Tyrannomon_EX8_011.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX8
  4. {
  5. public class Tyrannomon_EX8_011 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Digivolution Condition
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. if (targetPermanent.TopCard.ContainsTraits("Reptile"))
  16. {
  17. if (targetPermanent.TopCard.HasLevel)
  18. {
  19. if (targetPermanent.Level == 3)
  20. {
  21. return true;
  22. }
  23. }
  24. }
  25. return false;
  26. }
  27. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null));
  28. }
  29. #endregion
  30. #region Security
  31. if (timing == EffectTiming.SecuritySkill)
  32. {
  33. cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card));
  34. }
  35. #endregion
  36. #region Start of Your Main Phase
  37. if (timing == EffectTiming.OnStartMainPhase)
  38. {
  39. ActivateClass activateClass = new ActivateClass();
  40. activateClass.SetUpICardEffect("DP +3000", CanUseCondition, card);
  41. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  42. cardEffects.Add(activateClass);
  43. string EffectDiscription()
  44. {
  45. return "[Start of Your Main Phase] This Digimon gets +3000 DP until the end of your opponent's turn.";
  46. }
  47. bool CanUseCondition(Hashtable hashtable)
  48. {
  49. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  50. {
  51. if (CardEffectCommons.IsOwnerTurn(card))
  52. {
  53. return true;
  54. }
  55. }
  56. return false;
  57. }
  58. bool CanActivateCondition(Hashtable hashtable)
  59. {
  60. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  61. {
  62. return true;
  63. }
  64. return false;
  65. }
  66. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  67. {
  68. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  69. targetPermanent: card.PermanentOfThisCard(),
  70. changeValue: 3000,
  71. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  72. activateClass: activateClass));
  73. }
  74. }
  75. #endregion
  76. #region When Digivolving
  77. if (timing == EffectTiming.OnEnterFieldAnyone)
  78. {
  79. ActivateClass activateClass = new ActivateClass();
  80. activateClass.SetUpICardEffect("DP +3000", CanUseCondition, card);
  81. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  82. cardEffects.Add(activateClass);
  83. string EffectDiscription()
  84. {
  85. return "[When Digivolving] This Digimon gets +3000 DP until the end of your opponent's turn.";
  86. }
  87. bool CanUseCondition(Hashtable hashtable)
  88. {
  89. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  90. {
  91. if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
  92. {
  93. return true;
  94. }
  95. }
  96. return false;
  97. }
  98. bool CanActivateCondition(Hashtable hashtable)
  99. {
  100. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  101. {
  102. return true;
  103. }
  104. return false;
  105. }
  106. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  107. {
  108. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  109. targetPermanent: card.PermanentOfThisCard(),
  110. changeValue: 3000,
  111. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  112. activateClass: activateClass));
  113. }
  114. }
  115. #endregion
  116. #region Inherit
  117. if (timing == EffectTiming.None)
  118. {
  119. bool Condition()
  120. {
  121. if (CardEffectCommons.IsOwnerTurn(card))
  122. {
  123. return true;
  124. }
  125. return false;
  126. }
  127. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  128. changeValue: 2000,
  129. isInheritedEffect: true,
  130. card: card,
  131. condition: Condition));
  132. }
  133. #endregion
  134. return cardEffects;
  135. }
  136. }
  137. }