Shuttle gibbing code improvements (#81726)

## About The Pull Request

Adds a resistance flag, `SHUTTLE_CRUSH_PROOF`, adds it to the existing
things that have it, and adds it to the immortality spectres.

## Why It's Good For The Game

Gets rid of some hardcoded checks, making it easier for future code (or
admins) to make things immune to shuttle crushing.

Also makes it so immortality spectres are immune to being shuttle
crushed, as that kinda ruins the whole "immortality" thing...

## Changelog
🆑
refactor: Improved shuttle gibbing code, adding a new resistance flag,
`SHUTTLE_CRUSH_PROOF`.
fix: Immortality revival spectres can no longer be crushed by shuttles.
add: The ghost of Poly can no longer be shuttle-crushed, nor can
anything incorporeal.
/🆑

Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
Lucy
2024-03-08 23:00:18 -05:00
committed by GitHub
parent c9b3629353
commit a8d1551466
8 changed files with 24 additions and 22 deletions
+15 -19
View File
@@ -21,26 +21,22 @@ All ShuttleMove procs go here
return
var/shuttle_dir = shuttle.dir
for(var/i in contents)
var/atom/movable/thing = i
if(ismob(thing))
if(isliving(thing))
var/mob/living/M = thing
if(M.buckled)
M.buckled.unbuckle_mob(M, 1)
if(M.pulledby)
M.pulledby.stop_pulling()
M.stop_pulling()
M.visible_message(span_warning("[shuttle] slams into [M]!"))
SSblackbox.record_feedback("tally", "shuttle_gib", 1, M.type)
log_shuttle("[key_name(M)] was shuttle gibbed by [shuttle].")
M.investigate_log("has been gibbed by [shuttle].", INVESTIGATE_DEATHS)
M.gib(DROP_ALL_REMAINS)
else //non-living mobs shouldn't be affected by shuttles, which is why this is an else
if(istype(thing, /obj/effect/abstract) || istype(thing, /obj/singularity) || istype(thing, /obj/energy_ball))
for(var/atom/movable/thing as anything in contents)
if(thing.resistance_flags & SHUTTLE_CRUSH_PROOF)
continue
if(isliving(thing))
var/mob/living/living_thing = thing
if(living_thing.incorporeal_move) // Don't crush incorporeal things
continue
living_thing.buckled?.unbuckle_mob(living_thing, force = TRUE)
living_thing.pulledby?.stop_pulling()
living_thing.stop_pulling()
living_thing.visible_message(span_warning("[shuttle] slams into [living_thing]!"))
SSblackbox.record_feedback("tally", "shuttle_gib", 1, living_thing.type)
log_shuttle("[key_name(living_thing)] was shuttle gibbed by [shuttle].")
living_thing.investigate_log("has been gibbed by [shuttle].", INVESTIGATE_DEATHS)
living_thing.gib(DROP_ALL_REMAINS)
else if(!ismob(thing)) //non-living mobs shouldn't be affected by shuttles, which is why this is an else
if(!thing.anchored)
step(thing, shuttle_dir)
else