mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[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:
committed by
GitHub
parent
0c6b4cd278
commit
393e117ffe
@@ -5,6 +5,7 @@
|
||||
target.absorbable = source.absorbable; \
|
||||
target.allowmobvore = source.allowmobvore; \
|
||||
target.permit_healbelly = source.permit_healbelly; \
|
||||
target.allowtemp = source.allowtemp; \
|
||||
\
|
||||
target.vore_taste = source.vore_taste; \
|
||||
target.vore_smell = source.vore_smell; \
|
||||
|
||||
@@ -746,66 +746,67 @@
|
||||
|
||||
|
||||
// Hot air hurts :(
|
||||
if((breath.temperature <= species.cold_discomfort_level || breath.temperature >= species.heat_discomfort_level) && !(COLD_RESISTANCE in mutations))
|
||||
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.breath_cold_level_1)
|
||||
if(prob(20))
|
||||
to_chat(src, span_danger("You feel your face freezing and icicles forming in your lungs!"))
|
||||
else if(breath.temperature >= species.breath_heat_level_1)
|
||||
if(prob(20))
|
||||
to_chat(src, span_danger("You feel your face burning and a searing heat in your lungs!"))
|
||||
|
||||
if(breath.temperature >= species.heat_discomfort_level)
|
||||
|
||||
if(breath.temperature >= species.breath_heat_level_3)
|
||||
apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_MAX)
|
||||
else if(breath.temperature >= species.breath_heat_level_2)
|
||||
apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_MODERATE)
|
||||
if(breath.temperature <= species.breath_cold_level_1)
|
||||
if(prob(20))
|
||||
to_chat(src, span_danger("You feel your face freezing and icicles forming in your lungs!"))
|
||||
else if(breath.temperature >= species.breath_heat_level_1)
|
||||
apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_LOW)
|
||||
else if(species.get_environment_discomfort(src, ENVIRONMENT_COMFORT_MARKER_HOT))
|
||||
throw_alert("temp", /obj/screen/alert/warm, HOT_ALERT_SEVERITY_LOW)
|
||||
if(prob(20))
|
||||
to_chat(src, span_danger("You feel your face burning and a searing heat in your lungs!"))
|
||||
|
||||
if(breath.temperature >= species.heat_discomfort_level)
|
||||
|
||||
if(breath.temperature >= species.breath_heat_level_3)
|
||||
apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_MAX)
|
||||
else if(breath.temperature >= species.breath_heat_level_2)
|
||||
apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_MODERATE)
|
||||
else if(breath.temperature >= species.breath_heat_level_1)
|
||||
apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/hot, HOT_ALERT_SEVERITY_LOW)
|
||||
else if(species.get_environment_discomfort(src, ENVIRONMENT_COMFORT_MARKER_HOT))
|
||||
throw_alert("temp", /obj/screen/alert/warm, HOT_ALERT_SEVERITY_LOW)
|
||||
else
|
||||
clear_alert("temp")
|
||||
|
||||
else if(breath.temperature <= species.cold_discomfort_level)
|
||||
|
||||
if(breath.temperature <= species.breath_cold_level_3)
|
||||
apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_MAX)
|
||||
else if(breath.temperature <= species.breath_cold_level_2)
|
||||
apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_MODERATE)
|
||||
else if(breath.temperature <= species.breath_cold_level_1)
|
||||
apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_LOW)
|
||||
else if(species.get_environment_discomfort(src, ENVIRONMENT_COMFORT_MARKER_COLD))
|
||||
throw_alert("temp", /obj/screen/alert/chilly, COLD_ALERT_SEVERITY_LOW)
|
||||
else
|
||||
clear_alert("temp")
|
||||
|
||||
//breathing in hot/cold air also heats/cools you a bit
|
||||
var/temp_adj = breath.temperature - bodytemperature
|
||||
if (temp_adj < 0)
|
||||
temp_adj /= (BODYTEMP_COLD_DIVISOR * 5) //don't raise temperature as much as if we were directly exposed
|
||||
else
|
||||
clear_alert("temp")
|
||||
temp_adj /= (BODYTEMP_HEAT_DIVISOR * 5) //don't raise temperature as much as if we were directly exposed
|
||||
|
||||
else if(breath.temperature <= species.cold_discomfort_level)
|
||||
var/relative_density = breath.total_moles / (MOLES_CELLSTANDARD * BREATH_PERCENTAGE)
|
||||
temp_adj *= relative_density
|
||||
|
||||
if(breath.temperature <= species.breath_cold_level_3)
|
||||
apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_MAX)
|
||||
else if(breath.temperature <= species.breath_cold_level_2)
|
||||
apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_MODERATE)
|
||||
else if(breath.temperature <= species.breath_cold_level_1)
|
||||
apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, BP_HEAD)
|
||||
throw_alert("temp", /obj/screen/alert/cold, COLD_ALERT_SEVERITY_LOW)
|
||||
else if(species.get_environment_discomfort(src, ENVIRONMENT_COMFORT_MARKER_COLD))
|
||||
throw_alert("temp", /obj/screen/alert/chilly, COLD_ALERT_SEVERITY_LOW)
|
||||
else
|
||||
clear_alert("temp")
|
||||
if(temp_adj > BODYTEMP_HEATING_MAX)
|
||||
temp_adj = BODYTEMP_HEATING_MAX
|
||||
if(temp_adj < BODYTEMP_COOLING_MAX)
|
||||
temp_adj = BODYTEMP_COOLING_MAX
|
||||
|
||||
bodytemperature += temp_adj
|
||||
|
||||
//breathing in hot/cold air also heats/cools you a bit
|
||||
var/temp_adj = breath.temperature - bodytemperature
|
||||
if (temp_adj < 0)
|
||||
temp_adj /= (BODYTEMP_COLD_DIVISOR * 5) //don't raise temperature as much as if we were directly exposed
|
||||
else
|
||||
temp_adj /= (BODYTEMP_HEAT_DIVISOR * 5) //don't raise temperature as much as if we were directly exposed
|
||||
|
||||
var/relative_density = breath.total_moles / (MOLES_CELLSTANDARD * BREATH_PERCENTAGE)
|
||||
temp_adj *= relative_density
|
||||
|
||||
if(temp_adj > BODYTEMP_HEATING_MAX)
|
||||
temp_adj = BODYTEMP_HEATING_MAX
|
||||
if(temp_adj < BODYTEMP_COOLING_MAX)
|
||||
temp_adj = BODYTEMP_COOLING_MAX
|
||||
|
||||
bodytemperature += temp_adj
|
||||
|
||||
else
|
||||
clear_alert("temp")
|
||||
clear_alert("temp")
|
||||
|
||||
breath.update_values()
|
||||
return 1
|
||||
@@ -867,10 +868,13 @@
|
||||
else if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
|
||||
var/obj/machinery/atmospherics/unary/cryo_cell/cc = loc
|
||||
loc_temp = cc.air_contents.temperature
|
||||
else if(isbelly(loc))
|
||||
var/obj/belly/b = loc
|
||||
loc_temp = b.bellytemperature
|
||||
else
|
||||
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")
|
||||
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
|
||||
|
||||
@@ -889,8 +893,46 @@
|
||||
var/relative_density = environment.total_moles / MOLES_CELLSTANDARD
|
||||
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.
|
||||
if(bodytemperature >= species.heat_level_1)
|
||||
else if(bodytemperature >= species.heat_discomfort_level)
|
||||
//Body temperature is too hot.
|
||||
if(SEND_SIGNAL(src, COMSIG_CHECK_FOR_GODMODE) & COMSIG_GODMODE_CANCEL)
|
||||
return 1 // Cancelled by a component
|
||||
@@ -912,7 +954,7 @@
|
||||
|
||||
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.
|
||||
|
||||
if(SEND_SIGNAL(src, COMSIG_CHECK_FOR_GODMODE) & COMSIG_GODMODE_CANCEL)
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
selective_preference = client.prefs_vr.selective_preference
|
||||
eating_privacy_global = client.prefs_vr.eating_privacy_global
|
||||
allow_mimicry = client.prefs_vr.allow_mimicry
|
||||
allowtemp = client.prefs_vr.allowtemp
|
||||
|
||||
drop_vore = client.prefs_vr.drop_vore
|
||||
stumble_vore = client.prefs_vr.stumble_vore
|
||||
|
||||
@@ -517,6 +517,10 @@
|
||||
var/new_digest_clone = belly_data["digest_clone"]
|
||||
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"]))
|
||||
var/new_shrink_grow_size = belly_data["shrink_grow_size"]
|
||||
new_belly.shrink_grow_size = CLAMP(new_shrink_grow_size, 0.25, 2)
|
||||
@@ -569,6 +573,13 @@
|
||||
if(new_recycling == 1)
|
||||
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"]))
|
||||
var/new_storing_nutrition = belly_data["storing_nutrition"]
|
||||
if(new_storing_nutrition == 0)
|
||||
|
||||
@@ -263,6 +263,8 @@
|
||||
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/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.
|
||||
/obj/belly/vars_to_save()
|
||||
@@ -283,6 +285,7 @@
|
||||
"digest_oxy",
|
||||
"digest_tox",
|
||||
"digest_clone",
|
||||
"bellytemperature",
|
||||
"immutable",
|
||||
"can_taste",
|
||||
"escapable",
|
||||
@@ -1704,6 +1707,7 @@
|
||||
dupe.digest_oxy = digest_oxy
|
||||
dupe.digest_tox = digest_tox
|
||||
dupe.digest_clone = digest_clone
|
||||
dupe.bellytemperature = bellytemperature
|
||||
dupe.immutable = immutable
|
||||
dupe.can_taste = can_taste
|
||||
dupe.escapable = escapable
|
||||
|
||||
@@ -286,6 +286,9 @@
|
||||
belly_data["digest_tox"] = B.digest_tox
|
||||
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["is_feedable"] = B.is_feedable
|
||||
belly_data["contaminates"] = B.contaminates
|
||||
|
||||
@@ -1040,6 +1040,7 @@
|
||||
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("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("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>"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
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/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/list/vore_organs = list() // List of vore containers inside a mob
|
||||
var/absorbed = FALSE // If a mob is absorbed into another
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"absorbable" = owner.absorbable,
|
||||
"digest_leave_remains" = owner.digest_leave_remains,
|
||||
"allowmobvore" = owner.allowmobvore,
|
||||
"allowtemp" = owner.allowtemp,
|
||||
"permit_healbelly" = owner.permit_healbelly,
|
||||
"show_vore_fx" = owner.show_vore_fx,
|
||||
"can_be_drop_prey" = owner.can_be_drop_prey,
|
||||
|
||||
@@ -495,8 +495,7 @@
|
||||
return FALSE
|
||||
if(choice == 0)
|
||||
choice = rand(MIN_VOICE_FREQ, MAX_VOICE_FREQ)
|
||||
choice = CLAMP(choice, MIN_VOICE_FREQ, MAX_VOICE_FREQ)
|
||||
host.vore_selected.noise_freq = choice
|
||||
host.vore_selected.noise_freq = CLAMP(choice, MIN_VOICE_FREQ, MAX_VOICE_FREQ)
|
||||
. = TRUE
|
||||
if("b_tastes")
|
||||
host.vore_selected.can_taste = !host.vore_selected.can_taste
|
||||
@@ -541,38 +540,43 @@
|
||||
var/new_damage = text2num(params["val"])
|
||||
if(!isnum(new_damage))
|
||||
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 = new_damage
|
||||
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.items_preserved.Cut()
|
||||
. = TRUE
|
||||
if("b_brute_dmg")
|
||||
var/new_damage = text2num(params["val"])
|
||||
if(!isnum(new_damage))
|
||||
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 = new_damage
|
||||
host.vore_selected.digest_brute = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_brute)
|
||||
host.vore_selected.items_preserved.Cut()
|
||||
. = TRUE
|
||||
if("b_oxy_dmg")
|
||||
var/new_damage = text2num(params["val"])
|
||||
if(!isnum(new_damage))
|
||||
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 = new_damage
|
||||
host.vore_selected.digest_oxy = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_oxy)
|
||||
. = TRUE
|
||||
if("b_tox_dmg")
|
||||
var/new_damage = text2num(params["val"])
|
||||
if(!isnum(new_damage))
|
||||
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 = new_damage
|
||||
host.vore_selected.digest_tox = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_tox)
|
||||
. = TRUE
|
||||
if("b_clone_dmg")
|
||||
var/new_damage = text2num(params["val"])
|
||||
if(!isnum(new_damage))
|
||||
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 = new_damage
|
||||
host.vore_selected.digest_clone = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_clone)
|
||||
. = 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
|
||||
if("b_drainmode")
|
||||
var/new_drainmode = params["val"]
|
||||
|
||||
@@ -167,6 +167,8 @@
|
||||
"digest_clone" = selected.digest_clone,
|
||||
"digest_max" = selected.digest_max,
|
||||
"digest_free" = selected.get_unused_digestion_damage(),
|
||||
"bellytemperature" = selected.bellytemperature,
|
||||
"temperature_damage" = selected.temperature_damage,
|
||||
"bulge_size" = selected.bulge_size,
|
||||
"shrink_grow_size" = selected.shrink_grow_size,
|
||||
"contaminates" = selected.contaminates,
|
||||
|
||||
@@ -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/vore_death_privacy = FALSE //Makes it so that vore deaths don't get advertised to ghosts
|
||||
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.
|
||||
var/drop_vore = TRUE
|
||||
@@ -193,6 +194,7 @@
|
||||
absorbable = json_from_file["absorbable"]
|
||||
digest_leave_remains = json_from_file["digest_leave_remains"]
|
||||
allowmobvore = json_from_file["allowmobvore"]
|
||||
allowtemp = json_from_file["allowtemp"]
|
||||
vore_taste = json_from_file["vore_taste"]
|
||||
vore_smell = json_from_file["vore_smell"]
|
||||
permit_healbelly = json_from_file["permit_healbelly"]
|
||||
@@ -262,6 +264,8 @@
|
||||
digest_leave_remains = FALSE
|
||||
if(isnull(allowmobvore))
|
||||
allowmobvore = TRUE
|
||||
if(isnull(allowtemp))
|
||||
allowtemp = TRUE
|
||||
if(isnull(permit_healbelly))
|
||||
permit_healbelly = TRUE
|
||||
if(isnull(selective_preference))
|
||||
@@ -396,6 +400,7 @@
|
||||
"feeding" = feeding,
|
||||
"digest_leave_remains" = digest_leave_remains,
|
||||
"allowmobvore" = allowmobvore,
|
||||
"allowtemp" = allowtemp,
|
||||
"vore_taste" = vore_taste,
|
||||
"vore_smell" = vore_smell,
|
||||
"permit_healbelly" = permit_healbelly,
|
||||
|
||||
@@ -401,6 +401,12 @@
|
||||
host.client.prefs_vr.digestable = host.digestable
|
||||
unsaved_changes = 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")
|
||||
host.eating_privacy_global = !host.eating_privacy_global
|
||||
if(host.client.prefs_vr)
|
||||
|
||||
@@ -24,7 +24,7 @@ type Data = {
|
||||
type content = { name: string; index: number; amount: number };
|
||||
|
||||
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),
|
||||
};
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ export const VoreUserPreferences = (props: {
|
||||
absorbable,
|
||||
devourable,
|
||||
allowmobvore,
|
||||
allowtemp,
|
||||
feeding,
|
||||
permit_healbelly,
|
||||
can_be_drop_prey,
|
||||
@@ -120,6 +121,19 @@ export const VoreUserPreferences = (props: {
|
||||
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: {
|
||||
action: 'toggle_feed',
|
||||
test: feeding,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { LabeledList } from 'tgui-core/components';
|
||||
|
||||
import { digestModeToColor, selectiveBellyOptions } from '../../constants';
|
||||
import { bellyTemperatureToColor } from '../../functions';
|
||||
import type { bellyOptionData } from '../../types';
|
||||
import { VorePanelEditDropdown } from '../../VorePanelElements/VorePanelEditDropdown';
|
||||
import { VorePanelEditNumber } from '../../VorePanelElements/VorePanelEditNumber';
|
||||
@@ -20,6 +21,8 @@ export const BellyOptionsRight = (props: {
|
||||
digest_clone,
|
||||
digest_max,
|
||||
digest_free,
|
||||
bellytemperature,
|
||||
temperature_damage,
|
||||
shrink_grow_size,
|
||||
egg_type,
|
||||
egg_types,
|
||||
@@ -146,6 +149,33 @@ export const BellyOptionsRight = (props: {
|
||||
color="purple"
|
||||
/>
|
||||
</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">
|
||||
<VorePanelEditDropdown
|
||||
action="set_attribute"
|
||||
|
||||
@@ -87,12 +87,18 @@ export const VoreUserPreferencesDevouring = (props: {
|
||||
tooltipPosition="left"
|
||||
/>
|
||||
</Stack.Item>
|
||||
<Stack.Item basis="34%">
|
||||
<Stack.Item basis="32%">
|
||||
<VoreUserPreferenceItem
|
||||
spec={preferences.toggle_digest_pain}
|
||||
tooltipPosition="right"
|
||||
/>
|
||||
</Stack.Item>
|
||||
<Stack.Item basis="32%">
|
||||
<VoreUserPreferenceItem
|
||||
spec={preferences.temperature}
|
||||
tooltipPosition="top"
|
||||
/>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
) : (
|
||||
''
|
||||
|
||||
@@ -2,7 +2,10 @@ export function abilitiy_usable(nutri: number, cost: number): boolean {
|
||||
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) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -17,7 +20,7 @@ export function sanitize_color(color?: string | null, mirrorBlack?: boolean) {
|
||||
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`;
|
||||
}
|
||||
|
||||
@@ -27,7 +30,7 @@ export function fixCorruptedData(
|
||||
| string[]
|
||||
| null
|
||||
| Record<string | number, string | number>,
|
||||
) {
|
||||
): { corrupted?: boolean; data: string | string[] } {
|
||||
if (toSanitize === null) {
|
||||
return { data: '' };
|
||||
}
|
||||
@@ -49,8 +52,20 @@ export function fixCorruptedData(
|
||||
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
|
||||
export async function copy_to_clipboard(value: string | string[]) {
|
||||
export async function copy_to_clipboard(
|
||||
value: string | string[],
|
||||
): Promise<void> {
|
||||
let data = value;
|
||||
if (Array.isArray(data)) {
|
||||
data = data.join('\n\n');
|
||||
@@ -58,7 +73,9 @@ export async function copy_to_clipboard(value: string | string[]) {
|
||||
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();
|
||||
if (asArray) {
|
||||
return ourText.split('\n\n');
|
||||
|
||||
@@ -107,6 +107,7 @@ export type bellyOptionData = {
|
||||
digest_oxy: number;
|
||||
digest_tox: number;
|
||||
digest_clone: number;
|
||||
bellytemperature: number;
|
||||
digest_max: number;
|
||||
digest_free: number;
|
||||
bulge_size: number;
|
||||
@@ -137,6 +138,7 @@ export type bellyOptionData = {
|
||||
absorbedrename_name_min: number;
|
||||
drainmode_options: string[];
|
||||
drainmode: string;
|
||||
temperature_damage: BooleanLike;
|
||||
};
|
||||
|
||||
export type bellySoundData = {
|
||||
@@ -300,6 +302,7 @@ export type prefData = {
|
||||
absorbable: BooleanLike;
|
||||
digest_leave_remains: BooleanLike;
|
||||
allowmobvore: BooleanLike;
|
||||
allowtemp: BooleanLike;
|
||||
permit_healbelly: BooleanLike;
|
||||
show_vore_fx: BooleanLike;
|
||||
can_be_drop_prey: BooleanLike;
|
||||
@@ -414,6 +417,7 @@ export type localPrefs = {
|
||||
absorbable: preferenceData;
|
||||
devour: preferenceData;
|
||||
mobvore: preferenceData;
|
||||
temperature: preferenceData;
|
||||
feed: preferenceData;
|
||||
healbelly: preferenceData;
|
||||
dropnom_prey: preferenceData;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ export type Belly = {
|
||||
digest_oxy: number;
|
||||
digest_tox: number;
|
||||
digest_clone: number;
|
||||
bellytemperature: number;
|
||||
|
||||
can_taste: BooleanLike;
|
||||
is_feedable: BooleanLike;
|
||||
@@ -52,6 +53,7 @@ export type Belly = {
|
||||
storing_nutrition: BooleanLike;
|
||||
entrance_logs: BooleanLike;
|
||||
item_digest_logs: BooleanLike;
|
||||
temperature_damage: BooleanLike;
|
||||
|
||||
// Messages
|
||||
struggle_messages_outside: string[];
|
||||
|
||||
Reference in New Issue
Block a user