Merge branch 'master' into refactor/rework-tdfcs

This commit is contained in:
theelk801 2023-08-31 18:02:25 -04:00
commit 6db5aa75aa
682 changed files with 3712 additions and 1633 deletions

View file

@ -7,7 +7,10 @@ import mage.util.CardUtil;
import mage.view.CardsView; import mage.view.CardsView;
import java.awt.*; import java.awt.*;
import java.util.*; import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
/** /**
* GUI: parameters for dialogs, uses to store useful data * GUI: parameters for dialogs, uses to store useful data
@ -102,7 +105,7 @@ public class DlgParams {
return stringList; return stringList;
} }
public void setStringList(ArrayList<String> stringList) { public void setStringList(List<String> stringList) {
this.stringList = stringList; this.stringList = stringList;
} }
@ -118,7 +121,7 @@ public class DlgParams {
return objectList; return objectList;
} }
public void setObjectList(ArrayList<Object> objectList) { public void setObjectList(List<Object> objectList) {
this.objectList = objectList; this.objectList = objectList;
} }

View file

@ -1213,7 +1213,7 @@ public class HumanPlayer extends PlayerImpl {
Zone zone = game.getState().getZone(object.getId()); Zone zone = game.getState().getZone(object.getId());
if (zone != null) { if (zone != null) {
// look at card or try to cast/activate abilities // look at card or try to cast/activate abilities
LinkedHashMap<UUID, ActivatedAbility> useableAbilities = new LinkedHashMap<>(); Map<UUID, ActivatedAbility> useableAbilities = new LinkedHashMap<>();
Player actingPlayer = null; Player actingPlayer = null;
if (playerId.equals(game.getPriorityPlayerId())) { if (playerId.equals(game.getPriorityPlayerId())) {
@ -1559,7 +1559,7 @@ public class HumanPlayer extends PlayerImpl {
Zone zone = game.getState().getZone(object.getId()); Zone zone = game.getState().getZone(object.getId());
if (zone != null) { if (zone != null) {
LinkedHashMap<UUID, ActivatedManaAbilityImpl> useableAbilities = getUseableManaAbilities(object, zone, game); Map<UUID, ActivatedManaAbilityImpl> useableAbilities = getUseableManaAbilities(object, zone, game);
if (!useableAbilities.isEmpty()) { if (!useableAbilities.isEmpty()) {
// Added to ensure that mana is not being autopaid for spells that care about the color of mana being paid // Added to ensure that mana is not being autopaid for spells that care about the color of mana being paid
// See https://github.com/magefree/mage/issues/9070 // See https://github.com/magefree/mage/issues/9070
@ -2164,7 +2164,7 @@ public class HumanPlayer extends PlayerImpl {
return super.activateAbility(ability, game); return super.activateAbility(ability, game);
} }
protected void activateAbility(LinkedHashMap<UUID, ? extends ActivatedAbility> abilities, MageObject object, Game game) { protected void activateAbility(Map<UUID, ? extends ActivatedAbility> abilities, MageObject object, Game game) {
if (gameInCheckPlayableState(game)) { if (gameInCheckPlayableState(game)) {
return; return;
} }
@ -2268,7 +2268,7 @@ public class HumanPlayer extends PlayerImpl {
MageObject object = game.getObject(card.getId()); // must be object to find real abilities (example: commander) MageObject object = game.getObject(card.getId()); // must be object to find real abilities (example: commander)
if (object != null) { if (object != null) {
String message = "Choose ability to cast" + (noMana ? " for FREE" : "") + "<br>" + object.getLogName(); String message = "Choose ability to cast" + (noMana ? " for FREE" : "") + "<br>" + object.getLogName();
LinkedHashMap<UUID, SpellAbility> useableAbilities = PlayerImpl.getCastableSpellAbilities(game, playerId, object, game.getState().getZone(object.getId()), noMana); Map<UUID, SpellAbility> useableAbilities = PlayerImpl.getCastableSpellAbilities(game, playerId, object, game.getState().getZone(object.getId()), noMana);
if (useableAbilities != null if (useableAbilities != null
&& useableAbilities.size() == 1) { && useableAbilities.size() == 1) {
return useableAbilities.values().iterator().next(); return useableAbilities.values().iterator().next();

View file

@ -33,7 +33,7 @@ public class DraftController {
private final Draft draft; private final Draft draft;
private final UUID tableId; private final UUID tableId;
public DraftController(ManagerFactory managerFactory, Draft draft, ConcurrentHashMap<UUID, UUID> userPlayerMap, UUID tableId) { public DraftController(ManagerFactory managerFactory, Draft draft, ConcurrentMap<UUID, UUID> userPlayerMap, UUID tableId) {
this.managerFactory = managerFactory; this.managerFactory = managerFactory;
draftSessionId = UUID.randomUUID(); draftSessionId = UUID.randomUUID();
this.userPlayerMap = userPlayerMap; this.userPlayerMap = userPlayerMap;

View file

@ -68,11 +68,11 @@ public final class AgathaOfTheVileCauldron extends CardImpl {
class AgathaOfTheVileCauldronEffect extends CostModificationEffectImpl { class AgathaOfTheVileCauldronEffect extends CostModificationEffectImpl {
private final static DynamicValue xValue = new SourcePermanentPowerCount(false); private static final DynamicValue xValue = new SourcePermanentPowerCount(false);
AgathaOfTheVileCauldronEffect() { AgathaOfTheVileCauldronEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
staticText = "Activated abilities of creatures you control cost X less to activate, " staticText = "Activated abilities of creatures you control cost {X} less to activate, "
+ "where X is {this}'s power. " + "where X is {this}'s power. "
+ "This effect can't reduce the mana in that cost to less than one mana."; + "This effect can't reduce the mana in that cost to less than one mana.";
} }

View file

@ -2,7 +2,6 @@ package mage.cards.a;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
@ -100,11 +99,11 @@ enum AkimTheSoaringWindCondition implements Condition {
class AkimTheSoaringTokenAbility extends TriggeredAbilityImpl { class AkimTheSoaringTokenAbility extends TriggeredAbilityImpl {
public AkimTheSoaringTokenAbility() { AkimTheSoaringTokenAbility() {
super(Zone.BATTLEFIELD, new CreateTokenEffect(new BirdToken(), 1), false); super(Zone.BATTLEFIELD, new CreateTokenEffect(new BirdToken(), 1), false);
} }
public AkimTheSoaringTokenAbility(final AkimTheSoaringTokenAbility ability) { private AkimTheSoaringTokenAbility(final AkimTheSoaringTokenAbility ability) {
super(ability); super(ability);
} }
@ -124,7 +123,7 @@ class AkimTheSoaringTokenAbility extends TriggeredAbilityImpl {
} }
@Override @Override
public TriggeredAbility copy() { public AkimTheSoaringTokenAbility copy() {
return new AkimTheSoaringTokenAbility(this); return new AkimTheSoaringTokenAbility(this);
} }

View file

@ -37,6 +37,8 @@ public final class AltarOfBhaal extends AdventureCard {
// Bone Offering // Bone Offering
// Create a tapped 4/1 black Skeleton creature token with menace. // Create a tapped 4/1 black Skeleton creature token with menace.
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new SkeletonMenaceToken(), 1, true, false)); this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new SkeletonMenaceToken(), 1, true, false));
this.finalizeAdventure();
} }
private AltarOfBhaal(final AltarOfBhaal card) { private AltarOfBhaal(final AltarOfBhaal card) {

View file

@ -34,6 +34,8 @@ public final class AmethystDragon extends AdventureCard {
// Explosive Crystal deals 4 damage divided as you choose among any number of targets. // Explosive Crystal deals 4 damage divided as you choose among any number of targets.
this.getSpellCard().getSpellAbility().addEffect(new DamageMultiEffect(4)); this.getSpellCard().getSpellAbility().addEffect(new DamageMultiEffect(4));
this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTargetAmount(4)); this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTargetAmount(4));
this.finalizeAdventure();
} }
private AmethystDragon(final AmethystDragon card) { private AmethystDragon(final AmethystDragon card) {

View file

@ -83,8 +83,7 @@ class AmplifireEffect extends OneShotEffect {
SetBasePowerToughnessSourceEffect setBasePowerToughnessSourceEffect = new SetBasePowerToughnessSourceEffect( SetBasePowerToughnessSourceEffect setBasePowerToughnessSourceEffect = new SetBasePowerToughnessSourceEffect(
2*lastCard.getPower().getValue(), 2*lastCard.getPower().getValue(),
2*lastCard.getToughness().getValue(), 2*lastCard.getToughness().getValue(),
Duration.UntilYourNextTurn, Duration.UntilYourNextTurn
SubLayer.SetPT_7b
); );
game.addEffect(setBasePowerToughnessSourceEffect, source); game.addEffect(setBasePowerToughnessSourceEffect, source);
} }

View file

@ -2,11 +2,12 @@ package mage.cards.a;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect; import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicate; import mage.filter.predicate.Predicate;
import mage.game.Game; import mage.game.Game;
@ -20,10 +21,11 @@ import java.util.UUID;
public final class AncientLumberknot extends CardImpl { public final class AncientLumberknot extends CardImpl {
private static final FilterCreaturePermanent filter private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you control with toughness greater than its power"); = new FilterCreaturePermanent("each creature you control with toughness greater than its power");
static { static {
filter.add(AncientLumberknotPredicate.instance); filter.add(AncientLumberknotPredicate.instance);
filter.add(TargetController.YOU.getControllerPredicate());
} }
public AncientLumberknot(UUID ownerId, CardSetInfo setInfo) { public AncientLumberknot(UUID ownerId, CardSetInfo setInfo) {
@ -34,7 +36,7 @@ public final class AncientLumberknot extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// Each creature you control with toughness greater than its power assigns combat damage equal to its toughness rather than its power. // Each creature you control with toughness greater than its power assigns combat damage equal to its toughness rather than its power.
this.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessEffect(filter, true))); this.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessAllEffect(filter)));
} }
private AncientLumberknot(final AncientLumberknot card) { private AncientLumberknot(final AncientLumberknot card) {

View file

@ -52,6 +52,8 @@ public final class AnimatingFaerie extends AdventureCard {
CounterType.P1P1.createInstance(4) CounterType.P1P1.createInstance(4)
).setText(" ")); ).setText(" "));
this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter));
this.finalizeAdventure();
} }
private AnimatingFaerie(final AnimatingFaerie card) { private AnimatingFaerie(final AnimatingFaerie card) {

View file

@ -124,7 +124,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl {
toughness = 5; toughness = 5;
break; break;
} }
game.addEffect(new SetBasePowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a), source); game.addEffect(new SetBasePowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield), source);
return false; return false;
} }

View file

@ -42,6 +42,8 @@ public final class AquaticAlchemist extends AdventureCard {
this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard( this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(
StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY_FROM_YOUR_GRAVEYARD StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY_FROM_YOUR_GRAVEYARD
)); ));
this.finalizeAdventure();
} }
private AquaticAlchemist(final AquaticAlchemist card) { private AquaticAlchemist(final AquaticAlchemist card) {

View file

@ -6,7 +6,7 @@ import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderAllEffect; import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderAllEffect;
import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect; import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessAllEffect;
import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.DefenderAbility;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VigilanceAbility; import mage.abilities.keyword.VigilanceAbility;
@ -24,13 +24,14 @@ import java.util.UUID;
*/ */
public final class ArcadesTheStrategist extends CardImpl { public final class ArcadesTheStrategist extends CardImpl {
private static final FilterControlledCreaturePermanent filter private static final FilterControlledCreaturePermanent defenderSingle = new FilterControlledCreaturePermanent("a creature with defender");
= new FilterControlledCreaturePermanent("a creature with defender"); private static final FilterCreaturePermanent defenderPlural = new FilterCreaturePermanent("Each creature you control with defender");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent();
static { static {
filter.add(new AbilityPredicate(DefenderAbility.class)); defenderSingle.add(new AbilityPredicate(DefenderAbility.class));
filter2.add(new AbilityPredicate(DefenderAbility.class));
defenderPlural.add(TargetController.YOU.getControllerPredicate());
defenderPlural.add(new AbilityPredicate(DefenderAbility.class));
} }
public ArcadesTheStrategist(UUID ownerId, CardSetInfo setInfo) { public ArcadesTheStrategist(UUID ownerId, CardSetInfo setInfo) {
@ -50,13 +51,13 @@ public final class ArcadesTheStrategist extends CardImpl {
// Whenever a creature with defender enters the battlefield under your control, draw a card. // Whenever a creature with defender enters the battlefield under your control, draw a card.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility( this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
new DrawCardSourceControllerEffect(1), filter new DrawCardSourceControllerEffect(1), defenderSingle
)); ));
// Each creature you control with defender assigns combat damage equal to its toughness rather than its power and can attack as though it didn't have defender. // Each creature you control with defender assigns combat damage equal to its toughness rather than its power and can attack as though it didn't have defender.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new CombatDamageByToughnessEffect(filter2, true).setText("Each creature you control with defender assigns combat damage equal to its toughness rather than its power")); Ability ability = new SimpleStaticAbility(new CombatDamageByToughnessAllEffect(defenderPlural));
ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderAllEffect( ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderAllEffect(
Duration.WhileOnBattlefield, filter Duration.WhileOnBattlefield, defenderSingle
).setText("and can attack as though it didn't have defender")); ).setText("and can attack as though it didn't have defender"));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -31,6 +31,8 @@ public final class ArdenvaleTactician extends AdventureCard {
// Tap up to two target creatures. // Tap up to two target creatures.
this.getSpellCard().getSpellAbility().addEffect(new TapTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new TapTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2));
this.finalizeAdventure();
} }
private ArdenvaleTactician(final ArdenvaleTactician card) { private ArdenvaleTactician(final ArdenvaleTactician card) {

View file

@ -4,9 +4,8 @@ import mage.MageInt;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.keyword.BoastAbility; import mage.abilities.keyword.BoastAbility;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -88,7 +87,7 @@ class ArniBrokenbrowEffect extends OneShotEffect {
if (controller.chooseUse(outcome, "Change base power of " + mageObject.getLogName() + " to " if (controller.chooseUse(outcome, "Change base power of " + mageObject.getLogName() + " to "
+ power + " until end of turn?", source, game + power + " until end of turn?", source, game
)) { )) {
game.addEffect(new SetBasePowerToughnessSourceEffect(StaticValue.get(power), null, Duration.EndOfTurn, SubLayer.SetPT_7b), source); game.addEffect(new SetBasePowerSourceEffect(power, Duration.EndOfTurn), source);
return true; return true;
} }
return false; return false;

View file

@ -39,8 +39,7 @@ public final class AscendantSpirit extends CardImpl {
ability.addEffect(new SetBasePowerToughnessSourceEffect( ability.addEffect(new SetBasePowerToughnessSourceEffect(
2, 2,
3, 3,
Duration.WhileOnBattlefield, Duration.Custom
SubLayer.SetPT_7b
).setText("with base power and toughness 2/3")); ).setText("with base power and toughness 2/3"));
this.addAbility(ability); this.addAbility(ability);
@ -93,7 +92,7 @@ class AscendantSpiritWarriorEffect extends OneShotEffect {
Duration.Custom, SubType.SPIRIT, SubType.WARRIOR, SubType.ANGEL Duration.Custom, SubType.SPIRIT, SubType.WARRIOR, SubType.ANGEL
), source); ), source);
game.addEffect(new SetBasePowerToughnessSourceEffect( game.addEffect(new SetBasePowerToughnessSourceEffect(
4, 4, Duration.Custom, SubLayer.SetPT_7b 4, 4, Duration.Custom
), source); ), source);
return true; return true;
} }

