BT25_081.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Fangmon
  4. namespace DCGO.CardEffects.BT25
  5. {
  6. public class BT25_081 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region OP/WD Shared
  12. string SharedEffectName = "Suspend 1 non-purple Tamer";
  13. CardEffectFactory.ActivateClassesForSharedEffects
  14. (ref cardEffects, timing, card,
  15. SharedEffectName,
  16. SharedActivateCoroutine,
  17. SharedEffectDescription,
  18. optional: false,
  19. onPlay: true,
  20. whenDigivolving: true);
  21. string SharedEffectDescription(string tag) => $"[{tag}] Suspend 1 non-purple Tamer.";
  22. bool CanSelectPermanentCondition(Permanent permanent)
  23. {
  24. return CardEffectCommons.IsPermanentExistsOnBattleArea(permanent)
  25. && permanent.IsTamer
  26. && !permanent.TopCard.HasCardColor(CardColor.Purple);
  27. }
  28. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  29. {
  30. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  31. {
  32. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  33. selectPermanentEffect.SetUp(
  34. selectPlayer: card.Owner,
  35. canTargetCondition: CanSelectPermanentCondition,
  36. canTargetCondition_ByPreSelecetedList: null,
  37. canEndSelectCondition: null,
  38. maxCount: 1,
  39. canNoSelect: false,
  40. canEndNotMax: false,
  41. selectPermanentCoroutine: null,
  42. afterSelectPermanentCoroutine: null,
  43. mode: SelectPermanentEffect.Mode.Tap,
  44. cardEffect: activateClass);
  45. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  46. }
  47. }
  48. #endregion
  49. #region All Turns
  50. if (timing == EffectTiming.OnTappedAnyone)
  51. {
  52. ActivateClass activateClass = new ActivateClass();
  53. activateClass.SetUpICardEffect("Gain 1 memory", CanUseCondition, card);
  54. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  55. activateClass.SetHashString("BT25_081_AT");
  56. cardEffects.Add(activateClass);
  57. string EffectDescription()
  58. {
  59. return "[All Turns] [Once Per Turn] When any of your opponent's Tamers suspend, gain 1 memory.";
  60. }
  61. bool CanUseCondition(Hashtable hashtable)
  62. {
  63. return CardEffectCommons.IsExistOnBattleArea(card)
  64. && CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition);
  65. }
  66. bool CanActivateCondition(Hashtable hashtable)
  67. {
  68. return CardEffectCommons.IsExistOnBattleArea(card);
  69. }
  70. bool PermanentCondition(Permanent permanent)
  71. {
  72. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaTamer(permanent, card);
  73. }
  74. IEnumerator ActivateCoroutine(Hashtable hashtable)
  75. {
  76. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  77. }
  78. }
  79. #endregion
  80. #region Inherit
  81. if (timing == EffectTiming.OnDestroyedAnyone)
  82. {
  83. cardEffects.Add(CardEffectFactory.RetaliationSelfEffect(isInheritedEffect: true, card: card, condition: null));
  84. }
  85. #endregion
  86. return cardEffects;
  87. }
  88. }
  89. }