P_067.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_067 : 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.SecuritySkill)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Draw 2 and add this card to hand", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. activateClass.SetIsSecurityEffect(true);
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[Security] At the end of the battle, <Draw 2>. (Draw 2 cards from your deck.) Then, add this card to its owner's hand.";
  23. }
  24. bool CanUseCondition(Hashtable hashtable)
  25. {
  26. return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
  27. }
  28. bool CanActivateCondition(Hashtable hashtable)
  29. {
  30. if (CardEffectCommons.IsExistOnExecutingArea(card))
  31. {
  32. return true;
  33. }
  34. return false;
  35. }
  36. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  37. {
  38. yield return null;
  39. ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
  40. ActivateClass activateClass1 = new ActivateClass();
  41. activateClass1.SetUpICardEffect("Draw 2 and add this card to hand", CanUseCondition1, card);
  42. activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
  43. card.Owner.UntilEndBattleEffects.Add(GetCardEffect1);
  44. string EffectDiscription1()
  45. {
  46. return "<Draw 2>. (Draw 2 cards from your deck.) Then, add this card to its owner's hand.";
  47. }
  48. bool CanUseCondition1(Hashtable hashtable)
  49. {
  50. return true;
  51. }
  52. bool CanActivateCondition1(Hashtable hashtable)
  53. {
  54. return true;
  55. }
  56. IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
  57. {
  58. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 2, activateClass).Draw());
  59. if (card.Owner.ExecutingCards.Contains(card))
  60. {
  61. yield return ContinuousController.instance.StartCoroutine(card.Owner.brainStormObject.CloseBrainstrorm(card));
  62. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(new List<CardSource>() { card }, false, activateClass));
  63. }
  64. }
  65. ICardEffect GetCardEffect1(EffectTiming _timing)
  66. {
  67. if (_timing == EffectTiming.OnEndBattle)
  68. {
  69. return activateClass1;
  70. }
  71. return null;
  72. }
  73. }
  74. }
  75. return cardEffects;
  76. }
  77. }