Implemented Triumph of Anax

This commit is contained in:
Evan Kranzler 2020-01-03 11:13:54 -05:00
parent 82c7337ec3
commit 9a3d085a81
5 changed files with 103 additions and 22 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.t;
import mage.abilities.common.SagaAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent;
import mage.target.Targets;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class TheTriumphOfAnax extends CardImpl {
private static final DynamicValue xValue = new CountersSourceCount(CounterType.LORE);
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
}
public TheTriumphOfAnax(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
this.subtype.add(SubType.SAGA);
// (As this Saga enters and after your draw step, add a lore counter. Sacrifice after IV.)
SagaAbility sagaAbility = new SagaAbility(this, SagaChapter.CHAPTER_IV);
// I, II, III Until end of turn, target creature gains trample and gets +X/+0, where X is the number of lore counters on The Triumph of Anax.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_III,
new Effects(new GainAbilityTargetEffect(
TrampleAbility.getInstance(), Duration.EndOfTurn,
"Until end of turn, target creature gains trample"
), new BoostTargetEffect(
xValue, StaticValue.getZeroValue(), Duration.EndOfTurn, true
).setText("and gets +X/+0, where X is the number of lore counters on {this}")),
new TargetCreaturePermanent()
);
// IV Target creature you control fights up to one target creature you don't control.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_IV, SagaChapter.CHAPTER_IV,
new Effects(new FightTargetsEffect(
"Target creature you control fights up to one target creature you don't control"
)), new Targets(
new TargetControlledCreaturePermanent(),
new TargetPermanent(0, 1, filter, false)
)
);
}
private TheTriumphOfAnax(final TheTriumphOfAnax card) {
super(card);
}
@Override
public TheTriumphOfAnax copy() {
return new TheTriumphOfAnax(this);
}
}

View file

@ -105,6 +105,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
cards.add(new SetCardInfo("The Akroan War", 124, Rarity.RARE, mage.cards.t.TheAkroanWar.class)); cards.add(new SetCardInfo("The Akroan War", 124, Rarity.RARE, mage.cards.t.TheAkroanWar.class));
cards.add(new SetCardInfo("The Binding of the Titans", 166, Rarity.UNCOMMON, mage.cards.t.TheBindingOfTheTitans.class)); cards.add(new SetCardInfo("The Binding of the Titans", 166, Rarity.UNCOMMON, mage.cards.t.TheBindingOfTheTitans.class));
cards.add(new SetCardInfo("The Birth of Meletis", 5, Rarity.UNCOMMON, mage.cards.t.TheBirthOfMeletis.class)); cards.add(new SetCardInfo("The Birth of Meletis", 5, Rarity.UNCOMMON, mage.cards.t.TheBirthOfMeletis.class));
cards.add(new SetCardInfo("The Triumph of Anax", 160, Rarity.UNCOMMON, mage.cards.t.TheTriumphOfAnax.class));
cards.add(new SetCardInfo("Thirst for Meaning", 74, Rarity.COMMON, mage.cards.t.ThirstForMeaning.class)); cards.add(new SetCardInfo("Thirst for Meaning", 74, Rarity.COMMON, mage.cards.t.ThirstForMeaning.class));
cards.add(new SetCardInfo("Towering-Wave Mystic", 77, Rarity.COMMON, mage.cards.t.ToweringWaveMystic.class)); cards.add(new SetCardInfo("Towering-Wave Mystic", 77, Rarity.COMMON, mage.cards.t.ToweringWaveMystic.class));
cards.add(new SetCardInfo("Treacherous Blessing", 316, Rarity.RARE, mage.cards.t.TreacherousBlessing.class)); cards.add(new SetCardInfo("Treacherous Blessing", 316, Rarity.RARE, mage.cards.t.TreacherousBlessing.class));

View file

@ -14,11 +14,10 @@ import java.util.Set;
*/ */
public class Effects extends ArrayList<Effect> { public class Effects extends ArrayList<Effect> {
public Effects() { public Effects(Effect... effects) {
} for (Effect effect : effects) {
this.add(effect);
public Effects(Effect effect) { }
this.add(effect);
} }
public Effects(final Effects effects) { public Effects(final Effects effects) {

View file

@ -1,14 +1,19 @@
package mage.constants; package mage.constants;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public enum SagaChapter { public enum SagaChapter {
CHAPTER_I(1, "I"), CHAPTER_I(1, "I"),
CHAPTER_II(2, "II"), CHAPTER_II(2, "II"),
CHAPTER_III(3, "III"); CHAPTER_III(3, "III"),
CHAPTER_IV(4, "IV");
private static final Map<Integer, SagaChapter> chapterMap = new HashMap();
private final String text; private final String text;
private final int number; private final int number;
@ -28,15 +33,14 @@ public enum SagaChapter {
} }
public static SagaChapter getChapter(int number) { public static SagaChapter getChapter(int number) {
switch (number) { initMap();
case 1: return chapterMap.get(number);
return CHAPTER_I; }
case 2:
return CHAPTER_II; private static void initMap() {
case 3: if (!chapterMap.isEmpty()) {
return CHAPTER_III; return;
default:
return null;
} }
Arrays.stream(SagaChapter.values()).forEach(sagaChapter -> chapterMap.put(sagaChapter.getNumber(), sagaChapter));
} }
} }

View file

@ -19,11 +19,10 @@ public class Targets extends ArrayList<Target> {
private static final Logger logger = Logger.getLogger(Targets.class); private static final Logger logger = Logger.getLogger(Targets.class);
public Targets() { public Targets(Target... targets) {
} for (Target target : targets) {
this.add(target);
public Targets(Target target) { }
this.add(target);
} }
public Targets(final Targets targets) { public Targets(final Targets targets) {