Skip to content

Commit

Permalink
TGS Test Merge (#6188)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed May 10, 2024
2 parents 79488ae + 6c1f06c commit f8daa49
Show file tree
Hide file tree
Showing 47 changed files with 1,166 additions and 252 deletions.
25 changes: 25 additions & 0 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,36 @@
#define ASSEMBLY_UNLOCKED 1
#define ASSEMBLY_LOCKED 2

// RESEARCH UPGRADES DEFINES //

// Matrix CAS Upgrades
#define MATRIX_DEFAULT 0
#define MATRIX_NVG 1
#define MATRIX_WIDE 2

#define RESEARCH_UPGRADE_EXCLUDE_BUY -2
#define RESEARCH_UPGRADE_CATEGORY -1 //lord forgive me
#define RESEARCH_UPGRADE_TIER_1 1
#define RESEARCH_UPGRADE_TIER_2 2
#define RESEARCH_UPGRADE_TIER_3 3
#define RESEARCH_UPGRADE_TIER_4 4
#define RESEARCH_UPGRADE_TIER_5 5
//Value define

#define ITEM_MACHINERY_UPGRADE "Machinery" //*must* be same as category name.
#define ITEM_ACCESSORY_UPGRADE "Items"
#define ITEM_ARMOR_UPGRADE "Armor"

//injector plate stuff
#define EMERGENCY_PLATE_OD_PROTECTION_OFF 0
#define EMERGENCY_PLATE_OD_PROTECTION_STRICT 1
#define EMERGENCY_PLATE_OD_PROTECTION_DYNAMIC 2
#define EMERGENCY_PLATE_OD_WARNING 1
#define EMERGENCY_PLATE_ADJUSTED_WARNING 2


// RESEARCH UPGRADES DEFINES END

// Statistics defines
#define STATISTIC_XENO "xeno"
#define STATISTIC_HUMAN "human"
Expand Down
122 changes: 122 additions & 0 deletions code/datums/research_upgrade_datum.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/datum/research_upgrades
///unique to every upgrade. not the name of the item. name of the upgrade
var/name = "Upgrade."
///name of upgrades, not items. Items are at research_upgrades.dm somewhere in item folder.
var/desc = "something is broken. yippee!!"
///which behavior should this type follow. Should this be completely excluded from the buy menu? should it be one of the dropdown options?
var/behavior = RESEARCH_UPGRADE_EXCLUDE_BUY // should this be on the list? whatever.
/// the price of the upgrade, refer to this: 500 is a runner, 8k is queen. T3 is usually 3k.
var/value_upgrade = 1000
/// actual path to the item.(upgrade)
var/item_reference
///In which tab the upgrade should be.
var/upgrade_type
///Clearance requirment to buy this upgrade. 5x is level 6. Why is it not that way? no one knows.
var/clearance_req = 5

/datum/research_upgrades/machinery
name = "Machinery"
behavior = RESEARCH_UPGRADE_CATEGORY // one on the dropdown choices you get

/datum/research_upgrades/machinery/autodoc
name = "AutoDoc Upgrade"
behavior = RESEARCH_UPGRADE_EXCLUDE_BUY
item_reference = /obj/item/research_upgrades/autodoc
upgrade_type = ITEM_MACHINERY_UPGRADE

/datum/research_upgrades/machinery/autodoc/internal_bleed
name = "AutoDoc Internal Bleeding Repair"
desc = "A data and instruction set for the Autodoc, making it capable of rapidly fixing internal bleeding."
behavior = RESEARCH_UPGRADE_TIER_1
value_upgrade = 1000
clearance_req = 1

/datum/research_upgrades/machinery/autodoc/broken_bone
name = "AutoDoc Bone Fracture Repair"
desc = "A data instruction set for the Autodoc, making it capable of setting fractures and applying bonegel."
behavior = RESEARCH_UPGRADE_TIER_2
value_upgrade = 5000
clearance_req = 3

/datum/research_upgrades/machinery/autodoc/organ_damage
name = "AutoDoc Broken Organ Repair"
desc = "A data and instruction set for the Autodoc, making it capable of fixing organ damage."
behavior = RESEARCH_UPGRADE_TIER_3
value_upgrade = 4500
clearance_req = 2

/datum/research_upgrades/machinery/autodoc/larva_removal
name = "AutoDoc Embryo Removal"
desc = "Data and instruction set for AutoDoc making it mildly proficient in removing parasites left by unknown organism."
behavior = RESEARCH_UPGRADE_TIER_4
value_upgrade = 8000
clearance_req = 6


/datum/research_upgrades/machinery/sleeper
name = "Sleeper Upgrade"
desc = "Research upgrade for Sleeper system, technology on this disk is used on a sleeper to allow wider spectrum of chemicals to be administered, as well as upgrading dialysis software."
behavior = RESEARCH_UPGRADE_TIER_1
value_upgrade = 1000
item_reference = /obj/item/research_upgrades/sleeper
upgrade_type = ITEM_MACHINERY_UPGRADE
clearance_req = 2

/datum/research_upgrades/item
name = "Items"
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 two points."
value_upgrade = 2000
item_reference = /obj/item/research_upgrades/credits
behavior = RESEARCH_UPGRADE_TIER_1
upgrade_type = ITEM_ACCESSORY_UPGRADE
clearance_req = 3

/datum/research_upgrades/item/laser_scalpel
name = "Laser Scalpel"
desc = "An advanced, robust version of the normal scalpel, allowing it to pierce through thick skin and chitin alike with extreme ease."
value_upgrade = 3000
item_reference = /obj/item/tool/surgery/scalpel/laser/advanced
behavior = RESEARCH_UPGRADE_TIER_1
upgrade_type = ITEM_ACCESSORY_UPGRADE
clearance_req = 3

/datum/research_upgrades/armor
name = "Armor"
behavior = RESEARCH_UPGRADE_CATEGORY

/datum/research_upgrades/armor/translator
name = "Universal Translator Plate"
desc = "A uniform-attachable plate capable of translating any unknown language heard by the wearer."
value_upgrade = 2000
behavior = RESEARCH_UPGRADE_TIER_1
clearance_req = 4
upgrade_type = ITEM_ARMOR_UPGRADE
item_reference = /obj/item/clothing/accessory/health/research_plate/translator


/datum/research_upgrades/armor/coagulator
name = "Active Blood Coagulator Plate"
desc = "A uniform-attachable plate capable of coagulating any bleeding wounds the user possesses."
value_upgrade = 3000
behavior = RESEARCH_UPGRADE_TIER_1
clearance_req = 2
upgrade_type = ITEM_ARMOR_UPGRADE
item_reference = /obj/item/clothing/accessory/health/research_plate/coagulator

/datum/research_upgrades/armor/emergency_injector
name = "Medical Emergency Injector"
desc = "A medical plate with two buttons on the sides with hefty chemical tank. Attached to uniform and on simultanious press injects emergency dose of medical chemicals much larger than a normal emergency autoinjector. Single time use and is recycled in biomass printer. Features overdose protection"
value_upgrade = 1000
clearance_req = 3
behavior = RESEARCH_UPGRADE_TIER_1
upgrade_type = ITEM_ARMOR_UPGRADE
item_reference = /obj/item/clothing/accessory/health/research_plate/emergency_injector





7 changes: 6 additions & 1 deletion code/game/machinery/computer/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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 2 points from sales."))
qdel(cred)
//Clearance Updating
if(!istype(B, /obj/item/card/id))
return
Expand Down Expand Up @@ -162,7 +168,6 @@
visible_message(SPAN_NOTICE("Clearance access increased to level [GLOB.chemical_data.clearance_level] for [cost] credits."))
msg_admin_niche("[key_name(user)] traded research credits to upgrade the clearance to level [GLOB.chemical_data.clearance_level].")
if(max_clearance < GLOB.chemical_data.clearance_level)
GLOB.chemical_data.update_income(1) //Bonus income and a paper for buying clearance instead of swiping it up
switch(GLOB.chemical_data.clearance_level)
if(2)
new /obj/item/paper/research_notes/unique/tier_two/(photocopier.loc)
Expand Down
83 changes: 71 additions & 12 deletions code/game/machinery/medical_pod/autodoc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,11 @@
if(ORGAN_SURGERY)
switch(S.surgery_procedure)
if("damage")
if(prob(30)) visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning organ restoration.");
if(prob(30))
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning organ restoration.")
if(S.unneeded)
sleep(UNNEEDED_DELAY)
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.");
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.")
surgery_todo_list -= S
continue
open_incision(H,S.limb_ref)
Expand All @@ -352,18 +353,19 @@
if(istype(S.organ_ref,/datum/internal_organ))
S.organ_ref.rejuvenate()
else
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Organ is missing.");
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Organ is missing.")

// close them
if(S.limb_ref.name != "groin") // TODO: fix brute damage before closing
close_encased(H,S.limb_ref)
close_incision(H,S.limb_ref)

if("eyes")
if(prob(30)) visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning corrective eye surgery.");
if(prob(30))
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning corrective eye surgery.")
if(S.unneeded)
sleep(UNNEEDED_DELAY)
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.");
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.")
surgery_todo_list -= S
continue
if(istype(S.organ_ref,/datum/internal_organ/eyes))
Expand Down Expand Up @@ -392,15 +394,33 @@
H.sdisabilities &= ~DISABILITY_BLIND
E.heal_damage(E.damage)
E.eye_surgery_stage = 0
if("larva")
if(prob(30))
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b>beeps: Removing unknown parasites.")
if(!locate(/obj/item/alien_embryo) in occupant)
sleep(UNNEEDED_DELAY)
visible_message("[icon2html(src, viewers(src))] <b>[src]</b> speaks: Procedure has been deemed unnecessary.")// >:)
surgery_todo_list -= S
continue
sleep(SCALPEL_MAX_DURATION + HEMOSTAT_MAX_DURATION + REMOVE_OBJECT_MAX_DURATION)
var/obj/item/alien_embryo/alien_larva = locate() in occupant
var/mob/living/carbon/xenomorph/larva/living_xeno = locate() in occupant
if(living_xeno)
living_xeno.forceMove(get_turf(occupant)) //funny stealth larva bursts incoming
qdel(alien_larva)
else
alien_larva.forceMove(get_turf(occupant))
occupant.status_flags &= ~XENO_HOST


if(LIMB_SURGERY)
switch(S.surgery_procedure)
if("internal")
if(prob(30)) visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning internal bleeding procedure.");
if(prob(30))
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning internal bleeding procedure.")
if(S.unneeded)
sleep(UNNEEDED_DELAY)
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.");
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.")
surgery_todo_list -= S
continue
open_incision(H,S.limb_ref)
Expand All @@ -415,10 +435,11 @@
close_incision(H,S.limb_ref)

if("broken")
if(prob(30)) visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning broken bone procedure.");
if(prob(30))
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning broken bone procedure.")
if(S.unneeded)
sleep(UNNEEDED_DELAY)
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.");
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.")
surgery_todo_list -= S
continue
open_incision(H,S.limb_ref)
Expand All @@ -437,10 +458,11 @@
close_incision(H,S.limb_ref)

if("missing")
if(prob(30)) visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning limb replacement.");
if(prob(30))
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Beginning limb replacement.")
if(S.unneeded)
sleep(UNNEEDED_DELAY)
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.");
visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure has been deemed unnecessary.")
surgery_todo_list -= S
continue

Expand Down Expand Up @@ -519,6 +541,7 @@
close_encased(H,S.limb_ref)
close_incision(H,S.limb_ref)


if(prob(30)) visible_message("[icon2html(src, viewers(src))] \The <b>[src]</b> speaks: Procedure complete.");
surgery_todo_list -= S
continue
Expand Down Expand Up @@ -590,6 +613,8 @@
unslashable = TRUE
use_power = USE_POWER_IDLE
idle_power_usage = 40
/// What kind of upgrade do we have in this console? used by research upgrades. 1 is IB. 2 is bone frac. 3 is organ damage. 4 is larva removal
var/list/upgrades = list()

/obj/structure/machinery/autodoc_console/Initialize()
. = ..()
Expand Down Expand Up @@ -629,6 +654,18 @@
/obj/structure/machinery/autodoc_console/process()
updateUsrDialog()

/obj/structure/machinery/autodoc_console/attackby(obj/item/with, mob/user)
if(istype(with, /obj/item/research_upgrades/autodoc))
var/obj/item/research_upgrades/autodoc/upgrd = with
for(var/iter in upgrades)
if(iter == upgrd.value)
to_chat(user, SPAN_NOTICE("This data is already present in [src]!"))
return
if(!user.drop_inv_item_to_loc(with, src))
return
to_chat(user, SPAN_NOTICE("You insert the data into [src] and the drive whirrs to life, reading the data."))
upgrades += upgrd.value

/obj/structure/machinery/autodoc_console/attack_hand(mob/living/user)
if(..())
return
Expand Down Expand Up @@ -700,6 +737,9 @@
if("eyes")
surgeryqueue["eyes"] = 1
dat += "Corrective Eye Surgery"
if("larva")
surgeryqueue["larva"] = 1
dat += "Experimental Parasite Surgery"
if(LIMB_SURGERY)
switch(A.surgery_procedure)
if("internal")
Expand All @@ -720,6 +760,7 @@
if("open")
surgeryqueue["open"] = 1
dat += "Close Open Incisions"

dat += "<br>"

dat += "<hr><a href='?src=\ref[src];surgery=1'>Begin Surgery</a> - <a href='?src=\ref[src];refresh=1'>Refresh Menu</a> - <a href='?src=\ref[src];clear=1'>Clear Queue</a><hr>"
Expand All @@ -743,6 +784,22 @@
if(isnull(surgeryqueue["toxin"]))
dat += "<a href='?src=\ref[src];toxin=1'>Bloodstream Toxin Removal</a><br>"
dat += "<br>"
if(length(upgrades))
dat += "<b>Orthopedic Surgeries</b>"
for(var/iter in upgrades)
switch(iter)
if(RESEARCH_UPGRADE_TIER_2)
if(isnull(surgeryqueue["broken"]))
dat += "<a href='?src=\ref[src];broken=1'>Broken Bone Surgery</a><br>"
if(RESEARCH_UPGRADE_TIER_1)
if(isnull(surgeryqueue["internal"]))
dat += "<a href='?src=\ref[src];internal=1'>Internal Bleeding Surgery</a><br>"
if(RESEARCH_UPGRADE_TIER_3)
if(isnull(surgeryqueue["organdamage"]))
dat += "<a href='?src=\ref[src];organdamage=1'>Organ Damage Treatment</a><br>"
if(RESEARCH_UPGRADE_TIER_4)
if(isnull(surgeryqueue["larva"]))
dat += "<a href='?src=\ref[src];larva=1'>Experimental Parasite Exctraction</a><br>"
else
dat += "The autodoc is empty."
dat += text("<a href='?src=\ref[];mach_close=sleeper'>Close</a>", user)
Expand Down Expand Up @@ -797,7 +854,9 @@
if(!needed)
N.fields["autodoc_manual"] += create_autodoc_surgery(null,ORGAN_SURGERY,"damage",1)
updateUsrDialog()

if(href_list["larva"])
N.fields["autodoc_manual"] += create_autodoc_surgery("chest",ORGAN_SURGERY,"larva",0)
updateUsrDialog()
if(href_list["internal"])
for(var/obj/limb/L in connected.occupant.limbs)
if(L)
Expand Down
Loading

0 comments on commit f8daa49

Please sign in to comment.