Files
Bubberstation/code/controllers/subsystem/processing/station.dm
Qustinnus 95731342b9 [READY] Adds station traits: Small modifiers that can randomly be chosen each round (#56309)
This PR adds station traits which are essentially small changes to a normal round that can be used to create small variations in how a round might play out, sometimes there might be only one, very simple trait, but you might have a round where they have a somewhat bigger impact, to make rounds feel slightly more different from each other.

The following traits have been added:
Positive:

    Lucky winner - Free pizza and beer every 6-12 minutes
    Galactic Grant - Larger starting funds for cargo
    Premium internals boxes - emergency box has flare + radio as bonus
    Bountiful bounties - Bounties pay 20% more
    Strong supply lines - Imports 20% cheaper
    Filled maint - More loot in maint
    Fast shuttle - Cargo shuttle is faster
    Free scarves - Free scarfs if a slot is free

Neutral:

    Bananium shipment - Clown starts with 5 sheets of bananium (Neutral because this helps noone but the clown)
    Unnatural atmosphere - Lava planet can get more restricted gasses
    Unique AI - Random lawset at roundstart for AI
    Ian adventure - Ian teleports to a random spot on the station
    Glitched PDAs - PDA's have a different beep
    Announcer intern - Changes the announcement messages to sound like they're from an intern at Centcom

Negative:

    Carp infestation - Carp event is more common and can start earlier
    Weak supply lines - Imports 20% more expensive
    Blackout - Station lights are partially broken around the station
    Empty maint - Less loot in maint
    Overflow bureacracy mistake - Random overflow job (From a vetted list)
    Late Arrivals - Everyone starts in arrivals
    Random spawns - Random spawn location (by drop pod)
    Slow shuttle - Cargo shuttle is slower

Co-authored-by: Mothblocks <35135081+Jared-Fogle@users.noreply.github.com>
Co-authored-by: coiax <yellowbounder@gmail.com>
2021-02-05 15:49:49 -08:00

53 lines
2.3 KiB
Plaintext

PROCESSING_SUBSYSTEM_DEF(station)
name = "Station"
init_order = INIT_ORDER_STATION
flags = SS_BACKGROUND
runlevels = RUNLEVEL_GAME
wait = 5 SECONDS
///A list of currently active station traits
var/list/station_traits = list()
///Assoc list of trait type || assoc list of traits with weighted value. Used for picking traits from a specific category.
var/list/selectable_traits_by_types = list(STATION_TRAIT_POSITIVE = list(), STATION_TRAIT_NEUTRAL = list(), STATION_TRAIT_NEGATIVE = list())
///Currently active announcer. Starts as a type but gets initialized after traits are selected
var/datum/centcom_announcer/announcer = /datum/centcom_announcer/default
/datum/controller/subsystem/processing/station/Initialize(timeofday)
//If doing unit tests we don't do none of that trait shit ya know?
#ifndef UNIT_TESTS
SetupTraits()
#endif
announcer = new announcer() //Initialize the station's announcer datum
return ..()
///Rolls for the amount of traits and adds them to the traits list
/datum/controller/subsystem/processing/station/proc/SetupTraits()
for(var/i in subtypesof(/datum/station_trait))
var/datum/station_trait/trait_typepath = i
selectable_traits_by_types[initial(trait_typepath.trait_type)][trait_typepath] = initial(trait_typepath.weight)
var/positive_trait_count = pick(12;0, 5;1, 1;2)
var/neutral_trait_count = pick(5;0, 10;1, 3;2)
var/negative_trait_count = pick(12;0, 5;1, 1;2)
pick_traits(STATION_TRAIT_POSITIVE, positive_trait_count)
pick_traits(STATION_TRAIT_NEUTRAL, neutral_trait_count)
pick_traits(STATION_TRAIT_NEGATIVE, negative_trait_count)
///Picks traits of a specific category (e.g. bad or good) and a specified amount, then initializes them and adds them to the list of traits.
/datum/controller/subsystem/processing/station/proc/pick_traits(trait_type, amount)
if(!amount)
return
for(var/iterator in 1 to amount)
var/datum/station_trait/picked_trait = pickweight(selectable_traits_by_types[trait_type]) //Rolls from the table for the specific trait type
picked_trait = new picked_trait()
station_traits += picked_trait
if(!picked_trait.blacklist)
continue
for(var/i in picked_trait.blacklist)
var/datum/station_trait/trait_to_remove = i
selectable_traits_by_types[initial(trait_to_remove.trait_type)] -= trait_to_remove