Procházet zdrojové kódy

post hot fix updates

mbunch_kascope před 1 rokem
rodič
revize
1111941c1d

+ 1 - 1
Assets/CardEffect/BT18/Black/Machinedramon_BT18_073.cs

@@ -378,7 +378,7 @@ namespace DCGO.CardEffects.BT18
 
                 bool HasKimeramon(Permanent permanent)
                 {
-                    return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent) &&
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
                            permanent.TopCard.EqualsCardName("Kimeramon");
                 }
 

+ 33 - 31
Assets/CardEffect/BT18/Blue/TommyHimi_BT18_089.cs

@@ -94,6 +94,7 @@ namespace DCGO.CardEffects.BT18
                 activateClass.SetUpICardEffect("Trash bottom digivolution card", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
                 activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("WhenAttacking_BT18-089");
                 cardEffects.Add(activateClass);
 
                 string EffectDescription()
@@ -114,44 +115,45 @@ namespace DCGO.CardEffects.BT18
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnBattleArea(card) &&
-                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
+                    return CardEffectCommons.IsExistOnBattleArea(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                    selectPermanentEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectPermanentCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: false,
-                        canEndNotMax: false,
-                        selectPermanentCoroutine: SelectPermanentCoroutine,
-                        afterSelectPermanentCoroutine: null,
-                        mode: SelectPermanentEffect.Mode.Custom,
-                        cardEffect: activateClass);
-
-                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will trash digivolution cards.",
-                        "The opponent is selecting 1 Digimon that will trash digivolution cards.");
-
-                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     {
-                        yield return ContinuousController.instance.StartCoroutine(
-                            CardEffectCommons.TrashDigivolutionCardsFromTopOrBottom(
-                                targetPermanent: permanent,
-                                trashCount: 1,
-                                isFromTop: false,
-                                activateClass: activateClass));
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will trash digivolution cards.",
+                            "The opponent is selecting 1 Digimon that will trash digivolution cards.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(
+                                CardEffectCommons.TrashDigivolutionCardsFromTopOrBottom(
+                                    targetPermanent: permanent,
+                                    trashCount: 1,
+                                    isFromTop: false,
+                                    activateClass: activateClass));
+                        }
                     }
 
-                    if (!CardEffectCommons.HasMatchConditionOpponentsPermanent(card,
-                            permanent => permanent.IsDigimon && !permanent.HasNoDigivolutionCards))
+                    if (!CardEffectCommons.HasMatchConditionOpponentsPermanent(card,permanent => permanent.IsDigimon && !permanent.HasNoDigivolutionCards))
                     {
                         yield return ContinuousController.instance.StartCoroutine(
                             new DrawClass(card.Owner, 1, activateClass).Draw());

+ 24 - 30
Assets/CardEffect/BT18/Green/AncientKazemon_BT18_054.cs

@@ -119,23 +119,20 @@ namespace DCGO.CardEffects.BT18
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<Permanent> tappedPermanents = card.Owner.Enemy.GetBattleAreaDigimons()
-                        .Where(permanent =>
-                            !permanent.TopCard.CanNotBeAffected(activateClass) && 
-                            permanent.DP <= card.PermanentOfThisCard().DP &&
-                            permanent.CanSuspend)
-                        .ToList();
-
-                    yield return ContinuousController.instance.StartCoroutine(
-                        new SuspendPermanentsClass(tappedPermanents, hashtable).Tap());
-
-                    foreach (Permanent selectedPermanent in card.Owner.Enemy.GetBattleAreaDigimons())
+                    bool PermanentCondition(Permanent permanent)
                     {
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
-                            targetPermanent: selectedPermanent,
-                            activateClass: activateClass
-                        ));
+                        return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
+                               permanent.TopCard.CanNotBeAffected(activateClass) &&
+                               permanent.DP <= card.PermanentOfThisCard().DP &&
+                               permanent.CanSuspend;
                     }
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotUnsuspendPlayerEffect(
+                        permanentCondition: PermanentCondition,
+                        effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                        activateClass: activateClass,
+                        isOnlyActivePhase: false,
+                        effectName:"Can't Unsuspend"));
                 }
             }
 
