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

plesiomon, face up security options, ryutaro williams

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

+ 7 - 0
Assets/AddOn/GlitchFx-master/GlitchFx.unitypackage.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: d80f995af690a474e841364c1e88ee1b
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 36 - 46
Assets/CardEffect/EX8/Blue/EX8_027.cs

@@ -75,56 +75,46 @@ namespace DCGO.CardEffects.EX8
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        Permanent selectedPermanent = card.PermanentOfThisCard();
+                    List<CardSource> selectedCards = new List<CardSource>();
 
-                        if (selectedPermanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
-                        {
-                            int maxCount = Math.Min(1, selectedPermanent.DigivolutionCards.Count(CanSelectCardCondition));
-
-                            List<CardSource> selectedCards = new List<CardSource>();
-
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                        canTargetCondition: CanSelectCardCondition,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        canNoSelect: () => true,
-                                        selectCardCoroutine: SelectCardCoroutine,
-                                        afterSelectCardCoroutine: null,
-                                        message: "Select 1 digivolution card to play.",
-                                        maxCount: maxCount,
-                                        canEndNotMax: false,
-                                        isShowOpponent: true,
-                                        mode: SelectCardEffect.Mode.Custom,
-                                        root: SelectCardEffect.Root.Custom,
-                                        customRootCardList: selectedPermanent.DigivolutionCards,
-                                        canLookReverseCard: true,
-                                        selectPlayer: card.Owner,
-                                        cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 digivolution card to play.", "The opponent is selecting 1 digivolution card to play.");
-
-                            yield return StartCoroutine(selectCardEffect.Activate());
-
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
-                                yield return null;
-                            }
+                    selectCardEffect.SetUp(
+                                canTargetCondition: CanSelectCardCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                canNoSelect: () => true,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message: "Select 1 digivolution card to play.",
+                                maxCount: 1,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.Custom,
+                                root: SelectCardEffect.Root.Custom,
+                                customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                cardSources: selectedCards,
-                                activateClass: activateClass,
-                                payCost: false,
-                                isTapped: false,
-                                root: SelectCardEffect.Root.DigivolutionCards,
-                                activateETB: true));
-                        }
+                    selectCardEffect.SetUpCustomMessage("Select 1 digivolution card to play.", "The opponent is selecting 1 digivolution card to play.");
+
+                    yield return StartCoroutine(selectCardEffect.Activate());
+
+                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    {
+                        selectedCards.Add(cardSource);
+
+                        yield return null;
                     }
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                        cardSources: selectedCards,
+                        activateClass: activateClass,
+                        payCost: false,
+                        isTapped: false,
+                        root: SelectCardEffect.Root.DigivolutionCards,
+                        activateETB: true));
                 }
             }
             #endregion

+ 1 - 0
Assets/CardEffect/EX8/Blue/EX8_068.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 
 namespace DCGO.CardEffects.EX8

+ 43 - 11
Assets/CardEffect/EX8/Green/EX8_069.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 
 namespace DCGO.CardEffects.EX8
@@ -34,24 +35,55 @@ namespace DCGO.CardEffects.EX8
 
             #region All Turns - Security
 
-            if (timing == EffectTiming.None)
+            if(timing == EffectTiming.None)
             {
-                bool CanUseCondition()
+                bool PermanentCondition(Permanent permanent)
                 {
-                    return CardEffectCommons.IsExistInSecurity(card, false);
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           permanent.TopCard.EqualsTraits("NSp");
                 }
 
-                bool PermanentCondition(Permanent permanent)
+                AddSkillClass addSkillClass = new AddSkillClass();
+                addSkillClass.SetUpICardEffect("Your Digimons gain Alliance", CanUseCondition, card);
+                addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
+                cardEffects.Add(addSkillClass);
+
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
-                           permanent.TopCard.EqualsTraits("Nsp");
+                    return CardEffectCommons.IsExistInSecurity(card, false) &&
+                        CardEffectCommons.HasMatchConditionPermanent(PermanentCondition);
                 }
 
