BT11_025.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT11
  5. {
  6. public class BT11_025 : 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.OnAllyAttack)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  16. activateClass.SetHashString("Memory+1_BT11_025");
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[When Attacking][Once Per Turn] If your opponent has 8 or more cards in their hand, gain 1 memory.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  25. }
  26. bool CanActivateCondition(Hashtable hashtable)
  27. {
  28. if (CardEffectCommons.IsExistOnBattleArea(card))
  29. {
  30. if (card.Owner.Enemy.HandCards.Count >= 8)
  31. {
  32. return true;
  33. }
  34. }
  35. return false;
  36. }
  37. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  38. {
  39. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  40. }
  41. }
  42. if (timing == EffectTiming.OnAllyAttack)
  43. {
  44. ActivateClass activateClass = new ActivateClass();
  45. activateClass.SetUpICardEffect("Return 1 level 3 Digimon to hand", CanUseCondition, card);
  46. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  47. activateClass.SetIsInheritedEffect(true);
  48. activateClass.SetHashString("Bounce_BT11_025");
  49. cardEffects.Add(activateClass);
  50. string EffectDiscription()
  51. {
  52. return "[When Attacking][Once Per Turn] If you have a Tamer in play, return 1 of your opponent's level 3 Digimon to its owner's hand.";
  53. }
  54. bool CanSelectPermanentCondition(Permanent permanent)
  55. {
  56. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  57. {
  58. if (permanent.Level == 3)
  59. {
  60. if (permanent.TopCard.HasLevel)
  61. {
  62. return true;
  63. }
  64. }
  65. }
  66. return false;
  67. }
  68. bool CanUseCondition(Hashtable hashtable)
  69. {
  70. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  71. }
  72. bool CanActivateCondition(Hashtable hashtable)
  73. {
  74. if (CardEffectCommons.IsExistOnBattleArea(card))
  75. {
  76. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsTamer))
  77. {
  78. return true;
  79. }
  80. }
  81. return false;
  82. }
  83. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  84. {
  85. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  86. {
  87. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  88. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  89. selectPermanentEffect.SetUp(
  90. selectPlayer: card.Owner,
  91. canTargetCondition: CanSelectPermanentCondition,
  92. canTargetCondition_ByPreSelecetedList: null,
  93. canEndSelectCondition: null,
  94. maxCount: maxCount,
  95. canNoSelect: false,
  96. canEndNotMax: false,
  97. selectPermanentCoroutine: null,
  98. afterSelectPermanentCoroutine: null,
  99. mode: SelectPermanentEffect.Mode.Bounce,
  100. cardEffect: activateClass);
  101. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  102. }
  103. }
  104. }
  105. return cardEffects;
  106. }
  107. }
  108. }