Jelajahi Sumber

Remaining Black card bugs, small performance update

mbunch_kascope 2 tahun lalu
induk
melakukan
a3204f9f35

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

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

+ 4 - 15
Assets/CardEffect/EX6/Black/BryweLudramon_EX6_044.cs

@@ -2,6 +2,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
+using UnityEngine;
 
 namespace DCGO.CardEffects.EX6
 {
@@ -81,18 +82,6 @@ namespace DCGO.CardEffects.EX6
                     return false;
                 }
 
-                bool IsEnemyPermanent(Permanent permanent)
-                {
-                    if(CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)){
-                        if(permanent.HasDP && permanent.DP <= card.PermanentOfThisCard().DP)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     if (CardEffectCommons.IsExistOnHand(card))
@@ -110,8 +99,6 @@ namespace DCGO.CardEffects.EX6
                 {
                     Permanent selectedPermanent = null;
 
-                    yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-3, activateClass));
-
                     if (CardEffectCommons.HasMatchConditionPermanent(IsLevel6OrHasLegendArmsTrait))
                     {
                         int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(IsLevel6OrHasLegendArmsTrait));
@@ -144,11 +131,13 @@ namespace DCGO.CardEffects.EX6
 
                     if (selectedPermanent != null)
                     {
+                        yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-3, activateClass));
+
                         yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(
                                 new List<CardSource>() { card },
                                 activateClass));
 
-                        List<Permanent> enemyPermanents = card.Owner.Enemy.GetBattleAreaDigimons().Where(IsEnemyPermanent).ToList();
+                        List<Permanent> enemyPermanents = card.Owner.Enemy.GetBattleAreaDigimons().Where(x => x.DP <= selectedPermanent.DP).ToList();
 
                         foreach(Permanent permanent in enemyPermanents)
                         {

+ 101 - 19
Assets/CardEffect/EX6/Black/Diaboromon_EX6_043.cs

@@ -58,7 +58,7 @@ namespace DCGO.CardEffects.EX6
 
                 string EffectDiscription()
                 {
-                    return "[Start of Your Main Phase] You may play 1 [Diaboromon] (Digimon | 14 Cost | Level 6 | White | Mega | Unknown | Unidentified | DP3000) Token without paying the cost.";
+                    return "[When Digivolving] You may play 1 [Diaboromon] (Digimon | 14 Cost | Level 6 | White | Mega | Unknown | Unidentified | DP3000) Token without paying the cost.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -91,7 +91,8 @@ namespace DCGO.CardEffects.EX6
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Activate 1 [When Digivolving] effect", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetHashString("PlayToken_EX6_043");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -116,30 +117,111 @@ namespace DCGO.CardEffects.EX6
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    //TODO: Add Magnamon X BT16 effect here
-                    yield return null;
+                    List<ICardEffect> candidateEffects = card.PermanentOfThisCard().EffectList(EffectTiming.OnEnterFieldAnyone)
+                        .Clone()
+                        .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsWhenDigivolving);
+
+                    if (candidateEffects.Count >= 1)
+                    {
+                        ICardEffect selectedEffect = null;
+
+                        if (candidateEffects.Count == 1)
+                        {
+                            selectedEffect = candidateEffects[0];
+                        }
+
+                        else
+                        {
+                            List<SkillInfo> skillInfos = candidateEffects
+                                .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
+
+                            List<CardSource> cardSources = candidateEffects
+                                .Map(cardEffect => cardEffect.EffectSourceCard);
+
+                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                                canTargetCondition: (cardSource) => true,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                canNoSelect: () => false,
+                                selectCardCoroutine: null,
+                                afterSelectCardCoroutine: null,
+                                message: "Select 1 effect to activate.",
+                                maxCount: 1,
+                                canEndNotMax: false,
+                                isShowOpponent: false,
+                                mode: SelectCardEffect.Mode.Custom,
+                                root: SelectCardEffect.Root.Custom,
+                                customRootCardList: cardSources,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
+
+                            selectCardEffect.SetNotShowCard();
+                            selectCardEffect.SetUpSkillInfos(skillInfos);
+                            selectCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
+
+                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
+                            IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
+                            {
+                                if (selectedIndexes.Count == 1)
+                                {
+                                    selectedEffect = candidateEffects[selectedIndexes[0]];
+                                    yield return null;
+                                }
+                            }
+                        }
+
+                        if (selectedEffect != null)
+                        {
+                            Hashtable effectHashtable = CardEffectCommons.WhenDigivolvingCheckHashtableOfCard(selectedEffect.EffectSourceCard);
+
+                            yield return ContinuousController.instance.StartCoroutine(
+                                ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
+
+                        }
+                    }
                 }
             }
 
             if (timing == EffectTiming.None)
             {
-                foreach(Permanent permanent in card.Owner.GetBattleAreaDigimons())
+                bool CanUseCondition()
                 {
-                    if(permanent.TopCard == card)
-                        continue;
-
-                    if(!permanent.HasBlocker)
-                        cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
-                            isInheritedEffect: false,
-                            card: permanent.TopCard,
-                            condition: null));
-
-                    if (!permanent.HasJamming)
-                        cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(
-                            isInheritedEffect: false,
-                            card: permanent.TopCard,
-                            condition: null));
+                    return CardEffectCommons.IsExistOnBattleArea(card);
                 }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent != card.PermanentOfThisCard())
