Преглед на файлове

shoutmon DX, omnishoutmon

mbunch_kascope преди 1 година
родител
ревизия
b0d12068ba
променени са 2 файла, в които са добавени 94 реда и са изтрити 7 реда
  1. 92 5
      Assets/CardEffect/BT21/Red/BT21_021.cs
  2. 2 2
      Assets/CardEffect/BT21/Red/BT21_027.cs

+ 92 - 5
Assets/CardEffect/BT21/Red/BT21_021.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 
 //OmniShoutmon
 namespace DCGO.CardEffects.BT21
@@ -109,7 +110,7 @@ namespace DCGO.CardEffects.BT21
                                 {
                                     if (cardSource.IsDigimon)
                                     {
-                                        if (cardSource.EqualsCardName("Shoutmon"))
+                                        if (cardSource.EqualsCardNameDigiXros("Shoutmon"))
                                         {
                                             return true;
                                         }
@@ -362,8 +363,89 @@ namespace DCGO.CardEffects.BT21
 
                     if (selectedCard != null)
                     {
+                        #region reduce play cost
+
+                        ChangeCostClass changeCostClass = new ChangeCostClass();
+                        changeCostClass.SetUpICardEffect("Play Cost -5", CanUseCondition1, card);
+                        changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                        Func<EffectTiming, ICardEffect> getCardEffect = GetCardEffect;
+                        card.Owner.UntilCalculateFixedCostEffect.Add(getCardEffect);
+
+                        ICardEffect GetCardEffect(EffectTiming _timing)
+                        {
+                            if (_timing == EffectTiming.None)
+                            {
+                                return changeCostClass;
+                            }
+
+                            return null;
+                        }
+
+                        bool CanUseCondition1(Hashtable hashtable)
+                        {
+                            return true;
+                        }
+
+                        int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                        {
+                            if (CardSourceCondition(cardSource))
+                            {
+                                if (RootCondition(root))
+                                {
+                                    if (PermanentsCondition(targetPermanents))
+                                    {
+                                        Cost -= 5;
+                                    }
+                                }
+                            }
+
+                            return Cost;
+                        }
+
+                        bool PermanentsCondition(List<Permanent> targetPermanents)
+                        {
+                            if (targetPermanents == null)
+                            {
+                                return true;
+                            }
+                            else
+                            {
+                                if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
+                                {
+                                    return true;
+                                }
+                            }
+
+                            return false;
+                        }
+
+                        bool CardSourceCondition(CardSource cardSource)
+                        {
+                            if (cardSource != null)
+                            {
+                                if (cardSource.Owner == card.Owner)
+                                {
+                                    return CanSelectCardCondition(cardSource);
+                                }
+                            }
+
+                            return false;
+                        }
+
+                        bool RootCondition(SelectCardEffect.Root root)
+                        {
+                            return true;
+                        }
+
+                        bool isUpDown()
+                        {
+                            return true;
+                        }
+
+                        #endregion
+
                         bool isPlayed = false;
-                        var reducdedCost = selectedCard.BasePlayCostFromEntity - 5;
+                        Permanent thisPermanent = card.PermanentOfThisCard();
 
                         yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
                                      cardSources: new List<CardSource>() { selectedCard }, 
@@ -371,8 +453,13 @@ namespace DCGO.CardEffects.BT21
                                      payCost: true, 
                                      isTapped: false, 
                                      root: SelectCardEffect.Root.Hand,
-                                     activateETB: true, 
-                                     fixedCost: reducdedCost));
+                                     activateETB: true));
+
+                        #region release reducing play cost
+
+                        card.Owner.UntilCalculateFixedCostEffect.Remove(getCardEffect);
+
+                        #endregion
 
                         if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedCard.PermanentOfThisCard())) isPlayed = true;
 
@@ -383,7 +470,7 @@ namespace DCGO.CardEffects.BT21
 
                             selectPermanentEffect.SetUp(
                                 selectPlayer: card.Owner,
-                                canTargetCondition: permanent => permanent == card.PermanentOfThisCard(),
+                                canTargetCondition: permanent => permanent == thisPermanent,
                                 canTargetCondition_ByPreSelecetedList: null,
                                 canEndSelectCondition: null,
                                 maxCount: 1,

+ 2 - 2
Assets/CardEffect/BT21/Red/BT21_027.cs

@@ -136,7 +136,7 @@ namespace DCGO.CardEffects.BT21
             if (timing == EffectTiming.None)
             {
                 ChangeCardNamesForDigiXrosClass changeCardNamesForDigiXrosClass = new ChangeCardNamesForDigiXrosClass();
-                changeCardNamesForDigiXrosClass.SetUpICardEffect("Also treated as [Shoutmon]/[ZeigGreymon] for a DigiXros", CanUseCondition, card);
+                changeCardNamesForDigiXrosClass.SetUpICardEffect("Also treated as [OmniShoutmon]/[ZeigGreymon] for a DigiXros", CanUseCondition, card);
                 changeCardNamesForDigiXrosClass.SetUpChangeCardNamesForDigiXrosClass(changeCardNames: ChangeCardNames);
                 cardEffects.Add(changeCardNamesForDigiXrosClass);
 
@@ -149,7 +149,7 @@ namespace DCGO.CardEffects.BT21
                 {
                     if (cardSource == card)
                     {
-                        cardNames.Add("Shoutmon");
+                        cardNames.Add("OmniShoutmon");
                         cardNames.Add("ZeigGreymon");
                     }