ExVeemon_BT16_018.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT16
  4. {
  5. public class ExVeemon_BT16_018 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. var cardEffects = new List<ICardEffect>();
  10. switch (timing)
  11. {
  12. case EffectTiming.None:
  13. #region Alternate Digivolution Requirement
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.CardNames.Contains("Veemon");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  19. permanentCondition: PermanentCondition,
  20. digivolutionCost: 2,
  21. ignoreDigivolutionRequirement: false,
  22. card: card,
  23. condition: null)
  24. );
  25. #endregion
  26. #region Inherited Effect
  27. bool InheritedEffectCondition()
  28. {
  29. return CardEffectCommons.IsOwnerTurn(card);
  30. }
  31. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  32. changeValue: 2000,
  33. isInheritedEffect: true,
  34. card: card,
  35. condition: InheritedEffectCondition));
  36. #endregion
  37. break;
  38. case EffectTiming.OnAllyAttack:
  39. cardEffects.Add(CardEffectFactory.RaidSelfEffect(
  40. isInheritedEffect: false,
  41. card: card,
  42. condition: null)
  43. );
  44. break;
  45. case EffectTiming.OnEnterFieldAnyone:
  46. var activatePlayClass = new ActivateClass();
  47. activatePlayClass.SetUpICardEffect("Select 1 of your Digimon to gain battle protection", CanUsePlayCondition, card);
  48. activatePlayClass.SetUpActivateClass(CanActivateCondition, ActivatePlayCoroutine, -1, true, EffectDiscription());
  49. cardEffects.Add(activatePlayClass);
  50. var activateDigivolveClass = new ActivateClass();
  51. activateDigivolveClass.SetUpICardEffect("Select 1 of your Digimon to gain battle protection", CanUseDigivolveCondition, card);
  52. activateDigivolveClass.SetUpActivateClass(CanActivateCondition, ActivateDigivolveCoroutine, -1, true, EffectDiscription());
  53. cardEffects.Add(activateDigivolveClass);
  54. string EffectDiscription()
  55. {
  56. return "[On Play] [When Digivolving] 1 of your Digimon can't be deleted in battle until the end of your opponent's turn.";
  57. }
  58. bool CanUsePlayCondition(Hashtable hashtable)
  59. {
  60. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  61. }
  62. bool CanUseDigivolveCondition(Hashtable hashtable)
  63. {
  64. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  65. }
  66. bool CanActivateCondition(Hashtable hashtable)
  67. {
  68. return CardEffectCommons.IsExistOnBattleArea(card);
  69. }
  70. bool CanSelectPermanentCondition(Permanent permanent)
  71. {
  72. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  73. }
  74. IEnumerator ActivatePlayCoroutine(Hashtable hashtable)
  75. {
  76. var selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  77. selectPermanentEffect.SetUp(
  78. selectPlayer: card.Owner,
  79. canTargetCondition: CanSelectPermanentCondition,
  80. canTargetCondition_ByPreSelecetedList: null,
  81. canEndSelectCondition: null,
  82. maxCount: 1,
  83. canNoSelect: false,
  84. canEndNotMax: false,
  85. selectPermanentCoroutine: SelectPermanentCoroutine,
  86. afterSelectPermanentCoroutine: null,
  87. mode: SelectPermanentEffect.Mode.Custom,
  88. cardEffect: activatePlayClass);
  89. selectPermanentEffect.SetUpCustomMessage(
  90. "Select 1 Digimon that will get effects.",
  91. "The opponent is selecting 1 Digimon that will get effects.");
  92. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  93. yield break;
  94. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  95. {
  96. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBeDeletedByBattle(
  97. targetPermanent: permanent,
  98. canNotBeDestroyedByBattleCondition: CanNotBeDestroyedByBattleCondition,
  99. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  100. activateClass: activatePlayClass,
  101. effectName: "Can't be deleted in battle"));
  102. yield break;
  103. bool CanNotBeDestroyedByBattleCondition(Permanent permanent1, Permanent attackingPermanent, Permanent defendingPermanent, CardSource defendingCard)
  104. {
  105. return permanent1 == attackingPermanent || permanent1 == defendingPermanent;
  106. }
  107. }
  108. }
  109. IEnumerator ActivateDigivolveCoroutine(Hashtable hashtable)
  110. {
  111. var selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  112. selectPermanentEffect.SetUp(
  113. selectPlayer: card.Owner,
  114. canTargetCondition: CanSelectPermanentCondition,
  115. canTargetCondition_ByPreSelecetedList: null,
  116. canEndSelectCondition: null,
  117. maxCount: 1,
  118. canNoSelect: false,
  119. canEndNotMax: false,
  120. selectPermanentCoroutine: SelectPermanentCoroutine,
  121. afterSelectPermanentCoroutine: null,
  122. mode: SelectPermanentEffect.Mode.Custom,
  123. cardEffect: activateDigivolveClass);
  124. selectPermanentEffect.SetUpCustomMessage(
  125. "Select 1 Digimon that will get effects.",
  126. "The opponent is selecting 1 Digimon that will get effects.");
  127. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  128. yield break;
  129. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  130. {
  131. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBeDeletedByBattle(
  132. targetPermanent: permanent,
  133. canNotBeDestroyedByBattleCondition: CanNotBeDestroyedByBattleCondition,
  134. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  135. activateClass: activateDigivolveClass,
  136. effectName: "Can't be deleted in battle"));
  137. yield break;
  138. bool CanNotBeDestroyedByBattleCondition(Permanent permanent1, Permanent attackingPermanent, Permanent defendingPermanent, CardSource defendingCard)
  139. {
  140. return permanent == attackingPermanent || permanent == defendingPermanent;
  141. }
  142. }
  143. }
  144. break;
  145. }
  146. return cardEffects;
  147. }
  148. }
  149. }