mbunch_kascope 8 месяцев назад
Родитель
Сommit
3a4dc56592

+ 2 - 2
Assets/CardEffect/BT23/Black/BT23_057.cs

@@ -216,7 +216,7 @@ namespace DCGO.CardEffects.BT23
             if (timing == EffectTiming.None)
             {
                 ChangeCostClass changeCostClass = new ChangeCostClass();
-                changeCostClass.SetUpICardEffect("Play Cost -1", CanUseCondition, card);
+                changeCostClass.SetUpICardEffect("Play Cost -5", CanUseCondition, card);
                 changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => true, isChangePayingCost: () => true);
                 changeCostClass.SetNotShowUI(true);
                 cardEffects.Add(changeCostClass);
@@ -225,7 +225,7 @@ namespace DCGO.CardEffects.BT23
                 {
                     if (card.Owner.HandCards.Contains(card))
                     {
-                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Return 6 [D-Brigade] to get Play Cost -6");
+                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Return 3 cards with [Huckmon], [Sistermon] or [Jesmon] in their names to get Play Cost -5");
 
                         if (activateClass != null)
                         {

+ 95 - 94
Assets/CardEffect/BT23/Black/BT23_060.cs

@@ -288,124 +288,125 @@ namespace DCGO.CardEffects.BT23
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
-                           CardEffectCommons.HasMatchConditionOwnersSecurity(card, CanSelectCardCondition, false);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     CardSource selectedCard = null;
 
-                    #region Select target card
-                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                    selectCardEffect.SetUp(
-                        canTargetCondition: CanSelectCardCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        canNoSelect: () => false,
-                        selectCardCoroutine: SelectCardCoroutine,
-                        afterSelectCardCoroutine: null,
-                        message: "Select 1 card to use their [On Play] effect.",
-                        maxCount: 1,
-                        canEndNotMax: false,
-                        isShowOpponent: true,
-                        mode: SelectCardEffect.Mode.Custom,
-                        root: SelectCardEffect.Root.Security,
-                        customRootCardList: null,
-                        canLookReverseCard: false,
-                        selectPlayer: card.Owner,
-                        cardEffect: activateClass);
-
-                    selectCardEffect.SetUpCustomMessage(
-                        "Select 1 card to use their [On Play] effect.",
-                        "The opponent is selecting 1 card to use their [On Play] effect.");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
-
-                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    if(CardEffectCommons.HasMatchConditionOwnersSecurity(card, CanSelectCardCondition, false))
                     {
-                        selectedCard = cardSource;
+                        #region Select target card
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
-                        yield return null;
-                    }
-                    #endregion
+                        selectCardEffect.SetUp(
+                            canTargetCondition: CanSelectCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => false,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            message: "Select 1 card to use their [On Play] effect.",
+                            maxCount: 1,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            mode: SelectCardEffect.Mode.Custom,
+                            root: SelectCardEffect.Root.Security,
+                            customRootCardList: null,
+                            canLookReverseCard: false,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
 
-                    #region Select Effect
+                        selectCardEffect.SetUpCustomMessage(
+                            "Select 1 card to use their [On Play] effect.",
+                            "The opponent is selecting 1 card to use their [On Play] effect.");
 
-                    if (selectedCard != null)
-                    {
-                        List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
-                            .Clone()
-                            .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.EffectDiscription.StartsWith("[On Play]"));
+                        yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
-                        if (candidateEffects.Count >= 1)
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
                         {
-                            ICardEffect selectedEffect = null;
+                            selectedCard = cardSource;
 
-                            if (candidateEffects.Count == 1)
-                            {
-                                selectedEffect = candidateEffects[0];
-                            }
-                            else
+                            yield return null;
+                        }
+                        #endregion
+
+                        #region Select Effect
+
+                        if (selectedCard != null)
+                        {
+                            List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
+                                .Clone()
+                                .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.EffectDiscription.StartsWith("[On Play]"));
+
+                            if (candidateEffects.Count >= 1)
                             {
-                                List<SkillInfo> skillInfos = candidateEffects
-                                    .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
-
-                                List<CardSource> cardSources = candidateEffects
-                                    .Map(cardEffect => cardEffect.EffectSourceCard);
-
-                                SelectCardEffect selectCardEffect2 = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                selectCardEffect2.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);
-
-                                selectCardEffect2.SetNotShowCard();
-                                selectCardEffect2.SetUpSkillInfos(skillInfos);
-                                selectCardEffect2.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
-
-                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect2.Activate());
-
-                                IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
+                                ICardEffect selectedEffect = null;
+
+                                if (candidateEffects.Count == 1)
+                                {
+                                    selectedEffect = candidateEffects[0];
+                                }
+                                else
                                 {
-                                    if (selectedIndexes.Count == 1)
+                                    List<SkillInfo> skillInfos = candidateEffects
+                                        .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
+
+                                    List<CardSource> cardSources = candidateEffects
+                                        .Map(cardEffect => cardEffect.EffectSourceCard);
+
+                                    SelectCardEffect selectCardEffect2 = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                    selectCardEffect2.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);
+
+                                    selectCardEffect2.SetNotShowCard();
+                                    selectCardEffect2.SetUpSkillInfos(skillInfos);
+                                    selectCardEffect2.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect2.Activate());
+
+                                    IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
                                     {
-                                        selectedEffect = candidateEffects[selectedIndexes[0]];
-                                        yield return null;
+                                        if (selectedIndexes.Count == 1)
+                                        {
+                                            selectedEffect = candidateEffects[selectedIndexes[0]];
+                                            yield return null;
+                                        }
                                     }
                                 }
-                            }
-
-                            if (selectedEffect != null)
-                            {
-                                Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
 
-                                if (selectedEffect.CanUse(effectHashtable))
+                                if (selectedEffect != null)
                                 {
-                                    selectedEffect.SetIsDigimonEffect(true);
-                                    yield return ContinuousController.instance.StartCoroutine(
-                                        ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
+                                    Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
+
+                                    if (selectedEffect.CanUse(effectHashtable))
+                                    {
+                                        selectedEffect.SetIsDigimonEffect(true);
+                                        yield return ContinuousController.instance.StartCoroutine(
+                                            ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
+                                    }
                                 }
                             }
                         }
+                        #endregion
                     }
