Przeglądaj źródła

Lewis 001-030 2nd sweep checkpoint

Lewisaaronwelch 11 miesięcy temu
rodzic
commit
0d62cebab9

+ 4 - 2
Assets/CardEffect/EX10/Black/EX10_002.cs

@@ -10,11 +10,12 @@ namespace DCGO.CardEffects.EX10
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region ESS
+
             if (timing == EffectTiming.OnAttackTargetChanged)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1,false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetIsInheritedEffect(true);
                 activateClass.SetHashString("ESS_EX10-002");
                 cardEffects.Add(activateClass);
@@ -27,7 +28,7 @@ namespace DCGO.CardEffects.EX10
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
-                           CardEffectCommons.CanTriggerOnAttackTargetSwitch(hashtable, card);
+                           CardEffectCommons.CanTriggerOnPermanentAttackTargetSwitch(hashtable, _ => true);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
@@ -40,6 +41,7 @@ namespace DCGO.CardEffects.EX10
                     yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 5 - 0
Assets/CardEffect/EX10/Black/EX10_003.cs

@@ -11,11 +11,13 @@ namespace DCGO.CardEffects.EX10
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region ESS
+
             if (timing == EffectTiming.OnAllyAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("by trashing 3 digivolution sources, end an attack", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
                 activateClass.SetHashString("ESS_EX10-003");
                 cardEffects.Add(activateClass);
 
@@ -33,6 +35,7 @@ namespace DCGO.CardEffects.EX10
                 bool CanActivateCondition(Hashtable hashtable)
                 {
                     return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.IsOpponentTurn(card) &&
                            card.PermanentOfThisCard().DigivolutionCards.Count(ProperSources) >= 3;
                 }
 
@@ -87,7 +90,9 @@ namespace DCGO.CardEffects.EX10
                         GManager.instance.attackProcess.IsEndAttack = true;
                 }
             }
+
             #endregion
+
             return cardEffects;
         }
     }

+ 71 - 23
Assets/CardEffect/EX10/Black/EX10_025.cs

@@ -1,3 +1,4 @@
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
@@ -12,6 +13,7 @@ namespace DCGO.CardEffects.EX10
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region On Play
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -26,12 +28,15 @@ namespace DCGO.CardEffects.EX10
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
+                           && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
+                        && CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsRockOrMineral)
+                        && CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
                 }
 
                 bool IsRockOrMineral(CardSource source)
@@ -39,47 +44,89 @@ namespace DCGO.CardEffects.EX10
                     return source.EqualsTraits("Rock") || source.EqualsTraits("Mineral");
                 }
 
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
+                        && IsRockOrMineral(permanent.TopCard);
+                }
+
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, IsRockOrMineral) >= 2)
+                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsRockOrMineral))
                     {
+                        List<CardSource> selectedCards = null;
+
+                        int maxCount = Math.Min(2, CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, IsRockOrMineral));
                         SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                         selectCardEffect.SetUp(
-                        canTargetCondition: IsRockOrMineral,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        canNoSelect: () => true,
-                        selectCardCoroutine: null,
-                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
-                        message: "Select cards to place as the bottom digivolution sources",
-                        maxCount: 2,
-                        canEndNotMax: false,
-                        isShowOpponent: false,
-                        mode: SelectCardEffect.Mode.Custom,
-                        root: SelectCardEffect.Root.Trash,
-                        customRootCardList: null,
-                        canLookReverseCard: true,
-                        selectPlayer: card.Owner,
-                        cardEffect: activateClass);
+                            canTargetCondition: IsRockOrMineral,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            message: "Select cards to place as the bottom digivolution sources",
+                            maxCount: maxCount,
+                            canEndNotMax: true,
+                            isShowOpponent: false,
+                            mode: SelectCardEffect.Mode.Custom,
+                            root: SelectCardEffect.Root.Trash,
+                            customRootCardList: null,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
+                            yield return null;
+                        }
 
                         yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
-                        IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
+                        if (selectedCards.Any())
                         {
-                            if (cardSources.Count > 0)
+                            Permanent selectedPermanent = null;
+                            int maxCount1 = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectPermanentCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount1,
+                                canNoSelect: true,
+                                canEndNotMax: false,
+                                selectPermanentCoroutine: SelectPermanentCoroutine,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Custom,
+                                cardEffect: activateClass);
+
+                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
                             {
-                                yield return ContinuousController.instance.StartCoroutine(card.Owner.brainStormObject.CloseBrainstrorm(card));
+                                selectedPermanent = permanent;
+                                yield return null;
+                            }
+
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will gain digivolution cards.", "The opponent is selecting 1 Digimon that will gain digivolution cards.");
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                                yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(cardSources, activateClass));
+                            if (selectedPermanent != null)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(selectedCards, activateClass));
                             }
                         }
                     }
                 }
             }
+
             #endregion
 
             #region ESS
+
             if (timing == EffectTiming.OnDigivolutionCardDiscarded)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -141,6 +188,7 @@ namespace DCGO.CardEffects.EX10
                     yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 12 - 14
