BT4_020.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 BT4_020 : 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.OnTappedAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Gain Security Attack +1", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Your Turn] When one of your red or yellow Tamers is suspended, this Digimon gains <Security Attack +1> (This Digimon checks 1 additional security card) for the turn.";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  26. {
  27. if (permanent.IsTamer)
  28. {
  29. if (permanent.TopCard.CardColors.Contains(CardColor.Red))
  30. {
  31. return true;
  32. }
  33. if (permanent.TopCard.CardColors.Contains(CardColor.Yellow))
  34. {
  35. return true;
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. bool CanUseCondition(Hashtable hashtable)
  42. {
  43. if (CardEffectCommons.IsExistOnBattleArea(card))
  44. {
  45. if (CardEffectCommons.IsOwnerTurn(card))
  46. {
  47. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  48. {
  49. return true;
  50. }
  51. }
  52. }
  53. return false;
  54. }
  55. bool CanActivateCondition(Hashtable hashtable)
  56. {
  57. return CardEffectCommons.IsExistOnBattleArea(card);
  58. }
  59. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  60. {
  61. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(targetPermanent: card.PermanentOfThisCard(), changeValue: 1, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  62. }
  63. }
  64. return cardEffects;
  65. }
  66. }