EX11_008.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Elizamon
  4. namespace DCGO.CardEffects.EX11
  5. {
  6. public class EX11_008 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Shared WM/OP
  12. string SharedEffectName() => "1 Digimon gains <Raid> and +3k DP for turn.";
  13. string SharedEffectDescription(string tag) => $"[{tag}] 1 of your Digimon with the [Reptile] or [Dragonkin] trait gains <Raid> and +3000 DP for the turn.";
  14. bool SharedCanActivateCondition(Hashtable hashtable)
  15. {
  16. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  17. }
  18. bool PermanentDigimonCondition(Permanent permanent)
  19. {
  20. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  21. && (permanent.TopCard.EqualsTraits("Reptile")
  22. || permanent.TopCard.EqualsTraits("Dragonkin"));
  23. }
  24. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  25. {
  26. if (CardEffectCommons.HasMatchConditionPermanent(PermanentDigimonCondition))
  27. {
  28. Permanent selectedPermanent = null;
  29. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  30. selectPermanentEffect.SetUp(
  31. selectPlayer: card.Owner,
  32. canTargetCondition: PermanentDigimonCondition,
  33. canTargetCondition_ByPreSelecetedList: null,
  34. canEndSelectCondition: null,
  35. maxCount: 1,
  36. canNoSelect: false,
  37. canEndNotMax: false,
  38. selectPermanentCoroutine: SelectPermanentCoroutine,
  39. afterSelectPermanentCoroutine: null,
  40. mode: SelectPermanentEffect.Mode.Custom,
  41. cardEffect: activateClass);
  42. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will gain effects.",
  43. "The opponent is selecting 1 Digimon that will gain effects.");
  44. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  45. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  46. {
  47. selectedPermanent = permanent;
  48. yield return null;
  49. }
  50. if (selectedPermanent != null)
  51. {
  52. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRaid(
  53. targetPermanent: selectedPermanent,
  54. effectDuration: EffectDuration.UntilEachTurnEnd,
  55. activateClass: activateClass));
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  57. targetPermanent: selectedPermanent,
  58. changeValue: 3000,
  59. effectDuration: EffectDuration.UntilEachTurnEnd,
  60. activateClass: activateClass));
  61. }
  62. }
  63. }
  64. #endregion
  65. #region When Moving
  66. if (timing == EffectTiming.OnMove)
  67. {
  68. ActivateClass activateClass = new ActivateClass();
  69. activateClass.SetUpICardEffect(SharedEffectName(), CanUseCondition, card);
  70. activateClass.SetUpActivateClass(SharedCanActivateCondition, (hashTable) => SharedActivateCoroutine(hashTable, activateClass), -1, false, SharedEffectDescription("When Moving"));
  71. cardEffects.Add(activateClass);
  72. bool PermanentCondition(Permanent permanent)
  73. {
  74. return permanent == card.PermanentOfThisCard();
  75. }
  76. bool CanUseCondition(Hashtable hashtable)
  77. {
  78. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  79. && CardEffectCommons.CanTriggerOnMove(hashtable, PermanentCondition);
  80. }
  81. }
  82. #endregion
  83. #region On Play
  84. if (timing == EffectTiming.OnEnterFieldAnyone)
  85. {
  86. ActivateClass activateClass = new ActivateClass();
  87. activateClass.SetUpICardEffect(SharedEffectName(), CanUseCondition, card);
  88. activateClass.SetUpActivateClass(SharedCanActivateCondition, (hashTable) => SharedActivateCoroutine(hashTable, activateClass), -1, false, SharedEffectDescription("On Play"));
  89. cardEffects.Add(activateClass);
  90. bool CanUseCondition(Hashtable hashtable)
  91. {
  92. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  93. && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  94. }
  95. }
  96. #endregion
  97. #region Your Turn - ESS
  98. if (timing == EffectTiming.OnLoseSecurity)
  99. {
  100. ActivateClass activateClass = new ActivateClass();
  101. activateClass.SetUpICardEffect("Gain 1 memory", CanUseCondition, card);
  102. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  103. activateClass.SetIsInheritedEffect(true);
  104. activateClass.SetHashString("GainMemory_EX11_008");
  105. cardEffects.Add(activateClass);
  106. string EffectDescription()
  107. => "[Your Turn] [Once Per Turn] When your opponent's security stack is removed from, gain 1 memory.";
  108. bool CanUseCondition(Hashtable hashtable)
  109. {
  110. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  111. {
  112. if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, PlayerCondition))
  113. {
  114. if (CardEffectCommons.IsOwnerTurn(card))
  115. {
  116. return true;
  117. }
  118. }
  119. }
  120. return false;
  121. }
  122. bool CanActivateCondition(Hashtable hashtable)
  123. {
  124. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  125. {
  126. return true;
  127. }
  128. return false;
  129. }
  130. bool PlayerCondition(Player player)
  131. {
  132. if (player == card.Owner.Enemy)
  133. {
  134. return true;
  135. }
  136. return false;
  137. }
  138. IEnumerator ActivateCoroutine(Hashtable hashtable)
  139. {
  140. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  141. }
  142. }
  143. #endregion
  144. return cardEffects;
  145. }
  146. }
  147. }