package Fx2Entity import public Entity import public Fx2 import Assets public constant DEFAULT_FX = Abilities.arrowMissile1 abstract public class Fx2Entity extends Entity protected Fx2 fx var silent = false construct(player owner, vec3 pos, real radius, angle xyAngle, string sfxpath) super(owner, pos, radius) setupFx(xyAngle, sfxpath) construct(player owner, vec3 pos, angle xyAngle, string sfxpath) super(owner, pos, radius) setupFx(xyAngle, sfxpath) construct(vec3 pos, player owner) super(owner, pos, 0.) setupFx(angle(0), DEFAULT_FX) private function setupFx(angle xyAngle, string sfxpath) fx = new Fx2(pos, sfxpath) fx.setOrientation(xyAngle.toQuat(vec3(0, 0, 1))) override function update() if pos.inPlayable() super.update() fx.eff.setPos(pos) else terminate() function setFx(string sfxpath) fx.eff.destr() fx.eff = addEffect(sfxpath, pos) override function setPos(vec3 tpos) pos = tpos fx.eff.setPos(tpos) override function setXY(vec3 tpos) pos = tpos fx.eff.setPos(tpos) ondestroy if silent fx.eff.setAlpha(0) fx.eff.setPos(boundMax) destroy fx