BT4_084.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 BT4_084 : 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 +3", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Opponent's Turn] When an opponent plays a Tamer, gain 3 memory.";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
  26. {
  27. if (permanent.IsTamer)
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. if (CardEffectCommons.IsExistOnBattleArea(card))
  37. {
  38. if (CardEffectCommons.IsOpponentTurn(card))
  39. {
  40. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. return false;
  47. }
  48. bool CanActivateCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. if (card.Owner.CanAddMemory(activateClass))
  53. {
  54. return true;
  55. }
  56. }
  57. return false;
  58. }
  59. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  60. {
  61. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(3, activateClass));
  62. }
  63. }
  64. if (timing == EffectTiming.OnTappedAnyone)
  65. {
  66. ActivateClass activateClass = new ActivateClass();
  67. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  68. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  69. activateClass.SetIsInheritedEffect(true);
  70. cardEffects.Add(activateClass);
  71. string EffectDiscription()
  72. {
  73. return "[Opponent's Turn] When an opponent's Tamer becomes suspended, gain 1 memory.";
  74. }
  75. bool PermanentCondition(Permanent permanent)
  76. {
  77. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
  78. {
  79. if (permanent.IsTamer)
  80. {
  81. return true;
  82. }
  83. }
  84. return false;
  85. }
  86. bool CanUseCondition(Hashtable hashtable)
  87. {
  88. if (CardEffectCommons.IsExistOnBattleArea(card))
  89. {
  90. if (CardEffectCommons.IsOpponentTurn(card))
  91. {
  92. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  93. {
  94. return true;
  95. }
  96. }
  97. }
  98. return false;
  99. }
  100. bool CanActivateCondition(Hashtable hashtable)
  101. {
  102. if (CardEffectCommons.IsExistOnBattleArea(card))
  103. {
  104. if (card.Owner.CanAddMemory(activateClass))
  105. {
  106. return true;
  107. }
  108. }
  109. return false;
  110. }
  111. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  112. {
  113. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  114. }
  115. }
  116. return cardEffects;
  117. }
  118. }