BT5_100.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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_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] Reveal 5 cards from the top of your deck. Add 1 Digimon card with <Digisorption> among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  22. }
  23. bool CanSelectCardCondition(CardSource cardSource)
  24. {
  25. if (cardSource.IsDigimon)
  26. {
  27. if (cardSource.HasDigisorption)
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  37. }
  38. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  39. {
  40. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  41. revealCount: 5,
  42. simplifiedSelectCardConditions:
  43. new SimplifiedSelectCardConditionClass[]
  44. {
  45. new SimplifiedSelectCardConditionClass(
  46. canTargetCondition:CanSelectCardCondition,
  47. message: "Select 1 Digimon card with <Digisorption>.",
  48. mode: SelectCardEffect.Mode.AddHand,
  49. maxCount: 1,
  50. selectCardCoroutine: null),
  51. },
  52. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  53. activateClass: activateClass
  54. ));
  55. }
  56. }
  57. if (timing == EffectTiming.SecuritySkill)
  58. {
  59. ActivateClass activateClass = new ActivateClass();
  60. activateClass.SetUpICardEffect($"Add this card to hand", CanUseCondition, card);
  61. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  62. activateClass.SetIsSecurityEffect(true);
  63. cardEffects.Add(activateClass);
  64. string EffectDiscription()
  65. {
  66. return "[Security] Add this card to its owner's hand.";
  67. }
  68. bool CanUseCondition(Hashtable hashtable)
  69. {
  70. return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
  71. }
  72. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  73. {
  74. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.AddThisCardToHand(card, activateClass));
  75. }
  76. }
  77. return cardEffects;
  78. }
  79. }