| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.BT17
- {
- public class BT17_063 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternate Digivolution
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.EqualsCardName("HippoGryphonmon");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false,
- card: card, condition: null));
- }
- #endregion
- #region Retaliation
- if (timing == EffectTiming.OnDestroyedAnyone)
- {
- cardEffects.Add(CardEffectFactory.RetaliationSelfEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region When Digivolving
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Draw 1 and Trash 1, then digivolve into [Murmukusmon]", CanUseCondition,
- card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[When Digivolving] <Draw 1> and trash 1 card in your hand. Then, if [HippoGryphonmon] is in this Digimon's digivolution cards, this Digimon may digivolve into [Murmukusmon] in the hand for a digivolution cost of 2, ignoring its digivolution requirements.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- bool IsHippoGryphonmonCardCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon &&
- cardSource.EqualsCardName("HippoGryphonmon");
- }
- bool IsMurmukusmonCardCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon &&
- cardSource.EqualsCardName("Murmukusmon");
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card) &&
- (card.Owner.LibraryCards.Count >= 1 ||
- card.Owner.HandCards.Count >= 1 ||
- (card.PermanentOfThisCard().DigivolutionCards.Some(IsHippoGryphonmonCardCondition) &&
- card.Owner.HandCards.Some(IsMurmukusmonCardCondition)));
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- if (card.Owner.LibraryCards.Count >= 1)
- {
- yield return ContinuousController.instance.StartCoroutine(
- new DrawClass(card.Owner, 1, activateClass).Draw());
- }
- if (card.Owner.HandCards.Count >= 1)
- {
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
- selectHandEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: _ => true,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- isShowOpponent: true,
- selectCardCoroutine: null,
- afterSelectCardCoroutine: null,
- mode: SelectHandEffect.Mode.Discard,
- cardEffect: activateClass);
- yield return StartCoroutine(selectHandEffect.Activate());
- }
- if (card.PermanentOfThisCard().DigivolutionCards.Some(IsHippoGryphonmonCardCondition) &&
- card.Owner.HandCards.Some(IsMurmukusmonCardCondition))
- {
- yield return ContinuousController.instance.StartCoroutine(
- CardEffectCommons.DigivolveIntoHandOrTrashCard(
- targetPermanent: card.PermanentOfThisCard(),
- cardCondition: IsMurmukusmonCardCondition,
- payCost: true,
- reduceCostTuple: null,
- fixedCostTuple: null,
- ignoreDigivolutionRequirementFixedCost: 2,
- isHand: true,
- activateClass: activateClass,
- successProcess: null));
- }
- }
- }
- #endregion
- #region Retaliation - ESS
- if (timing == EffectTiming.OnDestroyedAnyone)
- {
- cardEffects.Add(CardEffectFactory.RetaliationSelfEffect(isInheritedEffect: true, card: card, condition: null));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|