mbunch_kascope 1 год назад
Родитель
Сommit
2f7ad8fd2d

+ 0 - 1
Assets/CardEffect/EX2/Black/EX2_038.cs

@@ -25,7 +25,6 @@ namespace DCGO.CardEffects.EX2
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    UnityEngine.Debug.Log($"CAN USE CONDITION: {CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card)}");
                     return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 

+ 2 - 4
Assets/CardEffect/EX8/Black/EX8_054.cs

@@ -98,7 +98,7 @@ namespace DCGO.CardEffects.EX8
                             if (!source.ContainsCardName("Justimon"))
                                 continue;
 
-                            List<ICardEffect> effects = source.EffectList(EffectTiming.OnEnterFieldAnyone)
+                            List<ICardEffect> effects = source.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
                             .Clone()
                             .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsWhenDigivolving);
 
@@ -165,8 +165,6 @@ namespace DCGO.CardEffects.EX8
                                     {
                                         Hashtable effectHashtable = CardEffectCommons.WhenDigivolvingCheckHashtableOfCard(card);
 
-                                        UnityEngine.Debug.Log($"CAN USE: {selectedEffect.CanUseCondition(effectHashtable)}");
-
                                         if (selectedEffect.CanUse(effectHashtable))
                                         {
                                             yield return ContinuousController.instance.StartCoroutine(((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
@@ -174,7 +172,7 @@ namespace DCGO.CardEffects.EX8
                                     }
                                 }
                             }
-                        }
+                        }                        
                     }
                 }
             }

+ 69 - 52
Assets/CardEffect/EX8/Purple/EX8_059.cs

