Skip to content

Commit

Permalink
[MIRROR] Driving any vehicle into the supermatter will dust all passe…
Browse files Browse the repository at this point in the history
…ngers (#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 <[email protected]>

* Driving any vehicle into the supermatter will dust all passengers

---------

Co-authored-by: Jacquerel <[email protected]>
Co-authored-by: san7890 <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Mar 22, 2024
1 parent 9aba8d1 commit 8754e05
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
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)

0 comments on commit 8754e05

Please sign in to comment.