Esempio n. 1
0
    public static void StartBattle(BattleScreenPrefab battleScreen)
    {
        foreach (var character in state.AllyUnitsInBattle)
        {
            foreach (var perk in character.Perks)
            {
                perk.PerformAtBeginningOfCombat(character);
            }
        }

        state.EnemyUnitsInBattle.ForEach((item) => item.CurrentIntents = item.GetNextIntents());
        // First, we kick off the player's turn.
    }
    public void Start()
    {
        INSTANCE = this;
        SelectCardInHandOverlay.Hide();
        ShowDeckScreen.Hide();

        GameObject.FindObjectOfType <UtilityObjectHolder>().Start();

        PotentialBattleEntityEnemySpots      = EnemyUnitSpotsParent.GetComponentsInChildren <BattleUnitPrefab>().ToList();
        PotentialBattleEntityAllySpots       = AllyUnitSpotsParent.GetComponentsInChildren <BattleUnitPrefab>().ToList();
        PotentialBattleEntityLargeEnemySpots = LargeEnemyUnitSpotsParent.GetComponentsInChildren <BattleUnitPrefab>().ToList();
        PotentialBattleEntityHugeEnemySpots  = HugeEnemyUnitSpotsParent.GetComponentsInChildren <BattleUnitPrefab>().ToList();

        state.Deck = new BattleDeck();
        foreach (var character in state.AllyUnitsInBattle)
        {
            character.InitForBattle();
            foreach (var card in character.BattleDeck)
            {
                state.Deck.AddNewCardToDiscardPile(card.CopyCard(logicallyIdenticalToExistingCard: true));
            }
        }

        action.DrawCards(5);

        /// END TODO
        Setup(ServiceLocator.GameState().EnemyUnitsInBattle, ServiceLocator.GameState().AllyUnitsInBattle);

        PotentialBattleEntityAllySpots.ForEach(item => item.HideOrShowAsAppropriate());
        PotentialBattleEntityEnemySpots.ForEach(item => item.HideOrShowAsAppropriate());
        PotentialBattleEntityLargeEnemySpots.ForEach(item => item.HideOrShowAsAppropriate());
        PotentialBattleEntityHugeEnemySpots.ForEach(item => item.HideOrShowAsAppropriate());

        state.EnemyUnitsInBattle.ForEach(item => item.InitForBattle());
        state.AllyUnitsInBattle.ForEach(item => item.InitForBattle());


        BattleStarter.StartBattle(this);
    }
 public void Awake()
 {
     EagerMonobehaviour.InitializeAllEagerMonobehaviours();
     INSTANCE = this;
 }