EX2_020.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX2
  4. {
  5. public class EX2_020 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnEnterFieldAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[On Play] If you have 3 or fewer security cards and [Shu-Chong Wong] in play, <Recovery +1 (Deck)>. (Place the top card of your deck on top of your security stack.)";
  19. }
  20. bool CanUseCondition(Hashtable hashtable)
  21. {
  22. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  23. }
  24. bool CanActivateCondition(Hashtable hashtable)
  25. {
  26. if (isExistOnField(card))
  27. {
  28. if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
  29. {
  30. if (card.Owner.LibraryCards.Count >= 1)
  31. {
  32. if (card.Owner.CanAddSecurity(activateClass))
  33. {
  34. if (card.Owner.SecurityCards.Count <= 3)
  35. {
  36. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.CardNames.Contains("Shu-Chong Wong")))
  37. {
  38. return true;
  39. }
  40. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.CardNames.Contains("Shu-ChongWong")))
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
  49. return false;
  50. }
  51. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  52. {
  53. if (CardEffectCommons.IsExistOnBattleArea(card))
  54. {
  55. yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
  56. }
  57. }
  58. }
  59. return cardEffects;
  60. }
  61. }
  62. }