Add a toggle for applying liquids to prey (#7123)

This commit is contained in:
TheGreatKitsune
2023-10-30 18:41:25 -05:00
committed by GitHub
parent da219bad86
commit 397f060b6f
7 changed files with 37 additions and 3 deletions

View File

@@ -17,6 +17,7 @@
var/liquid_overlay = TRUE //Belly-specific liquid overlay toggle
var/max_liquid_level = 100 //Custom max level for liquid overlay
var/mush_overlay = FALSE //Toggle for nutrition mush overlay
var/reagent_touches = TRUE //If reagents touch and interact with things in belly
var/mush_color = "#664330" //Nutrition mush overlay color
var/mush_alpha = 255 //Mush overlay transparency.
var/max_mush = 500 //How much nutrition for full mush overlay
@@ -193,7 +194,7 @@
/obj/belly/proc/HandleBellyReagentEffects(var/list/touchable_atoms)
if(LAZYLEN(contents))
if(reagents.total_volume >= 5)
if(reagent_touches && reagents.total_volume >= 5)
var/affecting_amt = reagents.total_volume / max(LAZYLEN(touchable_atoms), 1)
if(affecting_amt > 5)
affecting_amt = 5

View File

@@ -274,6 +274,7 @@
"reagentcolor",
"liquid_overlay",
"max_liquid_level",
"reagent_touches",
"mush_overlay",
"mush_color",
"mush_alpha",
@@ -1930,6 +1931,7 @@
dupe.reagentcolor = reagentcolor
dupe.liquid_overlay = liquid_overlay
dupe.max_liquid_level = max_liquid_level
dupe.reagent_touches = reagent_touches
dupe.mush_overlay = mush_overlay
dupe.mush_color = mush_color
dupe.mush_alpha = mush_alpha

View File

@@ -255,6 +255,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
"custom_reagentalpha" = selected.custom_reagentalpha,
"liquid_overlay" = selected.liquid_overlay,
"max_liquid_level" = selected.max_liquid_level,
"reagent_touches" = selected.reagent_touches,
"mush_overlay" = selected.mush_overlay,
"mush_color" = selected.mush_color,
"mush_alpha" = selected.mush_alpha,
@@ -448,6 +449,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
selected_list["liq_interacts"]["custom_reagentalpha"] = selected.custom_reagentalpha ? selected.custom_reagentalpha : "Default"
selected_list["liq_interacts"]["liquid_overlay"] = selected.liquid_overlay
selected_list["liq_interacts"]["max_liquid_level"] = selected.max_liquid_level
selected_list["liq_interacts"]["reagent_touches"] = selected.reagent_touches
selected_list["liq_interacts"]["mush_overlay"] = selected.mush_overlay
selected_list["liq_interacts"]["mush_color"] = selected.mush_color
selected_list["liq_interacts"]["mush_alpha"] = selected.mush_alpha
@@ -1413,6 +1415,13 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
var/max_liquid_level = belly_data["max_liquid_level"]
new_belly.max_liquid_level = CLAMP(max_liquid_level, 0, 100)
if(isnum(belly_data["reagent_touches"]))
var/new_reagent_touches = belly_data["reagent_touches"]
if(new_reagent_touches == 0)
new_belly.reagent_touches = FALSE
if(new_reagent_touches == 1)
new_belly.reagent_touches = TRUE
if(isnum(belly_data["mush_overlay"]))
var/new_mush_overlay = belly_data["mush_overlay"]
if(new_mush_overlay == 0)
@@ -3248,6 +3257,14 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
host.vore_selected.custom_reagentalpha = null
host.vore_selected.update_internal_overlay()
. = TRUE
if("b_reagent_touches")
if(!host.vore_selected.reagent_touches)
host.vore_selected.reagent_touches = 1
to_chat(usr,"<span class='warning'>Your [lowertext(host.vore_selected.name)] will now apply reagents to creatures when digesting.</span>")
else
host.vore_selected.reagent_touches = 0
to_chat(usr,"<span class='warning'>Your [lowertext(host.vore_selected.name)] will no longer apply reagents to creatures when digesting.</span>")
. = TRUE
if("b_mush_overlay")
if(!host.vore_selected.mush_overlay)
host.vore_selected.mush_overlay = 1

View File

@@ -302,6 +302,7 @@
belly_data["vorefootsteps_sounds"] = B.vorefootsteps_sounds
belly_data["liquid_overlay"] = B.liquid_overlay
belly_data["max_liquid_level"] = B.max_liquid_level
belly_data["reagent_toches"] = B.reagent_touches
belly_data["mush_overlay"] = B.mush_overlay
belly_data["mush_color"] = B.mush_color
belly_data["mush_alpha"] = B.mush_alpha

View File

@@ -50,7 +50,7 @@ const digestModeToPreyMode = {
* liq_reagent_transfer_verb, liq_reagent_nutri_rate, liq_reagent_capacity, liq_sloshing, liq_reagent_addons,
* show_liq_fullness, liq_messages, liq_msg_toggle1, liq_msg_toggle2, liq_msg_toggle3, liq_msg_toggle4,
* liq_msg_toggle5, liq_msg1, liq_msg2, liq_msg3, liq_msg4, liq_msg5, sound_volume, egg_name, recycling, entrance_logs, item_digest_logs, noise_freq,
* custom_reagentcolor, custom_reagentalpha, liquid_overlay, max_liquid_level, mush_overlay, mush_color, mush_alpha, max_mush, min_mush, item_mush_val,
* custom_reagentcolor, custom_reagentalpha, liquid_overlay, max_liquid_level, mush_overlay, reagent_touches, mush_color, mush_alpha, max_mush, min_mush, item_mush_val,
* metabolism_overlay, metabolism_mush_ratio, max_ingested, custom_ingested_color, custom_ingested_alpha
*
* To the tabs section of VoreSelectedBelly return
@@ -1859,6 +1859,7 @@ const VoreSelectedBellyLiquidOptions = (props, context) => {
custom_reagentalpha,
liquid_overlay,
max_liquid_level,
reagent_touches,
mush_overlay,
mush_color,
mush_alpha,
@@ -1980,6 +1981,16 @@ const VoreSelectedBellyLiquidOptions = (props, context) => {
icon="plus"
/>
</LabeledList.Item>
<LabeledList.Item label="Liquid Application to Prey">
<Button
onClick={() =>
act('liq_set_attribute', { liq_attribute: 'b_reagent_touches' })
}
icon={liq_interacts.reagent_touches ? 'toggle-on' : 'toggle-off'}
selected={liq_interacts.reagent_touches}
content={liq_interacts.reagent_touches ? 'On' : 'Off'}
/>
</LabeledList.Item>
<LabeledList.Item label="Custom Liquid Color">
<LiquidColorInput
action_name="b_custom_reagentcolor"

View File

@@ -281,6 +281,7 @@ type Belly = {
reagent_mode_flag_list: string[];
liquid_overlay: BooleanLike;
max_liquid_level: number;
reagent_touches: BooleanLike;
mush_overlay: BooleanLike;
mush_color: string;
mush_alpha: number;
@@ -449,6 +450,7 @@ const generateBellyString = (belly: Belly, index: number) => {
reagent_mode_flag_list,
liquid_overlay,
max_liquid_level,
reagent_touches,
mush_overlay,
mush_color,
mush_alpha,

File diff suppressed because one or more lines are too long