Jelajahi Sumber

Update to some BT15 yellow card

Albert Vasconcellos 2 tahun lalu
induk
melakukan
172c296eea

+ 14 - 4
Assets/CardEffect/BT15/Yellow/Angewomon_ACE_BT15_038.cs

@@ -16,7 +16,9 @@ public class Angewomon_ACE_BT15_038 : CEntity_Effect
       cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
       cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
     }
     }
 
 
-    if (timing == EffectTiming.OnEnterFieldAnyone)
+        #region On Play
+
+        if (timing == EffectTiming.OnEnterFieldAnyone)
     {
     {
       ActivateClass activateClass = new ActivateClass();
       ActivateClass activateClass = new ActivateClass();
       activateClass.SetUpICardEffect("Trash the top card of your security so that opponent's 1 Digimon gains DP -6000", CanUseCondition, card);
       activateClass.SetUpICardEffect("Trash the top card of your security so that opponent's 1 Digimon gains DP -6000", CanUseCondition, card);
@@ -113,8 +115,11 @@ public class Angewomon_ACE_BT15_038 : CEntity_Effect
         }
         }
       }
       }
     }
     }
+#endregion
+
+        #region When Digivolving 
 
 
-    if (timing == EffectTiming.OnEnterFieldAnyone)
+        if (timing == EffectTiming.OnEnterFieldAnyone)
     {
     {
       ActivateClass activateClass = new ActivateClass();
       ActivateClass activateClass = new ActivateClass();
       activateClass.SetUpICardEffect("Trash the top card of your security so that opponent's 1 Digimon gains DP -6000", CanUseCondition, card);
       activateClass.SetUpICardEffect("Trash the top card of your security so that opponent's 1 Digimon gains DP -6000", CanUseCondition, card);
@@ -211,8 +216,11 @@ public class Angewomon_ACE_BT15_038 : CEntity_Effect
         }
         }
       }
       }
     }
     }
+        #endregion
 
 
-    if (timing == EffectTiming.OnLoseSecurity)
+        #region All Turns
+
+        if (timing == EffectTiming.OnLoseSecurity)
     {
     {
       ActivateClass activateClass = new ActivateClass();
       ActivateClass activateClass = new ActivateClass();
       activateClass.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition, card);
       activateClass.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition, card);
@@ -256,7 +264,9 @@ public class Angewomon_ACE_BT15_038 : CEntity_Effect
         yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
         yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
       }
       }
     }
     }
+        #endregion
+
 
 
-    return cardEffects;
+        return cardEffects;
   }
   }
 }
 }

+ 360 - 0
Assets/CardEffect/BT15/Yellow/Babamon_BT15_041.cs

