From 4e433a463ce91140f6125908d100ac77cfaa07a6 Mon Sep 17 00:00:00 2001 From: LordME <58342752+TheLordME@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:09:03 +0200 Subject: [PATCH] Blindness_rework (#6479) ## About The Pull Request changes how blindness is handled in game temporary sources of blindness add a status effect to the affected mob while permanent sources (such as missing eyes/vision organs) add the traits ## Why It's Good For The Game blinding code was a mess (and still isnt perfect) this makes it slightly more reasonable ## Changelog :cl: refactor: refactored blinding code /:cl: --- citadel.dme | 1 + code/__DEFINES/mobs/mobs.dm | 2 + code/__DEFINES/traits/mob.dm | 19 +++++++ code/__DEFINES/traits/unsorted.dm | 6 --- code/datums/status_effects/basic/sight.dm | 14 +++++ .../changeling/powers/blind_sting.dm | 7 +-- code/game/gamemodes/cult/runes.dm | 8 ++- .../technomancer/spells/insert/mend_organs.dm | 2 +- .../technomancer/spells/mend_organs.dm | 2 +- code/game/machinery/adv_med.dm | 6 +-- code/game/machinery/doors/airlock/airlock.dm | 2 +- code/game/machinery/doors/door.dm | 2 +- code/game/machinery/flasher.dm | 5 +- code/game/objects/items.dm | 9 ---- .../items/devices/communicator/phone.dm | 4 +- code/game/objects/items/devices/flash.dm | 4 +- code/game/objects/items/devices/flashlight.dm | 2 +- .../objects/items/devices/laserpointer.dm | 2 +- code/game/objects/items/devices/translator.dm | 2 +- code/game/objects/items/shooting_range.dm | 2 +- code/game/objects/items/tools/weldingtool.dm | 4 +- .../items/weapons/implants/neuralbasic.dm | 2 +- .../structures/crates_lockers/__closet.dm | 2 +- code/game/objects/structures/morgue.dm | 2 +- .../atmospherics/environmental/zas/phoron.dm | 4 +- code/modules/clothing/glasses/_glasses.dm | 9 +++- code/modules/mining/ore.dm | 4 +- code/modules/mob/_modifiers/modifiers.dm | 18 ++++--- code/modules/mob/_modifiers/traits_phobias.dm | 12 ++--- code/modules/mob/_modifiers/unholy.dm | 2 +- code/modules/mob/grab.dm | 4 +- code/modules/mob/hear_say.dm | 4 +- .../mob/living/carbon/alien/alien_attacks.dm | 8 +-- .../mob/living/carbon/alien/alien_damage.dm | 2 +- code/modules/mob/living/carbon/alien/life.dm | 17 ++---- code/modules/mob/living/carbon/brain/life.dm | 36 ++++++------- code/modules/mob/living/carbon/breathe.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 6 ++- .../mob/living/carbon/human/human_powers.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 52 ++++++------------- .../living/carbon/human/traits/negative.dm | 7 +-- code/modules/mob/living/defense.dm | 2 +- code/modules/mob/living/health.dm | 4 +- code/modules/mob/living/life.dm | 15 +++--- code/modules/mob/living/living.dm | 17 +----- code/modules/mob/living/silicon/robot/life.dm | 18 ++----- code/modules/mob/living/silicon/silicon.dm | 2 +- code/modules/mob/living/simple_mob/defense.dm | 2 +- .../simple_mob/subtypes/animal/pets/dog.dm | 2 +- .../simple_mob/subtypes/animal/sif/kururak.dm | 4 +- .../subtypes/occult/constructs/shade.dm | 2 +- .../subtypes/occult/living_statue.dm | 2 +- code/modules/mob/login.dm | 2 + code/modules/mob/mob.dm | 2 +- code/modules/mob/mob_defines.dm | 2 - code/modules/mob/mob_helpers.dm | 2 +- code/modules/mob/observer/dead/dead.dm | 1 - code/modules/mob/status_procs.dm | 17 +++--- code/modules/nifsoft/nif.dm | 2 +- .../nifsoft/software/13_soulcatcher.dm | 4 +- code/modules/organs/internal/subtypes/eyes.dm | 4 +- .../overmap/legacy/ships/computers/ship.dm | 2 +- code/modules/projectiles/gun.dm | 2 +- code/modules/projectiles/projectile/energy.dm | 2 +- .../projectiles/projectile/energy_vr.dm | 3 -- .../targeting/targeting_overlay.dm | 2 +- .../Chemistry-Reagents-Food-Drinks.dm | 4 +- .../reagents/Chemistry-Reagents-Medicine.dm | 7 ++- .../reagents/Chemistry-Reagents-Other.dm | 2 +- code/modules/species/outsider/celestials.dm | 2 + code/modules/species/outsider/replicant.dm | 2 + code/modules/species/outsider/scori.dm | 2 + code/modules/species/outsider/shadow.dm | 2 + code/modules/species/outsider/skeleton.dm | 2 + code/modules/species/outsider/vox.dm | 1 + code/modules/species/promethean/promethean.dm | 1 + code/modules/species/protean/protean.dm | 1 + code/modules/species/shadekin/shadekin.dm | 3 +- .../species/shadekin/shadekin_blackeyed.dm | 1 + code/modules/species/species.dm | 4 -- code/modules/species/station/adherent.dm | 1 + code/modules/species/station/alraune.dm | 2 + code/modules/species/station/apidaen.dm | 1 + .../modules/species/station/custom_species.dm | 2 + code/modules/species/station/diona.dm | 1 + code/modules/species/station/golem.dm | 2 + code/modules/species/station/monkey.dm | 2 + code/modules/species/station/phoronoids.dm | 1 + code/modules/species/station/rapala.dm | 2 + .../modules/species/station/standard/akula.dm | 2 + .../modules/species/station/standard/harpy.dm | 2 + .../modules/species/station/standard/human.dm | 1 + .../species/station/standard/krisitik.dm | 1 + code/modules/species/station/standard/moth.dm | 1 + .../species/station/standard/naramadi.dm | 1 + .../species/station/standard/nevrean.dm | 1 + .../species/station/standard/shadekin.dm | 1 + .../species/station/standard/skrell.dm | 1 + .../species/station/standard/tajaran.dm | 1 + .../species/station/standard/teshari.dm | 1 + .../species/station/standard/unathi.dm | 1 + .../species/station/standard/vulpkanin.dm | 1 + .../species/station/standard/zaddat.dm | 1 + .../species/station/standard/zorren.dm | 2 + code/modules/species/station/vasilissan.dm | 1 + code/modules/species/station/werebeast.dm | 1 + code/modules/species/station/xenochimera.dm | 4 +- .../modules/species/virtual_reality/avatar.dm | 1 + .../species/xenomorphs/alien_species.dm | 1 + code/modules/spells/spellbook.dm | 4 +- code/modules/spells/targeted/targeted.dm | 2 +- code/modules/surgery/organs_internal.dm | 2 - code/modules/surgery/robotics.dm | 2 - code/modules/tgui/modules/overmap.dm | 2 +- code/modules/virus2/effect.dm | 2 +- 115 files changed, 257 insertions(+), 248 deletions(-) create mode 100644 code/datums/status_effects/basic/sight.dm diff --git a/citadel.dme b/citadel.dme index 65b232cb89c..dfe20ab3f2a 100644 --- a/citadel.dme +++ b/citadel.dme @@ -880,6 +880,7 @@ #include "code\datums\status_effects\status_effect.dm" #include "code\datums\status_effects\basic\crusher_track.dm" #include "code\datums\status_effects\basic\incapacitation.dm" +#include "code\datums\status_effects\basic\sight.dm" #include "code\datums\status_effects\grouped\crusher_mark.dm" #include "code\datums\status_effects\grouped\staggered.dm" #include "code\datums\underwear\bottom.dm" diff --git a/code/__DEFINES/mobs/mobs.dm b/code/__DEFINES/mobs/mobs.dm index 97836826670..3b37ef5bf0b 100644 --- a/code/__DEFINES/mobs/mobs.dm +++ b/code/__DEFINES/mobs/mobs.dm @@ -284,3 +284,5 @@ //* misc /// how far you have to shift to not be bumped by people #define WALLFLOWERING_PIXEL_SHIFT 8 + + diff --git a/code/__DEFINES/traits/mob.dm b/code/__DEFINES/traits/mob.dm index 8e4d0986bbb..bde5e1fddfd 100644 --- a/code/__DEFINES/traits/mob.dm +++ b/code/__DEFINES/traits/mob.dm @@ -68,3 +68,22 @@ DATUM_TRAIT(/mob, TRAIT_UNOBSERVANT) /// This mob can't digest alcohol #define TRAIT_ALCOHOL_INTOLERANT "alcohol_intolerant" DATUM_TRAIT(/mob, TRAIT_ALCOHOL_INTOLERANT) + +//Disabilities +#define TRAIT_BLIND "blind" +DATUM_TRAIT(/mob, TRAIT_BLIND) +#define TRAIT_MUTE "mute" +DATUM_TRAIT(/mob, TRAIT_MUTE) +#define TRAIT_DEAF "deaf" +DATUM_TRAIT(/mob, TRAIT_DEAF) + +//! Blindness causes +#define TRAIT_BLINDNESS_NO_EYES "No Eyes" +#define TRAIT_BLINDNESS_SPECIES "Species cant see" +#define TRAIT_BLINDNESS_VIS_ORGAN_MISSING "Missing Vision_organ" +#define TRAIT_BLINDNESS_CAMERA "Broken Camera on synth" +#define TRAIT_BLINDNESS_EYE_DMG "severe Eye damage" +#define TRAIT_BLINDNESS_DISABILITY "sdisability nervous" +#define TRAIT_BLINDNESS_STATUS_EFF "Status Effect: Blindness" +#define TRAIT_BLINDNESS_NEGATIV "Negative custom trait" + diff --git a/code/__DEFINES/traits/unsorted.dm b/code/__DEFINES/traits/unsorted.dm index 6f912c83f21..bd77b3c1c9a 100644 --- a/code/__DEFINES/traits/unsorted.dm +++ b/code/__DEFINES/traits/unsorted.dm @@ -3,12 +3,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming traits. */ -//mob traits -#define TRAIT_BLIND "blind" -#define TRAIT_MUTE "mute" - -#define TRAIT_DEAF "deaf" - ///Tracks whether we're gonna be a baby alien's mummy. #define TRAIT_XENO_HOST "xeno_host" diff --git a/code/datums/status_effects/basic/sight.dm b/code/datums/status_effects/basic/sight.dm new file mode 100644 index 00000000000..c96bf007b6d --- /dev/null +++ b/code/datums/status_effects/basic/sight.dm @@ -0,0 +1,14 @@ +/** + * Sight impairments that are currently handled by wierd procs they dont really fit into + */ +/datum/status_effect/sight/blindness + identifier = "Blindness" + +/datum/status_effect/sight/blindness/on_apply() + . = ..() + owner.add_blindness_source(TRAIT_BLINDNESS_STATUS_EFF) + +/datum/status_effect/sight/blindness/on_remove() + . = ..() + owner.remove_blindness_source(TRAIT_BLINDNESS_STATUS_EFF) + diff --git a/code/game/gamemodes/changeling/powers/blind_sting.dm b/code/game/gamemodes/changeling/powers/blind_sting.dm index 83404b91084..6aea23cc479 100644 --- a/code/game/gamemodes/changeling/powers/blind_sting.dm +++ b/code/game/gamemodes/changeling/powers/blind_sting.dm @@ -17,14 +17,11 @@ return 0 add_attack_logs(src,T,"Blind sting (changeling)") to_chat(T, "Your eyes burn horrificly!") - T.disabilities |= DISABILITY_NEARSIGHTED var/duration = 300 if(src.mind.changeling.recursive_enhancement) duration = duration + 150 to_chat(src, "They will be deprived of sight for longer.") - spawn(duration) - T.disabilities &= ~DISABILITY_NEARSIGHTED - T.Blind(10) - T.eye_blurry = 20 + T.apply_status_effect(/datum/status_effect/sight/blindness, duration) + T.eye_blurry = duration * 1.2 feedback_add_details("changeling_powers","BS") return 1 diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 0375200cba3..1ce654af189 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -278,7 +278,7 @@ var/list/sacrificed = list() if(I.damage > 0) I.damage = max(I.damage - 5, 0) //Heals 5 damage per organ per use if(I.damage <= 5 && I.organ_tag == O_EYES) - H.sdisabilities &= ~SDISABILITY_NERVOUS + H.remove_blindness_source(TRAIT_BLINDNESS_EYE_DMG) // check their limbs for(var/obj/item/organ/E in H.bad_external_organs) var/obj/item/organ/external/affected = E @@ -944,11 +944,9 @@ var/list/sacrificed = list() if(N) continue C.eye_blurry += 50 - C.Blind(20) + C.apply_status_effect(/datum/status_effect/sight/blindness, 20 SECONDS) if(prob(5)) C.disabilities |= DISABILITY_NEARSIGHTED - if(prob(10)) - C.sdisabilities |= SDISABILITY_NERVOUS C.show_message("Suddenly you see a red flash that blinds you.", 3) affected += C if(affected.len) @@ -967,7 +965,7 @@ var/list/sacrificed = list() if(N) continue C.eye_blurry += 30 - C.Blind(10) + C.apply_status_effect(/datum/status_effect/sight/blindness, 10 SECONDS) //talismans is weaker. affected += C C.show_message("You feel a sharp pain in your eyes, and the world disappears into darkness..", 3) diff --git a/code/game/gamemodes/technomancer/spells/insert/mend_organs.dm b/code/game/gamemodes/technomancer/spells/insert/mend_organs.dm index bf71ead2f5f..fe49d37195c 100644 --- a/code/game/gamemodes/technomancer/spells/insert/mend_organs.dm +++ b/code/game/gamemodes/technomancer/spells/insert/mend_organs.dm @@ -31,7 +31,7 @@ if(O.damage > 0) // Fix internal damage O.damage = max(O.damage - (heal_power / 5), 0) if(O.damage <= 5 && O.organ_tag == O_EYES) // Fix eyes - H.sdisabilities &= ~SDISABILITY_NERVOUS + H.remove_blindness_source(TRAIT_BLINDNESS_EYE_DMG) for(var/obj/item/organ/external/O in H.organs) // Fix limbs if(!O.robotic < ORGAN_ROBOT) // No robot parts for this. diff --git a/code/game/gamemodes/technomancer/spells/mend_organs.dm b/code/game/gamemodes/technomancer/spells/mend_organs.dm index 296afcc9740..9a2b3827336 100644 --- a/code/game/gamemodes/technomancer/spells/mend_organs.dm +++ b/code/game/gamemodes/technomancer/spells/mend_organs.dm @@ -35,7 +35,7 @@ if(O.damage > 0) // Fix internal damage O.heal_damage_i(heal_power / 2) if(O.damage <= 5 && O.organ_tag == O_EYES) // Fix eyes - H.sdisabilities &= ~SDISABILITY_NERVOUS + H.remove_blindness_source(TRAIT_BLINDNESS_EYE_DMG) for(var/obj/item/organ/external/O in H.organs) // Fix limbs if(!O.robotic < ORGAN_ROBOT) // No robot parts for this. diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index a9948a02049..c694e19bbdd 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -386,7 +386,7 @@ occupantData["intOrgan"] = intOrganData - occupantData["blind"] = (H.sdisabilities & SDISABILITY_NERVOUS) + occupantData["blind"] = (HAS_TRAIT(H, TRAIT_BLIND)) occupantData["nearsighted"] = (H.disabilities & DISABILITY_NEARSIGHTED) occupantData = attempt_vr(scanner,"get_occupant_data_vr",list(occupantData,H)) data["occupant"] = occupantData @@ -597,8 +597,8 @@ dat += "[i.name]N/A[i.damage][infection]:[mech][i_dead]" dat += "" dat += "" - if(occupant.sdisabilities & SDISABILITY_NERVOUS) - dat += "Cataracts detected.
" + if(HAS_TRAIT(occupant, TRAIT_BLIND)) + dat += "Severe impairment of the eyes or visual nerves detected.
" if(occupant.disabilities & DISABILITY_NEARSIGHTED) dat += "Retinal misalignment detected.
" else diff --git a/code/game/machinery/doors/airlock/airlock.dm b/code/game/machinery/doors/airlock/airlock.dm index f587a639b8a..b5249d4c538 100644 --- a/code/game/machinery/doors/airlock/airlock.dm +++ b/code/game/machinery/doors/airlock/airlock.dm @@ -865,7 +865,7 @@ About the new airlock wires panel: lock() . = ..() for (var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) O.show_message("[src.name]'s control panel bursts open, sparks spewing out!") var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 645acadfb23..eb6b243859f 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -284,7 +284,7 @@ // todo: this is shitcode if(!istype(src, /obj/machinery/door/airlock)) for (var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) O.show_message("[src.name] breaks!" ) update_icon() diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 347e1a84ec9..0dc55edd94e 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -90,9 +90,10 @@ H.flash_eyes() E.damage += rand(1, 5) else - if(!O.blinded && isliving(O)) + if(isliving(O)) var/mob/living/L = O - L.flash_eyes() + if(!L.has_status_effect(/datum/status_effect/sight/blindness)) + L.flash_eyes() O.afflict_paralyze(20 * flash_time) /obj/machinery/flasher/emp_act(severity) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 94bf8beecc7..6e2b8fee56c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -584,15 +584,6 @@ user.do_attack_animation(M) src.add_fingerprint(user) - //if((MUTATION_CLUMSY in user.mutations) && prob(50)) - // M = user - /* - to_chat(M, "You stab yourself in the eye.") - M.sdisabilities |= SDISABILITY_NERVOUS - M.weakened += 4 - M.adjustBruteLoss(10) - */ - if(istype(H)) var/obj/item/organ/internal/eyes/eyes = H.internal_organs_by_name[O_EYES] diff --git a/code/game/objects/items/devices/communicator/phone.dm b/code/game/objects/items/devices/communicator/phone.dm index 53799e116cc..dd350e74d84 100644 --- a/code/game/objects/items/devices/communicator/phone.dm +++ b/code/game/objects/items/devices/communicator/phone.dm @@ -328,14 +328,14 @@ // Proc: connect_video() // Parameters: user - the mob doing the viewing of video, comm - the communicator at the far end // Description: Sets up a videocall and puts the first view into it using watch_video, and updates the icon -/obj/item/communicator/proc/connect_video(mob/user,obj/item/communicator/comm) +/obj/item/communicator/proc/connect_video(mob/living/user,obj/item/communicator/comm) if((!user) || (!comm) || user.stat) return //KO or dead, or already in a video if(video_source) //Already in a video to_chat(user, "You are already connected to a video call!") return - if(user.blinded) //User is blinded + if(user.has_status_effect(/datum/status_effect/sight/blindness)) //User is blinded to_chat(user, "You cannot see well enough to do that!") return diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index aab42892826..ac803e70322 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -198,7 +198,7 @@ if(flash_strength > 0) H.Confuse(flash_strength + 5) H.afflict_stagger(FLASH_TRAIT, stagger_strength, stagger_duration) - H.Blind(flash_strength) + H.apply_status_effect(/datum/status_effect/sight/blindness, flash_strength SECONDS) H.eye_blurry = max(H.eye_blurry, flash_strength + 5) H.flash_eyes() H.adjustHalLoss(halloss_per_flash * (flash_strength / 5)) // Should take four flashes to stun. @@ -273,7 +273,7 @@ for(var/mob/living/carbon/C in oviewers(3, null)) var/safety = C.eyecheck() if(!safety) - if(!C.blinded) + if(!C.has_status_effect(/datum/status_effect/sight/blindness)) C.flash_eyes() return diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index ad47a2cfaff..fb3b406844c 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -166,7 +166,7 @@ user.visible_message(SPAN_NOTICE("\The [user] directs [src] to [L]'s eyes."), \ SPAN_NOTICE("You direct [src] to [L]'s eyes.")) if(H != user) //can't look into your own eyes buster - if(L.stat == DEAD || L.blinded) //mob is dead or fully blind + if(L.stat == DEAD || L.has_status_effect(/datum/status_effect/sight/blindness)) //mob is dead or fully blind to_chat(user, SPAN_WARNING("\The [L]'s pupils do not react to the light!")) return if(MUTATION_XRAY in L.mutations) diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index dc4f77309e9..91865cec554 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -104,7 +104,7 @@ //eye target check, will return -1 to 2 var/eye_prot = C.eyecheck() - if(C.blinded) + if(C.has_status_effect(/datum/status_effect/sight/blindness)) eye_prot = 4 var/severity = (rand(0, 1) + diode.rating - eye_prot) var/mob/living/carbon/human/H = C diff --git a/code/game/objects/items/devices/translator.dm b/code/game/objects/items/devices/translator.dm index a80be8e302c..3165fa9f381 100644 --- a/code/game/objects/items/devices/translator.dm +++ b/code/game/objects/items/devices/translator.dm @@ -138,7 +138,7 @@ if (language && (language.language_flags & LANGUAGE_NONVERBAL)) return //Not gonna translate sign language - if (visual && ((L.sdisabilities & SDISABILITY_NERVOUS) || L.eye_blind)) + if (visual && L.has_status_effect(/datum/status_effect/sight/blindness)) return //Can't see the screen, don't get the message if (audio && ((L.sdisabilities & SDISABILITY_DEAF) || L.ear_deaf)) diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index f5a60eb0d67..6c38e5f1a3c 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -83,7 +83,7 @@ hp -= Proj.damage if(hp <= 0) for(var/mob/O in oviewers()) - if ((O.client && !( O.blinded ))) + if ((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) to_chat(O, "\The [src] breaks into tiny pieces and collapses!") qdel(src) diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 377eb9947ca..57b801eb50f 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -315,10 +315,10 @@ if (E.damage >= E.min_broken_damage) to_chat(user, "You go blind!") - user.sdisabilities |= SDISABILITY_NERVOUS + user.remove_blindness_source( TRAIT_BLINDNESS_EYE_DMG) else if (E.damage >= E.min_bruised_damage) to_chat(user, "You go blind!") - user.Blind(5) + user.apply_status_effect(/datum/status_effect/sight/blindness, 5 SECONDS) user.eye_blurry = 5 user.disabilities |= DISABILITY_NEARSIGHTED spawn(100) diff --git a/code/game/objects/items/weapons/implants/neuralbasic.dm b/code/game/objects/items/weapons/implants/neuralbasic.dm index 9a2fb232857..027603b600d 100644 --- a/code/game/objects/items/weapons/implants/neuralbasic.dm +++ b/code/game/objects/items/weapons/implants/neuralbasic.dm @@ -101,7 +101,7 @@ Implant Specifics:
"} if(robotic_brain) to_chat(H, "WARNING. Fault dete-ct-- in the \the [src].") H.Confuse(30) - H.AdjustBlinded(5) + H.apply_status_effect(/datum/status_effect/sight/blindness, 5 SECONDS) my_brain.take_damage(15) my_brain = null return diff --git a/code/game/objects/structures/crates_lockers/__closet.dm b/code/game/objects/structures/crates_lockers/__closet.dm index 672505e8b44..2ff7861ae67 100644 --- a/code/game/objects/structures/crates_lockers/__closet.dm +++ b/code/game/objects/structures/crates_lockers/__closet.dm @@ -591,7 +591,7 @@ locked = !locked playsound(src, 'sound/machines/click.ogg', 15, 1, -3) for(var/mob/O in viewers(user, 3)) - if((O.client && !( O.blinded ))) + if((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) to_chat(O, "The locker has been [locked ? null : "un"]locked by [user].") update_icon() else diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index a8d1e3fddaa..18b979d9bbd 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -197,7 +197,7 @@ O.forceMove(src.loc) if (user != O) for(var/mob/B in viewers(user, 3)) - if ((B.client && !( B.blinded ))) + if ((B.client && !( B.has_status_effect(/datum/status_effect/sight/blindness) ))) to_chat(B, "\The [user] stuffs [O] into [src]!") return diff --git a/code/modules/atmospherics/environmental/zas/phoron.dm b/code/modules/atmospherics/environmental/zas/phoron.dm index 894038af9bc..7089db16013 100644 --- a/code/modules/atmospherics/environmental/zas/phoron.dm +++ b/code/modules/atmospherics/environmental/zas/phoron.dm @@ -110,9 +110,9 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') to_chat(src, "Your eyes burn!") E.damage += 2.5 eye_blurry = min(eye_blurry+1.5,50) - if (prob(max(0,E.damage - 15) + 1) &&!eye_blind) + if (prob(max(0,E.damage - 15) + 1) && !has_status_effect(/datum/status_effect/sight/blindness)) to_chat(src, "You are blinded!") - Blind(20) + apply_status_effect(/datum/status_effect/sight/blindness, 3 SECONDS) /mob/living/carbon/human/proc/pl_head_protected() CACHE_VSC_PROP(atmos_vsc, /atmos/phoron/phoronguard_only, phoronguard_only) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index e46774c284c..0e673307595 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -480,6 +480,13 @@ BLIND // can't see anything drop_sound = 'sound/items/drop/gloves.ogg' pickup_sound = 'sound/items/pickup/gloves.ogg' +/*obj/item/clothing/glasses/sunglasses/blindfold/equipped(mob/user, slot, flags) + . = ..() + if(ishuman(loc)) + var/mob/living/carbon/human/H = user + loc.add_modifier(/datum/modifier/sight/blindness)*/ + + /obj/item/clothing/glasses/sunglasses/blindfold/tape name = "length of tape" desc = "It's a robust DIY blindfold!" @@ -610,7 +617,7 @@ BLIND // can't see anything var/mob/living/carbon/human/M = src.loc to_chat(M, "The Optical Thermal Scanner overloads and blinds you!") if(M.glasses == src) - M.Blind(3) + M.apply_status_effect(/datum/status_effect/sight/blindness, 3 SECONDS) M.eye_blurry = 5 // Don't cure being nearsighted if(!(M.disabilities & DISABILITY_NEARSIGHTED)) diff --git a/code/modules/mining/ore.dm b/code/modules/mining/ore.dm index bbd9c744111..b156263848a 100644 --- a/code/modules/mining/ore.dm +++ b/code/modules/mining/ore.dm @@ -82,7 +82,7 @@ var/mob/living/carbon/human/H = hit_atom if(istype(H) && H.has_eyes() && prob(85)) to_chat(H, "Some of \the [src] gets in your eyes!") - H.Blind(5) + H.apply_status_effect(/datum/status_effect/sight/blindness, 5 SECONDS) H.eye_blurry += 10 spawn(1) if(isturf(loc)) @@ -142,7 +142,7 @@ var/mob/living/carbon/human/H = hit_atom if(istype(H) && H.has_eyes() && prob(85)) to_chat(H, "Some of \the [src] gets in your eyes!") - H.Blind(10) + H.apply_status_effect(/datum/status_effect/sight/blindness, 10 SECONDS) H.eye_blurry += 15 spawn(1) if(isturf(loc)) diff --git a/code/modules/mob/_modifiers/modifiers.dm b/code/modules/mob/_modifiers/modifiers.dm index 5a6ff0d75b8..e8def4f1695 100644 --- a/code/modules/mob/_modifiers/modifiers.dm +++ b/code/modules/mob/_modifiers/modifiers.dm @@ -168,7 +168,7 @@ // Call this to add a modifier to a mob. First argument is the modifier type you want, second is how long it should last, in ticks. // Third argument is the 'source' of the modifier, if it's from someone else. If null, it will default to the mob being applied to. // The SECONDS/MINUTES macro is very helpful for this. E.g. M.add_modifier(/datum/modifier/example, 5 MINUTES) -/mob/living/proc/add_modifier(var/modifier_type, var/expire_at = null, var/mob/living/origin = null) +/mob/living/proc/add_modifier(var/modifier_type, var/duration = null, var/mob/living/origin = null, silent = FALSE) // First, check if the mob already has this modifier. for(var/datum/modifier/M in modifiers) if(ispath(modifier_type, M)) @@ -179,8 +179,8 @@ break // No point checking anymore. if(MODIFIER_STACK_EXTEND) // Not allow to add a second instance, but we can try to prolong the first instance. - if(expire_at && world.time + expire_at > M.expire_at) - M.expire_at = world.time + expire_at + if(duration && world.time + duration > M.expire_at) + M.expire_at = world.time + duration return // If we're at this point, the mob doesn't already have it, or it does but stacking is allowed. @@ -188,9 +188,9 @@ if(!mod.can_apply(src)) qdel(mod) return - if(expire_at) - mod.expire_at = world.time + expire_at - if(mod.on_created_text) + if(duration) + mod.expire_at = world.time + duration + if(mod.on_created_text && !silent) to_chat(src, mod.on_created_text) modifiers.Add(mod) mod.on_applied() @@ -226,9 +226,13 @@ M.expire(silent) // Checks if the mob has a modifier type. -/mob/living/proc/has_modifier_of_type(var/modifier_type) +/mob/living/has_modifier_of_type(var/modifier_type) return get_modifier_of_type(modifier_type) ? TRUE : FALSE +// Always False, just so I can replace blinded checks with modifier checks +/mob/proc/has_modifier_of_type(var/modifier_type) + return FALSE + // Gets the first instance of a specific modifier type or subtype. /mob/living/proc/get_modifier_of_type(var/modifier_type) for(var/datum/modifier/M in modifiers) diff --git a/code/modules/mob/_modifiers/traits_phobias.dm b/code/modules/mob/_modifiers/traits_phobias.dm index 9c22213a65f..e3d33f6193b 100644 --- a/code/modules/mob/_modifiers/traits_phobias.dm +++ b/code/modules/mob/_modifiers/traits_phobias.dm @@ -99,7 +99,7 @@ ..() /datum/modifier/trait/phobia/haemophobia/should_fear() - if(holder.blinded) + if(holder.has_status_effect(/datum/status_effect/sight/blindness)) return 0 // Can't fear what cannot be seen. var/fear_amount = 0 @@ -190,7 +190,7 @@ ) /datum/modifier/trait/phobia/arachnophobe/should_fear() - if(holder.blinded) + if(holder.has_status_effect(/datum/status_effect/sight/blindness)) return 0 // Can't fear what cannot be seen. var/fear_amount = 0 @@ -256,7 +256,7 @@ ) /datum/modifier/trait/phobia/nyctophobe/should_fear() - if(holder.blinded) + if(holder.has_status_effect(/datum/status_effect/sight/blindness)) return 5 // Unlike most other fears coded here, being blind when afraid of darkness is pretty bad, I imagine. if(holder.see_in_dark >= 5) @@ -333,7 +333,7 @@ ) /datum/modifier/trait/phobia/claustrophobe/should_fear() - if(holder.blinded) + if(holder.has_status_effect(/datum/status_effect/sight/blindness)) return 0 // No idea if this is accurate. if(holder.loc && !isturf(holder.loc)) // Hiding in a locker or inside an exosuit is spooky. @@ -396,7 +396,7 @@ ) /datum/modifier/trait/phobia/blennophobe/should_fear() - if(holder.blinded) + if(holder.has_status_effect(/datum/status_effect/sight/blindness)) return 0 // Can't fear what cannot be seen. var/fear_amount = 0 @@ -484,7 +484,7 @@ ) /datum/modifier/trait/phobia/trypanophobe/should_fear() - if(holder.blinded) + if(holder.has_status_effect(/datum/status_effect/sight/blindness)) return 0 //Cannot feareth what cannot beest seen var/fear_amount = 0 diff --git a/code/modules/mob/_modifiers/unholy.dm b/code/modules/mob/_modifiers/unholy.dm index 12fb739a884..b7cac38a01e 100644 --- a/code/modules/mob/_modifiers/unholy.dm +++ b/code/modules/mob/_modifiers/unholy.dm @@ -125,7 +125,7 @@ if(O.damage > 0) // Fix internal damage O.damage = max(O.damage - 2, 0) if(O.damage <= 5 && O.organ_tag == O_EYES) // Fix eyes - H.sdisabilities &= ~SDISABILITY_NERVOUS + H.remove_blindness_source(TRAIT_BLINDNESS_EYE_DMG) for(var/obj/item/organ/external/O in H.organs) // Fix limbs, no matter if they are Man or Machine. O.heal_damage(rand(1,3), rand(1,3), internal = 1, robo_repair = 1) diff --git a/code/modules/mob/grab.dm b/code/modules/mob/grab.dm index addd4435ccb..aad94cc6f47 100644 --- a/code/modules/mob/grab.dm +++ b/code/modules/mob/grab.dm @@ -219,8 +219,8 @@ if(O_EYES) if(announce) assailant.visible_message("[assailant] covers [affecting]'s eyes!") - if(affecting.eye_blind < 3) - affecting.Blind(3) + if(!affecting.has_status_effect(/datum/status_effect/sight/blindness)) + affecting.apply_status_effect(/datum/status_effect/sight/blindness, 3 SECONDS) /obj/item/grab/attack_self(mob/user) . = ..() diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 73cc416affc..90aa8bd5ce2 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -26,7 +26,7 @@ //non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet. if (language && (language.language_flags & LANGUAGE_NONVERBAL)) - if (!speaker || (src.sdisabilities & SDISABILITY_NERVOUS || src.blinded) || !(speaker in view(src))) + if (!speaker || src.has_status_effect(/datum/status_effect/sight/blindness) || !(speaker in view(src))) message = stars(message) @@ -168,7 +168,7 @@ //non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet. if (language && (language.language_flags & LANGUAGE_NONVERBAL)) - if (!speaker || (src.sdisabilities & SDISABILITY_NERVOUS || src.blinded) || !(speaker in view(src))) + if (!speaker || src.has_status_effect(/datum/status_effect/sight/blindness) || !(speaker in view(src))) message = stars(message) if(!(language && (language.language_flags & LANGUAGE_INNATE))) // skip understanding checks for LANGUAGE_INNATE languages diff --git a/code/modules/mob/living/carbon/alien/alien_attacks.dm b/code/modules/mob/living/carbon/alien/alien_attacks.dm index 42f7735e2bb..bac33078a13 100644 --- a/code/modules/mob/living/carbon/alien/alien_attacks.dm +++ b/code/modules/mob/living/carbon/alien/alien_attacks.dm @@ -31,7 +31,7 @@ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) O.show_message("[L] has grabbed [src] passively!", 1) else @@ -46,18 +46,18 @@ step_away(src,L,15) playsound(loc, "punch", 25, 1, -1) for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) O.show_message("[L] has punched [src]!", 1) if (damage > 4.9) afflict_paralyze(20 * rand(10,15)) for(var/mob/O in viewers(L, null)) - if ((O.client && !( O.blinded ))) + if ((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) O.show_message("[L] has weakened [src]!", 1, "You hear someone fall.", 2) adjustBruteLoss(damage) update_health() else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) O.show_message("[L] has attempted to punch [src]!", 1) return diff --git a/code/modules/mob/living/carbon/alien/alien_damage.dm b/code/modules/mob/living/carbon/alien/alien_damage.dm index d185e96d7d8..8da46c15bbd 100644 --- a/code/modules/mob/living/carbon/alien/alien_damage.dm +++ b/code/modules/mob/living/carbon/alien/alien_damage.dm @@ -1,6 +1,6 @@ /mob/living/carbon/alien/legacy_ex_act(severity) - if(!blinded) + if(has_status_effect(/datum/status_effect/sight/blindness)) flash_eyes() var/b_loss = null diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 7a20022bd33..1097a0f9c5d 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -1,6 +1,5 @@ // Alien larva are quite simple. /mob/living/carbon/alien/Life(seconds, times_fired) - blinded = null . = ..() if(.) return @@ -36,30 +35,23 @@ if(status_flags & STATUS_GODMODE) return 0 if(stat == DEAD) - blinded = 1 silent = 0 else update_health() if(health <= 0) death() - blinded = 1 silent = 0 return 1 if(!IS_CONSCIOUS(src)) - blinded = 1 adjustHalLoss(-3) else if(IS_PRONE(src)) adjustHalLoss(-3) // Eyes and blindness. - if(!has_eyes()) - SetBlinded(1) - blinded = 1 + if(!has_eyes() && !HAS_TRAIT_FROM(src, TRAIT_BLIND, TRAIT_BLINDNESS_NO_EYES)) + add_blindness_source(TRAIT_BLINDNESS_NO_EYES) eye_blurry = 1 - else if(eye_blind) - AdjustBlinded(-1) - blinded = 1 else if(eye_blurry) eye_blurry = max(eye_blurry-1, 0) @@ -96,10 +88,7 @@ healths.icon_state = "health7" if ( stat != 2) - if(blinded) - overlay_fullscreen("blind", /atom/movable/screen/fullscreen/scaled/blind) - else - clear_fullscreen("blind") + //Blindness is handled by the modifier if(disabilities & DISABILITY_NEARSIGHTED) overlay_fullscreen("impaired", /atom/movable/screen/fullscreen/scaled/impaired, 1) else diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index eab91b6fd60..2d5e55a0d40 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -93,12 +93,12 @@ update_health() if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP - blinded = 1 + src.apply_status_effect(/datum/status_effect/sight/blindness, 5 SECONDS)//60 seconds is just a randomly picked number, the modifier does not expire as long as the holder is dead silent = 0 else //ALIVE. LIGHTS ARE ON if( !container && (health < config_legacy.health_threshold_dead || ((world.time - timeofhostdeath) > config_legacy.revival_brain_life)) ) death() - blinded = 1 + src.apply_status_effect(/datum/status_effect/sight/blindness, 5 SECONDS) silent = 0 return 1 @@ -112,8 +112,7 @@ if(31 to INFINITY) emp_damage = 30//Let's not overdo it if(21 to 30)//High level of EMP damage, unable to see, hear, or speak - SetBlinded(1) - blinded = 1 + src.apply_status_effect(/datum/status_effect/sight/blindness, 5 SECONDS) ear_deaf = 1 silent = 1 if(!alert)//Sounds an alarm, but only once per 'level' @@ -124,8 +123,6 @@ emp_damage -= 1 if(20) alert = 0 - blinded = 0 - SetBlinded(0) ear_deaf = 0 silent = 0 emp_damage -= 1 @@ -188,22 +185,19 @@ SetSeeInvisibleSelf(SEE_INVISIBLE_LIVING) if (stat != 2) - if ((blinded)) - overlay_fullscreen("blind", /atom/movable/screen/fullscreen/scaled/blind) + //Blindness is handled by the modifier + if(disabilities & DISABILITY_NEARSIGHTED) + overlay_fullscreen("impaired", /atom/movable/screen/fullscreen/scaled/impaired, 1) else - clear_fullscreen("blind") - if(disabilities & DISABILITY_NEARSIGHTED) - overlay_fullscreen("impaired", /atom/movable/screen/fullscreen/scaled/impaired, 1) - else - clear_fullscreen("impaired") - if(eye_blurry) - overlay_fullscreen("blurry", /atom/movable/screen/fullscreen/tiled/blurry) - else - clear_fullscreen("blurry") - if(druggy) - overlay_fullscreen("high", /atom/movable/screen/fullscreen/tiled/high) - else - clear_fullscreen("high") + clear_fullscreen("impaired") + if(eye_blurry) + overlay_fullscreen("blurry", /atom/movable/screen/fullscreen/tiled/blurry) + else + clear_fullscreen("blurry") + if(druggy) + overlay_fullscreen("high", /atom/movable/screen/fullscreen/tiled/high) + else + clear_fullscreen("high") if(IsRemoteViewing()) if(machine && machine.check_eye(src) < 0) diff --git a/code/modules/mob/living/carbon/breathe.dm b/code/modules/mob/living/carbon/breathe.dm index 5213fe1a9b7..680b058343f 100644 --- a/code/modules/mob/living/carbon/breathe.dm +++ b/code/modules/mob/living/carbon/breathe.dm @@ -21,7 +21,7 @@ if(losebreath>0) //Suffocating so do not take a breath AdjustLosebreath(stabilization? -5 : -1) - if (prob(10)) //Gasp per 10 ticks? Sounds about right. + if (prob(10) && !stat) //Gasp per 10 ticks? Sounds about right. spawn emote("gasp") else //Okay, we can breathe, now check if we can get air diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 389205a497b..c267cb56b42 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -51,6 +51,10 @@ regenerate_icons() update_transform() + //Permanent blindness due to stupidly setup vision organs + if(!species.vision_organ) + add_blindness_source(TRAIT_BLINDNESS_SPECIES) + //! WARNING SHITCODE REMOVE LATER /mob/living/carbon/human/LateInitialize() . = ..() @@ -104,7 +108,7 @@ . += species.statpanel_status(C, src, C.statpanel_tab("Species")) /mob/living/carbon/human/legacy_ex_act(severity) - if(!blinded) + if(!has_status_effect(/datum/status_effect/sight/blindness)) flash_eyes() var/shielded = 0 diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 292a64e6613..45c472b0844 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -77,7 +77,7 @@ src.afflict_paralyze(20 * rand(2,4)) for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.client && !( O.has_status_effect(/datum/status_effect/sight/blindness) ))) O.show_message("[src] [failed ? "tried to tackle" : "has tackled"] down [T]!", 1) /mob/living/carbon/human/proc/regurgitate() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index e7b3034586a..49b4aa61d79 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -50,7 +50,6 @@ //blinded get reset each cycle and then get activated later in the //code. Very ugly. I dont care. Moving this stuff here so its easy //to find it. - blinded = 0 fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it. // update the current life tick, can be used to e.g. only do something every 4 ticks @@ -205,6 +204,13 @@ /mob/living/carbon/human/handle_disabilities() ..() + if(!HAS_TRAIT_FROM(src, TRAIT_BLIND, TRAIT_BLINDNESS_SPECIES)) + var/obj/item/organ/vis = internal_organs_by_name[species.vision_organ] + if(!vis) + add_blindness_source( TRAIT_BLINDNESS_VIS_ORGAN_MISSING) + else if(HAS_TRAIT_FROM(src, TRAIT_BLIND, TRAIT_BLINDNESS_VIS_ORGAN_MISSING)) + remove_blindness_source(TRAIT_BLINDNESS_VIS_ORGAN_MISSING) + if(stat != CONSCIOUS) //Let's not worry about tourettes if you're not conscious. return @@ -1113,14 +1119,14 @@ //SSD check, if a logged player is awake put them back to sleep! if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP - blinded = 1 + apply_status_effect(/datum/status_effect/sight/blindness, 5 SECOND)//This modifier does not expire as long as the holder is dead silent = 0 else //ALIVE. LIGHTS ARE ON update_health() //TODO if(health <= config_legacy.health_threshold_dead || (should_have_organ("brain") && !has_brain())) death() - blinded = 1 + apply_status_effect(/datum/status_effect/sight/blindness, 5 SECOND) silent = 0 return 1 @@ -1155,7 +1161,7 @@ setHalLoss(species.total_health - 1) if(!IS_CONSCIOUS(src)) - blinded = 1 + apply_status_effect(/datum/status_effect/sight/blindness, 5 SECOND) animate_tail_reset() adjustHalLoss(-3) @@ -1178,7 +1184,7 @@ var/obj/item/hardsuit/O = back if(O.helmet && O.helmet == head && (O.helmet.body_cover_flags & EYES)) if((!O.is_online() && O.offline_vision_restriction == 2) || (O.is_online() && O.vision_restriction == 2)) - blinded = 1 + apply_status_effect(/datum/status_effect/sight/blindness, O.seal_delay) // Check everything else. @@ -1186,34 +1192,13 @@ if(embedded_flag && !(life_tick % 10)) if(!embedded_needs_process()) embedded_flag = 0 - //Vision - var/obj/item/organ/vision + if(species.vision_organ) - vision = internal_organs_by_name[species.vision_organ] - - if(!species.vision_organ) // Presumably if a species has no vision organs, they see via some other means. - SetBlinded(0) - blinded = 0 - eye_blurry = 0 - else if(!vision || vision.is_broken()) // Vision organs cut out or broken? Permablind. - SetBlinded(1) - blinded = 1 - eye_blurry = 1 - else //You have the requisite organs - if(sdisabilities & SDISABILITY_NERVOUS) // Disabled-blind, doesn't get better on its own - blinded = 1 - else if(eye_blind) // Blindness, heals slowly over time - AdjustBlinded(-1) - blinded = 1 - else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster - eye_blurry = max(eye_blurry-3, 0) - blinded = 1 - - //blurry sight - if(vision.is_bruised()) // Vision organs impaired? Permablurry. + var/obj/item/organ/vision = internal_organs_by_name[species.vision_organ] + if(vision && vision.is_bruised()) // Vision organs impaired? Permablurry. eye_blurry = 1 - if(eye_blurry) // Blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) + if(eye_blurry) // Blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) //Ears if(sdisabilities & SDISABILITY_DEAF) //disabled-deaf, doesn't get better on its own @@ -1484,11 +1469,6 @@ bodytemp.icon_state = "temp-1" else bodytemp.icon_state = "temp0" - if(blinded) - overlay_fullscreen("blind", /atom/movable/screen/fullscreen/scaled/blind) - - else - clear_fullscreen("blind") if(disabilities & DISABILITY_NEARSIGHTED) //this looks meh but saves a lot of memory by not requiring to add var/prescription var/corrected = FALSE diff --git a/code/modules/mob/living/carbon/human/traits/negative.dm b/code/modules/mob/living/carbon/human/traits/negative.dm index 1a7fc280cf5..3cf63d3cb80 100644 --- a/code/modules/mob/living/carbon/human/traits/negative.dm +++ b/code/modules/mob/living/carbon/human/traits/negative.dm @@ -183,13 +183,14 @@ desc = "You're blind. Permanently." cost = -3 custom_only = FALSE - traits = list( - TRAIT_BLIND - ) excludes = list( /datum/trait/negative/deaf ) +/datum/trait/negative/blind/apply(var/datum/species/S,var/mob/living/carbon/human/H) + .=..() + H.add_blindness_source(TRAIT_BLINDNESS_NEGATIV) + // todo: use it as a disability to vocal ears? organs? same as above? please? /datum/trait/negative/deaf name = "Deaf" diff --git a/code/modules/mob/living/defense.dm b/code/modules/mob/living/defense.dm index 977f70b4427..178b6bb6b8d 100644 --- a/code/modules/mob/living/defense.dm +++ b/code/modules/mob/living/defense.dm @@ -570,7 +570,7 @@ /mob/living/proc/get_accuracy_penalty() // Certain statuses make it harder to score a hit. var/accuracy_penalty = 0 - if(blinded) + if(has_status_effect(/datum/status_effect/sight/blindness)) accuracy_penalty += 75 if(eye_blurry) accuracy_penalty += 30 diff --git a/code/modules/mob/living/health.dm b/code/modules/mob/living/health.dm index a471a1e1965..d678b1277f5 100644 --- a/code/modules/mob/living/health.dm +++ b/code/modules/mob/living/health.dm @@ -75,9 +75,7 @@ //! WARNING: LEGACY CODE sdisabilities = 0 // ??? disabilities = 0 // ??? - blinded = 0 - SetBlinded(0) - eye_blind = 0 + remove_status_effect(/datum/status_effect/sight/blindness) ear_deaf = 0 ear_damage = 0 failed_last_breath = 0 diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index fccee1a68b2..a0ddb7dc18a 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -123,11 +123,13 @@ /mob/living/proc/handle_disabilities() //Eyes - if(sdisabilities & SDISABILITY_NERVOUS || stat || HAS_TRAIT(src, TRAIT_BLIND)) //blindness from disability or unconsciousness doesn't get better on its own - SetBlinded(1) - else if(eye_blind) //blindness, heals slowly over time - AdjustBlinded(-1) - else if(eye_blurry) //blurry eyes heal slowly + if(sdisabilities & SDISABILITY_NERVOUS) //blindness from disability or unconsciousness doesn't get better on its own + add_blindness_source(TRAIT_BLINDNESS_DISABILITY) + else + if(HAS_TRAIT_FROM(src, TRAIT_BLIND, TRAIT_BLINDNESS_DISABILITY)) + remove_blindness_source(TRAIT_BLINDNESS_DISABILITY) + + if(eye_blurry)//blurry eyes heal slowly eye_blurry = max(eye_blurry-1, 0) //Ears @@ -147,9 +149,6 @@ // mute trait shim for now if(HAS_TRAIT(src, TRAIT_MUTE)) silent = max(silent, 1) - // blind trait shim for now - if(HAS_TRAIT(src, TRAIT_BLIND)) - eye_blind = max(eye_blind, 1) /mob/living/handle_regular_hud_updates() if(!client) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 07e4a676985..2133c88a0af 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -331,19 +331,6 @@ default behaviour is: amount = round(amount * M.disable_duration_percent) ..(amount) -/mob/living/Blind(amount) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - -/mob/living/AdjustBlinded(amount) - if(amount > 0) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.disable_duration_percent)) - amount = round(amount * M.disable_duration_percent) - ..(amount) - // ++++ROCKDTBEN++++ MOB PROCS //END // Applies direct "cold" damage while checking protection against the cold. @@ -435,7 +422,7 @@ default behaviour is: //called when the mob receives a bright flash /mob/living/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /atom/movable/screen/fullscreen/tiled/flash) - if(override_blindness_check || !(disabilities & SDISABILITY_NERVOUS)) + if(override_blindness_check || has_status_effect(/datum/status_effect/sight/blindness)) overlay_fullscreen("flash", type) spawn(25) if(src) @@ -696,7 +683,7 @@ default behaviour is: return ..() /mob/living/proc/has_vision() - return !(eye_blind || (disabilities & SDISABILITY_NERVOUS) || stat || blinded) + return !(has_status_effect(/datum/status_effect/sight/blindness)) /mob/living/proc/dirties_floor() // If we ever decide to add fancy conditionals for making dirty floors (floating, etc), here's the proc. return makes_dirt diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 305c1fcb0ef..26d0982af59 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -74,15 +74,8 @@ AdjustConfused(-1) - blinded = !!IS_DEAD(src) - - if (src.stuttering) src.stuttering-- - if (src.eye_blind || HAS_TRAIT(src, TRAIT_BLIND)) - src.AdjustBlinded(-1) - src.blinded = 1 - if (src.ear_deaf > 0) src.ear_deaf-- if (src.ear_damage < 25) src.ear_damage -= 0.05 @@ -90,8 +83,6 @@ src.density = !( src.lying ) - if (src.sdisabilities & SDISABILITY_NERVOUS) - src.blinded = 1 if (src.sdisabilities & SDISABILITY_DEAF) src.ear_deaf = 1 @@ -114,9 +105,9 @@ radio.on = 1 if(is_component_functioning("camera")) - src.blinded = 0 + remove_blindness_source(TRAIT_BLINDNESS_CAMERA) else - src.blinded = 1 + add_blindness_source(TRAIT_BLINDNESS_CAMERA) return 1 @@ -215,10 +206,7 @@ // if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]" if(stat != 2) - if(blinded) - overlay_fullscreen("blind", /atom/movable/screen/fullscreen/scaled/blind) - else - clear_fullscreen("blind") + //Blindness is handled by the modifier, it also sets the fullscreen overlay if(disabilities & DISABILITY_NEARSIGHTED) overlay_fullscreen("impaired", /atom/movable/screen/fullscreen/scaled/impaired, 1) else diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 1d4231208d1..479e26ccf90 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -301,7 +301,7 @@ return 1 /mob/living/silicon/legacy_ex_act(severity) - if(!blinded) + if(!has_status_effect(/datum/status_effect/sight/blindness)) flash_eyes() switch(severity) diff --git a/code/modules/mob/living/simple_mob/defense.dm b/code/modules/mob/living/simple_mob/defense.dm index 868ee366fc2..5bb0b7f077e 100644 --- a/code/modules/mob/living/simple_mob/defense.dm +++ b/code/modules/mob/living/simple_mob/defense.dm @@ -89,7 +89,7 @@ // Exploding. /mob/living/simple_mob/legacy_ex_act(severity) - if(!blinded) + if(!has_status_effect(/datum/status_effect/sight/blindness)) flash_eyes() var/armor = run_armor_check(def_zone = null, attack_flag = "bomb") var/bombdam = 500 diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/dog.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/dog.dm index fe00122ced4..5b7ad57cd99 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/dog.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/dog.dm @@ -44,7 +44,7 @@ if(istype(O, /obj/item/newspaper)) if(!stat) for(var/mob/M in viewers(user, null)) - if ((M.client && !( M.blinded ))) + if ((M.client && !( M.has_status_effect(/datum/status_effect/sight/blindness) ))) M.show_message("[user] baps [name] on the nose with the rolled up [O]") spawn(0) for(var/i in list(1,2,4,8,4,2,1,2)) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/kururak.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/kururak.dm index 4485a0f7562..03b85b5917c 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/kururak.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/kururak.dm @@ -181,7 +181,7 @@ if(flash_strength > 0) to_chat(H, SPAN_ALIEN("You are disoriented by \the [src]!")) H.Confuse(flash_strength + 5) - H.Blind(flash_strength) + H.apply_status_effect(/datum/status_effect/sight/blindness, flash_strength) H.eye_blurry = max(H.eye_blurry, flash_strength + 5) H.flash_eyes() H.adjustHalLoss(flash_strength / 5) @@ -210,7 +210,7 @@ for(var/mob/living/carbon/C in oviewers(special_attack_max_range, null)) var/safety = C.eyecheck() if(!safety) - if(!C.blinded) + if(!C.has_status_effect(/datum/status_effect/sight/blindness)) C.flash_eyes() for(var/mob/living/silicon/robot/R in oviewers(special_attack_max_range, null)) if(R.has_active_type(/obj/item/borg/combat/shield)) diff --git a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/shade.dm b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/shade.dm index e3981744f59..9581c93c7d2 100644 --- a/code/modules/mob/living/simple_mob/subtypes/occult/constructs/shade.dm +++ b/code/modules/mob/living/simple_mob/subtypes/occult/constructs/shade.dm @@ -52,7 +52,7 @@ /mob/living/simple_mob/construct/shade/death() ..() for(var/mob/M in viewers(src, null)) - if((M.client && !( M.blinded ))) + if((M.client && !( M.has_status_effect(/datum/status_effect/sight/blindness) ))) M.show_message("[src] lets out a contented sigh as their form unwinds.") ghostize() diff --git a/code/modules/mob/living/simple_mob/subtypes/occult/living_statue.dm b/code/modules/mob/living/simple_mob/subtypes/occult/living_statue.dm index d6a22de4557..55c7f5b6b9a 100644 --- a/code/modules/mob/living/simple_mob/subtypes/occult/living_statue.dm +++ b/code/modules/mob/living/simple_mob/subtypes/occult/living_statue.dm @@ -157,7 +157,7 @@ /spell/aoe_turf/blindness/cast(list/targets, mob/user = usr) for(var/mob/living/victim as anything in targets) - victim.Blind(4) + victim.apply_status_effect(/datum/status_effect/sight/blindness, 4 SECONDS) /// Veil of Darkness Spell /spell/aoe_turf/veil_of_darkness diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 092fdf357d2..8e6695253ba 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -80,6 +80,8 @@ addtimer(CALLBACK(src, TYPE_PROC_REF(/mob, update_ssd_overlay)), 0) // reset cutscene to default; this is a proc for new players. login_cutscene() + // Make sure blindness fullscreen is applied if needed + blindness_handle_reconnect() //* legacy // this is below reset_perspective so self perspective generates. diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5360221ecc4..11a34b04b69 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -256,7 +256,7 @@ return restrained() ? FULLY_BUCKLED : PARTIALLY_BUCKLED /mob/proc/is_blind() - return ((sdisabilities & SDISABILITY_NERVOUS) || blinded || incapacitated(INCAPACITATION_KNOCKOUT)) + return (has_status_effect(/datum/status_effect/sight/blindness) || incapacitated(INCAPACITATION_KNOCKOUT)) /mob/proc/is_deaf() return ((sdisabilities & SDISABILITY_DEAF) || ear_deaf || incapacitated(INCAPACITATION_KNOCKOUT)) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 98bb8ff7703..c94c4beda71 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -201,7 +201,6 @@ var/sdisabilities = 0 //?Carbon var/disabilities = 0 //?Carbon var/transforming = null //?Carbon - var/eye_blind = null //?Carbon var/eye_blurry = null //?Carbon var/ear_deaf = null //?Carbon var/ear_damage = null //?Carbon @@ -215,7 +214,6 @@ var/gen_record = "" var/exploit_record = "" var/exploit_addons = list() //Assorted things that show up at the end of the exploit_record list - var/blinded = null var/bhunger = 0 //?Carbon var/ajourn = 0 var/druggy = 0 //?Carbon diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index b16cf944be6..62b2a013607 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -266,7 +266,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) /proc/is_blind(A) if(istype(A, /mob/living/carbon)) var/mob/living/carbon/C = A - if(C.sdisabilities & SDISABILITY_NERVOUS || C.blinded) + if(C.has_status_effect(/datum/status_effect/sight/blindness)) return 1 return 0 diff --git a/code/modules/mob/observer/dead/dead.dm b/code/modules/mob/observer/dead/dead.dm index 8341927ae1d..59861fd258f 100644 --- a/code/modules/mob/observer/dead/dead.dm +++ b/code/modules/mob/observer/dead/dead.dm @@ -11,7 +11,6 @@ GLOBAL_LIST_EMPTY(observer_list) alpha = 127 stat = DEAD mobility_flags = NONE - blinded = FALSE anchored = TRUE invisibility = INVISIBILITY_OBSERVER SET_APPEARANCE_FLAGS(PIXEL_SCALE | KEEP_TOGETHER) diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm index 2b06157963a..750e9660d4c 100644 --- a/code/modules/mob/status_procs.dm +++ b/code/modules/mob/status_procs.dm @@ -254,11 +254,16 @@ /mob/proc/AdjustConfused(amount) confused = max(confused + amount, 0) -/mob/proc/Blind(amount) - eye_blind = max(eye_blind, amount, 0) +/mob/proc/add_blindness_source(source) + ADD_TRAIT(src, TRAIT_BLIND, source) + overlay_fullscreen("blind", /atom/movable/screen/fullscreen/scaled/blind) -/mob/proc/SetBlinded(amount) - eye_blind = max(amount, 0) +/mob/proc/remove_blindness_source(source) + REMOVE_TRAIT(src, TRAIT_BLIND, source) + if(!HAS_TRAIT(src, TRAIT_BLIND)) + clear_fullscreen("blind") -/mob/proc/AdjustBlinded(amount) - eye_blind = max(eye_blind + amount, 0) +/mob/proc/blindness_handle_reconnect() + if(HAS_TRAIT(src, TRAIT_BLIND)) + clear_fullscreen("blind") + overlay_fullscreen("blind", /atom/movable/screen/fullscreen/scaled/blind) diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index fae85bb5c90..5636e2af6a1 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -320,7 +320,7 @@ GLOBAL_LIST_INIT(nif_id_lookup, init_nif_id_lookup()) switch(percent_done) //This is 0.0 to 1.0 kinda percent. //Connecting to optical nerves if(0.0 to 0.1) - human.eye_blind = 5 + human.apply_status_effect(/datum/status_effect/sight/blindness, 5 SECONDS) //Mapping brain if(0.2 to 0.9) diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index fa1d267a3bf..1892e218bef 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -407,11 +407,11 @@ //If they're blinded if(ext_blind) - eye_blind = 5 + apply_status_effect(/datum/status_effect/sight/blindness, 5 SECONDS) client.screen.Remove(GLOB.global_hud.whitense) overlay_fullscreen("blind", /atom/movable/screen/fullscreen/scaled/blind) else - eye_blind = 0 + remove_status_effect(/datum/status_effect/sight/blindness) clear_fullscreen("blind") client.screen.Add(GLOB.global_hud.whitense) diff --git a/code/modules/organs/internal/subtypes/eyes.dm b/code/modules/organs/internal/subtypes/eyes.dm index f6fc2d69a4e..90135cb9836 100644 --- a/code/modules/organs/internal/subtypes/eyes.dm +++ b/code/modules/organs/internal/subtypes/eyes.dm @@ -76,6 +76,7 @@ ..() if(is_broken() && !oldbroken && owner && !owner.stat) to_chat(owner, "You go blind!") + owner.add_blindness_source(TRAIT_BLINDNESS_EYE_DMG) /obj/item/organ/internal/eyes/tick_life(dt) . = ..() @@ -83,9 +84,6 @@ if(is_bruised()) owner.eye_blurry = 4 - if(is_broken()) - owner.Blind(4) - /obj/item/organ/internal/eyes/handle_germ_effects() . = ..() //Up should return an infection level as an integer if(!.) return diff --git a/code/modules/overmap/legacy/ships/computers/ship.dm b/code/modules/overmap/legacy/ships/computers/ship.dm index cb34713e243..22a8937ac1f 100644 --- a/code/modules/overmap/legacy/ships/computers/ship.dm +++ b/code/modules/overmap/legacy/ships/computers/ship.dm @@ -115,7 +115,7 @@ unlook(user) /obj/machinery/computer/ship/check_eye(mob/user, vis_update) - if(!get_dist(user, src) > 1 || user.blinded || !linked) + if(!get_dist(user, src) > 1 || user.has_status_effect(/datum/status_effect/sight/blindness) || !linked) unlook(user, vis_update) return -1 else diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 8d5ecefeb26..99faceeee18 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -566,7 +566,7 @@ for(var/mob/living/L in oview(2,user)) if(L.stat) continue - if(L.blinded) + if(L.has_status_effect(/datum/status_effect/sight/blindness)) to_chat(L, "You hear a [fire_sound_text]!") continue to_chat(L, "\The [user] fires \the [src][pointblank ? " point blank at \the [target]":""][reflex ? " by reflex":""]!") diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index bb573e02443..3479abf411f 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -31,7 +31,7 @@ if(flash_strength > 0) H.Confuse(flash_strength + 5) - H.Blind(flash_strength) + H.apply_status_effect(/datum/status_effect/sight/blindness, flash_strength SECONDS) H.eye_blurry = max(H.eye_blurry, flash_strength + 5) H.adjustHalLoss(22 * (flash_strength / 5)) // Five flashes to stun. Bit weaker than melee flashes due to being ranged. diff --git a/code/modules/projectiles/projectile/energy_vr.dm b/code/modules/projectiles/projectile/energy_vr.dm index 00d5dcca9a7..6d88a93a18d 100644 --- a/code/modules/projectiles/projectile/energy_vr.dm +++ b/code/modules/projectiles/projectile/energy_vr.dm @@ -1,9 +1,6 @@ /obj/projectile/energy/electrode/strong agony = 70 -/obj/projectile/energy - flash_strength = 10 - /obj/projectile/energy/flash flash_range = 1 diff --git a/code/modules/projectiles/targeting/targeting_overlay.dm b/code/modules/projectiles/targeting/targeting_overlay.dm index 46d8d45a00e..704e21dbbe2 100644 --- a/code/modules/projectiles/targeting/targeting_overlay.dm +++ b/code/modules/projectiles/targeting/targeting_overlay.dm @@ -118,7 +118,7 @@ var/mob/living/carbon/human/H = owner if(!(aiming_with in owner) || (istype(H) && !H.is_holding(aiming_with))) to_chat(owner, "You must keep hold of your weapon!") - else if(owner.eye_blind) + else if(owner.has_status_effect(/datum/status_effect/sight/blindness)) to_chat(owner, "You are blind and cannot see your target!") else if(!aiming_at || !istype(aiming_at.loc, /turf)) to_chat(owner, "You have lost sight of your target!") diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Food-Drinks.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Food-Drinks.dm index e94a230f435..e022017b873 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Food-Drinks.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Food-Drinks.dm @@ -614,7 +614,7 @@ else if(eyes_covered) to_chat(M, "Your [safe_thing] protects you from most of the pepperspray!") M.eye_blurry = max(M.eye_blurry, effective_strength * 3) - M.Blind(effective_strength) + M.apply_status_effect(/datum/status_effect/sight/blindness, effective_strength ) M.afflict_stun(20 * 5) M.afflict_paralyze(20 * 5) if(alien != IS_SLIME) @@ -627,7 +627,7 @@ else// Oh dear :D to_chat(M, "You're sprayed directly in the eyes with pepperspray!") M.eye_blurry = max(M.eye_blurry, effective_strength * 5) - M.Blind(effective_strength * 2) + M.apply_status_effect(/datum/status_effect/sight/blindness, effective_strength * 2 ) M.afflict_stun(20 * 5) M.afflict_paralyze(20 * 5) if(alien != IS_SLIME) diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Medicine.dm index b9d658ac15f..810331e2264 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Medicine.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Medicine.dm @@ -653,7 +653,6 @@ /datum/reagent/imidazoline/affect_blood(mob/living/carbon/M, alien, removed) M.eye_blurry = max(M.eye_blurry - 5, 0) - M.AdjustBlinded(-5) if(ishuman(M)) var/mob/living/carbon/human/H = M var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES] @@ -663,7 +662,7 @@ if(E.damage > 0) E.heal_damage_i(5 * removed, can_revive = TRUE) if(E.damage <= 5 && E.organ_tag == O_EYES) - H.sdisabilities &= ~SDISABILITY_NERVOUS + H.remove_blindness_source(TRAIT_BLINDNESS_EYE_DMG) /datum/reagent/peridaxon name = "Peridaxon" @@ -686,7 +685,7 @@ H.Confuse(5) if(I.damage <= 5 && I.organ_tag == O_EYES) H.eye_blurry = min(M.eye_blurry + 10, 100) //Eyes need to reset, or something - H.sdisabilities &= ~SDISABILITY_NERVOUS + H.remove_blindness_source(TRAIT_BLINDNESS_EYE_DMG) if(alien == IS_SLIME) H.ceiling_chemical_effect(CE_PAINKILLER, 20) if(prob(33)) @@ -711,7 +710,7 @@ H.Confuse(5) if(I.damage <= 5 && I.organ_tag == O_EYES) H.eye_blurry = min(M.eye_blurry + 10, 100) //Eyes need to reset, or something - H.sdisabilities &= ~SDISABILITY_NERVOUS + H.remove_blindness_source(TRAIT_BLINDNESS_EYE_DMG) if(alien == IS_SLIME) H.ceiling_chemical_effect(CE_PAINKILLER, 20) if(prob(33)) diff --git a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm index 1ead6ce13e7..11dae825ba2 100644 --- a/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/chemistry/reagents/Chemistry-Reagents-Other.dm @@ -212,7 +212,7 @@ M.disabilities = 0 M.sdisabilities = 0 M.eye_blurry = 0 - M.SetBlinded(0) + M.remove_status_effect(/datum/status_effect/sight/blindness) M.set_paralyzed(0) M.set_stunned(0) M.set_unconscious(0) diff --git a/code/modules/species/outsider/celestials.dm b/code/modules/species/outsider/celestials.dm index f9b4b42639a..453a0bc965d 100644 --- a/code/modules/species/outsider/celestials.dm +++ b/code/modules/species/outsider/celestials.dm @@ -31,6 +31,7 @@ //Angels glow in the dark. has_glowing_eyes = TRUE + vision_organ = O_EYES //Physical resistances and Weaknesses. flash_mod = 0.5 @@ -137,6 +138,7 @@ //Demons glow in the dark. has_glowing_eyes = TRUE + vision_organ = O_EYES //Physical resistances and Weaknesses. flash_mod = 3.0 diff --git a/code/modules/species/outsider/replicant.dm b/code/modules/species/outsider/replicant.dm index 0de7126bf51..e7275b00197 100644 --- a/code/modules/species/outsider/replicant.dm +++ b/code/modules/species/outsider/replicant.dm @@ -36,6 +36,8 @@ siemens_coefficient = 0.9 heal_rate = 0 + vision_organ = O_EYES + species_spawn_flags = SPECIES_SPAWN_SPECIAL species_appearance_flags = HAS_SKIN_COLOR | HAS_EYE_COLOR | HAS_HAIR_COLOR | HAS_UNDERWEAR diff --git a/code/modules/species/outsider/scori.dm b/code/modules/species/outsider/scori.dm index 0cfc79c6c3e..960fdfc9080 100644 --- a/code/modules/species/outsider/scori.dm +++ b/code/modules/species/outsider/scori.dm @@ -42,6 +42,8 @@ vision_innate = /datum/vision/baseline/species_tier_3 + vision_organ = O_EYES + //Adapted to overcast skies and caverns. flash_mod = 3.0 diff --git a/code/modules/species/outsider/shadow.dm b/code/modules/species/outsider/shadow.dm index 501f869dfed..8c7232beb20 100644 --- a/code/modules/species/outsider/shadow.dm +++ b/code/modules/species/outsider/shadow.dm @@ -19,6 +19,8 @@ has_organ = list() siemens_coefficient = 0 + vision_organ = O_EYES + blood_color = "#CCCCCC" flesh_color = "#AAAAAA" diff --git a/code/modules/species/outsider/skeleton.dm b/code/modules/species/outsider/skeleton.dm index a3b8b488265..bf0e5060914 100644 --- a/code/modules/species/outsider/skeleton.dm +++ b/code/modules/species/outsider/skeleton.dm @@ -37,6 +37,8 @@ flash_mod = 0 chemOD_mod = 0 + vision_organ = O_EYES + siemens_coefficient = 0 death_message = "falls over and stops moving!" diff --git a/code/modules/species/outsider/vox.dm b/code/modules/species/outsider/vox.dm index c309a1a0748..e11bb27dbe5 100644 --- a/code/modules/species/outsider/vox.dm +++ b/code/modules/species/outsider/vox.dm @@ -91,6 +91,7 @@ O_BRAIN = /obj/item/organ/internal/brain/vox, O_EYES = /obj/item/organ/internal/eyes, ) + vision_organ = O_EYES unarmed_types = list( /datum/unarmed_attack/stomp, diff --git a/code/modules/species/promethean/promethean.dm b/code/modules/species/promethean/promethean.dm index 2087aa8c371..5f4f719f95a 100644 --- a/code/modules/species/promethean/promethean.dm +++ b/code/modules/species/promethean/promethean.dm @@ -95,6 +95,7 @@ var/datum/species/shapeshifter/promethean/prometheans O_REGOXY = /obj/item/organ/internal/regennetwork/oxy, O_REGTOX = /obj/item/organ/internal/regennetwork/tox, ) + vision_organ = O_BRAIN //THey only really have the brain as neural point dispersed_eyes = TRUE diff --git a/code/modules/species/protean/protean.dm b/code/modules/species/protean/protean.dm index 4d979be9cd2..b0840303649 100644 --- a/code/modules/species/protean/protean.dm +++ b/code/modules/species/protean/protean.dm @@ -72,6 +72,7 @@ O_ORCH = /obj/item/organ/internal/nano/orchestrator, O_FACT = /obj/item/organ/internal/nano/refactory ) + vision_organ = O_BRAIN has_limbs = list( BP_TORSO = list("path" = /obj/item/organ/external/chest/unbreakable/nano), BP_GROIN = list("path" = /obj/item/organ/external/groin/unbreakable/nano), diff --git a/code/modules/species/shadekin/shadekin.dm b/code/modules/species/shadekin/shadekin.dm index e23e436f9b2..cd3b048c69f 100644 --- a/code/modules/species/shadekin/shadekin.dm +++ b/code/modules/species/shadekin/shadekin.dm @@ -38,7 +38,8 @@ siemens_coefficient = 1 vision_innate = /datum/vision/baseline/species_tier_3/for_snowflake_ocs - + vision_organ = O_EYES + slowdown = -0.5 item_slowdown_mod = 0.5 diff --git a/code/modules/species/shadekin/shadekin_blackeyed.dm b/code/modules/species/shadekin/shadekin_blackeyed.dm index fede97d8c4a..11152d27e9d 100644 --- a/code/modules/species/shadekin/shadekin_blackeyed.dm +++ b/code/modules/species/shadekin/shadekin_blackeyed.dm @@ -37,6 +37,7 @@ siemens_coefficient = 1 // Mirroring the shockproof removal of Shadekin vision_innate = /datum/vision/baseline/species_tier_3/for_snowflake_ocs + vision_organ = O_EYES slowdown = 0 // Originally 0.5 (As slow as unathi), lowered to 0 to be at human speed. item_slowdown_mod = 2 // Originally 1.5. They're not as physically fits, slowed down more by heavy gear. diff --git a/code/modules/species/species.dm b/code/modules/species/species.dm index 3fc6aa0378a..589e53f1f72 100644 --- a/code/modules/species/species.dm +++ b/code/modules/species/species.dm @@ -482,10 +482,6 @@ descriptor_datums[descriptor.name] = descriptor descriptors = descriptor_datums - //If the species has eyes, they are the default vision organ - if(!vision_organ && has_organ[O_EYES]) - vision_organ = O_EYES - unarmed_attacks = list() for(var/u_type in unarmed_types) unarmed_attacks += new u_type() diff --git a/code/modules/species/station/adherent.dm b/code/modules/species/station/adherent.dm index 81f4a8470fa..c303f8252c0 100644 --- a/code/modules/species/station/adherent.dm +++ b/code/modules/species/station/adherent.dm @@ -115,6 +115,7 @@ O_FLOAT = /obj/item/organ/internal/powered/float, O_JETS = /obj/item/organ/internal/powered/jets, ) + vision_organ = O_EYES move_trail = /obj/effect/debris/cleanable/blood/tracks/snake diff --git a/code/modules/species/station/alraune.dm b/code/modules/species/station/alraune.dm index 0d2467950d5..caa505abd8a 100644 --- a/code/modules/species/station/alraune.dm +++ b/code/modules/species/station/alraune.dm @@ -31,6 +31,8 @@ total_health = 100 //standard metabolic_rate = 0.75 // slow metabolism + vision_organ = O_EYES + brute_mod = 1 //nothing special burn_mod = 1.1 //plants don't like fire radiation_mod = 0.7 //cit change: plants seem to be pretty resilient. shouldn't come up much. diff --git a/code/modules/species/station/apidaen.dm b/code/modules/species/station/apidaen.dm index e9f592dfe8e..fd7609e82af 100644 --- a/code/modules/species/station/apidaen.dm +++ b/code/modules/species/station/apidaen.dm @@ -15,6 +15,7 @@ ) vision_innate = /datum/vision/baseline/species_tier_2 + vision_organ = O_EYES slowdown = -0.10 // Speed boost similar to spiders, slightly nerfed due to two less legs. brute_mod = 0.8 // 20% brute damage reduction seems fitting to match spiders, due to exoskeletons. diff --git a/code/modules/species/station/custom_species.dm b/code/modules/species/station/custom_species.dm index 8a3cf1198e4..2dfdcf2295d 100644 --- a/code/modules/species/station/custom_species.dm +++ b/code/modules/species/station/custom_species.dm @@ -23,6 +23,8 @@ species_spawn_flags = SPECIES_SPAWN_CHARACTER species_appearance_flags = HAS_HAIR_COLOR | HAS_SKIN_COLOR | HAS_LIPS | HAS_UNDERWEAR | HAS_EYE_COLOR + vision_organ = O_EYES + has_limbs = list( BP_TORSO = list("path" = /obj/item/organ/external/chest, "descriptor" = "torso"), BP_GROIN = list("path" = /obj/item/organ/external/groin, "descriptor" = "groin"), diff --git a/code/modules/species/station/diona.dm b/code/modules/species/station/diona.dm index 6c72a3d1bbd..302913010ad 100644 --- a/code/modules/species/station/diona.dm +++ b/code/modules/species/station/diona.dm @@ -57,6 +57,7 @@ O_POLYP = /obj/item/organ/internal/diona/polyp, O_ANCHOR = /obj/item/organ/internal/diona/ligament, ) + vision_organ = O_BRAIN has_limbs = list( BP_TORSO = list("path" = /obj/item/organ/external/diona/chest), diff --git a/code/modules/species/station/golem.dm b/code/modules/species/station/golem.dm index 5f131a6dc4f..fd43c054325 100644 --- a/code/modules/species/station/golem.dm +++ b/code/modules/species/station/golem.dm @@ -18,6 +18,8 @@ assisted_langs = list() + vision_organ = O_EYES + breath_type = null poison_type = null diff --git a/code/modules/species/station/monkey.dm b/code/modules/species/station/monkey.dm index d4ca2e39ec7..7719bf4df6e 100644 --- a/code/modules/species/station/monkey.dm +++ b/code/modules/species/station/monkey.dm @@ -40,6 +40,8 @@ brute_mod = 1.5 burn_mod = 1.5 + vision_organ = O_EYES + species_spawn_flags = SPECIES_SPAWN_SPECIAL bump_flag = MONKEY diff --git a/code/modules/species/station/phoronoids.dm b/code/modules/species/station/phoronoids.dm index 188db8ddeba..3033d87f7d5 100644 --- a/code/modules/species/station/phoronoids.dm +++ b/code/modules/species/station/phoronoids.dm @@ -64,6 +64,7 @@ O_BRAIN = /obj/item/organ/internal/brain, O_EYES = /obj/item/organ/internal/eyes, ) + vision_organ = O_EYES cold_level_1 = 200 cold_level_2 = 180 diff --git a/code/modules/species/station/rapala.dm b/code/modules/species/station/rapala.dm index d1bf832f5df..f6eb33bf65c 100644 --- a/code/modules/species/station/rapala.dm +++ b/code/modules/species/station/rapala.dm @@ -17,6 +17,8 @@ name_language = null intrinsic_languages = LANGUAGE_ID_BIRDSONG + vision_organ = O_EYES + color_mult = 1 max_age = 80 diff --git a/code/modules/species/station/standard/akula.dm b/code/modules/species/station/standard/akula.dm index 3abeba3b9cb..8dab95546b8 100644 --- a/code/modules/species/station/standard/akula.dm +++ b/code/modules/species/station/standard/akula.dm @@ -41,6 +41,8 @@ // burn_mod = 1.15 // gluttonous = 1 + vision_organ = O_EYES + color_mult = 1 water_movement = -4 max_age = 80 diff --git a/code/modules/species/station/standard/harpy.dm b/code/modules/species/station/standard/harpy.dm index 099a1aee423..0480603390b 100644 --- a/code/modules/species/station/standard/harpy.dm +++ b/code/modules/species/station/standard/harpy.dm @@ -43,3 +43,5 @@ "You feel uncomfortably warm.", "Your overheated skin itches." ) + + vision_organ = O_EYES diff --git a/code/modules/species/station/standard/human.dm b/code/modules/species/station/standard/human.dm index 296a864c9e2..104a403e2bb 100644 --- a/code/modules/species/station/standard/human.dm +++ b/code/modules/species/station/standard/human.dm @@ -52,6 +52,7 @@ O_STOMACH = /obj/item/organ/internal/stomach, O_INTESTINE = /obj/item/organ/internal/intestine, ) + vision_organ = O_EYES unarmed_types = list( /datum/unarmed_attack/punch, diff --git a/code/modules/species/station/standard/krisitik.dm b/code/modules/species/station/standard/krisitik.dm index 1cf0c620b28..abec4c656b8 100644 --- a/code/modules/species/station/standard/krisitik.dm +++ b/code/modules/species/station/standard/krisitik.dm @@ -19,6 +19,7 @@ intrinsic_languages = LANGUAGE_ID_SQUEAKISH vision_innate = /datum/vision/baseline/species_tier_2 + vision_organ = O_EYES color_mult = 1 diff --git a/code/modules/species/station/standard/moth.dm b/code/modules/species/station/standard/moth.dm index 312bcadda85..d64fd81d06d 100644 --- a/code/modules/species/station/standard/moth.dm +++ b/code/modules/species/station/standard/moth.dm @@ -29,6 +29,7 @@ GLOBAL_LIST_INIT(moth_lore_data, init_moth_lore()) unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp) vision_innate = /datum/vision/baseline/species_tier_2 + vision_organ = O_EYES // i'd like to see oyu move in water with wings water_movement = 0.3 diff --git a/code/modules/species/station/standard/naramadi.dm b/code/modules/species/station/standard/naramadi.dm index 8ea4b78c40b..cb9dada73b3 100644 --- a/code/modules/species/station/standard/naramadi.dm +++ b/code/modules/species/station/standard/naramadi.dm @@ -24,6 +24,7 @@ intrinsic_languages = LANGUAGE_ID_NARAMADI name_language = LANGUAGE_ID_NARAMADI color_mult = 1 + vision_organ = O_EYES max_age = 120 diff --git a/code/modules/species/station/standard/nevrean.dm b/code/modules/species/station/standard/nevrean.dm index 60d21842909..d862c4e9815 100644 --- a/code/modules/species/station/standard/nevrean.dm +++ b/code/modules/species/station/standard/nevrean.dm @@ -34,6 +34,7 @@ //brute_mod = 1.15 //burn_mod = 1.15 //gluttonous = 1 + vision_organ = O_EYES color_mult = 1 max_age = 80 diff --git a/code/modules/species/station/standard/shadekin.dm b/code/modules/species/station/standard/shadekin.dm index 7741d191561..39013b428d2 100644 --- a/code/modules/species/station/standard/shadekin.dm +++ b/code/modules/species/station/standard/shadekin.dm @@ -86,6 +86,7 @@ O_STOMACH = /obj/item/organ/internal/stomach, O_INTESTINE = /obj/item/organ/internal/intestine ) + vision_organ = O_EYES has_limbs = list( BP_TORSO = list("path" = /obj/item/organ/external/chest/crewkin), diff --git a/code/modules/species/station/standard/skrell.dm b/code/modules/species/station/standard/skrell.dm index 9937dace3f2..1151366a530 100644 --- a/code/modules/species/station/standard/skrell.dm +++ b/code/modules/species/station/standard/skrell.dm @@ -41,6 +41,7 @@ max_age = 130 vision_innate = /datum/vision/baseline/species_tier_2 + vision_organ = O_EYES flash_mod = 1.2 chemOD_mod = 0.9 diff --git a/code/modules/species/station/standard/tajaran.dm b/code/modules/species/station/standard/tajaran.dm index 1f12598f48a..bcee5764a43 100644 --- a/code/modules/species/station/standard/tajaran.dm +++ b/code/modules/species/station/standard/tajaran.dm @@ -30,6 +30,7 @@ ) vision_innate = /datum/vision/baseline/species_tier_2 + vision_organ = O_EYES slowdown = -0.5 snow_movement = -1 //Ignores half of light snow diff --git a/code/modules/species/station/standard/teshari.dm b/code/modules/species/station/standard/teshari.dm index 269ce2ff490..2a387379d71 100644 --- a/code/modules/species/station/standard/teshari.dm +++ b/code/modules/species/station/standard/teshari.dm @@ -141,6 +141,7 @@ O_STOMACH = /obj/item/organ/internal/stomach, O_INTESTINE = /obj/item/organ/internal/intestine, ) + vision_organ = O_EYES unarmed_types = list( /datum/unarmed_attack/bite/sharp, diff --git a/code/modules/species/station/standard/unathi.dm b/code/modules/species/station/standard/unathi.dm index 06175054ae6..fc7f8fcac05 100644 --- a/code/modules/species/station/standard/unathi.dm +++ b/code/modules/species/station/standard/unathi.dm @@ -112,6 +112,7 @@ O_STOMACH = /obj/item/organ/internal/stomach/unathi, O_INTESTINE = /obj/item/organ/internal/intestine/unathi, ) + vision_organ = O_EYES unarmed_types = list( /datum/unarmed_attack/stomp, diff --git a/code/modules/species/station/standard/vulpkanin.dm b/code/modules/species/station/standard/vulpkanin.dm index 0c4341bba4b..8fc4d7950af 100644 --- a/code/modules/species/station/standard/vulpkanin.dm +++ b/code/modules/species/station/standard/vulpkanin.dm @@ -20,6 +20,7 @@ intrinsic_languages = LANGUAGE_ID_VULPKANIN vision_innate = /datum/vision/baseline/species_tier_1 + vision_organ = O_EYES color_mult = 1 diff --git a/code/modules/species/station/standard/zaddat.dm b/code/modules/species/station/standard/zaddat.dm index 83680c9daf2..8cc4aebd4b2 100644 --- a/code/modules/species/station/standard/zaddat.dm +++ b/code/modules/species/station/standard/zaddat.dm @@ -86,6 +86,7 @@ O_STOMACH = /obj/item/organ/internal/stomach, O_INTESTINE = /obj/item/organ/internal/intestine ) + vision_organ = O_EYES unarmed_types = list( /datum/unarmed_attack/stomp, diff --git a/code/modules/species/station/standard/zorren.dm b/code/modules/species/station/standard/zorren.dm index b4030ab6558..4dc7a8237f6 100644 --- a/code/modules/species/station/standard/zorren.dm +++ b/code/modules/species/station/standard/zorren.dm @@ -45,6 +45,7 @@ base_color = "#333333" blood_color = "#240bc4" color_mult = 1 + vision_organ = O_EYES heat_discomfort_strings = list( "Your fur prickles in the heat.", @@ -114,6 +115,7 @@ base_color = "#333333" blood_color = "#240bc4" color_mult = 1 + vision_organ = O_EYES inherent_verbs = list( /mob/living/proc/shred_limb, diff --git a/code/modules/species/station/vasilissan.dm b/code/modules/species/station/vasilissan.dm index aa81d3fd530..3b2552683bf 100644 --- a/code/modules/species/station/vasilissan.dm +++ b/code/modules/species/station/vasilissan.dm @@ -14,6 +14,7 @@ ) vision_innate = /datum/vision/baseline/species_tier_2 + vision_organ = O_EYES slowdown = -0.15 // Small speedboost, as they've got a bunch of legs. Or something. I dunno. brute_mod = 0.8 // 20% brute damage reduction burn_mod = 1.15 // 15% burn damage increase. They're spiders. Aerosol can+lighter = dead spiders. diff --git a/code/modules/species/station/werebeast.dm b/code/modules/species/station/werebeast.dm index 398e3d24d99..f9ceb2f44b9 100644 --- a/code/modules/species/station/werebeast.dm +++ b/code/modules/species/station/werebeast.dm @@ -22,6 +22,7 @@ item_slowdown_mod = 0.25 hunger_factor = 0.4 vision_innate = /datum/vision/baseline/species_tier_3 + vision_organ = O_EYES mob_size = MOB_LARGE max_age = 200 diff --git a/code/modules/species/station/xenochimera.dm b/code/modules/species/station/xenochimera.dm index c82cf52a189..1bd3ed46a80 100644 --- a/code/modules/species/station/xenochimera.dm +++ b/code/modules/species/station/xenochimera.dm @@ -21,6 +21,7 @@ max_additional_languages = 5 vision_innate = /datum/vision/baseline/species_tier_3 + vision_organ = O_EYES slowdown = -0.2 //scuttly, but not as scuttly as a tajara or a teshari. brute_mod = 0.8 //About as tanky to brute as a Unathi. They'll probably snap and go feral when hurt though. burn_mod = 1.15 //As vulnerable to burn as a Tajara. @@ -631,8 +632,7 @@ H.adjustOxyLoss(-healing_amount) H.adjustCloneLoss(-healing_amount) H.adjustBrainLoss(-healing_amount) - H.blinded = FALSE - H.SetBlinded(FALSE) + H.remove_status_effect(/datum/status_effect/sight/blindness) H.eye_blurry = FALSE H.ear_deaf = FALSE H.ear_damage = FALSE diff --git a/code/modules/species/virtual_reality/avatar.dm b/code/modules/species/virtual_reality/avatar.dm index 2a3ed9c6afe..d1796d9599d 100644 --- a/code/modules/species/virtual_reality/avatar.dm +++ b/code/modules/species/virtual_reality/avatar.dm @@ -16,6 +16,7 @@ species_spawn_flags = SPECIES_SPAWN_SPECIAL speech_bubble_appearance = "cyber" + vision_organ = O_EYES assisted_langs = list() diff --git a/code/modules/species/xenomorphs/alien_species.dm b/code/modules/species/xenomorphs/alien_species.dm index 972c372e55c..eb33fdd386b 100644 --- a/code/modules/species/xenomorphs/alien_species.dm +++ b/code/modules/species/xenomorphs/alien_species.dm @@ -50,6 +50,7 @@ poison_type = null vision_flags = SEE_SELF|SEE_MOBS + vision_organ = O_EYES has_organ = list( O_HEART = /obj/item/organ/internal/heart, diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index fc484ecf7c6..0aa3b893180 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -315,10 +315,10 @@ icon_state ="bookblind" desc = "This book looks blurry, no matter how you look at it." -/obj/item/spellbook/oneuse/blind/recoil(mob/user) +/obj/item/spellbook/oneuse/blind/recoil(mob/living/user) ..() to_chat(user, "You go blind!") - user.Blind(10) + user.apply_status_effect(/datum/status_effect/sight/blindness, 10 SECONDS) /obj/item/spellbook/oneuse/mindswap spell = /spell/targeted/mind_transfer diff --git a/code/modules/spells/targeted/targeted.dm b/code/modules/spells/targeted/targeted.dm index 33fdfda6366..a3e1c0591f3 100644 --- a/code/modules/spells/targeted/targeted.dm +++ b/code/modules/spells/targeted/targeted.dm @@ -138,7 +138,7 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp if(amt_weakened || amt_paralysis || amt_stunned) if(target.buckled) target.buckled = null - target.Blind(amt_eye_blind) + target.apply_status_effect(/datum/status_effect/sight/blindness, amt_eye_blind SECONDS) target.eye_blurry += amt_eye_blurry target.dizziness += amt_dizziness target.Confuse(amt_confused) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index ad3af1c8ed7..d7f5f8503c1 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -117,8 +117,6 @@ user.visible_message("[user] treats damage to [target]'s [I.name] with [tool_name].", \ "You treat damage to [target]'s [I.name] with [tool_name]." ) I.revive(TRUE) - if(I.organ_tag == O_EYES) - target.sdisabilities &= ~SDISABILITY_NERVOUS if(I.organ_tag == O_LUNGS) target.SetLosebreath(0) diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index 12250275105..80f4ed95f6c 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -280,8 +280,6 @@ user.visible_message("[user] repairs [target]'s [I.name] with [tool].", \ "You repair [target]'s [I.name] with [tool]." ) I.revive(TRUE) - if(I.organ_tag == O_EYES) - target.sdisabilities &= ~SDISABILITY_NERVOUS /datum/surgery_step/robotics/fix_organ_robotic/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!hasorgans(target)) diff --git a/code/modules/tgui/modules/overmap.dm b/code/modules/tgui/modules/overmap.dm index 0797e416d5c..89b71e86644 100644 --- a/code/modules/tgui/modules/overmap.dm +++ b/code/modules/tgui/modules/overmap.dm @@ -70,7 +70,7 @@ return (WEAKREF(user) in viewers) /datum/tgui_module_old/ship/check_eye(var/mob/user) - if(!get_dist(user, ui_host()) > 1 || user.blinded || !linked) + if(!get_dist(user, ui_host()) > 1 || user.has_status_effect(/datum/status_effect/sight/blindness) || !linked) unlook(user) return -1 else diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index aeed2bf5b1e..78d5f2ffcd2 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -489,7 +489,7 @@ stage = 2 /datum/disease2/effect/blind/activate(var/mob/living/carbon/mob,var/multiplier) - mob.SetBlinded(4) + mob.apply_status_effect(/datum/status_effect/sight/blindness, 4 SECONDS) /datum/disease2/effect/cough name = "Severe Cough"