From d2d46ec77cf8a8ab65ea29da53ce17ede6695ea4 Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Wed, 17 May 2023 00:13:01 +0100 Subject: [PATCH] Blobs and Kudzu are killed by chasms. (#75469) ## About The Pull Request Fixes #75451 Originally I just whitelisted them because they're structures that are supported by their surroundings... but there's still the theoretical scenario where it has expanded over a reasonably large chasm and then becomes almost impossible to remove because you can't easily get at the ones in the middle, and it would be "levitating" after you cut off everything around the edge. So instead this adds a trait which restores the original behaviour of chasms where they delete stuff which falls into them and applies it to Blobs and Kudzu. ## Why It's Good For The Game It's a very niche scenario but "expanding structure falls into abstract chasm storage" causes issues where it potentially keeps processing in there and there isn't much you can do about it. Maybe there's other stuff that commonly falls into chasms we'll decide that we want to delete instead of keeping in pools now that you can just slap a trait onto something to do it, future consideration. ## Changelog :cl: fix: Blob and Kudzu tiles which expand into chasms will now be correctly destroyed by the chasm. /:cl: --- code/__DEFINES/traits.dm | 2 ++ code/_globalvars/traits.dm | 1 + code/datums/components/chasm.dm | 8 ++++++++ code/modules/antagonists/blob/structures/_blob.dm | 1 + code/modules/events/space_vines/vine_structure.dm | 1 + 5 files changed, 13 insertions(+) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index bfd3be65fdc..b12b77ba0b2 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -839,6 +839,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_DO_NOT_SPLASH "do_not_splash" /// Marks an atom when the cleaning of it is first started, so that the cleaning overlay doesn't get removed prematurely #define TRAIT_CURRENTLY_CLEANING "currently_cleaning" +/// Objects with this trait are deleted if they fall into chasms, rather than entering abstract storage +#define TRAIT_CHASM_DESTROYED "chasm_destroyed" // unique trait sources, still defines #define EMP_TRAIT "emp_trait" diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index d76f61e8473..c3da33fe107 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -182,6 +182,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_CANNOT_BE_UNBUCKLED" = TRAIT_CANNOT_BE_UNBUCKLED, "TRAIT_GAMER" = TRAIT_GAMER, "TRAIT_UNKNOWN" = TRAIT_UNKNOWN, + "TRAIT_CHASM_DESTROYED" = TRAIT_CHASM_DESTROYED, "TRAIT_MIMING" = TRAIT_MIMING, "TRAIT_PREVENT_IMPLANT_AUTO_EXPLOSION" = TRAIT_PREVENT_IMPLANT_AUTO_EXPLOSION, "TRAIT_UNOBSERVANT" = TRAIT_UNOBSERVANT, diff --git a/code/datums/components/chasm.dm b/code/datums/components/chasm.dm index b8733686c1e..7f1a3f6a599 100644 --- a/code/datums/components/chasm.dm +++ b/code/datums/components/chasm.dm @@ -132,6 +132,10 @@ GLOBAL_LIST_INIT(chasm_storage, list()) return // We're already handling this if(below_turf) + if(HAS_TRAIT(dropped_thing, TRAIT_CHASM_DESTROYED)) + qdel(dropped_thing) + return + // send to the turf below dropped_thing.visible_message(span_boldwarning("[dropped_thing] falls into [parent]!"), span_userdanger("[fall_message]")) below_turf.visible_message(span_boldwarning("[dropped_thing] falls from above!")) @@ -167,6 +171,10 @@ GLOBAL_LIST_INIT(chasm_storage, list()) if(!dropped_thing || QDELETED(dropped_thing)) return + if(HAS_TRAIT(dropped_thing, TRAIT_CHASM_DESTROYED)) + qdel(dropped_thing) + return + if(!storage) storage = new(get_turf(parent)) RegisterSignal(storage, COMSIG_ATOM_EXITED, PROC_REF(left_chasm)) diff --git a/code/modules/antagonists/blob/structures/_blob.dm b/code/modules/antagonists/blob/structures/_blob.dm index b3a71944e6d..e59603d2171 100644 --- a/code/modules/antagonists/blob/structures/_blob.dm +++ b/code/modules/antagonists/blob/structures/_blob.dm @@ -38,6 +38,7 @@ /obj/structure/blob/Initialize(mapload, owner_overmind) . = ..() + ADD_TRAIT(src, TRAIT_CHASM_DESTROYED, INNATE_TRAIT) register_context() if(owner_overmind) overmind = owner_overmind diff --git a/code/modules/events/space_vines/vine_structure.dm b/code/modules/events/space_vines/vine_structure.dm index 9ba68136ef7..9357dfce454 100644 --- a/code/modules/events/space_vines/vine_structure.dm +++ b/code/modules/events/space_vines/vine_structure.dm @@ -30,6 +30,7 @@ /obj/structure/spacevine/Initialize(mapload) . = ..() + ADD_TRAIT(src, TRAIT_CHASM_DESTROYED, INNATE_TRAIT) add_atom_colour("#ffffff", FIXED_COLOUR_PRIORITY) var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = PROC_REF(on_entered),