@@ -140,79 +140,96 @@ namespace DCGO.CardEffects.EX8
 
                                 if (selectedPermanent != null)
                                 {
-                                    ActivateClass activateClass1 = new ActivateClass();
-                                    activateClass1.SetUpICardEffect("Trash 1 card in your hand.", GivenEffectCanUseCondition, selectedPermanent.TopCard);
-                                    activateClass1.SetUpActivateClass(
-                                        GivenEffectCanActivateCondition,
-                                        GivenEffectActivateCoroutine,
-                                        -1,
-                                        false, GivenEffectDescription());
-                                    activateClass1.SetEffectSourcePermanent(selectedPermanent);
-                                    selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
-
                                     if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
                                     {
                                         yield return ContinuousController.instance.StartCoroutine(GManager.instance
                                             .GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
                                     }
 
-                                    string GivenEffectDescription()
+                                    AddSkillClass addSkillClass = new AddSkillClass();
+                                    addSkillClass.SetUpICardEffect("Trash 1 card in your hand", CanUseCondition1, card);
+                                    addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
+
+                                    card.Owner.UntilOpponentTurnEndEffects.Add((_timing) => addSkillClass);
+
+                                    bool CanUseCondition1(Hashtable hashtable)
                                     {
-                                        return "[On Deletion] Trash 1 card in your hand.";
+                                        return true;
                                     }
 
-                                    bool GivenEffectCanUseCondition(Hashtable hashtable)
+                                    bool CardSourceCondition(CardSource cardSource)
                                     {
-                                        return CardEffectCommons.CanTriggerOnDeletion(hashtable, selectedPermanent.TopCard);
+                                        return (cardSource == selectedPermanent.TopCard) &&
+                                               !selectedPermanent.TopCard.CanNotBeAffected(activateClass);
                                     }
 
-                                    bool GivenEffectCanActivateCondition(Hashtable hashtable1)
+                                    List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
                                     {
-                                        if (CardEffectCommons.CanActivateOnDeletion(selectedPermanent.TopCard))
+
+                                        if (_timing == EffectTiming.OnDestroyedAnyone)
                                         {
-                                            if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
+                                            ActivateClass activateClass1 = new ActivateClass();
+                                            activateClass1.SetUpICardEffect("Trash 1 card in your hand.", GivenEffectCanUseCondition, cardSource);
+                                            activateClass1.SetUpActivateClass(GivenEffectCanActivateCondition, GivenEffectActivateCoroutine, -1, false, GivenEffectDescription());
+                                            activateClass1.SetEffectSourceCard(cardSource);
+                                            cardEffects.Add(activateClass1);
+
+                                            if (cardSource.PermanentOfThisCard() != null)
                                             {
-                                                return true;
+                                                activateClass1.SetEffectSourcePermanent(cardSource.PermanentOfThisCard());
                                             }
-                                        }
 
-                                        return false;
-                                    }
+                                            string GivenEffectDescription()
+                                            {
+                                                return "[On Deletion] Trash 1 card in your hand.";
+                                            }
 
-                                    IEnumerator GivenEffectActivateCoroutine(Hashtable _hashtable)
-                                    {
-                                        if (selectedPermanent.TopCard.Owner.HandCards.Count >= 1)
-                                        {
-                                            int discardCount = 1;
-
-                                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                                            selectHandEffect.SetUp(
-                                                selectPlayer: selectedPermanent.TopCard.Owner,
-                                                canTargetCondition: (cardSource) => true,
-                                                canTargetCondition_ByPreSelecetedList: null,
-                                                canEndSelectCondition: null,
-                                                maxCount: discardCount,
-                                                canNoSelect: false,
-                                                canEndNotMax: false,
-                                                isShowOpponent: true,
-                                                selectCardCoroutine: null,
-                                                afterSelectCardCoroutine: null,
-                                                mode: SelectHandEffect.Mode.Discard,
-                                                cardEffect: activateClass);
-
-                                            yield return StartCoroutine(selectHandEffect.Activate());
-                                        }
-                                    }
+                                            bool GivenEffectCanUseCondition(Hashtable hashtable)
+                                            {
+                                                return CardEffectCommons.CanTriggerOnDeletion(hashtable, cardSource);
+                                            }
 
-                                    ICardEffect GetCardEffect(EffectTiming _timing)
-                                    {
-                                        if (_timing == EffectTiming.OnDestroyedAnyone)
-                                        {
-                                            return activateClass1;
+                                            bool GivenEffectCanActivateCondition(Hashtable hashtable1)
+                                            {
+                                                if (CardEffectCommons.CanActivateOnDeletion(cardSource))
+                                                {
+                                                    if (!cardSource.CanNotBeAffected(activateClass))
+                                                    {
+                                                        return true;
+                                                    }
+                                                }
+
+                                                return false;
+                                            }
+
+                                            IEnumerator GivenEffectActivateCoroutine(Hashtable _hashtable)
+                                            {
+                                                if (cardSource.Owner.HandCards.Count >= 1)
+                                                {
+                                                    int discardCount = 1;
+
+                                                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                                    selectHandEffect.SetUp(
+                                                        selectPlayer: cardSource.Owner,
+                                                        canTargetCondition: (cardSource) => true,
+                                                        canTargetCondition_ByPreSelecetedList: null,
+                                                        canEndSelectCondition: null,
+                                                        maxCount: discardCount,
+                                                        canNoSelect: false,
+                                                        canEndNotMax: false,
+                                                        isShowOpponent: true,
+                                                        selectCardCoroutine: null,
+                                                        afterSelectCardCoroutine: null,
+                                                        mode: SelectHandEffect.Mode.Discard,
+                                                        cardEffect: activateClass);
+
+                                                    yield return StartCoroutine(selectHandEffect.Activate());
+                                                }
+                                            }
                                         }
 
-                                        return null;
+                                        return cardEffects;
                                     }
                                 }
                             }

+ 1 - 4
Assets/CardEffect/P/Black/P_159.cs

@@ -122,10 +122,7 @@ namespace DCGO.CardEffects.P
 
                 bool HasDigimon(Permanent permanent)
                 {
-                    if(CardEffectCommons.IsOwnerPermanent(permanent, card))
-                        return permanent.IsDigimon;
-                    
-                    return false;
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 2 - 2
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:e8c55960c101b5118524a2057f775c9dbc5a298da0d0df9d53b0ed0853c050ae
-size 20168
+oid sha256:65eb3ebe97e6934f0108a138338d6d39bd210179f10278929e41bf2dd622e8c1
+size 20166