Merge pull request #3491 from Neerti/6/1/2017_mech_stumping

Makes Mechs Fall
This commit is contained in:
Anewbe
2017-06-01 14:44:36 -05:00
committed by GitHub

View File

@@ -23,12 +23,12 @@
if(!istype(start))
to_chat(src, "<span class='notice'>You are unable to move from here.</span>")
return 0
var/turf/destination = (direction == UP) ? GetAbove(src) : GetBelow(src)
if(!destination)
to_chat(src, "<span class='notice'>There is nothing of interest in this direction.</span>")
return 0
if(!start.CanZPass(src, direction))
to_chat(src, "<span class='warning'>\The [start] is in the way.</span>")
return 0
@@ -154,6 +154,28 @@
/obj/effect/decal/cleanable/can_fall()
return TRUE
// These didn't fall anyways but better to nip this now just incase.
/atom/movable/lighting_overlay/can_fall()
return FALSE
// Mechas are anchored, so we need to override.
/obj/mecha/can_fall()
var/obj/structure/lattice/lattice = locate(/obj/structure/lattice, loc)
if(lattice)
var/area/area = get_area(src)
if(area.has_gravity())
// Lattices seem a bit too flimsy to hold up a massive exosuit.
lattice.visible_message("<span class='danger'>\The [lattice] collapses under the weight of \the [src]!</span>")
qdel(lattice)
// See if something prevents us from falling.
var/turf/below = GetBelow(src)
for(var/atom/A in below)
if(!A.CanPass(src, src.loc))
return FALSE
return TRUE
/obj/item/pipe/can_fall()
var/turf/simulated/open/below = loc
below = below.below
@@ -195,4 +217,26 @@
apply_damage(rand(0, damage), BRUTE, BP_L_ARM)
apply_damage(rand(0, damage), BRUTE, BP_R_ARM)
Weaken(4)
updatehealth()
updatehealth()
/obj/mecha/handle_fall(var/turf/landing)
if(..())
return
// Tell the pilot that they just dropped down with a superheavy mecha.
if(occupant)
to_chat(occupant, "<span class='warning'>\The [src] crashed down onto \the [landing]!</span>")
// Anything on the same tile as the landing tile is gonna have a bad day.
for(var/mob/living/L in landing.contents)
L.visible_message("<span class='danger'>\The [src] crushes \the [L] as it lands on them!</span>")
L.adjustBruteLoss(rand(70, 100))
L.Weaken(8)
// Now to hurt the mech.
take_damage(rand(15, 30))
// And hurt the floor.
if(istype(landing, /turf/simulated/floor))
var/turf/simulated/floor/ground = landing
ground.break_tile()