BT4_109.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 BT4_109 : 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] 1 of your Digimon gets +3000 DP until the end of your opponent's next turn. Then, if that Digimon has 16000 DP or more, that Digimon gains <Blocker> (When an opponent's Digimon attacks, you may suspend this Digimon to force the opponent to attack it instead), <Reboot> (Unsuspend this Digimon during your opponent's unsuspend phase), and <Security Attack +1> (This Digimon checks 1 additional security card) until the end of your opponent's next turn.";
  22. }
  23. bool CanSelectPermanentCondition(Permanent permanent)
  24. {
  25. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  30. }
  31. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  32. {
  33. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  34. {
  35. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  36. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  37. selectPermanentEffect.SetUp(
  38. selectPlayer: card.Owner,
  39. canTargetCondition: CanSelectPermanentCondition,
  40. canTargetCondition_ByPreSelecetedList: null,
  41. canEndSelectCondition: null,
  42. maxCount: maxCount,
  43. canNoSelect: false,
  44. canEndNotMax: false,
  45. selectPermanentCoroutine: SelectPermanentCoroutine,
  46. afterSelectPermanentCoroutine: null,
  47. mode: SelectPermanentEffect.Mode.Custom,
  48. cardEffect: activateClass);
  49. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get effects.", "The opponent is selecting 1 Digimon that will get effects.");
  50. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  51. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  52. {
  53. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 3000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  54. if (permanent.DP >= 16000)
  55. {
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  57. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainReboot(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  58. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(targetPermanent: permanent, changeValue: 1, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  59. }
  60. }
  61. }
  62. }
  63. }
  64. if (timing == EffectTiming.SecuritySkill)
  65. {
  66. ActivateClass activateClass = new ActivateClass();
  67. activateClass.SetUpICardEffect($"Add this card to hand", CanUseCondition, card);
  68. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  69. activateClass.SetIsSecurityEffect(true);
  70. cardEffects.Add(activateClass);
  71. string EffectDiscription()
  72. {
  73. return "[Security] Add this card to its owner's hand.";
  74. }
  75. bool CanUseCondition(Hashtable hashtable)
  76. {
  77. return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
  78. }
  79. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  80. {
  81. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
  82. }
  83. }
  84. return cardEffects;
  85. }
  86. }