using System.Collections; using System.Collections.Generic; using System.Linq; namespace DCGO.CardEffects.EX6 { public class EX6_047 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Reveal 3", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with the [Fallen Angel] or [Demon Lord] trait and 1 purple option card among them to your hand. Return the rest to the bottom of the deck. If you added cards, trash 1 card in your hand."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPlay(hashtable,card); } bool CanSelectCardCondition(CardSource _card) { if (_card.CardTraits.Contains("Fallen Angel") || _card.CardTraits.Contains("FallenAngel") || _card.CardTraits.Contains("DemonLord") || _card.CardTraits.Contains("Demon Lord")) { return true; } return false; } bool CanSelectCardCondition1(CardSource _card) { if(_card.IsOption && _card.HasCardColor(CardColor.Purple)) { return true; } return false; } bool CanActivateCondition(Hashtable hashtable) { if(CardEffectCommons.IsExistOnBattleArea(card)) { if (card.Owner.LibraryCards.Count >= 1) { return true; } } return false; } IEnumerator ActivateCoroutine(Hashtable hashtable) { bool added = false; yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect( revealCount: 3, simplifiedSelectCardConditions: new SimplifiedSelectCardConditionClass[] { new SimplifiedSelectCardConditionClass( canTargetCondition:CanSelectCardCondition, message: "Select 1 card with the [Fallen Angel] or [Demon Lord] trait.", mode: SelectCardEffect.Mode.AddHand, maxCount: 1, selectCardCoroutine: null), new SimplifiedSelectCardConditionClass( canTargetCondition:CanSelectCardCondition1, message: "Select 1 purple Option card.", mode: SelectCardEffect.Mode.AddHand, maxCount: 1, selectCardCoroutine: null), }, remainingCardsPlace: RemainingCardsPlace.DeckBottom, activateClass: activateClass, revealedCardsCoroutine: RevealedCardsCoroutine )); IEnumerator RevealedCardsCoroutine(List revealedCards) { added = revealedCards.Count(CanSelectCardCondition) >= 1 || revealedCards.Count(CanSelectCardCondition1) >= 1; yield return null; } if (added) { if (card.Owner.HandCards.Count >= 1) { int discardCount = 1; SelectHandEffect selectHandEffect = GManager.instance.GetComponent(); selectHandEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: (cardSource) => true, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: discardCount, canNoSelect: false, canEndNotMax: false, isShowOpponent: true, selectCardCoroutine: null, afterSelectCardCoroutine: null, mode: SelectHandEffect.Mode.Discard, cardEffect: activateClass); yield return StartCoroutine(selectHandEffect.Activate()); } } } } #endregion #region Inherit if (timing == EffectTiming.None) { bool Condition() { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (card.Owner.Enemy.HandCards.Count <= 6) { return true; } } return false; } cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition)); } #endregion return cardEffects; } } }