using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; using Photon; using System; using Photon.Pun; public class ST14_07 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Trash 3 cards from deck top", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[When Digivolving] Trash the top 3 cards of your deck."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card); } IEnumerator ActivateCoroutine(Hashtable _hashtable) { yield return ContinuousController.instance.StartCoroutine(new IAddTrashCardsFromLibraryTop(3, card.Owner, activateClass).AddTrashCardsFromLibraryTop()); } } if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("This Digimon gains effect", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[When Digivolving] This Digimon gains \"[On Deletion] If there are 10 or more cards in your trash, you may play 1 [Beelzemon] from your trash without paying the cost\" until the end of your opponent's turn."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { return true; } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { Permanent selectedPermanent = card.PermanentOfThisCard(); if (selectedPermanent != null) { CardSource _topCard = selectedPermanent.TopCard; ActivateClass activateClass1 = new ActivateClass(); activateClass1.SetUpICardEffect("Play 1 [Beelzemon] from trash", CanUseCondition1, selectedPermanent.TopCard); activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, true, EffectDiscription1()); activateClass1.SetEffectSourcePermanent(selectedPermanent); CardEffectCommons.AddEffectToPermanent(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnDestroyedAnyone); yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent().CreateBuffEffect(selectedPermanent)); string EffectDiscription1() { return "[On Deletion] If there are 10 or more cards in your trash, you may play 1 [Beelzemon] from your trash without paying the cost."; } bool CanSelectCardCondition(CardSource cardSource) { if (cardSource.CardNames.Contains("Beelzemon")) { if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass)) { return true; } } return false; } bool CanUseCondition1(Hashtable hashtable1) { if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent)) { if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable1, (permanent) => permanent == selectedPermanent, activateClass)) { if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass)) { return true; } } } return false; } bool CanActivateCondition1(Hashtable hashtable1) { if (CardEffectCommons.IsTopCardInTrashOnDeletion(hashtable1)) { if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(_topCard, CanSelectCardCondition)) { if (_topCard.Owner.TrashCards.Count >= 10) { return true; } } } return false; } IEnumerator ActivateCoroutine1(Hashtable _hashtable1) { if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(_topCard, (cardSource) => CanSelectCardCondition(cardSource))) { int maxCount = Math.Min(1, _topCard.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource))); List selectedCards = new List(); SelectCardEffect selectCardEffect = GManager.instance.GetComponent(); selectCardEffect.SetUp( canTargetCondition: CanSelectCardCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, canNoSelect: () => true, selectCardCoroutine: SelectCardCoroutine, afterSelectCardCoroutine: null, message: "Select 1 card to play.", maxCount: maxCount, canEndNotMax: false, isShowOpponent: true, mode: SelectCardEffect.Mode.Custom, root: SelectCardEffect.Root.Trash, customRootCardList: null, canLookReverseCard: true, selectPlayer: _topCard.Owner, cardEffect: activateClass); selectCardEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play."); selectCardEffect.SetUpCustomMessage_ShowCard("Played Card"); yield return StartCoroutine(selectCardEffect.Activate()); IEnumerator SelectCardCoroutine(CardSource cardSource) { selectedCards.Add(cardSource); yield return null; } yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass1, payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true)); } } } } } if (timing == EffectTiming.None) { bool Condition() { if (CardEffectCommons.IsOwnerTurn(card)) { if (card.PermanentOfThisCard().TopCard.CardTraits.Contains("Wizard")) { return true; } if (card.PermanentOfThisCard().TopCard.CardTraits.Contains("Demon Lord")) { return true; } if (card.PermanentOfThisCard().TopCard.CardTraits.Contains("DemonLord")) { return true; } } return false; } cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition)); } return cardEffects; } }