Explorar o código

several bug fixes from 1.2.1 testing

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

+ 6 - 4
Assets/CardEffect/BT12/Purple/BaalmonXAntibody_BT12_082.cs

@@ -172,9 +172,6 @@ public class BaalmonXAntibody_BT12_082 : CEntity_Effect
 
             IEnumerator ActivateCoroutine(Hashtable _hashtable)
             {
-                if (card.Owner.LibraryCards.Count >= 1)
-                    yield return ContinuousController.instance.StartCoroutine(new IAddTrashCardsFromLibraryTop(3, card.Owner, activateClass).AddTrashCardsFromLibraryTop());
-
                 if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Baalmon") || cardSource.CardNames.Contains("X Antibody") || cardSource.CardNames.Contains("XAntibody")) >= 1)
                 {
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
@@ -198,7 +195,12 @@ public class BaalmonXAntibody_BT12_082 : CEntity_Effect
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }
-                }                
+                }
+                else
+                {
+                    if (card.Owner.LibraryCards.Count >= 1)
+                        yield return ContinuousController.instance.StartCoroutine(new IAddTrashCardsFromLibraryTop(3, card.Owner, activateClass).AddTrashCardsFromLibraryTop());
+                }
             }
         }
 

+ 2 - 2
Assets/CardEffect/BT15/Black/Machinedramon_BT15_066.cs

@@ -21,7 +21,7 @@ public class Machinedramon_BT15_066 : CEntity_Effect
 
             string EffectDiscription()
             {
-                return "[When Digivolving] Trigger <De-Digivolve 2> on 1 of your opponent's Digimon. (Trash up to 2 card from the top of one of your opponent's Digimon. If it has no digivolution cards, or becomes a level 3 Digimon, you can't trash any more cards.)";
+                return "[On Play] Trigger <De-Digivolve 2> on 1 of your opponent's Digimon. (Trash up to 2 card from the top of one of your opponent's Digimon. If it has no digivolution cards, or becomes a level 3 Digimon, you can't trash any more cards.)";
             }
 
             bool CanSelectPermanentCondition(Permanent permanent)
@@ -90,7 +90,7 @@ public class Machinedramon_BT15_066 : CEntity_Effect
 
             string EffectDiscription()
             {
-                return "[When Digivolving] Trigger <De-Digivolve 2> on 1 of your opponent's Digimon. (Trash up to 1 card from the top of one of your opponent's Digimon. If it has no digivolution cards, or becomes a level 3 Digimon, you can't trash any more cards.)";
+                return "[When Attacking] Trigger <De-Digivolve 2> on 1 of your opponent's Digimon. (Trash up to 1 card from the top of one of your opponent's Digimon. If it has no digivolution cards, or becomes a level 3 Digimon, you can't trash any more cards.)";
             }
 
             bool CanSelectPermanentCondition(Permanent permanent)

+ 1 - 1
Assets/CardEffect/BT16/Purple/Soloogarmon_BT16_076.cs

@@ -313,7 +313,7 @@ namespace DCGO.CardEffects.BT16
                     {
                         if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => (cardSource.CardTraits.Contains("SoC") && cardSource.IsTamer)) >= 1)
                         {
-                            return true;
+                            return CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectFenriInTrash);
                         }
                     }
 

+ 12 - 1
Assets/CardEffect/BT9/Purple/Dracmon_BT9_071.cs

