BT1_115.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_115 : 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.OnAllyAttack)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  18. activateClass.SetHashString("Unsuspend_BT1_115");
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[When Attacking][Once Per Turn] If you have a Tamer in play, unsuspend this Digimon.";
  23. }
  24. bool CanUseCondition(Hashtable hashtable)
  25. {
  26. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  27. }
  28. bool CanActivateCondition(Hashtable hashtable)
  29. {
  30. if (CardEffectCommons.IsExistOnBattleArea(card))
  31. {
  32. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsTamer))
  33. {
  34. return true;
  35. }
  36. }
  37. return false;
  38. }
  39. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  40. {
  41. Permanent selectedPermanent = card.PermanentOfThisCard();
  42. yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
  43. }
  44. }
  45. if (timing == EffectTiming.None)
  46. {
  47. bool Condition()
  48. {
  49. if (CardEffectCommons.IsExistOnBattleArea(card))
  50. {
  51. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.CardColors.Contains(CardColor.Blue) && permanent.IsTamer))
  52. {
  53. return true;
  54. }
  55. }
  56. return false;
  57. }
  58. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  59. changeValue: 1000,
  60. isInheritedEffect: true,
  61. card: card,
  62. condition: Condition));
  63. }
  64. return cardEffects;
  65. }
  66. }