Beispiel #1
0
    void Start()
    {
        MakeItASingleton();
        battleground = GetComponent <Battleground> ();
        GameManager gameManager = GameManager.getInstance();

        battleground.ClearAndSetASide(gameManager.getPlayerCharacters());
        battleground.ClearAndSetASide(gameManager.getEnemiesAtFloor(dungeonFloor));
        foreach (Character hero in battleground.getHeroSide())
        {
            if (hero != null)
            {
                initiativeOrder.Add(hero);
            }
        }
        foreach (Character enemy in battleground.getEnemySide())
        {
            if (enemy != null)
            {
                initiativeOrder.Add(enemy);
            }
        }
        foreach (Character character in initiativeOrder)
        {
            character.PrepareForFirstBattle();
        }
        battleground.ShowCharactersToThePlayer();
        round = 0;
        TryToStartTurn();
    }
Beispiel #2
0
    void EndBattleAndCheckIfDungeonEnded()
    {
        dungeonFloor++;
        GameManager gameManager = GameManager.getInstance();

        if (dungeonFloor < gameManager.getSelectedQuest().getCurrentDungeon().getBattleGroups().Count)
        {
            battleground.ClearAndSetASide(gameManager.getEnemiesDelayedAtFloor(dungeonFloor));
            battleground.ShowCharactersToThePlayer();
            initiativeOrder.RemoveAt(0);
            round++;
            TryToStartTurn();
        }
        else
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
        }
    }