Turns trait accessors into defines, fixes some bugs (#43820)

It's free performance.
This commit is contained in:
vuonojenmustaturska
2019-05-07 02:44:05 +03:00
committed by Emmett Gaines
parent af552d9be5
commit fb45b7a017
273 changed files with 871 additions and 893 deletions

View File

@@ -1,3 +1,63 @@
// trait accessor defines
#define ADD_TRAIT(target, trait, source) \
do { \
var/list/_L; \
if (!target.status_traits) { \
target.status_traits = list(); \
_L = target.status_traits; \
_L[trait] = list(source); \
} else { \
_L = target.status_traits; \
if (_L[trait]) { \
_L[trait] |= list(source); \
} else { \
_L[trait] = list(source); \
} \
} \
} while (0)
#define REMOVE_TRAIT(target, trait, sources) \
do { \
var/list/_L = target.status_traits; \
var/list/_S; \
if (sources && !islist(sources)) { \
_S = list(sources); \
} else { \
_S = sources\
}; \
if (_L && _L[trait]) { \
for (var/_T in _L[trait]) { \
if ((!_S && (_T != ROUNDSTART_TRAIT)) || (_T in _S)) { \
_L[trait] -= _T \
} \
};\
if (!length(_L[trait])) { \
_L -= trait \
}; \
if (!length(_L)) { \
target.status_traits = null \
}; \
} \
} while (0)
#define REMOVE_TRAITS_NOT_IN(target, sources) \
do { \
var/list/_L = target.status_traits; \
var/list/_S = sources; \
if (_L) { \
for (var/_T in _L) { \
_L[_T] &= _S;\
if (!length(_L[_T])) { \
_L -= _T } \
};\
if (!length(_L)) { \
target.status_traits = null\
};\
}\
} while (0)
#define HAS_TRAIT(target, trait) (target.status_traits ? (target.status_traits[trait] ? TRUE : FALSE) : FALSE)
#define HAS_TRAIT_FROM(target, trait, source) (target.status_traits ? (target.status_traits[trait] ? (source in target.status_traits[trait]) : FALSE) : FALSE)
//mob traits
#define TRAIT_BLIND "blind"
#define TRAIT_MUTE "mute"

View File

@@ -415,7 +415,7 @@ GLOBAL_LIST_EMPTY(species_list)
var/override = FALSE
if(M.client && M.client.holder && (prefs.chat_toggles & CHAT_DEAD))
override = TRUE
if(M.has_trait(TRAIT_SIXTHSENSE))
if(HAS_TRAIT(M, TRAIT_SIXTHSENSE))
override = TRUE
if(isnewplayer(M) && !override)
continue

View File

@@ -60,7 +60,7 @@
if(item_flags & NOBLUDGEON)
return
if(force && user.has_trait(TRAIT_PACIFISM))
if(force && HAS_TRAIT(user, TRAIT_PACIFISM))
to_chat(user, "<span class='warning'>You don't want to harm other living beings!</span>")
return

View File

@@ -53,11 +53,11 @@
lose_text = "<span class='notice'>You realize that magic might be real.</span>"
/datum/brain_trauma/magic/antimagic/on_gain()
owner.add_trait(TRAIT_ANTIMAGIC, TRAUMA_TRAIT)
ADD_TRAIT(owner, TRAIT_ANTIMAGIC, TRAUMA_TRAIT)
..()
/datum/brain_trauma/magic/antimagic/on_lose()
owner.remove_trait(TRAIT_ANTIMAGIC, TRAUMA_TRAIT)
REMOVE_TRAIT(owner, TRAIT_ANTIMAGIC, TRAUMA_TRAIT)
..()
/datum/brain_trauma/magic/stalker
@@ -112,4 +112,4 @@
name = "???"
desc = "It's coming closer..."
image_icon = 'icons/mob/lavaland/lavaland_monsters.dmi'
image_state = "curseblob"
image_state = "curseblob"

View File

@@ -42,7 +42,7 @@
lose_text = "<span class='notice'>You feel smart again.</span>"
/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")
..()
@@ -68,11 +68,11 @@
lose_text = "<span class='danger'>Your mind feels more clear.</span>"
/datum/brain_trauma/mild/speech_impediment/on_gain()
owner.add_trait(TRAIT_UNINTELLIGIBLE_SPEECH, TRAUMA_TRAIT)
ADD_TRAIT(owner, TRAIT_UNINTELLIGIBLE_SPEECH, TRAUMA_TRAIT)
..()
/datum/brain_trauma/mild/speech_impediment/on_lose()
owner.remove_trait(TRAIT_UNINTELLIGIBLE_SPEECH, TRAUMA_TRAIT)
REMOVE_TRAIT(owner, TRAIT_UNINTELLIGIBLE_SPEECH, TRAUMA_TRAIT)
..()
/datum/brain_trauma/mild/concussion
@@ -173,7 +173,7 @@
lose_text = "<span class='notice'>Your throat stops itching.</span>"
/datum/brain_trauma/mild/nervous_cough/on_life()
if(prob(12) && !owner.has_trait(TRAIT_SOOTHED_THROAT))
if(prob(12) && !HAS_TRAIT(owner, TRAIT_SOOTHED_THROAT))
if(prob(5))
to_chat(owner, "<span notice='warning'>[pick("You have a coughing fit!", "You can't stop coughing!")]</span>")
owner.Immobilize(20)

View File

@@ -38,7 +38,7 @@
/datum/brain_trauma/mild/phobia/on_life()
..()
if(owner.has_trait(TRAIT_FEARLESS))
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
return
if(is_blind(owner))
return
@@ -79,7 +79,7 @@
/datum/brain_trauma/mild/phobia/on_hear(message, speaker, message_language, raw_message, radio_freq)
if(!owner.can_hear() || world.time < next_scare) //words can't trigger you if you can't hear them *taps head*
return message
if(owner.has_trait(TRAIT_FEARLESS))
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
return message
for(var/word in trigger_words)
var/regex/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")
@@ -91,7 +91,7 @@
return message
/datum/brain_trauma/mild/phobia/on_say(message)
if(owner.has_trait(TRAIT_FEARLESS))
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
return message
for(var/word in trigger_words)
var/regex/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")

View File

@@ -13,11 +13,11 @@
lose_text = "<span class='notice'>You suddenly remember how to speak.</span>"
/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
@@ -109,13 +109,13 @@
/datum/brain_trauma/severe/paralysis/on_gain()
..()
for(var/X in paralysis_traits)
owner.add_trait(X, "trauma_paralysis")
ADD_TRAIT(owner, X, "trauma_paralysis")
owner.update_disabled_bodyparts()
/datum/brain_trauma/severe/paralysis/on_lose()
..()
for(var/X in paralysis_traits)
owner.remove_trait(X, "trauma_paralysis")
REMOVE_TRAIT(owner, X, "trauma_paralysis")
owner.update_disabled_bodyparts()
/datum/brain_trauma/severe/paralysis/paraplegic
@@ -171,7 +171,7 @@
stress = max(stress - 4, 0)
/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
@@ -233,11 +233,11 @@
lose_text = "<span class='notice'>You feel in control of your hands again.</span>"
/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
@@ -248,11 +248,11 @@
lose_text = "<span class='notice'>You no longer feel compelled to not harm.</span>"
/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)
..()
/datum/brain_trauma/severe/hypnotic_stupor

View File

@@ -23,11 +23,11 @@
speak("neutral", prob(25))
/datum/brain_trauma/special/godwoken/on_gain()
owner.add_trait(TRAIT_HOLY, TRAUMA_TRAIT)
ADD_TRAIT(owner, TRAIT_HOLY, TRAUMA_TRAIT)
..()
/datum/brain_trauma/special/godwoken/on_lose()
owner.remove_trait(TRAIT_HOLY, TRAUMA_TRAIT)
REMOVE_TRAIT(owner, TRAIT_HOLY, TRAUMA_TRAIT)
..()
/datum/brain_trauma/special/godwoken/proc/speak(type, include_owner = FALSE)
@@ -152,13 +152,13 @@
lose_text = "<span class='warning'>You realize you can feel pain again.</span>"
/datum/brain_trauma/special/tenacity/on_gain()
owner.add_trait(TRAIT_NOSOFTCRIT, TRAUMA_TRAIT)
owner.add_trait(TRAIT_NOHARDCRIT, TRAUMA_TRAIT)
ADD_TRAIT(owner, TRAIT_NOSOFTCRIT, TRAUMA_TRAIT)
ADD_TRAIT(owner, TRAIT_NOHARDCRIT, TRAUMA_TRAIT)
..()
/datum/brain_trauma/special/tenacity/on_lose()
owner.remove_trait(TRAIT_NOSOFTCRIT, TRAUMA_TRAIT)
owner.remove_trait(TRAIT_NOHARDCRIT, TRAUMA_TRAIT)
REMOVE_TRAIT(owner, TRAIT_NOSOFTCRIT, TRAUMA_TRAIT)
REMOVE_TRAIT(owner, TRAIT_NOHARDCRIT, TRAUMA_TRAIT)
..()
/datum/brain_trauma/special/death_whispers
@@ -180,12 +180,12 @@
..()
/datum/brain_trauma/special/death_whispers/proc/whispering()
owner.add_trait(TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
ADD_TRAIT(owner, TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
active = TRUE
addtimer(CALLBACK(src, .proc/cease_whispering), rand(50, 300))
/datum/brain_trauma/special/death_whispers/proc/cease_whispering()
owner.remove_trait(TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
REMOVE_TRAIT(owner, TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
active = FALSE
/datum/brain_trauma/special/beepsky

View File

@@ -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, "<span class='warning'>[codeword]</span>")

View File

@@ -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)

View File

@@ -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

View File

@@ -191,11 +191,11 @@
if(9)
setSanity(sanity+0.4, maximum=INFINITY)
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")
@@ -216,7 +216,7 @@
amount = sanity - 0.5
// Disturbed stops you from getting any more sane
if(owner.has_trait(TRAIT_UNSTABLE))
if(HAS_TRAIT(owner, TRAIT_UNSTABLE))
sanity = min(amount,sanity)
else
sanity = amount
@@ -323,11 +323,11 @@
var/mob/living/carbon/human/H = L
if(isethereal(H))
HandleCharge(H)
if(H.has_trait(TRAIT_NOHUNGER))
if(HAS_TRAIT(H, TRAIT_NOHUNGER))
return FALSE //no mood events for nutrition
switch(L.nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
if (!L.has_trait(TRAIT_VORACIOUS))
if (!HAS_TRAIT(L, TRAIT_VORACIOUS))
add_event(null, "nutrition", /datum/mood_event/fat)
else
add_event(null, "nutrition", /datum/mood_event/wellfed) // round and full
@@ -358,20 +358,20 @@
/datum/component/mood/proc/HandleHygiene(mob/living/carbon/human/H)
switch(H.hygiene)
if(0 to HYGIENE_LEVEL_DIRTY)
if(H.has_trait(TRAIT_NEAT))
if(HAS_TRAIT(H, TRAIT_NEAT))
add_event(null, "neat", /datum/mood_event/dirty)
if(H.has_trait(TRAIT_NEET))
if(HAS_TRAIT(H, TRAIT_NEET))
add_event(null, "NEET", /datum/mood_event/happy_neet)
HygieneMiasma(H)
if(HYGIENE_LEVEL_DIRTY to HYGIENE_LEVEL_NORMAL)
if(H.has_trait(TRAIT_NEAT))
if(HAS_TRAIT(H, TRAIT_NEAT))
clear_event(null, "neat")
if(H.has_trait(TRAIT_NEET))
if(HAS_TRAIT(H, TRAIT_NEET))
clear_event(null, "NEET")
if(HYGIENE_LEVEL_NORMAL to HYGIENE_LEVEL_CLEAN)
if(H.has_trait(TRAIT_NEAT))
if(HAS_TRAIT(H, TRAIT_NEAT))
add_event(null, "neat", /datum/mood_event/neat)
if(H.has_trait(TRAIT_NEET))
if(HAS_TRAIT(H, TRAIT_NEET))
clear_event(null, "NEET")
/datum/component/mood/proc/HygieneMiasma(mob/living/carbon/human/H)

View File

@@ -46,7 +46,7 @@
return
// No decay if formaldehyde in corpse or when the corpse is charred
if(C.reagents.has_reagent("formaldehyde", 15) || C.has_trait(TRAIT_HUSK))
if(C.reagents.has_reagent("formaldehyde", 15) || HAS_TRAIT(C, TRAIT_HUSK))
return
// Also no decay if corpse chilled or not organic/undead

View File

@@ -594,7 +594,7 @@
if(!stop_messages)
to_chat(M, "<span class='warning'>[IP] cannot hold [I] as it's a storage item of the same size!</span>")
return FALSE //To prevent the stacking of same sized storage items.
if(I.has_trait(TRAIT_NODROP)) //SHOULD be handled in unEquip, but better safe than sorry.
if(HAS_TRAIT(I, TRAIT_NODROP)) //SHOULD be handled in unEquip, but better safe than sorry.
if(!stop_messages)
to_chat(M, "<span class='warning'>\the [I] is stuck to your hand, you can't put it in \the [host]!</span>")
return FALSE

View File

@@ -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)

View File

@@ -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

View File

@@ -57,13 +57,13 @@ Bonus
var/mob/living/carbon/M = A.affected_mob
switch(A.stage)
if(3)
M.remove_trait(TRAIT_NOBREATH, DISEASE_TRAIT)
REMOVE_TRAIT(M, TRAIT_NOBREATH, DISEASE_TRAIT)
if(4)
M.add_trait(TRAIT_NOBREATH, DISEASE_TRAIT)
ADD_TRAIT(M, TRAIT_NOBREATH, DISEASE_TRAIT)
return TRUE
/datum/symptom/oxygen/End(datum/disease/advance/A)
if(!..())
return
if(A.stage >= 4)
A.affected_mob.remove_trait(TRAIT_NOBREATH, DISEASE_TRAIT)
REMOVE_TRAIT(A.affected_mob, TRAIT_NOBREATH, DISEASE_TRAIT)

View File

@@ -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, "<span class='notice'>Your vision slowly returns...</span>")
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, "<span class='notice'>You can finally focus your eyes on distant objects.</span>")
M.cure_nearsighted(EYE_DAMAGE)
M.blur_eyes(10)

View File

@@ -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, "<span class='userdanger'>You go blind!</span>")
M.become_blind(EYE_DAMAGE)
else

