BT13_100.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT13
  4. {
  5. public class BT13_100 : 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.OnStartTurn)
  11. {
  12. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  13. }
  14. if (timing == EffectTiming.OnEnterFieldAnyone)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[Your Turn] When one of your Digimon digivolves into a Digimon with [Vegetation], [Plant], or [Fairy] in one of its traits, by suspending this Tamer, gain 1 memory.";
  23. }
  24. bool PermanentCondition(Permanent permanent)
  25. {
  26. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  27. {
  28. if (permanent.TopCard.HasPlantTraits || permanent.TopCard.HasFairyTraits)
  29. {
  30. return true;
  31. }
  32. }
  33. return false;
  34. }
  35. bool CanUseCondition(Hashtable hashtable)
  36. {
  37. if (CardEffectCommons.IsExistOnBattleArea(card))
  38. {
  39. if (CardEffectCommons.IsOwnerTurn(card))
  40. {
  41. if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition))
  42. {
  43. return true;
  44. }
  45. }
  46. }
  47. return false;
  48. }
  49. bool CanActivateCondition(Hashtable hashtable)
  50. {
  51. return CardEffectCommons.CanActivateSuspendCostEffect(card);
  52. }
  53. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  54. {
  55. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  56. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  57. }
  58. }
  59. if (timing == EffectTiming.SecuritySkill)
  60. {
  61. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  62. }
  63. return cardEffects;
  64. }
  65. }
  66. }