@@ -103,7 +103,18 @@ public class Dracmon_BT9_071 : CEntity_Effect
 
             bool CanSelectCardCondition(CardSource cardSource)
             {
-                return cardSource.IsDigimon && (cardSource.CardTraits.Contains("Undead") || cardSource.CardTraits.Contains("DarkAnimal") || cardSource.CardTraits.Contains("Dark Animal"));
+                if (cardSource.IsDigimon)
+                {
+                    if(cardSource.CardTraits.Contains("Undead") || cardSource.CardTraits.Contains("DarkAnimal") || cardSource.CardTraits.Contains("Dark Animal"))
+                    {
+                        if (cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, false, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+                }
+
+                return false;
             }
 
             bool CanUseCondition(Hashtable hashtable)

+ 22 - 15
Assets/CardEffect/BT9/Purple/Sangurumon_BT9_073.cs

@@ -1,10 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
-using System.Linq;
-using Photon;
-using System;
-using Photon.Pun;
+
 public class Sangurumon_BT9_073 : CEntity_Effect
 {
     public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
@@ -26,7 +22,18 @@ public class Sangurumon_BT9_073 : CEntity_Effect
 
             bool CanSelectCardCondition(CardSource cardSource)
             {
-                return cardSource.IsDigimon && (cardSource.CardTraits.Contains("Undead") || cardSource.CardTraits.Contains("DarkAnimal") || cardSource.CardTraits.Contains("Dark Animal"));
+                if (cardSource.IsDigimon)
+                {
+                    if (cardSource.CardTraits.Contains("Undead") || cardSource.CardTraits.Contains("DarkAnimal") || cardSource.CardTraits.Contains("Dark Animal"))
+                    {
+                        if (cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, false, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+                }
+
+                return false;
             }
 
             bool CanUseCondition(Hashtable hashtable)
@@ -50,15 +57,15 @@ public class Sangurumon_BT9_073 : CEntity_Effect
             IEnumerator ActivateCoroutine(Hashtable _hashtable)
             {
                 yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
-                    targetPermanent: card.PermanentOfThisCard(),
-                    cardCondition: CanSelectCardCondition,
-                    payCost: true,
-                    reduceCostTuple: null,
-                    fixedCostTuple: null,
-                    ignoreDigivolutionRequirementFixedCost: -1,
-                    isHand: false,
-                    activateClass: activateClass,
-                    successProcess: null));
+                        targetPermanent: card.PermanentOfThisCard(),
+                        cardCondition: CanSelectCardCondition,
+                        payCost: true,
+                        reduceCostTuple: null,
+                        fixedCostTuple: null,
+                        ignoreDigivolutionRequirementFixedCost: -1,
+                        isHand: false,
+                        activateClass: activateClass,
+                        successProcess: null));
             }
         }
 

+ 13 - 10
Assets/CardEffect/EX2/Purple/AiAndMakoto_EX2_065.cs

@@ -83,16 +83,19 @@ public class AiAndMakoto_EX2_065 : CEntity_Effect
                     {
                         if (GManager.instance.attackProcess.AttackingPermanent.TopCard.CardNames.Contains("Beelzemon"))
                         {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
-                                                targetPermanent: GManager.instance.attackProcess.AttackingPermanent,
-                                                cardCondition: CanSelectCardCondition,
-                                                payCost: true,
-                                                reduceCostTuple: null,
-                                                fixedCostTuple: (fixedCost: 3, fixedCostCardCondition: null),
-                                                ignoreDigivolutionRequirementFixedCost: -1,
-                                                isHand: false,
-                                                activateClass: activateClass,
-                                                successProcess: null));
+                            if(CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                    targetPermanent: GManager.instance.attackProcess.AttackingPermanent,
+                                    cardCondition: CanSelectCardCondition,
+                                    payCost: true,
+                                    reduceCostTuple: null,
+                                    fixedCostTuple: (fixedCost: 3, fixedCostCardCondition: null),
+                                    ignoreDigivolutionRequirementFixedCost: -1,
+                                    isHand: false,
+                                    activateClass: activateClass,
+                                    successProcess: null));
+                            }
                         }
                     }
                 }

+ 77 - 46
Assets/CardEffect/EX6/Green/Turuiemon_EX6_033.cs

@@ -26,7 +26,7 @@ namespace DCGO.CardEffects.EX6
             }
             #endregion
 
-            #region On Play/When Digivolving
+            #region On Play
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -36,76 +36,107 @@ namespace DCGO.CardEffects.EX6
 
                 string EffectDiscription()
                 {
-                    return "[On Play] [When Digivolving] You may suspend 1 Digimon.";
+                    return "[On Play] You may suspend 1 Digimon.";
                 }
 
