Adds some core behavior code, uses it to fix a small bug

This commit is contained in:
Atermonera
2022-07-06 16:49:12 -04:00
committed by VirgoBot
parent d3c467e5e8
commit b5cc715647
7 changed files with 3464 additions and 1 deletions
@@ -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)
@@ -23,6 +24,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"
@@ -195,6 +197,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"
@@ -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.name)
@@ -141,6 +143,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.