BT24_006.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Tapmon
  4. namespace DCGO.CardEffects.BT24
  5. {
  6. public class BT24_006 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Your Turn - ESS
  12. if (timing == EffectTiming.WhenLinked)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("<Draw 1>, trash 1", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  17. activateClass.SetHashString("Draw_BT24_006");
  18. activateClass.SetIsInheritedEffect(true);
  19. cardEffects.Add(activateClass);
  20. string EffectDescription()
  21. {
  22. return "[Your Turn] [Once Per Turn] When this Digimon gets linked, <Draw 1> and trash 1 card in your hand.";
  23. }
  24. bool PermanentCondition(Permanent permanent)
  25. {
  26. return permanent == card.PermanentOfThisCard();
  27. }
  28. bool CardCondition(CardSource source)
  29. {
  30. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  31. }
  32. bool CanUseCondition(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.CanTriggerWhenLinked(hashtable, PermanentCondition, CardCondition);
  35. }
  36. bool CanActivateCondition(Hashtable hashtable)
  37. {
  38. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  39. && CardEffectCommons.IsOwnerTurn(card);
  40. }
  41. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  42. {
  43. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  44. if (card.Owner.HandCards.Count >= 1)
  45. {
  46. int discardCount = 1;
  47. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  48. selectHandEffect.SetUp(
  49. selectPlayer: card.Owner,
  50. canTargetCondition: (cardSource) => true,
  51. canTargetCondition_ByPreSelecetedList: null,
  52. canEndSelectCondition: null,
  53. maxCount: discardCount,
  54. canNoSelect: false,
  55. canEndNotMax: false,
  56. isShowOpponent: true,
  57. selectCardCoroutine: null,
  58. afterSelectCardCoroutine: null,
  59. mode: SelectHandEffect.Mode.Discard,
  60. cardEffect: activateClass);
  61. yield return StartCoroutine(selectHandEffect.Activate());
  62. }
  63. }
  64. }
  65. #endregion
  66. return cardEffects;
  67. }
  68. }
  69. }