| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // Garurumon
- namespace DCGO.CardEffects.BT23
- {
- public class BT23_018 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternative Digivolution Condition
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.HasCSTraits || targetPermanent.TopCard.ContainsCardName("Gabumon")
- && targetPermanent.TopCard.HasLevel
- && targetPermanent.TopCard.IsLevel3;
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 2,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null)
- );
- }
- #endregion
- #region Jamming
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Main - OPT
- if (timing == EffectTiming.OnDeclaration)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("By placing this card as bottom digivolution card, play 1 [Agumon]/[Nokia Shiramine] from hand for 2 reduce cost", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
- activateClass.SetHashString("BT23_018_Main");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Main] [Once Per Turn] By placing this Digimon's top stacked card as its bottom digivolution card, you may play 1 [Agumon] or [Nokia Shiramine] from your hand with the play cost reduced by 2.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && CardEffectCommons.IsOwnerTurn(card)
- && card.PermanentOfThisCard().StackCards.Count >= 1;
- }
- bool CanSelectCardCondition(CardSource cardSource)
- {
- if (CardEffectCommons.CanPlayAsNewPermanent(cardSource, true, activateClass))
- {
- if (cardSource.IsDigimon && cardSource.EqualsCardName("Agumon")) return true;
- if (cardSource.IsTamer && cardSource.EqualsCardName("Nokia Shiramine")) return true;
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card) && card.PermanentOfThisCard().StackCards.Count >= 1)
- {
- CardSource topCard = card.PermanentOfThisCard().TopCard;
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
- new List<CardSource>() { topCard },
- activateClass));
- if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
- {
- CardSource selectCard = null;
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, CanSelectCardCondition));
- selectHandEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectCardCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: true,
- canEndNotMax: false,
- isShowOpponent: true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- mode: SelectHandEffect.Mode.Custom,
- cardEffect: activateClass);
- selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
- selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectCard = cardSource;
- yield return null;
- }
- yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
- if (selectCard != null)
- {
- int cost = selectCard.BasePlayCostFromEntity - 2;
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
- new List<CardSource>() { selectCard },
- activateClass: activateClass,
- payCost: true,
- isTapped: false,
- root: SelectCardEffect.Root.Hand,
- activateETB: true,
- fixedCost: cost));
- }
- }
- }
- }
- }
- #endregion
- #region ESS
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOpponentTurn(card);
- }
- cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|