コード例 #1
0
    public CardSelectionFuture PromptDiscardOfSingleCard()
    {
        var future = new CardSelectionFuture();

        QueuedActions.DelayedActionWithFinishTrigger("Discard Prompt",
                                                     // starting action
                                                     () =>
        {
            if (GameState.Instance.Deck.Hand.Count == 0)
            {
                return;
            }
            SelectCardInHandOverlay.ShowPromptForCardSelection(new DiscardCardsBehavior(), future);
        },
                                                     // finish trigger
                                                     () =>
        {
            return(future.IsReady);
        });
        return(future);
    }
コード例 #2
0
    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);
    }