P_062.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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_062 : 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("Security Attack +1", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Your Turn] When you attack with a Digimon that has [Gammamon] in its digivolution cards, you may suspend this Tamer to have that Digimon gain <Security Attack +1> for the turn. (This Digimon checks 1 additional security card.)";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  26. {
  27. if (permanent.DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Gammamon")) >= 1)
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. if (CardEffectCommons.IsExistOnBattleArea(card))
  37. {
  38. if (CardEffectCommons.IsOwnerTurn(card))
  39. {
  40. if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. return false;
  47. }
  48. bool CanActivateCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  53. {
  54. return true;
  55. }
  56. }
  57. return false;
  58. }
  59. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  60. {
  61. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
  62. new List<Permanent>() { card.PermanentOfThisCard() },
  63. CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  64. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(
  65. targetPermanent: GManager.instance.attackProcess.AttackingPermanent,
  66. changeValue: 1,
  67. effectDuration: EffectDuration.UntilEachTurnEnd,
  68. activateClass: activateClass));
  69. }
  70. }
  71. if (timing == EffectTiming.SecuritySkill)
  72. {
  73. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  74. }
  75. return cardEffects;
  76. }
  77. }