From e89499672cb8335bae9ec620aff68a9f7e9aec65 Mon Sep 17 00:00:00 2001 From: Aranclanos Date: Wed, 13 Aug 2014 20:53:20 -0300 Subject: [PATCH] Added a spinning visual effect to rolling on the floor to extinguish yourself in case of a fire. Lube will now make you spin while you're slipping. Water will make you slip on the spot and won't move you forward. Fixed the bug of wrong mob directions when buckling them while they are lying down. --- code/game/turfs/turf.dm | 12 +++++------ .../modules/mob/living/carbon/update_icons.dm | 4 ++-- code/modules/mob/living/living.dm | 21 ++++++++++++++++++- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 1e4d75217fb..ac6cc4e66b3 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -371,13 +371,15 @@ if (M.m_intent=="walk" && (lube&NO_SLIP_WHEN_WALKING)) return 0 if(!M.lying) + var/olddir = M.dir + M.Stun(s_amount) + M.Weaken(w_amount) M.stop_pulling() - if(lube&STEP) - step(M, M.dir) if(lube&SLIDE) for(var/i=1, i<5, i++) spawn (i) - step(M, M.dir) + step(M, olddir) + M.spin(1,1) if(M.lying) //did I fall over? M.adjustBruteLoss(2) if(O) @@ -385,7 +387,5 @@ else M << "You slipped!" playsound(M.loc, 'sound/misc/slip.ogg', 50, 1, -3) - M.Stun(s_amount) - M.Weaken(w_amount) return 1 - return 0 // no success. Used in clown pda and wet floors + return 0 // no success. Used in clown pda and wet floors \ No newline at end of file diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index c58542f7b6a..ec32f437b12 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -16,9 +16,9 @@ else //if(lying != 0) if(lying_prev == 0) //Standing to lying final_pixel_y -= 6 + if(dir & (EAST|WEST)) //Facing east or west + final_dir = pick(NORTH, SOUTH) //So you fall on your side rather than your face or ass - if(dir & (EAST|WEST)) //Facing east or west - final_dir = pick(NORTH, SOUTH) //So you fall on your side rather than your face or ass lying_prev = lying //so we don't try to animate until there's been another change. if(changed) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a7acd1cdf83..f76998bda0c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -543,9 +543,11 @@ var/mob/living/carbon/CM = L if(CM.on_fire && CM.canmove) CM.fire_stacks -= 5 - CM.weakened = 5 + CM.Weaken(3) + CM.spin(32,2) CM.visible_message("[CM] rolls on the floor, trying to put themselves out!", \ "You stop, drop, and roll!") + sleep(30) if(fire_stacks <= 0) CM.visible_message("[CM] has successfully extinguished themselves!", \ "You extinguish yourself.") @@ -560,6 +562,23 @@ else cuff_resist(CM.legcuffed, CM) +/mob/living/carbon/proc/spin(spintime, speed) + spawn() + var/D = dir + while(spintime >= speed) + sleep(speed) + switch(D) + if(NORTH) + D = EAST + if(SOUTH) + D = WEST + if(EAST) + D = SOUTH + if(WEST) + D = NORTH + dir = D + spintime -= speed + return /mob/living/proc/get_visible_name() return name