Forráskód Böngészése

few card updates/bug fixes

mbunch_kascope 2 éve
szülő
commit
ff61335542

+ 2 - 2
Assets/CardEffect/BT13/Blue/MiragegaogamonBurstMode_BT13_033.cs

@@ -197,14 +197,14 @@ public class MiragegaogamonBurstMode_BT13_033 : CEntity_Effect
                     {
                         if (card.Owner.isYou)
                         {
-                            card.Owner.Enemy.HandCards = RandomUtility.ShuffledDeckCards(card.Owner.Enemy.HandCards);
-
                             foreach (CardSource cardSource in card.Owner.Enemy.HandCards)
                             {
                                 cardSource.SetReverse();
                             }
                         }
 
+                        card.Owner.Enemy.HandCards = RandomUtility.ShuffledDeckCards(card.Owner.Enemy.HandCards);
+
                         List<CardSource> selectedCards = new List<CardSource>();
 
                         SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();

+ 101 - 20
Assets/CardEffect/BT16/Black/Publimon_BT16_056.cs

@@ -120,10 +120,40 @@ namespace DCGO.CardEffects.BT16
                                     Permanent securityPermanent = selectedPermanent;
                                     CardSource securityCard = securityPermanent.TopCard;
 
-                                    yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(
-                                        securityPermanent,
-                                        CardEffectCommons.CardEffectHashtable(activateClass),
-                                        toTop).PutSecurity());
+                                    if(securityPermanent.DigivolutionCards.Count < 0)
+                                    {
+                                        yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(
+                                            securityPermanent,
+                                            CardEffectCommons.CardEffectHashtable(activateClass),
+                                            toTop).PutSecurity());
+                                    }
+                                    else
+                                    {
+                                        yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveFromAllArea(permanent.TopCard));
+
+                                        permanent.ShowingPermanentCard.ShowPermanentData(true);
+
+                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().RemoveDigivolveRootEffect(permanent.TopCard, permanent));
+
+                                        if (!permanent.TopCard.IsToken)
+                                        {
+                                            yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(permanent.TopCard, toTop));
+
+                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateRecoveryEffect(permanent.TopCard.Owner));
+
+                                            yield return ContinuousController.instance.StartCoroutine(new IAddSecurity(permanent.TopCard.Owner).AddSecurity());
+
+                                            permanent.willBeRemoveField = false;
+
+                                            if (permanent.ShowingPermanentCard != null)
+                                            {
+                                                if (permanent.ShowingPermanentCard.WillBeDeletedObject != null)
+                                                {
+                                                    permanent.ShowingPermanentCard.WillBeDeletedObject.SetActive(false);
+                                                }
+                                            }
+                                        }
+                                    }                                    
                                 }
                             }
                         }
@@ -136,13 +166,13 @@ namespace DCGO.CardEffects.BT16
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Trash top or bottom of opponents security", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Place top card of one of your opponent's Digimon to the top/bottom of their security stack.", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "[On Play] [When Digivolving] You may place the top card of 1 of your opponent's Digimon with the [Vaccine] trait at the top of your opponent's security stack.";
+                    return "[When Digivolving] You may place the top card of 1 of your opponent's Digimon with the [Vaccine] trait at the top of your opponent's security stack.";
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
@@ -166,7 +196,7 @@ namespace DCGO.CardEffects.BT16
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
                         if (CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition) >= 1)
-                        return true;
+                            return true;
                     }
 
                     return true;
@@ -199,29 +229,80 @@ namespace DCGO.CardEffects.BT16
 
                         IEnumerator SelectPermanentCoroutine(Permanent permanent)
                         {
-                            if (permanent != null)
+                            Permanent selectedPermanent = permanent;
+
+                            if (selectedPermanent != null)
                             {
-                                yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveFromAllArea(permanent.TopCard));
+                                if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
+                                {
+                                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                                {
+                                    new SelectionElement<bool>(message: $"Security Top", value : true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"Security Bottom", value : false, spriteIndex: 1),
+                                };
 
-                                permanent.ShowingPermanentCard.ShowPermanentData(true);
+                                    string selectPlayerMessage = "Will you place the card on the top or bottom of the security?";
+                                    string notSelectPlayerMessage = "The opponent is selecting whether to place the card on the top or bottom of security.";
 
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().RemoveDigivolveRootEffect(permanent.TopCard, permanent));
+                                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
 
-                                if (!permanent.TopCard.IsToken)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(permanent.TopCard));
+                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
-                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateRecoveryEffect(permanent.TopCard.Owner));
+                                    bool toTop = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                                    if (toTop)
+                                    {
+                                        GManager.instance.commandText.OpenCommandText("\"Place to the top of security\" was selected.");
+
+                                        GManager.instance.playLog.AddLogString($"\n{card.BaseENGCardNameFromEntity}({card.CardID}):Place the Digimon to the top of security\n");
+                                    }
+
+                                    else
+                                    {
+                                        GManager.instance.commandText.OpenCommandText("\"Place to the bottom of security\" was selected.");
+
+                                        GManager.instance.playLog.AddLogString($"\n{card.BaseENGCardNameFromEntity}({card.CardID}):Place the Digimon to the bottom of security\n");
+                                    }
 
-                                    yield return ContinuousController.instance.StartCoroutine(new IAddSecurity(permanent.TopCard.Owner).AddSecurity());
+                                    yield return new WaitForSeconds(0.4f);
+                                    GManager.instance.commandText.CloseCommandText();
+                                    yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
 
