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
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
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 ))
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
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