[MIRROR] Belly temperature (#11529)

Co-authored-by: SatinIsle <98125273+SatinIsle@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-29 15:04:54 -07:00
committed by GitHub
parent 0c6b4cd278
commit 393e117ffe
21 changed files with 494 additions and 472 deletions

View File

@@ -5,6 +5,7 @@
target.absorbable = source.absorbable; \ target.absorbable = source.absorbable; \
target.allowmobvore = source.allowmobvore; \ target.allowmobvore = source.allowmobvore; \
target.permit_healbelly = source.permit_healbelly; \ target.permit_healbelly = source.permit_healbelly; \
target.allowtemp = source.allowtemp; \
\ \
target.vore_taste = source.vore_taste; \ target.vore_taste = source.vore_taste; \
target.vore_smell = source.vore_smell; \ target.vore_smell = source.vore_smell; \

View File

@@ -746,6 +746,7 @@
// Hot air hurts :( // Hot air hurts :(
if(!isbelly(loc)) //None of this happens anyway whilst inside of a belly, belly temperatures are all handled as body temperature
if((breath.temperature <= species.cold_discomfort_level || breath.temperature >= species.heat_discomfort_level) && !(COLD_RESISTANCE in mutations)) if((breath.temperature <= species.cold_discomfort_level || breath.temperature >= species.heat_discomfort_level) && !(COLD_RESISTANCE in mutations))
if(breath.temperature <= species.breath_cold_level_1) if(breath.temperature <= species.breath_cold_level_1)
@@ -867,10 +868,13 @@
else if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) else if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
var/obj/machinery/atmospherics/unary/cryo_cell/cc = loc var/obj/machinery/atmospherics/unary/cryo_cell/cc = loc
loc_temp = cc.air_contents.temperature loc_temp = cc.air_contents.temperature
else if(isbelly(loc))
var/obj/belly/b = loc
loc_temp = b.bellytemperature
else else
loc_temp = environment.temperature loc_temp = environment.temperature
if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1) if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1 && (!isbelly(loc) || !allowtemp))
clear_alert("pressure") clear_alert("pressure")
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
@@ -889,8 +893,46 @@
var/relative_density = environment.total_moles / MOLES_CELLSTANDARD var/relative_density = environment.total_moles / MOLES_CELLSTANDARD
bodytemperature += between(BODYTEMP_COOLING_MAX, temp_adj*relative_density, BODYTEMP_HEATING_MAX) bodytemperature += between(BODYTEMP_COOLING_MAX, temp_adj*relative_density, BODYTEMP_HEATING_MAX)
if(isbelly(loc) && allowtemp)
var/obj/belly/b = loc
if(b.bellytemperature >= species.heat_discomfort_level) //A bit more easily triggered than normal, intentionally
var/burn_dam = 0
if(b.bellytemperature >= species.heat_level_1)
if(b.bellytemperature >= species.heat_level_2)
if(b.bellytemperature >= species.heat_level_3)
burn_dam = HEAT_DAMAGE_LEVEL_3
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_MAX)
else
burn_dam = HEAT_DAMAGE_LEVEL_2
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_MODERATE)
else
burn_dam = HEAT_DAMAGE_LEVEL_1
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_LOW)
else
throw_alert("temp", /obj/screen/alert/warm, HOT_ALERT_SEVERITY_LOW)
if(digestable && b.temperature_damage)
take_overall_damage(burn=burn_dam, used_weapon = "High Body Temperature")
else if(b.bellytemperature <= species.cold_discomfort_level)
var/cold_dam = 0
if(b.bellytemperature <= species.cold_level_1)
if(b.bellytemperature <= species.cold_level_2)
if(b.bellytemperature <= species.cold_level_3)
cold_dam = COLD_DAMAGE_LEVEL_3
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_MAX)
else
cold_dam = COLD_DAMAGE_LEVEL_2
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_MODERATE)
else
cold_dam = COLD_DAMAGE_LEVEL_1
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_LOW)
else
throw_alert("temp", /obj/screen/alert/chilly, COLD_ALERT_SEVERITY_LOW)
if(digestable && b.temperature_damage)
take_overall_damage(burn=cold_dam, used_weapon = "Low Body Temperature")
else clear_alert("temp")
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature >= species.heat_level_1) else if(bodytemperature >= species.heat_discomfort_level)
//Body temperature is too hot. //Body temperature is too hot.
if(SEND_SIGNAL(src, COMSIG_CHECK_FOR_GODMODE) & COMSIG_GODMODE_CANCEL) if(SEND_SIGNAL(src, COMSIG_CHECK_FOR_GODMODE) & COMSIG_GODMODE_CANCEL)
return 1 // Cancelled by a component return 1 // Cancelled by a component
@@ -912,7 +954,7 @@
take_overall_damage(burn=burn_dam, used_weapon = "High Body Temperature") take_overall_damage(burn=burn_dam, used_weapon = "High Body Temperature")
else if(bodytemperature <= species.cold_level_1) else if(bodytemperature <= species.cold_discomfort_level)
//Body temperature is too cold. //Body temperature is too cold.
if(SEND_SIGNAL(src, COMSIG_CHECK_FOR_GODMODE) & COMSIG_GODMODE_CANCEL) if(SEND_SIGNAL(src, COMSIG_CHECK_FOR_GODMODE) & COMSIG_GODMODE_CANCEL)

