mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 05:51:56 +01:00
Disarming Cost Fix (#16331)
This commit is contained in:
@@ -294,36 +294,37 @@
|
||||
src.help_up_offer = 0
|
||||
|
||||
if(I_DISARM)
|
||||
if(M.is_pacified())
|
||||
to_chat(M, SPAN_NOTICE("You don't want to risk hurting [src]!"))
|
||||
return FALSE
|
||||
|
||||
var/disarm_cost
|
||||
var/usesStamina
|
||||
var/obj/item/organ/internal/cell/cell = M.internal_organs_by_name[BP_CELL]
|
||||
var/obj/item/cell/potato
|
||||
if(cell)
|
||||
potato = cell.cell
|
||||
|
||||
if(M.max_stamina > 0)
|
||||
disarm_cost = M.max_stamina / 6
|
||||
if(M.is_drowsy())
|
||||
disarm_cost *= 1.25
|
||||
usesStamina = TRUE
|
||||
else if(M.max_stamina <= 0)
|
||||
if(M.isSynthetic())
|
||||
disarm_cost = potato.maxcharge / 24
|
||||
disarm_cost = M.max_nutrition / 6
|
||||
usesStamina = FALSE
|
||||
|
||||
if(usesStamina)
|
||||
if(M.stamina <= disarm_cost)
|
||||
to_chat(M, "<span class='danger'>You're too tired to disarm someone!</span>")
|
||||
if(isipc(M))
|
||||
disarm_cost = potato.maxcharge / 24
|
||||
if(potato.charge < disarm_cost)
|
||||
to_chat(M, SPAN_DANGER("You don't have enough charge to disarm someone!"))
|
||||
return FALSE
|
||||
potato.use(disarm_cost)
|
||||
else
|
||||
if(M.nutrition <= disarm_cost)
|
||||
to_chat(M, "<span class='danger'>You don't have enough power to disarm someone!</span>")
|
||||
return FALSE
|
||||
|
||||
if(M.is_pacified())
|
||||
to_chat(M, "<span class='notice'>You don't want to risk hurting [src]!</span>")
|
||||
return FALSE
|
||||
if(M.max_stamina > 0)
|
||||
disarm_cost = M.max_stamina / 6
|
||||
if(M.is_drowsy())
|
||||
disarm_cost *= 1.25
|
||||
if(M.stamina <= disarm_cost)
|
||||
to_chat(M, SPAN_DANGER("You're too tired to disarm someone!"))
|
||||
return FALSE
|
||||
M.stamina = Clamp(M.stamina - disarm_cost, 0, M.max_stamina) // attempting to knock something out of someone's hands, or pushing them over, is exhausting!
|
||||
else if(M.max_stamina <= 0)
|
||||
disarm_cost = M.max_nutrition / 6
|
||||
if(M.nutrition <= disarm_cost)
|
||||
to_chat(M, SPAN_DANGER("You don't have enough power to disarm someone!"))
|
||||
return FALSE
|
||||
M.nutrition = Clamp(M.nutrition - disarm_cost, 0, M.max_nutrition)
|
||||
|
||||
if(attacker_style && attacker_style.disarm_act(H, src))
|
||||
return TRUE
|
||||
@@ -334,14 +335,6 @@
|
||||
msg_admin_attack("[key_name(M)] disarmed [src.name] ([src.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[M.x];Y=[M.y];Z=[M.z]'>JMP</a>)",ckey=key_name(M),ckey_target=key_name(src))
|
||||
M.do_attack_animation(src)
|
||||
|
||||
if(usesStamina)
|
||||
M.stamina = M.stamina - disarm_cost //attempting to knock something out of someone's hands, or pushing them over, is exhausting!
|
||||
M.stamina = Clamp(M.stamina, 0, M.max_stamina)
|
||||
else if(M.isSynthetic())
|
||||
cell.use(disarm_cost)
|
||||
else
|
||||
M.nutrition = Clamp(M.nutrition - disarm_cost, 0, M.max_nutrition)
|
||||
|
||||
if(w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user