Browse Source

1.8.0.7 build

mbunch_kascope 1 year ago
parent
commit
001535b8e7

+ 86 - 51
Assets/CardEffect/P/Black/P_179.cs

@@ -11,6 +11,25 @@ namespace DCGO.CardEffects.P
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Alternate Digivolution Requirement
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    if (targetPermanent.TopCard.EqualsCardName("Justimon: Blitz Arm") || targetPermanent.TopCard.EqualsCardName("Justimon: Accel Arm"))
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false, card: card, condition: null));
+            }
+
+            #endregion
+
             #region Reduce Digivolution Cost
 
             if (timing == EffectTiming.None)
@@ -32,74 +51,86 @@ namespace DCGO.CardEffects.P
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
-                    => "When Digivolving] By placing 1 Option card with the [Device] trait from your hand or trash into the battle area, this Digimon gets +3000 DP until your opponent's turn ends.";
+                    => "[When Digivolving] By placing 1 Option card with the [Device] trait from your hand or trash into the battle area, this Digimon gets +3000 DP until your opponent's turn ends.";
 
                 bool CanSelectOption(CardSource cardSource)
                     => cardSource.IsOption && cardSource.HasDeviceTraits;
 
                 bool CanUseCondition(Hashtable hashtable)
-                    => CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                    => CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                       CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
 
                 bool CanActivateCondition(Hashtable hashtable)
                     => CardEffectCommons.IsExistOnBattleAreaDigimon(card)
-                    && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                    && (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectOption) || CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectOption));
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     CardSource selectedDevice = null;
-                    SelectCardEffect SharedSelectCardEffect(SelectCardEffect.Root root)
-                    {
-                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-                        selectCardEffect.SetUp(
-                            canTargetCondition: CanSelectOption,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            canNoSelect: () => true,
-                            selectCardCoroutine: SelectCardCoroutine,
-                            afterSelectCardCoroutine: null,
-                            message: "Select Device to play",
-                            maxCount: 1,
-                            canEndNotMax: true,
-                            isShowOpponent: true,
-                            mode: SelectCardEffect.Mode.Custom,
-                            root: root,
-                            customRootCardList: null,
-                            canLookReverseCard: true,
-                            selectPlayer: card.Owner,
-                            cardEffect: activateClass);
+                    bool optionInHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectOption);
+                    bool optionInTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectOption);
+                    SelectCardEffect.Root root = SelectCardEffect.Root.Hand;
 
-                        return selectCardEffect;
-                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    if (optionInHand && optionInTrash)
+                    {
+                        List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
                         {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                cardSources: new List<CardSource> { cardSource },
-                                activateClass: activateClass,
-                                payCost: false,
-                                isTapped: false,
-                                root: SelectCardEffect.Root.Trash,
-                                activateETB: true));
-                            selectedDevice = cardSource;
-                        }
-                    }
+                            new(message: "From hand", value: true, spriteIndex: 0),
+                            new(message: "From trash", value: false, spriteIndex: 1)
+                        };
+
+                        string selectPlayerMessage = "Choose option location";
+                        string notSelectPlayerMessage = "The opponent is choosing the option location.";
+
+                        GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner,
+                        selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
 
-                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                        root = GManager.instance.userSelectionManager.SelectedBoolValue ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
+                    }
+                    else
                     {
-                        new(message: "From hand", value: true, spriteIndex: 0),
-                        new(message: "From trash", value: false, spriteIndex: 1)
-                    };
+                        root = optionInHand ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
+                    }
+
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+                    selectCardEffect.SetUp(
+                        canTargetCondition: CanSelectOption,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: () => true,
+                        selectCardCoroutine: SelectCardCoroutine,
+                        afterSelectCardCoroutine: null,
+                        message: "Select Device to play",
+                        maxCount: 1,
+                        canEndNotMax: true,
+                        isShowOpponent: true,
+                        mode: SelectCardEffect.Mode.Custom,
+                        root: root,
+                        customRootCardList: null,
+                        canLookReverseCard: true,
+                        selectPlayer: card.Owner,
+                        cardEffect: activateClass);
 
-                    string selectPlayerMessage = "Choose option location";
-                    string notSelectPlayerMessage = "The opponent is choosing the option location.";
+                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    {
+                        selectedDevice = cardSource;
+                        yield return null;
+                    }
 
-                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner,
-                        selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
-                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
-                    SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedBoolValue ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
-                    if (root == SelectCardEffect.Root.Hand && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectOption)) yield return ContinuousController.instance.StartCoroutine(SharedSelectCardEffect(root).Activate());
-                    if (root == SelectCardEffect.Root.Trash && CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectOption)) yield return ContinuousController.instance.StartCoroutine(SharedSelectCardEffect(root).Activate());
                     if (selectedDevice != null)
                     {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                            cardSources: new List<CardSource> { selectedDevice },
+                            activateClass: activateClass,
+                            payCost: false,
+                            isTapped: false,
+                            root: SelectCardEffect.Root.Trash,
+                            activateETB: true));
+
                         ChangeBaseDPClass changeDPClass = new ChangeBaseDPClass();
                         changeDPClass.SetUpICardEffect("+3000 DP", (hashtable) => true, card);
                         changeDPClass.SetUpChangeBaseDPClass(changeDPFunc: ChangeDP, permanentCondition: permanentCondition, isUpDownFunc: () => false, isMinusDPFunc: () => false);