View File

@@ -43,6 +43,7 @@
selective_preference = client.prefs_vr.selective_preference selective_preference = client.prefs_vr.selective_preference
eating_privacy_global = client.prefs_vr.eating_privacy_global eating_privacy_global = client.prefs_vr.eating_privacy_global
allow_mimicry = client.prefs_vr.allow_mimicry allow_mimicry = client.prefs_vr.allow_mimicry
allowtemp = client.prefs_vr.allowtemp
drop_vore = client.prefs_vr.drop_vore drop_vore = client.prefs_vr.drop_vore
stumble_vore = client.prefs_vr.stumble_vore stumble_vore = client.prefs_vr.stumble_vore

View File

@@ -517,6 +517,10 @@
var/new_digest_clone = belly_data["digest_clone"] var/new_digest_clone = belly_data["digest_clone"]
new_belly.digest_clone = CLAMP(new_digest_clone, 0, new_belly.get_unused_digestion_damage()) new_belly.digest_clone = CLAMP(new_digest_clone, 0, new_belly.get_unused_digestion_damage())
if(isnum(belly_data["bellytemperature"]))
var/new_bellytemperature = belly_data["bellytemperature"]
new_belly.bellytemperature = CLAMP(new_bellytemperature, T0C, 473.15)
if(isnum(belly_data["shrink_grow_size"])) if(isnum(belly_data["shrink_grow_size"]))
var/new_shrink_grow_size = belly_data["shrink_grow_size"] var/new_shrink_grow_size = belly_data["shrink_grow_size"]
new_belly.shrink_grow_size = CLAMP(new_shrink_grow_size, 0.25, 2) new_belly.shrink_grow_size = CLAMP(new_shrink_grow_size, 0.25, 2)
@@ -569,6 +573,13 @@
if(new_recycling == 1) if(new_recycling == 1)
new_belly.recycling = TRUE new_belly.recycling = TRUE
if(isnum(belly_data["temperature_damage"]))
var/new_temp_damage = belly_data["temperature_damage"]
if(new_temp_damage == 0)
new_belly.temperature_damage = FALSE
if(new_temp_damage == 1)
new_belly.temperature_damage = TRUE
if(isnum(belly_data["storing_nutrition"])) if(isnum(belly_data["storing_nutrition"]))
var/new_storing_nutrition = belly_data["storing_nutrition"] var/new_storing_nutrition = belly_data["storing_nutrition"]
if(new_storing_nutrition == 0) if(new_storing_nutrition == 0)

View File

@@ -263,6 +263,8 @@
var/belchchance = 0 // % Chance of pred belching on prey struggle var/belchchance = 0 // % Chance of pred belching on prey struggle
var/list/belly_surrounding = list() // A list of living mobs surrounded by this belly, including inside containers, food, on mobs, etc. Exclusing inside other bellies. var/list/belly_surrounding = list() // A list of living mobs surrounded by this belly, including inside containers, food, on mobs, etc. Exclusing inside other bellies.
var/bellytemperature = T20C // Temperature applied to humans in the belly.
var/temperature_damage = FALSE // Does temperature damage prey?
//For serialization, keep this updated, required for bellies to save correctly. //For serialization, keep this updated, required for bellies to save correctly.
/obj/belly/vars_to_save() /obj/belly/vars_to_save()
@@ -283,6 +285,7 @@
"digest_oxy", "digest_oxy",
"digest_tox", "digest_tox",
"digest_clone", "digest_clone",
"bellytemperature",
"immutable", "immutable",
"can_taste", "can_taste",
"escapable", "escapable",
@@ -1704,6 +1707,7 @@
dupe.digest_oxy = digest_oxy dupe.digest_oxy = digest_oxy
dupe.digest_tox = digest_tox dupe.digest_tox = digest_tox
dupe.digest_clone = digest_clone dupe.digest_clone = digest_clone
dupe.bellytemperature = bellytemperature
dupe.immutable = immutable dupe.immutable = immutable
dupe.can_taste = can_taste dupe.can_taste = can_taste
dupe.escapable = escapable dupe.escapable = escapable