-                    #endregion
-
                 }
             }
 

+ 1 - 79
Assets/CardEffect/BT23/Blue/BT23_025.cs

@@ -261,85 +261,7 @@ namespace DCGO.CardEffects.BT23
             #region Security Effect
             if (timing == EffectTiming.SecuritySkill)
             {
-                cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card));
-
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, "");
-                activateClass.SetIsBackgroundProcess(true);
-                cardEffects.Add(activateClass);
-
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleArea(card) &&
-                           CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
-                }
-
-                IEnumerator ActivateCoroutine(Hashtable hashtable)
-                {
-                    yield return new WaitForSeconds(0.2f);
-
-                    #region Delete Digimon Played
-                    Permanent playedDigimon = card.PermanentOfThisCard();
-
-                    ActivateClass activateClass1 = new ActivateClass();
-                    activateClass1.SetUpICardEffect("Delete the Digimon", CanUseCondition2, card);
-                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
-                    activateClass1.SetEffectSourcePermanent(playedDigimon);
-                    playedDigimon.UntilOpponentTurnEndEffects.Add(GetCardEffect);
-
-                    string EffectDiscription1()
-                    {
-                        return "[End of Opponents Turn] Delete this Digimon.";
-                    }
-
-                    bool CanUseCondition2(Hashtable hashtable1)
-                    {
-                        if (CardEffectCommons.IsOpponentTurn(card))
-                        {
-                            if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(playedDigimon, playedDigimon.TopCard))
-                            {
-                                return true;
-                            }
-                        }
-
-                        return false;
-                    }
-
-                    bool CanActivateCondition1(Hashtable hashtable1)
-                    {
-                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedDigimon))
-                        {
-                            if (!playedDigimon.TopCard.CanNotBeAffected(activateClass1))
-                            {
-                                return true;
-                            }
-                        }
-
-                        return false;
-                    }
-
-                    IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
-                    {
-                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedDigimon))
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(
-                            new List<Permanent>() { playedDigimon },
-                            CardEffectCommons.CardEffectHashtable(activateClass1)).Destroy());
-                        }
-                    }
-
-                    ICardEffect GetCardEffect(EffectTiming _timing)
-                    {
-                        if (_timing == EffectTiming.OnEndTurn)
-                        {
-                            return activateClass1;
-                        }
-
-                        return null;
-                    }
-                    #endregion
-                }
+                cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card, EffectDuration.UntilOpponentTurnEnd));
             }
             #endregion
 

