From 41a8b8490c9b85b4010dc7615c27eded9c525dcd Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Tue, 23 Jun 2020 12:56:34 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A6=20Use=20COOLDOWN=20defines=20for?= =?UTF-8?q?=20paramedic=20penlights?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses the new COOLDOWN_ defines for the penlight's cooldown, which functions exactly the same as the `world.time` code, but is slightly cleaner and less prone to mistakes. --- code/datums/wounds/burns.dm | 4 ++-- code/game/objects/items/devices/flashlight.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/datums/wounds/burns.dm b/code/datums/wounds/burns.dm index feff9bf4de4..a09cf2fb7b0 100644 --- a/code/datums/wounds/burns.dm +++ b/code/datums/wounds/burns.dm @@ -249,7 +249,7 @@ /// Paramedic UV penlights /datum/wound/burn/proc/uv(obj/item/flashlight/pen/paramedic/I, mob/user) - if(I.uv_cooldown > world.time) + if(!COOLDOWN_FINISHED(I, uv_cooldown)) to_chat(user, "[I] is still recharging!") return if(infestation <= 0 || infestation < sanitization) @@ -258,7 +258,7 @@ user.visible_message("[user] flashes the burns on [victim]'s [limb] with [I].", "You flash the burns on [user == victim ? "your" : "[victim]'s"] [limb.name] with [I].", vision_distance=COMBAT_MESSAGE_RANGE) sanitization += I.uv_power - I.uv_cooldown = world.time + I.uv_cooldown_length + COOLDOWN_START(I, uv_cooldown, I.uv_cooldown_length) /datum/wound/burn/treat(obj/item/I, mob/user) if(istype(I, /obj/item/stack/medical/gauze)) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 7130eb705ce..9c3f690abd2 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -188,7 +188,7 @@ desc = "A high-powered UV penlight intended to help stave off infection in the field on serious burned patients. Probably really bad to look into." icon_state = "penlight_surgical" /// Our current UV cooldown - var/uv_cooldown = 0 + COOLDOWN_DECLARE(uv_cooldown) /// How long between UV fryings var/uv_cooldown_length = 1 MINUTES /// How much sanitization to apply to the burn wound