forked from External/mage
[PIP] Implement Preston Garvey, Minuteman
This commit is contained in:
parent
2d74f18a40
commit
5dcbd6d318
3 changed files with 139 additions and 4 deletions
91
Mage.Sets/src/mage/cards/p/PrestonGarveyMinuteman.java
Normal file
91
Mage.Sets/src/mage/cards/p/PrestonGarveyMinuteman.java
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.UntapAllEffect;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.permanent.EnchantedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.SettlementToken;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class PrestonGarveyMinuteman extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent("each enchanted permanent you control");
|
||||
|
||||
static {
|
||||
filter.add(EnchantedPredicate.instance);
|
||||
}
|
||||
|
||||
public PrestonGarveyMinuteman(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{G}{W}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// At the beginning of combat on your turn, create a green Aura enchantment token named Settlement attached to up to one target land you control. It has enchant land and "Enchanted land has '{T}: Add one mana of any color.'"
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(new PrestonGarveyMinutemanEffect());
|
||||
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Whenever Preston Garvey, Minuteman attacks, untap each enchanted permanent you control.
|
||||
this.addAbility(new AttacksTriggeredAbility(new UntapAllEffect(filter)));
|
||||
}
|
||||
|
||||
private PrestonGarveyMinuteman(final PrestonGarveyMinuteman card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrestonGarveyMinuteman copy() {
|
||||
return new PrestonGarveyMinuteman(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PrestonGarveyMinutemanEffect extends OneShotEffect {
|
||||
|
||||
PrestonGarveyMinutemanEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "create a green Aura enchantment token named Settlement " +
|
||||
"attached to up to one target land you control. It has enchant land and " +
|
||||
"\"Enchanted land has '{T}: Add one mana of any color.'\"";
|
||||
}
|
||||
|
||||
private PrestonGarveyMinutemanEffect(final PrestonGarveyMinutemanEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrestonGarveyMinutemanEffect copy() {
|
||||
return new PrestonGarveyMinutemanEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
return permanent != null && new SettlementToken().putOntoBattlefield(
|
||||
1, game, source, source.getControllerId(), false,
|
||||
false, null, permanent.getId()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -680,10 +680,10 @@ public final class Fallout extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Pre-War Formalwear", 369, Rarity.RARE, mage.cards.p.PreWarFormalwear.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Pre-War Formalwear", 549, Rarity.RARE, mage.cards.p.PreWarFormalwear.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Pre-War Formalwear", 897, Rarity.RARE, mage.cards.p.PreWarFormalwear.class, NON_FULL_USE_VARIOUS));
|
||||
//cards.add(new SetCardInfo("Preston Garvey, Minuteman", 425, Rarity.MYTHIC, mage.cards.p.PrestonGarveyMinuteman.class, NON_FULL_USE_VARIOUS));
|
||||
//cards.add(new SetCardInfo("Preston Garvey, Minuteman", 536, Rarity.MYTHIC, mage.cards.p.PrestonGarveyMinuteman.class, NON_FULL_USE_VARIOUS));
|
||||
//cards.add(new SetCardInfo("Preston Garvey, Minuteman", 8, Rarity.MYTHIC, mage.cards.p.PrestonGarveyMinuteman.class, NON_FULL_USE_VARIOUS));
|
||||
//cards.add(new SetCardInfo("Preston Garvey, Minuteman", 953, Rarity.MYTHIC, mage.cards.p.PrestonGarveyMinuteman.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Preston Garvey, Minuteman", 425, Rarity.MYTHIC, mage.cards.p.PrestonGarveyMinuteman.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Preston Garvey, Minuteman", 536, Rarity.MYTHIC, mage.cards.p.PrestonGarveyMinuteman.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Preston Garvey, Minuteman", 8, Rarity.MYTHIC, mage.cards.p.PrestonGarveyMinuteman.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Preston Garvey, Minuteman", 953, Rarity.MYTHIC, mage.cards.p.PrestonGarveyMinuteman.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Puresteel Paladin", 170, Rarity.RARE, mage.cards.p.PuresteelPaladin.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Puresteel Paladin", 456, Rarity.RARE, mage.cards.p.PuresteelPaladin.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Puresteel Paladin", 698, Rarity.RARE, mage.cards.p.PuresteelPaladin.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.mana.AnyColorManaAbility;
|
||||
import mage.constants.*;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SettlementToken extends TokenImpl {
|
||||
|
||||
public SettlementToken() {
|
||||
super("Settlement", "Settlement token");
|
||||
cardType.add(CardType.ENCHANTMENT);
|
||||
color.setGreen(true);
|
||||
subtype.add(SubType.AURA);
|
||||
|
||||
TargetPermanent auraTarget = new TargetLandPermanent();
|
||||
Ability ability = new EnchantAbility(auraTarget);
|
||||
ability.addTarget(auraTarget);
|
||||
ability.addEffect(new AttachEffect(Outcome.Benefit));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Enchanted land has "{T}: Add one mana of any color."
|
||||
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(
|
||||
new AnyColorManaAbility(), AttachmentType.AURA, Duration.WhileOnBattlefield,
|
||||
"enchanted land has \"{T}: Add one mana of any color.\""
|
||||
)));
|
||||
}
|
||||
|
||||
private SettlementToken(final SettlementToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public SettlementToken copy() {
|
||||
return new SettlementToken(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue