diff --git a/core/src/com/riiablo/engine/server/Actioneer.java b/core/src/com/riiablo/engine/server/Actioneer.java index d5bb41ad..9a98a78f 100644 --- a/core/src/com/riiablo/engine/server/Actioneer.java +++ b/core/src/com/riiablo/engine/server/Actioneer.java @@ -12,9 +12,11 @@ import com.badlogic.gdx.math.Vector2; import com.riiablo.Riiablo; import com.riiablo.codec.excel.Skills; import com.riiablo.engine.Engine; +import com.riiablo.engine.server.component.Box2DBody; import com.riiablo.engine.server.component.Casting; import com.riiablo.engine.server.component.Class; import com.riiablo.engine.server.component.MovementModes; +import com.riiablo.engine.server.component.Position; import com.riiablo.engine.server.component.Sequence; import com.riiablo.engine.server.event.AnimDataFinishedEvent; import com.riiablo.engine.server.event.AnimDataKeyframeEvent; @@ -29,6 +31,10 @@ public class Actioneer extends PassiveSystem { protected ComponentMapper mMovementModes; protected ComponentMapper mCasting; + // teleport-specific components + protected ComponentMapper mPosition; + protected ComponentMapper mBox2DBody; + protected EventSystem events; public void cast(int entityId, int skillId, Vector2 target) { @@ -92,6 +98,11 @@ public class Actioneer extends PassiveSystem { break; case 1: // attack break; + case 27: // teleport + mPosition.get(entityId).position.set(target); + Box2DBody box2dWrapper = mBox2DBody.get(entityId); + if (box2dWrapper != null) box2dWrapper.body.setTransform(target, 0); + break; default: log.warn("Unsupported srvdofunc({}) for {}", srvdofunc, entityId); // TODO: default case will log an error when all valid cases are enumerated