[MIRROR] move the from belly (#10474)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-03-20 16:08:04 -07:00
committed by GitHub
parent 6d174d27c4
commit 5fd7b79c56
9 changed files with 55 additions and 167 deletions

View File

@@ -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 += {"
// <b>Power: </b><a href='byond://?src=\ref[src];power=1'>[use_power?"On":"Off"]</a><br>
// <b>Filtering: </b>[current_filter_type]<br><HR>
// <h4>Set Filter Type:</h4>
// <A href='byond://?src=\ref[src];filterset=0'>Phoron</A><BR>
// <A href='byond://?src=\ref[src];filterset=1'>Oxygen</A><BR>
// <A href='byond://?src=\ref[src];filterset=2'>Nitrogen</A><BR>
// <A href='byond://?src=\ref[src];filterset=3'>Carbon Dioxide</A><BR>
// <A href='byond://?src=\ref[src];filterset=4'>Nitrous Oxide</A><BR>
// <A href='byond://?src=\ref[src];filterset=-1'>Nothing</A><BR>
// <HR>
// <B>Set Flow Rate Limit:</B>
// [src.set_flow_rate]L/s | <a href='byond://?src=\ref[src];set_flow_rate=1'>Change</a><BR>
// <B>Flow rate: </B>[round(last_flow_rate, 0.1)]L/s
// "}
// user << browse("<html><HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT></html>", "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)

View File

@@ -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: ") + "<a href='byond://?src=\ref[src];power=1'>[use_power?"On":"Off"]</a><br>
// <b>Set Flow Rate Limit: </b>
// [set_flow_rate]L/s | <a href='byond://?src=\ref[src];set_press=1'>Change</a>
// <br>
// <b>Flow Rate: </b>[round(last_flow_rate, 0.1)]L/s
// <br><hr>
// <b>Node 1 ([dir_name(node_connects[1],TRUE)]) Concentration:</b>
// <a href='byond://?src=\ref[src];node1_c=-0.1'><b>-</b></a>
// <a href='byond://?src=\ref[src];node1_c=-0.01'>-</a>
// [mixing_inputs[air1]]([mixing_inputs[air1]*100]%)
// <a href='byond://?src=\ref[src];node1_c=0.01'><b>+</b></a>
// <a href='byond://?src=\ref[src];node1_c=0.1'>+</a>
// <br>
// <b>Node 2 ([dir_name(node_connects[2],TRUE)]) Concentration:</b>
// <a href='byond://?src=\ref[src];node2_c=-0.1'><b>-</b></a>
// <a href='byond://?src=\ref[src];node2_c=-0.01'>-</a>
// [mixing_inputs[air2]]([mixing_inputs[air2]*100]%)
// <a href='byond://?src=\ref[src];node2_c=0.01'><b>+</b></a>
// <a href='byond://?src=\ref[src];node2_c=0.1'>+</a>
// "}
// user << browse("<html><HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT></html>", "window=atmo_mixer")
// onclose(user, "atmo_mixer")
// return
/obj/machinery/atmospherics/trinary/mixer/tgui_act(action, params)
if(..())

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -88,8 +88,8 @@ const InputArea = (props) => {
<Stack fill>
<Stack.Item>
<Button
disabled={input === min_value}
icon="angle-double-left"
disabled={input === min_value || min_value === -Infinity}
icon={min_value === -Infinity ? 'infinity' : 'angle-double-left'}
onClick={() => onClick(min_value)}
tooltip={min_value ? `Min (${min_value})` : 'Min'}
/>
@@ -110,8 +110,8 @@ const InputArea = (props) => {
</Stack.Item>
<Stack.Item>
<Button
disabled={input === max_value}
icon="angle-double-right"
disabled={input === max_value || max_value === Infinity}
icon={max_value === Infinity ? 'infinity' : 'angle-double-right'}
onClick={() => onClick(max_value)}
tooltip={max_value ? `Max (${max_value})` : 'Max'}
/>

View File

@@ -4295,7 +4295,6 @@
#include "code\modules\reagents\reagents\drugs.dm"
#include "code\modules\reagents\reagents\food_drinks.dm"
#include "code\modules\reagents\reagents\food_drinks_vr.dm"
#include "code\modules\reagents\reagents\liquid_belly.dm"
#include "code\modules\reagents\reagents\medicine.dm"
#include "code\modules\reagents\reagents\medicine_ch.dm"
#include "code\modules\reagents\reagents\medicine_vr.dm"