@@ -0,0 +1,360 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System.Linq;
+using Photon;
+using System;
+using Photon.Pun;
+
+public class Babamon_BT15_041 : CEntity_Effect
+{
+    public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+    {
+        List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+
+        #region On Play
+        if (timing == EffectTiming.OnEnterFieldAnyone)
+        {
+            ActivateClass activateClass = new ActivateClass();
+            activateClass.SetUpICardEffect("Give opponent's Digimon -6000 DP.", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+            cardEffects.Add(activateClass);
+
+            string EffectDiscription()
+            {
+                return "[On Play] 1 of your opponent's Digimon gets -6000 DP until the end of your opponent's turn.";
+            }
+
+            bool CanActivateCondition(Hashtable hashtable)
+            {
+                if (CardEffectCommons.IsExistOnBattleArea(card))
+                {
+                    return true;
+                }
+
+                return false;
+            }
+
+            bool CanUseCondition(Hashtable hashtable)
+            {
+                return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+            }
+
+            bool CanSelectPermanent(Permanent permanent)
+            {
+                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                {
+                    return true;
+                }
+                return false;
+            }
+
+            IEnumerator ActivateCoroutine(Hashtable _hashtable)
+            {
+                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanent))
+                {
+                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanent));
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectPermanent,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: maxCount,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: SelectPermanentCoroutine,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -6000.", "The opponent is selecting 1 Digimon that will get DP -6000.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                            targetPermanent: permanent,
+                            changeValue: -6000,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass));
+                    }
+                }
+            }
+
+        }
+        #endregion
+
+        #region On Deletion
+        if (timing == EffectTiming.OnEnterFieldAnyone)
+        {
+            ActivateClass activateClass = new ActivateClass();
+            activateClass.SetUpICardEffect("Give opponent's Digimon -6000 DP.", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+            cardEffects.Add(activateClass);
+
+            string EffectDiscription()
+            {
+                return "[On Deletion] 1 of your opponent's Digimon gets -6000 DP until the end of your opponent's turn.";
+            }
+
+            bool CanActivateCondition(Hashtable hashtable)
+            {
+                if (CardEffectCommons.IsExistOnBattleArea(card))
+                {
+                    return true;
+                }
+
+                return false;
+            }
+
+            bool CanUseCondition(Hashtable hashtable)
+            {
+                return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
+            }
+
+            bool CanSelectPermanent(Permanent permanent)
+            {
+                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                {
+                    return true;
+                }
+                return false;
+            }
+
+            IEnumerator ActivateCoroutine(Hashtable _hashtable)
+            {
+                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanent))
+                {
+                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanent));
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectPermanent,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: maxCount,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: SelectPermanentCoroutine,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -6000.", "The opponent is selecting 1 Digimon that will get DP -6000.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                            targetPermanent: permanent,
+                            changeValue: -6000,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass));
+                    }
+                }
+            }
+
+        }
+        #endregion
+
+        #region End of Opponent's Turn
+        if (timing == EffectTiming.OnEndTurn)
+        {
+            ActivateClass activateClass = new ActivateClass();
+            activateClass.SetUpICardEffect("Delete this Digimon to play [Rosemon] or [Jijimon] from hand.", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+            cardEffects.Add(activateClass);
+
+            string EffectDiscription()
+            {
+                return "[End of Opponent�'s Turn] By deleting this Digimon, you may play 1 [Rosemon] or [Jijimon] from your hand without paying the cost. Then activate the [When Digivolving] effect of the Digimon played by this effect.";
+            }
+
+            bool CanUseCondition(Hashtable hashtable)
+            {
+                if (isExistOnField(card))
+                {
+                    return true;
+                }
+
+                return false;
+            }
+
+            bool CanSelectCardCondition(CardSource cardSource)
+            {
+                if (card.Owner.HandCards.Count >= 1)
+                { 
+                    if (cardSource.CardNames.Contains("Jijimon") || cardSource.CardNames.Contains("Rosemon"))
+                    {
+                        if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
+                        {
+                            return true;
+                        }
+                    }
+                }
+                return false;
+            }
+
+            bool CanActivateCondition(Hashtable hashtable)
+            {
+                if(isExistOnField(card))
+                {
+                    if (CardEffectCommons.IsOpponentTurn(card))
+                    {
+                        if (card.PermanentOfThisCard().CanBeDestroyedBySkill(activateClass))
+                        {
+                            return true;
+                        }
+                    }
+                }
+                return false;
+            }
+
+            IEnumerator ActivateCoroutine(Hashtable _hashtable)
+            {
+                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
+
+                IEnumerator SuccessProcess()
+                {
+                    if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
+                    {
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        int maxCount = 1;
+
+                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                        selectHandEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            mode: SelectHandEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                        selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                        yield return StartCoroutine(selectHandEffect.Activate());
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
+
+                            yield return null;
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
+
+
+                        IEnumerator AfterSelectCoroutine(List<CardSource> cardSources)
+                        {
+                            List<Permanent> permanents = CardEffectCommons.GetPlayedPermanentsFromEnterFieldHashtable(
+                    hashtable: _hashtable,
+                    rootCondition: null);
+
+                            if (permanents != null)
+                            {
+                                List<ICardEffect> candidateEffects = permanents
+                                    .Map(permanent => permanent.EffectList(EffectTiming.OnEnterFieldAnyone))
+                                    .Flat()
+                                    .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> cardSources1 = 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)
+                                    {
+                                        if (selectedEffect.EffectSourceCard != null)
+                                        {
+                                            if (selectedEffect.EffectSourceCard.PermanentOfThisCard() != null)
+                                            {
+                                                Hashtable effectHashtable = CardEffectCommons.WhenDigivolvingCheckHashtableOfCard(selectedEffect.EffectSourceCard);
+
+                                                if (selectedEffect.CanUse(effectHashtable))
+                                                {
+                                                    yield return ContinuousController.instance.StartCoroutine(((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+
+
+                }
+            }
+
+        }
+            #endregion
+
+            return cardEffects;
+    }
+}

+ 11 - 0
Assets/CardEffect/BT15/Yellow/Babamon_BT15_041.cs.meta

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

+ 8 - 1
Assets/CardEffect/BT15/Yellow/Bombermon_BT15_039.cs

@@ -20,7 +20,7 @@ public class Bombermon_BT15_039 : CEntity_Effect
 
 
             cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
             cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
         }
         }
-
+        #region On Play
         if (timing == EffectTiming.OnEnterFieldAnyone)
         if (timing == EffectTiming.OnEnterFieldAnyone)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
@@ -147,7 +147,9 @@ public class Bombermon_BT15_039 : CEntity_Effect
                 }
                 }
             }
             }
         }
         }
