From 75c78fc3c941157f6f86a93f657132cd72cc1c5e Mon Sep 17 00:00:00 2001 From: Hubblenaut Date: Wed, 30 Dec 2015 16:49:24 +0100 Subject: [PATCH] Changes to Confused Moving --- code/modules/mob/living/living.dm | 28 ++++++++++++++++------------ code/modules/mob/mob_movement.dm | 26 +++++++++++++++++--------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b6cf19b849..4bcfb3853b 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -123,22 +123,26 @@ default behaviour is: now_pushing = 0 spawn(0) ..() - if (!istype(AM, /atom/movable)) + if (!istype(AM, /atom/movable) || AM.anchored) + if(confused && prob(50) && m_intent=="run") + Paralyse(1) + playsound(loc, "punch", 25, 1, -1) + visible_message("[src] [pick("ran", "slammed")] into \the [AM]!") + src.take_organ_damage(5) return if (!now_pushing) now_pushing = 1 - if (!AM.anchored) - var/t = get_dir(src, AM) - if (istype(AM, /obj/structure/window)) - for(var/obj/structure/window/win in get_step(AM,t)) - now_pushing = 0 - return - step(AM, t) - if(ishuman(AM) && AM:grabbed_by) - for(var/obj/item/weapon/grab/G in AM:grabbed_by) - step(G:assailant, get_dir(G:assailant, AM)) - G.adjust_position() + var/t = get_dir(src, AM) + if (istype(AM, /obj/structure/window)) + for(var/obj/structure/window/win in get_step(AM,t)) + now_pushing = 0 + return + step(AM, t) + if(ishuman(AM) && AM:grabbed_by) + for(var/obj/item/weapon/grab/G in AM:grabbed_by) + step(G:assailant, get_dir(G:assailant, AM)) + G.adjust_position() now_pushing = 0 return return diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index e946a9df41..36f94c15ac 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -11,7 +11,7 @@ return /mob/proc/setMoveCooldown(var/timeout) - if(client) + if(client) client.move_delay = max(world.time + timeout, client.move_delay) /client/North() @@ -286,7 +286,7 @@ //specific vehicle move delays are set in code\modules\vehicles\vehicle.dm move_delay = world.time + tickcomp //drunk driving - if(mob.confused) + if(mob.confused && prob(75)) direct = pick(cardinal) return mob.buckled.relaymove(mob,direct) @@ -307,8 +307,12 @@ if((!l_hand || (l_hand.status & ORGAN_DESTROYED)) && (!r_hand || (r_hand.status & ORGAN_DESTROYED))) return // No hands to drive your chair? Tough luck! //drunk wheelchair driving - if(mob.confused) - direct = pick(cardinal) + else if(mob.confused) + switch(mob.m_intent) + if("run") + if(prob(75)) direct = pick(cardinal) + if("walk") + if(prob(25)) direct = pick(cardinal) move_delay += 2 return mob.buckled.relaymove(mob,direct) @@ -348,7 +352,11 @@ return else if(mob.confused) - step(mob, pick(cardinal)) + switch(mob.m_intent) + if("run") + if(prob(75)) step(mob, pick(cardinal)) + if("walk") + if(prob(25)) step(mob, pick(cardinal)) else . = mob.SelfMove(n, direct) @@ -450,8 +458,8 @@ if(!Check_Dense_Object()) //Nothing to push off of so end here update_floating(0) return 0 - - update_floating(1) + + update_floating(1) if(restrained()) //Check to see if we can do things return 0 @@ -477,10 +485,10 @@ if(istype(turf,/turf/simulated/floor)) // Floors don't count if they don't have gravity var/area/A = turf.loc - if(istype(A) && A.has_gravity == 0) + if(istype(A) && A.has_gravity == 0) if(shoegrip == null) shoegrip = Check_Shoegrip() //Shoegrip is only ever checked when a zero-gravity floor is encountered to reduce load - if(!shoegrip) + if(!shoegrip) continue dense_object++