P_116.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 P_116 : 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.None)
  14. {
  15. ChangeCostClass changeCostClass = new ChangeCostClass();
  16. changeCostClass.SetUpICardEffect($"Play Cost is 0", CanUseCondition, card);
  17. changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => false);
  18. cardEffects.Add(changeCostClass);
  19. bool CanUseCondition(Hashtable hashtable)
  20. {
  21. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.CardNames.Contains("Agumon")))
  22. {
  23. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.CardNames.Contains("Pulsemon")))
  24. {
  25. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.CardNames.Contains("Gammamon")))
  26. {
  27. return true;
  28. }
  29. }
  30. }
  31. return false;
  32. }
  33. int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
  34. {
  35. if (CardSourceCondition(cardSource))
  36. {
  37. if (RootCondition(root))
  38. {
  39. if (PermanentsCondition(targetPermanents))
  40. {
  41. Cost = 0;
  42. }
  43. }
  44. }
  45. return Cost;
  46. }
  47. bool PermanentsCondition(List<Permanent> targetPermanents)
  48. {
  49. return true;
  50. }
  51. bool CardSourceCondition(CardSource cardSource)
  52. {
  53. return cardSource == card;
  54. }
  55. bool RootCondition(SelectCardEffect.Root root)
  56. {
  57. return true;
  58. }
  59. bool isUpDown()
  60. {
  61. return false;
  62. }
  63. }
  64. if (timing == EffectTiming.OptionSkill)
  65. {
  66. ActivateClass activateClass = new ActivateClass();
  67. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  68. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  69. cardEffects.Add(activateClass);
  70. string EffectDiscription()
  71. {
  72. return "[Main] Reveal the top 2 cards of your deck. Add all Tamer cards with a play cost of 3 or less among them to your hand. Return the rest to the top of the deck.";
  73. }
  74. bool CanSelectCardCondition(CardSource cardSource)
  75. {
  76. if (cardSource.IsTamer)
  77. {
  78. if (cardSource.GetCostItself <= 3)
  79. {
  80. if (cardSource.HasPlayCost)
  81. {
  82. return true;
  83. }
  84. }
  85. }
  86. return false;
  87. }
  88. bool CanUseCondition(Hashtable hashtable)
  89. {
  90. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  91. }
  92. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  93. {
  94. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.RevealDeckTopCardsAndProcessForAll(
  95. revealCount: 2,
  96. simplifiedSelectCardCondition:
  97. new SimplifiedSelectCardConditionClass(
  98. canTargetCondition: CanSelectCardCondition,
  99. message: "",
  100. mode: SelectCardEffect.Mode.AddHand,
  101. maxCount: -1,
  102. selectCardCoroutine: null),
  103. remainingCardsPlace: RemainingCardsPlace.DeckTop,
  104. activateClass: activateClass
  105. ));
  106. }
  107. }
  108. if (timing == EffectTiming.SecuritySkill)
  109. {
  110. CardEffectCommons.AddActivateMainOptionSecurityEffect(card: card, cardEffects: ref cardEffects, effectName: $"Reveal the top 2 cards of deck");
  111. }
  112. return cardEffects;
  113. }
  114. }