+        #endregion
 
 
+        #region When Digivolving
         if (timing == EffectTiming.OnEnterFieldAnyone)
         if (timing == EffectTiming.OnEnterFieldAnyone)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
@@ -274,7 +276,9 @@ public class Bombermon_BT15_039 : CEntity_Effect
                 }
                 }
             }
             }
         }
         }
+        #endregion
 
 
+        #region All Turns
         if (timing == EffectTiming.None)
         if (timing == EffectTiming.None)
         {
         {
             AddSkillClass addSkillClass = new AddSkillClass();
             AddSkillClass addSkillClass = new AddSkillClass();
@@ -328,7 +332,9 @@ public class Bombermon_BT15_039 : CEntity_Effect
                 return cardEffects;
                 return cardEffects;
             }
             }
         }
         }
+        #endregion
 
 
+        #region Inheritable
         if (timing == EffectTiming.None)
         if (timing == EffectTiming.None)
         {
         {
             AddSkillClass addSkillClass = new AddSkillClass();
             AddSkillClass addSkillClass = new AddSkillClass();
@@ -382,6 +388,7 @@ public class Bombermon_BT15_039 : CEntity_Effect
                 return cardEffects;
                 return cardEffects;
             }
             }
         }
         }
+        #endregion
 
 
         return cardEffects;
         return cardEffects;
     }
     }

+ 6 - 2
Assets/CardEffect/BT15/Yellow/Gatomon_BT15_037.cs

@@ -21,7 +21,8 @@ public class Gatomon_BT15_037 : CEntity_Effect
             cardEffects.Add(CardEffectFactory.BarrierSelfEffect(isInheritedEffect: true, card: card, condition: null));
             cardEffects.Add(CardEffectFactory.BarrierSelfEffect(isInheritedEffect: true, card: card, condition: null));
         }
         }
 
 
-        if(timing == EffectTiming.OnLoseSecurity)
+        #region All Turns
+        if (timing == EffectTiming.OnLoseSecurity)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
             activateClass.SetUpICardEffect("Gain 1 memory.", CanUseCondition, card);
             activateClass.SetUpICardEffect("Gain 1 memory.", CanUseCondition, card);
@@ -60,7 +61,9 @@ public class Gatomon_BT15_037 : CEntity_Effect
                 yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
                 yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
             }
             }
         }
         }
+        #endregion
 
 
+        #region When trashed from security
         if (timing == EffectTiming.OnDiscardSecurity)
         if (timing == EffectTiming.OnDiscardSecurity)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
