| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System.Linq;
- using Photon;
- using System;
- using Photon.Pun;
- public class BT7_038 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- return card.Owner.HandCards.Contains(card);
- }
- bool PermanentCondition(Permanent targetPermanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(targetPermanent, card))
- {
- if (targetPermanent.DigivolutionCards.Count((cardSource) => cardSource.IsTamer) >= 1)
- {
- return true;
- }
- }
- return false;
- }
- bool CardSourceCondition(CardSource cardSource)
- {
- return cardSource == card && cardSource.Owner.HandCards.Contains(cardSource);
- }
- bool RootCondition(SelectCardEffect.Root root)
- {
- return root == SelectCardEffect.Root.Hand;
- }
- cardEffects.Add(CardEffectFactory.ChangeDigivolutionCostStaticEffect(
- changeValue: -2,
- permanentCondition: PermanentCondition,
- cardCondition: CardSourceCondition,
- rootCondition: RootCondition,
- isInheritedEffect: false,
- card: card,
- condition: Condition,
- setFixedCost: false));
- }
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[When Digivolving] If a card with [Hybrid] in its traits is in this Digimon's digivolution cards, <Recovery +1 (Deck)>. (Place the top card of your deck on top of your security stack.)";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardTraits.Contains("Hybrid")) >= 1)
- {
- if (card.Owner.LibraryCards.Count >= 1)
- {
- if (card.Owner.CanAddSecurity(activateClass))
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
- }
- }
- return cardEffects;
- }
- }
|