BT1_081.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_081 : 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.OnDetermineDoSecurityCheck)
  14. {
  15. cardEffects.Add(CardEffectFactory.PierceSelfEffect(
  16. isInheritedEffect: false,
  17. card: card,
  18. condition: null));
  19. }
  20. if (timing == EffectTiming.OnEndAttack)
  21. {
  22. ActivateClass activateClass = new ActivateClass();
  23. activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
  24. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 2, true, EffectDiscription());
  25. cardEffects.Add(activateClass);
  26. string EffectDiscription()
  27. {
  28. return "[End of Attack][Twice Per Turn] You can unsuspend this Digimon by decreasing your memory by 3.";
  29. }
  30. bool CanUseCondition(Hashtable hashtable)
  31. {
  32. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  33. }
  34. bool CanActivateCondition(Hashtable hashtable)
  35. {
  36. if (CardEffectCommons.IsExistOnBattleArea(card))
  37. {
  38. if (card.Owner.MaxMemoryCost >= 3)
  39. {
  40. return true;
  41. }
  42. }
  43. return false;
  44. }
  45. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  46. {
  47. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-3, activateClass));
  48. Permanent selectedPermanent = card.PermanentOfThisCard();
  49. yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
  50. }
  51. }
  52. return cardEffects;
  53. }
  54. }