+ 1 - 1
Assets/CardEffect/BT23/Yellow/BT23_028.cs

@@ -228,7 +228,7 @@ namespace DCGO.CardEffects.BT23
                             DisableEffectClass invalidationClass = new DisableEffectClass();
                             invalidationClass.SetUpICardEffect("Ignore [When Digivolving] Effect", CanUseConditionDebuff, card);
                             invalidationClass.SetUpDisableEffectClass(DisableCondition: InvalidateCondition);
-                            selectedPermanent.UntilEachTurnEndEffects.Add(_ => invalidationClass);
+                            selectedPermanent.UntilOwnerTurnEndEffects.Add(_ => invalidationClass);
 
                             bool CanUseConditionDebuff(Hashtable hashtableDebuff)
                             {

+ 1 - 1
Assets/CardEffect/BT23/Yellow/BT23_035.cs

@@ -60,7 +60,7 @@ namespace DCGO.CardEffects.BT23
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDPPlayerEffect(
                         permanentCondition: PermanentCondition,
                         changeValue: -6000,
-                        effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                        effectDuration: EffectDuration.UntilEachTurnEnd,
                         activateClass: activateClass));
                 }
 

+ 1 - 1
Assets/Scripts/CardController.cs

@@ -1925,7 +1925,7 @@ public class IAddSecurityFromLibrary
             {
                 CardSource StockCard = _player.LibraryCards[0];
 
-                yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(StockCard));
+                yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(StockCard, useEffect: (i == 0)));
 
                 count++;
             }

+ 86 - 1
Assets/Scripts/CardEffectFactory.cs

@@ -2,6 +2,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
+using UnityEngine;
 
 public partial class CardEffectFactory
 {
@@ -193,7 +194,7 @@ public partial class CardEffectFactory
 
     #region Digimon's Security effect to play oneself after battle
 
-    public static ICardEffect PlaySelfDigimonAfterBattleSecurityEffect(CardSource card)
+    public static ICardEffect PlaySelfDigimonAfterBattleSecurityEffect(CardSource card, EffectDuration deleteDigimon = EffectDuration.UntilEndBattle)
     {
         ActivateClass activateClass = new ActivateClass();
         activateClass.SetUpICardEffect("Play this card at the end of the battle", CanUseCondition, card);
@@ -226,6 +227,7 @@ public partial class CardEffectFactory
 
             ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
 
+            #region Play Card
             ActivateClass activateClass1 = new ActivateClass();
             activateClass1.SetUpICardEffect("Play this card", CanUseCondition1, card);
             activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
@@ -267,6 +269,87 @@ public partial class CardEffectFactory
                             isTapped: false,
                             root: SelectCardEffect.Root.Security,
                             activateETB: true));
