Zanbamon_BT18_085.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace DCGO.CardEffects.BT18
  5. {
  6. public class Zanbamon_BT18_085 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Shared
  12. int OpponentTrashColorCount()
  13. {
  14. List<CardColor> cardColors = new List<CardColor>();
  15. foreach (CardSource cardSource in card.Owner.Enemy.TrashCards)
  16. {
  17. cardColors.AddRange(cardSource.CardColors);
  18. }
  19. cardColors = cardColors.Distinct().ToList();
  20. return cardColors.Count;
  21. }
  22. #endregion
  23. #region Digivolution Cost Reduction
  24. if (timing == EffectTiming.None)
  25. {
  26. bool Condition()
  27. {
  28. return !CardEffectCommons.IsExistOnField(card);
  29. }
  30. bool PermanentCondition(Permanent targetPermanent)
  31. {
  32. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(targetPermanent, card);
  33. }
  34. bool CardSourceCondition(CardSource cardSource)
  35. {
  36. return cardSource == card;
  37. }
  38. bool RootCondition(SelectCardEffect.Root root)
  39. {
  40. return true;
  41. }
  42. cardEffects.Add(CardEffectFactory.ChangeDigivolutionCostStaticEffect<Func<int>>(
  43. changeValue: () => -OpponentTrashColorCount(),
  44. permanentCondition: PermanentCondition,
  45. cardCondition: CardSourceCondition,
  46. rootCondition: RootCondition,
  47. isInheritedEffect: false,
  48. card: card,
  49. condition: Condition,
  50. setFixedCost: false));
  51. }
  52. #endregion
  53. #region Your Turn
  54. if (timing == EffectTiming.None)
  55. {
  56. bool Condition()
  57. {
  58. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  59. CardEffectCommons.IsOwnerTurn(card);
  60. }
  61. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: OpponentTrashColorCount() / 2,
  62. isInheritedEffect: false, card: card, condition: Condition));
  63. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000 * (OpponentTrashColorCount() / 2),
  64. isInheritedEffect: false, card: card, condition: Condition));
  65. }
  66. #endregion
  67. return cardEffects;
  68. }
  69. }
  70. }