Просмотр исходного кода

Added the 3 Appmon, missing Link and App Fusion effects

Added Watchmon_BT21_053, Shotmon_BT21_054 and Timemon_BT21_059, still missing their Link and App Fusion effects.
RobertoCastro446 1 год назад
Родитель
Сommit
66f2f4a5ef

+ 161 - 0
Assets/CardEffect/BT21/Black/Shotmon_BT21_054.cs

@@ -0,0 +1,161 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT21
+{
+    public class Shotmon_BT21_054 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            int totalSourceCount = 0;
+
+            #region Alternative Digivolution Condition
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel2 && (targetPermanent.TopCard.EqualsTraits("Appmon") || targetPermanent.TopCard.HasText("Three Musketeers"));
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 0,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region On Play
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Trash 1 source and de-digivolve 1.", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[On Play] By trashing 1 card with the [Appmon] or [Three Musketeers] trait from any of your Digimon's digivolution cards, <De-Digivolve 1> 1 of your opponent's Digimon.";
+                }
+
+                bool HasProperTrait(CardSource source)
+                {
+                    return !source.CanNotTrashFromDigivolutionCards(activateClass) &&
+                        source.EqualsTraits("Appmon") || source.EqualsTraits("Three Musketeers");
+                }
+
+                bool CanSelectTrashTargetCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        totalSourceCount = permanent.DigivolutionCards.Count(HasProperTrait);
+                        
+                        if (totalSourceCount >= 1)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                        CardEffectCommons.HasMatchConditionPermanent(CanSelectTrashTargetCondition) &&
+                        totalSourceCount >= 1;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    bool cardsTrashed = false;
+                    Permanent selectedPermanent = null;
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
+                        permanentCondition: CanSelectTrashTargetCondition,
+                        cardCondition: HasProperTrait,
+                        maxCount: 1,
+                        canNoTrash: false,
+                        isFromOnly1Permanent: false,
+                        activateClass: activateClass,
+                        afterSelectionCoroutine: AfterTrashedCards
+                    ));
+
+                    IEnumerator AfterTrashedCards(Permanent permanent, List<CardSource> cards)
+                    {
+                        if (cards.Count == 1)
+                            cardsTrashed = true;
+
+                        selectedPermanent = permanent;
+
+                        yield return null;
+                    }
+
+                    if (cardsTrashed && CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: CanEndSelectCondition,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to De-Digivolve.", "The opponent is selecting 1 Digimon to De-Digivolve.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        bool CanEndSelectCondition(List<Permanent> permanents)
+                        {
+                            return permanents.Count > 0;
+                        }
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            Permanent selectedPermanent = permanent;
+
+                            if (selectedPermanent != null)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(new IDegeneration(selectedPermanent, 1, activateClass).Degeneration());
+                            }
+
+                            yield return null;
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT21/Black/Shotmon_BT21_054.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e451a7c628a1682469a24ea227ce85a9
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 27 - 0
Assets/CardEffect/BT21/Black/Timemon_BT21_059.cs

@@ -0,0 +1,27 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.BT21
+{
+    public class Timemon_BT21_059 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Blocker
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: null));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT21/Black/Timemon_BT21_059.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fb07f2fa354946d41886fc2d5b3b0697
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 116 - 0
Assets/CardEffect/BT21/Black/Watchmon_BT21_053.cs

@@ -0,0 +1,116 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.BT21
+{
+    public class Watchmon_BT21_053 : 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.IsLevel2 && targetPermanent.TopCard.EqualsTraits("Appmon");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 0,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region On Play
+
+            if (timing == EffectTiming.None)
+            {
+                if (timing == EffectTiming.OnEnterFieldAnyone)
+                {
+                    ActivateClass activateClass = new ActivateClass();
+                    activateClass.SetUpICardEffect("1 of your opponent's Digimon can't attack players until their turn ends", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                    cardEffects.Add(activateClass);
+
+                    string EffectDiscription()
+                    {
+                        return "[On Play] Until your opponent's turn ends, 1 of their Digimon can't attack players.";
+                    }
+
+                    bool IsOpponentsDigimon(Permanent permanent)
+                    {
+                        return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                            CardEffectCommons.CanTriggerOnPlay(hashtable, card) &&
+                            CardEffectCommons.HasMatchConditionOpponentsPermanent(card, IsOpponentsDigimon);
+                    }
+
+                    bool CanActivateCondition(Hashtable hashtable)
+                    {
+                        return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                    }
+
+                    IEnumerator ActivateCoroutine(Hashtable hashtable)
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(IsOpponentsDigimon))
+                        {
+                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(IsOpponentsDigimon));
+
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: IsOpponentsDigimon,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: false,
+                                canEndNotMax: false,
+                                selectPermanentCoroutine: SelectCantAttackPermanent,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Custom,
+                                cardEffect: activateClass);
+
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                        }
+
+                        IEnumerator SelectCantAttackPermanent(Permanent permanent)
+                        {
+                            bool DefenderCondition(Permanent Defender)
+                            {
+                                return Defender == null;
+                            }
+
+                            if (permanent != null)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(
+                                    targetPermanent: permanent,
+                                    defenderCondition: DefenderCondition,
+                                    effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                                    activateClass: activateClass,
+                                    effectName: "Can't Attack Player"));
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT21/Black/Watchmon_BT21_053.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dea65eff6aa0c014abfdec0d741814db
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: