P_058.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 P_058 : 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. CanAttackTargetDefendingPermanentClass canAttackTargetDefendingPermanentClass = new CanAttackTargetDefendingPermanentClass();
  16. canAttackTargetDefendingPermanentClass.SetUpICardEffect($"Can attack to unsuspended Digimon", CanUseCondition, card);
  17. canAttackTargetDefendingPermanentClass.SetUpCanAttackTargetDefendingPermanentClass(attackerCondition: AttackerCondition, defenderCondition: DefenderCondition, cardEffectCondition: CardEffectCondition);
  18. cardEffects.Add(canAttackTargetDefendingPermanentClass);
  19. bool CanUseCondition(Hashtable hashtable)
  20. {
  21. if (isExistOnField(card))
  22. {
  23. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.CardColors.Contains(CardColor.Red) && permanent.IsTamer))
  24. {
  25. if (CardEffectCommons.IsOwnerTurn(card))
  26. {
  27. return true;
  28. }
  29. }
  30. }
  31. return false;
  32. }
  33. bool AttackerCondition(Permanent permanent)
  34. {
  35. return permanent == card.PermanentOfThisCard();
  36. }
  37. bool DefenderCondition(Permanent permanent)
  38. {
  39. if (permanent != null)
  40. {
  41. if (permanent.TopCard != null)
  42. {
  43. if (permanent.TopCard.Owner == card.Owner.Enemy)
  44. {
  45. if (permanent.IsDigimon)
  46. {
  47. if (!permanent.IsSuspended)
  48. {
  49. if (permanent.TopCard.Owner.GetBattleAreaPermanents().Contains(permanent))
  50. {
  51. return true;
  52. }
  53. }
  54. }
  55. }
  56. }
  57. }
  58. return false;
  59. }
  60. bool CardEffectCondition(ICardEffect cardEffect)
  61. {
  62. return true;
  63. }
  64. }
  65. return cardEffects;
  66. }
  67. }