Răsfoiți Sursa

1.5.5 build

mbunch_kascope 1 an în urmă
părinte
comite
1a94c46178

+ 20 - 28
Assets/CardEffect/BT18/Black/Machinedramon_BT18_073.cs

@@ -59,24 +59,27 @@ namespace DCGO.CardEffects.BT18
 
                 bool CardCondition(CardSource cardSource)
                 {
-                    if (cardSource == card)
-                    {
-                        if (CardEffectCommons.IsExistOnHand(cardSource))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return (cardSource == card);
                 }
 
                 bool CanNoSelect(CardSource cardSource)
                 {
                     if (cardSource != null)
                     {
-                        if (cardSource.PayingCost(SelectCardEffect.Root.Hand, null, checkAvailability: false) > cardSource.Owner.MaxMemoryCost)
+                        if (CardEffectCommons.IsExistOnHand(cardSource))
                         {
-                            return false;
+                            if (cardSource.PayingCost(SelectCardEffect.Root.Hand, null, checkAvailability: false) > cardSource.Owner.MaxMemoryCost)
+                            {
+                                return false;
+                            }
+                        }
+
+                        if (CardEffectCommons.IsExistOnTrash(cardSource))
+                        {
+                            if (cardSource.PayingCost(SelectCardEffect.Root.Trash, null, checkAvailability: false) > cardSource.Owner.MaxMemoryCost)
+                            {
+                                return false;
+                            }
                         }
                     }
 
@@ -90,15 +93,7 @@ namespace DCGO.CardEffects.BT18
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnHand(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(HasCompositeTraitInPlay))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.HasMatchConditionPermanent(HasCompositeTraitInPlay);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
@@ -219,16 +214,13 @@ namespace DCGO.CardEffects.BT18
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (card.Owner.HandCards.Contains(card))
-                    {
-                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Delete 1 of your [Composite] trait digimon to get Play Cost -4");
+                    ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Delete 1 of your [Composite] trait digimon to get Play Cost -4");
 
-                        if (activateClass != null)
+                    if (activateClass != null)
+                    {
+                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasCompositeTraitInPlay))
                         {
-                            if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasCompositeTraitInPlay))
-                            {
-                                return true;
-                            }
+                            return true;
                         }
                     }
 

+ 41 - 6
Assets/CardEffect/BT18/Purple/LucemonSatanMode_BT18_101.cs

@@ -38,6 +38,17 @@ namespace DCGO.CardEffects.BT18
                        (permanent.IsDigimon || permanent.IsTamer);
             }
 
+            bool CanSelectPermanentDigimon(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+            }
+
+            bool CanSelectPermanentTamer(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) &&
+                       permanent.IsTamer;
+            }
+
             #endregion
 
             #region When Digivolving
@@ -183,13 +194,15 @@ namespace DCGO.CardEffects.BT18
                             cardEffect: activateClass,
                             fromTop: true).DestroySecurity());
                     }
-                    else if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared))
+                    else
                     {
                         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                        selectPermanentEffect.SetUp(
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared))
+                        {
+                            selectPermanentEffect.SetUp(
                             selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentConditionShared,
+                            canTargetCondition: CanSelectPermanentDigimon,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: 1,
@@ -200,10 +213,32 @@ namespace DCGO.CardEffects.BT18
                             mode: SelectPermanentEffect.Mode.Destroy,
                             cardEffect: activateClass);
 
-                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer to delete.",
-                            "The opponent is selecting 1 Digimon or Tamer to delete.");
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
+                                "The opponent is selecting 1 Digimon to delete.");
 
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                        }
+
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared))
+                        {
+                            selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentTamer,
+                            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 Tamer to delete.",
+                                "The opponent is selecting 1 Tamer to delete.");
+
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                        }
                     }
                 }
             }

+ 2 - 7
Assets/CardEffect/BT18/Red/EmperorGreymon_BT18_018.cs