View File

@@ -286,6 +286,9 @@
belly_data["digest_tox"] = B.digest_tox belly_data["digest_tox"] = B.digest_tox
belly_data["digest_clone"] = B.digest_clone belly_data["digest_clone"] = B.digest_clone
belly_data["bellytemperature"] = B.bellytemperature
belly_data["temperature_damage"] = B.temperature_damage
belly_data["can_taste"] = B.can_taste belly_data["can_taste"] = B.can_taste
belly_data["is_feedable"] = B.is_feedable belly_data["is_feedable"] = B.is_feedable
belly_data["contaminates"] = B.contaminates belly_data["contaminates"] = B.contaminates

View File

@@ -1040,6 +1040,7 @@
dat += span_bold("Absorption Permission:") + " [absorbable ? span_green("Allowed") : span_red("Disallowed")]<br>" dat += span_bold("Absorption Permission:") + " [absorbable ? span_green("Allowed") : span_red("Disallowed")]<br>"
dat += span_bold("Selective Mode Pref:") + " [src.selective_preference]<br>" dat += span_bold("Selective Mode Pref:") + " [src.selective_preference]<br>"
dat += span_bold("Mob Vore:") + " [allowmobvore ? span_green("Enabled") : span_red("Disabled")]<br>" dat += span_bold("Mob Vore:") + " [allowmobvore ? span_green("Enabled") : span_red("Disabled")]<br>"
dat += span_bold("Affected by temperature:") + " [allowtemp ? span_green("Enabled") : span_red("Disabled")]<br>"
dat += span_bold("Autotransferable:") + " [autotransferable ? span_green("Enabled") : span_red("Disabled")]<br>" dat += span_bold("Autotransferable:") + " [autotransferable ? span_green("Enabled") : span_red("Disabled")]<br>"
dat += span_bold("Can be stripped:") + " [strip_pref ? span_green("Allowed") : span_red("Disallowed")]<br>" dat += span_bold("Can be stripped:") + " [strip_pref ? span_green("Allowed") : span_red("Disallowed")]<br>"
dat += span_bold("Applying reagents:") + " [apply_reagents ? span_green("Allowed") : span_red("Disallowed")]<br>" dat += span_bold("Applying reagents:") + " [apply_reagents ? span_green("Allowed") : span_red("Disallowed")]<br>"

View File

@@ -6,6 +6,7 @@
var/resizable = TRUE // Can other people resize you? (Usually ignored for self-resizes) var/resizable = TRUE // Can other people resize you? (Usually ignored for self-resizes)
var/digest_leave_remains = FALSE // Will this mob leave bones/skull/etc after the melty demise? var/digest_leave_remains = FALSE // Will this mob leave bones/skull/etc after the melty demise?
var/allowmobvore = TRUE // Will simplemobs attempt to eat the mob? var/allowmobvore = TRUE // Will simplemobs attempt to eat the mob?
var/allowtemp = TRUE // Can they be affected by belly temperature?
var/obj/belly/vore_selected // Default to no vore capability. var/obj/belly/vore_selected // Default to no vore capability.
var/list/vore_organs = list() // List of vore containers inside a mob var/list/vore_organs = list() // List of vore containers inside a mob
var/absorbed = FALSE // If a mob is absorbed into another var/absorbed = FALSE // If a mob is absorbed into another

View File

@@ -7,6 +7,7 @@
"absorbable" = owner.absorbable, "absorbable" = owner.absorbable,
"digest_leave_remains" = owner.digest_leave_remains, "digest_leave_remains" = owner.digest_leave_remains,
"allowmobvore" = owner.allowmobvore, "allowmobvore" = owner.allowmobvore,
"allowtemp" = owner.allowtemp,
"permit_healbelly" = owner.permit_healbelly, "permit_healbelly" = owner.permit_healbelly,
"show_vore_fx" = owner.show_vore_fx, "show_vore_fx" = owner.show_vore_fx,
"can_be_drop_prey" = owner.can_be_drop_prey, "can_be_drop_prey" = owner.can_be_drop_prey,

