diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 9a1ff260b7..8506d8b563 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -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 diff --git a/code/modules/vore/eating/exportpanel_vr.dm b/code/modules/vore/eating/exportpanel_vr.dm index 6f2599ec5e..e05aa18e6e 100644 --- a/code/modules/vore/eating/exportpanel_vr.dm +++ b/code/modules/vore/eating/exportpanel_vr.dm @@ -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 diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 93aab7e26d..b66bb3fa10 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -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 diff --git a/code/modules/vore/eating/special_bellies.dm b/code/modules/vore/eating/special_bellies.dm new file mode 100644 index 0000000000..c3b2168912 --- /dev/null +++ b/code/modules/vore/eating/special_bellies.dm @@ -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 ) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 7ba5edf97b..27e3d3b2d7 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -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 diff --git a/tgui/packages/tgui/interfaces/VorePanel/VoreBellySelectionAndCustomization.tsx b/tgui/packages/tgui/interfaces/VorePanel/VoreBellySelectionAndCustomization.tsx index 59a476e088..f3c0e72975 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VoreBellySelectionAndCustomization.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VoreBellySelectionAndCustomization.tsx @@ -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} > - - {belly.name} ({belly.contents}) - + + {belly.name} ({belly.contents}) + + + {!!belly.prevent_saving && ( + + + + )} + + ))} diff --git a/tgui/packages/tgui/interfaces/VorePanel/types.ts b/tgui/packages/tgui/interfaces/VorePanel/types.ts index e985da6e48..ddf09cd8f1 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/types.ts +++ b/tgui/packages/tgui/interfaces/VorePanel/types.ts @@ -55,6 +55,7 @@ export type bellyData = { ref: string; digest_mode: string; contents: number; + prevent_saving: BooleanLike; }; export type selectedData = { diff --git a/tgui/packages/tgui/interfaces/VorePanelExport/VorePanelExportDownload.tsx b/tgui/packages/tgui/interfaces/VorePanelExport/VorePanelExportDownload.tsx index 11fedc39c2..c412ad079a 100644 --- a/tgui/packages/tgui/interfaces/VorePanelExport/VorePanelExportDownload.tsx +++ b/tgui/packages/tgui/interfaces/VorePanelExport/VorePanelExportDownload.tsx @@ -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) => { '' + '' + '' + - 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', }, diff --git a/tgui/packages/tgui/interfaces/VorePanelExport/types.ts b/tgui/packages/tgui/interfaces/VorePanelExport/types.ts index 925f76e204..d1141b42d1 100644 --- a/tgui/packages/tgui/interfaces/VorePanelExport/types.ts +++ b/tgui/packages/tgui/interfaces/VorePanelExport/types.ts @@ -16,6 +16,7 @@ export type Belly = { absorbed_desc: string; vore_verb: string; release_verb: string; + prevent_saving: BooleanLike; // Controls mode: string; diff --git a/vorestation.dme b/vorestation.dme index 2eb0200de3..38fbee8a6f 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -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"