mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
[ZNR] Implemented Nighthawk Scavenger
This commit is contained in:
parent
d3e89f876f
commit
23ed28f387
2 changed files with 97 additions and 0 deletions
96
Mage.Sets/src/mage/cards/n/NighthawkScavenger.java
Normal file
96
Mage.Sets/src/mage/cards/n/NighthawkScavenger.java
Normal file
|
@ -0,0 +1,96 @@
|
|||
package mage.cards.n;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class NighthawkScavenger extends CardImpl {
|
||||
|
||||
public NighthawkScavenger(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
|
||||
|
||||
this.subtype.add(SubType.VAMPIRE);
|
||||
this.subtype.add(SubType.ROGUE);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Deathtouch
|
||||
this.addAbility(DeathtouchAbility.getInstance());
|
||||
|
||||
// Lifelink
|
||||
this.addAbility(LifelinkAbility.getInstance());
|
||||
|
||||
// Nighthawk Scavenger's power is equal to 1 plus the number of card types among cards in your opponents' graveyards.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.ALL,
|
||||
new SetPowerSourceEffect(
|
||||
NighthawkScavengerValue.instance, Duration.EndOfGame
|
||||
).setText("{this}'s power is equal to 1 plus the number of card types among cards in your opponents' graveyards.")
|
||||
));
|
||||
}
|
||||
|
||||
private NighthawkScavenger(final NighthawkScavenger card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NighthawkScavenger copy() {
|
||||
return new NighthawkScavenger(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum NighthawkScavengerValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return 1 + game.getOpponents(sourceAbility.getControllerId())
|
||||
.stream()
|
||||
.map(game::getPlayer)
|
||||
.filter(Objects::nonNull)
|
||||
.map(Player::getGraveyard)
|
||||
.map(g -> g.getCards(game))
|
||||
.flatMap(Collection::stream)
|
||||
.filter(Objects::nonNull)
|
||||
.map(MageObject::getCardType)
|
||||
.flatMap(Collection::stream)
|
||||
.collect(Collectors.toSet())
|
||||
.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NighthawkScavengerValue copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -128,6 +128,7 @@ public final class ZendikarRising extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Murkwater Pathway", 260, Rarity.RARE, mage.cards.m.MurkwaterPathway.class));
|
||||
cards.add(new SetCardInfo("Nahiri, Heir of the Ancients", 230, Rarity.MYTHIC, mage.cards.n.NahiriHeirOfTheAncients.class));
|
||||
cards.add(new SetCardInfo("Needleverge Pathway", 263, Rarity.RARE, mage.cards.n.NeedlevergePathway.class));
|
||||
cards.add(new SetCardInfo("Nighthawk Scavenger", 115, Rarity.RARE, mage.cards.n.NighthawkScavenger.class));
|
||||
cards.add(new SetCardInfo("Nimana Skitter-Sneak", 116, Rarity.COMMON, mage.cards.n.NimanaSkitterSneak.class));
|
||||
cards.add(new SetCardInfo("Omnath, Locus of Creation", 232, Rarity.MYTHIC, mage.cards.o.OmnathLocusOfCreation.class));
|
||||
cards.add(new SetCardInfo("Orah, Skyclave Hierophant", 233, Rarity.RARE, mage.cards.o.OrahSkyclaveHierophant.class));
|
||||
|
|
Loading…
Reference in a new issue