コード例 #1
0
ファイル: RbyExecution.cs プロジェクト: avatar00000/pokemon
    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()));
    }
コード例 #2
0
ファイル: RbyForce.cs プロジェクト: stringflow/pokemon
 public void CutAt(RbyTile target, Action preferredDirection = Action.None)
 {
     MoveTo(target, preferredDirection);
     Cut();
 }
コード例 #3
0
ファイル: RbyForce.cs プロジェクト: stringflow/pokemon
 public void PickupItemAt(RbyTile target, Action preferredDirection = Action.None)
 {
     MoveTo(target, preferredDirection, target);
     PickupItem();
 }
コード例 #4
0
ファイル: RbyForce.cs プロジェクト: stringflow/pokemon
 public void TalkTo(RbyTile target, Action preferredDirection = Action.None, Joypad holdButton = Joypad.None)
 {
     MoveTo(target, preferredDirection);
     Press(Joypad.A);
     ClearText(holdButton);
 }
コード例 #5
0
ファイル: RbyForce.cs プロジェクト: stringflow/pokemon
    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()));
    }