mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-10 09:22:05 +00:00
* tgui the beginning * binaries and the like * Bring in the last of it * Example radio UI * delete example * NTOS Main Menu, start on manifest, tgui states * tasks.json * gunnery ui pt 1 * okay * fix everything * scss update * oops * manifest gigablast * downloader part 1 * download prt 2 * NTOSDownloader final * mfw committing to_worlds * gunnery console pt2 * i cooked * targeting (finished) * one vueui down * voting ui almost done * MY MIND FEELS LIKE AN ARCH ENEMYYYY * voting ui down * photocopier * ntos config + download fixes * photocopier 2 * refactor define * NTOS client manager + fixes * fax machine final (it also uses toner now) * marching forwards... left behind... * ntnrc part 1 * canister * add quotes * portable pumps pt1 + more backgrounds * oops * finish the portable pump * freezers so I'll keep on pushing forward... you haven't seen the last of me... oooooooh... * doors ui pt1 * finish doors UI (forgive me wildkins it's a bit of shitcode) * vitals monitor, make things use labeled lists, new backgrounds * mais j'envoyé aucun mayday... * maglock pt1 * pour ça je me suis perdu... * infrared * fix that * prox sensor pt1 * prox sensor * signaler (this was actually pretty hard) * atmos control pt1 * atmos control pt1.1 * atmos pt 2 * fuel injector * multitool UI * jammer * list viewer * APC * portgen * targeting console updates + SMES ui * new themes, shield generator * supermatter * Add ore detector and (shitty) NTNet Relay * orderterminal pt1 * orderterminal pt2 * smartfridge * Add (air-)tank GUI update ore detector size * Adds Transfer Valves * Add AtmoScrubber * analyzer pt1 * weapons analyzer pt2 * bodyscanner pt1 * bodyscanner pt2 * fix this shitcode * seed storage * appearance changer * appearance changer final * sleeper pt1 * sleeper * gps * vehicles * chem dispenser * lily request * holopad * tgui modules pt1 * ppanel * damage menu * fixes * im here too now * follow menu, search bars * quikpay * quikpay fixes * circuit printer * ppanel * ppanel updates * pai * turret controls (i want to kill myself) * tweak * remove the boardgame * guntracker * implant tracker * penal mechs come close to me, come close to me * chem codex * pai radio * doorjack * pai directives * signaler removal, sensors * ghost spawner * spawnpoint * fixes * teleporter * one more to the chopping block * account database * remove divider * scanner, atmos * latejoin ui pt1 * latejoin * records pt1 * RECORDS UI DONE * delete interpreter & records * CHAT FUCKING CLIENT * data updates * fix some things * final UI, log * basic nanoui fix * antag panel * remove vueui * atm update * vending update * warrants, cameras * ntmonitor * time comes for all * preserve this legacy * bring that back (oops) * rcon, ui auto update for computer UIs, remove rcon computers * alarm monitoring (a bit broke and also todo: add custom alarm monitoring programs to a few consoles) * A LIKE SUPREME * a * power monitor * lights on * fuck this code, fuck nanoui modules, and fuck nanoui * LEAVE IT OH SO FAR BEHIND * fix alarm monitoring for synths * I SAW IN YOU WHAT LIFE WAS MISSING * comms console * idcard and record updates * turn the light on * arcade * pt2 * news browser * static * crusher * f * COULD I JUST SLEIGH THE GOLD FROM THE BALLS? I'M SO FRUSTRATED OH COULD YOU TELL? IF I HEAR ONE MORE VUEUI OR ONE NANOUI I'M GONNA LOSE IT SO LET ME GOOOOOOOOOOOOOOOOO * codeowners & suit sensors * html ui style removal * make lint happy * tgchat * tgpanels pt1 * THE SOUL LONGS FOR OBLIVION!!!!!!!!!!!!!!!!! * figure out why stat isnt working * goodbye ping * shhh * stat updates * An oath sworn in scors! Omni vortex lies! * final almost edits * fix that * last skin adjustments * resist and disorder * i slowly get up and turn off the noise, already fed up... * pleaseeeeeeeeeeeeeee * THE CREDIT LARP IS NECESSARY * i hold the keys * RISE UP * fix that? * harry's suggestions xoxo * runtime fix pt2 * You are the only thing that I still care about * fix runtimes and cl * whoops * misc fixes * fix that too * adds build workflow * f * Update update_tgui.yml * adds some needed steps * ATM * misc fixes and tweaks * fixes 2 * make newscasters usable and fix use power on freezers * turret control is clearer * remove duplicate * makes some verb tabs work properly * makes verbs work properly for real * sans moi * fixes pt2 * fix the chat unnecessarily reloading * fixes * epic * fixes * fix missing consoles --------- Co-authored-by: John Wildkins <john.wildkins@gmail.com> Co-authored-by: Matt Atlas <liermattia@gmail.com> Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> Co-authored-by: Werner <Arrow768@users.noreply.github.com> Co-authored-by: Geeves <ggrobler447@gmail.com> Co-authored-by: harryob <me@harryob.live>
159 lines
5.0 KiB
Plaintext
159 lines
5.0 KiB
Plaintext
/var/datum/controller/subsystem/plants/SSplants
|
|
|
|
/datum/controller/subsystem/plants
|
|
name = "Seeds & Plants"
|
|
flags = 0 // Override parent's flags.
|
|
wait = 75
|
|
init_order = SS_INIT_SEEDS
|
|
priority = SS_PRIORITY_PLANTS
|
|
runlevels = RUNLEVELS_PLAYING
|
|
|
|
var/list/product_descs = list() // Stores generated fruit descs.
|
|
var/list/seeds = list() // All seed data stored here.
|
|
var/list/gene_tag_masks = list() // Gene obfuscation for delicious trial and error goodness.
|
|
var/list/plant_icon_cache = list() // Stores images of growth, fruits and seeds.
|
|
var/list/plant_sprites = list() // List of all harvested product sprites.
|
|
var/list/plant_product_sprites = list() // List of all growth sprites plus number of growth stages.
|
|
var/list/gene_masked_list = list() // Stores list of masked genes rather than recreating it later
|
|
var/list/plant_gene_datums = list() // Stores gene masked list as datums
|
|
|
|
|
|
var/list/processing = list()
|
|
var/list/current = list()
|
|
|
|
/datum/controller/subsystem/plants/New()
|
|
NEW_SS_GLOBAL(SSplants)
|
|
|
|
/datum/controller/subsystem/plants/stat_entry(msg)
|
|
msg = "P:[processing.len]"
|
|
return ..()
|
|
|
|
/datum/controller/subsystem/plants/Initialize(timeofday)
|
|
// Build the icon lists.
|
|
for(var/icostate in icon_states('icons/obj/hydroponics_growing.dmi'))
|
|
var/split = findtext(icostate,"-")
|
|
if(!split)
|
|
// invalid icon_state
|
|
continue
|
|
|
|
var/ikey = copytext(icostate,(split+1))
|
|
if(ikey == "dead")
|
|
// don't count dead icons
|
|
continue
|
|
ikey = text2num(ikey)
|
|
var/base = copytext(icostate,1,split)
|
|
|
|
if(!(plant_sprites[base]) || (plant_sprites[base]<ikey))
|
|
plant_sprites[base] = ikey
|
|
|
|
for(var/icostate in icon_states('icons/obj/hydroponics_products.dmi'))
|
|
var/split = findtext(icostate,"-")
|
|
if(split)
|
|
plant_product_sprites |= copytext(icostate,1,split)
|
|
|
|
// Populate the global seed datum list.
|
|
for(var/type in typesof(/datum/seed)-/datum/seed)
|
|
var/datum/seed/S = new type
|
|
seeds[S.name] = S
|
|
S.uid = "[seeds.len]"
|
|
S.roundstart = 1
|
|
|
|
//Might as well mask the gene types while we're at it.
|
|
var/list/gene_datums = list()
|
|
var/list/used_masks = list()
|
|
var/list/plant_traits = ALL_GENES
|
|
while(plant_traits && plant_traits.len)
|
|
var/gene_tag = pick(plant_traits)
|
|
var/gene_mask = "[uppertext(num2hex(rand(0,255), 0))]"
|
|
|
|
while(gene_mask in used_masks)
|
|
gene_mask = "[uppertext(num2hex(rand(0,255), 0))]"
|
|
|
|
var/singleton/plantgene/G
|
|
|
|
for(var/D in gene_datums)
|
|
var/singleton/plantgene/P = gene_datums[D]
|
|
if(gene_tag == P.gene_tag)
|
|
G = P
|
|
gene_datums -=D
|
|
|
|
used_masks += gene_mask
|
|
plant_traits -= gene_tag
|
|
gene_tag_masks[gene_mask] = gene_tag
|
|
plant_gene_datums[gene_mask] = G
|
|
gene_masked_list += (list(list("tag" = gene_tag, "mask" = gene_mask)))
|
|
|
|
..()
|
|
|
|
/datum/controller/subsystem/plants/Recover()
|
|
if (istype(SSplants))
|
|
src.product_descs = SSplants.product_descs
|
|
src.seeds = SSplants.seeds
|
|
src.gene_tag_masks = SSplants.gene_tag_masks
|
|
src.plant_icon_cache = SSplants.plant_icon_cache
|
|
src.plant_sprites = SSplants.plant_sprites
|
|
src.plant_product_sprites = SSplants.plant_product_sprites
|
|
src.gene_masked_list = SSplants.gene_masked_list
|
|
src.plant_gene_datums = SSplants.plant_gene_datums
|
|
|
|
/datum/controller/subsystem/plants/fire(resumed = 0)
|
|
if (!resumed)
|
|
var/list/old = current // This should be empty, so might as well just reuse it.
|
|
current = processing
|
|
processing = old
|
|
|
|
var/list/queue = current
|
|
while (queue.len)
|
|
var/obj/effect/plant/P = queue[queue.len]
|
|
queue.len--
|
|
|
|
if (!QDELETED(P))
|
|
P.process()
|
|
|
|
if (MC_TICK_CHECK)
|
|
return
|
|
|
|
/datum/controller/subsystem/plants/proc/add_plant(obj/effect/plant/plant)
|
|
processing[plant] = TRUE
|
|
|
|
/datum/controller/subsystem/plants/proc/remove_plant(obj/effect/plant/plant)
|
|
processing -= plant
|
|
|
|
// Proc for creating a random seed type.
|
|
/datum/controller/subsystem/plants/proc/create_random_seed(var/survive_on_station)
|
|
var/datum/seed/seed = new()
|
|
seed.randomize()
|
|
seed.uid = seeds.len + 1
|
|
seed.name = "[seed.uid]"
|
|
seeds[seed.name] = seed
|
|
|
|
if(survive_on_station)
|
|
if(seed.consume_gasses)
|
|
seed.consume_gasses[GAS_PHORON] = null
|
|
seed.consume_gasses[GAS_CO2] = null
|
|
if(seed.chems && !isnull(seed.chems[/singleton/reagent/acid/polyacid]))
|
|
seed.chems[/singleton/reagent/acid/polyacid] = null // Eating through the hull will make these plants completely inviable, albeit very dangerous.
|
|
seed.chems -= null // Setting to null does not actually remove the entry, which is weird.
|
|
seed.set_trait(TRAIT_IDEAL_HEAT,293)
|
|
seed.set_trait(TRAIT_HEAT_TOLERANCE,20)
|
|
seed.set_trait(TRAIT_IDEAL_LIGHT,8)
|
|
seed.set_trait(TRAIT_LIGHT_TOLERANCE,5)
|
|
seed.set_trait(TRAIT_LOWKPA_TOLERANCE,25)
|
|
seed.set_trait(TRAIT_HIGHKPA_TOLERANCE,200)
|
|
return seed
|
|
|
|
// Debug for testing seed genes.
|
|
/client/proc/show_plant_genes()
|
|
set category = "Debug"
|
|
set name = "Show Plant Genes"
|
|
set desc = "Prints the round's plant gene masks."
|
|
|
|
if(!holder) return
|
|
|
|
if(!SSplants || !SSplants.gene_tag_masks)
|
|
to_chat(usr, "Gene masks not set.")
|
|
return
|
|
|
|
for(var/mask in SSplants.gene_tag_masks)
|
|
to_chat(usr, "[mask]: [SSplants.gene_tag_masks[mask]]")
|