Merge pull request #13290 from VOREStation/upstream-merge-8660

[MIRROR] Adds some core behavior code, uses it to fix a small bug (ABLE TO BE MERGED)
This commit is contained in:
C.L
2022-09-24 21:21:24 -04:00
committed by CHOMPStation2
parent 6ed92a2bf9
commit 8e6652e1b0
17 changed files with 177 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
// The actual modifiers (if used) for these are stored inside code/modules/mob/_modifiers/traits.dm
/datum/trait/modifier
abstract_type = /datum/trait/modifier
var/modifier_type = null // Type to add to the mob post spawn.
/datum/trait/modifier/apply_trait_post_spawn(mob/living/L)
@@ -26,6 +27,7 @@
// Physical traits are what they sound like, and involve the character's physical body, as opposed to their mental state.
/datum/trait/modifier/physical
abstract_type = /datum/trait/modifier/physical
name = "Physical"
category = "Physical"
@@ -198,6 +200,7 @@
// 'Mental' traits are just those that only sapients can have, for now, and generally involves fears.
// So far, all of them are just for fluff/don't have mechanical effects.
/datum/trait/modifier/mental
abstract_type = /datum/trait/modifier/mental
name = "Mental"
category = "Mental"

View File

@@ -5,7 +5,9 @@ var/list/trait_categories = list() // The categories available for the trait men
/hook/startup/proc/populate_trait_list()
//create a list of trait datums
for(var/trait_type in typesof(/datum/trait) - list(/datum/trait, /datum/trait/modifier))
for(var/trait_type as anything in subtypesof(/datum/trait))
if (is_abstract(trait_type))
continue
var/datum/trait/T = new trait_type
if(!T.is_available())
qdel(T)
@@ -144,6 +146,7 @@ var/list/trait_categories = list() // The categories available for the trait men
/datum/trait
abstract_type = /datum/trait
var/name = null // Name to show on UI
var/desc = null // Description of what it does, also shown on UI.
var/list/mutually_exclusive = list() // List of trait types which cannot be taken alongside this trait.