diff --git a/code/__DEFINES/station.dm b/code/__DEFINES/station.dm index ddaa82daffc..63430b52c37 100644 --- a/code/__DEFINES/station.dm +++ b/code/__DEFINES/station.dm @@ -2,12 +2,10 @@ #define STATION_TRAIT_NEUTRAL 2 #define STATION_TRAIT_NEGATIVE 3 -/// For traits that shouldn't be selected, like abstract types (wow) -#define STATION_TRAIT_ABSTRACT (1<<0) /// Only run on planet stations -#define STATION_TRAIT_PLANETARY (1<<1) +#define STATION_TRAIT_PLANETARY (1<<0) /// Only run on space stations -#define STATION_TRAIT_SPACE_BOUND (1<<2) +#define STATION_TRAIT_SPACE_BOUND (1<<1) /// Not restricted by space or planet, can always just happen #define STATION_TRAIT_MAP_UNRESTRICTED STATION_TRAIT_PLANETARY | STATION_TRAIT_SPACE_BOUND diff --git a/code/controllers/subsystem/processing/station.dm b/code/controllers/subsystem/processing/station.dm index 224d790faca..95a47a8de5c 100644 --- a/code/controllers/subsystem/processing/station.dm +++ b/code/controllers/subsystem/processing/station.dm @@ -58,7 +58,7 @@ PROCESSING_SUBSYSTEM_DEF(station) setup_trait(trait_typepath) continue - if(initial(trait_typepath.trait_flags) & STATION_TRAIT_ABSTRACT) + if(initial(trait_typepath.abstract_type) == trait_typepath) continue //Dont add abstract ones to it if(!(initial(trait_typepath.trait_flags) & STATION_TRAIT_PLANETARY) && SSmapping.is_planetary()) // we're on a planet but we can't do planet ;_; diff --git a/code/datums/station_traits/_station_trait.dm b/code/datums/station_traits/_station_trait.dm index 8e5b6310c71..8b2f7158b2e 100644 --- a/code/datums/station_traits/_station_trait.dm +++ b/code/datums/station_traits/_station_trait.dm @@ -33,6 +33,8 @@ GLOBAL_LIST_EMPTY(lobby_station_traits) var/dynamic_threat_id /// If ran during dynamic, do we reduce the total threat? Will be overriden by config if set var/threat_reduction = 0 + /// Trait should not be instantiated in a round if its type matches this type + var/abstract_type = /datum/station_trait /datum/station_trait/New() . = ..() diff --git a/code/datums/station_traits/job_traits.dm b/code/datums/station_traits/job_traits.dm index 12aa42332a9..300d6da8fa2 100644 --- a/code/datums/station_traits/job_traits.dm +++ b/code/datums/station_traits/job_traits.dm @@ -4,7 +4,7 @@ */ /datum/station_trait/job sign_up_button = TRUE - trait_flags = STATION_TRAIT_ABSTRACT + abstract_type = /datum/station_trait/job /// What tooltip to show on the button var/button_desc = "Sign up to gain some kind of unusual job, not available in most rounds." /// Type of job to enable @@ -68,7 +68,6 @@ weight = 1 show_in_report = FALSE // Selective attention test. Did you spot the gorilla? job_to_add = /datum/job/cargo_gorilla - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED /datum/station_trait/job/cargorilla/New() . = ..() diff --git a/code/datums/station_traits/negative_traits.dm b/code/datums/station_traits/negative_traits.dm index 7483aaf56b3..154d82cca74 100644 --- a/code/datums/station_traits/negative_traits.dm +++ b/code/datums/station_traits/negative_traits.dm @@ -254,7 +254,7 @@ name = "Random Event Modifier" report_message = "A random event has been modified this shift! Someone forgot to set this!" show_in_report = TRUE - trait_flags = STATION_TRAIT_ABSTRACT + abstract_type = /datum/station_trait/random_event_weight_modifier weight = 0 /// The path to the round_event_control that we modify. @@ -277,7 +277,6 @@ name = "Ionic Stormfront" report_message = "An ionic stormfront is passing over your station's system. Expect an increased likelihood of ion storms afflicting your station's silicon units." trait_type = STATION_TRAIT_NEGATIVE - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 3 event_control_path = /datum/round_event_control/ion_storm weight_multiplier = 2 @@ -286,7 +285,6 @@ name = "Radiation Stormfront" report_message = "A radioactive stormfront is passing through your station's system. Expect an increased likelihood of radiation storms passing over your station, as well the potential for multiple radiation storms to occur during your shift." trait_type = STATION_TRAIT_NEGATIVE - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 2 event_control_path = /datum/round_event_control/radiation_storm weight_multiplier = 1.5 @@ -296,7 +294,6 @@ name = "Dust Stormfront" report_message = "The space around your station is clouded by heavy pockets of space dust. Expect an increased likelyhood of space dust storms damaging the station hull." trait_type = STATION_TRAIT_NEGATIVE - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 2 event_control_path = /datum/round_event_control/meteor_wave/dust_storm weight_multiplier = 2 @@ -424,7 +421,7 @@ ///Station traits that influence the space background and apply some unique effects! /datum/station_trait/nebula name = "Nebula" - trait_flags = STATION_TRAIT_ABSTRACT + abstract_type = /datum/station_trait/nebula weight = 0 show_in_report = TRUE @@ -445,7 +442,7 @@ ///Station nebula that incur some sort of effect if no shielding is created /datum/station_trait/nebula/hostile - trait_flags = STATION_TRAIT_ABSTRACT + abstract_type = /datum/station_trait/nebula/hostile trait_processes = TRUE ///Intensity of the nebula @@ -663,7 +660,7 @@ ///Starts a storm on roundstart /datum/station_trait/storm - trait_flags = STATION_TRAIT_ABSTRACT + abstract_type = /datum/station_trait/storm var/datum/weather/storm_type /datum/station_trait/storm/on_round_start() diff --git a/code/datums/station_traits/positive_traits.dm b/code/datums/station_traits/positive_traits.dm index 9b05a146555..ce9e1ec4a27 100644 --- a/code/datums/station_traits/positive_traits.dm +++ b/code/datums/station_traits/positive_traits.dm @@ -133,7 +133,7 @@ name = "deathrattled department" trait_type = STATION_TRAIT_POSITIVE show_in_report = TRUE - trait_flags = STATION_TRAIT_ABSTRACT + abstract_type = /datum/station_trait/deathrattle_department blacklist = list(/datum/station_trait/deathrattle_all) var/department_to_apply_to @@ -161,49 +161,42 @@ /datum/station_trait/deathrattle_department/service name = "Deathrattled Service" - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 1 department_to_apply_to = DEPARTMENT_BITFLAG_SERVICE department_name = "Service" /datum/station_trait/deathrattle_department/cargo name = "Deathrattled Cargo" - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 1 department_to_apply_to = DEPARTMENT_BITFLAG_CARGO department_name = "Cargo" /datum/station_trait/deathrattle_department/engineering name = "Deathrattled Engineering" - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 1 department_to_apply_to = DEPARTMENT_BITFLAG_ENGINEERING department_name = "Engineering" /datum/station_trait/deathrattle_department/command name = "Deathrattled Command" - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 1 department_to_apply_to = DEPARTMENT_BITFLAG_COMMAND department_name = "Command" /datum/station_trait/deathrattle_department/science name = "Deathrattled Science" - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 1 department_to_apply_to = DEPARTMENT_BITFLAG_SCIENCE department_name = "Science" /datum/station_trait/deathrattle_department/security name = "Deathrattled Security" - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 1 department_to_apply_to = DEPARTMENT_BITFLAG_SECURITY department_name = "Security" /datum/station_trait/deathrattle_department/medical name = "Deathrattled Medical" - trait_flags = STATION_TRAIT_MAP_UNRESTRICTED weight = 1 department_to_apply_to = DEPARTMENT_BITFLAG_MEDICAL department_name = "Medical"