View File

@@ -642,7 +642,7 @@
/mob/living/carbon/human/proc/something_horrible_mindmelt()
if(!has_trait(TRAIT_BLIND))
if(!HAS_TRAIT(src, TRAIT_BLIND))
var/obj/item/organ/eyes/eyes = locate(/obj/item/organ/eyes) in internal_organs
if(!eyes)
return

View File

@@ -148,5 +148,5 @@
if(isliving(user))
var/mob/living/L = user
if(L.has_trait(TRAIT_EMOTEMUTE))
if(HAS_TRAIT(L, TRAIT_EMOTEMUTE))
return FALSE

View File

@@ -56,7 +56,7 @@
var/area/A = get_area(curturf)
var/area/B = get_area(destturf)
if(!forced && (teleatom.has_trait(TRAIT_NO_TELEPORT) || A.noteleport || B.noteleport))
if(!forced && (HAS_TRAIT(teleatom, TRAIT_NO_TELEPORT) || A.noteleport || B.noteleport))
return FALSE
if(SEND_SIGNAL(destturf, COMSIG_ATOM_INTERCEPT_TELEPORT, channel, curturf, destturf))

View File

@@ -181,7 +181,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, "<span class ='warning'>You club yourself over the head with [src].</span>")
user.Paralyze(60)
if(ishuman(user))

View File

@@ -116,12 +116,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.
@@ -158,12 +158,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.
@@ -227,12 +227,12 @@
/datum/mutation/human/insulated/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
owner.add_trait(TRAIT_SHOCKIMMUNE, "genetics")
ADD_TRAIT(owner, TRAIT_SHOCKIMMUNE, "genetics")
/datum/mutation/human/insulated/on_losing(mob/living/carbon/human/owner)
if(..())
return
owner.remove_trait(TRAIT_SHOCKIMMUNE, "genetics")
REMOVE_TRAIT(owner, TRAIT_SHOCKIMMUNE, "genetics")
/datum/mutation/human/fire
name = "Fiery Sweat"

