[MH2] Implemented Goblin Traprunner

This commit is contained in:
Evan Kranzler 2021-06-03 08:05:07 -04:00
parent d3be492f8c
commit c26ef0774f
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game;
import mage.game.permanent.token.GoblinToken;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GoblinTraprunner extends CardImpl {
public GoblinTraprunner(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.subtype.add(SubType.GOBLIN);
this.power = new MageInt(4);
this.toughness = new MageInt(2);
// Whenever Goblin Traprunner attacks, flip three coins. For each flip you win, create a 1/1 red Goblin creature token that's tapped and attacking.
this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(
new GoblinToken(), GoblinTraprunnerValue.instance, true, true
).setText("flip three coins. For each flip you win, " +
"create a 1/1 red Goblin creature token that's tapped and attacking"), false));
}
private GoblinTraprunner(final GoblinTraprunner card) {
super(card);
}
@Override
public GoblinTraprunner copy() {
return new GoblinTraprunner(this);
}
}
enum GoblinTraprunnerValue 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 count = 0;
for (int i = 0; i < 3; i++) {
if (player.flipCoin(sourceAbility, game, true)) {
count++;
}
}
return count;
}
@Override
public GoblinTraprunnerValue copy() {
return instance;
}
@Override
public String getMessage() {
return "";
}
}

View file

@ -127,6 +127,7 @@ public final class ModernHorizons2 extends ExpansionSet {
cards.add(new SetCardInfo("Glorious Enforcer", 14, Rarity.UNCOMMON, mage.cards.g.GloriousEnforcer.class));
cards.add(new SetCardInfo("Goblin Anarchomancer", 200, Rarity.COMMON, mage.cards.g.GoblinAnarchomancer.class));
cards.add(new SetCardInfo("Goblin Bombardment", 279, Rarity.RARE, mage.cards.g.GoblinBombardment.class));
cards.add(new SetCardInfo("Goblin Traprunner", 130, Rarity.UNCOMMON, mage.cards.g.GoblinTraprunner.class));
cards.add(new SetCardInfo("Goldmire Bridge", 247, Rarity.COMMON, mage.cards.g.GoldmireBridge.class));
cards.add(new SetCardInfo("Gorilla Shaman", 280, Rarity.UNCOMMON, mage.cards.g.GorillaShaman.class));
cards.add(new SetCardInfo("Graceful Restoration", 201, Rarity.UNCOMMON, mage.cards.g.GracefulRestoration.class));