BT13_097.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT13
  4. {
  5. public class BT13_097 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnStartTurn)
  11. {
  12. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  13. }
  14. if (timing == EffectTiming.OnAllyAttack)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Both players draw 1 card", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[Your Turn] When one of your Digimon with [Gaomon] or [GaoGamon] in its name attacks, by suspending this Tamer, both players draw 1 card from their decks.";
  23. }
  24. bool PermanentCondition(Permanent permanent)
  25. {
  26. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  27. {
  28. if (permanent.TopCard.ContainsCardName("Gaomon"))
  29. {
  30. return true;
  31. }
  32. if (permanent.TopCard.ContainsCardName("GaoGamon"))
  33. {
  34. return true;
  35. }
  36. }
  37. return false;
  38. }
  39. bool CanUseCondition(Hashtable hashtable)
  40. {
  41. if (CardEffectCommons.IsExistOnBattleArea(card))
  42. {
  43. if (CardEffectCommons.IsOwnerTurn(card))
  44. {
  45. if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
  46. {
  47. return true;
  48. }
  49. }
  50. }
  51. return false;
  52. }
  53. bool CanActivateCondition(Hashtable hashtable)
  54. {
  55. if (CardEffectCommons.IsExistOnBattleArea(card))
  56. {
  57. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  58. {
  59. return true;
  60. }
  61. }
  62. return false;
  63. }
  64. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  65. {
  66. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  67. foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
  68. {
  69. if (player.LibraryCards.Count >= 1)
  70. {
  71. yield return ContinuousController.instance.StartCoroutine(new DrawClass(player, 1, activateClass).Draw());
  72. }
  73. }
  74. }
  75. }
  76. if (timing == EffectTiming.SecuritySkill)
  77. {
  78. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  79. }
  80. return cardEffects;
  81. }
  82. }
  83. }