BT13_009.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT13
  4. {
  5. public class BT13_009 : 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("This Digimon digivolves into [BaoHuckmon]", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[Your Turn] When you play a Digimon with [Sistermon] in its name, this Digimon may digivolve into [BaoHuckmon] in the hand without paying the cost.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. return cardSource.CardNames.Contains("BaoHuckmon");
  23. }
  24. bool CanUseCondition(Hashtable hashtable)
  25. {
  26. if (CardEffectCommons.IsExistOnBattleArea(card))
  27. {
  28. if (CardEffectCommons.IsOwnerTurn(card))
  29. {
  30. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, (permanent) => CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && permanent.TopCard.ContainsCardName("Sistermon")))
  31. {
  32. return true;
  33. }
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. if (CardEffectCommons.IsExistOnBattleArea(card))
  41. {
  42. if (card.Owner.HandCards.Count >= 1)
  43. {
  44. return true;
  45. }
  46. }
  47. return false;
  48. }
  49. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  50. {
  51. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
  52. targetPermanent: card.PermanentOfThisCard(),
  53. cardCondition: CanSelectCardCondition,
  54. payCost: false,
  55. reduceCostTuple: null,
  56. fixedCostTuple: null,
  57. ignoreDigivolutionRequirementFixedCost: -1,
  58. isHand: true,
  59. activateClass: activateClass,
  60. successProcess: null));
  61. }
  62. }
  63. if (timing == EffectTiming.OnEnterFieldAnyone)
  64. {
  65. ActivateClass activateClass = new ActivateClass();
  66. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  67. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  68. activateClass.SetIsInheritedEffect(true);
  69. activateClass.SetHashString("Memory+1_BT13_009");
  70. cardEffects.Add(activateClass);
  71. string EffectDiscription()
  72. {
  73. return "[Your Turn][Once Per Turn] When you play a Digimon with [Sistermon] in its name, gain 1 memory.";
  74. }
  75. bool CanUseCondition(Hashtable hashtable)
  76. {
  77. if (CardEffectCommons.IsExistOnBattleArea(card))
  78. {
  79. if (CardEffectCommons.IsOwnerTurn(card))
  80. {
  81. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, (permanent) => CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && permanent.TopCard.ContainsCardName("Sistermon")))
  82. {
  83. return true;
  84. }
  85. }
  86. }
  87. return false;
  88. }
  89. bool CanActivateCondition(Hashtable hashtable)
  90. {
  91. if (CardEffectCommons.IsExistOnBattleArea(card))
  92. {
  93. return true;
  94. }
  95. return false;
  96. }
  97. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  98. {
  99. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  100. }
  101. }
  102. return cardEffects;
  103. }
  104. }
  105. }