LM_015.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.LM
  4. {
  5. public class LM_015 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region When Attacking
  11. if (timing == EffectTiming.OnAllyAttack)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("This Digimon digivolves", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[When Attacking] If you have a Tamer, this Digimon may digivolve into [Ginryumon] in your hand without paying the cost.";
  20. }
  21. bool HaveTamerCondition(Permanent permanent)
  22. {
  23. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  24. {
  25. if (permanent.IsTamer)
  26. {
  27. return true;
  28. }
  29. }
  30. return false;
  31. }
  32. bool CanSelectDigimonCondition(CardSource cardSource)
  33. {
  34. return cardSource.CardNames.Contains("Ginryumon");
  35. }
  36. bool CanUseCondition(Hashtable hashtable)
  37. {
  38. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  39. }
  40. bool CanActivateCondition(Hashtable hashtable)
  41. {
  42. if (CardEffectCommons.IsExistOnBattleArea(card))
  43. {
  44. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, HaveTamerCondition))
  45. {
  46. if (card.Owner.HandCards.Count >= 1)
  47. {
  48. return true;
  49. }
  50. }
  51. }
  52. return false;
  53. }
  54. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  55. {
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
  57. targetPermanent: card.PermanentOfThisCard(),
  58. cardCondition: CanSelectDigimonCondition,
  59. payCost: false,
  60. reduceCostTuple: null,
  61. fixedCostTuple: null,
  62. ignoreDigivolutionRequirementFixedCost: -1,
  63. isHand: true,
  64. activateClass: activateClass,
  65. successProcess: null));
  66. }
  67. }
  68. #endregion
  69. #region Your Turn - Inherited Effect
  70. if (timing == EffectTiming.None)
  71. {
  72. bool Condition()
  73. {
  74. if (CardEffectCommons.IsExistOnBattleArea(card))
  75. {
  76. if (CardEffectCommons.IsOwnerTurn(card))
  77. {
  78. if (card.ContainsTraits("X Antibody") || card.ContainsTraits("XAntibody"))
  79. {
  80. return true;
  81. }
  82. }
  83. }
  84. return false;
  85. }
  86. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  87. }
  88. #endregion
  89. return cardEffects;
  90. }
  91. }
  92. }