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

Add Susanoomon Ace cardEffect

Also fix ladydevimon X token name because it caused encoding problems
Andrej Erdelsky 1 год назад
Родитель
Сommit
a392ec1182

+ 2 - 2
Assets/CardBaseEntity/BT18/White/Digimon/Susanoomon-BT18-102.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:6e6e24cf5b3c63e52b05fde6ca71f0dd473879a4e2009bffbc59c20b59c02bee
-size 1897
+oid sha256:54758b460a1567d381a757b350ea19afa237c662a840830e971b9ef22629f1bd
+size 1908

+ 2 - 2
Assets/CardBaseEntity/BT18/White/Digimon/Susanoomon-BT18-102_P1.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:a748dd6939117c7afbed32239be461f7191533caa4f7b70d224496bc7594c950
-size 1903
+oid sha256:39dcb67b7d5d91bfd24438575a80196520f656ca0506f4be7d1529311819455a
+size 1914

+ 2 - 2
Assets/CardBaseEntity/BT18/White/Digimon/Susanoomon-BT18-102_P2.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:5b6fe8491b6cff60cee0a4a740f20a0fb8e176b69e50245886edc22dd640996b
-size 1903
+oid sha256:5d1b4efe04cfc25817e676eafa3bfd0db761c417d902b08e30004a23c90825b0
+size 1914

+ 229 - 7
Assets/CardEffect/BT18/White/Susanoomon_BT18_102.cs

@@ -1,5 +1,7 @@
+using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 
 namespace DCGO.CardEffects.BT18
 {
@@ -9,34 +11,254 @@ namespace DCGO.CardEffects.BT18
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Alternate Digivolution, Blast Digivolve
+
             if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return card.Owner.HandCards.Contains(card);
+                }
+
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return (targetPermanent.TopCard.EqualsCardName("Takuya Kanbara") ||
+                            targetPermanent.TopCard.EqualsCardName("TakuyaKanbara") ||
+                            targetPermanent.TopCard.EqualsCardName("Koji Minamoto") ||
+                            targetPermanent.TopCard.EqualsCardName("KojiMinamoto")) &&
+                           targetPermanent.DigivolutionCards.Count(cardSource => cardSource.ContainsTraits("Hybrid")) >= 10;
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition, digivolutionCost: 6, ignoreDigivolutionRequirement: false,
+                    card: card, condition: Condition));
+            }
+
+            if (timing == EffectTiming.OnCounterTiming)
+            {
+                cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
+            }
+
+            #endregion
+
+            #region When Digivolving, When Attacking Shared
+
+            int DeletionMaxDP()
+            {
+                int dp = 10000;
+
+                List<CardColor> cardColors = new List<CardColor>();
+
+                foreach (CardSource source in card.PermanentOfThisCard().cardSources)
+                {
+                    cardColors.AddRange(source.CardColors);
+                }
+
+                cardColors = cardColors.Distinct().ToList();
+
+                dp += cardColors.Count * 2000;
+
+                return dp;
+            }
+
+            #endregion
+
+            #region When Digivolving
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpICardEffect("Delete a Digimon with 10000 DP or less", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "";
+                    return
+                        "[When Digivolving] Delete 1 of your opponent's Digimon with 10000 DP or less. For each color in this Digimon's digivolution cards, add 2000 to this DP deletion effect's maximum.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
+                           permanent.DP <= card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return null;
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectPermanentCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Destroy,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                 }
             }
 
