EX4_064.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX4
  4. {
  5. public class EX4_064 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnStartTurn)
  11. {
  12. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  13. }
  14. if (timing == EffectTiming.OnDestroyedAnyone)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Draw 1 and Memory +1", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[All Turns] When one of your purple Digimon with [Ravemon] in its name or [Bird] or [Avian] in one of its traits is deleted, by suspending this Tamer, <Draw 1> (Draw 1 card from your deck). If that Digimon was deleted by an effect, gain 1 memory.";
  23. }
  24. bool PermanentCondition(Permanent permanent)
  25. {
  26. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  27. {
  28. if (permanent.TopCard.CardColors.Contains(CardColor.Purple))
  29. {
  30. if (permanent.TopCard.ContainsCardName("Ravemon"))
  31. {
  32. return true;
  33. }
  34. if (permanent.TopCard.HasBirdTraits)
  35. {
  36. return true;
  37. }
  38. }
  39. }
  40. return false;
  41. }
  42. bool CanUseCondition(Hashtable hashtable)
  43. {
  44. if (CardEffectCommons.IsExistOnBattleArea(card))
  45. {
  46. if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass))
  47. {
  48. return true;
  49. }
  50. }
  51. return false;
  52. }
  53. bool CanActivateCondition(Hashtable hashtable)
  54. {
  55. if (CardEffectCommons.IsExistOnBattleArea(card))
  56. {
  57. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  58. {
  59. return true;
  60. }
  61. }
  62. return false;
  63. }
  64. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  65. {
  66. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  67. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  68. if (CardEffectCommons.IsByEffect(_hashtable, null))
  69. {
  70. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  71. }
  72. }
  73. }
  74. if (timing == EffectTiming.SecuritySkill)
  75. {
  76. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  77. }
  78. return cardEffects;
  79. }
  80. }
  81. }