Ejemplo n.º 1
0
 public void RegisterBuildBalloon()
 {
     Debug.Log("Register build balloon and selected tile is " + selectedTile);
     if (actionPointsThisTurn - apToBuildBalloon < 0)
     {
         Debug.Log("Not enough AP");
         return;
     }
     if (selectedTile.PlaceObjectOnThisTile(balloonPrefab, tc.GetActivePlayer()) == false)
     {
         // Don't do the stuff
     }
     else
     {
         PlayerController p       = tc.GetActivePlayer();
         List <GameTile>  newLand = selectedTile.CalculateOwnership(p);
         p.AddLandToList(newLand);
         if (p.GetName() == "First")
         {
             selectedTile.transform.GetChild(0).GetComponent <SpriteRenderer>().color = Color.red;
         }
         else
         {
             selectedTile.transform.GetChild(0).GetComponent <SpriteRenderer>().color = Color.blue;
         }
         SubtractAP(apToBuildBalloon);
         am.Play("placeSFX");
     }
 }
Ejemplo n.º 2
0
    public void RegisterBuildBridge()
    {
        if (actionPointsThisTurn - apToBuildBridge < 0)
        {
            Debug.Log("Not enough AP");
            return;
        }
        bool passed = li.PlaceBridgeAtPosition(ToTileCoords(selectedPosition));

        if (passed)
        {
            List <GameTile> tempList = new List <GameTile>();
            GameTile        gt       = li.GetTileAtPosition(selectedPosition);
            // Debug.Log(gt.GetOccupyingObjectType());
            PlayerController p = tc.GetActivePlayer();
            tempList = gt.CalculateOwnership(p, true);
            // tempList.Add(selectedTile);
            p.AddLandToList(tempList);
            SubtractAP(apToBuildBridge);
            am.Play("bridgeSFX");
        }
        else
        {
            //Don't do the stuff.
            Debug.Log("Bridge building failed due to some issue with position.");
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// Instantiates the level.
    /// </summary>
    void InstantiateLevel(int player)
    {
        // tileMap = (GameObject)Instantiate(tileMapPrefab);
        // tileMap.transform.SetParent(this.transform);
        GameTile         g = (player == 1) ? p1StartCell : p2StartCell;
        PlayerController p = turnController.GetSpecificPlayer(player);

        g.PlaceObjectOnThisTile(am.balloonPrefab, p, true);
        List <GameTile> gl = g.CalculateOwnership(p);

        Debug.Log(gl.Count);
        p.AddLandToList(gl);
    }