Exemple #1
0
 private void OnRepair3(InputValue val)
 {
     if (potToRepair != null)
     {
         PotSpotController potSpot = potToRepair.GetComponent <PotSpotController>();
         potSpot.Craft(PotType.Type3, player.playerIndex);
         checkScore(potSpot.type);
     }
 }
Exemple #2
0
    public void recalculateScore(PotType nextTrending)
    {
        IntVariable myScore = scores[player.playerIndex];

        for (int i = 0; i < pots.Length; i++)
        {
            PotSpotController pot = pots[i].GetComponent <PotSpotController>();
            if (player.playerIndex == (int)pot.owner && pot.type == nextTrending)
            {
                myScore.value++;
            }
        }
    }
Exemple #3
0
    public void GetPlayerScore(PotType potInTrend)
    {
        int score = 0;

        for (int i = 0; i < pots.Length; i++)
        {
            PotSpotController pot = pots[i].GetComponent <PotSpotController>();
            if (player.playerIndex == (int)pot.owner && pot.type == potInTrend)
            {
                score++;
            }
        }
        totals[player.playerIndex].value = score;
        resetScores();
    }
Exemple #4
0
 private void OnBreak(InputValue val)
 {
     if (potToDestroy != null)
     {
         PotSpotController potSpot = potToDestroy.GetComponent <PotSpotController>();
         for (int i = 0; i < players.Length; i++)
         {
             int playerIndex = players[i].GetComponent <Player>().playerIndex;
             if (playerIndex == (int)potSpot.owner && potSpot.type == (PotType)trendingIndex.value)
             {
                 scores[playerIndex].value--;
             }
         }
         potSpot.Hit();
     }
 }