+                        {
+                            if (permanent.TopCard.ContainsCardName("Diaboromon"))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.BlockerStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: CanUseCondition
+                ));
+
+                cardEffects.Add(CardEffectFactory.JammingStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: CanUseCondition
+                ));
             }
             #endregion
 

+ 5 - 5
Assets/CardEffect/EX6/Black/Infermon_EX6_041.cs

@@ -1,7 +1,6 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
-using System.Linq;
 
 namespace DCGO.CardEffects.EX6
 {
@@ -15,7 +14,7 @@ namespace DCGO.CardEffects.EX6
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Delete 1 [Diaboromon], Digivolve into a [Diaboromon]", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -106,7 +105,7 @@ namespace DCGO.CardEffects.EX6
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Delete 1 [Diaboromon], Digivolve into a [Diaboromon]", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -197,9 +196,10 @@ namespace DCGO.CardEffects.EX6
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpICardEffect("<De-Digivolve 1> 1 of your opponent's Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("DeDigivolve_EX6_041");
+                activateClass.SetIsInheritedEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 20 - 27
Assets/CardEffect/EX6/Black/Kakkinmon_EX6_005.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using UnityEngine;
 using System.Linq;
 
 namespace DCGO.CardEffects.EX6
@@ -46,43 +47,35 @@ namespace DCGO.CardEffects.EX6
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    CardSource selectedSource = null;
-
                     SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                     selectCardEffect.SetUp(
-                        canTargetCondition: null,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        canNoSelect: () => true,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        message: "Select 1 card with [Legend-Arms] trait to hand",
-                        maxCount: 1,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        mode: SelectCardEffect.Mode.AddHand,
-                        root: SelectCardEffect.Root.Custom,
-                        customRootCardList: card.PermanentOfThisCard().DigivolutionCards.Where(HasLegendArms).ToList(),
-                        canLookReverseCard: false,
-                        selectPlayer: card.Owner,
-                        cardEffect: activateClass);
+                                canTargetCondition: HasLegendArms,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                canNoSelect: () => true,
+                                selectCardCoroutine: null,
+                                afterSelectCardCoroutine: AfterSelectCardCoroutine,
+                                message: "Select 1 digivolution card to add to your hand.",
+                                maxCount: 1,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.AddHand,
+                                root: SelectCardEffect.Root.Custom,
+                                customRootCardList: card.PermanentOfThisCard().DigivolutionCards.Where(HasLegendArms).ToList(),
+                                canLookReverseCard: false,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
 
                     yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                     {
-                        if (cardSource != null)
-                            selectedSource = cardSource;
+                        if (cardSources.Count > 0)
+                            yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
 
                         yield return null;
                     }
-
-                    if(selectedSource != null)
-                    {
-                        yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
-                    }
-
                 }
             }
             #endregion

+ 15 - 3
Assets/CardEffect/EX6/Black/Keramon_EX6_036.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using UnityEngine;
 using System.Linq;
 
 namespace DCGO.CardEffects.EX6
