瀏覽代碼

1.9.0.9 build

mbunch_kascope 1 年之前
父節點
當前提交
5767804b4b

+ 1 - 1
Assets/CardEffect/EX9/Black/EX9_005.cs

@@ -18,7 +18,7 @@ namespace DCGO.CardEffects.EX9
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Reduce play cost", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("Reduce_EX9_005");
 
                 cardEffects.Add(activateClass);

+ 3 - 3
Assets/CardEffect/EX9/Black/EX9_056.cs

@@ -108,7 +108,7 @@ namespace DCGO.CardEffects.EX9
                         selectedPermanent,
                         CardEffectCommons.CardEffectHashtable(activateClass), toTop: false).PutSecurity());
 
-                        if (selectedCard.Owner.SecurityCards.Contains(selectedCard))
+                        if (selectedCard.Owner.SecurityCards.Contains(selectedCard) || selectedCard.IsToken)
                         {
                             yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
                                 player: card.Owner.Enemy,
@@ -184,13 +184,13 @@ namespace DCGO.CardEffects.EX9
 
                     if (selectedPermanent != null)
                     {
-                        Player cardOwner = selectedPermanent.TopCard.Owner;
+                        CardSource selectedCard = selectedPermanent.TopCard;
 
                         yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(
                         selectedPermanent,
                         CardEffectCommons.CardEffectHashtable(activateClass), toTop: false).PutSecurity());
 
-                        if (cardOwner.SecurityCards.Contains(selectedPermanent.TopCard))
+                        if (selectedCard.Owner.SecurityCards.Contains(selectedCard) || selectedCard.IsToken)
                         {
                             yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
                                 player: card.Owner.Enemy,

+ 54 - 28
Assets/CardEffect/EX9/White/EX9_074.cs

@@ -149,17 +149,6 @@ namespace DCGO.CardEffects.EX9
                     return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) && permanent.TopCard.CardColors.Exists(color => cardColors.Contains(color));
                 }
 
-                bool CanTargetCondition_ByPreSelecetedList(List<Permanent> permanents, Permanent permanent, List<CardColor> cardColors)
-                {
-                    var currentColours = permanents
-                        .SelectMany(e => e.TopCard.CardColors)
-                        .Distinct()
-                        .ToList();
-
-                    if (permanent.TopCard.CardColors.Exists(x => currentColours.Contains(x))) return false;
-                    return true;
-                }
-
                 bool CanEndSelectCondition(List<Permanent> permanents)
                 {
                     if (permanents.Count <= 0)
@@ -238,6 +227,7 @@ namespace DCGO.CardEffects.EX9
 
                     if (colours.Count >= 6 && CardEffectCommons.HasMatchConditionOpponentsPermanent(card, permanent => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)))
                     {
+                        List<Permanent> permanentToDelete = new List<Permanent>();
                         List<CardColor> selectableColors = new List<CardColor>();
 
                         foreach (string cardColor in DataBase.CardColorNameDictionary.Values)
@@ -273,19 +263,42 @@ namespace DCGO.CardEffects.EX9
                                 selectPermanentEffect.SetUp(
                                     selectPlayer: card.Owner,
                                     canTargetCondition: CanSelectOpponentDigimon,
-                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
                                     canEndSelectCondition: CanEndSelectCondition,
                                     maxCount: 1,
                                     canNoSelect: false,
                                     canEndNotMax: true,
-                                    selectPermanentCoroutine: null,
+                                    selectPermanentCoroutine: DigimonToDelete,
                                     afterSelectPermanentCoroutine: null,
-                                    mode: SelectPermanentEffect.Mode.Destroy,
+                                    mode: SelectPermanentEffect.Mode.Custom,
                                     cardEffect: activateClass);
 
+                                selectPermanentEffect.SetUpCustomMessage($"Select 1 {deletableColor.ToString()} Digimon to delete", $"Opponent is selecting 1 {deletableColor.ToString()} Digimon to delete");
+
                                 yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                             }
                         }
+
+                        bool CanTargetCondition_ByPreSelecetedList(List<Permanent> permanents, Permanent permanent)
+                        {
+                            if (permanentToDelete.Contains(permanent)) 
+                                return false;
+                            
+                            return true;
+                        }
+
+                        IEnumerator DigimonToDelete (Permanent permanent)
+                        {
+                            if(permanent != null)
+                                permanentToDelete.Add(permanent);
+
+                            yield return null;
+                        }
+
+                        if(permanentToDelete.Count > 0)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(permanentToDelete, hashtable).Destroy());
+                        }
                     }
                 }
             }
@@ -326,17 +339,6 @@ namespace DCGO.CardEffects.EX9
                     return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) && permanent.TopCard.CardColors.Exists(color => cardColors.Contains(color));
                 }
 
