From a5c829ea53ad926599b1368577e727e170bbaf69 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Mon, 31 Aug 2020 20:24:17 -0700 Subject: [PATCH 1/3] FBP Internals Additions --- .../{borghydro.dm => borghypo.dm} | 316 +++++++++--------- .../reagents/reagent_containers/hypospray.dm | 2 + .../reagents/reagent_containers/syringes.dm | 2 + .../changelogs/Killian - synth injections.yml | 36 ++ vorestation.dme | 4 + 5 files changed, 203 insertions(+), 157 deletions(-) rename code/modules/reagents/reagent_containers/{borghydro.dm => borghypo.dm} (97%) create mode 100644 html/changelogs/Killian - synth injections.yml diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghypo.dm similarity index 97% rename from code/modules/reagents/reagent_containers/borghydro.dm rename to code/modules/reagents/reagent_containers/borghypo.dm index a08ea1b19b..d8afdf4631 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghypo.dm @@ -1,157 +1,159 @@ -/obj/item/weapon/reagent_containers/borghypo - name = "cyborg hypospray" - desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment." - icon = 'icons/obj/syringe.dmi' - item_state = "hypo" - icon_state = "borghypo" - amount_per_transfer_from_this = 5 - volume = 30 - possible_transfer_amounts = null - - var/mode = 1 - var/charge_cost = 50 - var/charge_tick = 0 - var/recharge_time = 5 //Time it takes for shots to recharge (in seconds) - var/bypass_protection = FALSE // If true, can inject through things like spacesuits and armor. - - var/list/reagent_ids = list("tricordrazine", "inaprovaline", "anti_toxin", "tramadol", "dexalin" ,"spaceacillin") - var/list/reagent_volumes = list() - var/list/reagent_names = list() - -/obj/item/weapon/reagent_containers/borghypo/surgeon - reagent_ids = list("tricordrazine", "inaprovaline", "oxycodone", "dexalin" ,"spaceacillin") - -/obj/item/weapon/reagent_containers/borghypo/crisis - reagent_ids = list("tricordrazine", "inaprovaline", "anti_toxin", "tramadol", "dexalin" ,"spaceacillin") - -/obj/item/weapon/reagent_containers/borghypo/lost - reagent_ids = list("tricordrazine", "bicaridine", "dexalin", "anti_toxin", "tramadol", "spaceacillin") - -/obj/item/weapon/reagent_containers/borghypo/merc - name = "advanced cyborg hypospray" - desc = "An advanced nanite and chemical synthesizer and injection system, designed for heavy-duty medical equipment. This type is capable of safely bypassing \ - thick materials that other hyposprays would struggle with." - bypass_protection = TRUE // Because mercs tend to be in spacesuits. - reagent_ids = list("healing_nanites", "hyperzine", "tramadol", "oxycodone", "spaceacillin", "peridaxon", "osteodaxon", "myelamine", "synthblood") - -/obj/item/weapon/reagent_containers/borghypo/Initialize() - . = ..() - - for(var/T in reagent_ids) - reagent_volumes[T] = volume - var/datum/reagent/R = SSchemistry.chemical_reagents[T] - reagent_names += R.name - - START_PROCESSING(SSobj, src) - -/obj/item/weapon/reagent_containers/borghypo/Destroy() - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/weapon/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg+ - if(++charge_tick < recharge_time) - return 0 - charge_tick = 0 - - if(isrobot(loc)) - var/mob/living/silicon/robot/R = loc - if(R && R.cell) - for(var/T in reagent_ids) - if(reagent_volumes[T] < volume) - R.cell.use(charge_cost) - reagent_volumes[T] = min(reagent_volumes[T] + 5, volume) - return 1 - -/obj/item/weapon/reagent_containers/borghypo/attack(var/mob/living/M, var/mob/user) - if(!istype(M)) - return - - if(!reagent_volumes[reagent_ids[mode]]) - to_chat(user, "The injector is empty.") - return - - var/mob/living/carbon/human/H = M - if(istype(H)) - var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) - if(!affected) - to_chat(user, "\The [H] is missing that limb!") - return - else if(affected.robotic >= ORGAN_ROBOT) - to_chat(user, "You cannot inject a robotic limb.") - return - - if(M.can_inject(user, 1, ignore_thickness = bypass_protection)) - to_chat(user, "You inject [M] with the injector.") - to_chat(M, "You feel a tiny prick!") - - if(M.reagents) - var/t = min(amount_per_transfer_from_this, reagent_volumes[reagent_ids[mode]]) - M.reagents.add_reagent(reagent_ids[mode], t) - reagent_volumes[reagent_ids[mode]] -= t - add_attack_logs(user, M, "Borg injected with [reagent_ids[mode]]") - to_chat(user, "[t] units injected. [reagent_volumes[reagent_ids[mode]]] units remaining.") - return - -/obj/item/weapon/reagent_containers/borghypo/attack_self(mob/user as mob) //Change the mode - var/t = "" - for(var/i = 1 to reagent_ids.len) - if(t) - t += ", " - if(mode == i) - t += "[reagent_names[i]]" - else - t += "[reagent_names[i]]" - t = "Available reagents: [t]." - to_chat(user,t) - - return - -/obj/item/weapon/reagent_containers/borghypo/Topic(var/href, var/list/href_list) - if(href_list["reagent"]) - var/t = reagent_ids.Find(href_list["reagent"]) - if(t) - playsound(src, 'sound/effects/pop.ogg', 50, 0) - mode = t - var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]] - to_chat(usr, "Synthesizer is now producing '[R.name]'.") - -/obj/item/weapon/reagent_containers/borghypo/examine(mob/user) - . = ..() - if(get_dist(user, src) <= 2) - var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]] - . += "It is currently producing [R.name] and has [reagent_volumes[reagent_ids[mode]]] out of [volume] units left." - -/obj/item/weapon/reagent_containers/borghypo/service - name = "cyborg drink synthesizer" - desc = "A portable drink dispencer." - icon = 'icons/obj/drinks.dmi' - icon_state = "shaker" - charge_cost = 20 - recharge_time = 3 - volume = 60 - possible_transfer_amounts = list(5, 10, 20, 30) - reagent_ids = list("ale", "cider", "beer", "berryjuice", "bitters", "coffee", "cognac", "cola", "dr_gibb", "egg", "gin", "gingerale", "hot_coco", "ice", "icetea", "kahlua", "lemonjuice", "lemon_lime", "limejuice", "mead", "milk", "mint", "orangejuice", "rum", "sake", "sodawater", "soymilk", "space_up", "spacemountainwind", "specialwhiskey", "sugar", "tea", "tequilla", "tomatojuice", "tonic", "vermouth", "vodka", "water", "watermelonjuice", "whiskey", "wine") - -/obj/item/weapon/reagent_containers/borghypo/service/attack(var/mob/M, var/mob/user) - return - -/obj/item/weapon/reagent_containers/borghypo/service/afterattack(var/obj/target, var/mob/user, var/proximity) - if(!proximity) - return - - if(!target.is_open_container() || !target.reagents) - return - - if(!reagent_volumes[reagent_ids[mode]]) - to_chat(user, "[src] is out of this reagent, give it some time to refill.") - return - - if(!target.reagents.get_free_space()) - to_chat(user, "[target] is full.") - return - - var/t = min(amount_per_transfer_from_this, reagent_volumes[reagent_ids[mode]]) - target.reagents.add_reagent(reagent_ids[mode], t) - reagent_volumes[reagent_ids[mode]] -= t - to_chat(user, "You transfer [t] units of the solution to [target].") - return +/obj/item/weapon/reagent_containers/borghypo + name = "cyborg hypospray" + desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment." + icon = 'icons/obj/syringe.dmi' + item_state = "hypo" + icon_state = "borghypo" + amount_per_transfer_from_this = 5 + volume = 30 + possible_transfer_amounts = null + + var/mode = 1 + var/charge_cost = 50 + var/charge_tick = 0 + var/recharge_time = 5 //Time it takes for shots to recharge (in seconds) + var/bypass_protection = FALSE // If true, can inject through things like spacesuits and armor. + + var/list/reagent_ids = list("tricordrazine", "inaprovaline", "anti_toxin", "tramadol", "dexalin" ,"spaceacillin") + var/list/reagent_volumes = list() + var/list/reagent_names = list() + +/obj/item/weapon/reagent_containers/borghypo/surgeon + reagent_ids = list("tricordrazine", "inaprovaline", "oxycodone", "dexalin" ,"spaceacillin") + +/obj/item/weapon/reagent_containers/borghypo/crisis + reagent_ids = list("tricordrazine", "inaprovaline", "anti_toxin", "tramadol", "dexalin" ,"spaceacillin") + +/obj/item/weapon/reagent_containers/borghypo/lost + reagent_ids = list("tricordrazine", "bicaridine", "dexalin", "anti_toxin", "tramadol", "spaceacillin") + +/obj/item/weapon/reagent_containers/borghypo/merc + name = "advanced cyborg hypospray" + desc = "An advanced nanite and chemical synthesizer and injection system, designed for heavy-duty medical equipment. This type is capable of safely bypassing \ + thick materials that other hyposprays would struggle with." + bypass_protection = TRUE // Because mercs tend to be in spacesuits. + reagent_ids = list("healing_nanites", "hyperzine", "tramadol", "oxycodone", "spaceacillin", "peridaxon", "osteodaxon", "myelamine", "synthblood") + +/obj/item/weapon/reagent_containers/borghypo/Initialize() + . = ..() + + for(var/T in reagent_ids) + reagent_volumes[T] = volume + var/datum/reagent/R = SSchemistry.chemical_reagents[T] + reagent_names += R.name + + START_PROCESSING(SSobj, src) + +/obj/item/weapon/reagent_containers/borghypo/Destroy() + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/item/weapon/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg+ + if(++charge_tick < recharge_time) + return 0 + charge_tick = 0 + + if(isrobot(loc)) + var/mob/living/silicon/robot/R = loc + if(R && R.cell) + for(var/T in reagent_ids) + if(reagent_volumes[T] < volume) + R.cell.use(charge_cost) + reagent_volumes[T] = min(reagent_volumes[T] + 5, volume) + return 1 + +/obj/item/weapon/reagent_containers/borghypo/attack(var/mob/living/M, var/mob/user) + if(!istype(M)) + return + + if(!reagent_volumes[reagent_ids[mode]]) + to_chat(user, "The injector is empty.") + return + + var/mob/living/carbon/human/H = M + if(istype(H)) + var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) + if(!affected) + to_chat(user, "\The [H] is missing that limb!") + return + /* since synths have oil/coolant streams now, it only makes sense that you should be able to inject stuff. preserved for posterity. + else if(affected.robotic >= ORGAN_ROBOT) + to_chat(user, "You cannot inject a robotic limb.") + return + */ + + if(M.can_inject(user, 1, ignore_thickness = bypass_protection)) + to_chat(user, "You inject [M] with the injector.") + to_chat(M, "You feel a tiny prick!") + + if(M.reagents) + var/t = min(amount_per_transfer_from_this, reagent_volumes[reagent_ids[mode]]) + M.reagents.add_reagent(reagent_ids[mode], t) + reagent_volumes[reagent_ids[mode]] -= t + add_attack_logs(user, M, "Borg injected with [reagent_ids[mode]]") + to_chat(user, "[t] units injected. [reagent_volumes[reagent_ids[mode]]] units remaining.") + return + +/obj/item/weapon/reagent_containers/borghypo/attack_self(mob/user as mob) //Change the mode + var/t = "" + for(var/i = 1 to reagent_ids.len) + if(t) + t += ", " + if(mode == i) + t += "[reagent_names[i]]" + else + t += "[reagent_names[i]]" + t = "Available reagents: [t]." + to_chat(user,t) + + return + +/obj/item/weapon/reagent_containers/borghypo/Topic(var/href, var/list/href_list) + if(href_list["reagent"]) + var/t = reagent_ids.Find(href_list["reagent"]) + if(t) + playsound(src, 'sound/effects/pop.ogg', 50, 0) + mode = t + var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]] + to_chat(usr, "Synthesizer is now producing '[R.name]'.") + +/obj/item/weapon/reagent_containers/borghypo/examine(mob/user) + . = ..() + if(get_dist(user, src) <= 2) + var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]] + . += "It is currently producing [R.name] and has [reagent_volumes[reagent_ids[mode]]] out of [volume] units left." + +/obj/item/weapon/reagent_containers/borghypo/service + name = "cyborg drink synthesizer" + desc = "A portable drink dispencer." + icon = 'icons/obj/drinks.dmi' + icon_state = "shaker" + charge_cost = 20 + recharge_time = 3 + volume = 60 + possible_transfer_amounts = list(5, 10, 20, 30) + reagent_ids = list("ale", "cider", "beer", "berryjuice", "bitters", "coffee", "cognac", "cola", "dr_gibb", "egg", "gin", "gingerale", "hot_coco", "ice", "icetea", "kahlua", "lemonjuice", "lemon_lime", "limejuice", "mead", "milk", "mint", "orangejuice", "rum", "sake", "sodawater", "soymilk", "space_up", "spacemountainwind", "specialwhiskey", "sugar", "tea", "tequilla", "tomatojuice", "tonic", "vermouth", "vodka", "water", "watermelonjuice", "whiskey", "wine") + +/obj/item/weapon/reagent_containers/borghypo/service/attack(var/mob/M, var/mob/user) + return + +/obj/item/weapon/reagent_containers/borghypo/service/afterattack(var/obj/target, var/mob/user, var/proximity) + if(!proximity) + return + + if(!target.is_open_container() || !target.reagents) + return + + if(!reagent_volumes[reagent_ids[mode]]) + to_chat(user, "[src] is out of this reagent, give it some time to refill.") + return + + if(!target.reagents.get_free_space()) + to_chat(user, "[target] is full.") + return + + var/t = min(amount_per_transfer_from_this, reagent_volumes[reagent_ids[mode]]) + target.reagents.add_reagent(reagent_ids[mode], t) + reagent_volumes[reagent_ids[mode]] -= t + to_chat(user, "You transfer [t] units of the solution to [target].") + return diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 9a1882e47b..80d0e1e34d 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -42,9 +42,11 @@ if(!affected) to_chat(user, "\The [H] is missing that limb!") return + /* since synths have oil/coolant streams now, it only makes sense that you should be able to inject stuff. preserved for posterity. else if(affected.robotic >= ORGAN_ROBOT) to_chat(user, "You cannot inject a robotic limb.") return + */ //VOREStation Add Start - Adds Prototype Hypo functionality if(H != user && prototype) diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 4bdf471989..fe50843852 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -170,9 +170,11 @@ if(!affected) to_chat(user, "\The [H] is missing that limb!") return + /* since synths have oil/coolant streams now, it only makes sense that you should be able to inject stuff. preserved for posterity. else if(affected.robotic >= ORGAN_ROBOT) to_chat(user, "You cannot inject a robotic limb.") return + */ var/cycle_time = injtime*0.33 //33% of the time slept between 5u doses var/warmup_time = 0 //0 for containers diff --git a/html/changelogs/Killian - synth injections.yml b/html/changelogs/Killian - synth injections.yml new file mode 100644 index 0000000000..3f32aa9aac --- /dev/null +++ b/html/changelogs/Killian - synth injections.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Killian + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "You can now inject reagents directly into a synth's 'blood' stream using syringes and hypos (inc. borg hypos). Taking oil/coolant samples is still impossible." diff --git a/vorestation.dme b/vorestation.dme index f11d4a2cdb..0e4e9cd3d5 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -3302,8 +3302,12 @@ #include "code\modules\reagents\hoses\hose.dm" #include "code\modules\reagents\hoses\hose_connector.dm" #include "code\modules\reagents\reagent_containers\blood_pack.dm" +<<<<<<< HEAD:vorestation.dme #include "code\modules\reagents\reagent_containers\blood_pack_vr.dm" #include "code\modules\reagents\reagent_containers\borghydro.dm" +======= +#include "code\modules\reagents\reagent_containers\borghypo.dm" +>>>>>>> 24e638c... Merge pull request #7583 from KillianKirilenko/kk-misc2:polaris.dme #include "code\modules\reagents\reagent_containers\dropper.dm" #include "code\modules\reagents\reagent_containers\glass.dm" #include "code\modules\reagents\reagent_containers\glass_vr.dm" From 9aec6b23dbfd93b755611e085ffe89504fabc546 Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Mon, 31 Aug 2020 23:40:21 -0400 Subject: [PATCH 2/3] Update vorestation.dme --- vorestation.dme | 3 --- 1 file changed, 3 deletions(-) diff --git a/vorestation.dme b/vorestation.dme index 0e4e9cd3d5..924ded2034 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -3302,12 +3302,9 @@ #include "code\modules\reagents\hoses\hose.dm" #include "code\modules\reagents\hoses\hose_connector.dm" #include "code\modules\reagents\reagent_containers\blood_pack.dm" -<<<<<<< HEAD:vorestation.dme #include "code\modules\reagents\reagent_containers\blood_pack_vr.dm" #include "code\modules\reagents\reagent_containers\borghydro.dm" -======= #include "code\modules\reagents\reagent_containers\borghypo.dm" ->>>>>>> 24e638c... Merge pull request #7583 from KillianKirilenko/kk-misc2:polaris.dme #include "code\modules\reagents\reagent_containers\dropper.dm" #include "code\modules\reagents\reagent_containers\glass.dm" #include "code\modules\reagents\reagent_containers\glass_vr.dm" From 847287eee438707fd1308df3212c4c8b02776a83 Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Mon, 31 Aug 2020 23:55:55 -0400 Subject: [PATCH 3/3] Update vorestation.dme --- vorestation.dme | 1 - 1 file changed, 1 deletion(-) diff --git a/vorestation.dme b/vorestation.dme index 924ded2034..52067f564a 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -3303,7 +3303,6 @@ #include "code\modules\reagents\hoses\hose_connector.dm" #include "code\modules\reagents\reagent_containers\blood_pack.dm" #include "code\modules\reagents\reagent_containers\blood_pack_vr.dm" -#include "code\modules\reagents\reagent_containers\borghydro.dm" #include "code\modules\reagents\reagent_containers\borghypo.dm" #include "code\modules\reagents\reagent_containers\dropper.dm" #include "code\modules\reagents\reagent_containers\glass.dm"