using Photon.Pun; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; namespace DCGO.CardEffects.EX3 { public class EX3_041 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); if (timing == EffectTiming.None) { bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.CardNames.Contains("Coredramon"); } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null)); } if (timing == EffectTiming.None) { cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null)); } if (timing == EffectTiming.None) { AddJogressLevelsClass addJogressLevelsClass = new AddJogressLevelsClass(); addJogressLevelsClass.SetUpICardEffect("Also treated as level 6 for DNA Digivolution", CanUseCondition, card); addJogressLevelsClass.SetUpAddJogressLevelsClass(AddJogressLevels); cardEffects.Add(addJogressLevelsClass); bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.IsOwnerTurn(card)) { return true; } } return false; } List AddJogressLevels(CardSource cardSource, Permanent permanent) { List levels = new List(); if (permanent == card.PermanentOfThisCard()) { if (cardSource != null) { if (cardSource.Owner == card.Owner) { if (cardSource.Owner.HandCards.Contains(cardSource)) { if (cardSource.CardNames.Contains("Examon")) { levels.Add(6); } } } } } return levels; } } if (timing == EffectTiming.OnEndTurn) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("DNA digivolve this Digimon", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[End of Your Turn] This Digimon and 1 of your other Digimon with [Dramon] in its name may DNA digivolve into a Digimon card in your hand by paying its DNA digivolve cost."; } bool CanSelectCardCondition(CardSource cardSource) { if (cardSource != null) { if (cardSource.IsDigimon) { if (cardSource.Owner == card.Owner) { if (cardSource.CanPlayJogress(true)) { if (isExistOnField(card)) { if (cardSource.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true)) { foreach (Permanent permanent in card.Owner.GetBattleAreaDigimons()) { if (permanent.TopCard.HasDramonName) { if (permanent != card.PermanentOfThisCard()) { if (cardSource.CanJogressFromTargetPermanent(permanent, true)) { if (cardSource.CanJogressFromTargetPermanents(new List() { card.PermanentOfThisCard(), permanent }, true)) { return true; } } } } } } } } } } } return false; } bool CanUseCondition(Hashtable hashtable) { if (isExistOnField(card)) { return true; } return false; } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.IsOwnerTurn(card)) { if (card.Owner.HandCards.Count >= 1) { if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsDigimon && permanent != card.PermanentOfThisCard() && permanent.TopCard.HasDramonName)) { return true; } } } } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (isExistOnField(card)) { yield return ContinuousController.instance.StartCoroutine( CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard( CanSelectCardCondition, payCost: true, isHand: true, activateClass, permanentConditions: new Func[] { (permanent) => permanent == card.PermanentOfThisCard(), (permanent) => permanent != card.PermanentOfThisCard() && permanent.TopCard.HasDramonName } )); } } } if (timing == EffectTiming.None) { bool Condition() { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (card.PermanentOfThisCard().TopCard.HasDramonName) { return true; } if (card.PermanentOfThisCard().TopCard.ContainsCardName("Examon")) { return true; } } return false; } cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: true, card: card, condition: Condition)); } return cardEffects; } } }