From a049f83b8d09eaf245cece39c72de0faa58a7518 Mon Sep 17 00:00:00 2001 From: Alphas00 <154434082+Alphas00@users.noreply.github.com> Date: Sat, 27 Apr 2024 22:59:10 +0200 Subject: [PATCH 1/2] Barrel Tank transfer variable Added transfer_amount to the barrel tank to dynamically change the amount of of chemicals transferred from the tank to the character (this is then multiplied by 2, as per the standard barrel tank function). This variable is DIFFERENT from amount_per_transfer_from_this, as that is part of the reagent containers code and is set to 0 from the barrel tank by default. --- .../code/modules/reagents/reagent_containers/barrel_tank.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GainStation13/code/modules/reagents/reagent_containers/barrel_tank.dm b/GainStation13/code/modules/reagents/reagent_containers/barrel_tank.dm index 07a3bf74..11a6ed75 100644 --- a/GainStation13/code/modules/reagents/reagent_containers/barrel_tank.dm +++ b/GainStation13/code/modules/reagents/reagent_containers/barrel_tank.dm @@ -11,6 +11,7 @@ actions_types = list(/datum/action/item_action/toggle_tube) var/mob/living/carbon/U = null + var/transfer_amount = 1 amount_per_transfer_from_this = 0 possible_transfer_amounts = list(0) @@ -60,7 +61,7 @@ if(reagents.total_volume) var/fraction = min(1/reagents.total_volume, 1) reagents.reaction(U, INGEST, fraction, FALSE) - reagents.trans_to(U, 1, 2) + reagents.trans_to(U, transfer_amount, 2) else to_chat(U, "The barrel is empty!") U = null From 5c2cfa112cf64334bae6798362e2d8055ab65687 Mon Sep 17 00:00:00 2001 From: Alphas00 <154434082+Alphas00@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:58:51 +0200 Subject: [PATCH 2/2] Adipoelectric Transformer introduced Adds the Adipoelectric Transformer, an engineering item that can be unlocked through the NutriTools tech node. This machine once placed on a wire will convert excess current into fatness for the person who stands on it --- .../machinery/adipoelectric_transformer.dm | 152 ++++++++++++++++++ .../research/techweb/nutritech_nodes.dm | 2 +- .../icons/obj/adipoelectric_transformer.dmi | Bin 0 -> 1177 bytes tgstation.dme | 1 + 4 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 GainStation13/code/machinery/adipoelectric_transformer.dm create mode 100644 GainStation13/icons/obj/adipoelectric_transformer.dmi diff --git a/GainStation13/code/machinery/adipoelectric_transformer.dm b/GainStation13/code/machinery/adipoelectric_transformer.dm new file mode 100644 index 00000000..a43652ab --- /dev/null +++ b/GainStation13/code/machinery/adipoelectric_transformer.dm @@ -0,0 +1,152 @@ +GLOBAL_LIST_EMPTY(adipoelectric_transformer) + +/obj/machinery/adipoelectric_transformer + name = "adipoelectric transformer" //change name to adipoelectric generator + desc = "This device uses calorite technology to store excess current in the wire it's placed on into whoever steps on!" + icon = 'GainStation13/icons/obj/adipoelectric_transformer.dmi' + icon_state = "state_off" + density = FALSE + use_power = IDLE_POWER_USE + idle_power_usage = 0 + active_power_usage = 0 + state_open = TRUE + circuit = /obj/item/circuitboard/machine/adipoelectric_transformer + occupant_typecache = list(/mob/living/carbon) + var/recharge_speed + var/obj/structure/cable/attached + var/drain_rate = 1000000 + var/lastprocessed = 0 + var/power_avaliable = 0 + var/conversion_rate = 0.000001 + var/emp_timer = 0 + var/emp_multiplier = 5 + +/obj/machinery/adipoelectric_transformer/Initialize() + . = ..() + update_icon() + +/obj/machinery/adipoelectric_transformer/RefreshParts() + recharge_speed = 0 + for(var/obj/item/stock_parts/capacitor/C in component_parts) + recharge_speed += C.rating + +/obj/machinery/adipoelectric_transformer/process() + if(!is_operational()) + return + if(!attached) + playsound(src, 'sound/machines/buzz-two.ogg', 50) + return PROCESS_KILL + var/datum/powernet/PN = attached.powernet + if(PN) + power_avaliable = PN.netexcess + update_icon() + if(power_avaliable <= 0) + return + if(occupant) + if(power_avaliable > drain_rate) + lastprocessed = ((power_avaliable - drain_rate) * (conversion_rate / 10)) + 1 + else + lastprocessed = power_avaliable * conversion_rate + if(!(world.time >= emp_timer + 600)) + lastprocessed = lastprocessed * emp_multiplier + occupant:adjust_fatness(lastprocessed * recharge_speed, FATTENING_TYPE_ITEM) + return 1 + +/obj/machinery/adipoelectric_transformer/relaymove(mob/user) + if(user.stat) + return + open_machine() + +/obj/machinery/adipoelectric_transformer/emp_act(severity) + . = ..() + if(!(stat & (BROKEN|NOPOWER))) + if(occupant) + emp_timer = world.time //stuck in for 600 ticks, about 60 seconds + +/obj/machinery/adipoelectric_transformer/attackby(obj/item/P, mob/user, params) + if(state_open) + if(default_deconstruction_screwdriver(user, "state_open", "state_off", P)) + return + + if(default_pry_open(P)) + return + + if(default_deconstruction_crowbar(P)) + return + return ..() + +/obj/machinery/adipoelectric_transformer/interact(mob/user) + toggle_open() + return TRUE + +/obj/machinery/adipoelectric_transformer/proc/toggle_open() + if(state_open) + close_machine() + else + open_machine() + update_icon() + +/obj/machinery/adipoelectric_transformer/open_machine() + if(!(world.time >= emp_timer + 600)) + return + . = ..() + GLOB.adipoelectric_transformer -= src + STOP_PROCESSING(SSobj, src) + +/obj/machinery/adipoelectric_transformer/close_machine() + . = ..() + if(LAZYLEN(GLOB.adipoelectric_transformer) < 1 && occupant) + var/turf/T = loc + if(isturf(T) && !T.intact) + attached = locate() in T + add_fingerprint(occupant) + GLOB.adipoelectric_transformer += src + START_PROCESSING(SSobj, src) + else + playsound(src, 'sound/machines/buzz-two.ogg', 50) + open_machine() + +/obj/machinery/adipoelectric_transformer/update_icon() + cut_overlays() + if(occupant) + var/image/occupant_overlay + occupant_overlay = image(occupant.icon, occupant.icon_state) + occupant_overlay.copy_overlays(occupant) + occupant_overlay.dir = SOUTH + occupant_overlay.pixel_y = 10 + add_overlay(occupant_overlay) + if(power_avaliable <= 0) + icon_state = "state_off" + else + if(!(world.time >= emp_timer + 600)) + icon_state = "state_overdrive" + add_overlay("particles_overdrive") + else + icon_state = "state_on" + add_overlay("particles_on") + else + icon_state = "state_off" + +/obj/machinery/adipoelectric_transformer/power_change() + ..() + update_icon() + +/obj/machinery/adipoelectric_transformer/Destroy() + . = ..() + GLOB.adipoelectric_transformer -= src + +/obj/item/circuitboard/machine/adipoelectric_transformer + name = "Adipoelectric Transformer (Machine Board)" + build_path = /obj/machinery/adipoelectric_transformer + req_components = list( + /obj/item/stock_parts/capacitor = 5, + /obj/item/stack/sheet/glass = 1, + /obj/item/stack/sheet/mineral/calorite = 1) + +/datum/design/board/adipoelectric_transformer + name = "Machine Design (Adipoelectric Transformer Board)" + desc = "The circuit board for an Adipoelectric Transformer." + id = "adipoelectric_transformer" + build_path = /obj/item/circuitboard/machine/adipoelectric_transformer + category = list("Research Machinery") + departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING diff --git a/GainStation13/code/modules/research/techweb/nutritech_nodes.dm b/GainStation13/code/modules/research/techweb/nutritech_nodes.dm index 72931afc..05ecff57 100644 --- a/GainStation13/code/modules/research/techweb/nutritech_nodes.dm +++ b/GainStation13/code/modules/research/techweb/nutritech_nodes.dm @@ -5,7 +5,7 @@ display_name = "Nutri-Tech Tools" description = "Ending world hunger was never made easier!" prereq_ids = list("biotech", "adv_engi") // add "engineering" if the designs get complicated later on - design_ids = list("calorite_collar", "ci-nutrimentturbo", "bluespace_belt") + design_ids = list("calorite_collar", "ci-nutrimentturbo", "bluespace_belt", "adipoelectric_transformer") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) boost_item_paths = list(/obj/item/gun/energy/fatoray, /obj/item/gun/energy/fatoray/cannon, /obj/item/trash/fatoray_scrap1, /obj/item/trash/fatoray_scrap2) export_price = 5000 diff --git a/GainStation13/icons/obj/adipoelectric_transformer.dmi b/GainStation13/icons/obj/adipoelectric_transformer.dmi new file mode 100644 index 0000000000000000000000000000000000000000..29c5fe8b1aaae2b286dd713d41ba51bd2e05b597 GIT binary patch literal 1177 zcmV;K1ZMk*P)004jp0{{R3ySP)t-s|7J7) zW;5fWci(X);f_`!8ya(Ma#Kf8LNqv1Oi@WfNR^e9X=7*;6%-2$3o{}jwG9o_baek_ zGj2sG6BZ~EC=EXv8jV~$fm1YfK1cxo0004WQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+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