Files
Bubberstation/code/modules/mob/status_procs.dm
SkyratBot 1fe0d145a3 [MIRROR] Converts blindness and nearsightedness to status effects, scratches some VERY dumb blindness handling that resulted in mobs becoming "incurably" blind [MDB IGNORE] (#18760)
* Converts blindness and nearsightedness to status effects, scratches some VERY dumb blindness handling that resulted in mobs becoming "incurably" blind

* Fixes the conflicts and makes shit compile!

* Fixes other things that didn't show up because I hadn't updated

* Fixes the lints.

* Okay NOW it's ready (please don't add anything else that touches blindness I beg you)

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2023-02-03 16:08:32 -05:00

56 lines
2.1 KiB
Plaintext

//Here are the procs used to modify status effects of a mob.
///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
///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)
/// Sight here is the mob.sight var, which tells byond what to actually show to our client
/// See [code\__DEFINES\sight.dm] for more details
/mob/proc/set_sight(new_value)
SHOULD_CALL_PARENT(TRUE)
if(sight == new_value)
return
var/old_sight = sight
sight = new_value
SEND_SIGNAL(src, COMSIG_MOB_SIGHT_CHANGE, new_value, old_sight)
/mob/proc/add_sight(new_value)
set_sight(sight | new_value)
/mob/proc/clear_sight(new_value)
set_sight(sight & ~new_value)
/// see invisibility is the mob's capability to see things that ought to be hidden from it
/// Can think of it as a primitive version of changing the alpha of planes
/// We mostly use it to hide ghosts, no real reason why
/mob/proc/set_invis_see(new_sight)
SHOULD_CALL_PARENT(TRUE)
if(new_sight == see_invisible)
return
var/old_invis = see_invisible
see_invisible = new_sight
SEND_SIGNAL(src, COMSIG_MOB_SEE_INVIS_CHANGE, see_invisible, old_invis)
/// see_in_dark is essentially just a range value
/// Basically, if a tile has 0 luminosity affecting it, it will be counted as "dark"
/// Then, if said tile is farther then see_in_dark from your mob, it will, rather then being rendered
/// As a normal tile with contents, instead be covered by "darkness". This effectively means it gets masked away, we don't even try to draw it.
/// You can see this effect by going somewhere dark, and cranking the alpha on the lighting plane to 0
/mob/proc/set_see_in_dark(new_dark)
SHOULD_CALL_PARENT(TRUE)
if(new_dark == see_in_dark)
return
var/old_dark = see_in_dark
see_in_dark = new_dark
SEND_SIGNAL(src, COMSIG_MOB_SEE_IN_DARK_CHANGE, see_in_dark, old_dark)