Example #1
0
        public override IEnumerator ApplyEffect(
            CardEffectState cardEffectState,
            CardEffectParams cardEffectParams)
        {
            int damageAmount = this.GetDamageAmount(cardEffectState);

            if (cardEffectState.GetTargetMode() == TargetMode.Room)
            {
                cardEffectParams.combatManager.IgnoreDuplicateSounds(true);
            }
            for (int i = 0; i < cardEffectParams.targets.Count; ++i)
            {
                CharacterState target = cardEffectParams.targets[i];

                yield return((object)cardEffectParams.combatManager.ApplyDamageToTarget(damageAmount, target, new CombatManager.ApplyDamageToTargetParameters()
                {
                    playedCard = cardEffectParams.playedCard,
                    finalEffectInSequence = cardEffectParams.finalEffectInSequence,
                    relicState = cardEffectParams.sourceRelic,
                    selfTarget = cardEffectParams.selfTarget,
                    vfxAtLoc = cardEffectState.GetAppliedVFX(),
                    showDamageVfx = cardEffectParams.allowPlayingDamageVfx
                }));
            }
            cardEffectParams.combatManager.IgnoreDuplicateSounds(false);
        }
        public override void AddDelegate(CardEffectState cardEffectState,
                                         CardEffectParams cardEffectParams,
                                         DeckScreen deckScreen)
        {
            deckScreen.AddDeckScreenCardStateChosenDelegate((DeckScreen.CardStateChosenDelegate)(chosenCardState =>
            {
                CardUpgradeState cardUpgradeState = new CardUpgradeState();
                cardUpgradeState.Setup(cardEffectState.GetParamCardUpgradeData());

                foreach (CardUpgradeMaskData filter in cardUpgradeState.GetFilters())
                {
                    if (!filter.FilterCard(chosenCardState, cardEffectParams.relicManager))
                    {
                        // If any of the filters matches, it doesn't get upgraded
                        return;
                    }
                }

                if (chosenCardState.GetCardType() == CardType.Monster)
                {
                    chosenCardState.GetTemporaryCardStateModifiers().AddUpgrade(cardUpgradeState);
                }
                if (chosenCardState.GetCardType() == CardType.Spell)
                {
                    chosenCardState.AddTemporaryTrait(new CardTraitDataBuilder {
                        TraitStateType = typeof(CardTraitPyreboost)
                    }.Build(), cardEffectParams.cardManager);
                }

                chosenCardState.UpdateCardBodyText();

                cardEffectParams.screenManager.SetScreenActive(ScreenName.Deck, false, (ScreenManager.ScreenActiveCallback)null);
            }));
        }
Example #3
0
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            ProviderManager.TryGetProvider <RoomManager>(out RoomManager roomManager);
            CharacterState target = roomManager.GetPyreRoom().GetPyreHeart();

            if (cardEffectParams.saveManager.PreviewMode)
            {
                yield break;
            }

            StatusEffectStackData statusEffectStack = GetStatusEffectStack(cardEffectState);

            if (statusEffectStack == null)
            {
                yield break;
            }
            int intInRange = cardEffectState.GetIntInRange();

            CharacterState.AddStatusEffectParams addStatusEffectParams = default(CharacterState.AddStatusEffectParams);
            addStatusEffectParams.sourceRelicState = cardEffectParams.sourceRelic;
            addStatusEffectParams.sourceCardState  = cardEffectParams.playedCard;
            addStatusEffectParams.cardManager      = cardEffectParams.cardManager;
            addStatusEffectParams.sourceIsHero     = (cardEffectState.GetSourceTeamType() == Team.Type.Heroes);
            CharacterState.AddStatusEffectParams addStatusEffectParams2 = addStatusEffectParams;

            RngId         rngId = cardEffectParams.saveManager.PreviewMode ? RngId.BattleTest : RngId.Battle;
            PlayerManager playerManager;

            ProviderManager.TryGetProvider <PlayerManager>(out playerManager);

            target.AddStatusEffect(statusEffectStack.statusId, playerManager.GetEnergy(), addStatusEffectParams2);
        }
        public override void AddDelegate(CardEffectState cardEffectState,
                                         CardEffectParams cardEffectParams,
                                         DeckScreen deckScreen)
        {
            deckScreen.AddDeckScreenCardStateChosenDelegate((DeckScreen.CardStateChosenDelegate)(chosenCardState =>
            {
                cardEffectParams.cardManager.MoveToStandByPile(chosenCardState, wasPlayed: false, wasExhausted: true, new RemoveFromStandByCondition(() => CardPile.ExhaustedPile), new CardManager.DiscardCardParams(), HandUI.DiscardEffect.Exhausted);

                var allTargets = new List <CharacterState>();
                cardEffectParams.heroManager.AddCharactersInRoomToList(allTargets, cardEffectParams.GetSelectedRoom().GetRoomIndex());

                if (allTargets.Count > 0)
                {
                    for (int i = 0; i < chosenCardState.GetCostWithoutAnyModifications(); i++)
                    {
                        cardEffectParams.combatManager.ApplyDamageToTarget(5, allTargets[0], new CombatManager.ApplyDamageToTargetParameters
                        {
                            damageType = Damage.Type.TowerHeart,
                            playedCard = cardEffectParams.playedCard,
                        });
                    }
                }
                cardEffectParams.screenManager.SetScreenActive(ScreenName.Deck, false, (ScreenManager.ScreenActiveCallback)null);
            }));
        }
