ST5_13.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class ST5_13 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.None)
  14. {
  15. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null));
  16. }
  17. if (timing == EffectTiming.OnDeclaration)
  18. {
  19. ActivateClass activateClass = new ActivateClass();
  20. activateClass.SetUpICardEffect("DP +4000", CanUseCondition, card);
  21. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  22. cardEffects.Add(activateClass);
  23. string EffectDiscription()
  24. {
  25. return "[Main] <Digi-Burst 2> (Trash 2 of this Digimon's Digivolution cards to activate the effect below.) - 1 of your Digimon gets +4000 DP until the end of your opponent's next turn.";
  26. }
  27. bool CanSelectPermanentCondition(Permanent permanent)
  28. {
  29. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  30. }
  31. bool CanUseCondition(Hashtable hashtable)
  32. {
  33. if (CardEffectCommons.IsExistOnBattleArea(card))
  34. {
  35. if (new IDigiBurst(card.PermanentOfThisCard(), 2, activateClass).CanDigiBurst())
  36. {
  37. return true;
  38. }
  39. }
  40. return false;
  41. }
  42. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  43. {
  44. if (isExistOnField(card))
  45. {
  46. if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
  47. {
  48. if (new IDigiBurst(card.PermanentOfThisCard(), 2, activateClass).CanDigiBurst())
  49. {
  50. yield return ContinuousController.instance.StartCoroutine(new IDigiBurst(card.PermanentOfThisCard(), 2, activateClass).DigiBurst());
  51. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  52. {
  53. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  54. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  55. selectPermanentEffect.SetUp(
  56. selectPlayer: card.Owner,
  57. canTargetCondition: CanSelectPermanentCondition,
  58. canTargetCondition_ByPreSelecetedList: null,
  59. canEndSelectCondition: null,
  60. maxCount: maxCount,
  61. canNoSelect: false,
  62. canEndNotMax: false,
  63. selectPermanentCoroutine: SelectPermanentCoroutine,
  64. afterSelectPermanentCoroutine: null,
  65. mode: SelectPermanentEffect.Mode.Custom,
  66. cardEffect: activateClass);
  67. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP +4000.", "The opponent is selecting 1 Digimon that will get DP +4000.");
  68. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  69. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  70. {
  71. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 4000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  72. }
  73. }
  74. }
  75. }
  76. }
  77. }
  78. }
  79. return cardEffects;
  80. }
  81. }