| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 |
- using System.Collections;
- using System.Collections.Generic;
- // WarGreymon
- namespace DCGO.CardEffects.EX12
- {
- public class EX12_017 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternative Digivolution Condition
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.ContainsCardName("Greymon")
- || targetPermanent.TopCard.EqualsTraits("ME")
- || targetPermanent.TopCard.EqualsTraits("VB");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 3,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null,
- level: 5)
- );
- }
- #endregion
- #region DNA Digivolution
- if (timing == EffectTiming.None)
- {
- AddJogressConditionClass addJogressConditionClass = new AddJogressConditionClass();
- addJogressConditionClass.SetUpICardEffect("DNA Digivolution", CanUseCondition, card);
- addJogressConditionClass.SetUpAddJogressConditionClass(getJogressCondition: GetJogress);
- addJogressConditionClass.SetNotShowUI(true);
- cardEffects.Add(addJogressConditionClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- return true;
- }
- JogressCondition GetJogress(CardSource cardSource)
- {
- if (cardSource == card)
- {
- bool PermanentCondition1(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
- && (permanent.TopCard.CardColors.Contains(CardColor.Red)
- || permanent.TopCard.CardColors.Contains(CardColor.Yellow))
- && permanent.Levels_ForJogress(card).Contains(5);
- }
- bool PermanentCondition2(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
- && (permanent.TopCard.CardColors.Contains(CardColor.Black)
- || permanent.TopCard.CardColors.Contains(CardColor.Purple))
- && permanent.Levels_ForJogress(card).Contains(5);
- }
- JogressConditionElement[] elements = new JogressConditionElement[]
- {
- new JogressConditionElement(PermanentCondition1, "a level 5 Red or Yellow Digimon"),
- new JogressConditionElement(PermanentCondition2, "a level 5 Black or Purple Digimon"),
- };
- JogressCondition jogressCondition = new JogressCondition(elements, 0);
- return jogressCondition;
- }
- return null;
- }
- }
- #endregion
- #region Security A. +1
- if (timing == EffectTiming.None) cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null));
- #endregion
- #region Decode
- if (timing == EffectTiming.WhenRemoveField)
- {
- bool SourceCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon
- && cardSource.HasLevel
- && cardSource.Level <= 5
- && (cardSource.ContainsCardName("Agumon")
- || cardSource.ContainsCardName("Greymon")
- || cardSource.EqualsTraits("ME")
- || cardSource.EqualsTraits("VB"));
- }
- string[] decodeStrings = { "(Lv.5 or lower w/[Agumon]/[Greymon] in name or w/[ME]/[VB] trait)", "Level 5 or lower Digimon card with [Agumon]/[Greymon] in name or [ME]/[VB] trait" };
- cardEffects.Add(CardEffectFactory.DecodeSelfEffect(card: card, isInheritedEffect: false, decodeStrings: decodeStrings, sourceCondition: SourceCondition, condition: null));
- }
- #endregion
- #region Shared OP/WD/WA
- string SharedEffectName = "<De-Digivolve 3> 1 enemy Digimon, then by placing 2 [Gammamon] text/[VB] from trash under, taunt 1 enemy Digimon";
- string SharedHashString = "EX12_017_OP_WD_WA";
- CardEffectFactory.ActivateClassesForSharedEffects
- (ref cardEffects, timing, card,
- SharedEffectName,
- SharedActivateCoroutine,
- SharedEffectDescription,
- optional: false,
- maxCountPerTurn: 1,
- hashValue: SharedHashString,
- onPlay: true,
- whenDigivolving: true,
- whenAttacking: true);
- string SharedEffectDescription(string tag)
- {
- return $"[{tag}] [Once Per Turn] <De-Digivolve 2> 1 of your opponent's Digimon. Then, delete 1 of your opponent's lowest DP Digimon.";
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
- bool CanSelectMinDPDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsMinDP(permanent, card.Owner.Enemy);
- }
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- if(CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Degenerate,
- cardEffect: activateClass);
- selectPermanentEffect.SetDegenerationCount(2);
- selectPermanentEffect.SetUpCustomMessage("Select 1 opponent's Digimon to De-Digivolve", "The opponent is selecting 1 Digimon to De-Digivolve");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectMinDPDigimon))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectMinDPDigimon,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Destroy,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- }
- #endregion
- #region Counter
- if (timing == EffectTiming.OnCounterTiming)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("2 of your Digimon may DNA into [Omnimon]/[ME]/[VB] in hand, then may redirect attack", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
- activateClass.SetIsSkippable(true);
- activateClass.SetHashString("EX12_017_Counter");
- activateClass.SetIsCounterEffect(true);
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return "[Counter] [Once Per Turn] 2 of your Digimon may DNA digivolve into [Omnimon] or an [ME] or [VB] trait Digimon card in the hand. Then, you may change the attack target to 1 of your Digimon.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
- && CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, permanent => CardEffectCommons.IsOpponentPermanent(permanent, card));
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass);
- }
- bool CanSelectRedirectPermanentCondition (Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
- }
- bool CanSelectDNACardCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon
- && cardSource.CanPlayJogress(true)
- && (cardSource.EqualsCardName("Omnimon")
- || cardSource.EqualsTraits("ME")
- || cardSource.EqualsTraits("VB"));
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- #region DNA digivolve
- yield return ContinuousController.instance.StartCoroutine(
- CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
- CanSelectDNACardCondition,
- payCost: true,
- isHand: true,
- activateClass
- ));
- #endregion
- #region Redirect attack
- Permanent selectedPermanent = null;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectRedirectPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to change the attack target to.", "The opponent is selecting 1 Digimon to change the attack target to.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
- yield return null;
- }
- if (selectedPermanent != null)
- {
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.attackProcess.SwitchDefender(
- activateClass,
- false,
- selectedPermanent));
- }
- #endregion
- }
- }
- #endregion
- #region Assembly
- if (timing == EffectTiming.None)
- {
- AddAssemblyConditionClass addAssemblyConditionClass = new AddAssemblyConditionClass();
- addAssemblyConditionClass.SetUpICardEffect("Assembly", CanUseCondition, card);
- addAssemblyConditionClass.SetUpAddAssemblyConditionClass(getAssemblyCondition: GetAssembly);
- addAssemblyConditionClass.SetNotShowUI(true);
- cardEffects.Add(addAssemblyConditionClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- return true;
- }
- AssemblyCondition GetAssembly(CardSource cardSource)
- {
- if (cardSource == card)
- {
- AssemblyConditionElement element1 = new AssemblyConditionElement(CanSelectCardCondition1, elementCount: 1);
- AssemblyConditionElement element2 = new AssemblyConditionElement(CanSelectCardCondition2, elementCount: 1);
- AssemblyConditionElement element3 = new AssemblyConditionElement(CanSelectCardCondition3, elementCount: 1);
- bool CanSelectCardCondition1(CardSource cardSource)
- {
- return cardSource != null
- && cardSource.Owner == card.Owner
- && cardSource.IsLevel5
- && (cardSource.ContainsCardName("Agumon")
- || cardSource.ContainsCardName("Greymon")
- || cardSource.EqualsTraits("ME")
- || cardSource.EqualsTraits("VB"));
- }
- bool CanSelectCardCondition2(CardSource cardSource)
- {
- return cardSource != null
- && cardSource.Owner == card.Owner
- && cardSource.IsLevel4
- && (cardSource.ContainsCardName("Agumon")
- || cardSource.ContainsCardName("Greymon")
- || cardSource.EqualsTraits("ME")
- || cardSource.EqualsTraits("VB"));
- }
- bool CanSelectCardCondition3(CardSource cardSource)
- {
- return cardSource != null
- && cardSource.Owner == card.Owner
- && cardSource.IsLevel3
- && (cardSource.ContainsCardName("Agumon")
- || cardSource.ContainsCardName("Greymon")
- || cardSource.EqualsTraits("ME")
- || cardSource.EqualsTraits("VB"));
- }
- AssemblyCondition assemblyCondition = new AssemblyCondition(
- elements: new List<AssemblyConditionElement>() { element1, element2, element3 },
- reduceCost: 6);
- return assemblyCondition;
- }
- return null;
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|