@@ -111,9 +112,20 @@ namespace DCGO.CardEffects.EX6
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
-                {
-                    if(card.PermanentOfThisCard().TopCard.ContainsTraits("Unidentified"))
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayDiaboromonToken(activateClass));
+                {              
+                    List<Hashtable> deletionHashtables = CardEffectCommons.GetHashtablesFromHashtable(hashtable);
+
+                    if(deletionHashtables.Count > 0)
+                    {
+                        Hashtable hash = deletionHashtables[0];
+                        if (hash.ContainsKey("TopCard") && hash["TopCard"] is CardSource)
+                        {
+                            CardSource source = (CardSource)hash["TopCard"];
+
+                            if(card.ContainsTraits("Unidentified"))
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayDiaboromonToken(activateClass));
+                        }
+                    }
                 }
             }
             #endregion

+ 15 - 6
Assets/CardEffect/EX6/Black/Kurisarimon_EX6_039.cs

@@ -324,12 +324,9 @@ namespace DCGO.CardEffects.EX6
                 {
                     if (CardEffectCommons.CanActivateOnDeletionInherited(hashtable, card))
                     {
-                        if (card.PermanentOfThisCard().TopCard.ContainsTraits("Unidentified"))
+                        if (card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame()) >= 1)
                         {
-                            if (card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame()) >= 1)
-                            {
-                                return true;
-                            }
+                            return true;
                         }
                     }
 
@@ -338,7 +335,19 @@ namespace DCGO.CardEffects.EX6
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayDiaboromonToken(activateClass));
+                    List<Hashtable> deletionHashtables = CardEffectCommons.GetHashtablesFromHashtable(_hashtable);
+
+                    if (deletionHashtables.Count > 0)
+                    {
+                        Hashtable hash = deletionHashtables[0];
+                        if (hash.ContainsKey("TopCard") && hash["TopCard"] is CardSource)
+                        {
+                            CardSource source = (CardSource)hash["TopCard"];
+
+                            if (card.ContainsTraits("Unidentified"))
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayDiaboromonToken(activateClass));
+                        }
+                    }
                 }
             }
             #endregion

+ 2 - 2
Assets/CardEffect/EX6/Black/Ludomon_EX6_038.cs

@@ -69,8 +69,6 @@ namespace DCGO.CardEffects.EX6
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-1, activateClass));
-
                     if (CardEffectCommons.HasMatchConditionPermanent(IsLevel3OrHasLegendArmsTrait))
                     {
                         Permanent selectedPermanent = null;
@@ -104,6 +102,8 @@ namespace DCGO.CardEffects.EX6
 
                         if (selectedPermanent != null)
                         {
+                            yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-1, activateClass));
+
                             yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(
                                 new List<CardSource>() { card },
                                 activateClass));

+ 8 - 8
Assets/CardEffect/EX6/Black/RaijiLudomon_EX6_042.cs

@@ -154,14 +154,14 @@ namespace DCGO.CardEffects.EX6
                                 activateClass));
 
                             ActivateClass activateClass1 = new ActivateClass();
-                            activateClass1.SetUpICardEffect("Attack with this Digimon", CanUseCondition1, selectedPermanent.TopCard);
+                            activateClass1.SetUpICardEffect("Attack with this Digimon", CanUseCondition1, selectedEnemy.TopCard);
                             activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
-                            activateClass1.SetEffectSourcePermanent(selectedPermanent);
-                            selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect);
+                            activateClass1.SetEffectSourcePermanent(selectedEnemy);
+                            selectedEnemy.UntilOwnerTurnEndEffects.Add(GetCardEffect);
 
                             if (!selectedEnemy.TopCard.CanNotBeAffected(activateClass))
                             {
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
+                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedEnemy));
                             }
 
                             string EffectDiscription1()