-                cardEffects.Add(CardEffectFactory.AllianceStaticEffect(
-                    permanentCondition: PermanentCondition,
-                    isInheritedEffect: false,
-                    card: card,
-                    condition: CanUseCondition));
+                bool CardSourceCondition(CardSource cardSource)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(cardSource))
+                    {
+                        if (cardSource == cardSource.PermanentOfThisCard().TopCard)
+                        {
+                            if (PermanentCondition(cardSource.PermanentOfThisCard()))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
+                {
+                    if (_timing == EffectTiming.OnAllyAttack)
+                    {
+                        bool Condition()
+                        {
+                            return CardSourceCondition(cardSource);
+                        }
+
+                        cardEffects.Add(CardEffectFactory.AllianceSelfEffect(false, cardSource, Condition));
+                    }
+
+                    return cardEffects;
+                }
             }
 
             #endregion

+ 32 - 67
Assets/CardEffect/EX8/Red/EX8_065.cs

@@ -94,33 +94,17 @@ namespace DCGO.CardEffects.EX8
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card);
-                }
-
-                bool CanSelectCardCondition(CardSource cardSource)
-                {
-                    return cardSource.IsDigimon && cardSource.HasLevel && cardSource.ContainsCardName("Tyrannomon") || cardSource.ContainsTraits("Dinosaur");
-                }
-
-                bool CanSelectPermanentCondition(Permanent permanent)
-                { 
-                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        if (permanent != card.PermanentOfThisCard())
+                        if (CardEffectCommons.IsOwnerTurn(card))
                         {
-                            foreach (CardSource cardSource in card.Owner.HandCards)
+                            if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
                             {
-                                if (CanSelectCardCondition(cardSource))
-                                {
-                                    if (cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass))
-                                    {
-                                        return true;
-                                    }
-                                }
+                                return true;
                             }
                         }
                     }
-                   
+
                     return false;
                 }
 
@@ -128,12 +112,9 @@ namespace DCGO.CardEffects.EX8
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        if (CardEffectCommons.IsOwnerTurn(card))
+                        if (CardEffectCommons.CanActivateSuspendCostEffect(card))
                         {
-                            if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
-                            {
-                                return true;
-                            }
+                            return true;
                         }
                     }
 
@@ -146,52 +127,36 @@ namespace DCGO.CardEffects.EX8
                         new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() },
                             CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
 
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
+                    if (GManager.instance.attackProcess.AttackingPermanent != null)
                     {
-                        Permanent selectedPermanent = null;
-
-                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
-
-                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffect.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCount,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: SelectPermanentCoroutine,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
-
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will digivolve.", "The opponent is selecting 1 Digimon that will digivolve.");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        if (GManager.instance.attackProcess.AttackingPermanent.TopCard != null && !GManager.instance.attackProcess.AttackingPermanent.IsToken)
                         {
-                            selectedPermanent = permanent;
+                            Permanent selectedPermanent = GManager.instance.attackProcess.AttackingPermanent;
 
-                            yield return null;
-                        }
+                            bool CanSelectCardCondition(CardSource cardSource)
+                            {
+                                return cardSource.IsDigimon &&
+                                       cardSource.HasLevel &&
+                                       (cardSource.ContainsCardName("Tyrannomon") || cardSource.ContainsTraits("Dinosaur")) &&
+                                       cardSource.CanPlayCardTargetFrame(selectedPermanent.PermanentFrame, false, activateClass);
+                            }
 
-                        if (selectedPermanent != null)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
-                                targetPermanent: selectedPermanent,
-                                cardCondition: CanSelectCardCondition,
-                                payCost: true,
-                                reduceCostTuple: (reduceCost: 1, reduceCostCardCondition: null),
-                                fixedCostTuple: null,
-                                ignoreDigivolutionRequirementFixedCost: -1,
-                                isHand: true,
-                                activateClass: activateClass,
-                                successProcess: null));
+                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                        targetPermanent: selectedPermanent,
+                                        cardCondition: CanSelectCardCondition,
+                                        payCost: true,
+                                        reduceCostTuple: (reduceCost: 1, reduceCostCardCondition: null),
+                                        fixedCostTuple: null,
+                                        ignoreDigivolutionRequirementFixedCost: -1,
+                                        isHand: true,
+                                        activateClass: activateClass,
+                                        successProcess: null));
+                            }
                         }
-                    }
+
+                    }  
                 }
             }
             #endregion

+ 33 - 0
Assets/Scripts/CEntity_EffectController.cs

