git commit death
This commit is contained in:
@@ -3,222 +3,80 @@
|
||||
//The effects include: stun, knockdown, unconscious, sleeping, resting, jitteriness, dizziness, ear damage,
|
||||
// eye damage, eye_blind, eye_blurry, druggy, TRAIT_BLIND trait, and TRAIT_NEARSIGHT trait.
|
||||
|
||||
/////////////////////////////////// STUN ////////////////////////////////////
|
||||
|
||||
/mob/proc/IsStun() //non-living mobs shouldn't be stunned
|
||||
return FALSE
|
||||
|
||||
/////////////////////////////////// KNOCKDOWN ////////////////////////////////////
|
||||
|
||||
/mob/proc/IsKnockdown() //non-living mobs shouldn't be knocked down
|
||||
return FALSE
|
||||
|
||||
/////////////////////////////////// UNCONSCIOUS ////////////////////////////////////
|
||||
|
||||
/mob/proc/IsUnconscious() //non-living mobs shouldn't be unconscious
|
||||
return FALSE
|
||||
|
||||
/mob/living/IsUnconscious() //If we're unconscious
|
||||
return has_status_effect(STATUS_EFFECT_UNCONSCIOUS)
|
||||
|
||||
/mob/living/proc/AmountUnconscious() //How many deciseconds remain in our unconsciousness
|
||||
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
|
||||
if(U)
|
||||
return U.duration - world.time
|
||||
return 0
|
||||
|
||||
/mob/living/proc/Unconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Can't go below remaining duration
|
||||
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious)
|
||||
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
|
||||
if(U)
|
||||
U.duration = max(world.time + amount, U.duration)
|
||||
else if(amount > 0)
|
||||
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
|
||||
return U
|
||||
|
||||
/mob/living/proc/SetUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Sets remaining duration
|
||||
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious)
|
||||
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
|
||||
if(amount <= 0)
|
||||
if(U)
|
||||
qdel(U)
|
||||
else if(U)
|
||||
U.duration = world.time + amount
|
||||
else
|
||||
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
|
||||
return U
|
||||
|
||||
/mob/living/proc/AdjustUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Adds to remaining duration
|
||||
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious)
|
||||
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
|
||||
if(U)
|
||||
U.duration += amount
|
||||
else if(amount > 0)
|
||||
U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount, updating)
|
||||
return U
|
||||
|
||||
/////////////////////////////////// SLEEPING ////////////////////////////////////
|
||||
|
||||
/mob/proc/IsSleeping() //non-living mobs shouldn't be sleeping either
|
||||
return FALSE
|
||||
|
||||
/mob/living/IsSleeping() //If we're asleep
|
||||
return has_status_effect(STATUS_EFFECT_SLEEPING)
|
||||
|
||||
/mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
return S.duration - world.time
|
||||
return 0
|
||||
|
||||
/mob/living/proc/Sleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Can't go below remaining duration
|
||||
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
S.duration = max(world.time + amount, S.duration)
|
||||
else if(amount > 0)
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
|
||||
/mob/living/proc/SetSleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Sets remaining duration
|
||||
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(amount <= 0)
|
||||
if(S)
|
||||
qdel(S)
|
||||
else if(S)
|
||||
S.duration = world.time + amount
|
||||
else
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
|
||||
/mob/living/proc/AdjustSleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Adds to remaining duration
|
||||
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
S.duration += amount
|
||||
else if(amount > 0)
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
|
||||
/////////////////////////////////// RESTING ////////////////////////////////////
|
||||
|
||||
/mob/proc/Resting(amount)
|
||||
resting = max(max(resting,amount),0)
|
||||
|
||||
/mob/living/Resting(amount)
|
||||
..()
|
||||
update_canmove()
|
||||
|
||||
/mob/proc/SetResting(amount)
|
||||
resting = max(amount,0)
|
||||
|
||||
/mob/living/SetResting(amount)
|
||||
..()
|
||||
update_canmove()
|
||||
|
||||
/mob/proc/AdjustResting(amount)
|
||||
resting = max(resting + amount,0)
|
||||
|
||||
/mob/living/AdjustResting(amount)
|
||||
..()
|
||||
update_canmove()
|
||||
|
||||
/////////////////////////////////// JITTERINESS ////////////////////////////////////
|
||||
|
||||
///Set the jitter of a mob
|
||||
/mob/proc/Jitter(amount)
|
||||
jitteriness = max(jitteriness,amount,0)
|
||||
|
||||
/////////////////////////////////// DIZZINESS ////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Set the dizzyness of a mob to a passed in amount
|
||||
*
|
||||
* Except if dizziness is already higher in which case it does nothing
|
||||
*/
|
||||
/mob/proc/Dizzy(amount)
|
||||
dizziness = max(dizziness,amount,0)
|
||||
|
||||
/////////////////////////////////// EYE_BLIND ////////////////////////////////////
|
||||
///FOrce set the dizzyness of a mob
|
||||
/mob/proc/set_dizziness(amount)
|
||||
dizziness = max(amount, 0)
|
||||
|
||||
///Blind a mobs eyes by amount
|
||||
/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 || stat == SOFT_CRIT)
|
||||
throw_alert("blind", /obj/screen/alert/blind)
|
||||
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
|
||||
adjust_blindness(amount)
|
||||
|
||||
/**
|
||||
* Adjust a mobs blindness by an amount
|
||||
*
|
||||
* Will apply the blind alerts if needed
|
||||
*/
|
||||
/mob/proc/adjust_blindness(amount)
|
||||
if(amount>0)
|
||||
var/old_eye_blind = eye_blind
|
||||
eye_blind += amount
|
||||
if(!old_eye_blind)
|
||||
if(stat == CONSCIOUS || stat == SOFT_CRIT)
|
||||
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 && stat != SOFT_CRIT))
|
||||
blind_minimum = 1
|
||||
if(isliving(src))
|
||||
var/mob/living/L = src
|
||||
if(HAS_TRAIT(L, TRAIT_BLIND))
|
||||
blind_minimum = 1
|
||||
eye_blind = max(eye_blind+amount, blind_minimum)
|
||||
if(!eye_blind)
|
||||
clear_alert("blind")
|
||||
clear_fullscreen("blind")
|
||||
|
||||
var/old_eye_blind = eye_blind
|
||||
eye_blind = max(0, eye_blind + amount)
|
||||
if(!old_eye_blind || !eye_blind && !HAS_TRAIT(src, TRAIT_BLIND))
|
||||
update_blindness()
|
||||
/**
|
||||
* Force set the blindness of a mob to some level
|
||||
*/
|
||||
/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 || stat == SOFT_CRIT)
|
||||
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 && stat != SOFT_CRIT)
|
||||
blind_minimum = 1
|
||||
if(isliving(src))
|
||||
var/mob/living/L = src
|
||||
if(HAS_TRAIT(L, TRAIT_BLIND))
|
||||
blind_minimum = 1
|
||||
eye_blind = blind_minimum
|
||||
if(!eye_blind)
|
||||
clear_alert("blind")
|
||||
clear_fullscreen("blind")
|
||||
|
||||
/////////////////////////////////// EYE_BLURRY ////////////////////////////////////
|
||||
var/old_eye_blind = eye_blind
|
||||
eye_blind = max(amount, 0)
|
||||
if(!old_eye_blind || !eye_blind && !HAS_TRAIT(src, TRAIT_BLIND))
|
||||
update_blindness()
|
||||
|
||||
/// proc that adds and removes blindness overlays when necessary
|
||||
/mob/proc/update_blindness()
|
||||
if(stat == UNCONSCIOUS || HAS_TRAIT(src, TRAIT_BLIND) || eye_blind) // UNCONSCIOUS or has blind trait, or has temporary blindness
|
||||
if(stat == CONSCIOUS || stat == SOFT_CRIT)
|
||||
throw_alert("blind", /obj/screen/alert/blind)
|
||||
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
|
||||
// You are blind why should you be able to make out details like color, only shapes near you
|
||||
add_client_colour(/datum/client_colour/monochrome/blind)
|
||||
else // CONSCIOUS no blind trait, no blindness
|
||||
clear_alert("blind")
|
||||
clear_fullscreen("blind")
|
||||
remove_client_colour(/datum/client_colour/monochrome/blind)
|
||||
/**
|
||||
* Make the mobs vision 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)
|
||||
add_eyeblur() //Citadel edit blurry eye memes entailed. syncs beware
|
||||
else if(eye_blurry > 0)
|
||||
update_eyeblur()
|
||||
update_eye_blur()
|
||||
|
||||
/**
|
||||
* Adjust the current blurriness of the mobs vision by amount
|
||||
*/
|
||||
/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)
|
||||
add_eyeblur()
|
||||
else if(eye_blurry > 0)
|
||||
update_eyeblur()
|
||||
else if(old_eye_blurry && !eye_blurry)
|
||||
remove_eyeblur()
|
||||
update_eye_blur()
|
||||
|
||||
///Set the mobs blurriness of vision to an amount
|
||||
/mob/proc/set_blurriness(amount)
|
||||
var/old_eye_blurry = eye_blurry
|
||||
eye_blurry = max(amount, 0)
|
||||
if(amount>0)
|
||||
if(!old_eye_blurry)
|
||||
add_eyeblur()
|
||||
else if(eye_blurry > 0)
|
||||
update_eyeblur()
|
||||
else if(old_eye_blurry)
|
||||
remove_eyeblur()
|
||||
update_eye_blur()
|
||||
|
||||
/mob/proc/update_eye_blur()
|
||||
remove_eyeblur()
|
||||
add_eyeblur()
|
||||
|
||||
/mob/proc/add_eyeblur()
|
||||
if(!client)
|
||||
@@ -228,10 +86,6 @@
|
||||
GW.add_filter("blurry_eyes", 2, EYE_BLUR(CLAMP(eye_blurry*0.1,0.6,3)))
|
||||
F.add_filter("blurry_eyes", 2, EYE_BLUR(CLAMP(eye_blurry*0.1,0.6,3)))
|
||||
|
||||
/mob/proc/update_eyeblur()
|
||||
remove_eyeblur()
|
||||
add_eyeblur()
|
||||
|
||||
/mob/proc/remove_eyeblur()
|
||||
if(!client)
|
||||
return
|
||||
@@ -240,24 +94,23 @@
|
||||
GW.remove_filter("blurry_eyes")
|
||||
F.remove_filter("blurry_eyes")
|
||||
|
||||
/////////////////////////////////// DRUGGY ////////////////////////////////////
|
||||
|
||||
///Adjust the drugginess of a mob
|
||||
/mob/proc/adjust_drugginess(amount)
|
||||
return
|
||||
|
||||
///Set the drugginess of a mob
|
||||
/mob/proc/set_drugginess(amount)
|
||||
return
|
||||
|
||||
/////////////////////////////////// GROSSED OUT ////////////////////////////////////
|
||||
|
||||
///Adjust the disgust level of a mob
|
||||
/mob/proc/adjust_disgust(amount)
|
||||
return
|
||||
|
||||
///Set the disgust level of a mob
|
||||
/mob/proc/set_disgust(amount)
|
||||
return
|
||||
|
||||
/////////////////////////////////// TEMPERATURE ////////////////////////////////////
|
||||
|
||||
///Adjust the body temperature of a mob, with min/max settings
|
||||
/mob/proc/adjust_bodytemperature(amount,min_temp=0,max_temp=INFINITY)
|
||||
if(bodytemperature >= min_temp && bodytemperature <= max_temp)
|
||||
bodytemperature = CLAMP(bodytemperature + amount,min_temp,max_temp)
|
||||
|
||||
Reference in New Issue
Block a user