View file

@ -0,0 +1,120 @@
package mage.cards.a;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.TotalCardsExiledOwnedManaValue;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileCardsFromTopOfLibraryTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.token.AshiokWickedManipulatorNightmareToken;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.watchers.common.CardsExiledThisTurnWatcher;
import java.util.Set;
import java.util.UUID;
/**
* @author Susucr
*/
public final class AshiokWickedManipulator extends CardImpl {
public AshiokWickedManipulator(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{B}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.ASHIOK);
this.setStartingLoyalty(5);
// If you would pay life while your library has at least that many cards in it, exile that many cards from the top of your library instead.
this.addAbility(new SimpleStaticAbility(new AshiokWickedManipulatorReplacementEffect()));
// +1: Look at the top two cards of your library. Exile one of them and put the other into your hand.
this.addAbility(new LoyaltyAbility(
new LookLibraryAndPickControllerEffect(2, 1, PutCards.EXILED, PutCards.HAND)
.setText("look at the top two cards of your library. Exile one of them and put the other into your hand"),
1
));
// -2: Create two 1/1 black Nightmare creature tokens with "At the beginning of combat on your turn, if a card was put into exile this turn, put a +1/+1 counter on this creature."
this.addAbility(new LoyaltyAbility(
new CreateTokenEffect(new AshiokWickedManipulatorNightmareToken(), 2),
-2
), new CardsExiledThisTurnWatcher());
// -7: Target player exiles the top X cards of their library, where X is the total mana value of cards you own in exile.
Ability ability = new LoyaltyAbility(
new ExileCardsFromTopOfLibraryTargetEffect(TotalCardsExiledOwnedManaValue.instance)
.setText("target player exiles the top X cards of their library, "
+ "where X is the total mana value of cards you own in exile"),
-7
);
ability.addTarget(new TargetPlayer());
ability.addHint(TotalCardsExiledOwnedManaValue.getHint());
this.addAbility(ability);
}
private AshiokWickedManipulator(final AshiokWickedManipulator card) {
super(card);
}
@Override
public AshiokWickedManipulator copy() {
return new AshiokWickedManipulator(this);
}
}
class AshiokWickedManipulatorReplacementEffect extends ReplacementEffectImpl {
AshiokWickedManipulatorReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "If you would pay life while your library has at least that many cards in it, "
+ "exile that many cards from the top of your library instead.";
}
private AshiokWickedManipulatorReplacementEffect(final AshiokWickedManipulatorReplacementEffect effect) {
super(effect);
}
@Override
public AshiokWickedManipulatorReplacementEffect copy() {
return new AshiokWickedManipulatorReplacementEffect(this);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Set<Card> cards = player.getLibrary().getTopCards(game, event.getAmount());
player.moveCardsToExile(cards, source, game, false, null, "");
return true;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.PAY_LIFE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
UUID playerId = source.getControllerId();
if (!event.getPlayerId().equals(playerId)) {
return false;
}
Player player = game.getPlayer(playerId);
return player != null && player.getLibrary().size() >= event.getAmount();
}
}

View file

@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderTargetEffect; import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderTargetEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect; import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessAllEffect;
import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -36,7 +36,7 @@ public final class AssaultFormation extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
// Each creature you control assigns combat damage equal to its toughness rather than its power. // Each creature you control assigns combat damage equal to its toughness rather than its power.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CombatDamageByToughnessEffect(StaticFilters.FILTER_PERMANENT_CREATURE, true))); this.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessAllEffect(StaticFilters.FILTER_CONTROLLED_CREATURE_EACH)));
// {G}: Target creature with defender can attack this turn as though it didn't have defender. // {G}: Target creature with defender can attack this turn as though it didn't have defender.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration.EndOfTurn), new ManaCostsImpl<>("{G}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration.EndOfTurn), new ManaCostsImpl<>("{G}"));

View file

@ -9,7 +9,7 @@ import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect; import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
@ -35,19 +35,19 @@ public final class BaldinCenturyHerdmaster extends CardImpl {
this.power = new MageInt(0); this.power = new MageInt(0);
this.toughness = new MageInt(7); this.toughness = new MageInt(7);
// Sumo SpiritAs long as it's your turn, each creature assigns combat damage equal to its toughness rather than its power. // As long as it's your turn, each creature assigns combat damage equal to its toughness rather than its power.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new CombatDamageByToughnessEffect(StaticFilters.FILTER_PERMANENT_CREATURE, false), new CombatDamageByToughnessAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE),
MyTurnCondition.instance, "as long as it's your turn, each creature " + MyTurnCondition.instance, "as long as it's your turn, each creature " +
"assigns combat damage equal to its toughness rather than its power" "assigns combat damage equal to its toughness rather than its power"
)).withFlavorWord("Sumo Spirit")); )));
// Hundred Hand SlapWhenever E. Honda, Sumo Champion attacks, up to one hundred target creatures each get +0/+X until end of turn, where X is the number of cards in your hand. // Whenever Baldin, Century Herdmaster attacks, up to one hundred target creatures each get +0/+X until end of turn, where X is the number of cards in your hand.
Ability ability = new AttacksTriggeredAbility(new BoostTargetEffect( Ability ability = new AttacksTriggeredAbility(new BoostTargetEffect(
StaticValue.get(0), CardsInControllerHandCount.instance, Duration.EndOfTurn StaticValue.get(0), CardsInControllerHandCount.instance, Duration.EndOfTurn
).setText("up to one hundred target creatures each get +0/+X until end of turn, where X is the number of cards in your hand")); ).setText("up to one hundred target creatures each get +0/+X until end of turn, where X is the number of cards in your hand"));
ability.addTarget(new TargetCreaturePermanent(0, 100)); ability.addTarget(new TargetCreaturePermanent(0, 100));
this.addAbility(ability.withFlavorWord("Hundred Hand Slap")); this.addAbility(ability);
} }
private BaldinCenturyHerdmaster(final BaldinCenturyHerdmaster card) { private BaldinCenturyHerdmaster(final BaldinCenturyHerdmaster card) {

View file

@ -12,7 +12,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubLayer;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
@ -41,7 +40,7 @@ public final class BattlegateMimic extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Whenever you cast a spell that's both red and white, Battlegate Mimic has base power and toughness 4/2 and gains first strike until end of turn. // Whenever you cast a spell that's both red and white, Battlegate Mimic has base power and toughness 4/2 and gains first strike until end of turn.
SetBasePowerToughnessSourceEffect baseToughnessSourceEffect = new SetBasePowerToughnessSourceEffect(4, 2, Duration.EndOfTurn, SubLayer.SetPT_7b); SetBasePowerToughnessSourceEffect baseToughnessSourceEffect = new SetBasePowerToughnessSourceEffect(4, 2, Duration.EndOfTurn);
Ability ability = SpellCastControllerTriggeredAbility.createWithRule(baseToughnessSourceEffect, filter, false, rule); Ability ability = SpellCastControllerTriggeredAbility.createWithRule(baseToughnessSourceEffect, filter, false, rule);
ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, false, true)); ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, false, true));
this.addAbility(ability); this.addAbility(ability);

View file