@@ -86,6 +86,25 @@ public class CEntity_EffectController : MonoBehaviour
                         }
                         #endregion
 
+                        #region Effects from security
+                        foreach (CardSource source in player.SecurityCards)
+                        {
+                            if (source.IsFlipped)
+                                continue;
+
+                            foreach (ICardEffect cardEffect in source.EffectList(EffectTiming.None))
+                            {
+                                if (cardEffect is IAddSkillEffect)
+                                {
+                                    if (cardEffect.CanUse(null))
+                                    {
+                                        GetCardEffects = ((IAddSkillEffect)cardEffect).GetCardEffect(card, GetCardEffects, timing);
+                                    }
+                                }
+                            }
+                        }
+                        #endregion
+
                         #region Effects added by players
                         foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
                         {
@@ -130,6 +149,20 @@ public class CEntity_EffectController : MonoBehaviour
                         }
                     }
                 }
+
+                if (CardEffectCommons.IsExistInSecurity(card))
+                {
+                    foreach (ICardEffect cardEffect in card.cEntity_EffectController.cEntity_Effect.GetCardEffects(EffectTiming.None, card))
+                    {
+                        if (cardEffect is IAddSkillEffect)
+                        {
+                            if (cardEffect.CanUse(null))
+                            {
+                                GetCardEffects = ((IAddSkillEffect)cardEffect).GetCardEffect(card, GetCardEffects, timing);
+                            }
+                        }
+                    }
+                }
             }
         }
 

+ 19 - 17
Assets/Scripts/Permanent.cs

@@ -2336,29 +2336,29 @@ public class Permanent
                         }
                     }
                     #endregion
+                }
 
-                    #region Effects of faceup security
-                    foreach (CardSource source in player.SecurityCards)
-                    {
-                        if (source.IsFlipped)
-                            continue;
+                #region Effects of faceup security
+                foreach (CardSource source in player.SecurityCards)
+                {
+                    if (source.IsFlipped)
+                        continue;
 
-                        foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.OnAllyAttack))
+                    foreach (ICardEffect cardEffect in source.EffectList(EffectTiming.OnAllyAttack))
+                    {
+                        if (cardEffect is IAllianceEffect)
                         {
-                            if (cardEffect is IAllianceEffect)
+                            if (cardEffect.CanTrigger(null))
                             {
-                                if (cardEffect.CanTrigger(null))
+                                if (((IAllianceEffect)cardEffect).HasAlliance(this))
                                 {
-                                    if (((IAllianceEffect)cardEffect).HasAlliance(this))
-                                    {
-                                        return true;
-                                    }
+                                    return true;
                                 }
                             }
                         }
                     }
-                    #endregion
                 }
+                #endregion
 
                 #region Player Effects
                 foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.OnAllyAttack))
@@ -2510,12 +2510,12 @@ public class Permanent
             return false;
         }
 
-        #region 戦闘で消滅しない効果
+        #region Given Effects
         foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
         {
             foreach (Permanent permanent in player.GetFieldPermanents())
             {
-                #region 場のパーマネントの効果
+                #region Permanents
                 foreach (ICardEffect cardEffect in permanent.EffectList(EffectTiming.None))
                 {
                     if (cardEffect is ICanNotBeDestroyedByBattleEffect)
@@ -2538,6 +2538,8 @@ public class Permanent
                 if (source.IsFlipped)
                     continue;
 
+
+
                 foreach (ICardEffect cardEffect in source.EffectList(EffectTiming.None))
                 {
                     if (cardEffect is ICanNotBeDestroyedByBattleEffect)
@@ -2546,7 +2548,7 @@ public class Permanent
                         {
                             if (((ICanNotBeDestroyedByBattleEffect)cardEffect).CanNotBeDestroyedByBattle(this, AttackingPermanent, DefendingPermanent, DefendingCard))
                             {
-                                return true;
+                                return false;
                             }
                         }
                     }
@@ -2554,7 +2556,7 @@ public class Permanent
             }
             #endregion
 
-            #region プレイヤーの効果
+            #region Player Effects
             foreach (ICardEffect cardEffect in player.EffectList(EffectTiming.None))
             {
                 if (cardEffect is ICanNotBeDestroyedByBattleEffect)