Skip to content

Commit

Permalink
апдейт по ревью гахера 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dj-34 committed Dec 10, 2023
1 parent 16f0845 commit e6ad892
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions modular_ss220/sechailer/code/sechailer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ GLOBAL_LIST_EMPTY(sechailers)
/obj/item/clothing/mask/gas/sechailer
var/obj/item/radio/radio // For dispatch to work
var/dispatch_cooldown = 25 SECONDS
var/is_on_cooldown = FALSE
var/is_emped = FALSE
var/on_cooldown = FALSE
var/emped = FALSE
var/static/list/available_dispatch_messages = list(
"502 (Убийство)",
"101 (Сопротивление Аресту)",
Expand Down Expand Up @@ -53,18 +53,18 @@ GLOBAL_LIST_EMPTY(sechailers)

if(!message)
return
if(is_on_cooldown)
var/cooldown_info = "Ожидайте. Система оповещения "
if(is_emped)
if(on_cooldown)
var/list/cooldown_info = list("Ожидайте. Система оповещения ")
if(emped)
cooldown_info += "в защитном режиме, "
else
cooldown_info += "перезаряжается, "
// Cooldown not updating realtime, and i don't want to rewrite it just for the sake of it
cooldown_info += "примерное время восстановления: [dispatch_cooldown / 10] секунд."
to_chat(user, span_notice(cooldown_info))
to_chat(user, span_notice(cooldown_info.Join()))
return

is_on_cooldown = TRUE
on_cooldown = TRUE
addtimer(CALLBACK(src, PROC_REF(reboot)), dispatch_cooldown)
// This code if fucking hell, but it works as intended
for(var/atom/movable/hailer in GLOB.sechailers)
Expand All @@ -87,19 +87,19 @@ GLOBAL_LIST_EMPTY(sechailers)
playsound(hailer.loc, 'modular_ss220/sechailer/sound/radio_static.ogg', 30, TRUE)

/obj/item/clothing/mask/gas/sechailer/proc/reboot()
is_on_cooldown = FALSE
is_emped = FALSE
on_cooldown = FALSE
emped = FALSE

/obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, actiontype)
. = ..()
if(actiontype == /datum/action/item_action/dispatch)
dispatch(user)

/obj/item/clothing/mask/gas/sechailer/emp_act(severity)
if(is_on_cooldown)
if(on_cooldown)
return
is_on_cooldown = TRUE
is_emped = TRUE
on_cooldown = TRUE
emped = TRUE
addtimer(CALLBACK(src, PROC_REF(reboot)), dispatch_cooldown)
if(ishuman(loc))
var/mob/living/carbon/human/user = loc
Expand Down

0 comments on commit e6ad892

Please sign in to comment.