Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research Rework Part Two: The Contract System. #7023

Draft
wants to merge 141 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
e771c62
jesus christ forgive me for this shitcode
kiVts Jan 18, 2024
0234eb1
Revert "jesus christ forgive me for this shitcode"
kiVts Jan 18, 2024
0d274f4
Merge branch 'cmss13-devs:master' into xenos
kiVts Jan 18, 2024
b181704
Revert "Revert "jesus christ forgive me for this shitcode""
kiVts Jan 18, 2024
5578153
AH
kiVts Jan 19, 2024
b9ffd6b
organ changes
kiVts Jan 19, 2024
2d8a5ad
mroe shit removed
kiVts Jan 19, 2024
55d6ec0
polising
kiVts Jan 19, 2024
33cddf7
waa
kiVts Jan 24, 2024
1c1feaa
ima kms
kiVts Jan 26, 2024
fd68692
omfg kms
kiVts Jan 28, 2024
9c48fd5
HOLY LORD THE AUTODOC CODE NEVER AGAIN
kiVts Jan 29, 2024
81bc372
someone really needs to move autodoc to tgui holy moly
kiVts Jan 29, 2024
8ac8d49
sleeper, this one was quite easy
kiVts Jan 29, 2024
b134076
usuless cherrypicking that I like
kiVts Jan 29, 2024
f5285bf
more packets and sme other things
kiVts Jan 29, 2024
0ea30a8
defines defines defines
kiVts Jan 29, 2024
ef4f95f
yipppee work
kiVts Feb 1, 2024
5ac257d
;-;
kiVts Feb 1, 2024
787c8c7
oops
kiVts Feb 1, 2024
e6429e2
lol why
kiVts Feb 1, 2024
8982d53
oof
kiVts Feb 1, 2024
bce6545
forgorto remove
kiVts Feb 1, 2024
e67736b
wounds
kiVts Feb 15, 2024
9cf2549
sprites
kiVts Feb 15, 2024
dc2c6da
datumiziing wip
kiVts Mar 15, 2024
06ff41e
removal of pregenerated chemicals
kiVts Mar 18, 2024
d49e50f
nuking pregenerated chems, starting to work on reroll part
kiVts Mar 18, 2024
5e4ced4
consitent
kiVts Mar 18, 2024
ff2743f
Merge branch 'xenos' of https://github.com/kiVts/cmss13 into xenos
kiVts Mar 18, 2024
4e04d39
ignore me
kiVts Mar 24, 2024
e90e310
bs
kiVts Mar 30, 2024
dcfaa67
ok big push
kiVts Apr 4, 2024
71c0b28
sync
kiVts Jun 11, 2024
2eacec6
sync
kiVts Jun 11, 2024
cdde3d6
its never going to end Im stuck here help me
kiVts Jun 12, 2024
beefd1f
its ugly but it works!
kiVts Jun 13, 2024
6a120e2
Merge branch 'master' into we_ball_chemsimtgui4
kiVts Jun 19, 2024
2346cc0
ugh
kiVts Jun 19, 2024
af93d9e
suffering is almost over
kiVts Jun 23, 2024
7321c23
time to pr this bad boy
kiVts Jun 26, 2024
ae75afd
def time to pr this bad boy
kiVts Jun 26, 2024
141dd22
forgot this
kiVts Jun 26, 2024
aab3233
final thinggss ugghg
kiVts Jun 26, 2024
dcdb30d
useless
kiVts Jun 26, 2024
c68e29a
tuurrrummm
kiVts Jun 26, 2024
0582897
okay actually the time
kiVts Jun 26, 2024
0d30279
too tired just sleep
kiVts Jun 26, 2024
2927961
finishers
kiVts Jun 30, 2024
aa93a88
nanoui does not exist and is simply enemy propaganda
kiVts Jun 30, 2024
97fc829
final thing
kiVts Jun 30, 2024
ae43ef3
polish
kiVts Jul 4, 2024
fb80bc2
ugh
kiVts Jul 4, 2024
f353b22
it was funny but not anymore
kiVts Jul 4, 2024
5280d57
abuses are bad also Im stupid
kiVts Jul 6, 2024
d97f093
ugh
kiVts Jul 7, 2024
159437c
Merge remote-tracking branch 'upstream/master' into we_ball_chemsimtgui4
kiVts Jul 7, 2024
4e7b445
Merge remote-tracking branch 'upstream/master' into xenos
kiVts Jul 9, 2024
11db72e
Merge branch 'we_ball_chemsimtgui4' into xenos
kiVts Jul 9, 2024
a6d28aa
clean
kiVts Jul 9, 2024
fe73776
more fixes
kiVts Jul 9, 2024
c33a6d7
revert tim pee poo regulating & mst nerf
kiVts Jul 11, 2024
5343f02
big push again
kiVts Jul 11, 2024
46961b6
fix
kiVts Jul 11, 2024
7380327
Merge remote-tracking branch 'upstream/master' into xenos
kiVts Aug 8, 2024
336e97d
few things
kiVts Aug 9, 2024
775d5b1
this
kiVts Aug 11, 2024
2366a9c
this tiny bit
kiVts Aug 13, 2024
d696dcb
thats it for today sleep time
kiVts Aug 16, 2024
04ba7f7
Making progress, death to create mode
kiVts Aug 20, 2024
d5dec28
Merge remote-tracking branch 'upstream/master' into xenos
kiVts Aug 21, 2024
a27a8fe
more things to sit through yippppee
kiVts Aug 23, 2024
d58ae69
way more work than this
kiVts Aug 23, 2024
9b7f1f8
time to pr this thing
kiVts Aug 24, 2024
d1b04d4
this
kiVts Aug 24, 2024
36befc5
woops
kiVts Aug 24, 2024
258eac2
lints
kiVts Aug 24, 2024
e701815
Oh my god
kiVts Aug 24, 2024
6d78155
nuke
kiVts Aug 24, 2024
63015e6
why didnt it showed up earlier!!!!
kiVts Aug 24, 2024
4edba25
check_ready and tgui minor polish
kiVts Aug 25, 2024
658c8e2
if I said no create mode then there is no create mode.
kiVts Aug 25, 2024
c90cce2
did you know nettle is a bucket
kiVts Aug 26, 2024
768c71e
small adjustment
kiVts Aug 26, 2024
2576eb8
Merge remote-tracking branch 'upstream/master' into xenos
kiVts Aug 27, 2024
952ec46
Merge branch 'master' of https://github.com/cmss13-devs/cmss13 into x…
kiVts Aug 27, 2024
8818423
tini tiny fix.
kiVts Sep 8, 2024
a963fee
it actually worked, damn.
kiVts Sep 12, 2024
88020bd
tab
kiVts Sep 13, 2024
86a1c4a
reroll
kiVts Sep 15, 2024
8dce37c
forgot that
kiVts Sep 15, 2024
032cace
coagulator fix
kiVts Sep 15, 2024
39e4b73
the wanted polish
kiVts Sep 18, 2024
de5ae3c
lints
kiVts Sep 18, 2024
c5ab4aa
clean up the mess
kiVts Sep 18, 2024
b61b7a8
Merge remote-tracking branch 'upstream/master' into xenos
kiVts Sep 25, 2024
e136e39
Update code/modules/paperwork/paper.dm
kiVts Sep 26, 2024
66d251c
Merge branch 'xenos' of https://github.com/kiVts/cmss13 into xenos
kiVts Sep 30, 2024
8194eb5
small changes to prices
kiVts Sep 30, 2024
d9462f0
Update Presets because they're outdated
private-tristan Oct 3, 2024
a3bc900
Merge pull request #1 from private-tristan/xenos
kiVts Oct 3, 2024
3222262
fix and fix
kiVts Oct 4, 2024
4cd5040
Merge branch 'xenos' of https://github.com/kiVts/cmss13 into xenos
kiVts Oct 4, 2024
827f278
woops
kiVts Oct 4, 2024
e47ddb2
grammar
kiVts Oct 4, 2024
74b82c0
fixes fixes
kiVts Oct 4, 2024
958e61d
flop
kiVts Oct 4, 2024
a9711c0
shhhh
kiVts Oct 4, 2024
a3bc9de
empty file undo
kiVts Oct 4, 2024
a8a34c2
price fix
kiVts Oct 4, 2024
0646fce
polish
kiVts Oct 4, 2024
f69fbe7
oi
kiVts Oct 4, 2024
bbf5416
Merge branch 'master' into xenos
kiVts Oct 4, 2024
63cdab3
Merge remote-tracking branch 'upstream/master' into xenos
kiVts Oct 4, 2024
3598c17
Merge branch 'xenos' of https://github.com/kiVts/cmss13 into xenos
kiVts Oct 4, 2024
338e73f
thymol ;-;
kiVts Oct 4, 2024
41cf2be
properties and time changes
kiVts Oct 5, 2024
44f94b8
hydro chems buff, easy tier buff, decotr delight sillyiness
kiVts Oct 15, 2024
65fc9e0
quick bugfig
kiVts Oct 16, 2024
7738303
reward buff and more properties
kiVts Oct 17, 2024
06d5d4a
more buffs!!!!
kiVts Oct 23, 2024
45c55d6
Making fuels viable :tm:
kiVts Oct 24, 2024
45219ed
small buff
kiVts Oct 24, 2024
14380d4
small change
kiVts Oct 25, 2024
17432d0
last thing
kiVts Oct 25, 2024
39ffc63
more
kiVts Oct 25, 2024
6cb3ba6
Change my mind
kiVts Oct 25, 2024
d2f46b1
more costs rebalances
kiVts Oct 25, 2024
a924a3b
moving the ciph hint
kiVts Oct 25, 2024
90ddbae
OOF
kiVts Oct 25, 2024
c48228b
ciphering change
kiVts Oct 26, 2024
79be4ba
we shall see how this turns out
kiVts Oct 27, 2024
3ab42f1
this
kiVts Oct 27, 2024
03259a8
uhm
kiVts Oct 27, 2024
5f9fb36
priority bugfixes and generation changes
kiVts Nov 2, 2024
87249e1
Apply suggestions from code review
kiVts Nov 2, 2024
e0a2a48
comma
kiVts Nov 2, 2024
6e6d8be
removes all xeno bloods from contracts+ adds thymol to death
kiVts Nov 3, 2024
e4c0968
bandaid while Im away
kiVts Nov 3, 2024
2efb25f
fix
kiVts Nov 3, 2024
ecb4158
4>>5
kiVts Nov 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -157,7 +157,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 @@ -186,8 +186,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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i hate this syntax can't we use pick_weight

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 @@ -123,7 +120,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 @@ -281,9 +278,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
Loading