@ -39,6 +39,8 @@ public final class BeanstalkGiant extends AdventureCard {
this.getSpellCard().getSpellAbility().addEffect( this.getSpellCard().getSpellAbility().addEffect(
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND)) new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND))
); );
this.finalizeAdventure();
} }
private BeanstalkGiant(final BeanstalkGiant card) { private BeanstalkGiant(final BeanstalkGiant card) {

View file

@ -30,6 +30,8 @@ public final class BeanstalkWurm extends AdventureCard {
// Plant Beans // Plant Beans
// You may play an additional land this turn. // You may play an additional land this turn.
this.getSpellCard().getSpellAbility().addEffect(new PlayAdditionalLandsControllerEffect(1, Duration.EndOfTurn)); this.getSpellCard().getSpellAbility().addEffect(new PlayAdditionalLandsControllerEffect(1, Duration.EndOfTurn));
this.finalizeAdventure();
} }
private BeanstalkWurm(final BeanstalkWurm card) { private BeanstalkWurm(final BeanstalkWurm card) {

View file

@ -3,14 +3,13 @@ package mage.cards.b;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect; import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import java.util.UUID; import java.util.UUID;
/** /**
@ -26,7 +25,7 @@ public final class BelligerentBrontodon extends CardImpl {
this.toughness = new MageInt(6); this.toughness = new MageInt(6);
// Each creature you control assigns combat damage equal to its toughness rather than its power. // Each creature you control assigns combat damage equal to its toughness rather than its power.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CombatDamageByToughnessEffect(StaticFilters.FILTER_PERMANENT_CREATURE, true))); this.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessAllEffect(StaticFilters.FILTER_CONTROLLED_CREATURE_EACH)));
} }
private BelligerentBrontodon(final BelligerentBrontodon card) { private BelligerentBrontodon(final BelligerentBrontodon card) {

View file

@ -31,6 +31,8 @@ public final class BellowingBruiser extends AdventureCard {
// Up to two target creatures can't block this turn. // Up to two target creatures can't block this turn.
this.getSpellCard().getSpellAbility().addEffect(new CantBlockTargetEffect(Duration.EndOfTurn)); this.getSpellCard().getSpellAbility().addEffect(new CantBlockTargetEffect(Duration.EndOfTurn));
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2));
this.finalizeAdventure();
} }
private BellowingBruiser(final BellowingBruiser card) { private BellowingBruiser(final BellowingBruiser card) {

View file

@ -49,6 +49,8 @@ public final class BelunaGrandsquall extends AdventureCard {
// Seek Thrills // Seek Thrills
// Mill seven cards. Then put all cards that have an Adventure from among the milled cards into your hand. // Mill seven cards. Then put all cards that have an Adventure from among the milled cards into your hand.
this.getSpellCard().getSpellAbility().addEffect(new SeekThrillsEffect()); this.getSpellCard().getSpellAbility().addEffect(new SeekThrillsEffect());
this.finalizeAdventure();
} }
private BelunaGrandsquall(final BelunaGrandsquall card) { private BelunaGrandsquall(final BelunaGrandsquall card) {

View file

@ -40,6 +40,8 @@ public final class BelunasGatekeeper extends AdventureCard {
// Return target creature you don't control with mana value 3 or less to its owner's hand. // Return target creature you don't control with mana value 3 or less to its owner's hand.
this.getSpellCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter));
this.finalizeAdventure();
} }
private BelunasGatekeeper(final BelunasGatekeeper card) { private BelunasGatekeeper(final BelunasGatekeeper card) {

View file

@ -28,6 +28,8 @@ public final class BesottedKnight extends AdventureCard {
// Create a Royal Role token attached to target creature you control. // Create a Royal Role token attached to target creature you control.
this.getSpellCard().getSpellAbility().addEffect(new CreateRoleAttachedTargetEffect(RoleType.ROYAL)); this.getSpellCard().getSpellAbility().addEffect(new CreateRoleAttachedTargetEffect(RoleType.ROYAL));
this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.finalizeAdventure();
} }
private BesottedKnight(final BesottedKnight card) { private BesottedKnight(final BesottedKnight card) {

View file

@ -6,20 +6,12 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect; import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessTargetEffect;
import mage.constants.*; import mage.constants.*;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.MageObjectReferencePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.FoodToken; import mage.game.permanent.token.FoodToken;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
@ -43,7 +35,7 @@ public final class BillThePony extends CardImpl {
// Sacrifice a Food: Until end of turn, target creature you control assigns combat damage equal to its toughness rather than its power. // Sacrifice a Food: Until end of turn, target creature you control assigns combat damage equal to its toughness rather than its power.
Ability ability = new SimpleActivatedAbility( Ability ability = new SimpleActivatedAbility(
new BillThePonyEffect(), new CombatDamageByToughnessTargetEffect(Duration.EndOfTurn),
new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_FOOD)) new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_FOOD))
); );
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_CREATURE)); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_CREATURE));
@ -59,35 +51,4 @@ public final class BillThePony extends CardImpl {
public BillThePony copy() { public BillThePony copy() {
return new BillThePony(this); return new BillThePony(this);
} }
}
class BillThePonyEffect extends OneShotEffect {
BillThePonyEffect() {
super(Outcome.Benefit);
staticText = "Until end of turn, target creature you control assigns " +
"combat damage equal to its toughness rather than its power.";
}
private BillThePonyEffect(final BillThePonyEffect effect) {
super(effect);
}
@Override
public BillThePonyEffect copy() {
return new BillThePonyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent == null) {
return false;
}
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new MageObjectReferencePredicate(permanent, game));
game.addEffect(new CombatDamageByToughnessEffect(filter, false, Duration.EndOfTurn), source);
return true;
}
} }

View file

@ -49,6 +49,8 @@ public final class BlessedHippogriff extends AdventureCard {
// Target creature gains indestructible until end of turn. // Target creature gains indestructible until end of turn.
this.getSpellCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(IndestructibleAbility.getInstance())); this.getSpellCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(IndestructibleAbility.getInstance()));
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
this.finalizeAdventure();
} }
private BlessedHippogriff(final BlessedHippogriff card) { private BlessedHippogriff(final BlessedHippogriff card) {

View file

@ -1,7 +1,6 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -18,6 +17,8 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.NamePredicate;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -37,7 +38,7 @@ public final class BogbrewWitch extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// {2}, {T}: Search your library for a card named Festering Newt or Bubbling Cauldron, put it onto the battlefield tapped, then shuffle your library. // {2}, {T}: Search your library for a card named Festering Newt or Bubbling Cauldron, put it onto the battlefield tapped, then shuffle your library.
TargetCardInLibrary target = new TargetCardInLibrary(1, 1, new FilterCard(filter)); TargetCardInLibrary target = new TargetCardInLibrary(1, 1, filter);
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new SearchLibraryPutInPlayEffect(target, true), new SearchLibraryPutInPlayEffect(target, true),
new ManaCostsImpl<>("{2}")); new ManaCostsImpl<>("{2}"));

View file

@ -39,6 +39,8 @@ public final class BonecrusherGiant extends AdventureCard {
this.getSpellCard().getSpellAbility().addEffect(new DamageCantBePreventedEffect(Duration.EndOfTurn, "Damage can't be prevented this turn")); this.getSpellCard().getSpellAbility().addEffect(new DamageCantBePreventedEffect(Duration.EndOfTurn, "Damage can't be prevented this turn"));
this.getSpellCard().getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellCard().getSpellAbility().addEffect(new DamageTargetEffect(2));
this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget()); this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget());
this.finalizeAdventure();
} }
private BonecrusherGiant(final BonecrusherGiant card) { private BonecrusherGiant(final BonecrusherGiant card) {

View file

@ -56,6 +56,8 @@ public final class BrambleFamiliar extends AdventureCard {
// Fetch Quest // Fetch Quest
// Mill seven cards, then put a creature, enchantment, or land card from among cards milled this way onto the battlefield. // Mill seven cards, then put a creature, enchantment, or land card from among cards milled this way onto the battlefield.
this.getSpellCard().getSpellAbility().addEffect(new FetchQuestEffect()); this.getSpellCard().getSpellAbility().addEffect(new FetchQuestEffect());
this.finalizeAdventure();
} }
private BrambleFamiliar(final BrambleFamiliar card) { private BrambleFamiliar(final BrambleFamiliar card) {

View file

@ -33,9 +33,7 @@ public final class BramblefortFink extends CardImpl {
// {8}: Bramblefort Fink has base power and toughness 10/10 until end of turn. Activate this ability only if you control an Oko planeswalker. // {8}: Bramblefort Fink has base power and toughness 10/10 until end of turn. Activate this ability only if you control an Oko planeswalker.
this.addAbility(new ActivateIfConditionActivatedAbility( this.addAbility(new ActivateIfConditionActivatedAbility(
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new SetBasePowerToughnessSourceEffect( new SetBasePowerToughnessSourceEffect(10, 10, Duration.EndOfTurn),
10, 10, Duration.EndOfTurn, SubLayer.SetPT_7b
).setText("{this} has base power and toughness 10/10 until end of turn"),
new GenericManaCost(8), new GenericManaCost(8),
condition)); condition));
} }

View file

@ -49,6 +49,8 @@ public final class BrazenBorrower extends AdventureCard {
// Return target nonland permanent an opponent controls to its owner's hand. // Return target nonland permanent an opponent controls to its owner's hand.
this.getSpellCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter));
this.finalizeAdventure();
} }
private BrazenBorrower(final BrazenBorrower card) { private BrazenBorrower(final BrazenBorrower card) {

View file

@ -0,0 +1,119 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.token.FoodAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author Xanderhall
*/
public final class BrenardGingerSculptor extends CardImpl {
private static final FilterCreaturePermanent foodOrGolemCreature = new FilterCreaturePermanent("a Food or a Golem creature");
private static final FilterPermanent nontokenCreature = new FilterControlledCreaturePermanent("another nontoken creature you control");
static {
foodOrGolemCreature.add(Predicates.or(SubType.FOOD.getPredicate(), SubType.GOLEM.getPredicate()));
nontokenCreature.add(TokenPredicate.FALSE);
nontokenCreature.add(AnotherPredicate.instance);
}
public BrenardGingerSculptor(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{U}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Each creature you control that's a Food or a Golem gets +2/+2 and has trample.
Ability ability = new SimpleStaticAbility(new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, foodOrGolemCreature)
.setText("each creature you control that's a Food or a Golem gets +2/+2"));
ability.addEffect(new GainAbilityAllEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, foodOrGolemCreature).setText("and has trample."));
this.addAbility(ability);
// Whenever another nontoken creature you control dies, you may exile it. If you do, create a token that's a copy of that creature, except it's a 1/1 Food Golem artifact creature in addition to its other types and it has "2, {T}, Sacrifice this artifact: You gain 3 life."
this.addAbility(new DiesCreatureTriggeredAbility(new BrenardGingerSculptorEffect(), true, nontokenCreature, true));
}
private BrenardGingerSculptor(final BrenardGingerSculptor card) {
super(card);
}
@Override
public BrenardGingerSculptor copy() {
return new BrenardGingerSculptor(this);
}
}
class BrenardGingerSculptorEffect extends OneShotEffect {
BrenardGingerSculptorEffect() {
super(Outcome.Copy);
this.staticText = "you may exile it. If you do, create a token that's a copy of that creature, except it's a 1/1 Food Golem artifact creature in "+
"addition to its other types and it has \"{2}, {T}, Sacrifice this artifact: You gain 3 life.\"";
}
private BrenardGingerSculptorEffect(final BrenardGingerSculptorEffect effect) {
super(effect);
}
public BrenardGingerSculptorEffect copy() {
return new BrenardGingerSculptorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (player == null || card == null) {
return false;
}
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(
source.getControllerId(), CardType.CREATURE, false, 1, false,
false, null, 1, 1, false
);
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1));
effect.setBecomesArtifact(true);
effect.setAdditionalSubType(SubType.FOOD);
effect.setAdditionalSubType(SubType.GOLEM);
effect.addAdditionalAbilities(new FoodAbility(false));
player.moveCards(card, Zone.EXILED, source, game);
effect.apply(game, source);
return true;
}
}

View file

