diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index fa39b35cab..adf8656708 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -131,6 +131,7 @@ #define TRAIT_NYMPHO "nymphomania" #define TRAIT_MASO "masochism" #define TRAIT_ASSBLASTUSA "assblastusa" +#define TRAIT_CULT_EYES "cult_eyes" // common trait sources #define TRAIT_GENERIC "generic" @@ -153,4 +154,3 @@ #define STASIS_MUTE "stasis" #define GENETICS_SPELL "genetics_spell" #define EYES_COVERED "eyes_covered" -#define CULT_EYES "cult_eyes" diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index d23d0905e9..2a14d232aa 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -64,7 +64,7 @@ to_chat(user, "You're too exhausted.") // CIT CHANGE - ditto return // CIT CHANGE - ditto - if(force && user.has_trait(TRAIT_PACIFISM)) + if(force && HAS_TRAIT(user, TRAIT_PACIFISM)) to_chat(user, "You don't want to harm other living beings!") return diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm index afd53726db..f2fec3bb63 100644 --- a/code/datums/brain_damage/mild.dm +++ b/code/datums/brain_damage/mild.dm @@ -42,7 +42,7 @@ lose_text = "You feel smart again." /datum/brain_trauma/mild/dumbness/on_gain() - owner.add_trait(TRAIT_DUMB, TRAUMA_TRAIT) + ADD_TRAIT(owner, TRAIT_DUMB, TRAUMA_TRAIT) SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "dumb", /datum/mood_event/oblivious) ..() @@ -55,7 +55,7 @@ ..() /datum/brain_trauma/mild/dumbness/on_lose() - owner.remove_trait(TRAIT_DUMB, TRAUMA_TRAIT) + REMOVE_TRAIT(owner, TRAIT_DUMB, TRAUMA_TRAIT) owner.derpspeech = 0 SEND_SIGNAL(owner, COMSIG_CLEAR_MOOD_EVENT, "dumb") ..() diff --git a/code/datums/brain_damage/severe.dm b/code/datums/brain_damage/severe.dm index a8adbfbce8..e790e539c8 100644 --- a/code/datums/brain_damage/severe.dm +++ b/code/datums/brain_damage/severe.dm @@ -13,11 +13,11 @@ lose_text = "You suddenly remember how to speak." /datum/brain_trauma/severe/mute/on_gain() - owner.add_trait(TRAIT_MUTE, TRAUMA_TRAIT) + ADD_TRAIT(owner, TRAIT_MUTE, TRAUMA_TRAIT) ..() /datum/brain_trauma/severe/mute/on_lose() - owner.remove_trait(TRAIT_MUTE, TRAUMA_TRAIT) + REMOVE_TRAIT(owner, TRAIT_MUTE, TRAUMA_TRAIT) ..() /datum/brain_trauma/severe/aphasia @@ -121,7 +121,7 @@ stress -= 4 /datum/brain_trauma/severe/monophobia/proc/check_alone() - if(owner.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(owner, TRAIT_BLIND)) return TRUE for(var/mob/M in oview(owner, 7)) if(!isliving(M)) //ghosts ain't people @@ -183,11 +183,11 @@ lose_text = "You feel in control of your hands again." /datum/brain_trauma/severe/discoordination/on_gain() - owner.add_trait(TRAIT_MONKEYLIKE, TRAUMA_TRAIT) + ADD_TRAIT(owner, TRAIT_MONKEYLIKE, TRAUMA_TRAIT) ..() /datum/brain_trauma/severe/discoordination/on_lose() - owner.remove_trait(TRAIT_MONKEYLIKE, TRAUMA_TRAIT) + REMOVE_TRAIT(owner, TRAIT_MONKEYLIKE, TRAUMA_TRAIT) ..() /datum/brain_trauma/severe/pacifism @@ -198,9 +198,9 @@ lose_text = "You no longer feel compelled to not harm." /datum/brain_trauma/severe/pacifism/on_gain() - owner.add_trait(TRAIT_PACIFISM, TRAUMA_TRAIT) + ADD_TRAIT(owner, TRAIT_PACIFISM, TRAUMA_TRAIT) ..() /datum/brain_trauma/severe/pacifism/on_lose() - owner.remove_trait(TRAIT_PACIFISM, TRAUMA_TRAIT) + REMOVE_TRAIT(owner, TRAIT_PACIFISM, TRAUMA_TRAIT) ..() \ No newline at end of file diff --git a/code/datums/brain_damage/split_personality.dm b/code/datums/brain_damage/split_personality.dm index 9ce65717f1..612af13392 100644 --- a/code/datums/brain_damage/split_personality.dm +++ b/code/datums/brain_damage/split_personality.dm @@ -192,7 +192,7 @@ return //no random switching /datum/brain_trauma/severe/split_personality/brainwashing/on_hear(message, speaker, message_language, raw_message, radio_freq) - if(owner.has_trait(TRAIT_DEAF) || owner == speaker) + if(HAS_TRAIT(owner, TRAIT_DEAF) || owner == speaker) return message if(findtext(message, codeword)) message = replacetext(message, codeword, "[codeword]") diff --git a/code/datums/components/caltrop.dm b/code/datums/components/caltrop.dm index 1e1b7a0a48..838a1b576a 100644 --- a/code/datums/components/caltrop.dm +++ b/code/datums/components/caltrop.dm @@ -24,7 +24,7 @@ if(ishuman(AM)) var/mob/living/carbon/human/H = AM - if(H.has_trait(TRAIT_PIERCEIMMUNE)) + if(HAS_TRAIT(H, TRAIT_PIERCEIMMUNE)) return if((flags & CALTROP_IGNORE_WALKERS) && H.m_intent == MOVE_INTENT_WALK) @@ -46,7 +46,7 @@ return var/damage = rand(min_damage, max_damage) - if(H.has_trait(TRAIT_LIGHT_STEP)) + if(HAS_TRAIT(H, TRAIT_LIGHT_STEP)) damage *= 0.75 H.apply_damage(damage, BRUTE, picked_def_zone) diff --git a/code/datums/components/earhealing.dm b/code/datums/components/earhealing.dm index 9396eab3a3..6eb71285e0 100644 --- a/code/datums/components/earhealing.dm +++ b/code/datums/components/earhealing.dm @@ -23,7 +23,7 @@ if (!wearer) STOP_PROCESSING(SSobj, src) return - if(!wearer.has_trait(TRAIT_DEAF)) + if(!HAS_TRAIT(wearer, TRAIT_DEAF)) var/obj/item/organ/ears/ears = wearer.getorganslot(ORGAN_SLOT_EARS) if (ears) ears.deaf = max(ears.deaf - 1, (ears.ear_damage < UNHEALING_EAR_DAMAGE ? 0 : 1)) // Do not clear deafness while above the unhealing ear damage threshold diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 933c38505b..b32921a4ce 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -15,7 +15,7 @@ /datum/component/mood/Initialize() if(!isliving(parent)) return COMPONENT_INCOMPATIBLE - + START_PROCESSING(SSmood, src) RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, .proc/add_event) @@ -150,17 +150,17 @@ else owner.crit_threshold -= (holdmyinsanityeffect - insanity_effect) - if(owner.has_trait(TRAIT_DEPRESSION)) + if(HAS_TRAIT(owner, TRAIT_DEPRESSION)) if(prob(0.05)) add_event(null, "depression", /datum/mood_event/depression) clear_event(null, "jolly") - if(owner.has_trait(TRAIT_JOLLY)) + if(HAS_TRAIT(owner, TRAIT_JOLLY)) if(prob(0.05)) add_event(null, "jolly", /datum/mood_event/jolly) clear_event(null, "depression") holdmyinsanityeffect = insanity_effect - + HandleNutrition(owner) /datum/component/mood/proc/DecreaseSanity(amount, minimum = SANITY_INSANE) diff --git a/code/datums/diseases/_MobProcs.dm b/code/datums/diseases/_MobProcs.dm index ba570eca06..e1432bf9a6 100644 --- a/code/datums/diseases/_MobProcs.dm +++ b/code/datums/diseases/_MobProcs.dm @@ -117,7 +117,7 @@ /mob/living/carbon/AirborneContractDisease(datum/disease/D, force_spread) if(internal) return - if(has_trait(TRAIT_NOBREATH)) + if(HAS_TRAIT(src, TRAIT_NOBREATH)) return ..() @@ -137,7 +137,7 @@ /mob/living/carbon/human/CanContractDisease(datum/disease/D) if(dna) - if(has_trait(TRAIT_VIRUSIMMUNE) && !D.bypasses_immunity) + if(HAS_TRAIT(src, TRAIT_VIRUSIMMUNE) && !D.bypasses_immunity) return FALSE for(var/thing in D.required_organs) diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index 0ace2ca8fd..3e1ac87e6e 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -233,7 +233,7 @@ /datum/symptom/heal/coma/CanHeal(datum/disease/advance/A) var/mob/living/M = A.affected_mob - if(M.has_trait(TRAIT_DEATHCOMA)) + if(HAS_TRAIT(M, TRAIT_DEATHCOMA)) return power else if(M.IsUnconscious() || M.stat == UNCONSCIOUS) return power * 0.9 diff --git a/code/datums/diseases/advance/symptoms/sensory.dm b/code/datums/diseases/advance/symptoms/sensory.dm index ffc145bd72..8d7cc5ed70 100644 --- a/code/datums/diseases/advance/symptoms/sensory.dm +++ b/code/datums/diseases/advance/symptoms/sensory.dm @@ -85,14 +85,14 @@ if(4, 5) M.restoreEars() - if(M.has_trait(TRAIT_BLIND, EYE_DAMAGE)) + if(HAS_TRAIT_FROM(M, TRAIT_BLIND, EYE_DAMAGE)) if(prob(20)) to_chat(M, "Your vision slowly returns...") M.cure_blind(EYE_DAMAGE) M.cure_nearsighted(EYE_DAMAGE) M.blur_eyes(35) - else if(M.has_trait(TRAIT_NEARSIGHT, EYE_DAMAGE)) + else if(HAS_TRAIT_FROM(M, TRAIT_NEARSIGHT, EYE_DAMAGE)) to_chat(M, "You can finally focus your eyes on distant objects.") M.cure_nearsighted(EYE_DAMAGE) M.blur_eyes(10) diff --git a/code/datums/diseases/advance/symptoms/vision.dm b/code/datums/diseases/advance/symptoms/vision.dm index 0b42012f76..d1cc6905a6 100644 --- a/code/datums/diseases/advance/symptoms/vision.dm +++ b/code/datums/diseases/advance/symptoms/vision.dm @@ -61,7 +61,7 @@ Bonus M.become_nearsighted(EYE_DAMAGE) if(prob(eyes.eye_damage - 10 + 1)) if(!remove_eyes) - if(!M.has_trait(TRAIT_BLIND)) + if(!HAS_TRAIT(M, TRAIT_BLIND)) to_chat(M, "You go blind!") M.become_blind(EYE_DAMAGE) else diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm index 57cdb9bcf5..6c91cc3a7d 100644 --- a/code/datums/emotes.dm +++ b/code/datums/emotes.dm @@ -133,7 +133,7 @@ if(isliving(user)) var/mob/living/L = user - if(L.has_trait(TRAIT_EMOTEMUTE)) + if(HAS_TRAIT(L, TRAIT_EMOTEMUTE)) return FALSE /datum/emote/sound diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index 4a15afd672..035e5ac833 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -179,7 +179,7 @@ /obj/item/twohanded/bostaff/attack(mob/target, mob/living/user) add_fingerprint(user) - if((user.has_trait(TRAIT_CLUMSY)) && prob(50)) + if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50)) to_chat(user, "You club yourself over the head with [src].") user.Knockdown(60) if(ishuman(user)) diff --git a/code/datums/mutations/body.dm b/code/datums/mutations/body.dm index e114a43736..461c221ff8 100644 --- a/code/datums/mutations/body.dm +++ b/code/datums/mutations/body.dm @@ -86,12 +86,12 @@ /datum/mutation/human/clumsy/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.add_trait(TRAIT_CLUMSY, GENETIC_MUTATION) + ADD_TRAIT(owner, TRAIT_CLUMSY, GENETIC_MUTATION) /datum/mutation/human/clumsy/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.remove_trait(TRAIT_CLUMSY, GENETIC_MUTATION) + REMOVE_TRAIT(owner, TRAIT_CLUMSY, GENETIC_MUTATION) //Tourettes causes you to randomly stand in place and shout. @@ -125,12 +125,12 @@ /datum/mutation/human/deaf/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.add_trait(TRAIT_DEAF, GENETIC_MUTATION) + ADD_TRAIT(owner, TRAIT_DEAF, GENETIC_MUTATION) /datum/mutation/human/deaf/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.remove_trait(TRAIT_DEAF, GENETIC_MUTATION) + REMOVE_TRAIT(owner, TRAIT_DEAF, GENETIC_MUTATION) //Monified turns you into a monkey. diff --git a/code/datums/mutations/cold_resistance.dm b/code/datums/mutations/cold_resistance.dm index 6c3ac2982d..3d8fbababa 100644 --- a/code/datums/mutations/cold_resistance.dm +++ b/code/datums/mutations/cold_resistance.dm @@ -17,14 +17,14 @@ /datum/mutation/human/cold_resistance/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.add_trait(TRAIT_RESISTCOLD, "cold_resistance") -// owner.add_trait(TRAIT_RESISTLOWPRESSURE, "cold_resistance") CITADEL CHANGE + ADD_TRAIT(owner, TRAIT_RESISTCOLD, "cold_resistance") +// ADD_TRAIT(owner, TRAIT_RESISTLOWPRESSURE, "cold_resistance") CITADEL CHANGE /datum/mutation/human/cold_resistance/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.remove_trait(TRAIT_RESISTCOLD, "cold_resistance") -// owner.remove_trait(TRAIT_RESISTLOWPRESSURE, "cold_resistance") CITADEL CHANGE + REMOVE_TRAIT(owner, TRAIT_RESISTCOLD, "cold_resistance") +// REMOVE_TRAIT(owner, TRAIT_RESISTLOWPRESSURE, "cold_resistance") CITADEL CHANGE /datum/mutation/human/cold_resistance/on_life(mob/living/carbon/human/owner) if(owner.getFireLoss()) diff --git a/code/datums/mutations/hulk.dm b/code/datums/mutations/hulk.dm index 7bcd056fab..0c760f4620 100644 --- a/code/datums/mutations/hulk.dm +++ b/code/datums/mutations/hulk.dm @@ -11,8 +11,8 @@ /datum/mutation/human/hulk/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.add_trait(TRAIT_STUNIMMUNE, TRAIT_HULK) - owner.add_trait(TRAIT_PUSHIMMUNE, TRAIT_HULK) + ADD_TRAIT(owner, TRAIT_STUNIMMUNE, TRAIT_HULK) + ADD_TRAIT(owner, TRAIT_PUSHIMMUNE, TRAIT_HULK) owner.update_body_parts() SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "hulk", /datum/mood_event/hulk) @@ -28,8 +28,8 @@ /datum/mutation/human/hulk/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.remove_trait(TRAIT_STUNIMMUNE, TRAIT_HULK) - owner.remove_trait(TRAIT_PUSHIMMUNE, TRAIT_HULK) + REMOVE_TRAIT(owner, TRAIT_STUNIMMUNE, TRAIT_HULK) + REMOVE_TRAIT(owner, TRAIT_PUSHIMMUNE, TRAIT_HULK) owner.update_body_parts() SEND_SIGNAL(owner, COMSIG_CLEAR_MOOD_EVENT, "hulk") diff --git a/code/datums/mutations/speech.dm b/code/datums/mutations/speech.dm index 3f303535ce..5c718cf554 100644 --- a/code/datums/mutations/speech.dm +++ b/code/datums/mutations/speech.dm @@ -30,12 +30,12 @@ /datum/mutation/human/mute/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.add_trait(TRAIT_MUTE, GENETIC_MUTATION) + ADD_TRAIT(owner, TRAIT_MUTE, GENETIC_MUTATION) /datum/mutation/human/mute/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.remove_trait(TRAIT_MUTE, GENETIC_MUTATION) + REMOVE_TRAIT(owner, TRAIT_MUTE, GENETIC_MUTATION) /datum/mutation/human/smile diff --git a/code/datums/saymode.dm b/code/datums/saymode.dm index ed6edd11ab..c4f485653e 100644 --- a/code/datums/saymode.dm +++ b/code/datums/saymode.dm @@ -27,7 +27,7 @@ switch(M.lingcheck()) if (LINGHIVE_LING) var/mob/living/L = M - if (!L.has_trait(CHANGELING_HIVEMIND_MUTE)) + if (!HAS_TRAIT(L, CHANGELING_HIVEMIND_MUTE)) to_chat(M, msg) if(LINGHIVE_LINK) to_chat(M, msg) @@ -35,7 +35,7 @@ if(prob(40)) to_chat(M, "We can faintly sense an outsider trying to communicate through the hivemind...") if(LINGHIVE_LING) - if (user.has_trait(CHANGELING_HIVEMIND_MUTE)) + if (HAS_TRAIT(user, CHANGELING_HIVEMIND_MUTE)) to_chat(user, "The poison in the air hinders our ability to interact with the hivemind.") return FALSE var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) @@ -52,7 +52,7 @@ to_chat(M, msg) if(LINGHIVE_LING) var/mob/living/L = M - if (!L.has_trait(CHANGELING_HIVEMIND_MUTE)) + if (!HAS_TRAIT(L, CHANGELING_HIVEMIND_MUTE)) to_chat(M, msg) if(LINGHIVE_OUTSIDER) if(prob(40)) diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index dd8ee1b166..0512977d1a 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -465,13 +465,13 @@ /datum/status_effect/hippocraticOath/on_apply() //Makes the user passive, it's in their oath not to harm! - owner.add_trait(TRAIT_PACIFISM, "hippocraticOath") + ADD_TRAIT(owner, TRAIT_PACIFISM, "hippocraticOath") var/datum/atom_hud/H = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] H.add_hud_to(owner) return ..() /datum/status_effect/hippocraticOath/on_remove() - owner.remove_trait(TRAIT_PACIFISM, "hippocraticOath") + REMOVE_TRAIT(owner, TRAIT_PACIFISM, "hippocraticOath") var/datum/atom_hud/H = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] H.remove_hud_from(owner) diff --git a/code/datums/traits/_quirk.dm b/code/datums/traits/_quirk.dm index 963afacec3..cc6dd8db3f 100644 --- a/code/datums/traits/_quirk.dm +++ b/code/datums/traits/_quirk.dm @@ -21,7 +21,7 @@ to_chat(quirk_holder, gain_text) quirk_holder.roundstart_quirks += src if(mob_trait) - quirk_holder.add_trait(mob_trait, ROUNDSTART_TRAIT) + ADD_TRAIT(quirk_holder, mob_trait, ROUNDSTART_TRAIT) START_PROCESSING(SSquirks, src) add() if(spawn_effects) @@ -35,7 +35,7 @@ to_chat(quirk_holder, lose_text) quirk_holder.roundstart_quirks -= src if(mob_trait) - quirk_holder.remove_trait(mob_trait, ROUNDSTART_TRAIT, TRUE) + REMOVE_TRAIT(quirk_holder, mob_trait, ROUNDSTART_TRAIT) SSquirks.quirk_objects -= src return ..() @@ -43,8 +43,8 @@ quirk_holder.roundstart_quirks -= src to_mob.roundstart_quirks += src if(mob_trait) - quirk_holder.remove_trait(mob_trait, ROUNDSTART_TRAIT) - to_mob.add_trait(mob_trait, ROUNDSTART_TRAIT) + REMOVE_TRAIT(quirk_holder, mob_trait, ROUNDSTART_TRAIT) + ADD_TRAIT(to_mob, mob_trait, ROUNDSTART_TRAIT) quirk_holder = to_mob on_transfer() @@ -111,7 +111,7 @@ Use this as a guideline mob_trait = TRAIT_NEARSIGHT ///This define is in __DEFINES/traits.dm and is the actual "trait" that the game tracks - ///You'll need to use "has_trait(X, sources)" checks around the code to check this; for instance, the Ageusia trait is checked in taste code + ///You'll need to use "HAS_TRAIT_FROM(src, X, sources)" checks around the code to check this; for instance, the Ageusia trait is checked in taste code ///If you need help finding where to put it, the declaration finder on GitHub is the best way to locate it gain_text = "Things far away from you start looking blurry." diff --git a/code/datums/weather/weather_types/radiation_storm.dm b/code/datums/weather/weather_types/radiation_storm.dm index 0906a7e053..f3b8118087 100644 --- a/code/datums/weather/weather_types/radiation_storm.dm +++ b/code/datums/weather/weather_types/radiation_storm.dm @@ -33,7 +33,7 @@ if(prob(40)) if(ishuman(L)) var/mob/living/carbon/human/H = L - if(H.dna && !H.has_trait(TRAIT_RADIMMUNE)) + if(H.dna && !HAS_TRAIT(H, TRAIT_RADIMMUNE)) if(prob(max(0,100-resist))) H.randmuti() if(prob(50)) diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 3af43ffb78..8506a4133a 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -100,7 +100,7 @@ //helper for getting the appropriate health status /proc/RoundHealth(mob/living/M) - if(M.stat == DEAD || (M.has_trait(TRAIT_FAKEDEATH))) + if(M.stat == DEAD || (HAS_TRAIT(M, TRAIT_FAKEDEATH))) return "health-100" //what's our health? it doesn't matter, we're dead, or faking var/maxi_health = M.maxHealth if(iscarbon(M) && M.health < 0) @@ -172,7 +172,7 @@ var/image/holder = hud_list[STATUS_HUD] var/icon/I = icon(icon, icon_state, dir) holder.pixel_y = I.Height() - world.icon_size - if(stat == DEAD || (has_trait(TRAIT_FAKEDEATH))) + if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH))) holder.icon_state = "huddead" else holder.icon_state = "hudhealthy" @@ -182,9 +182,9 @@ var/icon/I = icon(icon, icon_state, dir) var/virus_threat = check_virus() holder.pixel_y = I.Height() - world.icon_size - if(has_trait(TRAIT_XENO_HOST)) + if(HAS_TRAIT(src, TRAIT_XENO_HOST)) holder.icon_state = "hudxeno" - else if(stat == DEAD || (has_trait(TRAIT_FAKEDEATH))) + else if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH))) if(tod) var/tdelta = round(world.time - timeofdeath) if(tdelta < (DEFIB_TIME_LIMIT * 10)) @@ -242,7 +242,7 @@ var/icon/IC = icon(icon, icon_state, dir) holder.pixel_y = IC.Height() - world.icon_size holder.icon_state = "hud_imp_chem" - if(has_trait(TRAIT_MINDSHIELD)) + if(HAS_TRAIT(src, TRAIT_MINDSHIELD)) holder = hud_list[IMPLOYAL_HUD] var/icon/IC = icon(icon, icon_state, dir) holder.pixel_y = IC.Height() - world.icon_size diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index d6513b5d40..a21d1bce35 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -64,7 +64,7 @@ Credit where due: return FALSE if(isliving(M)) var/mob/living/L = M - if(L.has_trait(TRAIT_MINDSHIELD)) + if(HAS_TRAIT(L, TRAIT_MINDSHIELD)) return FALSE if(ishuman(M) || isbrain(M) || isguardian(M) || issilicon(M) || isclockmob(M) || istype(M, /mob/living/simple_animal/drone/cogscarab) || istype(M, /mob/camera/eminence)) return TRUE diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 7b492e3a95..8f091b6372 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -26,7 +26,7 @@ return FALSE else return FALSE - if(M.has_trait(TRAIT_MINDSHIELD) || issilicon(M) || isbot(M) || isdrone(M) || is_servant_of_ratvar(M) || !M.client) + if(HAS_TRAIT(M, TRAIT_MINDSHIELD) || issilicon(M) || isbot(M) || isdrone(M) || is_servant_of_ratvar(M) || !M.client) return FALSE //can't convert machines, shielded, braindead, or ratvar's dogs return TRUE diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index d3b5e53a1b..36a5c6ede4 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -182,11 +182,11 @@ //Get the clone body ready maim_clone(H) - H.add_trait(TRAIT_STABLEHEART, "cloning") - H.add_trait(TRAIT_EMOTEMUTE, "cloning") - H.add_trait(TRAIT_MUTE, "cloning") - H.add_trait(TRAIT_NOBREATH, "cloning") - H.add_trait(TRAIT_NOCRITDAMAGE, "cloning") + ADD_TRAIT(H, TRAIT_STABLEHEART, "cloning") + ADD_TRAIT(H, TRAIT_EMOTEMUTE, "cloning") + ADD_TRAIT(H, TRAIT_MUTE, "cloning") + ADD_TRAIT(H, TRAIT_NOBREATH, "cloning") + ADD_TRAIT(H, TRAIT_NOCRITDAMAGE, "cloning") H.Unconscious(80) clonemind.transfer_to(H) @@ -361,11 +361,11 @@ if(!mob_occupant) return - mob_occupant.remove_trait(TRAIT_STABLEHEART, "cloning") - mob_occupant.remove_trait(TRAIT_EMOTEMUTE, "cloning") - mob_occupant.remove_trait(TRAIT_MUTE, "cloning") - mob_occupant.remove_trait(TRAIT_NOCRITDAMAGE, "cloning") - mob_occupant.remove_trait(TRAIT_NOBREATH, "cloning") + REMOVE_TRAIT(mob_occupant, TRAIT_STABLEHEART, "cloning") + REMOVE_TRAIT(mob_occupant, TRAIT_EMOTEMUTE, "cloning") + REMOVE_TRAIT(mob_occupant, TRAIT_MUTE, "cloning") + REMOVE_TRAIT(mob_occupant, TRAIT_NOCRITDAMAGE, "cloning") + REMOVE_TRAIT(mob_occupant, TRAIT_NOBREATH, "cloning") if(grab_ghost_when == CLONER_MATURE_CLONE) mob_occupant.grab_ghost() @@ -452,7 +452,7 @@ // brain function, they also have no limbs or internal organs. - if(!H.has_trait(TRAIT_NODISMEMBER)) + if(!HAS_TRAIT(H, TRAIT_NODISMEMBER)) var/static/list/zones = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) for(var/zone in zones) var/obj/item/bodypart/BP = H.get_bodypart(zone) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 00a5c8941d..39d5c3d56f 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -450,7 +450,7 @@ scantemp = "Subject's brain is not responding to scanning stimuli." playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) return - if((mob_occupant.has_trait(TRAIT_NOCLONE)) && (src.scanner.scan_level < 2)) + if((HAS_TRAIT(mob_occupant, TRAIT_NOCLONE)) && (src.scanner.scan_level < 2)) scantemp = "Subject no longer contains the fundamental materials required to create a living clone." playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0) return diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index 2980c741be..9d49574317 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -76,7 +76,7 @@ if(connected && connected.is_operational()) if(connected.occupant) //set occupant_status message viable_occupant = connected.occupant - if(viable_occupant.has_dna() && !viable_occupant.has_trait(TRAIT_RADIMMUNE) && !viable_occupant.has_trait(TRAIT_NOCLONE) || (connected.scan_level == 3)) //occupant is viable for dna modification + if(viable_occupant.has_dna() && !HAS_TRAIT(viable_occupant, TRAIT_RADIMMUNE) && !HAS_TRAIT(viable_occupant, TRAIT_NOCLONE) || (connected.scan_level == 3)) //occupant is viable for dna modification occupant_status += "[viable_occupant.name] => " switch(viable_occupant.stat) if(CONSCIOUS) @@ -523,7 +523,7 @@ var/mob/living/carbon/viable_occupant = null if(connected) viable_occupant = connected.occupant - if(!istype(viable_occupant) || !viable_occupant.dna || viable_occupant.has_trait(TRAIT_RADIMMUNE) || viable_occupant.has_trait(TRAIT_NOCLONE)) + if(!istype(viable_occupant) || !viable_occupant.dna || HAS_TRAIT(viable_occupant, TRAIT_RADIMMUNE) || HAS_TRAIT(viable_occupant, TRAIT_NOCLONE)) viable_occupant = null return viable_occupant diff --git a/code/game/machinery/dna_scanner.dm b/code/game/machinery/dna_scanner.dm index 90a6b07733..7895fb8c9f 100644 --- a/code/game/machinery/dna_scanner.dm +++ b/code/game/machinery/dna_scanner.dm @@ -99,7 +99,7 @@ var/mob/living/mob_occupant = get_mob_or_brainmob(occupant) if(istype(mob_occupant)) if(locate_computer(/obj/machinery/computer/cloning)) - if(!mob_occupant.suiciding && !(mob_occupant.has_trait(TRAIT_NOCLONE)) && !mob_occupant.hellbound) + if(!mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_NOCLONE)) && !mob_occupant.hellbound) mob_occupant.notify_ghost_cloning("Your corpse has been placed into a cloning scanner. Re-enter your corpse if you want to be cloned!", source = src) // DNA manipulators cannot operate on severed heads or brains diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 0183fcecd4..1081cb5fa7 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -763,7 +763,7 @@ if(ishuman(user) && prob(40) && src.density) var/mob/living/carbon/human/H = user - if((H.has_trait(TRAIT_DUMB)) && Adjacent(user)) + if((HAS_TRAIT(H, TRAIT_DUMB)) && Adjacent(user)) playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) if(!istype(H.head, /obj/item/clothing/head/helmet)) H.visible_message("[user] headbutts the airlock.", \ diff --git a/code/game/machinery/exp_cloner.dm b/code/game/machinery/exp_cloner.dm index 45ac999a6a..e8364d2271 100644 --- a/code/game/machinery/exp_cloner.dm +++ b/code/game/machinery/exp_cloner.dm @@ -42,11 +42,11 @@ icon_state = "pod_1" //Get the clone body ready maim_clone(H) - H.add_trait(TRAIT_STABLEHEART, "cloning") - H.add_trait(TRAIT_EMOTEMUTE, "cloning") - H.add_trait(TRAIT_MUTE, "cloning") - H.add_trait(TRAIT_NOBREATH, "cloning") - H.add_trait(TRAIT_NOCRITDAMAGE, "cloning") + ADD_TRAIT(H, TRAIT_STABLEHEART, "cloning") + ADD_TRAIT(H, TRAIT_EMOTEMUTE, "cloning") + ADD_TRAIT(H, TRAIT_MUTE, "cloning") + ADD_TRAIT(H, TRAIT_NOBREATH, "cloning") + ADD_TRAIT(H, TRAIT_NOCRITDAMAGE, "cloning") H.Unconscious(80) var/list/candidates = pollCandidatesForMob("Do you want to play as [clonename]'s defective clone?", null, null, null, 100, H) @@ -268,7 +268,7 @@ scantemp = "Unable to locate valid genetic data." playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) return - if((mob_occupant.has_trait(TRAIT_NOCLONE)) && (src.scanner.scan_level < 2)) + if((HAS_TRAIT(mob_occupant, TRAIT_NOCLONE)) && (src.scanner.scan_level < 2)) scantemp = "Subject no longer contains the fundamental materials required to create a living clone." playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0) return diff --git a/code/game/machinery/harvester.dm b/code/game/machinery/harvester.dm index 1f40672e05..0042da1c92 100644 --- a/code/game/machinery/harvester.dm +++ b/code/game/machinery/harvester.dm @@ -73,7 +73,7 @@ say("Subject is not organic.") playsound(src, 'sound/machines/buzz-sigh.ogg', 30, 1) return - if(!allow_living && !(C.stat == DEAD || C.has_trait(TRAIT_FAKEDEATH))) //I mean, the machines scanners arent advanced enough to tell you're alive + if(!allow_living && !(C.stat == DEAD || HAS_TRAIT(C, TRAIT_FAKEDEATH))) //I mean, the machines scanners arent advanced enough to tell you're alive say("Subject is still alive.") playsound(src, 'sound/machines/buzz-sigh.ogg', 30, 1) return diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 911bb76bda..b0204ddeb8 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -485,7 +485,7 @@ threatcount += 4 if(shoot_unloyal) - if (!perp.has_trait(TRAIT_MINDSHIELD)) + if (!HAS_TRAIT(perp, TRAIT_MINDSHIELD)) threatcount += 4 return threatcount diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index d5de4a4898..945c60d8ba 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -446,13 +446,13 @@ var/mob/living/L = user if(!Adjacent(target)) if(selected && selected.is_ranged()) - if(L.has_trait(TRAIT_PACIFISM) && selected.harmful) + if(HAS_TRAIT(L, TRAIT_PACIFISM) && selected.harmful) to_chat(user, "You don't want to harm other living beings!") return if(selected.action(target,params)) selected.start_cooldown() else if(selected && selected.is_melee()) - if(isliving(target) && selected.harmful && L.has_trait(TRAIT_PACIFISM)) + if(isliving(target) && selected.harmful && HAS_TRAIT(L, TRAIT_PACIFISM)) to_chat(user, "You don't want to harm other living beings!") return if(selected.action(target,params)) diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index 07152b0310..d5aff99f32 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -72,7 +72,7 @@ ..() if(ishuman(O)) var/mob/living/carbon/human/H = O - if(H.shoes && blood_state && bloodiness && !H.has_trait(TRAIT_LIGHT_STEP)) + if(H.shoes && blood_state && bloodiness && !HAS_TRAIT(H, TRAIT_LIGHT_STEP)) var/obj/item/clothing/shoes/S = H.shoes var/add_blood = 0 if(bloodiness >= BLOOD_GAIN_PER_STEP) diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index f1a1655fb4..35f06c2768 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -60,7 +60,7 @@ /obj/effect/decal/cleanable/blood/gibs/Crossed(mob/living/L) if(istype(L) && has_gravity(loc)) - playsound(loc, 'sound/effects/gib_step.ogg', L.has_trait(TRAIT_LIGHT_STEP) ? 20 : 50, 1) + playsound(loc, 'sound/effects/gib_step.ogg', HAS_TRAIT(L, TRAIT_LIGHT_STEP) ? 20 : 50, 1) . = ..() /obj/effect/decal/cleanable/blood/gibs/proc/streak(list/directions) diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index 12a72685bb..7e8094c9e7 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -170,7 +170,7 @@ if(!victim.client || !istype(victim)) return to_chat(victim, "You feel fast!") - victim.add_trait(TRAIT_GOTTAGOREALLYFAST, "yellow_orb") + ADD_TRAIT(victim, TRAIT_GOTTAGOREALLYFAST, "yellow_orb") sleep(duration) - victim.remove_trait(TRAIT_GOTTAGOREALLYFAST, "yellow_orb") + REMOVE_TRAIT(victim, TRAIT_GOTTAGOREALLYFAST, "yellow_orb") to_chat(victim, "You slow down.") diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 9314faab27..69cb247287 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -256,7 +256,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) can_handle_hot = TRUE else if(C.gloves && (C.gloves.max_heat_protection_temperature > 360)) can_handle_hot = TRUE - else if(C.has_trait(TRAIT_RESISTHEAT) || C.has_trait(TRAIT_RESISTHEATHANDS)) + else if(HAS_TRAIT(C, TRAIT_RESISTHEAT) || HAS_TRAIT(C, TRAIT_RESISTHEATHANDS)) can_handle_hot = TRUE if(can_handle_hot) @@ -449,10 +449,10 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) return 0 /obj/item/proc/eyestab(mob/living/carbon/M, mob/living/carbon/user) - if(user.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(user, TRAIT_PACIFISM)) to_chat(user, "You don't want to harm [M]!") return - if(user.has_trait(TRAIT_CLUMSY) && prob(50)) + if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) M = user var/is_human_victim = 0 var/obj/item/bodypart/affecting = M.get_bodypart(BODY_ZONE_HEAD) @@ -523,7 +523,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) M.adjust_blurriness(15) if(M.stat != DEAD) to_chat(M, "Your eyes start to bleed profusely!") - if(!(M.has_trait(TRAIT_BLIND) || M.has_trait(TRAIT_NEARSIGHT))) + if(!(HAS_TRAIT(M, TRAIT_BLIND) || HAS_TRAIT(M, TRAIT_NEARSIGHT))) to_chat(M, "You become nearsighted!") M.become_nearsighted(EYE_DAMAGE) if(prob(50)) diff --git a/code/game/objects/items/body_egg.dm b/code/game/objects/items/body_egg.dm index a8f5894b7c..80fc0f43fd 100644 --- a/code/game/objects/items/body_egg.dm +++ b/code/game/objects/items/body_egg.dm @@ -16,7 +16,7 @@ /obj/item/organ/body_egg/Insert(var/mob/living/carbon/M, special = 0) ..() - owner.add_trait(TRAIT_XENO_HOST, TRAIT_GENERIC) + ADD_TRAIT(owner, TRAIT_XENO_HOST, TRAIT_GENERIC) START_PROCESSING(SSobj, src) owner.med_hud_set_status() INVOKE_ASYNC(src, .proc/AddInfectionImages, owner) @@ -24,7 +24,7 @@ /obj/item/organ/body_egg/Remove(var/mob/living/carbon/M, special = 0) STOP_PROCESSING(SSobj, src) if(owner) - owner.remove_trait(TRAIT_XENO_HOST, TRAIT_GENERIC) + REMOVE_TRAIT(owner, TRAIT_XENO_HOST, TRAIT_GENERIC) owner.med_hud_set_status() INVOKE_ASYNC(src, .proc/RemoveInfectionImages, owner) ..() diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 30089f298f..99d6c874e8 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -254,7 +254,7 @@ cost = 0 if(ishuman(user)) var/mob/living/carbon/human/H = user - if (H.has_trait(TRAIT_TAGGER)) + if (HAS_TRAIT(H, TRAIT_TAGGER)) cost *= 0.5 var/charges_used = use_charges(user, cost) if(!charges_used) diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index ba4a0ffae8..55e75b3992 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -444,7 +444,7 @@ /obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/H) var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) - return (!H.suiciding && !(H.has_trait(TRAIT_NOCLONE)) && !H.hellbound && ((world.time - H.timeofdeath) < tlimit) && (H.getBruteLoss() < 180) && (H.getFireLoss() < 180) && H.getorgan(/obj/item/organ/heart) && BR && !BR.damaged_brain) + return (!H.suiciding && !(HAS_TRAIT(H, TRAIT_NOCLONE)) && !H.hellbound && ((world.time - H.timeofdeath) < tlimit) && (H.getBruteLoss() < 180) && (H.getFireLoss() < 180) && H.getorgan(/obj/item/organ/heart) && BR && !BR.damaged_brain) /obj/item/twohanded/shockpaddles/proc/shock_touching(dmg, mob/H) if(req_defib) @@ -585,7 +585,7 @@ shock_touching(30, H) var/failed - if (H.suiciding || (H.has_trait(TRAIT_NOCLONE))) + if (H.suiciding || (HAS_TRAIT(H, TRAIT_NOCLONE))) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Recovery of patient impossible. Further attempts futile." else if (H.hellbound) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's soul appears to be on another plane of existence. Further attempts futile." diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index cbbd7a387a..40f2059d25 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -52,7 +52,7 @@ add_fingerprint(user) if(istype(M) && on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH)) - if((user.has_trait(TRAIT_CLUMSY) || user.has_trait(TRAIT_DUMB)) && prob(50)) //too dumb to use flashlight properly + if((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50)) //too dumb to use flashlight properly return ..() //just hit them in the head if(!user.IsAdvancedToolUser()) @@ -86,7 +86,7 @@ else user.visible_message("[user] directs [src] to [M]'s eyes.", \ "You direct [src] to [M]'s eyes.") - if(M.stat == DEAD || (M.has_trait(TRAIT_BLIND)) || !M.flash_act(visual = 1)) //mob is dead or fully blind + if(M.stat == DEAD || (HAS_TRAIT(M, TRAIT_BLIND)) || !M.flash_act(visual = 1)) //mob is dead or fully blind to_chat(user, "[M]'s pupils don't react to the light!") else if(M.dna && M.dna.check_mutation(XRAY)) //mob has X-ray vision to_chat(user, "[M]'s pupils give an eerie glow!") diff --git a/code/game/objects/items/devices/instruments.dm b/code/game/objects/items/devices/instruments.dm index c5ed5fb601..661d38ce6b 100644 --- a/code/game/objects/items/devices/instruments.dm +++ b/code/game/objects/items/devices/instruments.dm @@ -54,7 +54,7 @@ /obj/item/instrument/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/musicaltuner)) var/mob/living/carbon/human/H = user - if (H.has_trait(TRAIT_MUSICIAN)) + if (HAS_TRAIT(H, TRAIT_MUSICIAN)) if (!tune_time) H.visible_message("[H] tunes the [src] to perfection!", "You tune the [src] to perfection!") tune_time = 300 diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index 632c2c4221..7baea7f488 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -69,7 +69,7 @@ if (!user.IsAdvancedToolUser()) to_chat(user, "You don't have the dexterity to do this!") return - if(user.has_trait(TRAIT_NOGUNS)) + if(HAS_TRAIT(user, TRAIT_NOGUNS)) to_chat(user, "Your fingers can't press the button!") return if(ishuman(user)) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 79b04c771b..34056e3a82 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -95,7 +95,7 @@ SLIME SCANNER /obj/item/healthanalyzer/attack(mob/living/M, mob/living/carbon/human/user) // Clumsiness/brain damage check - if ((user.has_trait(TRAIT_CLUMSY) || user.has_trait(TRAIT_DUMB)) && prob(50)) + if ((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50)) to_chat(user, "You stupidly try to analyze the floor's vitals!") user.visible_message("[user] has analyzed the floor's vitals!") var/msg = "*---------*\nAnalyzing results for The floor:\n\tOverall status: Healthy\n" @@ -127,7 +127,7 @@ SLIME SCANNER var/brute_loss = M.getBruteLoss() var/mob_status = (M.stat == DEAD ? "Deceased" : "[round(M.health/M.maxHealth,0.01)*100] % healthy") - if(M.has_trait(TRAIT_FAKEDEATH) && !advanced) + if(HAS_TRAIT(M, TRAIT_FAKEDEATH) && !advanced) mob_status = "Deceased" oxy_loss = max(rand(1, 40), oxy_loss, (300 - (tox_loss + fire_loss + brute_loss))) // Random oxygen loss @@ -199,10 +199,10 @@ SLIME SCANNER msg += "\t==EAR STATUS==\n" if(istype(ears)) var/healthy = TRUE - if(C.has_trait(TRAIT_DEAF, GENETIC_MUTATION)) + if(HAS_TRAIT_FROM(C, TRAIT_DEAF, GENETIC_MUTATION)) healthy = FALSE msg += "\tSubject is genetically deaf.\n" - else if(C.has_trait(TRAIT_DEAF)) + else if(HAS_TRAIT(C, TRAIT_DEAF)) healthy = FALSE msg += "\tSubject is deaf.\n" else @@ -220,10 +220,10 @@ SLIME SCANNER msg += "\t==EYE STATUS==\n" if(istype(eyes)) var/healthy = TRUE - if(C.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(C, TRAIT_BLIND)) msg += "\tSubject is blind.\n" healthy = FALSE - if(C.has_trait(TRAIT_NEARSIGHT)) + if(HAS_TRAIT(C, TRAIT_NEARSIGHT)) msg += "\tSubject is nearsighted.\n" healthy = FALSE if(eyes.eye_damage > 30) @@ -290,7 +290,7 @@ SLIME SCANNER msg += "Body temperature: [round(M.bodytemperature-T0C,0.1)] °C ([round(M.bodytemperature*1.8-459.67,0.1)] °F)\n" // Time of death - if(M.tod && (M.stat == DEAD || ((M.has_trait(TRAIT_FAKEDEATH)) && !advanced))) + if(M.tod && (M.stat == DEAD || ((HAS_TRAIT(M, TRAIT_FAKEDEATH)) && !advanced))) msg += "Time of Death: [M.tod]\n" var/tdelta = round(world.time - M.timeofdeath) if(tdelta < (DEFIB_TIME_LIMIT * 10)) diff --git a/code/game/objects/items/dna_injector.dm b/code/game/objects/items/dna_injector.dm index d5ac5d9c52..10c81e9dbb 100644 --- a/code/game/objects/items/dna_injector.dm +++ b/code/game/objects/items/dna_injector.dm @@ -31,7 +31,7 @@ /obj/item/dnainjector/proc/inject(mob/living/carbon/M, mob/user) prepare() - if(M.has_dna() && !M.has_trait(TRAIT_RADIMMUNE) && !M.has_trait(TRAIT_NOCLONE)) + if(M.has_dna() && !HAS_TRAIT(M, TRAIT_RADIMMUNE) && !HAS_TRAIT(M, TRAIT_NOCLONE)) M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2)) var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]" for(var/datum/mutation/human/HM in remove_mutations) @@ -313,7 +313,7 @@ to_chat(user, "You can't modify [M]'s DNA while [M.p_theyre()] dead.") return FALSE - if(M.has_dna() && !(M.has_trait(TRAIT_NOCLONE))) + if(M.has_dna() && !(HAS_TRAIT(M, TRAIT_NOCLONE))) M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2)) var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]" var/endtime = world.time+duration diff --git a/code/game/objects/items/grenades/grenade.dm b/code/game/objects/items/grenades/grenade.dm index 32e06eb9b4..28d8739369 100644 --- a/code/game/objects/items/grenades/grenade.dm +++ b/code/game/objects/items/grenades/grenade.dm @@ -33,7 +33,7 @@ qdel(src) /obj/item/grenade/proc/clown_check(mob/living/carbon/human/user) - var/clumsy = user.has_trait(TRAIT_CLUMSY) + var/clumsy = HAS_TRAIT(user, TRAIT_CLUMSY) if(clumsy && (clumsy_check == GRENADE_CLUMSY_FUMBLE)) if(prob(50)) to_chat(user, "Huh? How does this thing work?") diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 1f3019fe65..5e19577b46 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -44,7 +44,7 @@ if(!istype(C)) return - if(iscarbon(user) && (user.has_trait(TRAIT_CLUMSY) && prob(50))) + if(iscarbon(user) && (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))) to_chat(user, "Uh... how do those things work?!") apply_cuffs(user,user) return diff --git a/code/game/objects/items/implants/implant_mindshield.dm b/code/game/objects/items/implants/implant_mindshield.dm index 1982740cc9..b9907cbfca 100644 --- a/code/game/objects/items/implants/implant_mindshield.dm +++ b/code/game/objects/items/implants/implant_mindshield.dm @@ -20,7 +20,7 @@ /obj/item/implant/mindshield/implant(mob/living/target, mob/user, silent = FALSE) if(..()) if(!target.mind) - target.add_trait(TRAIT_MINDSHIELD, "implant") + ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant") target.sec_hud_set_implants() return TRUE @@ -49,7 +49,7 @@ to_chat(target, "You feel something interfering with your mental conditioning, but you resist it!") else to_chat(target, "You feel a sense of peace and security. You are now protected from brainwashing.") - target.add_trait(TRAIT_MINDSHIELD, "implant") + ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant") target.sec_hud_set_implants() return TRUE return FALSE @@ -58,7 +58,7 @@ if(..()) if(isliving(target)) var/mob/living/L = target - L.remove_trait(TRAIT_MINDSHIELD, "implant") + REMOVE_TRAIT(L, TRAIT_MINDSHIELD, "implant") L.sec_hud_set_implants() if(target.stat != DEAD && !silent) to_chat(target, "Your mind suddenly feels terribly vulnerable. You are no longer safe from brainwashing.") diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index 36c79bd454..781e1fa562 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -185,7 +185,7 @@ objective = stripped_input(usr,"What order do you want to imprint on [C]?","Enter the order","",120) message_admins("[ADMIN_LOOKUPFLW(user)] set brainwash machine objective to '[objective]'.") log_game("[key_name(user)] set brainwash machine objective to '[objective]'.") - if(C.has_trait(TRAIT_MINDSHIELD)) + if(HAS_TRAIT(C, TRAIT_MINDSHIELD)) return FALSE brainwash(C, objective) message_admins("[ADMIN_LOOKUPFLW(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") diff --git a/code/game/objects/items/manuals.dm b/code/game/objects/items/manuals.dm index 6194c4d9ca..02d0a1c36a 100644 --- a/code/game/objects/items/manuals.dm +++ b/code/game/objects/items/manuals.dm @@ -37,7 +37,7 @@

