|
|
@@ -35,141 +35,143 @@ namespace DCGO.CardEffects.BT19
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card) &&
|
|
|
- CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasCompositeTrait);
|
|
|
+ return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
- #region reduce play cost
|
|
|
- ChangeCostClass changeCostClass = new ChangeCostClass();
|
|
|
- changeCostClass.SetUpICardEffect($"Play Cost -4", 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(CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasCompositeTrait))
|
|
|
{
|
|
|
- if (_timing == EffectTiming.None)
|
|
|
+ #region reduce play cost
|
|
|
+ ChangeCostClass changeCostClass = new ChangeCostClass();
|
|
|
+ changeCostClass.SetUpICardEffect($"Play Cost -4", 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)
|
|
|
{
|
|
|
- return changeCostClass;
|
|
|
- }
|
|
|
+ if (_timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ return changeCostClass;
|
|
|
+ }
|
|
|
|
|
|
- return null;
|
|
|
- }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
- bool CanUseCondition1(Hashtable hashtable)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ bool CanUseCondition1(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
- int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
|
|
|
- {
|
|
|
- if (CardSourceCondition(cardSource))
|
|
|
+ int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
|
|
|
{
|
|
|
- if (RootCondition(root))
|
|
|
+ if (CardSourceCondition(cardSource))
|
|
|
{
|
|
|
- if (PermanentsCondition(targetPermanents))
|
|
|
+ if (RootCondition(root))
|
|
|
{
|
|
|
- Cost -= 4;
|
|
|
+ if (PermanentsCondition(targetPermanents))
|
|
|
+ {
|
|
|
+ Cost -= 4;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- return Cost;
|
|
|
- }
|
|
|
|
|
|
- bool PermanentsCondition(List<Permanent> targetPermanents)
|
|
|
- {
|
|
|
- if (targetPermanents == null)
|
|
|
- {
|
|
|
- return true;
|
|
|
+ return Cost;
|
|
|
}
|
|
|
|
|
|
- else
|
|
|
+ bool PermanentsCondition(List<Permanent> targetPermanents)
|
|
|
{
|
|
|
- if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
|
|
|
+ if (targetPermanents == null)
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- bool CardSourceCondition(CardSource cardSource)
|
|
|
- {
|
|
|
- if (cardSource.HasPlayCost)
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CardSourceCondition(CardSource cardSource)
|
|
|
{
|
|
|
- if (cardSource.IsDigimon)
|
|
|
- return cardSource.ContainsTraits("Composite");
|
|
|
+ if (cardSource.HasPlayCost)
|
|
|
+ {
|
|
|
+ if (cardSource.IsDigimon)
|
|
|
+ return cardSource.ContainsTraits("Composite");
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ bool RootCondition(SelectCardEffect.Root root)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
- bool RootCondition(SelectCardEffect.Root root)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ bool isUpDown()
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: HasCompositeTrait,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: null,
|
|
|
+ afterSelectCardCoroutine: SelectCardCoroutine,
|
|
|
+ message: "Select 1 [Composite] trait Digimon card to play.",
|
|
|
+ maxCount: 1,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage(
|
|
|
+ "Select 1 [Composite] trait Digimon card to play.",
|
|
|
+ "The opponent is selecting 1 [Composite] trait Digimon card to play.");
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Play Card");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(List<CardSource> sources)
|
|
|
+ {
|
|
|
+ selectedCards = sources;
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
|
|
|
- bool isUpDown()
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
- List<CardSource> selectedCards = new List<CardSource>();
|
|
|
-
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: HasCompositeTrait,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: null,
|
|
|
- afterSelectCardCoroutine: SelectCardCoroutine,
|
|
|
- message: "Select 1 [Composite] trait Digimon card to play.",
|
|
|
- maxCount: 1,
|
|
|
- canEndNotMax: false,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- customRootCardList: null,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- selectCardEffect.SetUpCustomMessage(
|
|
|
- "Select 1 [Composite] trait Digimon card to play.",
|
|
|
- "The opponent is selecting 1 [Composite] trait Digimon card to play.");
|
|
|
- selectCardEffect.SetUpCustomMessage_ShowCard("Play Card");
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
-
|
|
|
- IEnumerator SelectCardCoroutine(List<CardSource> sources)
|
|
|
- {
|
|
|
- selectedCards = sources;
|
|
|
- yield return null;
|
|
|
- }
|
|
|
+ #region Place As Source
|
|
|
+ if (selectedCards.Count > 0)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
+ cardSources: selectedCards,
|
|
|
+ activateClass: activateClass,
|
|
|
+ payCost: true,
|
|
|
+ isTapped: false,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ activateETB: true));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
|
|
|
- #region Place As Source
|
|
|
- if (selectedCards.Count > 0)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
- cardSources: selectedCards,
|
|
|
- activateClass: activateClass,
|
|
|
- payCost: true,
|
|
|
- isTapped: false,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- activateETB: true));
|
|
|
+ #region Remove Cost effect after use
|
|
|
+ card.Owner.UntilCalculateFixedCostEffect.Remove(getCardEffect);
|
|
|
+ #endregion
|
|
|
}
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region Remove Cost effect after use
|
|
|
- card.Owner.UntilCalculateFixedCostEffect.Remove(getCardEffect);
|
|
|
- #endregion
|
|
|
|
|
|
yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
|
|
|
}
|