-                bool CanUseCondition(Hashtable hashtable)
+                bool PermanentCondition(Permanent permanent)
                 {
-                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card) || CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(permanent.TopCard);
                 }
 
-                bool PermanentCondition(Permanent permanent)
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) || CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
-                    {
-                        return true;
-                    }
-                    return false;
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        return true;
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
-                        {
-                            new SelectionElement<bool>(message: $"Yes", value : true, spriteIndex: 0),
-                            new SelectionElement<bool>(message: $"No", value : false, spriteIndex: 1),
-                        };
+                    if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
+                    {
+
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: PermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Tap,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to suspend.", "The opponent is selecting 1 Digimon to suspend.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+                }
+            }
+            #endregion
 
-                    string selectPlayerMessage = "Will you suspend 1 Digimon?";
-                    string notSelectPlayerMessage = "The opponent is choosing whether or not to suspend a Digimon.";
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Suspend 1 Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
 
-                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] You may suspend 1 Digimon.";
+                }
 
-                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                bool PermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(permanent.TopCard);
+                }
 
-                    bool willSuspend = GManager.instance.userSelectionManager.SelectedBoolValue;
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
 
-                    if (willSuspend)
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
                     {
-                        if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
-                        {
 
-                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentCondition));
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentCondition));
 
-                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                            selectPermanentEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: PermanentCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                maxCount: maxCount,
-                                canNoSelect: false,
-                                canEndNotMax: false,
-                                selectPermanentCoroutine: null,
-                                afterSelectPermanentCoroutine: null,
-                                mode: SelectPermanentEffect.Mode.Tap,
-                                cardEffect: activateClass);
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: PermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Tap,
+                            cardEffect: activateClass);
 
-                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to suspend.", "The opponent is selecting 1 Digimon to suspend.");
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to suspend.", "The opponent is selecting 1 Digimon to suspend.");
 
-                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }
                 }
             }

+ 2 - 9
Assets/CardEffect/EX6/Yellow/TK_Takaishi_And_Kari_Kamiya_EX6_063.cs

@@ -182,21 +182,14 @@ namespace DCGO.CardEffects.EX6
                 
                 string EffectDescription()
                 {
-                    return
-                        "[Your Turn] When one of your Digimon is played or digivolves, if it has the [Angel]/[Archangel]/[Three Great Angels] trait, by suspending this Tamer, gain 1 memory.";
+                    return "[Your Turn] When one of your Digimon is played or digivolves, if it has the [Angel]/[Archangel]/[Three Great Angels] trait, by suspending this Tamer, gain 1 memory.";
                 }
                 
                 bool PermanentCondition(Permanent permanent)
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
-                        if (permanent.TopCard.ContainsTraits("Angel") ||
-                            permanent.TopCard.ContainsTraits("Archangel") ||
-                            permanent.TopCard.ContainsTraits("Three Great Angels") ||
-                            permanent.TopCard.ContainsTraits("ThreeGreatAngels"))
-                        {
-                            return true;
-                        }
+                        return permanent.TopCard.HasAngelTraitRestrictive;
                     }
                     
                     return false;

+ 1 - 9
Assets/CardEffect/ST17/Green/Cherubimon_ST17_09.cs

@@ -112,15 +112,7 @@ namespace DCGO.CardEffects.ST17
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleArea(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)

+ 2 - 26
Assets/CardEffect/ST17/Green/Terriermon_ST17_02.cs

@@ -82,7 +82,7 @@ namespace DCGO.CardEffects.ST17
                     #region reduce play cost
                     ChangeCostClass changeCostClass = new ChangeCostClass();
                     changeCostClass.SetUpICardEffect($"Play Cost -2", CanUseCondition1, card);
-                    changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                    changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CanSelectCardCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
                     Func<EffectTiming, ICardEffect> getCardEffect = GetCardEffect;
                     card.Owner.UntilCalculateFixedCostEffect.Add(getCardEffect);
 