@@ -15,11 +15,6 @@ namespace DCGO.CardEffects.BT18
 
             if (timing == EffectTiming.None)
             {
-                bool Condition()
-                {
-                    return card.Owner.HandCards.Contains(card);
-                }
-
                 bool PermanentCondition(Permanent targetPermanent)
                 {
                     return targetPermanent.TopCard.EqualsCardName("Takuya Kanbara") &&
@@ -27,8 +22,8 @@ namespace DCGO.CardEffects.BT18
                 }
 
                 cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
-                    permanentCondition: PermanentCondition, digivolutionCost: 5, ignoreDigivolutionRequirement: false,
-                    card: card, condition: Condition));
+                    permanentCondition: PermanentCondition, digivolutionCost: 5, ignoreDigivolutionRequirement: true,
+                    card: card, condition: null));
             }
 
             #endregion

+ 1 - 2
Assets/CardEffect/BT18/Red/WindtoFlameIcetoSword_BT18_095.cs

@@ -299,8 +299,7 @@ namespace DCGO.CardEffects.BT18
                                     GManager.instance.userSelectionManager.SetBool(canSelectHand);
                                 }
 
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
-                                    .WaitForEndSelect());
+                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
                                 bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
 

+ 2 - 1
Assets/CardEffect/BT18/White/LucemonLarva_BT18_086.cs

@@ -107,7 +107,8 @@ namespace DCGO.CardEffects.BT18
 
                 bool IsLucemonRemoved(Permanent permanent)
                 {
-                    return permanent.TopCard.EqualsCardName("Lucemon: Satan Mode");
+                    return permanent.TopCard.Owner == card.Owner &&
+                           permanent.TopCard.EqualsCardName("Lucemon: Satan Mode");
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 2 - 7
Assets/CardEffect/BT18/Yellow/MagnaGarurumon_BT18_042.cs

@@ -14,11 +14,6 @@ namespace DCGO.CardEffects.BT18
 
             if (timing == EffectTiming.None)
             {
-                bool Condition()
-                {
-                    return card.Owner.HandCards.Contains(card);
-                }
-
                 bool PermanentCondition(Permanent targetPermanent)
                 {
                     return targetPermanent.TopCard.EqualsCardName("Koji Minamoto") &&
@@ -26,8 +21,8 @@ namespace DCGO.CardEffects.BT18
                 }
 
                 cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
-                    permanentCondition: PermanentCondition, digivolutionCost: 5, ignoreDigivolutionRequirement: false,
-                    card: card, condition: Condition));
+                    permanentCondition: PermanentCondition, digivolutionCost: 5, ignoreDigivolutionRequirement: true,
+                    card: card, condition: null));
             }
 
             #endregion

+ 2 - 1
Assets/Scripts/CardEffectCommons.cs

@@ -655,7 +655,8 @@ public partial class CardEffectCommons
             }
             else
             {
-                selectedCards.Add(activateClass.EffectSourceCard);
+                //TODO:Removed as of 1.5.5, effects shouldn't reactivate if digivolution from trash failed?
+                //selectedCards.Add(activateClass.EffectSourceCard);
             }
         }
 

+ 5 - 10
Assets/Scripts/CardEffectFactory/KeyWordEffects/BlastDNADigivolution.cs

@@ -195,18 +195,13 @@ public partial class CardEffectFactory
                 selectedCardSource = cardSource;
 
                 Permanent playedPermanent;
-                int frameID = -1; 
+                int frameID = -1;
 
-                foreach (FieldCardFrame fieldCardFrame in selectedCardSource.Owner.fieldCardFrames)
+                FieldCardFrame preferredFrame = selectedCardSource.PreferredFrame();
+
+                if (preferredFrame != null)
                 {
-                    if (card.CanPlayCardTargetFrame(fieldCardFrame, false, null))
-                    {
-                        if (fieldCardFrame.IsEmptyFrame())
-                        {
-                            frameID = fieldCardFrame.FrameID;
-                            break;
-                        }
-                    }
+                    frameID = preferredFrame.FrameID;
                 }
 
                 if (0 <= frameID && frameID < card.Owner.fieldCardFrames.Count)

+ 1 - 1
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:a794a73dcc81c007f03de23c39403e9a86941dfa5b61b15141fb04210ad5f978
+oid sha256:a7efd7b2994283beaac1d74a6d49a356b5003370c1e98991f9e7cc1585f48bf5
 size 20166