Example #5
0
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            StatusEffectStackData statusEffectStack = GetStatusEffectStack(cardEffectState);

            if (statusEffectStack == null)
            {
                yield break;
            }
            if (statusEffectStack.statusId == Burnout)
            {
                if (cardEffectParams.targets[0].IsMiniboss() || cardEffectParams.targets[0].IsOuterTrainBoss())
                {
                    yield break;
                }
            }
            CharacterState.AddStatusEffectParams addStatusEffectParams = default(CharacterState.AddStatusEffectParams);
            addStatusEffectParams.sourceRelicState = cardEffectParams.sourceRelic;
            addStatusEffectParams.sourceCardState  = cardEffectParams.playedCard;
            addStatusEffectParams.cardManager      = cardEffectParams.cardManager;
            addStatusEffectParams.sourceIsHero     = (cardEffectState.GetSourceTeamType() == Team.Type.Heroes);
            CharacterState.AddStatusEffectParams addStatusEffectParams2 = addStatusEffectParams;
            for (int num = cardEffectParams.targets.Count - 1; num >= 0; num--)
            {
                CharacterState characterState = cardEffectParams.targets[num];
                int            count          = statusEffectStack.count;
                characterState.AddStatusEffect(statusEffectStack.statusId, count, addStatusEffectParams2);
            }
        }
Example #6
0
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            int       num             = 0;
            CardState parentCardState = cardEffectState.GetParentCardState();

            if (parentCardState != null)
            {
                CardTraitState.ApplyingHealParameters healParameters = default(CardTraitState.ApplyingHealParameters);
                healParameters.combatManager = cardEffectParams.combatManager;
                foreach (CardTraitState traitState in parentCardState.GetTraitStates())
                {
                    healParameters.healAmount = num;
                    num = traitState.OnApplyingTrainHeal(healParameters);
                }
            }
            num += cardEffectState.GetParamInt();
            PyreRoomState  pyreRoom       = cardEffectParams.roomManager.GetPyreRoom();
            CharacterState characterState = pyreRoom?.GetPyreHeart();

            if (characterState != null)
            {
                num = Mathf.Min(cardEffectParams.saveManager.GetMaxTowerHP() - cardEffectParams.playerManager.GetTowerHP(), num);
                characterState.GetCharacterUI().ApplyStateToUI(pyreRoom.GetPyreHeart(), cardEffectParams.popupNotificationManager, num, doingDamage: false);
            }
            cardEffectParams.playerManager.HealTowerHP(num);

            yield break;
        }
 public override bool TestEffect(
     CardEffectState cardEffectState,
     CardEffectParams cardEffectParams)
 {
     this.cardSelectionMode = cardEffectState.GetTargetCardSelectionMode();
     return(base.TestEffect(cardEffectState, cardEffectParams));
 }
