Files
Paradise/code/datums/spells/night_vision.dm
KalevTait d1da076958 Code Readability - Spells (#18141)
* changed fake disintegrate to not need a permit (as far as sec bots are concerned)

* prefer boolean defines to magic numbers

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* added check

* spells

* Revert "added check"

This reverts commit 082aa40246.

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
2022-07-01 15:52:12 -05:00

29 lines
1.0 KiB
Plaintext

/obj/effect/proc_holder/spell/night_vision
name = "Toggle Nightvision"
desc = "Toggle your nightvision mode."
charge_max = 10
clothes_req = FALSE
message = "<span class='notice'>You toggle your night vision!</span>"
/obj/effect/proc_holder/spell/night_vision/create_new_targeting()
return new /datum/spell_targeting/self
/obj/effect/proc_holder/spell/night_vision/cast(list/targets, mob/user = usr)
for(var/mob/living/target in targets)
switch(target.lighting_alpha)
if (LIGHTING_PLANE_ALPHA_VISIBLE)
target.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
name = "Toggle Nightvision \[More]"
if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)
target.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
name = "Toggle Nightvision \[Full]"
if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
target.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
name = "Toggle Nightvision \[OFF]"
else
target.lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
name = "Toggle Nightvision \[ON]"
target.update_sight()