From e6b7fd91493188035ce008968b2fb28c4ec83d1f Mon Sep 17 00:00:00 2001 From: Mark van Alphen Date: Thu, 9 May 2019 03:11:06 +0200 Subject: [PATCH] Move night vision spell and give it to constructs --- code/datums/spells/night_vision.dm | 27 +++++++++++++++++ .../mob/living/simple_animal/constructs.dm | 10 ++++--- .../living/simple_animal/hostile/statue.dm | 29 ------------------- paradise.dme | 1 + 4 files changed, 34 insertions(+), 33 deletions(-) create mode 100644 code/datums/spells/night_vision.dm diff --git a/code/datums/spells/night_vision.dm b/code/datums/spells/night_vision.dm new file mode 100644 index 00000000000..1327b4ffcee --- /dev/null +++ b/code/datums/spells/night_vision.dm @@ -0,0 +1,27 @@ +/obj/effect/proc_holder/spell/targeted/night_vision + name = "Toggle Nightvision" + desc = "Toggle your nightvision mode." + + charge_max = 10 + clothes_req = 0 + + message = "You toggle your night vision!" + range = -1 + include_user = 1 + +/obj/effect/proc_holder/spell/targeted/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() diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index 91abb6b2696..a001d40e879 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -113,7 +113,7 @@ status_flags = 0 const_type = "juggernaut" mob_size = MOB_SIZE_LARGE - construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall) + construct_spells = list(/obj/effect/proc_holder/spell/targeted/night_vision, /obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall) force_threshold = 11 playstyle_string = "You are a Juggernaut. Though slow, your shell can withstand extreme punishment, \ create shield walls, rip apart enemies and walls alike, and even deflect energy weapons." @@ -171,7 +171,7 @@ see_in_dark = 8 attack_sound = 'sound/weapons/bladeslice.ogg' const_type = "wraith" - construct_spells = list(/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift) + construct_spells = list(/obj/effect/proc_holder/spell/targeted/night_vision, /obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift) retreat_distance = 2 //AI wraiths will move in and out of combat playstyle_string = "You are a Wraith. Though relatively fragile, you are fast, deadly, and even able to phase through walls." @@ -202,7 +202,8 @@ minimum_distance = 10 //AI artificers will flee like fuck attack_sound = 'sound/weapons/punch2.ogg' const_type = "builder" - construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser, + construct_spells = list(/obj/effect/proc_holder/spell/targeted/night_vision, + /obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser, /obj/effect/proc_holder/spell/aoe_turf/conjure/wall, /obj/effect/proc_holder/spell/aoe_turf/conjure/floor, /obj/effect/proc_holder/spell/aoe_turf/conjure/pylon, @@ -311,7 +312,8 @@ see_in_dark = 8 attack_sound = 'sound/weapons/tap.ogg' const_type = "harvester" - construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/wall, + construct_spells = list(/obj/effect/proc_holder/spell/targeted/night_vision, + /obj/effect/proc_holder/spell/aoe_turf/conjure/wall, /obj/effect/proc_holder/spell/aoe_turf/conjure/floor, /obj/effect/proc_holder/spell/targeted/smoke/disable) retreat_distance = 2 //AI harvesters will move in and out of combat, like wraiths, but shittier diff --git a/code/modules/mob/living/simple_animal/hostile/statue.dm b/code/modules/mob/living/simple_animal/hostile/statue.dm index 3f649eae984..2e1e7508e1c 100644 --- a/code/modules/mob/living/simple_animal/hostile/statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/statue.dm @@ -189,35 +189,6 @@ L.EyeBlind(4) return -//Toggle Night Vision -/obj/effect/proc_holder/spell/targeted/night_vision - name = "Toggle Nightvision" - desc = "Toggle your nightvision mode." - - charge_max = 10 - clothes_req = 0 - - message = "You toggle your night vision!" - range = -1 - include_user = 1 - -/obj/effect/proc_holder/spell/targeted/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() - /mob/living/simple_animal/hostile/statue/sentience_act() faction -= "neutral" diff --git a/paradise.dme b/paradise.dme index 465d383743a..7a8eadca405 100644 --- a/paradise.dme +++ b/paradise.dme @@ -371,6 +371,7 @@ #include "code\datums\spells\magnet.dm" #include "code\datums\spells\mime.dm" #include "code\datums\spells\mind_transfer.dm" +#include "code\datums\spells\night_vision.dm" #include "code\datums\spells\projectile.dm" #include "code\datums\spells\rathens.dm" #include "code\datums\spells\rod_form.dm"