@@ -103,7 +103,7 @@ namespace DCGO.CardEffects.ST17
 
                     int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
                     {
-                        if (CardSourceCondition(cardSource))
+                        if (CanSelectCardCondition(cardSource))
                         {
                             if (RootCondition(root))
                             {
@@ -135,30 +135,6 @@ namespace DCGO.CardEffects.ST17
                         return false;
                     }
 
-                    bool CardSourceCondition(CardSource cardSource)
-                    {
-                        if (cardSource.IsTamer)
-                        {
-                            if (cardSource.CardColors.Contains(CardColor.Green))
-                            {
-                                return true;
-                            }
-                        }
-
-                        if (cardSource.IsDigimon)
-                        {
-                            if (cardSource.Level == 3)
-                            {
-                                if (cardSource.CardNames.Contains("Lopmon"))
-                                {
-                                    return true;
-                                }
-                            }
-                        }
-
-                        return false;
-                    }
-
                     bool RootCondition(SelectCardEffect.Root root)
                     {
                         return true;

+ 3 - 2
Assets/Editor/AttachCardData.cs

@@ -12,7 +12,7 @@ public class AttachCardData : MonoBehaviour
     {
         List<CEntity_Base> List = GetAsset.LoadAll<CEntity_Base>("Assets/CardBaseEntity/");
 
-        List<string> UnimplementedCardIDs = new List<string>() { "P-137", "P-138", "P-139", "P-140", "P-141", "P-142" };
+        List<string> UnimplementedCardSpriteNames = new List<string>() { "P-147", "P-137", "P-138", "P-139", "P-140", "P-141", "P-142" };
 
         foreach (GameObject obj in Selection.gameObjects)
         {
@@ -27,8 +27,9 @@ public class AttachCardData : MonoBehaviour
 
                 foreach (CEntity_Base cEntity_Base in List)
                 {
-                    if (UnimplementedCardIDs.Contains(cEntity_Base.CardID))
+                    if (UnimplementedCardSpriteNames.Contains(cEntity_Base.CardSpriteName))
                     {
+                        Debug.Log(cEntity_Base.CardID);
                         continue;
                     }
 

+ 0 - 2
Assets/Scenes/ContinuousControllerScene.unity

@@ -4087,7 +4087,6 @@ MonoBehaviour:
   - {fileID: 11400000, guid: b7a798ffb8160e544a113e8eccbe0ee7, type: 2}
   - {fileID: 11400000, guid: b712bc580903ca844805cea3f9196c43, type: 2}
   - {fileID: 11400000, guid: 08bffc393060c28459d64bea8e6e4979, type: 2}
-  - {fileID: 11400000, guid: 5da84928e2535f040bd80220ca2d5397, type: 2}
   - {fileID: 11400000, guid: fa218108d5366e2448103b258fb9c890, type: 2}
   - {fileID: 11400000, guid: 1fc84f81a0a0d844e8aa1b091bb634fe, type: 2}
   - {fileID: 11400000, guid: 99de8b57fc534a740a455255aad17046, type: 2}
@@ -7911,7 +7910,6 @@ MonoBehaviour:
   - {fileID: 11400000, guid: dceb2592a41528d4d99d5ab25f096fe1, type: 2}
   - {fileID: 11400000, guid: b712bc580903ca844805cea3f9196c43, type: 2}
   - {fileID: 11400000, guid: 08bffc393060c28459d64bea8e6e4979, type: 2}
-  - {fileID: 11400000, guid: 5da84928e2535f040bd80220ca2d5397, type: 2}
   - {fileID: 11400000, guid: fa218108d5366e2448103b258fb9c890, type: 2}
   - {fileID: 11400000, guid: 1fc84f81a0a0d844e8aa1b091bb634fe, type: 2}
   - {fileID: 11400000, guid: c2f6a08dd624c264881c9261a4d1ec8d, type: 2}