View File

@@ -495,8 +495,7 @@
return FALSE return FALSE
if(choice == 0) if(choice == 0)
choice = rand(MIN_VOICE_FREQ, MAX_VOICE_FREQ) choice = rand(MIN_VOICE_FREQ, MAX_VOICE_FREQ)
choice = CLAMP(choice, MIN_VOICE_FREQ, MAX_VOICE_FREQ) host.vore_selected.noise_freq = CLAMP(choice, MIN_VOICE_FREQ, MAX_VOICE_FREQ)
host.vore_selected.noise_freq = choice
. = TRUE . = TRUE
if("b_tastes") if("b_tastes")
host.vore_selected.can_taste = !host.vore_selected.can_taste host.vore_selected.can_taste = !host.vore_selected.can_taste
@@ -541,38 +540,43 @@
var/new_damage = text2num(params["val"]) var/new_damage = text2num(params["val"])
if(!isnum(new_damage)) if(!isnum(new_damage))
return FALSE return FALSE
new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_burn) // sanity check following tgui input host.vore_selected.digest_burn = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_burn) // sanity check following tgui input
host.vore_selected.digest_burn = new_damage
host.vore_selected.items_preserved.Cut() host.vore_selected.items_preserved.Cut()
. = TRUE . = TRUE
if("b_brute_dmg") if("b_brute_dmg")
var/new_damage = text2num(params["val"]) var/new_damage = text2num(params["val"])
if(!isnum(new_damage)) if(!isnum(new_damage))
return FALSE return FALSE
new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_brute) host.vore_selected.digest_brute = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_brute)
host.vore_selected.digest_brute = new_damage
host.vore_selected.items_preserved.Cut() host.vore_selected.items_preserved.Cut()
. = TRUE . = TRUE
if("b_oxy_dmg") if("b_oxy_dmg")
var/new_damage = text2num(params["val"]) var/new_damage = text2num(params["val"])
if(!isnum(new_damage)) if(!isnum(new_damage))
return FALSE return FALSE
new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_oxy) host.vore_selected.digest_oxy = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_oxy)
host.vore_selected.digest_oxy = new_damage
. = TRUE . = TRUE
if("b_tox_dmg") if("b_tox_dmg")
var/new_damage = text2num(params["val"]) var/new_damage = text2num(params["val"])
if(!isnum(new_damage)) if(!isnum(new_damage))
return FALSE return FALSE
new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_tox) host.vore_selected.digest_tox = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_tox)
host.vore_selected.digest_tox = new_damage
. = TRUE . = TRUE
if("b_clone_dmg") if("b_clone_dmg")
var/new_damage = text2num(params["val"]) var/new_damage = text2num(params["val"])
if(!isnum(new_damage)) if(!isnum(new_damage))
return FALSE return FALSE
new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_clone) host.vore_selected.digest_clone = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_clone)
host.vore_selected.digest_clone = new_damage . = TRUE
if("b_bellytemperature")
var/new_temp = text2num(params["val"])
if(!isnum(new_temp))
return FALSE
new_temp = new_temp + T0C
host.vore_selected.bellytemperature = CLAMP(new_temp, T0C, 473.15)
. = TRUE
if("b_temperature_damage")
host.vore_selected.temperature_damage = !host.vore_selected.temperature_damage
. = TRUE . = TRUE
if("b_drainmode") if("b_drainmode")
var/new_drainmode = params["val"] var/new_drainmode = params["val"]

View File

@@ -167,6 +167,8 @@
"digest_clone" = selected.digest_clone, "digest_clone" = selected.digest_clone,
"digest_max" = selected.digest_max, "digest_max" = selected.digest_max,
"digest_free" = selected.get_unused_digestion_damage(), "digest_free" = selected.get_unused_digestion_damage(),
"bellytemperature" = selected.bellytemperature,
"temperature_damage" = selected.temperature_damage,
"bulge_size" = selected.bulge_size, "bulge_size" = selected.bulge_size,
"shrink_grow_size" = selected.shrink_grow_size, "shrink_grow_size" = selected.shrink_grow_size,
"contaminates" = selected.contaminates, "contaminates" = selected.contaminates,

