From ad59c6eda7f9a5cef9f03df3ea9f27bc3b9edf85 Mon Sep 17 00:00:00 2001 From: nmajask Date: Sat, 6 Nov 2021 02:14:33 -0400 Subject: [PATCH 1/4] Reworks batlong to use stamina damage Lots of changes --- code/game/objects/items/stunbaton.dm | 52 ++++++++++++++++++---------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 70e485cf2808..c3bbc749e71e 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -17,6 +17,7 @@ var/cooldown = 2 SECONDS var/stunforce = 100 + var/stamina_damage = 70 var/status = 0 var/obj/item/stock_parts/cell/cell var/hitcost = 1000 @@ -180,11 +181,14 @@ /obj/item/melee/baton/proc/baton_stun(mob/living/L, mob/user) + var/effective_stamina_damage = stamina_damage + if(ishuman(L)) var/mob/living/carbon/human/H = L if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) //No message; check_shields() handles that playsound(L, 'sound/weapons/genhit.ogg', 50, 1) return 0 + effective_stamina_damage *= 1 - H.getarmor(type = "energy") * 0.02 if(iscyborg(loc)) var/mob/living/silicon/robot/R = loc if(!R || !R.cell || !R.cell.use(hitcost)) @@ -193,14 +197,35 @@ if(!deductcharge(hitcost)) return 0 - /// After a target is hit, we do a chunk of stamina damage, along with other effects. - /// After a period of time, we then check to see what stun duration we give. - L.Jitter(20) - L.confused = max(8, L.confused) - L.apply_effect(EFFECT_STUTTER, stunforce) - L.adjustStaminaLoss(60) + var/trait_check = HAS_TRAIT(L, TRAIT_STUNRESISTANCE) + + if(trait_check) + effective_stamina_damage *= 0.1 + + if(effective_stamina_damage < 0) + effective_stamina_damage = 0 + + L.adjustStaminaLoss(effective_stamina_damage) SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK) - addtimer(CALLBACK(src, .proc/apply_stun_effect_end, L), 2.5 SECONDS) + var/current_stamina_damage = L.getStaminaLoss() + + if(current_stamina_damage >= 90) + if(!L.IsParalyzed()) + to_chat(L, span_warning("You muscles seize, making you collapse[trait_check ? ", but your body quickly recovers..." : "!"]")) + if(trait_check) + L.Paralyze(stunforce * 0.1) + else + L.Paralyze(stunforce) + L.Jitter(20) + L.confused = max(8, L.confused) + L.apply_effect(EFFECT_STUTTER, stunforce) + else if(current_stamina_damage > 70) + L.Jitter(10) + L.confused = max(8, L.confused) + L.apply_effect(EFFECT_STUTTER, stunforce) + else if(current_stamina_damage >= 20) + L.Jitter(5) + L.apply_effect(EFFECT_STUTTER, stunforce) if(user) L.lastattacker = user.real_name @@ -219,16 +244,6 @@ return 1 -/// After the initial stun period, we check to see if the target needs to have the stun applied. -/obj/item/melee/baton/proc/apply_stun_effect_end(mob/living/target) - var/trait_check = HAS_TRAIT(target, TRAIT_STUNRESISTANCE) //var since we check it in out to_chat as well as determine stun duration - if(!target.IsParalyzed()) - to_chat(target, span_warning("You muscles seize, making you collapse[trait_check ? ", but your body quickly recovers..." : "!"]")) - if(trait_check) - target.Paralyze(stunforce * 0.1) - else - target.Paralyze(stunforce) - /obj/item/melee/baton/emp_act(severity) . = ..() if (!(. & EMP_PROTECT_SELF)) @@ -246,6 +261,7 @@ force = 3 throwforce = 5 stunforce = 100 + stamina_damage = 45 hitcost = 2000 throw_hit_chance = 10 slot_flags = ITEM_SLOT_BACK @@ -263,4 +279,4 @@ name = "tactical stunprod" desc = "A cost-effective, mass-produced, tactical stun prod." preload_cell_type = /obj/item/stock_parts/cell/high/plus // comes with a cell - color = "#aeb08c" // super tactical \ No newline at end of file + color = "#aeb08c" // super tactical From b5df8e28f602557e70076cf9db74c76bf19e1aa5 Mon Sep 17 00:00:00 2001 From: nmajask Date: Sun, 7 Nov 2021 00:41:38 -0400 Subject: [PATCH 2/4] Does the thing theos wanted Now uses the dedicated procs --- code/game/objects/items/stunbaton.dm | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index c3bbc749e71e..5ac8d1cf8359 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -181,14 +181,11 @@ /obj/item/melee/baton/proc/baton_stun(mob/living/L, mob/user) - var/effective_stamina_damage = stamina_damage - if(ishuman(L)) var/mob/living/carbon/human/H = L if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) //No message; check_shields() handles that playsound(L, 'sound/weapons/genhit.ogg', 50, 1) return 0 - effective_stamina_damage *= 1 - H.getarmor(type = "energy") * 0.02 if(iscyborg(loc)) var/mob/living/silicon/robot/R = loc if(!R || !R.cell || !R.cell.use(hitcost)) @@ -199,13 +196,9 @@ var/trait_check = HAS_TRAIT(L, TRAIT_STUNRESISTANCE) - if(trait_check) - effective_stamina_damage *= 0.1 - - if(effective_stamina_damage < 0) - effective_stamina_damage = 0 - - L.adjustStaminaLoss(effective_stamina_damage) + var/obj/item/bodypart/affecting = L.get_bodypart(user.zone_selected) + var/armor_block = L.run_armor_check(affecting, "energy") * 2 + L.apply_damage(stamina_damage, STAMINA, user.zone_selected, armor_block) SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK) var/current_stamina_damage = L.getStaminaLoss() From 1ea07b9eb526cb169486a1c951e6216834cabc3c Mon Sep 17 00:00:00 2001 From: nmajask Date: Sun, 7 Nov 2021 00:55:11 -0400 Subject: [PATCH 3/4] Removes the multiplication of the armor_block This is what theos wanted, so I hope it works --- code/game/objects/items/stunbaton.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 5ac8d1cf8359..2e9afc885299 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -197,7 +197,7 @@ var/trait_check = HAS_TRAIT(L, TRAIT_STUNRESISTANCE) var/obj/item/bodypart/affecting = L.get_bodypart(user.zone_selected) - var/armor_block = L.run_armor_check(affecting, "energy") * 2 + var/armor_block = L.run_armor_check(affecting, "energy") L.apply_damage(stamina_damage, STAMINA, user.zone_selected, armor_block) SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK) var/current_stamina_damage = L.getStaminaLoss() From 6acf2ab7403f1bab7019d872f616e3d04984e23b Mon Sep 17 00:00:00 2001 From: nmajask Date: Fri, 3 Dec 2021 02:04:11 -0500 Subject: [PATCH 4/4] Applied changes to borg stun arms It works around the same as how current stun arms work, they just now worry about armor and anti-stun stuff. --- code/game/objects/items/robot/robot_items.dm | 30 ++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 50a423816ca6..cfea715927a4 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -9,6 +9,8 @@ name = "electrically-charged arm" icon_state = "elecarm" var/charge_cost = 750 + var/stunforce = 100 + var/stamina_damage = 90 /obj/item/borg/stun/attack(mob/living/M, mob/living/user) if(ishuman(M)) @@ -22,8 +24,32 @@ return user.do_attack_animation(M) - M.Paralyze(100) - M.apply_effect(EFFECT_STUTTER, 5) + + var/trait_check = HAS_TRAIT(M, TRAIT_STUNRESISTANCE) + + var/obj/item/bodypart/affecting = M.get_bodypart(user.zone_selected) + var/armor_block = M.run_armor_check(affecting, "energy") + M.apply_damage(stamina_damage, STAMINA, user.zone_selected, armor_block) + SEND_SIGNAL(M, COMSIG_LIVING_MINOR_SHOCK) + var/current_stamina_damage = M.getStaminaLoss() + + if(current_stamina_damage >= 90) + if(!M.IsParalyzed()) + to_chat(M, span_warning("You muscles seize, making you collapse[trait_check ? ", but your body quickly recovers..." : "!"]")) + if(trait_check) + M.Paralyze(stunforce * 0.1) + else + M.Paralyze(stunforce) + M.Jitter(20) + M.confused = max(8, M.confused) + M.apply_effect(EFFECT_STUTTER, stunforce) + else if(current_stamina_damage > 70) + M.Jitter(10) + M.confused = max(8, M.confused) + M.apply_effect(EFFECT_STUTTER, stunforce) + else if(current_stamina_damage >= 20) + M.Jitter(5) + M.apply_effect(EFFECT_STUTTER, stunforce) M.visible_message(span_danger("[user] has prodded [M] with [src]!"), \ span_userdanger("[user] has prodded you with [src]!"))