Explorar o código

Final updates to LM cards

mbunch_kascope %!s(int64=2) %!d(string=hai) anos
pai
achega
c63f374004

+ 7 - 0
Assets/AddOn/GlitchFx-master/GlitchFx.unitypackage.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: d80f995af690a474e841364c1e88ee1b
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 5
Assets/CardEffect/BT5/White/ShiromineNokia_BT5_092.cs

@@ -224,17 +224,20 @@ public class ShiromineNokia_BT5_092 : CEntity_Effect
 
                         bool PermanentCondition(Permanent targetPermanent)
                         {
-                            if (targetPermanent.TopCard != null)
+                            if(targetPermanent != null)
                             {
-                                if (targetPermanent.TopCard.Owner == card.Owner)
+                                if (targetPermanent.TopCard != null)
                                 {
-                                    if (targetPermanent.TopCard.Owner.GetBattleAreaPermanents().Contains(targetPermanent))
+                                    if (targetPermanent.TopCard.Owner == card.Owner)
                                     {
-                                        return true;
+                                        if (targetPermanent.TopCard.Owner.GetBattleAreaPermanents().Contains(targetPermanent))
+                                        {
+                                            return true;
+                                        }
                                     }
                                 }
                             }
-
+                            
                             return false;
                         }
 

+ 71 - 64
Assets/CardEffect/LM/Green/Airdramon_LM_009.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using UnityEngine;
 using System.Linq;
 
 namespace DCGO.CardEffects.LM
@@ -27,7 +28,15 @@ namespace DCGO.CardEffects.LM
 
                 bool PermanentCondition(Permanent permanent)
                 {
-                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card);
+                    if(CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent != card.PermanentOfThisCard())
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
                 }
 
                 bool PlayCardCondition(CardSource cardSource)
@@ -40,9 +49,11 @@ namespace DCGO.CardEffects.LM
 
                     return false;
                 }
+
                 bool DigivolveCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.HasText("Angoramon"))
+                    if (cardSource.IsDigimon)
+                        if (cardSource.HasText("Angoramon"))
                         return true;
 
                     return false;
@@ -50,14 +61,17 @@ namespace DCGO.CardEffects.LM
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if(CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, PlayCardCondition))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        return true;
-                    }
+                        if (CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, PlayCardCondition))
+                        {
+                            return true;
+                        }
 
-                    if(CardEffectCommons.CanTriggerWhenPermanentWouldDigivolve(hashtable, PermanentCondition, DigivolveCardCondition))
-                    {
-                        return true;
+                        if (CardEffectCommons.CanTriggerWhenPermanentWouldDigivolve(hashtable, PermanentCondition, DigivolveCardCondition))
+                        {
+                            return true;
+                        }
                     }
 
                     return false;
@@ -69,7 +83,10 @@ namespace DCGO.CardEffects.LM
                     {
                         if(CardEffectCommons.IsExistOnBattleArea(card))
                         {
-                            return true;
+                            if (CardEffectCommons.CanActivateSuspendCostEffect(card))
+                            {
+                                return true;
+                            }
                         }
                     }
 
@@ -78,90 +95,80 @@ namespace DCGO.CardEffects.LM
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
+
                     if(CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
+                        if (!card.PermanentOfThisCard().IsSuspended && card.PermanentOfThisCard().CanSuspend)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
                             new List<Permanent>() { card.PermanentOfThisCard() },
                             CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
 
-                        if (card.PermanentOfThisCard().IsSuspended)
-                        {
-                            ChangeCostClass changeCostClass = new ChangeCostClass();
-                            changeCostClass.SetUpICardEffect("Cost -2", CanUseChangeCostCondition, card);
-                            changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
-                            card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
-
-                            bool CanUseChangeCostCondition(Hashtable hashtable)
+                            if (card.PermanentOfThisCard().IsSuspended)
                             {
-                                return true;
-                            }
+                                ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
 
-                            int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
-                            {
-                                if (CardSourceCondition(cardSource))
+                                ChangeCostClass changeCostClass = new ChangeCostClass();
+                                changeCostClass.SetUpICardEffect("Cost -2", CanUseChangeCostCondition, card);
+                                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                                card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
+
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
+
+                                bool CanUseChangeCostCondition(Hashtable hashtable)
                                 {
-                                    if (RootCondition(root))
+                                    return true;
+                                }
+
+                                int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                                {
+                                    if (CardSourceCondition(cardSource))
                                     {
-                                        if (PermanentsCondition(targetPermanents))
+                                        if (RootCondition(root))
                                         {
-                                            Cost -= 2;
+                                            if (PermanentsCondition(targetPermanents))
+                                            {
+                                                Cost -= 2;
+                                            }
                                         }
                                     }
-                                }
 
-                                return Cost;
-                            }
-
-                            bool PermanentsCondition(List<Permanent> targetPermanents)
-                            {
-                                if (targetPermanents == null)
-                                {
-                                    return true;
+                                    return Cost;
                                 }
 
-                                else
+                                bool PermanentsCondition(List<Permanent> targetPermanents)
                                 {
-                                    if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
+                                    if (targetPermanents != null)
                                     {
                                         return true;
                                     }
-                                }
 
-                                return false;
-                            }
+                                    return false;
+                                }
 
-                            bool CardSourceCondition(CardSource cardSource)
-                            {
-                                if (cardSource != null)
+                                bool CardSourceCondition(CardSource cardSource)
                                 {
-                                    if (cardSource.Owner == card.Owner)
+                                    if (cardSource != null)
                                     {
-                                        if (cardSource.IsDigimon)
+                                        if (cardSource.Owner == card.Owner)
                                         {
-                                            if (cardSource.HasText("Angoramon"))
-                                            {
-                                                return true;
-                                            }
+                                            return true;
                                         }
                                     }
-                                }
 
-                                return false;
-                            }
-
-                            bool RootCondition(SelectCardEffect.Root root)
-                            {
-                                return true;
-                            }
-
-                            bool isUpDown()
-                            {
-                                return true;
-                            }
+                                    return false;
+                                }
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
+                                bool RootCondition(SelectCardEffect.Root root)
+                                {
+                                    return true;
+                                }
 
