EX1_027.cs 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX1
  4. {
  5. public class EX1_027 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.SecuritySkill)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Recovery +1 (Deck) at the end of the battle", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. activateClass.SetIsSecurityEffect(true);
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[Security] At the end of the battle, if you have 3 or fewer security cards, <Recovery +1 (Deck)>. (Place the top card of your deck on top of your security stack.)";
  20. }
  21. bool CanUseCondition(Hashtable hashtable)
  22. {
  23. return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
  24. }
  25. bool CanActivateCondition(Hashtable hashtable)
  26. {
  27. if (CardEffectCommons.IsExistOnExecutingArea(card))
  28. {
  29. return true;
  30. }
  31. return false;
  32. }
  33. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  34. {
  35. yield return null;
  36. ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
  37. ActivateClass activateClass1 = new ActivateClass();
  38. activateClass1.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition1, card);
  39. activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
  40. card.Owner.UntilEndBattleEffects.Add(GetCardEffect1);
  41. string EffectDiscription1()
  42. {
  43. return "Trigger <Recovery +1 (Deck)>. (Place the top card of your deck on top of your security stack.)";
  44. }
  45. bool CanUseCondition1(Hashtable hashtable)
  46. {
  47. return true;
  48. }
  49. bool CanActivateCondition1(Hashtable hashtable)
  50. {
  51. if (card.Owner.LibraryCards.Count >= 1)
  52. {
  53. if (card.Owner.SecurityCards.Count <= 3)
  54. {
  55. if (card.Owner.CanAddSecurity(activateClass1))
  56. {
  57. return true;
  58. }
  59. }
  60. }
  61. return false;
  62. }
  63. IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
  64. {
  65. yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass1).Recovery());
  66. }
  67. ICardEffect GetCardEffect1(EffectTiming _timing)
  68. {
  69. if (_timing == EffectTiming.OnEndBattle)
  70. {
  71. return activateClass1;
  72. }
  73. return null;
  74. }
  75. }
  76. }
  77. return cardEffects;
  78. }
  79. }
  80. }