From c9ee48b78fdd2ba6e58148db7d868eeafbc13847 Mon Sep 17 00:00:00 2001 From: Cameron Lennox Date: Sat, 11 Nov 2017 19:24:35 -0500 Subject: [PATCH] WIP --- code/modules/multiz/movement.dm | 5 +++ code/modules/multiz/movement_vr.dm | 58 ++++++++++++++++++++++++++++++ vorestation.dme | 1 + 3 files changed, 64 insertions(+) create mode 100644 code/modules/multiz/movement_vr.dm diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index f9a662e2e84..2f0d0f76f6d 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -352,6 +352,11 @@ "You hear something slam into \the [landing].") playsound(loc, "punch", 25, 1, -1) var/damage = 15 // Because wounds heal rather quickly, 15 should be enough to discourage jumping off but not be enough to ruin you, at least for the first time. + for(var/mob/M in landing.contents) //VOREStation Edit Start + if(M != src) + M.visible_message("\The [src] drops onto \the [M]!") + M.Weaken(8) + damage = 5 //VOREStation Edit END apply_damage(rand(0, damage), BRUTE, BP_HEAD) apply_damage(rand(0, damage), BRUTE, BP_TORSO) apply_damage(rand(0, damage), BRUTE, BP_L_LEG) diff --git a/code/modules/multiz/movement_vr.dm b/code/modules/multiz/movement_vr.dm new file mode 100644 index 00000000000..dbe1b7a37d4 --- /dev/null +++ b/code/modules/multiz/movement_vr.dm @@ -0,0 +1,58 @@ + +/*/mob/handle_fall(var/turf/landing) + for(var/mob/M in landing) + if(M != src && M.CheckFall(src)) + return 1 + for(var/atom/A in landing) + if(!A.CanPass(src, src.loc, 1, 0)) + return FALSE + // TODO - Stairs should operate thru a different mechanism, not falling, to allow side-bumping. + + // Now lets move there! + if(!Move(landing)) + return 1 + + // Detect if we made a silent landing. + if(locate(/obj/structure/stairs) in landing) + return 1 + + if(isopenspace(oldloc)) + oldloc.visible_message("\The [src] falls down through \the [oldloc]!", "You hear something falling through the air.") + + // If the turf has density, we give it first dibs + if (landing.density && landing.CheckFall(src)) + return + + // First hit objects in the turf! + for(var/atom/movable/A in landing) + if(A != src && A.CheckFall(src)) + return + + // If none of them stopped us, then hit the turf itself + landing.CheckFall(src) +*/ +/mob/handle_fall(var/turf/landing) + var/mob/drop_mob= locate(/mob, loc) + if(drop_mob) + lattice.visible_message("\The [drop_mob] is dropped onto by \the [src]!") + drop_mob.fall_impact(src) + + // Then call parent to have us actually fall + return ..() +/mob/CheckFall(var/atom/movable/falling_atom) + return falling_atom.fall_impact(src) + +/mob/fall_impact(var/atom/hit_atom) + if(ismob(hit_atom)) + var/mob/M = hit_atom + M.visible_message("\The [src] falls onto \the [M]!") + M.Weaken(8) + +/mob/proc/CanZPass(atom/A, direction) + if(z == A.z) //moving FROM this turf + return direction == UP //can't go below + else + if(direction == UP) //on a turf below, trying to enter + return 0 + if(direction == DOWN) //on a turf above, trying to enter + return 1 \ No newline at end of file diff --git a/vorestation.dme b/vorestation.dme index d1b5a5b37b5..e75eec04a6c 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2087,6 +2087,7 @@ #include "code\modules\multiz\basic.dm" #include "code\modules\multiz\ladder_assembly_vr.dm" #include "code\modules\multiz\movement.dm" +#include "code\modules\multiz\movement_vr.dm" #include "code\modules\multiz\open_space_controller.dm" #include "code\modules\multiz\pipes.dm" #include "code\modules\multiz\structures.dm"