It really is that easy! Good luck! - + "} @@ -344,14 +344,14 @@ author = "Sir John Rose" title = "Barman Recipes: Mixing Drinks and Changing Lives" page_link = "Guide_to_food_and_drinks" - + /obj/item/book/manual/wiki/robotics_cyborgs name = "Robotics for Dummies" icon_state = "borgbook" author = "XISC" title = "Robotics for Dummies" page_link = "Guide_to_robotics" - + /obj/item/book/manual/wiki/research_and_development name = "Research and Development 101" icon_state = "rdbook" @@ -401,7 +401,7 @@ author = "the City-state of Atmosia" title = "Lexica Atmosia" page_link = "Guide_to_Atmospherics" - + /obj/item/book/manual/wiki/medicine name = "Medical Space Compendium, Volume 638" icon_state = "book8" @@ -441,7 +441,7 @@ H.dropItemToGround(W) if(prob(50)) step(W, pick(GLOB.alldirs)) - H.add_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) + ADD_TRAIT(H, TRAIT_DISFIGURED, TRAIT_GENERIC) H.bleed_rate = 5 H.gib_animation() sleep(3) diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 8ed0f273e6..9162f3ed91 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -156,7 +156,7 @@ return //CIT CHANGE - ditto add_fingerprint(user) - if((user.has_trait(TRAIT_CLUMSY)) && prob(50)) + if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50)) to_chat(user, "You club yourself over the head.") user.Knockdown(60 * force) if(ishuman(user)) diff --git a/code/game/objects/items/melee/transforming.dm b/code/game/objects/items/melee/transforming.dm index 74eb048d8a..0d39e6c847 100644 --- a/code/game/objects/items/melee/transforming.dm +++ b/code/game/objects/items/melee/transforming.dm @@ -82,6 +82,6 @@ to_chat(user, "[src] [active ? "is now active":"can now be concealed"].") /obj/item/melee/transforming/proc/clumsy_transform_effect(mob/living/user) - if(clumsy_check && user.has_trait(TRAIT_CLUMSY) && prob(50)) + if(clumsy_check && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) to_chat(user, "You accidentally cut yourself with [src], like a doofus!") user.take_bodypart_damage(5,5) diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index d37ec0376a..bd301c36f7 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -150,7 +150,7 @@ if(tank && !tank.air_contents.remove(gasPerThrow * pressureSetting)) to_chat(user, "\The [src] lets out a weak hiss and doesn't react!") return - if(user.has_trait(TRAIT_CLUMSY) && prob(75) && clumsyCheck && iscarbon(user)) + if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(75) && clumsyCheck && iscarbon(user)) var/mob/living/carbon/C = user C.visible_message("[C] loses [C.p_their()] grip on [src], causing it to go off!", "[src] slips out of your hands and goes off!") C.dropItemToGround(src, TRUE) diff --git a/code/game/objects/items/religion.dm b/code/game/objects/items/religion.dm index a80aa1be60..8582725cda 100644 --- a/code/game/objects/items/religion.dm +++ b/code/game/objects/items/religion.dm @@ -187,7 +187,7 @@ inspiration_available = FALSE /obj/item/banner/command/check_inspiration(mob/living/carbon/human/H) - return H.has_trait(TRAIT_MINDSHIELD) //Command is stalwart but rewards their allies. + return HAS_TRAIT(H, TRAIT_MINDSHIELD) //Command is stalwart but rewards their allies. /datum/crafting_recipe/command_banner name = "Command Banner" diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 30c7115346..b641e15d90 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -91,7 +91,7 @@ return (active) /obj/item/shield/energy/attack_self(mob/living/carbon/human/user) - if(clumsy_check && user.has_trait(TRAIT_CLUMSY) && prob(50)) + if(clumsy_check && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) to_chat(user, "You beat yourself in the head with [src].") user.take_bodypart_damage(5) active = !active diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index d3a3ecd5ef..cf967e25ba 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -281,12 +281,12 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( var/hit_hand = ((user.active_hand_index % 2 == 0) ? "r_" : "l_") + "arm" if(ishuman(user)) var/mob/living/carbon/human/H = user - if(!H.gloves && !H.has_trait(TRAIT_PIERCEIMMUNE)) // golems, etc + if(!H.gloves && !HAS_TRAIT(H, TRAIT_PIERCEIMMUNE)) // golems, etc to_chat(H, "[src] cuts into your hand!") H.apply_damage(force*0.5, BRUTE, hit_hand) else if(ismonkey(user)) var/mob/living/carbon/monkey/M = user - if(!M.has_trait(TRAIT_PIERCEIMMUNE)) + if(!HAS_TRAIT(M, TRAIT_PIERCEIMMUNE)) to_chat(M, "[src] cuts into your hand!") M.apply_damage(force*0.5, BRUTE, hit_hand) @@ -312,7 +312,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( /obj/item/shard/Crossed(mob/living/L) if(istype(L) && has_gravity(loc)) - if(L.has_trait(TRAIT_LIGHT_STEP)) + if(HAS_TRAIT(L, TRAIT_LIGHT_STEP)) playsound(loc, 'sound/effects/glass_step.ogg', 30, 1) else playsound(loc, 'sound/effects/glass_step.ogg', 50, 1) diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index b95d6a897e..c2d5ca50be 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -109,7 +109,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", to_chat(user, "You don't have the dexterity to do this!") return - if (user.has_trait(TRAIT_CLUMSY) && prob(50)) + if (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) to_chat(user, "[src] slips out of your hand and hits your head.") user.take_bodypart_damage(10) user.Unconscious(400) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 3904355893..73405cc3ac 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -124,7 +124,7 @@ add_fingerprint(user) /obj/item/melee/baton/attack(mob/M, mob/living/carbon/human/user) - if(status && user.has_trait(TRAIT_CLUMSY) && prob(50)) + if(status && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) clowning_around(user) return diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index cdeb972ca1..1245b7de94 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -128,7 +128,7 @@ H.dropItemToGround(W) if(prob(50)) step(W, pick(GLOB.alldirs)) - H.add_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) + ADD_TRAIT(H, TRAIT_DISFIGURED, TRAIT_GENERIC) H.bleed_rate = 5 H.gib_animation() sleep(3) diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index d4ec9217e7..bf63a96f05 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -350,7 +350,7 @@ unwield() return ..() - if(user.has_trait(TRAIT_CLUMSY) && (wielded) && prob(40)) + if(HAS_TRAIT(user, TRAIT_CLUMSY) && (wielded) && prob(40)) impale(user) return if((wielded) && prob(50)) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 68c4ffeee8..5f21862c17 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -71,7 +71,7 @@ adjusted_climb_time *= 2 if(isalien(user)) adjusted_climb_time *= 0.25 //aliens are terrifyingly fast - if(user.has_trait(TRAIT_FREERUNNING)) //do you have any idea how fast I am??? + if(HAS_TRAIT(user, TRAIT_FREERUNNING)) //do you have any idea how fast I am??? adjusted_climb_time *= 0.8 structureclimber = user if(do_mob(user, user, adjusted_climb_time)) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index a6a6c5f699..cbdb0750e2 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -86,7 +86,7 @@ to_chat(user, "Alt-click to [locked ? "unlock" : "lock"].") if(isliving(user)) var/mob/living/L = user - if(L.has_trait(TRAIT_SKITTISH)) + if(HAS_TRAIT(L, TRAIT_SKITTISH)) to_chat(user, "Ctrl-Shift-click [src] to jump inside.") /obj/structure/closet/CanPass(atom/movable/mover, turf/target) @@ -416,7 +416,7 @@ togglelock(user) /obj/structure/closet/CtrlShiftClick(mob/living/user) - if(!user.has_trait(TRAIT_SKITTISH)) + if(!HAS_TRAIT(user, TRAIT_SKITTISH)) return ..() if(!user.canUseTopic(src) || !isturf(user.loc)) return diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 695395afd2..09e5510d62 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -182,7 +182,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an for(var/mob/living/M in compiled) var/mob/living/mob_occupant = get_mob_or_brainmob(M) - if(mob_occupant.client && !mob_occupant.suiciding && !(mob_occupant.has_trait(TRAIT_NOCLONE)) && !mob_occupant.hellbound) + if(mob_occupant.client && !mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_NOCLONE)) && !mob_occupant.hellbound) icon_state = "morgue4" // Cloneable if(mob_occupant.stat == DEAD && beeper) if(world.time > next_beep) diff --git a/code/game/objects/structures/petrified_statue.dm b/code/game/objects/structures/petrified_statue.dm index 815dd9de6d..65ffb7e2e5 100644 --- a/code/game/objects/structures/petrified_statue.dm +++ b/code/game/objects/structures/petrified_statue.dm @@ -17,7 +17,7 @@ L.buckled.unbuckle_mob(L,force=1) L.visible_message("[L]'s skin rapidly turns to marble!", "Your body freezes up! Can't... move... can't... think...") L.forceMove(src) - L.add_trait(TRAIT_MUTE, STATUE_MUTE) + ADD_TRAIT(L, TRAIT_MUTE, STATUE_MUTE) L.faction += "mimic" //Stops mimics from instaqdeling people in statues L.status_flags |= GODMODE obj_integrity = L.health + 100 //stoning damaged mobs will result in easier to shatter statues @@ -59,7 +59,7 @@ if(petrified_mob) petrified_mob.status_flags &= ~GODMODE petrified_mob.forceMove(loc) - petrified_mob.remove_trait(TRAIT_MUTE, STATUE_MUTE) + REMOVE_TRAIT(petrified_mob, TRAIT_MUTE, STATUE_MUTE) petrified_mob.take_overall_damage((petrified_mob.health - obj_integrity + 100)) //any new damage the statue incurred is transfered to the mob petrified_mob.faction -= "mimic" petrified_mob = null diff --git a/code/modules/admin/antag_panel.dm b/code/modules/admin/antag_panel.dm index 1e207909bd..1672310567 100644 --- a/code/modules/admin/antag_panel.dm +++ b/code/modules/admin/antag_panel.dm @@ -80,7 +80,7 @@ GLOBAL_VAR(antag_prototypes) var/list/result = list() if(!current) result += "No body!" - if(current && current.has_trait(TRAIT_MINDSHIELD)) + if(current && HAS_TRAIT(current, TRAIT_MINDSHIELD)) result += "Mindshielded" //Move these to mob if(iscyborg(current)) diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index da1b404ea5..968c2d1e2f 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -34,14 +34,14 @@ deity = "Nar'Sie" else if(isliving(usr)) var/mob/living/L = usr - if(L.has_trait(TRAIT_SPIRITUAL)) + if(HAS_TRAIT(L, TRAIT_SPIRITUAL)) cross.icon_state = "holylight" font_color = "blue" prayer_type = "SPIRITUAL PRAYER" - + var/msg_tmp = msg msg = "[icon2html(cross, GLOB.admins)][prayer_type][deity ? " (to [deity])" : ""]: [ADMIN_FULLMONTY(src)] [ADMIN_SC(src)]: [msg]" - + for(var/client/C in GLOB.admins) if(C.prefs.chat_toggles & CHAT_PRAYER) to_chat(C, msg) diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index 969590402c..8a3ff2186a 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -272,10 +272,10 @@ /obj/item/organ/heart/gland/electric/Insert(mob/living/carbon/M, special = 0) ..() - owner.add_trait(TRAIT_SHOCKIMMUNE, ORGAN_TRAIT) + ADD_TRAIT(owner, TRAIT_SHOCKIMMUNE, ORGAN_TRAIT) /obj/item/organ/heart/gland/electric/Remove(mob/living/carbon/M, special = 0) - owner.remove_trait(TRAIT_SHOCKIMMUNE, ORGAN_TRAIT) + REMOVE_TRAIT(owner, TRAIT_SHOCKIMMUNE, ORGAN_TRAIT) ..() /obj/item/organ/heart/gland/electric/activate() diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index 7e0ae3c08c..5b0be336ff 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -169,7 +169,7 @@ to_chat(owner.current, "We have reached our capacity for abilities.") return - if(owner.current.has_trait(TRAIT_DEATHCOMA))//To avoid potential exploits by buying new powers while in stasis, which clears your verblist. + if(HAS_TRAIT(owner.current, TRAIT_DEATHCOMA))//To avoid potential exploits by buying new powers while in stasis, which clears your verblist. to_chat(owner.current, "We lack the energy to evolve new abilities right now.") return @@ -239,7 +239,7 @@ if(verbose) to_chat(user, "[target] is not compatible with our biology.") return - if((target.has_trait(TRAIT_NOCLONE)) || (target.has_trait(TRAIT_NOCLONE))) + if((HAS_TRAIT(target, TRAIT_NOCLONE)) || (HAS_TRAIT(target, TRAIT_NOCLONE))) if(verbose) to_chat(user, "DNA of [target] is ruined beyond usability!") return diff --git a/code/modules/antagonists/changeling/changeling_power.dm b/code/modules/antagonists/changeling/changeling_power.dm index 1d4f15ec9d..c5334265fb 100644 --- a/code/modules/antagonists/changeling/changeling_power.dm +++ b/code/modules/antagonists/changeling/changeling_power.dm @@ -68,7 +68,7 @@ if(req_stat < user.stat) to_chat(user, "We are incapacitated.") return 0 - if((user.has_trait(TRAIT_DEATHCOMA)) && (!ignores_fakedeath)) + if((HAS_TRAIT(user, TRAIT_DEATHCOMA)) && (!ignores_fakedeath)) to_chat(user, "We are incapacitated.") return 0 return 1 diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm index c19eb50e7f..346d948c79 100644 --- a/code/modules/antagonists/changeling/powers/fakedeath.dm +++ b/code/modules/antagonists/changeling/powers/fakedeath.dm @@ -33,7 +33,7 @@ RV.action.Grant(user) /obj/effect/proc_holder/changeling/fakedeath/can_sting(mob/living/user) - if(user.has_trait(TRAIT_DEATHCOMA, "changeling")) + if(HAS_TRAIT_FROM(user, TRAIT_DEATHCOMA, "changeling")) to_chat(user, "We are already reviving.") return if(!user.stat) //Confirmation for living changelings if they want to fake their death diff --git a/code/modules/antagonists/changeling/powers/hivemind.dm b/code/modules/antagonists/changeling/powers/hivemind.dm index a33dab31c3..1d7382d947 100644 --- a/code/modules/antagonists/changeling/powers/hivemind.dm +++ b/code/modules/antagonists/changeling/powers/hivemind.dm @@ -10,7 +10,7 @@ action_background_icon_state = "bg_ling" /obj/effect/proc_holder/changeling/hivemind_comms/sting_action(var/mob/living/user) - if (user.has_trait(CHANGELING_HIVEMIND_MUTE)) + if (HAS_TRAIT(user, CHANGELING_HIVEMIND_MUTE)) to_chat(user, "The poison in the air hinders our ability to interact with the hivemind.") return var/input = html_decode(stripped_input(usr, "Please choose a message to transmit.", "Changeling Hivemind", "")) @@ -47,7 +47,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank) action_background_icon_state = "bg_ling" /obj/effect/proc_holder/changeling/hivemind_upload/sting_action(var/mob/living/user) - if (user.has_trait(CHANGELING_HIVEMIND_MUTE)) + if (HAS_TRAIT(user, CHANGELING_HIVEMIND_MUTE)) to_chat(user, "The poison in the air hinders our ability to interact with the hivemind.") return var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) @@ -86,7 +86,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank) /obj/effect/proc_holder/changeling/hivemind_download/can_sting(mob/living/carbon/user) if(!..()) return - if (user.has_trait(CHANGELING_HIVEMIND_MUTE)) + if (HAS_TRAIT(user, CHANGELING_HIVEMIND_MUTE)) to_chat(user, "The poison in the air hinders our ability to interact with the hivemind.") return var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) diff --git a/code/modules/antagonists/changeling/powers/revive.dm b/code/modules/antagonists/changeling/powers/revive.dm index 514b7603fd..3404765628 100644 --- a/code/modules/antagonists/changeling/powers/revive.dm +++ b/code/modules/antagonists/changeling/powers/revive.dm @@ -37,7 +37,7 @@ if(!.) return - if(user.has_trait(CHANGELING_DRAIN) || ((user.stat != DEAD) && !(user.has_trait(TRAIT_DEATHCOMA)))) + if(HAS_TRAIT(user, CHANGELING_DRAIN) || ((user.stat != DEAD) && !(HAS_TRAIT(user, TRAIT_DEATHCOMA)))) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) changeling.purchasedpowers -= src return FALSE diff --git a/code/modules/antagonists/changeling/powers/strained_muscles.dm b/code/modules/antagonists/changeling/powers/strained_muscles.dm index 4e8b8adbd1..baeed8b0b2 100644 --- a/code/modules/antagonists/changeling/powers/strained_muscles.dm +++ b/code/modules/antagonists/changeling/powers/strained_muscles.dm @@ -19,7 +19,7 @@ if(active) to_chat(user, "Our muscles tense and strengthen.") else - user.remove_trait(TRAIT_GOTTAGOFAST, "changeling_muscles") + REMOVE_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling_muscles") to_chat(user, "Our muscles relax.") if(stacks >= 10) to_chat(user, "We collapse in exhaustion.") @@ -32,12 +32,12 @@ /obj/effect/proc_holder/changeling/strained_muscles/proc/muscle_loop(mob/living/carbon/user) while(active) - user.add_trait(TRAIT_GOTTAGOFAST, "changeling_muscles") + ADD_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling_muscles") if(user.stat != CONSCIOUS || user.staminaloss >= 90) active = !active to_chat(user, "Our muscles relax without the energy to strengthen them.") user.Knockdown(40) - user.remove_trait(TRAIT_GOTTAGOFAST, "changeling_muscles") + REMOVE_TRAIT(user, TRAIT_GOTTAGOFAST, "changeling_muscles") break stacks++ diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index c9b48fa6fc..5a701d8a96 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -91,7 +91,7 @@ /obj/effect/proc_holder/changeling/sting/transformation/can_sting(mob/user, mob/living/carbon/target) if(!..()) return - if((target.has_trait(TRAIT_HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits)) + if((HAS_TRAIT(target, TRAIT_HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits)) to_chat(user, "Our sting appears ineffective against its DNA.") return 0 return 1 @@ -134,7 +134,7 @@ return if(isliving(target)) var/mob/living/L = target - if((L.has_trait(TRAIT_HUSK)) || !L.has_dna()) + if((HAS_TRAIT(L, TRAIT_HUSK)) || !L.has_dna()) to_chat(user, "Our sting appears ineffective against its DNA.") return 0 return 1 diff --git a/code/modules/antagonists/clockcult/clock_items/wraith_spectacles.dm b/code/modules/antagonists/clockcult/clock_items/wraith_spectacles.dm index 51521ada24..9d241148b4 100644 --- a/code/modules/antagonists/clockcult/clock_items/wraith_spectacles.dm +++ b/code/modules/antagonists/clockcult/clock_items/wraith_spectacles.dm @@ -32,7 +32,7 @@ if(ishuman(loc)) var/mob/living/carbon/human/H = loc if(src == H.glasses && !up) - if(H.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(H, TRAIT_BLIND)) to_chat(H, "\"You're blind, idiot. Stop embarrassing yourself.\"") return if(blind_cultist(H)) @@ -76,7 +76,7 @@ ..() if(slot != SLOT_GLASSES || up) return - if(user.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(user, TRAIT_BLIND)) to_chat(user, "\"You're blind, idiot. Stop embarrassing yourself.\"" ) return if(blind_cultist(user)) //Cultists instantly go blind @@ -115,11 +115,11 @@ var/obj/item/clothing/glasses/wraith_spectacles/WS = L.glasses desc = "[glasses_right && !WS.up ? "":""]You are [glasses_right ? "":"not "]wearing wraith spectacles[glasses_right && !WS.up ? "!":"."]
\ You have taken [W.eye_damage_done] eye damage from them.
" - if(L.has_trait(TRAIT_NEARSIGHT)) + if(HAS_TRAIT(L, TRAIT_NEARSIGHT)) desc += "You are nearsighted!
" else if(glasses_right && !WS.up) desc += "You will become nearsighted at [W.nearsight_breakpoint] eye damage.
" - if(L.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(L, TRAIT_BLIND)) desc += "You are blind!" else if(glasses_right && !WS.up) desc += "You will become blind at [W.blind_breakpoint] eye damage." @@ -153,18 +153,18 @@ qdel(src) /datum/status_effect/wraith_spectacles/proc/apply_eye_damage(mob/living/carbon/human/H) - if(H.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(H, TRAIT_BLIND)) return H.adjust_eye_damage(0.5) eye_damage_done += 0.5 if(eye_damage_done >= 20) H.adjust_blurriness(2) if(eye_damage_done >= nearsight_breakpoint) - if(!H.has_trait(TRAIT_NEARSIGHT)) + if(!HAS_TRAIT(H, TRAIT_NEARSIGHT)) to_chat(H, "Your vision doubles, then trembles. Darkness begins to close in. You can't keep this up!") H.become_nearsighted(EYE_DAMAGE) if(eye_damage_done >= blind_breakpoint) - if(!H.has_trait(TRAIT_BLIND)) + if(!HAS_TRAIT(H, TRAIT_BLIND)) to_chat(H, "A piercing white light floods your vision. Suddenly, all goes dark!") H.become_blind(EYE_DAMAGE) diff --git a/code/modules/antagonists/clockcult/clock_structures/ocular_warden.dm b/code/modules/antagonists/clockcult/clock_structures/ocular_warden.dm index 8dfadb60bc..df0083e845 100644 --- a/code/modules/antagonists/clockcult/clock_structures/ocular_warden.dm +++ b/code/modules/antagonists/clockcult/clock_structures/ocular_warden.dm @@ -110,7 +110,7 @@ if(!(BI.resistance_flags & ON_FIRE)) BI.fire_act() continue - if(is_servant_of_ratvar(L) || (L.has_trait(TRAIT_BLIND)) || L.anti_magic_check(TRUE, TRUE)) + if(is_servant_of_ratvar(L) || (HAS_TRAIT(L, TRAIT_BLIND)) || L.anti_magic_check(TRUE, TRUE)) continue if(L.stat || L.lying) continue diff --git a/code/modules/antagonists/cult/cult.dm b/code/modules/antagonists/cult/cult.dm index 9451012a04..32442ee72c 100644 --- a/code/modules/antagonists/cult/cult.dm +++ b/code/modules/antagonists/cult/cult.dm @@ -131,7 +131,7 @@ var/mob/living/carbon/human/H = current H.eye_color = initial(H.eye_color) H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK) - H.remove_trait(CULT_EYES) + REMOVE_TRAIT(H, TRAIT_CULT_EYES, "valid_cultist") H.update_body() H.cut_overlays() H.regenerate_icons() @@ -225,7 +225,7 @@ var/mob/living/carbon/human/H = current H.eye_color = initial(H.eye_color) H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK) - H.remove_trait(CULT_EYES) + REMOVE_TRAIT(H, TRAIT_CULT_EYES, "valid_cultist") H.cut_overlays() H.regenerate_icons() @@ -301,7 +301,7 @@ var/mob/living/carbon/human/H = cultist H.eye_color = "f00" H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK) - H.add_trait(CULT_EYES) + ADD_TRAIT(H, TRAIT_CULT_EYES, "valid_cultist") H.update_body() /datum/team/cult/proc/ascend(cultist) diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index 3c11351660..2f3a039e70 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -123,7 +123,7 @@ structure_check() searches for nearby cultist structures required for the invoca continue if(ishuman(L)) var/mob/living/carbon/human/H = L - if((H.has_trait(TRAIT_MUTE)) || H.silent) + if((HAS_TRAIT(H, TRAIT_MUTE)) || H.silent) continue if(L.stat) continue @@ -250,14 +250,14 @@ structure_check() searches for nearby cultist structures required for the invoca currentconversionman = convertee conversiontimeout = world.time + (10 SECONDS) convertee.Stun(100) - convertee.add_trait(TRAIT_MUTE, "conversionrune") + ADD_TRAIT(convertee, TRAIT_MUTE, "conversionrune") conversionresult = FALSE while(world.time < conversiontimeout && convertee && !conversionresult) stoplag(1) currentconversionman = null if(!convertee) return FALSE - convertee.remove_trait(TRAIT_MUTE, "conversionrune") + REMOVE_TRAIT(convertee, TRAIT_MUTE, "conversionrune") if(get_turf(convertee) != get_turf(src)) return FALSE if(!conversionresult) diff --git a/code/modules/antagonists/highlander/highlander.dm b/code/modules/antagonists/highlander/highlander.dm index 1fa37f3a51..c0246ba978 100644 --- a/code/modules/antagonists/highlander/highlander.dm +++ b/code/modules/antagonists/highlander/highlander.dm @@ -7,11 +7,11 @@ /datum/antagonist/highlander/apply_innate_effects(mob/living/mob_override) var/mob/living/L = owner.current || mob_override - L.add_trait(TRAIT_NOGUNS, "highlander") + ADD_TRAIT(L, TRAIT_NOGUNS, "highlander") /datum/antagonist/highlander/remove_innate_effects(mob/living/mob_override) var/mob/living/L = owner.current || mob_override - L.remove_trait(TRAIT_NOGUNS, "highlander") + REMOVE_TRAIT(L, TRAIT_NOGUNS, "highlander") /datum/antagonist/highlander/proc/forge_objectives() var/datum/objective/steal/steal_objective = new diff --git a/code/modules/antagonists/overthrow/overthrow_converter.dm b/code/modules/antagonists/overthrow/overthrow_converter.dm index c94a838165..23599bd01b 100644 --- a/code/modules/antagonists/overthrow/overthrow_converter.dm +++ b/code/modules/antagonists/overthrow/overthrow_converter.dm @@ -37,7 +37,7 @@ if(M == user) to_chat(user,"You cannot convert yourself!") return - if(M.has_trait(TRAIT_MINDSHIELD)) + if(HAS_TRAIT(M, TRAIT_MINDSHIELD)) to_chat(user, "This mind is too strong to convert, try to remove whatever is protecting it first!") return M.visible_message("[user] is attempting to implant [M].") diff --git a/code/modules/antagonists/revolution/revolution.dm b/code/modules/antagonists/revolution/revolution.dm index 90df57f48b..e10d83ffb7 100644 --- a/code/modules/antagonists/revolution/revolution.dm +++ b/code/modules/antagonists/revolution/revolution.dm @@ -17,7 +17,7 @@ return FALSE if(new_owner.unconvertable) return FALSE - if(new_owner.current && new_owner.current.has_trait(TRAIT_MINDSHIELD)) + if(new_owner.current && HAS_TRAIT(new_owner.current, TRAIT_MINDSHIELD)) return FALSE /datum/antagonist/rev/apply_innate_effects(mob/living/mob_override) diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index ad83ed8c13..b1aa63c242 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -43,7 +43,7 @@ holder.update_icon() /obj/item/assembly/flash/proc/clown_check(mob/living/carbon/human/user) - if(user.has_trait(TRAIT_CLUMSY) && prob(50)) + if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) flash_carbon(user, user, 15, 0) return FALSE return TRUE diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 58a3a5349a..a2a9fb0105 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -18,7 +18,7 @@ if(!armed) if(ishuman(usr)) var/mob/living/carbon/human/user = usr - if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) + if((HAS_TRAIT(user, TRAIT_DUMB) || HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50)) to_chat(user, "Your hand slips, setting off the trigger!") pulse(FALSE) update_icon() @@ -38,7 +38,7 @@ var/obj/item/bodypart/affecting = null if(ishuman(target)) var/mob/living/carbon/human/H = target - if(H.has_trait(TRAIT_PIERCEIMMUNE)) + if(HAS_TRAIT(H, TRAIT_PIERCEIMMUNE)) playsound(src, 'sound/effects/snap.ogg', 50, TRUE) armed = FALSE update_icon() @@ -70,7 +70,7 @@ if(!armed) to_chat(user, "You arm [src].") else - if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) + if((HAS_TRAIT(user, TRAIT_DUMB) || HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50)) var/which_hand = BODY_ZONE_PRECISE_L_HAND if(!(user.active_hand_index % 2)) which_hand = BODY_ZONE_PRECISE_R_HAND @@ -87,7 +87,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/assembly/mousetrap/attack_hand(mob/living/carbon/human/user) if(armed) - if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) + if((HAS_TRAIT(user, TRAIT_DUMB) || HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50)) var/which_hand = BODY_ZONE_PRECISE_L_HAND if(!(user.active_hand_index % 2)) which_hand = BODY_ZONE_PRECISE_R_HAND diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 7f7b3ae0ed..67d0252bb2 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -45,7 +45,7 @@ /obj/item/clothing/glasses/proc/thermal_overload() if(ishuman(src.loc)) var/mob/living/carbon/human/H = src.loc - if(!(H.has_trait(TRAIT_BLIND))) + if(!(HAS_TRAIT(H, TRAIT_BLIND))) if(H.glasses == src) to_chat(H, "[src] overloads and blinds you!") H.flash_act(visual = 1) diff --git a/code/modules/clothing/neck/_neck.dm b/code/modules/clothing/neck/_neck.dm index 4179e69a45..330f69ddaf 100644 --- a/code/modules/clothing/neck/_neck.dm +++ b/code/modules/clothing/neck/_neck.dm @@ -66,7 +66,7 @@ var/obj/item/organ/heart/heart = M.getorganslot(ORGAN_SLOT_HEART) var/obj/item/organ/lungs/lungs = M.getorganslot(ORGAN_SLOT_LUNGS) - if(!(M.stat == DEAD || (M.has_trait(TRAIT_FAKEDEATH)))) + if(!(M.stat == DEAD || (HAS_TRAIT(M, TRAIT_FAKEDEATH)))) if(heart && istype(heart)) heart_strength = "an unstable" if(heart.beating) diff --git a/code/modules/clothing/shoes/taeclowndo.dm b/code/modules/clothing/shoes/taeclowndo.dm index 20d9fa6b70..f2bbdf0ceb 100644 --- a/code/modules/clothing/shoes/taeclowndo.dm +++ b/code/modules/clothing/shoes/taeclowndo.dm @@ -13,7 +13,7 @@ if(!ishuman(user)) return var/mob/living/carbon/human/H = user - if(!(H.has_trait(TRAIT_CLUMSY)) && !(H.mind && H.mind.assigned_role == "Clown")) + if(!(HAS_TRAIT(H, TRAIT_CLUMSY)) && !(H.mind && H.mind.assigned_role == "Clown")) return if(slot == SLOT_SHOES) spells = new diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index f09c0481f6..f63ca39874 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -39,7 +39,7 @@ continue if(H.stat == DEAD) continue - if(H.has_trait(TRAIT_VIRUSIMMUNE)) //Don't pick someone who's virus immune, only for it to not do anything. + if(HAS_TRAIT(H, TRAIT_VIRUSIMMUNE)) //Don't pick someone who's virus immune, only for it to not do anything. continue var/foundAlready = FALSE // don't infect someone that already has a disease for(var/thing in H.diseases) @@ -51,7 +51,7 @@ var/datum/disease/D if(!advanced_virus) if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. - if(!H.dna || (H.has_trait(TRAIT_BLIND))) //A blindness disease would be the worst. + if(!H.dna || (HAS_TRAIT(H, TRAIT_BLIND))) //A blindness disease would be the worst. continue D = new virus_type() var/datum/disease/dnaspread/DS = D diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index 6594146e81..e11fb133fd 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -36,7 +36,7 @@ if(M == user) user.visible_message("[user] swallows a gulp of [src].", "You swallow a gulp of [src].") - if(M.has_trait(TRAIT_VORACIOUS)) + if(HAS_TRAIT(M, TRAIT_VORACIOUS)) M.changeNext_move(CLICK_CD_MELEE * 0.5) //chug! chug! chug! else diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index b753a6c246..dab933ca4e 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -57,7 +57,7 @@ if(user.a_intent != INTENT_HARM || !isGlass) return ..() - if(user.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(user, TRAIT_PACIFISM)) to_chat(user, "You don't want to harm [target]!") return diff --git a/code/modules/food_and_drinks/food.dm b/code/modules/food_and_drinks/food.dm index f9d9a3d85a..3a6d74355d 100644 --- a/code/modules/food_and_drinks/food.dm +++ b/code/modules/food_and_drinks/food.dm @@ -19,7 +19,7 @@ if(last_check_time + 50 < world.time) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(!H.has_trait(TRAIT_AGEUSIA)) + if(!HAS_TRAIT(H, TRAIT_AGEUSIA)) if(foodtype & H.dna.species.toxic_food) to_chat(H,"What the hell was that thing?!") H.adjust_disgust(25 + 30 * fraction) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index 2b37065709..d3408ca5e5 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -112,7 +112,7 @@ All foods are distributed among various categories. Use common sense. else if(fullness > (600 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat user.visible_message("[user] cannot force any more of \the [src] to go down [user.p_their()] throat!", "You cannot force any more of \the [src] to go down your throat!") return 0 - if(M.has_trait(TRAIT_VORACIOUS)) + if(HAS_TRAIT(M, TRAIT_VORACIOUS)) M.changeNext_move(CLICK_CD_MELEE * 0.5) //nom nom nom else if(!isbrain(M)) //If you're feeding it to someone else. diff --git a/code/modules/food_and_drinks/food/snacks_pastry.dm b/code/modules/food_and_drinks/food/snacks_pastry.dm index fe05d8a5bf..927a7d2697 100644 --- a/code/modules/food_and_drinks/food/snacks_pastry.dm +++ b/code/modules/food_and_drinks/food/snacks_pastry.dm @@ -28,7 +28,7 @@ if(last_check_time + 50 < world.time) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.mind && H.mind.assigned_role == "Security Officer" || H.mind.assigned_role == "Detective" || H.mind.assigned_role == "Warden" || H.mind.assigned_role == "Head of Security" && !H.has_trait(TRAIT_AGEUSIA)) + if(H.mind && H.mind.assigned_role == "Security Officer" || H.mind.assigned_role == "Detective" || H.mind.assigned_role == "Warden" || H.mind.assigned_role == "Head of Security" && !HAS_TRAIT(H, TRAIT_AGEUSIA)) to_chat(H,"I love this taste!") H.adjust_disgust(-5 + -2.5 * fraction) GET_COMPONENT_FROM(mood, /datum/component/mood, H) diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm index e3f8c254ac..dbcce2830b 100644 --- a/code/modules/hydroponics/grown/nettle.dm +++ b/code/modules/hydroponics/grown/nettle.dm @@ -56,7 +56,7 @@ var/mob/living/carbon/C = user if(C.gloves) return FALSE - if(C.has_trait(TRAIT_PIERCEIMMUNE)) + if(HAS_TRAIT(C, TRAIT_PIERCEIMMUNE)) return FALSE var/hit_zone = (C.held_index_to_dir(C.active_hand_index) == "l" ? "l_":"r_") + "arm" var/obj/item/bodypart/affecting = C.get_bodypart(hit_zone) diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 23823e1e18..0990ca961a 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -222,9 +222,9 @@ to_chat(user, "You feel your life being drained by the pendant...") if(do_after(user, 40, target = user)) to_chat(user, "Your lifeforce is now linked to the pendant! You feel like removing it would kill you, and yet you instinctively know that until then, you won't die.") - user.add_trait(TRAIT_NODEATH, "memento_mori") - user.add_trait(TRAIT_NOHARDCRIT, "memento_mori") - user.add_trait(TRAIT_NOCRITDAMAGE, "memento_mori") + ADD_TRAIT(user, TRAIT_NODEATH, "memento_mori") + ADD_TRAIT(user, TRAIT_NOHARDCRIT, "memento_mori") + ADD_TRAIT(user, TRAIT_NOCRITDAMAGE, "memento_mori") icon_state = "memento_mori_active" active_owner = user @@ -662,7 +662,7 @@ playsound(user, 'sound/magic/clockwork/fellowship_armory.ogg', 35, TRUE, frequency = 90000 - (active * 30000)) /obj/item/melee/transforming/cleaving_saw/clumsy_transform_effect(mob/living/user) - if(user.has_trait(TRAIT_CLUMSY) && prob(50)) + if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) to_chat(user, "You accidentally cut yourself with [src], like a doofus!") user.take_bodypart_damage(10) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 71a12e9ff4..815184c63d 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -16,7 +16,7 @@ /mob/living/carbon/monkey/handle_blood() - if(bodytemperature >= TCRYO && !(has_trait(TRAIT_NOCLONE))) //cryosleep or husked people do not pump the blood. + if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_NOCLONE))) //cryosleep or husked people do not pump the blood. //Blood regeneration if there is some space if(blood_volume < BLOOD_VOLUME_NORMAL) blood_volume += 0.1 // regenerate blood VERY slowly @@ -30,10 +30,10 @@ bleed_rate = 0 return - if(bodytemperature >= TCRYO && !(has_trait(TRAIT_NOCLONE))) //cryosleep or husked people do not pump the blood. + if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_NOCLONE))) //cryosleep or husked people do not pump the blood. //Blood regeneration if there is some space - if(blood_volume < BLOOD_VOLUME_NORMAL && !has_trait(TRAIT_NOHUNGER)) + if(blood_volume < BLOOD_VOLUME_NORMAL && !HAS_TRAIT(src, TRAIT_NOHUNGER)) var/nutrition_ratio = 0 switch(nutrition) if(0 to NUTRITION_LEVEL_STARVING) @@ -69,7 +69,7 @@ Unconscious(rand(20,60)) to_chat(src, "You feel extremely [word].") if(-INFINITY to BLOOD_VOLUME_SURVIVE) - if(!has_trait(TRAIT_NODEATH)) + if(!HAS_TRAIT(src, TRAIT_NODEATH)) death() var/temp_bleed = 0 @@ -87,7 +87,7 @@ bleed_rate = max(bleed_rate - 0.5, temp_bleed)//if no wounds, other bleed effects (heparin) naturally decreases - if(bleed_rate && !bleedsuppress && !(has_trait(TRAIT_FAKEDEATH))) + if(bleed_rate && !bleedsuppress && !(HAS_TRAIT(src, TRAIT_FAKEDEATH))) bleed(bleed_rate) //Makes a blood drop, leaking amt units of blood from the mob @@ -214,13 +214,13 @@ return "blood" /mob/living/carbon/monkey/get_blood_id() - if(!(has_trait(TRAIT_NOCLONE))) + if(!(HAS_TRAIT(src, TRAIT_NOCLONE))) return "blood" /mob/living/carbon/human/get_blood_id() if(dna.species.exotic_blood) return dna.species.exotic_blood - else if((NOBLOOD in dna.species.species_traits) || (has_trait(TRAIT_NOCLONE))) + else if((NOBLOOD in dna.species.species_traits) || (HAS_TRAIT(src, TRAIT_NOCLONE))) return return "blood" diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 0b4d5f6098..64b75bc801 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -42,13 +42,13 @@ INVOKE_ASYNC(is_devil(src), /datum/antagonist/devil.proc/beginResurrectionCheck, src) /mob/living/carbon/human/proc/makeSkeleton() - add_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) + ADD_TRAIT(src, TRAIT_DISFIGURED, TRAIT_GENERIC) set_species(/datum/species/skeleton) return 1 /mob/living/carbon/proc/Drain() become_husk(CHANGELING_DRAIN) - add_trait(TRAIT_NOCLONE, CHANGELING_DRAIN) + ADD_TRAIT(src, TRAIT_NOCLONE, CHANGELING_DRAIN) blood_volume = 0 return 1 diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 94f08280d4..de99287d41 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -93,7 +93,7 @@ if(!(SLOT_GLASSES in obscured)) if(glasses) msg += "[t_He] [t_has] [glasses.get_examine_string(user)] covering [t_his] eyes.\n" - else if(eye_color == BLOODCULT_EYE && iscultist(src) && HAS_TRAIT(src, CULT_EYES)) + else if(eye_color == BLOODCULT_EYE && iscultist(src) && HAS_TRAIT(src, TRAIT_CULT_EYES)) msg += "[t_His] eyes are glowing an unnatural red!\n" //ears diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 1861b5ebd0..2a75119841 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -614,7 +614,7 @@ facial_hair_style = "Shaved" hair_style = "Bald" update_hair() - add_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) + ADD_TRAIT(src, TRAIT_DISFIGURED, TRAIT_GENERIC) update_damage_overlays() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 12b1d73778..1af9dbc5f5 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -63,7 +63,7 @@ /mob/living/carbon/human/handle_traits() if(eye_blind) //blindness, heals slowly over time - if(HAS_TRAIT(src, TRAIT_BLIND, EYES_COVERED)) //covering your eyes heals blurry eyes faster + if(HAS_TRAIT_FROM(src, TRAIT_BLIND, EYES_COVERED)) //covering your eyes heals blurry eyes faster adjust_blindness(-3) else adjust_blindness(-1) @@ -332,7 +332,7 @@ HM.on_life(src) /mob/living/carbon/human/proc/handle_heart() - var/we_breath = !HAS_TRAIT(src, TRAIT_NOBREATH, SPECIES_TRAIT) + var/we_breath = !HAS_TRAIT_FROM(src, TRAIT_NOBREATH, SPECIES_TRAIT) if(!undergoing_cardiac_arrest()) return diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index b0ac43aa42..673249b186 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -54,7 +54,7 @@ /mob/living/carbon/human/IsVocal() // how do species that don't breathe talk? magic, that's what. - if(!HAS_TRAIT(src, TRAIT_NOBREATH, SPECIES_TRAIT) && !getorganslot(ORGAN_SLOT_LUNGS)) + if(!HAS_TRAIT_FROM(src, TRAIT_NOBREATH, SPECIES_TRAIT) && !getorganslot(ORGAN_SLOT_LUNGS)) return FALSE if(mind) return !mind.miming diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 1a6ef6cd2f..c9abf392a2 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -286,7 +286,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) C.put_in_hands(new mutanthands()) for(var/X in inherent_traits) - C.add_trait(X, SPECIES_TRAIT) + ADD_TRAIT(C, X, SPECIES_TRAIT) if(TRAIT_VIRUSIMMUNE in inherent_traits) for(var/datum/disease/A in C.diseases) @@ -313,7 +313,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(DIGITIGRADE in species_traits) C.Digitigrade_Leg_Swap(TRUE) for(var/X in inherent_traits) - C.remove_trait(X, SPECIES_TRAIT) + REMOVE_TRAIT(C, X, SPECIES_TRAIT) SEND_SIGNAL(C, COMSIG_SPECIES_LOSS, src) @@ -1161,13 +1161,13 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(HAS_TRAIT(H, TRAIT_FAT))//I share your pain, past coder. if(H.overeatduration < 100) to_chat(H, "You feel fit again!") - H.remove_trait(TRAIT_FAT, OBESITY) + REMOVE_TRAIT(H, TRAIT_FAT, OBESITY) H.update_inv_w_uniform() H.update_inv_wear_suit() else if(H.overeatduration >= 100) to_chat(H, "You suddenly feel blubbery!") - H.add_trait(TRAIT_FAT, OBESITY) + ADD_TRAIT(H, TRAIT_FAT, OBESITY) H.update_inv_w_uniform() H.update_inv_wear_suit() @@ -1480,7 +1480,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) "You slap [user == target ? "yourself" : "\the [target]"] in the face! ",\ "You hear a slap." ) - if (!target.HAS_TRAIT(TRAIT_NYMPHO)) + if (!HAS_TRAIT(target, TRAIT_NYMPHO)) stop_wagging_tail(target) user.do_attack_animation(target, ATTACK_EFFECT_FACE_SLAP) user.adjustStaminaLossBuffered(3) @@ -1488,7 +1488,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) else if(aim_for_groin && (target == user || target.lying || same_dir) && (target_on_help || target_restrained || target_aiming_for_groin)) user.do_attack_animation(target, ATTACK_EFFECT_ASS_SLAP) user.adjustStaminaLossBuffered(3) - if(target.has_trait(TRAIT_ASSBLASTUSA)) + if(HAS_TRAIT(target, TRAIT_ASSBLASTUSA)) var/hit_zone = (user.held_index_to_dir(user.active_hand_index) == "l" ? "l_":"r_") + "arm" user.adjustStaminaLoss(50, affected_zone = hit_zone) var/obj/item/bodypart/affecting = user.get_bodypart(hit_zone) @@ -1512,9 +1512,9 @@ GLOBAL_LIST_EMPTY(roundstart_races) ) if (target.canbearoused) target.adjustArousalLoss(5) - if (target.getArousalLoss() >= 100 && ishuman(target) && target.has_trait(TRAIT_MASO) && target.has_dna()) + if (target.getArousalLoss() >= 100 && ishuman(target) && HAS_TRAIT(target, TRAIT_MASO) && target.has_dna()) target.mob_climax(forced_climax=TRUE) - if (!target.has_trait(TRAIT_NYMPHO)) + if (!HAS_TRAIT(target, TRAIT_NYMPHO)) stop_wagging_tail(target) return FALSE @@ -1649,7 +1649,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) //dismemberment var/probability = I.get_dismemberment_chance(affecting) - if(prob(probability) || (H.has_trait(TRAIT_EASYDISMEMBER) && prob(probability))) //try twice + if(prob(probability) || (HAS_TRAIT(H, TRAIT_EASYDISMEMBER) && prob(probability))) //try twice if(affecting.dismember(I.damtype)) I.add_mob_blood(H) playsound(get_turf(H), I.get_dismember_sound(), 80, 1) @@ -1747,7 +1747,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(BP) if(damage > 0 ? BP.receive_damage(damage * hit_percent * brutemod * H.physiology.brute_mod, 0) : BP.heal_damage(abs(damage * hit_percent * brutemod * H.physiology.brute_mod), 0)) H.update_damage_overlays() - if(H.has_trait(TRAIT_MASO)) + if(HAS_TRAIT(H, TRAIT_MASO)) H.adjustArousalLoss(damage * brutemod * H.physiology.brute_mod) if (H.getArousalLoss() >= 100 && ishuman(H) && H.has_dna()) H.mob_climax(forced_climax=TRUE) @@ -1796,7 +1796,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) ///////////// /datum/species/proc/breathe(mob/living/carbon/human/H) - if(H.has_trait(TRAIT_NOBREATH)) + if(HAS_TRAIT(H, TRAIT_NOBREATH)) return TRUE @@ -1844,7 +1844,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) H.throw_alert("temp", /obj/screen/alert/hot, 3) // +/- 50 degrees from 310K is the 'safe' zone, where no damage is dealt. - if(H.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !H.has_trait(TRAIT_RESISTHEAT)) + if(H.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !HAS_TRAIT(H, TRAIT_RESISTHEAT)) //Body temperature is too hot. SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "cold") @@ -1862,7 +1862,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) H.emote("scream") H.apply_damage(burn_damage, BURN) - else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !H.has_trait(TRAIT_RESISTCOLD)) + else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(H, TRAIT_RESISTCOLD)) SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "hot") SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "cold", /datum/mood_event/cold) switch(H.bodytemperature) @@ -1881,7 +1881,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) var/adjusted_pressure = H.calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. switch(adjusted_pressure) if(HAZARD_HIGH_PRESSURE to INFINITY) - if(!H.has_trait(TRAIT_RESISTHIGHPRESSURE)) + if(!HAS_TRAIT(H, TRAIT_RESISTHIGHPRESSURE)) H.adjustBruteLoss(min(((adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 ) * PRESSURE_DAMAGE_COEFFICIENT, MAX_HIGH_PRESSURE_DAMAGE) * H.physiology.pressure_mod) H.throw_alert("pressure", /obj/screen/alert/highpressure, 2) else @@ -1893,7 +1893,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) H.throw_alert("pressure", /obj/screen/alert/lowpressure, 1) else - if(H.has_trait(TRAIT_RESISTLOWPRESSURE)) + if(HAS_TRAIT(H, TRAIT_RESISTLOWPRESSURE)) H.clear_alert("pressure") else H.adjustBruteLoss(LOW_PRESSURE_DAMAGE * H.physiology.pressure_mod) @@ -1904,7 +1904,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) ////////// /datum/species/proc/handle_fire(mob/living/carbon/human/H, no_protection = FALSE) - if(H.has_trait(TRAIT_NOFIRE)) + if(HAS_TRAIT(H, TRAIT_NOFIRE)) return if(H.on_fire) //the fire tries to damage the exposed clothes and items @@ -1972,7 +1972,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "on_fire", /datum/mood_event/on_fire) /datum/species/proc/CanIgniteMob(mob/living/carbon/human/H) - if(H.has_trait(TRAIT_NOFIRE)) + if(HAS_TRAIT(H, TRAIT_NOFIRE)) return FALSE return TRUE diff --git a/code/modules/mob/living/carbon/human/species_types/angel.dm b/code/modules/mob/living/carbon/human/species_types/angel.dm index 5122294956..c1c848106c 100644 --- a/code/modules/mob/living/carbon/human/species_types/angel.dm +++ b/code/modules/mob/living/carbon/human/species_types/angel.dm @@ -23,7 +23,7 @@ if(ishuman(H) && !fly) fly = new fly.Grant(H) - H.add_trait(TRAIT_HOLY, SPECIES_TRAIT) + ADD_TRAIT(H, TRAIT_HOLY, SPECIES_TRAIT) /datum/species/angel/on_species_loss(mob/living/carbon/human/H) if(fly) @@ -36,7 +36,7 @@ H.dna.species.mutant_bodyparts -= "wings" H.dna.features["wings"] = "None" H.update_body() - H.remove_trait(TRAIT_HOLY, SPECIES_TRAIT) + REMOVE_TRAIT(H, TRAIT_HOLY, SPECIES_TRAIT) ..() /datum/species/angel/spec_life(mob/living/carbon/human/H) diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index b790ae0489..ff90929c4b 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -74,10 +74,10 @@ /datum/species/golem/adamantine/on_species_gain(mob/living/carbon/C, datum/species/old_species) ..() - C.add_trait(TRAIT_ANTIMAGIC, SPECIES_TRAIT) + ADD_TRAIT(C, TRAIT_ANTIMAGIC, SPECIES_TRAIT) /datum/species/golem/adamantine/on_species_loss(mob/living/carbon/C) - C.remove_trait(TRAIT_ANTIMAGIC, SPECIES_TRAIT) + REMOVE_TRAIT(C, TRAIT_ANTIMAGIC, SPECIES_TRAIT) ..() //The suicide bombers of golemkind @@ -175,10 +175,10 @@ /datum/species/golem/silver/on_species_gain(mob/living/carbon/C, datum/species/old_species) ..() - C.add_trait(TRAIT_HOLY, SPECIES_TRAIT) + ADD_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) /datum/species/golem/silver/on_species_loss(mob/living/carbon/C) - C.remove_trait(TRAIT_HOLY, SPECIES_TRAIT) + REMOVE_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) ..() //Harder to stun, deals more damage, but it's even slower @@ -698,10 +698,10 @@ /datum/species/golem/cloth/on_species_gain(mob/living/carbon/C, datum/species/old_species) ..() - C.add_trait(TRAIT_HOLY, SPECIES_TRAIT) + ADD_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) /datum/species/golem/cloth/on_species_loss(mob/living/carbon/C) - C.remove_trait(TRAIT_HOLY, SPECIES_TRAIT) + REMOVE_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) ..() /datum/species/golem/cloth/check_roundstart_eligible() @@ -768,7 +768,7 @@ /obj/structure/cloth_pile/proc/revive() if(QDELETED(src) || QDELETED(cloth_golem)) //QDELETED also checks for null, so if no cloth golem is set this won't runtime return - if(cloth_golem.suiciding || cloth_golem.has_trait(TRAIT_NOCLONE)) + if(cloth_golem.suiciding || HAS_TRAIT(cloth_golem, TRAIT_NOCLONE)) QDEL_NULL(cloth_golem) return diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 0461fb9b79..b218b2cefc 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -594,7 +594,7 @@ /datum/species/jelly/stargazer/proc/link_mob(mob/living/M) if(QDELETED(M) || M.stat == DEAD) return FALSE - if(M.has_trait(TRAIT_MINDSHIELD)) //mindshield implant, no dice + if(HAS_TRAIT(M, TRAIT_MINDSHIELD)) //mindshield implant, no dice return FALSE if(M in linked_mobs) return FALSE diff --git a/code/modules/mob/living/carbon/human/status_procs.dm b/code/modules/mob/living/carbon/human/status_procs.dm index 844545a748..5c20b0ce75 100644 --- a/code/modules/mob/living/carbon/human/status_procs.dm +++ b/code/modules/mob/living/carbon/human/status_procs.dm @@ -9,12 +9,12 @@ /mob/living/carbon/human/Unconscious(amount, updating = 1, ignore_canunconscious = 0) amount = dna.species.spec_stun(src,amount) - if(has_trait(TRAIT_HEAVY_SLEEPER)) + if(HAS_TRAIT(src, TRAIT_HEAVY_SLEEPER)) amount *= rand(1.25, 1.3) return ..() /mob/living/carbon/human/Sleeping(amount, updating = 1, ignore_sleepimmune = 0) - if(has_trait(TRAIT_HEAVY_SLEEPER)) + if(HAS_TRAIT(src, TRAIT_HEAVY_SLEEPER)) amount *= rand(1.25, 1.3) return ..() diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index ef5b9045ca..feb80e8d2c 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -663,7 +663,7 @@ generate/load female uniform sprites matching all previously decided variables else . += "-no_marking" - if(has_trait(TRAIT_HUSK)) + if(HAS_TRAIT(src, TRAIT_HUSK)) . += "-husk" /mob/living/carbon/human/load_limb_from_cache() @@ -705,7 +705,7 @@ generate/load female uniform sprites matching all previously decided variables add_overlay(HD.get_limb_icon()) update_damage_overlays() - if(HD && !(has_trait(TRAIT_HUSK))) + if(HD && !(HAS_TRAIT(src, TRAIT_HUSK))) // lipstick if(lip_style && (LIPS in dna.species.species_traits)) var/mutable_appearance/lip_overlay = mutable_appearance('icons/mob/human_face.dmi', "lips_[lip_style]", -BODY_LAYER) diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index 901fb48b20..4c1c235fe1 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -119,7 +119,7 @@ cuff_resist(I) /mob/living/carbon/monkey/proc/should_target(var/mob/living/L) - if(has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(src, TRAIT_PACIFISM)) return FALSE if(enemies[L]) @@ -143,7 +143,7 @@ pickupTimer = 0 else INVOKE_ASYNC(src, .proc/walk2derpless, pickupTarget.loc) - if(Adjacent(pickupTarget) || Adjacent(pickupTarget.loc)) // next to target + if(Adjacent(pickupTarget) || Adjacent(pickupTarget.loc)) // next to target drop_all_held_items() // who cares about these items, i want that one! if(isturf(pickupTarget.loc)) // on floor equip_item(pickupTarget) @@ -167,7 +167,7 @@ battle_screech() retaliate(L) return TRUE - else + else bodyDisposal = locate(/obj/machinery/disposal/) in around if(bodyDisposal) target = L diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 55b5d67c24..906e138b0a 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -81,7 +81,7 @@ adjust_bodytemperature(min((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR, BODYTEMP_HEATING_MAX)) - if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !has_trait(TRAIT_RESISTHEAT)) + if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !HAS_TRAIT(src, TRAIT_RESISTHEAT)) switch(bodytemperature) if(360 to 400) throw_alert("temp", /obj/screen/alert/hot, 1) @@ -96,7 +96,7 @@ else apply_damage(HEAT_DAMAGE_LEVEL_2, BURN) - else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !has_trait(TRAIT_RESISTCOLD)) + else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(src, TRAIT_RESISTCOLD)) if(!istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell)) switch(bodytemperature) if(200 to 260) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 1ffa3316ab..f1a6b58cd1 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -147,7 +147,7 @@ threatcount += 4 //trigger look_for_perp() since they're nonhuman and very likely hostile //mindshield implants imply trustworthyness - if(has_trait(TRAIT_MINDSHIELD)) + if(HAS_TRAIT(src, TRAIT_MINDSHIELD)) threatcount -= 1 return threatcount diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm index c807251af4..6311776596 100644 --- a/code/modules/mob/living/carbon/monkey/update_icons.dm +++ b/code/modules/mob/living/carbon/monkey/update_icons.dm @@ -19,7 +19,7 @@ if(!HD) //Decapitated return - if(has_trait(TRAIT_HUSK)) + if(HAS_TRAIT(src, TRAIT_HUSK)) return var/hair_hidden = 0 diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 4e5c7decc5..b2eed2d19e 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -101,14 +101,14 @@ if(EFFECT_SLUR) slurring = max(slurring,(effect * hit_percent)) if(EFFECT_STUTTER) - if((status_flags & CANSTUN) && !has_trait(TRAIT_STUNIMMUNE)) // stun is usually associated with stutter + if((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) // stun is usually associated with stutter stuttering = max(stuttering,(effect * hit_percent)) if(EFFECT_EYE_BLUR) blur_eyes(effect * hit_percent) if(EFFECT_DROWSY) drowsyness = max(drowsyness,(effect * hit_percent)) if(EFFECT_JITTER) - if((status_flags & CANSTUN) && !has_trait(TRAIT_STUNIMMUNE)) + if((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) jitteriness = max(jitteriness,(effect * hit_percent)) return 1 diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 9ef4c1567a..f238db3582 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -126,7 +126,7 @@ /mob/living/proc/handle_traits() //Eyes if(eye_blind) //blindness, heals slowly over time - if(!stat && !(has_trait(TRAIT_BLIND))) + if(!stat && !(HAS_TRAIT(src, TRAIT_BLIND))) eye_blind = max(eye_blind-1,0) if(client && !eye_blind) clear_alert("blind") diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b6717f2932..0eeca1db6c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -170,7 +170,7 @@ return 1 if(isliving(M)) var/mob/living/L = M - if(L.has_trait(TRAIT_PUSHIMMUNE)) + if(HAS_TRAIT(L, TRAIT_PUSHIMMUNE)) return 1 //If they're a human, and they're not in help intent, block pushing if(ishuman(M) && (M.a_intent != INTENT_HELP)) @@ -306,7 +306,7 @@ /mob/living/pointed(atom/A as mob|obj|turf in view()) if(incapacitated()) return FALSE - if(has_trait(TRAIT_DEATHCOMA)) + if(HAS_TRAIT(src, TRAIT_DEATHCOMA)) return FALSE if(!..()) return FALSE @@ -889,7 +889,7 @@ /mob/living/rad_act(amount) . = ..() - if(!amount || (amount < RAD_MOB_SKIN_PROTECTION) || has_trait(TRAIT_RADIMMUNE)) + if(!amount || (amount < RAD_MOB_SKIN_PROTECTION) || HAS_TRAIT(src, TRAIT_RADIMMUNE)) return amount -= RAD_BACKGROUND_RADIATION // This will always be at least 1 because of how skin protection is calculated @@ -905,7 +905,7 @@ . = ..() if(.) return - if((magic && has_trait(TRAIT_ANTIMAGIC)) || (holy && has_trait(TRAIT_HOLY))) + if((magic && HAS_TRAIT(src, TRAIT_ANTIMAGIC)) || (holy && HAS_TRAIT(src, TRAIT_HOLY))) return src /mob/living/proc/fakefireextinguish() @@ -988,7 +988,7 @@ //Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. //Robots, animals and brains have their own version so don't worry about them /mob/living/proc/update_canmove() - var/ko = IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (has_trait(TRAIT_DEATHCOMA)) + var/ko = IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) var/move_and_fall = stat == SOFT_CRIT && !pulledby var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK var/buckle_lying = !(buckled && !buckled.buckle_lying) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 0d74094d81..449bbe361f 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -137,11 +137,11 @@ user.start_pulling(src, supress_message) return - if(!(status_flags & CANPUSH) || has_trait(TRAIT_PUSHIMMUNE)) + if(!(status_flags & CANPUSH) || HAS_TRAIT(src, TRAIT_PUSHIMMUNE)) to_chat(user, "[src] can't be grabbed more aggressively!") return FALSE - if(user.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(user, TRAIT_PACIFISM)) to_chat(user, "You don't want to risk hurting [src]!") return FALSE @@ -204,7 +204,7 @@ M.Feedstop() return // can't attack while eating! - if(has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(src, TRAIT_PACIFISM)) to_chat(M, "You don't want to hurt anyone!") return FALSE @@ -221,7 +221,7 @@ M.visible_message("\The [M] [M.friendly] [src]!") return FALSE else - if(M.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(M, TRAIT_PACIFISM)) to_chat(M, "You don't want to hurt anyone!") return FALSE @@ -240,7 +240,7 @@ return FALSE if (M.a_intent == INTENT_HARM) - if(M.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(M, TRAIT_PACIFISM)) to_chat(M, "You don't want to hurt anyone!") return FALSE @@ -266,7 +266,7 @@ return FALSE else - if(L.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(L, TRAIT_PACIFISM)) to_chat(L, "You don't want to hurt anyone!") return @@ -291,7 +291,7 @@ grabbedby(M) return FALSE if("harm") - if(M.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(M, TRAIT_PACIFISM)) to_chat(M, "You don't want to hurt anyone!") return FALSE M.do_attack_animation(src) @@ -315,7 +315,7 @@ SEND_SIGNAL(src, COMSIG_LIVING_ELECTROCUTE_ACT, shock_damage) if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) return FALSE - if(has_trait(TRAIT_SHOCKIMMUNE)) + if(HAS_TRAIT(src, TRAIT_SHOCKIMMUNE)) return FALSE if(shock_damage > 0) if(!illusion) @@ -385,7 +385,7 @@ //called when the mob receives a bright flash /mob/living/proc/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash) - if(get_eye_protection() < intensity && (override_blindness_check || !(has_trait(TRAIT_BLIND)))) + if(get_eye_protection() < intensity && (override_blindness_check || !(HAS_TRAIT(src, TRAIT_BLIND)))) overlay_fullscreen("flash", type) addtimer(CALLBACK(src, .proc/clear_fullscreen, "flash", 25), 25) return TRUE diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 871e33349a..e2f62b054c 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -301,7 +301,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( return 1 /mob/living/proc/can_speak_vocal(message) //Check AFTER handling of xeno and ling channels - if(has_trait(TRAIT_MUTE)) + if(HAS_TRAIT(src, TRAIT_MUTE)) return 0 if(is_muzzled()) diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm index a92c1ff9e1..793df63c87 100644 --- a/code/modules/mob/living/simple_animal/animal_defense.dm +++ b/code/modules/mob/living/simple_animal/animal_defense.dm @@ -15,7 +15,7 @@ grabbedby(M) if("harm", "disarm") - if(M.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(M, TRAIT_PACIFISM)) to_chat(M, "You don't want to hurt [src]!") return M.do_attack_animation(src, ATTACK_EFFECT_PUNCH) @@ -29,7 +29,7 @@ /mob/living/simple_animal/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) if(user.a_intent == INTENT_HARM) - if(user.has_trait(TRAIT_PACIFISM)) + if(HAS_TRAIT(user, TRAIT_PACIFISM)) to_chat(user, "You don't want to hurt [src]!") return FALSE ..(user, 1) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 7167d87bde..5a21d33d5a 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -343,7 +343,7 @@ /mob/living/simple_animal/bot/medbot/proc/assess_patient(mob/living/carbon/C) //Time to see if they need medical help! - if(C.stat == DEAD || (C.has_trait(TRAIT_FAKEDEATH))) + if(C.stat == DEAD || (HAS_TRAIT(C, TRAIT_FAKEDEATH))) return FALSE //welp too late for them! if(!(loc == C.loc) && !(isturf(C.loc) && isturf(loc))) @@ -421,7 +421,7 @@ soft_reset() return - if(C.stat == DEAD || (C.has_trait(TRAIT_FAKEDEATH))) + if(C.stat == DEAD || (HAS_TRAIT(C, TRAIT_FAKEDEATH))) var/list/messagevoice = list("No! Stay with me!" = 'sound/voice/medbot/no.ogg',"Live, damnit! LIVE!" = 'sound/voice/medbot/live.ogg',"I...I've never lost a patient before. Not today, I mean." = 'sound/voice/medbot/lost.ogg') var/message = pick(messagevoice) speak(message) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index ff91ca7dc3..3cc8822d02 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -343,7 +343,7 @@ /mob/living/simple_animal/hostile/construct/harvester/AttackingTarget() if(iscarbon(target)) var/mob/living/carbon/C = target - if(C.has_trait(TRAIT_NODISMEMBER)) + if(HAS_TRAIT(C, TRAIT_NODISMEMBER)) return ..() //ATTACK! var/list/parts = list() var/undismembermerable_limbs = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/headcrab.dm b/code/modules/mob/living/simple_animal/hostile/headcrab.dm index 646987b155..80e0172f45 100644 --- a/code/modules/mob/living/simple_animal/hostile/headcrab.dm +++ b/code/modules/mob/living/simple_animal/hostile/headcrab.dm @@ -43,7 +43,7 @@ // Changeling egg can survive in aliens! var/mob/living/carbon/C = target if(C.stat == DEAD) - if(C.has_trait(TRAIT_XENO_HOST)) + if(HAS_TRAIT(C, TRAIT_XENO_HOST)) to_chat(src, "A foreign presence repels us from this body. Perhaps we should try to infest another?") return Infect(target) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index c491b3e78d..7cf8defc0f 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -558,7 +558,7 @@ Difficulty: Very Hard H.regenerate_limbs() H.regenerate_organs() H.revive(1,0) - H.add_trait(TRAIT_NOCLONE, MAGIC_TRAIT) //Free revives, but significantly limits your options for reviving except via the crystal + ADD_TRAIT(H, TRAIT_NOCLONE, MAGIC_TRAIT) //Free revives, but significantly limits your options for reviving except via the crystal H.grab_ghost(force = TRUE) /obj/machinery/anomalous_crystal/helpers //Lets ghost spawn as helpful creatures that can only heal people slightly. Incredibly fragile and they can't converse with humans @@ -721,7 +721,7 @@ Difficulty: Very Hard if(isliving(A) && holder_animal) var/mob/living/L = A L.notransform = 1 - L.add_trait(TRAIT_MUTE, STASIS_MUTE) + ADD_TRAIT(L, TRAIT_MUTE, STASIS_MUTE) L.status_flags |= GODMODE L.mind.transfer_to(holder_animal) var/obj/effect/proc_holder/spell/targeted/exit_possession/P = new /obj/effect/proc_holder/spell/targeted/exit_possession @@ -731,7 +731,7 @@ Difficulty: Very Hard /obj/structure/closet/stasis/dump_contents(var/kill = 1) STOP_PROCESSING(SSobj, src) for(var/mob/living/L in src) - L.remove_trait(TRAIT_MUTE, STASIS_MUTE) + REMOVE_TRAIT(L, TRAIT_MUTE, STASIS_MUTE) L.status_flags &= ~GODMODE L.notransform = 0 if(holder_animal) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 537ce8e67d..5006bd2920 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -15,7 +15,7 @@ return 0 /mob/living/proc/Stun(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration - if(((status_flags & CANSTUN) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canstun) + if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) if(absorb_stun(amount, ignore_canstun)) return var/datum/status_effect/incapacitating/stun/S = IsStun() @@ -26,7 +26,7 @@ return S /mob/living/proc/SetStun(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration - if(((status_flags & CANSTUN) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canstun) + if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) var/datum/status_effect/incapacitating/stun/S = IsStun() if(amount <= 0) if(S) @@ -41,7 +41,7 @@ return S /mob/living/proc/AdjustStun(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration - if(((status_flags & CANSTUN) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canstun) + if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) if(absorb_stun(amount, ignore_canstun)) return var/datum/status_effect/incapacitating/stun/S = IsStun() @@ -63,7 +63,7 @@ return 0 /mob/living/proc/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) //Can't go below remaining duration - if(((status_flags & CANKNOCKDOWN) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canknockdown) + if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canknockdown) if(absorb_stun(amount, ignore_canknockdown)) return var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() @@ -74,7 +74,7 @@ return K /mob/living/proc/SetKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) //Sets remaining duration - if(((status_flags & CANKNOCKDOWN) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canknockdown) + if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canknockdown) var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() if(amount <= 0) if(K) @@ -89,7 +89,7 @@ return K /mob/living/proc/AdjustKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE) //Adds to remaining duration - if(((status_flags & CANKNOCKDOWN) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canknockdown) + if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canknockdown) if(absorb_stun(amount, ignore_canknockdown)) return var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() @@ -141,7 +141,7 @@ /////////////////////////////////// DISABILITIES //////////////////////////////////// /mob/living/proc/add_quirk(quirk, spawn_effects) //separate proc due to the way these ones are handled - if(has_trait(quirk)) + if(HAS_TRAIT(src, quirk)) return if(!SSquirks || !SSquirks.quirks[quirk]) return @@ -161,42 +161,42 @@ /////////////////////////////////// TRAIT PROCS //////////////////////////////////// /mob/living/proc/cure_blind(list/sources) - remove_trait(TRAIT_BLIND, sources) - if(!has_trait(TRAIT_BLIND)) + REMOVE_TRAIT(src, TRAIT_BLIND, sources) + if(!HAS_TRAIT(src, TRAIT_BLIND)) adjust_blindness(-1) /mob/living/proc/become_blind(source) - if(!has_trait(TRAIT_BLIND)) + if(!HAS_TRAIT(src, TRAIT_BLIND)) blind_eyes(1) - add_trait(TRAIT_BLIND, source) + ADD_TRAIT(src, TRAIT_BLIND, source) /mob/living/proc/cure_nearsighted(list/sources) - remove_trait(TRAIT_NEARSIGHT, sources) - if(!has_trait(TRAIT_NEARSIGHT)) + REMOVE_TRAIT(src, TRAIT_NEARSIGHT, sources) + if(!HAS_TRAIT(src, TRAIT_NEARSIGHT)) clear_fullscreen("nearsighted") /mob/living/proc/become_nearsighted(source) - if(!has_trait(TRAIT_NEARSIGHT)) + if(!HAS_TRAIT(src, TRAIT_NEARSIGHT)) overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) - add_trait(TRAIT_NEARSIGHT, source) + ADD_TRAIT(src, TRAIT_NEARSIGHT, source) /mob/living/proc/cure_husk(list/sources) - remove_trait(TRAIT_HUSK, sources) - if(!has_trait(TRAIT_HUSK)) - remove_trait(TRAIT_DISFIGURED, "husk") + REMOVE_TRAIT(src, TRAIT_HUSK, sources) + if(!HAS_TRAIT(src, TRAIT_HUSK)) + REMOVE_TRAIT(src, TRAIT_DISFIGURED, "husk") update_body() return TRUE /mob/living/proc/become_husk(source) - if(!has_trait(TRAIT_HUSK)) - add_trait(TRAIT_DISFIGURED, "husk") + if(!HAS_TRAIT(src, TRAIT_HUSK)) + ADD_TRAIT(src, TRAIT_DISFIGURED, "husk") update_body() . = TRUE - add_trait(TRAIT_HUSK, source) + ADD_TRAIT(src, TRAIT_HUSK, source) /mob/living/proc/cure_fakedeath(list/sources) - remove_trait(TRAIT_FAKEDEATH, sources) - remove_trait(TRAIT_DEATHCOMA, sources) + REMOVE_TRAIT(src, TRAIT_FAKEDEATH, sources) + REMOVE_TRAIT(src, TRAIT_DEATHCOMA, sources) if(stat != DEAD) tod = null update_stat() @@ -206,15 +206,15 @@ return if(!silent) emote("deathgasp") - add_trait(TRAIT_FAKEDEATH, source) - add_trait(TRAIT_DEATHCOMA, source) + ADD_TRAIT(src, TRAIT_FAKEDEATH, source) + ADD_TRAIT(src, TRAIT_DEATHCOMA, source) tod = STATION_TIME_TIMESTAMP("hh:mm:ss") update_stat() /mob/living/proc/unignore_slowdown(list/sources) - remove_trait(TRAIT_IGNORESLOWDOWN, sources) + REMOVE_TRAIT(src, TRAIT_IGNORESLOWDOWN, sources) update_movespeed(FALSE) /mob/living/proc/ignore_slowdown(source) - add_trait(TRAIT_IGNORESLOWDOWN, source) + ADD_TRAIT(src, TRAIT_IGNORESLOWDOWN, source) update_movespeed(FALSE) \ No newline at end of file diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm index a1a1bbe502..606d6d4f66 100644 --- a/code/modules/mob/status_procs.dm +++ b/code/modules/mob/status_procs.dm @@ -28,7 +28,7 @@ return 0 /mob/living/proc/Unconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Can't go below remaining duration - if(((status_flags & CANUNCONSCIOUS) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canunconscious) + if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious) var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() if(U) U.duration = max(world.time + amount, U.duration) @@ -37,7 +37,7 @@ return U /mob/living/proc/SetUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Sets remaining duration - if(((status_flags & CANUNCONSCIOUS) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canunconscious) + if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious) var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() if(amount <= 0) if(U) @@ -49,7 +49,7 @@ return U /mob/living/proc/AdjustUnconscious(amount, updating = TRUE, ignore_canunconscious = FALSE) //Adds to remaining duration - if(((status_flags & CANUNCONSCIOUS) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canunconscious) + if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canunconscious) var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() if(U) U.duration += amount @@ -72,7 +72,7 @@ return 0 /mob/living/proc/Sleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Can't go below remaining duration - if((!has_trait(TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune) + if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune) var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() if(S) S.duration = max(world.time + amount, S.duration) @@ -81,7 +81,7 @@ return S /mob/living/proc/SetSleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Sets remaining duration - if((!has_trait(TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune) + if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune) var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() if(amount <= 0) if(S) @@ -93,7 +93,7 @@ return S /mob/living/proc/AdjustSleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Adds to remaining duration - if((!has_trait(TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune) + if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune) var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() if(S) S.duration += amount @@ -170,7 +170,7 @@ blind_minimum = 1 if(isliving(src)) var/mob/living/L = src - if(L.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(L, TRAIT_BLIND)) blind_minimum = 1 eye_blind = max(eye_blind+amount, blind_minimum) if(!eye_blind) @@ -191,7 +191,7 @@ blind_minimum = 1 if(isliving(src)) var/mob/living/L = src - if(L.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(L, TRAIT_BLIND)) blind_minimum = 1 eye_blind = blind_minimum if(!eye_blind) diff --git a/code/modules/paperwork/contract.dm b/code/modules/paperwork/contract.dm index 006151c4eb..676774ff88 100644 --- a/code/modules/paperwork/contract.dm +++ b/code/modules/paperwork/contract.dm @@ -202,7 +202,7 @@ if(!user.mind.hasSoul) to_chat(user, "You do not possess a soul.") return 0 - if(user.has_trait(TRAIT_DUMB)) + if(HAS_TRAIT(user, TRAIT_DUMB)) to_chat(user, "You quickly scrawl 'your name' on the contract.") signIncorrectly() return 0 diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index d6d0a3dc4f..37877ffb09 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -89,7 +89,7 @@ return if(ishuman(usr)) var/mob/living/carbon/human/H = usr - if(H.has_trait(TRAIT_CLUMSY) && prob(25)) + if(HAS_TRAIT(H, TRAIT_CLUMSY) && prob(25)) to_chat(H, "You cut yourself on the paper! Ahhhh! Ahhhhh!") H.damageoverlaytemp = 9001 H.update_damage_hud() @@ -314,7 +314,7 @@ to_chat(user, "You stamp the paper with your rubber stamp.") if(P.is_hot()) - if(user.has_trait(TRAIT_CLUMSY) && prob(10)) + if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) user.visible_message("[user] accidentally ignites [user.p_them()]self!", \ "You miss the paper and accidentally light yourself on fire!") user.dropItemToGround(P) diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index 73eadfbc45..e3ce30066a 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -65,7 +65,7 @@ update_icon() else if(P.is_hot()) - if(user.has_trait(TRAIT_CLUMSY) && prob(10)) + if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) user.visible_message("[user] accidentally ignites [user.p_them()]self!", \ "You miss [src] and accidentally light yourself on fire!") user.dropItemToGround(P) diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index b3f59abfae..8c51fd31ea 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -124,7 +124,7 @@ var/realcooldown = cooldown var/mob/living/carbon/human/H = user - if (H.has_trait(TRAIT_PHOTOGRAPHER)) + if (HAS_TRAIT(H, TRAIT_PHOTOGRAPHER)) realcooldown *= 0.5 addtimer(CALLBACK(src, .proc/cooldown), realcooldown) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 1c05b6c11a..b77ea9d13a 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -604,7 +604,7 @@ else prot = 1 - if(prot > 0 || user.has_trait(TRAIT_RESISTHEAT) || user.has_trait(TRAIT_RESISTHEATHANDS)) + if(prot > 0 || HAS_TRAIT(user, TRAIT_RESISTHEAT) || HAS_TRAIT(user, TRAIT_RESISTHEATHANDS)) to_chat(user, "You remove the light [fitting].") else if(istype(user) && user.dna.check_mutation(TK)) to_chat(user, "You telekinetically remove the light [fitting].") diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index a7474fd8cb..542e4ecffa 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -162,7 +162,7 @@ //Exclude lasertag guns from the TRAIT_CLUMSY check. if(clumsy_check) if(istype(user)) - if (user.has_trait(TRAIT_CLUMSY) && prob(40)) + if (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(40)) to_chat(user, "You shoot yourself in the foot with [src]!") var/shot_leg = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) process_fire(user, user, FALSE, params, shot_leg) @@ -220,7 +220,7 @@ firing_burst = FALSE return FALSE if(chambered && chambered.BB) - if(user.has_trait(TRAIT_PACIFISM)) // If the user has the pacifist trait, then they won't be able to fire [src] if the round chambered inside of [src] is lethal. + if(HAS_TRAIT(user, TRAIT_PACIFISM)) // If the user has the pacifist trait, then they won't be able to fire [src] if the round chambered inside of [src] is lethal. if(chambered.harmful) // Is the bullet chambered harmful? to_chat(user, " [src] is lethally chambered! You don't want to risk harming anyone...") return @@ -259,7 +259,7 @@ var/rand_spr = rand() if(spread) randomized_gun_spread = rand(0,spread) - if(user.has_trait(TRAIT_POOR_AIM)) //nice shootin' tex + if(HAS_TRAIT(user, TRAIT_POOR_AIM)) //nice shootin' tex bonus_spread += 25 var/randomized_bonus_spread = rand(0, bonus_spread) @@ -269,7 +269,7 @@ addtimer(CALLBACK(src, .proc/process_burst, user, target, message, params, zone_override, sprd, randomized_gun_spread, randomized_bonus_spread, rand_spr, i), fire_delay * (i - 1)) else if(chambered) - if(user.has_trait(TRAIT_PACIFISM)) // If the user has the pacifist trait, then they won't be able to fire [src] if the round chambered inside of [src] is lethal. + if(HAS_TRAIT(user, TRAIT_PACIFISM)) // If the user has the pacifist trait, then they won't be able to fire [src] if the round chambered inside of [src] is lethal. if(chambered.harmful) // Is the bullet chambered harmful? to_chat(user, " [src] is lethally chambered! You don't want to risk harming anyone...") return diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index 2116f037a3..f455e0f138 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -351,7 +351,7 @@ clumsy_check = 0 /obj/item/gun/ballistic/revolver/reverse/can_trigger_gun(mob/living/user) - if((user.has_trait(TRAIT_CLUMSY)) || (user.mind && user.mind.assigned_role == "Clown")) + if((HAS_TRAIT(user, TRAIT_CLUMSY)) || (user.mind && user.mind.assigned_role == "Clown")) return ..() if(process_fire(user, user, FALSE, null, BODY_ZONE_HEAD)) user.visible_message("[user] somehow manages to shoot [user.p_them()]self in the face!", "You somehow shoot yourself in the face! How the hell?!") diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index 3698eb1ede..05d6367306 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -133,7 +133,7 @@ // A gun with ultra-honk pin is useful for clown and useless for everyone else. /obj/item/firing_pin/clown/ultra/pin_auth(mob/living/user) playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1) - if(user && (!(user.has_trait(TRAIT_CLUMSY)) && !(user.mind && user.mind.assigned_role == "Clown"))) + if(user && (!(HAS_TRAIT(user, TRAIT_CLUMSY)) && !(user.mind && user.mind.assigned_role == "Clown"))) return FALSE return TRUE diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index af01a0049f..047d50beaf 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -31,7 +31,7 @@ var/mob/living/carbon/C = target if(C.dna && C.dna.check_mutation(HULK)) C.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) - else if((C.status_flags & CANKNOCKDOWN) && !C.has_trait(TRAIT_STUNIMMUNE)) + else if((C.status_flags & CANKNOCKDOWN) && !HAS_TRAIT(C, TRAIT_STUNIMMUNE)) addtimer(CALLBACK(C, /mob/living/carbon.proc/do_jitter_animation, jitter), 5) /obj/item/projectile/energy/electrode/on_range() //to ensure the bolt sparks when it reaches the end of its range if it didn't hit a target yet diff --git a/code/modules/projectiles/projectile/energy/stun.dm b/code/modules/projectiles/projectile/energy/stun.dm index db1ad403a7..895a165f49 100644 --- a/code/modules/projectiles/projectile/energy/stun.dm +++ b/code/modules/projectiles/projectile/energy/stun.dm @@ -22,7 +22,7 @@ SEND_SIGNAL(C, COMSIG_LIVING_MINOR_SHOCK) if(C.dna && C.dna.check_mutation(HULK)) C.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ), forced = "hulk") - else if((C.status_flags & CANKNOCKDOWN) && !C.has_trait(TRAIT_STUNIMMUNE)) + else if((C.status_flags & CANKNOCKDOWN) && !HAS_TRAIT(C, TRAIT_STUNIMMUNE)) addtimer(CALLBACK(C, /mob/living/carbon.proc/do_jitter_animation, jitter), 5) /obj/item/projectile/energy/electrode/on_range() //to ensure the bolt sparks when it reaches the end of its range if it didn't hit a target yet diff --git a/code/modules/projectiles/projectile/special/hallucination.dm b/code/modules/projectiles/projectile/special/hallucination.dm index f65ebce51f..5814e7138e 100644 --- a/code/modules/projectiles/projectile/special/hallucination.dm +++ b/code/modules/projectiles/projectile/special/hallucination.dm @@ -170,7 +170,7 @@ hal_target.stuttering += 20 if(hal_target.dna && hal_target.dna.check_mutation(HULK)) hal_target.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ), forced = "hulk") - else if((hal_target.status_flags & CANKNOCKDOWN) && !hal_target.has_trait(TRAIT_STUNIMMUNE)) + else if((hal_target.status_flags & CANKNOCKDOWN) && !HAS_TRAIT(hal_target, TRAIT_STUNIMMUNE)) addtimer(CALLBACK(hal_target, /mob/living/carbon.proc/do_jitter_animation, 20), 5) /obj/item/projectile/hallucination/disabler diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 92d9da401b..14963a6689 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -37,7 +37,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/on_mob_life(mob/living/carbon/C) if(C.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER) var/booze_power = boozepwr - if(C.has_trait(TRAIT_ALCOHOL_TOLERANCE)) //we're an accomplished drinker + if(HAS_TRAIT(C, TRAIT_ALCOHOL_TOLERANCE)) //we're an accomplished drinker booze_power *= 0.7 C.drunkenness = max((C.drunkenness + (sqrt(volume) * booze_power * ALCOHOL_RATE)), 0) //Volume, power, and server alcohol rate effect how quickly one gets drunk var/obj/item/organ/liver/L = C.getorganslot(ORGAN_SLOT_LIVER) @@ -129,7 +129,7 @@ All effects don't start immediately, but rather get worse over time; the rate is M.dizziness = max(0,M.dizziness-5) M.drowsyness = max(0,M.drowsyness-3) M.AdjustSleeping(-40, FALSE) - if(!M.has_trait(TRAIT_ALCOHOL_TOLERANCE)) + if(!HAS_TRAIT(M, TRAIT_ALCOHOL_TOLERANCE)) M.Jitter(5) ..() . = 1 @@ -165,7 +165,7 @@ All effects don't start immediately, but rather get worse over time; the rate is M.drowsyness = max(0,M.drowsyness-7) M.AdjustSleeping(-40) M.adjust_bodytemperature(-5 * TEMPERATURE_DAMAGE_COEFFICIENT, BODYTEMP_NORMAL) - if(!M.has_trait(TRAIT_ALCOHOL_TOLERANCE)) + if(!HAS_TRAIT(M, TRAIT_ALCOHOL_TOLERANCE)) M.Jitter(5) return ..() @@ -186,7 +186,7 @@ All effects don't start immediately, but rather get worse over time; the rate is to_chat(M, "[pick("You have a really bad headache.", "Your eyes hurt.", "You find it hard to stay still.", "You feel your heart practically beating out of your chest.")]") if(prob(5) && iscarbon(M)) - if(M.has_trait(TRAIT_BLIND)) + if(HAS_TRAIT(M, TRAIT_BLIND)) var/obj/item/organ/eyes/eye = M.getorganslot(ORGAN_SLOT_EYES) if(istype(eye)) eye.Remove(M) @@ -364,7 +364,7 @@ All effects don't start immediately, but rather get worse over time; the rate is shot_glass_icon_state = "shotglassgreen" /datum/reagent/consumable/ethanol/absinthe/on_mob_life(mob/living/carbon/M) - if(prob(10) && !M.has_trait(TRAIT_ALCOHOL_TOLERANCE)) + if(prob(10) && !HAS_TRAIT(M, TRAIT_ALCOHOL_TOLERANCE)) M.hallucination += 4 //Reference to the urban myth ..() @@ -640,7 +640,7 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_desc = "Heavy, hot and strong. Just like the Iron fist of the LAW." /datum/reagent/consumable/ethanol/beepsky_smash/on_mob_life(mob/living/carbon/M) - if(M.has_trait(TRAIT_ALCOHOL_TOLERANCE)) + if(HAS_TRAIT(M, TRAIT_ALCOHOL_TOLERANCE)) M.Stun(30, 0) //this realistically does nothing to prevent chainstunning but will cause them to recover faster once it's out of their system else M.Stun(40, 0) @@ -674,7 +674,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/manly_dorf/on_mob_add(mob/living/M) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.dna.check_mutation(DWARFISM) || H.has_trait(TRAIT_ALCOHOL_TOLERANCE)) + if(H.dna.check_mutation(DWARFISM) || HAS_TRAIT(H, TRAIT_ALCOHOL_TOLERANCE)) to_chat(H, "Now THAT is MANLY!") boozepwr = 5 //We've had worse in the mines dorf_mode = TRUE @@ -1274,7 +1274,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/atomicbomb/on_mob_life(mob/living/carbon/M) M.set_drugginess(50) - if(!M.has_trait(TRAIT_ALCOHOL_TOLERANCE)) + if(!HAS_TRAIT(M, TRAIT_ALCOHOL_TOLERANCE)) M.confused = max(M.confused+2,0) M.Dizzy(10) M.slurring = max(M.slurring,50) diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index 6ec37f3ec4..ac15eb6b01 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -392,10 +392,10 @@ /datum/reagent/consumable/nuka_cola/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_GOTTAGOFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id) /datum/reagent/consumable/nuka_cola/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_GOTTAGOFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id) ..() /datum/reagent/consumable/nuka_cola/on_mob_life(mob/living/carbon/M) diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index a4a2c8e527..102588d98e 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -253,16 +253,16 @@ /datum/reagent/drug/bath_salts/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_STUNIMMUNE, id) - L.add_trait(TRAIT_SLEEPIMMUNE, id) + ADD_TRAIT(L, TRAIT_STUNIMMUNE, id) + ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, id) if(iscarbon(L)) var/mob/living/carbon/C = L rage = new() C.gain_trauma(rage, TRAUMA_RESILIENCE_ABSOLUTE) /datum/reagent/drug/bath_salts/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_STUNIMMUNE, id) - L.remove_trait(TRAIT_SLEEPIMMUNE, id) + REMOVE_TRAIT(L, TRAIT_STUNIMMUNE, id) + REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, id) if(rage) QDEL_NULL(rage) ..() @@ -372,7 +372,7 @@ /datum/reagent/drug/skooma/on_mob_add(mob/living/L) . = ..() - L.add_trait(TRAIT_GOTTAGOFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id) L.next_move_modifier *= 2 if(ishuman(L)) var/mob/living/carbon/human/H = L @@ -383,7 +383,7 @@ /datum/reagent/drug/skooma/on_mob_delete(mob/living/L) . = ..() - L.remove_trait(TRAIT_GOTTAGOFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id) L.next_move_modifier *= 0.5 if(ishuman(L)) var/mob/living/carbon/human/H = L diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index a65a1f4adb..afa469706a 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -22,7 +22,7 @@ /datum/reagent/consumable/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(method == INGEST) - if (quality && !M.has_trait(TRAIT_AGEUSIA)) + if (quality && !HAS_TRAIT(M, TRAIT_AGEUSIA)) switch(quality) if (DRINK_NICE) SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/quality_nice) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 6c9f77c762..276616ff24 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -44,7 +44,7 @@ M.adjustToxLoss(-5, 0, TRUE) M.hallucination = 0 M.setBrainLoss(0) - M.remove_all_traits() + REMOVE_TRAITS_NOT_IN(M, list(SPECIES_TRAIT, ROUNDSTART_TRAIT, ORGAN_TRAIT)) M.set_blurriness(0) M.set_blindness(0) M.SetKnockdown(0, 0) @@ -136,7 +136,7 @@ M.adjustFireLoss(-power, 0) M.adjustToxLoss(-power, 0, TRUE) //heals TOXINLOVERs M.adjustCloneLoss(-power, 0) - M.remove_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) //fixes common causes for disfiguration + REMOVE_TRAIT(M, TRAIT_DISFIGURED, TRAIT_GENERIC) //fixes common causes for disfiguration . = 1 metabolization_rate = REAGENTS_METABOLISM * (0.00001 * (M.bodytemperature ** 2) + 0.5) ..() @@ -152,7 +152,7 @@ /datum/reagent/medicine/clonexadone/on_mob_life(mob/living/carbon/M) if(M.bodytemperature < T0C) M.adjustCloneLoss(0.00006 * (M.bodytemperature ** 2) - 6, 0) - M.remove_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) + REMOVE_TRAIT(M, TRAIT_DISFIGURED, TRAIT_GENERIC) . = 1 metabolization_rate = REAGENTS_METABOLISM * (0.000015 * (M.bodytemperature ** 2) + 0.75) ..() @@ -182,7 +182,7 @@ M.adjustFireLoss(-1.5 * power, 0) M.adjustToxLoss(-power, 0, TRUE) M.adjustCloneLoss(-power, 0) - M.remove_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) + REMOVE_TRAIT(M, TRAIT_DISFIGURED, TRAIT_GENERIC) . = 1 ..() @@ -198,7 +198,7 @@ /datum/reagent/medicine/rezadone/on_mob_life(mob/living/carbon/M) M.setCloneLoss(0) //Rezadone is almost never used in favor of cryoxadone. Hopefully this will change that. M.heal_bodypart_damage(1,1) - M.remove_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) + REMOVE_TRAIT(M, TRAIT_DISFIGURED, TRAIT_GENERIC) ..() . = 1 @@ -702,14 +702,14 @@ var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES) if (!eyes) return - if(M.has_trait(TRAIT_BLIND, EYE_DAMAGE)) + if(HAS_TRAIT_FROM(M, TRAIT_BLIND, EYE_DAMAGE)) if(prob(20)) to_chat(M, "Your vision slowly returns...") M.cure_blind(EYE_DAMAGE) M.cure_nearsighted(EYE_DAMAGE) M.blur_eyes(35) - else if(M.has_trait(TRAIT_NEARSIGHT, EYE_DAMAGE)) + else if(HAS_TRAIT_FROM(M, TRAIT_NEARSIGHT, EYE_DAMAGE)) to_chat(M, "The blackness in your peripheral vision fades.") M.cure_nearsighted(EYE_DAMAGE) M.blur_eyes(10) @@ -800,7 +800,7 @@ M.visible_message("[M]'s body convulses a bit, and then falls still once more.") return M.visible_message("[M]'s body convulses a bit.") - if(!M.suiciding && !(M.has_trait(TRAIT_NOCLONE)) && !M.hellbound) + if(!M.suiciding && !(HAS_TRAIT(M, TRAIT_NOCLONE)) && !M.hellbound) if(!M) return if(M.notify_ghost_cloning(source = M)) @@ -877,10 +877,10 @@ /datum/reagent/medicine/stimulants/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_GOTTAGOFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id) /datum/reagent/medicine/stimulants/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_GOTTAGOFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id) ..() /datum/reagent/medicine/stimulants/on_mob_life(mob/living/carbon/M) @@ -1189,10 +1189,10 @@ /datum/reagent/medicine/changelinghaste/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_GOTTAGOREALLYFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, id) /datum/reagent/medicine/changelinghaste/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_GOTTAGOREALLYFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, id) ..() /datum/reagent/medicine/changelinghaste/on_mob_life(mob/living/carbon/M) @@ -1211,10 +1211,10 @@ /datum/reagent/medicine/corazone/on_mob_add(mob/living/M) ..() - M.add_trait(TRAIT_STABLEHEART, id) + ADD_TRAIT(M, TRAIT_STABLEHEART, id) /datum/reagent/medicine/corazone/on_mob_delete(mob/living/M) - M.remove_trait(TRAIT_STABLEHEART, id) + REMOVE_TRAIT(M, TRAIT_STABLEHEART, id) ..() /datum/reagent/medicine/muscle_stimulant @@ -1242,11 +1242,11 @@ var/overdose_progress = 0 // to track overdose progress /datum/reagent/medicine/modafinil/on_mob_add(mob/living/M) - M.add_trait(TRAIT_SLEEPIMMUNE, id) + ADD_TRAIT(M, TRAIT_SLEEPIMMUNE, id) ..() /datum/reagent/medicine/modafinil/on_mob_delete(mob/living/M) - M.remove_trait(TRAIT_SLEEPIMMUNE, id) + REMOVE_TRAIT(M, TRAIT_SLEEPIMMUNE, id) ..() /datum/reagent/medicine/modafinil/on_mob_life(mob/living/carbon/M) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 5d1593d1e7..40242909de 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -198,10 +198,10 @@ /datum/reagent/water/holywater/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_HOLY, id) + ADD_TRAIT(L, TRAIT_HOLY, id) /datum/reagent/water/holywater/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_HOLY, id) + REMOVE_TRAIT(L, TRAIT_HOLY, id) ..() /datum/reagent/water/holywater/reaction_mob(mob/living/M, method=TOUCH, reac_volume) @@ -1243,12 +1243,12 @@ /datum/reagent/stimulum/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_STUNIMMUNE, id) - L.add_trait(TRAIT_SLEEPIMMUNE, id) + ADD_TRAIT(L, TRAIT_STUNIMMUNE, id) + ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, id) /datum/reagent/stimulum/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_STUNIMMUNE, id) - L.remove_trait(TRAIT_SLEEPIMMUNE, id) + REMOVE_TRAIT(L, TRAIT_STUNIMMUNE, id) + REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, id) ..() /datum/reagent/stimulum/on_mob_life(mob/living/carbon/M) @@ -1268,10 +1268,10 @@ /datum/reagent/nitryl/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_GOTTAGOFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id) /datum/reagent/nitryl/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_GOTTAGOFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id) ..() /////////////////////////Coloured Crayon Powder//////////////////////////// @@ -1779,10 +1779,10 @@ /datum/reagent/pax/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_PACIFISM, id) + ADD_TRAIT(L, TRAIT_PACIFISM, id) /datum/reagent/pax/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_PACIFISM, id) + REMOVE_TRAIT(L, TRAIT_PACIFISM, id) ..() /datum/reagent/bz_metabolites @@ -1795,11 +1795,11 @@ /datum/reagent/bz_metabolites/on_mob_add(mob/living/L) ..() - L.add_trait(CHANGELING_HIVEMIND_MUTE, id) + ADD_TRAIT(L, CHANGELING_HIVEMIND_MUTE, id) /datum/reagent/bz_metabolites/on_mob_delete(mob/living/L) ..() - L.remove_trait(CHANGELING_HIVEMIND_MUTE, id) + REMOVE_TRAIT(L, CHANGELING_HIVEMIND_MUTE, id) /datum/reagent/bz_metabolites/on_mob_life(mob/living/L) if(L.mind) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index edf12a3413..8be95efb83 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -97,7 +97,7 @@ /datum/reagent/toxin/lexorin/on_mob_life(mob/living/carbon/C) . = TRUE - if(C.has_trait(TRAIT_NOBREATH)) + if(HAS_TRAIT(C, TRAIT_NOBREATH)) . = FALSE if(.) @@ -135,7 +135,7 @@ taste_description = "mint" /datum/reagent/toxin/minttoxin/on_mob_life(mob/living/carbon/M) - if(M.has_trait(TRAIT_FAT)) + if(HAS_TRAIT(M, TRAIT_FAT)) M.gib() return ..() @@ -180,10 +180,10 @@ /datum/reagent/toxin/ghoulpowder/on_mob_add(mob/living/L) ..() - L.add_trait(TRAIT_FAKEDEATH, id) + ADD_TRAIT(L, TRAIT_FAKEDEATH, id) /datum/reagent/toxin/ghoulpowder/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_FAKEDEATH, id) + REMOVE_TRAIT(L, TRAIT_FAKEDEATH, id) ..() /datum/reagent/toxin/ghoulpowder/on_mob_life(mob/living/carbon/M) @@ -883,7 +883,7 @@ taste_description = "stillness" /datum/reagent/toxin/mimesbane/on_mob_add(mob/living/L) - L.add_trait(TRAIT_EMOTEMUTE, id) + ADD_TRAIT(L, TRAIT_EMOTEMUTE, id) /datum/reagent/toxin/mimesbane/on_mob_delete(mob/living/L) - L.remove_trait(TRAIT_EMOTEMUTE, id) + REMOVE_TRAIT(L, TRAIT_EMOTEMUTE, id) diff --git a/code/modules/research/nanites/nanite_programs/buffing.dm b/code/modules/research/nanites/nanite_programs/buffing.dm index 578e7731bb..c80c5c5d96 100644 --- a/code/modules/research/nanites/nanite_programs/buffing.dm +++ b/code/modules/research/nanites/nanite_programs/buffing.dm @@ -106,11 +106,11 @@ /datum/nanite_program/conductive/enable_passive_effect() . = ..() - host_mob.add_trait(TRAIT_SHOCKIMMUNE, "nanites") + ADD_TRAIT(host_mob, TRAIT_SHOCKIMMUNE, "nanites") /datum/nanite_program/conductive/disable_passive_effect() . = ..() - host_mob.remove_trait(TRAIT_SHOCKIMMUNE, "nanites") + REMOVE_TRAIT(host_mob, TRAIT_SHOCKIMMUNE, "nanites") /datum/nanite_program/mindshield name = "Mental Barrier" @@ -121,10 +121,10 @@ /datum/nanite_program/mindshield/enable_passive_effect() . = ..() if(!host_mob.mind.has_antag_datum(/datum/antagonist/rev)) //won't work if on a rev, to avoid having implanted revs - host_mob.add_trait(TRAIT_MINDSHIELD, "nanites") + ADD_TRAIT(host_mob, TRAIT_MINDSHIELD, "nanites") host_mob.sec_hud_set_implants() /datum/nanite_program/mindshield/disable_passive_effect() . = ..() - host_mob.remove_trait(TRAIT_MINDSHIELD, "nanites") + REMOVE_TRAIT(host_mob, TRAIT_MINDSHIELD, "nanites") host_mob.sec_hud_set_implants() \ No newline at end of file diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index df32a5d127..ab314cb33c 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -215,7 +215,7 @@ if(!iscarbon(host_mob)) //nonstandard biology return FALSE var/mob/living/carbon/C = host_mob - if(C.suiciding || C.has_trait(TRAIT_NOCLONE) || C.hellbound) //can't revive + if(C.suiciding || HAS_TRAIT(C, TRAIT_NOCLONE) || C.hellbound) //can't revive return FALSE if((world.time - C.timeofdeath) > 1800) //too late return FALSE diff --git a/code/modules/research/nanites/nanite_programs/suppression.dm b/code/modules/research/nanites/nanite_programs/suppression.dm index 3d89baba68..a6225fd337 100644 --- a/code/modules/research/nanites/nanite_programs/suppression.dm +++ b/code/modules/research/nanites/nanite_programs/suppression.dm @@ -65,11 +65,11 @@ /datum/nanite_program/pacifying/enable_passive_effect() . = ..() - host_mob.add_trait(TRAIT_PACIFISM, "nanites") + ADD_TRAIT(host_mob, TRAIT_PACIFISM, "nanites") /datum/nanite_program/pacifying/disable_passive_effect() . = ..() - host_mob.remove_trait(TRAIT_PACIFISM, "nanites") + REMOVE_TRAIT(host_mob, TRAIT_PACIFISM, "nanites") /datum/nanite_program/blinding name = "Blindness" @@ -93,11 +93,11 @@ /datum/nanite_program/mute/enable_passive_effect() . = ..() - host_mob.add_trait(TRAIT_MUTE, "nanites") + ADD_TRAIT(host_mob, TRAIT_MUTE, "nanites") /datum/nanite_program/mute/disable_passive_effect() . = ..() - host_mob.remove_trait(TRAIT_MUTE, "nanites") + REMOVE_TRAIT(host_mob, TRAIT_MUTE, "nanites") /datum/nanite_program/fake_death name = "Death Simulation" diff --git a/code/modules/research/xenobiology/crossbreeding/_clothing.dm b/code/modules/research/xenobiology/crossbreeding/_clothing.dm index 016fd95899..b8bdffbabf 100644 --- a/code/modules/research/xenobiology/crossbreeding/_clothing.dm +++ b/code/modules/research/xenobiology/crossbreeding/_clothing.dm @@ -20,14 +20,14 @@ Slimecrossing Armor /obj/item/clothing/mask/nobreath/equipped(mob/living/carbon/human/user, slot) . = ..() if(slot == SLOT_WEAR_MASK) - user.add_trait(TRAIT_NOBREATH, "breathmask_[REF(src)]") + ADD_TRAIT(user, TRAIT_NOBREATH, "breathmask_[REF(src)]") user.failed_last_breath = FALSE user.clear_alert("not_enough_oxy") user.apply_status_effect(/datum/status_effect/rebreathing) /obj/item/clothing/mask/nobreath/dropped(mob/living/carbon/human/user) ..() - user.remove_trait(TRAIT_NOBREATH, "breathmask_[REF(src)]") + REMOVE_TRAIT(user, TRAIT_NOBREATH, "breathmask_[REF(src)]") user.remove_status_effect(/datum/status_effect/rebreathing) /obj/item/clothing/glasses/prism_glasses @@ -112,11 +112,11 @@ Slimecrossing Armor /obj/item/clothing/head/peaceflower/equipped(mob/living/carbon/human/user, slot) . = ..() if(slot == SLOT_HEAD) - user.add_trait(TRAIT_PACIFISM, "peaceflower_[REF(src)]") + ADD_TRAIT(user, TRAIT_PACIFISM, "peaceflower_[REF(src)]") /obj/item/clothing/head/peaceflower/dropped(mob/living/carbon/human/user) ..() - user.remove_trait(TRAIT_PACIFISM, "peaceflower_[REF(src)]") + REMOVE_TRAIT(user, TRAIT_PACIFISM, "peaceflower_[REF(src)]") /obj/item/clothing/head/peaceflower/attack_hand(mob/user) if(iscarbon(user)) diff --git a/code/modules/research/xenobiology/crossbreeding/_misc.dm b/code/modules/research/xenobiology/crossbreeding/_misc.dm index 0784946a37..b28f1676a1 100644 --- a/code/modules/research/xenobiology/crossbreeding/_misc.dm +++ b/code/modules/research/xenobiology/crossbreeding/_misc.dm @@ -56,7 +56,7 @@ if(last_check_time + 50 < world.time) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.mind && !H.has_trait(TRAIT_AGEUSIA)) + if(H.mind && !HAS_TRAIT(H, TRAIT_AGEUSIA)) to_chat(H,"That didn't taste very good...") //No disgust, though. It's just not good tasting. GET_COMPONENT_FROM(mood, /datum/component/mood, H) if(mood) diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index 20d879cd77..ad5bfa27dc 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -11,7 +11,7 @@ /datum/status_effect/rainbow_protection/on_apply() owner.status_flags |= GODMODE - owner.add_trait(TRAIT_PACIFISM, "slimestatus") + ADD_TRAIT(owner, TRAIT_PACIFISM, "slimestatus") owner.visible_message("[owner] shines with a brilliant rainbow light.", "You feel protected by an unknown force!") originalcolor = owner.color @@ -24,7 +24,7 @@ /datum/status_effect/rainbow_protection/on_remove() owner.status_flags &= ~GODMODE owner.color = originalcolor - owner.remove_trait(TRAIT_PACIFISM, "slimestatus") + REMOVE_TRAIT(owner, TRAIT_PACIFISM, "slimestatus") owner.visible_message("[owner] stops glowing, the rainbow light fading away.", "You no longer feel protected...") @@ -246,12 +246,12 @@ datum/status_effect/rebreathing/tick() duration = 100 /datum/status_effect/firecookie/on_apply() - owner.add_trait(TRAIT_RESISTCOLD,"firecookie") + ADD_TRAIT(owner, TRAIT_RESISTCOLD,"firecookie") owner.adjust_bodytemperature(110) return ..() /datum/status_effect/firecookie/on_remove() - owner.remove_trait(TRAIT_RESISTCOLD,"firecookie") + REMOVE_TRAIT(owner, TRAIT_RESISTCOLD,"firecookie") /datum/status_effect/watercookie id = "watercookie" @@ -260,7 +260,7 @@ datum/status_effect/rebreathing/tick() duration = 100 /datum/status_effect/watercookie/on_apply() - owner.add_trait(TRAIT_NOSLIPWATER,"watercookie") + ADD_TRAIT(owner, TRAIT_NOSLIPWATER,"watercookie") return ..() /datum/status_effect/watercookie/tick() @@ -268,7 +268,7 @@ datum/status_effect/rebreathing/tick() T.MakeSlippery(TURF_WET_WATER, min_wet_time = 10, wet_time_to_add = 5) /datum/status_effect/watercookie/on_remove() - owner.remove_trait(TRAIT_NOSLIPWATER,"watercookie") + REMOVE_TRAIT(owner, TRAIT_NOSLIPWATER,"watercookie") /datum/status_effect/metalcookie id = "metalcookie" @@ -313,11 +313,11 @@ datum/status_effect/rebreathing/tick() duration = 600 /datum/status_effect/toxincookie/on_apply() - owner.add_trait(TRAIT_TOXINLOVER,"toxincookie") + ADD_TRAIT(owner, TRAIT_TOXINLOVER,"toxincookie") return ..() /datum/status_effect/toxincookie/on_remove() - owner.remove_trait(TRAIT_TOXINLOVER,"toxincookie") + REMOVE_TRAIT(owner, TRAIT_TOXINLOVER,"toxincookie") /datum/status_effect/timecookie id = "timecookie" @@ -417,11 +417,11 @@ datum/status_effect/rebreathing/tick() duration = 30 /datum/status_effect/plur/on_apply() - owner.add_trait(TRAIT_PACIFISM, "peacecookie") + ADD_TRAIT(owner, TRAIT_PACIFISM, "peacecookie") return ..() /datum/status_effect/plur/on_remove() - owner.remove_trait(TRAIT_PACIFISM, "peacecookie") + REMOVE_TRAIT(owner, TRAIT_PACIFISM, "peacecookie") /datum/status_effect/adamantinecookie id = "adamantinecookie" @@ -515,11 +515,11 @@ datum/status_effect/rebreathing/tick() colour = "blue" /datum/status_effect/stabilized/blue/on_apply() - owner.add_trait(TRAIT_NOSLIPWATER, "slimestatus") + ADD_TRAIT(owner, TRAIT_NOSLIPWATER, "slimestatus") return ..() datum/status_effect/stabilized/blue/on_remove() - owner.remove_trait(TRAIT_NOSLIPWATER, "slimestatus") + REMOVE_TRAIT(owner, TRAIT_NOSLIPWATER, "slimestatus") /datum/status_effect/stabilized/metal id = "stabilizedmetal" @@ -580,7 +580,7 @@ datum/status_effect/stabilized/blue/on_remove() examine_text = "Their fingertips burn brightly!" /datum/status_effect/stabilized/darkpurple/on_apply() - owner.add_trait(TRAIT_RESISTHEATHANDS, "slimestatus") + ADD_TRAIT(owner, TRAIT_RESISTHEATHANDS, "slimestatus") fire = new(owner) return ..() @@ -596,7 +596,7 @@ datum/status_effect/stabilized/blue/on_remove() return ..() /datum/status_effect/stabilized/darkpurple/on_remove() - owner.remove_trait(TRAIT_RESISTHEATHANDS, "slimestatus") + REMOVE_TRAIT(owner, TRAIT_RESISTHEATHANDS, "slimestatus") qdel(fire) /datum/status_effect/stabilized/darkblue @@ -916,7 +916,7 @@ datum/status_effect/stabilized/blue/on_remove() colour = "light pink" /datum/status_effect/stabilized/lightpink/on_apply() - owner.add_trait(TRAIT_GOTTAGOFAST,"slimestatus") + ADD_TRAIT(owner, TRAIT_GOTTAGOFAST,"slimestatus") return ..() /datum/status_effect/stabilized/lightpink/tick() @@ -927,7 +927,7 @@ datum/status_effect/stabilized/blue/on_remove() return ..() /datum/status_effect/stabilized/lightpink/on_remove() - owner.remove_trait(TRAIT_GOTTAGOFAST,"slimestatus") + REMOVE_TRAIT(owner, TRAIT_GOTTAGOFAST,"slimestatus") /datum/status_effect/stabilized/adamantine id = "stabilizedadamantine" diff --git a/code/modules/research/xenobiology/crossbreeding/charged.dm b/code/modules/research/xenobiology/crossbreeding/charged.dm index b664380d9e..f3aaa62623 100644 --- a/code/modules/research/xenobiology/crossbreeding/charged.dm +++ b/code/modules/research/xenobiology/crossbreeding/charged.dm @@ -427,7 +427,7 @@ Charged extracts: else to_chat(user, "You drink the pacification potion!") if(isanimal(M)) - M.add_trait(TRAIT_PACIFISM, MAGIC_TRAIT) + ADD_TRAIT(M, TRAIT_PACIFISM, MAGIC_TRAIT) else if(iscarbon(M)) var/mob/living/carbon/C = M C.gain_trauma(/datum/brain_trauma/severe/pacifism, TRAUMA_RESILIENCE_SURGERY) diff --git a/code/modules/spells/spell_types/genetic.dm b/code/modules/spells/spell_types/genetic.dm index 37fca86f46..02d3c087f6 100644 --- a/code/modules/spells/spell_types/genetic.dm +++ b/code/modules/spells/spell_types/genetic.dm @@ -26,7 +26,7 @@ for(var/A in mutations) target.dna.add_mutation(A) for(var/A in traits) - target.add_trait(A, GENETICS_SPELL) + ADD_TRAIT(target, A, GENETICS_SPELL) active_on += target addtimer(CALLBACK(src, .proc/remove, target), duration) @@ -41,4 +41,4 @@ for(var/A in mutations) target.dna.remove_mutation(A) for(var/A in traits) - target.remove_trait(A, GENETICS_SPELL) \ No newline at end of file + REMOVE_TRAIT(target, A, GENETICS_SPELL) \ No newline at end of file diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index 7f291be674..3073a6fcc3 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -258,25 +258,25 @@ var/obj/item/organ/lungs/L = H.internal_organs_slot[ORGAN_SLOT_LUNGS] L.tox_breath_dam_min = 0 L.tox_breath_dam_max = 0 - H.add_trait(TRAIT_VIRUSIMMUNE, "dna_vault") + ADD_TRAIT(H, TRAIT_VIRUSIMMUNE, "dna_vault") if(VAULT_NOBREATH) to_chat(H, "Your lungs feel great.") - H.add_trait(TRAIT_NOBREATH, "dna_vault") + ADD_TRAIT(H, TRAIT_NOBREATH, "dna_vault") if(VAULT_FIREPROOF) to_chat(H, "You feel fireproof.") S.burnmod = 0.5 - H.add_trait(TRAIT_RESISTHEAT, "dna_vault") - H.add_trait(TRAIT_NOFIRE, "dna_vault") + ADD_TRAIT(H, TRAIT_RESISTHEAT, "dna_vault") + ADD_TRAIT(H, TRAIT_NOFIRE, "dna_vault") if(VAULT_STUNTIME) to_chat(H, "Nothing can keep you down for long.") S.stunmod = 0.5 if(VAULT_ARMOUR) to_chat(H, "You feel tough.") S.armor = 30 - H.add_trait(TRAIT_PIERCEIMMUNE, "dna_vault") + ADD_TRAIT(H, TRAIT_PIERCEIMMUNE, "dna_vault") if(VAULT_SPEED) to_chat(H, "Your legs feel faster.") - H.add_trait(TRAIT_GOTTAGOFAST, "dna_vault") + ADD_TRAIT(H, TRAIT_GOTTAGOFAST, "dna_vault") if(VAULT_QUICK) to_chat(H, "Your arms move as fast as lightning.") H.next_move_modifier = 0.5 diff --git a/code/modules/surgery/advanced/brainwashing.dm b/code/modules/surgery/advanced/brainwashing.dm index f4db9ddbee..23783f1bf2 100644 --- a/code/modules/surgery/advanced/brainwashing.dm +++ b/code/modules/surgery/advanced/brainwashing.dm @@ -41,7 +41,7 @@ if(!target.mind) user.visible_message("[target] doesn't respond to the brainwashing, as if [target.p_they()] lacked a mind...") return FALSE - if(target.has_trait(TRAIT_MINDSHIELD)) + if(HAS_TRAIT(target, TRAIT_MINDSHIELD)) user.visible_message("You hear a faint buzzing from a device inside [target]'s brain, and the brainwashing is erased.") return FALSE user.visible_message("[user] successfully brainwashes [target]!", "You succeed in brainwashing [target].") diff --git a/code/modules/surgery/advanced/revival.dm b/code/modules/surgery/advanced/revival.dm index 0cd7a64235..ebda8a04e2 100644 --- a/code/modules/surgery/advanced/revival.dm +++ b/code/modules/surgery/advanced/revival.dm @@ -18,7 +18,7 @@ return FALSE if(target.stat != DEAD) return FALSE - if(target.suiciding || target.has_trait(TRAIT_NOCLONE) || target.hellbound) + if(target.suiciding || HAS_TRAIT(target, TRAIT_NOCLONE) || target.hellbound) return FALSE var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) if(!B) diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index 230347fae5..9204de3d08 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -88,7 +88,7 @@ /obj/item/bodypart/attack(mob/living/carbon/C, mob/user) if(ishuman(C)) var/mob/living/carbon/human/H = C - if(C.has_trait(TRAIT_LIMBATTACHMENT)) + if(HAS_TRAIT(C, TRAIT_LIMBATTACHMENT)) if(!H.get_bodypart(body_zone) && !animal_origin) if(H == user) H.visible_message("[H] jams [src] into [H.p_their()] empty socket!",\ @@ -221,7 +221,7 @@ //Checks disabled status thresholds /obj/item/bodypart/proc/check_disabled() - if(!can_dismember() || owner.has_trait(TRAIT_NODISMEMBER)) + if(!can_dismember() || HAS_TRAIT(owner, TRAIT_NODISMEMBER)) return if(!disabled && (get_damage(TRUE) >= max_damage)) set_disabled(TRUE) @@ -284,7 +284,7 @@ C = owner no_update = FALSE - if(C.has_trait(TRAIT_HUSK) && is_organic_limb()) + if(HAS_TRAIT(C, TRAIT_HUSK) && is_organic_limb()) species_id = "husk" //overrides species_id dmg_overlay_type = "" //no damage overlay shown when husked should_draw_gender = FALSE diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 1a46a9dcb1..9341fb6c25 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -12,7 +12,7 @@ return FALSE if(C.status_flags & GODMODE) return FALSE - if(C.has_trait(TRAIT_NODISMEMBER)) + if(HAS_TRAIT(C, TRAIT_NODISMEMBER)) return FALSE var/obj/item/bodypart/affecting = C.get_bodypart(BODY_ZONE_CHEST) @@ -47,7 +47,7 @@ var/mob/living/carbon/C = owner if(!dismemberable) return FALSE - if(C.has_trait(TRAIT_NODISMEMBER)) + if(HAS_TRAIT(C, TRAIT_NODISMEMBER)) return FALSE . = list() var/organ_spilled = 0 diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm index 1f0fa00632..46ee10a3fd 100644 --- a/code/modules/surgery/bodyparts/head.dm +++ b/code/modules/surgery/bodyparts/head.dm @@ -68,7 +68,7 @@ C = owner real_name = C.real_name - if(C.has_trait(TRAIT_HUSK)) + if(HAS_TRAIT(C, TRAIT_HUSK)) real_name = "Unknown" hair_style = "Bald" facial_hair_style = "Shaved" diff --git a/code/modules/surgery/lipoplasty.dm b/code/modules/surgery/lipoplasty.dm index 7bc7553023..9967eba663 100644 --- a/code/modules/surgery/lipoplasty.dm +++ b/code/modules/surgery/lipoplasty.dm @@ -4,7 +4,7 @@ possible_locs = list(BODY_ZONE_CHEST) /datum/surgery/lipoplasty/can_start(mob/user, mob/living/carbon/target) - if(target.has_trait(TRAIT_FAT)) + if(HAS_TRAIT(target, TRAIT_FAT)) return 1 return 0 diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index c54d3bb532..b0a2f38c46 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -25,7 +25,7 @@ return var/mob/living/carbon/C = owner // genetic deafness prevents the body from using the ears, even if healthy - if(C.has_trait(TRAIT_DEAF)) + if(HAS_TRAIT(C, TRAIT_DEAF)) deaf = max(deaf, 1) else if(ear_damage < UNHEALING_EAR_DAMAGE) // if higher than UNHEALING_EAR_DAMAGE, no natural healing occurs. ear_damage = max(ear_damage - 0.05, 0) @@ -37,7 +37,7 @@ var/mob/living/carbon/C = owner - if(iscarbon(owner) && C.has_trait(TRAIT_DEAF)) + if(iscarbon(owner) && HAS_TRAIT(C, TRAIT_DEAF)) deaf = 1 /obj/item/organ/ears/proc/adjustEarDamage(ddmg, ddeaf) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 9f42cf0baa..98abb2528a 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -26,7 +26,7 @@ HMN.regenerate_icons() else eye_color = HMN.eye_color - if(HMN.has_trait(TRAIT_NIGHT_VISION) && !lighting_alpha) + if(HAS_TRAIT(HMN, TRAIT_NIGHT_VISION) && !lighting_alpha) lighting_alpha = LIGHTING_PLANE_ALPHA_NV_TRAIT see_in_dark = 8 M.update_tint() diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm index ee767566e6..f666fc209b 100755 --- a/code/modules/surgery/organs/liver.dm +++ b/code/modules/surgery/organs/liver.dm @@ -25,7 +25,7 @@ //slowly heal liver damage damage = max(0, damage - 0.1) - if(filterToxins && !owner.has_trait(TRAIT_TOXINLOVER)) + if(filterToxins && !HAS_TRAIT(owner, TRAIT_TOXINLOVER)) //handle liver toxin filtration for(var/I in C.reagents.reagent_list) var/datum/reagent/pickedreagent = I diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 1e22796b1b..a15ef51dda 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -58,7 +58,7 @@ /obj/item/organ/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H) if((H.status_flags & GODMODE)) return - if(H.has_trait(TRAIT_NOBREATH)) + if(HAS_TRAIT(H, TRAIT_NOBREATH)) return if(!breath || (breath.total_moles() == 0)) @@ -66,7 +66,7 @@ return if(H.health >= H.crit_threshold) H.adjustOxyLoss(HUMAN_MAX_OXYLOSS) - else if(!H.has_trait(TRAIT_NOCRITDAMAGE)) + else if(!HAS_TRAIT(H, TRAIT_NOCRITDAMAGE)) H.adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS) H.failed_last_breath = TRUE @@ -365,7 +365,7 @@ /obj/item/organ/lungs/proc/handle_breath_temperature(datum/gas_mixture/breath, mob/living/carbon/human/H) // called by human/life, handles temperatures var/breath_temperature = breath.temperature - if(!H.has_trait(TRAIT_RESISTCOLD)) // COLD DAMAGE + if(!HAS_TRAIT(H, TRAIT_RESISTCOLD)) // COLD DAMAGE var/cold_modifier = H.dna.species.coldmod if(breath_temperature < cold_level_3_threshold) H.apply_damage_type(cold_level_3_damage*cold_modifier, cold_damage_type) @@ -377,7 +377,7 @@ if(prob(20)) to_chat(H, "You feel [cold_message] in your [name]!") - if(!H.has_trait(TRAIT_RESISTHEAT)) // HEAT DAMAGE + if(!HAS_TRAIT(H, TRAIT_RESISTHEAT)) // HEAT DAMAGE var/heat_modifier = H.dna.species.heatmod if(breath_temperature > heat_level_1_threshold && breath_temperature < heat_level_2_threshold) H.apply_damage_type(heat_level_1_damage*heat_modifier, heat_damage_type) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 1408bff60c..b16967b6b0 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -110,7 +110,7 @@ var/breathes = TRUE var/blooded = TRUE if(dna && dna.species) - if(has_trait(TRAIT_NOBREATH, SPECIES_TRAIT)) + if(HAS_TRAIT_FROM(src, TRAIT_NOBREATH, SPECIES_TRAIT)) breathes = FALSE if(NOBLOOD in dna.species.species_traits) blooded = FALSE diff --git a/code/modules/surgery/plastic_surgery.dm b/code/modules/surgery/plastic_surgery.dm index 3a3dd6a1dd..54482ade73 100644 --- a/code/modules/surgery/plastic_surgery.dm +++ b/code/modules/surgery/plastic_surgery.dm @@ -13,8 +13,8 @@ user.visible_message("[user] begins to alter [target]'s appearance.", "You begin to alter [target]'s appearance...") /datum/surgery_step/reshape_face/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(target.has_trait(TRAIT_DISFIGURED, TRAIT_GENERIC)) - target.remove_trait(TRAIT_DISFIGURED, TRAIT_GENERIC) + if(HAS_TRAIT_FROM(target, TRAIT_DISFIGURED, TRAIT_GENERIC)) + REMOVE_TRAIT(target, TRAIT_DISFIGURED, TRAIT_GENERIC) user.visible_message("[user] successfully restores [target]'s appearance!", "You successfully restore [target]'s appearance.") else var/list/names = list() diff --git a/modular_citadel/code/game/gamemodes/gangs/gang_pen.dm b/modular_citadel/code/game/gamemodes/gangs/gang_pen.dm index 3dfdf4dd9b..0851f3b596 100644 --- a/modular_citadel/code/game/gamemodes/gangs/gang_pen.dm +++ b/modular_citadel/code/game/gamemodes/gangs/gang_pen.dm @@ -49,7 +49,7 @@ return to_chat(user, "This mind is already controlled by someone else!") return - if(check && gangster_mind.current.has_trait(TRAIT_MINDSHIELD)) //Check to see if the potential gangster is implanted + if(check && HAS_TRAIT(gangster_mind.current, TRAIT_MINDSHIELD)) //Check to see if the potential gangster is implanted to_chat(user, "This mind is too strong to control!") return var/mob/living/carbon/human/H = gangster_mind.current // we are sure the dude's human cause it's checked in attack() diff --git a/modular_citadel/code/game/objects/items/melee/eutactic_blades.dm b/modular_citadel/code/game/objects/items/melee/eutactic_blades.dm index e6ba224f8d..ce6aada0fc 100644 --- a/modular_citadel/code/game/objects/items/melee/eutactic_blades.dm +++ b/modular_citadel/code/game/objects/items/melee/eutactic_blades.dm @@ -367,7 +367,7 @@ unwield() return ..() - if(user.has_trait(TRAIT_CLUMSY) && (wielded) && prob(40)) + if(HAS_TRAIT(user, TRAIT_CLUMSY) && (wielded) && prob(40)) impale(user) return diff --git a/modular_citadel/code/game/objects/items/melee/misc.dm b/modular_citadel/code/game/objects/items/melee/misc.dm index 82ede048a8..6a53adcc1f 100644 --- a/modular_citadel/code/game/objects/items/melee/misc.dm +++ b/modular_citadel/code/game/objects/items/melee/misc.dm @@ -16,7 +16,7 @@ return //CIT CHANGE - ditto add_fingerprint(user) - if((user.has_trait(TRAIT_CLUMSY)) && prob(50)) + if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50)) to_chat(user, "You club yourself over the head.") user.Knockdown(60 * force) if(ishuman(user)) diff --git a/modular_citadel/code/modules/arousal/organs/genitals.dm b/modular_citadel/code/modules/arousal/organs/genitals.dm index cbf14e420a..52508d7803 100644 --- a/modular_citadel/code/modules/arousal/organs/genitals.dm +++ b/modular_citadel/code/modules/arousal/organs/genitals.dm @@ -286,7 +286,7 @@ return if(NOGENITALS in species_traits)//golems and such return - if(H.has_trait(TRAIT_HUSK)) + if(HAS_TRAIT(H, TRAIT_HUSK)) return var/list/genitals_to_add = list() diff --git a/modular_citadel/code/modules/mob/living/status_procs.dm b/modular_citadel/code/modules/mob/living/status_procs.dm index f646af3286..851c7438a7 100644 --- a/modular_citadel/code/modules/mob/living/status_procs.dm +++ b/modular_citadel/code/modules/mob/living/status_procs.dm @@ -1,5 +1,5 @@ /mob/living/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg) //Can't go below remaining duration - if(((status_flags & CANKNOCKDOWN) && !has_trait(TRAIT_STUNIMMUNE)) || ignore_canknockdown) + if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canknockdown) if(absorb_stun(isnull(override_hardstun)? amount : override_hardstun, ignore_canknockdown)) return var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() diff --git a/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm b/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm index 3da35d9c6d..2a6f03fae3 100644 --- a/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm +++ b/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm @@ -97,7 +97,7 @@ color = "#FFADFF"//PINK, rgb(255, 173, 255) /datum/reagent/drug/aphrodisiac/on_mob_life(mob/living/M) - if(M && M.canbearoused && !M.has_trait(TRAIT_CROCRIN_IMMUNE)) + if(M && M.canbearoused && !HAS_TRAIT(M, TRAIT_CROCRIN_IMMUNE)) if(prob(33)) M.adjustArousalLoss(2) if(prob(5)) @@ -119,7 +119,7 @@ overdose_threshold = 20 /datum/reagent/drug/aphrodisiacplus/on_mob_life(mob/living/M) - if(M && M.canbearoused && !M.has_trait(TRAIT_CROCRIN_IMMUNE)) + if(M && M.canbearoused && !HAS_TRAIT(M, TRAIT_CROCRIN_IMMUNE)) if(prob(33)) M.adjustArousalLoss(6)//not quite six times as powerful, but still considerably more powerful. if(prob(5)) @@ -151,7 +151,7 @@ ..() /datum/reagent/drug/aphrodisiacplus/overdose_process(mob/living/M) - if(M && M.canbearoused && !M.has_trait(TRAIT_CROCRIN_IMMUNE) && prob(33)) + if(M && M.canbearoused && !HAS_TRAIT(M, TRAIT_CROCRIN_IMMUNE) && prob(33)) if(M.getArousalLoss() >= 100 && ishuman(M) && M.has_dna()) var/mob/living/carbon/human/H = M if(prob(50)) //Less spam