View File

@@ -14,8 +14,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)
@@ -31,8 +31,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")

View File

@@ -48,13 +48,13 @@
if(..())
return
owner.add_trait(visionflag, GENETIC_MUTATION)
ADD_TRAIT(owner, visionflag, GENETIC_MUTATION)
owner.update_sight()
/datum/mutation/human/thermal/on_losing(mob/living/carbon/human/owner)
if(..())
return
owner.remove_trait(visionflag, GENETIC_MUTATION)
REMOVE_TRAIT(owner, visionflag, GENETIC_MUTATION)
owner.update_sight()
//X-ray Vision lets you see through walls.

View File

@@ -19,12 +19,12 @@
/datum/mutation/human/space_adaptation/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
owner.add_trait(TRAIT_RESISTCOLD, "space_adaptation")
owner.add_trait(TRAIT_RESISTLOWPRESSURE, "space_adaptation")
ADD_TRAIT(owner, TRAIT_RESISTCOLD, "space_adaptation")
ADD_TRAIT(owner, TRAIT_RESISTLOWPRESSURE, "space_adaptation")
/datum/mutation/human/space_adaptation/on_losing(mob/living/carbon/human/owner)
if(..())
return
owner.remove_trait(TRAIT_RESISTCOLD, "space_adaptation")
owner.remove_trait(TRAIT_RESISTLOWPRESSURE, "space_adaptation")
REMOVE_TRAIT(owner, TRAIT_RESISTCOLD, "space_adaptation")
REMOVE_TRAIT(owner, TRAIT_RESISTLOWPRESSURE, "space_adaptation")

View File

@@ -33,12 +33,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
@@ -109,12 +109,12 @@
/datum/mutation/human/unintelligible/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
owner.add_trait(TRAIT_UNINTELLIGIBLE_SPEECH, GENETIC_MUTATION)
ADD_TRAIT(owner, TRAIT_UNINTELLIGIBLE_SPEECH, GENETIC_MUTATION)
/datum/mutation/human/unintelligible/on_losing(mob/living/carbon/human/owner)
if(..())
return
owner.remove_trait(TRAIT_UNINTELLIGIBLE_SPEECH, GENETIC_MUTATION)
REMOVE_TRAIT(owner, TRAIT_UNINTELLIGIBLE_SPEECH, GENETIC_MUTATION)
/datum/mutation/human/swedish
name = "Swedish"

View File

@@ -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, "<span class='changeling'>We can faintly sense an outsider trying to communicate through the hivemind...</span>")
if(LINGHIVE_LING)
if (user.has_trait(CHANGELING_HIVEMIND_MUTE))
if (HAS_TRAIT(user, CHANGELING_HIVEMIND_MUTE))
to_chat(user, "<span class='warning'>The poison in the air hinders our ability to interact with the hivemind.</span>")
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))

View File

@@ -468,13 +468,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)
@@ -570,7 +570,7 @@
alert_type = /obj/screen/alert/status_effect/regenerative_core
/datum/status_effect/regenerative_core/on_apply()
owner.add_trait(TRAIT_IGNOREDAMAGESLOWDOWN, "regenerative_core")
ADD_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, "regenerative_core")
owner.adjustBruteLoss(-25)
owner.adjustFireLoss(-25)
owner.remove_CC()
@@ -578,7 +578,7 @@
return TRUE
/datum/status_effect/regenerative_core/on_remove()
owner.remove_trait(TRAIT_IGNOREDAMAGESLOWDOWN, "regenerative_core")
REMOVE_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, id)
/datum/status_effect/antimagic
id = "antimagic"
@@ -587,11 +587,11 @@
/datum/status_effect/antimagic/on_apply()
owner.visible_message("<span class='notice'>[owner] is coated with a dull aura!</span>")
owner.add_trait(TRAIT_ANTIMAGIC, MAGIC_TRAIT)
ADD_TRAIT(owner, TRAIT_ANTIMAGIC, MAGIC_TRAIT)
//glowing wings overlay
playsound(owner, 'sound/weapons/fwoosh.ogg', 75, 0)
return ..()
/datum/status_effect/antimagic/on_remove()
owner.remove_trait(TRAIT_ANTIMAGIC, MAGIC_TRAIT)
REMOVE_TRAIT(owner, TRAIT_ANTIMAGIC, MAGIC_TRAIT)
owner.visible_message("<span class='warning'>[owner]'s dull aura fades away...</span>")

View File

@@ -92,11 +92,11 @@
alert_type = /obj/screen/alert/status_effect/strandling
/datum/status_effect/strandling/on_apply()
owner.add_trait(TRAIT_MAGIC_CHOKE, "dumbmoron")
ADD_TRAIT(owner, TRAIT_MAGIC_CHOKE, "dumbmoron")
return ..()
/datum/status_effect/strandling/on_remove()
owner.remove_trait(TRAIT_MAGIC_CHOKE, "dumbmoron")
REMOVE_TRAIT(owner, TRAIT_MAGIC_CHOKE, "dumbmoron")
return ..()
/obj/screen/alert/status_effect/strandling
@@ -121,11 +121,11 @@
. = ..()
/datum/status_effect/pacify/on_apply()
owner.add_trait(TRAIT_PACIFISM, "status_effect")
ADD_TRAIT(owner, TRAIT_PACIFISM, "status_effect")
return ..()
/datum/status_effect/pacify/on_remove()
owner.remove_trait(TRAIT_PACIFISM, "status_effect")
REMOVE_TRAIT(owner, TRAIT_PACIFISM, "status_effect")
//OTHER DEBUFFS
/datum/status_effect/pacify
@@ -141,11 +141,11 @@
. = ..()
/datum/status_effect/pacify/on_apply()
owner.add_trait(TRAIT_PACIFISM, "status_effect")
ADD_TRAIT(owner, TRAIT_PACIFISM, "status_effect")
return ..()
/datum/status_effect/pacify/on_remove()
owner.remove_trait(TRAIT_PACIFISM, "status_effect")
REMOVE_TRAIT(owner, TRAIT_PACIFISM, "status_effect")
/datum/status_effect/his_wrath //does minor damage over time unless holding His Grace
id = "his_wrath"
@@ -581,16 +581,16 @@
alert_type = null
/datum/status_effect/gonbolaPacify/on_apply()
owner.add_trait(TRAIT_PACIFISM, "gonbolaPacify")
owner.add_trait(TRAIT_MUTE, "gonbolaMute")
owner.add_trait(TRAIT_JOLLY, "gonbolaJolly")
ADD_TRAIT(owner, TRAIT_PACIFISM, "gonbolaPacify")
ADD_TRAIT(owner, TRAIT_MUTE, "gonbolaMute")
ADD_TRAIT(owner, TRAIT_JOLLY, "gonbolaJolly")
to_chat(owner, "<span class='notice'>You suddenly feel at peace and feel no need to make any sudden or rash actions...</span>")
return ..()
/datum/status_effect/gonbolaPacify/on_remove()
owner.remove_trait(TRAIT_PACIFISM, "gonbolaPacify")
owner.remove_trait(TRAIT_MUTE, "gonbolaMute")
owner.remove_trait(TRAIT_JOLLY, "gonbolaJolly")
REMOVE_TRAIT(owner, TRAIT_PACIFISM, "gonbolaPacify")
REMOVE_TRAIT(owner, TRAIT_MUTE, "gonbolaMute")
REMOVE_TRAIT(owner, TRAIT_JOLLY, "gonbolaJolly")
/datum/status_effect/trance
id = "trance"
@@ -615,7 +615,7 @@
if(!iscarbon(owner))
return FALSE
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/hypnotize)
owner.add_trait(TRAIT_MUTE, "trance")
ADD_TRAIT(owner, TRAIT_MUTE, "trance")
if(!owner.has_quirk(/datum/quirk/monochromatic))
owner.add_client_colour(/datum/client_colour/monochrome)
owner.visible_message("[stun ? "<span class='warning'>[owner] stands still as [owner.p_their()] eyes seem to focus on a distant point.</span>" : ""]", \
@@ -629,7 +629,7 @@
/datum/status_effect/trance/on_remove()
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
owner.remove_trait(TRAIT_MUTE, "trance")
REMOVE_TRAIT(owner, TRAIT_MUTE, "trance")
owner.dizziness = 0
if(!owner.has_quirk(/datum/quirk/monochromatic))
owner.remove_client_colour(/datum/client_colour/monochrome)

View File

@@ -79,11 +79,11 @@
/datum/status_effect/throat_soothed/on_apply()
. = ..()
owner.add_trait(TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
ADD_TRAIT(owner, TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
/datum/status_effect/throat_soothed/on_remove()
. = ..()
owner.remove_trait(TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
REMOVE_TRAIT(owner, TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
/datum/status_effect/bounty
id = "bounty"

View File

@@ -1,75 +0,0 @@
/datum/proc/add_trait(trait, source)
LAZYINITLIST(status_traits)
if(!status_traits[trait])
status_traits[trait] = list(source)
else
status_traits[trait] |= list(source)
/datum/proc/remove_trait(trait, list/sources, force)
if(!status_traits)
return //nothing to remove
if(!status_traits[trait])
return
if(locate(ROUNDSTART_TRAIT) in status_traits[trait] && !force) //mob traits applied through roundstart cannot normally be removed
return
if(!sources) // No defined source cures the trait entirely.
status_traits -= trait
return
if(!islist(sources))
sources = list(sources)
if(LAZYLEN(sources))
for(var/S in sources)
if(S in status_traits[trait])
status_traits[trait] -= S
else
status_traits[trait] = list()
if(!LAZYLEN(status_traits[trait]))
status_traits -= trait
/datum/proc/has_trait(trait, list/sources)
if(!status_traits)
return FALSE //well of course it doesn't have the trait
if(!status_traits[trait])
return FALSE
. = FALSE
if(sources && !islist(sources))
sources = list(sources)
if(LAZYLEN(sources))
for(var/S in sources)
if(S in status_traits[trait])
return TRUE
else if(LAZYLEN(status_traits[trait]))
return TRUE
/datum/proc/remove_all_traits(remove_species_traits = FALSE, remove_organ_traits = FALSE, remove_quirks = FALSE)
if(!status_traits)
return //nothing to remove
var/list/blacklisted_sources = list()
if(!remove_species_traits)
blacklisted_sources += SPECIES_TRAIT
if(!remove_organ_traits)
blacklisted_sources += ORGAN_TRAIT
if(!remove_quirks)
blacklisted_sources += ROUNDSTART_TRAIT
for(var/kebab in status_traits)
var/skip
for(var/S in blacklisted_sources)
if(S in status_traits[kebab])
skip = TRUE
break
if(!skip)
remove_trait(kebab, null, TRUE)
CHECK_TICK

View File

@@ -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 = "<span class='danger'>Things far away from you start looking blurry.</span>"

View File

@@ -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))

View File

@@ -102,7 +102,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)
@@ -174,7 +174,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"
@@ -184,9 +184,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))
@@ -244,7 +244,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

