mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
[MIRROR] trash eater refactor (#10235)
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
681661cc86
commit
10b3a5c1b7
171
code/game/objects/trash_eating.dm
Normal file
171
code/game/objects/trash_eating.dm
Normal file
@@ -0,0 +1,171 @@
|
||||
// checks for when items are consumed by trash/ore eater
|
||||
/obj/item/proc/on_trash_eaten(var/mob/living/user)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(is_type_in_list(src,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."))
|
||||
return FALSE
|
||||
if(!trash_eatable) //OOC pref. This /IS/ respected, even if adminbus_trash 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"])")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/proc/after_trash_eaten(var/mob/living/user) // Override for post-swallow messages
|
||||
to_chat(src, span_notice("You can taste the flavor of garbage. Delicious."))
|
||||
|
||||
// PAI
|
||||
/obj/item/paicard/on_trash_eaten(var/mob/living/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/mob/living/silicon/pai/pocketpal = pai
|
||||
if(pocketpal && (!pocketpal.devourable))
|
||||
to_chat(user, span_warning("\The [pocketpal] doesn't allow you to eat it."))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/paicard/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the sweet flavor of digital friendship."))
|
||||
if(pai && pai.client && isbelly(loc))
|
||||
var/obj/belly/B = loc
|
||||
to_chat(pai, span_boldnotice("[B.desc]"))
|
||||
|
||||
// Book
|
||||
/obj/item/book/on_trash_eaten(var/mob/living/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(carved)
|
||||
to_chat(user, span_warning("\The [src] is not worth eating without the filling."))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/book/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the dry flavor of knowledge."))
|
||||
|
||||
// PDA
|
||||
/obj/item/pda/on_trash_eaten(var/mob/living/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(owner)
|
||||
var/watching = FALSE
|
||||
for(var/mob/living/carbon/human/H in view(user))
|
||||
if(H.real_name == owner && H.client)
|
||||
watching = TRUE
|
||||
break
|
||||
if(!watching)
|
||||
return FALSE
|
||||
else
|
||||
visible_message(span_warning("[user] is threatening to make [src] disappear!"))
|
||||
if(id)
|
||||
var/confirm = tgui_alert(user, "The PDA you're holding contains a vulnerable ID card. Will you risk it?", "Confirmation", list("Definitely", "Cancel"))
|
||||
if(confirm != "Definitely")
|
||||
return FALSE
|
||||
if(!do_after(user, 100, src))
|
||||
return FALSE
|
||||
visible_message(span_warning("[user] successfully makes [src] disappear!"))
|
||||
return TRUE
|
||||
|
||||
/obj/item/pda/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the sweet flavor of delicious technology."))
|
||||
|
||||
// Shoes
|
||||
/obj/item/clothing/shoes/on_trash_eaten(var/mob/living/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(holding)
|
||||
to_chat(user, span_warning("There's something inside!"))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
// Capture crystal
|
||||
/obj/item/capture_crystal/on_trash_eaten(var/mob/living/user)
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(!bound_mob.devourable)
|
||||
to_chat(user, span_warning("That doesn't seem like a good idea. (\The [bound_mob]'s prefs don't allow it.)"))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/capture_crystal/after_trash_eaten(var/mob/living/user)
|
||||
if(bound_mob && (bound_mob in contents))
|
||||
if(isbelly(loc))
|
||||
/* CHOMPRemove Start, handled by indirect FX
|
||||
var/obj/belly/B = loc
|
||||
to_chat(bound_mob, span_notice("Outside of your crystal, you can see; " + span_notice("[B.desc]")))
|
||||
*/// CHOMPRemove End
|
||||
to_chat(user, span_notice("You can taste the the power of command."))
|
||||
|
||||
// Most trash has no special check, so the rest of these are just after_trash_eaten()
|
||||
/obj/item/flashlight/flare/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of spicy cardboard."))
|
||||
|
||||
/obj/item/flame/match/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of spicy cardboard."))
|
||||
|
||||
/obj/item/storage/box/matches/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of spicy cardboard."))
|
||||
|
||||
/obj/item/flashlight/glowstick/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You found out the glowy juice only tastes like regret."))
|
||||
|
||||
/obj/item/trash/cigbutt/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of bitter ash. Classy."))
|
||||
|
||||
/obj/item/clothing/mask/smokable/after_trash_eaten(var/mob/living/user)
|
||||
if(lit)
|
||||
to_chat(user, span_notice("You can taste the flavor of burning ash. Spicy!"))
|
||||
else
|
||||
to_chat(user, span_notice("You can taste the flavor of aromatic rolling paper and funny looks."))
|
||||
|
||||
/obj/item/paper/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the dry flavor of bureaucracy."))
|
||||
|
||||
/obj/item/dice/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the bitter flavor of cheating."))
|
||||
|
||||
/obj/item/roulette_ball/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the bitter flavor of cheating."))
|
||||
|
||||
/obj/item/lipstick/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of couture and style. Toddler at the make-up bag style."))
|
||||
|
||||
/obj/item/soap/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the bitter flavor of verbal purification."))
|
||||
|
||||
/obj/item/spacecash/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of wealth and reckless waste."))
|
||||
|
||||
/obj/item/storage/wallet/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of wealth and reckless waste."))
|
||||
|
||||
/obj/item/broken_bottle/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of pain. This can't possibly be healthy for your guts."))
|
||||
|
||||
/obj/item/material/shard/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the flavor of pain. This can't possibly be healthy for your guts."))
|
||||
|
||||
/obj/item/light/after_trash_eaten(var/mob/living/user)
|
||||
if(status == LIGHT_BROKEN)
|
||||
to_chat(user, span_notice("You can taste the flavor of pain. This can't possibly be healthy for your guts."))
|
||||
else
|
||||
to_chat(user, span_notice("You can taste the flavor of really bad ideas."))
|
||||
|
||||
/obj/item/bikehorn/tinytether/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You feel a rush of power swallowing such a large, err, tiny structure."))
|
||||
|
||||
/obj/item/mmi/digital/posibrain/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the sweet flavor of digital friendship. Or maybe it is something else."))
|
||||
|
||||
/obj/item/aicard/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the sweet flavor of digital friendship. Or maybe it is something else."))
|
||||
|
||||
/obj/item/reagent_containers/food/after_trash_eaten(var/mob/living/user)
|
||||
if(!reagents.total_volume)
|
||||
to_chat(user, span_notice("You can taste the flavor of garbage and leftovers. Delicious?"))
|
||||
else
|
||||
to_chat(user, span_notice("You can taste the flavor of gluttonous waste of food."))
|
||||
|
||||
/obj/item/clothing/accessory/collar/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the submissiveness in the wearer of [src]!"))
|
||||
@@ -998,159 +998,14 @@
|
||||
to_chat(src, span_notice("You are not holding anything."))
|
||||
return
|
||||
|
||||
if(is_type_in_list(I,item_vore_blacklist) && !adminbus_trash) //If someone has adminbus, they can eat whatever they want.
|
||||
to_chat(src, span_warning("You are not allowed to eat this."))
|
||||
return
|
||||
|
||||
if(!I.trash_eatable) //OOC pref. This /IS/ respected, even if adminbus_trash is enabled
|
||||
to_chat(src, span_warning("You can't eat that so casually!"))
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/paicard))
|
||||
var/obj/item/paicard/palcard = I
|
||||
var/mob/living/silicon/pai/pocketpal = palcard.pai
|
||||
if(pocketpal && (!pocketpal.devourable))
|
||||
to_chat(src, span_warning("\The [pocketpal] doesn't allow you to eat it."))
|
||||
if(is_type_in_list(I,edible_trash) || adminbus_trash || is_type_in_list(I,edible_tech) && isSynthetic()) // CHOMPEdit adds edible tech for synth
|
||||
if(!I.on_trash_eaten(src)) // shows object's rejection message itself
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/book))
|
||||
var/obj/item/book/book = I
|
||||
if(book.carved)
|
||||
to_chat(src, span_warning("\The [book] is not worth eating without the filling."))
|
||||
return
|
||||
|
||||
if(is_type_in_list(I,edible_trash) | adminbus_trash || is_type_in_list(I,edible_tech) && isSynthetic()) //chompstation add synth check
|
||||
if(I.hidden_uplink)
|
||||
to_chat(src, span_warning("You really should not be eating this."))
|
||||
message_admins("[key_name(src)] has attempted to ingest an uplink item. ([src ? ADMIN_JMP(src) : "null"])")
|
||||
return
|
||||
if(istype(I,/obj/item/pda))
|
||||
var/obj/item/pda/P = I
|
||||
if(P.owner)
|
||||
var/watching = FALSE
|
||||
for(var/mob/living/carbon/human/H in view(src))
|
||||
if(H.real_name == P.owner && H.client)
|
||||
watching = TRUE
|
||||
break
|
||||
if(!watching)
|
||||
return
|
||||
else
|
||||
visible_message(span_warning("[src] is threatening to make [P] disappear!"))
|
||||
if(P.id)
|
||||
var/confirm = tgui_alert(src, "The PDA you're holding contains a vulnerable ID card. Will you risk it?", "Confirmation", list("Definitely", "Cancel"))
|
||||
if(confirm != "Definitely")
|
||||
return
|
||||
if(!do_after(src, 100, P))
|
||||
return
|
||||
visible_message(span_warning("[src] successfully makes [P] disappear!"))
|
||||
to_chat(src, span_notice("You can taste the sweet flavor of delicious technology."))
|
||||
drop_item()
|
||||
I.forceMove(vore_selected)
|
||||
updateVRPanel()
|
||||
return
|
||||
if(istype(I,/obj/item/clothing/shoes))
|
||||
var/obj/item/clothing/shoes/S = I
|
||||
if(S.holding)
|
||||
to_chat(src, span_warning("There's something inside!"))
|
||||
return
|
||||
if(iscapturecrystal(I))
|
||||
var/obj/item/capture_crystal/C = I
|
||||
if(!C.bound_mob.devourable)
|
||||
to_chat(src, span_warning("That doesn't seem like a good idea. (\The [C.bound_mob]'s prefs don't allow it.)"))
|
||||
return
|
||||
drop_item()
|
||||
I.forceMove(vore_selected)
|
||||
updateVRPanel()
|
||||
|
||||
log_admin("VORE: [src] used Eat Trash to swallow [I].")
|
||||
|
||||
if(istype(I,/obj/item/flashlight/flare) || istype(I,/obj/item/flame/match) || istype(I,/obj/item/storage/box/matches))
|
||||
to_chat(src, span_notice("You can taste the flavor of spicy cardboard."))
|
||||
else if(istype(I,/obj/item/flashlight/glowstick))
|
||||
to_chat(src, span_notice("You found out the glowy juice only tastes like regret."))
|
||||
else if(istype(I,/obj/item/trash/cigbutt))
|
||||
to_chat(src, span_notice("You can taste the flavor of bitter ash. Classy."))
|
||||
else if(istype(I,/obj/item/clothing/mask/smokable))
|
||||
var/obj/item/clothing/mask/smokable/C = I
|
||||
if(C.lit)
|
||||
to_chat(src, span_notice("You can taste the flavor of burning ash. Spicy!"))
|
||||
else
|
||||
to_chat(src, span_notice("You can taste the flavor of aromatic rolling paper and funny looks."))
|
||||
else if(istype(I,/obj/item/paper))
|
||||
to_chat(src, span_notice("You can taste the dry flavor of bureaucracy."))
|
||||
else if(istype(I,/obj/item/book))
|
||||
to_chat(src, span_notice("You can taste the dry flavor of knowledge."))
|
||||
else if(istype(I,/obj/item/dice)) //CHOMPedit: Removed roulette ball because that's not active here.
|
||||
to_chat(src, span_notice("You can taste the bitter flavor of cheating."))
|
||||
else if(istype(I,/obj/item/lipstick))
|
||||
to_chat(src, span_notice("You can taste the flavor of couture and style. Toddler at the make-up bag style."))
|
||||
else if(istype(I,/obj/item/soap))
|
||||
to_chat(src, span_notice("You can taste the bitter flavor of verbal purification."))
|
||||
else if(istype(I,/obj/item/spacecash) || istype(I,/obj/item/storage/wallet))
|
||||
to_chat(src, span_notice("You can taste the flavor of wealth and reckless waste."))
|
||||
else if(istype(I,/obj/item/broken_bottle) || istype(I,/obj/item/material/shard))
|
||||
to_chat(src, span_notice("You can taste the flavor of pain. This can't possibly be healthy for your guts."))
|
||||
else if(istype(I,/obj/item/light))
|
||||
var/obj/item/light/L = I
|
||||
if(L.status == LIGHT_BROKEN)
|
||||
to_chat(src, span_notice("You can taste the flavor of pain. This can't possibly be healthy for your guts."))
|
||||
else
|
||||
to_chat(src, span_notice("You can taste the flavor of really bad ideas."))
|
||||
else if(istype(I,/obj/item/bikehorn/tinytether))
|
||||
to_chat(src, span_notice("You feel a rush of power swallowing such a large, err, tiny structure."))
|
||||
else if(istype(I,/obj/item/mmi/digital/posibrain) || istype(I,/obj/item/aicard))
|
||||
to_chat(src, span_notice("You can taste the sweet flavor of digital friendship. Or maybe it is something else."))
|
||||
else if(istype(I,/obj/item/paicard))
|
||||
to_chat(src, span_notice("You can taste the sweet flavor of digital friendship."))
|
||||
var/obj/item/paicard/ourcard = I
|
||||
if(ourcard.pai && ourcard.pai.client && isbelly(ourcard.loc))
|
||||
var/obj/belly/B = ourcard.loc
|
||||
to_chat(ourcard.pai, span_boldnotice("[B.desc]"))
|
||||
else if(istype(I,/obj/item/reagent_containers/food))
|
||||
var/obj/item/reagent_containers/food/F = I
|
||||
if(!F.reagents.total_volume)
|
||||
to_chat(src, span_notice("You can taste the flavor of garbage and leftovers. Delicious?"))
|
||||
else
|
||||
to_chat(src, span_notice("You can taste the flavor of gluttonous waste of food."))
|
||||
else if (istype(I,/obj/item/clothing/accessory/collar))
|
||||
to_chat(src, span_notice("You can taste the submissiveness in the wearer of [I]!"))
|
||||
else if(iscapturecrystal(I))
|
||||
var/obj/item/capture_crystal/C = I
|
||||
if(C.bound_mob && (C.bound_mob in C.contents))
|
||||
if(isbelly(C.loc))
|
||||
//var/obj/belly/B = C.loc //CHOMPedit
|
||||
//to_chat(C.bound_mob, span_notice("Outside of your crystal, you can see; " + span_notice("[B.desc]"))) //CHOMPedit: moved to modular_chomp capture_crystal.dm
|
||||
to_chat(src, span_notice("You can taste the the power of command."))
|
||||
// CHOMPedit begin
|
||||
else if(istype(I,/obj/item/starcaster_news))
|
||||
to_chat(src, span_notice("You can taste the dry flavor of digital garbage, oh wait its just the news."))
|
||||
else if(istype(I,/obj/item/newspaper))
|
||||
to_chat(src, span_notice("You can taste the dry flavor of garbage, oh wait its just the news."))
|
||||
else if (istype(I,/obj/item/cell))
|
||||
visible_message(span_warning("[src] sates their electric appetite with a [I]!"))
|
||||
to_chat(src, span_notice("You can taste the spicy flavor of electrolytes, yum."))
|
||||
else if (istype(I,/obj/item/walkpod))
|
||||
visible_message(span_warning("[src] sates their musical appetite with a [I]!"))
|
||||
to_chat(src, span_notice("You can taste the jazzy flavor of music."))
|
||||
else if (istype(I,/obj/item/mail/junkmail))
|
||||
visible_message(span_warning("[src] devours the [I]!"))
|
||||
to_chat(src, span_notice("You can taste the flavor of the galactic postal service."))
|
||||
else if (istype(I,/obj/item/gun/energy/sizegun))
|
||||
visible_message(span_warning("[src] devours the [I]!"))
|
||||
to_chat(src, span_notice("You didn't read the warning label, did you?"))
|
||||
else if (istype(I,/obj/item/slow_sizegun))
|
||||
visible_message(span_warning("[src] devours the [I]!"))
|
||||
to_chat(src, span_notice("You taste the flavor of sunday driver bluespace."))
|
||||
else if (istype(I,/obj/item/laser_pointer))
|
||||
visible_message(span_warning("[src] devours the [I]!"))
|
||||
to_chat(src, span_notice("You taste the flavor of a laser."))
|
||||
else if (istype(I,/obj/item/canvas))
|
||||
visible_message(span_warning("[src] devours the [I]!"))
|
||||
to_chat(src, span_notice("You taste the flavor of priceless artwork."))
|
||||
//CHOMPedit end
|
||||
|
||||
else
|
||||
to_chat(src, span_notice("You can taste the flavor of garbage. Delicious."))
|
||||
I.after_trash_eaten(src)
|
||||
visible_message(span_vwarning("[src] demonstrates the voracious capabilities of their [lowertext(vore_selected.name)] by making [I] disappear!")) //CHOMPedit
|
||||
return
|
||||
to_chat(src, span_notice("This snack is too powerful to go down that easily.")) //CHOMPEdit
|
||||
|
||||
33
modular_chomp/game/objects/trash_eating.dm
Normal file
33
modular_chomp/game/objects/trash_eating.dm
Normal file
@@ -0,0 +1,33 @@
|
||||
/obj/item/starcaster_news/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the dry flavor of digital garbage, oh wait its just the news."))
|
||||
|
||||
/obj/item/newspaper/after_trash_eaten(var/mob/living/user)
|
||||
to_chat(user, span_notice("You can taste the dry flavor of garbage, oh wait its just the news."))
|
||||
|
||||
/obj/item/cell/after_trash_eaten(var/mob/living/user)
|
||||
visible_message(span_warning("[user] sates their electric appetite with a [src]!"))
|
||||
to_chat(user, span_notice("You can taste the spicy flavor of electrolytes, yum."))
|
||||
|
||||
/obj/item/walkpod/after_trash_eaten(var/mob/living/user)
|
||||
visible_message(span_warning("[user] sates their musical appetite with a [src]!"))
|
||||
to_chat(user, span_notice("You can taste the jazzy flavor of music."))
|
||||
|
||||
/obj/item/mail/junkmail/after_trash_eaten(var/mob/living/user)
|
||||
visible_message(span_warning("[user] devours the [src]!"))
|
||||
to_chat(user, span_notice("You can taste the flavor of the galactic postal service."))
|
||||
|
||||
/obj/item/gun/energy/sizegun/after_trash_eaten(var/mob/living/user)
|
||||
visible_message(span_warning("[user] devours the [src]!"))
|
||||
to_chat(user, span_notice("You didn't read the warning label, did you?"))
|
||||
|
||||
/obj/item/slow_sizegun/after_trash_eaten(var/mob/living/user)
|
||||
visible_message(span_warning("[user] devours the [src]!"))
|
||||
to_chat(user, span_notice("You taste the flavor of sunday driver bluespace."))
|
||||
|
||||
/obj/item/laser_pointer/after_trash_eaten(var/mob/living/user)
|
||||
visible_message(span_warning("[user] devours the [src]!"))
|
||||
to_chat(user, span_notice("You taste the flavor of a laser."))
|
||||
|
||||
/obj/item/canvas/after_trash_eaten(var/mob/living/user)
|
||||
visible_message(span_warning("[user] devours the [src]!"))
|
||||
to_chat(user, span_notice("You taste the flavor of priceless artwork."))
|
||||
@@ -1310,6 +1310,7 @@
|
||||
#include "code\game\objects\objs.dm"
|
||||
#include "code\game\objects\structures.dm"
|
||||
#include "code\game\objects\stumble_into_vr.dm"
|
||||
#include "code\game\objects\trash_eating.dm"
|
||||
#include "code\game\objects\weapons.dm"
|
||||
#include "code\game\objects\effects\blockers_yw.dm"
|
||||
#include "code\game\objects\effects\bluespace_spawner_ch.dm"
|
||||
@@ -5162,6 +5163,7 @@
|
||||
#include "modular_chomp\game\machinery\buttons.dm"
|
||||
#include "modular_chomp\game\machinery\traptiles.dm"
|
||||
#include "modular_chomp\game\machinery\turrets.dm"
|
||||
#include "modular_chomp\game\objects\trash_eating.dm"
|
||||
#include "modular_chomp\game\objects\effects\spiders.dm"
|
||||
#include "modular_chomp\game\objects\effects\step_triggers.dm"
|
||||
#include "modular_chomp\game\turfs\shuttlewall_types.dm"
|
||||
|
||||
Reference in New Issue
Block a user