-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Система постеров для революции #3021
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,14 @@ GLOBAL_DATUM_INIT(revs, /datum/antagonist/revolutionary, new) | |
rev_obj.target = player.mind | ||
rev_obj.explanation_text = "Assassinate, capture or convert [player.real_name], the [player.mind.assigned_role]." | ||
global_objectives += rev_obj | ||
|
||
/datum/antagonist/revolutionary/equip(mob/living/carbon/human/revolutionary) | ||
if(!..()) | ||
return 0 | ||
|
||
equip_poster(revolutionary) | ||
equip_poster(revolutionary) | ||
|
||
/datum/antagonist/revolutionary/proc/equip_poster(mob/living/carbon/human/player) | ||
var/obj/item/weapon/contraband/poster/revolutionary/P = new(get_turf(player)) | ||
player.equip_to_storage(P) | ||
Comment on lines
+48
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Давай это пока спилим, ибо сами постеры по себе бесполезные сейчас. Думаю их пока не стоит вводить в игру. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
var/global/global_uid = 0 | ||
var/uid | ||
var/area_flags | ||
var/score = 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Лучше переименовать в |
||
|
||
/area/New() | ||
icon_state = "" | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,3 +1,5 @@ | ||||||||||||
GLOBAL_LIST_EMPTY(revolution_posters) | ||||||||||||
|
||||||||||||
/datum/game_mode/revolution | ||||||||||||
name = "Revolution" | ||||||||||||
config_tag = "revolution" | ||||||||||||
|
@@ -10,3 +12,20 @@ | |||||||||||
shuttle_delay = 2 | ||||||||||||
antag_tags = list(MODE_REVOLUTIONARY) | ||||||||||||
require_all_templates = 1 | ||||||||||||
|
||||||||||||
var/last_poster_update | ||||||||||||
var/points = 0 | ||||||||||||
|
||||||||||||
/datum/game_mode/revolution/post_setup() | ||||||||||||
..() | ||||||||||||
last_poster_update = round_duration_in_ticks + 1 MINUTES | ||||||||||||
|
||||||||||||
|
||||||||||||
/datum/game_mode/revolution/process() | ||||||||||||
if(last_poster_update <= round_duration_in_ticks) | ||||||||||||
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
for(var/obj/structure/P in GLOB.revolution_posters) | ||||||||||||
if(P && (P.z in GLOB.using_map.station_levels)) | ||||||||||||
points += get_area(P.loc).score | ||||||||||||
else | ||||||||||||
GLOB.revolution_posters -= P | ||||||||||||
last_poster_update = round_duration_in_ticks + 1 MINUTES | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ты здесь складываешь ТИКИ и децисекунды. Нельзя так делать) Нужно либо все считать в тиках, либо все в децисекундах. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
desc = "The poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface." | ||
icon_state = "rolled_poster" | ||
var/serial_number = 0 | ||
var/revolution = FALSE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Здесь лучше переменную назвать не "революция", а "революционный", т.е. |
||
|
||
|
||
/obj/item/weapon/contraband/poster/New(turf/loc, given_serial = 0) | ||
|
@@ -57,8 +58,7 @@ | |
|
||
to_chat(user, "<span class='notice'>You start placing the poster on the wall...</span>")//Looks like it's uncluttered enough. Place the poster. | ||
|
||
|
||
var/obj/structure/sign/poster/P = new(user.loc, placement_dir=get_dir(user, W), serial=serial_number) | ||
var/obj/structure/sign/poster/P = new(user.loc, placement_dir=get_dir(user, W), serial=serial_number, revolution=revolution) | ||
|
||
flick("poster_being_set", P) | ||
//playsound(W, 'sound/items/poster_being_created.ogg', 100, 1) //why the hell does placing a poster make printer sounds? | ||
|
@@ -75,6 +75,33 @@ | |
|
||
qdel(oldsrc) //delete it now to cut down on sanity checks afterwards. Agouri's code supports rerolling it anyway | ||
|
||
//REV POSTER | ||
/obj/item/weapon/contraband/poster/revolutionary | ||
name = "rolled-up poster - unknown number" | ||
desc = "This poster has strange message." | ||
revolution = TRUE | ||
|
||
/obj/item/weapon/contraband/poster/revolutionary/New(turf/loc) | ||
..(loc, serial_number=666) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. В There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Зачем вообще New переопределять здесь? Кажется это лишнее. |
||
|
||
/obj/item/weapon/contraband/poster/revolutionary/afterattack(atom/A, mob/user, adjacent, clickparams) | ||
var/area/B = get_area(user.loc) | ||
if(istype(B, /area/space)) | ||
to_chat(user, SPAN_WARNING("You can't place this poster in space.")) | ||
return | ||
|
||
if(!(user.z in GLOB.using_map.station_levels)) | ||
to_chat(user, SPAN_WARNING("You can place this poster only on station levels,")) | ||
return | ||
Comment on lines
+89
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Почему? Пусть висят где угодно, но считать будем только размещенные в правильных зонах, не? Это как-то нелогично, что кусок бумаги мы повесить не можем где хотим. |
||
|
||
for(var/obj/structure/P in GLOB.revolution_posters) | ||
if(istype(B, get_area(P.loc))) | ||
to_chat(user, SPAN_WARNING("A poster has been placed in this area already.")) | ||
return | ||
Comment on lines
+97
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Тоже какие-то странные механоограничения вылазят. Пусть обклеивают отсек полностью, чо такого то? Просто когда считаем - надо собирать некий список зон, в который каждая зона может попасть ровно один раз. А потом по этому списку считаем очки. Так логичнее будет, тебе так не кажется? |
||
|
||
..(A, user, adjacent, clickparams) | ||
|
||
|
||
//############################## THE ACTUAL DECALS ########################### | ||
|
||
/obj/structure/sign/poster | ||
|
@@ -85,16 +112,22 @@ | |
var/serial_number //Will hold the value of src.loc if nobody initialises it | ||
var/poster_type //So mappers can specify a desired poster | ||
var/ruined = 0 | ||
var/revolutionary = FALSE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. О, а здесь нормальная переменная :) |
||
|
||
/obj/structure/sign/poster/New(newloc, placement_dir=null, serial=null) | ||
/obj/structure/sign/poster/New(newloc, placement_dir=null, serial=null, revolution=FALSE) | ||
..(newloc) | ||
|
||
if(!serial) | ||
serial = rand(1, poster_designs.len) //use a random serial if none is given | ||
if(revolution) | ||
revolutionary = TRUE | ||
set_revolution_poster() | ||
GLOB.revolution_posters += src | ||
else | ||
if(!serial) | ||
serial = rand(1, poster_designs.len) //use a random serial if none is given | ||
|
||
serial_number = serial | ||
var/datum/poster/design = poster_designs[serial_number] | ||
set_poster(design) | ||
serial_number = serial | ||
var/datum/poster/design = poster_designs[serial_number] | ||
set_poster(design) | ||
|
||
switch (placement_dir) | ||
if (NORTH) | ||
|
@@ -122,6 +155,11 @@ | |
desc = "[initial(desc)] [design.desc]" | ||
icon_state = design.icon_state // poster[serial_number] | ||
|
||
/obj/structure/sign/poster/proc/set_revolution_poster() | ||
SetName("[initial(name)] - Break our Chains!") | ||
desc = "[initial(desc)] It's time to end golden age of Nanotrasen!" | ||
icon_state = "revposter" | ||
|
||
/obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) | ||
if(isWirecutter(W)) | ||
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1) | ||
|
@@ -131,6 +169,8 @@ | |
else | ||
to_chat(user, "<span class='notice'>You carefully remove the poster from the wall.</span>") | ||
roll_and_drop(user.loc) | ||
if(revolutionary) | ||
GLOB.revolution_posters -= src | ||
Comment on lines
+172
to
+173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Это лучше запихать в roll_and_drop |
||
return | ||
|
||
|
||
|
@@ -152,6 +192,10 @@ | |
desc = "You can't make out anything from the poster's original print. It's ruined." | ||
add_fingerprint(user) | ||
|
||
if(revolutionary) | ||
GLOB.revolution_posters -= src | ||
return | ||
|
||
/obj/structure/sign/poster/proc/roll_and_drop(turf/newloc) | ||
var/obj/item/weapon/contraband/poster/P = new(src, serial_number) | ||
P.loc = newloc | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нафиг это нужно?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно для отображения в списке глобальных переменных, который находится в вкладке Debug. Делал для тестов, оставил на всякий случай.