BT22_085.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Rina Shinomiya
  5. namespace DCGO.CardEffects.BT22
  6. {
  7. public class BT22_085 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region 3 Memory Setter
  13. if (timing == EffectTiming.OnStartTurn)
  14. {
  15. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  16. }
  17. #endregion
  18. #region On Play
  19. if (timing == EffectTiming.OnEnterFieldAnyone)
  20. {
  21. ActivateClass activateClass = new ActivateClass();
  22. activateClass.SetUpICardEffect("1 digimon with [Veedramon] in name gains +3k DP ", CanUseCondition, card);
  23. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  24. cardEffects.Add(activateClass);
  25. string EffectDiscription()
  26. {
  27. return "[On Play] 1 of your Digimon with [Veedramon] in its name gets +3000 DP until your opponent's turn ends.";
  28. }
  29. bool CanUseCondition(Hashtable hashtable)
  30. {
  31. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  32. }
  33. bool CanActivateCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnBattleArea(card)
  36. && CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsVeedramonInName);
  37. }
  38. bool IsVeedramonInName(Permanent permanent)
  39. {
  40. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  41. && permanent.TopCard.ContainsCardName("Veedramon");
  42. }
  43. IEnumerator ActivateCoroutine(Hashtable hashtable)
  44. {
  45. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsVeedramonInName))
  46. {
  47. Permanent selectedPermanent = null;
  48. #region Select Permanent
  49. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersPermanentCount(card, IsVeedramonInName));
  50. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  51. selectPermanentEffect.SetUp(
  52. selectPlayer: card.Owner,
  53. canTargetCondition: IsVeedramonInName,
  54. canTargetCondition_ByPreSelecetedList: null,
  55. canEndSelectCondition: null,
  56. maxCount: maxCount,
  57. canNoSelect: false,
  58. canEndNotMax: false,
  59. selectPermanentCoroutine: SelectPermanentCoroutine,
  60. afterSelectPermanentCoroutine: null,
  61. mode: SelectPermanentEffect.Mode.Custom,
  62. cardEffect: activateClass);
  63. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  64. {
  65. selectedPermanent = permanent;
  66. yield return null;
  67. }
  68. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to gain +3K DP.", "The opponent is selecting 1 Digimon to gain +3K DP.");
  69. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  70. #endregion
  71. if (selectedPermanent != null)
  72. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: selectedPermanent, changeValue: 3000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  73. }
  74. }
  75. }
  76. #endregion
  77. #region Your Turn
  78. if (timing == EffectTiming.OnAllyAttack)
  79. {
  80. Permanent attackingVeedraInName = null;
  81. ActivateClass activateClass = new ActivateClass();
  82. activateClass.SetUpICardEffect("Bounce this tamer to hand, give attacking digimon <Jamming>", CanUseCondition, card);
  83. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  84. cardEffects.Add(activateClass);
  85. string EffectDiscription()
  86. {
  87. return "[Your Turn] When one of your Digimon with [Veedramon] in its name attacks, by returning this Tamer to the hand, that Digimon gains <Jamming> for the turn. (This Digimon can't be deleted in battles against Security Digimon.)";
  88. }
  89. bool CanUseCondition(Hashtable hashtable)
  90. {
  91. return CardEffectCommons.IsExistOnBattleArea(card) &&
  92. CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentAttackCondition);
  93. }
  94. bool CanActivateCondition(Hashtable hashtable)
  95. {
  96. return CardEffectCommons.IsExistOnBattleArea(card) &&
  97. CardEffectCommons.IsOwnerTurn(card);
  98. }
  99. bool PermanentAttackCondition(Permanent permanent)
  100. {
  101. if (IsVeedramonInName(permanent))
  102. {
  103. attackingVeedraInName = permanent;
  104. return true;
  105. }
  106. return false;
  107. }
  108. bool IsVeedramonInName(Permanent permanent)
  109. {
  110. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  111. && permanent.TopCard.ContainsCardName("Veedramon");
  112. }
  113. IEnumerator ActivateCoroutine(Hashtable hashtable)
  114. {
  115. Permanent bounceTargetPermanent = card.PermanentOfThisCard();
  116. if (bounceTargetPermanent != null)
  117. {
  118. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BouncePeremanentAndProcessAccordingToResult(
  119. targetPermanents: new List<Permanent>() { bounceTargetPermanent },
  120. activateClass: activateClass,
  121. successProcess: SuccessProcess(),
  122. failureProcess: null));
  123. IEnumerator SuccessProcess()
  124. {
  125. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainJamming(attackingVeedraInName, EffectDuration.UntilEachTurnEnd, activateClass));
  126. }
  127. }
  128. }
  129. }
  130. #endregion
  131. #region Security
  132. if (timing == EffectTiming.SecuritySkill)
  133. {
  134. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  135. }
  136. #endregion
  137. return cardEffects;
  138. }
  139. }
  140. }