diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm
index 5fec97b4f0..4d99afa8d0 100644
--- a/code/game/objects/effects/step_triggers.dm
+++ b/code/game/objects/effects/step_triggers.dm
@@ -185,10 +185,11 @@ var/global/list/tele_landmarks = list() // Terrible, but the alternative is loop
return
A.forceMove(T)
- if(isliving(A)) // Someday, implement parachutes. For now, just turbomurder whoever falls.
+ // Living things should probably be logged when they fall...
+ if(isliving(A))
message_admins("\The [A] fell out of the sky.")
- var/mob/living/L = A
- L.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this.
+ // ... because they're probably going to die from it.
+ A.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this.
else
message_admins("ERROR: planetary_fall step trigger lacks a planet to fall onto.")
return
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index 8e796ca250..d8044da328 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -217,8 +217,4 @@
var/seedarkness = 1 //Determines mob's ability to see shadows. 1 = Normal vision, 0 = darkvision
- // Falling things
- var/hovering = FALSE // Is the mob floating or flying in some way? If so, don't fall normally. //Not implemented yet, idea is to let them ignore terrain slowdown and falling down floors
- var/softfall = FALSE // Is the mob able to lessen their impact upon falling?
- var/parachuting = FALSE // Is the mob able to jump out of planes and survive? Don't check this directly outside of CanParachute().
var/get_rig_stats = 0 //Moved from computer.dm
diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm
index 59b0b2ebe8..ccd00753f8 100644
--- a/code/modules/multiz/movement.dm
+++ b/code/modules/multiz/movement.dm
@@ -347,9 +347,12 @@
/atom/movable/proc/fall_impact(var/atom/hit_atom, var/damage_min = 0, var/damage_max = 10, var/silent = FALSE, var/planetary = FALSE)
if(!silent)
visible_message("\The [src] falls from above and slams into \the [hit_atom]!", "You hear something slam into \the [hit_atom].")
+ for(var/atom/movable/A in src.contents)
+ A.fall_impact(hit_atom, damage_min, damage_max, silent = TRUE)
// Take damage from falling and hitting the ground
-/mob/living/fall_impact(var/turf/landing, var/damage_min = 0, var/damage_max = 30, var/silent = FALSE, var/planetary = FALSE)
+/mob/living/fall_impact(var/atom/hit_atom, var/damage_min = 0, var/damage_max = 10, var/silent = FALSE, var/planetary = FALSE)
+ var/turf/landing = get_turf(hit_atom)
if(planetary && src.CanParachute())
if(!silent)
visible_message("\The [src] glides in from above and lands on \the [landing]!", \
@@ -376,60 +379,32 @@
"You hear something slam into \the [landing].")
playsound(loc, "punch", 25, 1, -1)
- if(planetary) //Since the planetary fall damage is calibrated for humans, we need to up this a bit
- damage_min *= 2
- damage_max *= 2
-
- adjustBruteLoss(rand(damage_min, damage_max))
- return
- return
-
-/mob/living/carbon/human/fall_impact(var/turf/landing, var/damage_min = 0, var/damage_max = 10, var/silent = FALSE, var/planetary = FALSE)
- if(planetary && src.CanParachute())
- if(!silent)
- visible_message("\The [src] glides in from above and lands on \the [landing]!", \
- "You land on \the [landing]!", \
- "You hear something land \the [landing].")
- return
- else if(!planetary && src.softfall) // Falling one floor and falling one atmosphere are very different things
- if(!silent)
- visible_message("\The [src] falls from above and lands on \the [landing]!", \
- "You land on \the [landing]!", \
- "You hear something land \the [landing].")
- return
- else
- if(!silent)
- if(planetary)
- visible_message("\A [src] falls out of the sky and crashes into \the [landing]!", \
- " You fall out of the skiy and crash into \the [landing]!", \
- "You hear something slam into \the [landing].")
- var/turf/T = get_turf(landing)
- explosion(T, 0, 1, 2)
- else
- visible_message("\The [src] falls from above and slams into \the [landing]!", \
- "You fall off and hit \the [landing]!", \
- "You hear something slam into \the [landing].")
- playsound(loc, "punch", 25, 1, -1)
-
- // Because wounds heal rather quickly, 10 should be enough to discourage jumping off but not be enough to ruin you, at least for the first time.
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_HEAD)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_TORSO)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_GROIN)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_L_LEG)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_R_LEG)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_L_FOOT)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_R_FOOT)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_L_ARM)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_R_ARM)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_L_HAND)
- apply_damage(rand(damage_min, damage_max), BRUTE, BP_R_HAND)
+ // Because wounds heal rather quickly, 10 (the default for this proc) should be enough to discourage jumping off but not be enough to ruin you, at least for the first time.
+ // Hits 10 times, because apparently targeting individual limbs lets certain species survive the fall from atmosphere
+ for(var/i = 1 to 10)
+ adjustBruteLoss(rand(damage_min, damage_max))
Weaken(4)
updatehealth()
return
return
-//Checks if the mob is allowed to survive a fall from space
-/mob/living/proc/CanParachute()
+//Using /atom/movable instead of /obj/item because I'm not sure what all humans can pick up or wear
+/atom/movable
+ var/parachute = FALSE // Is this thing a parachute itself?
+ var/hovering = FALSE // Is the thing floating or flying in some way? If so, don't fall normally. //Not implemented yet, idea is to let mobs/mechs ignore terrain slowdown and falling down floors
+ var/softfall = FALSE // Is the thing able to lessen their impact upon falling?
+ var/parachuting = FALSE // Is the thing able to jump out of planes and survive? Don't check this directly outside of CanParachute().
+
+/atom/movable/proc/isParachute()
+ return parachute
+
+//This is what makes the parachute items know they've been used.
+//I made it /atom/movable so it can be retooled for other things (mobs, mechs, etc), though it's only currently called in human/CanParachute().
+/atom/movable/proc/handleParachute()
+ return
+
+//Checks if the thing is allowed to survive a fall from space
+/atom/movable/proc/CanParachute()
return parachuting
//For humans, this needs to be a wee bit more complicated
@@ -454,19 +429,6 @@
else
return parachuting
-//For human falling code
-//Using /obj instead of /obj/item because I'm not sure what all humans can pick up or wear
-/obj
- var/parachute = FALSE
-
-/obj/proc/isParachute()
- return parachute
-
-//This is what makes the parachute items know they've been used.
-//I made it /atom/movable so it can be retooled for other things (mobs, mechs, etc), though it's only currently called in human/CanParachute().
-/atom/movable/proc/handleParachute()
- return
-
//Mech Code
/obj/mecha/handle_fall(var/turf/landing)
// First things first, break any lattice
@@ -480,18 +442,49 @@
return ..()
/obj/mecha/fall_impact(var/atom/hit_atom, var/damage_min = 15, var/damage_max = 30, var/silent = FALSE, var/planetary = FALSE)
- // Tell the pilot that they just dropped down with a superheavy mecha.
- if(occupant)
- to_chat(occupant, "\The [src] crashed down onto \the [hit_atom]!")
-
// Anything on the same tile as the landing tile is gonna have a bad day.
for(var/mob/living/L in hit_atom.contents)
L.visible_message("\The [src] crushes \the [L] as it lands on them!")
L.adjustBruteLoss(rand(70, 100))
L.Weaken(8)
- // Now to hurt the mech.
- take_damage(rand(damage_min, damage_max))
+ var/turf/landing = get_turf(hit_atom)
+
+ if(planetary && src.CanParachute())
+ if(!silent)
+ visible_message("\The [src] glides in from above and lands on \the [landing]!", \
+ "You land on \the [landing]!", \
+ "You hear something land \the [landing].")
+ return
+ else if(!planetary && src.softfall) // Falling one floor and falling one atmosphere are very different things
+ if(!silent)
+ visible_message("\The [src] falls from above and lands on \the [landing]!", \
+ "You land on \the [landing]!", \
+ "You hear something land \the [landing].")
+ return
+ else
+ if(!silent)
+ if(planetary)
+ visible_message("\A [src] falls out of the sky and crashes into \the [landing]!", \
+ " You fall out of the skiy and crash into \the [landing]!", \
+ "You hear something slam into \the [landing].")
+ var/turf/T = get_turf(landing)
+ explosion(T, 0, 1, 2)
+ else
+ visible_message("\The [src] falls from above and slams into \the [landing]!", \
+ "You fall off and hit \the [landing]!", \
+ "You hear something slam into \the [landing].")
+ playsound(loc, "punch", 25, 1, -1)
+
+ // Now to hurt everything in the mech (if the fall is planetary, the mech blows up, so we do this first)
+ for(var/atom/movable/A in src.contents)
+ A.fall_impact(hit_atom, damage_min, damage_max, silent = TRUE)
+ // And now the Mech
+
+ if(!planetary)
+ take_damage(rand(damage_min, damage_max))
+ else
+ qdel(src)
// And hurt the floor.
if(istype(hit_atom, /turf/simulated/floor))
diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm
index 0bfd3dfd0e..fe54e49461 100644
--- a/code/modules/organs/organ_external.dm
+++ b/code/modules/organs/organ_external.dm
@@ -323,7 +323,8 @@
// sync the organ's damage with its wounds
src.update_damages()
- owner.updatehealth() //droplimb will call updatehealth() again if it does end up being called
+ if(owner)
+ owner.updatehealth() //droplimb will call updatehealth() again if it does end up being called
//If limb took enough damage, try to cut or tear it off
if(owner && loc == owner && !is_stump())
diff --git a/html/changelogs/Anewbe - MechsFall.yml b/html/changelogs/Anewbe - MechsFall.yml
new file mode 100644
index 0000000000..af4d4acedb
--- /dev/null
+++ b/html/changelogs/Anewbe - MechsFall.yml
@@ -0,0 +1,36 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+#################################
+
+# Your name.
+author: Anewbe
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - bugfix: "You need a parachute to survive atmospheric reentry, closets, mechs, and other impromptu parachutes will not longer prevent splatting."