From e59031cb33ebabf2113ac76ea51355cedd1b543a Mon Sep 17 00:00:00 2001
From: SatinIsle <98125273+SatinIsle@users.noreply.github.com>
Date: Sun, 21 Apr 2024 12:11:26 +0100
Subject: [PATCH] Ghosts stay in bellies (#15918)
* Ghosts stay in bellies
Ported a change to digestion from chomp:
Changed digestion death to place the characters ghost inside of the belly they died in. This allows them to be see the belly text still, be carried around and can even be moved between bellies (such as moved along with everything else to intestines, etc), or hear a final subtled message. Tested and seems to work fine here.
Ports these PRs: https://github.com/CHOMPStation2/CHOMPStation2/pull/3074 https://github.com/CHOMPStation2/CHOMPStation2/pull/4772 https://github.com/CHOMPStation2/CHOMPStation2/pull/7132
Plus one addition of my own to prevent it playing the ingestion sound upon the ghost being placed in the belly.
* Fixes the ghost's camera being stuck when transferring them to different bellies.
* Don't announce releasing observers
* Fix for ghosts being visible in examines
---
code/modules/vore/eating/belly_obj_vr.dm | 38 +++++++++++++++++++-----
1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm
index 690f03c08a0..8436586bc11 100644
--- a/code/modules/vore/eating/belly_obj_vr.dm
+++ b/code/modules/vore/eating/belly_obj_vr.dm
@@ -363,18 +363,31 @@
STOP_PROCESSING(SSbellies, src)
owner?.vore_organs?.Remove(src)
owner = null
+ for(var/mob/observer/G in src)
+ G.forceMove(get_turf(src)) //ported from CHOMPStation PR#7132
return ..()
// Called whenever an atom enters this belly
/obj/belly/Entered(atom/movable/thing, atom/OldLoc)
+
+ if(istype(thing, /mob/observer)) //Ports CHOMPStation PR#3072
+ if(desc) //Ports CHOMPStation PR#4772
+ //Allow ghosts see where they are if they're still getting squished along inside.
+ var/formatted_desc
+ formatted_desc = replacetext(desc, "%belly", lowertext(name)) //replace with this belly's name
+ formatted_desc = replacetext(formatted_desc, "%pred", owner) //replace with this belly's owner
+ formatted_desc = replacetext(formatted_desc, "%prey", thing) //replace with whatever mob entered into this belly
+ to_chat(thing, "[formatted_desc]")
+
if(OldLoc in contents)
return //Someone dropping something (or being stripdigested)
//Generic entered message
- to_chat(owner,"[thing] slides into your [lowertext(name)].")
+ if(!istype(thing, /mob/observer)) //Don't have ghosts announce they're reentering the belly on death
+ to_chat(owner,"[thing] slides into your [lowertext(name)].")
//Sound w/ antispam flag setting
- if(vore_sound && !recent_sound)
+ if(vore_sound && !recent_sound && !istype(thing, /mob/observer))
var/soundfile
if(!fancy_vore)
soundfile = classic_vore_sounds[vore_sound]
@@ -639,7 +652,7 @@
privacy_volume = 25
//Print notifications/sound if necessary
- if(!silent)
+ if(!silent && !isobserver(M))
owner.visible_message("[span_green("[owner] [release_verb] [M] from their [lowertext(name)]!")]",range = privacy_range)
var/soundfile
if(!fancy_vore)
@@ -699,6 +712,15 @@
for(var/mob/living/L in contents)
living_count++
+ var/count_total = contents.len
+ for(var/mob/observer/C in contents)
+ count_total-- //Exclude any ghosts from %count
+
+ var/list/vore_contents = list()
+ for(var/G in contents)
+ if(!isobserver(G))
+ vore_contents += G //Exclude any ghosts from %prey
+
for(var/mob/living/P in contents)
if(!P.absorbed) //This is required first, in case there's a person absorbed and not absorbed in a stomach.
total_bulge += P.size_multiplier
@@ -708,9 +730,9 @@
formatted_message = replacetext(raw_message, "%belly", lowertext(name))
formatted_message = replacetext(formatted_message, "%pred", owner)
- formatted_message = replacetext(formatted_message, "%prey", english_list(contents))
+ formatted_message = replacetext(formatted_message, "%prey", english_list(vore_contents))
formatted_message = replacetext(formatted_message, "%countprey", living_count)
- formatted_message = replacetext(formatted_message, "%count", contents.len)
+ formatted_message = replacetext(formatted_message, "%count", count_total)
return(span_red("[formatted_message]"))
@@ -1020,7 +1042,9 @@
//Incase they have the loop going, let's double check to stop it.
M.stop_sound_channel(CHANNEL_PREYLOOP)
// Delete the digested mob
- M.ghostize() // Make sure they're out, so we can copy attack logs and such.
+ var/mob/observer/G = M.ghostize() //Ports CHOMPStation PR#3074 Make sure they're out, so we can copy attack logs and such.
+ if(G)
+ G.forceMove(src)
qdel(M)
// Handle a mob being absorbed
@@ -1636,7 +1660,7 @@
if(!(content in src) || !istype(target))
return
content.forceMove(target)
- if(ismob(content))
+ if(ismob(content) && !isobserver(content))
var/mob/ourmob = content
ourmob.reset_view(owner)
if(isitem(content))