public override IEnumerator UsePower(int index = 0) { //============================================================== // Select a target, at the start of your next turn, // {TangoOne} deals that target 3 projectile damage. //============================================================== int numDamage = GetPowerNumeral(0, PowerDamageToDeal); IEnumerable <Card> targets = GameController.FindTargetsInPlay(); List <SelectTargetDecision> storedResults = new List <SelectTargetDecision>(); IEnumerator coroutine = GameController.SelectTargetAndStoreResults(DecisionMaker, targets, storedResults, damageSource: CharacterCard, damageAmount: card => numDamage, damageType: DamageType.Projectile, selectionType: SelectionType.SelectTargetNoDamage, cardSource: GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } Card target = storedResults.FirstOrDefault()?.SelectedCard; if (target != null) { OnPhaseChangeStatusEffect effect = new OnPhaseChangeStatusEffect(this.CardWithoutReplacements, nameof(StartOfTurnDealDamageResponse), $"{base.Card.Title} will deal {PowerDamageToDeal} projectile damage to {target.Title} at the start of her next turn", new[] { TriggerType.DealDamage }, this.Card); effect.UntilEndOfNextTurn(base.HeroTurnTaker); effect.TurnTakerCriteria.IsSpecificTurnTaker = base.HeroTurnTaker; effect.UntilTargetLeavesPlay(target); effect.TurnPhaseCriteria.Phase = Phase.Start; effect.BeforeOrAfter = BeforeOrAfter.After; effect.CanEffectStack = true; effect.CardSource = this.Card; effect.NumberOfUses = 1; effect.DoesDealDamage = true; effect.SetPowerNumeralsArray(new int[] { numDamage }); IEnumerator addStatusEffectRoutine = base.GameController.AddStatusEffect(effect, true, GetCardSource()); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(addStatusEffectRoutine)); } else { base.GameController.ExhaustCoroutine(addStatusEffectRoutine); } } }
private OnPhaseChangeStatusEffect MakeTurntakerStartPhaseEffect(string methodToCall, TurnTaker target, TriggerType triggerType, string description) { OnPhaseChangeStatusEffect effect = new OnPhaseChangeStatusEffect(this.CardWithoutReplacements, methodToCall, description, new[] { triggerType }, this.Card); GameController.AddCardPropertyJournalEntry(Card, IncapTurnTakerKey, target); effect.UntilEndOfNextTurn(base.HeroTurnTaker); effect.TurnTakerCriteria.IsSpecificTurnTaker = base.HeroTurnTaker; effect.TurnPhaseCriteria.Phase = Phase.Start; effect.BeforeOrAfter = BeforeOrAfter.After; effect.UntilCardLeavesPlay(base.Card); return(effect); }
public override IEnumerator UsePower(int index = 0) { //Power: "Until the end of your next turn, reduce the first damage dealt to Vikral each turn by X, where X is the number of Microstorms in play." //Check Scatter Deflector and Energized Chassis (Kyoss) for referencing on ways to make it variable amount per turn and once per turn? base.AddCardPropertyJournalEntry(MicrostormReducePropertyKey, true); OnPhaseChangeStatusEffect opcse = new OnPhaseChangeStatusEffect(CardWithoutReplacements, nameof(DoNothing), $"Until the end of your next turn, reduce the first damage dealt to {base.TurnTaker.Name} by X, where X is the number of Microstorms in play.", new TriggerType[] { TriggerType.ReduceDamage }, this.Card); opcse.CardDestroyedExpiryCriteria.Card = base.CharacterCard; opcse.UntilEndOfNextTurn(base.TurnTaker); IEnumerator coroutine = AddStatusEffect(opcse, true); if (UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(coroutine)); } else { base.GameController.ExhaustCoroutine(coroutine); } }
public override IEnumerator Play() { // Find hero with the most cards in hand List <TurnTaker> excludedTurnTakers = new List <TurnTaker>(); List <TurnTaker> mostCardsInHandResults = new List <TurnTaker>(); IEnumerator heroWithMostCardsInHandRoutine = base.FindHeroWithMostCardsInHand(mostCardsInHandResults); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(heroWithMostCardsInHandRoutine)); } else { base.GameController.ExhaustCoroutine(heroWithMostCardsInHandRoutine); } if (mostCardsInHandResults.Any()) { var biggestHandTurnTaker = mostCardsInHandResults.First(); excludedTurnTakers.Add(biggestHandTurnTaker); //The status effect must last slightly longer than the triggering phase action, or the effect will not fire. OnPhaseChangeStatusEffect effect = new OnPhaseChangeStatusEffect(CardWithoutReplacements, nameof(PreventDrawsThisTurnEffect), $"{biggestHandTurnTaker.Name} cannot draw cards on their turn.", new TriggerType[] { TriggerType.CreateStatusEffect }, base.Card); effect.TurnTakerCriteria.IsSpecificTurnTaker = biggestHandTurnTaker; effect.TurnPhaseCriteria.Phase = Phase.Start; effect.UntilEndOfNextTurn(biggestHandTurnTaker); effect.CanEffectStack = true; IEnumerator onPhaseChangeRoutine = base.AddStatusEffect(effect); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(onPhaseChangeRoutine)); } else { base.GameController.ExhaustCoroutine(onPhaseChangeRoutine); } } // Find hero with most cards in play List <TurnTaker> mostCardsInPlayResults = new List <TurnTaker>(); IEnumerator heroWithMostCardsInPlayRoutine = base.FindHeroWithMostCardsInPlay(mostCardsInPlayResults); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(heroWithMostCardsInPlayRoutine)); } else { base.GameController.ExhaustCoroutine(heroWithMostCardsInPlayRoutine); } if (mostCardsInPlayResults.Any()) { var mostCardsTurnTaker = mostCardsInPlayResults.First(); excludedTurnTakers.Add(mostCardsTurnTaker); //The status effect must last slightly longer than the triggering phase action, or the effect will not fire. // This hero may not play cards during their next turn. OnPhaseChangeStatusEffect effect = new OnPhaseChangeStatusEffect(CardWithoutReplacements, nameof(PreventPlaysThisTurnEffect), $"{mostCardsTurnTaker.Name} cannot play cards on their turn.", new TriggerType[] { TriggerType.CreateStatusEffect }, base.Card); effect.TurnTakerCriteria.IsSpecificTurnTaker = mostCardsTurnTaker; effect.TurnPhaseCriteria.Phase = Phase.Start; effect.UntilEndOfNextTurn(mostCardsTurnTaker); effect.CanEffectStack = true; IEnumerator onPhaseChangeRoutine = base.AddStatusEffect(effect); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(onPhaseChangeRoutine)); } else { base.GameController.ExhaustCoroutine(onPhaseChangeRoutine); } } // All other heroes shuffle their trash into their decks IEnumerator shuffleRoutine = base.DoActionToEachTurnTakerInTurnOrder(ttc => ttc.IsHero && !ttc.IsIncapacitatedOrOutOfGame && !excludedTurnTakers.Contains(ttc.TurnTaker), ShuffleTrashResponse); if (base.UseUnityCoroutines) { yield return(base.GameController.StartCoroutine(shuffleRoutine)); } else { base.GameController.ExhaustCoroutine(shuffleRoutine); } }