#define DamageText(target,damage) new/effect/damage(target.loc,target,damage)
effect
parent_type = /atom/movable
damage
maptext_width = 128
maptext_height = 16
mouse_opacity = 0
layer = EFFECT_LAYER
New(Loc,mob/ref,damage,mob/source)
..()
//loc = ref.loc
step_x = ref.step_x
step_y = ref.step_y
maptext = {"<span class="damage">[damage]</span>"}
pixel_x = -(128-ref.icon_width)/2
var/image/i1
var/image/i2
if(ismob(ref)&&ref.client)
i1 = new()
i1.override = 1
i1.maptext = {"<span class="incomingdamage">[damage]</span>"}
i1.loc = src
ref.client << i1
if(ismob(source)&&source.client)
i2 = new()
i2.override = 1
i2.maptext = {"<span class="outgoingdamage">[damage]</span>"}
i2.loc = src
source.client << i2
var/ox = rand(-16,16)
animate(src,pixel_x=pixel_x,pixel_y=0,alpha=255,time=0)
animate(pixel_x=pixel_x+ox*0.25,pixel_y=16,alpha=255,time=2.5)
animate(pixel_x=pixel_x+ox*0.5,pixel_y=32,alpha=196,time=2.5)
animate(pixel_x=pixel_x+ox,pixel_y=48,alpha=128,time=2.5)
animate(pixel_x=pixel_x+ox*2,pixel_y=64,alpha=0,time=2.5)
spawn(10)
loc = null
if(i1&&ref.client)
ref.client.images -= i1
if(i2&&source.client)
source.client.images -= i2
Problem description:
When I apply this animation to the damage object, the object disappears for several frames and then reappears. Something is going wrong with animate(), and I'm not sure what's causing it. Anyone got any tips before I bug report this one?