@@ -171,11 +171,11 @@ namespace DCGO.CardEffects.EX6
 
                             bool CanUseCondition1(Hashtable hashtable1)
                             {
-                                if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
+                                if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedEnemy))
                                 {
-                                    if (selectedPermanent.TopCard.Owner.GetBattleAreaDigimons().Contains(selectedPermanent))
+                                    if (selectedEnemy.TopCard.Owner.GetBattleAreaDigimons().Contains(selectedEnemy))
                                     {
-                                        if (GManager.instance.turnStateMachine.gameContext.TurnPlayer == selectedPermanent.TopCard.Owner)
+                                        if (GManager.instance.turnStateMachine.gameContext.TurnPlayer == selectedEnemy.TopCard.Owner)
                                         {
                                             return true;
                                         }
@@ -210,7 +210,7 @@ namespace DCGO.CardEffects.EX6
                                         SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
 
                                         selectAttackEffect.SetUp(
-                                            attacker: selectedPermanent,
+                                            attacker: selectedEnemy,
                                             canAttackPlayerCondition: () => true,
                                             defenderCondition: (permanent) => true,
                                             cardEffect: activateClass1);

+ 15 - 24
Assets/CardEffect/EX6/Black/Spadamon_EX6_037.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using UnityEngine;
 using System.Linq;
 
 namespace DCGO.CardEffects.EX6
@@ -16,7 +17,7 @@ namespace DCGO.CardEffects.EX6
             {
                 static bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.CardNames.Contains("Shakuttomon") && targetPermanent.TopCard.CardNames.Contains("Kakkinmon");
+                    return targetPermanent.TopCard.ContainsCardName("Shakuttomon") || targetPermanent.TopCard.ContainsCardName("Kakkinmon");
                 }
 
                 cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
@@ -145,46 +146,36 @@ namespace DCGO.CardEffects.EX6
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    CardSource selectedSource = null;
-
                     if (card.Owner.HandCards.Count(HasLegendArmInTrait) > 0)
                     {
-                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
-                        selectCardEffect.SetUp(
-                            canTargetCondition: null,
+                        selectHandEffect.SetUp(
+                            canTargetCondition: HasLegendArmInTrait,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
-                            canNoSelect: () => true,
-                            selectCardCoroutine: SelectCardCoroutine,
-                            afterSelectCardCoroutine: null,
-                            message: "Discard 1 card with [Legend-Arms] trait to hand",
+                            canNoSelect: true,
+                            selectCardCoroutine: null,
+                            afterSelectCardCoroutine: AfterSelectCardCoroutine,
                             maxCount: 1,
                             canEndNotMax: false,
                             isShowOpponent: true,
-                            mode: SelectCardEffect.Mode.Discard,
-                            root: SelectCardEffect.Root.Hand,
-                            customRootCardList: card.Owner.HandCards.Where(HasLegendArmInTrait).ToList(),
-                            canLookReverseCard: false,
+                            mode: SelectHandEffect.Mode.Discard,
                             selectPlayer: card.Owner,
                             cardEffect: activateClass);
 
-                        yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                        selectHandEffect.SetUpCustomMessage("Select 1 card with [Legend-Arms] trait to discard.", "The opponent is selecting 1 card with [Legend-Arms] trait to discard.");
+                        
+                        yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
 
-                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
                         {
-                            if (cardSource != null)
-                                selectedSource = cardSource;
+                            if (cardSources.Count > 0)
+                                yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 2, activateClass).Draw());
 
                             yield return null;
                         }
-
-                        if (selectedSource != null)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 2, activateClass).Draw());
-                        }
                     }
-                    yield return null;
                 }
             }
             #endregion

+ 2 - 2
Assets/CardEffect/EX6/Black/TiaLudomon_EX6_040.cs

@@ -74,8 +74,6 @@ namespace DCGO.CardEffects.EX6
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-1, activateClass));
-                    
                     if (CardEffectCommons.HasMatchConditionPermanent(IsLevel3OrHasLegendArmsTrait))
                     {
                         Permanent selectedPermanent = null;
@@ -109,6 +107,8 @@ namespace DCGO.CardEffects.EX6
 
                         if (selectedPermanent != null)
                         {
+                            yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-1, activateClass));
+
                             yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(
                                 new List<CardSource>() { card },
                                 activateClass));

+ 2 - 0
Assets/Scripts/CardController.cs