@ -8,7 +8,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubLayer;
import mage.constants.SubType; import mage.constants.SubType;
import java.util.UUID; import java.util.UUID;
@ -28,7 +27,7 @@ public final class BrokersInitiate extends CardImpl {
// {4}{G/U}: Brokers Initiate has base power and toughness 5/5 until end of turn. // {4}{G/U}: Brokers Initiate has base power and toughness 5/5 until end of turn.
this.addAbility(new SimpleActivatedAbility( this.addAbility(new SimpleActivatedAbility(
new SetBasePowerToughnessSourceEffect(5, 5, Duration.EndOfTurn, SubLayer.SetPT_7b), new SetBasePowerToughnessSourceEffect(5, 5, Duration.EndOfTurn),
new ManaCostsImpl<>("{4}{G/U}") new ManaCostsImpl<>("{4}{G/U}")
)); ));
} }

View file

@ -58,6 +58,8 @@ public final class CallousSellSword extends AdventureCard {
this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent().setTargetTag(1)); this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent().setTargetTag(1));
this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget(1, 1, filterSecondTarget).setTargetTag(2)); this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget(1, 1, filterSecondTarget).setTargetTag(2));
this.getSpellCard().getSpellAbility().addEffect(new CallousSellSwordSacrificeFirstTargetEffect().concatBy("Then")); this.getSpellCard().getSpellAbility().addEffect(new CallousSellSwordSacrificeFirstTargetEffect().concatBy("Then"));
this.finalizeAdventure();
} }
private CallousSellSword(final CallousSellSword card) { private CallousSellSword(final CallousSellSword card) {

View file

@ -1,6 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -9,25 +8,18 @@ import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentsComparedToOpponentsCondition; import mage.abilities.condition.common.ControlsPermanentsComparedToOpponentsCondition;
import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ContinuousEffectImpl;
import mage.constants.SubType;
import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType; import mage.constants.*;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -68,19 +60,19 @@ public final class ChaosLord extends CardImpl {
class ChaosLordTriggeredAbility extends BeginningOfUpkeepTriggeredAbility { class ChaosLordTriggeredAbility extends BeginningOfUpkeepTriggeredAbility {
public ChaosLordTriggeredAbility() { ChaosLordTriggeredAbility() {
super(Zone.BATTLEFIELD, super(Zone.BATTLEFIELD,
new GainControlSourceEffect(), new GainControlSourceEffect(),
TargetController.YOU, TargetController.YOU,
false); false);
} }
public ChaosLordTriggeredAbility(ChaosLordTriggeredAbility ability) { private ChaosLordTriggeredAbility(final ChaosLordTriggeredAbility ability) {
super(ability); super(ability);
} }
@Override @Override
public BeginningOfUpkeepTriggeredAbility copy() { public ChaosLordTriggeredAbility copy() {
return new ChaosLordTriggeredAbility(this); return new ChaosLordTriggeredAbility(this);
} }

View file

@ -40,6 +40,8 @@ public final class CheekyHouseMouse extends AdventureCard {
this.getSpellCard().getSpellAbility().addEffect(new CantBeBlockedTargetEffect(filter, Duration.EndOfTurn) this.getSpellCard().getSpellAbility().addEffect(new CantBeBlockedTargetEffect(filter, Duration.EndOfTurn)
.setText("it can't be blocked by creatures with power 3 or greater this turn")); .setText("it can't be blocked by creatures with power 3 or greater this turn"));
this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.finalizeAdventure();
} }
private CheekyHouseMouse(final CheekyHouseMouse card) { private CheekyHouseMouse(final CheekyHouseMouse card) {

View file

@ -34,7 +34,7 @@ public final class ChimericMass extends CardImpl {
new CreatureToken(0, 0, "Construct artifact creature with \"This creature's power and toughness are each equal to the number of charge counters on it.\"") new CreatureToken(0, 0, "Construct artifact creature with \"This creature's power and toughness are each equal to the number of charge counters on it.\"")
.withType(CardType.ARTIFACT) .withType(CardType.ARTIFACT)
.withSubType(SubType.CONSTRUCT) .withSubType(SubType.CONSTRUCT)
.withAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect(count, count, Duration.WhileOnBattlefield, SubLayer.SetPT_7b))), .withAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect(count, Duration.WhileOnBattlefield))),
CardType.ARTIFACT, Duration.EndOfTurn).withDurationRuleAtStart(true), new GenericManaCost(1))); CardType.ARTIFACT, Duration.EndOfTurn).withDurationRuleAtStart(true), new GenericManaCost(1)));
} }

View file