@@ -88,7 +91,8 @@ public class Gatomon_BT15_037 : CEntity_Effect
                 yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: new List<CardSource>() { card }, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Execution, activateETB: true));
                 yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: new List<CardSource>() { card }, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Execution, activateETB: true));
             }
             }
 
 
-        }    
+        }
+        #endregion
 
 
         return cardEffects;
         return cardEffects;
     }
     }

+ 23 - 5
Assets/CardEffect/BT15/Yellow/Geremon_BT15_035.cs

@@ -12,6 +12,8 @@ public class Geremon_BT15_035 : CEntity_Effect
     {
     {
         List<ICardEffect> cardEffects = new List<ICardEffect>();
         List<ICardEffect> cardEffects = new List<ICardEffect>();
 
 
+        #region Rule Text
+
         if (timing == EffectTiming.None)
         if (timing == EffectTiming.None)
         {
         {
             ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
             ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
@@ -34,6 +36,9 @@ public class Geremon_BT15_035 : CEntity_Effect
                 return CardNames;
                 return CardNames;
             }
             }
         }
         }
+        #endregion
+
+        #region On Play
 
 
         if (timing == EffectTiming.OnEnterFieldAnyone)
         if (timing == EffectTiming.OnEnterFieldAnyone)
         {
         {
@@ -162,6 +167,10 @@ public class Geremon_BT15_035 : CEntity_Effect
             }
             }
         }
         }
 
 
+        #endregion
+
+        #region On Deletion
+
         if (timing == EffectTiming.OnDestroyedAnyone)
         if (timing == EffectTiming.OnDestroyedAnyone)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
@@ -288,12 +297,16 @@ public class Geremon_BT15_035 : CEntity_Effect
                 }
                 }
             }
             }
         }
         }
+        #endregion
+
+        #region Inheritable
 
 
         if (timing == EffectTiming.OnAllyAttack)
         if (timing == EffectTiming.OnAllyAttack)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
             activateClass.SetUpICardEffect("Security Attack -1", CanUseCondition, card);
             activateClass.SetUpICardEffect("Security Attack -1", CanUseCondition, card);
             activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
             activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+            activateClass.SetHashString("Sec-1_BT15_035");
             activateClass.SetIsInheritedEffect(true);
             activateClass.SetIsInheritedEffect(true);
             cardEffects.Add(activateClass);
             cardEffects.Add(activateClass);
 
 
@@ -304,7 +317,11 @@ public class Geremon_BT15_035 : CEntity_Effect
 
 
             bool CanSelectPermanentCondition(Permanent permanent)
             bool CanSelectPermanentCondition(Permanent permanent)
             {
             {
-                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                if(CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent,card))
+                {
+                    return true;
+                }
+                return false;
             }
             }
 
 
             bool CanUseCondition(Hashtable hashtable)
             bool CanUseCondition(Hashtable hashtable)
@@ -314,13 +331,12 @@ public class Geremon_BT15_035 : CEntity_Effect
 
 
             bool CanActivateCondition(Hashtable hashtable)
             bool CanActivateCondition(Hashtable hashtable)
             {
             {
-                if (CardEffectCommons.CanActivateOnDeletionInherited(hashtable, card))
-                {
+        
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     {
                     {
                         return true;
                         return true;
                     }
                     }
-                }
+                
 
 
                 return false;
                 return false;
             }
             }
@@ -363,7 +379,9 @@ public class Geremon_BT15_035 : CEntity_Effect
                 }
                 }
             }
             }
         }
         }
-
+        #endregion
+         
         return cardEffects;
         return cardEffects;
+
     }
     }
 }
 }

+ 379 - 0
Assets/CardEffect/BT15/Yellow/Magnadramon_BT15_042.cs