@@ -118,15 +149,13 @@ namespace DCGO.CardEffects.P
 
             #region When Digivolving/Attacking OPT Shared
 
-            string SharedEffectDiscription()
-                => "When Digivolving or attacking] By trashing 1 [Device] Option on the field, you can select 1 of your opponent's Digimon with a level of 9 or less to delete.";
             bool CanSelectPermanentOptionCondition(Permanent permanent)
                 => permanent.TopCard.IsOption && permanent.TopCard.HasDeviceTraits;
 
             bool CanSelectPermanentDigimonCondition(Permanent permanent)
                 => CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent)
-                && permanent.TopCard.HasLevel
-                && permanent.TopCard.Level <= 9;
+                && permanent.TopCard.HasPlayCost
+                && permanent.TopCard.GetCostItself <= 9;
 
             IEnumerator SharedActivateCoroutine(Hashtable _hashtable, ActivateClass activateClass)
             {
@@ -194,6 +223,9 @@ namespace DCGO.CardEffects.P
                 activateClass.SetHashString("P_179_Trash&Delete");
                 cardEffects.Add(activateClass);
 
+                string SharedEffectDiscription()
+                => "[When Digivolving] By trashing 1 [Device] Option on the field, you can select 1 of your opponent's Digimon with a level of 9 or less to delete.";
+
                 bool CanUseCondition(Hashtable hashtable)
                     => CardEffectCommons.IsExistOnBattleAreaDigimon(card);
 
@@ -214,6 +246,9 @@ namespace DCGO.CardEffects.P
                 activateClass.SetHashString("P_179_Trash&Delete");
                 cardEffects.Add(activateClass);
 
+                string SharedEffectDiscription()
+                => "[When Attacking] By trashing 1 [Device] Option on the field, you can select 1 of your opponent's Digimon with a level of 9 or less to delete.";
+
                 bool CanUseCondition(Hashtable hashtable)
                     => CardEffectCommons.IsExistOnBattleAreaDigimon(card);
 

+ 22 - 29
Assets/CardEffect/P/Red/P_180.cs

@@ -29,27 +29,24 @@ namespace DCGO.CardEffects.P
 
             #endregion
 
-            #region When Source Stripped
-
+            #region When Trashed from digivolutions cards
             if (timing == EffectTiming.OnDigivolutionCardDiscarded)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Delete 1 digimon with 7k DP or lower", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                     => "When effects trash this card from digivolution cards, delete 1 of your opponent's 7000 DP or lower Digimon.";
 
-                bool PermanentCondition(Permanent permanent)
-                    => CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
-
                 bool CanUseCondition(Hashtable hashtable)
-                    => CardEffectCommons.IsExistOnTrash(card)
-                    && CardEffectCommons.CanTriggerOnTrashDigivolutionCard(hashtable, PermanentCondition, cardEffect => true, cardSource => card);
+                    => CardEffectCommons.CanTriggerOnTrashSelfDigivolutionCard(hashtable, cardEffect => cardEffect != null, card);
 
                 bool CanActivateCondition(Hashtable hashtable)
-                => CardEffectCommons.IsExistOnTrash(card);
+                => CardEffectCommons.IsExistOnTrash(card) &&
+                   CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentsDigimon);
 
                 bool CanSelectOpponentsDigimon(Permanent permanent)
                 => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
@@ -57,27 +54,23 @@ namespace DCGO.CardEffects.P
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectOpponentsDigimon))
-                    {
-                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentsDigimon));
-                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffect.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectOpponentsDigimon,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCount,
-                            canNoSelect: false,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: null,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Destroy,
-                            cardEffect: activateClass);
-
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 digimon to delete", "The opponent is selecting 1 digimon to delete");
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                    }
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectOpponentsDigimon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Destroy,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 digimon to delete", "The opponent is selecting 1 digimon to delete");
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                 }
             }
 

+ 1 - 1
Assets/Scripts/CardController.cs

@@ -513,7 +513,7 @@ public class PlayCardClass
 
             List<SkillInfo> skillInfos_BeforePayCost = AutoProcessing.GetSkillInfos(hashtable, EffectTiming.BeforePayCost)
             .Concat(AutoProcessing.GetSkillInfosOfCards(hashtable, EffectTiming.BeforePayCost, new List<CardSource>() { card }
-                .Filter(cardSource => !CardEffectCommons.IsExistOnHand(cardSource) && !CardEffectCommons.IsExistOnTrash(cardSource) && cardSource.PermanentOfThisCard() == null)))
+                .Filter(cardSource => !CardEffectCommons.IsExistOnHand(cardSource) && !CardEffectCommons.IsExistOnTrash(cardSource) && !CardEffectCommons.IsExistInSecurity(cardSource) && cardSource.PermanentOfThisCard() == null)))
             .ToList();
 
             yield return ContinuousController.instance.StartCoroutine(AutoProcessing.ActivateBackgroundEffects(hashtable, EffectTiming.BeforePayCost));

+ 1 - 1
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:7fca2bab5c9170bf7c64d6d83cc57c447f5f8a69755154922055e536b3994099
+oid sha256:465c229ec32d29c5108958e756da9bf884c9dc7bc587f1f0b68dcad4535548d4
 size 20168