From be17090547f867517bdfe18682d993d3c376199e Mon Sep 17 00:00:00 2001
From: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Date: Mon, 26 Mar 2018 05:32:12 +1000
Subject: [PATCH] (SQ-Merge) Possible fix for drop-nomming (#3331)
* possible drop-nomming fix
* no longer 100% fall cushion on non-aligning prefs
* fixed some checks
---
code/modules/multiz/movement_vr.dm | 47 ++++++++++++++++++++++++---
code/modules/vore/eating/living_vr.dm | 6 +++-
2 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/code/modules/multiz/movement_vr.dm b/code/modules/multiz/movement_vr.dm
index 370aa97f4dc..4ed62e25823 100644
--- a/code/modules/multiz/movement_vr.dm
+++ b/code/modules/multiz/movement_vr.dm
@@ -1,6 +1,6 @@
/mob/living/handle_fall(var/turf/landing)
- var/mob/drop_mob= locate(/mob, loc)
+ var/mob/drop_mob = locate(/mob, landing)
if(locate(/obj/structure/stairs) in landing)
for(var/atom/A in landing)
@@ -13,8 +13,10 @@
if(!O.CanFallThru(src, landing))
return 1
- if(drop_mob && drop_mob != src && ismob(drop_mob)) //Shitload of checks. This is because the game finds various ways to screw me over.
- drop_mob.fall_impact(src)
+ if(drop_mob && !(drop_mob == src) && ismob(drop_mob) && isliving(drop_mob)) //Shitload of checks. This is because the game finds various ways to screw me over.
+ var/mob/living/drop_living = drop_mob
+ if(drop_living.dropped_onto(src))
+ return
// Then call parent to have us actually fall
return ..()
@@ -41,9 +43,9 @@
M.visible_message("\The [src] drops onto \the [M]! FALL IMPACT SHADOW WEAKEN 8")
M.Weaken(8)
*/
- if(isliving(hit_atom)) //THIS WEAKENS THE PERSON FALLING & NOMS THE PERSON FALLEN ONTO. SRC is person fallen onto. hit_atom is the person falling. Confusing.
+/* if(isliving(hit_atom)) //THIS WEAKENS THE PERSON FALLING & NOMS THE PERSON FALLEN ONTO. SRC is person fallen onto. hit_atom is the person falling. Confusing.
var/mob/living/pred = hit_atom
- pred.visible_message("\The [hit_atom] falls onto \the [src]!")
+ pred.visible_message("\The [hit_atom] falls onto \the [src.owner]!")
pred.Weaken(8) //Stun the person you're dropping onto! You /are/ suffering massive damage for a single stun.
var/mob/living/prey = src.owner //The shadow's owner
if(isliving(prey))
@@ -52,7 +54,42 @@
else if(prey.can_be_drop_pred && pred.can_be_drop_prey) //Is person being fallen onto pred & person falling prey
pred.feed_grabbed_to_self_falling_nom(prey,pred) //oh, how the tables have turned.
else
+ playsound(loc, "punch", 25, 1, -1)
prey.Weaken(8) //Just fall onto them if neither of the above apply.
+ var/tdamage
+ for(var/i = 1 to 10)
+ tdamage = rand(0, 10)/2
+ pred.adjustBruteLoss(tdamage)
+ prey.adjustBruteLoss(tdamage)
+ pred.updatehealth()
+ prey.updatehealth()
+*/
+/mob/living/proc/dropped_onto(var/atom/hit_atom)
+ if(!isliving(hit_atom))
+ return 0
+
+ var/mob/living/pred = hit_atom
+ pred.visible_message("\The [hit_atom] falls onto \the [src]!")
+ pred.Weaken(8)
+ var/mob/living/prey = src
+ var/fallloc = prey.loc
+ if(pred.can_be_drop_pred && prey.can_be_drop_prey)
+ pred.feed_grabbed_to_self_falling_nom(pred,prey)
+ pred.loc = fallloc
+ else if(prey.can_be_drop_pred && pred.can_be_drop_prey)
+ prey.feed_grabbed_to_self_falling_nom(prey,pred)
+ else
+ prey.Weaken(8)
+ pred.loc = prey.loc
+ playsound(loc, "punch", 25, 1, -1)
+ var/tdamage
+ for(var/i = 1 to 10)
+ tdamage = rand(0, 10)/2
+ pred.adjustBruteLoss(tdamage)
+ prey.adjustBruteLoss(tdamage)
+ pred.updatehealth()
+ prey.updatehealth()
+ return 1
/mob/observer/dead/CheckFall()
return
diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm
index def24d450a5..9d671b9d6eb 100644
--- a/code/modules/vore/eating/living_vr.dm
+++ b/code/modules/vore/eating/living_vr.dm
@@ -415,7 +415,11 @@
user.visible_message(attempt_msg)
// Now give the prey time to escape... return if they did
- var/swallow_time = delay || istype(prey, /mob/living/carbon/human) ? belly.human_prey_swallow_time : belly.nonhuman_prey_swallow_time
+ var/swallow_time
+ if(delay)
+ swallow_time = delay
+ else
+ swallow_time = istype(prey, /mob/living/carbon/human) ? belly.human_prey_swallow_time : belly.nonhuman_prey_swallow_time
//Timer and progress bar
if(!do_after(user, swallow_time, prey))