forked from External/mage
[TLA] Implement Zhao, the Moon Slayer
This commit is contained in:
parent
70444ba7de
commit
d7b5c21894
6 changed files with 121 additions and 125 deletions
|
|
@ -1,16 +1,10 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
import mage.abilities.effects.common.continuous.NonbasicLandsAreMountainsEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.constants.CardType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -23,7 +17,7 @@ public final class BloodMoon extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||
|
||||
// Nonbasic lands are Mountains.
|
||||
this.addAbility(new SimpleStaticAbility(new BloodMoonEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(new NonbasicLandsAreMountainsEffect()));
|
||||
}
|
||||
|
||||
private BloodMoon(final BloodMoon card) {
|
||||
|
|
@ -34,57 +28,4 @@ public final class BloodMoon extends CardImpl {
|
|||
public BloodMoon copy() {
|
||||
return new BloodMoon(this);
|
||||
}
|
||||
|
||||
static class BloodMoonEffect extends ContinuousEffectImpl {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(SuperType.BASIC.getPredicate()));
|
||||
}
|
||||
|
||||
BloodMoonEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
this.staticText = "Nonbasic lands are Mountains";
|
||||
this.dependencyTypes.add(DependencyType.BecomeMountain);
|
||||
this.dependendToTypes.add(DependencyType.BecomeNonbasicLand);
|
||||
}
|
||||
|
||||
private BloodMoonEffect(final BloodMoonEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BloodMoonEffect copy() {
|
||||
return new BloodMoonEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
// 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects
|
||||
// So the ability removing has to be done before Layer 6
|
||||
// Lands have their mana ability intrinsically, so that is added in layer 4
|
||||
land.removeAllSubTypes(game, SubTypeSet.NonBasicLandType);
|
||||
land.addSubType(game, SubType.MOUNTAIN);
|
||||
land.removeAllAbilities(source.getSourceId(), game);
|
||||
land.addAbility(new RedManaAbility(), source.getSourceId(), game);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.TypeChangingEffects_4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,12 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
import mage.abilities.effects.common.continuous.NonbasicLandsAreMountainsEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -29,7 +24,7 @@ public final class MagusOfTheMoon extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Nonbasic lands are Mountains.
|
||||
this.addAbility(new SimpleStaticAbility(new MagusOfTheMoonEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(new NonbasicLandsAreMountainsEffect()));
|
||||
}
|
||||
|
||||
private MagusOfTheMoon(final MagusOfTheMoon card) {
|
||||
|
|
@ -40,58 +35,4 @@ public final class MagusOfTheMoon extends CardImpl {
|
|||
public MagusOfTheMoon copy() {
|
||||
return new MagusOfTheMoon(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MagusOfTheMoonEffect extends ContinuousEffectImpl {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(SuperType.BASIC.getPredicate()));
|
||||
}
|
||||
|
||||
MagusOfTheMoonEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
this.staticText = "Nonbasic lands are Mountains";
|
||||
dependendToTypes.add(DependencyType.BecomeNonbasicLand);
|
||||
dependencyTypes.add(DependencyType.BecomeMountain);
|
||||
}
|
||||
|
||||
private MagusOfTheMoonEffect(final MagusOfTheMoonEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagusOfTheMoonEffect copy() {
|
||||
return new MagusOfTheMoonEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
// 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects
|
||||
// So the ability removing has to be done before Layer 6
|
||||
land.removeAllAbilities(source.getSourceId(), game);
|
||||
land.removeAllSubTypes(game, SubTypeSet.NonBasicLandType);
|
||||
land.addSubType(game, SubType.MOUNTAIN);
|
||||
// Mountains have the red mana ability intrinsically so the ability must be added in this layer
|
||||
land.addAbility(new RedManaAbility(), source.getSourceId(), game);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.TypeChangingEffects_4;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
66
Mage.Sets/src/mage/cards/z/ZhaoTheMoonSlayer.java
Normal file
66
Mage.Sets/src/mage/cards/z/ZhaoTheMoonSlayer.java
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
package mage.cards.z;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.common.PermanentsEnterBattlefieldTappedEffect;
|
||||
import mage.abilities.effects.common.continuous.NonbasicLandsAreMountainsEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ZhaoTheMoonSlayer extends CardImpl {
|
||||
|
||||
private static final Condition condition = new SourceHasCounterCondition(CounterType.CONQUEROR);
|
||||
|
||||
public ZhaoTheMoonSlayer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Menace
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// Nonbasic lands enter tapped.
|
||||
this.addAbility(new SimpleStaticAbility(new PermanentsEnterBattlefieldTappedEffect(StaticFilters.FILTER_LANDS_NONBASIC)));
|
||||
|
||||
// {7}: Put a conqueror counter on Zhao.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new AddCountersSourceEffect(CounterType.CONQUEROR.createInstance()), new GenericManaCost(7)
|
||||
));
|
||||
|
||||
// As long as Zhao has a conqueror counter on him, nonbasic lands are Mountains.
|
||||
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
|
||||
new NonbasicLandsAreMountainsEffect(), condition,
|
||||
"as long as {this} has a conqueror counter on him, nonbasic lands are Mountains"
|
||||
)));
|
||||
}
|
||||
|
||||
private ZhaoTheMoonSlayer(final ZhaoTheMoonSlayer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZhaoTheMoonSlayer copy() {
|
||||
return new ZhaoTheMoonSlayer(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -341,6 +341,8 @@ public final class AvatarTheLastAirbender extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Yue, the Moon Spirit", 83, Rarity.RARE, mage.cards.y.YueTheMoonSpirit.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Yuyan Archers", 161, Rarity.COMMON, mage.cards.y.YuyanArchers.class));
|
||||
cards.add(new SetCardInfo("Zhao, Ruthless Admiral", 252, Rarity.UNCOMMON, mage.cards.z.ZhaoRuthlessAdmiral.class));
|
||||
cards.add(new SetCardInfo("Zhao, the Moon Slayer", 162, Rarity.RARE, mage.cards.z.ZhaoTheMoonSlayer.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Zhao, the Moon Slayer", 376, Rarity.RARE, mage.cards.z.ZhaoTheMoonSlayer.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Zuko's Conviction", 123, Rarity.UNCOMMON, mage.cards.z.ZukosConviction.class));
|
||||
cards.add(new SetCardInfo("Zuko's Exile", 3, Rarity.COMMON, mage.cards.z.ZukosExile.class));
|
||||
cards.add(new SetCardInfo("Zuko, Exiled Prince", 163, Rarity.UNCOMMON, mage.cards.z.ZukoExiledPrince.class));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class NonbasicLandsAreMountainsEffect extends ContinuousEffectImpl {
|
||||
|
||||
public NonbasicLandsAreMountainsEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Detriment);
|
||||
this.staticText = "nonbasic lands are Mountains";
|
||||
this.dependencyTypes.add(DependencyType.BecomeMountain);
|
||||
this.dependendToTypes.add(DependencyType.BecomeNonbasicLand);
|
||||
}
|
||||
|
||||
private NonbasicLandsAreMountainsEffect(final NonbasicLandsAreMountainsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NonbasicLandsAreMountainsEffect copy() {
|
||||
return new NonbasicLandsAreMountainsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent land : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LANDS_NONBASIC, source.getControllerId(), game)) {
|
||||
// 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects
|
||||
// So the ability removing has to be done before Layer 6
|
||||
// Lands have their mana ability intrinsically, so that is added in layer 4
|
||||
land.removeAllSubTypes(game, SubTypeSet.NonBasicLandType);
|
||||
land.addSubType(game, SubType.MOUNTAIN);
|
||||
land.removeAllAbilities(source.getSourceId(), game);
|
||||
land.addAbility(new RedManaAbility(), source.getSourceId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -46,6 +46,7 @@ public enum CounterType {
|
|||
COLLECTION("collection"),
|
||||
COMPONENT("component"),
|
||||
CONTESTED("contested"),
|
||||
CONQUEROR("conqueror"),
|
||||
CORPSE("corpse"),
|
||||
CORRUPTION("corruption"),
|
||||
CREDIT("credit"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue