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
@@ -148,6 +148,7 @@
color = COLOR_PALE_GREEN
light_range = 2
light_color = COLOR_PALE_GREEN
resistance_flags = parent_type::resistance_flags | SHUTTLE_CRUSH_PROOF
/// Who are we reviving?
var/mob/living/corpse
/// Who if anyone is playing as them?
@@ -197,6 +197,7 @@
butcher_results = list(/obj/item/ectoplasm = 1)
ai_controller = /datum/ai_controller/basic_controller/parrot/ghost
speech_probability_rate = 1
resistance_flags = parent_type::resistance_flags | SHUTTLE_CRUSH_PROOF
/mob/living/basic/parrot/poly/ghost/Initialize(mapload)
// block anything and everything that could possibly happen with writing memory for ghosts
@@ -50,7 +50,7 @@
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE | PASSCLOSEDTURF | PASSMACHINE | PASSSTRUCTURE | PASSDOORS
flags_1 = SUPERMATTER_IGNORES_1
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF | SHUTTLE_CRUSH_PROOF
obj_flags = CAN_BE_HIT | DANGEROUS_POSSESSION
/obj/singularity/Initialize(mapload, starting_energy = 50)
+1 -1
View File
@@ -26,7 +26,7 @@
obj_flags = CAN_BE_HIT | DANGEROUS_POSSESSION
pixel_x = -32
pixel_y = -32
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF | SHUTTLE_CRUSH_PROOF
flags_1 = SUPERMATTER_IGNORES_1
var/energy
+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