View File

@@ -49,6 +49,7 @@
var/eating_privacy_global = FALSE //Makes eating attempt/success messages only reach for subtle range if true, overwritten by belly-specific var var/eating_privacy_global = FALSE //Makes eating attempt/success messages only reach for subtle range if true, overwritten by belly-specific var
var/vore_death_privacy = FALSE //Makes it so that vore deaths don't get advertised to ghosts var/vore_death_privacy = FALSE //Makes it so that vore deaths don't get advertised to ghosts
var/allow_mimicry = TRUE var/allow_mimicry = TRUE
var/allowtemp = TRUE //Can be affected by belly temperature
// These are 'modifier' prefs, do nothing on their own but pair with drop_prey/drop_pred settings. // These are 'modifier' prefs, do nothing on their own but pair with drop_prey/drop_pred settings.
var/drop_vore = TRUE var/drop_vore = TRUE
@@ -193,6 +194,7 @@
absorbable = json_from_file["absorbable"] absorbable = json_from_file["absorbable"]
digest_leave_remains = json_from_file["digest_leave_remains"] digest_leave_remains = json_from_file["digest_leave_remains"]
allowmobvore = json_from_file["allowmobvore"] allowmobvore = json_from_file["allowmobvore"]
allowtemp = json_from_file["allowtemp"]
vore_taste = json_from_file["vore_taste"] vore_taste = json_from_file["vore_taste"]
vore_smell = json_from_file["vore_smell"] vore_smell = json_from_file["vore_smell"]
permit_healbelly = json_from_file["permit_healbelly"] permit_healbelly = json_from_file["permit_healbelly"]
@@ -262,6 +264,8 @@
digest_leave_remains = FALSE digest_leave_remains = FALSE
if(isnull(allowmobvore)) if(isnull(allowmobvore))
allowmobvore = TRUE allowmobvore = TRUE
if(isnull(allowtemp))
allowtemp = TRUE
if(isnull(permit_healbelly)) if(isnull(permit_healbelly))
permit_healbelly = TRUE permit_healbelly = TRUE
if(isnull(selective_preference)) if(isnull(selective_preference))
@@ -396,6 +400,7 @@
"feeding" = feeding, "feeding" = feeding,
"digest_leave_remains" = digest_leave_remains, "digest_leave_remains" = digest_leave_remains,
"allowmobvore" = allowmobvore, "allowmobvore" = allowmobvore,
"allowtemp" = allowtemp,
"vore_taste" = vore_taste, "vore_taste" = vore_taste,
"vore_smell" = vore_smell, "vore_smell" = vore_smell,
"permit_healbelly" = permit_healbelly, "permit_healbelly" = permit_healbelly,

View File

@@ -401,6 +401,12 @@
host.client.prefs_vr.digestable = host.digestable host.client.prefs_vr.digestable = host.digestable
unsaved_changes = TRUE unsaved_changes = TRUE
return TRUE return TRUE
if("toggle_allowtemp")
host.allowtemp = !host.allowtemp
if(host.client.prefs_vr)
host.client.prefs_vr.allowtemp = host.allowtemp
unsaved_changes = TRUE
return TRUE
if("toggle_global_privacy") if("toggle_global_privacy")
host.eating_privacy_global = !host.eating_privacy_global host.eating_privacy_global = !host.eating_privacy_global
if(host.client.prefs_vr) if(host.client.prefs_vr)

View File