-                            yield return null;
+                                bool isUpDown()
+                                {
+                                    return true;
+                                }
+                            }  
                         }
                     }
                 }

+ 35 - 69
Assets/CardEffect/LM/Green/Diarbbitmon_LM_013.cs

@@ -181,28 +181,29 @@ namespace DCGO.CardEffects.LM
 
                     if (selectedCards.Count > 0)
                     {
-                        CardSource playedCard = selectedCards[0];
+                        Permanent selectedPermanent = selectedCards[0].PermanentOfThisCard();
 
-                        AddSkillClass addSkillClass = new AddSkillClass();
-                        addSkillClass.SetUpICardEffect("Return to hand", CanUseReturnCondition, card);
-                        addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
-                        card.Owner.UntilOpponentTurnEndEffects.Add((_timing) => addSkillClass);
+                        ActivateClass activateClass1 = new ActivateClass();
+                        activateClass1.SetUpICardEffect("Attack with this Digimon", CanUseCondition1, selectedPermanent.TopCard);
+                        activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
+                        activateClass1.SetEffectSourcePermanent(selectedPermanent);
+                        selectedPermanent.UntilOpponentTurnEndEffects.Add(GetCardEffect);
 
-                        string EffectDiscription1()
+                        if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
                         {
-                            return "[End of Opponent's Turn] Return this Digimon to the hand.";
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
                         }
 
-                        bool CanUseReturnCondition(Hashtable hashtable)
+                        string EffectDiscription1()
                         {
-                            return true;
+                            return "[End of Opponent's Turn] Return this Digimon to the hand.";
                         }
 
-                        bool CardSourceCondition(CardSource cardSource)
+                        bool CanUseCondition1(Hashtable hashtable1)
                         {
-                            if (cardSource.CanNotBeAffected(addSkillClass))
+                            if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
                             {
-                                if (cardSource == cardSource.PermanentOfThisCard().TopCard)
+                                if (GManager.instance.turnStateMachine.gameContext.TurnPlayer != selectedPermanent.TopCard.Owner)
                                 {
                                     return true;
                                 }
@@ -211,76 +212,41 @@ namespace DCGO.CardEffects.LM
                             return false;
                         }
 
-                        bool CanActivateCondition(Hashtable hashtable)
+                        bool CanActivateCondition1(Hashtable hashtable1)
                         {
-                            if (CardEffectCommons.IsExistOnBattleArea(playedCard))
+                            if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
                             {
-                                return true;
+                                if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
+                                {
+                                    return true;
+                                }
                             }
 
                             return false;
                         }
 
-                        List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                        IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
                         {
-                            if (_timing == EffectTiming.OnEndTurn)
+                            if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
                             {
-                                ActivateClass activateReturnClass = new ActivateClass();
-                                activateReturnClass.SetUpICardEffect("Return to hand", CanUseReturnCondition, cardSource);
-                                activateReturnClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription1());
-                                cardEffects.Add(activateReturnClass);
-
-                                if (cardSource.PermanentOfThisCard() != null)
-                                {
-                                    activateReturnClass.SetEffectSourcePermanent(cardSource.PermanentOfThisCard());
-                                }
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BouncePeremanentAndProcessAccordingToResult(
+                                    targetPermanents: new List<Permanent>() { selectedPermanent },
+                                    activateClass: activateClass1,
+                                    successProcess: null,
+                                    failureProcess: null));
+                            }
+                        }
 