@ -1,7 +1,6 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
@ -12,14 +11,12 @@ import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/** /**
* *
@ -47,15 +44,15 @@ public final class CivicSaber extends CardImpl {
return new CivicSaber(this); return new CivicSaber(this);
} }
} }
class CivicSaberColorCount implements DynamicValue { class CivicSaberColorCount implements DynamicValue {
public CivicSaberColorCount() { CivicSaberColorCount() {
} }
public CivicSaberColorCount(final CivicSaberColorCount dynamicValue) { private CivicSaberColorCount(final CivicSaberColorCount dynamicValue) {
} }
@Override @Override
public int calculate(Game game, Ability sourceAbility, Effect effect) { public int calculate(Game game, Ability sourceAbility, Effect effect) {
int count = 0; int count = 0;
@ -68,9 +65,9 @@ class CivicSaberColorCount implements DynamicValue {
} }
return count; return count;
} }
@Override @Override
public DynamicValue copy() { public CivicSaberColorCount copy() {
return new CivicSaberColorCount(this); return new CivicSaberColorCount(this);
} }

View file

@ -38,6 +38,8 @@ public final class ColossalBadger extends AdventureCard {
// Choose target creature. Mill four cards, then put a +1/+1 counter on that creature for each creature card milled this way. // Choose target creature. Mill four cards, then put a +1/+1 counter on that creature for each creature card milled this way.
this.getSpellCard().getSpellAbility().addEffect(new ColossalBadgerEffect()); this.getSpellCard().getSpellAbility().addEffect(new ColossalBadgerEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
this.finalizeAdventure();
} }
private ColossalBadger(final ColossalBadger card) { private ColossalBadger(final ColossalBadger card) {

View file

@ -32,6 +32,8 @@ public final class ConceitedWitch extends AdventureCard {
// Create a Wicked Role token attached to target creature you control. // Create a Wicked Role token attached to target creature you control.
this.getSpellCard().getSpellAbility().addEffect(new CreateRoleAttachedTargetEffect(RoleType.WICKED)); this.getSpellCard().getSpellAbility().addEffect(new CreateRoleAttachedTargetEffect(RoleType.WICKED));
this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.finalizeAdventure();
} }
private ConceitedWitch(final ConceitedWitch card) { private ConceitedWitch(final ConceitedWitch card) {

View file

@ -3,15 +3,16 @@ package mage.cards.c;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.AdditiveDynamicValue;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount; import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.continuous.SetBasePowerToughnessPlusOneSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.permanent.token.ConsumingBlobOozeToken; import mage.game.permanent.token.ConsumingBlobOozeToken;
import java.util.UUID; import java.util.UUID;
@ -22,7 +23,6 @@ import java.util.UUID;
public final class ConsumingBlob extends CardImpl { public final class ConsumingBlob extends CardImpl {
private static final DynamicValue powerValue = CardTypesInGraveyardCount.YOU; private static final DynamicValue powerValue = CardTypesInGraveyardCount.YOU;
private static final DynamicValue toughnessValue = new AdditiveDynamicValue(powerValue, StaticValue.get(1));
public ConsumingBlob(UUID ownerId, CardSetInfo setInfo) { public ConsumingBlob(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
@ -32,11 +32,7 @@ public final class ConsumingBlob extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Consuming Blob's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1. // Consuming Blob's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1.
this.addAbility(new SimpleStaticAbility( this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessPlusOneSourceEffect(powerValue)));
Zone.ALL,
new SetBasePowerToughnessSourceEffect(powerValue, toughnessValue, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a)
.setText("{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1")
));
// At the beginning of your end step, create a green Ooze creature token with "This creature's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1". // At the beginning of your end step, create a green Ooze creature token with "This creature's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1".
this.addAbility(new BeginningOfEndStepTriggeredAbility( this.addAbility(new BeginningOfEndStepTriggeredAbility(

View file

@ -0,0 +1,112 @@
package mage.cards.c;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.BecomesMonarchSourceEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.util.functions.CopyApplier;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CourtOfVantress extends CardImpl {
private static final FilterPermanent filter
= new FilterArtifactOrEnchantmentPermanent("other target enchantment or artifact");
static {
filter.add(AnotherPredicate.instance);
}
public CourtOfVantress(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}");
// When Court of Vantress enters the battlefield, you become the monarch.
this.addAbility(new EntersBattlefieldTriggeredAbility(new BecomesMonarchSourceEffect()));
// At the beginning of your upkeep, choose up to one other target enchantment or artifact. If you're the monarch, you may create a token that's a copy of it. If you're not the monarch, you may have Court of Vantress become a copy of it, except it has this ability.
this.addAbility(makeAbility());
}
private CourtOfVantress(final CourtOfVantress card) {
super(card);
}
@Override
public CourtOfVantress copy() {
return new CourtOfVantress(this);
}
static Ability makeAbility() {
Ability ability = new BeginningOfUpkeepTriggeredAbility(
new CourtOfVantressEffect(), TargetController.YOU, false
);
ability.addTarget(new TargetPermanent(0, 1, filter));
return ability;
}
}
class CourtOfVantressEffect extends OneShotEffect {
private static final CopyApplier applier = new CopyApplier() {
@Override
public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) {
blueprint.getAbilities().add(CourtOfVantress.makeAbility());
return true;
}
};
CourtOfVantressEffect() {
super(Outcome.Benefit);
staticText = "choose up to one other target enchantment or artifact. If you're the monarch, " +
"you may create a token that's a copy of it. If you're not the monarch, " +
"you may have {this} become a copy of it, except it has this ability";
}
private CourtOfVantressEffect(final CourtOfVantressEffect effect) {
super(effect);
}
@Override
public CourtOfVantressEffect copy() {
return new CourtOfVantressEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (player == null || permanent == null) {
return false;
}
if (source.isControlledBy(game.getMonarchId())) {
return player.chooseUse(outcome, "Create a token copy of " + permanent.getIdName() + '?', source, game)
&& new CreateTokenCopyTargetEffect().setSavedPermanent(permanent).apply(game, source);
}
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
if (sourcePermanent == null || !player.chooseUse(outcome, "Have " + sourcePermanent.getIdName() +
" become a copy of " + permanent.getIdName() + '?', source, game)) {
return false;
}
game.copyPermanent(Duration.Custom, permanent, sourcePermanent.getId(), source, applier);
return true;
}
}

View file

@ -8,9 +8,8 @@ import mage.abilities.condition.common.FormidableCondition;
import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
@ -41,8 +40,7 @@ public final class CraterElemental extends CardImpl {
// <i>Formidable</i> &mdash; {2}{R}: Crater Elemental has base power 8 until end of turn. Activate this ability only if creatures you control have total power 8 or greater. // <i>Formidable</i> &mdash; {2}{R}: Crater Elemental has base power 8 until end of turn. Activate this ability only if creatures you control have total power 8 or greater.
ability = new ActivateIfConditionActivatedAbility( ability = new ActivateIfConditionActivatedAbility(
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new SetBasePowerToughnessSourceEffect(StaticValue.get(8), null, Duration.EndOfTurn, SubLayer.SetPT_7b) new SetBasePowerSourceEffect(8, Duration.EndOfTurn),
.setText("{this} has base power 8 until end of turn"),
new ManaCostsImpl<>("{2}{R}"), new ManaCostsImpl<>("{2}{R}"),
FormidableCondition.instance FormidableCondition.instance
); );

View file

@ -37,6 +37,8 @@ public final class CruelSomnophage extends AdventureCard {
// Target player mills four cards. // Target player mills four cards.
this.getSpellCard().getSpellAbility().addEffect(new MillCardsTargetEffect(4)); this.getSpellCard().getSpellAbility().addEffect(new MillCardsTargetEffect(4));
this.getSpellCard().getSpellAbility().addTarget(new TargetPlayer()); this.getSpellCard().getSpellAbility().addTarget(new TargetPlayer());
this.finalizeAdventure();
} }
private CruelSomnophage(final CruelSomnophage card) { private CruelSomnophage(final CruelSomnophage card) {

View file

@ -48,6 +48,8 @@ public final class CrystalDragon extends AdventureCard {
// Return target artifact, enchantment, or legendary card from your graveyard to your hand. // Return target artifact, enchantment, or legendary card from your graveyard to your hand.
this.getSpellCard().getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter));
this.finalizeAdventure();
} }
private CrystalDragon(final CrystalDragon card) { private CrystalDragon(final CrystalDragon card) {

View file

@ -26,6 +26,8 @@ public final class CuriousPair extends AdventureCard {
// Treats to Share // Treats to Share
// Create a Food token. // Create a Food token.
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken())); this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken()));
this.finalizeAdventure();
} }
private CuriousPair(final CuriousPair card) { private CuriousPair(final CuriousPair card) {

View file

@ -0,0 +1,118 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateRoleAttachedTargetEffect;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.RoleType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.GameLog;
import java.util.UUID;
/**
* @author Susucr
*/
public final class CurseOfTheWerefox extends CardImpl {
public CurseOfTheWerefox(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
// Create a Monster Role token attached to target creature you control. When you do, that creature fights up to one target creature you don't control.
this.getSpellAbility().addEffect(new CurseOfTheWerefoxEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
}
private CurseOfTheWerefox(final CurseOfTheWerefox card) {
super(card);
}
@Override
public CurseOfTheWerefox copy() {
return new CurseOfTheWerefox(this);
}
}
class CurseOfTheWerefoxEffect extends OneShotEffect {
CurseOfTheWerefoxEffect() {
super(Outcome.Benefit);
staticText = "create a Monster Role token attached to target creature you control. "
+ "When you do, that creature fights up to one target creature you don't control";
}
private CurseOfTheWerefoxEffect(final CurseOfTheWerefoxEffect effect) {
super(effect);
}
@Override
public CurseOfTheWerefoxEffect copy() {
return new CurseOfTheWerefoxEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(source.getFirstTarget());
if (target == null) {
return false;
}
boolean didCreate =
new CreateRoleAttachedTargetEffect(RoleType.MONSTER)
.setTargetPointer(new FixedTarget(target, game))
.apply(game, source);
if (!didCreate) {
return false;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
new CurseOfTheWerefoxFightEffect(), false,
"that creature fights up to one target creature you don't control"
);
ability.getEffects().setTargetPointer(new FixedTarget(target.getId(), game));
ability.addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
}
class CurseOfTheWerefoxFightEffect extends OneShotEffect {
CurseOfTheWerefoxFightEffect() {
super(Outcome.Damage);
}
private CurseOfTheWerefoxFightEffect(final CurseOfTheWerefoxFightEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent triggeredCreature = game.getPermanent(this.targetPointer.getFirst(game, source));
Permanent target = game.getPermanent(source.getFirstTarget());
if (triggeredCreature != null
&& target != null
&& triggeredCreature.isCreature(game)
&& target.isCreature(game)) {
return triggeredCreature.fight(target, source, game);
}
return false;
}
@Override
public CurseOfTheWerefoxFightEffect copy() {
return new CurseOfTheWerefoxFightEffect(this);
}
}

View file

@ -1,7 +1,6 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
@ -12,11 +11,7 @@ import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.game.Game; import mage.game.Game;
@ -25,6 +20,8 @@ import mage.players.Player;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -62,13 +59,13 @@ public final class DeathsApproach extends CardImpl {
class CardsInEnchantedCreaturesControllerGraveyardCount implements DynamicValue { class CardsInEnchantedCreaturesControllerGraveyardCount implements DynamicValue {
private FilterCard filter; private final FilterCard filter;
public CardsInEnchantedCreaturesControllerGraveyardCount(FilterCard filter) { CardsInEnchantedCreaturesControllerGraveyardCount(FilterCard filter) {
this.filter = filter; this.filter = filter;
} }
public CardsInEnchantedCreaturesControllerGraveyardCount(final CardsInEnchantedCreaturesControllerGraveyardCount dynamicValue) { private CardsInEnchantedCreaturesControllerGraveyardCount(final CardsInEnchantedCreaturesControllerGraveyardCount dynamicValue) {
this.filter = dynamicValue.filter; this.filter = dynamicValue.filter;
} }
@ -89,7 +86,7 @@ class CardsInEnchantedCreaturesControllerGraveyardCount implements DynamicValue
} }
@Override @Override
public DynamicValue copy() { public CardsInEnchantedCreaturesControllerGraveyardCount copy() {
return new CardsInEnchantedCreaturesControllerGraveyardCount(this); return new CardsInEnchantedCreaturesControllerGraveyardCount(this);
} }

View file

@ -51,6 +51,8 @@ public final class DecadentDragon extends AdventureCard {
// Exile the top two cards of target opponent's library face down. You may look at and play those cards for as long as they remain exiled. // Exile the top two cards of target opponent's library face down. You may look at and play those cards for as long as they remain exiled.
this.getSpellCard().getSpellAbility().addEffect(new ExpensiveTasteEffect()); this.getSpellCard().getSpellAbility().addEffect(new ExpensiveTasteEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetOpponent()); this.getSpellCard().getSpellAbility().addTarget(new TargetOpponent());
this.finalizeAdventure();
} }
private DecadentDragon(final DecadentDragon card) { private DecadentDragon(final DecadentDragon card) {

View file

@ -10,6 +10,7 @@ import mage.abilities.effects.common.DoIfCostPaid;
import mage.cards.*; import mage.cards.*;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.PermanentReferenceInCollectionPredicate; import mage.filter.predicate.permanent.PermanentReferenceInCollectionPredicate;
@ -32,12 +33,11 @@ public final class DescendantsFury extends CardImpl {
// Whenever one or more creatures you control deal combat damage to a player, you may sacrifice one of them. If you do, reveal cards from the top of your library until you reveal a creature card that shares a creature type with the sacrificed creature. Put that card onto the battlefield and the rest on the bottom of your library in a random order. // Whenever one or more creatures you control deal combat damage to a player, you may sacrifice one of them. If you do, reveal cards from the top of your library until you reveal a creature card that shares a creature type with the sacrificed creature. Put that card onto the battlefield and the rest on the bottom of your library in a random order.
Ability ability = new DealCombatDamageControlledTriggeredAbility( Ability ability = new DealCombatDamageControlledTriggeredAbility(
Zone.BATTLEFIELD,
new DoIfCostPaid( new DoIfCostPaid(
new DescendantsFuryEffect(), new DescendantsFuryEffect(),
new DescendantsFurySacrificeCost() new DescendantsFurySacrificeCost()
), ),
true SetTargetPointer.PLAYER
); );
ability.addWatcher(new DamagedPlayerThisCombatWatcher()); ability.addWatcher(new DamagedPlayerThisCombatWatcher());

View file

@ -67,6 +67,8 @@ public final class DevouringSugarmaw extends AdventureCard {
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new HumanToken())); this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new HumanToken()));
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken()) this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken())
.setText("and a Food token")); .setText("and a Food token"));
this.finalizeAdventure();
} }
private DevouringSugarmaw(final DevouringSugarmaw card) { private DevouringSugarmaw(final DevouringSugarmaw card) {

View file

@ -103,7 +103,7 @@ enum DonalHeraldOfWingsApplier implements StackObjectCopyApplier {
copiedSpell.addSubType(SubType.SPIRIT); copiedSpell.addSubType(SubType.SPIRIT);
copiedSpell.getPower().setModifiedBaseValue(1); copiedSpell.getPower().setModifiedBaseValue(1);
copiedSpell.getToughness().setModifiedBaseValue(1); copiedSpell.getToughness().setModifiedBaseValue(1);
Ability ability = new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect(1,1, Duration.Custom, SubLayer.SetPT_7b)); Ability ability = new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect(1,1, Duration.Custom));
ability.setRuleVisible(false); ability.setRuleVisible(false);
copiedSpell.getAbilities().add(ability); copiedSpell.getAbilities().add(ability);
} }

View file

@ -2,13 +2,14 @@ package mage.cards.d;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect; import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import java.util.UUID; import java.util.UUID;
@ -25,6 +26,8 @@ import java.util.UUID;
*/ */
public final class DoranTheSiegeTower extends CardImpl { public final class DoranTheSiegeTower extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("each creature");
public DoranTheSiegeTower(UUID ownerId, CardSetInfo setInfo) { public DoranTheSiegeTower(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{B}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{B}{G}");
this.supertype.add(SuperType.LEGENDARY); this.supertype.add(SuperType.LEGENDARY);
@ -35,9 +38,7 @@ public final class DoranTheSiegeTower extends CardImpl {
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// Each creature assigns combat damage equal to its toughness rather than its power. // Each creature assigns combat damage equal to its toughness rather than its power.
this.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessEffect( this.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessAllEffect(filter)));
StaticFilters.FILTER_PERMANENT_CREATURE, false
)));
} }
private DoranTheSiegeTower(final DoranTheSiegeTower card) { private DoranTheSiegeTower(final DoranTheSiegeTower card) {

View file

@ -117,7 +117,7 @@ class DracoplasmEffect extends ReplacementEffectImpl {
toughness = CardUtil.overflowInc(toughness, targetCreature.getToughness().getValue()); toughness = CardUtil.overflowInc(toughness, targetCreature.getToughness().getValue());
} }
} }
ContinuousEffect effect = new SetBasePowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b); ContinuousEffect effect = new SetBasePowerToughnessSourceEffect(power, toughness, Duration.Custom);
game.addEffect(effect, source); game.addEffect(effect, source);
return false; return false;
} }

View file

@ -48,6 +48,8 @@ public final class DreadLinnorm extends AdventureCard {
this.getSpellCard().getSpellAbility().addEffect(new UntapTargetEffect().setText("and untap it")); this.getSpellCard().getSpellAbility().addEffect(new UntapTargetEffect().setText("and untap it"));
this.getSpellCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(HexproofAbility.getInstance()).setText("It gains hexproof until end of turn")); this.getSpellCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(HexproofAbility.getInstance()).setText("It gains hexproof until end of turn"));
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
this.finalizeAdventure();
} }
private DreadLinnorm(final DreadLinnorm card) { private DreadLinnorm(final DreadLinnorm card) {

View file

@ -78,7 +78,7 @@ class DruidClassToken extends TokenImpl {
this.addAbility(HasteAbility.getInstance()); this.addAbility(HasteAbility.getInstance());
this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect( this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect(
LandsYouControlCount.instance, LandsYouControlCount.instance, Duration.EndOfGame, SubLayer.SetPT_7b LandsYouControlCount.instance, Duration.EndOfGame
).setText("this creature's power and toughness are each equal to the number of lands you control"))); ).setText("this creature's power and toughness are each equal to the number of lands you control")));
} }

View file