View File

@@ -63,7 +63,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

View File

@@ -42,17 +42,17 @@
var/obj/item/clothing/C
if(!H.w_uniform || H.dropItemToGround(H.w_uniform))
C = new /obj/item/clothing/under/rank/clown(H)
C.add_trait(TRAIT_NODROP, CLOWN_NUKE_TRAIT)
ADD_TRAIT(C, TRAIT_NODROP, CLOWN_NUKE_TRAIT)
H.equip_to_slot_or_del(C, SLOT_W_UNIFORM)
if(!H.shoes || H.dropItemToGround(H.shoes))
C = new /obj/item/clothing/shoes/clown_shoes(H)
C.add_trait(TRAIT_NODROP, CLOWN_NUKE_TRAIT)
ADD_TRAIT(C, TRAIT_NODROP, CLOWN_NUKE_TRAIT)
H.equip_to_slot_or_del(C, SLOT_SHOES)
if(!H.wear_mask || H.dropItemToGround(H.wear_mask))
C = new /obj/item/clothing/mask/gas/clown_hat(H)
C.add_trait(TRAIT_NODROP, CLOWN_NUKE_TRAIT)
ADD_TRAIT(C, TRAIT_NODROP, CLOWN_NUKE_TRAIT)
H.equip_to_slot_or_del(C, SLOT_WEAR_MASK)
H.dna.add_mutation(CLOWNMUT)

View File

@@ -220,11 +220,11 @@
/obj/item/clothing/mask/fakemoustache/sticky/Initialize()
. = ..()
add_trait(TRAIT_NODROP, STICKY_MOUSTACHE_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, STICKY_MOUSTACHE_TRAIT)
addtimer(CALLBACK(src, .proc/unstick), unstick_time)
/obj/item/clothing/mask/fakemoustache/sticky/proc/unstick()
remove_trait(TRAIT_NODROP, STICKY_MOUSTACHE_TRAIT)
REMOVE_TRAIT(src, TRAIT_NODROP, STICKY_MOUSTACHE_TRAIT)
//DARK H.O.N.K. AND CLOWN MECH WEAPONS

View File

@@ -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

View File

@@ -176,7 +176,7 @@
H.hardset_dna(ui, mutation_index, H.real_name, null, mrace, features)
if(!H.has_trait(TRAIT_RADIMMUNE))//dont apply mutations if the species is Mutation proof.
if(!HAS_TRAIT(H, TRAIT_RADIMMUNE))//dont apply mutations if the species is Mutation proof.
if(efficiency > 2)
var/list/unclean_mutations = (GLOB.not_good_mutations|GLOB.bad_mutations)
H.dna.remove_mutation_group(unclean_mutations)
@@ -197,11 +197,11 @@
icon_state = "pod_1"
//Get the clone body ready
maim_clone(H)
H.add_trait(TRAIT_STABLEHEART, CLONING_POD_TRAIT)
H.add_trait(TRAIT_EMOTEMUTE, CLONING_POD_TRAIT)
H.add_trait(TRAIT_MUTE, CLONING_POD_TRAIT)
H.add_trait(TRAIT_NOBREATH, CLONING_POD_TRAIT)
H.add_trait(TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_STABLEHEART, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_EMOTEMUTE, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_MUTE, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_NOBREATH, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT)
H.Unconscious(80)
clonemind.transfer_to(H)
@@ -404,11 +404,11 @@
if(!mob_occupant)
return
current_insurance = null
mob_occupant.remove_trait(TRAIT_STABLEHEART, CLONING_POD_TRAIT)
mob_occupant.remove_trait(TRAIT_EMOTEMUTE, CLONING_POD_TRAIT)
mob_occupant.remove_trait(TRAIT_MUTE, CLONING_POD_TRAIT)
mob_occupant.remove_trait(TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT)
mob_occupant.remove_trait(TRAIT_NOBREATH, CLONING_POD_TRAIT)
REMOVE_TRAIT(mob_occupant, TRAIT_STABLEHEART, CLONING_POD_TRAIT)
REMOVE_TRAIT(mob_occupant, TRAIT_EMOTEMUTE, CLONING_POD_TRAIT)
REMOVE_TRAIT(mob_occupant, TRAIT_MUTE, CLONING_POD_TRAIT)
REMOVE_TRAIT(mob_occupant, TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT)
REMOVE_TRAIT(mob_occupant, TRAIT_NOBREATH, CLONING_POD_TRAIT)
if(grab_ghost_when == CLONER_MATURE_CLONE)
mob_occupant.grab_ghost()
@@ -501,7 +501,7 @@
// Applying brainloss is done when the clone leaves the pod, so application of traumas can happen
// based on the level of damage sustained.
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)

View File

@@ -535,11 +535,11 @@
scantemp = "<font class='bad'>Subject's brain is not responding to scanning stimuli.</font>"
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
return
if((mob_occupant.has_trait(TRAIT_HUSK)) && (src.scanner.scan_level < 2))
if((HAS_TRAIT(mob_occupant, TRAIT_HUSK)) && (src.scanner.scan_level < 2))
scantemp = "<font class='bad'>Subject's body is too damaged to scan properly.</font>"
playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
return
if(mob_occupant.has_trait(TRAIT_BADDNA))
if(HAS_TRAIT(mob_occupant, TRAIT_BADDNA))
scantemp = "<font class='bad'>Subject's DNA is damaged beyond any hope of recovery.</font>"
playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
return

