BT11_024.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace DCGO.CardEffects.BT11
  5. {
  6. public class BT11_024 : 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.OnEnterFieldAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Place 1 card to digivolution cards to Draw 1", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[On Play] By placing 1 blue level 3 Digimon card or 1 Digimon card with [Aqua] or [Sea Animal] in one of its traits from your hand under this Digimon as its bottom digivolution card, <Draw 1>.";
  20. }
  21. bool CanSelectCardCondition(CardSource cardSource)
  22. {
  23. if (cardSource.IsDigimon)
  24. {
  25. if (cardSource.HasCardColor(CardColor.Blue))
  26. {
  27. if (cardSource.Level == 3)
  28. {
  29. if (cardSource.HasLevel)
  30. {
  31. return true;
  32. }
  33. }
  34. }
  35. if (cardSource.HasAquaTraits)
  36. {
  37. return true;
  38. }
  39. }
  40. return false;
  41. }
  42. bool CanUseCondition(Hashtable hashtable)
  43. {
  44. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  45. }
  46. bool CanActivateCondition(Hashtable hashtable)
  47. {
  48. if (CardEffectCommons.IsExistOnBattleArea(card))
  49. {
  50. if (card.Owner.HandCards.Count >= 1)
  51. {
  52. return true;
  53. }
  54. }
  55. return false;
  56. }
  57. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  58. {
  59. if (CardEffectCommons.IsExistOnBattleArea(card))
  60. {
  61. if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  62. {
  63. List<CardSource> selectedCards = new List<CardSource>();
  64. int maxCount = 1;
  65. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  66. selectHandEffect.SetUp(
  67. selectPlayer: card.Owner,
  68. canTargetCondition: CanSelectCardCondition,
  69. canTargetCondition_ByPreSelecetedList: null,
  70. canEndSelectCondition: null,
  71. maxCount: maxCount,
  72. canNoSelect: true,
  73. canEndNotMax: false,
  74. isShowOpponent: true,
  75. selectCardCoroutine: SelectCardCoroutine,
  76. afterSelectCardCoroutine: null,
  77. mode: SelectHandEffect.Mode.Custom,
  78. cardEffect: activateClass);
  79. selectHandEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.", "The opponent is selecting 1 card to place on bottom of digivolution cards.");
  80. selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  81. yield return StartCoroutine(selectHandEffect.Activate());
  82. IEnumerator SelectCardCoroutine(CardSource cardSource)
  83. {
  84. selectedCards.Add(cardSource);
  85. yield return null;
  86. }
  87. if (selectedCards.Count >= 1)
  88. {
  89. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
  90. selectedCards,
  91. activateClass));
  92. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  93. }
  94. }
  95. }
  96. }
  97. }
  98. return cardEffects;
  99. }
  100. }
  101. }