|
|
@@ -12,6 +12,7 @@ namespace DCGO.CardEffects.BT21
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
|
#region On Play
|
|
|
+
|
|
|
if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
@@ -132,145 +133,114 @@ namespace DCGO.CardEffects.BT21
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
- #region Inherit
|
|
|
- ActivateClass activateClassInherit = new ActivateClass();
|
|
|
- activateClassInherit.SetUpICardEffect("Digivolution Cost -1", CanUseConditionInherit, card);
|
|
|
- activateClassInherit.SetUpActivateClass(CanActivateConditionInherit, ActivateCoroutineInherit, 1, false, EffectDiscriptionInherit());
|
|
|
- activateClassInherit.SetIsInheritedEffect(true);
|
|
|
- activateClassInherit.SetNotShowUI(true);
|
|
|
- activateClassInherit.SetIsBackgroundProcess(true);
|
|
|
- activateClassInherit.SetHashString("DigivolutionCost-1_BT21_056");
|
|
|
+ #region Your Turn Inherited
|
|
|
|
|
|
- string EffectDiscriptionInherit()
|
|
|
+ if (timing == EffectTiming.BeforePayCost)
|
|
|
{
|
|
|
- return "[Your Turn] [Once Per Turn] When this Digimon would digivolve into a Digimon card with [Vemmon] in its text, reduce the digivolution cost by 1.";
|
|
|
- }
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Digivolution Cost -1", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
|
|
|
+ activateClass.SetIsInheritedEffect(true);
|
|
|
+ activateClass.SetHashString("DigivolutionCost-1_BT21_056");
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
|
|
|
- bool CanUseConditionInherit(Hashtable hashtable)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
+ string EffectDiscription()
|
|
|
{
|
|
|
- if (CardEffectCommons.IsOwnerTurn(card))
|
|
|
- {
|
|
|
- if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
|
|
|
- {
|
|
|
- List<CardSource> evoRootTops = CardEffectCommons.GetEvoRootTopsFromEnterFieldHashtable(
|
|
|
- hashtable,
|
|
|
- permanent => permanent.cardSources.Contains(card));
|
|
|
+ return "[Your Turn] [Once Per Turn] When this Digimon would digivolve into a Digimon card with [Vemmon] in its text, reduce the digivolution cost by 1.";
|
|
|
+ }
|
|
|
|
|
|
- if (evoRootTops != null)
|
|
|
- {
|
|
|
- if (!evoRootTops.Contains(card))
|
|
|
- {
|
|
|
- if (card.PermanentOfThisCard().TopCard.HasText("Vemmon"))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ bool PermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
|
|
|
+ permanent == card.PermanentOfThisCard();
|
|
|
}
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ bool CardCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.IsDigimon &&
|
|
|
+ cardSource.HasText("Vemmon");
|
|
|
+ }
|
|
|
|
|
|
- bool CanActivateConditionInherit(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
- }
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.IsOwnerTurn(card) &&
|
|
|
+ CardEffectCommons.CanTriggerWhenPermanentWouldDigivolve(hashtable, PermanentCondition, CardCondition);
|
|
|
+ }
|
|
|
|
|
|
- IEnumerator ActivateCoroutineInherit(Hashtable _hashtable)
|
|
|
- {
|
|
|
- yield return null;
|
|
|
- }
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
+ }
|
|
|
|
|
|
- if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
- {
|
|
|
- cardEffects.Add(activateClassInherit);
|
|
|
- }
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
+ {
|
|
|
+ if (isExistOnField(card))
|
|
|
+ {
|
|
|
+ Hashtable hashtable = new Hashtable();
|
|
|
+ hashtable.Add("CardEffect", activateClass);
|
|
|
|
|
|
- if (timing == EffectTiming.None)
|
|
|
- {
|
|
|
- ChangeCostClass changeCostClass = new ChangeCostClass();
|
|
|
- changeCostClass.SetUpICardEffect($"Digivolution Cost -1", CanUseConditionChangeCost, card);
|
|
|
- changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
|
|
|
+ ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
|
|
|
|
|
|
- changeCostClass.SetIsInheritedEffect(true);
|
|
|
- cardEffects.Add(changeCostClass);
|
|
|
+ ChangeCostClass changeCostClass = new ChangeCostClass();
|
|
|
+ changeCostClass.SetUpICardEffect("Digivolution Cost -1", CanUseCondition1, card);
|
|
|
+ changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
|
|
|
+ card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
|
|
|
|
|
|
- bool CanUseConditionChangeCost(Hashtable hashtable)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsOwnerTurn(card))
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
|
|
|
+
|
|
|
+ bool CanUseCondition1(Hashtable hashtable)
|
|
|
{
|
|
|
- if (!card.cEntity_EffectController.isOverMaxCountPerTurn(activateClassInherit, activateClassInherit.MaxCountPerTurn))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ return true;
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
|
|
|
- {
|
|
|
- if (CardSourceCondition(cardSource))
|
|
|
- {
|
|
|
- if (RootCondition(root))
|
|
|
+ int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
|
|
|
{
|
|
|
- if (PermanentsCondition(targetPermanents))
|
|
|
+ if (CardSourceCondition(cardSource) && RootCondition(root) && PermanentsCondition(targetPermanents))
|
|
|
{
|
|
|
Cost -= 1;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- return Cost;
|
|
|
- }
|
|
|
+ return Cost;
|
|
|
+ }
|
|
|
|
|
|
- bool PermanentsCondition(List<Permanent> targetPermanents)
|
|
|
- {
|
|
|
- if (targetPermanents != null)
|
|
|
- {
|
|
|
- if (targetPermanents.Count(PermanentCondition) >= 1)
|
|
|
+ bool PermanentsCondition(List<Permanent> targetPermanents)
|
|
|
{
|
|
|
- return true;
|
|
|
+ return targetPermanents != null &&
|
|
|
+ targetPermanents.Count(PermanentCondition) >= 1;
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- bool PermanentCondition(Permanent targetPermanent)
|
|
|
- {
|
|
|
- return targetPermanent == card.PermanentOfThisCard();
|
|
|
- }
|
|
|
+ bool PermanentCondition(Permanent targetPermanent)
|
|
|
+ {
|
|
|
+ return targetPermanent.TopCard != null &&
|
|
|
+ targetPermanent.TopCard.Owner == card.Owner &&
|
|
|
+ targetPermanent.TopCard.Owner.GetBattleAreaPermanents().Contains(targetPermanent);
|
|
|
+ }
|
|
|
|
|
|
- bool CardSourceCondition(CardSource cardSource)
|
|
|
- {
|
|
|
- if (cardSource.HasText("Vemmon"))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ bool CardSourceCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource != null &&
|
|
|
+ cardSource.Owner == card.Owner &&
|
|
|
+ cardSource.HasText("Vemmon");
|
|
|
+ }
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ bool RootCondition(SelectCardEffect.Root root)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
- bool RootCondition(SelectCardEffect.Root root)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ bool isUpDown()
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
- bool isUpDown()
|
|
|
- {
|
|
|
- return true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
return cardEffects;
|