View File

@@ -126,7 +126,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_BADDNA) || (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_BADDNA) || (connected.scan_level == 3)) //occupant is viable for dna modification
occupant_status += "[viable_occupant.name] => "
switch(viable_occupant.stat)
if(CONSCIOUS)
@@ -842,7 +842,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_BADDNA))
if(!istype(viable_occupant) || !viable_occupant.dna || HAS_TRAIT(viable_occupant, TRAIT_RADIMMUNE) || HAS_TRAIT(viable_occupant, TRAIT_BADDNA))
viable_occupant = null
return viable_occupant

View File

@@ -69,7 +69,7 @@
if(defib)
to_chat(user, "<span class='warning'>There's already a defibrillator in [src]!</span>")
return
if(I.has_trait(TRAIT_NODROP) || !user.transferItemToLoc(I, src))
if(HAS_TRAIT(I, TRAIT_NODROP) || !user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return
user.visible_message("<span class='notice'>[user] hooks up [I] to [src]!</span>", \

View File

@@ -750,7 +750,7 @@
if(ishuman(user) && prob(40) && 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, 'sound/effects/bang.ogg', 25, TRUE)
if(!istype(H.head, /obj/item/clothing/head/helmet))
H.visible_message("<span class='danger'>[user] headbutts the airlock.</span>", \

View File

@@ -42,11 +42,11 @@
icon_state = "pod_1"
//Get the clone body ready
maim_clone(H)
H.add_trait(TRAIT_STABLEHEART, CLONING_POD_TRAIT)
H.add_trait(TRAIT_EMOTEMUTE, CLONING_POD_TRAIT)
H.add_trait(TRAIT_MUTE, CLONING_POD_TRAIT)
H.add_trait(TRAIT_NOBREATH, CLONING_POD_TRAIT)
H.add_trait(TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_STABLEHEART, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_EMOTEMUTE, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_MUTE, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_NOBREATH, CLONING_POD_TRAIT)
ADD_TRAIT(H, TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT)
H.Unconscious(80)
var/list/candidates = pollCandidatesForMob("Do you want to play as [clonename]'s defective clone?", null, null, null, 100, H)
@@ -270,11 +270,11 @@
scantemp = "<font class='bad'>Unable to locate valid genetic data.</font>"
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
return
if((mob_occupant.has_trait(TRAIT_HUSK)) && (src.scanner.scan_level < 2))
if((HAS_TRAIT(mob_occupant, TRAIT_HUSK)) && (src.scanner.scan_level < 2))
scantemp = "<font class='bad'>Subject's body is too damaged to scan properly.</font>"
playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
return
if(mob_occupant.has_trait(TRAIT_BADDNA))
if(HAS_TRAIT(mob_occupant, TRAIT_BADDNA))
scantemp = "<font class='bad'>Subject's DNA is damaged beyond any hope of recovery.</font>"
playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
return

View File

@@ -65,7 +65,7 @@
if(!isitem(A))
continue
var/obj/item/I = A
if(!(I.has_trait(TRAIT_NODROP)))
if(!(HAS_TRAIT(I, TRAIT_NODROP)))
say("Subject may not have abiotic items on.")
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, 1)
return
@@ -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

View File

@@ -498,7 +498,7 @@
threatcount += 4
if(shoot_unloyal)
if (!perp.has_trait(TRAIT_MINDSHIELD))
if (!HAS_TRAIT(perp, TRAIT_MINDSHIELD))
threatcount += 4
return threatcount

View File

@@ -90,7 +90,7 @@
if(!R || (R.fields["criminal"] == "*Arrest*"))
beep = TRUE
if(SCANGATE_MINDSHIELD)
if(M.has_trait(TRAIT_MINDSHIELD))
if(HAS_TRAIT(M, TRAIT_MINDSHIELD))
beep = TRUE
if(SCANGATE_NANITES)
if(SEND_SIGNAL(M, COMSIG_HAS_NANITES))

View File

@@ -489,13 +489,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, "<span class='warning'>You don't want to harm other living beings!</span>")
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, "<span class='warning'>You don't want to harm other living beings!</span>")
return
if(selected.action(target,params))

View File

@@ -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
if(!S.can_be_bloody)
return

View File

@@ -75,7 +75,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)

View File

@@ -131,7 +131,7 @@
var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc)
victim.log_message("entered a blood frenzy", LOG_ATTACK)
chainsaw.add_trait(TRAIT_NODROP, CHAINSAW_FRENZY_TRAIT)
ADD_TRAIT(chainsaw, TRAIT_NODROP, CHAINSAW_FRENZY_TRAIT)
victim.drop_all_held_items()
victim.put_in_hands(chainsaw, forced = TRUE)
chainsaw.attack_self(victim)

View File

@@ -260,7 +260,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)
@@ -493,7 +493,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
M.adjust_blurriness(15)
if(M.stat != DEAD)
to_chat(M, "<span class='danger'>Your eyes start to bleed profusely!</span>")
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, "<span class='danger'>You become nearsighted!</span>")
M.become_nearsighted(EYE_DAMAGE)
if(prob(50))
@@ -789,12 +789,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
return ..()
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=TRUE, diagonals_first = FALSE, var/datum/callback/callback)
if(has_trait(TRAIT_NODROP))
if(HAS_TRAIT(src, TRAIT_NODROP))
return
return ..()
/obj/item/proc/canStrip(mob/stripper, mob/owner)
return !has_trait(TRAIT_NODROP)
return !HAS_TRAIT(src, TRAIT_NODROP)
/obj/item/proc/doStrip(mob/stripper, mob/owner)
return owner.dropItemToGround(src)

View File

@@ -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)
..()

View File

@@ -58,7 +58,7 @@
/obj/item/gun/energy/chrono_gun/Initialize()
. = ..()
add_trait(TRAIT_NODROP, CHRONO_GUN_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, CHRONO_GUN_TRAIT)
if(istype(loc, /obj/item/chrono_eraser))
TED = loc
else //admin must have spawned it

View File

@@ -279,7 +279,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)

View File

@@ -437,7 +437,7 @@
do_help(H, user)
/obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/H)
if(H.suiciding || H.hellbound || H.has_trait(TRAIT_HUSK))
if(H.suiciding || H.hellbound || HAS_TRAIT(H, TRAIT_HUSK))
return
if((world.time - H.timeofdeath) > tlimit)
return
@@ -577,7 +577,7 @@
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Body has decayed for too long. Further attempts futile.</span>"
else if (!H.getorgan(/obj/item/organ/heart))
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's heart is missing.</span>"
else if(total_burn >= MAX_REVIVE_FIRE_DAMAGE || total_brute >= MAX_REVIVE_BRUTE_DAMAGE || H.has_trait(TRAIT_HUSK))
else if(total_burn >= MAX_REVIVE_FIRE_DAMAGE || total_brute >= MAX_REVIVE_BRUTE_DAMAGE || HAS_TRAIT(H, TRAIT_HUSK))
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Severe tissue damage makes recovery of patient impossible via defibrillator. Further attempts futile.</span>"
else if(H.get_ghost())
failed = "<span class='warning'>[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - No activity in patient's brain. Further attempts may be successful.</span>"

View File

@@ -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("<span class='warning'>[user] directs [src] to [M]'s eyes.</span>", \
"<span class='danger'>You direct [src] to [M]'s eyes.</span>")
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, "<span class='warning'>[M]'s pupils don't react to the light!</span>")
else if(M.dna && M.dna.check_mutation(XRAY)) //mob has X-ray vision
to_chat(user, "<span class='danger'>[M]'s pupils give an eerie glow!</span>")

View File

