BT21_037.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT21
  4. {
  5. public class BT21_037 : 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. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.EqualsCardName("Veemon");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  18. permanentCondition: PermanentCondition,
  19. digivolutionCost: 2,
  20. ignoreDigivolutionRequirement: false,
  21. card: card,
  22. condition: null));
  23. }
  24. #endregion
  25. #region Piercing
  26. if (timing == EffectTiming.OnDetermineDoSecurityCheck)
  27. {
  28. cardEffects.Add(CardEffectFactory.PierceSelfEffect(
  29. isInheritedEffect: false,
  30. card: card,
  31. condition: null));
  32. }
  33. #endregion
  34. #region Armor Purge
  35. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  36. {
  37. cardEffects.Add(CardEffectFactory.ArmorPurgeEffect(card: card));
  38. }
  39. #endregion
  40. #region When Digivolving
  41. if (timing == EffectTiming.OnEnterFieldAnyone)
  42. {
  43. ActivateClass activateClass = new ActivateClass();
  44. activateClass.SetUpICardEffect("Suspend 1 of your opponent's Digimon and get DP +2000", CanUseCondition, card);
  45. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  46. cardEffects.Add(activateClass);
  47. string EffectDescription()
  48. {
  49. return
  50. "[When Digivolving] Suspend 1 of your opponent's Digimon. Then, this Digimon gets +2000 DP until your opponent's turn ends.";
  51. }
  52. bool CanUseCondition(Hashtable hashtable)
  53. {
  54. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  55. }
  56. bool CanSelectPermanentCondition(Permanent permanent)
  57. {
  58. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  59. permanent.CanSuspend;
  60. }
  61. bool CanActivateCondition(Hashtable hashtable)
  62. {
  63. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  64. }
  65. IEnumerator ActivateCoroutine(Hashtable hashtable)
  66. {
  67. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  68. {
  69. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  70. selectPermanentEffect.SetUp(
  71. selectPlayer: card.Owner,
  72. canTargetCondition: CanSelectPermanentCondition,
  73. canTargetCondition_ByPreSelecetedList: null,
  74. canEndSelectCondition: null,
  75. maxCount: 1,
  76. canNoSelect: false,
  77. canEndNotMax: false,
  78. selectPermanentCoroutine: null,
  79. afterSelectPermanentCoroutine: null,
  80. mode: SelectPermanentEffect.Mode.Tap,
  81. cardEffect: activateClass);
  82. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  83. }
  84. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  85. targetPermanent: card.PermanentOfThisCard(),
  86. changeValue: 2000,
  87. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  88. activateClass: activateClass));
  89. }
  90. }
  91. #endregion
  92. return cardEffects;
  93. }
  94. }
  95. }