@@ -3977,6 +3977,8 @@ public class SuspendPermanentsClass
         {
             permanent.IsSuspended = true;
 
+            GManager.OnCardSuspendedChanged?.Invoke(true);
+
             permanent.DPWhenSuspended = permanent.DP;
 
             if (permanent.ShowingPermanentCard != null)

+ 4 - 0
Assets/Scripts/CardSource.cs

@@ -48,6 +48,8 @@ public class CardSource : MonoBehaviour
     public void SetFace()
     {
         IsFlipped = false;
+
+        GManager.OnCardFlippedChanged?.Invoke();
     }
     #endregion
 
@@ -55,6 +57,8 @@ public class CardSource : MonoBehaviour
     public void SetReverse()
     {
         IsFlipped = true;
+
+        GManager.OnCardFlippedChanged?.Invoke();
     }
     #endregion
 

+ 118 - 70
Assets/Scripts/FieldPermanentCard.cs

@@ -7,6 +7,7 @@ using DG.Tweening;
 using UnityEngine.EventSystems;
 using TMPro;
 using System;
+using System.Diagnostics;
 
 public class FieldPermanentCard : MonoBehaviour
 {
@@ -160,6 +161,11 @@ public class FieldPermanentCard : MonoBehaviour
         }
 
         OffPermanentIndexText();
+        
+        //Events
+        GManager.OnReverseOpponentsCardsChanged += SetTransformRotation;
+        GManager.OnCardFlippedChanged += SetCardIsFlipped;
+        //GManager.OnCardSuspendedChanged += SetCardSuspended;
     }
 
     public IEnumerator ShowAddDigivolutionCardEffect()
@@ -243,7 +249,7 @@ public class FieldPermanentCard : MonoBehaviour
 
     #region Processing on click
 
-    #region クリックされた時の処理
+    #region Processing when clicked
     public void OnClick()
     {
         if (ThisPermanent != null)
@@ -272,14 +278,14 @@ public class FieldPermanentCard : MonoBehaviour
     }
     #endregion
 
-    #region クリックされた時の処理を追加
+    #region Added processing when clicked
     public void AddClickTarget(UnityAction<FieldPermanentCard> _OnClickAction)
     {
         OnClickAction = _OnClickAction;
     }
     #endregion
 
