Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 7d00ff2

Browse files
committed
TGS Test merge #12608
2 parents 176472c + 47e5a26 commit 7d00ff2

2 files changed

Lines changed: 55 additions & 20 deletions

File tree

code/game/objects/items/robot/robot_items.dm

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
name = "electrically-charged arm"
1010
icon_state = "elecarm"
1111
var/charge_cost = 750
12+
var/stunforce = 100
13+
var/stamina_damage = 90
1214

1315
/obj/item/borg/stun/attack(mob/living/M, mob/living/user)
1416
if(ishuman(M))
@@ -22,8 +24,32 @@
2224
return
2325

2426
user.do_attack_animation(M)
25-
M.Paralyze(100)
26-
M.apply_effect(EFFECT_STUTTER, 5)
27+
28+
var/trait_check = HAS_TRAIT(M, TRAIT_STUNRESISTANCE)
29+
30+
var/obj/item/bodypart/affecting = M.get_bodypart(user.zone_selected)
31+
var/armor_block = M.run_armor_check(affecting, "energy")
32+
M.apply_damage(stamina_damage, STAMINA, user.zone_selected, armor_block)
33+
SEND_SIGNAL(M, COMSIG_LIVING_MINOR_SHOCK)
34+
var/current_stamina_damage = M.getStaminaLoss()
35+
36+
if(current_stamina_damage >= 90)
37+
if(!M.IsParalyzed())
38+
to_chat(M, span_warning("You muscles seize, making you collapse[trait_check ? ", but your body quickly recovers..." : "!"]"))
39+
if(trait_check)
40+
M.Paralyze(stunforce * 0.1)
41+
else
42+
M.Paralyze(stunforce)
43+
M.Jitter(20)
44+
M.confused = max(8, M.confused)
45+
M.apply_effect(EFFECT_STUTTER, stunforce)
46+
else if(current_stamina_damage > 70)
47+
M.Jitter(10)
48+
M.confused = max(8, M.confused)
49+
M.apply_effect(EFFECT_STUTTER, stunforce)
50+
else if(current_stamina_damage >= 20)
51+
M.Jitter(5)
52+
M.apply_effect(EFFECT_STUTTER, stunforce)
2753

2854
M.visible_message(span_danger("[user] has prodded [M] with [src]!"), \
2955
span_userdanger("[user] has prodded you with [src]!"))

code/game/objects/items/stunbaton.dm

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
var/cooldown = 2 SECONDS
1919
var/stunforce = 100
20+
var/stamina_damage = 70
2021
var/status = 0
2122
var/obj/item/stock_parts/cell/cell
2223
var/hitcost = 1000
@@ -193,14 +194,31 @@
193194
if(!deductcharge(hitcost))
194195
return 0
195196

196-
/// After a target is hit, we do a chunk of stamina damage, along with other effects.
197-
/// After a period of time, we then check to see what stun duration we give.
198-
L.Jitter(20)
199-
L.confused = max(8, L.confused)
200-
L.apply_effect(EFFECT_STUTTER, stunforce)
201-
L.adjustStaminaLoss(60)
197+
var/trait_check = HAS_TRAIT(L, TRAIT_STUNRESISTANCE)
198+
199+
var/obj/item/bodypart/affecting = L.get_bodypart(user.zone_selected)
200+
var/armor_block = L.run_armor_check(affecting, "energy")
201+
L.apply_damage(stamina_damage, STAMINA, user.zone_selected, armor_block)
202202
SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK)
203-
addtimer(CALLBACK(src, .proc/apply_stun_effect_end, L), 2.5 SECONDS)
203+
var/current_stamina_damage = L.getStaminaLoss()
204+
205+
if(current_stamina_damage >= 90)
206+
if(!L.IsParalyzed())
207+
to_chat(L, span_warning("You muscles seize, making you collapse[trait_check ? ", but your body quickly recovers..." : "!"]"))
208+
if(trait_check)
209+
L.Paralyze(stunforce * 0.1)
210+
else
211+
L.Paralyze(stunforce)
212+
L.Jitter(20)
213+
L.confused = max(8, L.confused)
214+
L.apply_effect(EFFECT_STUTTER, stunforce)
215+
else if(current_stamina_damage > 70)
216+
L.Jitter(10)
217+
L.confused = max(8, L.confused)
218+
L.apply_effect(EFFECT_STUTTER, stunforce)
219+
else if(current_stamina_damage >= 20)
220+
L.Jitter(5)
221+
L.apply_effect(EFFECT_STUTTER, stunforce)
204222

205223
if(user)
206224
L.lastattacker = user.real_name
@@ -219,16 +237,6 @@
219237

220238
return 1
221239

222-
/// After the initial stun period, we check to see if the target needs to have the stun applied.
223-
/obj/item/melee/baton/proc/apply_stun_effect_end(mob/living/target)
224-
var/trait_check = HAS_TRAIT(target, TRAIT_STUNRESISTANCE) //var since we check it in out to_chat as well as determine stun duration
225-
if(!target.IsParalyzed())
226-
to_chat(target, span_warning("You muscles seize, making you collapse[trait_check ? ", but your body quickly recovers..." : "!"]"))
227-
if(trait_check)
228-
target.Paralyze(stunforce * 0.1)
229-
else
230-
target.Paralyze(stunforce)
231-
232240
/obj/item/melee/baton/emp_act(severity)
233241
. = ..()
234242
if (!(. & EMP_PROTECT_SELF))
@@ -246,6 +254,7 @@
246254
force = 3
247255
throwforce = 5
248256
stunforce = 100
257+
stamina_damage = 45
249258
hitcost = 2000
250259
throw_hit_chance = 10
251260
slot_flags = ITEM_SLOT_BACK
@@ -263,4 +272,4 @@
263272
name = "tactical stunprod"
264273
desc = "A cost-effective, mass-produced, tactical stun prod."
265274
preload_cell_type = /obj/item/stock_parts/cell/high/plus // comes with a cell
266-
color = "#aeb08c" // super tactical
275+
color = "#aeb08c" // super tactical

0 commit comments

Comments
 (0)