protected override ActorActionResult OnPerform(Actor user, Entity targetEntity, Vector2Int targetTile) { Vector2Int delta = MapUtils.To4Dir(targetTile - user.Entity.Cell); Vector2Int cell = user.Entity.Cell + delta; if (user.CanOccupy(cell)) { user.Entity.Position += delta; } return(null); }
public override ActorActionResult TakeTurn() { var move = GetAbility(AbilitySignature.Move); if (target != null && move != null) { if (MapUtils.IsNeighborCells(target.Entity.Cell, Entity.Cell) == false) { var dir = target.Entity.Cell - Entity.Cell; var delta = MapUtils.To4Dir(dir); return(move.Perform(this, Entity.Cell + delta)); } } return(null); }