[LCC] Implement Pantlaza, Sun-Favored (#11590)

This commit is contained in:
jimga150 2023-12-31 14:24:55 -05:00 committed by GitHub
parent 9b3ff32a33
commit 53d62c7f44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 1 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.keyword.DiscoverEffect;
import mage.constants.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author jimga150
*/
public final class PantlazaSunFavored extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent(SubType.DINOSAUR, "Dinosaur");
public PantlazaSunFavored(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{G}{W}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.DINOSAUR);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Whenever Pantlaza, Sun-Favored or another Dinosaur enters the battlefield under your control,
// you may discover X, where X is that creature's toughness. Do this only once each turn.
this.addAbility(new EntersBattlefieldThisOrAnotherTriggeredAbility(
new PantlazaSunFavoredEffect(), filter, true, SetTargetPointer.PERMANENT, true
).setDoOnlyOnceEachTurn(true));
}
private PantlazaSunFavored(final PantlazaSunFavored card) {
super(card);
}
@Override
public PantlazaSunFavored copy() {
return new PantlazaSunFavored(this);
}
}
// Based on Dinosaur Egg
class PantlazaSunFavoredEffect extends OneShotEffect {
PantlazaSunFavoredEffect() {
super(Outcome.PlayForFree);
staticText = "discover X, where X is that creature's toughness";
}
private PantlazaSunFavoredEffect(final PantlazaSunFavoredEffect effect) {
super(effect);
}
@Override
public PantlazaSunFavoredEffect copy() {
return new PantlazaSunFavoredEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
if (player == null || permanent == null) {
return false;
}
DiscoverEffect.doDiscover(player, Math.max(0, permanent.getToughness().getValue()), game, source);
return true;
}
}

View file

@ -191,6 +191,7 @@ public final class LostCavernsOfIxalanCommander extends ExpansionSet {
cards.add(new SetCardInfo("Orzhov Signet", 310, Rarity.UNCOMMON, mage.cards.o.OrzhovSignet.class));
cards.add(new SetCardInfo("Otepec Huntmaster", 229, Rarity.UNCOMMON, mage.cards.o.OtepecHuntmaster.class));
cards.add(new SetCardInfo("Pact of the Serpent", 206, Rarity.RARE, mage.cards.p.PactOfTheSerpent.class));
cards.add(new SetCardInfo("Pantlaza, Sun-Favored", 4, Rarity.MYTHIC, mage.cards.p.PantlazaSunFavored.class));
cards.add(new SetCardInfo("Path of Ancestry", 346, Rarity.COMMON, mage.cards.p.PathOfAncestry.class));
cards.add(new SetCardInfo("Path to Exile", 134, Rarity.UNCOMMON, mage.cards.p.PathToExile.class));
cards.add(new SetCardInfo("Patron of the Vein", 207, Rarity.RARE, mage.cards.p.PatronOfTheVein.class));

View file

@ -20,7 +20,7 @@ public class EntersBattlefieldThisOrAnotherTriggeredAbility extends EntersBattle
setTriggerPhrase("Whenever " + this.filter.getMessage() + " enters the battlefield" + (onlyControlled ? " under your control, " : ", "));
}
private EntersBattlefieldThisOrAnotherTriggeredAbility(final EntersBattlefieldThisOrAnotherTriggeredAbility ability) {
protected EntersBattlefieldThisOrAnotherTriggeredAbility(final EntersBattlefieldThisOrAnotherTriggeredAbility ability) {
super(ability);
}