Example #8
0
        public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            StatusEffectStackData statusEffectStack = GetStatusEffectStack(cardEffectState);

            if (statusEffectStack == null)
            {
                return(false);
            }
            if (cardEffectState.GetTargetMode() != TargetMode.DropTargetCharacter)
            {
                return(true);
            }
            if (cardEffectParams.targets.Count <= 0)
            {
                return(false);
            }
            if (cardEffectParams.statusEffectManager.GetStatusEffectDataById(statusEffectStack.statusId).IsStackable())
            {
                return(true);
            }
            ProviderManager.TryGetProvider <RoomManager>(out RoomManager roomManager);
            CharacterState target = roomManager.GetPyreRoom().GetPyreHeart();

            if (!target.HasStatusEffect(statusEffectStack.statusId))
            {
                return(true);
            }
            return(false);
        }
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            int intInRange = cardEffectState.GetIntInRange();

            CharacterState.AddStatusEffectParams addStatusEffectParams = default(CharacterState.AddStatusEffectParams);
            addStatusEffectParams.sourceRelicState = cardEffectParams.sourceRelic;
            addStatusEffectParams.sourceCardState  = cardEffectParams.playedCard;
            addStatusEffectParams.cardManager      = cardEffectParams.cardManager;
            addStatusEffectParams.sourceIsHero     = false;
            CharacterState.AddStatusEffectParams addStatusEffectParams2 = addStatusEffectParams;

            StatusEffectData.DisplayCategory buffOrDebuff = StatusEffectData.DisplayCategory.Negative;
            if (cardEffectState.GetParamBool())
            {
                buffOrDebuff = StatusEffectData.DisplayCategory.Positive;
            }

            foreach (CharacterState character in cardEffectParams.targets)
            {
                List <CharacterState.StatusEffectStack> statusEffectStacks;
                character.GetStatusEffects(out statusEffectStacks);

                foreach (var status in statusEffectStacks)
                {
                    if (status.State.GetDisplayCategory() == buffOrDebuff)
                    {
                        character.AddStatusEffect(status.State.GetStatusId(), 0, addStatusEffectParams2);
                    }
                }
            }
            yield break;
        }
Example #10
0
 public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
 {
     foreach (CharacterState target in cardEffectParams.targets)
     {
         return(TestEffectOnTarget(cardEffectState, cardEffectParams, target));
     }
     return(false);
 }
Example #11
0
 public string GetTipTooltipKey(CardEffectState cardEffectState)
 {
     if (cardEffectState.GetParamCardUpgradeData() != null && cardEffectState.GetParamCardUpgradeData().HasUnitStatUpgrade())
     {
         return("TipTooltip_StatChangesStick");
     }
     return(null);
 }
Example #12
0
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            target    = cardEffectParams.targets[0];
            addDamage = cardEffectState.GetParamInt();
            lastCap   = 0;

            yield break;
        }
Example #13
0
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            foreach (CharacterState target in cardEffectParams.targets)
            {
                if (!OnGainEmber.energyData.TryGetValue(target, out int addEnergy))
                {
                    addEnergy = 1;
                }

                CardUpgradeState upgradeState = new CardUpgradeState();
                upgradeState.Setup(cardEffectState.GetParamCardUpgradeData());

                // Tweak the CardUpgradeState's stats
                Traverse.Create(upgradeState).Field("attackDamage").SetValue(upgradeState.GetAttackDamage() * addEnergy);
                Traverse.Create(upgradeState).Field("additionalHP").SetValue(upgradeState.GetAdditionalHP() * addEnergy);

                if (cardEffectParams.playedCard != null)
                {
                    foreach (CardTraitState traitState in cardEffectParams.playedCard.GetTraitStates())
                    {
                        traitState.OnApplyingCardUpgradeToUnit(cardEffectParams.playedCard, target, upgradeState, cardEffectParams.cardManager);
                    }
                }
                int    attackDamage = upgradeState.GetAttackDamage();
                int    additionalHP = upgradeState.GetAdditionalHP();
                string text         = ((attackDamage != 0) ? GetAttackNotificationText(upgradeState) : null);
                string text2        = ((additionalHP != 0) ? GetHPNotificationText(upgradeState) : null);
                string text3        = string.Empty;
                if (text != null && text2 != null)
                {
                    text3 = string.Format("TextFormat_SpacedItems".Localize(), text, text2);
                }
                else if (text != null)
                {
                    text3 = text;
                }
                else if (text2 != null)
                {
                    text3 = text2;
                }
                if (text3 != null)
                {
                    NotifyHealthEffectTriggered(cardEffectParams.saveManager, cardEffectParams.popupNotificationManager, text3, target.GetCharacterUI());
                }
                yield return(target.ApplyCardUpgrade(upgradeState));

                CardState spawnerCard = target.GetSpawnerCard();
                bool      flag        = target.HasStatusEffect("cardless");
                if (spawnerCard != null && !cardEffectParams.saveManager.PreviewMode && !flag)
                {
                    CardAnimator.CardUpgradeAnimationInfo type = new CardAnimator.CardUpgradeAnimationInfo(spawnerCard, upgradeState);
                    CardAnimator.DoAddRecentCardUpgrade.Dispatch(type);
                    spawnerCard.GetTemporaryCardStateModifiers().AddUpgrade(upgradeState);
                    spawnerCard.UpdateCardBodyText();
                    cardEffectParams.cardManager?.RefreshCardInHand(spawnerCard);
                }
            }
        }
        public override bool TestEffect(
            CardEffectState cardEffectState,
            CardEffectParams cardEffectParams)
        {
            List <CardState> hand = cardEffectParams.cardManager.GetHand(true);

            CardEffectFreezeRandomCard.FilterCards(hand);
            return(hand.Count >= 0);
        }
