EX10_010.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. using System.Linq;
  5. //Wargreymon ACE
  6. namespace DCGO.CardEffects.EX10
  7. {
  8. public class EX10_010 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. #region Blast Digivolve
  14. if (timing == EffectTiming.OnCounterTiming)
  15. {
  16. cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
  17. }
  18. #endregion
  19. #region Static Effects
  20. //Raid
  21. if (timing == EffectTiming.OnAllyAttack)
  22. {
  23. cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
  24. }
  25. //Reboot/Blocker
  26. if (timing == EffectTiming.None)
  27. {
  28. cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  29. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  30. }
  31. #endregion
  32. #region On Play/When Digivolving Shared
  33. string EffectDescription(string tag)
  34. {
  35. return $"[{tag}] Delete 1 of your opponent's play cost 7 or lower Digimon or Tamers.";
  36. }
  37. bool CanSelectPermanentCondition(Permanent permanent)
  38. {
  39. return (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) || CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaTamer(permanent, card))
  40. && permanent.TopCard.HasPlayCost && permanent.TopCard.GetCostItself <= 7;
  41. }
  42. bool CanActivateSharedCondition(Hashtable hashtable)
  43. {
  44. return CardEffectCommons.IsExistOnBattleArea(card) &&
  45. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
  46. }
  47. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  48. {
  49. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  50. {
  51. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  52. selectPermanentEffect.SetUp(
  53. selectPlayer: card.Owner,
  54. canTargetCondition: CanSelectPermanentCondition,
  55. canTargetCondition_ByPreSelecetedList: null,
  56. canEndSelectCondition: null,
  57. maxCount: 1,
  58. canNoSelect: false,
  59. canEndNotMax: false,
  60. selectPermanentCoroutine: null,
  61. afterSelectPermanentCoroutine: null,
  62. mode: SelectPermanentEffect.Mode.Destroy,
  63. cardEffect: activateClass);
  64. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  65. }
  66. }
  67. #endregion
  68. #region On Play
  69. if (timing == EffectTiming.OnEnterFieldAnyone)
  70. {
  71. ActivateClass activateClass = new ActivateClass();
  72. activateClass.SetUpICardEffect("Delete 1 Digimon/Tamer", CanUseCondition, card);
  73. activateClass.SetUpActivateClass(CanActivateSharedCondition, (hashTable) => SharedActivateCoroutine(hashTable, activateClass), -1, false, EffectDescription("On Play"));
  74. cardEffects.Add(activateClass);
  75. bool CanUseCondition(Hashtable hashtable)
  76. {
  77. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  78. }
  79. }
  80. #endregion
  81. #region When Digivolving
  82. if (timing == EffectTiming.OnEnterFieldAnyone)
  83. {
  84. ActivateClass activateClass = new ActivateClass();
  85. activateClass.SetUpICardEffect("Delete 1 Digimon/Tamer", CanUseCondition, card);
  86. activateClass.SetUpActivateClass(CanActivateSharedCondition, (hashTable) => SharedActivateCoroutine(hashTable, activateClass), -1, false, EffectDescription("When Digivolving"));
  87. cardEffects.Add(activateClass);
  88. bool CanUseCondition(Hashtable hashtable)
  89. {
  90. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  91. CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  92. }
  93. }
  94. #endregion
  95. #region All Turns
  96. if (timing == EffectTiming.None)
  97. {
  98. CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
  99. canNotAffectedClass.SetUpICardEffect("Isn't affected by opponent's Digimon's effects", CanUseCondition, card);
  100. canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardCondition, SkillCondition: SkillCondition);
  101. cardEffects.Add(canNotAffectedClass);
  102. bool CanUseCondition(Hashtable hashtable)
  103. {
  104. return CanUse();
  105. }
  106. bool CanUse()
  107. {
  108. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  109. CardEffectCommons.HasMatchConditionPermanent(OpponentsPermanent);
  110. }
  111. bool PermanentCondition(Permanent permanent)
  112. {
  113. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  114. {
  115. return true;
  116. }
  117. return false;
  118. }
  119. bool CardCondition(CardSource cardSource)
  120. {
  121. if (cardSource == card)
  122. {
  123. if (CardEffectCommons.IsExistOnBattleArea(card))
  124. {
  125. if (cardSource == card.PermanentOfThisCard().TopCard)
  126. {
  127. return true;
  128. }
  129. }
  130. }
  131. return false;
  132. }
  133. bool SkillCondition(ICardEffect cardEffect)
  134. {
  135. if (CardEffectCommons.IsOpponentEffect(cardEffect, card))
  136. {
  137. if (cardEffect.IsDigimonEffect)
  138. {
  139. return true;
  140. }
  141. }
  142. return false;
  143. }
  144. bool OpponentsPermanent(Permanent permanent)
  145. {
  146. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  147. permanent.GetDP(card.PermanentOfThisCard()) >= 13000;
  148. }
  149. cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
  150. permanentCondition: PermanentCondition,
  151. changeValue: 3000,
  152. isInheritedEffect: false,
  153. card: card,
  154. condition: CanUse,
  155. effectName: () => "This Digimon gain DP +3000"));
  156. }
  157. #endregion
  158. return cardEffects;
  159. }
  160. }
  161. }