diff --git a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java index 9554817d948..bfe1f16d8a4 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java +++ b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EndOfCombatTriggeredAbility; import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.ContinuousEffect; @@ -77,7 +78,7 @@ public class TheWretched extends CardImpl { this.toughness = new MageInt(5); // At end of combat, gain control of all creatures blocking The Wretched for as long as you control The Wretched. - this.addAbility(new EndOfAnyCombatTriggeredAbility(), new BlockedAttackerWatcher()); + this.addAbility(new EndOfCombatTriggeredAbility(new TheWretchedEffect(), false), new BlockedAttackerWatcher()); } @@ -91,37 +92,6 @@ public class TheWretched extends CardImpl { } } -class EndOfAnyCombatTriggeredAbility extends TriggeredAbilityImpl { - - EndOfAnyCombatTriggeredAbility() { - super(Zone.BATTLEFIELD, new TheWretchedEffect(), false); - } - - EndOfAnyCombatTriggeredAbility(final EndOfAnyCombatTriggeredAbility ability) { - super(ability); - } - - @Override - public EndOfAnyCombatTriggeredAbility copy() { - return new EndOfAnyCombatTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return true; - } - - @Override - public String getRule() { - return "At the end of combat, gain control of all creatures blocking {this} for as long as you control {this}."; - } -} - class TheWretchedEffect extends OneShotEffect { TheWretchedEffect() { diff --git a/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java b/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java index 38ceb429d07..ab61208dc24 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java +++ b/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java @@ -37,7 +37,7 @@ public class CatacombSlug extends mage.sets.returntoravnica.CatacombSlug { public CatacombSlug(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 998; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java b/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java index 7aafc1d8ef6..9415221491c 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java @@ -37,7 +37,7 @@ public class ChandrasFury extends mage.sets.magic2013.ChandrasFury { public ChandrasFury(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 997; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java b/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java index 3cbc9c975af..60c62df9cbd 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java @@ -37,7 +37,7 @@ public class ChargingGriffin extends mage.sets.magic2014.ChargingGriffin { public ChargingGriffin(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 996; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java b/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java index b363d80e591..ef033f9db46 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java +++ b/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java @@ -37,7 +37,7 @@ public class Claustrophobia extends mage.sets.innistrad.Claustrophobia { public Claustrophobia(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 995; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java b/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java index 97349a0e0e7..7c282ccd931 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java +++ b/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java @@ -37,7 +37,7 @@ public class Cobblebrute extends mage.sets.returntoravnica.Cobblebrute { public Cobblebrute(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 994; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java b/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java index 7682e5befe8..c82e1c25a66 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java +++ b/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java @@ -37,7 +37,7 @@ public class CruelRevival extends mage.sets.onslaught.CruelRevival { public CruelRevival(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 993; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/Disperse.java b/Mage.Sets/src/mage/sets/magicorigins/Disperse.java index 7581651100b..962e36434b6 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/Disperse.java +++ b/Mage.Sets/src/mage/sets/magicorigins/Disperse.java @@ -37,7 +37,7 @@ public class Disperse extends mage.sets.scarsofmirrodin.Disperse { public Disperse(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 992; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java b/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java index d901aee1be2..4b13a997457 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java @@ -37,7 +37,7 @@ public class ElvishVisionary extends mage.sets.shardsofalara.ElvishVisionary { public ElvishVisionary(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 991; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java b/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java index a973a8e8d1b..92348e1805a 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java +++ b/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java @@ -37,7 +37,7 @@ public class FieryConclusion extends mage.sets.ravnica.FieryConclusion { public FieryConclusion(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 990; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java new file mode 100644 index 00000000000..5c291b6c299 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java @@ -0,0 +1,194 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.RequirementEffect; +import mage.abilities.effects.common.PreventAllDamageToSourceEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.TurnPhase; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class GideonBattleForged extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public GideonBattleForged(UUID ownerId) { + super(ownerId, 23, "Gideon, Battle-Forged", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, ""); + this.expansionSetCode = "ORI"; + this.subtype.add("Gideon"); + + this.color.setWhite(true); + + this.nightCard = true; + this.canTransform = true; + + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + + // +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able. + LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new GideonBattleForgedAttacksIfAbleTargetEffect(Duration.Custom), 2); + loyaltyAbility.addTarget(new TargetCreaturePermanent(0,1,filter, false)); + this.addAbility(loyaltyAbility); + + // +1: Until your next turn, target creature gains indestructible. Untap that creature. + Effect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.UntilYourNextTurn); + effect.setText("Until your next turn, target creature gains indestructible"); + loyaltyAbility = new LoyaltyAbility(effect, 1); + effect = new UntapTargetEffect(); + effect.setText("Untap that creature"); + loyaltyAbility.addEffect(effect); + this.addAbility(loyaltyAbility); + + // 0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn. + LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonBattleForgedToken(), "planeswalker", Duration.EndOfTurn), 0); + effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("Prevent all damage that would be dealt to him this turn"); + ability3.addEffect(effect); + this.addAbility(ability3); + + } + + public GideonBattleForged(final GideonBattleForged card) { + super(card); + } + + @Override + public GideonBattleForged copy() { + return new GideonBattleForged(this); + } +} + +class GideonBattleForgedToken extends Token { + + public GideonBattleForgedToken() { + super("", "4/4 Human Soldier creature with indestructible"); + cardType.add(CardType.CREATURE); + subtype.add("Human"); + subtype.add("Soldier"); + power = new MageInt(4); + toughness = new MageInt(4); + this.addAbility(IndestructibleAbility.getInstance()); + } + +} + +class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { + + int nextTurnTargetController = 0; + protected MageObjectReference targetPermanentReference; + + public GideonBattleForgedAttacksIfAbleTargetEffect(Duration duration) { + super(duration); + staticText = "Up to one target creature an opponent controls attacks {this} during its controller's next turn if able"; + } + + public GideonBattleForgedAttacksIfAbleTargetEffect(final GideonBattleForgedAttacksIfAbleTargetEffect effect) { + super(effect); + this.nextTurnTargetController = effect.nextTurnTargetController; + this.targetPermanentReference = effect.targetPermanentReference; + } + + @Override + public GideonBattleForgedAttacksIfAbleTargetEffect copy() { + return new GideonBattleForgedAttacksIfAbleTargetEffect(this); + } + + @Override + public boolean isInactive(Ability source, Game game) { + Permanent targetPermanent = targetPermanentReference.getPermanent(game); + if (targetPermanent == null) { + return false; + } + if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) { + nextTurnTargetController = game.getTurnNum(); + } + return game.getPhase().getType() == TurnPhase.END && game.getTurnNum() > nextTurnTargetController; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) { + if (game.getActivePlayerId().equals(permanent.getControllerId())) { + Permanent planeswalker = game.getPermanent(source.getSourceId()); + if (planeswalker != null) { + if (planeswalker.getCardType().contains(CardType.CREATURE)) { + return true; + } + } else { + discard(); + } + } + } + return false; + } + + @Override + public UUID mustAttackDefender(Ability source, Game game) { + return source.getSourceId(); + } + + @Override + public boolean mustAttack(Game game) { + return true; + } + + @Override + public boolean mustBlock(Game game) { + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java b/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java index 418337f87b1..6d2b6f15f2c 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java +++ b/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java @@ -37,7 +37,7 @@ public class GoldForgedSentinel extends mage.sets.journeyintonyx.GoldForgedSenti public GoldForgedSentinel(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 989; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java index acdb852b8b7..bc5db55e567 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java +++ b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java @@ -57,7 +57,7 @@ import mage.util.CardUtil; public class HixusPrisonWarden extends CardImpl { public HixusPrisonWarden(UUID ownerId) { - super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}{3}{W}{W}"); + super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.expansionSetCode = "ORI"; this.supertype.add("Legendary"); this.subtype.add("Human"); diff --git a/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java b/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java index 8588e525641..4679bf67104 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java +++ b/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java @@ -38,7 +38,7 @@ public class JayemdaeTome extends mage.sets.tenthedition.JayemdaeTome { public JayemdaeTome(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 988; this.expansionSetCode = "ORI"; this.rarity = Rarity.UNCOMMON; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java b/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java new file mode 100644 index 00000000000..0da1c307fc7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.EndOfCombatTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.watchers.common.AttackedThisCombatWatcher; + +/** + * + * @author LevelX2 + */ +public class KytheonHeroOfAkros extends CardImpl { + + public KytheonHeroOfAkros(UUID ownerId) { + super(ownerId, 23, "Kytheon, Hero of Akros", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ORI"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + this.canTransform = true; + this.secondSideCard = new GideonBattleForged(ownerId); + + // At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, + // then return him to the battlefield transformed under his owner's control. + this.addAbility(new TransformAbility()); + this.addAbility(new ConditionalTriggeredAbility(new EndOfCombatTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.MALE), false), + new KytheonHeroOfAkrosCondition(), "At end of combat, if {this} and at least two other creatures attacked this combat, exile {this}, " + + "then return him to the battlefield transformed under his owner's control."), new AttackedThisCombatWatcher()); + + // {2}{W}: Kytheon gains indestructible until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl<>("{2}{W}"))); + + } + + public KytheonHeroOfAkros(final KytheonHeroOfAkros card) { + super(card); + } + + @Override + public KytheonHeroOfAkros copy() { + return new KytheonHeroOfAkros(this); + } +} + +class KytheonHeroOfAkrosCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + Permanent sourceObject = game.getPermanent(source.getSourceId()); + if (sourceObject != null) { + AttackedThisCombatWatcher watcher = (AttackedThisCombatWatcher) game.getState().getWatchers().get("AttackedThisCombat"); + if (watcher != null) { + boolean sourceFound = false; + int number = 0; + for (MageObjectReference mor: watcher.getAttackedThisTurnCreatures()) { + if (mor.refersTo(sourceObject, game)) { + sourceFound = true; + } else { + number++; + } + } + return sourceFound && number >= 2; + } + } + return false; + } + + @Override + public String toString() { + return "if {this} and at least two other creatures attacked this combat"; + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java b/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java index 5c2ef28e0af..e4346108392 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java +++ b/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java @@ -37,7 +37,7 @@ public class LeafGilder extends mage.sets.lorwyn.LeafGilder { public LeafGilder(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 987; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java b/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java index ffc48924a7a..5aefd0e3821 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java +++ b/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java @@ -37,7 +37,7 @@ public class MaritimeGuard extends mage.sets.magic2011.MaritimeGuard { public MaritimeGuard(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 986; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java b/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java index f76704a0dba..2996f3fa423 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java +++ b/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java @@ -37,7 +37,7 @@ public class Meteorite extends mage.sets.magic2015.Meteorite { public Meteorite(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 985; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java b/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java index ca7871a5d01..3686162a484 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java +++ b/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java @@ -37,7 +37,7 @@ public class MightyLeap extends mage.sets.magic2011.MightyLeap { public MightyLeap(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 984; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java b/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java index 22ef98bc763..439cf1fb125 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java +++ b/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java @@ -29,28 +29,22 @@ package mage.sets.magicorigins; import java.util.UUID; import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.abilities.keyword.TransformAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; -import mage.game.Game; -import mage.players.Player; import mage.target.common.TargetCardInLibrary; /** @@ -83,7 +77,7 @@ public class NissaVastwoodSeer extends CardImpl { // Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control. this.addAbility(new TransformAbility()); this.addAbility(new ConditionalTriggeredAbility( - new EntersBattlefieldControlledTriggeredAbility(new NissaVastwoodSeerTransformEffect(), new FilterLandPermanent()), + new EntersBattlefieldControlledTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.FEMAL), new FilterLandPermanent()), new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), CountType.MORE_THAN, 6, true), "Whenever a land enters the battlefield under your control, if you control seven or more lands, exile {this}, then return her to the battlefield transformed under her owner's control.")); } @@ -97,34 +91,3 @@ public class NissaVastwoodSeer extends CardImpl { return new NissaVastwoodSeer(this); } } - -class NissaVastwoodSeerTransformEffect extends OneShotEffect { - - NissaVastwoodSeerTransformEffect() { - super(Outcome.Benefit); - this.staticText = "exile {this}, then return her to the battlefield transformed under her owner's control"; - } - - NissaVastwoodSeerTransformEffect(final NissaVastwoodSeerTransformEffect effect) { - super(effect); - } - - @Override - public NissaVastwoodSeerTransformEffect copy() { - return new NissaVastwoodSeerTransformEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject sourceObject = source.getSourceObjectIfItStillExists(game); - Player controller = game.getPlayer(source.getControllerId()); - if (sourceObject != null && controller != null) { - Card card = (Card) sourceObject; - if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) { - game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); - controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); - } - } - return true; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java b/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java index 907344659f5..71446b0a5d9 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java +++ b/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java @@ -37,7 +37,7 @@ public class RunedServitor extends mage.sets.riseoftheeldrazi.RunedServitor { public RunedServitor(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 983; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java b/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java index d4252ebcd87..f03d8afd2a5 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java @@ -37,7 +37,7 @@ public class ScrapskinDrake extends mage.sets.avacynrestored.ScrapskinDrake { public ScrapskinDrake(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 982; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java b/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java index 0a3464df340..0d1b8d2ffad 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java @@ -37,7 +37,7 @@ public class TitanicGrowth extends mage.sets.magic2012.TitanicGrowth { public TitanicGrowth(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 981; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java b/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java index fbb3ca18954..a8cba796028 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java @@ -37,7 +37,7 @@ public class TitansStrength extends mage.sets.theros.TitansStrength { public TitansStrength(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 980; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java b/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java index 83f4e1c1304..a80343127c6 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java @@ -37,7 +37,7 @@ public class TowerGeist extends mage.sets.darkascension.TowerGeist { public TowerGeist(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 979; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java b/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java index d63e8419778..c0a4be303e3 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java +++ b/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java @@ -37,7 +37,7 @@ public class VastwoodGorger extends mage.sets.zendikar.VastwoodGorger { public VastwoodGorger(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 978; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java b/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java index a2152d252aa..19b5635b498 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java +++ b/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java @@ -37,7 +37,7 @@ public class WeightOfTheUnderworld extends mage.sets.bornofthegods.WeightOfTheUn public WeightOfTheUnderworld(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 977; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java b/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java index 9aeebb11921..3eadb733209 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java +++ b/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java @@ -37,7 +37,7 @@ public class YevasForcemage extends mage.sets.magic2013.YevasForcemage { public YevasForcemage(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 976; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java b/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java index a8782b64095..24dd1b11194 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java +++ b/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java @@ -37,7 +37,7 @@ public class YokedOx extends mage.sets.theros.YokedOx { public YokedOx(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 975; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java index b52ecc52b86..d01d66c5968 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java @@ -38,6 +38,7 @@ import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -85,7 +86,9 @@ public class GideonJura extends CardImpl { // 0: Until end of turn, Gideon Jura becomes a 6/6 Human Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn. LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonJuraToken(), "planeswalker", Duration.EndOfTurn), 0); - ability3.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn)); + Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("Prevent all damage that would be dealt to him this turn"); + ability3.addEffect(effect); this.addAbility(ability3); } diff --git a/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java b/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java index e248728b5f7..056443e3b01 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java +++ b/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java @@ -53,7 +53,11 @@ public class MantisEngine extends CardImpl { this.subtype.add("Insect"); this.power = new MageInt(3); this.toughness = new MageInt(3); + + // {2}: Mantis Engine gains flying until end of turn. (It can't be blocked except by creatures with flying or reach.) this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2))); + + // {2}: Mantis Engine gains first strike until end of turn. (It deals combat damage before creatures without first strike.) this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2))); } diff --git a/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java b/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java new file mode 100644 index 00000000000..58926ccb9b0 --- /dev/null +++ b/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java @@ -0,0 +1,48 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author LevelX2 + */ + +public class EndOfCombatTriggeredAbility extends TriggeredAbilityImpl { + + public EndOfCombatTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } + + public EndOfCombatTriggeredAbility(final EndOfCombatTriggeredAbility ability) { + super(ability); + } + + @Override + public EndOfCombatTriggeredAbility copy() { + return new EndOfCombatTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return true; + } + + @Override + public String getRule() { + return "At the end of combat, " + super.getRule(); + } +} \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java b/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java new file mode 100644 index 00000000000..3e6bd508bb4 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java @@ -0,0 +1,55 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ + +public class ExileAndReturnTransformedSourceEffect extends OneShotEffect { + + public static enum Gender { MALE, FEMAL }; + + public ExileAndReturnTransformedSourceEffect(Gender gender) { + super(Outcome.Benefit); + this.staticText = "exile {this}, then return " + (gender.equals(Gender.MALE) ? "him":"her") + + " to the battlefield transformed under" + (gender.equals(Gender.MALE) ? "his":"her")+ " owner's control"; + } + + public ExileAndReturnTransformedSourceEffect(final ExileAndReturnTransformedSourceEffect effect) { + super(effect); + } + + @Override + public ExileAndReturnTransformedSourceEffect copy() { + return new ExileAndReturnTransformedSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObjectIfItStillExists(game); + Player controller = game.getPlayer(source.getControllerId()); + if (sourceObject != null && controller != null) { + Card card = (Card) sourceObject; + if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) { + game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); + controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); + } + } + return true; + } +} diff --git a/Mage/src/mage/game/combat/Combat.java b/Mage/src/mage/game/combat/Combat.java index b70442fc7e4..e5d281763cd 100644 --- a/Mage/src/mage/game/combat/Combat.java +++ b/Mage/src/mage/game/combat/Combat.java @@ -247,7 +247,9 @@ public class Combat implements Serializable, Copyable { for (Ability ability : entry.getValue()) { UUID defenderId = effect.mustAttackDefender(ability, game); if (defenderId != null) { - defendersForcedToAttack.add(defenderId); + if (defenders.contains(defenderId)) { + defendersForcedToAttack.add(defenderId); + } } break; } diff --git a/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java b/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java new file mode 100644 index 00000000000..b95a7a73142 --- /dev/null +++ b/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java @@ -0,0 +1,53 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.watchers.common; + +import java.util.HashSet; +import java.util.Set; +import mage.MageObjectReference; +import mage.constants.WatcherScope; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.watchers.Watcher; + +/** + * + * @author LevelX2 + */ + +public class AttackedThisCombatWatcher extends Watcher { + + public Set attackedThisTurnCreatures = new HashSet<>(); + + public AttackedThisCombatWatcher() { + super("AttackedThisCombat", WatcherScope.GAME); + } + + public AttackedThisCombatWatcher(final AttackedThisCombatWatcher watcher) { + super(watcher); + this.attackedThisTurnCreatures.addAll(watcher.attackedThisTurnCreatures); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.BEGIN_COMBAT_STEP_PRE) { + this.attackedThisTurnCreatures.clear(); + } + if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { + this.attackedThisTurnCreatures.add(new MageObjectReference(event.getSourceId(),game)); + } + } + + public Set getAttackedThisTurnCreatures() { + return this.attackedThisTurnCreatures; + } + + @Override + public AttackedThisCombatWatcher copy() { + return new AttackedThisCombatWatcher(this); + } + +}