Просмотр исходного кода

Entmon, Petaldramon, puroromon, adding to security face up

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

+ 51 - 0
Assets/CardEffect/BT18/Green/Entmon_BT18_051.cs

@@ -0,0 +1,51 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects
+{
+    public class Entmon_BT18_051 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return CardEffectCommons.IsOwnerTurn(card) && 
+                           CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           card.PermanentOfThisCard().IsSuspended;
+                }
+
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent == card.PermanentOfThisCard();
+                }
+
+                bool CardSourceCondition(CardSource cardSource)
+                {
+                    return cardSource.IsLevel6 &&
+                           cardSource.HasPlantTraits;
+                }
+
+                bool RootCondition(SelectCardEffect.Root root)
+                {
+                    return true;
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeDigivolutionCostStaticEffect(
+                    changeValue: -2,
+                    permanentCondition: PermanentCondition,
+                    cardCondition: CardSourceCondition,
+                    rootCondition: RootCondition,
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: Condition,
+                    setFixedCost: false));
+            }
+
+            return cardEffects;
+        }
+    }
+}

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

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

+ 201 - 0
Assets/CardEffect/BT18/Green/Petaldramon_BT18_050.cs

@@ -0,0 +1,201 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.BT18
+{
+    public class Petaldramon_BT18_050 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution Requirement
+            if (timing == EffectTiming.None)
+            {
+                static bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.EqualsCardName("Arbormon");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: true, card: card, condition: null));
+            }
+            #endregion
+
+            #region On Play/When Digivolving Shared
+            bool YourDigimon(Permanent permanent)
+            {
+                if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    return permanent.TopCard.Level <= 4 && permanent.TopCard.HasLevel &&
+                            permanent.TopCard.HasPlantTraits;
+
+                return false;
+            }
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("unspending 1 of your digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] You may unsuspend 1 of your level 4 or lower Digimon with [Vegetation] or [Plant] in one of its traits.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return CardEffectCommons.HasMatchConditionPermanent(YourDigimon);
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: YourDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.UnTap,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to suspend.", "The opponent is selecting 1 Digimon to suspend.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                }
+            }
+            #endregion
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("unspending 1 of your digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Digivolving] You may unsuspend 1 of your level 4 or lower Digimon with [Vegetation] or [Plant] in one of its traits.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return CardEffectCommons.HasMatchConditionPermanent(YourDigimon);
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: YourDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.UnTap,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to suspend.", "The opponent is selecting 1 Digimon to suspend.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                }
+            }
+            #endregion
+
+            #region When Attacking - ESS
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Suspend 1 of your opponent's Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetHashString("Suspend_BT18_050");
+                activateClass.SetIsInheritedEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Attacking] [Once Per Turn] Suspend 1 of your opponent's Digimon.";
+                }
+
+                bool OpponentsDigimon(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return CardEffectCommons.HasMatchConditionPermanent(OpponentsDigimon);
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: OpponentsDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Tap,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to suspend.", "The opponent is selecting 1 Digimon to suspend.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

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

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

+ 71 - 0
Assets/CardEffect/BT18/Green/Puroromon_BT18_004.cs

@@ -0,0 +1,71 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects
+{
+    public class Puroromon_BT18_004 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            if (timing == EffectTiming.OnStartMainPhase)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Place 1 [Royal Base] trait Digimon face up as bottom security, add top security to hand", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[Start of Your Main Phase] By placing 1 Digimon card with the [Royal Base] trait in your hand face up as your bottom security card, add your top security card to the hand.";
+                }
+
+                bool IsRoyalBaseDigimon(CardSource card)
+                {
+                    return card.EqualsTraits("Royal Base");
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsOwnerTurn(card) &&
+                           CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           card.PermanentOfThisCard().DigivolutionCards.Contains(card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                        return CardEffectCommons.HasMatchConditionOwnersHand(card,IsRoyalBaseDigimon);
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                    selectHandEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: IsRoyalBaseDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: true,
+                        canEndNotMax: false,
+                        isShowOpponent: true,
+                        selectCardCoroutine: null,
+                        afterSelectCardCoroutine: null,
+                        mode: SelectHandEffect.Mode.PutSecurityBottom,
+                        cardEffect: activateClass);
+
+                    selectHandEffect.SetIsFaceup();
+
+                    yield return StartCoroutine(selectHandEffect.Activate());
+                }
+            }
+
+            return cardEffects;
+        }
+    }
+}

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

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

+ 3 - 2
Assets/Scripts/CardObjectController.cs

@@ -956,7 +956,7 @@ public class CardObjectController : MonoBehaviour
     #endregion
 
     #region Add card to security
-    public static IEnumerator AddSecurityCard(CardSource cardSource, bool toTop = true)
+    public static IEnumerator AddSecurityCard(CardSource cardSource, bool toTop = true, bool faceUp = false)
     {
         if (!cardSource.Owner.SecurityCards.Contains(cardSource))
         {
@@ -964,7 +964,8 @@ public class CardObjectController : MonoBehaviour
 
             if (!cardSource.IsToken)
             {
-                cardSource.SetReverse();
+                if(!faceUp)
+                    cardSource.SetReverse();
 
                 cardSource.Owner.SecurityCards.Insert(0, cardSource);
 

+ 26 - 0
Assets/Scripts/SelectHandEffect.cs

@@ -42,6 +42,7 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
         _customMessage_Enemy = "";
         _showOpponentMessage = true;
         _isLocal = false;
+        _isFaceUp = false;
     }
 
     public void SetIsLocal()
@@ -59,6 +60,11 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
         _digiXros = true;
     }
 
+    public void SetIsFaceup()
+    {
+        _isFaceUp = true;
+    }
+
     public void SetUpCustomMessage_ShowCard(string CustomMessage_ShowCard)
     {
         _customMessage_ShowCard = CustomMessage_ShowCard;
@@ -102,11 +108,14 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
     bool _showCard = true;
     bool _digiXros = false;
     bool _isLocal = false;
+    bool _isFaceUp = false;
+
     public enum Mode
     {
         Discard,
         PutLibraryTop,
         PutLibraryBottom,
+        PutSecurityBottom,
         Custom
     }
 
@@ -207,6 +216,11 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
                                 message = "Select cards to put on bottom of the deck.";
                             }
 
+                            break;
+                        case Mode.PutSecurityBottom:
+                            string str = _isFaceUp ? "faceup" : "facedown";
+                            message = $"Select card(s) to put on bottom of the security {str}.";
+
                             break;
 
                         case Mode.Custom:
@@ -630,6 +644,12 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
 
                                     break;
 
+                                case Mode.PutSecurityBottom:
+
+                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Cards put on bottom of security", _isFaceUp, true));
+
+                                    break;
+
                                 case Mode.Custom:
 
                                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect(_targetCards, "Selected cards", true, true));
@@ -675,6 +695,12 @@ public class SelectHandEffect : MonoBehaviourPunCallbacks
                         yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryBottomCards(_targetCards));
                         break;
 
+                    case Mode.PutSecurityBottom:
+
+                        foreach (CardSource cardSource in _targetCards)
+                            yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(cardSource,false, _isFaceUp));
+                        break;
+
                     case Mode.Custom:
                         if (_selectCardCoroutine != null)
                         {