mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 03:26:31 +01:00
[MIRROR] Blindness-related bug fixes and code improvements (#6291)
* Blindness-related bug fix and code improvements (#59616) TRAIT_BLIND caused by the hypnochair or by being unconscious (eg. sleeping) will no longer prevent you from being flashed. Moves all raw text strings used in become_blind and cure_blind calls (as well as nanites in general with ADD_TRAIT) into defines. Code changes not in changelog due to not being even the slightest bit of player facing. * Blindness-related bug fixes and code improvements Co-authored-by: RandomGamer123 <31096837+RandomGamer123@users.noreply.github.com>
This commit is contained in:
@@ -545,6 +545,11 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
|
||||
#define STASIS_MUTE "stasis"
|
||||
#define GENETICS_SPELL "genetics_spell"
|
||||
#define EYES_COVERED "eyes_covered"
|
||||
#define HYPNOCHAIR_TRAIT "hypnochair"
|
||||
#define NANITES_TRAIT "nanites"
|
||||
#define FLASHLIGHT_EYES "flashlight_eyes"
|
||||
#define IMPURE_OCULINE "impure_oculine"
|
||||
#define BLINDFOLD_TRAIT "blindfolded"
|
||||
#define TRAIT_SANTA "santa"
|
||||
#define SCRYING_ORB "scrying-orb"
|
||||
#define ABDUCTOR_ANTAGONIST "abductor-antagonist"
|
||||
|
||||
@@ -93,8 +93,8 @@
|
||||
victim = C
|
||||
if(!(C.get_eye_protection() > 0))
|
||||
to_chat(C, "<span class='warning'>Strobing coloured lights assault you relentlessly! You're losing your ability to think straight!</span>")
|
||||
C.become_blind("hypnochair")
|
||||
ADD_TRAIT(C, TRAIT_DEAF, "hypnochair")
|
||||
C.become_blind(HYPNOCHAIR_TRAIT)
|
||||
ADD_TRAIT(C, TRAIT_DEAF, HYPNOCHAIR_TRAIT)
|
||||
interrogating = TRUE
|
||||
START_PROCESSING(SSobj, src)
|
||||
start_time = world.time
|
||||
@@ -127,8 +127,8 @@
|
||||
if(QDELETED(victim) || victim != occupant)
|
||||
victim = null
|
||||
return
|
||||
victim.cure_blind("hypnochair")
|
||||
REMOVE_TRAIT(victim, TRAIT_DEAF, "hypnochair")
|
||||
victim.cure_blind(HYPNOCHAIR_TRAIT)
|
||||
REMOVE_TRAIT(victim, TRAIT_DEAF, HYPNOCHAIR_TRAIT)
|
||||
if(!(victim.get_eye_protection() > 0))
|
||||
victim.cure_trauma_type(/datum/brain_trauma/severe/hypnotic_trigger, TRAUMA_RESILIENCE_SURGERY)
|
||||
if(prob(90))
|
||||
|
||||
@@ -360,11 +360,11 @@
|
||||
/obj/item/clothing/glasses/blindfold/equipped(mob/living/carbon/human/user, slot)
|
||||
. = ..()
|
||||
if(slot == ITEM_SLOT_EYES)
|
||||
user.become_blind("blindfold_[REF(src)]")
|
||||
user.become_blind(BLINDFOLD_TRAIT)
|
||||
|
||||
/obj/item/clothing/glasses/blindfold/dropped(mob/living/carbon/human/user)
|
||||
..()
|
||||
user.cure_blind("blindfold_[REF(src)]")
|
||||
user.cure_blind(BLINDFOLD_TRAIT)
|
||||
|
||||
/obj/item/clothing/glasses/trickblindfold
|
||||
name = "blindfold"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/mob/living/carbon/get_eye_protection()
|
||||
. = ..()
|
||||
if(HAS_TRAIT(src, TRAIT_BLIND))
|
||||
if(HAS_TRAIT_NOT_FROM(src, TRAIT_BLIND, list(UNCONSCIOUS_TRAIT, HYPNOCHAIR_TRAIT)))
|
||||
return INFINITY //For all my homies that can not see in the world
|
||||
var/obj/item/organ/eyes/E = getorganslot(ORGAN_SLOT_EYES)
|
||||
if(!E)
|
||||
|
||||
+2
-2
@@ -746,13 +746,13 @@ Basically, we fill the time between now and 2s from now with hands based off the
|
||||
if(headache)
|
||||
return ..()
|
||||
if(DT_PROB(100*(1-creation_purity), delta_time))
|
||||
owner.become_blind("oculine_impure")
|
||||
owner.become_blind(IMPURE_OCULINE)
|
||||
to_chat(owner, "<span class='warning'>You suddenly develop a pounding headache as your vision fluxuates.</spans>")
|
||||
headache = TRUE
|
||||
..()
|
||||
|
||||
/datum/reagent/inverse/oculine/on_mob_end_metabolize(mob/living/owner)
|
||||
owner.cure_blind("oculine_impure")
|
||||
owner.cure_blind(IMPURE_OCULINE)
|
||||
if(headache)
|
||||
to_chat(owner, "<span class='notice'>Your headache clears up!</spans>")
|
||||
..()
|
||||
|
||||
@@ -87,11 +87,11 @@
|
||||
|
||||
/datum/nanite_program/conductive/enable_passive_effect()
|
||||
. = ..()
|
||||
ADD_TRAIT(host_mob, TRAIT_SHOCKIMMUNE, "nanites")
|
||||
ADD_TRAIT(host_mob, TRAIT_SHOCKIMMUNE, NANITES_TRAIT)
|
||||
|
||||
/datum/nanite_program/conductive/disable_passive_effect()
|
||||
. = ..()
|
||||
REMOVE_TRAIT(host_mob, TRAIT_SHOCKIMMUNE, "nanites")
|
||||
REMOVE_TRAIT(host_mob, TRAIT_SHOCKIMMUNE, NANITES_TRAIT)
|
||||
|
||||
/datum/nanite_program/mindshield
|
||||
name = "Mental Barrier"
|
||||
@@ -102,10 +102,10 @@
|
||||
/datum/nanite_program/mindshield/enable_passive_effect()
|
||||
. = ..()
|
||||
if(!host_mob.mind.has_antag_datum(/datum/antagonist/rev, TRUE)) //won't work if on a rev, to avoid having implanted revs.
|
||||
ADD_TRAIT(host_mob, TRAIT_MINDSHIELD, "nanites")
|
||||
ADD_TRAIT(host_mob, TRAIT_MINDSHIELD, NANITES_TRAIT)
|
||||
host_mob.sec_hud_set_implants()
|
||||
|
||||
/datum/nanite_program/mindshield/disable_passive_effect()
|
||||
. = ..()
|
||||
REMOVE_TRAIT(host_mob, TRAIT_MINDSHIELD, "nanites")
|
||||
REMOVE_TRAIT(host_mob, TRAIT_MINDSHIELD, NANITES_TRAIT)
|
||||
host_mob.sec_hud_set_implants()
|
||||
|
||||
@@ -62,11 +62,11 @@
|
||||
|
||||
/datum/nanite_program/pacifying/enable_passive_effect()
|
||||
. = ..()
|
||||
ADD_TRAIT(host_mob, TRAIT_PACIFISM, "nanites")
|
||||
ADD_TRAIT(host_mob, TRAIT_PACIFISM, NANITES_TRAIT)
|
||||
|
||||
/datum/nanite_program/pacifying/disable_passive_effect()
|
||||
. = ..()
|
||||
REMOVE_TRAIT(host_mob, TRAIT_PACIFISM, "nanites")
|
||||
REMOVE_TRAIT(host_mob, TRAIT_PACIFISM, NANITES_TRAIT)
|
||||
|
||||
/datum/nanite_program/blinding
|
||||
name = "Blindness"
|
||||
@@ -76,11 +76,11 @@
|
||||
|
||||
/datum/nanite_program/blinding/enable_passive_effect()
|
||||
. = ..()
|
||||
host_mob.become_blind("nanites")
|
||||
host_mob.become_blind(NANITES_TRAIT)
|
||||
|
||||
/datum/nanite_program/blinding/disable_passive_effect()
|
||||
. = ..()
|
||||
host_mob.cure_blind("nanites")
|
||||
host_mob.cure_blind(NANITES_TRAIT)
|
||||
|
||||
/datum/nanite_program/mute
|
||||
name = "Mute"
|
||||
@@ -90,11 +90,11 @@
|
||||
|
||||
/datum/nanite_program/mute/enable_passive_effect()
|
||||
. = ..()
|
||||
ADD_TRAIT(host_mob, TRAIT_MUTE, "nanites")
|
||||
ADD_TRAIT(host_mob, TRAIT_MUTE, NANITES_TRAIT)
|
||||
|
||||
/datum/nanite_program/mute/disable_passive_effect()
|
||||
. = ..()
|
||||
REMOVE_TRAIT(host_mob, TRAIT_MUTE, "nanites")
|
||||
REMOVE_TRAIT(host_mob, TRAIT_MUTE, NANITES_TRAIT)
|
||||
|
||||
/datum/nanite_program/fake_death
|
||||
name = "Death Simulation"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
/datum/nanite_program/monitoring/enable_passive_effect()
|
||||
. = ..()
|
||||
ADD_TRAIT(host_mob, TRAIT_NANITE_MONITORING, "nanites") //Shows up in diagnostic and medical HUDs as a small blinking icon
|
||||
ADD_TRAIT(host_mob, TRAIT_NANITE_MONITORING, NANITES_TRAIT) //Shows up in diagnostic and medical HUDs as a small blinking icon
|
||||
if(ishuman(host_mob))
|
||||
GLOB.nanite_sensors_list |= host_mob
|
||||
host_mob.hud_set_nanite_indicator()
|
||||
|
||||
@@ -214,14 +214,14 @@
|
||||
eye.on = TRUE
|
||||
eye.forceMove(victim)
|
||||
eye.update_brightness(victim)
|
||||
victim.become_blind("flashlight_eyes")
|
||||
victim.become_blind(FLASHLIGHT_EYES)
|
||||
|
||||
|
||||
/obj/item/organ/eyes/robotic/flashlight/Remove(mob/living/carbon/victim, special = 0)
|
||||
eye.on = FALSE
|
||||
eye.update_brightness(victim)
|
||||
eye.forceMove(src)
|
||||
victim.cure_blind("flashlight_eyes")
|
||||
victim.cure_blind(FLASHLIGHT_EYES)
|
||||
..()
|
||||
|
||||
// Welding shield implant
|
||||
|
||||
Reference in New Issue
Block a user