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 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 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); })); }
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 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 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; }
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); } }
public override bool TestEffect( CardEffectState cardEffectState, CardEffectParams cardEffectParams) { this.cardSelectionMode = cardEffectState.GetTargetCardSelectionMode(); return(base.TestEffect(cardEffectState, cardEffectParams)); }
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); })); }
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams) { target = cardEffectParams.targets[0]; addDamage = cardEffectState.GetParamInt(); lastCap = 0; yield break; }
public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams) { foreach (CharacterState target in cardEffectParams.targets) { return(TestEffectOnTarget(cardEffectState, cardEffectParams, target)); } return(false); }
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); }
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); })); }
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; }
public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams) { if (cardEffectState.GetTargetMode() != TargetMode.DropTargetCharacter) { return(true); } if (cardEffectParams.targets.Count <= 0) { return(false); } return(false); }
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 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 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; }
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 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; }
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; }
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams) { int deckSize = cardEffectParams.cardManager.GetDrawPile().Count; foreach (var target in cardEffectParams.targets) { NotifyHealthEffectTriggered(cardEffectParams.saveManager, cardEffectParams.popupNotificationManager, GetActivatedDescription(cardEffectState), target.GetCharacterUI()); target.BuffDamage(cardEffectState.GetParamInt() * deckSize); yield return(target.BuffMaxHP(cardEffectState.GetParamInt() * deckSize, false)); } yield break; }
public override IEnumerator ApplyEffect( CardEffectState cardEffectState, CardEffectParams cardEffectParams) { List <CardState> cards = cardEffectParams.cardManager.GetAllCards(); CardEffectFreezeRandomCard.FilterCards(cards); foreach (var card in cards) { CardTraitData cardTraitData = new CardTraitData(); cardTraitData.Setup("CardTraitFreeze"); cardEffectParams.cardManager.AddTemporaryTraitToCard(card, cardTraitData, true, false); } yield break; }
public override bool TestEffectOnTarget(CardEffectState cardEffectState, CardEffectParams cardEffectParams, CharacterState target) { if (target.IsPyreHeart()) { if (cardEffectParams.saveManager.PreviewMode && !cardEffectParams.GetSelectedRoom().GetIsPyreRoom()) { return(false); } return(true); } if (target.IsAlive && target.GetCanAttack()) { return(true); } return(false); }
public override IEnumerator OnTrigger(List <CharacterState> targets) { ProviderManager.TryGetProvider <RoomManager>(out RoomManager roomManager); var cardEffectParams = new CardEffectParams { saveManager = ProviderManager.CombatManager.GetSaveManager(), combatManager = ProviderManager.CombatManager, heroManager = ProviderManager.CombatManager.GetHeroManager(), roomManager = roomManager, targets = targets, }; var bumper = new CardEffectBump(); yield return(bumper.Bump(cardEffectParams, -1)); }
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams) { 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; foreach (CharacterState character in cardEffectParams.targets) { List <CharacterState.StatusEffectStack> statusEffectStacks; character.GetStatusEffects(out statusEffectStacks); // True flips buffs into debuffs, false flips debuffs into buffs foreach (var status in statusEffectStacks) { if (cardEffectState.GetParamBool()) { if (StatusFlips.ContainsKey(status.State.GetStatusId())) { int count = status.Count; character.RemoveStatusEffect(status.State.GetStatusId(), false, count); string debuff = StatusFlips.GetValueSafe(status.State.GetStatusId()); Trainworks.Trainworks.Log(BepInEx.Logging.LogLevel.All, "Flipping " + status.State.GetStatusId() + " to " + debuff + " - " + count); character.AddStatusEffect(debuff, count); } } else { if (StatusFlips.ContainsValue(status.State.GetStatusId())) { int count = status.Count; character.RemoveStatusEffect(status.State.GetStatusId(), false, count); string buff = StatusFlips.FirstOrDefault(x => x.Value == status.State.GetStatusId()).Key; Trainworks.Trainworks.Log(BepInEx.Logging.LogLevel.All, "Flipping " + status.State.GetStatusId() + " to " + buff + " - " + count); character.AddStatusEffect(buff, count); } } } } yield break; }
public override IEnumerator ApplyEffect( CardEffectState cardEffectState, CardEffectParams cardEffectParams) { this.buffAmount = cardEffectParams.playerManager.GetEnergy() * cardEffectState.GetParamInt(); cardEffectParams.playedCard.GetCardStateModifiers().IncrementAdditionalDamage(this.buffAmount); cardEffectParams.playedCard.UpdateCardBodyText((SaveManager)null); CardManager cardManager = cardEffectParams.cardManager; if (cardManager != null) { cardManager.RefreshCardInHand(cardEffectParams.playedCard, true); } yield break; }
public override IEnumerator ApplyEffect( CardEffectState cardEffectState, CardEffectParams cardEffectParams) { CardUpgradeState cardUpgradeState = new CardUpgradeState(); cardUpgradeState.Setup(cardEffectState.GetParamCardUpgradeData()); var card = cardEffectParams.playedCard; CardAnimator.CardUpgradeAnimationInfo type = new CardAnimator.CardUpgradeAnimationInfo(card, cardUpgradeState); CardAnimator.DoAddRecentCardUpgrade.Dispatch(type); card.GetTemporaryCardStateModifiers().AddUpgrade(cardUpgradeState); card.UpdateCardBodyText(); cardEffectParams.cardManager.RefreshCardInHand(card); yield break; }