BT6_019.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 BT6_019 : 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. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  18. activateClass.SetHashString("Memory+1_BT6_019");
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[All Turns][Once Per Turn] When you play a Tamer with [Matt Ishida] in its name, gain 1 memory.";
  23. }
  24. bool PermanentCondition(Permanent permanent)
  25. {
  26. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  27. {
  28. if (permanent.IsTamer)
  29. {
  30. if (permanent.TopCard.ContainsCardName("Matt Ishida"))
  31. {
  32. return true;
  33. }
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanUseCondition(Hashtable hashtable)
  39. {
  40. if (CardEffectCommons.IsExistOnBattleArea(card))
  41. {
  42. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  43. {
  44. return true;
  45. }
  46. }
  47. return false;
  48. }
  49. bool CanActivateCondition(Hashtable hashtable)
  50. {
  51. if (CardEffectCommons.IsExistOnBattleArea(card))
  52. {
  53. return true;
  54. }
  55. return false;
  56. }
  57. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  58. {
  59. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  60. }
  61. }
  62. if (timing == EffectTiming.OnAllyAttack)
  63. {
  64. ActivateClass activateClass = new ActivateClass();
  65. activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
  66. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
  67. activateClass.SetIsInheritedEffect(true);
  68. activateClass.SetHashString("Unsuspend_BT6_019");
  69. cardEffects.Add(activateClass);
  70. string EffectDiscription()
  71. {
  72. return "[When Attacking][Once Per Turn] If this Digimon is [Gabumon - Bond of Friendship], you may unsuspend it.";
  73. }
  74. bool CanUseCondition(Hashtable hashtable)
  75. {
  76. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  77. }
  78. bool CanActivateCondition(Hashtable hashtable)
  79. {
  80. if (CardEffectCommons.IsExistOnBattleArea(card))
  81. {
  82. if (CardEffectCommons.CanUnsuspend(card.PermanentOfThisCard()))
  83. {
  84. if (card.PermanentOfThisCard().TopCard.ContainsCardName("Gabumon - Bond of Friendship"))
  85. {
  86. return true;
  87. }
  88. }
  89. }
  90. return false;
  91. }
  92. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  93. {
  94. Permanent selectedPermanent = card.PermanentOfThisCard();
  95. yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
  96. }
  97. }
  98. return cardEffects;
  99. }
  100. }