Makes the sprite of a mob bob up and down while it is in space, unless it is wearing magboots.

This commit is contained in:
RavingManiac
2012-10-03 23:03:17 +08:00
parent 8814c2f529
commit e558f1f0f1
3 changed files with 34 additions and 0 deletions
+26
View File
@@ -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()
..()
+2
View File
@@ -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
+6
View File
@@ -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++