Floating effect now uses animate() instead of pixel_y while loop thingy.

Distinct actions that indefinitely change a mob's pixel_y or pixel_x, like strapping someone to a roller bed, should also alter new variables old_y or old_x accordingly. This means that floating and jittering animations no longer interfere, as the animations use old_x/old_y as the "base" position.

Entering areas with gravity from areas without grabity now removes floating effect.
This commit is contained in:
RavingManiac
2014-09-30 22:37:48 +08:00
parent 918520df83
commit c4875e7d36
6 changed files with 42 additions and 17 deletions
@@ -16,6 +16,7 @@
"<span class='notice'>[user.name] pulls you free from the gelatinous resin.</span>",\
"<span class='notice'>You hear squelching...</span>")
buckled_mob.pixel_y = 0
buckled_mob.old_y = 0
unbuckle()
else
buckled_mob.visible_message(\
@@ -25,6 +26,7 @@
spawn(1200)
if(user && buckled_mob && user.buckled == src)
buckled_mob.pixel_y = 0
buckled_mob.old_y = 0
unbuckle()
src.add_fingerprint(user)
return
@@ -52,6 +54,7 @@
M.dir = src.dir
M.update_canmove()
M.pixel_y = 6
M.old_y = 6
src.buckled_mob = M
src.add_fingerprint(user)
return
@@ -195,6 +195,7 @@
if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || user.lying || user.stat || M.buckled || istype(usr, /mob/living/silicon/pai) )
return
M.pixel_y = 6
M.old_y = 6
density = 1
icon_state = "up"
..()
@@ -204,6 +205,7 @@
if(buckled_mob)
if(buckled_mob.buckled == src) //this is probably unneccesary, but it doesn't hurt
buckled_mob.pixel_y = 0
buckled_mob.old_y = 0
buckled_mob.anchored = initial(buckled_mob.anchored)
buckled_mob.buckled = null
buckled_mob.update_canmove()