P_143.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.P
  4. {
  5. public class P_143 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region End of Your Turn
  11. if (timing == EffectTiming.OnEndTurn)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Move this Digimon to empty space in breeding area", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
  16. activateClass.SetHashString("EndTurn_P_143");
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[End of Your Turn] [Once Per Turn] You may move this to the empty space in your breeding area.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  25. {
  26. if (CardEffectCommons.IsOwnerTurn(card))
  27. {
  28. return true;
  29. }
  30. }
  31. return false;
  32. }
  33. bool CanActivateCondition(Hashtable hashtable)
  34. {
  35. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  36. {
  37. if (card.Owner.GetBreedingAreaPermanents().Count == 0)
  38. {
  39. return true;
  40. }
  41. }
  42. return false;
  43. }
  44. IEnumerator ActivateCoroutine(Hashtable hashtable)
  45. {
  46. if (card.PermanentOfThisCard().CanMove)
  47. {
  48. yield return ContinuousController.instance.StartCoroutine(CardObjectController.MovePermanent(card.PermanentOfThisCard().PermanentFrame, true, activateClass));
  49. }
  50. }
  51. }
  52. #endregion
  53. #region Piercing - ESS
  54. if (timing == EffectTiming.OnDetermineDoSecurityCheck)
  55. {
  56. cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: true, card: card, condition: null));
  57. }
  58. #endregion
  59. return cardEffects;
  60. }
  61. }
  62. }