@@ -164,23 +161,20 @@ namespace DCGO.CardEffects.BT18
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    List<Permanent> tappedPermanents = card.Owner.Enemy.GetBattleAreaDigimons()
-                        .Where(permanent =>
-                            !permanent.TopCard.CanNotBeAffected(activateClass) && 
-                            permanent.DP <= card.PermanentOfThisCard().DP &&
-                            permanent.CanSuspend)
-                        .ToList();
-
-                    yield return ContinuousController.instance.StartCoroutine(
-                        new SuspendPermanentsClass(tappedPermanents, hashtable).Tap());
-
-                    foreach (Permanent selectedPermanent in card.Owner.Enemy.GetBattleAreaDigimons())
+                    bool PermanentCondition(Permanent permanent)
                     {
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
-                            targetPermanent: selectedPermanent,
-                            activateClass: activateClass
-                        ));
+                        return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
+                               permanent.TopCard.CanNotBeAffected(activateClass) &&
+                               permanent.DP <= card.PermanentOfThisCard().DP &&
+                               permanent.CanSuspend;
                     }
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotUnsuspendPlayerEffect(
+                        permanentCondition: PermanentCondition,
+                        effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                        activateClass: activateClass,
+                        isOnlyActivePhase: false,
+                        effectName: "Can't Unsuspend"));
                 }
             }
 

+ 24 - 2
Assets/CardEffect/BT18/Purple/Duskmon_BT18_078.cs

@@ -153,10 +153,21 @@ namespace DCGO.CardEffects.BT18
                         CardColor chosenColor = (CardColor)GManager.instance.userSelectionManager.SelectedIntValue;
 
                         ChangeBaseCardColorClass changeBaseCardNameClass = new ChangeBaseCardColorClass();
-                        changeBaseCardNameClass.SetUpICardEffect("Original card color is changed", CanUseChangeColorCondition, card);
+                        changeBaseCardNameClass.SetUpICardEffect($"Original card color is changed: {chosenColor}", CanUseChangeColorCondition, card);
                         changeBaseCardNameClass.SetUpChangeBaseCardColorClass(ChangeBaseCardColors: ChangeBaseCardColors);
                         selectedPermanent.UntilOwnerTurnEndEffects.Add(_ => changeBaseCardNameClass);
 
