[OTJ] Implement Vial-Smasher, Gleeful Grenadier

This commit is contained in:
theelk801 2024-03-27 08:35:22 -04:00
parent 1edbb9c68e
commit fd856d49eb
4 changed files with 88 additions and 2 deletions

View file

@ -0,0 +1,55 @@
package mage.cards.v;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.filter.predicate.mageobject.OutlawPredicate;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class VialSmasherGleefulGrenadier extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("another outlaw");
static {
filter.add(AnotherPredicate.instance);
filter.add(OutlawPredicate.instance);
}
public VialSmasherGleefulGrenadier(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{R}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.GOBLIN);
this.subtype.add(SubType.MERCENARY);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Whenever another outlaw enters the battlefield under your control, Vial Smasher, Gleeful Grenadier deals 1 damage to target opponent.
Ability ability = new EntersBattlefieldControlledTriggeredAbility(new DamageTargetEffect(1), filter);
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
}
private VialSmasherGleefulGrenadier(final VialSmasherGleefulGrenadier card) {
super(card);
}
@Override
public VialSmasherGleefulGrenadier copy() {
return new VialSmasherGleefulGrenadier(this);
}
}

View file

@ -51,6 +51,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet {
cards.add(new SetCardInfo("Soured Springs", 264, Rarity.COMMON, mage.cards.s.SouredSprings.class));
cards.add(new SetCardInfo("Spirebluff Canal", 270, Rarity.RARE, mage.cards.s.SpirebluffCanal.class));
cards.add(new SetCardInfo("Swamp", 274, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Vial Smasher, Gleeful Grenadier", 235, Rarity.UNCOMMON, mage.cards.v.VialSmasherGleefulGrenadier.class));
cards.removeIf(setCardInfo -> unfinished.contains(setCardInfo.getName())); // remove when mechanic is implemented
}

View file

@ -167,11 +167,19 @@ public interface MageObject extends MageItem, Serializable, Copyable<MageObject>
void setZoneChangeCounter(int value, Game game);
default boolean isHistoric(Game game) {
return getCardType(game).contains(CardType.ARTIFACT)
|| getSuperType(game).contains(SuperType.LEGENDARY)
return isArtifact(game)
|| isLegendary(game)
|| hasSubtype(SubType.SAGA, game);
}
default boolean isOutlaw(Game game) {
return hasSubtype(SubType.ASSASSIN, game)
|| hasSubtype(SubType.MERCENARY, game)
|| hasSubtype(SubType.PIRATE, game)
|| hasSubtype(SubType.ROGUE, game)
|| hasSubtype(SubType.WARLOCK, game);
}
default boolean isCreature() {
return isCreature(null);
}

View file

@ -0,0 +1,22 @@
package mage.filter.predicate.mageobject;
import mage.MageObject;
import mage.filter.predicate.Predicate;
import mage.game.Game;
/**
* @author TheElk801
*/
public enum OutlawPredicate implements Predicate<MageObject> {
instance;
@Override
public boolean apply(MageObject input, Game game) {
return input.isOutlaw(game);
}
@Override
public String toString() {
return "Outlaw";
}
}