270 lines
8.1 KiB
Plaintext
270 lines
8.1 KiB
Plaintext
|
|
//Here are the procs used to modify status effects of a mob.
|
|
//The effects include: stun, knockdown, unconscious, sleeping, resting, jitteriness, dizziness, ear damage,
|
|
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
|
|
|
|
#define STUN_TIME_MULTIPLIER 0.05 //temporary; multiplies input stun times by this, will be removed once stuns are status effects
|
|
|
|
/////////////////////////////////// STUN ////////////////////////////////////
|
|
|
|
/mob/proc/Stun(amount, updating = 1, ignore_canstun = 0)
|
|
if(status_flags & CANSTUN || ignore_canstun)
|
|
stun = max(max(stun,amount * STUN_TIME_MULTIPLIER),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
|
|
if(updating)
|
|
update_canmove()
|
|
return TRUE
|
|
|
|
/mob/proc/SetStun(amount, updating = 1, ignore_canstun = 0) //if you REALLY need to set stun to a set amount without the whole "can't go below current stun"
|
|
if(status_flags & CANSTUN || ignore_canstun)
|
|
stun = max(amount * STUN_TIME_MULTIPLIER,0)
|
|
if(updating)
|
|
update_canmove()
|
|
return TRUE
|
|
|
|
/mob/proc/AdjustStun(amount, updating = 1, ignore_canstun = 0)
|
|
if(status_flags & CANSTUN || ignore_canstun)
|
|
stun = max(stun + (amount * STUN_TIME_MULTIPLIER),0)
|
|
if(updating)
|
|
update_canmove()
|
|
return TRUE
|
|
|
|
/////////////////////////////////// KNOCKDOWN ////////////////////////////////////
|
|
|
|
/mob/proc/Knockdown(amount, updating = 1, ignore_canknockdown = 0)
|
|
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown)
|
|
knockdown = max(max(knockdown,amount * STUN_TIME_MULTIPLIER),0)
|
|
if(updating)
|
|
update_canmove() //updates lying, canmove and icons
|
|
return TRUE
|
|
|
|
/mob/proc/SetKnockdown(amount, updating = 1, ignore_canknockdown = 0)
|
|
if(status_flags & CANKNOCKDOWN || ignore_canknockdown)
|
|
knockdown = max(amount * STUN_TIME_MULTIPLIER,0)
|
|
if(updating)
|
|
update_canmove() //updates lying, canmove and icons
|
|
return TRUE
|
|
|
|
/mob/proc/AdjustKnockdown(amount, updating = 1, ignore_canknockdown = 0)
|
|
if((status_flags & CANKNOCKDOWN) || ignore_canknockdown)
|
|
knockdown = max(knockdown + (amount * STUN_TIME_MULTIPLIER) ,0)
|
|
if(updating)
|
|
update_canmove() //updates lying, canmove and icons
|
|
return TRUE
|
|
|
|
/////////////////////////////////// UNCONSCIOUS ////////////////////////////////////
|
|
|
|
/mob/proc/Unconscious(amount, updating = TRUE, ignore_canunconscious = FALSE)
|
|
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious)
|
|
var/old_unconscious = unconscious
|
|
unconscious = max(max(unconscious,amount * STUN_TIME_MULTIPLIER),0)
|
|
if((!old_unconscious && unconscious) || (old_unconscious && !unconscious))
|
|
if(updating)
|
|
update_stat()
|
|
return TRUE
|
|
|
|
/mob/proc/SetUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE)
|
|
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious)
|
|
var/old_unconscious = unconscious
|
|
unconscious = max(amount * STUN_TIME_MULTIPLIER,0)
|
|
if((!old_unconscious && unconscious) || (old_unconscious && !unconscious))
|
|
if(updating)
|
|
update_stat()
|
|
return TRUE
|
|
|
|
/mob/proc/AdjustUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE)
|
|
if(status_flags & CANUNCONSCIOUS || ignore_canunconscious)
|
|
var/old_unconscious = unconscious
|
|
unconscious = max(unconscious + (amount * STUN_TIME_MULTIPLIER) ,0)
|
|
if((!old_unconscious && unconscious) || (old_unconscious && !unconscious))
|
|
if(updating)
|
|
update_stat()
|
|
return TRUE
|
|
|
|
/////////////////////////////////// SLEEPING ////////////////////////////////////
|
|
|
|
/mob/proc/Sleeping(amount, updating = TRUE, no_alert = FALSE)
|
|
var/old_sleeping = sleeping
|
|
sleeping = max(max(sleeping,amount * STUN_TIME_MULTIPLIER),0)
|
|
if(!old_sleeping && sleeping)
|
|
if(!no_alert)
|
|
throw_alert("asleep", /obj/screen/alert/asleep)
|
|
if(updating)
|
|
update_stat()
|
|
else if(old_sleeping && !sleeping)
|
|
clear_alert("asleep")
|
|
if(updating)
|
|
update_stat()
|
|
|
|
/mob/proc/SetSleeping(amount, updating = 1, no_alert = FALSE)
|
|
var/old_sleeping = sleeping
|
|
sleeping = max(amount * STUN_TIME_MULTIPLIER,0)
|
|
if(!old_sleeping && sleeping)
|
|
if(!no_alert)
|
|
throw_alert("asleep", /obj/screen/alert/asleep)
|
|
if(updating)
|
|
update_stat()
|
|
else if(old_sleeping && !sleeping)
|
|
clear_alert("asleep")
|
|
if(updating)
|
|
update_stat()
|
|
|
|
/mob/proc/AdjustSleeping(amount, updating = 1, no_alert = FALSE)
|
|
var/old_sleeping = sleeping
|
|
sleeping = max(sleeping + (amount * STUN_TIME_MULTIPLIER) ,0)
|
|
if(!old_sleeping && sleeping)
|
|
if(!no_alert)
|
|
throw_alert("asleep", /obj/screen/alert/asleep)
|
|
if(updating)
|
|
update_stat()
|
|
else if(old_sleeping && !sleeping)
|
|
clear_alert("asleep")
|
|
if(updating)
|
|
update_stat()
|
|
|
|
/////////////////////////////////// RESTING ////////////////////////////////////
|
|
|
|
/mob/proc/Resting(amount)
|
|
resting = max(max(resting,amount),0)
|
|
update_canmove()
|
|
|
|
/mob/proc/SetResting(amount)
|
|
resting = max(amount,0)
|
|
update_canmove()
|
|
|
|
/mob/proc/AdjustResting(amount)
|
|
resting = max(resting + amount,0)
|
|
update_canmove()
|
|
|
|
/////////////////////////////////// JITTERINESS ////////////////////////////////////
|
|
|
|
/mob/proc/Jitter(amount)
|
|
jitteriness = max(jitteriness,amount,0)
|
|
|
|
/////////////////////////////////// DIZZINESS ////////////////////////////////////
|
|
|
|
/mob/proc/Dizzy(amount)
|
|
dizziness = max(dizziness,amount,0)
|
|
|
|
/////////////////////////////////// EYE DAMAGE ////////////////////////////////////
|
|
|
|
/mob/proc/damage_eyes(amount)
|
|
return
|
|
|
|
/mob/proc/adjust_eye_damage(amount)
|
|
return
|
|
|
|
/mob/proc/set_eye_damage(amount)
|
|
return
|
|
|
|
/////////////////////////////////// EYE_BLIND ////////////////////////////////////
|
|
|
|
/mob/proc/blind_eyes(amount)
|
|
if(amount>0)
|
|
var/old_eye_blind = eye_blind
|
|
eye_blind = max(eye_blind, amount)
|
|
if(!old_eye_blind)
|
|
if(stat == CONSCIOUS)
|
|
throw_alert("blind", /obj/screen/alert/blind)
|
|
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
|
|
|
|
/mob/proc/adjust_blindness(amount)
|
|
if(amount>0)
|
|
var/old_eye_blind = eye_blind
|
|
eye_blind += amount
|
|
if(!old_eye_blind)
|
|
if(stat == CONSCIOUS)
|
|
throw_alert("blind", /obj/screen/alert/blind)
|
|
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
|
|
else if(eye_blind)
|
|
var/blind_minimum = 0
|
|
if(stat != CONSCIOUS || (disabilities & BLIND))
|
|
blind_minimum = 1
|
|
eye_blind = max(eye_blind+amount, blind_minimum)
|
|
if(!eye_blind)
|
|
clear_alert("blind")
|
|
clear_fullscreen("blind")
|
|
|
|
/mob/proc/set_blindness(amount)
|
|
if(amount>0)
|
|
var/old_eye_blind = eye_blind
|
|
eye_blind = amount
|
|
if(client && !old_eye_blind)
|
|
if(stat == CONSCIOUS)
|
|
throw_alert("blind", /obj/screen/alert/blind)
|
|
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
|
|
else if(eye_blind)
|
|
var/blind_minimum = 0
|
|
if(stat != CONSCIOUS || (disabilities & BLIND))
|
|
blind_minimum = 1
|
|
eye_blind = blind_minimum
|
|
if(!eye_blind)
|
|
clear_alert("blind")
|
|
clear_fullscreen("blind")
|
|
|
|
/////////////////////////////////// EYE_BLURRY ////////////////////////////////////
|
|
|
|
/mob/proc/blur_eyes(amount)
|
|
if(amount>0)
|
|
var/old_eye_blurry = eye_blurry
|
|
eye_blurry = max(amount, eye_blurry)
|
|
if(!old_eye_blurry)
|
|
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
|
|
|
|
/mob/proc/adjust_blurriness(amount)
|
|
var/old_eye_blurry = eye_blurry
|
|
eye_blurry = max(eye_blurry+amount, 0)
|
|
if(amount>0)
|
|
if(!old_eye_blurry)
|
|
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
|
|
else if(old_eye_blurry && !eye_blurry)
|
|
clear_fullscreen("blurry")
|
|
|
|
/mob/proc/set_blurriness(amount)
|
|
var/old_eye_blurry = eye_blurry
|
|
eye_blurry = max(amount, 0)
|
|
if(amount>0)
|
|
if(!old_eye_blurry)
|
|
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
|
|
else if(old_eye_blurry)
|
|
clear_fullscreen("blurry")
|
|
|
|
/////////////////////////////////// DRUGGY ////////////////////////////////////
|
|
|
|
/mob/proc/adjust_drugginess(amount)
|
|
return
|
|
|
|
/mob/proc/set_drugginess(amount)
|
|
return
|
|
|
|
/////////////////////////////////// BLIND DISABILITY ////////////////////////////////////
|
|
|
|
/mob/proc/cure_blind() //when we want to cure the BLIND disability only.
|
|
return
|
|
|
|
/mob/proc/become_blind()
|
|
return
|
|
|
|
/////////////////////////////////// NEARSIGHT DISABILITY ////////////////////////////////////
|
|
|
|
/mob/proc/cure_nearsighted()
|
|
return
|
|
|
|
/mob/proc/become_nearsighted()
|
|
return
|
|
|
|
|
|
//////////////////////////////// HUSK DISABILITY ///////////////////////////:
|
|
|
|
/mob/proc/cure_husk()
|
|
return
|
|
|
|
/mob/proc/become_husk()
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|