Assets/CardEffect/EX10/Black/EX10_027.cs

@@ -28,6 +28,7 @@ namespace DCGO.CardEffects.EX10
             #endregion
 
             #region On Play
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -42,20 +43,10 @@ namespace DCGO.CardEffects.EX10
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource != null)
-                    {
-                        if (cardSource.Owner == card.Owner)
-                        {
-                            if (cardSource.ContainsCardName("Sukamon"))
-                            {
-                                return true;
-                            }
-                        }
-                    }
-
-                    return cardSource.HasText("Knightmon") ||
-                           cardSource.HasBagraArmyTraits ||
-                           cardSource.EqualsTraits("Twilight");
+                    return cardSource.IsDigimon &&
+                           (cardSource.HasText("Knightmon")
+                           || cardSource.HasBagraArmyTraits
+                           || cardSource.HasTwilightTrait);
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -135,9 +126,11 @@ namespace DCGO.CardEffects.EX10
                     }
                 }
             }
+
             #endregion
 
             #region When Digivolving
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -245,16 +238,20 @@ namespace DCGO.CardEffects.EX10
                     }
                 }
             }
+
             #endregion
 
             #region Save
+
             if (timing == EffectTiming.OnDestroyedAnyone)
             {
                 cardEffects.Add(CardEffectFactory.SaveEffect(card: card));
             }
+
             #endregion
 
             #region Retaliation - ESS
+
             if (timing == EffectTiming.OnDestroyedAnyone)
             {
                 cardEffects.Add(CardEffectFactory.RetaliationSelfEffect(
@@ -262,6 +259,7 @@ namespace DCGO.CardEffects.EX10
                     card: card,
                     condition: null));
             }
+
             #endregion
 
             return cardEffects;

+ 11 - 3
Assets/CardEffect/EX10/Black/EX10_028.cs

@@ -12,10 +12,11 @@ namespace DCGO.CardEffects.EX10
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region On Play
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("By trashing 1 sources, 1 Digimon gains <Reboot>, <Blocker> and +3000 DP", CanUseCondition, card);
+                activateClass.SetUpICardEffect("By trashing 1 sources, 1 Digimon gains <Reboot>, <Blocker> and +3000 DP", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -112,6 +113,7 @@ namespace DCGO.CardEffects.EX10
                                 mode: SelectPermanentEffect.Mode.Custom,
                                 cardEffect: activateClass);
 
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 of your Digimon to gain effects & 3K DP", "The opponent is selecting 1 of their Digimon to gain effects & 3K DP");
                             yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
                             IEnumerator SelectTargetPermanent(Permanent permanent)
@@ -145,13 +147,15 @@ namespace DCGO.CardEffects.EX10
                     }
                 }
             }
+
             #endregion
 
             #region When Digivolving
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("By trashing 1 sources, 1 Digimon gains <Reboot>, <Blocker> and +3000 DP", CanUseCondition, card);
+                activateClass.SetUpICardEffect("By trashing 1 sources, 1 Digimon gains <Reboot>, <Blocker> and +3000 DP", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -248,6 +252,7 @@ namespace DCGO.CardEffects.EX10
                                 mode: SelectPermanentEffect.Mode.Custom,
                                 cardEffect: activateClass);
 
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 of your Digimon to gain effects & 3K DP", "The opponent is selecting 1 of their Digimon to gain effects & 3K DP");
                             yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
                             IEnumerator SelectTargetPermanent(Permanent permanent)
@@ -256,7 +261,7 @@ namespace DCGO.CardEffects.EX10
                                 yield return null;
                             }
 
-                            if(selectedPermanent != null)
+                            if (selectedPermanent != null)
                             {
                                 yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainReboot(
                                     targetPermanent: selectedPermanent,
@@ -281,9 +286,11 @@ namespace DCGO.CardEffects.EX10
                     }
                 }
             }
+
             #endregion
 
             #region ESS
+
             if (timing == EffectTiming.OnDigivolutionCardDiscarded)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -345,6 +352,7 @@ namespace DCGO.CardEffects.EX10
                     yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 5 - 2
Assets/CardEffect/EX10/Green/EX10_001.cs

