Luxmon_BT18_032.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT18
  5. {
  6. public class Luxmon_BT18_032 : 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
  12. if (timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Gain 1 memory", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  17. activateClass.SetHashString("GainMemory_BT18-032");
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Your Turn] [Once per Turn] When any of your other Digimon with the [Angel], [Archangel], or [Three Great Angels] trait are played, gain 1 memory.";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  26. {
  27. if (permanent != card.PermanentOfThisCard())
  28. {
  29. if (permanent.TopCard.HasAngelTraitRestrictive)
  30. return true;
  31. }
  32. }
  33. return false;
  34. }
  35. bool CanUseCondition(Hashtable hashtable)
  36. {
  37. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  38. {
  39. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  40. {
  41. if (CardEffectCommons.IsOwnerTurn(card))
  42. return true;
  43. }
  44. }
  45. return false;
  46. }
  47. bool CanActivateCondition(Hashtable hashtable)
  48. {
  49. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  50. {
  51. if (card.Owner.CanAddMemory(activateClass))
  52. return true;
  53. }
  54. return false;
  55. }
  56. IEnumerator ActivateCoroutine(Hashtable hashtable)
  57. {
  58. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  59. }
  60. }
  61. #endregion
  62. #region When Attacking - Inherited
  63. if (timing == EffectTiming.OnAllyAttack)
  64. {
  65. ActivateClass activateClass = new ActivateClass();
  66. activateClass.SetUpICardEffect("1 of opponent's Digimon gets -2000 DP", CanUseCondition, card);
  67. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  68. activateClass.SetHashString("WhenAttackingInherit_Luxmon_BT18_032");
  69. activateClass.SetIsInheritedEffect(true);
  70. cardEffects.Add(activateClass);
  71. string EffectDiscription()
  72. {
  73. return "[When Attacking] 1 of your opponent's Digimon gets -2000 DP for the turn.";
  74. }
  75. bool CanSelectPermanentCondition(Permanent permanent)
  76. {
  77. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  78. }
  79. bool CanUseCondition(Hashtable hashtable)
  80. {
  81. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  82. }
  83. bool CanActivateCondition(Hashtable hashtable)
  84. {
  85. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  86. {
  87. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  88. return true;
  89. }
  90. return false;
  91. }
  92. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  93. {
  94. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  95. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  96. selectPermanentEffect.SetUp(
  97. selectPlayer: card.Owner,
  98. canTargetCondition: CanSelectPermanentCondition,
  99. canTargetCondition_ByPreSelecetedList: null,
  100. canEndSelectCondition: null,
  101. maxCount: maxCount,
  102. canNoSelect: false,
  103. canEndNotMax: false,
  104. selectPermanentCoroutine: SelectPermanentCoroutine,
  105. afterSelectPermanentCoroutine: null,
  106. mode: SelectPermanentEffect.Mode.Custom,
  107. cardEffect: activateClass);
  108. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -2000.", "The opponent is selecting 1 Digimon that will get DP -2000.");
  109. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  110. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  111. {
  112. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -2000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  113. }
  114. }
  115. }
  116. #endregion
  117. return cardEffects;
  118. }
  119. }
  120. }