Files
Paradise/code/datums/spells/night_vision.dm
Charlie ded049a902 Spell cooldown refactor (#18327)
* Squashed commit of the following:

commit 979fe5287c3dd33cd5d69bdd968beae245984f2e
Author: hal9000PR <charliesteeples@outlook.com>
Date:   Sat Jul 9 23:40:53 2022 +0100

    guts the old system

* refactors spell cooldowns into a handler

* charge datum

* garbage collection

* cleanup, renames cooldown var

* review changes

* boo cooldown fix

* styling

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
2022-07-23 00:00:42 +02:00

29 lines
1.0 KiB
Plaintext

/obj/effect/proc_holder/spell/night_vision
name = "Toggle Nightvision"
desc = "Toggle your nightvision mode."
base_cooldown = 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()