EX1_051.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX1
  4. {
  5. public class EX1_051 : 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.OnEnterFieldAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  15. activateClass.SetHashString("Memory+1_EX1_051");
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[Opponent's Turn][Once Per Turn] When an opponent's Digimon digivolves into a level 5 or higher Digimon, gain 1 memory.";
  20. }
  21. bool PermanentCondition(Permanent permanent)
  22. {
  23. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  24. {
  25. if (permanent.Level >= 5)
  26. {
  27. if (permanent.TopCard.HasLevel)
  28. {
  29. return true;
  30. }
  31. }
  32. }
  33. return false;
  34. }
  35. bool CanUseCondition(Hashtable hashtable)
  36. {
  37. if (CardEffectCommons.IsExistOnBattleArea(card))
  38. {
  39. if (CardEffectCommons.IsOpponentTurn(card))
  40. {
  41. if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition))
  42. {
  43. return true;
  44. }
  45. }
  46. }
  47. return false;
  48. }
  49. bool CanActivateCondition(Hashtable hashtable)
  50. {
  51. if (CardEffectCommons.IsExistOnBattleArea(card))
  52. {
  53. return true;
  54. }
  55. return false;
  56. }
  57. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  58. {
  59. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  60. }
  61. }
  62. if (timing == EffectTiming.None)
  63. {
  64. bool Condition()
  65. {
  66. if (CardEffectCommons.IsExistOnBattleArea(card))
  67. {
  68. return true;
  69. }
  70. return false;
  71. }
  72. bool PermanentCondition(Permanent permanent)
  73. {
  74. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  75. {
  76. if (permanent != card.PermanentOfThisCard())
  77. {
  78. if (permanent.TopCard.HasSameCardName(card.PermanentOfThisCard().TopCard))
  79. {
  80. return true;
  81. }
  82. }
  83. }
  84. return false;
  85. }
  86. cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
  87. permanentCondition: PermanentCondition,
  88. changeValue: 2000,
  89. isInheritedEffect: true,
  90. card: card,
  91. condition: Condition,
  92. effectName: () => "Your other Digimon with the same name as this Digimon gain DP +2000"));
  93. }
  94. return cardEffects;
  95. }
  96. }
  97. }