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

+ 247 - 0
Assets/CardEffect/BT18/Green/CannonBeemon_BT18_052.cs

@@ -0,0 +1,247 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT18
+{
+    public class CannonBeemon_BT18_052 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel4 &&
+                           targetPermanent.TopCard.EqualsTraits("Royal Base");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false,
+                    card: card, condition: null));
+            }
+
+            #endregion
+
+            #region On Play/When Digivolving Shared
+            bool IsOpponenetsDigimon(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+            }
+
+            
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("For each of your face up security cards, <De-Digivolve 1> 1 of your opponent's Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] For each of your face up security cards, <De-Digivolve 1> 1 of your opponent's Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return card.Owner.SecurityCards.Count(cardSource => !cardSource.IsFlipped) > 0;
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    int maxCount = card.Owner.SecurityCards.Count(cardSource => !cardSource.IsFlipped);
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    for (int i = 0; i < maxCount; i++)
+                    {
+                        selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: IsOpponenetsDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: DeDigivolvePermanent,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+
+                    IEnumerator DeDigivolvePermanent(Permanent permanent)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, 1, activateClass).Degeneration());
+                    }
+                }
+            }
+            #endregion
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("For each of your face up security cards, <De-Digivolve 1> 1 of your opponent's Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] For each of your face up security cards, <De-Digivolve 1> 1 of your opponent's Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return card.Owner.SecurityCards.Count(cardSource => !cardSource.IsFlipped) > 0;
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    int maxCount = card.Owner.SecurityCards.Count(cardSource => !cardSource.IsFlipped);
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    for (int i = 0; i < maxCount; i++)
+                    {
+                        selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: IsOpponenetsDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: DeDigivolvePermanent,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+
+                    IEnumerator DeDigivolvePermanent(Permanent permanent)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, 1, activateClass).Degeneration());
+                    }
+                }
+            }
+            #endregion
+
+            #region All Turns - ESS
+            if (timing == EffectTiming.OnEndBattle)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Trash the top card of opponent's security", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("TrashSecurity_BT18_052");
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] [Once Per Turn] When this Digimon deletes an opponent's Digimon in battle, trash the top card of your opponent's security stack.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
+                        bool LoserCondition(Permanent permanent) => CardEffectCommons.IsOpponentPermanent(permanent, card);
+
+                        if (CardEffectCommons.CanTriggerWhenDeleteOpponentDigimonByBattle(hashtable: hashtable, winnerCondition: WinnerCondition, loserCondition: LoserCondition, isOnlyWinnerSurvive: false))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                        player: card.Owner.Enemy,
+                        destroySecurityCount: 1,
+                        cardEffect: activateClass,
+                        fromTop: true).DestroySecurity());
+                }
+            }
+            #endregion
+
+            #region All Turns - Security
+            if (timing == EffectTiming.None)
+            {
+                bool CanUseCondition()
+                {
+                    if (CardEffectCommons.IsExistInSecurity(card, true))
+                    {
+                        if (CardEffectCommons.IsOpponentTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.TopCard.EqualsTraits("Royal Base"))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.BlockerStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: CanUseCondition));
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Green/CannonBeemon_BT18_052.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b44d49712a6148b42be1f6c5b7b17074
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 1
Assets/CardEffect/BT18/Green/FunBeemon_BT18_044.cs

@@ -130,7 +130,6 @@ namespace DCGO.CardEffects.BT18
 
                 bool Condition()
                 {
-                    UnityEngine.Debug.Log($"FUNBEEMON CONDITION: {CardEffectCommons.IsExistInSecurity(card, false)}");
                     return CardEffectCommons.IsExistInSecurity(card, false);
                 }
 

+ 231 - 0
Assets/CardEffect/BT18/Green/TigerVespamon_BT18_056.cs

@@ -0,0 +1,231 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects
+{
+    public class TigerVespamon_BT18_056 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel5 &&
+                           targetPermanent.TopCard.EqualsTraits("Royal Base");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false,
+                    card: card, condition: null));
+            }
+
+            #endregion
+
+            #region Piercing/Reboot
+            if (timing == EffectTiming.OnDetermineDoSecurityCheck)
+            {
+                cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region On Play/When Digivolving Shared
+            bool IsOpponenetsDigimon(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+            }
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.None)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Suspend 1 for each face up security, Then opponents Digimon can't unsuspend", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] [When Digivolving] For each of your face up security cards, suspend 1 of your opponent's Digimon. Then, none of their Digimon can unsuspend until the end of their turn.";
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (!permanent.TopCard.CanNotBeAffected(activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    int maxCount = card.Owner.SecurityCards.Count(cardSource => !cardSource.IsFlipped);
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: IsOpponenetsDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: maxCount,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Tap,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotUnsuspendPlayerEffect(
+                            permanentCondition: PermanentCondition,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass,
+                            isOnlyActivePhase: false,
+                            effectName: "Your Digimon can't unsuspend"));
+                }
+            }
+            #endregion
+
+            #region When Digivolving
+            if (timing == EffectTiming.None)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Suspend 1 for each face up security, Then opponents Digimon can't unsuspend", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] For each of your face up security cards, suspend 1 of your opponent's Digimon. Then, none of their Digimon can unsuspend until the end of their turn.";
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (!permanent.TopCard.CanNotBeAffected(activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    int maxCount = card.Owner.SecurityCards.Count(cardSource => !cardSource.IsFlipped);
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: IsOpponenetsDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: maxCount,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Tap,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotUnsuspendPlayerEffect(
+                            permanentCondition: PermanentCondition,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass,
+                            isOnlyActivePhase: false,
+                            effectName: "Your Digimon can't unsuspend"));
+                }
+            }
+            #endregion
+
+            #region All Turns
+
+            if (timing == EffectTiming.OnDestroyedAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
+                activateClass.SetHashString("BT18_056_Unsuspend");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[All Turns] [Once Per Turn] When other Digimon are deleted in battle, this Digimon may unsuspend.";
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnBattleArea(permanent) &&
+                           permanent.IsDigimon &&
+                           permanent != card.PermanentOfThisCard();
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition) &&
+                           CardEffectCommons.IsByBattle(hashtable);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           CardEffectCommons.CanUnsuspend(card.PermanentOfThisCard()) &&
+                           CardEffectCommons.GetHashtablesFromHashtable(hashtable) is { Count: >= 1 };
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(
+                        new IUnsuspendPermanents(new List<Permanent>() { card.PermanentOfThisCard() }, activateClass).Unsuspend());
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Green/TigerVespamon_BT18_056.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 168de42542d63ec4aacc12eed280b94e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 126 - 0
Assets/CardEffect/BT18/Green/Waspmon_BT18_046.cs

