| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- using System.Collections;
- using System.Collections.Generic;
- // MetalGreymon
- namespace DCGO.CardEffects.EX12
- {
- public class EX12_016 : 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: 4)
- );
- }
- #endregion
- #region Decode
- if (timing == EffectTiming.WhenRemoveField)
- {
- bool SourceCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon
- && cardSource.HasLevel
- && cardSource.Level <= 4
- && (cardSource.ContainsCardName("Agumon")
- || cardSource.ContainsCardName("Greymon")
- || cardSource.EqualsTraits("ME")
- || cardSource.EqualsTraits("VB"));
- }
- string[] decodeStrings = { "(Lv.4 or lower w/[Agumon]/[Greymon] in name or w/[ME]/[VB] trait)", "Level 4 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
- string SharedEffectName = "Delete 1 enemy 6K DP or lower Digimon, then taunt 1 enemy Digimon";
- CardEffectFactory.ActivateClassesForSharedEffects
- (ref cardEffects, timing, card,
- SharedEffectName,
- SharedActivateCoroutine,
- SharedEffectDescription,
- optional: false,
- onPlay: true,
- whenDigivolving: true);
- string SharedEffectDescription(string tag)
- {
- return $"[{tag}] Delete 1 of your opponent's Digimon with 6000 DP or less. Then, give 1 of their Digimon \"[Start of Your Main Phase] This Digimon attacks.\" until their turn ends.";
- }
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- bool CanSelectPermanentCondition1(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
- && permanent.HasDP
- && permanent.DP <= card.Owner.MaxDP_DeleteEffect(6000, activateClass);
- }
- bool CanSelectPermanentCondition2(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
- if(CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition1,
- 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());
- }
- if(CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition2))
- {
- Permanent selectedPermanment = null;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition2,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanment = permanent;
- yield return null;
- }
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to gain [Start of Your Main Phase] This Digimon attacks", "The opponent is selecting 1 Digimon to gain [Start of Your Main Phase] This Digimon attacks");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- if (selectedPermanment != null)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.StartOfMainAttack(
- targetPermanent: selectedPermanment,
- cardEffect: activateClass));
- }
- }
- }
- #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 element = new AssemblyConditionElement(CanSelectCardCondition);
- bool CanSelectCardCondition(CardSource cardSource)
- {
- return cardSource.HasLevel
- && cardSource.Level <= 4
- && (cardSource.ContainsCardName("Agumon")
- || cardSource.ContainsCardName("Greymon")
- || cardSource.EqualsTraits("ME")
- || cardSource.EqualsTraits("VB"));
- }
- AssemblyCondition assemblyCondition = new AssemblyCondition(
- element: element,
- CanTargetCondition_ByPreSelecetedList: null,
- selectMessage: "Lv.4 or lower w/[Agumon]/[Greymon] in name or w/[ME]/[VB] trait",
- elementCount: 1,
- reduceCost: 2);
- return assemblyCondition;
- }
- return null;
- }
- }
- #endregion
- #region Inherited
- if (timing == EffectTiming.WhenRemoveField)
- {
- bool SourceCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon
- && cardSource.HasLevel
- && cardSource.Level <= 4
- && (cardSource.ContainsCardName("Agumon")
- || cardSource.ContainsCardName("Greymon")
- || cardSource.EqualsTraits("ME")
- || cardSource.EqualsTraits("VB"));
- }
- string[] decodeStrings = { "(Lv.4 or lower w/[Agumon]/[Greymon] in name or w/[ME]/[VB] trait)", "Level 4 or lower Digimon card with [Agumon]/[Greymon] in name or [ME]/[VB] trait" };
- cardEffects.Add(CardEffectFactory.DecodeSelfEffect(card: card, isInheritedEffect: true, decodeStrings: decodeStrings, sourceCondition: SourceCondition, condition: null));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|