@@ -10,6 +10,7 @@ namespace DCGO.CardEffects.EX10
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region ESS
+
             if (timing == EffectTiming.OnLinkCardDiscarded)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -27,12 +28,13 @@ namespace DCGO.CardEffects.EX10
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
-                           CardEffectCommons.CanTriggerOnTrashLinkedCard(hashtable,perm => perm == card.PermanentOfThisCard(), cardEffect => cardEffect != null, source => source != null);
+                           CardEffectCommons.CanTriggerOnTrashLinkedCard(hashtable, perm => perm == card.PermanentOfThisCard(), cardEffect => cardEffect != null, source => source != null);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
+                        && CardEffectCommons.IsOwnerTurn(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
@@ -40,6 +42,7 @@ namespace DCGO.CardEffects.EX10
                     yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 10 - 1
Assets/CardEffect/EX10/Green/EX10_021.cs

@@ -2,7 +2,8 @@ using System.Collections;
 using System.Collections.Generic;
 using System;
 
-namespace DCGO.CardEffects
+// Belphemon: Sleep Mode
+namespace DCGO.CardEffects.EX10
 {
     public class EX10_021 : CEntity_Effect
     {
@@ -11,6 +12,7 @@ namespace DCGO.CardEffects
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Digivolution Requirements
+
             if (timing == EffectTiming.None)
             {
                 bool PermanentCondition(Permanent targetPermanent)
@@ -20,9 +22,11 @@ namespace DCGO.CardEffects
 
                 cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false, card: card, condition: null));
             }
+
             #endregion
 
             #region On Play
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -192,9 +196,11 @@ namespace DCGO.CardEffects
                     }
                 }
             }
+
             #endregion
 
             #region When Digivolving
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -364,9 +370,11 @@ namespace DCGO.CardEffects
                     }
                 }
             }
+
             #endregion
 
             #region Opponent's Turn - OPT
+
             if (timing == EffectTiming.OnTappedAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -449,6 +457,7 @@ namespace DCGO.CardEffects
                     }
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 1 - 1
Assets/CardEffect/EX10/Red/EX10_008.cs

@@ -164,7 +164,7 @@ namespace DCGO.CardEffects.EX10
 
                 string EffectDiscription()
                 {
-                    return "[Opponent's Turn] [Once Per Turn] When attack targets change, if this Digimon has [Greymon] in its name in its name, trash your opponent's top security card.";
+                    return "[Opponent's Turn] [Once Per Turn] When attack targets change, if this Digimon has [Greymon] in its name, trash your opponent's top security card.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 54 - 2
Assets/CardEffect/EX10/Red/EX10_010.cs

@@ -1,6 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using System;
+using System.Linq;
 
 //Wargreymon ACE
 namespace DCGO.CardEffects.EX10
@@ -124,6 +125,54 @@ namespace DCGO.CardEffects.EX10
                 {
                     Permanent thisPermanent = card.PermanentOfThisCard();
 
+                    #region Setup Immunity
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return FieldCondition();
+                    }
+
+                    bool CardCondition(CardSource cardSource)
+                    {
+                        if (cardSource == card)
+                        {
+                            if (CardEffectCommons.IsExistOnBattleArea(card))
+                            {
+                                if (cardSource == card.PermanentOfThisCard().TopCard)
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    bool SkillCondition(ICardEffect cardEffect)
+                    {
+                        if (CardEffectCommons.IsOpponentEffect(cardEffect, card))
+                        {
+                            if (cardEffect.IsDigimonEffect)
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    bool FieldCondition()
+                    {
+                        return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                               CardEffectCommons.HasMatchConditionPermanent(OpponentsPermanent);
+                    }
+
+                    CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
+                    canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's Digimon's effects", CanUseCondition, card);
+                    canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardCondition, SkillCondition: SkillCondition);
+
+                    #endregion
+
                     bool OpponentsPermanent(Permanent permanent)
                     {
                         return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
@@ -135,15 +184,18 @@ namespace DCGO.CardEffects.EX10
                         if (CardEffectCommons.HasMatchConditionPermanent(OpponentsPermanent))
                         {
                             thisPermanent.AddBoost(new Permanent.DPBoost("AT_EX10-010", 3000, null));
+                            cardEffects.Add(canNotAffectedClass);
                         }
                         else
                         {
-                            thisPermanent.RemoveBoost("AT_EX10-010");
+                            if (thisPermanent.Boosts.Exists(x => x.ID == "AT_EX10-010")) thisPermanent.RemoveBoost("AT_EX10-010");
+                            if (cardEffects.Contains(canNotAffectedClass)) cardEffects.Remove(canNotAffectedClass);
                         }
                     }
                     else
                     {
-                        thisPermanent.RemoveBoost("AT_EX10-010");
+                        if (thisPermanent.Boosts.Exists(x => x.ID == "AT_EX10-010")) thisPermanent.RemoveBoost("AT_EX10-010");
+                        if (cardEffects.Contains(canNotAffectedClass)) cardEffects.Remove(canNotAffectedClass);
                     }
                 }
             }

+ 16 - 4
Assets/Scripts/CardSource.cs

@@ -3683,10 +3683,10 @@ public class CardSource : MonoBehaviour
         get
         {
             return EqualsTraits("Undead");
-		}
-	}
-	
-	#endregion
+        }
+    }
+
+    #endregion
 
     #region whether this card has "Galaxy" trait
 
@@ -3711,6 +3711,18 @@ public class CardSource : MonoBehaviour
     }
 
     #endregion
+
+    #region whether this card has Twilight trait
+
+    public bool HasTwilightTrait
+    {
+        get
+        {
+            return EqualsTraits("Twilight");
+        }
+    }
+
+    #endregion
 }
 
 public class JogressCondition