[40K] Implemented Great Unclean One

This commit is contained in:
Evan Kranzler 2022-09-15 20:51:13 -04:00
parent 89eb256c16
commit 53f76c2403
3 changed files with 122 additions and 0 deletions

View file

@ -0,0 +1,89 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.game.Game;
import mage.game.permanent.token.PlaguebearerOfNurgleToken;
import mage.players.Player;
import java.util.Objects;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GreatUncleanOne extends CardImpl {
public GreatUncleanOne(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.subtype.add(SubType.DEMON);
this.power = new MageInt(4);
this.toughness = new MageInt(5);
// Reverberating Summons -- At the beginning of your end step, each opponent loses 2 life. Then for each opponent who has less life than you, create a 1/3 black Demon creature token named Plaguebearer of Nurgle.
Ability ability = new BeginningOfEndStepTriggeredAbility(
new LoseLifeOpponentsEffect(2), TargetController.YOU, false
);
ability.addEffect(new CreateTokenEffect(
new PlaguebearerOfNurgleToken(), GreatUncleanOneValue.instance
).setText("then for each opponent who has less life than you, " +
"create a 1/3 black Demon creature token named Plaguebearer of Nurgle"));
this.addAbility(ability.withFlavorWord("Reverberating Summons"));
}
private GreatUncleanOne(final GreatUncleanOne card) {
super(card);
}
@Override
public GreatUncleanOne copy() {
return new GreatUncleanOne(this);
}
}
enum GreatUncleanOneValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player player = game.getPlayer(sourceAbility.getControllerId());
if (player == null) {
return 0;
}
int life = player.getLife();
return game
.getOpponents(player.getId())
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
.mapToInt(Player::getLife)
.map(l -> l < life ? 1 : 0)
.sum();
}
@Override
public GreatUncleanOneValue copy() {
return this;
}
@Override
public String getMessage() {
return "";
}
@Override
public String toString() {
return "1";
}
}

View file

@ -65,6 +65,7 @@ public final class Warhammer40000 extends ExpansionSet {
cards.add(new SetCardInfo("Game Trail", 282, Rarity.RARE, mage.cards.g.GameTrail.class));
cards.add(new SetCardInfo("Gargoyle Flock", 123, Rarity.RARE, mage.cards.g.GargoyleFlock.class));
cards.add(new SetCardInfo("Goliath Truck", 158, Rarity.UNCOMMON, mage.cards.g.GoliathTruck.class));
cards.add(new SetCardInfo("Great Unclean One", 35, Rarity.RARE, mage.cards.g.GreatUncleanOne.class));
cards.add(new SetCardInfo("Hardened Scales", 215, Rarity.RARE, mage.cards.h.HardenedScales.class));
cards.add(new SetCardInfo("Harrow", 216, Rarity.COMMON, mage.cards.h.Harrow.class));
cards.add(new SetCardInfo("Herald of Slaanesh", 77, Rarity.UNCOMMON, mage.cards.h.HeraldOfSlaanesh.class));

View file

@ -0,0 +1,32 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.Arrays;
/**
* @author TheElk801
*/
public final class PlaguebearerOfNurgleToken extends TokenImpl {
public PlaguebearerOfNurgleToken() {
super("Plaguebearer of Nurgle", "1/3 black Demon creature token named Plaguebearer of Nurgle");
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add(SubType.DEMON);
power = new MageInt(1);
toughness = new MageInt(3);
availableImageSetCodes = Arrays.asList("40K");
}
public PlaguebearerOfNurgleToken(final PlaguebearerOfNurgleToken token) {
super(token);
}
public PlaguebearerOfNurgleToken copy() {
return new PlaguebearerOfNurgleToken(this);
}
}