From 8754e0529efd73dd006a64b4be0df69e98092f29 Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Fri, 22 Mar 2024 11:10:13 -0400 Subject: [PATCH] [MIRROR] Driving any vehicle into the supermatter will dust all passengers (#1580) * Driving any vehicle into the supermatter will dust all passengers (#82137) ## About The Pull Request Fixes #82135 All occupants of vehicles (including mobs you can ride) will now die if anyone drives that vehicle into the supermatter crystal. ## Why It's Good For The Game It may not be canonically true that driving the clown car into the supermatter dusts all occupants but by god, it should be. This is the result that you expect to occur upon doing such a thing. ## Changelog :cl: fix: Driving a vehicle into the supermatter will kill everyone riding the vehicle /:cl: --------- Co-authored-by: san7890 * Driving any vehicle into the supermatter will dust all passengers --------- Co-authored-by: Jacquerel Co-authored-by: san7890 --- code/__DEFINES/dcs/signals/signals_object.dm | 3 +++ code/datums/components/riding/riding.dm | 7 +++++++ code/datums/components/supermatter_crystal.dm | 14 ++++++++++---- code/modules/vehicles/sealed.dm | 10 ++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index da4fc0fcb2f..01145cd32ea 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -61,6 +61,9 @@ /// from /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM sounds an audible alarm #define COMSIG_SUPERMATTER_DELAM_ALARM "sm_delam_alarm" +/// from /datum/component/supermatter_crystal/proc/consume() +/// called on the thing consumed, passes the thing which consumed it +#define COMSIG_SUPERMATTER_CONSUMED "sm_consumed_this" // /obj/machinery/cryo_cell signals diff --git a/code/datums/components/riding/riding.dm b/code/datums/components/riding/riding.dm index 98024e1a00e..74451e47c87 100644 --- a/code/datums/components/riding/riding.dm +++ b/code/datums/components/riding/riding.dm @@ -67,6 +67,7 @@ RegisterSignal(parent, COMSIG_BUCKLED_CAN_Z_MOVE, PROC_REF(riding_can_z_move)) RegisterSignals(parent, GLOB.movement_type_addtrait_signals, PROC_REF(on_movement_type_trait_gain)) RegisterSignals(parent, GLOB.movement_type_removetrait_signals, PROC_REF(on_movement_type_trait_loss)) + RegisterSignal(parent, COMSIG_SUPERMATTER_CONSUMED, PROC_REF(on_entered_supermatter)) if(!can_force_unbuckle) RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND, PROC_REF(force_unbuckle)) @@ -314,3 +315,9 @@ if((living_hitter in source.buckled_mobs)) return return COMPONENT_CANCEL_ATTACK_CHAIN + +/// When we touch a crystal, kill everything inside us +/datum/component/riding/proc/on_entered_supermatter(atom/movable/ridden, atom/movable/supermatter) + SIGNAL_HANDLER + for (var/mob/passenger as anything in ridden.buckled_mobs) + passenger.Bump(supermatter) diff --git a/code/datums/components/supermatter_crystal.dm b/code/datums/components/supermatter_crystal.dm index 122cc021fab..9ff049e21fc 100644 --- a/code/datums/components/supermatter_crystal.dm +++ b/code/datums/components/supermatter_crystal.dm @@ -288,15 +288,23 @@ consume(atom_source, nom) /datum/component/supermatter_crystal/proc/consume(atom/source, atom/movable/consumed_object) + if(consumed_object.flags_1 & SUPERMATTER_IGNORES_1) + return + if(isliving(consumed_object)) + var/mob/living/consumed_mob = consumed_object + if(consumed_mob.status_flags & GODMODE) + return + var/atom/atom_source = source + SEND_SIGNAL(consumed_object, COMSIG_SUPERMATTER_CONSUMED, atom_source) + var/object_size = 0 var/matter_increase = 0 var/damage_increase = 0 + if(isliving(consumed_object)) var/mob/living/consumed_mob = consumed_object object_size = consumed_mob.mob_size + 2 - if(consumed_mob.status_flags & GODMODE) - return message_admins("[atom_source] has consumed [key_name_admin(consumed_mob)] [ADMIN_JMP(atom_source)].") atom_source.investigate_log("has consumed [key_name(consumed_mob)].", INVESTIGATE_ENGINE) consumed_mob.investigate_log("has been dusted by [atom_source].", INVESTIGATE_DEATHS) @@ -312,8 +320,6 @@ if(is_clown_job(consumed_mob.mind?.assigned_role)) damage_increase += rand(-30, 30) // HONK consume_returns(matter_increase, damage_increase) - else if(consumed_object.flags_1 & SUPERMATTER_IGNORES_1) - return else if(isobj(consumed_object)) if(!iseffect(consumed_object)) var/suspicion = "" diff --git a/code/modules/vehicles/sealed.dm b/code/modules/vehicles/sealed.dm index de1b5ac93f0..0ecc492f6d5 100644 --- a/code/modules/vehicles/sealed.dm +++ b/code/modules/vehicles/sealed.dm @@ -6,6 +6,10 @@ ///Determines which occupants provide access when bumping into doors var/access_provider_flags = VEHICLE_CONTROL_DRIVE +/obj/vehicle/sealed/Initialize(mapload) + . = ..() + RegisterSignal(src, COMSIG_SUPERMATTER_CONSUMED, PROC_REF(on_entered_supermatter)) + /obj/vehicle/sealed/generate_actions() . = ..() initialize_passenger_action_type(/datum/action/vehicle/sealed/climb_out) @@ -158,3 +162,9 @@ /// Sinced sealed vehicles (cars and mechs) don't have riding components, the actual movement is handled here from [/obj/vehicle/sealed/proc/relaymove] /obj/vehicle/sealed/proc/vehicle_move(direction) return FALSE + +/// When we touch a crystal, kill everything inside us +/obj/vehicle/sealed/proc/on_entered_supermatter(atom/movable/vehicle, atom/movable/supermatter) + SIGNAL_HANDLER + for (var/mob/passenger as anything in occupants) + passenger.Bump(supermatter)