@@ -0,0 +1,126 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.BT18
+{
+    public class Waspmon_BT18_046 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel3 &&
+                           targetPermanent.TopCard.EqualsTraits("Royal Base");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false,
+                    card: card, condition: null));
+            }
+
+            #endregion
+
+            #region Opponent's Turn Effect
+
+            if (timing == EffectTiming.None)
+            {
+                bool AttackerCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                }
+
+                bool DefenderCondition(Permanent permanent)
+                {
+                    return permanent == null;
+                }
+
+                bool Condition()
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.IsOpponentTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                string effectName = "Opponent's Digimon with as much or less DP as this Digimon can't attack players";
+
+                cardEffects.Add(CardEffectFactory.CanNotAttackStaticEffect(
+                    attackerCondition: AttackerCondition,
+                    defenderCondition: DefenderCondition,
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: Condition,
+                    effectName: effectName
+                ));
+            }
+
+            #endregion
+
+            #region All Turns - ESS
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
+            }
+            #endregion
+
+            #region All Turns - Security
+            if (timing == EffectTiming.None)
+            {
+                string EffectDiscription()
+                {
+                    return "(Security) [All Turns] All of your [Royal Base] trait Digimon get +1000 DP.";
+                }
+
+                bool Condition()
+                {
+                    return CardEffectCommons.IsExistInSecurity(card, false);
+                }
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
+                    {
+                        if (permanent.TopCard.EqualsTraits("Royal Base"))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
+                permanentCondition: PermanentCondition,
+                changeValue: 1000,
+                isInheritedEffect: false,
+                card: card,
+                condition: Condition,
+                effectName: EffectDiscription));
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Green/Waspmon_BT18_046.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d891c5efc5b7dcd48917a580b5c9d32b
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 5 - 4
Assets/Scripts/ContinuousController.cs

