LM_047.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Chartreuse Memory Boost!
  4. namespace DCGO.CardEffects.LM
  5. {
  6. public class LM_047 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Color Requirements Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. IgnoreColorConditionClass ignoreColorConditionClass = new IgnoreColorConditionClass();
  15. ignoreColorConditionClass.SetUpICardEffect("Green also meets this card's color requirements", CanUseCondition, card);
  16. ignoreColorConditionClass.SetUpIgnoreColorConditionClass(cardCondition: CardCondition);
  17. cardEffects.Add(ignoreColorConditionClass);
  18. bool CanUseCondition(Hashtable hashtable)
  19. {
  20. return CardEffectCommons.HasMatchConditionPermanent((permanent) =>
  21. permanent.TopCard.Owner == card.Owner &&
  22. permanent.TopCard.CardColors.Contains(CardColor.Green) &&
  23. (permanent.IsDigimon || permanent.IsTamer), true);
  24. }
  25. bool CardCondition(CardSource cardSource)
  26. {
  27. if (cardSource == card)
  28. {
  29. return true;
  30. }
  31. return false;
  32. }
  33. }
  34. #endregion
  35. #region Main
  36. if (timing == EffectTiming.OptionSkill)
  37. {
  38. ActivateClass activateClass = new ActivateClass();
  39. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  40. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  41. cardEffects.Add(activateClass);
  42. string EffectDiscription()
  43. {
  44. return "[Main] Reveal the top 3 cards of your deck. Add 1 yellow or green Digimon card among them to the hand. Return the rest to the bottom of deck. Then, place this card in the battle area.";
  45. }
  46. bool CanSelectCardCondition(CardSource cardSource)
  47. {
  48. if (cardSource.IsDigimon)
  49. {
  50. if (cardSource.HasCardColor(CardColor.Yellow) || cardSource.HasCardColor(CardColor.Green))
  51. {
  52. return true;
  53. }
  54. }
  55. return false;
  56. }
  57. bool CanUseCondition(Hashtable hashtable)
  58. {
  59. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  60. }
  61. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  62. {
  63. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.RevealDeckTopCardsAndSelect(
  64. revealCount: 3,
  65. selectCardConditions:
  66. new SelectCardConditionClass[]
  67. {
  68. new SelectCardConditionClass(
  69. canTargetCondition:CanSelectCardCondition,
  70. canTargetCondition_ByPreSelecetedList:null,
  71. canEndSelectCondition:null,
  72. canNoSelect:false,
  73. selectCardCoroutine: null,
  74. message: "Select 1 yellow or green Digimon card.",
  75. maxCount: 1,
  76. canEndNotMax:false,
  77. mode: SelectCardEffect.Mode.AddHand
  78. )
  79. },
  80. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  81. activateClass: activateClass,
  82. canNoAction: false));
  83. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
  84. }
  85. }
  86. #endregion
  87. #region Main Delay
  88. if (timing == EffectTiming.OnDeclaration)
  89. {
  90. cardEffects.Add(CardEffectFactory.Gain2MemoryOptionDelayEffect(card));
  91. }
  92. #endregion
  93. #region Security
  94. if (timing == EffectTiming.SecuritySkill)
  95. {
  96. cardEffects.Add(CardEffectFactory.PlaceSelfDelayOptionSecurityEffect(card));
  97. }
  98. #endregion
  99. return cardEffects;
  100. }
  101. }
  102. }