BT18_064.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT18
  4. {
  5. public class BT18_064 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Alternate Digivolve Condition
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.EqualsCardName("Sephirothmon");
  16. }
  17. static bool TamerCondition(Permanent targetPermanent)
  18. {
  19. return targetPermanent.TopCard.CardColors.Contains(CardColor.Black) &&
  20. targetPermanent.IsTamer;
  21. }
  22. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  23. permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false,
  24. card: card, condition: null));
  25. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: TamerCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: true, card: card, condition: null));
  26. }
  27. #endregion
  28. #region On Play
  29. if (timing == EffectTiming.OnEnterFieldAnyone)
  30. {
  31. ActivateClass activateClass = new ActivateClass();
  32. activateClass.SetUpICardEffect("Can't be returned to the hand or deck", CanUseCondition, card);
  33. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  34. cardEffects.Add(activateClass);
  35. string EffectDiscription()
  36. {
  37. return "[On Play] Until the end of your opponent's turn, your opponent's effects can't return this Digimon to the hand or deck.";
  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. return true;
  48. }
  49. return false;
  50. }
  51. IEnumerator ActivateCoroutine(Hashtable hashtable)
  52. {
  53. bool CardEffectCondition(ICardEffect cardEffect)
  54. {
  55. return CardEffectCommons.IsOpponentEffect(cardEffect, card);
  56. }
  57. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToHand(
  58. targetPermanent: card.PermanentOfThisCard(),
  59. cardEffectCondition: CardEffectCondition,
  60. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  61. activateClass: activateClass,
  62. effectName: "Can't return to hand by opponent's effects"));
  63. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToDeck(
  64. targetPermanent: card.PermanentOfThisCard(),
  65. cardEffectCondition: CardEffectCondition,
  66. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  67. activateClass: activateClass,
  68. effectName: "Can't return to deck by opponent's effects"));
  69. }
  70. }
  71. #endregion
  72. #region When Digivolving
  73. if (timing == EffectTiming.OnEnterFieldAnyone)
  74. {
  75. ActivateClass activateClass = new ActivateClass();
  76. activateClass.SetUpICardEffect("Can't be returned to the hand or deck", CanUseCondition, card);
  77. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  78. cardEffects.Add(activateClass);
  79. string EffectDiscription()
  80. {
  81. return "[When Digivolving] Until the end of your opponent's turn, your opponent's effects can't return this Digimon to the hand or deck.";
  82. }
  83. bool CanUseCondition(Hashtable hashtable)
  84. {
  85. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  86. }
  87. bool CanActivateCondition(Hashtable hashtable)
  88. {
  89. if (CardEffectCommons.IsExistOnBattleArea(card))
  90. {
  91. return true;
  92. }
  93. return false;
  94. }
  95. IEnumerator ActivateCoroutine(Hashtable hashtable)
  96. {
  97. bool CardEffectCondition(ICardEffect cardEffect)
  98. {
  99. return CardEffectCommons.IsOpponentEffect(cardEffect, card);
  100. }
  101. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToHand(
  102. targetPermanent: card.PermanentOfThisCard(),
  103. cardEffectCondition: CardEffectCondition,
  104. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  105. activateClass: activateClass,
  106. effectName: "Can't return to hand by opponent's effects"));
  107. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotReturnToDeck(
  108. targetPermanent: card.PermanentOfThisCard(),
  109. cardEffectCondition: CardEffectCondition,
  110. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  111. activateClass: activateClass,
  112. effectName: "Can't return to deck by opponent's effects"));
  113. }
  114. }
  115. #endregion
  116. #region ESS - Opponent's Turn
  117. if (timing == EffectTiming.None)
  118. {
  119. bool Condition()
  120. {
  121. if (CardEffectCommons.IsExistOnBattleArea(card))
  122. {
  123. if (CardEffectCommons.IsOpponentTurn(card))
  124. {
  125. return true;
  126. }
  127. }
  128. return false;
  129. }
  130. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
  131. }
  132. #endregion
  133. return cardEffects;
  134. }
  135. }
  136. }