From 5fd7b79c56d527ae76fe1f0258c752c7ee260acd Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Thu, 20 Mar 2025 16:08:04 -0700 Subject: [PATCH] [MIRROR] move the from belly (#10474) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- .../components/trinary_devices/filter.dm | 39 ----------- .../components/trinary_devices/mixer.dm | 30 --------- code/modules/admin/callproc/callproc.dm | 10 +-- code/modules/reagents/holder/holder.dm | 15 +++-- code/modules/reagents/reactions/_reactions.dm | 4 +- .../modules/reagents/reagents/liquid_belly.dm | 49 -------------- code/modules/vore/eating/belly_obj_liquids.dm | 66 +++++++++---------- .../tgui/interfaces/NumberInputModal.tsx | 8 +-- vorestation.dme | 1 - 9 files changed, 55 insertions(+), 167 deletions(-) delete mode 100644 code/modules/reagents/reagents/liquid_belly.dm diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 3f9317c1cf..3a7f85ccaf 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -119,45 +119,6 @@ tgui_interact(user) - // var/dat - // var/current_filter_type - // switch(filter_type) - // if(0) - // current_filter_type = "Phoron" - // if(1) - // current_filter_type = "Oxygen" - // if(2) - // current_filter_type = "Nitrogen" - // if(3) - // current_filter_type = "Carbon Dioxide" - // if(4) - // current_filter_type = "Nitrous Oxide" - // if(-1) - // current_filter_type = "Nothing" - // else - // current_filter_type = "ERROR - Report this bug to the admin, please!" - - // dat += {" - // Power: [use_power?"On":"Off"]
- // Filtering: [current_filter_type]

- //

Set Filter Type:

- // Phoron
- // Oxygen
- // Nitrogen
- // Carbon Dioxide
- // Nitrous Oxide
- // Nothing
- //
- // Set Flow Rate Limit: - // [src.set_flow_rate]L/s | Change
- // Flow rate: [round(last_flow_rate, 0.1)]L/s - // "} - - // user << browse("[src.name] control[dat]", "window=atmos_filter") - // onclose(user, "atmos_filter") - - - /obj/machinery/atmospherics/trinary/atmos_filter/tgui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index e76af3809d..17b6fc68af 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -100,36 +100,6 @@ if(..()) return tgui_interact(user) - // src.add_fingerprint(user) - // if(!src.allowed(user)) - // to_chat(user, span_warning("Access denied.")) - // return - // user.set_machine(src) - // var/list/node_connects = get_node_connect_dirs() - // var/dat = {span_bold("Power: ") + "[use_power?"On":"Off"]
- // Set Flow Rate Limit: - // [set_flow_rate]L/s | Change - //
- // Flow Rate: [round(last_flow_rate, 0.1)]L/s - //

- // Node 1 ([dir_name(node_connects[1],TRUE)]) Concentration: - // - - // - - // [mixing_inputs[air1]]([mixing_inputs[air1]*100]%) - // + - // + - //
- // Node 2 ([dir_name(node_connects[2],TRUE)]) Concentration: - // - - // - - // [mixing_inputs[air2]]([mixing_inputs[air2]*100]%) - // + - // + - // "} - - // user << browse("[src.name] control[dat]", "window=atmo_mixer") - // onclose(user, "atmo_mixer") - // return /obj/machinery/atmospherics/trinary/mixer/tgui_act(action, params) if(..()) diff --git a/code/modules/admin/callproc/callproc.dm b/code/modules/admin/callproc/callproc.dm index a7be3c50c5..d5cc688c26 100644 --- a/code/modules/admin/callproc/callproc.dm +++ b/code/modules/admin/callproc/callproc.dm @@ -41,12 +41,12 @@ testname = replacetext(testname, "()", "") if(targetselected && !hascall(target,testname)) - to_chat(usr, span_filter_adminlog("" + span_red("Error: callproc(): type [target.type] has no proc named [procname].") + "")) + to_chat(usr, span_filter_adminlog(span_red("Error: callproc(): type [target.type] has no proc named [procname]."))) return else var/procpath = text2path(procname) if (!procpath) - to_chat(usr, span_filter_adminlog("" + span_red("Error: callproc(): proc [procname] does not exist. (Did you forget the /proc/ part?)") + "")) + to_chat(usr, span_filter_adminlog(span_red("Error: callproc(): proc [procname] does not exist. (Did you forget the /proc/ part?)"))) return var/list/lst = get_callproc_args() if(!lst) @@ -54,7 +54,7 @@ if(targetselected) if(!target) - to_chat(usr, span_filter_adminlog("" + span_red("Error: callproc(): owner of proc no longer exists.") + "")) + to_chat(usr, span_filter_adminlog(span_red("Error: callproc(): owner of proc no longer exists."))) return var/msg = "[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]." log_admin(msg) @@ -138,11 +138,11 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) if(!check_rights(R_DEBUG)) return - var/procname = tgui_input_text(usr, "Proc name, eg: fake_blood","Proc:", null) + var/procname = tgui_input_text(usr, "Proc name, eg: fake_blood","Proc:") if(!procname) return if(!hascall(A,procname)) - to_chat(usr, span_filter_adminlog("" + span_red("Error: callproc_datum(): type [A.type] has no proc named [procname].") + "")) + to_chat(usr, span_filter_adminlog(span_red("Error: callproc_datum(): type [A.type] has no proc named [procname]."))) return var/list/lst = get_callproc_args() if(!lst) diff --git a/code/modules/reagents/holder/holder.dm b/code/modules/reagents/holder/holder.dm index d370753c81..bbe8f4f78e 100644 --- a/code/modules/reagents/holder/holder.dm +++ b/code/modules/reagents/holder/holder.dm @@ -83,14 +83,18 @@ var/reaction_occurred var/list/eligible_reactions = list() var/list/effect_reactions = list() + var/from_belly do + from_belly = FALSE reaction_occurred = FALSE for(var/datum/reagent/R as anything in reagent_list) if(SSchemistry.instant_reactions_by_reagent[R.id]) eligible_reactions |= SSchemistry.instant_reactions_by_reagent[R.id] + if(!from_belly) + from_belly = R.from_belly for(var/decl/chemical_reaction/C as anything in eligible_reactions) - if(C.can_happen(src) && C.process(src)) + if(C.can_happen(src) && C.process(src, from_belly)) effect_reactions |= C reaction_occurred = TRUE eligible_reactions.len = 0 @@ -101,20 +105,21 @@ /* Holder-to-chemical */ -/datum/reagents/proc/add_reagent(var/id, var/amount, var/data = null, var/safety = 0) +/datum/reagents/proc/add_reagent(var/id, var/amount, var/data = null, var/safety = 0, var/was_from_belly) if(!isnum(amount) || amount <= 0) return 0 update_total() amount = min(amount, get_free_space()) - for(var/datum/reagent/current in reagent_list) if(current.id == id) if(current.id == REAGENT_ID_BLOOD) if(LAZYLEN(data) && !isnull(data["species"]) && !isnull(current.data["species"]) && data["species"] != current.data["species"]) // Species bloodtypes are already incompatible, this just stops it from mixing into the one already in a container. continue + if(was_from_belly) + current.from_belly = was_from_belly current.volume += amount if(!isnull(data)) // For all we know, it could be zero or empty string and meaningful current.mix_data(data, amount) @@ -131,6 +136,8 @@ R.holder = src R.volume = amount R.initialize_data(data) + if(was_from_belly) + R.from_belly = was_from_belly update_total() if(!safety) handle_reactions() @@ -255,7 +262,7 @@ for(var/datum/reagent/current in reagent_list) var/amount_to_transfer = current.volume * part - target.add_reagent(current.id, amount_to_transfer * multiplier, current.get_data(), safety = 1) // We don't react until everything is in place + target.add_reagent(current.id, amount_to_transfer * multiplier, current.get_data(), safety = 1, was_from_belly = current.from_belly) // We don't react until everything is in place if(!copy) remove_reagent(current.id, amount_to_transfer, 1) diff --git a/code/modules/reagents/reactions/_reactions.dm b/code/modules/reagents/reactions/_reactions.dm index d6f3c73a50..18a3058263 100644 --- a/code/modules/reagents/reactions/_reactions.dm +++ b/code/modules/reagents/reactions/_reactions.dm @@ -78,7 +78,7 @@ return progress -/decl/chemical_reaction/process(var/datum/reagents/holder) +/decl/chemical_reaction/process(var/datum/reagents/holder, var/belly_reagent) //determine how far the reaction can proceed var/list/reaction_limits = list() for(var/reactant in required_reagents) @@ -101,7 +101,7 @@ //add the product var/amt_produced = result_amount * reaction_progress if(result) - holder.add_reagent(result, amt_produced, data, safety = 1) + holder.add_reagent(result, amt_produced, data, safety = 1, was_from_belly = belly_reagent) on_reaction(holder, amt_produced) diff --git a/code/modules/reagents/reagents/liquid_belly.dm b/code/modules/reagents/reagents/liquid_belly.dm deleted file mode 100644 index 21c098b25a..0000000000 --- a/code/modules/reagents/reagents/liquid_belly.dm +++ /dev/null @@ -1,49 +0,0 @@ -// Subtypes of other reagents specifically used in liquid bellies, otherwise identical to the parent - -/datum/reagent/water/liquid_belly - id = REAGENT_ID_WATER_BELLY - from_belly = TRUE - -/datum/reagent/drink/milk/liquid_belly - id = REAGENT_ID_MILK_BELLY - from_belly = TRUE - -/datum/reagent/drink/milk/cream/liquid_belly - id = REAGENT_ID_CREAM_BELLY - from_belly = TRUE - -/datum/reagent/nutriment/honey/liquid_belly - id = REAGENT_ID_HONEY_BELLY - from_belly = TRUE - -/datum/reagent/nutriment/cherryjelly/liquid_belly - id = REAGENT_ID_CHERRYJELLY_BELLY - from_belly = TRUE - -/datum/reagent/acid/digestive/liquid_belly - id = REAGENT_ID_STOMACID_BELLY - from_belly = TRUE - -/datum/reagent/acid/diet_digestive/liquid_belly - id = REAGENT_ID_DIETSTOMACID_BELLY - from_belly = TRUE - -/datum/reagent/space_cleaner/liquid_belly - id = REAGENT_ID_CLEANER_BELLY - from_belly = TRUE - -/datum/reagent/lube/liquid_belly - id = REAGENT_ID_LUBE_BELLY - from_belly = TRUE - -/datum/reagent/nutriment/biomass/liquid_belly - id = REAGENT_ID_BIOMASS_BELLY - from_belly = TRUE - -/datum/reagent/radium/concentrated/liquid_belly - id = REAGENT_ID_CONCENTRATEDRADIUM_BELLY - from_belly = TRUE - -/datum/reagent/tricordrazine/liquid_belly - id = REAGENT_ID_TRICORDRAZINE_BELLY - from_belly = TRUE diff --git a/code/modules/vore/eating/belly_obj_liquids.dm b/code/modules/vore/eating/belly_obj_liquids.dm index 764ead5049..94a0ebf9e3 100644 --- a/code/modules/vore/eating/belly_obj_liquids.dm +++ b/code/modules/vore/eating/belly_obj_liquids.dm @@ -1,7 +1,7 @@ ///////////////////// NUTRITION REAGENT PRODUCTION ///////////////// /obj/belly/proc/HandleBellyReagents() - if(show_liquids && reagentbellymode && reagent_mode_flags & DM_FLAG_REAGENTSNUTRI && reagents.total_volume < custom_max_volume && !isnewplayer(owner)) //Removed if(reagentbellymode == TRUE) since that's less optimized + if(show_liquids && reagentbellymode && reagent_mode_flags & DM_FLAG_REAGENTSNUTRI && reagents.total_volume < custom_max_volume && !isnewplayer(owner)) if(isrobot(owner)) var/mob/living/silicon/robot/R = owner if(R.cell && R.cell.charge >= gen_cost*10 && gen_interval >= gen_time) @@ -53,7 +53,7 @@ else owner.nutrition -= gen_cost for(var/reagent in generated_reagents) - reagents.add_reagent(reagent, generated_reagents[reagent]) + reagents.add_reagent(reagent, generated_reagents[reagent], was_from_belly = TRUE) if(count_liquid_for_sprite) owner.handle_belly_update() //This is run whenever a belly's contents are changed. if(LAZYLEN(belly_surrounding)) @@ -64,7 +64,7 @@ /obj/belly/proc/GenerateBellyReagents_digesting() //The rate isnt based on selected reagent, due to the fact that the price of the reagent is already paid by nutrient not gained. if(reagents.total_volume + (digest_nutri_gain * gen_amount) <= custom_max_volume) //By default a reagent with an amount of 1 should result in pred getting 100 units from a full health prey for(var/reagent in generated_reagents) - reagents.add_reagent(reagent, generated_reagents[reagent] * digest_nutri_gain / gen_cost) + reagents.add_reagent(reagent, generated_reagents[reagent] * digest_nutri_gain / gen_cost, was_from_belly = TRUE) else owner_adjust_nutrition(digest_nutri_gain * owner.get_digestion_efficiency_modifier()) digest_nutri_gain = 0 @@ -72,10 +72,10 @@ /obj/belly/proc/GenerateBellyReagents_digested() if(reagents.total_volume <= custom_max_volume - 25 * gen_amount) for(var/reagent in generated_reagents) - reagents.add_reagent(reagent, generated_reagents[reagent] * 25) + reagents.add_reagent(reagent, generated_reagents[reagent] * 25, was_from_belly = TRUE) else for(var/reagent in generated_reagents) - reagents.add_reagent(reagent, generated_reagents[reagent] / gen_amount * (custom_max_volume - reagents.total_volume)) + reagents.add_reagent(reagent, generated_reagents[reagent] / gen_amount * (custom_max_volume - reagents.total_volume), was_from_belly = TRUE) digest_nutri_gain = 0 //////////////////////////// REAGENT_ABSORB //////////////////////// @@ -83,18 +83,18 @@ /obj/belly/proc/GenerateBellyReagents_absorbing() if(reagents.total_volume <= custom_max_volume - 1.5 * gen_amount) //Going for 1.5 amount of reagent per cycle, can be adjusted in future if need adjustments for(var/reagent in generated_reagents) - reagents.add_reagent(reagent, generated_reagents[reagent] * 1.5) + reagents.add_reagent(reagent, generated_reagents[reagent] * 1.5, was_from_belly = TRUE) else for(var/reagent in generated_reagents) - reagents.add_reagent(reagent, generated_reagents[reagent] / gen_amount * (custom_max_volume - reagents.total_volume)) + reagents.add_reagent(reagent, generated_reagents[reagent] / gen_amount * (custom_max_volume - reagents.total_volume), was_from_belly = TRUE) /obj/belly/proc/GenerateBellyReagents_absorbed() if(reagents.total_volume <= custom_max_volume - 25 * gen_amount) //Going for 25 amount of reagent for absorbing the prey, can be adjusted in future if need adjustments for(var/reagent in generated_reagents) - reagents.add_reagent(reagent, generated_reagents[reagent] * 10) + reagents.add_reagent(reagent, generated_reagents[reagent] * 10, was_from_belly = TRUE) else for(var/reagent in generated_reagents) - reagents.add_reagent(reagent, generated_reagents[reagent] / gen_amount * (custom_max_volume - reagents.total_volume)) + reagents.add_reagent(reagent, generated_reagents[reagent] / gen_amount * (custom_max_volume - reagents.total_volume), was_from_belly = TRUE) //////////////////////////// REAGENT_DRAIN ///////////////////////// //Currently not needed, maybe later a specific proc for drain needs to be made - Jack @@ -110,100 +110,100 @@ our_reagents.Add(lowertext(entry)) switch(reagent_chosen) if(REAGENT_WATER) - generated_reagents = list(REAGENT_ID_WATER_BELLY = 1) + generated_reagents = list(REAGENT_ID_WATER = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_WATER) gen_amount = 1 gen_cost = 1 - reagentid = REAGENT_ID_WATER_BELLY + reagentid = REAGENT_ID_WATER reagentcolor = "#0064C877" if(REAGENT_MILK) - generated_reagents = list(REAGENT_ID_MILK_BELLY = 1) + generated_reagents = list(REAGENT_ID_MILK = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_MILK) gen_amount = 1 gen_cost = 5 - reagentid = REAGENT_ID_MILK_BELLY + reagentid = REAGENT_ID_MILK reagentcolor = "#DFDFDF" if(REAGENT_CREAM) - generated_reagents = list(REAGENT_ID_CREAM_BELLY = 1) + generated_reagents = list(REAGENT_ID_CREAM = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_CREAM) gen_amount = 1 gen_cost = 5 - reagentid = REAGENT_ID_CREAM_BELLY + reagentid = REAGENT_ID_CREAM reagentcolor = "#DFD7AF" if(REAGENT_HONEY) - generated_reagents = list(REAGENT_ID_HONEY_BELLY = 1) + generated_reagents = list(REAGENT_ID_HONEY = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_HONEY) gen_amount = 1 gen_cost = 10 - reagentid = REAGENT_ID_HONEY_BELLY + reagentid = REAGENT_ID_HONEY reagentcolor = "#FFFF00" if(REAGENT_CHERRYJELLY) //Kinda WIP, allows slime like folks something to stuff others with, should make a generic jelly in future - generated_reagents = list(REAGENT_ID_CHERRYJELLY_BELLY = 1) + generated_reagents = list(REAGENT_ID_CHERRYJELLY = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_CHERRYJELLY) gen_amount = 1 gen_cost = 10 - reagentid = REAGENT_ID_CHERRYJELLY_BELLY + reagentid = REAGENT_ID_CHERRYJELLY reagentcolor = "#801E28" if(REAGENT_STOMACID) - generated_reagents = list(REAGENT_ID_STOMACID_BELLY = 1) + generated_reagents = list(REAGENT_ID_STOMACID = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_STOMACID) gen_amount = 1 gen_cost = 1 - reagentid = REAGENT_ID_STOMACID_BELLY + reagentid = REAGENT_ID_STOMACID reagentcolor = "#664330" if(REAGENT_DIETSTOMACID) - generated_reagents = list(REAGENT_ID_DIETSTOMACID_BELLY = 1) + generated_reagents = list(REAGENT_ID_DIETSTOMACID = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_DIETSTOMACID) gen_amount = 1 gen_cost = 1 - reagentid = REAGENT_ID_DIETSTOMACID_BELLY + reagentid = REAGENT_ID_DIETSTOMACID reagentcolor = "#664330" if(REAGENT_CLEANER) - generated_reagents = list(REAGENT_ID_CLEANER_BELLY = 1) + generated_reagents = list(REAGENT_ID_CLEANER = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_CLEANER) gen_amount = 1 gen_cost = 10 - reagentid = REAGENT_ID_CLEANER_BELLY + reagentid = REAGENT_ID_CLEANER reagentcolor = "#A5F0EE" if(REAGENT_LUBE) - generated_reagents = list(REAGENT_ID_LUBE_BELLY = 1) + generated_reagents = list(REAGENT_ID_LUBE = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_LUBE) gen_amount = 1 gen_cost = 10 - reagentid = REAGENT_ID_LUBE_BELLY + reagentid = REAGENT_ID_LUBE reagentcolor = "#009CA8" if(REAGENT_BIOMASS) - generated_reagents = list(REAGENT_ID_BIOMASS_BELLY = 1) + generated_reagents = list(REAGENT_ID_BIOMASS = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_BIOMASS) gen_amount = 1 gen_cost = 10 - reagentid = REAGENT_ID_BIOMASS_BELLY + reagentid = REAGENT_ID_BIOMASS reagentcolor = "#DF9FBF" if(REAGENT_CONCENTRATEDRADIUM) - generated_reagents = list(REAGENT_ID_CONCENTRATEDRADIUM_BELLY = 1) + generated_reagents = list(REAGENT_ID_CONCENTRATEDRADIUM = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_CONCENTRATEDRADIUM) gen_amount = 1 gen_cost = 1 - reagentid = REAGENT_ID_CONCENTRATEDRADIUM_BELLY + reagentid = REAGENT_ID_CONCENTRATEDRADIUM reagentcolor = "#C7C7C7" if(REAGENT_TRICORDRAZINE) - generated_reagents = list(REAGENT_ID_TRICORDRAZINE_BELLY = 1) + generated_reagents = list(REAGENT_ID_TRICORDRAZINE = 1) if(reagent_name in our_reagents) reagent_name = lowertext(REAGENT_TRICORDRAZINE) gen_amount = 1 gen_cost = 10 - reagentid = REAGENT_ID_TRICORDRAZINE_BELLY + reagentid = REAGENT_ID_TRICORDRAZINE reagentcolor = "#8040FF" is_beneficial = TRUE diff --git a/tgui/packages/tgui/interfaces/NumberInputModal.tsx b/tgui/packages/tgui/interfaces/NumberInputModal.tsx index 5391d0f77f..be280a8aef 100644 --- a/tgui/packages/tgui/interfaces/NumberInputModal.tsx +++ b/tgui/packages/tgui/interfaces/NumberInputModal.tsx @@ -88,8 +88,8 @@ const InputArea = (props) => {