public void RegisterFireAction()
    {
        Debug.Log("Fire action registered");
        if (actionPointsThisTurn - apToFireCannon < 0)
        {
            Debug.Log("Not enough AP!");
            return;
        }
        GameTile            targetTile = SelectTile(selectedPosition);
        PlaceableObjectType t          = targetTile.GetOccupyingObjectType();

        if (t == PlaceableObjectType.BALLOON)
        {
            Debug.Log("That's a valid thing to destroy");
            targetTile.RemoveObjectOnThisTile();
            PlayerController p        = targetTile.myOwner;
            List <GameTile>  toRemove = targetTile.RevokeOwnership(tc.GetActivePlayer());

            p.RemoveFromLandList(toRemove);
            SubtractAP(apToFireCannon);
            am.Play("fireSFX");
        }
        else
        {
            Debug.Log("That's not a balloon");
        }
    }
 void CheckValidBuildOptions()
 {
     ui.canBalloon = li.CheckValidBalloonPosition(selectedPosition);
     ui.canCannon  = ui.canBalloon;
     ui.canBridge  = li.CheckValidBridgePosition(selectedPosition);
     ui.canFire    = (selectedTile == null) ? false : selectedTile.GetOccupyingObjectType() == PlaceableObjectType.CANNON;
 }
示例#3
0
    /// <summary>
    /// Checks if the tile is empty.
    /// </summary>
    /// <param name="pos"></param>
    /// <returns></returns>
    public bool CheckValidBalloonPosition(Vector3 pos)
    {
        GameTile t = GetTileAtPosition(pos);

        if (t == null)
        {
            return(false);
        }
        else
        {
            if (t.GetOccupyingObjectType() == PlaceableObjectType.NULL)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
    }