Skip to content

Commit

Permalink
tweak(botany): removes gene shuffling & merges xenobotany with botany
Browse files Browse the repository at this point in the history
  • Loading branch information
intercepti0n authored May 28, 2024
1 parent 17ec8da commit a502b94
Show file tree
Hide file tree
Showing 36 changed files with 852 additions and 614 deletions.
2 changes: 1 addition & 1 deletion baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,8 @@
#include "code\game\objects\items\circuitboards\computer\research.dm"
#include "code\game\objects\items\circuitboards\computer\station_alert.dm"
#include "code\game\objects\items\circuitboards\computer\telecomms.dm"
#include "code\game\objects\items\circuitboards\machinery\biogenerator.dm"
#include "code\game\objects\items\circuitboards\machinery\commsantenna.dm"
#include "code\game\objects\items\circuitboards\machinery\hydroponics.dm"
#include "code\game\objects\items\circuitboards\machinery\kitchen.dm"
#include "code\game\objects\items\circuitboards\machinery\machinery_circuitboards.dm"
#include "code\game\objects\items\circuitboards\machinery\mech_recharger.dm"
Expand Down
29 changes: 4 additions & 25 deletions code/controllers/subsystems/plants.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ PROCESSING_SUBSYSTEM_DEF(plants)
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() // Stored gene masked list, rather than recreating it when needed.
var/list/plant_gene_datums = list() // Stored datum versions of the gene masked list.
var/list/plant_gene_datums = list() // Stored datum versions of the gene list.
var/list/canonical_plants = list() // Validation keys for canonical icons usage.
var/list/canonical_plant_sprites = list() // The same as plant_sprites, but for the canonical ones.
var/list/canonical_plant_icon_cache = list()
Expand Down Expand Up @@ -72,29 +71,9 @@ PROCESSING_SUBSYSTEM_DEF(plants)
for(var/obj/item/seeds/S in world)
S.update_seed()

//Might as well mask the gene types while we're at it.
var/list/gene_datums = decls_repository.get_decls_of_subtype(/decl/plantgene)
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)))]"

while(gene_mask in used_masks)
gene_mask = "[uppertext(num2hex(rand(0,255)))]"

var/decl/plantgene/G

for(var/D in gene_datums)
var/decl/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_tag] = gene_mask
plant_gene_datums[gene_mask] = G
gene_masked_list.Add(list(list("tag" = gene_tag, "mask" = gene_mask)))
for (var/decl/plantgene/gene as anything in decls_repository.get_decls_of_subtype(/decl/plantgene))
plant_gene_datums[gene.gene_tag] = gene

. = ..()

// Proc for creating a random seed type.
Expand Down
2 changes: 1 addition & 1 deletion code/datums/supplypacks/hydroponics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
cost = 15
containertype = /obj/structure/closet/crate/secure
containername = "\improper Exotic Seeds crate"
access = access_xenobiology
access = access_hydroponics

/decl/hierarchy/supply_pack/hydroponics/watertank
name = "Water tank crate"
Expand Down
5 changes: 2 additions & 3 deletions code/game/jobs/job/science.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@
supervisors = "the research director"
selection_color = "#633d63"
economic_modifier = 7
access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_hydroponics)
minimal_access = list(access_research, access_xenobiology, access_hydroponics)
alt_titles = list("Xenobotanist")
access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology)
minimal_access = list(access_research, access_xenobiology)
minimal_player_age = 7
outfit_type = /decl/hierarchy/outfit/job/science/xenobiologist

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/seed_extractor.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/obj/machinery/seed_extractor
name = "seed extractor"
desc = "Extracts and bags seeds from produce."
icon = 'icons/obj/hydroponics_machines.dmi'
icon = 'icons/obj/machines/seed_extractor.dmi'
icon_state = "sextractor"
layer = BELOW_OBJ_LAYER
density = 1
Expand Down
12 changes: 0 additions & 12 deletions code/game/objects/items/circuitboards/machinery/biogenerator.dm

This file was deleted.

24 changes: 24 additions & 0 deletions code/game/objects/items/circuitboards/machinery/hydroponics.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef T_BOARD
#error T_BOARD macro is not defined but we need it!
#endif

/obj/item/circuitboard/genemod
name = T_BOARD("Genetic Forge")
board_type = "machine"
req_components = list(
/obj/item/stock_parts/console_screen = 1,
/obj/item/stock_parts/micro_laser = 1,
/obj/item/stock_parts/manipulator = 1,
)
build_path = /obj/machinery/genemod
origin_tech = list(TECH_ENGINEERING = 2, TECH_BIO = 1)

/obj/item/circuitboard/biogenerator
name = T_BOARD("biogenerator")
build_path = /obj/machinery/biogenerator
board_type = "machine"
req_components = list(
/obj/item/stock_parts/matter_bin = 1,
/obj/item/stock_parts/manipulator = 1,
)
origin_tech = list(TECH_DATA = 2)
2 changes: 1 addition & 1 deletion code/game/objects/items/storage/specialized.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/obj/item/storage/plants
name = "botanical satchel"
desc = "This bag can be used to store all kinds of plant products and botanical specimen."
icon = 'icons/obj/hydroponics_machines.dmi'
icon = 'icons/obj/hydroponics_items.dmi'
icon_state = "plantbag"
slot_flags = SLOT_BELT
max_storage_space = 100
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/crates_lockers/crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@

/obj/structure/closet/crate/hydroponics/prespawned/WillContain()
return list(
/obj/item/reagent_containers/vessel/bucket/watercan = 2,
/obj/item/reagent_containers/spray/plantbgone = 2,
/obj/item/material/minihoe = 2,
/obj/item/storage/plants = 2,
Expand Down
2 changes: 0 additions & 2 deletions code/modules/Z_item_worth/worths_list.dm
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,6 @@ var/list/worths = list(
/obj/machinery/computer/account_database = -3000,
/obj/machinery/atm = -4500,
/obj/machinery/food_replicator = -9000,
/obj/machinery/botany/editor = -16000,
/obj/machinery/botany = -9050,
/obj/machinery/seed_storage = -500,
/obj/machinery/beehive = -500,
/obj/machinery/portable_atmospherics/hydroponics/soil = 1, //its dirt,
Expand Down
21 changes: 19 additions & 2 deletions code/modules/hydroponics/seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
var/genetype // Label used when applying trait.
var/list/values // Values to copy into the target seed datum.

var/source
var/source_short

/datum/plantgene/New(datum/seed/sampled_from, gene_name)
src.genetype = gene_name

source = "[gene_name], sampled from [sampled_from.display_name]"
source_short = "[copytext(capitalize(gene_name), 1, 3)], #[sampled_from.uid]"

/datum/seed
//Tracking.
var/uid // Unique identifier.
Expand Down Expand Up @@ -653,8 +662,7 @@
if(!genetype) return 0

var/list/traits_to_copy
var/datum/plantgene/P = new()
P.genetype = genetype
var/datum/plantgene/P = new(src, genetype)
P.values = list()

switch(genetype)
Expand Down Expand Up @@ -841,3 +849,12 @@

/datum/seed/proc/is_canonical()
return canonical_icon && (SSplants.canonical_plants[canonical_icon] == get_canonical_key())

/// Checks whether this seed is unique and saves it if necessary.
/datum/seed/proc/save_seed()
if(name != "new line" && isnull(SSplants.seeds[name]))
return

uid = sequential_id(/datum/seed/)
name = "[uid]"
SSplants.seeds[name] = src
Loading

0 comments on commit a502b94

Please sign in to comment.