@@ -0,0 +1,379 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System.Linq;
+using Photon;
+using System;
+using Photon.Pun;
+using System.Runtime.InteropServices.WindowsRuntime;
+
+public class Magnadramon_BT15_042 : CEntity_Effect
+{
+    public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+    {
+        List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+
+        #region All Turns
+        if (timing == EffectTiming.OnLoseSecurity)
+        {
+            ActivateClass activateClass = new ActivateClass();
+            activateClass.SetUpICardEffect("Place 1 yellow card from your hand to the top or bottom of your security stack.", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+            cardEffects.Add(activateClass);
+
+            string EffectDiscription()
+            {
+                return "[All Turns][Once per turn] When a card is removed from your security stack, if you have 3 or less security cards, you may place 1 yellow card from your hand at the top or bottom of your security stack.";
+            }
+
+            bool CanActivateCondition(Hashtable hashtable)
+            {
+                if (CardEffectCommons.IsExistOnBattleArea(card))
+                {
+                    return true;
+                }
+                return false;
+            }
+
+            bool CanUseCondition(Hashtable hashtable)
+            {
+                if (CardEffectCommons.IsExistOnBattleArea(card))
+                {
+                    if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, player => player == card.Owner))
+                    {
+                        if (card.Owner.SecurityCards.Count() <= 3)
+                        {
+                            return true;
+                        }
+                    }
+                }
+                return false;
+            }
+
+            bool CanSelectCardCondition(CardSource cardSource)
+            {
+                if(cardSource.CardColors.Contains(CardColor.Yellow))
+                {
+                    return true;
+                }
+                return false;
+            }
+
+
+            IEnumerator ActivateCoroutine(Hashtable _hashtable)
+            {
+                if (card.Owner.CanAddSecurity(activateClass))
+                {
+                    if (card.Owner.SecurityCards.Count <= 3)
+                    {
+                        if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
+                        {
+                            List<CardSource> selectedCard = new List<CardSource>();
+
+                            int maxCount = 1;
+
+                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                            selectHandEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectCardCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: true,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                mode: SelectHandEffect.Mode.Custom,
+                                cardEffect: activateClass);
+
+                            selectHandEffect.SetUpCustomMessage(
+                                "Select 1 card to place at the top or bottom of security.",
+                                "The opponent is selecting 1 card to place at the bottom of security.");
+                            selectHandEffect.SetUpCustomMessage_ShowCard("Security Bottom Card");
+
+                            yield return StartCoroutine(selectHandEffect.Activate());
+
+                            IEnumerator SelectCardCoroutine(CardSource cardSource)
+                            {
+                                if (selectedCard != null)
+                                {
+                                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                                {
+                                    new SelectionElement<bool>(message: $"Security Top", value : true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"Security Bottom", value : false, spriteIndex: 1),
+                                };
+
+                                    string selectPlayerMessage = "Will you place the card on the top or bottom of the security?";
+                                    string notSelectPlayerMessage = "The opponent is selecting whether to place the card on the top or bottom of security.";
+
+                                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+
+                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                                    bool toTop = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                                    if (toTop)
+                                    {
+                                        GManager.instance.commandText.OpenCommandText("\"Place to the top of security\" was selected.");
+
+                                        GManager.instance.playLog.AddLogString($"\n{card.BaseENGCardNameFromEntity}({card.CardID}):Place the Digimon to the top of security\n");
+                                    }
+
+                                    else
+                                    {
+                                        GManager.instance.commandText.OpenCommandText("\"Place to the bottom of security\" was selected.");
+
+                                        GManager.instance.playLog.AddLogString($"\n{card.BaseENGCardNameFromEntity}({card.CardID}):Place the Digimon to the bottom of security\n");
+                                    }
+
+                                    yield return new WaitForSeconds(0.4f);
+                                    GManager.instance.commandText.CloseCommandText();
+                                    yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
+
+                                    selectedCard.Add(cardSource);
+
+                                    yield return null;
+
+                                    foreach (CardSource card in selectedCard)
+                                    {
+                                        if (toTop)
+                                        {
+                                            yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(card, toTop: true));
+                                        }
+
+                                        if (!toTop)
+                                        {
+                                            yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(card, toTop: false));
+                                        }
+
+                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateRecoveryEffect(card.Owner));
+
+                                        yield return ContinuousController.instance.StartCoroutine(new IAddSecurity(card.Owner).AddSecurity());
+                                    }
+                                }
+
+                            }
+
+                        }
+
+                    }
+                }
+            }
+
+        }
+        #endregion
+
+        #region On Play
+        if (timing == EffectTiming.OnEnterFieldAnyone)
+        {
+            ActivateClass activateClass = new ActivateClass();
+            activateClass.SetUpICardEffect("Trash the top or bottom of your security to reduce opponent's Digimon DP.", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+            activateClass.SetHashString("TrashSecuirtyToReduceDP_BT15_042");
+            cardEffects.Add(activateClass);
+
+            string EffectDiscription()
+            {
+                return "[On Play] By trashing the top or bottom card of your security stack, 1 of your opponent's Digimon gets -9000 DP until the end of your opponent's turn.";
+            }
+
+            bool CanUseCondition(Hashtable hashtable)
+            {
+                return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+            }
+
+            bool CanActivateCondition(Hashtable hashtable)
+            {
+                if (CardEffectCommons.IsExistOnBattleArea(card))
+                {
+                    if (card.Owner.SecurityCards.Count >= 1)
+                    {
+                        return true;
+                    }
+                }
+
+                return false;
+            }
+
+            bool CanSelectPermanentCondition(Permanent permanent)
+            {
+                if(CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                {
+                    if (permanent.HasDP)
+                    {
+                        return true;
+                    }
+
+                }
+                return false;
+            }
+
+            IEnumerator ActivateCoroutine(Hashtable _hashtable)
+            {
+                if (card.Owner.SecurityCards.Count >= 1)
+                {
+                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                    {
+                        new SelectionElement<bool>(message: $"Security Top", value : true, spriteIndex: 0),
+                        new SelectionElement<bool>(message: $"Security Bottom", value : false, spriteIndex: 1),
+                    };
+
+                    string selectPlayerMessage = "Which will you trash the top or bottom card of the security?";
+                    string notSelectPlayerMessage = "The opponent is selecting whether to trash the top or bottom card of security.";
+
+                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+
+                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                    bool fromTop = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                    yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                            card.Owner,
+                            1,
+                            activateClass,
+                            fromTop).DestroySecurity());
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -9000.", "The opponent is selecting 1 Digimon that will get DP -2000.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -9000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
+                        }
+                    }
+                }
+            }
+        }
+        #endregion
+
+        #region When Digivolving
+        if (timing == EffectTiming.OnEnterFieldAnyone)
+        {
+            ActivateClass activateClass = new ActivateClass();
+            activateClass.SetUpICardEffect("Trash the top or bottom of your security to reduce opponent's Digimon DP.", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+            activateClass.SetHashString("TrashSecuirtyToReduceDP_BT15_042");
+            cardEffects.Add(activateClass);
+
+            string EffectDiscription()
+            {
+                return "[When Digivolving] By trashing the top or bottom card of your security stack, 1 of your opponent's Digimon gets -9000 DP until the end of your opponent's turn.";
+            }
+
+            bool CanUseCondition(Hashtable hashtable)
+            {
+                return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+            }
+
+            bool CanActivateCondition(Hashtable hashtable)
+            {
+                if (CardEffectCommons.IsExistOnBattleArea(card))
+                {
+                    if (card.Owner.SecurityCards.Count >= 1)
+                    {
+                        return true;
+                    }
+                }
+
+                return false;
+            }
+
+            bool CanSelectPermanentCondition(Permanent permanent)
+            {
+                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                {
+                    if (permanent.HasDP)
+                    {
+                        return true;
+                    }
+
+                }
+                return false;
+            }
+
+            IEnumerator ActivateCoroutine(Hashtable _hashtable)
+            {
+                if (card.Owner.SecurityCards.Count >= 1)
+                {
+                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                    {
+                        new SelectionElement<bool>(message: $"Security Top", value : true, spriteIndex: 0),
+                        new SelectionElement<bool>(message: $"Security Bottom", value : false, spriteIndex: 1),
+                    };
+
+                    string selectPlayerMessage = "Which will you trash the top or bottom card of the security?";
+                    string notSelectPlayerMessage = "The opponent is selecting whether to trash the top or bottom card of security.";
+
+                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+
+                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                    bool fromTop = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                    yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                            card.Owner,
+                            1,
+                            activateClass,
+                            fromTop).DestroySecurity());
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -9000.", "The opponent is selecting 1 Digimon that will get DP -2000.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -9000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
+                        }
+                    }
+                }
+            }
+        }
+            #endregion
+
+
+            return cardEffects;
+    }
+
+}

