mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 19:52:40 +00:00
[MIRROR] Non-savable vore bellies and Special Vorebelly Variant Support (#10636)
Co-authored-by: Reo Lozzot <84661000+ReoDaProtovali@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
07e2fe15f1
commit
3ac7ee10fa
@@ -67,6 +67,7 @@
|
||||
var/belly_item_mult = 1 //Multiplier for how filling items are in borg borg bellies. Items are also weighted on item size
|
||||
var/belly_overall_mult = 1 //Multiplier applied ontop of any other specific multipliers
|
||||
var/private_struggle = FALSE // If struggles are made public or not
|
||||
var/prevent_saving = FALSE // Can this belly be saved? For special bellies that mobs and adminbus might have.
|
||||
|
||||
|
||||
var/vore_sprite_flags = DM_FLAG_VORESPRITE_BELLY
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
belly_data["absorbed_desc"] = B.absorbed_desc
|
||||
belly_data["vore_verb"] = B.vore_verb
|
||||
belly_data["release_verb"] = B.release_verb
|
||||
belly_data["prevent_saving"] = B.prevent_saving
|
||||
|
||||
// Controls
|
||||
belly_data["mode"] = B.digest_mode
|
||||
|
||||
@@ -254,6 +254,8 @@
|
||||
|
||||
var/list/serialized = list()
|
||||
for(var/obj/belly/B as anything in src.vore_organs)
|
||||
if(B.prevent_saving) // Dont save bellies marked as unsavable.
|
||||
continue
|
||||
serialized += list(B.serialize()) //Can't add a list as an object to another list in Byond. Thanks.
|
||||
|
||||
P.belly_prefs = serialized
|
||||
|
||||
34
code/modules/vore/eating/special_bellies.dm
Normal file
34
code/modules/vore/eating/special_bellies.dm
Normal file
@@ -0,0 +1,34 @@
|
||||
// Special Vorebelly types. For general use bellies that have abnormal functionality.
|
||||
// Also ones that probably shouldn't be savable.
|
||||
// PS: I'm adding this file in the middle of a toilet overhaul PR.
|
||||
// If that's not the definition of scope increase, I dont know what is. -Reo
|
||||
|
||||
/obj/belly/special //parant type for bellies you dont want to be treated like normal bellies to use
|
||||
prevent_saving = TRUE
|
||||
|
||||
/obj/belly/special/teleporter
|
||||
var/atom/movable/target = null
|
||||
var/target_turf = TRUE
|
||||
var/teleport_delay = 3 SECONDS
|
||||
|
||||
/obj/belly/special/teleporter/Entered(atom/movable/thing, atom/OldLoc)
|
||||
. = ..()
|
||||
if(teleport_delay <= 0) //just try to teleport immediately.
|
||||
try_tele(thing)
|
||||
return
|
||||
addtimer(CALLBACK(src, PROC_REF(try_tele), thing), teleport_delay, TIMER_DELETE_ME)
|
||||
|
||||
/obj/belly/special/teleporter/process(wait)
|
||||
if(istype(target))
|
||||
return ..()
|
||||
for(var/atom/movable/AM in contents)
|
||||
try_tele(AM)
|
||||
. = ..()
|
||||
|
||||
/obj/belly/special/teleporter/proc/try_tele(atom/movable/thing)
|
||||
if(!istype(target))
|
||||
return
|
||||
if(isturf(target)) // if it's a turf, we dont need to do anything else, just teleport to it
|
||||
thing.forceMove(target)
|
||||
else
|
||||
thing.forceMove(target_turf ? get_turf(target) : target )
|
||||
@@ -196,6 +196,7 @@
|
||||
"ref" = "\ref[B]",
|
||||
"digest_mode" = B.digest_mode,
|
||||
"contents" = LAZYLEN(B.contents),
|
||||
"prevent_saving" = B.prevent_saving,
|
||||
)))
|
||||
data["our_bellies"] = our_bellies
|
||||
|
||||
@@ -664,6 +665,15 @@
|
||||
var/choice = tgui_alert(ui.user, "Warning: Saving your vore panel while playing what is very-likely not your normal character will overwrite whatever character you have loaded in character setup. Maybe this is your 'playing a simple mob' slot, though. Are you SURE you want to overwrite your current slot with these vore bellies?", "WARNING!", list("No, abort!", "Yes, save."))
|
||||
if(choice != "Yes, save.")
|
||||
return TRUE
|
||||
// Lets check for unsavable bellies...
|
||||
var/list/unsavable_bellies = list()
|
||||
for(var/obj/belly/B in host.vore_organs)
|
||||
if(B.prevent_saving)
|
||||
unsavable_bellies += B.name
|
||||
if(LAZYLEN(unsavable_bellies))
|
||||
var/choice = tgui_alert(ui.user, "Warning: One or more of your vore organs are unsavable. Saving now will save every vore belly except \[[jointext(unsavable_bellies, ", ")]\]. Are you sure you want to save?", "WARNING!", list("No, abort!", "Yes, save."))
|
||||
if(choice != "Yes, save.")
|
||||
return TRUE
|
||||
if(!host.save_vore_prefs())
|
||||
tgui_alert_async(ui.user, "ERROR: " + STATION_PREF_NAME + "-specific preferences failed to save!","Error")
|
||||
else
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Divider, Icon, Section, Tabs } from 'tgui-core/components';
|
||||
import { Stack } from 'tgui-core/components';
|
||||
import {
|
||||
Divider,
|
||||
Icon,
|
||||
Section,
|
||||
Stack,
|
||||
Tabs,
|
||||
Tooltip,
|
||||
} from 'tgui-core/components';
|
||||
import type { BooleanLike } from 'tgui-core/react';
|
||||
|
||||
import { digestModeToColor } from './constants';
|
||||
@@ -50,16 +56,30 @@ export const VoreBellySelectionAndCustomization = (props: {
|
||||
selected={!!belly.selected}
|
||||
textColor={digestModeToColor[belly.digest_mode]}
|
||||
onClick={() => act('bellypick', { bellypick: belly.ref })}
|
||||
backgroundColor={belly.prevent_saving ? '#180000' : undefined}
|
||||
>
|
||||
<Box
|
||||
inline
|
||||
<Stack
|
||||
fill
|
||||
textColor={
|
||||
(belly.selected && digestModeToColor[belly.digest_mode]) ||
|
||||
null
|
||||
}
|
||||
>
|
||||
{belly.name} ({belly.contents})
|
||||
</Box>
|
||||
<Stack.Item grow>
|
||||
{belly.name} ({belly.contents})
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
{!!belly.prevent_saving && (
|
||||
<Tooltip position="right" content="Temporary belly">
|
||||
<Icon
|
||||
name="triangle-exclamation"
|
||||
mr={0.5}
|
||||
color="red"
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Tabs.Tab>
|
||||
))}
|
||||
</Tabs>
|
||||
|
||||
@@ -55,6 +55,7 @@ export type bellyData = {
|
||||
ref: string;
|
||||
digest_mode: string;
|
||||
contents: number;
|
||||
prevent_saving: BooleanLike;
|
||||
};
|
||||
|
||||
export type selectedData = {
|
||||
|
||||
@@ -14,6 +14,8 @@ export const downloadPrefs = (extension: string) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const validBellies = bellies.filter((belly) => !belly.prevent_saving);
|
||||
|
||||
const datesegment = getCurrentTimestamp();
|
||||
|
||||
const filename = mob_name + datesegment + extension;
|
||||
@@ -28,7 +30,7 @@ export const downloadPrefs = (extension: string) => {
|
||||
'<meta charset="utf-8">' +
|
||||
'<meta name="viewport" content="width=device-width, initial-scale=1">' +
|
||||
'<title>' +
|
||||
bellies.length +
|
||||
validBellies.length +
|
||||
' Exported Bellies (DB_VER: ' +
|
||||
db_repo +
|
||||
'-' +
|
||||
@@ -47,7 +49,7 @@ export const downloadPrefs = (extension: string) => {
|
||||
type: 'text/html',
|
||||
},
|
||||
);
|
||||
bellies.forEach((belly, i) => {
|
||||
validBellies.forEach((belly, i) => {
|
||||
blob = new Blob([blob, generateBellyString(belly, i)], {
|
||||
type: 'text/html',
|
||||
});
|
||||
@@ -70,7 +72,7 @@ export const downloadPrefs = (extension: string) => {
|
||||
|
||||
if (extension === '.vrdb') {
|
||||
blob = new Blob(
|
||||
[JSON.stringify({ bellies: bellies, soulcatcher: soulcatcher })],
|
||||
[JSON.stringify({ bellies: validBellies, soulcatcher: soulcatcher })],
|
||||
{
|
||||
type: 'application/json',
|
||||
},
|
||||
|
||||
@@ -16,6 +16,7 @@ export type Belly = {
|
||||
absorbed_desc: string;
|
||||
vore_verb: string;
|
||||
release_verb: string;
|
||||
prevent_saving: BooleanLike;
|
||||
|
||||
// Controls
|
||||
mode: string;
|
||||
|
||||
@@ -4631,6 +4631,7 @@
|
||||
#include "code\modules\vore\eating\soulcatcher_import.dm"
|
||||
#include "code\modules\vore\eating\soulcatcher_mob.dm"
|
||||
#include "code\modules\vore\eating\soulcatcher_observer.dm"
|
||||
#include "code\modules\vore\eating\special_bellies.dm"
|
||||
#include "code\modules\vore\eating\stumblevore_vr.dm"
|
||||
#include "code\modules\vore\eating\transforming_vr.dm"
|
||||
#include "code\modules\vore\eating\vertical_nom_vr.dm"
|
||||
|
||||
Reference in New Issue
Block a user