From 48250f603e6deea85ef209189fd39ec89d28c2d0 Mon Sep 17 00:00:00 2001 From: itseasytosee <55666666+itseasytosee@users.noreply.github.com> Date: Fri, 16 Sep 2022 21:27:08 -0500 Subject: [PATCH] Makes flash hyper vulnerability based on negative flash resistance modifier, removes snowflake trait. (#69530) --- code/__DEFINES/mobs.dm | 1 + code/__DEFINES/traits.dm | 2 -- code/modules/assembly/flash.dm | 7 +++++-- code/modules/surgery/organs/eyes.dm | 15 ++------------- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 2ce5125e10d..1dbf4a0df6c 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -435,6 +435,7 @@ #define REAGENTS_EFFECT_MULTIPLIER (REAGENTS_METABOLISM / 0.4) // By defining the effect multiplier this way, it'll exactly adjust all effects according to how they originally were with the 0.4 metabolism // Eye protection +#define FLASH_PROTECTION_HYPER_SENSITIVE -2 #define FLASH_PROTECTION_SENSITIVE -1 #define FLASH_PROTECTION_NONE 0 #define FLASH_PROTECTION_FLASH 1 diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index e59a1f31680..7e0166096d0 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -296,8 +296,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_NOFLASH "noflash" /// prevents xeno huggies implanting skeletons #define TRAIT_XENO_IMMUNE "xeno_immune" -/// Makes you flashable from any direction -#define TRAIT_FLASH_SENSITIVE "flash_sensitive" #define TRAIT_NAIVE "naive" #define TRAIT_PRIMITIVE "primitive" #define TRAIT_GUNFLIP "gunflip" diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 22dcb4838b5..bd10e77326b 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -1,5 +1,6 @@ #define CONFUSION_STACK_MAX_MULTIPLIER 2 + /// No deviation at all. Flashed from the front or front-left/front-right. Alternatively, flashed in direct view. #define DEVIATION_NONE 0 /// Partial deviation. Flashed from the side. Alternatively, flashed out the corner of your eyes. @@ -200,8 +201,10 @@ if(victim.flags_1 & IS_SPINNING_1) return DEVIATION_NONE - if(HAS_TRAIT(victim, TRAIT_FLASH_SENSITIVE)) //If your eyes are sensitive and can be flashed from any direction. - return DEVIATION_NONE + if(iscarbon(victim)) + var/mob/living/carbon/carbon_victim = victim + if(carbon_victim.get_eye_protection() < FLASH_PROTECTION_SENSITIVE) // If we have really bad flash sensitivity, usually due to really sensitive eyes, we get flashed from all directions + return DEVIATION_NONE // Are they on the same tile? We'll return partial deviation. This may be someone flashing while lying down // or flashing someone they're stood on the same turf as, or a borg flashing someone buckled to them. diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index a1215651be4..3f8e6723d5f 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -517,19 +517,12 @@ desc = "These eyes seem to stare back no matter the direction you look at it from." eye_icon_state = "flyeyes" icon_state = "eyeballs-fly" - -/obj/item/organ/internal/eyes/fly/Insert(mob/living/carbon/eye_owner, special = FALSE, drop_if_replaced = TRUE) - . = ..() - ADD_TRAIT(eye_owner, TRAIT_FLASH_SENSITIVE, ORGAN_TRAIT) - -/obj/item/organ/internal/eyes/fly/Remove(mob/living/carbon/eye_owner, special = FALSE) - REMOVE_TRAIT(eye_owner, TRAIT_FLASH_SENSITIVE, ORGAN_TRAIT) - return ..() + flash_protect = FLASH_PROTECTION_HYPER_SENSITIVE /obj/item/organ/internal/eyes/night_vision/maintenance_adapted name = "adapted eyes" desc = "These red eyes look like two foggy marbles. They give off a particularly worrying glow in the dark." - flash_protect = FLASH_PROTECTION_SENSITIVE + flash_protect = FLASH_PROTECTION_HYPER_SENSITIVE eye_color_left = "f00" eye_color_right = "f00" icon_state = "adapted_eyes" @@ -545,8 +538,6 @@ adapt_light.on = TRUE adapt_light.forceMove(adapted) adapt_light.update_brightness(adapted) - //traits - ADD_TRAIT(adapted, TRAIT_FLASH_SENSITIVE, ORGAN_TRAIT) ADD_TRAIT(adapted, TRAIT_UNNATURAL_RED_GLOWY_EYES, ORGAN_TRAIT) /obj/item/organ/internal/eyes/night_vision/maintenance_adapted/on_life(delta_time, times_fired) @@ -565,7 +556,5 @@ adapt_light.on = FALSE adapt_light.update_brightness(unadapted) adapt_light.forceMove(src) - //traits - REMOVE_TRAIT(unadapted, TRAIT_FLASH_SENSITIVE, ORGAN_TRAIT) REMOVE_TRAIT(unadapted, TRAIT_UNNATURAL_RED_GLOWY_EYES, ORGAN_TRAIT) return ..()