Modsuit flashlights are now properly extinguished (#22557)

* pREVE

* No more force
This commit is contained in:
Luc
2023-10-01 09:25:58 -04:00
committed by GitHub
parent 792ad7b904
commit f35ac06d66
2 changed files with 20 additions and 0 deletions
+5
View File
@@ -744,3 +744,8 @@
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.regenerate_icons()
/obj/item/mod/control/extinguish_light(force)
. = ..()
for(var/obj/item/mod/module/module as anything in modules)
module.extinguish_light(force)
@@ -223,11 +223,19 @@
var/min_range = 2
/// Maximum range we can set.
var/max_range = 5
/// The cooldown before we can re-activate this after having it forcefully extinguished
COOLDOWN_DECLARE(activation_cooldown)
/obj/item/mod/module/flashlight/on_activation()
if(!COOLDOWN_FINISHED(src, activation_cooldown))
to_chat(mod.wearer, "<span class='warning'>[src] isn't ready after being shut down!</span>")
return
. = ..()
if(!.)
return
COOLDOWN_RESET(src, activation_cooldown)
active_power_cost = base_power * mod_light_range
mod.set_light(mod_light_range, mod_light_power, light_color)
@@ -263,6 +271,13 @@
mod_color_overide = light_color
on_deactivation()
/obj/item/mod/module/flashlight/extinguish_light(force)
. = ..()
on_deactivation(FALSE)
COOLDOWN_START(src, activation_cooldown, 20 SECONDS)
to_chat(mod.wearer, "<span class='warning'>Your [name] shuts off!</span>")
///Dispenser - Dispenses an item after a time passes.
/obj/item/mod/module/dispenser
name = "MOD burger dispenser module"