コード例 #1
0
    public void AttemptPlayCardFromHand(AbstractCard logicalCard, AbstractBattleUnit target, QueueingType queueingType = QueueingType.TO_BACK
                                        )
    {
        QueuedActions.DelayedActionWithCustomTrigger("Attempt play card from hand: " + logicalCard.Name, () =>
        {
            IsCurrentActionFinished = true;

            if (logicalCard != null)
            {
                if (!logicalCard.CanPlay(target).Playable)
                {
                    Shout(logicalCard.Owner, logicalCard.CanPlay(target).ReasonUnplayable);
                }
                else
                {
                    RunCardEvocationSpecialEffects(logicalCard, target);
                    logicalCard.PlayCardFromHandIfAble_Action(target);
                }
            }
            else
            {
                throw new System.Exception("Could not deploy card!  None selected.");
            }
            CheckIsBattleOver();
        }, queueingType);
    }
コード例 #2
0
 public void EvokeCardEffect(AbstractCard card, AbstractBattleUnit target, QueueingType queuingType = QueueingType.TO_BACK)
 {
     QueuedActions.DelayedActionWithCustomTrigger("Evoke card effect", () =>
     {
         RunCardEvocationSpecialEffects(card, target);
         card.EvokeCardEffect(target);
     }
                                                  );
 }
コード例 #3
0
    // I should probably stop using the action manager for campaign actions
    public void PromptCardReward(AbstractBattleUnit soldier)
    {
        var soldierClass = soldier.SoldierClass;

        soldier.NumberCardRewardsEligibleFor--;

        var cardsThatCanBeSelected = soldierClass.GetCardRewardChoices();

        QueuedActions.DelayedActionWithCustomTrigger("Choose New Card For Deck", () => {
            CardRewardScreen.Instance.Show(cardsThatCanBeSelected, soldier);
        });
    }
コード例 #4
0
 public void ExhaustCard(AbstractCard protoCard, QueueingType queueingType = QueueingType.TO_BACK)
 {
     QueuedActions.DelayedActionWithCustomTrigger("ExhaustCard", () => {
         gameState.Deck.MoveCardToPile(protoCard, CardPosition.EXPENDED);
         ServiceLocator.GetCardAnimationManager().DisappearCard(protoCard, assumedToExistInHand: false, callbackWhenFinished: () =>
         {
             IsCurrentActionFinished = true;
         });
         BattleRules.TriggerProc(new ExhaustedCardProc {
             TriggeringCardIfAny = protoCard
         });
     }, queueingType);
 }
コード例 #5
0
 public void AttackUnitForDamage(AbstractBattleUnit targetUnit, AbstractBattleUnit sourceUnit, int baseDamageDealt, AbstractCard cardPlayed)
 {
     Require.NotNull(targetUnit);
     QueuedActions.DelayedActionWithCustomTrigger("AttackUnitForDamage_ShakeUnit", () => {
         if (targetUnit.IsDead || sourceUnit.IsDead)
         {
             // do nothing if it's already dead
             IsCurrentActionFinished = true;
             return;
         }
         targetUnit.CorrespondingPrefab.gameObject.AddComponent <ShakePrefab>();
         var shakePrefab = targetUnit.CorrespondingPrefab.gameObject.GetComponent <ShakePrefab>();
         shakePrefab.Begin(() => { IsCurrentActionFinished = true; });
         targetUnit.CorrespondingPrefab.FlickerFeedbacks.PlayFeedbacks();
         BattleRules.ProcessDamageWithCalculatedModifiers(sourceUnit, targetUnit, cardPlayed, baseDamageDealt);
     });
 }
コード例 #6
0
    public void DamageUnitNonAttack(AbstractBattleUnit targetUnit, AbstractBattleUnit nullableSourceUnit, int baseDamageDealt)
    {
        if (targetUnit == null)
        {
            return;
        }
        QueuedActions.DelayedActionWithCustomTrigger("DamageUnitNonAttack_ShakeUnit", () => {
            if (targetUnit.IsDead)
            {
                // do nothing if it's already dead
                IsCurrentActionFinished = true;
                return;
            }
            targetUnit.CorrespondingPrefab.gameObject.AddComponent <ShakePrefab>();
            var shakePrefab = targetUnit.CorrespondingPrefab.gameObject.GetComponent <ShakePrefab>();
            shakePrefab.Begin(() => { IsCurrentActionFinished = true; });
            targetUnit.CorrespondingPrefab.FlickerFeedbacks.PlayFeedbacks();

            BattleRules.ProcessDamageWithCalculatedModifiers(nullableSourceUnit, targetUnit,
                                                             nullableCardPlayed: null,
                                                             baseDamage: baseDamageDealt,
                                                             isAttack: false);
        });
    }
コード例 #7
0
 public void AddToBack(BasicDelayedAction action)
 {
     QueuedActions.DelayedActionWithCustomTrigger(action.ActionId, action.onStart, queueingType: QueueingType.TO_BACK);
 }
コード例 #8
0
 public void AddToFront(BasicDelayedAction action)
 {
     QueuedActions.DelayedActionWithCustomTrigger(action.ActionId, action.onStart, queueingType: QueueingType.TO_FRONT);
 }