@@ -159,7 +159,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
/obj/item/gps/cyborg/Initialize()
. = ..()
add_trait(TRAIT_NODROP, CYBORG_ITEM_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
/obj/item/gps/internal
icon_state = null

View File

@@ -77,7 +77,7 @@
if (!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if(user.has_trait(TRAIT_NOGUNS))
if(HAS_TRAIT(user, TRAIT_NOGUNS))
to_chat(user, "<span class='warning'>Your fingers can't press the button!</span>")
return
if(ishuman(user))

View File

@@ -49,7 +49,7 @@
if(iscarbon(user))
var/mob/living/carbon/C = user
if(C.get_item_by_slot(SLOT_HEAD) == src)
if(has_trait(TRAIT_NODROP, REVERSE_BEAR_TRAP_TRAIT) && !struggling)
if(HAS_TRAIT_FROM(src, TRAIT_NODROP, REVERSE_BEAR_TRAP_TRAIT) && !struggling)
struggling = TRUE
var/fear_string
switch(time_left)
@@ -74,7 +74,7 @@
else
user.visible_message("<span class='warning'>The lock on [user]'s [name] pops open!</span>", \
"<span class='userdanger'>You force open the padlock!</span>", "<i>You hear a single, pronounced click!</i>")
remove_trait(TRAIT_NODROP, REVERSE_BEAR_TRAP_TRAIT)
REMOVE_TRAIT(src, TRAIT_NODROP, REVERSE_BEAR_TRAP_TRAIT)
struggling = FALSE
else
..()
@@ -116,7 +116,7 @@
/obj/item/reverse_bear_trap/proc/reset()
ticking = FALSE
remove_trait(TRAIT_NODROP, REVERSE_BEAR_TRAP_TRAIT)
REMOVE_TRAIT(src, TRAIT_NODROP, REVERSE_BEAR_TRAP_TRAIT)
soundloop.stop()
soundloop2.stop()
STOP_PROCESSING(SSprocessing, src)
@@ -125,7 +125,7 @@
ticking = TRUE
escape_chance = initial(escape_chance) //we keep these vars until re-arm, for tracking purposes
time_left = initial(time_left)
add_trait(TRAIT_NODROP, REVERSE_BEAR_TRAP_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, REVERSE_BEAR_TRAP_TRAIT)
soundloop.start()
soundloop2.mid_length = initial(soundloop2.mid_length)
soundloop2.start()

View File

@@ -61,7 +61,7 @@ GENE SCANNER
if(O.level != 1)
continue
if(O.invisibility == INVISIBILITY_MAXIMUM || O.has_trait(TRAIT_T_RAY_VISIBLE))
if(O.invisibility == INVISIBILITY_MAXIMUM || HAS_TRAIT(O, TRAIT_T_RAY_VISIBLE))
var/image/I = new(loc = get_turf(O))
var/mutable_appearance/MA = new(O)
MA.alpha = 128
@@ -106,7 +106,7 @@ GENE 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, "<span class='notice'>You stupidly try to analyze the floor's vitals!</span>")
user.visible_message("<span class='warning'>[user] has analyzed the floor's vitals!</span>")
to_chat(user, "<span class='info'>Analyzing results for The floor:\n\tOverall status: <b>Healthy</b>")
@@ -136,7 +136,7 @@ GENE SCANNER
var/brute_loss = M.getBruteLoss()
var/mob_status = (M.stat == DEAD ? "<span class='alert'><b>Deceased</b></span>" : "<b>[round(M.health/M.maxHealth,0.01)*100] % healthy</b>")
if(M.has_trait(TRAIT_FAKEDEATH) && !advanced)
if(HAS_TRAIT(M, TRAIT_FAKEDEATH) && !advanced)
mob_status = "<span class='alert'><b>Deceased</b></span>"
oxy_loss = max(rand(1, 40), oxy_loss, (300 - (tox_loss + fire_loss + brute_loss))) // Random oxygen loss
@@ -209,10 +209,10 @@ GENE SCANNER
to_chat(user, "\t<span class='info'><b>==EAR STATUS==</b></span>")
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
to_chat(user, "\t<span class='alert'>Subject is genetically deaf.</span>")
else if(C.has_trait(TRAIT_DEAF))
else if(HAS_TRAIT(C, TRAIT_DEAF))
healthy = FALSE
to_chat(user, "\t<span class='alert'>Subject is deaf.</span>")
else
@@ -230,10 +230,10 @@ GENE SCANNER
to_chat(user, "\t<span class='info'><b>==EYE STATUS==</b></span>")
if(istype(eyes))
var/healthy = TRUE
if(C.has_trait(TRAIT_BLIND))
if(HAS_TRAIT(C, TRAIT_BLIND))
to_chat(user, "\t<span class='alert'>Subject is blind.</span>")
healthy = FALSE
if(C.has_trait(TRAIT_NEARSIGHT))
if(HAS_TRAIT(C, TRAIT_NEARSIGHT))
to_chat(user, "\t<span class='alert'>Subject is nearsighted.</span>")
healthy = FALSE
if(eyes.eye_damage > 30)
@@ -300,7 +300,7 @@ GENE SCANNER
to_chat(user, "<span class='info'>Body temperature: [round(M.bodytemperature-T0C,0.1)] &deg;C ([round(M.bodytemperature*1.8-459.67,0.1)] &deg;F)</span>")
// 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)))
to_chat(user, "<span class='info'>Time of Death:</span> [M.tod]")
var/tdelta = round(world.time - M.timeofdeath)
if(tdelta < (DEFIB_TIME_LIMIT * 10))
@@ -682,7 +682,7 @@ GENE SCANNER
/obj/item/sequence_scanner/attack(mob/living/M, mob/living/carbon/human/user)
add_fingerprint(user)
if (!M.has_trait(TRAIT_RADIMMUNE) && !M.has_trait(TRAIT_BADDNA)) //no scanning if its a husk or DNA-less Species
if (!HAS_TRAIT(M, TRAIT_RADIMMUNE) && !HAS_TRAIT(M, TRAIT_BADDNA)) //no scanning if its a husk or DNA-less Species
user.visible_message("<span class='notice'>[user] has analyzed [M]'s genetic sequence.</span>")
gene_scan(M, user, src)

View File

@@ -20,7 +20,7 @@
return attack_hand(user)
/obj/item/dnainjector/proc/inject(mob/living/carbon/M, mob/user)
if(M.has_dna() && !M.has_trait(TRAIT_RADIMMUNE) && !M.has_trait(TRAIT_BADDNA))
if(M.has_dna() && !HAS_TRAIT(M, TRAIT_RADIMMUNE) && !HAS_TRAIT(M, TRAIT_BADDNA))
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/HM in remove_mutations)
@@ -431,7 +431,7 @@
to_chat(user, "<span class='notice'>You can't modify [M]'s DNA while [M.p_theyre()] dead.</span>")
return FALSE
if(M.has_dna() && !(M.has_trait(TRAIT_BADDNA)))
if(M.has_dna() && !(HAS_TRAIT(M, TRAIT_BADDNA)))
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
@@ -493,7 +493,7 @@
var/filled = FALSE
/obj/item/dnainjector/activator/inject(mob/living/carbon/M, mob/user)
if(M.has_dna() && !M.has_trait(TRAIT_RADIMMUNE) && !M.has_trait(TRAIT_BADDNA))
if(M.has_dna() && !HAS_TRAIT(M, TRAIT_RADIMMUNE) && !HAS_TRAIT(M, TRAIT_BADDNA))
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/mutation in add_mutations)

View File

@@ -34,11 +34,11 @@ GLOBAL_LIST_EMPTY(possible_gifts)
/obj/item/a_gift/examine(mob/M)
. = ..()
if(M.has_trait(TRAIT_PRESENT_VISION) || isobserver(M))
if(HAS_TRAIT(M, TRAIT_PRESENT_VISION) || isobserver(M))
to_chat(M, "<span class='notice'>It contains \a [initial(contains_type.name)].</span>")
/obj/item/a_gift/attack_self(mob/M)
if(M.has_trait(TRAIT_CANNOT_OPEN_PRESENTS))
if(HAS_TRAIT(M, TRAIT_CANNOT_OPEN_PRESENTS))
to_chat(M, "<span class='warning'>You're supposed to be spreading gifts, not opening them yourself!</span>")
return

View File

@@ -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, "<span class='warning'>Huh? How does this thing work?</span>")

View File

@@ -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, "<span class='warning'>Uh... how do those things work?!</span>")
apply_cuffs(user,user)
return

View File

