mbunch_kascope 2 роки тому
батько
коміт
beb174f4c5

+ 3 - 3
Assets/CardEffect/BT16/Black/Dorimon_BT16_005.cs

@@ -80,12 +80,12 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    Debug.Log($"ActivateCoroutine");
                     List<Hashtable> hashtables = CardEffectCommons.GetHashtablesFromHashtable(hashtable);
 
                     if (hashtables != null)
-                    {
-                        yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(hashtables.Count, activateClass));
+                    {   
+                        if(hashtables.Count > 0)
+                            yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
                     }
                 }
             }

+ 20 - 62
Assets/CardEffect/EX2/Red/MatsudaTakato_EX2_056.cs

@@ -79,7 +79,7 @@ public class MatsudaTakato_EX2_056 : CEntity_Effect
                 return "[Your Turn] When one of your Digimon would digivolve into a Digimon with [Gallantmon] or [Growlmon] in its name, that Digimon gains \"[When Digivolving] <Blitz> (This Digimon can attack when your opponent has 1 or more memory.)\" for the turn.";
             }
 
-            bool PermanentCondition(Permanent permanent)
+            bool DigivolvePermanentCondition(Permanent permanent)
             {
                 return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card);
             }
@@ -103,7 +103,7 @@ public class MatsudaTakato_EX2_056 : CEntity_Effect
                 {
                     if (CardEffectCommons.IsOwnerTurn(card))
                     {
-                        if (CardEffectCommons.CanTriggerWhenPermanentWouldDigivolve(hashtable, PermanentCondition, CardCondition))
+                        if (CardEffectCommons.CanTriggerWhenPermanentWouldDigivolve(hashtable, DigivolvePermanentCondition, CardCondition))
                         {
                             return true;
                         }
@@ -137,72 +137,30 @@ public class MatsudaTakato_EX2_056 : CEntity_Effect
 
                 List<Permanent> Permanents = CardEffectCommons.GetPermanentsFromHashtable(_hashtable);
 
-                if (Permanents != null)
+                bool PermanentCondition(Permanent permanent)
                 {
-                    if (Permanents.Count(CardEffectCommons.IsPermanentExistsOnBattleArea) >= 1)
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
-                        bool PermanentCondition(Permanent permanent)
+                        if (Permanents.Contains(permanent))
                         {
-                            if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
-                            {
-                                if (Permanents.Contains(permanent))
-                                {
-                                    return true;
-                                }
-                            }
-
-                            return false;
+                            return true;
                         }
+                    }
 
-                        foreach (Permanent permanent in card.Owner.GetBattleAreaPermanents())
+                    return false;
+                }
+
+                if (Permanents != null)
+                {
+                    if (Permanents.Count(PermanentCondition) >= 1)
+                    {
+                        foreach (Permanent permanent in card.Owner.GetBattleAreaPermanents().Filter(PermanentCondition))
                         {
-                            if (PermanentCondition(permanent))
-                            {
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateBuffEffect(permanent));
-
-                                yield return new WaitForSeconds(0.2f);
-
-                                AddSkillClass addSkillClass = new AddSkillClass();
-                                addSkillClass.SetUpICardEffect("Gain Blitz", CanUseCondition1, card);
-                                addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
-                                CardEffectCommons.AddEffectToPermanent(targetPermanent: permanent, effectDuration: EffectDuration.UntilEachTurnEnd, card: card, cardEffect: addSkillClass, timing: EffectTiming.None);
-
-                                bool CanUseCondition1(Hashtable hashtable)
-                                {
-                                    return true;
-                                }
-
-                                bool CardSourceCondition(CardSource cardSource)
-                                {
-                                    if (PermanentCondition(cardSource.PermanentOfThisCard()))
-                                    {
-                                        if (cardSource == cardSource.PermanentOfThisCard().TopCard)
-                                        {
-                                            return true;
-                                        }
-                                    }
-
-                                    return false;
-                                }
-
-                                List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
-                                {
-                                    if (_timing == EffectTiming.OnEnterFieldAnyone)
-                                    {
-                                        bool Condition()
-                                        {
-                                            return CardSourceCondition(cardSource);
-                                        }
-
-                                        cardEffects.Add(CardEffectFactory.BlitzSelfEffect(isInheritedEffect: false,
-                                            card: cardSource,
-                                            condition: Condition,
-                                            isWhenDigivolving: true));
-                                    }
-
-                                    return cardEffects;
-                                }
-                            }
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlitz(
+                                targetPermanent: permanent,
+                                effectDuration: EffectDuration.UntilEachTurnEnd,
+                                activateClass: activateClass,
+                                isWhenDigivolving:true));
                         }
                     }
                 }