@ -45,6 +45,8 @@ public final class ElusiveOtter extends AdventureCard {
target.setMinNumberOfTargets(0); target.setMinNumberOfTargets(0);
target.setMaxNumberOfTargets(Integer.MAX_VALUE); target.setMaxNumberOfTargets(Integer.MAX_VALUE);
this.getSpellCard().getSpellAbility().addTarget(target); this.getSpellCard().getSpellAbility().addTarget(target);
this.finalizeAdventure();
} }
private ElusiveOtter(final ElusiveOtter card) { private ElusiveOtter(final ElusiveOtter card) {

View file

@ -65,7 +65,7 @@ class ElvishImpersonatorsEffect extends OneShotEffect {
List<Integer> results = controller.rollDice(outcome, source, game, 6, 2, 0); List<Integer> results = controller.rollDice(outcome, source, game, 6, 2, 0);
int firstRoll = results.get(0); int firstRoll = results.get(0);
int secondRoll = results.get(1); int secondRoll = results.get(1);
game.addEffect(new SetBasePowerToughnessSourceEffect(firstRoll, secondRoll, Duration.WhileOnBattlefield, SubLayer.SetPT_7b), source); game.addEffect(new SetBasePowerToughnessSourceEffect(firstRoll, secondRoll, Duration.Custom), source);
return true; return true;
} }
} }

View file

@ -27,6 +27,8 @@ public final class EmberethShieldbreaker extends AdventureCard {
// Destroy target artifact. // Destroy target artifact.
this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetArtifactPermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetArtifactPermanent());
this.finalizeAdventure();
} }
private EmberethShieldbreaker(final EmberethShieldbreaker card) { private EmberethShieldbreaker(final EmberethShieldbreaker card) {

View file

@ -46,6 +46,8 @@ public final class EmeraldDragon extends AdventureCard {
// Counter target activated or triggered ability from a noncreature source. // Counter target activated or triggered ability from a noncreature source.
this.getSpellCard().getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetActivatedOrTriggeredAbility(filter)); this.getSpellCard().getSpellAbility().addTarget(new TargetActivatedOrTriggeredAbility(filter));
this.finalizeAdventure();
} }
private EmeraldDragon(final EmeraldDragon card) { private EmeraldDragon(final EmeraldDragon card) {

View file

@ -1,4 +1,3 @@
package mage.cards.e; package mage.cards.e;
import mage.MageInt; import mage.MageInt;
@ -42,9 +41,7 @@ public final class EntropicSpecter extends CardImpl {
// Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand. // Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand.
this.addAbility(new SimpleStaticAbility(Zone.ALL, this.addAbility(new SimpleStaticAbility(Zone.ALL,
// back to the graveyard or if the chosen player left the game it's again a 0/0 // back to the graveyard or if the chosen player left the game it's again a 0/0
new SetBasePowerToughnessSourceEffect(CardsInTargetPlayerHandCount.instance, CardsInTargetPlayerHandCount.instance, new SetBasePowerToughnessSourceEffect(CardsInTargetPlayerHandCount.instance, Duration.WhileOnBattlefield)));
Duration.WhileOnBattlefield, SubLayer.SetPT_7b)
.setText("{this}'s power and toughness are each equal to the number of cards in the chosen player's hand")));
// Whenever Entropic Specter deals damage to a player, that player discards a card. // Whenever Entropic Specter deals damage to a player, that player discards a card.
this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1, false), false, true)); this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1, false), false, true));

View file

@ -41,6 +41,8 @@ public final class Ettercap extends AdventureCard {
// Destroy target creature with flying. // Destroy target creature with flying.
this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter));
this.finalizeAdventure();
} }
private Ettercap(final Ettercap card) { private Ettercap(final Ettercap card) {

View file

@ -34,7 +34,7 @@ public final class EvolvedSleeper extends CardImpl {
Duration.Custom, SubType.HUMAN, SubType.CLERIC Duration.Custom, SubType.HUMAN, SubType.CLERIC
).setText("{this} becomes a Human Cleric"), new ManaCostsImpl<>("{B}")); ).setText("{this} becomes a Human Cleric"), new ManaCostsImpl<>("{B}"));
ability.addEffect(new SetBasePowerToughnessSourceEffect( ability.addEffect(new SetBasePowerToughnessSourceEffect(
2, 2, Duration.Custom, SubLayer.SetPT_7b 2, 2, Duration.Custom
).setText("with base power and toughness 2/2")); ).setText("with base power and toughness 2/2"));
this.addAbility(ability); this.addAbility(ability);
@ -87,7 +87,7 @@ class EvolvedSleeperClericEffect extends OneShotEffect {
Duration.Custom, SubType.PHYREXIAN, SubType.HUMAN, SubType.CLERIC Duration.Custom, SubType.PHYREXIAN, SubType.HUMAN, SubType.CLERIC
), source); ), source);
game.addEffect(new SetBasePowerToughnessSourceEffect( game.addEffect(new SetBasePowerToughnessSourceEffect(
3, 3, Duration.Custom, SubLayer.SetPT_7b 3, 3, Duration.Custom
), source); ), source);
return true; return true;
} }

View file

@ -1,28 +1,22 @@
package mage.cards.e; package mage.cards.e;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect; import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.abilities.keyword.LifelinkAbility; import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
* *
* @author TheElk801 * @author TheElk801
@ -88,7 +82,7 @@ class EvraHalcyonWitnessEffect extends OneShotEffect {
// For example, say Evra is enchanted with Dub (which makes it 6/6) and your life total is 7. // For example, say Evra is enchanted with Dub (which makes it 6/6) and your life total is 7.
// After the exchange, Evra would be a 9/6 creature (its power became 7, which was then modified by Dub) and your life total would be 6. // After the exchange, Evra would be a 9/6 creature (its power became 7, which was then modified by Dub) and your life total would be 6.
// (2018-04-27) // (2018-04-27)
game.addEffect(new SetBasePowerToughnessSourceEffect(StaticValue.get(life), null, Duration.Custom, SubLayer.SetPT_7b), source); game.addEffect(new SetBasePowerSourceEffect(life, Duration.Custom), source);
return true; return true;
} }
} }

View file

@ -19,8 +19,6 @@ import mage.game.ExileZone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.events.ZoneChangeGroupEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.players.Player; import mage.players.Player;
@ -108,7 +106,7 @@ class ExtraordinaryJourneyEffect extends OneShotEffect {
Set<Card> cards = permanents Set<Card> cards = permanents
.stream() .stream()
.map(p -> p.getMainCard()) .map(Card::getMainCard)
.filter(Objects::nonNull) .filter(Objects::nonNull)
.filter(card -> game.getState().getZone(card.getId()) == Zone.EXILED) .filter(card -> game.getState().getZone(card.getId()) == Zone.EXILED)
.collect(Collectors.toSet()); .collect(Collectors.toSet());
@ -148,7 +146,7 @@ class ExtraordinaryJourneyEffect extends OneShotEffect {
class ExtraordinaryJourneyTriggeredAbility extends TriggeredAbilityImpl { class ExtraordinaryJourneyTriggeredAbility extends TriggeredAbilityImpl {
ExtraordinaryJourneyTriggeredAbility() { ExtraordinaryJourneyTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false); super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1, "you"), false);
setTriggerPhrase("Whenever one or more nontoken creatures enter the battlefield, " setTriggerPhrase("Whenever one or more nontoken creatures enter the battlefield, "
+ "if one or more of them entered from exile or was cast from exile, "); + "if one or more of them entered from exile or was cast from exile, ");
setTriggersOnceEachTurn(true); setTriggersOnceEachTurn(true);
@ -197,4 +195,4 @@ class ExtraordinaryJourneyTriggeredAbility extends TriggeredAbilityImpl {
return false; return false;
} }
} }

View file

@ -13,7 +13,6 @@ import mage.cards.AdventureCard;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -46,6 +45,8 @@ public final class FaeOfWishes extends AdventureCard {
// You may reveal a noncreature card you own from outside the game and put it into your hand. // You may reveal a noncreature card you own from outside the game and put it into your hand.
this.getSpellCard().getSpellAbility().addEffect(new WishEffect(StaticFilters.FILTER_CARD_A_NON_CREATURE)); this.getSpellCard().getSpellAbility().addEffect(new WishEffect(StaticFilters.FILTER_CARD_A_NON_CREATURE));
this.getSpellCard().getSpellAbility().addHint(OpenSideboardHint.instance); this.getSpellCard().getSpellAbility().addHint(OpenSideboardHint.instance);
this.finalizeAdventure();
} }
private FaeOfWishes(final FaeOfWishes card) { private FaeOfWishes(final FaeOfWishes card) {

View file

@ -0,0 +1,58 @@
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.common.DealCombatDamageControlledTriggeredAbility;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
/**
*
* @author Xanderhall
*/
public final class FaerieBladecrafter extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.FAERIE, "Faeries");
private static final DynamicValue count = new SourcePermanentPowerCount();
public FaerieBladecrafter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add(SubType.FAERIE);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever one or more Faeries you control deal combat damage to a player, put a +1/+1 counter on Faerie Bladecrafter.
this.addAbility(new DealCombatDamageControlledTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter));
// When Faerie Bladecrafter dies, each opponent loses X life and you gain X life, where X is its power.
Ability ability = new DiesSourceTriggeredAbility(new LoseLifeOpponentsEffect(count).setText("each opponent loses X life"));
ability.addEffect(new GainLifeEffect(count).setText("and you gain X life, where X is its power"));
this.addAbility(ability);
}
private FaerieBladecrafter(final FaerieBladecrafter card) {
super(card);
}
@Override
public FaerieBladecrafter copy() {
return new FaerieBladecrafter(this);
}
}

View file

@ -37,6 +37,8 @@ public final class FaerieGuidemother extends AdventureCard {
FlyingAbility.getInstance(), Duration.EndOfTurn FlyingAbility.getInstance(), Duration.EndOfTurn
).setText("and gains flying until end of turn")); ).setText("and gains flying until end of turn"));
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
this.finalizeAdventure();
} }
private FaerieGuidemother(final FaerieGuidemother card) { private FaerieGuidemother(final FaerieGuidemother card) {

View file

@ -0,0 +1,88 @@
package mage.cards.f;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.FaerieBlockFliersToken;
import mage.game.permanent.token.Token;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Susucr
*/
public final class FaerieSlumberParty extends CardImpl {
public FaerieSlumberParty(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{U}{U}");
// Return all creatures to their owners' hands. For each opponent who controlled a creature returned this way, you create two 1/1 blue Faerie creature tokens with flying and "This creature can block only creatures with flying."
this.getSpellAbility().addEffect(new FaerieSlumberPartyEffect());
}
private FaerieSlumberParty(final FaerieSlumberParty card) {
super(card);
}
@Override
public FaerieSlumberParty copy() {
return new FaerieSlumberParty(this);
}
}
class FaerieSlumberPartyEffect extends OneShotEffect {
FaerieSlumberPartyEffect() {
super(Outcome.Benefit);
this.staticText = "Return all creatures to their owners' hands. For each opponent who controlled a creature "
+ "returned this way, you create two 1/1 blue Faerie creature tokens with flying and "
+ "\"This creature can block only creatures with flying.\"";
}
private FaerieSlumberPartyEffect(final FaerieSlumberPartyEffect effect) {
super(effect);
}
@Override
public FaerieSlumberPartyEffect copy() {
return new FaerieSlumberPartyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Set<UUID> opponents = game.getOpponents(source.getControllerId());
int count = game.getBattlefield()
.getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)
.stream()
.filter(Objects::nonNull)
.map(Permanent::getControllerId)
.distinct()
.filter(opponents::contains)
.mapToInt(id -> 1)
.sum();
if(!new ReturnToHandFromBattlefieldAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE)
.apply(game, source)) {
return false;
}
if(count > 0) {
Token token = new FaerieBlockFliersToken();
token.putOntoBattlefield(2 * count, game, source, source.getControllerId());
}
return true;
}
}

View file

