Ver código fonte

Updates to LM cards

mbunch_kascope 2 anos atrás
pai
commit
322fcbeed0

+ 32 - 34
Assets/CardEffect/LM/Blue/Amphimon_LM_005.cs

@@ -93,6 +93,7 @@ namespace DCGO.CardEffects.LM
                 {
                     List<CardSource> discardedCards = new List<CardSource>();
 
+                    int maxCount = Math.Min(4, card.Owner.HandCards.Count(CanSelectCardCondition));
                     SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
                     selectHandEffect.SetUp(
@@ -100,7 +101,7 @@ namespace DCGO.CardEffects.LM
                         canTargetCondition: CanSelectCardTrashingCondition,
                         canTargetCondition_ByPreSelecetedList: null,
                         canEndSelectCondition: null,
-                        maxCount: 4,
+                        maxCount: maxCount,
                         canNoSelect: true,
                         canEndNotMax: false,
                         isShowOpponent: true,
@@ -118,41 +119,38 @@ namespace DCGO.CardEffects.LM
                         yield return null;
                     }
 
-                    if (discardedCards.Count >= 1)
+                    foreach (CardSource cardSource in discardedCards)
                     {
-                        foreach (CardSource cardSource in discardedCards)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
-                                permanentCondition: CanSelectPermanentCondition,
-                                cardCondition: CanSelectCardCondition,
-                                maxCount: 1,
-                                canNoTrash: false,
-                                isFromOnly1Permanent: true,
-                                activateClass: activateClass
-                            ));
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
+                            permanentCondition: CanSelectPermanentCondition,
+                            cardCondition: CanSelectCardCondition,
+                            maxCount: 1,
+                            canNoTrash: false,
+                            isFromOnly1Permanent: true,
+                            activateClass: activateClass
+                        ));
+                    }
 
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectBounceCondition))
-                        {
-                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectBounceCondition));
-
-                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                            selectPermanentEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: CanSelectBounceCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: maxCount,
-                                canNoSelect: false,
-                                canEndNotMax: false,
-                                selectPermanentCoroutine: null,
-                                afterSelectPermanentCoroutine: null,
-                                mode: SelectPermanentEffect.Mode.Bounce,
-                                cardEffect: activateClass);
-
-                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                        }
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectBounceCondition))
+                    {
+                        int maxBounceCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectBounceCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectBounceCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxBounceCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Bounce,
+                            cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }
                 }
             }

+ 9 - 1
Assets/CardEffect/LM/Blue/Jellymon_LM_002.cs

@@ -36,7 +36,15 @@ namespace DCGO.CardEffects.LM
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)

+ 24 - 11
Assets/CardEffect/LM/Blue/TeslaJellymon_LM_003.cs

@@ -26,10 +26,12 @@ namespace DCGO.CardEffects.LM
                 {
                     if (permanent == AttackingPermanent)
                     {
-                        if (DefendingCard != null)
-                        {
-                            return true;
-                        }
+                        return true;
+                    }
+
+                    if (permanent == DefendingPermanent)
+                    {
+                        return true;
                     }
 
                     return false;
@@ -44,6 +46,19 @@ namespace DCGO.CardEffects.LM
                     return false;
                 }
 
+                bool PermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
+                    {
+                        if(permanent.TopCard == card)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
@@ -95,14 +110,12 @@ namespace DCGO.CardEffects.LM
 
                     if (discarded)
                     {
-                        yield return CardEffectFactory.CanNotBeDestroyedByBattleStaticEffect(
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBeDeletedPlayerEffect(
+                            permanentCondition: PermanentCondition,
                             canNotBeDestroyedByBattleCondition: CanNotBeDestroyedByBattleCondition,
-                            permanentCondition: null,
-                            isInheritedEffect: false,
-                            card: card,
-                            condition: null,
-                            effectName: "Can't be deleted by battle"
-                        );
+                            effectDuration: EffectDuration.UntilOwnerTurnEnd,
+                            activateClass: activateClass,
+                            effectName: "Can't be deleted by battle"));
                     }
                 }
             }

+ 12 - 6
Assets/CardEffect/LM/Green/Airdramon_LM_009.cs

@@ -16,7 +16,7 @@ namespace DCGO.CardEffects.LM
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Reduce Play/Digivolution Cost", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 activateClass.SetHashString("PlayDigivolutionCost-_LM_009");
                 cardEffects.Add(activateClass);
 
@@ -34,7 +34,7 @@ namespace DCGO.CardEffects.LM
                 {
                     if (CardEffectCommons.IsExistOnHand(cardSource))
                     {
-                        if (cardSource.CardNames.Contains("Angoramon"))
+                        if (cardSource.HasText("Angoramon"))
                             return true;
                     }
 
@@ -42,7 +42,7 @@ namespace DCGO.CardEffects.LM
                 }
                 bool DigivolveCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.CardNames.Contains("Angoramon"))
