[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:
CHOMPStation2StaffMirrorBot
2025-04-12 20:46:26 -07:00
committed by GitHub
parent 07e2fe15f1
commit 3ac7ee10fa
10 changed files with 82 additions and 9 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View 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 )

View File

@@ -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