EX12_006.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Kakamon
  4. namespace DCGO.CardEffects.EX12
  5. {
  6. public class EX12_006 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alternate Digivolution Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.EqualsTraits("Shambala");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null, level: 2));
  19. }
  20. #endregion
  21. #region Start of Your Main Phase
  22. if (timing == EffectTiming.OnStartMainPhase)
  23. {
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect("Trash 1 [SW] card to <Draw 1> and gain 1 memory", CanUseCondition, card);
  26. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  27. activateClass.SetIsSkippable(true);
  28. cardEffects.Add(activateClass);
  29. string EffectDescription()
  30. {
  31. return "[Start of Your Main Phase] By trashing 1 card with the [SW] trait from your hand, <Draw 1> and gain 1 memory.";
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
  36. && CardEffectCommons.IsOwnerTurn(card);
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass)
  41. && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition);
  42. }
  43. bool CanSelectCardCondition(CardSource cardSource)
  44. {
  45. return cardSource.EqualsTraits("Shambala");
  46. }
  47. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  48. {
  49. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  50. selectHandEffect.SetUp(
  51. selectPlayer: card.Owner,
  52. canTargetCondition: CanSelectCardCondition,
  53. canTargetCondition_ByPreSelecetedList: null,
  54. canEndSelectCondition: null,
  55. maxCount: 1,
  56. canNoSelect: true,
  57. canEndNotMax: false,
  58. isShowOpponent: true,
  59. selectCardCoroutine: null,
  60. afterSelectCardCoroutine: AfterSelectCardCoroutine,
  61. mode: SelectHandEffect.Mode.Discard,
  62. cardEffect: activateClass);
  63. yield return StartCoroutine(selectHandEffect.Activate());
  64. IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
  65. {
  66. if (cardSources.Count >= 1)
  67. {
  68. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  69. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  70. }
  71. }
  72. }
  73. }
  74. #endregion
  75. #region Inherit
  76. if (timing == EffectTiming.None)
  77. {
  78. bool Condition()
  79. {
  80. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  81. && CardEffectCommons.IsOwnerTurn(card);
  82. }
  83. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  84. changeValue: 2000,
  85. isInheritedEffect: true,
  86. card: card,
  87. condition: Condition));
  88. }
  89. #endregion
  90. return cardEffects;
  91. }
  92. }
  93. }