From 979bbef1a081362b8a3e6e17f4b29e08d5acc412 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 19 Jul 2023 14:30:26 +0100 Subject: [PATCH] changes --- code/modules/cm_preds/yaut_bracers.dm | 17 ++++++++--------- code/modules/power/apc.dm | 6 +++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index 889f34992270..c2cff7d323e7 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -35,8 +35,6 @@ var/charge_rate = 30 /// Cooldown on draining power from APC var/charge_cooldown = COOLDOWN_BRACER_CHARGE - /// Worldtime of last recharge - var/last_charge var/cloaked = 0 var/cloak_timer = 0 var/cloak_malfunction = 0 @@ -47,6 +45,7 @@ var/mob/living/carbon/human/owner //Pred spawned on, or thrall given to. var/obj/item/clothing/gloves/yautja/linked_bracer //Bracer linked to this one (thrall or mentor). + COOLDOWN_DECLARE(bracer_recharge) /obj/item/clothing/gloves/yautja/equipped(mob/user, slot) . = ..() @@ -95,13 +94,13 @@ human_holder.update_power_display(perc_charge) //Non-Yautja have a chance to get stunned with each power drain - if(cloaked) - if(!HAS_TRAIT(human_holder, TRAIT_YAUTJA_TECH) && !human_holder.hunter_data.thralled) - if(prob(15)) - decloak(human_holder) - shock_user(human_holder) - if(human_holder.stat == DEAD) - decloak(human_holder, TRUE) + if(!cloaked) + return + if(human_holder.stat == DEAD) + decloak(human_holder, TRUE) + if(!HAS_TRAIT(human_holder, TRAIT_YAUTJA_TECH) && !human_holder.hunter_data.thralled && prob(15)) + decloak(human_holder) + shock_user(human_holder) /// handles decloaking only on HUNTER gloves /obj/item/clothing/gloves/yautja/proc/decloak() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 0a33e4bd1f89..b10f1481d37c 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -841,8 +841,8 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( if(istype(bracer)) if(grabber.action_busy) return FALSE - if(bracer.last_charge > world.time) - to_chat(user, SPAN_WARNING("It is too soon for [bracer.name] to siphon power again.")) + if(!COOLDOWN_FINISHED(bracer, bracer_recharge)) + to_chat(user, SPAN_WARNING("It is too soon for [bracer.name] to siphon power again. Wait [COOLDOWN_SECONDSLEFT(bracer, bracer_recharge)] seconds.")) return FALSE to_chat(user, SPAN_NOTICE("You rest your bracer against the APC interface and begin to siphon off some of the stored energy.")) if(!do_after(grabber, 20, INTERRUPT_ALL, BUSY_ICON_HOSTILE)) @@ -869,7 +869,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( return FALSE playsound(src.loc, 'sound/effects/sparks2.ogg', 25, 1) bracer.charge += charge_to_use - bracer.last_charge = (world.time + bracer.charge_cooldown) + COOLDOWN_START(bracer, bracer_recharge, bracer.charge_cooldown) to_chat(grabber, SPAN_YAUTJABOLD("[icon2html(bracer)] \The [bracer] beep: Power siphon complete. Charge at [bracer.charge]/[bracer.charge_max].")) if(bracer.notification_sound) playsound(bracer.loc, 'sound/items/pred_bracer.ogg', 75, 1)