Пример #1
0
    public override void Die()
    {
        RemoveEnemyFromList();
        invincible = true;
        Pawn pawn = PawnGenerator.GenerateCrystalDrop(level);

        if (BattleSceneManager.instance != null)
        {
            BattleSceneManager.instance.AddPawn(pawn);
        }
        StartCoroutine(DieRoutine());
    }
Пример #2
0
    public void SoulsGacha()
    {
        List <Pawn> acquiredPawns      = new List <Pawn>();
        int         level              = 5;     // The overall level of the gacha (determines the levels of the heroes dropped)
        int         numPawnsToGenerate = 1;     // Guaranteed 1 pawn to drop, maximum of 5 pawns to drop

        print("Got " + numPawnsToGenerate + " new pawns");
        level -= (int)Mathf.Sqrt(numPawnsToGenerate);           // scale the level by the number of pawns dropped
        for (int i = 0; i < numPawnsToGenerate; i++)
        {
            acquiredPawns.Add(PawnGenerator.GenerateCrystalDrop(level));
        }
        foreach (Pawn pawn in acquiredPawns)
        {
            gm.saveGame.pawnWallet.AddPawn(pawn);
        }
        acquirePawnsView.Init(acquiredPawns.ToArray());
    }
Пример #3
0
 private IEnumerator ClaimRewardsRoutine()
 {
     if (currentNumRewards > 0)
     {
         heroesRescuedMenu.Reset();
         // Play a dialogue and wait for it to finish
         dialogueView.Init(dialogueSuccess);
         while (dialogueView.dialoguePlaying)
         {
             yield return(null);
         }
         // Get rewards
         List <Pawn> rewards = new List <Pawn>();
         for (int i = 0; i < currentNumRewards; i++)
         {
             Pawn p = PawnGenerator.GenerateCrystalDrop(1);
             saveGame.pawnWallet.AddPawn(p);
             rewards.Add(p);
         }
         // View the rewards in the heroesRescuedMenu
         heroesRescuedMenu.gameObject.SetActive(true);
         heroesRescuedMenu.Init(rewards);
         // Reset the timer and the number of rewards
         if (timerCounter.GetTimer(TIMER_KEY).time <= 0)
         {
             timeUntilNextReward = REWARD_INTERVAL;
             ResetTimer();
         }
         currentNumRewards = 0;
     }
     else
     {
         dialogueView.Init(dialogueFailure);
     }
     yield return(null);
 }