-                bool CanTargetCondition_ByPreSelecetedList(List<Permanent> permanents, Permanent permanent, List<CardColor> cardColors)
-                {
-                    var currentColours = permanents
-                        .SelectMany(e => e.TopCard.CardColors)
-                        .Distinct()
-                        .ToList();
-
-                    if (permanent.TopCard.CardColors.Exists(x => currentColours.Contains(x))) return false;
-                    return true;
-                }
-
                 bool CanEndSelectCondition(List<Permanent> permanents)
                 {
                     if (permanents.Count <= 0)
@@ -415,6 +417,7 @@ namespace DCGO.CardEffects.EX9
 
                     if (colours.Count >= 6 && CardEffectCommons.HasMatchConditionOpponentsPermanent(card, permanent => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)))
                     {
+                        List<Permanent> permanentToDelete = new List<Permanent>();
                         List<CardColor> selectableColors = new List<CardColor>();
 
                         foreach (string cardColor in DataBase.CardColorNameDictionary.Values)
@@ -450,19 +453,42 @@ namespace DCGO.CardEffects.EX9
                                 selectPermanentEffect.SetUp(
                                     selectPlayer: card.Owner,
                                     canTargetCondition: CanSelectOpponentDigimon,
-                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
                                     canEndSelectCondition: CanEndSelectCondition,
                                     maxCount: 1,
                                     canNoSelect: false,
                                     canEndNotMax: true,
-                                    selectPermanentCoroutine: null,
+                                    selectPermanentCoroutine: DigimonToDelete,
                                     afterSelectPermanentCoroutine: null,
-                                    mode: SelectPermanentEffect.Mode.Destroy,
+                                    mode: SelectPermanentEffect.Mode.Custom,
                                     cardEffect: activateClass);
 
+                                selectPermanentEffect.SetUpCustomMessage($"Select 1 {deletableColor.ToString()} Digimon to delete", $"Opponent is selecting 1 {deletableColor.ToString()} Digimon to delete");
+
                                 yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                             }
                         }
+
+                        bool CanTargetCondition_ByPreSelecetedList(List<Permanent> permanents, Permanent permanent)
+                        {
+                            if (permanentToDelete.Contains(permanent))
+                                return false;
+
+                            return true;
+                        }
+
+                        IEnumerator DigimonToDelete(Permanent permanent)
+                        {
+                            if (permanent != null)
+                                permanentToDelete.Add(permanent);
+
+                            yield return null;
+                        }
+
+                        if (permanentToDelete.Count > 0)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(permanentToDelete, hashtable).Destroy());
+                        }
                     }
                 }
             }

+ 52 - 42
Assets/CardEffect/EX9/Yellow/EX9_027.cs

@@ -239,38 +239,42 @@ namespace DCGO.CardEffects.EX9
             #endregion
 
             #region ESS
-
             if (timing == EffectTiming.OnAllyAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Delete 1 other of your digimon, to end a attack", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
-                activateClass.SetHashString("EX9_027_EndAttack");
+                activateClass.SetUpICardEffect("End the attack by deleting 1 of your Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetHashString("StopAttack_EX9-027");
                 activateClass.SetIsInheritedEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[Opponent's Turn] [Once Per Turn] When one of your opponent's Digimon attacks, by deleting 1 of your other Digimon, end that attack.";
+                    return "[Opponent's Turn][Once Per Turn] When an opponent's Digimon attacks, by deleting 1 of your other Digimon, end the attack.";
                 }
 
-                bool EnemyPermanentCondition(Permanent permanent)
-                {
-                    return CardEffectCommons.IsOpponentPermanent(permanent, card);
-                }
-
-                bool AllyPermanentCondition(Permanent permanent)
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && permanent != card.PermanentOfThisCard().TopCard.PermanentOfThisCard();
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, permanent => true))
+                        {
+                            if (CardEffectCommons.IsOpponentTurn(card))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+                    return false;
                 }
 
-                bool CanUseCondition(Hashtable hashtable)
+                bool CanActivateCondition(Hashtable hashtable)
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
                         if (CardEffectCommons.IsOpponentTurn(card))
                         {
-                            if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, EnemyPermanentCondition))
+                            if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition))
                             {
                                 return true;
                             }
@@ -280,51 +284,57 @@ namespace DCGO.CardEffects.EX9
                     return false;
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
+                bool CanSelectPermanentCondition(Permanent permanent)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
-                        if (card.Owner.GetBattleAreaPermanents().Filter(x => AllyPermanentCondition(x)).Count >= 1)
+                        if (permanent != card.PermanentOfThisCard())
                         {
                             return true;
                         }
                     }
-
                     return false;
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    bool deleted = false;
-                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(AllyPermanentCondition));
-                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        int maxCount = 1;
 
-                    selectPermanentEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: AllyPermanentCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: true,
-                        canEndNotMax: true,
-                        selectPermanentCoroutine: null,
-                        afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
-                        mode: SelectPermanentEffect.Mode.Destroy,
-                        cardEffect: activateClass);
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete", "The opponent is selecting 1 Digimon to delete");
-                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
 
-                    IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
-                    {
-                        if (permanents.Any()) deleted = true;
-                        yield return null;
-                    }
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
 
