BT25_005.cs 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. // Pagumon
  5. namespace DCGO.CardEffects.BT25
  6. {
  7. public class BT25_005 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Your turn
  13. if (timing == EffectTiming.OnAddDigivolutionCards)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Digivolve into a [Three Musketeers] in text or [TS] trait in hand for 2 reduced cost", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
  18. activateClass.SetHashString("EX11_074_OnAddDigivolutionCards");
  19. activateClass.SetIsInheritedEffect(true);
  20. cardEffects.Add(activateClass);
  21. string EffectDiscription()
  22. {
  23. return "[Your Turn] [Once Per Turn] When [Three Musketeers] trait cards are placed in this Digimon's digivolution cards, it may digivolve into a Digimon card with [Three Musketeers] in its text or the [TS] trait in the hand with the cost reduced by 2.";
  24. }
  25. bool CanUseCondition(Hashtable hashtable)
  26. {
  27. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  28. && CardEffectCommons.CanTriggerOnAddDigivolutionCard(hashtable, PermamentCondition, null, CardCondition)
  29. && CardEffectCommons.IsOwnerTurn(card);
  30. }
  31. bool CanActivateCondition(Hashtable hashtable)
  32. {
  33. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  34. }
  35. bool PermamentCondition(Permanent permanent)
  36. {
  37. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  38. && card.PermanentOfThisCard() == permanent;
  39. }
  40. bool CardCondition(CardSource cardSource)
  41. {
  42. return cardSource.HasThreeMusketeersTraits;
  43. }
  44. bool CanDigivolveCondition(CardSource cardSource)
  45. {
  46. return cardSource.HasText("Three Musketeers") || cardSource.HasTSTraits;
  47. }
  48. IEnumerator ActivateCoroutine(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanDigivolveCondition))
  51. {
  52. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
  53. targetPermanent: card.PermanentOfThisCard(),
  54. cardCondition: CanDigivolveCondition,
  55. payCost: true,
  56. reduceCostTuple: (reduceCost: 2, reduceCostCardCondition: null),
  57. fixedCostTuple: null,
  58. ignoreDigivolutionRequirementFixedCost: -1,
  59. isHand: true,
  60. activateClass: activateClass,
  61. successProcess: null));
  62. }
  63. }
  64. }
  65. #endregion
  66. return cardEffects;
  67. }
  68. }
  69. }