EX8_008.cs 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX8
  4. {
  5. public class EX8_008 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Digivolution Condition
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. if (targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 2)
  16. return targetPermanent.TopCard.EqualsTraits("NSo");
  17. return false;
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  20. permanentCondition: PermanentCondition,
  21. digivolutionCost: 0,
  22. ignoreDigivolutionRequirement: false,
  23. card: card,
  24. condition: null)
  25. );
  26. }
  27. #endregion
  28. #region On Deletion
  29. if (timing == EffectTiming.OnDestroyedAnyone)
  30. {
  31. ActivateClass activateClass = new ActivateClass();
  32. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  33. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  34. cardEffects.Add(activateClass);
  35. string EffectDiscription()
  36. {
  37. return "[On Deletion] Gain 1 memory.";
  38. }
  39. bool CanUseCondition(Hashtable hashtable)
  40. {
  41. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card, activateClass);
  42. }
  43. bool CanActivateCondition(Hashtable hashtable)
  44. {
  45. if (CardEffectCommons.CanActivateOnDeletion(card, activateClass))
  46. {
  47. if (card.Owner.CanAddMemory(activateClass))
  48. {
  49. return true;
  50. }
  51. }
  52. return false;
  53. }
  54. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  55. {
  56. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  57. }
  58. }
  59. #endregion
  60. #region Inherit
  61. if (timing == EffectTiming.None)
  62. {
  63. bool Condition()
  64. {
  65. if (CardEffectCommons.IsOwnerTurn(card))
  66. {
  67. return true;
  68. }
  69. return false;
  70. }
  71. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  72. changeValue: 2000,
  73. isInheritedEffect: true,
  74. card: card,
  75. condition: Condition));
  76. }
  77. #endregion
  78. return cardEffects;
  79. }
  80. }
  81. }