BT13_095.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT13
  5. {
  6. public class BT13_095 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.OnStartTurn)
  12. {
  13. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  14. }
  15. if (timing == EffectTiming.OnEnterFieldAnyone)
  16. {
  17. ActivateClass activateClass = new ActivateClass();
  18. activateClass.SetUpICardEffect("Suspend this Tamer", CanUseCondition, card);
  19. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  20. cardEffects.Add(activateClass);
  21. string EffectDiscription()
  22. {
  23. return "[On Play] You may suspend this Tamer.";
  24. }
  25. bool CanUseCondition(Hashtable hashtable)
  26. {
  27. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  28. }
  29. bool CanActivateCondition(Hashtable hashtable)
  30. {
  31. if (CardEffectCommons.IsExistOnBattleArea(card))
  32. {
  33. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  34. {
  35. return true;
  36. }
  37. }
  38. return false;
  39. }
  40. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  41. {
  42. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  43. }
  44. }
  45. if (timing == EffectTiming.OnTappedAnyone)
  46. {
  47. ActivateClass activateClass = new ActivateClass();
  48. activateClass.SetUpICardEffect("DP -3000 and Memory +1", CanUseCondition, card);
  49. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  50. cardEffects.Add(activateClass);
  51. string EffectDiscription()
  52. {
  53. return "[All Turns] When this Tamer becomes suspended, 1 of your opponent's Digimon gets -3000 DP for the turn. Then, if you have a Digimon with [Agumon] or [Greymon] in its name, gain 1 memory.";
  54. }
  55. bool CanSelectPermanentCondition(Permanent permanent)
  56. {
  57. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  58. }
  59. bool CanUseCondition(Hashtable hashtable)
  60. {
  61. if (CardEffectCommons.IsExistOnBattleArea(card))
  62. {
  63. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, (permanent) => permanent == card.PermanentOfThisCard()))
  64. {
  65. return true;
  66. }
  67. }
  68. return false;
  69. }
  70. bool CanActivateCondition(Hashtable hashtable)
  71. {
  72. if (CardEffectCommons.IsExistOnBattleArea(card))
  73. {
  74. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  75. {
  76. return true;
  77. }
  78. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsDigimon && permanent.TopCard.ContainsCardName("Agumon") || permanent.TopCard.HasGreymonName))
  79. {
  80. if (card.Owner.CanAddMemory(activateClass))
  81. {
  82. return true;
  83. }
  84. }
  85. }
  86. return false;
  87. }
  88. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  89. {
  90. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  91. {
  92. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  93. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  94. selectPermanentEffect.SetUp(
  95. selectPlayer: card.Owner,
  96. canTargetCondition: CanSelectPermanentCondition,
  97. canTargetCondition_ByPreSelecetedList: null,
  98. canEndSelectCondition: null,
  99. maxCount: maxCount,
  100. canNoSelect: false,
  101. canEndNotMax: false,
  102. selectPermanentCoroutine: SelectPermanentCoroutine,
  103. afterSelectPermanentCoroutine: null,
  104. mode: SelectPermanentEffect.Mode.Custom,
  105. cardEffect: activateClass);
  106. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -3000.", "The opponent is selecting 1 Digimon that will get DP -3000.");
  107. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  108. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  109. {
  110. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -3000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  111. }
  112. }
  113. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsDigimon && permanent.TopCard.ContainsCardName("Agumon") || permanent.TopCard.HasGreymonName))
  114. {
  115. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  116. }
  117. }
  118. }
  119. if (timing == EffectTiming.SecuritySkill)
  120. {
  121. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  122. }
  123. return cardEffects;
  124. }
  125. }
  126. }