Exemplo n.º 1
0
 public void consumePow1()
 {
     if (pow1.amount > 0)
     {
         pow1.amount--;
         cloneSpeel1--;
         questSpell.number++;
         questControllerUI.SaveQuest();
         powerUI.SaveData();
     }
 }
Exemplo n.º 2
0
    void gameOver()
    {
        if (trueDeath && secondChange == false)
        {
            battleUI.GameOver();
            loser = true;
            QuestController.SaveQuest();
            //StartCoroutine(DelayGameOver());
        }

        if (trueDeath && secondChange)
        {
            battleUI.GameOver2();
            loser = true;
            QuestController.SaveQuest();
            //StartCoroutine(DelayGameOver());
        }
    }
Exemplo n.º 3
0
    public void TurnWheel()
    {
        // Player has enough money to turn the wheel
        if (CurrentCoinsAmount >= TurnCost)
        {
            if (quest.number < 5)
            {
                quest.number++;
                questUI.SaveQuest();
            }

            _currentLerpRotationTime = 0f;

            // Fill the necessary angles (for example if you want to have 12 sectors you need to fill the angles with 30 degrees step)
            _sectorsAngles = new float[] { 45, 90, 135, 180, 225, 270, 315, 360 };

            if (nameGachapon != null)
            {
                audioManager.PlaySound(nameGachapon);
            }
            CoinsClone = 0;
            powerClone.Clear();
            imgRewards2.gameObject.SetActive(false);
            imgRewards3.gameObject.SetActive(false);
            ACReward.SetActive(false);
            calulateLoot();
            Debug.Log(TestAngle);

            int fullCircles = 5;
            //float randomFinalAngle = _sectorsAngles[UnityEngine.Random.Range(0, _sectorsAngles.Length)];
            //Debug.Log(randomFinalAngle);
            float randomFinalAngle = TestAngle;
            Debug.Log(randomFinalAngle);

            // Here we set up how many circles our wheel should rotate before stop
            _finalAngle = -(fullCircles * 360 + randomFinalAngle);
            _isStarted  = true;

            PreviousCoinsAmount = CurrentCoinsAmount;

            // Decrease money for the turn
            CurrentCoinsAmount -= TurnCost;

            // Show wasted coins
            if (CoinsDeltaText)
            {
                CoinsDeltaText.text = "-" + TurnCost;
                CoinsDeltaText.gameObject.SetActive(true);
            }

            // Animate coins
            StartCoroutine(HideCoinsDelta());
            StartCoroutine(UpdateCoinsAmount());

            Activel.gameObject.SetActive(false);
        }
    }
Exemplo n.º 4
0
 public void ClaimQuest()
 {
     if (quest.number >= quest.numberMax)
     {
         QuestUI.coins.Add(quest.present);
         quest.checkReceived = true;
         process.SetActive(false);
         Claim.SetActive(false);
         QuestUI.SaveQuest();
     }
 }