BT22_006.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Moonmon
  4. namespace DCGO.CardEffects.BT22
  5. {
  6. public class BT22_006 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.OnAddDigivolutionCards)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Draw 1, trash 1", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
  16. activateClass.SetHashString("BT22_006_Draw1");
  17. activateClass.SetIsInheritedEffect(true);
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Your Turn] [Once Per Turn] When effects place this Digimon's top stacked card as its bottom digivolution card, <Draw 1> (Draw 1 card from your deck.) and trash 1 card in your hand.";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. return CardEffectCommons.CanTriggerOnAddDigivolutionCard(hashtable, permament => permament == card.PermanentOfThisCard(), cardEffect => cardEffect.EffectSourceCard != null, null)
  26. && CardEffectCommons.IsFromDigimon(hashtable);
  27. }
  28. bool CanActivateCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  31. && CardEffectCommons.IsOwnerTurn(card);
  32. }
  33. IEnumerator ActivateCoroutine(Hashtable hashtable)
  34. {
  35. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  36. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  37. selectHandEffect.SetUp(
  38. selectPlayer: card.Owner,
  39. canTargetCondition: (cardSource) => true,
  40. canTargetCondition_ByPreSelecetedList: null,
  41. canEndSelectCondition: null,
  42. maxCount: 1,
  43. canNoSelect: true,
  44. canEndNotMax: false,
  45. isShowOpponent: true,
  46. selectCardCoroutine: null,
  47. afterSelectCardCoroutine: null,
  48. mode: SelectHandEffect.Mode.Discard,
  49. cardEffect: activateClass);
  50. yield return StartCoroutine(selectHandEffect.Activate());
  51. }
  52. }
  53. return cardEffects;
  54. }
  55. }
  56. }