Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions code/game/objects/items/robot/robot_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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]!"))
Expand Down
45 changes: 27 additions & 18 deletions code/game/objects/items/stunbaton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -193,14 +194,31 @@
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)

var/obj/item/bodypart/affecting = L.get_bodypart(user.zone_selected)
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)
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
Expand All @@ -219,16 +237,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))
Expand All @@ -246,6 +254,7 @@
force = 3
throwforce = 5
stunforce = 100
stamina_damage = 45
hitcost = 2000
throw_hit_chance = 10
slot_flags = ITEM_SLOT_BACK
Expand All @@ -263,4 +272,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
color = "#aeb08c" // super tactical