Example #15
0
        private int GetDamageAmount(CardEffectState cardEffectState)
        {
            PlayerManager playerManager;

            ProviderManager.TryGetProvider <PlayerManager>(out playerManager);

            int num = cardEffectState.GetParamInt() * playerManager.GetEnergy();

            return(num);
        }
Example #16
0
        private int GetDamageAmount(CardEffectState cardEffectState)
        {
            PlayerManager playerManager;

            ProviderManager.TryGetProvider <PlayerManager>(out playerManager);

            int fibonacci = Fibonacci(playerManager.GetEnergy() + 1);

            return(cardEffectState.GetParamInt() + fibonacci);
        }
Example #17
0
        public override IEnumerator ApplyEffect(
            CardEffectState cardEffectState,
            CardEffectParams cardEffectParams)
        {
            int pyredamage = cardEffectParams.roomManager.GetPyreRoom().GetPyreHeart().GetAttackDamage();

            cardEffectParams.saveManager.pyreAttackChangedSignal.Dispatch(pyredamage, 1 + ((cardEffectParams.relicManager != null) ? cardEffectParams.relicManager.GetPyreStatusEffectCount("multistrike") : 0));

            yield break;
        }
 public override void AddDelegate(CardEffectState cardEffectState,
                                  CardEffectParams cardEffectParams,
                                  DeckScreen deckScreen)
 {
     deckScreen.AddDeckScreenCardStateChosenDelegate((DeckScreen.CardStateChosenDelegate)(chosenCardState =>
     {
         cardEffectParams.cardManager.MoveToStandByPile(chosenCardState, wasPlayed: false, wasExhausted: true, new RemoveFromStandByCondition(() => CardPile.ExhaustedPile), new CardManager.DiscardCardParams(), HandUI.DiscardEffect.Exhausted);
         cardEffectParams.screenManager.SetScreenActive(ScreenName.Deck, false, (ScreenManager.ScreenActiveCallback)null);
     }));
 }
Example #19
0
        public override IEnumerator ApplyEffect(
            CardEffectState cardEffectState,
            CardEffectParams cardEffectParams)
        {
            if (cardEffectState.SaveManager.PreviewMode)
            {
                yield break;
            }

            int       paramInt = cardEffectState.GetParamInt();
            string    wardType = cardEffectState.GetParamStr();
            WardState wardState;

            switch (wardType)
            {
            case "WardStateShifter":
                wardState       = new WardStateShifter();
                wardState.power = paramInt;
                break;

            case "WardStatePower":
                wardState       = new WardStatePower();
                wardState.power = paramInt;
                break;

            case "WardStatePyrebound":
                wardState       = new WardStatePyrebound();
                wardState.power = paramInt;
                break;

            case "WardStatePyreHarvest":
                wardState       = new WardStatePyreHarvest();
                wardState.power = paramInt;
                break;

            case "WardStateRandomDamage":
                wardState       = new WardStateRandomDamage();
                wardState.power = paramInt;
                break;

            default:
                yield break;
            }

            int roomIndex = cardEffectParams.selectedRoom;

            if (cardEffectState.GetParamBool())
            {
                WardManager.AddWardLater(wardState, roomIndex);
                yield break;
            }

            WardManager.AddWard(wardState, roomIndex);
            yield break;
        }
Example #20
0
        public bool WillEffectKillTarget(
            CharacterState target,
            CardState card,
            CardEffectState cardEffectState,
            out int resultantDamage)
        {
            int damageAmount = GetDamageAmount(cardEffectState);

            resultantDamage = target.GetDamageToTarget(damageAmount, (CharacterState)null, card, out int _, Damage.Type.Default);
            return(resultantDamage >= target.GetHP());
        }
