BT11_094.cs 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace DCGO.CardEffects.BT11
  5. {
  6. public class BT11_094 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.OnStartTurn)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[Start of Your Turn] Gain 1 memory.";
  20. }
  21. bool CanUseCondition(Hashtable hashtable)
  22. {
  23. if (CardEffectCommons.IsExistOnBattleArea(card))
  24. {
  25. if (CardEffectCommons.IsOwnerTurn(card))
  26. {
  27. return true;
  28. }
  29. }
  30. return false;
  31. }
  32. bool CanActivateCondition(Hashtable hashtable)
  33. {
  34. if (CardEffectCommons.IsExistOnBattleArea(card))
  35. {
  36. if (card.Owner.CanAddMemory(activateClass))
  37. {
  38. return true;
  39. }
  40. }
  41. return false;
  42. }
  43. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  44. {
  45. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  46. }
  47. }
  48. if (timing == EffectTiming.OnEnterFieldAnyone)
  49. {
  50. ActivateClass activateClass = new ActivateClass();
  51. activateClass.SetUpICardEffect("Play 1 [Angewomon] or [LadyDevimon]", CanUseCondition, card);
  52. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  53. cardEffects.Add(activateClass);
  54. string EffectDiscription()
  55. {
  56. return "[Your Turn] When one of your Digimon digivolves into [Angewomon] or [LadyDevimon], if you have 1 or fewer Digimon in play, by suspending this Tamer, you may play 1 [Angewomon] or [LadyDevimon] with a different name than the Digimon you digivolved into from your hand without paying the cost.";
  57. }
  58. bool PermanentCondition(Permanent permanent)
  59. {
  60. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  61. {
  62. if (permanent.TopCard.CardNames.Contains("Angewomon"))
  63. {
  64. return true;
  65. }
  66. if (permanent.TopCard.CardNames.Contains("LadyDevimon"))
  67. {
  68. return true;
  69. }
  70. }
  71. return false;
  72. }
  73. bool CanUseCondition(Hashtable hashtable)
  74. {
  75. if (CardEffectCommons.IsExistOnBattleArea(card))
  76. {
  77. if (CardEffectCommons.IsOwnerTurn(card))
  78. {
  79. if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition))
  80. {
  81. return true;
  82. }
  83. }
  84. }
  85. return false;
  86. }
  87. bool CanActivateCondition(Hashtable hashtable)
  88. {
  89. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  90. {
  91. if (card.Owner.GetBattleAreaDigimons().Count <= 1)
  92. {
  93. return true;
  94. }
  95. }
  96. return false;
  97. }
  98. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  99. {
  100. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  101. List<Permanent> permanents = CardEffectCommons.GetPlayedPermanentsFromEnterFieldHashtable(
  102. hashtable: _hashtable,
  103. rootCondition: null);
  104. if (permanents != null)
  105. {
  106. bool CanSelectCardCondition(CardSource cardSource)
  107. {
  108. if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
  109. {
  110. if (permanents.Count(permanent => permanent.CardNamesJustAfterDigivolved.Contains("Angewomon")) == 0)
  111. {
  112. if (cardSource.CardNames.Contains("Angewomon"))
  113. {
  114. return true;
  115. }
  116. }
  117. if (permanents.Count(permanent => permanent.CardNamesJustAfterDigivolved.Contains("LadyDevimon")) == 0)
  118. {
  119. if (cardSource.CardNames.Contains("LadyDevimon"))
  120. {
  121. return true;
  122. }
  123. }
  124. }
  125. return false;
  126. }
  127. if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  128. {
  129. List<CardSource> selectedCards = new List<CardSource>();
  130. int maxCount = 1;
  131. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  132. selectHandEffect.SetUp(
  133. selectPlayer: card.Owner,
  134. canTargetCondition: CanSelectCardCondition,
  135. canTargetCondition_ByPreSelecetedList: null,
  136. canEndSelectCondition: null,
  137. maxCount: maxCount,
  138. canNoSelect: true,
  139. canEndNotMax: false,
  140. isShowOpponent: true,
  141. selectCardCoroutine: SelectCardCoroutine,
  142. afterSelectCardCoroutine: null,
  143. mode: SelectHandEffect.Mode.Custom,
  144. cardEffect: activateClass);
  145. selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
  146. selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
  147. yield return StartCoroutine(selectHandEffect.Activate());
  148. IEnumerator SelectCardCoroutine(CardSource cardSource)
  149. {
  150. selectedCards.Add(cardSource);
  151. yield return null;
  152. }
  153. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
  154. cardSources: selectedCards,
  155. activateClass: activateClass,
  156. payCost: false,
  157. isTapped: false,
  158. root: SelectCardEffect.Root.Hand,
  159. activateETB: true));
  160. }
  161. }
  162. }
  163. }
  164. if (timing == EffectTiming.SecuritySkill)
  165. {
  166. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  167. }
  168. return cardEffects;
  169. }
  170. }
  171. }