Skip to content

Commit

Permalink
TGS Test Merge (#7023)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Nov 3, 2024
2 parents 51de25e + 2efb25f commit 0572b52
Show file tree
Hide file tree
Showing 49 changed files with 996 additions and 939 deletions.
22 changes: 20 additions & 2 deletions code/__DEFINES/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@
#define CHEM_CLASS_COMMON 2
/// Chemicals which recipe is uncommonly known and made (spacedrugs, foaming agent)
#define CHEM_CLASS_UNCOMMON 3
/// Chemicals without a recipe but can be obtained on the Almayer, or requires rare components
/// Chemicals with or without a recipe but can be obtained on the Almayer, or requires rare components
#define CHEM_CLASS_RARE 4
/// Chemicals without a recipe and can't be obtained on the Almayer, or requires special components
#define CHEM_CLASS_SPECIAL 5
/// Randomly generated chemicals
#define CHEM_CLASS_ULTRA 6
/// Rare chemicals ONLY aquired via hydroponics, Those are mostly useless but very important for hard difficulty on contracts.
#define CHEM_CLASS_HYDRO 7

//chem_effect_flags, used to quickly check if the mob has a chem that provides a special effect
#define CHEM_EFFECT_RESIST_FRACTURE (1<<0)
Expand Down Expand Up @@ -196,6 +198,7 @@
#define PROPERTY_DNA_DISINTEGRATING "DNA-Disintegrating"
#define PROPERTY_REGULATING "regulating"
#define PROPERTY_CIPHERING "ciphering"
#define PROPERTY_ENCRYPTED "encrypted"
#define PROPERTY_CIPHERING_PREDATOR "cross-ciphering"
#define PROPERTY_FIRE_PENETRATING "fire-penetrating"
//Admin Only Properties
Expand Down Expand Up @@ -225,6 +228,9 @@
#define PROPERTY_UNKNOWN "unknown" //just has an OD effect
#define PROPERTY_HEMOSITIC "hemositic"

///Legendary properties, no PROPERTY_TYPE_ANOMALOUS, only normal ones.
#define PROPERTY_LEGENDARY_LIST list(PROPERTY_HYPERGENETIC, PROPERTY_BOOSTING, PROPERTY_REGULATING)


//Property rarity

Expand All @@ -236,7 +242,7 @@
#define PROPERTY_UNCOMMON 2
/// can only be generated at specific gen_tiers, but can also be made through specific property combinations
#define PROPERTY_RARE 3
/// can strictly only be generated at specific gen_tiers
/// can strictly only be made through random generated property combinations, hints are found groundside.
#define PROPERTY_LEGENDARY 4
/// can only be spawned through admin powers
#define PROPERTY_ADMIN 5
Expand Down Expand Up @@ -268,13 +274,25 @@

/// Scales cost of increasing clearance using credits
#define RESEARCH_LEVEL_INCREASE_MULTIPLIER 3
/// Amount of contract chemicals that should be generated
#define RESEARCH_CONTRACT_CHEM_AMOUNT 3
///reroll in X minutes if our contract is NOT picked
#define RESEARCH_CONTRACT_NOT_PICKED 4 MINUTES
///reroll in X minutes if our contract IS picked
#define RESEARCH_CONTRACT_PICKED 7 MINUTES
/// Scales tech level to max amplification level
#define TECHTREE_LEVEL_MULTIPLIER 2
/// how many properties to combine into legendary
#define LEGENDARY_COMBINE_PROPERTIES 3
/// how many properties to combine into ciphering from encrypted.
#define CIPHERING_COMBINE_PROPERTIES LEGENDARY_COMBINE_PROPERTIES + 1

//Property cost multipliers for the chemical simulator
#define PROPERTY_COST_MAX 8
#define PROPERTY_MULTIPLIER_RARE 2
#define PROPERTY_MULTIPLIER_ANOMALOUS 5
#define PROPERTY_MULTIPLIER_ADD_BULK 2 // if you use the add mode if target has X(currently 6) or more properties
#define PROPERTY_MULTIPLIER_ADD_VALUE 3 // if you use the add mode if the target total value of the properties is above a certain value

/*
For minimum potencies for properties
Expand Down
5 changes: 2 additions & 3 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
#define ASSEMBLY_UNLOCKED 1
#define ASSEMBLY_LOCKED 2

// RESEARCH UPGRADES DEFINES //
// RESEARCH DEFINES //

// Matrix CAS Upgrades
#define MATRIX_DEFAULT 0
Expand Down Expand Up @@ -188,8 +188,7 @@
#define EMERGENCY_PLATE_OD_WARNING 1
#define EMERGENCY_PLATE_ADJUSTED_WARNING 2


// RESEARCH UPGRADES DEFINES END
// RESEARCH DEFINES END

// Statistics defines
#define STATISTIC_XENO "xeno"
Expand Down
4 changes: 2 additions & 2 deletions code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ GLOBAL_LIST_INIT_TYPED(conflicting_properties, /list, list( PROPERTY_NUTRITIOUS
PROPERTY_HYPOMETABOLIC = PROPERTY_HYPERMETABOLIC, PROPERTY_HYPERTHROTTLING = PROPERTY_NEUROINHIBITING,
PROPERTY_FOCUSING = PROPERTY_NERVESTIMULATING, PROPERTY_THERMOSTABILIZING = PROPERTY_HYPERTHERMIC, PROPERTY_THERMOSTABILIZING = PROPERTY_HYPOTHERMIC,
PROPERTY_AIDING = PROPERTY_NEUROINHIBITING, PROPERTY_OXYGENATING = PROPERTY_HYPOXEMIC, PROPERTY_ANTICARCINOGENIC = PROPERTY_CARCINOGENIC, \
PROPERTY_CIPHERING = PROPERTY_CIPHERING_PREDATOR, PROPERTY_TRANSFORMATIVE = PROPERTY_ANTITOXIC, PROPERTY_MUSCLESTIMULATING = PROPERTY_NERVESTIMULATING))
PROPERTY_CIPHERING = PROPERTY_CIPHERING_PREDATOR, PROPERTY_TRANSFORMATIVE = PROPERTY_ANTITOXIC))
//list of all properties that combine into something else, now featured in global list
GLOBAL_LIST_INIT_TYPED(combining_properties, /list, list( PROPERTY_DEFIBRILLATING = list(PROPERTY_MUSCLESTIMULATING, PROPERTY_CARDIOPEUTIC),\
PROPERTY_THANATOMETABOL = list(PROPERTY_HYPOXEMIC, PROPERTY_CRYOMETABOLIZING, PROPERTY_NEUROCRYOGENIC),\
Expand All @@ -148,7 +148,7 @@ GLOBAL_LIST_INIT_TYPED(combining_properties, /list, list( PROPERTY_DEFIBRILLATIN
PROPERTY_BONEMENDING = list(PROPERTY_HYPERDENSIFICATING, PROPERTY_NUTRITIOUS),\
PROPERTY_ENCEPHALOPHRASIVE = list(PROPERTY_NERVESTIMULATING, PROPERTY_PSYCHOSTIMULATING)))
//List of all id's from classed /datum/reagent datums indexed by class or tier. Used by chemistry generator and chem spawners.
GLOBAL_LIST_INIT_TYPED(chemical_gen_classes_list, /list, list("C" = list(),"C1" = list(),"C2" = list(),"C3" = list(),"C4" = list(),"C5" = list(),"C6" = list(),"T1" = list(),"T2" = list(),"T3" = list(),"T4" = list(),"tau", list()))
GLOBAL_LIST_INIT_TYPED(chemical_gen_classes_list, /list, list("C" = list(),"C1" = list(),"C2" = list(),"C3" = list(),"C4" = list(),"C5" = list(),"C6" = list(),"T1" = list(),"T2" = list(),"T3" = list(),"T4" = list(), "H1" = list(), "tau", list()))
//properties generated in chemicals, helps to make sure the same property doesn't show up 10 times
GLOBAL_LIST_INIT_TYPED(generated_properties, /list, list("positive" = list(), "negative" = list(), "neutral" = list()))

Expand Down
11 changes: 8 additions & 3 deletions code/controllers/subsystem/objectives_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ SUBSYSTEM_DEF(objectives)
var/disks = 30
var/experimental_devices = 15
var/research_papers = 15
var/vial_boxes = 20
var/vial_boxes = 15
var/research_legendary_hints = 8

//A stub of tweaking item spawns based on map
switch(SSmapping.configs[GROUND_MAP])
Expand All @@ -131,7 +132,6 @@ SUBSYSTEM_DEF(objectives)
folders = 25
disks = 25
if(MAP_CORSAT)
vial_boxes = 30
research_papers = 30
experimental_devices = 20

Expand Down Expand Up @@ -191,10 +191,15 @@ SUBSYSTEM_DEF(objectives)
for(var/i=0;i<research_papers;i++)
var/dest = pick(10;"close", 8;"medium", 2;"far", 20;"science", 15;"close_documents", 12;"medium_documents", 3;"far_documents", 30;"science_documents")
spawn_objective_at_landmark(dest, /obj/item/paper/research_notes)
for(var/i=0;i<research_legendary_hints;i++)//;-;
var/dest = pick(5;"close", 8;"medium", 7;"far", 20;"science", 13;"close_documents", 9;"medium_documents", 13;"far_documents", 25;"science_documents")
spawn_objective_at_landmark(dest, pick_weight(list(/obj/item/paper/research_notes/leg_hint = 5, /obj/item/paper/research_notes/ciph_hint/complete = 3)))
for(var/i=0;i<vial_boxes;i++)
var/dest = pick(15;"close", 30;"medium", 5;"far", 50;"science")
var/dest = pick(40;"medium", 20;"far", 40;"science")
spawn_objective_at_landmark(dest, /obj/item/storage/fancy/vials/random)



// Populate the map with objective items.

/datum/controller/subsystem/objectives/proc/spawn_objective_at_landmark(dest, obj/item/it)
Expand Down
20 changes: 19 additions & 1 deletion code/controllers/subsystem/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,32 @@ SUBSYSTEM_DEF(reagents)
GLOB.chemical_data.research_property_data += chem
if(prop.rarity > PROPERTY_DISABLED)
//Filters for the generator picking properties
if(prop.rarity == PROPERTY_RARE || prop.rarity == PROPERTY_LEGENDARY)
if(prop.rarity == PROPERTY_RARE) //legendary properties are no more
GLOB.chemical_properties_list["rare"][prop.name] = prop
else if(isNegativeProperty(prop))
GLOB.chemical_properties_list["negative"][prop.name] = prop
else if(isNeutralProperty(prop))
GLOB.chemical_properties_list["neutral"][prop.name] = prop
else if(isPositiveProperty(prop))
GLOB.chemical_properties_list["positive"][prop.name] = prop
//preparing combining properties
var/list/special_chemicals = subtypesof(/datum/chem_property/special)//preparing random generation for legendary properties
for(var/property in special_chemicals)
var/list/recipe = list()
var/datum/chem_property/prop = property
if((prop.rarity == PROPERTY_LEGENDARY && prop.category != PROPERTY_TYPE_ANOMALOUS) || prop.name == PROPERTY_CIPHERING)
for(var/recipe_attempts in 1 to 5) //five attempts at generating valid recipe.
for(var/properties in 1 to LEGENDARY_COMBINE_PROPERTIES)
recipe += pick(GLOB.chemical_properties_list[pick("neutral", "positive", "negative")])
if(length(recipe) == LEGENDARY_COMBINE_PROPERTIES)
if(prop.name == PROPERTY_CIPHERING)
recipe += PROPERTY_ENCRYPTED
break
recipe = list()//reset the list if its invalid
if(length(recipe) >= 3)
GLOB.combining_properties[prop.name] = recipe



/datum/controller/subsystem/reagents/proc/prepare_reagents()
//I dislike having these here but map-objects are initialised before world/New() is called. >_>
Expand Down
2 changes: 1 addition & 1 deletion code/datums/recipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@
/datum/recipe/nettlesoup
reagents = list("water" = 10)
items = list(
/obj/item/grown/nettle,
/obj/item/reagent_container/food/snacks/grown/nettle,
/obj/item/reagent_container/food/snacks/grown/potato,
/obj/item/reagent_container/food/snacks/egg,
)
Expand Down
18 changes: 9 additions & 9 deletions code/datums/research_upgrade_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@
behavior = RESEARCH_UPGRADE_CATEGORY

/datum/research_upgrades/item/research_credits
name = "Research Credits"
desc = "Sell the data acquired to the nearest Weyland-Yutani Science division team for 8 or 9 points."
value_upgrade = 2000
name = "Research Contract Reroll"
desc = "Sell the data acquired to the nearest Weyland-Yutani Science division team to request new contract chemicals."
value_upgrade = 1000
behavior = RESEARCH_UPGRADE_ITEM
upgrade_type = ITEM_ACCESSORY_UPGRADE
item_reference = /obj/item/research_upgrades/credits
change_purchase = 500
maximum_price = 5000
clearance_req = 5
item_reference = /obj/item/research_upgrades/reroll
change_purchase = 200
maximum_price = 2000
clearance_req = 4

/datum/research_upgrades/item/laser_scalpel
name = "Laser Scalpel"
Expand All @@ -112,10 +112,10 @@
/datum/research_upgrades/item/incision_management
name = "Incision Management System"
desc = "A true extension of the surgeon's body, this marvel instantly and completely prepares an incision, allowing for the immediate commencement of therapeutic steps."
value_upgrade = 3000
value_upgrade = 2000
behavior = RESEARCH_UPGRADE_ITEM
upgrade_type = ITEM_ACCESSORY_UPGRADE
clearance_req = 4
clearance_req = 3
item_reference = /obj/item/tool/surgery/scalpel/manager


Expand Down
10 changes: 3 additions & 7 deletions code/game/gamemodes/colonialmarines/colonialmarines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
flags_round_type = MODE_INFESTATION|MODE_FOG_ACTIVATED|MODE_NEW_SPAWN
static_comms_amount = 1
var/round_status_flags

var/research_allocation_interval = 10 MINUTES
var/next_research_allocation = 0
var/next_stat_check = 0
var/list/running_round_stats = list()
var/list/lz_smoke = list()
Expand Down Expand Up @@ -128,7 +125,7 @@
addtimer(CALLBACK(src, PROC_REF(ares_online)), 5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(map_announcement)), 20 SECONDS)
addtimer(CALLBACK(src, PROC_REF(start_lz_hazards)), LZ_HAZARD_START)

GLOB.chemical_data.reroll_chemicals()
return ..()

/datum/game_mode/colonialmarines/ds_first_landed(obj/docking_port/stationary/marine_dropship)
Expand Down Expand Up @@ -363,9 +360,8 @@
check_hijack_explosions()
check_ground_humans()

if(next_research_allocation < world.time)
GLOB.chemical_data.update_credits(GLOB.chemical_data.research_allocation_amount)
next_research_allocation = world.time + research_allocation_interval
if(GLOB.chemical_data.next_reroll < world.time)
GLOB.chemical_data.reroll_chemicals()

if(!round_finished)
var/datum/hive_status/hive
Expand Down
9 changes: 4 additions & 5 deletions code/game/gamemodes/extended/extended.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
required_players = 0
latejoin_larva_drop = 0
votable = FALSE
var/research_allocation_interval = 10 MINUTES
var/next_research_allocation = 0
taskbar_icon = 'icons/taskbar/gml_colonyrp.png'

/datum/game_mode/announce()
Expand All @@ -19,13 +17,14 @@
for(var/mob/new_player/np in GLOB.new_player_list)
np.new_player_panel_proc()
round_time_lobby = world.time
GLOB.chemical_data.reroll_chemicals() //kickstart the research chemical contract "system"
return ..()

/datum/game_mode/extended/process()
if(GLOB.chemical_data.next_reroll < world.time)
GLOB.chemical_data.reroll_chemicals()

. = ..()
if(next_research_allocation < world.time)
GLOB.chemical_data.update_credits(GLOB.chemical_data.research_allocation_amount)
next_research_allocation = world.time + research_allocation_interval

/datum/game_mode/extended/check_finished()
if(round_finished)
Expand Down
58 changes: 49 additions & 9 deletions code/game/machinery/computer/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var/max_clearance = 1 // max clearance level reached by research
var/main_terminal = FALSE
var/obj/structure/machinery/photocopier/photocopier
var/datum/reagent/last_picked_contract

/obj/structure/machinery/computer/research/main_terminal
name = "research main terminal"
Expand All @@ -16,9 +17,12 @@
/obj/structure/machinery/computer/research/Initialize()
. = ..()
photocopier = locate(/obj/structure/machinery/photocopier,get_step(src, NORTH))
GLOB.chemical_data.research_computers += src

/obj/structure/machinery/computer/research/Destroy()
QDEL_NULL(photocopier)
GLOB.chemical_data.research_computers -= src
last_picked_contract = null
. = ..()

/obj/structure/machinery/computer/research/attackby(obj/item/B, mob/living/user)
Expand Down Expand Up @@ -53,12 +57,12 @@
var/obj/item/paper/research_report/CR = P.convert_to_chem_report()
GLOB.chemical_data.save_document(CR, response, CR.name)
return
//biomass credits rewards
if(istype(B, /obj/item/research_upgrades/credits))
var/obj/item/research_upgrades/credits/cred = B
GLOB.chemical_data.update_credits(cred.credit_value)
visible_message(SPAN_NOTICE("[user] inserts [cred] in [src], collecting [cred.credit_value] points from sales."))
qdel(cred)
//biomass rewards
if(istype(B, /obj/item/research_upgrades/reroll))
var/obj/item/research_upgrades/reroll/reroll = B
GLOB.chemical_data.reroll_chemicals()
visible_message(SPAN_NOTICE("[user] inserts [reroll] in [src], Rerolling contract chemicals."))
qdel(reroll)
//Clearance Card Updating
if(!istype(B, /obj/item/card/id))
return
Expand Down Expand Up @@ -88,12 +92,27 @@
tgui_interact(user)

/obj/structure/machinery/computer/research/ui_static_data(mob/user)
var/list/data = list(
var/list/contract = list()
for(var/i in 1 to length(GLOB.chemical_data.contract_chems))
var/datum/reagent/generated/contract_chem = GLOB.chemical_data.contract_chems["contract-chem-[i]"]
if(!contract_chem)
continue
var/datum/reagent/temp = GLOB.chemical_reagents_list[contract_chem.reagent_recipe_hint]
contract += list(list(
"name" = contract_chem.name,
"property_hint" = contract_chem.property_hint,
"recipe_hint" = temp.name,
"id" = contract_chem.id,
"gen_tier" = contract_chem.gen_tier,
))
var/list/static_data = list(
"base_purchase_cost" = base_purchase_cost,
"main_terminal" = main_terminal,
"terminal_view" = TRUE,
"chems_generated" = isnull(GLOB.chemical_data.contract_chems),
"contract_chems" = contract,
)
return data
return static_data

/obj/structure/machinery/computer/research/ui_data(mob/user)
var/list/data = list(
Expand All @@ -104,7 +123,11 @@
"published_documents" = GLOB.chemical_data.research_publications,
"clearance_x_access" = GLOB.chemical_data.clearance_x_access,
"photocopier_error" = !photocopier,
"printer_toner" = photocopier?.toner
"printer_toner" = photocopier?.toner,
"is_contract_picked" = GLOB.chemical_data.picked_chem,
"world_time" = world.time,
"next_reroll" = GLOB.chemical_data.next_reroll,
"contract_cooldown" = (GLOB.chemical_data.picked_chem ? RESEARCH_CONTRACT_PICKED : RESEARCH_CONTRACT_NOT_PICKED)
)
return data

Expand Down Expand Up @@ -188,4 +211,21 @@
GLOB.chemical_data.reached_x_access = TRUE
GLOB.chemical_data.update_credits(purchase_cost * -1)
visible_message(SPAN_NOTICE("Clearance Level X Acquired."))
if("take_contract")
if(!GLOB.chemical_data.picked_chem)
var/chem_id = params["id"]
var/new_id = GLOB.chemical_data.legalize_chem(GLOB.chemical_data.contract_chems[chem_id])
new /obj/item/paper/research_notes(photocopier.loc, GLOB.chemical_reagents_list[new_id], "synthesis")
GLOB.chemical_data.picked_chem = TRUE
GLOB.chemical_data.next_reroll = world.time + RESEARCH_CONTRACT_PICKED
last_picked_contract = GLOB.chemical_reagents_list[new_id]
if("reprint_last_contract")
if(last_picked_contract)
new /obj/item/paper/research_notes(photocopier.loc, last_picked_contract, "synthesis")
playsound(loc, 'sound/machines/twobeep.ogg', 5, 1)
else
playsound(loc, 'sound/machines/buzz-two.ogg', 5, 1)
langchat_speech("There are no contracts to reprint available", get_mobs_in_view(7, src), GLOB.all_languages, skip_language_check = TRUE, additional_styles = list("langchat_small"))
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: There are no contracts to reprint available")

playsound(loc, pick('sound/machines/computer_typing1.ogg','sound/machines/computer_typing2.ogg','sound/machines/computer_typing3.ogg'), 5, 1)
3 changes: 1 addition & 2 deletions code/game/machinery/vending/vending_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,12 @@
/obj/item/seeds/sunflowerseed = 2,/obj/item/seeds/tomatoseed = 3,/obj/item/seeds/wheatseed = 3,/obj/item/seeds/appleseed = 3,
/obj/item/seeds/poppyseed = 3,/obj/item/seeds/sugarcaneseed = 3,/obj/item/seeds/peanutseed = 3,/obj/item/seeds/whitebeetseed = 3,/obj/item/seeds/watermelonseed = 3,/obj/item/seeds/limeseed = 3,
/obj/item/seeds/lemonseed = 3,/obj/item/seeds/orangeseed = 3,/obj/item/seeds/grassseed = 3,/obj/item/seeds/cocoapodseed = 3,/obj/item/seeds/plumpmycelium = 2,
/obj/item/seeds/cabbageseed = 3,/obj/item/seeds/grapeseed = 3,/obj/item/seeds/pumpkinseed = 3,/obj/item/seeds/cherryseed = 3,/obj/item/seeds/riceseed = 3)
/obj/item/seeds/cabbageseed = 3,/obj/item/seeds/grapeseed = 3,/obj/item/seeds/pumpkinseed = 3,/obj/item/seeds/cherryseed = 3,/obj/item/seeds/riceseed = 3,/obj/item/seeds/reishimycelium = 3,)
contraband = list(
/obj/item/seeds/libertymycelium = 1,
/obj/item/seeds/mtearseed = 1,
/obj/item/seeds/ambrosiavulgarisseed = 1,
/obj/item/seeds/nettleseed = 1,
/obj/item/seeds/reishimycelium = 1,
)
premium = list(/obj/item/toy/waterflower = 1)

Expand Down
Loading

0 comments on commit 0572b52

Please sign in to comment.