BT8_060.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 BT8_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 3 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 3 cards of your deck. Add 1 card with [X-Antibody] in its traits and 1 [Yuji Musya] among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  22. }
  23. bool CanSelectCardCondition(CardSource cardSource)
  24. {
  25. return cardSource.HasXAntibodyTraits;
  26. }
  27. bool CanSelectCardCondition1(CardSource cardSource)
  28. {
  29. if (cardSource.CardNames.Contains("Yuji Musya"))
  30. {
  31. return true;
  32. }
  33. if (cardSource.CardNames.Contains("YujiMusya"))
  34. {
  35. return true;
  36. }
  37. return false;
  38. }
  39. bool CanUseCondition(Hashtable hashtable)
  40. {
  41. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  42. }
  43. bool CanActivateCondition(Hashtable hashtable)
  44. {
  45. if (CardEffectCommons.IsExistOnBattleArea(card))
  46. {
  47. if (card.Owner.LibraryCards.Count >= 1)
  48. {
  49. return true;
  50. }
  51. }
  52. return false;
  53. }
  54. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  55. {
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  57. revealCount: 3,
  58. simplifiedSelectCardConditions:
  59. new SimplifiedSelectCardConditionClass[]
  60. {
  61. new SimplifiedSelectCardConditionClass(
  62. canTargetCondition:CanSelectCardCondition,
  63. message: "Select 1 card with [X-Antibody] in its traits.",
  64. mode: SelectCardEffect.Mode.AddHand,
  65. maxCount: 1,
  66. selectCardCoroutine: null),
  67. new SimplifiedSelectCardConditionClass(
  68. canTargetCondition:CanSelectCardCondition1,
  69. message:"Select 1 [Yuji Musya].",
  70. mode: SelectCardEffect.Mode.AddHand,
  71. maxCount: 1,
  72. selectCardCoroutine: null),
  73. },
  74. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  75. activateClass: activateClass,
  76. mutualConditions: true
  77. ));
  78. }
  79. }
  80. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  81. {
  82. bool CanSelectPermanentCondition(Permanent permanent)
  83. {
  84. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  85. {
  86. if (permanent != card.PermanentOfThisCard())
  87. {
  88. if (permanent.TopCard.CardColors.Contains(CardColor.Black))
  89. {
  90. if (permanent.willBeRemoveField)
  91. {
  92. return true;
  93. }
  94. }
  95. }
  96. }
  97. return false;
  98. }
  99. string EffectDiscription()
  100. {
  101. return "<Decoy (Black)> (When one of your other black Digimon would be deleted by an opponent's effect, you may delete this Digimon to prevent that deletion.)";
  102. }
  103. bool Condition()
  104. {
  105. if (CardEffectCommons.IsExistOnBattleArea(card))
  106. {
  107. if (card.PermanentOfThisCard().TopCard.HasXAntibodyTraits)
  108. {
  109. return true;
  110. }
  111. }
  112. return false;
  113. }
  114. cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: true, card: card, condition: Condition, permanentCondition: CanSelectPermanentCondition, effectName: "Decoy (Black)", effectDiscription: EffectDiscription()));
  115. }
  116. return cardEffects;
  117. }
  118. }