+ 4 - 0
Assets/CardEffect/EX6/Black/Kakkinmon_EX6_005.cs

@@ -32,8 +32,10 @@ namespace DCGO.CardEffects.EX6
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
+                    Debug.Log($"Kakkinmon_EX6 - CanUseCondtion: {CardEffectCommons.IsOwnerTurn(card)}");
                     if (CardEffectCommons.IsOwnerTurn(card))
                     {
+                        Debug.Log($"Kakkinmon_EX6 - CanUseCondtion: {card.PermanentOfThisCard().DigivolutionCards.Count(HasLegendArms)}");
                         return card.PermanentOfThisCard().DigivolutionCards.Count(HasLegendArms) > 0;
                     }
 
@@ -42,11 +44,13 @@ namespace DCGO.CardEffects.EX6
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
+                    Debug.Log($"Kakkinmon_EX6 - CanActivateCondition: {CardEffectCommons.IsExistOnBattleAreaDigimon(card)}");
                     return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
+                    Debug.Log($"Kakkinmon_EX6 - ActivateCoroutine");
                     SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                     selectCardEffect.SetUp(

+ 22 - 4
Assets/CardEffect/EX6/Purple/Gate_of_Deadly_Sins_EX6_006.cs

@@ -64,6 +64,7 @@ namespace DCGO.CardEffects.EX6
             {
                 if (CardEffectCommons.IsExistOnBreedingArea(card))
                 {
+                    /*
                     int count()
                     {
                         List<CardSource> DigivolutionCards = card.PermanentOfThisCard().DigivolutionCards;
@@ -100,14 +101,14 @@ namespace DCGO.CardEffects.EX6
                         }
                         return DigivolutionCards.Count;
                     }
-
+                    */
 
                     int reduceCount = 3;
 
-                    if (count() >= 5)
+                    /*if (count() >= 5)
                     {
                         reduceCount = 4;
-                    }
+                    }*/
 
 
                     if (reduceCount >= 1)
@@ -172,7 +173,24 @@ namespace DCGO.CardEffects.EX6
 
                     if(count() >= 5)
                     {
-                        reduceCount = 4;
+                        List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>
+                        {
+                            new(message: "4", value: true, spriteIndex: 0),
+                            new(message: "3", value: false, spriteIndex: 1),
+                        };
+
+                        string selectPlayerMessage = "Which cost reduction do you want to use?";
+                        string notSelectPlayerMessage = "The opponent is choosing which cost reduction to use.";
+
+                        GManager.instance.userSelectionManager.SetBoolSelection(
+                            selectionElements: selectionElements, selectPlayer: card.Owner,
+                            selectPlayerMessage: selectPlayerMessage,
+                            notSelectPlayerMessage: notSelectPlayerMessage);
+
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                        if (GManager.instance.userSelectionManager.SelectedBoolValue)
+                            reduceCount = 4;
                     }
 
 

+ 5 - 4
Assets/CardEffect/EX6/Purple/Ogudomon_EX6_073.cs

@@ -65,12 +65,12 @@ namespace DCGO.CardEffects.EX6
 
                 return false;
             }
-
+            //if (digivolutionCards.Count((filteredCard) =>  filteredCard.CardNames.Concat(cardSource.CardNames).Distinct().ToList().Count > 0) == 0)
             bool CanSelectTrashCardCondition(CardSource cardSource)
             {
                 if (HasSevenGreatDemonLordsTrait(cardSource))
                 {
-                    if (digivolutionCards.Count((filteredCard) => filteredCard.CardNames.Concat(cardSource.CardNames).Distinct().ToList().Count > 0) == 0)
+                    if(!digivolutionCards.Some(filteredCard => filteredCard != cardSource && cardSource.HasSameCardName(filteredCard)))
                     {
                         return true;
                     }
@@ -326,7 +326,7 @@ namespace DCGO.CardEffects.EX6
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Delete 7 Digimon/Tamers, Then Trash 7 security. For each card deleted, reduce that number by 1", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -383,6 +383,7 @@ namespace DCGO.CardEffects.EX6
                     selectCardEffect.SetNotShowCard();
 
                     yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
                     IEnumerator SelectCardCoroutine(CardSource cardSource)
                     {
                         selectedCards.Add(cardSource);
@@ -430,7 +431,7 @@ namespace DCGO.CardEffects.EX6
                     }
                     #endregion
 
-                    if (deletedPermanents.Count < 7)
+                    if (returnedToLibrary && deletedPermanents.Count < 7)
                     {
                         yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
                             player: card.Owner.Enemy,

+ 6 - 19
Assets/CardEffect/EX6/Red/RagnaLoardmonAce_EX6_011.cs

@@ -175,20 +175,7 @@ namespace DCGO.CardEffects.EX6
                     {
                         if (CardEffectCommons.IsOpponentEffect(cardEffect, card))
                         {
-                            if (cardEffect.IsDigimonEffect)
-                            {
-                                return true;
-                            }
-                            
-                            if (cardEffect.EffectSourceCard.IsOption)
-                            {
-                                return true;
-                            }
-                            
-                            if (cardEffect.IsTamerEffect)
-                            {
-                                return true;
-                            }
+                            return true;
                         }
                     }
                 }
@@ -237,7 +224,7 @@ namespace DCGO.CardEffects.EX6
                     
                     // This Digimon isn't affected by your opponent's effects until the end of their turn.
                     CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
-                    canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's Digimon's effects",
+                    canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's effects",
                         CanUseImmunitySharedCondition, card);
                     canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardImmunitySharedCondition,
                         SkillCondition: SkillImmunitySharedCondition);
@@ -320,13 +307,13 @@ namespace DCGO.CardEffects.EX6
                     
                     // This Digimon isn't affected by your opponent's effects until the end of their turn.
                     CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
-                    canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's Digimon's effects",
+                    canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's effects",
                         CanUseImmunitySharedCondition, card);
                     canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardImmunitySharedCondition,
                         SkillCondition: SkillImmunitySharedCondition);
