public override int WalkTo(int targetX, int targetY) { RbyMap map = Map; RbyTile current = map[XCoord, YCoord]; RbyTile target = map[targetX, targetY]; RbyWarp warp = map.Warps[XCoord, YCoord]; bool original = false; if (warp != null) { original = warp.Allowed; warp.Allowed = true; } List <Action> path = Pathfinding.FindPath(map, current, 17, map.Tileset.LandPermissions, target); if (warp != null) { warp.Allowed = original; } return(Execute(path.ToArray())); }
public void CutAt(RbyTile target, Action preferredDirection = Action.None) { MoveTo(target, preferredDirection); Cut(); }
public void PickupItemAt(RbyTile target, Action preferredDirection = Action.None) { MoveTo(target, preferredDirection, target); PickupItem(); }
public void TalkTo(RbyTile target, Action preferredDirection = Action.None, Joypad holdButton = Joypad.None) { MoveTo(target, preferredDirection); Press(Joypad.A); ClearText(holdButton); }
public int MoveTo(RbyTile target, Action preferredDirection = Action.None, params RbyTile[] additionallyBlockedTiles) { List <Action> path = Pathfinding.FindPath <RbyMap, RbyTile>(this, Tile, target, preferredDirection, additionallyBlockedTiles); return(Execute(path.ToArray())); }