From f0494383fdce890ec78d9477286b9190863c02d7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 5 Jan 2018 15:26:10 +0100 Subject: [PATCH] [RIX] Added 4 cards. --- .../src/mage/cards/b/BlindSpotGiant.java | 63 ++------- .../src/mage/cards/d/DireFleetPoisoner.java | 95 ++++++++++++++ Mage.Sets/src/mage/cards/h/HadanasClimb.java | 78 +++++++++++ .../src/mage/cards/h/HazoretTheFervent.java | 45 +------ ...sailMarauder.java => WarkiteMarauder.java} | 38 +++++- .../src/mage/cards/w/WaywardSwordtooth.java | 77 +++++++++++ .../mage/cards/w/WingedTempleOfOrazca.java | 123 ++++++++++++++++++ Mage.Sets/src/mage/sets/RivalsOfIxalan.java | 6 +- .../common/CitysBlessingCondition.java | 2 +- ...ttackBlockUnlessConditionSourceEffect.java | 74 +++++++++++ 10 files changed, 502 insertions(+), 99 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/d/DireFleetPoisoner.java create mode 100644 Mage.Sets/src/mage/cards/h/HadanasClimb.java rename Mage.Sets/src/mage/cards/w/{WarsailMarauder.java => WarkiteMarauder.java} (61%) create mode 100644 Mage.Sets/src/mage/cards/w/WaywardSwordtooth.java create mode 100644 Mage.Sets/src/mage/cards/w/WingedTempleOfOrazca.java create mode 100644 Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackBlockUnlessConditionSourceEffect.java diff --git a/Mage.Sets/src/mage/cards/b/BlindSpotGiant.java b/Mage.Sets/src/mage/cards/b/BlindSpotGiant.java index 0080adc0b6c..1b736e2ee42 100644 --- a/Mage.Sets/src/mage/cards/b/BlindSpotGiant.java +++ b/Mage.Sets/src/mage/cards/b/BlindSpotGiant.java @@ -29,20 +29,17 @@ package mage.cards.b; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.RestrictionEffect; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.effects.common.combat.CantAttackBlockUnlessConditionSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -50,15 +47,23 @@ import mage.game.permanent.Permanent; */ public class BlindSpotGiant extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control another Giant"); + + static { + filter.add(new SubtypePredicate(SubType.GIANT)); + filter.add(new AnotherPredicate()); + } + public BlindSpotGiant(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.subtype.add(SubType.GIANT, SubType.WARRIOR); this.power = new MageInt(4); this.toughness = new MageInt(3); // Blind-Spot Giant can't attack or block unless you control another Giant. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BlindSpotGiantEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new CantAttackBlockUnlessConditionSourceEffect(new PermanentsOnTheBattlefieldCondition(filter)))); } @@ -71,47 +76,3 @@ public class BlindSpotGiant extends CardImpl { return new BlindSpotGiant(this); } } - -class BlindSpotGiantEffect extends RestrictionEffect { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("another Giant"); - static { - filter.add(new SubtypePredicate(SubType.GIANT)); - filter.add(new AnotherPredicate()); - } - - public BlindSpotGiantEffect() { - super(Duration.WhileOnBattlefield); - staticText = "{this} can't attack or block unless you control another Giant"; - } - - public BlindSpotGiantEffect(final BlindSpotGiantEffect effect) { - super(effect); - } - - @Override - public BlindSpotGiantEffect copy() { - return new BlindSpotGiantEffect(this); - } - - @Override - public boolean canAttack(Game game) { - return false; - } - - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) { - return false; - } - return true; - } // do not apply to other creatures. - return false; - } -} diff --git a/Mage.Sets/src/mage/cards/d/DireFleetPoisoner.java b/Mage.Sets/src/mage/cards/d/DireFleetPoisoner.java new file mode 100644 index 00000000000..bb266298596 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DireFleetPoisoner.java @@ -0,0 +1,95 @@ +/* + * 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.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class DireFleetPoisoner extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.PIRATE, "attacking Pirate"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(new AttackingPredicate()); + } + + public DireFleetPoisoner(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.PIRATE); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // When Dire Fleet Poisoner enters the battlefield, target attacking Pirate you control gets +1/+1 and gains deathtouch until end of turn. + Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); + effect.setText("target attacking Pirate you control gets +1/+1"); + EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(effect); + effect = new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains deathtouch until end of turn"); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public DireFleetPoisoner(final DireFleetPoisoner card) { + super(card); + } + + @Override + public DireFleetPoisoner copy() { + return new DireFleetPoisoner(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HadanasClimb.java b/Mage.Sets/src/mage/cards/h/HadanasClimb.java new file mode 100644 index 00000000000..2c7f819563e --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HadanasClimb.java @@ -0,0 +1,78 @@ +/* + * 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.cards.h; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.condition.common.TargetHasCounterCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.w.WingedTempleOfOrazca; +import mage.constants.CardType; +import mage.constants.SuperType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class HadanasClimb extends CardImpl { + + public HadanasClimb(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.transformable = true; + + this.secondSideCardClazz = WingedTempleOfOrazca.class; + + // At the beginning of combat on your turn, put a +1/+1 counter on target creature you control. Then if that creature has three or more +1/+1 counters on it, transform Hadana's Climb. + this.addAbility(new TransformAbility()); + Ability ability = new BeginningOfCombatTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), TargetController.YOU, false); + ability.addEffect(new ConditionalOneShotEffect(new TransformSourceEffect(true), new TargetHasCounterCondition(CounterType.P1P1, 3, Integer.MAX_VALUE), + "Then if that creature has three or more +1/+1 counters on it, transform {this}")); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public HadanasClimb(final HadanasClimb card) { + super(card); + } + + @Override + public HadanasClimb copy() { + return new HadanasClimb(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HazoretTheFervent.java b/Mage.Sets/src/mage/cards/h/HazoretTheFervent.java index 962a0346f51..c08e6dd3834 100644 --- a/Mage.Sets/src/mage/cards/h/HazoretTheFervent.java +++ b/Mage.Sets/src/mage/cards/h/HazoretTheFervent.java @@ -32,23 +32,21 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInHandCondition; import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.combat.CantAttackBlockUnlessConditionSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.SubType; -import mage.constants.Duration; import mage.constants.SuperType; import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; /** * @@ -71,7 +69,9 @@ public class HazoretTheFervent extends CardImpl { this.addAbility(HasteAbility.getInstance()); // Hazoret the Fervent can't attack or block unless you have one or fewer cards in hand. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HazoretTheFerventEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new CantAttackBlockUnlessConditionSourceEffect(new CardsInHandCondition(ComparisonType.FEWER_THAN, 2)) + .setText("{this} can't attack or block unless you have one or fewer cards in hand"))); // {2}{R}, Discard a card: Hazoret deals 2 damage to each opponent. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamagePlayersEffect(2, TargetController.OPPONENT), new ManaCostsImpl("{2}{R}")); @@ -88,36 +88,3 @@ public class HazoretTheFervent extends CardImpl { return new HazoretTheFervent(this); } } - -class HazoretTheFerventEffect extends RestrictionEffect { - - public HazoretTheFerventEffect() { - super(Duration.WhileOnBattlefield); - staticText = "{this} can't attack or block unless you have one or fewer cards in hand"; - } - - public HazoretTheFerventEffect(final HazoretTheFerventEffect effect) { - super(effect); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - Player controller = game.getPlayer(source.getControllerId()); - return permanent.getId().equals(source.getSourceId()) && controller.getHand().size() > 1; - } - - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } - - @Override - public boolean canAttack(Game game) { - return false; - } - - @Override - public HazoretTheFerventEffect copy() { - return new HazoretTheFerventEffect(this); - } -} diff --git a/Mage.Sets/src/mage/cards/w/WarsailMarauder.java b/Mage.Sets/src/mage/cards/w/WarkiteMarauder.java similarity index 61% rename from Mage.Sets/src/mage/cards/w/WarsailMarauder.java rename to Mage.Sets/src/mage/cards/w/WarkiteMarauder.java index 00121b2976b..927440b9fab 100644 --- a/Mage.Sets/src/mage/cards/w/WarsailMarauder.java +++ b/Mage.Sets/src/mage/cards/w/WarkiteMarauder.java @@ -39,14 +39,21 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; /** * * @author LevelX2 */ -public class WarsailMarauder extends CardImpl { +public class WarkiteMarauder extends CardImpl { - public WarsailMarauder(UUID ownerId, CardSetInfo setInfo) { + private final UUID originalId; + + public WarkiteMarauder(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add(SubType.HUMAN); @@ -57,20 +64,37 @@ public class WarsailMarauder extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - // Whenever Warsail Marauder attacks, target creature loses all abilities and has base power and toughness 0/1 until end of turn. + // Whenever Warkite Marauder attacks, target creature defending player controls loses all abilities and has base power and toughness 0/1 until end of turn. Ability ability = new AttacksTriggeredAbility(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn) - .setText("target creature loses all abilities"), false); + .setText("target creature defending player controls loses all abilities"), false); ability.addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn) .setText("and has base power and toughness 0/1 until end of turn")); + ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls"))); this.addAbility(ability); + this.originalId = ability.getOriginalId(); + } - public WarsailMarauder(final WarsailMarauder card) { + public WarkiteMarauder(final WarkiteMarauder card) { super(card); + this.originalId = card.originalId; } @Override - public WarsailMarauder copy() { - return new WarsailMarauder(this); + public void adjustTargets(Ability ability, Game game) { + if (ability.getOriginalId().equals(originalId)) { + ability.getTargets().clear(); + ability.addTarget(new TargetControlledCreaturePermanent()); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); + UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId()); + filter.add(new ControllerIdPredicate(defenderId)); + TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false); + ability.addTarget(target); + } + } + + @Override + public WarkiteMarauder copy() { + return new WarkiteMarauder(this); } } diff --git a/Mage.Sets/src/mage/cards/w/WaywardSwordtooth.java b/Mage.Sets/src/mage/cards/w/WaywardSwordtooth.java new file mode 100644 index 00000000000..1a3466b9b14 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WaywardSwordtooth.java @@ -0,0 +1,77 @@ +/* + * 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.cards.w; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CitysBlessingCondition; +import mage.abilities.effects.common.combat.CantAttackBlockUnlessConditionSourceEffect; +import mage.abilities.effects.common.continuous.PlayAdditionalLandsControllerEffect; +import mage.abilities.keyword.AscendAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class WaywardSwordtooth extends CardImpl { + + public WaywardSwordtooth(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.DINOSAUR); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Ascend + this.addAbility(new AscendAbility()); + + // You may play an additional land on each of your turns. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new PlayAdditionalLandsControllerEffect(1, Duration.WhileOnBattlefield))); + + // Wayward Sawtooth can't attack or block unless you have the city's blessing. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockUnlessConditionSourceEffect(CitysBlessingCondition.instance))); + + } + + public WaywardSwordtooth(final WaywardSwordtooth card) { + super(card); + } + + @Override + public WaywardSwordtooth copy() { + return new WaywardSwordtooth(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WingedTempleOfOrazca.java b/Mage.Sets/src/mage/cards/w/WingedTempleOfOrazca.java new file mode 100644 index 00000000000..f2f033f7384 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WingedTempleOfOrazca.java @@ -0,0 +1,123 @@ +/* + * 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.cards.w; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class WingedTempleOfOrazca extends CardImpl { + + public WingedTempleOfOrazca(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.addSuperType(SuperType.LEGENDARY); + + this.nightCard = true; + + // (Transforms from Hadana's Climb.) + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new InfoEffect("(Transforms from Hadana's Climb.)")); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // {T}: Add one mana of any color to your mana pool. + this.addAbility(new AnyColorManaAbility()); + + // {1}{G}{U}, {T}: Target creature you control gains flying and gets +X/+X until end of turn, where X is its power. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new WingedTempleOfOrazcaEffect(), new ManaCostsImpl<>("{1}{G}{U}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public WingedTempleOfOrazca(final WingedTempleOfOrazca card) { + super(card); + } + + @Override + public WingedTempleOfOrazca copy() { + return new WingedTempleOfOrazca(this); + } +} + +class WingedTempleOfOrazcaEffect extends OneShotEffect { + + public WingedTempleOfOrazcaEffect() { + super(Outcome.Benefit); + this.staticText = "it gains flying and gets +X/+X until end of turn, where X is its power"; + } + + public WingedTempleOfOrazcaEffect(final WingedTempleOfOrazcaEffect effect) { + super(effect); + } + + @Override + public WingedTempleOfOrazcaEffect copy() { + return new WingedTempleOfOrazcaEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); + if (creature != null && creature.isCreature()) { + int pow = creature.getPower().getValue(); + ContinuousEffect effect = new BoostTargetEffect(pow, pow, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(creature, game)); + game.addEffect(effect, source); + effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(creature, game)); + game.addEffect(effect, source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/RivalsOfIxalan.java b/Mage.Sets/src/mage/sets/RivalsOfIxalan.java index ab0a07f84b0..05e94b7ba2d 100644 --- a/Mage.Sets/src/mage/sets/RivalsOfIxalan.java +++ b/Mage.Sets/src/mage/sets/RivalsOfIxalan.java @@ -65,6 +65,7 @@ public class RivalsOfIxalan extends ExpansionSet { cards.add(new SetCardInfo("Cinder Barrens", 205, Rarity.RARE, mage.cards.c.CinderBarrens.class)); cards.add(new SetCardInfo("Deeproot Elite", 127, Rarity.RARE, mage.cards.d.DeeprootElite.class)); cards.add(new SetCardInfo("Dire Fleet Neckbreaker", 156, Rarity.UNCOMMON, mage.cards.d.DireFleetNeckbreaker.class)); + cards.add(new SetCardInfo("Dire Fleet Poisoner", 68, Rarity.RARE, mage.cards.d.DireFleetPoisoner.class)); cards.add(new SetCardInfo("Dusk Charger", 69, Rarity.COMMON, mage.cards.d.DuskCharger.class)); cards.add(new SetCardInfo("Dusk Legion Zealot", 70, Rarity.COMMON, mage.cards.d.DuskLegionZealot.class)); cards.add(new SetCardInfo("Elenda, the Dusk Rose", 157, Rarity.MYTHIC, mage.cards.e.ElendaTheDuskRose.class)); @@ -77,6 +78,7 @@ public class RivalsOfIxalan extends ExpansionSet { cards.add(new SetCardInfo("Forerunner of the Legion", 9, Rarity.UNCOMMON, mage.cards.f.ForerunnerOfTheLegion.class)); cards.add(new SetCardInfo("Ghalta, Primal Hunger", 130, Rarity.RARE, mage.cards.g.GhaltaPrimalHunger.class)); cards.add(new SetCardInfo("Glorious Destiny", 18, Rarity.RARE, mage.cards.g.GloriousDestiny.class)); + cards.add(new SetCardInfo("Hadana's Climb", 158, Rarity.RARE, mage.cards.h.HadanasClimb.class)); cards.add(new SetCardInfo("Jadelight Ranger", 136, Rarity.RARE, mage.cards.j.JadelightRanger.class)); cards.add(new SetCardInfo("Journey to Eternity", 160, Rarity.RARE, mage.cards.j.JourneyToEternity.class)); cards.add(new SetCardInfo("Jungle Creeper", 161, Rarity.UNCOMMON, mage.cards.j.JungleCreeper.class)); @@ -107,7 +109,9 @@ public class RivalsOfIxalan extends ExpansionSet { cards.add(new SetCardInfo("Vraska's Conquistador", 199, Rarity.UNCOMMON, mage.cards.v.VraskasConquistador.class)); cards.add(new SetCardInfo("Vraska's Scorn", 200, Rarity.RARE, mage.cards.v.VraskasScorn.class)); cards.add(new SetCardInfo("Vraska, Scheming Gorgon", 197, Rarity.MYTHIC, mage.cards.v.VraskaSchemingGorgon.class)); - cards.add(new SetCardInfo("Warsail Marauder", 60, Rarity.RARE, mage.cards.w.WarsailMarauder.class)); + cards.add(new SetCardInfo("Warkite Marauder", 60, Rarity.RARE, mage.cards.w.WarkiteMarauder.class)); + cards.add(new SetCardInfo("Wayward Swordtooth", 150, Rarity.RARE, mage.cards.w.WaywardSwordtooth.class)); + cards.add(new SetCardInfo("Winged Temple of Orazca", 158, Rarity.RARE, mage.cards.w.WingedTempleOfOrazca.class)); cards.add(new SetCardInfo("World Shaper", 151, Rarity.RARE, mage.cards.w.WorldShaper.class)); cards.add(new SetCardInfo("Zetalpa, Primal Dawn", 30, Rarity.RARE, mage.cards.z.ZetalpaPrimalDawn.class)); } diff --git a/Mage/src/main/java/mage/abilities/condition/common/CitysBlessingCondition.java b/Mage/src/main/java/mage/abilities/condition/common/CitysBlessingCondition.java index d8f333d9259..7507f11d315 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/CitysBlessingCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/CitysBlessingCondition.java @@ -47,6 +47,6 @@ public enum CitysBlessingCondition implements Condition { @Override public String toString() { - return "If you have the city's blessing"; + return "you have the city's blessing"; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackBlockUnlessConditionSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackBlockUnlessConditionSourceEffect.java new file mode 100644 index 00000000000..6f9989e9b44 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackBlockUnlessConditionSourceEffect.java @@ -0,0 +1,74 @@ +/* + * 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.abilities.effects.common.combat; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.abilities.effects.RestrictionEffect; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class CantAttackBlockUnlessConditionSourceEffect extends RestrictionEffect { + + private Condition condition; + + public CantAttackBlockUnlessConditionSourceEffect(Condition condition) { + super(Duration.WhileOnBattlefield); + this.condition = condition; + staticText = "{this} can't attack or block unless " + condition.toString(); + } + + public CantAttackBlockUnlessConditionSourceEffect(final CantAttackBlockUnlessConditionSourceEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getId().equals(source.getSourceId()) && condition.apply(game, source); + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } + + @Override + public boolean canAttack(Game game) { + return false; + } + + @Override + public CantAttackBlockUnlessConditionSourceEffect copy() { + return new CantAttackBlockUnlessConditionSourceEffect(this); + } +}