BT6_082.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 BT6_082 : 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.None)
  14. {
  15. bool CanUseCondition()
  16. {
  17. if (CardEffectCommons.IsExistOnBattleArea(card))
  18. {
  19. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsDigimon && (permanent.TopCard.HasRoyalKnightTraits || permanent.TopCard.ContainsCardName("Huckmon"))))
  20. {
  21. return true;
  22. }
  23. }
  24. return false;
  25. }
  26. bool PermanentCondition(Permanent permanent)
  27. {
  28. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  29. {
  30. if (permanent.TopCard.ContainsCardName("Sistermon"))
  31. {
  32. return true;
  33. }
  34. }
  35. return false;
  36. }
  37. cardEffects.Add(CardEffectFactory.BlockerStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: false, card: card, condition: CanUseCondition));
  38. }
  39. if (timing == EffectTiming.OnEnterFieldAnyone)
  40. {
  41. ActivateClass activateClass = new ActivateClass();
  42. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  43. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  44. cardEffects.Add(activateClass);
  45. string EffectDiscription()
  46. {
  47. return "[On Play] Trigger <Draw 1>. (Draw 1 card from your deck.)";
  48. }
  49. bool CanUseCondition(Hashtable hashtable)
  50. {
  51. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  52. }
  53. bool CanActivateCondition(Hashtable hashtable)
  54. {
  55. if (CardEffectCommons.IsExistOnBattleArea(card))
  56. {
  57. if (card.Owner.LibraryCards.Count >= 1)
  58. {
  59. return true;
  60. }
  61. }
  62. return false;
  63. }
  64. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  65. {
  66. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  67. }
  68. }
  69. return cardEffects;
  70. }
  71. }