BT18_077.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT18
  4. {
  5. public class BT18_077 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Alternate Digivolution
  11. // Any purple or yellow tamer
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.IsTamer && (targetPermanent.TopCard.CardColors.Contains(CardColor.Purple) ||
  17. targetPermanent.TopCard.CardColors.Contains(CardColor.Yellow));
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  20. permanentCondition: PermanentCondition, digivolutionCost: 4, ignoreDigivolutionRequirement: false,
  21. card: card, condition: null));
  22. }
  23. // Koichi Kimura
  24. if (timing == EffectTiming.None)
  25. {
  26. bool PermanentCondition(Permanent targetPermanent)
  27. {
  28. return targetPermanent.TopCard.EqualsCardName("Koichi Kimura");
  29. }
  30. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  31. permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false,
  32. card: card, condition: null));
  33. }
  34. // Loweemon
  35. if (timing == EffectTiming.None)
  36. {
  37. bool PermanentCondition(Permanent targetPermanent)
  38. {
  39. return targetPermanent.TopCard.EqualsCardName("Loweemon");
  40. }
  41. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  42. permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false,
  43. card: card, condition: null));
  44. }
  45. #endregion
  46. #region Retaliation
  47. if (timing == EffectTiming.OnDestroyedAnyone)
  48. {
  49. cardEffects.Add(CardEffectFactory.RetaliationSelfEffect(isInheritedEffect: false, card: card, condition: null));
  50. }
  51. #endregion
  52. #region On Play/ When Digivolving Shared
  53. bool CanSelectPermanentConditionShared(Permanent permanent)
  54. {
  55. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  56. permanent.IsDigimon &&
  57. permanent.TopCard.HasLevel &&
  58. permanent.Level <= 4;
  59. }
  60. bool CanActivateConditionShared(Hashtable hashtable)
  61. {
  62. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  63. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared);
  64. }
  65. #endregion
  66. #region On Play
  67. if (timing == EffectTiming.OnEnterFieldAnyone)
  68. {
  69. ActivateClass activateClass = new ActivateClass();
  70. activateClass.SetUpICardEffect("Delete 1 of your opponent's level 4 or lower Digimon",
  71. CanUseCondition, card);
  72. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  73. cardEffects.Add(activateClass);
  74. string EffectDescription()
  75. {
  76. return
  77. "[On Play] Delete 1 of your opponent's level 4 or lower Digimon.";
  78. }
  79. bool CanUseCondition(Hashtable hashtable)
  80. {
  81. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  82. }
  83. IEnumerator ActivateCoroutine(Hashtable hashtable)
  84. {
  85. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  86. selectPermanentEffect.SetUp(
  87. selectPlayer: card.Owner,
  88. canTargetCondition: CanSelectPermanentConditionShared,
  89. canTargetCondition_ByPreSelecetedList: null,
  90. canEndSelectCondition: null,
  91. maxCount: 1,
  92. canNoSelect: false,
  93. canEndNotMax: false,
  94. selectPermanentCoroutine: null,
  95. afterSelectPermanentCoroutine: null,
  96. mode: SelectPermanentEffect.Mode.Destroy,
  97. cardEffect: activateClass);
  98. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
  99. "The opponent is selecting 1 Digimon to delete.");
  100. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  101. }
  102. }
  103. #endregion
  104. #region When Digivolving
  105. if (timing == EffectTiming.OnEnterFieldAnyone)
  106. {
  107. ActivateClass activateClass = new ActivateClass();
  108. activateClass.SetUpICardEffect("Delete 1 of your opponent's level 4 or lower Digimon",
  109. CanUseCondition, card);
  110. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  111. cardEffects.Add(activateClass);
  112. string EffectDescription()
  113. {
  114. return
  115. "[When Digivolving] Delete 1 of your opponent's level 4 or lower Digimon.";
  116. }
  117. bool CanUseCondition(Hashtable hashtable)
  118. {
  119. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  120. }
  121. IEnumerator ActivateCoroutine(Hashtable hashtable)
  122. {
  123. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  124. selectPermanentEffect.SetUp(
  125. selectPlayer: card.Owner,
  126. canTargetCondition: CanSelectPermanentConditionShared,
  127. canTargetCondition_ByPreSelecetedList: null,
  128. canEndSelectCondition: null,
  129. maxCount: 1,
  130. canNoSelect: false,
  131. canEndNotMax: false,
  132. selectPermanentCoroutine: null,
  133. afterSelectPermanentCoroutine: null,
  134. mode: SelectPermanentEffect.Mode.Destroy,
  135. cardEffect: activateClass);
  136. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
  137. "The opponent is selecting 1 Digimon to delete.");
  138. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  139. }
  140. }
  141. #endregion
  142. #region Retaliation - ESS
  143. if (timing == EffectTiming.OnDestroyedAnyone)
  144. {
  145. cardEffects.Add(CardEffectFactory.RetaliationSelfEffect(isInheritedEffect: true, card: card, condition: null));
  146. }
  147. #endregion
  148. return cardEffects;
  149. }
  150. }
  151. }