From 7d867fa4470ec5d71fa46a5d263caa263ab50ba9 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 19 Jul 2023 15:10:36 +0100 Subject: [PATCH] changes timers --- code/game/objects/items/explosives/plastic.dm | 8 ++++++-- code/modules/cm_preds/yaut_shield.dm | 6 +++--- code/modules/cm_preds/yaut_weapons.dm | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/explosives/plastic.dm b/code/game/objects/items/explosives/plastic.dm index 179245e29ebc..5dcd6df0c250 100644 --- a/code/game/objects/items/explosives/plastic.dm +++ b/code/game/objects/items/explosives/plastic.dm @@ -340,7 +340,9 @@ /obj/item/explosive/plastic/breaching_charge/handle_explosion(turf/target_turf, dir, cause_data) var/explosion_target = get_step(target_turf, dir) create_shrapnel(explosion_target, shrapnel_volume, dir, angle,/datum/ammo/bullet/shrapnel/metal, cause_data) - sleep(1)// prevents explosion from eating shrapnel + addtimer(CALLBACK(src, PROC_REF(trigger_explosion), target_turf, dir, cause_data), 1 SECONDS) + +/obj/item/explosive/plastic/breaching_charge/proc/trigger_explosion(turf/target_turf, dir, cause_data) cell_explosion(target_turf, 60, 60, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, dir, cause_data) qdel(src) @@ -367,6 +369,8 @@ /obj/item/explosive/plastic/breaching_charge/plasma/handle_explosion(turf/target_turf, dir, cause_data) var/explosion_target = get_step(target_turf, dir) create_shrapnel(explosion_target, shrapnel_volume, dir, angle,/datum/ammo/bullet/shrapnel/plasma, cause_data) - sleep(1)// prevents explosion from eating shrapnel + addtimer(CALLBACK(src, PROC_REF(trigger_explosion), target_turf, dir, cause_data), 1 SECONDS) + +/obj/item/explosive/plastic/breaching_charge/plasma/trigger_explosion(turf/target_turf, dir, cause_data) cell_explosion(target_turf, 90, 90, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, dir, cause_data) qdel(src) diff --git a/code/modules/cm_preds/yaut_shield.dm b/code/modules/cm_preds/yaut_shield.dm index f1bf8cb0f7a1..7b84f935f4c5 100644 --- a/code/modules/cm_preds/yaut_shield.dm +++ b/code/modules/cm_preds/yaut_shield.dm @@ -45,10 +45,10 @@ M.apply_effect(3, DAZE) M.apply_effect(5, SLOW) -/obj/item/weapon/shield/riot/yautja/attackby(obj/item/object, mob/user) +/obj/item/weapon/shield/riot/yautja/attackby(obj/item/attacking_item, mob/user) if(cooldown < world.time - 25) - if(istype(object, /obj/item/weapon) && (object.flags_item & ITEM_PREDATOR)) - user.visible_message(SPAN_WARNING("[user] bashes [src] with [object]!")) + if(istype(attacking_item, /obj/item/weapon) && (attacking_item.flags_item & ITEM_PREDATOR)) + user.visible_message(SPAN_WARNING("[user] bashes [src] with [attacking_item]!")) playsound(user.loc, 'sound/effects/shieldbash.ogg', 25, 1) cooldown = world.time else diff --git a/code/modules/cm_preds/yaut_weapons.dm b/code/modules/cm_preds/yaut_weapons.dm index c6c0946f6710..eb00ab7aba96 100644 --- a/code/modules/cm_preds/yaut_weapons.dm +++ b/code/modules/cm_preds/yaut_weapons.dm @@ -995,7 +995,7 @@ var/obj/item/projectile/projectile = create_bullet(ammo, initial(name)) projectile.SetLuminosity(1) in_chamber = projectile - charge_time-- + charge_time -= shot_cost return in_chamber /obj/item/weapon/gun/energy/yautja/plasmapistol/has_ammunition() @@ -1008,7 +1008,7 @@ /obj/item/weapon/gun/energy/yautja/plasmapistol/delete_bullet(obj/item/projectile/projectile_to_fire, refund = 0) qdel(projectile_to_fire) if(refund) - charge_time *= 2 + charge_time += shot_cost log_debug("Plasma Pistol refunded shot.") return TRUE