EX11_010.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // MasterTyrannomon
  5. namespace DCGO.CardEffects.EX11
  6. {
  7. public class EX11_010 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Digivolution Condition
  13. if (timing == EffectTiming.None)
  14. {
  15. bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. return targetPermanent.TopCard.ContainsTraits("Dinosaur")
  18. && targetPermanent.TopCard.IsLevel4;
  19. }
  20. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
  21. }
  22. #endregion
  23. #region Sec +1
  24. if (timing == EffectTiming.None)
  25. {
  26. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(
  27. changeValue: 1,
  28. isInheritedEffect: false,
  29. card: card,
  30. condition: null));
  31. }
  32. #endregion
  33. #region Fortitude
  34. if (timing == EffectTiming.OnDestroyedAnyone)
  35. {
  36. cardEffects.Add(CardEffectFactory.FortitudeSelfEffect(isInheritedEffect: false, card: card, condition: null));
  37. }
  38. #endregion
  39. #region Shared OP/WD
  40. string SharedEffectName() => "Suspend 1. If this is suspended get +4k DP.";
  41. string SharedEffectDescription(string tag) => $"[{tag}] You may suspend 1 Digimon. Then, if this Digimon is suspended, it gets +4000 DP until your opponent's turn ends.";
  42. bool SharedCanActivateCondition(Hashtable hashtable)
  43. {
  44. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  45. }
  46. bool PermanentConditionBattleArea(Permanent permanent)
  47. {
  48. return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent);
  49. }
  50. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  51. {
  52. if (CardEffectCommons.HasMatchConditionPermanent(PermanentConditionBattleArea))
  53. {
  54. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentConditionBattleArea));
  55. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  56. selectPermanentEffect.SetUp(
  57. selectPlayer: card.Owner,
  58. canTargetCondition: PermanentConditionBattleArea,
  59. canTargetCondition_ByPreSelecetedList: null,
  60. canEndSelectCondition: null,
  61. maxCount: maxCount,
  62. canNoSelect: true,
  63. canEndNotMax: false,
  64. selectPermanentCoroutine: null,
  65. afterSelectPermanentCoroutine: null,
  66. mode: SelectPermanentEffect.Mode.Tap,
  67. cardEffect: activateClass);
  68. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to suspend.", "The opponent is selecting 1 Digimon to suspend.");
  69. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  70. }
  71. if (card.PermanentOfThisCard().IsSuspended)
  72. {
  73. yield return ContinuousController.instance.StartCoroutine(
  74. CardEffectCommons.ChangeDigimonDP(card.PermanentOfThisCard(), 4000, EffectDuration.UntilOpponentTurnEnd, activateClass));
  75. }
  76. }
  77. #endregion
  78. #region On Play
  79. if (timing == EffectTiming.OnEnterFieldAnyone)
  80. {
  81. ActivateClass activateClass = new ActivateClass();
  82. activateClass.SetUpICardEffect(SharedEffectName(), CanUseCondition, card);
  83. activateClass.SetUpActivateClass(SharedCanActivateCondition, hash => SharedActivateCoroutine(hash, activateClass), -1, false, SharedEffectDescription("On Play"));
  84. cardEffects.Add(activateClass);
  85. bool CanUseCondition(Hashtable hashtable)
  86. {
  87. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  88. && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  89. }
  90. }
  91. #endregion
  92. #region When Digivolving
  93. if (timing == EffectTiming.OnEnterFieldAnyone)
  94. {
  95. ActivateClass activateClass = new ActivateClass();
  96. activateClass.SetUpICardEffect(SharedEffectName(), CanUseCondition, card);
  97. activateClass.SetUpActivateClass(SharedCanActivateCondition, hash => SharedActivateCoroutine(hash, activateClass), -1, false, SharedEffectDescription("When Digivolving"));
  98. cardEffects.Add(activateClass);
  99. bool CanUseCondition(Hashtable hashtable)
  100. {
  101. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  102. && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  103. }
  104. }
  105. #endregion
  106. #region Inherit
  107. if (timing == EffectTiming.None)
  108. {
  109. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: true, card: card, condition: null));
  110. }
  111. #endregion
  112. return cardEffects;
  113. }
  114. }
  115. }