-                                IEnumerator ActivateCoroutine(Hashtable _hashtable)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BouncePeremanentAndProcessAccordingToResult(
-                                        targetPermanents: new List<Permanent>() { playedCard.PermanentOfThisCard() },
-                                        activateClass: activateClass,
-                                        successProcess: null,
-                                        failureProcess: null));
-
-                                    /*IEnumerator SuccessProcess()
-                                    {
-                                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                                        bool CanSelectPermanentCondition1(Permanent permanent)
-                                        {
-                                            if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
-                                            {
-                                                if (playedCard.PermanentOfThisCard().LevelJustBeforeRemoveField > 0)
-                                                {
-                                                    return true;
-                                                }
-                                            }
-
-                                            return false;
-                                        }
-
-                                        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.Bounce,
-                                                cardEffect: activateClass);
-
-                                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                                    }*/
-                                }
+                        ICardEffect GetCardEffect(EffectTiming _timing)
+                        {
+                            if (_timing == EffectTiming.OnEndTurn)
+                            {
+                                return activateClass1;
                             }
 
-                            return cardEffects;
+                            return null;
                         }
-}
+                    }
                 }
             }
             #endregion

+ 37 - 59
Assets/CardEffect/LM/Purple/Regulusmon_LM_017.cs

@@ -189,29 +189,16 @@ namespace DCGO.CardEffects.LM
                     return false;
                 }
 
-                bool CanSelectCardCondition(CardSource cardSource)
-                {
-                    if (CardEffectCommons.IsExistOnTrash(cardSource))
-                    {
-                        if (cardSource.Owner == card.Owner)
-                            return cardSource.IsDigimon && cardSource.Level <= 4;
-                    }
-                    return false;
-                }
-
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    Debug.Log($"CanUseCondition");
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        Debug.Log($"CanUseCondition: Exists");
                         if (CardEffectCommons.CanTriggerOnAddDigivolutionCard(
                                 hashtable: hashtable,
                                 permanentCondition: permanent => permanent == card.PermanentOfThisCard(),
                                 cardEffectCondition: cardEffect => cardEffect.EffectSourceCard != null,
                                 cardCondition: null))
                         {
-                            Debug.Log($"CanUseCondition: Can Trigger OnAddDigivolution");
                             return true;
                         }
                     }
@@ -258,69 +245,60 @@ namespace DCGO.CardEffects.LM
 
                     IEnumerator SuccessProcess()
                     {
-                        ActivateClass activateByClass = new ActivateClass();
-                        activateByClass.SetUpICardEffect("Play 1 Digimon", CanUseByCondition, card);
-                        activateByClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
-                        cardEffects.Add(activateByClass);
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        List<CardSource> selectedCards = new List<CardSource>();
 
-                        bool CanUseByCondition(Hashtable hashtable)
+                        bool CanSelectCardCondition(CardSource cardSource)
                         {
-                            if (CardEffectCommons.IsExistOnBattleArea(card))
+                            if (CardEffectCommons.IsExistOnTrash(cardSource))
                             {
-                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
+                                if (cardSource.Owner == card.Owner)
                                 {
-                                    return true;
+                                    return cardSource.IsDigimon && cardSource.Level <= 4;
                                 }
-                            }
 
+
+                            }
                             return false;
                         }
 
-                        IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                        selectCardEffect.SetUp(
+                            canTargetCondition: CanSelectCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            message: "Select 1 Digimon card to play.",
+                            maxCount: 1,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            mode: SelectCardEffect.Mode.Custom,
+                            root: SelectCardEffect.Root.Trash,
+                            customRootCardList: null,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                        selectCardEffect.SetUpCustomMessage("Select 1 Digimon to play.", "The opponent is selecting 1 Digimon card to play.");
+
+                        yield return StartCoroutine(selectCardEffect.Activate());
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
                         {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            List<CardSource> selectedCards = new List<CardSource>();
-
-                            selectCardEffect.SetUp(
-                                canTargetCondition: CanSelectCardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: SelectCardCoroutine,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 Digimon card to play.",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.Custom,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to play.", "The opponent is selecting 1 Digimon card to play.");
-
-                            yield return StartCoroutine(selectPermanentEffect.Activate());
-
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
+                            selectedCards.Add(cardSource);
 
-                                yield return null;
-                            }
+                            yield return null;
+                        }
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
                                 cardSources: selectedCards,
-                                activateClass: activateByClass,
+                                activateClass: activateClass,
                                 payCost: false,
                                 isTapped: false,
                                 root: SelectCardEffect.Root.Trash,
                                 activateETB: true));
-                        }
-
-                        yield return null;
                     }
                 }
             }