BT1_060.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 BT1_060 : 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("Recovery +1 (Deck)", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[On Play] Trigger <Recovery +1 (Deck)>. (Place the top card of your deck on top of your security stack.)";
  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.LibraryCards.Count >= 1)
  32. {
  33. if (card.Owner.CanAddSecurity(activateClass))
  34. {
  35. return true;
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  42. {
  43. yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
  44. }
  45. }
  46. if (timing == EffectTiming.None)
  47. {
  48. int count()
  49. {
  50. return card.Owner.SecurityCards.Count / 3;
  51. }
  52. bool Condition()
  53. {
  54. if (CardEffectCommons.IsOwnerTurn(card))
  55. {
  56. if (count() >= 1)
  57. {
  58. return true;
  59. }
  60. }
  61. return false;
  62. }
  63. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect<Func<int>>(
  64. changeValue: () => 1000 * count(),
  65. isInheritedEffect: true,
  66. card: card,
  67. condition: Condition));
  68. }
  69. return cardEffects;
  70. }
  71. }