Implemented Anax, Hardened in the Forge

This commit is contained in:
Evan Kranzler 2020-01-06 21:40:50 -05:00
parent a00b4cdc9e
commit 14c22137ce
3 changed files with 132 additions and 0 deletions

View file

@ -0,0 +1,97 @@
package mage.cards.a;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.PermanentToken;
import mage.game.permanent.token.SatyrCantBlockToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AnaxHardenedInTheForge extends CardImpl {
public AnaxHardenedInTheForge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{R}{R}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.DEMIGOD);
this.power = new MageInt(0);
this.toughness = new MageInt(3);
// Anax's power is equal to your devotion to red.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetPowerSourceEffect(DevotionCount.R, Duration.EndOfGame)
.setText("{this}'s power is equal to your devotion to red")
).addHint(DevotionCount.R.getHint()));
// Whenever Anax or another nontoken creature you control dies, create a 1/1 red Satyr creature token with "This creature can't block." If the creature had 4 power or greater, create two of those tokens instead.
this.addAbility(new AnaxHardenedInTheForgeTriggeredAbility());
}
private AnaxHardenedInTheForge(final AnaxHardenedInTheForge card) {
super(card);
}
@Override
public AnaxHardenedInTheForge copy() {
return new AnaxHardenedInTheForge(this);
}
}
class AnaxHardenedInTheForgeTriggeredAbility extends TriggeredAbilityImpl {
AnaxHardenedInTheForgeTriggeredAbility() {
super(Zone.BATTLEFIELD, null, false);
}
private AnaxHardenedInTheForgeTriggeredAbility(final AnaxHardenedInTheForgeTriggeredAbility ability) {
super(ability);
}
@Override
public AnaxHardenedInTheForgeTriggeredAbility copy() {
return new AnaxHardenedInTheForgeTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (!zEvent.isDiesEvent()) {
return false;
}
if (!zEvent.getTarget().getId().equals(getSourceId())
&& (zEvent.getTarget() instanceof PermanentToken
|| !zEvent.getTarget().isCreature())) {
return false;
}
int tokenCount = zEvent.getTarget().getPower().getValue() > 3 ? 2 : 1;
this.getEffects().clear();
this.addEffect(new CreateTokenEffect(new SatyrCantBlockToken(), tokenCount));
return true;
}
@Override
public String getRule() {
return "Whenever {this} or another nontoken creature you control dies, " +
"create a 1/1 red Satyr creature token with \"This creature can't block.\" " +
"If the creature had 4 power or greater, create two of those tokens instead.";
}
}

View file

@ -27,6 +27,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
this.maxCardNumberInBooster = 254; this.maxCardNumberInBooster = 254;
cards.add(new SetCardInfo("Allure of the Unknown", 207, Rarity.RARE, mage.cards.a.AllureOfTheUnknown.class)); cards.add(new SetCardInfo("Allure of the Unknown", 207, Rarity.RARE, mage.cards.a.AllureOfTheUnknown.class));
cards.add(new SetCardInfo("Anax, Hardened in the Forge", 125, Rarity.UNCOMMON, mage.cards.a.AnaxHardenedInTheForge.class));
cards.add(new SetCardInfo("Aphemia, the Cacophony", 84, Rarity.RARE, mage.cards.a.AphemiaTheCacophony.class)); cards.add(new SetCardInfo("Aphemia, the Cacophony", 84, Rarity.RARE, mage.cards.a.AphemiaTheCacophony.class));
cards.add(new SetCardInfo("Arasta of the Endless Web", 165, Rarity.RARE, mage.cards.a.ArastaOfTheEndlessWeb.class)); cards.add(new SetCardInfo("Arasta of the Endless Web", 165, Rarity.RARE, mage.cards.a.ArastaOfTheEndlessWeb.class));
cards.add(new SetCardInfo("Archon of Falling Stars", 2, Rarity.UNCOMMON, mage.cards.a.ArchonOfFallingStars.class)); cards.add(new SetCardInfo("Archon of Falling Stars", 2, Rarity.UNCOMMON, mage.cards.a.ArchonOfFallingStars.class));

View file

@ -0,0 +1,34 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.combat.CantBlockSourceEffect;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
/**
* @author TheElk801
*/
public final class SatyrCantBlockToken extends TokenImpl {
public SatyrCantBlockToken() {
super("Satyr", "1/1 red Satyr creature token with \"This creature can't block.\"");
cardType.add(CardType.CREATURE);
color.setRed(true);
subtype.add(SubType.SATYR);
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(new SimpleStaticAbility(new CantBlockSourceEffect(Duration.WhileOnBattlefield)
.setText("this creature can't block")));
}
private SatyrCantBlockToken(final SatyrCantBlockToken token) {
super(token);
}
public SatyrCantBlockToken copy() {
return new SatyrCantBlockToken(this);
}
}