+                    if (cardSource.HasText("Angoramon"))
                         return true;
 
                     return false;
@@ -134,9 +134,15 @@ namespace DCGO.CardEffects.LM
                             {
                                 if (cardSource != null)
                                 {
-                                    if (cardSource == card)
+                                    if (cardSource.Owner == card.Owner)
                                     {
-                                        return true;
+                                        if (cardSource.IsDigimon)
+                                        {
+                                            if (cardSource.HasText("Angoramon"))
+                                            {
+                                                return true;
+                                            }
+                                        }
                                     }
                                 }
 
@@ -179,7 +185,7 @@ namespace DCGO.CardEffects.LM
                 {
                     if(CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent,card))
                     {
-                        return permanent.TopCard.CardNames.Contains("Angoramon");
+                        return permanent.TopCard.HasText("Angoramon");
                     }
 
                     return false;

+ 15 - 2
Assets/CardEffect/LM/Green/Angoramon_LM_008.cs

@@ -22,9 +22,22 @@ namespace DCGO.CardEffects.LM
                     return "[Start of Your Main Phase] If you have a Tamer, gain 1 memory.";
                 }
 
+                bool HasTamerCondition(Permanent permanent)
+                {
+                    return permanent.IsTamer;
+                }
+
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return card.Owner.CanAddMemory(activateClass);
+                    if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasTamerCondition))
+                    {
+                        if(card.Owner.CanAddMemory(activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
@@ -58,7 +71,7 @@ namespace DCGO.CardEffects.LM
                         {
                             if(card.PermanentOfThisCard().TopCard != card)
                             {
-                                if (card.PermanentOfThisCard().TopCard.CardNames.Contains("Angoramon"))
+                                if (card.PermanentOfThisCard().TopCard.HasText("Angoramon"))
                                 {
                                     return true;
                                 }

+ 1 - 1
Assets/CardEffect/LM/Green/Chamblemon_LM_010.cs

@@ -61,7 +61,7 @@ namespace DCGO.CardEffects.LM
                             canEndNotMax: false,
                             selectPermanentCoroutine: null,
                             afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Custom,
+                            mode: SelectPermanentEffect.Mode.Tap,
                             cardEffect: activateClass);
 
                         selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer to suspend.", "The opponent is selecting 1 Tamer to suspend.");

+ 2 - 2
Assets/CardEffect/LM/Green/Lamortmon_LM_012.cs

@@ -61,7 +61,7 @@ namespace DCGO.CardEffects.LM
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition))
+                    if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanentCondition))
                     {
                         int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
 
@@ -84,7 +84,7 @@ namespace DCGO.CardEffects.LM
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectUnsuspendCondition))
+                        if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectUnsuspendCondition))
                         {
                             int blockerCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectUnsuspendCondition));
 

+ 2 - 1
Assets/CardEffect/LM/Green/SymbareAngoramon_LM_011.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using UnityEngine;
 
 namespace DCGO.CardEffects.LM
 {
@@ -61,7 +62,7 @@ namespace DCGO.CardEffects.LM
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition))
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     {
                         int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
 

+ 1 - 6
Assets/CardEffect/LM/Yellow/Publimon_LM_007.cs

@@ -24,12 +24,7 @@ namespace DCGO.CardEffects.LM
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        return true;
-                    }
-
-                    return false;
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)

+ 4 - 4
Assets/CardEffect/LM/Yellow/Quantumon_LM_020.cs

@@ -244,17 +244,17 @@ namespace DCGO.CardEffects.LM
                             message: "",
                             mode: SelectCardEffect.Mode.Custom,
                             maxCount: -1,
-                            selectCardCoroutine: RevealedCardsCoroutine),
+                            selectCardCoroutine: null),
                         remainingCardsPlace: RemainingCardsPlace.DeckTopOrBottom,
                         activateClass: activateClass,
-                        revealedCardsCoroutine: null,
+                        revealedCardsCoroutine: RevealedCardsCoroutine,
                         refSelectedCards: null,
                         isOpponentDeck: true
                     ));
 
-                    IEnumerator RevealedCardsCoroutine(CardSource revealedCard)
+                    IEnumerator RevealedCardsCoroutine(List<CardSource> revealedCards)
                     {
-                        if (revealedCard.CardKind.Equals(selectedCategory))
+                        if (revealedCards[0].CardKind.Equals(selectedCategory))
                         {
                             CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
                             canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's Digimon's effects", CanUseCondition, card);