@ -30,6 +30,8 @@ public final class FangDragon extends AdventureCard {
this.getSpellCard().getSpellAbility().addEffect(new DamageAllEffect( this.getSpellCard().getSpellAbility().addEffect(new DamageAllEffect(
1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL
)); ));
this.finalizeAdventure();
} }
private FangDragon(final FangDragon card) { private FangDragon(final FangDragon card) {

View file

@ -1,6 +1,7 @@
package mage.cards.f; package mage.cards.f;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set;
import java.util.UUID; import java.util.UUID;
import mage.MageObject; import mage.MageObject;
@ -95,9 +96,9 @@ class FatalGrudgeEffect extends OneShotEffect {
class FatalGrudgePredicate implements Predicate<MageObject> { class FatalGrudgePredicate implements Predicate<MageObject> {
private final HashSet<CardType> types; private final Set<CardType> types;
public FatalGrudgePredicate(HashSet<CardType> types) { public FatalGrudgePredicate(Set<CardType> types) {
this.types = types; this.types = types;
} }

View file

@ -36,6 +36,7 @@ public final class FellHorseman extends AdventureCard {
this.getSpellCard().getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
this.finalizeAdventure();
} }
private FellHorseman(final FellHorseman card) { private FellHorseman(final FellHorseman card) {

View file

@ -33,6 +33,8 @@ public final class FerociousWerefox extends AdventureCard {
// Create a Monster Role token attached to target creature you control. // Create a Monster Role token attached to target creature you control.
this.getSpellCard().getSpellAbility().addEffect(new CreateRoleAttachedTargetEffect(RoleType.MONSTER)); this.getSpellCard().getSpellAbility().addEffect(new CreateRoleAttachedTargetEffect(RoleType.MONSTER));
this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.finalizeAdventure();
} }
private FerociousWerefox(final FerociousWerefox card) { private FerociousWerefox(final FerociousWerefox card) {

View file

@ -1,6 +1,6 @@
package mage.cards.f; package mage.cards.f;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.DealCombatDamageControlledTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
@ -8,15 +8,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.game.permanent.token.FaerieDragonToken; import mage.game.permanent.token.FaerieDragonToken;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID; import java.util.UUID;
/** /**
@ -32,7 +25,9 @@ public final class FeywildVisitor extends CardImpl {
// Commander creatures you own have "Whenever one or more nontoken creatures you control deal combat damage to a player, you create a 1/1 blue Faerie Dragon creature token with flying." // Commander creatures you own have "Whenever one or more nontoken creatures you control deal combat damage to a player, you create a 1/1 blue Faerie Dragon creature token with flying."
this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect( this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect(
new FeywildVisitorAbility(), Duration.WhileOnBattlefield, new DealCombatDamageControlledTriggeredAbility(new CreateTokenEffect(new FaerieDragonToken()), StaticFilters.FILTER_CREATURE_NON_TOKEN)
.setTriggerPhrase("Whenever one or more nontoken creatures you control deal combat damage to a player, you "),
Duration.WhileOnBattlefield,
StaticFilters.FILTER_CREATURES_OWNED_COMMANDER StaticFilters.FILTER_CREATURES_OWNED_COMMANDER
))); )));
} }
@ -46,49 +41,3 @@ public final class FeywildVisitor extends CardImpl {
return new FeywildVisitor(this); return new FeywildVisitor(this);
} }
} }
class FeywildVisitorAbility extends TriggeredAbilityImpl {
private final List<UUID> damagedPlayerIds = new ArrayList<>();
FeywildVisitorAbility() {
super(Zone.BATTLEFIELD, new CreateTokenEffect(new FaerieDragonToken()), false);
setTriggerPhrase("Whenever one or more nontoken creatures you control deal combat damage to a player, you ");
}
private FeywildVisitorAbility(final FeywildVisitorAbility ability) {
super(ability);
}
@Override
public FeywildVisitorAbility copy() {
return new FeywildVisitorAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|| event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_POST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_POST) {
damagedPlayerIds.clear();
return false;
}
if (event.getType() != GameEvent.EventType.DAMAGED_PLAYER
|| !((DamagedPlayerEvent) event).isCombatDamage()) {
return false;
}
Permanent creature = game.getPermanent(event.getSourceId());
if (creature == null
|| !creature.isControlledBy(getControllerId())
|| creature instanceof PermanentToken
|| damagedPlayerIds.contains(event.getTargetId())) {
return false;
}
damagedPlayerIds.add(event.getTargetId());
return true;
}
}

View file

@ -35,7 +35,7 @@ public final class FigureOfDestiny extends CardImpl {
Duration.Custom, SubType.KITHKIN, SubType.SPIRIT Duration.Custom, SubType.KITHKIN, SubType.SPIRIT
).setText("{this} becomes a Kithkin Spirit"), new ManaCostsImpl<>("{R/W}")); ).setText("{this} becomes a Kithkin Spirit"), new ManaCostsImpl<>("{R/W}"));
ability.addEffect(new SetBasePowerToughnessSourceEffect( ability.addEffect(new SetBasePowerToughnessSourceEffect(
2, 2, Duration.Custom, SubLayer.SetPT_7b 2, 2, Duration.Custom
).setText("with base power and toughness 2/2")); ).setText("with base power and toughness 2/2"));
this.addAbility(ability); this.addAbility(ability);
@ -86,7 +86,7 @@ class FigureOfDestinySpiritEffect extends OneShotEffect {
Duration.Custom, SubType.KITHKIN, SubType.SPIRIT, SubType.WARRIOR Duration.Custom, SubType.KITHKIN, SubType.SPIRIT, SubType.WARRIOR
), source); ), source);
game.addEffect(new SetBasePowerToughnessSourceEffect( game.addEffect(new SetBasePowerToughnessSourceEffect(
4, 4, Duration.Custom, SubLayer.SetPT_7b 4, 4, Duration.Custom
), source); ), source);
return true; return true;
} }
@ -119,7 +119,7 @@ class FigureOfDestinyWarriorEffect extends OneShotEffect {
Duration.Custom, SubType.KITHKIN, SubType.SPIRIT, SubType.WARRIOR, SubType.AVATAR Duration.Custom, SubType.KITHKIN, SubType.SPIRIT, SubType.WARRIOR, SubType.AVATAR
), source); ), source);
game.addEffect(new SetBasePowerToughnessSourceEffect( game.addEffect(new SetBasePowerToughnessSourceEffect(
8, 8, Duration.Custom, SubLayer.SetPT_7b 8, 8, Duration.Custom
), source); ), source);
game.addEffect(new GainAbilitySourceEffect( game.addEffect(new GainAbilitySourceEffect(
FlyingAbility.getInstance(), Duration.Custom FlyingAbility.getInstance(), Duration.Custom

View file

@ -45,6 +45,8 @@ public final class FlaxenIntruder extends AdventureCard {
// Welcome Home // Welcome Home
// Create three 2/2 green Bear creature tokens. // Create three 2/2 green Bear creature tokens.
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new BearToken(), 3)); this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new BearToken(), 3));
this.finalizeAdventure();
} }
private FlaxenIntruder(final FlaxenIntruder card) { private FlaxenIntruder(final FlaxenIntruder card) {

View file

@ -31,6 +31,8 @@ public final class FoulmireKnight extends AdventureCard {
// You draw a card and you lose 1 life. // You draw a card and you lose 1 life.
this.getSpellCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).setText("You draw a card")); this.getSpellCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).setText("You draw a card"));
this.getSpellCard().getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and")); this.getSpellCard().getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
this.finalizeAdventure();
} }
private FoulmireKnight(final FoulmireKnight card) { private FoulmireKnight(final FoulmireKnight card) {

View file

@ -44,7 +44,7 @@ public final class FrodoSauronsBane extends CardImpl {
this.addAbility(new SimpleActivatedAbility( this.addAbility(new SimpleActivatedAbility(
new ConditionalOneShotEffect(new AddContinuousEffectToGame( new ConditionalOneShotEffect(new AddContinuousEffectToGame(
new AddCardSubTypeSourceEffect(Duration.Custom, SubType.HALFLING, SubType.SCOUT), new AddCardSubTypeSourceEffect(Duration.Custom, SubType.HALFLING, SubType.SCOUT),
new SetBasePowerToughnessSourceEffect(2, 3, Duration.Custom, SubLayer.SetPT_7b), new SetBasePowerToughnessSourceEffect(2, 3, Duration.Custom),
new GainAbilitySourceEffect(LifelinkAbility.getInstance(), Duration.Custom) new GainAbilitySourceEffect(LifelinkAbility.getInstance(), Duration.Custom)
), condition1, "if {this} is a Citizen, it becomes a Halfling Scout with base power and toughness 2/3 and lifelink"), ), condition1, "if {this} is a Citizen, it becomes a Halfling Scout with base power and toughness 2/3 and lifelink"),
new ManaCostsImpl<>("{W/B}{W/B}") new ManaCostsImpl<>("{W/B}{W/B}")

View file

@ -41,6 +41,8 @@ public final class FrolickingFamiliar extends AdventureCard {
// Blow Off Steam deals 1 damage to any target. // Blow Off Steam deals 1 damage to any target.
this.getSpellCard().getSpellAbility().addEffect(new DamageTargetEffect(1)); this.getSpellCard().getSpellAbility().addEffect(new DamageTargetEffect(1));
this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget()); this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget());
this.finalizeAdventure();
} }
private FrolickingFamiliar(final FrolickingFamiliar card) { private FrolickingFamiliar(final FrolickingFamiliar card) {

View file

@ -1,21 +1,22 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.DrawDiscardControllerEffect; import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.ManaValuePredicate; import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.target.common.TargetOpponentsCreaturePermanent; import mage.target.common.TargetOpponentsCreaturePermanent;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.ComparisonType;
/** /**
* *
@ -46,6 +47,8 @@ public final class GalvanicGiant extends AdventureCard {
// Storm Reading // Storm Reading
// Draw four cards, then discard two cards. // Draw four cards, then discard two cards.
this.getSpellCard().getSpellAbility().addEffect(new DrawDiscardControllerEffect(4, 2)); this.getSpellCard().getSpellAbility().addEffect(new DrawDiscardControllerEffect(4, 2));
this.finalizeAdventure();
} }
private GalvanicGiant(final GalvanicGiant card) { private GalvanicGiant(final GalvanicGiant card) {

View file

@ -28,6 +28,8 @@ public final class GarenbrigCarver extends AdventureCard {
// Target creature gets +2/+2 until end of turn. // Target creature gets +2/+2 until end of turn.
this.getSpellCard().getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); this.getSpellCard().getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn));
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
this.finalizeAdventure();
} }
private GarenbrigCarver(final GarenbrigCarver card) { private GarenbrigCarver(final GarenbrigCarver card) {

View file

@ -1,7 +1,6 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
@ -18,6 +17,8 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
* *
* @author TheElk801 * @author TheElk801
@ -51,16 +52,16 @@ public final class GhastlyRemains extends CardImpl {
class GhastlyRemainsTriggeredAbility extends BeginningOfUpkeepTriggeredAbility { class GhastlyRemainsTriggeredAbility extends BeginningOfUpkeepTriggeredAbility {
public GhastlyRemainsTriggeredAbility() { GhastlyRemainsTriggeredAbility() {
super(Zone.GRAVEYARD, new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl<>("{B}{B}{B}")), TargetController.YOU, false); super(Zone.GRAVEYARD, new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl<>("{B}{B}{B}")), TargetController.YOU, false);
} }
public GhastlyRemainsTriggeredAbility(GhastlyRemainsTriggeredAbility ability) { private GhastlyRemainsTriggeredAbility(final GhastlyRemainsTriggeredAbility ability) {
super(ability); super(ability);
} }
@Override @Override
public BeginningOfUpkeepTriggeredAbility copy() { public GhastlyRemainsTriggeredAbility copy() {
return new GhastlyRemainsTriggeredAbility(this); return new GhastlyRemainsTriggeredAbility(this);
} }

View file

@ -1,21 +1,21 @@
package mage.cards.g; package mage.cards.g;
import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.effects.common.counter.AddCountersAttachedEffect; import mage.abilities.effects.common.counter.AddCountersAttachedEffect;
import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.EquipAbility;
import mage.cards.AdventureCard; import mage.cards.AdventureCard;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType; import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID; import java.util.UUID;
import mage.abilities.costs.mana.GenericManaCost;
import mage.constants.Outcome;
import mage.target.common.TargetControlledCreaturePermanent;
/** /**
* @author TheElk801 * @author TheElk801
@ -39,6 +39,8 @@ public final class GhostLantern extends AdventureCard {
// Return target creature card from your graveyard to your hand. // Return target creature card from your graveyard to your hand.
this.getSpellCard().getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
this.finalizeAdventure();
} }
private GhostLantern(final GhostLantern card) { private GhostLantern(final GhostLantern card) {

View file

@ -49,6 +49,8 @@ public final class GiantKiller extends AdventureCard {
// Destroy target creature with power 4 or greater. // Destroy target creature with power 4 or greater.
this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter));
this.finalizeAdventure();
} }
private GiantKiller(final GiantKiller card) { private GiantKiller(final GiantKiller card) {

View file

@ -71,7 +71,7 @@ class GigantiformAbility extends StaticAbility {
super(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA)); super(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA));
Ability ability = new SimpleStaticAbility( Ability ability = new SimpleStaticAbility(
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new SetBasePowerToughnessSourceEffect(8, 8, Duration.WhileOnBattlefield, SubLayer.SetPT_7b) new SetBasePowerToughnessSourceEffect(8, 8, Duration.WhileOnBattlefield)
); );
this.addEffect(new GainAbilityAttachedEffect(ability, AttachmentType.AURA)); this.addEffect(new GainAbilityAttachedEffect(ability, AttachmentType.AURA));
} }

View file

@ -1,4 +1,3 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID; import java.util.UUID;
@ -8,7 +7,6 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.effects.common.CopyPermanentEffect;
@ -18,7 +16,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubLayer;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
@ -56,8 +53,7 @@ class GigantoplasmCopyApplier extends CopyApplier {
@Override @Override
public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) { public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) {
DynamicValue variableMana = ManacostVariableValue.REGULAR; Effect effect = new SetBasePowerToughnessSourceEffect(ManacostVariableValue.REGULAR, Duration.Custom);
Effect effect = new SetBasePowerToughnessSourceEffect(variableMana, variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b);
effect.setText("This creature has base power and toughness X/X"); effect.setText("This creature has base power and toughness X/X");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{X}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{X}"));
blueprint.getAbilities().add(ability); blueprint.getAbilities().add(ability);

View file

@ -1,7 +1,6 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.common.DiscardCardCost;
@ -17,6 +16,8 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
* *
* @author Plopman * @author Plopman
@ -47,18 +48,18 @@ public final class Gigapede extends CardImpl {
} }
class GigapedeTriggerdAbility extends BeginningOfUpkeepTriggeredAbility{ class GigapedeTriggerdAbility extends BeginningOfUpkeepTriggeredAbility {
public GigapedeTriggerdAbility(){ GigapedeTriggerdAbility() {
super(Zone.GRAVEYARD, new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new DiscardCardCost()), TargetController.YOU, false); super(Zone.GRAVEYARD, new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new DiscardCardCost()), TargetController.YOU, false);
} }
public GigapedeTriggerdAbility(GigapedeTriggerdAbility ability) { private GigapedeTriggerdAbility(final GigapedeTriggerdAbility ability) {
super(ability); super(ability);
} }
@Override @Override
public BeginningOfUpkeepTriggeredAbility copy() { public GigapedeTriggerdAbility copy() {
return new GigapedeTriggerdAbility(this); return new GigapedeTriggerdAbility(this);
} }

View file

@ -32,6 +32,8 @@ public final class GingerbreadHunter extends AdventureCard {
// Target creature gets -2/-2 until end of turn. // Target creature gets -2/-2 until end of turn.
this.getSpellCard().getSpellAbility().addEffect(new BoostTargetEffect(-2, -2)); this.getSpellCard().getSpellAbility().addEffect(new BoostTargetEffect(-2, -2));
this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
this.finalizeAdventure();
} }
private GingerbreadHunter(final GingerbreadHunter card) { private GingerbreadHunter(final GingerbreadHunter card) {

View file

@ -1,7 +1,6 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -25,6 +24,8 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -70,10 +71,10 @@ class CountersOnControlledCount implements DynamicValue {
static FilterCreaturePermanent filter = new FilterCreaturePermanent(); static FilterCreaturePermanent filter = new FilterCreaturePermanent();
public CountersOnControlledCount() { CountersOnControlledCount() {
} }
public CountersOnControlledCount(final CountersOnControlledCount dynamicValue) { private CountersOnControlledCount(final CountersOnControlledCount dynamicValue) {
super(); super();
} }
@ -90,7 +91,7 @@ class CountersOnControlledCount implements DynamicValue {
} }
@Override @Override
public DynamicValue copy() { public CountersOnControlledCount copy() {
return new CountersOnControlledCount(this); return new CountersOnControlledCount(this);
} }

View file

@ -1,8 +1,6 @@
package mage.cards.g; package mage.cards.g;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
@ -13,14 +11,13 @@ import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.List;
import java.util.UUID;
/** /**
* *
* @author North * @author North
@ -51,10 +48,10 @@ public final class GolemSkinGauntlets extends CardImpl {
// compare to Goblin Gaveleer // compare to Goblin Gaveleer
class GolemSkinGauntletsAttachedCount implements DynamicValue { class GolemSkinGauntletsAttachedCount implements DynamicValue {
public GolemSkinGauntletsAttachedCount() { GolemSkinGauntletsAttachedCount() {
} }
public GolemSkinGauntletsAttachedCount(final GolemSkinGauntletsAttachedCount dynamicValue) { private GolemSkinGauntletsAttachedCount(final GolemSkinGauntletsAttachedCount dynamicValue) {
} }
@Override @Override
@ -78,7 +75,7 @@ class GolemSkinGauntletsAttachedCount implements DynamicValue {
} }
@Override @Override
public DynamicValue copy() { public GolemSkinGauntletsAttachedCount copy() {
return new GolemSkinGauntletsAttachedCount(this); return new GolemSkinGauntletsAttachedCount(this);
} }

View file

@ -52,6 +52,8 @@ public final class GrabbyGiant extends AdventureCard {
// That's Mine // That's Mine
// Create a Treasure token. // Create a Treasure token.
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new TreasureToken())); this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new TreasureToken()));
this.finalizeAdventure();
} }
private GrabbyGiant(final GrabbyGiant card) { private GrabbyGiant(final GrabbyGiant card) {

View file

@ -48,6 +48,8 @@ public final class GraySlaad extends AdventureCard {
// Entropic Decay // Entropic Decay
// Mill four cards. // Mill four cards.
this.getSpellCard().getSpellAbility().addEffect(new MillCardsControllerEffect(4)); this.getSpellCard().getSpellAbility().addEffect(new MillCardsControllerEffect(4));
this.finalizeAdventure();
} }
private GraySlaad(final GraySlaad card) { private GraySlaad(final GraySlaad card) {

View file

@ -42,6 +42,8 @@ public final class GuardianNaga extends AdventureCard {
// Exile target artifact or enchantment. // Exile target artifact or enchantment.
this.getSpellCard().getSpellAbility().addEffect(new ExileTargetEffect()); this.getSpellCard().getSpellAbility().addEffect(new ExileTargetEffect());
this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT)); this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
this.finalizeAdventure();
} }
private GuardianNaga(final GuardianNaga card) { private GuardianNaga(final GuardianNaga card) {

View file

@ -1,15 +1,9 @@
package mage.cards.g; package mage.cards.g;
import java.util.Set;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
@ -22,6 +16,9 @@ import mage.target.Target;
import mage.target.TargetCard; import mage.target.TargetCard;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.Set;
import java.util.UUID;
/** /**
* *
* @author TheElk801 * @author TheElk801
@ -95,7 +92,7 @@ class GuidedPassageEffect extends OneShotEffect {
} }
TargetCard target1 = new TargetCard(1, Zone.LIBRARY, StaticFilters.FILTER_CARD_CREATURE); TargetCard target1 = new TargetCard(1, Zone.LIBRARY, StaticFilters.FILTER_CARD_CREATURE);
TargetCard target2 = new TargetCard(1, Zone.LIBRARY, StaticFilters.FILTER_CARD_LAND); TargetCard target2 = new TargetCard(1, Zone.LIBRARY, StaticFilters.FILTER_CARD_LAND);
TargetCard target3 = new TargetCard(1, Zone.LIBRARY, new FilterCard(filter)); TargetCard target3 = new TargetCard(1, Zone.LIBRARY, filter);
opponent.chooseTarget(Outcome.Detriment, cards, target1, source, game); opponent.chooseTarget(Outcome.Detriment, cards, target1, source, game);
opponent.chooseTarget(Outcome.Detriment, cards, target2, source, game); opponent.chooseTarget(Outcome.Detriment, cards, target2, source, game);
opponent.chooseTarget(Outcome.Detriment, cards, target3, source, game); opponent.chooseTarget(Outcome.Detriment, cards, target3, source, game);

View file

@ -37,15 +37,17 @@ public final class GumdropPoisoner extends AdventureCard {
// Lifelink // Lifelink
this.addAbility(LifelinkAbility.getInstance()); this.addAbility(LifelinkAbility.getInstance());
// When Gumdrop Poisoner enters the battlefield, target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn. // When Gumdrop Poisoner enters the battlefield, up to one target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn.
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(xValue, xValue) Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(xValue, xValue)
.setText("target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn")); .setText("up to one target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn"));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent(0, 1));
this.addAbility(ability.addHint(ControllerGainedLifeCount.getHint()), new PlayerGainedLifeWatcher()); this.addAbility(ability.addHint(ControllerGainedLifeCount.getHint()), new PlayerGainedLifeWatcher());
// Tempt with Treats // Tempt with Treats
// Create a Food token. // Create a Food token.
this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken())); this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken()));
this.finalizeAdventure();
} }
private GumdropPoisoner(final GumdropPoisoner card) { private GumdropPoisoner(final GumdropPoisoner card) {

View file

@ -81,9 +81,9 @@ class HalfdaneUpkeepEffect extends OneShotEffect {
ContinuousEffect effect = new SetBasePowerToughnessSourceEffect( ContinuousEffect effect = new SetBasePowerToughnessSourceEffect(
permanent.getPower().getValue(), permanent.getPower().getValue(),
permanent.getToughness().getValue(), permanent.getToughness().getValue(),
Duration.UntilYourNextUpkeepStep, Duration.UntilYourNextUpkeepStep
SubLayer.SetPT_7b); );
game.addEffect(effect, source); game.addEffect(effect, source);
return true; return true;
} }
} }

View file

@ -44,6 +44,8 @@ public final class HeartflameDuelist extends AdventureCard {
// Heartflame Slash deals 3 damage to any target. // Heartflame Slash deals 3 damage to any target.
this.getSpellCard().getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellCard().getSpellAbility().addEffect(new DamageTargetEffect(3));
this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget()); this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget());
this.finalizeAdventure();
} }
private HeartflameDuelist(final HeartflameDuelist card) { private HeartflameDuelist(final HeartflameDuelist card) {
@ -54,4 +56,4 @@ public final class HeartflameDuelist extends AdventureCard {
public HeartflameDuelist copy() { public HeartflameDuelist copy() {
return new HeartflameDuelist(this); return new HeartflameDuelist(this);
} }
} }

Some files were not shown because too many files have changed in this diff Show more