Example #21
0
        public override string GetCardText(CardEffectState cardEffectState, RelicManager relicManager = null)
        {
            LocalizationUtil.GeneratedTextDisplay = LocalizationUtil.GeneratedTextDisplayType.Show;
            var status = GetStatusEffectStack(cardEffectState);

            if (status == null)
            {
                return("Apply a status dependent on your paired clan.<br><i>(See tooltips)</i>");
            }
            return("Apply " + StatusEffectManager.GetLocalizedName(status.statusId, status.count, true));
        }
 static void Postfix(CardEffectState effectState, List <CharacterState> targets, SpawnPoint dropLocation, SubtypeData targetSubtype)
 {
     if (BossTargetIgnoreFix.targetIgnoreBosses && effectState.GetTargetMode() == TargetMode.DropTargetCharacter && dropLocation != null)
     {
         CharacterState characterState = dropLocation.GetCharacterState();
         if (characterState.IsMiniboss() || characterState.IsOuterTrainBoss())
         {
             targets.Clear();
             // lastTargetedCharacters.Clear();
         }
     }
 }
 public override void AddDelegate(CardEffectState cardEffectState,
                                  CardEffectParams cardEffectParams,
                                  DeckScreen deckScreen)
 {
     deckScreen.AddDeckScreenCardStateChosenDelegate((DeckScreen.CardStateChosenDelegate)(chosenCardState =>
     {
         chosenCardState.AddTemporaryTrait(new CardTraitDataBuilder {
             TraitStateName = "CardTraitFreebie", ParamInt = -99
         }.Build(), cardEffectParams.cardManager);
         cardEffectParams.screenManager.SetScreenActive(ScreenName.Deck, false, (ScreenManager.ScreenActiveCallback)null);
     }));
 }
 public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
 {
     if (cardEffectState.GetTargetMode() != TargetMode.DropTargetCharacter)
     {
         return(true);
     }
     if (cardEffectParams.targets.Count <= 0)
     {
         return(false);
     }
     return(false);
 }
Example #25
0
        public override bool TestEffect(
            CardEffectState cardEffectState,
            CardEffectParams cardEffectParams)
        {
            int  intInRange = GetDamageAmount(cardEffectState);
            bool flag2      = true;

            if (cardEffectState.GetTargetMode() == TargetMode.DropTargetCharacter)
            {
                flag2 = cardEffectParams.targets.Count > 0;
            }
            return(intInRange >= 0 && flag2);
        }
 public virtual void AddDelegate(CardEffectState cardEffectState,
                                 CardEffectParams cardEffectParams,
                                 DeckScreen deckScreen)
 {
     deckScreen.AddDeckScreenCardStateChosenDelegate((DeckScreen.CardStateChosenDelegate)(chosenCardState =>
     {
         cardEffectParams.cardManager.DrawSpecificCard(chosenCardState, 0.0f, this.GetDrawSource(cardEffectState.GetTargetMode()), cardEffectParams.playedCard, 1, 1);
         chosenCardState.AddTemporaryTrait(new CardTraitDataBuilder {
             TraitStateName = "CardTraitExhaustState"
         }.Build(), cardEffectParams.cardManager);
         cardEffectParams.screenManager.SetScreenActive(ScreenName.Deck, false, (ScreenManager.ScreenActiveCallback)null);
     }));
 }
        public override string GetCardText(CardEffectState cardEffectState, RelicManager relicManager = null)
        {
            int damage = 0;

            try
            {
                damage = GetDamageAmount();
            }
            catch (System.Exception)
            {
            }
            return("Flashfire_EffectDesc".Localize(new LocalizedIntegers(damage)));
        }
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            owner            = cardEffectParams.targets[0];
            reflectDebuffs   = cardEffectState.GetParamBool();
            flatIncrease     = cardEffectState.GetParamInt();
            multiplyIncrease = cardEffectState.GetParamMultiplier();
            targeting        = cardEffectState.GetAdditionalParamInt();
            cardEffectState.SetShouldOverrideTriggerUI(true);

            instance = this;

            yield break;
        }
Example #29
0
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            int energy = cardEffectParams.playerManager.GetEnergy();

            foreach (var target in cardEffectParams.targets)
            {
                foreach (var status in cardEffectState.GetParamStatusEffectStackData())
                {
                    target.AddStatusEffect(status.statusId, status.count * energy);
                }
            }

            yield break;
        }
Example #30
0
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            int energy = cardEffectParams.playerManager.GetEnergy();

            foreach (var target in cardEffectParams.targets)
            {
                NotifyHealthEffectTriggered(cardEffectParams.saveManager, cardEffectParams.popupNotificationManager, GetActivatedDescription(cardEffectState), target.GetCharacterUI());

                target.BuffDamage(cardEffectState.GetParamInt() * energy);
                yield return(target.BuffMaxHP(cardEffectState.GetAdditionalParamInt() * energy, false));
            }

            yield break;
        }