-                    if (deleted) GManager.instance.attackProcess.IsEndAttack = true;
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { permanent }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
+
+                            IEnumerator SuccessProcess()
+                            {
+                                GManager.instance.attackProcess.IsEndAttack = true;
+
+                                yield return null;
+                            }
+                        }
+                    }
                 }
             }
-
             #endregion
 
             return cardEffects;

+ 6 - 32
Assets/CardEffect/EX9/Yellow/EX9_067.cs

@@ -69,7 +69,7 @@ namespace DCGO.CardEffects.EX9
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 Arisa Kinosaki or [Puppet] digimon from hand for -3 cost", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -115,39 +115,13 @@ namespace DCGO.CardEffects.EX9
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    bool didBounce = false;
-                    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: true,
-                        selectPermanentCoroutine: null,
-                        afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
-                        mode: SelectPermanentEffect.Mode.PutLibraryBottom,
-                        cardEffect: activateClass);
-
-                    selectPermanentEffect.SetUpCustomMessage("Select Mirai to bottom deck", "Your opponent is deciding to bottom deck tamer");
-                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                    IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
-                    {
-                        if (permanents.Any()) didBounce = true;
-                        yield return null;
-                    }
 
-                    if (didBounce)
-                    {
-                        List<CardSource> selectedCards = new List<CardSource>();
+                    yield return ContinuousController.instance.StartCoroutine(new DeckBottomBounceClass(new List<Permanent> { card.PermanentOfThisCard() }, hashtable).DeckBounce());
 
-                        int maxCount1 = 1;
+                    List<CardSource> selectedCards = new List<CardSource>();
 
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                    {
                         SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
 
                         selectHandEffect.SetUp(
@@ -155,7 +129,7 @@ namespace DCGO.CardEffects.EX9
                             canTargetCondition: CanSelectCardCondition,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
-                            maxCount: maxCount,
+                            maxCount: 1,
                             canNoSelect: true,
                             canEndNotMax: true,
                             isShowOpponent: true,

+ 1 - 1
Assets/Scripts/AutoProcessing.cs

@@ -361,7 +361,7 @@ public class AutoProcessing : MonoBehaviourPunCallbacks
         #endregion
 
         #region Is it necessary to deal with card being face down?
-        if (CardEffectCommons.HasMatchConditionPermanent(IsPermanentFaceDown))
+        if (CardEffectCommons.HasMatchConditionPermanent(IsPermanentFaceDown, true))
         {
             return true;
         }

+ 17 - 2
Assets/Scripts/CardSource.cs

@@ -557,7 +557,16 @@ public class CardSource : MonoBehaviour
     #endregion
 
     #region base play cost from entity
-    public int BasePlayCostFromEntity => _cEntity_Base.PlayCost;
+    public int BasePlayCostFromEntity
+    {
+        get
+        {
+            if (IsFlipped)
+                return -1;
+            else
+                return _cEntity_Base.PlayCost;
+        }
+    }
     #endregion
 
     #region get card cost of itself (refered by card effects)
@@ -1147,6 +1156,9 @@ public class CardSource : MonoBehaviour
     {
         get
         {
+            if (IsFlipped)
+                return new List<string>();
+
             List<string> cardNames = BaseCardNames.Clone();
 
             #region the effects of itself
@@ -2072,6 +2084,9 @@ public class CardSource : MonoBehaviour
     {
         get
         {
+            if (IsFlipped)
+                return new List<string>();
+
             List<string> traits =
                 _cEntity_Base.Form_ENG
                     .Filter(s => !string.IsNullOrEmpty(s))
@@ -2359,7 +2374,7 @@ public class CardSource : MonoBehaviour
     #endregion
 
     #region whether this card has level
-    public bool HasLevel => _cEntity_Base == null || _cEntity_Base.HasLevel;
+    public bool HasLevel => _cEntity_Base == null || _cEntity_Base.HasLevel || IsFlipped;
     #endregion
 
     #region whether this card is level 2

+ 9 - 0
Assets/Scripts/Permanent.cs

@@ -3092,6 +3092,9 @@ public class Permanent
         {
             if (TopCard != null)
             {
+                if (TopCard.IsFlipped)
+                    return false;
+
                 if (TopCard.IsDigimon || TopCard.IsDigiEgg)
                 {
                     return true;
@@ -3150,6 +3153,9 @@ public class Permanent
         {
             if (TopCard != null)
             {
+                if (TopCard.IsFlipped)
+                    return false;
+
                 if (TopCard.IsTamer)
                 {
                     return true;
@@ -3596,6 +3602,9 @@ public class Permanent
 
             foreach (CardSource cardSource in DigivolutionCards)
             {
+                if (cardSource.IsFlipped)
+                    continue;
+
                 foreach (CardColor cardColor in cardSource.CardColors)
                 {
                     if (!cardColors.Contains(cardColor))

+ 1 - 1
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:8a49e02006fe21b9ae8f29ba5ddee42c43cdbf520c00757a9d2084eba8c40237
+oid sha256:30f6a3bcdd240b9b3d463de8c8035473f60583fc3b9b3d8a3cb51edf7c9441ea
 size 20168