BT5_021.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_021 : 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. CannotReduceCostClass cannotReduceCostClass = new CannotReduceCostClass();
  16. cannotReduceCostClass.SetUpICardEffect("Opponent can't reduce digivolution costs", CanUseCondition, card);
  17. cannotReduceCostClass.SetUpCannotReduceCostClass(
  18. playerCondition: PlayerCondition,
  19. targetPermanentsCondition: TargetPermanentsCondition,
  20. cardCondition: CardCondition);
  21. cardEffects.Add(cannotReduceCostClass);
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. if (CardEffectCommons.IsExistOnBattleArea(card))
  25. {
  26. if (CardEffectCommons.IsOpponentTurn(card))
  27. {
  28. if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
  29. {
  30. return true;
  31. }
  32. }
  33. }
  34. return false;
  35. }
  36. bool PlayerCondition(Player player)
  37. {
  38. if (player == card.Owner.Enemy)
  39. {
  40. return true;
  41. }
  42. return false;
  43. }
  44. bool TargetPermanentsCondition(List<Permanent> targetPermanents)
  45. {
  46. if (targetPermanents != null)
  47. {
  48. if (targetPermanents.Count((permanent) => permanent != null) >= 1)
  49. {
  50. return true;
  51. }
  52. }
  53. return false;
  54. }
  55. bool CardCondition(CardSource cardSource)
  56. {
  57. return cardSource.IsPermanent;
  58. }
  59. }
  60. return cardEffects;
  61. }
  62. }