diff --git a/code/modules/antagonists/changeling/powers/augmented_eyesight.dm b/code/modules/antagonists/changeling/powers/augmented_eyesight.dm index 544a0ed2a0d..e218c99cbd5 100644 --- a/code/modules/antagonists/changeling/powers/augmented_eyesight.dm +++ b/code/modules/antagonists/changeling/powers/augmented_eyesight.dm @@ -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, "We adjust our eyes to protect them from bright lights.") - else - to_chat(user, "We can't adjust our eyes if we don't have any!") + 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, "We adjust our eyes to sense prey through walls.") - 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, "We adjust our eyes to protect them from bright lights.") - active = FALSE - user.update_sight() - else - to_chat(user, "We can't adjust our eyes if we don't have any!") + 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, "We can't adjust our eyes if we don't have any!") + 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, "We adjust our eyes to sense prey through walls.") + 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, "We adjust our eyes to protect them from bright lights.") + user.update_sight() diff --git a/code/modules/antagonists/changeling/powers/transform.dm b/code/modules/antagonists/changeling/powers/transform.dm index 1255fcd70d0..8780af63bdc 100644 --- a/code/modules/antagonists/changeling/powers/transform.dm +++ b/code/modules/antagonists/changeling/powers/transform.dm @@ -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