using System.Collections; using System.Collections.Generic; namespace DCGO.CardEffects.BT16 { public class BT16_005 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); 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 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 hashtables = CardEffectCommons.GetHashtablesFromHashtable(hashtable); if (hashtables != null) { if (hashtables.Count >= 1) { return true; } } } } return false; } IEnumerator ActivateCoroutine(Hashtable hashtable) { List hashtables = CardEffectCommons.GetHashtablesFromHashtable(hashtable); if (hashtables != null) { if (hashtables.Count > 0) yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass)); } } } return cardEffects; } } }