ST7_03.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 ST7_03 : 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.None)
  14. {
  15. bool Condition()
  16. {
  17. if (CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.IsExistOnBattleArea(card))
  18. {
  19. if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, (permanent) => permanent.IsDigimon && permanent.Level >= 6 && permanent.TopCard.HasLevel))
  20. {
  21. return true;
  22. }
  23. }
  24. return false;
  25. }
  26. bool PermanentCondition(Permanent targetPermanent)
  27. {
  28. return targetPermanent == card.PermanentOfThisCard();
  29. }
  30. bool CardCondition(CardSource cardSource)
  31. {
  32. if (cardSource.Owner.HandCards.Contains(cardSource))
  33. {
  34. if (cardSource.CardNames.Contains("Gallantmon"))
  35. {
  36. return true;
  37. }
  38. }
  39. return false;
  40. }
  41. string effectName = $"Can digivolve to [Gallantmon]";
  42. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 4, ignoreDigivolutionRequirement: true, card: card, condition: Condition, effectName: effectName, cardCondition: CardCondition));
  43. }
  44. if (timing == EffectTiming.OnDestroyedAnyone)
  45. {
  46. ActivateClass activateClass = new ActivateClass();
  47. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  48. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  49. activateClass.SetIsInheritedEffect(true);
  50. activateClass.SetHashString("Draw1_ST7_03");
  51. cardEffects.Add(activateClass);
  52. string EffectDiscription()
  53. {
  54. return "[Your Turn][Once Per Turn] When an opponent's Digimon is deleted, trigger <Draw 1>. (Draw 1 card from your deck.)";
  55. }
  56. bool PermanentCondition(Permanent permanent)
  57. {
  58. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  59. }
  60. bool CanUseCondition(Hashtable hashtable)
  61. {
  62. if (CardEffectCommons.IsExistOnBattleArea(card))
  63. {
  64. if (CardEffectCommons.IsOwnerTurn(card))
  65. {
  66. if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass))
  67. {
  68. return true;
  69. }
  70. }
  71. }
  72. return false;
  73. }
  74. bool CanActivateCondition(Hashtable hashtable)
  75. {
  76. if (CardEffectCommons.IsExistOnBattleArea(card))
  77. {
  78. if (card.Owner.LibraryCards.Count >= 1)
  79. {
  80. return true;
  81. }
  82. }
  83. return false;
  84. }
  85. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  86. {
  87. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  88. }
  89. }
  90. return cardEffects;
  91. }
  92. }