-                                    permanent.willBeRemoveField = false;
+                                    Permanent securityPermanent = selectedPermanent;
+                                    CardSource securityCard = securityPermanent.TopCard;
 
-                                    if (permanent.ShowingPermanentCard != null)
+                                    if (securityPermanent.DigivolutionCards.Count < 0)
+                                    {
+                                        yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(
+                                            securityPermanent,
+                                            CardEffectCommons.CardEffectHashtable(activateClass),
+                                            toTop).PutSecurity());
+                                    }
+                                    else
                                     {
-                                        if (permanent.ShowingPermanentCard.WillBeDeletedObject != null)
+                                        yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveFromAllArea(permanent.TopCard));
+
+                                        permanent.ShowingPermanentCard.ShowPermanentData(true);
+
+                                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().RemoveDigivolveRootEffect(permanent.TopCard, permanent));
+
+                                        if (!permanent.TopCard.IsToken)
                                         {
-                                            permanent.ShowingPermanentCard.WillBeDeletedObject.SetActive(false);
+                                            yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(permanent.TopCard, toTop));
+
+                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateRecoveryEffect(permanent.TopCard.Owner));
+
+                                            yield return ContinuousController.instance.StartCoroutine(new IAddSecurity(permanent.TopCard.Owner).AddSecurity());
+
+                                            permanent.willBeRemoveField = false;
+
+                                            if (permanent.ShowingPermanentCard != null)
+                                            {
+                                                if (permanent.ShowingPermanentCard.WillBeDeletedObject != null)
+                                                {
+                                                    permanent.ShowingPermanentCard.WillBeDeletedObject.SetActive(false);
+                                                }
+                                            }
                                         }
                                     }
                                 }

+ 4 - 4
Assets/CardEffect/BT16/Green/ShineOfBee_BT16_095.cs

@@ -38,6 +38,9 @@ namespace DCGO.CardEffects.BT16
 
                 bool CanSelectPermanentsToBotDeck(Permanent permanent)
                 {
+                    if (!permanent.IsSuspended)
+                        return false;
+                    
                     return CardEffectCommons.IsMinDP(permanent, card.Owner.Enemy);
                 }
 
@@ -79,10 +82,7 @@ namespace DCGO.CardEffects.BT16
                         List<Permanent> selectedPermanents = new List<Permanent>();
 
                         foreach (Permanent permanent in card.Owner.Enemy.GetBattleAreaDigimons())
-                        {
-                            if (!permanent.IsSuspended)
-                                continue;
-                            
+                        {                            
                             if (!CanSelectPermanentsToBotDeck(permanent))
                                 continue;
                             

+ 2 - 1
Assets/CardEffect/EX1/Green/Tentomon_EX1_033.cs

@@ -53,7 +53,8 @@ public class Tentomon_EX1_033 : CEntity_Effect
                     Func<EffectTiming, ICardEffect> getCardEffect = GetCardEffect;
                     changeCostClass.SetUpICardEffect("Digivolution Cost -1", CanUseCondition1, card);
                     changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
-                    CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilEachTurnEnd, card: card, cardEffect: null, timing: EffectTiming.None, getCardEffect: getCardEffect);
+                    card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
+                    //CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilCalculateFixedCost, card: card, cardEffect: null, timing: EffectTiming.None, getCardEffect: getCardEffect);
 
                     ActivateClass activateClass1 = new ActivateClass();
                     Func<EffectTiming, ICardEffect> getCardEffect1 = GetCardEffect1;

+ 0 - 20
Assets/CardEffect/EX6/Green/Cherubimon_EX6_035.cs

@@ -100,8 +100,6 @@ namespace DCGO.CardEffects.EX6
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    
-
                     if (CardEffectCommons.IsExistOnHand(cardSource))
                     {
                         if (cardSource.IsDigimon && cardSource.Level <= 4 && cardSource.CardColors.Contains(CardColor.Green))
@@ -115,15 +113,6 @@ namespace DCGO.CardEffects.EX6
                         }
                     }
 
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                        {
-                            return true;
-                        }
-
-                    }
-
                     return false;
                 }
 
@@ -291,15 +280,6 @@ namespace DCGO.CardEffects.EX6
                         }
                     }
 
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                        {
-                            return true;
-                        }
-
-                    }
-
                     return false;
                 }
 

+ 2 - 1
Assets/Scripts/CardController.cs

@@ -2561,8 +2561,9 @@ public class IPutSecurityPermanent
 
         #region add log
         string log = "";
+        string fromString = _toTop ? "top" : "bottom";
 
-        log += $"\nPut cards on top of security:";
+        log += $"\nPut cards on {fromString} of security:";
 
         log += $"\n{_permanent.TopCard.BaseENGCardNameFromEntity}({_permanent.TopCard.CardID})";
 

+ 4 - 2
Assets/Scripts/FieldPermanentCard.cs

@@ -339,6 +339,9 @@ public class FieldPermanentCard : MonoBehaviour
         if (ContinuousController.instance == null)
             return;
 
+        if (CardImage == null)
+            return;
+
         // card image
         if (ThisPermanent.TopCard.IsFlipped)
         {
@@ -351,8 +354,7 @@ public class FieldPermanentCard : MonoBehaviour
             CardImage.sprite = await ThisPermanent.TopCard.GetCardSprite();
         }
 
-        if(CardImage != null)
-            CardImage.gameObject.SetActive(true);
+        CardImage.gameObject.SetActive(true);
     }
 
     void SetCardSuspended(bool updateIsTapped)