Explorar o código

Update level 4 scripts

Andrej Erdelsky hai 1 ano
pai
achega
87b0e2d04b

+ 2 - 1
.gitignore

@@ -86,4 +86,5 @@ crashlytics-build.properties
 /Assets/Resources/Fonts & Materials/Makinas-4-Flat SDF.asset
 /Assets/Resources/Fonts & Materials/mplus-1c-regular SDF.asset
 /Assets/Resources/Fonts & Materials/ANTQUAB SDF.asset
-/Assets/StreamingAssets/Card/
+/Assets/StreamingAssets/Card/
+/.idea

+ 1 - 1
Assets/CardEffect/BT18/Black/Beetlemon_BT18_063.cs

@@ -208,7 +208,7 @@ namespace DCGO.CardEffects.BT18
                 string EffectDescription()
                 {
                     return
-                        "[All Turns] (Once Per Turn) When this Digimon would leave the battle area other than by your effects, you may play 1 Tamer card with inherited effects from this Digimon's digivolution cards without paying the cost.";
+                        "[All Turns] When this Digimon would leave the battle area other than by your effects, you may play 1 Tamer card with inherited effects from this Digimon's digivolution cards without paying the cost.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 1 - 1
Assets/CardEffect/BT18/Blue/Kumamon_BT18_022.cs

@@ -236,7 +236,7 @@ namespace DCGO.CardEffects.BT18
                 string EffectDescription()
                 {
                     return
-                        "[All Turns] (Once Per Turn) When this Digimon would leave the battle area other than by your effects, you may play 1 Tamer card with inherited effects from this Digimon's digivolution cards without paying the cost.";
+                        "[All Turns] When this Digimon would leave the battle area other than by your effects, you may play 1 Tamer card with inherited effects from this Digimon's digivolution cards without paying the cost.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 1 - 1
Assets/CardEffect/BT18/Green/Kazemon_BT18_048.cs

@@ -225,7 +225,7 @@ namespace DCGO.CardEffects.BT18
                 string EffectDescription()
                 {
                     return
-                        "[All Turns] (Once Per Turn) When this Digimon would leave the battle area other than by your effects, you may play 1 Tamer card with inherited effects from this Digimon's digivolution cards without paying the cost.";
+                        "[All Turns] When this Digimon would leave the battle area other than by your effects, you may play 1 Tamer card with inherited effects from this Digimon's digivolution cards without paying the cost.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 3 - 5
Assets/CardEffect/BT18/Purple/Loweemon_BT18_076.cs

@@ -97,16 +97,14 @@ namespace DCGO.CardEffects.BT18
 
                     if (card.Owner.HandCards.Count >= 1)
                     {
-                        int discardCount = 1;
-
                         SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
                         selectHandEffect.SetUp(
                             selectPlayer: card.Owner,
-                            canTargetCondition: (cardSource) => true,
+                            canTargetCondition: _ => true,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
-                            maxCount: discardCount,
+                            maxCount: 1,
                             canNoSelect: false,
                             canEndNotMax: false,
                             isShowOpponent: true,
@@ -227,7 +225,7 @@ namespace DCGO.CardEffects.BT18
                 string EffectDescription()
                 {
                     return
-                        "[All Turns] (Once Per Turn) When this Digimon would leave the battle area other than by your effects, you may play 1 Tamer card with inherited effects from this Digimon's digivolution cards without paying the cost.";
+                        "[All Turns] When this Digimon would leave the battle area other than by your effects, you may play 1 Tamer card with inherited effects from this Digimon's digivolution cards without paying the cost.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 172 - 7
Assets/CardEffect/BT18/Yellow/Lobomon_BT18_037.cs

@@ -1,5 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
+using System;
+using System.Linq;
 
 namespace DCGO.CardEffects.BT18
 {
@@ -9,34 +11,197 @@ namespace DCGO.CardEffects.BT18
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Alternate Digivolution
+
+            // Any yellow or blue tamer
             if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return card.Owner.HandCards.Contains(card);
+                }
+
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.IsTamer && (targetPermanent.TopCard.CardColors.Contains(CardColor.Yellow) ||
+                                                       targetPermanent.TopCard.CardColors.Contains(CardColor.Blue));
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false,
+                    card: card, condition: Condition));
+            }
+
+            // Koji Minamoto
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return card.Owner.HandCards.Contains(card);
+                }
+
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.EqualsCardName("Koji Minamoto") ||
+                           targetPermanent.TopCard.EqualsCardName("KojiMinamoto");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false,
+                    card: card, condition: Condition));
+            }
+
+            // KendoGarurumon
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.EqualsCardName("KendoGarurumon");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false,
+                    card: card, condition: null));
+            }
+
+            #endregion
+
+            #region When Digivolving
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Add 1 card from security to hand", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Digivolving] Search your security stack. You may add 1 card with the [Hybrid]/[Ten Warriors] trait among them to your hand. If you added a card, <Recovery +1 (Deck)> (Place the top card of your deck on top of your security stack). Then, shuffle your security stack.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    return cardSource.HasHybridTenWarriorsTraits;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           card.Owner.SecurityCards.Count >= 1;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    int maxCount = Math.Min(1, card.Owner.SecurityCards.Count(CanSelectCardCondition));
+
+                    CardSource selectedCard = null;
+
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                    selectCardEffect.SetUp(
+                        canTargetCondition: CanSelectCardCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: () => true,
+                        selectCardCoroutine: null,
+                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
+                        message: "Select 1 card to add to your hand.",
+                        maxCount: maxCount,
+                        canEndNotMax: false,
+                        isShowOpponent: true,
+                        mode: SelectCardEffect.Mode.AddHand,
+                        root: SelectCardEffect.Root.Security,
+                        customRootCardList: null,
+                        canLookReverseCard: true,
+                        selectPlayer: card.Owner,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
+                    IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
+                    {
+                        foreach (CardSource cardSource in cardSources)
+                        {
+                            selectedCard = cardSource;
+                        }
+
+                        if (cardSources.Count >= 1)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(new IReduceSecurity(
+                                player: card.Owner,
+                                refSkillInfos: ref ContinuousController.instance.nullSkillInfos).ReduceSecurity());
+                        }
+
+                        yield return null;
+                    }
+
+                    if (selectedCard)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
+                    }
+
+                    ContinuousController.instance.PlaySE(GManager.instance.ShuffleSE);
+
+                    card.Owner.SecurityCards = RandomUtility.ShuffledDeckCards(card.Owner.SecurityCards);
+                }
+            }
+
+            #endregion
+
+            #region When Attacking - ESS
+
+            if (timing == EffectTiming.OnAllyAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false,
+                    EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "";
+                    return
+                        "[When Attacking] If you have 7 or fewer cards in your hand, [Draw 1].";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return true;
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (card.Owner.HandCards.Count <= 7)
+                        {
+                            if (card.Owner.LibraryCards.Count >= 1)
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return null;
+                    yield return ContinuousController.instance.StartCoroutine(
+                        new DrawClass(card.Owner, 1, activateClass).Draw());
                 }
             }
 
+            #endregion
+
             return cardEffects;
         }
     }