BT1_105.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 BT1_105 : 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. activateClass.SetEffectDiscription(EffectDiscription());
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[Main] Change the original DP of 1 of your opponent's Digimon to 3000 until the end of your opponent's next turn.";
  23. }
  24. bool CanSelectPermanentCondition(Permanent permanent)
  25. {
  26. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  27. {
  28. return true;
  29. }
  30. return false;
  31. }
  32. bool CanUseCondition(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  35. }
  36. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  37. {
  38. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  39. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  40. selectPermanentEffect.SetUp(
  41. selectPlayer: card.Owner,
  42. canTargetCondition: CanSelectPermanentCondition,
  43. canTargetCondition_ByPreSelecetedList: null,
  44. canEndSelectCondition: null,
  45. maxCount: maxCount,
  46. canNoSelect: false,
  47. canEndNotMax: false,
  48. selectPermanentCoroutine: SelectPermanentCoroutine,
  49. afterSelectPermanentCoroutine: null,
  50. mode: SelectPermanentEffect.Mode.Custom,
  51. cardEffect: activateClass);
  52. selectPermanentEffect.SetUpCustomMessage(customMessageArray: CardEffectCommons.customPermanentMessageArray_ChangeOriginDP(changeValue: 3000, maxCount: maxCount));
  53. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  54. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  55. {
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeBaseDigimonDP(targetPermanent: permanent, changeValue: 3000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  57. }
  58. }
  59. }
  60. return cardEffects;
  61. }
  62. }