+
+                        if (deleteDigimon != EffectDuration.UntilEndBattle)
+                        {
+                            yield return new WaitForSeconds(0.2f);
+
+                            #region Delete Digimon Played
+                            Permanent playedDigimon = card.PermanentOfThisCard();
+
+                            ActivateClass activateClass2 = new ActivateClass();
+                            activateClass2.SetUpICardEffect("Delete this Digimon", CanUseCondition2, card);
+                            activateClass2.SetUpActivateClass(CanActivateCondition2, ActivateCoroutine2, -1, false, EffectDiscription2());
+                            activateClass2.SetEffectSourcePermanent(playedDigimon);
+                            playedDigimon.UntilOpponentTurnEndEffects.Add(GetCardEffect);
+
+                            string EffectDiscription2()
+                            {
+                                if (deleteDigimon == EffectDuration.UntilOwnerTurnEnd)
+                                {
+                                    return "[End of Your Turn] Delete this Digimon.";
+                                }
+
+                                if (deleteDigimon == EffectDuration.UntilOpponentTurnEnd)
+                                {
+                                    return "[End of Opponents Turn] Delete this Digimon.";
+                                }
+
+                                return "";
+                            }
+
+                            bool CanUseCondition2(Hashtable hashtable1)
+                            {
+                                if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(playedDigimon, playedDigimon.TopCard))
+                                {
+                                    if(deleteDigimon == EffectDuration.UntilOwnerTurnEnd)
+                                    {
+                                        return CardEffectCommons.IsOwnerTurn(card);
+                                    }
+
+                                    if (deleteDigimon == EffectDuration.UntilOpponentTurnEnd)
+                                    {
+                                        return CardEffectCommons.IsOpponentTurn(card);
+                                    }
+                                }
+
+                                return false;
+                            }
+
+                            bool CanActivateCondition2(Hashtable hashtable1)
+                            {
+                                if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedDigimon))
+                                {
+                                    if (!playedDigimon.TopCard.CanNotBeAffected(activateClass2))
+                                    {
+                                        return true;
+                                    }
+                                }
+
+                                return false;
+                            }
+
+                            IEnumerator ActivateCoroutine2(Hashtable _hashtable1)
+                            {
+                                if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedDigimon))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(
+                                    new List<Permanent>() { playedDigimon },
+                                    CardEffectCommons.CardEffectHashtable(activateClass2)).Destroy());
+                                }
+                            }
+
+                            ICardEffect GetCardEffect(EffectTiming _timing)
+                            {
+                                if (_timing == EffectTiming.OnEndTurn)
+                                {
+                                    return activateClass2;
+                                }
+
+                                return null;
+                            }
+                            #endregion
+                        }
                     }
                 }
             }
@@ -280,6 +363,8 @@ public partial class CardEffectFactory
 
                 return null;
             }
+            #endregion
+
         }
 
         return activateClass;

+ 3 - 2
Assets/Scripts/CardObjectController.cs

@@ -966,7 +966,7 @@ public class CardObjectController : MonoBehaviour
     #endregion
 
     #region Add card to security
-    public static IEnumerator AddSecurityCard(CardSource cardSource, bool toTop = true, bool faceUp = false)
+    public static IEnumerator AddSecurityCard(CardSource cardSource, bool toTop = true, bool faceUp = false, bool useEffect = true)
     {
         if (!cardSource.Owner.SecurityCards.Contains(cardSource))
         {
@@ -987,7 +987,8 @@ public class CardObjectController : MonoBehaviour
                     cardSource.Owner.SecurityCards.Add(cardSource);
                 }
 
-                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateRecoveryEffect(cardSource.Owner));
+                if(useEffect)
+                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateRecoveryEffect(cardSource.Owner));
 
                 yield return ContinuousController.instance.StartCoroutine(new IAddSecurity(cardSource).AddSecurity());
             }

+ 1 - 1
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:fe2de0aa918a0e773c6acc7a1743f0ccd96cf7179977d413755edf39a3b0a95d
+oid sha256:08755cc737627755dd197b334eeb83bf7ad8af0ad6a245bef6320006815c87b6
 size 20167