Ports (most(ok like half)) station traits from tg. Ready for review into TM (#22334)

* no longer super sick time to port station traits in a 4 hour rush as you have lost control of your life

* some changes /fixes

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* more changes

* oh right, the murders (uplink price tweaks)

* Update code/controllers/subsystem/SSjobs.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* compiles

* doesnt work but works better

* tgui dogs still sleep but I want to sleep

* it should finally compile now. Probably.

* Update tgui.bundle.js

* Sorry IAN, transfer components is shoddy as hell

* removes minor uneeded /tgui

* also extra line whoops

* final stuff

* reverting changes I made earlier is hard ok

* Weight change, uplink reference

* oh right, the hey fucko

* Update code/_globalvars/traits.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update tgui.bundle.js

* pushes

* pulls it

* Apply suggestions from code review

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* more changes, ion rifle blocked on cyb revolution

* dipshit remove the debug / tgui pritier and such

* tgui

* updates tgui again as nanomap was merged

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* comment / tgui

* every day I worry all day

* Full TGUI rebuild + prettier

* ah fuck

* leave a customer feedback at the link below!

* tgui momenr

* tgui moment

* FUCK I am dumb

* vertical TGUI

* She T's on my GUI till I

* Update tgui.bundle.js

* Apply suggestions from code review

Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>

* Update code/modules/supply/supply_pack.dm

Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>

* IPC can now use robotic hearts / pulse demon hearts and charge

* fixes revert not working for hangover / arrivals

* tgui moment

* hhgreg

* fixes that one bug

* Every day I worry all day

* deconflicted for real this t ime

* Update code/datums/station_traits/postive_traits.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* ch-ch-ch-changes

* Update SSjobs.dm

* Update code/modules/supply/supply_pack.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* deconflicted but won't pass CI

* fixes double dipping on traits

* my le consoles, they le no work?

* Great Great Asset, Asset, Great Great Asset, Asset...

* sorry slime mains

* fixes borgs being punished heavier

* actually fixes it, I was dense

* hopefully fixes borg drunk further

* makes it compile?

* actually makes it compile god whyyyy

---------

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2024-01-08 14:07:09 -05:00
committed by GitHub
parent 2c7a9b3078
commit d668a29a60
51 changed files with 1632 additions and 47 deletions
+2
View File
@@ -86,6 +86,8 @@ SUBSYSTEM_DEF(economy)
SUPPLY_MISC,
SUPPLY_VEND
)
///The modifier on crate prices to multiple the price by.
var/pack_price_modifier = 1
//////Paycheck Variables/////
/// time to next payday
+27 -5
View File
@@ -20,6 +20,10 @@ SUBSYSTEM_DEF(jobs)
///list of station departments and their associated roles and economy payments
var/list/station_departments = list()
/// Do we spawn everyone at shuttle due to late arivals?
var/late_arrivals_spawning = FALSE
/// Do we spawn people drunkenly due to the party last night?
var/drunken_spawning = FALSE
/datum/controller/subsystem/jobs/Initialize()
if(!length(occupations))
@@ -469,11 +473,15 @@ SUBSYSTEM_DEF(jobs)
H.job = rank
if(!joined_late)
if(!joined_late && !late_arrivals_spawning)
var/turf/T = null
var/obj/S = null
for(var/obj/effect/landmark/start/sloc in GLOB.landmarks_list)
if(sloc.name != rank)
var/list/landmarks = GLOB.landmarks_list
if(drunken_spawning)
landmarks = shuffle(landmarks) //Shuffle it so it's random
for(var/obj/effect/landmark/start/sloc in landmarks)
if(sloc.name != rank && !drunken_spawning)
continue
if(locate(/mob/living) in sloc.loc)
continue
@@ -521,8 +529,22 @@ SUBSYSTEM_DEF(jobs)
if(istype(G) && !G.prescription)
G.upgrade_prescription()
H.update_nearsighted_effects()
H.create_log(MISC_LOG, "Spawned as \an [H.dna?.species ? H.dna.species : "Undefined species"] named [H]. [joined_late ? "Joined during the round" : "Roundstart joined"] as job: [rank].")
if(joined_late || job.admin_only)
H.create_log(MISC_LOG, "Spawned as \an [H.dna?.species ? H.dna.species : "Undefined species"] named [H]. [joined_late ? "Joined during the round" : "Roundstart joined"] as job: [rank].")
return H
if(late_arrivals_spawning)
H.forceMove(pick(GLOB.latejoin))
if(drunken_spawning)
var/obj/item/organ/internal/liver/L
var/liver_multiplier = 1
L = H.get_int_organ(/obj/item/organ/internal/liver)
if(L)
liver_multiplier = L.alcohol_intensity
if(isslimeperson(H) || isrobot(H))
liver_multiplier = 5
H.Sleeping(5 SECONDS)
H.Drunk((2 / liver_multiplier) MINUTES)
H.create_log(MISC_LOG, "Spawned as \an [H.dna?.species ? H.dna.species : "Undefined species"] named [H]. Roundstart joined as job: [rank].")
return H
/datum/controller/subsystem/jobs/proc/LoadJobs(highpop = FALSE) //ran during round setup, reads info from jobs list
+1
View File
@@ -278,6 +278,7 @@ SUBSYSTEM_DEF(ticker)
watch = start_watch()
GLOB.data_core.manifest() // Create the manifest
log_debug("Manifest creation took [stop_watch(watch)]s")
SEND_SIGNAL(src, COMSIG_TICKER_ROUND_STARTING, world.time)
// Update the MC and state to game playing
current_state = GAME_STATE_PLAYING
@@ -0,0 +1,73 @@
PROCESSING_SUBSYSTEM_DEF(station)
name = "Station"
init_order = INIT_ORDER_STATION
flags = SS_TICKER
wait = 5 SECONDS
cpu_display = SS_CPUDISPLAY_DEFAULT
offline_implications = "Station traits will no longer process. No intervention needed at this time."
/// 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())
/datum/controller/subsystem/processing/station/Initialize()
SetupTraits()
///Rolls for the amount of traits and adds them to the traits list
/datum/controller/subsystem/processing/station/proc/SetupTraits()
if(fexists("data/next_traits.txt"))
var/forced_traits_contents = file2list("data/next_traits.txt")
fdel("data/next_traits.txt")
var/list/temp_list = splittext(forced_traits_contents[1], ",")
for(var/trait_text_path in temp_list)
var/station_trait_path = text2path(trait_text_path)
if(!ispath(station_trait_path, /datum/station_trait) || station_trait_path == /datum/station_trait)
var/message = "Invalid station trait path [station_trait_path] was requested in the future station traits!"
log_game(message)
message_admins(message)
continue
setup_trait(station_trait_path)
return
for(var/i in subtypesof(/datum/station_trait))
var/datum/station_trait/trait_typepath = i
// If forced, (probably debugging), just set it up now, keep it out of the pool.
if(initial(trait_typepath.force))
setup_trait(trait_typepath)
continue
if(initial(trait_typepath.trait_flags) & STATION_TRAIT_ABSTRACT)
continue //Dont add abstract ones to it
selectable_traits_by_types[initial(trait_typepath.trait_type)][trait_typepath] = initial(trait_typepath.weight)
var/positive_trait_count = pick(20;0, 5;1, 1;2)
var/neutral_trait_count = pick(10;0, 10;1, 3;2)
var/negative_trait_count = pick(20;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_sign, amount)
if(!amount)
return
for(var/iterator in 1 to amount)
var/datum/station_trait/trait_type = pickweight(selectable_traits_by_types[trait_sign]) //Rolls from the table for the specific trait type
setup_trait(trait_type)
///Creates a given trait of a specific type, while also removing any blacklisted ones from the future pool.
/datum/controller/subsystem/processing/station/proc/setup_trait(datum/station_trait/trait_type)
var/datum/station_trait/trait_instance = new trait_type()
station_traits += trait_instance
log_game("Station Trait: [trait_instance.name] chosen for this round.")
trait_instance.blacklist += trait_instance.type
for(var/i in trait_instance.blacklist)
var/datum/station_trait/trait_to_remove = i
selectable_traits_by_types[initial(trait_to_remove.trait_type)] -= trait_to_remove