| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.BT16
- {
- public class BT16_005 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- if (timing == EffectTiming.OnDestroyedAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("BT16-005-Memory+1");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[All Turns] [Once Per Turn] When another Digimon with <Blocker> is deleted, gain 1 memory.";
- }
- bool PermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
- {
- if (permanent.IsDigimon)
- {
- if (permanent.HasBlocker)
- {
- if (permanent != card.PermanentOfThisCard())
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (card.Owner.CanAddMemory(activateClass))
- {
- List<Hashtable> hashtables = CardEffectCommons.GetHashtablesFromHashtable(hashtable);
- if (hashtables != null)
- {
- if (hashtables.Count >= 1)
- {
- return true;
- }
- }
- }
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- List<Hashtable> hashtables = CardEffectCommons.GetHashtablesFromHashtable(hashtable);
- if (hashtables != null)
- {
- if (hashtables.Count > 0)
- yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
- }
- }
- }
- return cardEffects;
- }
- }
- }
|