BT5_093.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 BT5_093 : 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.OnStartTurn)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Memory +2", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Start of Your Turn] If your opponent has a level 6 or higher Digimon in play, gain 2 memory.";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. if (CardEffectCommons.IsExistOnBattleArea(card))
  26. {
  27. if (CardEffectCommons.IsOwnerTurn(card))
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool PermanentCondition(Permanent permanent)
  35. {
  36. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  37. {
  38. if (permanent.Level >= 6)
  39. {
  40. if (permanent.TopCard.HasLevel)
  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 (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
  53. {
  54. if (card.Owner.CanAddMemory(activateClass))
  55. {
  56. return true;
  57. }
  58. }
  59. }
  60. return false;
  61. }
  62. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  63. {
  64. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(2, activateClass));
  65. }
  66. }
  67. if (timing == EffectTiming.None)
  68. {
  69. bool Condition()
  70. {
  71. if (CardEffectCommons.IsExistOnBattleArea(card))
  72. {
  73. if (CardEffectCommons.IsOwnerTurn(card))
  74. {
  75. return true;
  76. }
  77. }
  78. return false;
  79. }
  80. bool PermanentCondition(Permanent permanent)
  81. {
  82. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  83. {
  84. if (permanent.TopCard.ContainsCardName("Omnimon"))
  85. {
  86. return true;
  87. }
  88. }
  89. return false;
  90. }
  91. cardEffects.Add(CardEffectFactory.ChangeSAttackStaticEffect(
  92. permanentCondition: PermanentCondition,
  93. changeValue: 1,
  94. isInheritedEffect: false,
  95. card: card,
  96. condition: Condition));
  97. }
  98. if (timing == EffectTiming.SecuritySkill)
  99. {
  100. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  101. }
  102. return cardEffects;
  103. }
  104. }