+            #endregion
+
+            #region When Attacking Deletion
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete a Digimon with 10000 DP or less", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Attacking] Delete 1 of your opponent's Digimon with 10000 DP or less. For each color in this Digimon's digivolution cards, add 2000 to this DP deletion effect's maximum.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
+                           permanent.DP <= card.Owner.MaxDP_DeleteEffect(DeletionMaxDP(), activateClass);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectPermanentCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Destroy,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                }
+            }
+
+            #endregion
+
+            #region When Attacking Trash Security
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect(
+                    "Place Tamer digivolution cards as your bottom security cards to trash Opponent's security cards", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Attacking] By placing up to 5 Tamer cards from this Digimon's digivolution cards as your bottom security cards, trash opponent's top security cards for each card placed by this effect.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanSelectTamerCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsTamer;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           card.PermanentOfThisCard().DigivolutionCards.Some(CanSelectTamerCardCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                    selectCardEffect.SetUp(
+                        canTargetCondition: CanSelectTamerCardCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: () => false,
+                        selectCardCoroutine: null,
+                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
+                        message:
+                        "Select cards that will get placed to the bottom of your security stack\n(cards will be placed to the bottom of the security stack so that cards with lower numbers are on top).",
+                        maxCount: Math.Min(5, card.PermanentOfThisCard().DigivolutionCards.Count(CanSelectTamerCardCondition)),
+                        canEndNotMax: true,
+                        isShowOpponent: true,
+                        mode: SelectCardEffect.Mode.Custom,
+                        root: SelectCardEffect.Root.Custom,
+                        customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
+                        canLookReverseCard: true,
+                        selectPlayer: card.Owner,
+                        cardEffect: activateClass);
+
+                    selectCardEffect.SetUpCustomMessage("Select digivolution cards to place to the bottom of your security stack.",
+                        "The opponent is selecting digivolution cards to place to the bottom of your security stack.");
+                    selectCardEffect.SetNotShowCard();
+                    yield return StartCoroutine(selectCardEffect.Activate());
+
+                    IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
+                    {
+                        foreach (var cardSource in cardSources)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(
+                                CardObjectController.AddSecurityCard(cardSource, toTop: false));
+
+                            yield return ContinuousController.instance.StartCoroutine(GManager.instance
+                                .GetComponent<Effects>().CreateRecoveryEffect(cardSource.Owner));
+
+                            yield return ContinuousController.instance.StartCoroutine(
+                                new IAddSecurity(cardSource.Owner).AddSecurity());
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                            player: card.Owner.Enemy,
+                            destroySecurityCount: cardSources.Count,
+                            cardEffect: activateClass,
+                            fromTop: true).DestroySecurity());
+                    }
+                }
+            }
+
+            #endregion
+
             return cardEffects;
         }
     }

+ 2 - 2
Assets/CardEffect/EX7/Purple/LadyDevimonXAntibody_EX7_058.cs

@@ -172,7 +172,7 @@ namespace DCGO.CardEffects.EX7
 
                     if (CanActivateSecondEffectCondition(hashtable))
                     {
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayVoléeZerdrücken(activateClass));
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayVoleeZerdrucken(activateClass));
                     }
                 }
             }
@@ -307,7 +307,7 @@ namespace DCGO.CardEffects.EX7
 
                     if (CanActivateSecondEffectCondition(hashtable))
                     {
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayVoléeZerdrücken(activateClass));
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayVoleeZerdrucken(activateClass));
                     }
                 }
             }

+ 2 - 2
Assets/Scripts/CardEffectCommons.cs

@@ -230,10 +230,10 @@ public partial class CardEffectCommons
     #endregion
 
     #region Play 1 [Volée & Zerdrücken] Token
-    public static IEnumerator PlayVoléeZerdrücken(ICardEffect activateClass)
+    public static IEnumerator PlayVoleeZerdrucken(ICardEffect activateClass)
     {
         yield return ContinuousController.instance.StartCoroutine(PlayToken(
-            tokenData: ContinuousController.instance.VoléeZerdrückenToken,
+            tokenData: ContinuousController.instance.VoleeZerdruckenToken,
             activateClass: activateClass,
             isOwnerPermanent: true,
             isTapped: false

+ 3 - 3
Assets/Scripts/ContinuousController.cs

@@ -109,7 +109,7 @@ public class ContinuousController : MonoBehaviour
     public CEntity_Base GyuukimonToken { get; private set; }
     public CEntity_Base KoHagurumonToken { get; private set; }
     public CEntity_Base FamiliarToken { get; private set; }
-    public CEntity_Base VoléeZerdrückenToken { get; private set; }
+    public CEntity_Base VoleeZerdruckenToken { get; private set; }
     public CardRestriction BanList { get; private set; } = new CardRestriction(new List<CardLimitCount>(), new List<BannedPair>());
 
     void LoadBanList()
@@ -264,7 +264,7 @@ public class ContinuousController : MonoBehaviour
 
         await FamiliarToken.GetCardSprite();
 
-        VoléeZerdrückenToken = new CEntity_Base()
+        VoleeZerdruckenToken = new CEntity_Base()
         {
             cardColors = new List<CardColor>() { CardColor.Purple },
             PlayCost = -1,
@@ -283,7 +283,7 @@ public class ContinuousController : MonoBehaviour
             CardEffectClassName = "VoléeZerdrücken_EX7_030_token"
         };
 
-        await VoléeZerdrückenToken.GetCardSprite();
+        await VoleeZerdruckenToken.GetCardSprite();
     }
 
     public static ContinuousController instance = null;