BT24_084.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. // Inori Misono
  6. namespace DCGO.CardEffects.BT24
  7. {
  8. public class BT24_084 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. #region Start of Your Main Phase
  14. if (timing == EffectTiming.OnStartMainPhase)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  19. cardEffects.Add(activateClass);
  20. string EffectDescription() => "[Start of Your Main Phase] If you have 4 or less memory, gain 1 memory.";
  21. bool CanUseCondition(Hashtable hashtable)
  22. {
  23. return CardEffectCommons.IsExistOnBattleArea(card)
  24. && CardEffectCommons.IsOwnerTurn(card);
  25. }
  26. bool CanActivateCondition(Hashtable hashtable)
  27. {
  28. return CardEffectCommons.IsExistOnBattleArea(card);
  29. }
  30. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  31. {
  32. if (card.Owner.CanAddMemory(activateClass) && card.Owner.MemoryForPlayer <= 4)
  33. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  34. }
  35. }
  36. #endregion
  37. #region All Turns
  38. if (timing == EffectTiming.OnLoseSecurity)
  39. {
  40. ActivateClass activateClass = new ActivateClass();
  41. activateClass.SetUpICardEffect("Digivolve an [Aegiomon] into an [Aegiochusmon]", CanUseCondition, card);
  42. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  43. cardEffects.Add(activateClass);
  44. string EffectDescription() => "[All Turns] When your security stack is removed from, by suspending this Tamer, 1 of your [Aegiomon] may digivolve into a Digimon card with [Aegiouchusmon] in its name in the hand without paying the cost.";
  45. bool CanUseCondition(Hashtable hashtable)
  46. {
  47. return CardEffectCommons.IsExistOnBattleArea(card)
  48. && CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, player => player == card.Owner);
  49. }
  50. bool CanActivateCondition(Hashtable hashtable)
  51. {
  52. return CardEffectCommons.IsExistOnBattleArea(card)
  53. && CardEffectCommons.CanActivateSuspendCostEffect(card);
  54. }
  55. bool CanSelectPermanentCondition(Permanent permanent)
  56. {
  57. return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
  58. && permanent.TopCard.EqualsCardName("Aegiomon");
  59. }
  60. bool CanSelectCardCondition(CardSource cardSource)
  61. {
  62. return cardSource.ContainsCardName("Aegiochusmon");
  63. }
  64. IEnumerator ActivateCoroutine(Hashtable hashtable)
  65. {
  66. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent> { card.PermanentOfThisCard() }, hashtable).Tap());
  67. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  68. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  69. selectPermanentEffect.SetUp(
  70. selectPlayer: card.Owner,
  71. canTargetCondition: CanSelectPermanentCondition,
  72. canTargetCondition_ByPreSelecetedList: null,
  73. canEndSelectCondition: null,
  74. maxCount: maxCount,
  75. canNoSelect: true,
  76. canEndNotMax: false,
  77. selectPermanentCoroutine: SelectPermanentCoroutine,
  78. afterSelectPermanentCoroutine: null,
  79. mode: SelectPermanentEffect.Mode.Custom,
  80. cardEffect: activateClass);
  81. selectPermanentEffect.SetUpCustomMessage(
  82. "Select 1 Digimon that will digivolve.",
  83. "The opponent is selecting 1 Digimon that will digivolve.");
  84. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  85. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  86. {
  87. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
  88. targetPermanent: permanent,
  89. cardCondition: CanSelectCardCondition,
  90. payCost: false,
  91. reduceCostTuple: null,
  92. fixedCostTuple: null,
  93. ignoreDigivolutionRequirementFixedCost: -1,
  94. isHand: true,
  95. activateClass: activateClass,
  96. successProcess: null));
  97. }
  98. }
  99. }
  100. #endregion
  101. #region Security
  102. if (timing == EffectTiming.SecuritySkill)
  103. {
  104. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  105. }
  106. #endregion
  107. return cardEffects;
  108. }
  109. }
  110. }