Skip to content

Commit

Permalink
Jumping out of a dropship heading towards an LZ now throws your body …
Browse files Browse the repository at this point in the history
…at the ground, instead of deleting it. (#5584)

# About the pull request

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

Jumping out of a dropship heading towards an LZ now throws your body at
the ground, instead of deleting it. This does around 500 damage, and
permanently kills you.


![image](https://github.com/cmss13-devs/cmss13/assets/91113370/6bbd7926-1f8b-4078-a1ea-2dc583725ece)


These people falling out of the sky, can land anywhere where there is no
ceiling (or a glass one). Basically anywhere you can mortar, medevac, or
laze something.

This only works if the dropship is heading towards one of the LZs, if
not, then they're deleted like normal.

I also fixed the throwing, so it doesn't appear like you're just
standing in space for 0.5 seconds before being disappeared.

I also removed some unused arguments in `take_overall_damage` and
`take_overall_armored_damage`.

# Explain why it's good for the game
It adds a bit of depth to the game, instead of your character being just
outright deleted, their body actually ends up somewhere.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


https://github.com/cmss13-devs/cmss13/assets/91113370/a6df19dc-7f9f-4c8d-8169-2db1497b6c54

(It does play sounds when you land, you just cant really hear them in
this clip because they died.)


![image](https://github.com/cmss13-devs/cmss13/assets/91113370/b7f1bf66-fdce-4082-97c2-3fa841e168eb)


![image](https://github.com/cmss13-devs/cmss13/assets/91113370/f0819fea-4ac8-47b5-a012-f8ea12f08799)


https://github.com/cmss13-devs/cmss13/assets/91113370/f727b8f7-1df3-4725-bb82-f16dc8294eea

(Items do a little bounce when they land too)

</details>


# Changelog
:cl:
add: Falling out of a Dropship en route to an LZ, now lets your corpse
plummet to the ground instead of being deleted.
/:cl:

---------

Co-authored-by: private-tristan <[email protected]>
  • Loading branch information
Contrabang and private-tristan authored Feb 20, 2024
1 parent f0f1f04 commit f9ed344
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 30 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ GLOBAL_LIST(trait_name_map)
#define XENO_WEED_TRAIT "xeno_weed"
/// traits associated with actively interacted machinery
#define INTERACTION_TRAIT "interaction"
/// traits associated with interacting with a dropship
#define TRAIT_SOURCE_DROPSHIP_INTERACTION "dropship_interaction"
/// traits bound by stunned status effects
#define STUNNED_TRAIT "stunned"
/// traits bound by knocked_down status effect
Expand Down
16 changes: 2 additions & 14 deletions code/controllers/subsystem/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ SUBSYSTEM_DEF(shuttle)
// First, determine the size of the needed zone
// Because of shuttle rotation, the "width" of the shuttle is not
// always x.
var/travel_dir = M.preferred_direction
// Remember, the direction is the direction we appear to be
// coming from
var/dock_angle = dir2angle(M.preferred_direction) + dir2angle(M.port_direction) + 180
var/dock_dir = angle2dir(dock_angle)

Expand All @@ -185,19 +182,10 @@ SUBSYSTEM_DEF(shuttle)

/*
to_chat(world, "The attempted transit dock will be [transit_width] width, and \)
[transit_height] in height. The travel dir is [travel_dir]."
[transit_height] in height. The travel dir is [M.preferred_direction]."
*/

var/transit_path = /turf/open/space/transit
switch(travel_dir)
if(NORTH)
transit_path = /turf/open/space/transit/north
if(SOUTH)
transit_path = /turf/open/space/transit/south
if(EAST)
transit_path = /turf/open/space/transit/east
if(WEST)
transit_path = /turf/open/space/transit/west
var/transit_path = M.get_transit_path_type()

var/datum/turf_reservation/proposal = SSmapping.RequestBlockReservation(transit_width, transit_height, null, /datum/turf_reservation/transit, transit_path)

Expand Down
114 changes: 106 additions & 8 deletions code/game/turfs/transit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,117 @@
if(isobserver(crosser) || crosser.anchored)
return

if(!(isitem(crosser) || isliving(crosser)))
if(!isitem(crosser) && !isliving(crosser))
return

var/turf/open/floor/floor = old_loc
if(istype(floor))
var/fling_dir = get_dir(floor, crosser.loc)

var/turf/near_turf = get_step(crosser.loc, get_step(crosser.loc, fling_dir))
var/turf/projected = get_ranged_target_turf(near_turf, fling_dir, 50)
if(!istype(old_loc, /turf/open/space))
var/turf/projected = get_ranged_target_turf(crosser.loc, dir, 10)

INVOKE_ASYNC(crosser, TYPE_PROC_REF(/atom/movable, throw_atom), projected, 50, SPEED_FAST, null, TRUE)

QDEL_IN(crosser, 0.5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(handle_crosser), crosser), 0.5 SECONDS)

/turf/open/space/transit/proc/handle_crosser(atom/movable/crosser)
if(QDELETED(crosser))
return
qdel(crosser)

/turf/open/space/transit/dropship
var/shuttle_tag

/turf/open/space/transit/dropship/handle_crosser(atom/movable/crosser)
if(QDELETED(crosser))
return
if(!shuttle_tag)
return ..()

var/obj/docking_port/mobile/marine_dropship/dropship = SSshuttle.getShuttle(shuttle_tag)
if(!istype(dropship) || dropship.mode != SHUTTLE_CALL)
return ..()

if(dropship.destination.id != DROPSHIP_LZ1 && dropship.destination.id != DROPSHIP_LZ2)
return ..() // we're not heading towards the LZs

// you just jumped out of a dropship heading towards the LZ, have fun living on the way down!
var/list/ground_z_levels = SSmapping.levels_by_trait(ZTRAIT_GROUND)
if(!length(ground_z_levels))
return ..()

var/list/area/potential_areas = shuffle(SSmapping.areas_in_z["[ground_z_levels[1]]"])

for(var/area/maybe_this_area in potential_areas)
if(CEILING_IS_PROTECTED(maybe_this_area.ceiling, CEILING_PROTECTION_TIER_1)) // prevents out of bounds too
continue
if(istype(maybe_this_area, /area/space)) // make sure its not space, just in case
continue

var/turf/open/possible_turf = null
var/list/area_turfs = get_area_turfs(maybe_this_area)
for(var/i in 1 to 10)
possible_turf = pick_n_take(area_turfs)
// we're looking for an open, non-dense, and non-space turf.
if(!istype(possible_turf) || is_blocked_turf(possible_turf) || istype(possible_turf, /turf/open/space))
continue

if(!istype(possible_turf) || is_blocked_turf(possible_turf) || istype(possible_turf, /turf/open/space))
continue // couldnt find one in 10 loops, check another area

// we found a good turf, lets drop em
INVOKE_ASYNC(src, PROC_REF(handle_drop), crosser, possible_turf, dropship.name)
return

return ..() // they couldn't be dropped, just delete them

/turf/open/space/transit/dropship/proc/handle_drop(atom/movable/crosser, turf/target, dropship_name)
if(QDELETED(crosser))
return
ADD_TRAIT(crosser, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION)

crosser.pixel_z = 360
crosser.forceMove(target)
crosser.visible_message(SPAN_WARNING("[crosser] falls out of the sky."), SPAN_HIGHDANGER("As you fall out of the [dropship_name], you plummet towards the ground."))
animate(crosser, time = 6, pixel_z = 0, flags = ANIMATION_PARALLEL)

REMOVE_TRAIT(crosser, TRAIT_IMMOBILIZED, TRAIT_SOURCE_DROPSHIP_INTERACTION)
if(isitem(crosser))
var/obj/item/item = crosser
item.explosion_throw(200) // give it a bit of a kick
return

if(!isliving(crosser))
return // don't know how you got here, but you shouldnt be here.
var/mob/living/fallen_mob = crosser

playsound(target, "punch", rand(20, 70), TRUE)
playsound(target, "punch", rand(20, 70), TRUE)
playsound(target, "bone_break", rand(20, 70), TRUE)
playsound(target, "bone_break", rand(20, 70), TRUE)

fallen_mob.KnockDown(10) // 10 seconds
fallen_mob.Stun(3) // 3 seconds


if(ishuman(fallen_mob))
var/mob/living/carbon/human/human = fallen_mob
human.last_damage_data = create_cause_data("falling from [dropship_name]", human)
// I'd say falling from space is pretty much like getting hit by an explosion
human.take_overall_armored_damage(300, ARMOR_BOMB, limb_damage_chance = 100)
// but just in case, you will still take a ton of damage.
human.take_overall_damage(200, used_weapon = "falling", limb_damage_chance = 100)
if(human.stat != DEAD)
human.death(human.last_damage_data)
fallen_mob.status_flags |= PERMANENTLY_DEAD
return
// take a little bit more damage otherwise
fallen_mob.take_overall_damage(400, used_weapon = "falling", limb_damage_chance = 100)

/turf/open/space/transit/dropship/alamo
shuttle_tag = DROPSHIP_ALAMO
dir = SOUTH

/turf/open/space/transit/dropship/normandy
shuttle_tag = DROPSHIP_NORMANDY
dir = SOUTH

/turf/open/space/transit/south
dir = SOUTH
Expand Down
12 changes: 7 additions & 5 deletions code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,25 +311,27 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t
if(update) UpdateDamageIcon()

// damage MANY limbs, in random order
/mob/living/carbon/human/take_overall_damage(brute, burn, sharp = 0, edge = 0, used_weapon = null)
/mob/living/carbon/human/take_overall_damage(brute, burn, used_weapon = null, limb_damage_chance = 80)
if(status_flags & GODMODE)
return //godmode
var/list/obj/limb/parts = get_damageable_limbs(80)
var/list/obj/limb/parts = get_damageable_limbs(limb_damage_chance)
var/amount_of_parts = length(parts)
for(var/obj/limb/L as anything in parts)
L.take_damage(brute / amount_of_parts, burn / amount_of_parts, sharp, edge, used_weapon)
L.take_damage(brute / amount_of_parts, burn / amount_of_parts, sharp = FALSE, edge = FALSE, used_weapon = used_weapon)
updatehealth()
UpdateDamageIcon()

// damage MANY LIMBS, in random order
/mob/living/carbon/human/proc/take_overall_armored_damage(damage, armour_type = ARMOR_MELEE, damage_type = BRUTE, limb_damage_chance = 80, penetration = 0, armour_break_pr_pen = 0, armour_break_flat = 0)
// damage MANY LIMBS, in random order, but consider armor
/mob/living/carbon/human/proc/take_overall_armored_damage(damage, armour_type = ARMOR_MELEE, damage_type = BRUTE, limb_damage_chance = 80, penetration = 0)
if(status_flags & GODMODE)
return //godmode
var/list/obj/limb/parts = get_damageable_limbs(limb_damage_chance)
var/amount_of_parts = length(parts)
var/armour_config = GLOB.marine_ranged
if(armour_type == ARMOR_MELEE)
armour_config = GLOB.marine_melee
if(armour_type == ARMOR_BOMB)
armour_config = GLOB.marine_explosive
for(var/obj/limb/L as anything in parts)
var/armor = getarmor(L, armour_type)
var/modified_damage = armor_damage_reduction(armour_config, damage, armor, penetration, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/living_health_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
src.updatehealth()

// damage MANY limbs, in random order
/mob/living/proc/take_overall_damage(brute, burn, used_weapon = null)
/mob/living/proc/take_overall_damage(brute, burn, used_weapon = null, limb_damage_chance = 80)
if(status_flags & GODMODE) return 0 //godmode
apply_damage(brute, BRUTE)
apply_damage(burn, BURN)
Expand Down
12 changes: 12 additions & 0 deletions code/modules/shuttle/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1004,3 +1004,15 @@
to_chat(user, SPAN_WARNING("Shuttle already in transit."))
return FALSE
return TRUE

/obj/docking_port/mobile/proc/get_transit_path_type()
. = /turf/open/space/transit
switch(preferred_direction)
if(NORTH)
return /turf/open/space/transit/north
if(SOUTH)
return /turf/open/space/transit/south
if(EAST)
return /turf/open/space/transit/east
if(WEST)
return /turf/open/space/transit/west
10 changes: 8 additions & 2 deletions code/modules/shuttle/shuttles/dropship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,18 @@
/obj/docking_port/mobile/marine_dropship/alamo
name = "Alamo"
id = DROPSHIP_ALAMO
preferred_direction = SOUTH
preferred_direction = SOUTH // If you are changing this, please update the dir of the path below as well

/obj/docking_port/mobile/marine_dropship/alamo/get_transit_path_type()
return /turf/open/space/transit/dropship/alamo

/obj/docking_port/mobile/marine_dropship/normandy
name = "Normandy"
id = DROPSHIP_NORMANDY
preferred_direction = SOUTH
preferred_direction = SOUTH // If you are changing this, please update the dir of the path below as well

/obj/docking_port/mobile/marine_dropship/normandy/get_transit_path_type()
return /turf/open/space/transit/dropship/normandy

/obj/docking_port/mobile/marine_dropship/check()
. = ..()
Expand Down

0 comments on commit f9ed344

Please sign in to comment.