EX1_061.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX1
  4. {
  5. public class EX1_061 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.None)
  11. {
  12. bool Condition()
  13. {
  14. return CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.IsExistOnBattleArea(card);
  15. }
  16. bool PermanentCondition(Permanent targetPermanent)
  17. {
  18. return targetPermanent == card.PermanentOfThisCard();
  19. }
  20. bool CardSourceCondition(CardSource cardSource)
  21. {
  22. return cardSource.IsDigimon && cardSource.ContainsCardName("Myotismon") && cardSource.Owner.HandCards.Contains(cardSource);
  23. }
  24. bool RootCondition(SelectCardEffect.Root root)
  25. {
  26. return root == SelectCardEffect.Root.Hand;
  27. }
  28. cardEffects.Add(CardEffectFactory.ChangeDigivolutionCostStaticEffect(
  29. changeValue: -1,
  30. permanentCondition: PermanentCondition,
  31. cardCondition: CardSourceCondition,
  32. rootCondition: RootCondition,
  33. isInheritedEffect: false,
  34. card: card,
  35. condition: Condition,
  36. setFixedCost: false));
  37. }
  38. if (timing == EffectTiming.None)
  39. {
  40. CanAttackTargetDefendingPermanentClass canAttackTargetDefendingPermanentClass = new CanAttackTargetDefendingPermanentClass();
  41. canAttackTargetDefendingPermanentClass.SetUpICardEffect($"Your Digimon can attack to unsuspended Digimon", CanUseCondition, card);
  42. canAttackTargetDefendingPermanentClass.SetUpCanAttackTargetDefendingPermanentClass(
  43. attackerCondition: AttackerCondition,
  44. defenderCondition: DefenderCondition,
  45. cardEffectCondition: CardEffectCondition);
  46. canAttackTargetDefendingPermanentClass.SetIsInheritedEffect(true);
  47. cardEffects.Add(canAttackTargetDefendingPermanentClass);
  48. bool CanUseCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. if (CardEffectCommons.IsOwnerTurn(card))
  53. {
  54. if (card.PermanentOfThisCard().TopCard.ContainsCardName("Myotismon"))
  55. {
  56. return true;
  57. }
  58. }
  59. }
  60. return false;
  61. }
  62. bool AttackerCondition(Permanent permanent)
  63. {
  64. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  65. {
  66. if (permanent.HasRetaliation)
  67. {
  68. return true;
  69. }
  70. }
  71. return false;
  72. }
  73. bool DefenderCondition(Permanent permanent)
  74. {
  75. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  76. {
  77. if (!permanent.IsSuspended)
  78. {
  79. if (permanent.Level <= 4)
  80. {
  81. if (permanent.TopCard.HasLevel)
  82. {
  83. return true;
  84. }
  85. }
  86. }
  87. }
  88. return false;
  89. }
  90. bool CardEffectCondition(ICardEffect cardEffect)
  91. {
  92. return true;
  93. }
  94. }
  95. return cardEffects;
  96. }
  97. }
  98. }