EX11_062.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System;
  5. namespace DCGO.CardEffects.EX11
  6. {
  7. // Shoto Kazama
  8. public class EX11_062 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. #region Start of turn set to 3
  14. if (timing == EffectTiming.OnStartTurn)
  15. {
  16. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  17. }
  18. #endregion
  19. #region All Turns
  20. if (timing == EffectTiming.OnTappedAnyone)
  21. {
  22. ActivateClass activateClass = new ActivateClass();
  23. activateClass.SetUpICardEffect("Suspend. If effects suspended those digimon, Draw 1. 1 digimon gains +3k DP", CanUseCondition, card);
  24. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  25. cardEffects.Add(activateClass);
  26. string EffectDiscription()
  27. => "[All Turns] When any Digimon suspend, by suspending this Tamer, if effects suspended those Digimon, <Draw 1>. After, 1 of your digimon with [Avian] or [Bird] in any of its traits or the [Vortex Warriors] trait gets +3000 DP until your opponent's turn ends.";
  28. bool PermanentCondition(Permanent permanent)
  29. {
  30. return permanent.IsDigimon;
  31. }
  32. bool CanUseCondition(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.IsExistOnBattleArea(card)
  35. && CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition);
  36. }
  37. bool CanActivateCondition(Hashtable hashtable)
  38. {
  39. return CardEffectCommons.IsExistOnBattleArea(card)
  40. && CardEffectCommons.CanActivateSuspendCostEffect(card);
  41. }
  42. bool CanSelectPermanentCondition(Permanent permanent)
  43. {
  44. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  45. && (permanent.TopCard.ContainsTraits("Avian")
  46. || permanent.TopCard.ContainsTraits("Bird")
  47. || permanent.TopCard.EqualsTraits("Vortex Warriors"));
  48. }
  49. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  50. {
  51. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  52. if (CardEffectCommons.IsByEffect(_hashtable, null))
  53. {
  54. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  55. }
  56. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  57. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  58. selectPermanentEffect.SetUp(
  59. selectPlayer: card.Owner,
  60. canTargetCondition: CanSelectPermanentCondition,
  61. canTargetCondition_ByPreSelecetedList: null,
  62. canEndSelectCondition: null,
  63. maxCount: maxCount,
  64. canNoSelect: false,
  65. canEndNotMax: false,
  66. selectPermanentCoroutine: SelectPermanentCoroutine,
  67. afterSelectPermanentCoroutine: null,
  68. mode: SelectPermanentEffect.Mode.Custom,
  69. cardEffect: activateClass);
  70. selectPermanentEffect.SetUpCustomMessage(
  71. "Select 1 Digimon that will gain 3k DP.",
  72. "The opponent is selecting 1 Digimon that will gain 3k DP.");
  73. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  74. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  75. {
  76. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  77. targetPermanent: permanent,
  78. changeValue: 3000,
  79. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  80. activateClass: activateClass));
  81. }
  82. }
  83. }
  84. #endregion
  85. #region Your Turn
  86. if (timing == EffectTiming.None)
  87. {
  88. bool AttackerCondition(Permanent permanent)
  89. {
  90. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  91. }
  92. bool Condition()
  93. {
  94. return CardEffectCommons.IsExistOnBattleArea(card)
  95. && CardEffectCommons.IsOwnerTurn(card)
  96. && !card.Owner.Enemy.GetBattleAreaDigimons().Any(permanent => !permanent.IsSuspended);
  97. }
  98. string effectName = "While your opponent has no unsuspended digimon, your <Vortex> can also attack players.";
  99. cardEffects.Add(CardEffectFactory.VortexCanAttackPlayersStaticEffect(
  100. attackerCondition: AttackerCondition,
  101. isInheritedEffect: false,
  102. card: card,
  103. condition: Condition,
  104. effectName: effectName
  105. ));
  106. }
  107. #endregion
  108. #region Security
  109. if (timing == EffectTiming.SecuritySkill)
  110. {
  111. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  112. }
  113. #endregion
  114. return cardEffects;
  115. }
  116. }
  117. }