BT6_060.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class BT6_060 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.OnEnterFieldAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Reveal the top 4 cards of deck", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[On Play] Reveal the top 4 cards of your deck. Add 1 Digimon card with [Three Musketeers] in its traits and 1 Option card with a memory cost of 7 among them to your hand. Trash the remaining cards.";
  22. }
  23. bool CanSelectCardCondition(CardSource cardSource)
  24. {
  25. if (cardSource.IsDigimon)
  26. {
  27. if (cardSource.CardTraits.Contains("Three Musketeers") || cardSource.CardTraits.Contains("ThreeMusketeers"))
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanSelectCardCondition1(CardSource cardSource)
  35. {
  36. if (cardSource.IsOption)
  37. {
  38. if (cardSource.GetCostItself == 7)
  39. {
  40. return true;
  41. }
  42. }
  43. return false;
  44. }
  45. bool CanUseCondition(Hashtable hashtable)
  46. {
  47. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  48. }
  49. bool CanActivateCondition(Hashtable hashtable)
  50. {
  51. if (CardEffectCommons.IsExistOnBattleArea(card))
  52. {
  53. if (card.Owner.LibraryCards.Count >= 1)
  54. {
  55. return true;
  56. }
  57. }
  58. return false;
  59. }
  60. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  61. {
  62. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  63. revealCount: 4,
  64. simplifiedSelectCardConditions:
  65. new SimplifiedSelectCardConditionClass[]
  66. {
  67. new SimplifiedSelectCardConditionClass(
  68. canTargetCondition:CanSelectCardCondition,
  69. message: "Select 1 Digimon card with [Three Musketeers] in its traits.",
  70. mode: SelectCardEffect.Mode.AddHand,
  71. maxCount: 1,
  72. selectCardCoroutine: null),
  73. new SimplifiedSelectCardConditionClass(
  74. canTargetCondition:CanSelectCardCondition1,
  75. message: "Select 1 Option card with a memory cost of 7.",
  76. mode: SelectCardEffect.Mode.AddHand,
  77. maxCount: 1,
  78. selectCardCoroutine: null),
  79. },
  80. remainingCardsPlace: RemainingCardsPlace.Trash,
  81. activateClass: activateClass
  82. ));
  83. }
  84. }
  85. if (timing == EffectTiming.None)
  86. {
  87. bool Condition()
  88. {
  89. return CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.IsExistOnBattleArea(card);
  90. }
  91. bool PermanentCondition(Permanent targetPermanent)
  92. {
  93. return targetPermanent == card.PermanentOfThisCard();
  94. }
  95. bool CardCondition(CardSource cardSource)
  96. {
  97. if (cardSource != null)
  98. {
  99. if (cardSource.Owner == card.Owner)
  100. {
  101. if (cardSource.Owner.HandCards.Contains(cardSource))
  102. {
  103. if (cardSource.IsDigimon)
  104. {
  105. if (cardSource.CardTraits.Contains("Three Musketeers") || cardSource.CardTraits.Contains("ThreeMusketeers"))
  106. {
  107. return true;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. return false;
  114. }
  115. string effectName = $"Can digivolve to [Three Musketeers] Digimon";
  116. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 6, ignoreDigivolutionRequirement: true, card: card, condition: Condition, effectName: effectName, cardCondition: CardCondition));
  117. }
  118. return cardEffects;
  119. }
  120. }