@@ -1181,23 +1181,24 @@ public static class RandomUtility
 
         foreach (CardSource cardSource in DeckCards)
         {
+            cardSource.SetReverse();
             CardDatas.Add(cardSource);
         }
 
-        // 整数 n の初期値はデッキの枚数
+        // The initial value of the integer n is the number of cards in the deck
         int n = CardDatas.Count;
 
         for (int i = 0; i < 20; i++)
         {
-            // nが1より小さくなるまで繰り返す
+            //repeat until n is less than 1
             while (n > 1)
             {
                 n--;
 
-                // kは 0 ~ n+1 の間のランダムな値
+                // k is a random value between 0 and n+1
                 int k = UnityEngine.Random.Range(0, n + 1);
 
-                // k番目のカードをtempに代入
+                // Assign kth card to temp
                 CardSource temp = CardDatas[k];
                 CardDatas[k] = CardDatas[n];
                 CardDatas[n] = temp;

+ 26 - 6
Assets/Scripts/Permanent.cs

@@ -356,17 +356,15 @@ public class Permanent
                     #region Effects of face up security
                     foreach (CardSource cardSource in player.SecurityCards)
                     {
-                        //if (!cardSource.IsFlipped)
-                        //    continue;
+                        if (cardSource.IsFlipped)
+                            continue;
 
                         foreach (ICardEffect cardEffect in cardSource.EffectList(EffectTiming.None))
                         {
                             if (cardEffect is IChangeDPEffect)
                             {
-                                Debug.Log($"{cardSource.BaseENGCardNameFromEntity} - {cardEffect.EffectName} - {cardEffect.CanUse(null)}");
                                 if (cardEffect.CanUse(null))
                                 {
-                                    Debug.Log($"{cardSource.BaseENGCardNameFromEntity} - {((IChangeDPEffect)cardEffect).PermanentCondition(this)}");
                                     if (((IChangeDPEffect)cardEffect).PermanentCondition(this))
                                     {
                                         if (((IChangeDPEffect)cardEffect).IsMinusDP())
@@ -1831,9 +1829,9 @@ public class Permanent
         {
             foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
             {
+                #region Effects of permanents in play
                 foreach (Permanent permanent in player.GetFieldPermanents())
                 {
-                    #region 場のパーマネントの効果
                     foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
                     {
                         if (cardEffect is IBlockerEffect)
@@ -1847,8 +1845,30 @@ public class Permanent
                             }
                         }
                     }
-                    #endregion
                 }
+                #endregion
+
+                #region Effects of faceup security
+                foreach (CardSource source in player.SecurityCards)
+                {
+                    if (source.IsFlipped)
+                        continue;
+
+                    foreach (ICardEffect cardEffect in source.EffectList(EffectTiming.None))
+                    {
+                        if (cardEffect is IBlockerEffect)
+                        {
+                            if (cardEffect.CanTrigger(null))
+                            {
+                                if (((IBlockerEffect)cardEffect).IsBlocker(this))
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+                }
+                #endregion
 
                 #region プレイヤーの効果
                 foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))