Fixes some bugs with changeling's Augmented Eyesight (#28582)

* woe

* oops
This commit is contained in:
Contrabang
2025-03-15 08:24:29 +00:00
committed by GitHub
parent 866fd0ca13
commit 855e8c89f4
2 changed files with 24 additions and 28 deletions
@@ -12,45 +12,39 @@
/datum/action/changeling/augmented_eyesight/on_purchase(mob/user, /datum/antagonist/changeling/C) //The ability starts inactive, so we should be protected from flashes.
if(!..())
return
var/obj/item/organ/internal/eyes/E = user.get_organ_slot("eyes")
if(E)
E.flash_protect = FLASH_PROTECTION_WELDER //Adjust the user's eyes' flash protection
to_chat(user, "<span class='notice'>We adjust our eyes to protect them from bright lights.</span>")
else
to_chat(user, "<span class='warning'>We can't adjust our eyes if we don't have any!</span>")
update_eyes(user)
/datum/action/changeling/augmented_eyesight/sting_action(mob/living/carbon/user)
if(!istype(user))
return FALSE
..()
var/obj/item/organ/internal/eyes/E = user.get_organ_slot("eyes")
if(E)
if(!active)
E.vision_flags |= SEE_MOBS | SEE_OBJS | SEE_TURFS //Add sight flags to the user's eyes
E.flash_protect = FLASH_PROTECTION_SENSITIVE //Adjust the user's eyes' flash protection
E.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
to_chat(user, "<span class='notice'>We adjust our eyes to sense prey through walls.</span>")
active = TRUE
else
E.vision_flags ^= SEE_MOBS | SEE_OBJS | SEE_TURFS //Remove sight flags from the user's eyes
E.flash_protect = FLASH_PROTECTION_WELDER //Adjust the user's eyes' flash protection
E.lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
to_chat(user, "<span class='notice'>We adjust our eyes to protect them from bright lights.</span>")
active = FALSE
user.update_sight()
else
to_chat(user, "<span class='warning'>We can't adjust our eyes if we don't have any!</span>")
active = !active
update_eyes(user)
return TRUE
/datum/action/changeling/augmented_eyesight/Remove(mob/user) //Get rid of x-ray vision and flash protection when the user refunds this ability
if(!istype(user))
return
var/obj/item/organ/internal/eyes/E = user.get_organ_slot("eyes")
if(E)
if(active)
E.vision_flags ^= SEE_MOBS | SEE_OBJS | SEE_TURFS
else
E.flash_protect = FLASH_PROTECTION_NONE
E.vision_flags = initial(E.vision_flags)
E.flash_protect = initial(E.flash_protect)
user.update_sight()
..()
/datum/action/changeling/augmented_eyesight/proc/update_eyes(mob/user)
var/obj/item/organ/internal/eyes/E = user.get_organ_slot("eyes")
if(!E)
to_chat(user, "<span class='warning'>We can't adjust our eyes if we don't have any!</span>")
return
if(active)
E.vision_flags |= SEE_MOBS | SEE_OBJS | SEE_TURFS //Add sight flags to the user's eyes
E.flash_protect = FLASH_PROTECTION_SENSITIVE //Adjust the user's eyes' flash protection
E.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
to_chat(user, "<span class='notice'>We adjust our eyes to sense prey through walls.</span>")
else
E.vision_flags = initial(E.vision_flags) //Remove sight flags from the user's eyes
E.flash_protect = FLASH_PROTECTION_WELDER //Adjust the user's eyes' flash protection
E.lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
to_chat(user, "<span class='notice'>We adjust our eyes to protect them from bright lights.</span>")
user.update_sight()
@@ -25,5 +25,7 @@
user.handcuffed = keep_cuffs
user.update_handcuffed()
cling.update_languages()
var/datum/action/changeling/augmented_eyesight/eyesight = locate() in user.actions
eyesight.update_eyes(user)
SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]"))
return TRUE