mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-20 18:47:20 +01:00
Merge pull request #7818 from Crazylemon64/item_stumbling
Item stumbling refactor
This commit is contained in:
@@ -930,7 +930,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
W.plane = initial(W.plane)
|
||||
|
||||
|
||||
/mob/living/carbon/proc/slip(var/description, var/stun, var/weaken, var/tilesSlipped, var/walkSafely, var/slipAny)
|
||||
/mob/living/carbon/proc/slip(description, stun, weaken, tilesSlipped, walkSafely, slipAny, slipVerb = "slip")
|
||||
if(flying || buckled || (walkSafely && m_intent == MOVE_INTENT_WALK))
|
||||
return 0
|
||||
if((lying) && (!(tilesSlipped)))
|
||||
@@ -944,10 +944,10 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
for(var/t = 0, t<=tilesSlipped, t++)
|
||||
spawn (t) step(src, src.dir)
|
||||
stop_pulling()
|
||||
to_chat(src, "<span class='notice'>You slipped on [description]!</span>")
|
||||
to_chat(src, "<span class='notice'>You [slipVerb]ped on [description]!</span>")
|
||||
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
|
||||
if(stun)
|
||||
Stun(stun)
|
||||
// Something something don't run with scissors
|
||||
Stun(stun)
|
||||
Weaken(weaken)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -330,6 +330,8 @@
|
||||
SetParalysis(max(paralysis, amount), updating, force)
|
||||
|
||||
/mob/living/SetParalysis(amount, updating = 1, force = 0)
|
||||
if((!!amount) == (!!paralysis)) // We're not changing from + to 0 or vice versa
|
||||
updating = FALSE
|
||||
if(status_flags & CANPARALYSE || force)
|
||||
paralysis = max(amount, 0)
|
||||
if(updating)
|
||||
@@ -358,9 +360,11 @@
|
||||
SetSleeping(max(sleeping, amount), updating, no_alert)
|
||||
|
||||
/mob/living/SetSleeping(amount, updating = 1, no_alert = FALSE)
|
||||
if((!!amount) == (!!sleeping)) // We're not changing from + to 0 or vice versa
|
||||
updating = FALSE
|
||||
sleeping = max(amount, 0)
|
||||
update_sleeping_effects(no_alert)
|
||||
if(updating)
|
||||
update_sleeping_effects(no_alert)
|
||||
update_stat()
|
||||
update_canmove()
|
||||
|
||||
@@ -410,6 +414,8 @@
|
||||
SetStunned(max(stunned, amount), updating, force)
|
||||
|
||||
/mob/living/SetStunned(amount, updating = 1, force = 0) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
|
||||
if((!!amount) == (!!stunned)) // We're not changing from + to 0 or vice versa
|
||||
updating = FALSE
|
||||
if(status_flags & CANSTUN || force)
|
||||
stunned = max(amount, 0)
|
||||
if(updating)
|
||||
@@ -440,6 +446,8 @@
|
||||
SetWeakened(max(weakened, amount), updating, force)
|
||||
|
||||
/mob/living/SetWeakened(amount, updating = 1, force = 0)
|
||||
if((!!amount) == (!!weakened)) // We're not changing from + to 0 or vice versa
|
||||
updating = FALSE
|
||||
if(status_flags & CANWEAKEN || force)
|
||||
weakened = max(amount, 0)
|
||||
if(updating)
|
||||
|
||||
Reference in New Issue
Block a user