+ 11 - 0
Assets/CardEffect/BT15/Yellow/Magnadramon_BT15_042.cs.meta

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

+ 10 - 2
Assets/CardEffect/BT15/Yellow/Salamon_BT15_034.cs

@@ -12,7 +12,9 @@ public class Salamon_BT15_034 : CEntity_Effect
     {
     {
         List<ICardEffect> cardEffects = new List<ICardEffect>();
         List<ICardEffect> cardEffects = new List<ICardEffect>();
 
 
-        if(timing == EffectTiming.OnLoseSecurity)
+        #region All Turns Inherit
+
+        if (timing == EffectTiming.OnLoseSecurity)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
             activateClass.SetUpICardEffect("Give an opponent's Digimon card -2000 DP.", CanUseCondition, card);
             activateClass.SetUpICardEffect("Give an opponent's Digimon card -2000 DP.", CanUseCondition, card);
@@ -86,6 +88,10 @@ public class Salamon_BT15_034 : CEntity_Effect
 
 
         }
         }
 
 
+        #endregion
+
+        #region Start of Main Phase
+
         if (timing == EffectTiming.OnStartMainPhase)
         if (timing == EffectTiming.OnStartMainPhase)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
@@ -260,6 +266,8 @@ public class Salamon_BT15_034 : CEntity_Effect
 
 
         }
         }
 
 
