diff --git a/Mage.Sets/src/mage/cards/m/MathasFiendSeeker.java b/Mage.Sets/src/mage/cards/m/MathasFiendSeeker.java index bb6c0d144e..e123dd9db1 100644 --- a/Mage.Sets/src/mage/cards/m/MathasFiendSeeker.java +++ b/Mage.Sets/src/mage/cards/m/MathasFiendSeeker.java @@ -80,7 +80,7 @@ public class MathasFiendSeeker extends CardImpl { // At the beginning of your end step, put a bounty counter on target creature an opponent controls. For as long as that creature has a bounty counter on it, it has "When this creature dies, each opponent draws a card and gains 2 life." Ability ability = new BeginningOfYourEndStepTriggeredAbility(new AddCountersTargetEffect(CounterType.BOUNTY.createInstance()), false); ability.addTarget(new TargetCreaturePermanent(filter)); - Ability ability2 = new DiesTriggeredAbility(new DrawCardAllEffect(2, TargetController.OPPONENT)); + Ability ability2 = new DiesTriggeredAbility(new DrawCardAllEffect(1, TargetController.OPPONENT)); ability2.addEffect(new OpponentsGainLifeEffect()); Effect effect = new MathasFiendSeekerGainAbilityEffect( ability2, diff --git a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java index b1d63e8ed8..add8f8fe35 100644 --- a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java +++ b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java @@ -89,7 +89,7 @@ public class NimDeathmantle extends CardImpl { class NimDeathmantleTriggeredAbility extends TriggeredAbilityImpl { NimDeathmantleTriggeredAbility() { - super(Zone.BATTLEFIELD, new NimDeathmantleEffect(), true); + super(Zone.BATTLEFIELD, new NimDeathmantleEffect(), false); } NimDeathmantleTriggeredAbility(NimDeathmantleTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/cards/o/OathOfDruids.java b/Mage.Sets/src/mage/cards/o/OathOfDruids.java index 9b76d66afb..f3217435ae 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfDruids.java +++ b/Mage.Sets/src/mage/cards/o/OathOfDruids.java @@ -63,10 +63,10 @@ public class OathOfDruids extends CardImpl { } public OathOfDruids(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); // At the beginning of each player's upkeep, that player chooses target player who controls more creatures than he or she does and is his or her opponent. The first player may reveal cards from the top of his or her library until he or she reveals a creature card. If he or she does, that player puts that card onto the battlefield and all other cards revealed this way into his or her graveyard. - Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfDruidsEffect(), TargetController.ANY, true); + Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfDruidsEffect(), TargetController.ANY, false); ability.addTarget(new TargetPlayer(1, 1, false, filter)); originalId = ability.getOriginalId(); this.addAbility(ability); @@ -77,9 +77,11 @@ public class OathOfDruids extends CardImpl { if (ability.getOriginalId().equals(originalId)) { Player activePlayer = game.getPlayer(game.getActivePlayerId()); if (activePlayer != null) { - ability.setControllerId(activePlayer.getId()); ability.getTargets().clear(); +// FilterPlayer filter = new FilterPlayer(); +// filter.add(new OathOfDruidsPredicate()); TargetPlayer target = new TargetPlayer(1, 1, false, filter); + target.setTargetController(activePlayer.getId()); ability.getTargets().add(target); } } @@ -108,7 +110,7 @@ class OathOfDruidsPredicate implements ObjectSourcePlayerPredicate> { + + private static final FilterCard filter = new FilterCard("creature cards"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + } + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + Player targetPlayer = input.getObject(); + Player firstPlayer = game.getPlayer(game.getActivePlayerId()); + if (targetPlayer == null + || firstPlayer == null + || !firstPlayer.hasOpponent(targetPlayer.getId(), game)) { + return false; + } + int countGraveyardTargetPlayer = targetPlayer.getGraveyard().getCards(filter, game).size(); + int countGraveyardFirstPlayer = firstPlayer.getGraveyard().getCards(filter, game).size(); + + return countGraveyardTargetPlayer < countGraveyardFirstPlayer; + } + + @Override + public String toString() { + return "player whose graveyard has fewer creature cards in it than his or her graveyard does and is his or her opponent"; + } +} + +class OathOfGhoulsEffect extends OneShotEffect { + +// private static final FilterCard filter = new FilterCard("creature card"); +// +// static { +// filter.add(new CardTypePredicate(CardType.CREATURE)); +// filter.add(new OwnerPredicate(TargetController.ACTIVE)); +// } + + public OathOfGhoulsEffect() { + super(Outcome.Benefit); + staticText = "that player chooses target player whose graveyard has fewer creature cards in it than his or her graveyard does and is his or her opponent. The first player may return a creature card from his or her graveyard to his or her hand"; + } + + public OathOfGhoulsEffect(OathOfGhoulsEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = game.getObject(source.getSourceId()); + Player firstPlayer = game.getPlayer(game.getActivePlayerId()); + if (sourceObject == null || firstPlayer == null) { + return false; + } + FilterCard filter = new FilterCreatureCard("creature card"); + filter.add(new OwnerIdPredicate(firstPlayer.getId())); + Target target = new TargetCardInGraveyard(filter); + target.setNotTarget(true); +// target.setTargetController(firstPlayer.getId()); + if (target.canChoose(source.getSourceId(),firstPlayer.getId(), game) + && firstPlayer.chooseUse(outcome, "Return a creature card from your graveyard to your hand?", source, game) + && firstPlayer.chooseTarget(Outcome.ReturnToHand, target, source, game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + firstPlayer.moveCards(card, Zone.HAND, source, game); + } + } + return true; + } + + @Override + public OathOfGhoulsEffect copy() { + return new OathOfGhoulsEffect(this); + } +} diff --git a/Mage.Sets/src/mage/cards/o/OathOfLieges.java b/Mage.Sets/src/mage/cards/o/OathOfLieges.java index 0a075b444d..38479085ff 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfLieges.java +++ b/Mage.Sets/src/mage/cards/o/OathOfLieges.java @@ -56,16 +56,15 @@ import java.util.UUID; */ public class OathOfLieges extends CardImpl { + private final UUID originalId; private static final FilterPlayer FILTER = new FilterPlayer("player who controls more lands than you do and is your opponent"); static { FILTER.add(new OathOfLiegesPredicate()); } - private final UUID originalId; - public OathOfLieges(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); // At the beginning of each player's upkeep, that player chooses target player who controls more lands than he or she does and is his or her opponent. The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library. Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfLiegesEffect(), TargetController.ANY, false); @@ -74,11 +73,6 @@ public class OathOfLieges extends CardImpl { this.addAbility(ability); } - public OathOfLieges(final OathOfLieges card) { - super(card); - this.originalId = card.originalId; - } - @Override public void adjustTargets(Ability ability, Game game) { if (ability.getOriginalId().equals(originalId)) { @@ -92,6 +86,11 @@ public class OathOfLieges extends CardImpl { } } + public OathOfLieges(final OathOfLieges card) { + super(card); + this.originalId = card.originalId; + } + @Override public OathOfLieges copy() { return new OathOfLieges(this); @@ -102,7 +101,8 @@ class OathOfLiegesEffect extends OneShotEffect { public OathOfLiegesEffect() { super(Outcome.Benefit); - this.staticText = "that player chooses target player who controls more lands than he or she does and is his or her opponent. The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library"; + this.staticText = "that player chooses target player who controls more lands than he or she does and is his or her opponent. " + + "The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library"; } public OathOfLiegesEffect(final OathOfLiegesEffect effect) { @@ -142,7 +142,7 @@ class OathOfLiegesPredicate implements ObjectSourcePlayerPredicate> { + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + Player targetPlayer = input.getObject(); + Player firstPlayer = game.getPlayer(game.getActivePlayerId()); + if (targetPlayer == null + || firstPlayer == null + || !firstPlayer.hasOpponent(targetPlayer.getId(), game)) { + return false; + } + int lifeTotalTargetPlayer = targetPlayer.getLife(); + int lifeTotalFirstPlayer = firstPlayer.getLife(); + + return lifeTotalTargetPlayer > lifeTotalFirstPlayer; + } + + @Override + public String toString() { + return "player who has more life than he or she does and is his or her opponent"; + } +} + +class OathOfMagesEffect extends OneShotEffect { + + public OathOfMagesEffect() { + super(Outcome.Damage); + staticText = "that player chooses target player who has more life than he or she does and is his or her opponent. The first player may have Oath of Mages deal 1 damage to the second player"; + } + + public OathOfMagesEffect(OathOfMagesEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = game.getObject(source.getSourceId()); + Player firstPlayer = game.getPlayer(game.getActivePlayerId()); + Player secondPlayer = game.getPlayer(source.getFirstTarget()); + if (sourceObject == null || firstPlayer == null) { + return false; + } + if (firstPlayer.chooseUse(outcome, "Deal one damage to " + secondPlayer.getLogName() + "?", source, game)) { + secondPlayer.damage(1, source.getId(), game, false, true); + } + return true; + } + + @Override + public OathOfMagesEffect copy() { + return new OathOfMagesEffect(this); + } +} diff --git a/Mage.Sets/src/mage/cards/o/OathOfScholars.java b/Mage.Sets/src/mage/cards/o/OathOfScholars.java index 9dce28ca2d..28fb5c4a3f 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfScholars.java +++ b/Mage.Sets/src/mage/cards/o/OathOfScholars.java @@ -65,7 +65,7 @@ public class OathOfScholars extends CardImpl { ability.addTarget(new TargetPlayer(1, 1, false, filter)); this.addAbility(ability); originalId = ability.getOriginalId(); - + } @Override @@ -73,9 +73,9 @@ public class OathOfScholars extends CardImpl { if (ability.getOriginalId().equals(originalId)) { Player activePlayer = game.getPlayer(game.getActivePlayerId()); if (activePlayer != null) { - ability.setControllerId(activePlayer.getId()); ability.getTargets().clear(); TargetPlayer target = new TargetPlayer(1, 1, false, filter); + target.setTargetController(activePlayer.getId()); ability.getTargets().add(target); } } @@ -100,8 +100,7 @@ class OathOfScholarsPredicate implements ObjectSourcePlayerPredicate