ST12_10.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class ST12_10 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.OnEnterFieldAnyone)
  14. {
  15. cardEffects.Add(CardEffectFactory.BlitzSelfEffect(isInheritedEffect: false, card: card, condition: null, isWhenDigivolving: true));
  16. }
  17. if (timing == EffectTiming.OnAllyAttack)
  18. {
  19. ActivateClass activateClass = new ActivateClass();
  20. activateClass.SetUpICardEffect("Play 1 Digimon card with [Sistermon] in its name from hand", CanUseCondition, card);
  21. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  22. cardEffects.Add(activateClass);
  23. string EffectDiscription()
  24. {
  25. return "[When Attacking] You may play 1 Digimon card with [Sistermon] in its name from your hand without paying its memory cost.";
  26. }
  27. bool CanSelectCardCondition(CardSource cardSource)
  28. {
  29. if (cardSource.IsDigimon)
  30. {
  31. if (cardSource.ContainsCardName("Sistermon"))
  32. {
  33. if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
  34. {
  35. return true;
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. bool CanUseCondition(Hashtable hashtable)
  42. {
  43. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  44. }
  45. bool CanActivateCondition(Hashtable hashtable)
  46. {
  47. if (CardEffectCommons.IsExistOnBattleArea(card))
  48. {
  49. if (card.Owner.HandCards.Count >= 1)
  50. {
  51. return true;
  52. }
  53. }
  54. return false;
  55. }
  56. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  57. {
  58. List<CardSource> selectedCards = new List<CardSource>();
  59. int maxCount = 1;
  60. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  61. selectHandEffect.SetUp(
  62. selectPlayer: card.Owner,
  63. canTargetCondition: CanSelectCardCondition,
  64. canTargetCondition_ByPreSelecetedList: null,
  65. canEndSelectCondition: null,
  66. maxCount: maxCount,
  67. canNoSelect: true,
  68. canEndNotMax: false,
  69. isShowOpponent: true,
  70. selectCardCoroutine: SelectCardCoroutine,
  71. afterSelectCardCoroutine: null,
  72. mode: SelectHandEffect.Mode.Custom,
  73. cardEffect: activateClass);
  74. selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
  75. selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
  76. yield return StartCoroutine(selectHandEffect.Activate());
  77. IEnumerator SelectCardCoroutine(CardSource cardSource)
  78. {
  79. selectedCards.Add(cardSource);
  80. yield return null;
  81. }
  82. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
  83. }
  84. }
  85. if (timing == EffectTiming.OnEnterFieldAnyone)
  86. {
  87. ActivateClass activateClass = new ActivateClass();
  88. activateClass.SetUpICardEffect("This Digimon gains DP +3000 and Security Attack +1", CanUseCondition, card);
  89. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  90. activateClass.SetHashString("DP+3000AndSAttack+1_ST12_10");
  91. cardEffects.Add(activateClass);
  92. string EffectDiscription()
  93. {
  94. return "[Your Turn][Once Per Turn] When you play another Digimon by an effect, this Digimon gets +3000 DP and gains <Security Attack +1> for the turn. (This Digimon checks 1 additional security card.)";
  95. }
  96. bool PermanentCondition(Permanent permanent)
  97. {
  98. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  99. {
  100. if (permanent != card.PermanentOfThisCard())
  101. {
  102. return true;
  103. }
  104. }
  105. return false;
  106. }
  107. bool CanUseCondition(Hashtable hashtable)
  108. {
  109. if (CardEffectCommons.IsExistOnBattleArea(card))
  110. {
  111. if (CardEffectCommons.IsOwnerTurn(card))
  112. {
  113. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  114. {
  115. if (CardEffectCommons.IsByEffect(hashtable, null))
  116. {
  117. return true;
  118. }
  119. }
  120. }
  121. }
  122. return false;
  123. }
  124. bool CanActivateCondition(Hashtable hashtable)
  125. {
  126. return CardEffectCommons.IsExistOnBattleArea(card);
  127. }
  128. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  129. {
  130. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: card.PermanentOfThisCard(), changeValue: 3000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  131. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(targetPermanent: card.PermanentOfThisCard(), changeValue: 1, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  132. }
  133. }
  134. return cardEffects;
  135. }
  136. }