-                    cardEffects.Add(canNotAffectedClass);
-                    
-                    
+                    card.PermanentOfThisCard().UntilOpponentTurnEndEffects.Add(_ => canNotAffectedClass);
+
+
                     // if DNA Digivolving
                     if (CardEffectCommons.IsJogress(hashtable))
                     {

+ 4 - 1
Assets/CardEffect/EX6/Yellow/Lucemon_EX6_018.cs

@@ -275,7 +275,10 @@ namespace DCGO.CardEffects.EX6
                             cardSource.ContainsCardName("Lucemon Chaos Mode") ||
                             cardSource.ContainsCardName("LucemonChaosMode"))
                         {
-                            return true;
+                            if (cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, false, activateClass, SelectCardEffect.Root.Trash))
+                            {
+                                return true;
+                            }
                         }
                     }
                     

+ 2 - 15
Assets/CardEffect/EX6/Yellow/MastemonAce_EX6_029.cs

@@ -411,21 +411,8 @@ namespace DCGO.CardEffects.EX6
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (card.Owner.HandCards.Count(IsCardAngelCondition) >= 1)
-                        {
-                            return true;
-                        }
-                        
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsCardAngelCondition))
-                        {
-                            return true;
-                        }
-                    }
-                    
-                    return false;
+                {                    
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
                 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 7 - 16
Assets/CardEffect/EX6/Yellow/SeraphimonAce_EX6_028.cs

@@ -135,15 +135,14 @@ namespace DCGO.CardEffects.EX6
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Return 1 of your opponent's Digimon to the hand", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false,
-                    EffectDescription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
                 activateClass.SetHashString("ReturnToHand_EX6_028");
                 cardEffects.Add(activateClass);
                 
                 string EffectDescription()
                 {
                     return
-                        "[Your Turn][Once Per Turn] When a card is added to your security stack, return 1 of your opponent's Digimon with a level as high or lower than the number of cards in your security stack to the hand.";
+                        "[All Turns] [Once per Turn] When a card is added to your security stack, return 1 of your opponent's Digimon with as high or lower a level as the number of your security cards to the hand.";
                 }
                 
                 bool CanSelectOpponentPermanentCondition(Permanent permanent)
@@ -164,14 +163,11 @@ namespace DCGO.CardEffects.EX6
                 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (CardEffectCommons.IsOwnerTurn(card))
+                        if (CardEffectCommons.CanTriggerWhenAddSecurity(hashtable, player => player == card.Owner))
                         {
-                            if (CardEffectCommons.CanTriggerWhenAddSecurity(hashtable, player => player == card.Owner))
-                            {
-                                return true;
-                            }
+                            return true;
                         }
                     }
                     
