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)