From 705a013445e20b4c70f58b313137b7bfde544fed Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Mon, 5 Jul 2021 22:44:30 +0100 Subject: [PATCH 1/8] i do --- code/__HELPERS/traits.dm | 1 + code/_globalvars/genetics.dm | 2 +- code/_globalvars/traits.dm | 1 + code/game/dna/mutations/powers.dm | 44 +++++++++---------- code/game/gamemodes/setupgame.dm | 4 +- .../objects/items/weapons/dna_injector.dm | 22 ---------- .../objects/items/weapons/storage/belt.dm | 1 - .../antagonists/wishgranter/wishgranter.dm | 3 -- .../awaymissions/mission_code/wildwest.dm | 2 - code/modules/mining/abandonedcrates.dm | 28 ++++++------ code/modules/mob/living/carbon/carbon.dm | 4 ++ .../living/carbon/human/species/_species.dm | 6 ++- 12 files changed, 49 insertions(+), 69 deletions(-) diff --git a/code/__HELPERS/traits.dm b/code/__HELPERS/traits.dm index 4241cee9e9b..3e52865e577 100644 --- a/code/__HELPERS/traits.dm +++ b/code/__HELPERS/traits.dm @@ -139,6 +139,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_BLOODCRAWL_EAT "bloodcrawl_eat" #define TRAIT_DWARF "dwarf" #define TRAIT_SILENT_FOOTSTEPS "silent_footsteps" //makes your footsteps completely silent +#define TRAIT_MESON_VISION "meson_vision" #define TRAIT_COMIC_SANS "comic_sans" #define TRAIT_NOFINGERPRINTS "no_fingerprints" diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm index 1119ac364cc..d6c290b5247 100644 --- a/code/_globalvars/genetics.dm +++ b/code/_globalvars/genetics.dm @@ -5,7 +5,6 @@ GLOBAL_VAR_INIT(deafblock, 0) GLOBAL_VAR_INIT(hulkblock, 0) GLOBAL_VAR_INIT(teleblock, 0) GLOBAL_VAR_INIT(fireblock, 0) -GLOBAL_VAR_INIT(xrayblock, 0) GLOBAL_VAR_INIT(clumsyblock, 0) GLOBAL_VAR_INIT(fakeblock, 0) GLOBAL_VAR_INIT(coughblock, 0) @@ -30,6 +29,7 @@ GLOBAL_VAR_INIT(hallucinationblock, 0) GLOBAL_VAR_INIT(noprintsblock, 0) GLOBAL_VAR_INIT(shockimmunityblock, 0) GLOBAL_VAR_INIT(smallsizeblock, 0) +GLOBAL_VAR_INIT(mesonblock, 0) /////////////////////////////// // Goon Stuff diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index da0fb3b8fc2..1ad2c8fd2d4 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -45,6 +45,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_DWARF" = TRAIT_DWARF, "TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS, "TRAIT_ALCOHOL_TOLERANCE" = TRAIT_ALCOHOL_TOLERANCE, + "TRAIT_MESON_VISION" = TRAIT_MESON_VISION, "TRAIT_COMIC_SANS" = TRAIT_COMIC_SANS, "TRAIT_NOFINGERPRINTS" = TRAIT_NOFINGERPRINTS, diff --git a/code/game/dna/mutations/powers.dm b/code/game/dna/mutations/powers.dm index e8fa3998df3..587d221f72d 100644 --- a/code/game/dna/mutations/powers.dm +++ b/code/game/dna/mutations/powers.dm @@ -158,28 +158,6 @@ M.status_flags |= CANSTUN | CANWEAKEN | CANPARALYSE | CANPUSH //temporary fix until the problem can be solved. to_chat(M, "You suddenly feel very weak.") -/datum/mutation/xray - name = "X-Ray Vision" - activation_messages = list("The walls suddenly disappear.") - deactivation_messages = list("The walls around you re-appear.") - instability = GENE_INSTABILITY_MAJOR - traits_to_add = list(TRAIT_XRAY_VISION) - activation_prob = 15 - -/datum/mutation/xray/New() - ..() - block = GLOB.xrayblock - -/datum/mutation/xray/activate(mob/living/M) - ..() - M.update_sight() - M.update_icons() //Apply eyeshine as needed. - -/datum/mutation/xray/deactivate(mob/living/M) - ..() - M.update_sight() - M.update_icons() //Remove eyeshine as needed. - /datum/mutation/tk name = "Telekenesis" activation_messages = list("You feel smarter.") @@ -1179,3 +1157,25 @@ else H.remoteview_target = null H.reset_perspective() + +/datum/mutation/meson_vision + name = "Meson Vision" + activation_messages = list("More information seems to reach your eyes...") + deactivation_messages = list("The amount of information reaching your eyes fades...") + instability = GENE_INSTABILITY_MODERATE + traits_to_add = list(TRAIT_MESON_VISION) + activation_prob = 33 + +/datum/mutation/meson_vision/New() + ..() + block = GLOB.mesonblock + +/datum/mutation/meson_vision/activate(mob/living/M) + ..() + M.update_sight() + M.update_icons() + +/datum/mutation/meson_vision/deactivate(mob/living/M) + ..() + M.update_sight() + M.update_icons() diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index d749f8ef553..b3f7882f2e6 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -40,7 +40,6 @@ GLOB.hulkblock = getAssignedBlock("HULK", numsToAssign, DNA_HARD_BOUNDS, good=1) GLOB.teleblock = getAssignedBlock("TELE", numsToAssign, DNA_HARD_BOUNDS, good=1) GLOB.fireblock = getAssignedBlock("FIRE", numsToAssign, DNA_HARDER_BOUNDS, good=1) - GLOB.xrayblock = getAssignedBlock("XRAY", numsToAssign, DNA_HARDER_BOUNDS, good=1) GLOB.clumsyblock = getAssignedBlock("CLUMSY", numsToAssign) GLOB.fakeblock = getAssignedBlock("FAKE", numsToAssign) GLOB.coughblock = getAssignedBlock("COUGH", numsToAssign) @@ -49,6 +48,8 @@ GLOB.twitchblock = getAssignedBlock("TWITCH", numsToAssign) GLOB.nervousblock = getAssignedBlock("NERVOUS", numsToAssign) GLOB.wingdingsblock = getAssignedBlock("WINGDINGS", numsToAssign) + GLOB.mesonblock = getAssignedBlock("MESONS", numsToAssign, DNA_HARDER_BOUNDS, good=1) + // Bay muts GLOB.breathlessblock = getAssignedBlock("BREATHLESS", numsToAssign, DNA_HARD_BOUNDS, good=1) @@ -62,7 +63,6 @@ GLOB.noprintsblock = getAssignedBlock("NOPRINTS", numsToAssign, DNA_HARD_BOUNDS, good=1) GLOB.shockimmunityblock = getAssignedBlock("SHOCKIMMUNITY", numsToAssign, good=1) GLOB.smallsizeblock = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS, good=1) - // // Goon muts ///////////////////////////////////////////// diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 46d347e0db7..02b53d2ff56 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -170,28 +170,6 @@ block = GLOB.hulkblock ..() -/obj/item/dnainjector/xraymut - name = "DNA-Injector (Xray)" - desc = "Finally you can see what the Captain does." - datatype = DNA2_BUF_SE - value = 0xFFF - forcedmutation = TRUE - -/obj/item/dnainjector/xraymut/Initialize() - block = GLOB.xrayblock - ..() - -/obj/item/dnainjector/antixray - name = "DNA-Injector (Anti-Xray)" - desc = "It will make you see harder." - datatype = DNA2_BUF_SE - value = 0x001 - forcedmutation = TRUE - -/obj/item/dnainjector/antixray/Initialize() - block = GLOB.xrayblock - ..() - /obj/item/dnainjector/firemut name = "DNA-Injector (Fire)" desc = "Gives you fire." diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index eb700165441..1ba3a7b7724 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -714,7 +714,6 @@ new /obj/item/stack/cable_coil(src) new /obj/item/restraints/handcuffs(src) - new /obj/item/dnainjector/xraymut(src) new /obj/item/dnainjector/firemut(src) new /obj/item/dnainjector/telemut(src) new /obj/item/dnainjector/hulkmut(src) diff --git a/code/modules/antagonists/wishgranter/wishgranter.dm b/code/modules/antagonists/wishgranter/wishgranter.dm index 92e6336d693..99efbc811f4 100644 --- a/code/modules/antagonists/wishgranter/wishgranter.dm +++ b/code/modules/antagonists/wishgranter/wishgranter.dm @@ -25,9 +25,6 @@ H.dna.SetSEState(GLOB.hulkblock, TRUE) singlemutcheck(H, GLOB.hulkblock, MUTCHK_FORCED) - H.dna.SetSEState(GLOB.xrayblock, TRUE) - singlemutcheck(H, GLOB.xrayblock, MUTCHK_FORCED) - H.dna.SetSEState(GLOB.fireblock, TRUE) singlemutcheck(H, GLOB.fireblock, MUTCHK_FORCED) diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 2377deca844..511fbb92294 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -79,8 +79,6 @@ ADD_TRAIT(user, TRAIT_LASEREYES, "ww_wishgranter") user.dna.SetSEState(GLOB.fireblock, TRUE) singlemutcheck(user, GLOB.fireblock, MUTCHK_FORCED) - user.dna.SetSEState(GLOB.xrayblock, TRUE) - singlemutcheck(user, GLOB.xrayblock, MUTCHK_FORCED) if(ishuman(user)) var/mob/living/carbon/human/human = user if(!isshadowperson(human)) diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm index 19773358277..a1695a4a1f0 100644 --- a/code/modules/mining/abandonedcrates.dm +++ b/code/modules/mining/abandonedcrates.dm @@ -104,21 +104,7 @@ new /obj/item/toy/katana(src) if(85 to 86) new /obj/item/defibrillator/compact(src) - if(87) //1% chance - new /obj/item/weed_extract(src) - if(88) - new /obj/item/organ/internal/brain(src) - if(89) - new /obj/item/organ/internal/brain/xeno(src) - if(90) - new /obj/item/organ/internal/heart(src) - if(91) - new /obj/item/soulstone/anybody(src) - if(92) - new /obj/item/katana(src) - if(93) - new /obj/item/dnainjector/xraymut(src) - if(94) + if(87 to 88) new /obj/item/storage/backpack/clown(src) new /obj/item/clothing/under/rank/clown(src) new /obj/item/clothing/shoes/clown_shoes(src) @@ -128,6 +114,18 @@ new /obj/item/toy/crayon/rainbow(src) new /obj/item/reagent_containers/spray/waterflower(src) new /obj/item/reagent_containers/food/drinks/bottle/bottleofbanana(src) + if(89) //1% chance + new /obj/item/weed_extract(src) + if(90) + new /obj/item/organ/internal/brain(src) + if(91) + new /obj/item/organ/internal/brain/xeno(src) + if(92) + new /obj/item/organ/internal/heart(src) + if(93) + new /obj/item/soulstone/anybody(src) + if(94) + new /obj/item/katana(src) if(95) new /obj/item/clothing/under/mime(src) new /obj/item/clothing/shoes/black(src) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index b0b2769032e..5c802d535f9 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1201,6 +1201,10 @@ so that different stomachs can handle things in different ways VB*/ sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) see_in_dark = max(see_in_dark, 8) + if(HAS_TRAIT(src, TRAIT_MESON_VISION)) + sight |= (SEE_TURFS) + lighting_alpha = min(lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) + SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT) sync_lighting_plane_alpha() diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 7d1ae80a955..3ff0e567634 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -894,7 +894,11 @@ It'll return null if the organ doesn't correspond, so include null checks when u if(!isnull(H.vision_type.lighting_alpha)) H.lighting_alpha = min(H.vision_type.lighting_alpha, H.lighting_alpha) - if(HAS_TRAIT(src, TRAIT_THERMAL_VISION)) + if(HAS_TRAIT(H, TRAIT_MESON_VISION)) + H.sight |= (SEE_TURFS) + H.lighting_alpha = min(H.lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) + + if(HAS_TRAIT(H, TRAIT_THERMAL_VISION)) H.sight |= (SEE_MOBS) H.lighting_alpha = min(H.lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) From 2414afc550a91cd24791dc9761d44afb01d887db Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Mon, 5 Jul 2021 22:53:55 +0100 Subject: [PATCH 2/8] stare at the supermatter in this brand new update! --- code/modules/power/supermatter/supermatter.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 0cc682eae32..a1693155ea4 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -221,7 +221,7 @@ return var/mob/living/carbon/human/H = user var/immune = istype(H.glasses, /obj/item/clothing/glasses/meson) - if(!immune && (get_dist(user, src) < HALLUCINATION_RANGE(power))) + if(!immune && !HAS_TRAIT(H, TRAIT_MESON_VISION) && (get_dist(user, src) < HALLUCINATION_RANGE(power))) . += "You get headaches just from looking at it." /obj/machinery/power/supermatter_crystal/proc/get_status() @@ -520,7 +520,7 @@ //Makes em go mad and accumulate rads. for(var/mob/living/carbon/human/l in view(src, HALLUCINATION_RANGE(power))) // If they can see it without mesons on. Bad on them. - if(!istype(l.glasses, /obj/item/clothing/glasses/meson)) + if(!istype(l.glasses, /obj/item/clothing/glasses/meson) && !HAS_TRAIT(l, TRAIT_MESON_VISION)) var/D = sqrt(1 / max(1, get_dist(l, src))) l.hallucination += power * hallucination_power * D l.hallucination = clamp(l.hallucination, 0, 200) From 9564c2d7c1482b1409ef711b3c4986e7d7b97714 Mon Sep 17 00:00:00 2001 From: S34N <12197162+S34NW@users.noreply.github.com> Date: Mon, 5 Jul 2021 23:04:14 +0100 Subject: [PATCH 3/8] Apply suggestions from code review --- code/game/dna/mutations/powers.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/game/dna/mutations/powers.dm b/code/game/dna/mutations/powers.dm index 587d221f72d..3f5ca929221 100644 --- a/code/game/dna/mutations/powers.dm +++ b/code/game/dna/mutations/powers.dm @@ -1162,9 +1162,8 @@ name = "Meson Vision" activation_messages = list("More information seems to reach your eyes...") deactivation_messages = list("The amount of information reaching your eyes fades...") - instability = GENE_INSTABILITY_MODERATE + instability = GENE_INSTABILITY_MINOR traits_to_add = list(TRAIT_MESON_VISION) - activation_prob = 33 /datum/mutation/meson_vision/New() ..() From cce8b389c6141ce456843814c5915e572233b13f Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Mon, 5 Jul 2021 23:59:15 +0100 Subject: [PATCH 4/8] adds even more vision genes! --- code/__HELPERS/traits.dm | 2 + code/_globalvars/genetics.dm | 2 + code/_globalvars/traits.dm | 2 + code/game/dna/mutations/powers.dm | 40 ++++++++++++++++++- code/game/gamemodes/setupgame.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 11 +++++ .../living/carbon/human/species/_species.dm | 9 +++++ 7 files changed, 68 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/traits.dm b/code/__HELPERS/traits.dm index 3e52865e577..9c4911fd8a0 100644 --- a/code/__HELPERS/traits.dm +++ b/code/__HELPERS/traits.dm @@ -140,6 +140,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_DWARF "dwarf" #define TRAIT_SILENT_FOOTSTEPS "silent_footsteps" //makes your footsteps completely silent #define TRAIT_MESON_VISION "meson_vision" +#define TRAIT_FLASH_PROTECTION "flash_protection" +#define TRAIT_NIGHT_VISION "night_vision" #define TRAIT_COMIC_SANS "comic_sans" #define TRAIT_NOFINGERPRINTS "no_fingerprints" diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm index d6c290b5247..2c49057e636 100644 --- a/code/_globalvars/genetics.dm +++ b/code/_globalvars/genetics.dm @@ -30,6 +30,8 @@ GLOBAL_VAR_INIT(noprintsblock, 0) GLOBAL_VAR_INIT(shockimmunityblock, 0) GLOBAL_VAR_INIT(smallsizeblock, 0) GLOBAL_VAR_INIT(mesonblock, 0) +GLOBAL_VAR_INIT(noflashblock, 0) +GLOBAL_VAR_INIT(nightvisionblock, 0) /////////////////////////////// // Goon Stuff diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 1ad2c8fd2d4..479ebb35d62 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -46,6 +46,8 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS, "TRAIT_ALCOHOL_TOLERANCE" = TRAIT_ALCOHOL_TOLERANCE, "TRAIT_MESON_VISION" = TRAIT_MESON_VISION, + "TRAIT_FLASH_PROTECTION" = TRAIT_FLASH_PROTECTION, + "TRAIT_NIGHT_VISION" = TRAIT_NIGHT_VISION, "TRAIT_COMIC_SANS" = TRAIT_COMIC_SANS, "TRAIT_NOFINGERPRINTS" = TRAIT_NOFINGERPRINTS, diff --git a/code/game/dna/mutations/powers.dm b/code/game/dna/mutations/powers.dm index 3f5ca929221..fa2a7420c4c 100644 --- a/code/game/dna/mutations/powers.dm +++ b/code/game/dna/mutations/powers.dm @@ -1172,9 +1172,47 @@ /datum/mutation/meson_vision/activate(mob/living/M) ..() M.update_sight() - M.update_icons() /datum/mutation/meson_vision/deactivate(mob/living/M) ..() M.update_sight() + +/datum/mutation/night_vision + name = "Night Vision" + activation_messages = list("Were the lights always that bright?") + deactivation_messages = list("The ambient light level returns to normal...") + instability = GENE_INSTABILITY_MODERATE + traits_to_add = list(TRAIT_NIGHT_VISION) + +/datum/mutation/night_vision/New() + ..() + block = GLOB.nightvisionblock + +/datum/mutation/night_vision/activate(mob/living/M) + ..() + M.update_sight() M.update_icons() + +/datum/mutation/night_vision/deactivate(mob/living/M) + ..() + M.update_sight() + M.update_icons() + +/datum/mutation/flash_protection + name = "Flash Protection" + activation_messages = list("You stop noticing the glare from lights...") + deactivation_messages = list("Lights begin glaring again...") + instability = GENE_INSTABILITY_MINOR + traits_to_add = list(TRAIT_FLASH_PROTECTION) + +/datum/mutation/flash_protection/New() + ..() + block = GLOB.noflashblock + +/datum/mutation/flash_protection/activate(mob/living/M) + ..() + M.update_sight() + +/datum/mutation/flash_protection/deactivate(mob/living/M) + ..() + M.update_sight() diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index b3f7882f2e6..0ed8526387d 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -48,7 +48,9 @@ GLOB.twitchblock = getAssignedBlock("TWITCH", numsToAssign) GLOB.nervousblock = getAssignedBlock("NERVOUS", numsToAssign) GLOB.wingdingsblock = getAssignedBlock("WINGDINGS", numsToAssign) - GLOB.mesonblock = getAssignedBlock("MESONS", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.mesonblock = getAssignedBlock("MESONS", numsToAssign, good=1) + GLOB.noflashblock = getAssignedBlock("NOFLASH", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.nightvisionblock = getAssignedBlock("NIGHTVISION", numsToAssign, DNA_HARDER_BOUNDS, good=1) // Bay muts diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 5c802d535f9..79ea8a7c165 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1183,11 +1183,14 @@ so that different stomachs can handle things in different ways VB*/ grant_death_vision() return + var/obj/item/organ/internal/eyes/E = get_organ_slot("eyes") + E.flash_protect = initial(E.flash_protect) see_invisible = initial(see_invisible) see_in_dark = initial(see_in_dark) sight = initial(sight) lighting_alpha = initial(lighting_alpha) + if(client.eye != src) var/atom/A = client.eye if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. @@ -1205,6 +1208,14 @@ so that different stomachs can handle things in different ways VB*/ sight |= (SEE_TURFS) lighting_alpha = min(lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) + if(HAS_TRAIT(src, TRAIT_NIGHT_VISION)) + see_in_dark = max(see_in_dark, 8) + lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE + + if(HAS_TRAIT(src, TRAIT_FLASH_PROTECTION)) + if(E) + E.flash_protect = FLASH_PROTECTION_WELDER + SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT) sync_lighting_plane_alpha() diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 3ff0e567634..68da34cbc9d 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -842,6 +842,7 @@ It'll return null if the organ doesn't correspond, so include null checks when u H.sight |= eyes.vision_flags H.see_in_dark = eyes.see_in_dark H.see_invisible = eyes.see_invisible + eyes.flash_protect = initial(eyes.flash_protect) if(!isnull(eyes.lighting_alpha)) H.lighting_alpha = eyes.lighting_alpha else @@ -905,6 +906,14 @@ It'll return null if the organ doesn't correspond, so include null checks when u if(HAS_TRAIT(H, TRAIT_XRAY_VISION)) H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + if(HAS_TRAIT(H, TRAIT_NIGHT_VISION)) + H.see_in_dark = max(H.see_in_dark, 8) + H.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE + + if(HAS_TRAIT(H, TRAIT_FLASH_PROTECTION)) + if(eyes) + eyes.flash_protect = FLASH_PROTECTION_WELDER + if(H.has_status_effect(STATUS_EFFECT_SUMMONEDGHOST)) H.see_invisible = SEE_INVISIBLE_OBSERVER From 59b6282eeccf00fe0c22dae384de4acc0a7427c4 Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Tue, 6 Jul 2021 00:06:19 +0100 Subject: [PATCH 5/8] you cant have flash protection without eyes --- code/modules/mob/living/carbon/carbon.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 79ea8a7c165..6f3b2c4bd2b 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1184,7 +1184,8 @@ so that different stomachs can handle things in different ways VB*/ return var/obj/item/organ/internal/eyes/E = get_organ_slot("eyes") - E.flash_protect = initial(E.flash_protect) + if(E) + E.flash_protect = initial(E.flash_protect) see_invisible = initial(see_invisible) see_in_dark = initial(see_in_dark) sight = initial(sight) From 6bb8f30391b840d01278c34a45db00011c0b5fc5 Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Tue, 6 Jul 2021 14:23:18 +0100 Subject: [PATCH 6/8] optimises flash protection --- code/game/dna/mutations/powers.dm | 8 -------- code/modules/mob/living/carbon/carbon.dm | 7 ------- code/modules/mob/living/carbon/human/species/_species.dm | 5 ----- code/modules/mob/living/living.dm | 2 +- 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/code/game/dna/mutations/powers.dm b/code/game/dna/mutations/powers.dm index fa2a7420c4c..a2d96697a5e 100644 --- a/code/game/dna/mutations/powers.dm +++ b/code/game/dna/mutations/powers.dm @@ -1208,11 +1208,3 @@ /datum/mutation/flash_protection/New() ..() block = GLOB.noflashblock - -/datum/mutation/flash_protection/activate(mob/living/M) - ..() - M.update_sight() - -/datum/mutation/flash_protection/deactivate(mob/living/M) - ..() - M.update_sight() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 6f3b2c4bd2b..dafe0fcbc6c 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1183,9 +1183,6 @@ so that different stomachs can handle things in different ways VB*/ grant_death_vision() return - var/obj/item/organ/internal/eyes/E = get_organ_slot("eyes") - if(E) - E.flash_protect = initial(E.flash_protect) see_invisible = initial(see_invisible) see_in_dark = initial(see_in_dark) sight = initial(sight) @@ -1213,10 +1210,6 @@ so that different stomachs can handle things in different ways VB*/ see_in_dark = max(see_in_dark, 8) lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE - if(HAS_TRAIT(src, TRAIT_FLASH_PROTECTION)) - if(E) - E.flash_protect = FLASH_PROTECTION_WELDER - SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT) sync_lighting_plane_alpha() diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 68da34cbc9d..3021262b292 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -842,7 +842,6 @@ It'll return null if the organ doesn't correspond, so include null checks when u H.sight |= eyes.vision_flags H.see_in_dark = eyes.see_in_dark H.see_invisible = eyes.see_invisible - eyes.flash_protect = initial(eyes.flash_protect) if(!isnull(eyes.lighting_alpha)) H.lighting_alpha = eyes.lighting_alpha else @@ -910,10 +909,6 @@ It'll return null if the organ doesn't correspond, so include null checks when u H.see_in_dark = max(H.see_in_dark, 8) H.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE - if(HAS_TRAIT(H, TRAIT_FLASH_PROTECTION)) - if(eyes) - eyes.flash_protect = FLASH_PROTECTION_WELDER - if(H.has_status_effect(STATUS_EFFECT_SUMMONEDGHOST)) H.see_invisible = SEE_INVISIBLE_OBSERVER diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 23f4d829d43..916392c5ac9 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -773,7 +773,7 @@ //called when the mob receives a bright flash /mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash) - if(check_eye_prot() < intensity && (override_blindness_check || !HAS_TRAIT(src, TRAIT_BLIND))) + if(check_eye_prot() < intensity && (override_blindness_check || !HAS_TRAIT(src, TRAIT_BLIND)) && !HAS_TRAIT(src, TRAIT_FLASH_PROTECTION)) overlay_fullscreen("flash", type) addtimer(CALLBACK(src, .proc/clear_fullscreen, "flash", 25), 25) return 1 From d48906e1318a03b9d16be8784161a1ab30c9f06c Mon Sep 17 00:00:00 2001 From: S34N <12197162+S34NW@users.noreply.github.com> Date: Wed, 28 Jul 2021 17:21:48 +0100 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: SabreML <57483089+SabreML@users.noreply.github.com> --- code/__HELPERS/traits.dm | 4 ++-- code/game/gamemodes/setupgame.dm | 6 +++--- code/modules/mob/living/carbon/carbon.dm | 3 +-- code/modules/mob/living/carbon/human/species/_species.dm | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/code/__HELPERS/traits.dm b/code/__HELPERS/traits.dm index 9c4911fd8a0..9625c48e7b0 100644 --- a/code/__HELPERS/traits.dm +++ b/code/__HELPERS/traits.dm @@ -140,8 +140,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_DWARF "dwarf" #define TRAIT_SILENT_FOOTSTEPS "silent_footsteps" //makes your footsteps completely silent #define TRAIT_MESON_VISION "meson_vision" -#define TRAIT_FLASH_PROTECTION "flash_protection" -#define TRAIT_NIGHT_VISION "night_vision" +#define TRAIT_FLASH_PROTECTION "flash_protection" +#define TRAIT_NIGHT_VISION "night_vision" #define TRAIT_COMIC_SANS "comic_sans" #define TRAIT_NOFINGERPRINTS "no_fingerprints" diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 0ed8526387d..7315b52b062 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -48,9 +48,9 @@ GLOB.twitchblock = getAssignedBlock("TWITCH", numsToAssign) GLOB.nervousblock = getAssignedBlock("NERVOUS", numsToAssign) GLOB.wingdingsblock = getAssignedBlock("WINGDINGS", numsToAssign) - GLOB.mesonblock = getAssignedBlock("MESONS", numsToAssign, good=1) - GLOB.noflashblock = getAssignedBlock("NOFLASH", numsToAssign, DNA_HARDER_BOUNDS, good=1) - GLOB.nightvisionblock = getAssignedBlock("NIGHTVISION", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.mesonblock = getAssignedBlock("MESONS", numsToAssign, good=1) + GLOB.noflashblock = getAssignedBlock("NOFLASH", numsToAssign, DNA_HARDER_BOUNDS, good=1) + GLOB.nightvisionblock = getAssignedBlock("NIGHTVISION", numsToAssign, DNA_HARDER_BOUNDS, good=1) // Bay muts diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index dafe0fcbc6c..a425e35f9ab 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1188,7 +1188,6 @@ so that different stomachs can handle things in different ways VB*/ sight = initial(sight) lighting_alpha = initial(lighting_alpha) - if(client.eye != src) var/atom/A = client.eye if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. @@ -1203,7 +1202,7 @@ so that different stomachs can handle things in different ways VB*/ see_in_dark = max(see_in_dark, 8) if(HAS_TRAIT(src, TRAIT_MESON_VISION)) - sight |= (SEE_TURFS) + sight |= SEE_TURFS lighting_alpha = min(lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) if(HAS_TRAIT(src, TRAIT_NIGHT_VISION)) diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 3021262b292..f7cc37fbd8b 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -895,7 +895,7 @@ It'll return null if the organ doesn't correspond, so include null checks when u H.lighting_alpha = min(H.vision_type.lighting_alpha, H.lighting_alpha) if(HAS_TRAIT(H, TRAIT_MESON_VISION)) - H.sight |= (SEE_TURFS) + H.sight |= SEE_TURFS H.lighting_alpha = min(H.lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) if(HAS_TRAIT(H, TRAIT_THERMAL_VISION)) From 1942cee972ec544d8e47b36a9df609308ec923b6 Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Wed, 28 Jul 2021 17:55:01 +0100 Subject: [PATCH 8/8] eyeshine properly applied --- code/game/dna/mutations/disabilities.dm | 8 ++++++-- code/game/dna/mutations/powers.dm | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/code/game/dna/mutations/disabilities.dm b/code/game/dna/mutations/disabilities.dm index bcb11eb1631..a03c686140a 100644 --- a/code/game/dna/mutations/disabilities.dm +++ b/code/game/dna/mutations/disabilities.dm @@ -140,12 +140,16 @@ /datum/mutation/disability/colourblindness/activate(mob/M) ..() M.update_client_colour() //Handle the activation of the colourblindness on the mob. - M.update_icons() //Apply eyeshine as needed. + if(ishuman(M)) + var/mob/living/carbon/human/H = M + H.update_misc_effects() /datum/mutation/disability/colourblindness/deactivate(mob/M) ..() M.update_client_colour() //Handle the deactivation of the colourblindness on the mob. - M.update_icons() //Remove eyeshine as needed. + if(ishuman(M)) + var/mob/living/carbon/human/H = M + H.update_misc_effects() /datum/mutation/disability/deaf name = "Deafness" diff --git a/code/game/dna/mutations/powers.dm b/code/game/dna/mutations/powers.dm index a2d96697a5e..035703e32f0 100644 --- a/code/game/dna/mutations/powers.dm +++ b/code/game/dna/mutations/powers.dm @@ -1191,12 +1191,16 @@ /datum/mutation/night_vision/activate(mob/living/M) ..() M.update_sight() - M.update_icons() + if(ishuman(M)) + var/mob/living/carbon/human/H = M + H.update_misc_effects() /datum/mutation/night_vision/deactivate(mob/living/M) ..() M.update_sight() - M.update_icons() + if(ishuman(M)) + var/mob/living/carbon/human/H = M + H.update_misc_effects() /datum/mutation/flash_protection name = "Flash Protection"