-            return cardEffects;
+        #endregion
+
+        return cardEffects;
     }
     }
 }
 }

+ 7 - 2
Assets/CardEffect/BT15/Yellow/Wizardmon_BT15_036.cs

@@ -18,6 +18,8 @@ public class Wizardmon_BT15_036 : CEntity_Effect
             cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
             cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
         }
         }
 
 
+        #region On Deletion
+
         if (timing == EffectTiming.OnDestroyedAnyone)
         if (timing == EffectTiming.OnDestroyedAnyone)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
@@ -118,8 +120,10 @@ public class Wizardmon_BT15_036 : CEntity_Effect
                 }
                 }
             }
             }
         }
         }
+        #endregion
 
 
-            if (timing == EffectTiming.OnEnterFieldAnyone)
+        #region On Play
+        if (timing == EffectTiming.OnEnterFieldAnyone)
             {
             {
                 ActivateClass activateClass = new ActivateClass();
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Trash a security to give opponent's Digimon -6000 DP.", CanUseCondition, card);
                 activateClass.SetUpICardEffect("Trash a security to give opponent's Digimon -6000 DP.", CanUseCondition, card);
@@ -135,7 +139,7 @@ public class Wizardmon_BT15_036 : CEntity_Effect
                 {
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
                     {
-                        if (card.Owner.SecurityCards.Count > 0)
+                        if (card.Owner.SecurityCards.Count >= 1)
                         {
                         {
                             return true;
                             return true;
                         }
                         }
@@ -221,6 +225,7 @@ public class Wizardmon_BT15_036 : CEntity_Effect
             
             
         
         
         }
         }
+        #endregion
 
 
         return cardEffects;
         return cardEffects;
     }
     }