EX1_044.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace DCGO.CardEffects.EX1
  5. {
  6. public class EX1_044 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.None)
  12. {
  13. int count()
  14. {
  15. if (CardEffectCommons.IsExistOnBattleArea(card))
  16. {
  17. return card.Owner.GetBattleAreaDigimons().Count((permanent) => permanent != card.PermanentOfThisCard() && permanent.TopCard.HasSameCardName(card.PermanentOfThisCard().TopCard));
  18. }
  19. return 0;
  20. }
  21. bool Condition()
  22. {
  23. if (CardEffectCommons.IsExistOnBattleArea(card))
  24. {
  25. if (CardEffectCommons.IsOwnerTurn(card))
  26. {
  27. if (count() >= 1)
  28. {
  29. return true;
  30. }
  31. }
  32. }
  33. return false;
  34. }
  35. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect<Func<int>>(changeValue: () => 1000 * count(), isInheritedEffect: true, card: card, condition: Condition));
  36. }
  37. return cardEffects;
  38. }
  39. }
  40. }