ST2_12.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 ST2_12 : 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 +1", 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 Digimon with no digivolution cards, gain 1 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 CanActivateCondition(Hashtable hashtable)
  35. {
  36. if (isExistOnField(card))
  37. {
  38. if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, (permanent) => permanent.IsDigimon && permanent.HasNoDigivolutionCards))
  39. {
  40. if (card.Owner.CanAddMemory(activateClass))
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. return false;
  47. }
  48. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  49. {
  50. if (isExistOnField(card))
  51. {
  52. if (card.Owner.CanAddMemory(activateClass))
  53. {
  54. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  55. }
  56. }
  57. }
  58. }
  59. if (timing == EffectTiming.SecuritySkill)
  60. {
  61. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  62. }
  63. return cardEffects;
  64. }
  65. }