BT5_103.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 BT5_103 : 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] Until the end of your opponent's next turn, all of your Digimon with <Reboot> get +1000 DP and <Blocker>. (When an opponent's Digimon attacks, you may suspend this Digimon to force the opponent to attack it instead.)";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  26. }
  27. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  28. {
  29. bool PermanentCondition(Permanent permanent)
  30. {
  31. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  32. {
  33. if (permanent.HasReboot)
  34. {
  35. return true;
  36. }
  37. }
  38. return false;
  39. }
  40. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDPPlayerEffect(
  41. permanentCondition: PermanentCondition,
  42. changeValue: 1000,
  43. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  44. activateClass: activateClass));
  45. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlockerPlayerEffect(
  46. permanentCondition: PermanentCondition,
  47. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  48. activateClass: activateClass));
  49. }
  50. }
  51. if (timing == EffectTiming.SecuritySkill)
  52. {
  53. ActivateClass activateClass = new ActivateClass();
  54. activateClass.SetUpICardEffect($"All opponent's Digimon can't attack to player and add this card to hand", CanUseCondition, card);
  55. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  56. activateClass.SetIsSecurityEffect(true);
  57. cardEffects.Add(activateClass);
  58. string EffectDiscription()
  59. {
  60. return "[Security] Your opponent's Digimon can't attack players for the turn. Then, add this card to your hand.";
  61. }
  62. bool CanUseCondition(Hashtable hashtable)
  63. {
  64. return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
  65. }
  66. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  67. {
  68. bool AttackerCondition(Permanent Attacker)
  69. {
  70. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(Attacker, card))
  71. {
  72. return true;
  73. }
  74. return false;
  75. }
  76. bool DefenderCondition(Permanent Defender)
  77. {
  78. return Defender == null;
  79. }
  80. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttackPlayerEffect(
  81. attackerCondition: AttackerCondition,
  82. defenderCondition: DefenderCondition,
  83. effectDuration: EffectDuration.UntilEachTurnEnd,
  84. activateClass: activateClass,
  85. effectName: "Can't Attack to player"));
  86. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
  87. }
  88. }
  89. return cardEffects;
  90. }
  91. }