+                        #region Log
+                        string log = "";
+
+                        log += $"\nChanged Card Color to {chosenColor}:";
+                        log += $"\n{selectedPermanent.TopCard.BaseENGCardNameFromEntity}({selectedPermanent.TopCard.CardID})";
+
+                        log += "\n";
+
+                        PlayLog.OnAddLog?.Invoke(log);
+                        #endregion
+
                         bool CanUseChangeColorCondition(Hashtable hashtableColor)
                         {
                             return selectedPermanent.TopCard != null && !selectedPermanent.TopCard.CanNotBeAffected(activateClass);
@@ -256,10 +267,21 @@ namespace DCGO.CardEffects.BT18
                         CardColor chosenColor = (CardColor)GManager.instance.userSelectionManager.SelectedIntValue;
 
                         ChangeBaseCardColorClass changeBaseCardNameClass = new ChangeBaseCardColorClass();
-                        changeBaseCardNameClass.SetUpICardEffect("Original card color is changed", CanUseChangeColorCondition, card);
+                        changeBaseCardNameClass.SetUpICardEffect($"Original card color is changed: {chosenColor}", CanUseChangeColorCondition, card);
                         changeBaseCardNameClass.SetUpChangeBaseCardColorClass(ChangeBaseCardColors: ChangeBaseCardColors);
                         selectedPermanent.UntilOwnerTurnEndEffects.Add(_ => changeBaseCardNameClass);
 
+                        #region Log
+                        string log = "";
+
+                        log += $"\nChanged Card Color to {chosenColor}:";
+                        log += $"\n{selectedPermanent.TopCard.BaseENGCardNameFromEntity}({selectedPermanent.TopCard.CardID})";
+
+                        log += "\n";
+
+                        PlayLog.OnAddLog?.Invoke(log);
+                        #endregion
+
                         bool CanUseChangeColorCondition(Hashtable hashtableColor)
                         {
                             return selectedPermanent.TopCard != null && !selectedPermanent.TopCard.CanNotBeAffected(activateClass);

+ 4 - 1
Assets/CardEffect/BT18/Purple/LucemonSatanMode_BT18_101.cs

@@ -118,7 +118,10 @@ namespace DCGO.CardEffects.BT18
                     IEnumerator SelectCardCoroutine(CardSource cardSource)
                     {
                         selectedCards.Add(cardSource);
-                        played = true;
+
+                        if(CardEffectCommons.CanPlayAsNewPermanent(cardSource,false,activateClass,SelectCardEffect.Root.Trash,true))
+                            played = true;
+
                         yield return null;
                     }
 

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

@@ -143,7 +143,8 @@ namespace DCGO.CardEffects.BT18
             {
                 bool PermanentCondition(Permanent permanent)
                 {
-                    return (permanent.DP == 0);
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           (permanent.DP == 0);
                 }
 
                 bool NonWhiteDigimon(Permanent permanent)

+ 1 - 1
Assets/CardEffect/BT18/White/Susanoomon_BT18_102.cs

@@ -47,7 +47,7 @@ namespace DCGO.CardEffects.BT18
 
                 List<CardColor> cardColors = new List<CardColor>();
 
-                foreach (CardSource source in card.PermanentOfThisCard().cardSources)
+                foreach (CardSource source in card.PermanentOfThisCard().DigivolutionCards)
                 {
                     cardColors.AddRange(source.CardColors);
                 }

+ 1 - 1
Assets/CardEffect/BT18/Yellow/MetalEtemon_BT18_041.cs

@@ -356,7 +356,7 @@ namespace DCGO.CardEffects.BT18
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    if (CardEffectCommons.CanActivateOnDeletion(card))
                     {
                         if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                         {

+ 7 - 0
Assets/CardEffect/BT18/Yellow/Mistymon_BT18_039.cs

@@ -10,6 +10,13 @@ namespace DCGO.CardEffects.BT18
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Barrier
+            if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
+            {
+                cardEffects.Add(CardEffectFactory.BarrierSelfEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+            #endregion
+
             #region On Play
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {

+ 2 - 18
Assets/CardEffect/BT19/Black/DarkKnightmon_BT19_063.cs

@@ -134,15 +134,7 @@ namespace DCGO.CardEffects.BT19
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
@@ -248,15 +240,7 @@ namespace DCGO.CardEffects.BT19
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)

+ 1 - 1
Assets/CardEffect/BT19/Black/Machinedramon_BT19_065.cs

@@ -268,7 +268,7 @@ namespace DCGO.CardEffects.BT19
                         PlayCardClass playCard = new PlayCardClass(
                                 cardSources: new List<CardSource>() { source },
                                 hashtable: CardEffectCommons.CardEffectHashtable(activateClass),
-                                payCost: true,
+                                payCost: false,
                                 targetPermanent: null,
                                 isTapped: false,
                                 root: SelectCardEffect.Root.Trash,

+ 5 - 4
Assets/CardEffect/BT19/Green/Winr_BT19_084.cs

@@ -38,13 +38,13 @@ namespace DCGO.CardEffects.BT19
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return isExistOnField(card) &&
-                           HasFaceUpSecurity();
+                    return isExistOnField(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
+                    if(HasFaceUpSecurity())
+                        yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
                 }
             }
 
@@ -90,7 +90,8 @@ namespace DCGO.CardEffects.BT19
 
                 bool IsRoyalBaseDigimon(CardSource cardSource)
                 {
-                    return cardSource.EqualsTraits("Royal Base");
+                    return cardSource.IsDigimon &&
+                           cardSource.EqualsTraits("Royal Base");
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 20 - 29
Assets/CardEffect/BT19/Yellow/WizardmonXAntibody_BT19_036.cs

@@ -58,26 +58,21 @@ namespace DCGO.CardEffects.BT19
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (card.Owner.SecurityCards.Count >= 1)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    CardSource topCard = card.Owner.SecurityCards[0];
+                    if (card.Owner.SecurityCards.Count >= 1)
+                    {
+                        CardSource topCard = card.Owner.SecurityCards[0];
 
-                    yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(new List<CardSource>() { topCard }, false, activateClass));
+                        yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(new List<CardSource>() { topCard }, false, activateClass));
 
-                    yield return ContinuousController.instance.StartCoroutine(new IReduceSecurity(
-                        player: card.Owner,
-                        refSkillInfos: ref ContinuousController.instance.nullSkillInfos).ReduceSecurity());
+                        yield return ContinuousController.instance.StartCoroutine(new IReduceSecurity(
+                            player: card.Owner,
+                            refSkillInfos: ref ContinuousController.instance.nullSkillInfos).ReduceSecurity());
+                    }                        
 
                     if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.EqualsCardName("Wizardmon") || cardSource.EqualsCardName("X Antibody")) >= 1)
                     {
@@ -179,26 +174,21 @@ namespace DCGO.CardEffects.BT19
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (card.Owner.SecurityCards.Count >= 1)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    CardSource topCard = card.Owner.SecurityCards[0];
+                    if (card.Owner.SecurityCards.Count >= 1)
+                    {
+                        CardSource topCard = card.Owner.SecurityCards[0];
 
-                    yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(new List<CardSource>() { topCard }, false, activateClass));
+                        yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(new List<CardSource>() { topCard }, false, activateClass));
 
-                    yield return ContinuousController.instance.StartCoroutine(new IReduceSecurity(
-                        player: card.Owner,
-                        refSkillInfos: ref ContinuousController.instance.nullSkillInfos).ReduceSecurity());
+                        yield return ContinuousController.instance.StartCoroutine(new IReduceSecurity(
+                            player: card.Owner,
+                            refSkillInfos: ref ContinuousController.instance.nullSkillInfos).ReduceSecurity());
+                    }
 
                     if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.EqualsCardName("Wizardmon") || cardSource.EqualsCardName("X Antibody")) >= 1)
                     {
@@ -289,7 +279,8 @@ namespace DCGO.CardEffects.BT19
                 {
                     if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (card.CardColors.Contains(CardColor.Yellow) && (card.ContainsTraits("Data") || card.ContainsTraits("Witchelny")))
+                        Permanent thisPermanent = card.PermanentOfThisCard();
+                        if (thisPermanent.TopCard.CardColors.Contains(CardColor.Yellow) && (thisPermanent.TopCard.ContainsTraits("Data") || thisPermanent.TopCard.ContainsTraits("Witchelny")))
                         {
                             if (card.Owner.SecurityCards.Count >= 1)
                                 return true;

+ 1 - 1
Assets/CardEffect/EX6/Black/RaijiLudomon_EX6_042.cs

@@ -300,7 +300,7 @@ namespace DCGO.CardEffects.EX6
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Prevent Deletion", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
                 activateClass.SetHashString("Protection_EX6_042");
                 activateClass.SetIsInheritedEffect(true);
                 cardEffects.Add(activateClass);

+ 2 - 2
Assets/Scripts/CardEffectCommons.cs

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

+ 1 - 1
ProjectSettings/ProjectSettings.asset

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