P_130.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 P_130 : 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("Move your Digimon to Battle Area", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[On Play] You may move 1 of your level 3 or higher Digimon from the breeding area to the battle area.";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  26. }
  27. bool CanActivateCondition(Hashtable hashtable)
  28. {
  29. if (CardEffectCommons.IsExistOnBattleArea(card))
  30. {
  31. if (card.Owner.GetBreedingAreaPermanents().Count((permanent) => permanent.TopCard.HasLevel && permanent.Level >= 3 && permanent.CanMove) >= 1 && card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame()) >= 1)
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }
  38. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  39. {
  40. if (card.Owner.GetBreedingAreaPermanents().Count((permanent) => permanent.TopCard.HasLevel && permanent.Level >= 3 && permanent.CanMove) >= 1 && card.Owner.fieldCardFrames.Count((frame) => frame.IsEmptyFrame()) >= 1)
  41. {
  42. yield return ContinuousController.instance.StartCoroutine(CardObjectController.MovePermanent(card.Owner.GetBreedingAreaPermanents()[0].PermanentFrame));
  43. }
  44. }
  45. }
  46. if (timing == EffectTiming.OnMove)
  47. {
  48. ActivateClass activateClass = new ActivateClass();
  49. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  50. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  51. cardEffects.Add(activateClass);
  52. string EffectDiscription()
  53. {
  54. return "[Your Turn] When one of your Digimon moves from the breeding area to the battle area, by suspending this Tamer, gain 1 memory.";
  55. }
  56. bool PermanentCondition(Permanent permanent)
  57. {
  58. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  59. }
  60. bool CanUseCondition(Hashtable hashtable)
  61. {
  62. if (CardEffectCommons.IsExistOnBattleArea(card))
  63. {
  64. if (CardEffectCommons.IsOwnerTurn(card))
  65. {
  66. if (CardEffectCommons.CanTriggerOnMove(hashtable, PermanentCondition))
  67. {
  68. return true;
  69. }
  70. }
  71. }
  72. return false;
  73. }
  74. bool CanActivateCondition(Hashtable hashtable)
  75. {
  76. if (CardEffectCommons.IsExistOnBattleArea(card))
  77. {
  78. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  79. {
  80. return true;
  81. }
  82. }
  83. return false;
  84. }
  85. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  86. {
  87. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  88. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  89. }
  90. }
  91. if (timing == EffectTiming.SecuritySkill)
  92. {
  93. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  94. }
  95. return cardEffects;
  96. }
  97. }