[MIRROR] Trasheat backend (#12842)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-06-25 11:16:36 -04:00
committed by GitHub
co-authored by Cameron Lennox
parent d52a5101b9
commit 4b0d0cc665
7 changed files with 83 additions and 32 deletions
+8 -11
View File
@@ -64,7 +64,11 @@ GLOBAL_LIST_INIT(item_vore_blacklist, list(
/obj/item/areaeditor/blueprints,
/obj/item/clothing/head/helmet/space,
/obj/item/disk/nuclear,
/obj/item/clothing/suit/storage/hooded/wintercoat/roiz))
/obj/item/clothing/suit/storage/hooded/wintercoat/roiz,
/obj/item/bluespace_harpoon,
/obj/item/storage/belt/utility/chief/full,
/obj/item/storage/bag/circuits,
/obj/item/telecube))
//Classic Vore sounds
GLOBAL_LIST_INIT(classic_vore_sounds, list(
@@ -338,15 +342,7 @@ GLOBAL_LIST_INIT(edible_trash, list(/obj/item/broken_device,
/obj/item/reagent_containers/glass/rag,
/obj/item/soap,
/obj/item/spacecash,
/obj/item/storage/box/khcrystal,
/obj/item/storage/box/matches,
/obj/item/storage/box/wings,
/obj/item/storage/fancy/candle_box,
/obj/item/storage/fancy/cigarettes,
/obj/item/storage/fancy/crayons,
/obj/item/storage/fancy/egg_box,
/obj/item/storage/wallet,
/obj/item/storage/vore_egg,
/obj/item/storage,
/obj/item/bikehorn/tinytether,
/obj/item/entrepreneur,
/obj/item/capture_crystal,
@@ -375,7 +371,8 @@ GLOBAL_LIST_INIT(edible_trash, list(/obj/item/broken_device,
/obj/item/clothing/ears, //chompstation addition end
/obj/item/roulette_ball,
/obj/item/pizzabox,
/obj/item/card/id
/obj/item/card/id,
/obj/item/text_to_speech
))
GLOBAL_LIST_INIT(contamination_flavors, list(
@@ -83,7 +83,7 @@
if(!destination_belly)
return
if(source.stat != DEAD && source.trash_catching)
if(source.adminbus_trash || is_type_in_list(O, GLOB.edible_trash) && O.trash_eatable && !is_type_in_list(O, GLOB.item_vore_blacklist))
if(source.expanded_trasheat || is_type_in_list(O, GLOB.edible_trash) && O.trash_eatable && !is_type_in_list(O, GLOB.item_vore_blacklist))
source.visible_message(span_vwarning("[O] is thrown directly into [source]'s [lowertext(destination_belly.name)]!"))
destination_belly.nom_atom(O)
return COMSIG_CANCEL_HITBY
+1 -1
View File
@@ -320,7 +320,7 @@
return TRUE
if(isliving(user))
var/mob/living/trashcheck = user
if(trashcheck.adminbus_trash)
if(trashcheck.expanded_trasheat)
return TRUE
if(isliving(target)) //quick prefs test. Better safe than sorry
var/mob/living/caneat = target
+2 -2
View File
@@ -264,7 +264,7 @@
if(istype(W,/obj/item/grab || /obj/item/holder))
gargoyle.vore_attackby(W, user)
return
if(gargoyle.adminbus_trash || is_type_in_list(W, GLOB.edible_trash) && W.trash_eatable && !is_type_in_list(W, GLOB.item_vore_blacklist))
if(gargoyle.expanded_trasheat || is_type_in_list(W, GLOB.edible_trash) && W.trash_eatable && !is_type_in_list(W, GLOB.item_vore_blacklist))
to_chat(user, span_warning("You slip [W] into [gargoyle]'s [lowertext(gargoyle.vore_selected.name)] ."))
user.drop_item()
gargoyle.vore_selected.nom_atom(W)
@@ -291,7 +291,7 @@
return
if(isitem(source) && gargoyle.vore_selected && gargoyle.trash_catching)
var/obj/item/I = source
if(gargoyle.adminbus_trash || is_type_in_list(I, GLOB.edible_trash) && I.trash_eatable && !is_type_in_list(I, GLOB.item_vore_blacklist))
if(gargoyle.expanded_trasheat || is_type_in_list(I, GLOB.edible_trash) && I.trash_eatable && !is_type_in_list(I, GLOB.item_vore_blacklist))
gargoyle.hitby(source, throwingdatum)
return
else if(isliving(source))
+57 -3
View File
@@ -8,12 +8,15 @@
if(signal_results & COMSIG_ITEM_TRASH_EAT_FORCED) // Ignore everything including blacklist, prefs and adminbus. Component is handling the rules.
return TRUE
if(is_type_in_list(src, GLOB.item_vore_blacklist) && !user.adminbus_trash) //If someone has adminbus, they can eat whatever they want.
to_chat(user, span_warning("You are not allowed to eat this."))
var/item_found = recursive_trash_eat_search(user)
if(item_found) //Checks for blacklisted items.
to_chat(user, span_warning("You are not allowed to eat \the [item_found]."))
return FALSE
if(!trash_eatable) //OOC pref. This /IS/ respected, even if adminbus_trash is enabled
if(!trash_eatable) //OOC pref. This /IS/ respected, even if expanded_trasheat is enabled
to_chat(user, span_warning("You can't eat that so casually!"))
return FALSE
if(hidden_uplink)
to_chat(user, span_warning("You really should not be eating this."))
message_admins("[key_name(user)] has attempted to ingest an uplink item. ([user ? ADMIN_JMP(user) : "null"])")
@@ -21,6 +24,49 @@
return TRUE
///Checks to see if the item fails critieria to allow it to be eaten. Does NOT check the blacklist, as it's checked before this is called.
/obj/item/proc/check_item_devourability(mob/living/user)
//If we've been admin enabled, eat anything that isn't blacklisted.
if(user.expanded_trasheat)
return TRUE
//If it's whitelisted, eat it.
if(is_type_in_list(src, GLOB.edible_trash))
return TRUE
if(is_type_in_list(src, GLOB.edible_tech) && user.isSynthetic())
return TRUE
return FALSE
/*
//The below allows checks for certain crtieria to decline it, otherwise allow it. Comented out until
if(force > 30 || throwforce > 30) //Swords, etc.
to_chat(user, span_warning("The [src] is too powerful to eat."))
return FALSE
if(w_class >= ITEMSIZE_NORMAL)
to_chat(user, span_warning("The [src] is too large to eat."))
return FALSE
return TRUE
*/
///Recursively searches through items for invalid items.
///Returns the blacklisted item.
/obj/item/proc/recursive_trash_eat_search(mob/living/user, depth = 0)
if(depth > 25) //Probably a loop.
return src
if(item_flags & ABSTRACT) //Abstract items are fine.
return FALSE
if(is_type_in_list(src, GLOB.item_vore_blacklist)) //Blacklisted item. Stop the loop here.
return src
if(!check_item_devourability(user))
return src
for(var/obj/item/next_item_to_search in contents)
if(recursive_trash_eat_search(next_item_to_search, depth + 1))
return next_item_to_search
return FALSE
/// Override this for post-swallow messages. Returns true if components on mob or item allow trash eating messages
/obj/proc/after_trash_eaten(mob/living/user)
SHOULD_CALL_PARENT(TRUE)
@@ -77,6 +123,14 @@
if(H.real_name == owner && H.client)
watching = TRUE
break
if(!watching) //Check if they're in our bellies if we don't see them in our sight.
if(user.vore_organs)
for(var/obj/belly/B in user.vore_organs)
for(var/mob/living/content in B.contents)
if(content.real_name == owner && content.client)
watching = TRUE
break
if(!watching)
return FALSE
else
@@ -38,7 +38,7 @@
vore_pounce_chance = 100
vore_pounce_maxhealth = 200
has_hands = TRUE
adminbus_trash = TRUE //You know what, sure whatever. It's not like anyone's gonna be taking this bird on unga trips to be their gamer backpack, which kinda was the main reason for the trash eater restrictions in the first place anyway.
expanded_trasheat = TRUE //You know what, sure whatever. It's not like anyone's gonna be taking this bird on unga trips to be their gamer backpack, which kinda was the main reason for the trash eater restrictions in the first place anyway.
faction = "neutral"
say_list_type = /datum/say_list/swoopie
ai_holder_type = /datum/ai_holder/simple_mob/retaliate/swoopie
+13 -13
View File
@@ -16,7 +16,7 @@
var/fuzzy = 0 // Preference toggle for sharp/fuzzy icon.
var/next_preyloop // For Fancy sound internal loop
var/stuffing_feeder = FALSE // Can feed foods to others whole, like trash eater can eat them on their own.
var/adminbus_trash = FALSE // For abusing trash eater for event shenanigans.
var/expanded_trasheat = FALSE // Allows eating anything that is not blacklisted, even if it fails criteria..
var/adminbus_eat_minerals = FALSE // This creature subsists on a diet of pure adminium.
var/vis_height = 32 // Sprite height used for resize features.
var/appendage_color = "#e03997" //Default pink. Used for the 'long_vore' trait.
@@ -855,17 +855,17 @@
to_chat(src, span_notice("You are not holding anything."))
return
if(is_type_in_list(I, GLOB.edible_trash) || adminbus_trash || is_type_in_list(I,GLOB.edible_tech) && isSynthetic()) // adds edible tech for synth
if(!I.on_trash_eaten(src)) // shows object's rejection message itself
return
drop_item()
vore_selected.nom_atom(I)
updateVRPanel()
log_admin("VORE: [src] used Eat Trash to swallow [I].")
I.after_trash_eaten(src)
visible_message(span_vwarning(src.vore_selected.belly_format_string(src.vore_selected.trash_eater_in, I, item=I)))
if(!I.check_item_devourability(src))
return
to_chat(src, span_notice("This snack is too powerful to go down that easily."))
if(!I.on_trash_eaten(src)) // shows object's rejection message itself
return
drop_item()
vore_selected.nom_atom(I)
updateVRPanel()
log_admin("VORE: [src] used Eat Trash to swallow [I].")
I.after_trash_eaten(src)
visible_message(span_vwarning(src.vore_selected.belly_format_string(src.vore_selected.trash_eater_in, I, item=I)))
return
/mob/living/proc/toggle_trash_catching() //Ported from chompstation
@@ -1610,8 +1610,8 @@
set name = "Restrict Trash Eater"
set category = "Abilities.Vore"
set desc = "Toggle Trash Eater restriction level."
adminbus_trash = !adminbus_trash
to_chat(src, span_vwarning("Trash Eater restriction level set to [adminbus_trash ? "everything not blacklisted" : "only whitelisted items"]."))
expanded_trasheat = !expanded_trasheat
to_chat(src, span_vwarning("Trash Eater restriction level set to [expanded_trasheat ? "everything not blacklisted" : "only whitelisted items"]."))
/mob/living/proc/liquidbelly_visuals()
set name = "Toggle Liquidbelly Visuals"