@@ -90,7 +90,7 @@
do_attack_animation(master, null, src)
master.emote("scream")
master.remove_status_effect(STATUS_EFFECT_HISGRACE)
remove_trait(TRAIT_NODROP, HIS_GRACE_TRAIT)
REMOVE_TRAIT(src, TRAIT_NODROP, HIS_GRACE_TRAIT)
master.Paralyze(60)
master.adjustBruteLoss(master.maxHealth)
playsound(master, 'sound/effects/splat.ogg', 100, 0)
@@ -202,20 +202,20 @@
update_stats()
/obj/item/his_grace/proc/update_stats()
remove_trait(TRAIT_NODROP, HIS_GRACE_TRAIT)
REMOVE_TRAIT(src, TRAIT_NODROP, HIS_GRACE_TRAIT)
var/mob/living/master = get_atom_on_turf(src, /mob/living)
switch(bloodthirst)
if(HIS_GRACE_CONSUME_OWNER to HIS_GRACE_FALL_ASLEEP)
if(HIS_GRACE_CONSUME_OWNER > prev_bloodthirst)
master.visible_message("<span class='userdanger'>[src] enters a frenzy!</span>")
if(HIS_GRACE_STARVING to HIS_GRACE_CONSUME_OWNER)
add_trait(TRAIT_NODROP, HIS_GRACE_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, HIS_GRACE_TRAIT)
if(HIS_GRACE_STARVING > prev_bloodthirst)
master.visible_message("<span class='boldwarning'>[src] is starving!</span>", "<span class='his_grace big'>[src]'s bloodlust overcomes you. [src] must be fed, or you will become His meal.\
[force_bonus < 15 ? " And still, His power grows.":""]</span>")
force_bonus = max(force_bonus, 15)
if(HIS_GRACE_FAMISHED to HIS_GRACE_STARVING)
add_trait(TRAIT_NODROP, HIS_GRACE_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, HIS_GRACE_TRAIT)
if(HIS_GRACE_FAMISHED > prev_bloodthirst)
master.visible_message("<span class='warning'>[src] is very hungry!</span>", "<span class='his_grace big'>Spines sink into your hand. [src] must feed immediately.\
[force_bonus < 10 ? " His power grows.":""]</span>")

View File

@@ -235,7 +235,7 @@
/obj/item/nullrod/godhand/Initialize()
. = ..()
add_trait(TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
/obj/item/nullrod/staff
icon_state = "godstaff-red"
@@ -481,7 +481,7 @@
/obj/item/nullrod/chainsaw/Initialize()
. = ..()
add_trait(TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
AddComponent(/datum/component/butchering, 30, 100, 0, hitsound)
/obj/item/nullrod/clown
@@ -553,7 +553,7 @@
/obj/item/nullrod/armblade/Initialize()
. = ..()
add_trait(TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
AddComponent(/datum/component/butchering, 80, 70)
/obj/item/nullrod/armblade/tentacle

View File

@@ -136,7 +136,7 @@
return
update_icon()
if(sticky)
add_trait(TRAIT_NODROP, HOT_POTATO_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT)
name = "primed [name]"
activation_time = timer + world.time
detonation_timerid = addtimer(CALLBACK(src, .proc/detonate), delay, TIMER_STOPPABLE)
@@ -150,7 +150,7 @@
/obj/item/hot_potato/proc/deactivate()
update_icon()
name = initial(name)
remove_trait(TRAIT_NODROP, HOT_POTATO_TRAIT)
REMOVE_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT)
deltimer(detonation_timerid)
STOP_PROCESSING(SSfastprocess, src)
detonation_timerid = null

View File

@@ -19,7 +19,7 @@
/obj/item/implant/mindshield/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
if(..())
if(!target.mind)
target.add_trait(TRAIT_MINDSHIELD, "implant")
ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant")
target.sec_hud_set_implants()
return TRUE
@@ -68,7 +68,7 @@
to_chat(target, "<span class='warning'>You feel something interfering with your mental conditioning, but you resist it!</span>")
else
to_chat(target, "<span class='notice'>You feel a sense of peace and security. You are now protected from brainwashing.</span>")
target.add_trait(TRAIT_MINDSHIELD, "implant")
ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant")
target.sec_hud_set_implants()
return TRUE
return FALSE
@@ -77,7 +77,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, "<span class='boldnotice'>Your mind suddenly feels terribly vulnerable. You are no longer safe from brainwashing.</span>")

View File

@@ -189,7 +189,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]'.")

View File

@@ -49,7 +49,7 @@
forkload = null
else if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
if(user.has_trait(TRAIT_CLUMSY) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
M = user
return eyestab(M,user)
else
@@ -81,7 +81,7 @@
/obj/item/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user)
if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
if(user.has_trait(TRAIT_CLUMSY) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
M = user
return eyestab(M,user)
else

View File

@@ -434,7 +434,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)

View File

@@ -91,7 +91,7 @@
/obj/item/melee/sabre/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is trying to cut off all [user.p_their()] limbs with [src]! it looks like [user.p_theyre()] trying to commit suicide!</span>")
var/i = 0
add_trait(TRAIT_NODROP, SABRE_SUICIDE_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, SABRE_SUICIDE_TRAIT)
if(iscarbon(user))
var/mob/living/carbon/Cuser = user
var/obj/item/bodypart/holding_bodypart = Cuser.get_holding_bodypart_of_item(src)
@@ -129,7 +129,7 @@
if(!QDELETED(user))
user.adjustBruteLoss(200)
user.death(FALSE)
remove_trait(TRAIT_NODROP, SABRE_SUICIDE_TRAIT)
REMOVE_TRAIT(src, TRAIT_NODROP, SABRE_SUICIDE_TRAIT)
/obj/item/melee/classic_baton
name = "police baton"
@@ -150,7 +150,7 @@
return ..()
add_fingerprint(user)
if((user.has_trait(TRAIT_CLUMSY)) && prob(50))
if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
to_chat(user, "<span class ='danger'>You club yourself over the head.</span>")
user.Paralyze(60 * force)
if(ishuman(user))

View File

@@ -82,6 +82,6 @@
to_chat(user, "<span class='notice'>[src] [active ? "is now active":"can now be concealed"].</span>")
/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, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
user.take_bodypart_damage(5,5)

View File

@@ -152,7 +152,7 @@
if(tank && !tank.air_contents.remove(gasPerThrow * pressureSetting))
to_chat(user, "<span class='warning'>\The [src] lets out a weak hiss and doesn't react!</span>")
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("<span class='warning'>[C] loses [C.p_their()] grip on [src], causing it to go off!</span>", "<span class='userdanger'>[src] slips out of your hands and goes off!</span>")
C.dropItemToGround(src, TRUE)

View File

@@ -189,7 +189,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"

View File

@@ -208,7 +208,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, "<span class='warning'>You beat yourself in the head with [src].</span>")
user.take_bodypart_damage(5)
active = !active

View File

@@ -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, "<span class='warning'>[src] cuts into your hand!</span>")
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, "<span class='warning'>[src] cuts into your hand!</span>")
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)

View File

@@ -97,7 +97,7 @@
var/mob/M = get(loc, /mob)
if(!istype(M))
return
if(M.has_trait(TRAIT_CANNOT_OPEN_PRESENTS))
if(HAS_TRAIT(M, TRAIT_CANNOT_OPEN_PRESENTS))
GET_COMPONENT(STR, /datum/component/storage)
var/turf/floor = get_turf(src)
var/obj/item/I = new /obj/item/a_gift/anything(floor)
@@ -299,7 +299,7 @@
/obj/item/storage/backpack/satchel/flat/Initialize()
. = ..()
add_trait(TRAIT_T_RAY_VISIBLE, TRAIT_GENERIC)
ADD_TRAIT(src, TRAIT_T_RAY_VISIBLE, TRAIT_GENERIC)
/obj/item/storage/backpack/satchel/flat/ComponentInitialize()
. = ..()

View File

