EX6_004.cs 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.EX6
  5. {
  6. public class EX6_004 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Inherit
  12. if (timing == EffectTiming.OnTappedAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("DP +2000", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  17. activateClass.SetIsInheritedEffect(true);
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Your Turn][Once Per Turn] When an effect suspends one of your Digimon, 1 of your Digimon gets +2000 DP for the turn.";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. if (CardEffectCommons.IsExistOnBattleArea(card))
  30. {
  31. if (CardEffectCommons.IsOwnerTurn(card))
  32. {
  33. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  34. {
  35. if (CardEffectCommons.IsByEffect(hashtable, null))
  36. {
  37. return true;
  38. }
  39. }
  40. }
  41. }
  42. return false;
  43. }
  44. bool CanActivateCondition(Hashtable hashtable)
  45. {
  46. if (CardEffectCommons.IsExistOnBattleArea(card))
  47. {
  48. return true;
  49. }
  50. return false;
  51. }
  52. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  53. {
  54. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentCondition));
  55. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  56. selectPermanentEffect.SetUp(
  57. selectPlayer: card.Owner,
  58. canTargetCondition: PermanentCondition,
  59. canTargetCondition_ByPreSelecetedList: null,
  60. canEndSelectCondition: null,
  61. maxCount: maxCount,
  62. canNoSelect: false,
  63. canEndNotMax: false,
  64. selectPermanentCoroutine: SelectPermanentCoroutine,
  65. afterSelectPermanentCoroutine: null,
  66. mode: SelectPermanentEffect.Mode.Custom,
  67. cardEffect: activateClass);
  68. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP +2000.", "The opponent is selecting 1 Digimon that will get DP +2000.");
  69. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  70. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  71. {
  72. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 2000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  73. }
  74. }
  75. }
  76. #endregion
  77. return cardEffects;
  78. }
  79. }
  80. }