@@ -179,13 +175,8 @@ namespace DCGO.CardEffects.EX6
                 }
                 
                 bool CanActivateCondition(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        return true;
-                    }
-                    
-                    return false;
+                {                   
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
                 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 2 - 5
Assets/CardEffect/P/Black/DiaboromonAce_P_114.cs

@@ -1,10 +1,7 @@
+using System;
 using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
 using System.Linq;
-using Photon;
-using System;
-using Photon.Pun;
 
 public class DiaboromonAce_P_114 : CEntity_Effect
 {
@@ -62,7 +59,7 @@ public class DiaboromonAce_P_114 : CEntity_Effect
 
             string EffectDiscription()
             {
-                return "[When Digivolving] You may play 1 [Diaboromon] Token without paying its memory cost (Diaboromon Tokens are level 6 white Digimon with a memory cost of 14, 3000 DP, and are Mega form, Unidentified type, and Unknown attribute).";
+                return "[When Attacking] You may play 1 [Diaboromon] Token without paying its memory cost (Diaboromon Tokens are level 6 white Digimon with a memory cost of 14, 3000 DP, and are Mega form, Unidentified type, and Unknown attribute).";
             }
 
             bool CanUseCondition(Hashtable hashtable)

+ 45 - 0
Assets/Scripts/CardEffectCommons/KeyWordEffects/Blitz.cs

@@ -46,4 +46,49 @@ public partial class CardEffectCommons
         }
     }
     #endregion
+
+    #region Target 1 Digimon gains [Blitz]
+    public static IEnumerator GainBlitz(Permanent targetPermanent, EffectDuration effectDuration, ICardEffect activateClass, bool isWhenDigivolving)
+    {
+        if (targetPermanent == null) yield break;
+        if (!IsPermanentExistsOnBattleArea(targetPermanent)) yield break;
+        if (activateClass == null) yield break;
+        if (activateClass.EffectSourceCard == null) yield break;
+
+        CardSource card = activateClass.EffectSourceCard;
+
+        bool CanUseCondition()
+        {
+            if (IsPermanentExistsOnBattleArea(targetPermanent))
+            {
+                if (!targetPermanent.TopCard.CanNotBeAffected(activateClass))
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        ActivateClass blitz = CardEffectFactory.BlitzEffect(
+            targetPermanent: targetPermanent,
+            isInheritedEffect: false,
+            condition: CanUseCondition,
+            isWhenDigivolving: isWhenDigivolving,
+            rootCardEffect: activateClass,
+            card: targetPermanent.TopCard);
+
+        AddEffectToPermanent(
+            targetPermanent: targetPermanent,
+            effectDuration: effectDuration,
+            card: card,
+            cardEffect: blitz,
+            timing: EffectTiming.OnEnterFieldAnyone);
+
+        if (!targetPermanent.TopCard.CanNotBeAffected(activateClass))
+        {
+            yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateBuffEffect(targetPermanent));
+        }
+    }
+    #endregion
 }

+ 1 - 3
Assets/Scripts/CardEffectFactory/KeyWordEffects/Blitz.cs

@@ -1,8 +1,6 @@
+using System;
 using System.Collections;
 using System.Collections.Generic;
-using System;
-using System.Linq;
-using UnityEngine;
 
 public partial class CardEffectFactory
 {