@@ -112,7 +112,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if (user.has_trait(TRAIT_CLUMSY) && prob(50))
if (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='danger'>[src] slips out of your hand and hits your head.</span>")
user.take_bodypart_damage(10)
user.Unconscious(400)

View File

@@ -29,7 +29,7 @@
return TRUE
/obj/item/storage/doStrip(mob/who)
if(has_trait(TRAIT_NODROP) && rummage_if_nodrop)
if(HAS_TRAIT(src, TRAIT_NODROP) && rummage_if_nodrop)
GET_COMPONENT(CP, /datum/component/storage)
CP.do_quick_empty()
return TRUE

View File

@@ -112,7 +112,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))
user.visible_message("<span class='danger'>[user] accidentally hits [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally hit yourself with [src]!</span>")
user.Paralyze(stunforce*3)

View File

@@ -130,7 +130,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)

View File

@@ -8,7 +8,7 @@
/obj/item/melee/baton/cattleprod/teleprod/attack(mob/living/carbon/M, mob/living/carbon/user)//handles making things teleport when hit
..()
if(status && user.has_trait(TRAIT_CLUMSY) && prob(50))
if(status && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
user.visible_message("<span class='danger'>[user] accidentally hits [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally hit yourself with [src]!</span>")
if(do_teleport(user, get_turf(user), 50, channel = TELEPORT_CHANNEL_BLUESPACE))//honk honk

View File

@@ -75,10 +75,10 @@
return ..()
if(user.zone_selected != BODY_ZONE_PRECISE_EYES && user.zone_selected != BODY_ZONE_HEAD)
return ..()
if(user.has_trait(TRAIT_PACIFISM))
if(HAS_TRAIT(user, TRAIT_PACIFISM))
to_chat(user, "<span class='warning'>You don't want to harm [M]!</span>")
return
if(user.has_trait(TRAIT_CLUMSY) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
M = user
return eyestab(M,user)

View File

@@ -267,8 +267,8 @@
// Copied from /obj/item/melee/transforming/energy/sword/attackby
/obj/item/toy/sword/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/toy/sword))
if(W.has_trait(TRAIT_NODROP) || has_trait(TRAIT_NODROP))
to_chat(user, "<span class='warning'>\the [has_trait(TRAIT_NODROP) ? src : W] is stuck to your hand, you can't attach it to \the [has_trait(TRAIT_NODROP) ? W : src]!</span>")
if(HAS_TRAIT(W, TRAIT_NODROP) || HAS_TRAIT(src, TRAIT_NODROP))
to_chat(user, "<span class='warning'>\the [HAS_TRAIT(src, TRAIT_NODROP) ? src : W] is stuck to your hand, you can't attach it to \the [HAS_TRAIT(src, TRAIT_NODROP) ? W : src]!</span>")
return
else
to_chat(user, "<span class='notice'>You attach the ends of the two plastic swords, making a single double-bladed toy! You're fake-cool.</span>")

View File

@@ -348,7 +348,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))

View File

@@ -91,7 +91,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
/obj/item/claymore/highlander/Initialize()
. = ..()
add_trait(TRAIT_NODROP, HIGHLANDER)
ADD_TRAIT(src, TRAIT_NODROP, HIGHLANDER)
START_PROCESSING(SSobj, src)
/obj/item/claymore/highlander/Destroy()
@@ -255,7 +255,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
user.put_in_hands(S)
to_chat(user, "<span class='notice'>You fasten the glass shard to the top of the rod with the cable.</span>")
else if(istype(I, /obj/item/assembly/igniter) && !(I.has_trait(TRAIT_NODROP)))
else if(istype(I, /obj/item/assembly/igniter) && !(HAS_TRAIT(I, TRAIT_NODROP)))
var/obj/item/melee/baton/cattleprod/P = new /obj/item/melee/baton/cattleprod
remove_item_from_storage(user)
@@ -440,7 +440,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
/obj/item/mounted_chainsaw/Initialize()
. = ..()
add_trait(TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
/obj/item/mounted_chainsaw/Destroy()
var/obj/item/bodypart/part

View File

@@ -72,7 +72,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))

View File

@@ -86,7 +86,7 @@
to_chat(user, "<span class='notice'>Alt-click to [locked ? "unlock" : "lock"].</span>")
if(isliving(user))
var/mob/living/L = user
if(L.has_trait(TRAIT_SKITTISH))
if(HAS_TRAIT(L, TRAIT_SKITTISH))
to_chat(user, "<span class='notice'>Ctrl-Shift-click [src] to jump inside.</span>")
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
@@ -176,7 +176,7 @@
else if(isobj(AM))
if((!allow_dense && AM.density) || AM.anchored || AM.has_buckled_mobs())
return FALSE
else if(isitem(AM) && !AM.has_trait(TRAIT_NODROP))
else if(isitem(AM) && !HAS_TRAIT(AM, TRAIT_NODROP))
return TRUE
else if(!allow_objects && !istype(AM, /obj/effect/dummy/chameleon))
return FALSE
@@ -415,7 +415,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

View File

@@ -186,7 +186,7 @@
/obj/item/gun_control/Initialize()
. = ..()
add_trait(TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
turret = loc
if(!istype(turret))
return INITIALIZE_HINT_QDEL

View File

@@ -184,7 +184,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_BADDNA)) && !mob_occupant.hellbound)
if(mob_occupant.client && !mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_BADDNA)) && !mob_occupant.hellbound)
icon_state = "morgue4" // Cloneable
if(mob_occupant.stat == DEAD && beeper)
if(world.time > next_beep)

View File

@@ -73,7 +73,7 @@
var/sound/music_played = sound(soundfile)
for(var/i in hearing_mobs)
var/mob/M = i
if(user.has_trait(TRAIT_MUSICIAN) && isliving(M))
if(HAS_TRAIT(user, TRAIT_MUSICIAN) && isliving(M))
var/mob/living/L = M
L.apply_status_effect(STATUS_EFFECT_GOOD_MUSIC)
if(!M.client || !(M.client.prefs.toggles & SOUND_INSTRUMENTS))

View File

@@ -17,7 +17,7 @@
L.buckled.unbuckle_mob(L,force=1)
L.visible_message("<span class='warning'>[L]'s skin rapidly turns to marble!</span>", "<span class='userdanger'>Your body freezes up! Can't... move... can't... think...</span>")
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

View File

@@ -50,11 +50,11 @@
playsound(src, 'sound/effects/supermatter.ogg', 50, 1)
dust()
return
if(A.pacifist && !has_trait(TRAIT_PACIFISM, VR_ZONE_TRAIT))
add_trait(TRAIT_PACIFISM, VR_ZONE_TRAIT)
if(A.pacifist && !HAS_TRAIT_FROM(src, TRAIT_PACIFISM, VR_ZONE_TRAIT))
ADD_TRAIT(src, TRAIT_PACIFISM, VR_ZONE_TRAIT)
to_chat(src, "<span class='notice'>You feel like your ability to fight other living beings is being suppressed.</span>")
else if(!A.pacifist && has_trait(TRAIT_PACIFISM, VR_ZONE_TRAIT))
remove_trait(TRAIT_PACIFISM, VR_ZONE_TRAIT)
else if(!A.pacifist && HAS_TRAIT_FROM(src, TRAIT_PACIFISM, VR_ZONE_TRAIT))
REMOVE_TRAIT(src, TRAIT_PACIFISM, VR_ZONE_TRAIT)
to_chat(src, "<span class='notice'>You feel that your ability to fight is no longer being suppressed.</span>")
/mob/living/carbon/human/virtual_reality/proc/revert_to_reality(deathchecks = TRUE)

View File

@@ -80,7 +80,7 @@ GLOBAL_VAR(antag_prototypes)
var/list/result = list()
if(!current)
result += "<span class='bad'>No body!</span>"
if(current && current.has_trait(TRAIT_MINDSHIELD))
if(current && HAS_TRAIT(current, TRAIT_MINDSHIELD))
result += "<span class='good'>Mindshielded</span>"
//Move these to mob
if(iscyborg(current))

View File

@@ -417,7 +417,7 @@
H.equip_to_slot_or_del(I, SLOT_W_UNIFORM)
qdel(olduniform)
if(droptype == "Yes")
I.add_trait(TRAIT_NODROP, ADMIN_TRAIT)
ADD_TRAIT(I, TRAIT_NODROP, ADMIN_TRAIT)
else
to_chat(H, "You're not kawaii enough for this.")

View File

@@ -34,7 +34,7 @@
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"

Some files were not shown because too many files have changed in this diff Show More