BT19_062.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT19
  4. {
  5. public class BT19_062 : 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 Requirement
  11. if (timing == EffectTiming.None)
  12. {
  13. static bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.EqualsCardName("Strikedramon");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
  18. }
  19. #endregion
  20. #region Rush
  21. if(timing == EffectTiming.None)
  22. {
  23. cardEffects.Add(CardEffectFactory.RushSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  24. }
  25. #endregion
  26. #region Collision
  27. if (timing == EffectTiming.OnCounterTiming)
  28. {
  29. cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false, card, null));
  30. }
  31. #endregion
  32. #region When Attacking
  33. if (timing == EffectTiming.OnAllyAttack)
  34. {
  35. ActivateClass activateClass = new ActivateClass();
  36. activateClass.SetUpICardEffect("Trash 1 Option card in your battle area", CanUseCondition, card);
  37. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  38. cardEffects.Add(activateClass);
  39. string EffectDescription()
  40. {
  41. return "[When Attacking] Trash 1 Option card in your battle area.";
  42. }
  43. bool CanUseCondition(Hashtable hashtable)
  44. {
  45. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  46. }
  47. bool CanSelectOptionCondition(Permanent permanent)
  48. {
  49. return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
  50. permanent.IsOption;
  51. }
  52. bool CanActivateCondition(Hashtable hashtable)
  53. {
  54. return CardEffectCommons.IsExistOnBattleArea(card) &&
  55. CardEffectCommons.HasMatchConditionPermanent(CanSelectOptionCondition);
  56. }
  57. IEnumerator ActivateCoroutine(Hashtable hashtable)
  58. {
  59. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  60. selectPermanentEffect.SetUp(
  61. selectPlayer: card.Owner,
  62. canTargetCondition: CanSelectOptionCondition,
  63. canTargetCondition_ByPreSelecetedList: null,
  64. canEndSelectCondition: null,
  65. maxCount: 1,
  66. canNoSelect: false,
  67. canEndNotMax: false,
  68. selectPermanentCoroutine: null,
  69. afterSelectPermanentCoroutine: null,
  70. mode: SelectPermanentEffect.Mode.Destroy,
  71. cardEffect: activateClass);
  72. selectPermanentEffect.SetUpCustomMessage("Select 1 Option to trash.",
  73. "The opponent is selecting 1 Option to trash.");
  74. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  75. }
  76. }
  77. #endregion
  78. #region End of Your Turn
  79. if (timing == EffectTiming.OnEndTurn)
  80. {
  81. ActivateClass activateClass = new ActivateClass();
  82. activateClass.SetUpICardEffect("This Digimon may attack a player", CanUseCondition, card);
  83. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  84. cardEffects.Add(activateClass);
  85. string EffectDescription()
  86. {
  87. return "[End of Your Turn] If your opponent has an unsuspended Digimon, this Digimon attacks the player.";
  88. }
  89. bool CanUseCondition(Hashtable hashtable)
  90. {
  91. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  92. {
  93. if (CardEffectCommons.IsOwnerTurn(card))
  94. {
  95. return true;
  96. }
  97. }
  98. return false;
  99. }
  100. bool CanActivateCondition(Hashtable hashtable)
  101. {
  102. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  103. CardEffectCommons.HasMatchConditionOpponentsPermanent(card, permanent => permanent.IsDigimon && !permanent.IsSuspended) &&
  104. card.PermanentOfThisCard().CanAttack(activateClass);
  105. }
  106. IEnumerator ActivateCoroutine(Hashtable hashtable)
  107. {
  108. SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
  109. selectAttackEffect.SetUp(
  110. attacker: card.PermanentOfThisCard(),
  111. canAttackPlayerCondition: () => true,
  112. defenderCondition: (permanent) => false,
  113. cardEffect: activateClass);
  114. selectAttackEffect.SetCanNotSelectNotAttack();
  115. yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
  116. }
  117. }
  118. #endregion
  119. #region Collision - ESS
  120. if (timing == EffectTiming.OnCounterTiming)
  121. {
  122. cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(
  123. isInheritedEffect: true,
  124. card: card,
  125. condition: null));
  126. }
  127. #endregion
  128. return cardEffects;
  129. }
  130. }
  131. }