@@ -24,7 +24,7 @@ type Data = {
type content = { name: string; index: number; amount: number }; type content = { name: string; index: number; amount: number };
const sortTypes = { const sortTypes = {
Alphabetical: (a: content, b: content) => a.name > b.name, Alphabetical: (a: content, b: content) => a.name.localeCompare(b.name),
'By amount': (a: content, b: content) => -(a.amount - b.amount), 'By amount': (a: content, b: content) => -(a.amount - b.amount),
}; };

View File

@@ -21,6 +21,7 @@ export const VoreUserPreferences = (props: {
absorbable, absorbable,
devourable, devourable,
allowmobvore, allowmobvore,
allowtemp,
feeding, feeding,
permit_healbelly, permit_healbelly,
can_be_drop_prey, can_be_drop_prey,
@@ -120,6 +121,19 @@ export const VoreUserPreferences = (props: {
disabled: 'No Mobs eating you', disabled: 'No Mobs eating you',
}, },
}, },
temperature: {
action: 'toggle_allowtemp',
test: allowtemp,
tooltip: {
main: "This button is for those who don't want to be affected by belly temperature, as temperature can be deadly.",
enable: 'Click here to be affected by belly temperature.',
disable: 'Click here to not be affected by belly temperature.',
},
content: {
enabled: 'Affected By Temperature',
disabled: 'Immune To Temperature',
},
},
feed: { feed: {
action: 'toggle_feed', action: 'toggle_feed',
test: feeding, test: feeding,

View File

@@ -1,6 +1,7 @@
import { LabeledList } from 'tgui-core/components'; import { LabeledList } from 'tgui-core/components';
import { digestModeToColor, selectiveBellyOptions } from '../../constants'; import { digestModeToColor, selectiveBellyOptions } from '../../constants';
import { bellyTemperatureToColor } from '../../functions';
import type { bellyOptionData } from '../../types'; import type { bellyOptionData } from '../../types';
import { VorePanelEditDropdown } from '../../VorePanelElements/VorePanelEditDropdown'; import { VorePanelEditDropdown } from '../../VorePanelElements/VorePanelEditDropdown';
import { VorePanelEditNumber } from '../../VorePanelElements/VorePanelEditNumber'; import { VorePanelEditNumber } from '../../VorePanelElements/VorePanelEditNumber';
@@ -20,6 +21,8 @@ export const BellyOptionsRight = (props: {
digest_clone, digest_clone,
digest_max, digest_max,
digest_free, digest_free,
bellytemperature,
temperature_damage,
shrink_grow_size, shrink_grow_size,
egg_type, egg_type,
egg_types, egg_types,
@@ -146,6 +149,33 @@ export const BellyOptionsRight = (props: {
color="purple" color="purple"
/> />
</LabeledList.Item> </LabeledList.Item>
<LabeledList.Item label="Belly Temperature">
<VorePanelEditNumber
tooltip={
'Choose a temperature between -100*C and 200*C for the temperature inside of this belly.'
}
action="set_attribute"
subAction="b_bellytemperature"
editMode={editMode}
value={Math.round((bellytemperature - 273.15) * 10) / 10}
minValue={-100}
step={0.01}
stepPixel={0.1}
digits={1}
maxValue={200}
unit="°C"
color={bellyTemperatureToColor(bellytemperature)}
/>
</LabeledList.Item>
<LabeledList.Item label="Temperature Damage">
<VorePanelEditSwitch
action="set_attribute"
subAction="b_temperature_damage"
editMode={editMode}
active={!!temperature_damage}
tooltip="If enabled, temperature will deal damage if too hot or cold for prey (assuming they have digestion enabled)."
/>
</LabeledList.Item>
<LabeledList.Item label="Drain Finishing Mode"> <LabeledList.Item label="Drain Finishing Mode">
<VorePanelEditDropdown <VorePanelEditDropdown
action="set_attribute" action="set_attribute"

View File

@@ -87,12 +87,18 @@ export const VoreUserPreferencesDevouring = (props: {
tooltipPosition="left" tooltipPosition="left"
/> />
</Stack.Item> </Stack.Item>
<Stack.Item basis="34%"> <Stack.Item basis="32%">
<VoreUserPreferenceItem <VoreUserPreferenceItem
spec={preferences.toggle_digest_pain} spec={preferences.toggle_digest_pain}
tooltipPosition="right" tooltipPosition="right"
/> />
</Stack.Item> </Stack.Item>
<Stack.Item basis="32%">
<VoreUserPreferenceItem
spec={preferences.temperature}
tooltipPosition="top"
/>
</Stack.Item>
</Stack> </Stack>
) : ( ) : (
'' ''

View File

@@ -2,7 +2,10 @@ export function abilitiy_usable(nutri: number, cost: number): boolean {
return nutri >= cost; return nutri >= cost;
} }
export function sanitize_color(color?: string | null, mirrorBlack?: boolean) { export function sanitize_color(
color?: string | null,
mirrorBlack?: boolean,
): string | undefined {
if (!color) { if (!color) {
return undefined; return undefined;
} }
@@ -17,7 +20,7 @@ export function sanitize_color(color?: string | null, mirrorBlack?: boolean) {
return ctx.fillStyle; return ctx.fillStyle;
} }
export function calcLineHeight(lim: number, height: number) { export function calcLineHeight(lim: number, height: number): string {
return `${(Math.ceil(lim / 25 / height + 0.5) * height).toFixed()}px`; return `${(Math.ceil(lim / 25 / height + 0.5) * height).toFixed()}px`;
} }
@@ -27,7 +30,7 @@ export function fixCorruptedData(
| string[] | string[]
| null | null
| Record<string | number, string | number>, | Record<string | number, string | number>,
) { ): { corrupted?: boolean; data: string | string[] } {
if (toSanitize === null) { if (toSanitize === null) {
return { data: '' }; return { data: '' };
} }
@@ -49,8 +52,20 @@ export function fixCorruptedData(
return { corrupted: true, data: clearedData || [] }; return { corrupted: true, data: clearedData || [] };
} }
export function bellyTemperatureToColor(temp: number): string | undefined {
if (temp < 260) {
return 'teal';
}
if (temp > 360) {
return 'red';
}
return undefined;
}
// Those can't be used currently, due to byond limitations // Those can't be used currently, due to byond limitations
export async function copy_to_clipboard(value: string | string[]) { export async function copy_to_clipboard(
value: string | string[],
): Promise<void> {
let data = value; let data = value;
if (Array.isArray(data)) { if (Array.isArray(data)) {
data = data.join('\n\n'); data = data.join('\n\n');
@@ -58,7 +73,9 @@ export async function copy_to_clipboard(value: string | string[]) {
await navigator.clipboard.writeText(data); await navigator.clipboard.writeText(data);
} }
export async function paste_from_clipboard(asArray = false) { export async function paste_from_clipboard(
asArray = false,
): Promise<string | string[]> {
const ourText = await navigator.clipboard.readText(); const ourText = await navigator.clipboard.readText();
if (asArray) { if (asArray) {
return ourText.split('\n\n'); return ourText.split('\n\n');

View File

@@ -107,6 +107,7 @@ export type bellyOptionData = {
digest_oxy: number; digest_oxy: number;
digest_tox: number; digest_tox: number;
digest_clone: number; digest_clone: number;
bellytemperature: number;
digest_max: number; digest_max: number;
digest_free: number; digest_free: number;
bulge_size: number; bulge_size: number;
@@ -137,6 +138,7 @@ export type bellyOptionData = {
absorbedrename_name_min: number; absorbedrename_name_min: number;
drainmode_options: string[]; drainmode_options: string[];
drainmode: string; drainmode: string;
temperature_damage: BooleanLike;
}; };
export type bellySoundData = { export type bellySoundData = {
@@ -300,6 +302,7 @@ export type prefData = {
absorbable: BooleanLike; absorbable: BooleanLike;
digest_leave_remains: BooleanLike; digest_leave_remains: BooleanLike;
allowmobvore: BooleanLike; allowmobvore: BooleanLike;
allowtemp: BooleanLike;
permit_healbelly: BooleanLike; permit_healbelly: BooleanLike;
show_vore_fx: BooleanLike; show_vore_fx: BooleanLike;
can_be_drop_prey: BooleanLike; can_be_drop_prey: BooleanLike;
@@ -414,6 +417,7 @@ export type localPrefs = {
absorbable: preferenceData; absorbable: preferenceData;
devour: preferenceData; devour: preferenceData;
mobvore: preferenceData; mobvore: preferenceData;
temperature: preferenceData;
feed: preferenceData; feed: preferenceData;
healbelly: preferenceData; healbelly: preferenceData;
dropnom_prey: preferenceData; dropnom_prey: preferenceData;

View File

@@ -29,6 +29,7 @@ export type Belly = {
digest_oxy: number; digest_oxy: number;
digest_tox: number; digest_tox: number;
digest_clone: number; digest_clone: number;
bellytemperature: number;
can_taste: BooleanLike; can_taste: BooleanLike;
is_feedable: BooleanLike; is_feedable: BooleanLike;
@@ -52,6 +53,7 @@ export type Belly = {
storing_nutrition: BooleanLike; storing_nutrition: BooleanLike;
entrance_logs: BooleanLike; entrance_logs: BooleanLike;
item_digest_logs: BooleanLike; item_digest_logs: BooleanLike;
temperature_damage: BooleanLike;
// Messages // Messages
struggle_messages_outside: string[]; struggle_messages_outside: string[];