Merge pull request #10661 from xxalpha/changeling_vision

Fixed changeling night vision and night vision spell.
This commit is contained in:
Jordie
2015-07-23 22:22:38 +10:00
3 changed files with 28 additions and 11 deletions
@@ -9,7 +9,9 @@
dna_cost = 2 //Would be 1 without thermal vision
var/active = 0 //Whether or not vision is enhanced
/obj/effect/proc_holder/changeling/augmented_eyesight/sting_action(mob/user)
/obj/effect/proc_holder/changeling/augmented_eyesight/sting_action(mob/living/carbon/human/user)
if(!istype(user))
return
active = !active
if(active)
user << "<span class='notice'>We feel a minute twitch in our eyes, and darkness creeps away.</span>"
@@ -17,12 +19,12 @@
user.sight |= SEE_MOBS
user.permanent_sight_flags |= SEE_MOBS
user.see_in_dark = 8
user.see_invisible = SEE_INVISIBLE_MINIMUM
user.dna.species.invis_sight = SEE_INVISIBLE_MINIMUM
else
user << "<span class='notice'>Our vision dulls. Shadows gather.</span>"
user.weakeyes = 0
user.sight -= SEE_MOBS
user.permanent_sight_flags -= SEE_MOBS
user.sight &= ~SEE_MOBS
user.permanent_sight_flags &= ~SEE_MOBS
user.see_in_dark = 0
user.see_invisible = SEE_INVISIBLE_LIVING
user.dna.species.invis_sight = initial(user.dna.species.invis_sight)
return 1
@@ -198,10 +198,19 @@
/obj/effect/proc_holder/spell/targeted/night_vision/cast(list/targets)
for(var/mob/living/target in targets)
if(target.see_invisible == SEE_INVISIBLE_LIVING)
target.see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
name = "Toggle Nightvision \[ON\]"
if(istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target
if(H.dna.species.invis_sight == SEE_INVISIBLE_LIVING)
H.dna.species.invis_sight = SEE_INVISIBLE_OBSERVER_NOLIGHTING
name = "Toggle Nightvision \[ON]"
else
H.dna.species.invis_sight = SEE_INVISIBLE_LIVING
name = "Toggle Nightvision \[OFF]"
else
target.see_invisible = SEE_INVISIBLE_LIVING
name = "Toggle Nightvision \[OFF\]"
return
if(target.see_invisible == SEE_INVISIBLE_LIVING)
target.see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
name = "Toggle Nightvision \[ON]"
else
target.see_invisible = SEE_INVISIBLE_LIVING
name = "Toggle Nightvision \[OFF]"
@@ -0,0 +1,6 @@
author: xxalpha
delete-after: True
changes:
- bugfix: "Changeling augmented eyesight night vision is now working."