BT2_100.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 BT2_100 : 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.OptionSkill)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  17. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Main] Suspend 1 of your opponent's Digimon. Then 1 of your Digimon gets +2000 DP for the turn.";
  22. }
  23. bool CanSelectPermanentCondition(Permanent permanent)
  24. {
  25. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  26. }
  27. bool CanSelectPermanentCondition1(Permanent permanent)
  28. {
  29. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  30. }
  31. bool CanUseCondition(Hashtable hashtable)
  32. {
  33. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  34. }
  35. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  36. {
  37. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  38. {
  39. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  40. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  41. selectPermanentEffect.SetUp(
  42. selectPlayer: card.Owner,
  43. canTargetCondition: CanSelectPermanentCondition,
  44. canTargetCondition_ByPreSelecetedList: null,
  45. canEndSelectCondition: null,
  46. maxCount: maxCount,
  47. canNoSelect: false,
  48. canEndNotMax: false,
  49. selectPermanentCoroutine: null,
  50. afterSelectPermanentCoroutine: null,
  51. mode: SelectPermanentEffect.Mode.Tap,
  52. cardEffect: activateClass);
  53. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  54. }
  55. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
  56. {
  57. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition1));
  58. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  59. selectPermanentEffect.SetUp(
  60. selectPlayer: card.Owner,
  61. canTargetCondition: CanSelectPermanentCondition1,
  62. canTargetCondition_ByPreSelecetedList: null,
  63. canEndSelectCondition: null,
  64. maxCount: maxCount,
  65. canNoSelect: false,
  66. canEndNotMax: false,
  67. selectPermanentCoroutine: SelectPermanentCoroutine,
  68. afterSelectPermanentCoroutine: null,
  69. mode: SelectPermanentEffect.Mode.Custom,
  70. cardEffect: activateClass);
  71. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP +2000.", "The opponent is selecting 1 Digimon that will get DP +2000.");
  72. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  73. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  74. {
  75. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 2000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  76. }
  77. }
  78. }
  79. }
  80. return cardEffects;
  81. }
  82. }