-    #region クリックされた時の処理を削除
+    #region Delete the process when clicked
     public void RemoveClickTarget()
     {
         OnClickAction = null;
@@ -292,113 +298,148 @@ public class FieldPermanentCard : MonoBehaviour
     {
         ThisPermanent = permanent;
 
+        SetTransformRotation();
+        SetCardIsFlipped();
         ShowPermanentData(updateIsTapped);
     }
     #endregion
 
     #region Reflect permanent data on UI
     bool _oldTurnSuspendedCards = false;
-    public async void ShowPermanentData(bool updateIsTapped)
+
+    void SetTransformRotation()
     {
         if (ThisPermanent == null)
-        {
             return;
-        }
 
-        if (ThisPermanent.TopCard != null)
-        {
-            // reverse opponent's card
-            if (!ThisPermanent.TopCard.Owner.isYou)
-            {
-                if (ContinuousController.instance != null)
-                {
-                    if (ContinuousController.instance.reverseOpponentsCards)
-                    {
-                        Parent.transform.localRotation = Quaternion.Euler(new Vector3(0, 0, 180));
-                    }
+        if (ThisPermanent.TopCard == null)
+            return;
 
-                    else
-                    {
-                        Parent.transform.localRotation = Quaternion.Euler(new Vector3(0, 0, 0));
-                    }
-                }
-            }
+        if (ThisPermanent.TopCard.Owner.isYou)
+            return;
 
-            // card image
-            if (ThisPermanent.TopCard.IsFlipped)
-            {
+        if (ContinuousController.instance == null)
+            return;
+
+
+        if (ContinuousController.instance.reverseOpponentsCards)
+            Parent.transform.localRotation = Quaternion.Euler(new Vector3(0, 0, 180));
+        else
+            Parent.transform.localRotation = Quaternion.Euler(new Vector3(0, 0, 0));
+    }
+
+    async void SetCardIsFlipped()
+    {
+        if (ThisPermanent == null)
+            return;
+
+        if (ThisPermanent.TopCard == null)
+            return;
+
+        if (ContinuousController.instance == null)
+            return;
+
+        // card image
+        if (ThisPermanent.TopCard.IsFlipped)
+        {
+            if (CardImage.sprite != ContinuousController.instance.ReverseCard)
                 CardImage.sprite = ContinuousController.instance.ReverseCard;
-            }
+        }
 
-            else
-            {
-                CardImage.sprite = await ThisPermanent.TopCard.GetCardSprite();
-            }
+        else
+        {
+            CardImage.sprite = await ThisPermanent.TopCard.GetCardSprite();
+        }
 
+        if(CardImage != null)
             CardImage.gameObject.SetActive(true);
+    }
 
-            //タップ
-            if (ThisPermanent.IsSuspended)
+    void SetCardSuspended(bool updateIsTapped)
+    {
+        if (ThisPermanent == null)
+            return;
+
+        if (ThisPermanent.TopCard == null)
+            return;
+
+        if (ContinuousController.instance == null)
+            return;
+
+        if (ThisPermanent.IsSuspended)
+        {
+            if (TapObject != null)
+                TapObject.SetActive(true);
+
+            if (updateIsTapped)
             {
-                if (TapObject != null)
-                {
-                    TapObject.SetActive(true);
-                }
+                bool turnSuspendedCards = ContinuousController.instance != null && ContinuousController.instance.turnSuspendedCards;
 
-                if (updateIsTapped)
+                if (anim != null)
                 {
-                    bool turnSuspendedCards = ContinuousController.instance != null && ContinuousController.instance.turnSuspendedCards;
-
-                    if (anim != null)
+                    if (ThisPermanent.OldIsSuspended != ThisPermanent.IsSuspended || _oldTurnSuspendedCards != turnSuspendedCards)
                     {
-                        if (ThisPermanent.OldIsSuspended != ThisPermanent.IsSuspended || _oldTurnSuspendedCards != turnSuspendedCards)
-                        {
-                            ThisPermanent.OldIsSuspended = ThisPermanent.IsSuspended;
-                            _oldTurnSuspendedCards = turnSuspendedCards;
+                        ThisPermanent.OldIsSuspended = ThisPermanent.IsSuspended;
+                        _oldTurnSuspendedCards = turnSuspendedCards;
 
-                            if (turnSuspendedCards)
-                            {
+                        if (turnSuspendedCards)
+                        {
+                            if (anim.GetInteger("Tap") != 1)
                                 anim.SetInteger("Tap", 1);
-                            }
+                        }
 
-                            else
-                            {
+                        else
+                        {
+                            if (anim.GetInteger("Tap") != -1)
                                 anim.SetInteger("Tap", -1);
-                            }
                         }
                     }
                 }
             }
+        }
 
-            else
-            {
-                if (TapObject != null)
-                {
-                    TapObject.SetActive(false);
-                }
+        else
+        {
+            if (TapObject != null)
+                TapObject.SetActive(false);
 
-                if (ContinuousController.instance != null)
+            if (ContinuousController.instance != null)
+            {
+                if (ContinuousController.instance.turnSuspendedCards)
                 {
-                    if (ContinuousController.instance.turnSuspendedCards)
+                    if (ThisPermanent.OldIsSuspended != ThisPermanent.IsSuspended)
                     {
-                        if (ThisPermanent.OldIsSuspended != ThisPermanent.IsSuspended)
-                        {
-                            ThisPermanent.OldIsSuspended = ThisPermanent.IsSuspended;
+                        ThisPermanent.OldIsSuspended = ThisPermanent.IsSuspended;
 
-                            if (anim != null)
-                            {
+                        if (anim != null)
+                        {
+                            if (anim.GetInteger("Tap") != -1)
                                 anim.SetInteger("Tap", -1);
-                            }
                         }
                     }
                 }
             }
+        }
+    }
+
+    public void ShowPermanentData(bool updateIsTapped)
+    {
+        if (ThisPermanent == null)
+        {
+            return;
+        }
+
+        if (ThisPermanent.TopCard != null)
+        {
+            SetCardSuspended(updateIsTapped);
 
             //DP
             if (ThisPermanent.IsDigimon && ThisPermanent.DP >= 0)
             {
                 DPText.transform.parent.gameObject.SetActive(true);
-                DPText.text = ThisPermanent.DP.ToString();
+
+                if(DPText.text != ThisPermanent.DP.ToString())
+                    DPText.text = ThisPermanent.DP.ToString();
 
                 for (int i = 0; i < DPBackground_color.Count; i++)
                 {
@@ -414,7 +455,8 @@ public class FieldPermanentCard : MonoBehaviour
                         cardColor = ThisPermanent.TopCard.CardColors[0];
                     }
 
-                    DPBackground_color[i].color = DataBase.CardColor_ColorLightDictionary[cardColor];
+                    if (DPBackground_color[i].color != DataBase.CardColor_ColorLightDictionary[cardColor])
+                        DPBackground_color[i].color = DataBase.CardColor_ColorLightDictionary[cardColor];
                 }
             }
 
@@ -427,7 +469,9 @@ public class FieldPermanentCard : MonoBehaviour
             if (ThisPermanent.IsDigimon && ThisPermanent.TopCard.HasLevel)
             {
                 LevelText.transform.parent.gameObject.SetActive(true);
-                LevelText.text = ThisPermanent.Level.ToString();
+
+                if(LevelText.text != ThisPermanent.Level.ToString())
+                    LevelText.text = ThisPermanent.Level.ToString();
 
                 foreach (TextCardColorMaterial textCardColorMaterial in textCardColorMaterials)
                 {
@@ -449,8 +493,12 @@ public class FieldPermanentCard : MonoBehaviour
                 if (ThisPermanent.DigivolutionCards.Count >= 1)
                 {
                     EvoRootCountText.transform.parent.gameObject.SetActive(true);
-                    EvoRootCountText.text = $"×{ThisPermanent.DigivolutionCards.Count}";
-                    EvoRootCountBackground.color = DataBase.CardColor_ColorLightDictionary[ThisPermanent.TopCard.CardColors[0]];
+
+                    if(EvoRootCountText.text != $"×{ThisPermanent.DigivolutionCards.Count}")
+                        EvoRootCountText.text = $"×{ThisPermanent.DigivolutionCards.Count}";
+
+                    if(EvoRootCountBackground.color != DataBase.CardColor_ColorLightDictionary[ThisPermanent.TopCard.CardColors[0]])
+                        EvoRootCountBackground.color = DataBase.CardColor_ColorLightDictionary[ThisPermanent.TopCard.CardColors[0]];
                 }
 
                 else

+ 7 - 0
Assets/Scripts/GManager.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using Photon;
 using Photon.Pun;
 using System.IO;
+using System;
 
 public class GManager : MonoBehaviour
 {
@@ -213,6 +214,12 @@ public class GManager : MonoBehaviour
 
     public int CardIndex { get; set; } = 0;
 
+    #region Events
+    public static Action OnReverseOpponentsCardsChanged;
+    public static Action OnCardFlippedChanged;
+    public static Action<bool> OnCardSuspendedChanged;
+    #endregion
+
     private async void Awake()
     {
         //return;

+ 2 - 0
Assets/Scripts/GameplayOption.cs

@@ -156,6 +156,8 @@ public class GameplayOption : OffAnimation
             settingRef: ref ContinuousController.instance.reverseOpponentsCards,
             saveAction: ContinuousController.instance.SaveReverseOpponentsCards
         );
+
+        GManager.OnReverseOpponentsCardsChanged?.Invoke();
     }
 
     public void HandleReverseOpponentsCardsToggle()

+ 7 - 0
lfs/objects/6b/87/6b87afd036a38747e01d189df3c9af79afb76f98ad96ab0752e5f65c581bc73c

@@ -0,0 +1,7 @@
+version https://git-lfs.github.com/spec/v1
+<<<<<<< HEAD
+oid sha256:bd1ffa4d26d99914afbe6dc29032815e5723596cd806da591b0fe1624f2f5ac7
+=======
+oid sha256:9c60c84046739fd041054bc086f3c9836a50fd5987bb6f47c593b15069345759
+>>>>>>> d27732b5c1d72e362742e193385f652e1792782f
+size 23800