Skip to content

Commit

Permalink
Merge remote-tracking branch 'fira-cm-main/oops-sorry-segrain' into t…
Browse files Browse the repository at this point in the history
…rait-hotfix
  • Loading branch information
morrowwolf committed Nov 13, 2023
2 parents 94a6181 + cecf097 commit ae95cb1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
25 changes: 20 additions & 5 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
_L = target._status_traits; \
_L[trait] = list(source); \
SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \
if(trait in GLOB.traits_with_elements){ \
target.AddElement(GLOB.traits_with_elements[trait]); \
} \
} else { \
_L = target._status_traits; \
if (_L[trait]) { \
_L[trait] |= list(source); \
} else { \
_L[trait] = list(source); \
SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \
if(trait in GLOB.traits_with_elements){ \
target.AddElement(GLOB.traits_with_elements[trait]); \
} \
} \
} \
} while (0)
Expand All @@ -38,6 +44,9 @@
if (!length(_L[trait])) { \
_L -= trait; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \
if(trait in GLOB.traits_with_elements) { \
target.RemoveElement(GLOB.traits_with_elements[trait]); \
} \
}; \
if (!length(_L)) { \
target._status_traits = null \
Expand All @@ -62,6 +71,9 @@
if (!length(_traits_list[trait])) { \
_traits_list -= trait; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \
if(trait in GLOB.traits_with_elements) { \
target.RemoveElement(GLOB.traits_with_elements[trait]); \
} \
}; \
if (!length(_traits_list)) { \
target._status_traits = null \
Expand All @@ -78,8 +90,11 @@
if (!length(_L[_T])) { \
_L -= _T; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T), _T); \
if(trait in GLOB.traits_with_elements) { \
target.RemoveElement(GLOB.traits_with_elements[trait]); \
}; \
};\
};\
if (!length(_L)) { \
target._status_traits = null\
};\
Expand All @@ -101,8 +116,11 @@
if (!length(_L[_T])) { \
_L -= _T; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T)); \
if(_T in GLOB.traits_with_elements) { \
target.RemoveElement(GLOB.traits_with_elements[_T]); \
}; \
};\
};\
if (!length(_L)) { \
target._status_traits = null\
};\
Expand All @@ -124,9 +142,6 @@
/// Example trait
// #define TRAIT_X "t_x"

/// cannot be removed without admin intervention
#define ROUNDSTART_TRAIT "roundstart"

//-- mob traits --
/// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this!
#define TRAIT_UNDENSE "undense"
Expand Down Expand Up @@ -355,6 +370,8 @@ GLOBAL_LIST(trait_name_map)
/// Example trait source
// #define TRAIT_SOURCE_Y "t_s_y"
#define TRAIT_SOURCE_INHERENT "t_s_inherent"
/// cannot be removed without admin intervention
#define ROUNDSTART_TRAIT "roundstart"
//-- mob traits --
///Status trait coming from lying down through update_canmove()
#define LYING_TRAIT "lying"
Expand All @@ -364,8 +381,6 @@ GLOBAL_LIST(trait_name_map)
#define TRAIT_SOURCE_HIVE "t_s_hive"
///Status trait coming from being buckled.
#define TRAIT_SOURCE_BUCKLE "t_s_buckle"
///Status trait coming from roundstart quirks (that don't exist yet). Unremovable by REMOVE_TRAIT
#define TRAIT_SOURCE_QUIRK "t_s_quirk"
///Status trait coming from being assigned as [acting] squad leader.
#define TRAIT_SOURCE_SQUAD_LEADER "t_s_squad_leader"
///Status trait coming from their job
Expand Down
8 changes: 4 additions & 4 deletions code/modules/character_traits/biology_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
to_chat(target, SPAN_WARNING("Your species is too sophisticated for you be able to recieve the lisping trait."))
return

ADD_TRAIT(target, TRAIT_LISPING, TRAIT_SOURCE_QUIRK)
ADD_TRAIT(target, TRAIT_LISPING, ROUNDSTART_TRAIT)
target.speech_problem_flag = TRUE

..()

/datum/character_trait/biology/lisp/unapply_trait(mob/living/carbon/human/target)
REMOVE_TRAIT(target, TRAIT_LISPING, TRAIT_SOURCE_QUIRK)
REMOVE_TRAIT(target, TRAIT_LISPING, ROUNDSTART_TRAIT)
target.speech_problem_flag = FALSE
..()

Expand Down Expand Up @@ -127,9 +127,9 @@
to_chat(target, SPAN_WARNING("Only riflemen can have the Hardcore trait."))
return

ADD_TRAIT(target, TRAIT_HARDCORE, TRAIT_SOURCE_QUIRK)
ADD_TRAIT(target, TRAIT_HARDCORE, ROUNDSTART_TRAIT)
..()

/datum/character_trait/biology/hardcore/unapply_trait(mob/living/carbon/human/target)
REMOVE_TRAIT(target, TRAIT_HARDCORE, TRAIT_SOURCE_QUIRK)
REMOVE_TRAIT(target, TRAIT_HARDCORE, ROUNDSTART_TRAIT)
..()

0 comments on commit ae95cb1

Please sign in to comment.