Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Driving any vehicle into the supermatter will dust all passengers #2512

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions code/datums/components/riding/riding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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)
14 changes: 10 additions & 4 deletions code/datums/components/supermatter_crystal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 = ""
Expand Down
10 changes: 10 additions & 0 deletions code/modules/vehicles/sealed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Loading