Skip to content

Commit

Permalink
Violent ejections (#8474)
Browse files Browse the repository at this point in the history
  • Loading branch information
XElectricX authored Apr 19, 2024
1 parent fde647a commit 4344283
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion code/modules/mechs/mech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@
selected_system = null

for(var/mob/living/Pilot in pilots)
eject(Pilot)
eject(Pilot, TRUE, TRUE)

pilots = null
var/obj/item/mech_equipment/forklifting_system/lifter = locate() in contents
if(lifter)
Expand Down
12 changes: 10 additions & 2 deletions code/modules/mechs/mech_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@
access_card.access |= pilot.GetAccess()
to_chat(pilot, SPAN_NOTICE("Security access permissions synchronized."))

/mob/living/exosuit/proc/eject(mob/living/user, silent)
if(!user || !(user in src.contents)) return
/mob/living/exosuit/proc/eject(mob/living/user, silent, mech_death)
if(!user || !(user in src.contents))
return

if(body && body.has_hatch)
if(hatch_closed)
if(hatch_locked)
Expand All @@ -247,6 +249,12 @@
to_chat(user, SPAN_NOTICE("You climb out of \the [src]."))

user.forceMove(get_turf(src))

if(mech_death)
user.apply_damages(30, 30) //Give them bruises and burns
//Mobs process every 2 seconds but both handle_statuses() and handle_status_effects() decrements by 1
user.AdjustWeakened(4)

//LAZYREMOVE(user.additional_vision_handlers, src)
if(user in pilots)
a_intent = I_HURT
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mechs/mech_life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
// Eject the pilots
hatch_locked = FALSE // So they can get out
for(var/pilot in pilots)
eject(pilot, silent=TRUE)
eject(pilot, TRUE, TRUE)

// Salvage moves into the wreck unless we're exploding violently.
var/obj/wreck = new wreckage_path(drop_location(), src, gibbed)
Expand Down

0 comments on commit 4344283

Please sign in to comment.