diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index f236e08a48b..9cdd4bec893 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -649,6 +649,9 @@ note dizziness decrements automatically in the mob's Life() proc. // Typo from the oriignal coder here, below lies the jitteriness process. So make of his code what you will, the previous comment here was just a copypaste of the above. /mob/proc/jittery_process() + + if (is_floaty) return + var/old_x = pixel_x var/old_y = pixel_y is_jittery = 1 @@ -667,6 +670,29 @@ note dizziness decrements automatically in the mob's Life() proc. pixel_x = old_x pixel_y = old_y +//Floaty - Makes the mob sprite bob up and down. Also a copypaste of dizziness + +/mob/proc/make_floaty() + if(floatiness && !is_floaty) + spawn(0) + floaty_process() + +/mob/proc/floaty_process() + + if (is_jittery) return + + var/old_x = pixel_x + var/old_y = pixel_y + is_floaty = 1 + while(floatiness) + pixel_y = 3 * cos(7 * world.time) //May need some tweaking + + sleep(1) + //endwhile - reset the pixel offsets to zero + is_floaty = 0 + pixel_x = old_x + pixel_y = old_y + /mob/Stat() ..() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index be8d9c066cd..71217a2fdf3 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -94,6 +94,8 @@ var/dizziness = 0//Carbon var/is_dizzy = 0 var/is_jittery = 0 + var/is_floaty = 0 + var/floatiness = 0 var/jitteriness = 0//Carbon var/charges = 0.0 var/nutrition = 400.0//Carbon diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 8c79d4db9ce..c5d2b8527c3 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -314,6 +314,8 @@ if((istype(mob.loc, /turf/space)) || (mob.lastarea.has_gravity == 0)) if(!mob.Process_Spacemove(0)) return 0 + else + mob.floatiness = 0 if(isobj(mob.loc) || ismob(mob.loc))//Inside an object, tell it we moved @@ -516,6 +518,10 @@ dense_object++ break + //Makes the mob floaty + src.floatiness = 1 + src.make_floaty() + if(!dense_object && (locate(/obj/structure/lattice) in oview(1, src))) dense_object++