mirror of
https://github.com/correl/mage.git
synced 2024-12-28 11:14:13 +00:00
Merge pull request #3 from magefree/master
Merge https://github.com/magefree/mage
This commit is contained in:
commit
3de0b5083a
50 changed files with 696 additions and 234 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -132,4 +132,3 @@ Mage.Client/serverlist.txt
|
|||
client_secrets.json
|
||||
|
||||
dependency-reduced-pom.xml
|
||||
/Mage.Server.Plugins/Mage.Game.PennyDreadfulCommanderFreeForAll/target/
|
|
@ -257,16 +257,16 @@ public enum WizardCardsImageSource implements CardImageSource {
|
|||
supportedSets.add("E01");
|
||||
supportedSets.add("HOU");
|
||||
supportedSets.add("C17");
|
||||
// supportedSets.add("XLN");
|
||||
// supportedSets.add("DDT");
|
||||
// supportedSets.add("IMA");
|
||||
// supportedSets.add("E02");
|
||||
// supportedSets.add("V17");
|
||||
// supportedSets.add("UST");
|
||||
// supportedSets.add("RIX");
|
||||
// supportedSets.add("A25");
|
||||
// supportedSets.add("DOM");
|
||||
// supportedSets.add("M19");
|
||||
supportedSets.add("XLN");
|
||||
// supportedSets.add("DDT"); // Duel Decks: Merfolk vs. Goblins
|
||||
// supportedSets.add("IMA"); // Iconic Msters
|
||||
// supportedSets.add("E02"); // Explorers of Ixalan
|
||||
// supportedSets.add("V17"); // From the Vault: Transform
|
||||
// supportedSets.add("UST"); // Unstable
|
||||
// supportedSets.add("RIX"); // Rivals of Ixalan
|
||||
// supportedSets.add("A25"); // Masters 25
|
||||
// supportedSets.add("DOM"); // Dominaria
|
||||
// supportedSets.add("M19"); // Core 2019
|
||||
|
||||
sets = new HashMap<>();
|
||||
setsAliases = new HashMap<>();
|
||||
|
|
|
@ -65,12 +65,13 @@ import mage.watchers.Watcher;
|
|||
*/
|
||||
public class AdmiralBeckettBrass extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other Pirates you control");
|
||||
private static final FilterNonlandPermanent filter2 = new FilterNonlandPermanent("nonland permanent controlled by a player who was dealt combat damage by three or more Pirates this turn");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.PIRATE));
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter2.add(new ControllerDealtDamageByPiratesPredicate());
|
||||
}
|
||||
|
||||
public AdmiralBeckettBrass(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
@ -87,25 +88,12 @@ public class AdmiralBeckettBrass extends CardImpl {
|
|||
|
||||
// At the beginning of your end step, gain control of target nonland permanent controlled by a player who was dealt combat damage by three or more Pirates this turn.
|
||||
Ability ability = new BeginningOfEndStepTriggeredAbility(new GainControlTargetEffect(Duration.Custom), TargetController.YOU, false);
|
||||
ability.addTarget(new TargetNonlandPermanent(new FilterNonlandPermanent("nonland permanent controlled by a player who was dealt combat damage by three or more Pirates this turn")));
|
||||
originalId = ability.getOriginalId();
|
||||
ability.addTarget(new TargetNonlandPermanent(filter2));
|
||||
this.addAbility(ability, new DamagedByPiratesWatcher());
|
||||
}
|
||||
|
||||
public AdmiralBeckettBrass(final AdmiralBeckettBrass card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)) {
|
||||
ability.getTargets().clear();
|
||||
FilterNonlandPermanent playerFilter = new FilterNonlandPermanent("nonland permanent controlled by a player who was dealt combat damage by three or more Pirates this turn");
|
||||
playerFilter.add(new ControllerDealtDamageByPiratesPredicate());
|
||||
TargetNonlandPermanent target = new TargetNonlandPermanent(1, 1, playerFilter, true);
|
||||
ability.addTarget(target);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
101
Mage.Sets/src/mage/cards/a/AnaSanctuary.java
Normal file
101
Mage.Sets/src/mage/cards/a/AnaSanctuary.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* 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.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SanctuaryTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class AnaSanctuary extends CardImpl {
|
||||
|
||||
public AnaSanctuary(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
|
||||
|
||||
// At the beginning of your upkeep, if you control a blue or black permanent, target creature gets +1/+1 until end of turn. If you control a blue permanent and a black permanent, that creature gets +5/+5 until end of turn instead.
|
||||
Ability ability = new SanctuaryTriggeredAbility(
|
||||
new BoostEffect(1), new BoostEffect(5), ObjectColor.BLACK, ObjectColor.BLUE,
|
||||
"At the beginning of your upkeep, if you control a blue or black permanent, "
|
||||
+ "target creature gets +1/+1 until end of turn. If you control a blue permanent and a black permanent, that creature gets +5/+5 until end of turn instead."
|
||||
);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public AnaSanctuary(final AnaSanctuary card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnaSanctuary copy() {
|
||||
return new AnaSanctuary(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BoostEffect extends OneShotEffect {
|
||||
|
||||
private final int amount;
|
||||
|
||||
BoostEffect(int amount) {
|
||||
super(Outcome.Benefit);
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
BoostEffect(final BoostEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoostEffect copy() {
|
||||
return new BoostEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ContinuousEffect effect = new BoostTargetEffect(amount, amount, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
|
@ -38,13 +37,15 @@ import mage.filter.FilterPermanent;
|
|||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cbt33, North (Karma)
|
||||
*/
|
||||
public class BraidsCabalMinion extends CardImpl {
|
||||
|
||||
static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land");
|
||||
static final FilterPermanent filter = new FilterPermanent("an artifact, creature, or land");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT),
|
||||
|
|
|
@ -73,6 +73,7 @@ public class BrassTalonChimera extends CardImpl {
|
|||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P2P2.createInstance()), new SacrificeSourceCost());
|
||||
ability.addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
addAbility(ability);
|
||||
}
|
||||
|
||||
public BrassTalonChimera(final BrassTalonChimera card) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
|
@ -13,9 +12,11 @@ import mage.filter.common.FilterControlledLandPermanent;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class BullElephant extends CardImpl {
|
||||
|
||||
private static FilterControlledLandPermanent controlledForest = new FilterControlledLandPermanent("two forests you control");
|
||||
private static FilterControlledLandPermanent controlledForest = new FilterControlledLandPermanent("Forests you control");
|
||||
|
||||
static {
|
||||
controlledForest.add(new SubtypePredicate(SubType.FOREST));
|
||||
|
|
|
@ -30,44 +30,28 @@ package mage.cards.c;
|
|||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.common.SanctuaryTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawDiscardControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Pete Rossi
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class CetaSanctuary extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a red or green permanent");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(new ColorPredicate(ObjectColor.RED), new ColorPredicate(ObjectColor.GREEN)));
|
||||
}
|
||||
|
||||
public CetaSanctuary(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
||||
|
||||
// At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. If you control a red permanent and a green permanent, instead draw two cards, then discard a card.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new CetaSanctuaryEffect(), TargetController.YOU, true);
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. If you control a red permanent and a green permanent, instead draw two cards, then discard a card."));
|
||||
|
||||
Ability ability = new SanctuaryTriggeredAbility(
|
||||
new DrawDiscardControllerEffect(1, 1), new DrawDiscardControllerEffect(2, 1), ObjectColor.GREEN, ObjectColor.RED,
|
||||
"At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. "
|
||||
+ "If you control a red permanent and a green permanent, instead draw two cards, then discard a card."
|
||||
);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public CetaSanctuary(final CetaSanctuary card) {
|
||||
|
@ -79,49 +63,3 @@ public class CetaSanctuary extends CardImpl {
|
|||
return new CetaSanctuary(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CetaSanctuaryEffect extends OneShotEffect {
|
||||
|
||||
public CetaSanctuaryEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
}
|
||||
|
||||
public CetaSanctuaryEffect(final CetaSanctuaryEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
int red = 0;
|
||||
int green = 0;
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) {
|
||||
ObjectColor color = permanent.getColor(game);
|
||||
if (color.isRed()) {
|
||||
red = 1;
|
||||
}
|
||||
if (color.isGreen()) {
|
||||
green = 1;
|
||||
}
|
||||
|
||||
if (red == 1 && green == 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (red != 0 || green != 0) {
|
||||
controller.drawCards((red + green), game);
|
||||
controller.discard(1, false, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CetaSanctuaryEffect copy() {
|
||||
return new CetaSanctuaryEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
|
||||
|
@ -36,9 +35,11 @@ import mage.abilities.keyword.FabricateAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.common.FilterAttackingCreature;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -57,7 +58,7 @@ public class CultivatorOfBlades extends CardImpl {
|
|||
this.addAbility(new FabricateAbility(2));
|
||||
|
||||
// Whenever Cultivator of Blades attacks, you may have other attacking creatures get +X/+X until end of turn, where X is Cultivator of Blades's power.
|
||||
this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(new SourcePermanentPowerCount(), new SourcePermanentPowerCount(), Duration.EndOfTurn, new FilterAttackingCreature(), true, true),
|
||||
this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(new SourcePermanentPowerCount(), new SourcePermanentPowerCount(), Duration.EndOfTurn, StaticFilters.FILTER_ATTACKING_CREATURES, true, true),
|
||||
true, "Whenever Cultivator of Blades attacks, you may have other attacking creatures get +X/+X until end of turn, where X is Cultivator of Blades's power."));
|
||||
}
|
||||
|
||||
|
|
65
Mage.Sets/src/mage/cards/d/DegaSanctuary.java
Normal file
65
Mage.Sets/src/mage/cards/d/DegaSanctuary.java
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* 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.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SanctuaryTriggeredAbility;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class DegaSanctuary extends CardImpl {
|
||||
|
||||
public DegaSanctuary(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
|
||||
// At the beginning of your upkeep, if you control a black or red permanent, you gain 2 life. If you control a black permanent and a red permanent, you gain 4 life instead.
|
||||
Ability ability = new SanctuaryTriggeredAbility(
|
||||
new GainLifeEffect(2), new GainLifeEffect(4), ObjectColor.BLACK, ObjectColor.RED,
|
||||
"At the beginning of your upkeep, if you control a black or red permanent, you gain 2 life. "
|
||||
+ "If you control a black permanent and a red permanent, you gain 4 life instead."
|
||||
);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public DegaSanctuary(final DegaSanctuary card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DegaSanctuary copy() {
|
||||
return new DegaSanctuary(this);
|
||||
}
|
||||
}
|
|
@ -112,7 +112,7 @@ class DualNatureCreateTokenEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(permanent.getControllerId());
|
||||
effect.setTargetPointer(targetPointer);
|
||||
|
|
|
@ -27,26 +27,27 @@
|
|||
*/
|
||||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class FierceEmpath extends CardImpl {
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("a creature card with converted mana cost 6 or greater");
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card with converted mana cost 6 or greater");
|
||||
static {
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.MORE_THAN, 5));
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -35,34 +34,28 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class Fork extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("target instant or sorcery spell");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT),
|
||||
new CardTypePredicate(CardType.SORCERY)));
|
||||
}
|
||||
|
||||
public Fork(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}{R}");
|
||||
|
||||
// Copy target instant or sorcery spell, except that the copy is red. You may choose new targets for the copy.
|
||||
this.getSpellAbility().addEffect(new ForkEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell(filter));
|
||||
this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_INSTANT_OR_SORCERY_SPELL));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||
|
@ -44,6 +43,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -72,7 +73,7 @@ public class GatecreeperVine extends CardImpl {
|
|||
|
||||
// When Gatecreeper Vine enters the battlefield, you may search your library for a basic land card or a Gate card, reveal it, put it into your hand, then shuffle your library.
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true)));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true));
|
||||
}
|
||||
|
||||
public GatecreeperVine(final GatecreeperVine card) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
|
@ -43,6 +42,8 @@ import mage.filter.FilterCard;
|
|||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jonubuu
|
||||
|
@ -50,7 +51,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
public class GoblinWarchief extends CardImpl {
|
||||
|
||||
private static final FilterCard filterSpells = new FilterCard("Goblin spells");
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblins");
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures");
|
||||
|
||||
static {
|
||||
filterSpells.add(new SubtypePredicate(SubType.GOBLIN));
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
|
@ -44,6 +43,8 @@ import mage.players.Player;
|
|||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -58,7 +59,7 @@ public class GuildFeud extends CardImpl {
|
|||
// then puts the rest into his or her graveyard. You do the same with the top three
|
||||
// cards of your library. If two creatures are put onto the battlefield this way,
|
||||
// those creatures fight each other.
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new GuildFeudEffect(), TargetController.YOU, true);
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new GuildFeudEffect(), TargetController.YOU, false);
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
|
@ -45,6 +44,8 @@ import mage.filter.predicate.permanent.ControllerPredicate;
|
|||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -68,7 +69,7 @@ public class HaazdaSnareSquad extends CardImpl {
|
|||
|
||||
// Whenever Haazda Snare Squad attacks you may pay {W}. If you do, tap target creature an opponent controls.
|
||||
Ability ability = new AttacksTriggeredAbility(new DoIfCostPaid(new TapTargetEffect(""), new ManaCostsImpl("{W}")),false,
|
||||
"Whenever {this} attacks you may pay {W}. If you do, tap target creature an opponent controls.");
|
||||
"Whenever {this} attacks, you may pay {W}. If you do, tap target creature an opponent controls.");
|
||||
Target target = new TargetCreaturePermanent(filter);
|
||||
ability.addTarget(target);
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -33,7 +33,6 @@ import java.util.Set;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
|
@ -44,7 +43,8 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPlayer;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedPlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -59,6 +59,12 @@ import mage.watchers.Watcher;
|
|||
*/
|
||||
public class HopeOfGhirapur extends CardImpl {
|
||||
|
||||
private static final FilterPlayer filter = new FilterPlayer("player who was dealt combat damage by {this} this turn");
|
||||
|
||||
static {
|
||||
filter.add(new HopeOfGhirapurPlayerLostLifePredicate());
|
||||
}
|
||||
|
||||
public HopeOfGhirapur(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}");
|
||||
|
||||
|
@ -70,28 +76,10 @@ public class HopeOfGhirapur extends CardImpl {
|
|||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
//TODO: Make ability properly copiable
|
||||
// Sacrifice Hope of Ghirapur: Until your next turn, target player who was dealt combat damage by Hope of Ghirapur this turn can't cast noncreature spells.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HopeOfGhirapurCantCastEffect(), new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
||||
this.addAbility(ability, new HopeOfGhirapurCombatDamageWatcher());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability instanceof SimpleActivatedAbility) {
|
||||
if (!ability.getEffects().isEmpty() && (ability.getEffects().get(0) instanceof HopeOfGhirapurCantCastEffect)) {
|
||||
MageObject sourceObject = ability.getSourceObject(game);
|
||||
if (sourceObject != null) {
|
||||
ability.getTargets().clear();
|
||||
FilterPlayer playerFilter = new FilterPlayer("player who was dealt combat damage by " + sourceObject.getIdName() + " this turn");
|
||||
MageObjectReference sourceReference = new MageObjectReference(ability.getSourceId(), ability.getSourceObjectZoneChangeCounter(), game);
|
||||
playerFilter.add(new HopeOfGhirapurPlayerLostLifePredicate(sourceReference));
|
||||
ability.addTarget(new TargetPlayer(1, 1, false, playerFilter));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public HopeOfGhirapur(final HopeOfGhirapur card) {
|
||||
|
@ -152,19 +140,20 @@ class HopeOfGhirapurCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class HopeOfGhirapurPlayerLostLifePredicate implements Predicate<Player> {
|
||||
class HopeOfGhirapurPlayerLostLifePredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||
|
||||
private final MageObjectReference sourceReference;
|
||||
|
||||
public HopeOfGhirapurPlayerLostLifePredicate(MageObjectReference sourceReference) {
|
||||
this.sourceReference = sourceReference;
|
||||
public HopeOfGhirapurPlayerLostLifePredicate() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Player input, Game game) {
|
||||
public boolean apply(ObjectSourcePlayer<Player> input, Game game) {
|
||||
Player targetPlayer = input.getObject();
|
||||
if (targetPlayer == null) {
|
||||
return false;
|
||||
}
|
||||
HopeOfGhirapurCombatDamageWatcher watcher = (HopeOfGhirapurCombatDamageWatcher) game.getState().getWatchers().get(HopeOfGhirapurCombatDamageWatcher.class.getSimpleName());
|
||||
if (watcher != null) {
|
||||
return watcher.playerGotCombatDamage(sourceReference, input.getId());
|
||||
return watcher.playerGotCombatDamage(input.getSourceId(), input.getObject().getId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -172,7 +161,7 @@ class HopeOfGhirapurPlayerLostLifePredicate implements Predicate<Player> {
|
|||
|
||||
class HopeOfGhirapurCombatDamageWatcher extends Watcher {
|
||||
|
||||
private final HashMap<MageObjectReference, Set<UUID>> combatDamagedPlayers = new HashMap<>();
|
||||
private final HashMap<UUID, Set<UUID>> combatDamagedPlayers = new HashMap<>();
|
||||
|
||||
public HopeOfGhirapurCombatDamageWatcher() {
|
||||
super(HopeOfGhirapurCombatDamageWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
|
@ -180,10 +169,10 @@ class HopeOfGhirapurCombatDamageWatcher extends Watcher {
|
|||
|
||||
public HopeOfGhirapurCombatDamageWatcher(final HopeOfGhirapurCombatDamageWatcher watcher) {
|
||||
super(watcher);
|
||||
for (MageObjectReference sourceReference : watcher.combatDamagedPlayers.keySet()) {
|
||||
for (UUID damagerId : watcher.combatDamagedPlayers.keySet()) {
|
||||
Set<UUID> players = new HashSet<>();
|
||||
players.addAll(watcher.combatDamagedPlayers.get(sourceReference));
|
||||
this.combatDamagedPlayers.put(sourceReference, players);
|
||||
players.addAll(watcher.combatDamagedPlayers.get(damagerId));
|
||||
this.combatDamagedPlayers.put(damagerId, players);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,29 +184,29 @@ class HopeOfGhirapurCombatDamageWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) {
|
||||
MageObjectReference sourceReference = new MageObjectReference(event.getSourceId(), game);
|
||||
UUID damagerId = event.getSourceId();
|
||||
Set<UUID> players;
|
||||
if (combatDamagedPlayers.containsKey(sourceReference)) {
|
||||
players = combatDamagedPlayers.get(sourceReference);
|
||||
if (combatDamagedPlayers.containsKey(damagerId)) {
|
||||
players = combatDamagedPlayers.get(damagerId);
|
||||
} else {
|
||||
players = new HashSet<>();
|
||||
combatDamagedPlayers.put(sourceReference, players);
|
||||
combatDamagedPlayers.put(damagerId, players);
|
||||
}
|
||||
players.add(event.getTargetId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the current object has damaged the player during
|
||||
* the current turn.
|
||||
* Checks if the current object has damaged the player during the current
|
||||
* turn.
|
||||
*
|
||||
* @param objectReference
|
||||
* @param objectId
|
||||
* @param playerId
|
||||
* @return
|
||||
*/
|
||||
public boolean playerGotCombatDamage(MageObjectReference objectReference, UUID playerId) {
|
||||
if (combatDamagedPlayers.containsKey(objectReference)) {
|
||||
return combatDamagedPlayers.get(objectReference).contains(playerId);
|
||||
public boolean playerGotCombatDamage(UUID objectId, UUID playerId) {
|
||||
if (combatDamagedPlayers.containsKey(objectId)) {
|
||||
return combatDamagedPlayers.get(objectId).contains(playerId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -27,25 +27,26 @@
|
|||
*/
|
||||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
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.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
|
@ -72,6 +73,7 @@ public class IronHeartChimera extends CardImpl {
|
|||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P2P2.createInstance()), new SacrificeSourceCost());
|
||||
ability.addEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
addAbility(ability);
|
||||
}
|
||||
|
||||
public IronHeartChimera(final IronHeartChimera card) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.j;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
|
@ -36,18 +35,19 @@ import mage.abilities.keyword.VigilanceAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.common.FilterAttackingCreature;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class JelennSphinx extends CardImpl {
|
||||
|
||||
public JelennSphinx(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{U}");
|
||||
this.subtype.add(SubType.SPHINX);
|
||||
|
||||
this.power = new MageInt(1);
|
||||
|
@ -58,7 +58,7 @@ public class JelennSphinx extends CardImpl {
|
|||
// Vigilance
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
// Whenever Jelenn Sphinx attacks, other attacking creatures get +1/+1 until end of turn.
|
||||
this.addAbility(new AttacksTriggeredAbility(new BoostAllEffect(1,1, Duration.EndOfTurn,new FilterAttackingCreature(),true), false));
|
||||
this.addAbility(new AttacksTriggeredAbility(new BoostAllEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_ATTACKING_CREATURES, true), false));
|
||||
}
|
||||
|
||||
public JelennSphinx(final JelennSphinx card) {
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
*/
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -49,6 +47,9 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -120,7 +121,7 @@ class KatabaticWindsRuleModifyingEffect extends ContinuousRuleModifyingEffectImp
|
|||
|
||||
public KatabaticWindsRuleModifyingEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = ", and their activated abilities with {tap} in their costs can't be activated";
|
||||
staticText = ", and their activated abilities with {T} in their costs can't be activated";
|
||||
}
|
||||
|
||||
public KatabaticWindsRuleModifyingEffect(final KatabaticWindsRuleModifyingEffect effect) {
|
||||
|
|
|
@ -27,25 +27,26 @@
|
|||
*/
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
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.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
|
@ -72,6 +73,7 @@ public class LeadBellyChimera extends CardImpl {
|
|||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P2P2.createInstance()), new SacrificeSourceCost());
|
||||
ability.addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
addAbility(ability);
|
||||
}
|
||||
|
||||
public LeadBellyChimera(final LeadBellyChimera card) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
|
@ -39,13 +38,15 @@ import mage.filter.common.FilterLandPermanent;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Quercitron
|
||||
*/
|
||||
public class LivingLands extends CardImpl {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("All Forests");
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Forests");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.FOREST));
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -47,12 +46,14 @@ import mage.filter.predicate.Predicate;
|
|||
import mage.game.Game;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author BursegSardaukar
|
||||
*/
|
||||
public class MagewrightsStone extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that has an ability with {T} in its cost");
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that has an activated ability with {T} in its cost");
|
||||
|
||||
static {
|
||||
filter.add(new HasAbilityWithTapSymbolPredicate());
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
*/
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
|
||||
|
@ -43,6 +40,10 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
@ -70,7 +71,7 @@ class ManabondEffect extends OneShotEffect {
|
|||
|
||||
public ManabondEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
staticText = "you may reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand";
|
||||
staticText = "reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand";
|
||||
}
|
||||
|
||||
public ManabondEffect(final ManabondEffect effect) {
|
||||
|
|
|
@ -83,9 +83,7 @@ public class MathasFiendSeeker extends CardImpl {
|
|||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
Ability ability2 = new DiesTriggeredAbility(new DrawCardAllEffect(1, TargetController.OPPONENT));
|
||||
ability2.addEffect(new OpponentsGainLifeEffect());
|
||||
Effect effect = new MathasFiendSeekerGainAbilityEffect(
|
||||
ability2,
|
||||
Duration.Custom, rule);
|
||||
Effect effect = new MathasFiendSeekerGainAbilityEffect(ability2, Duration.Custom, rule);
|
||||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
@ -112,8 +110,8 @@ class MathasFiendSeekerGainAbilityEffect extends GainAbilityTargetEffect {
|
|||
|
||||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source));
|
||||
if (land != null && land.getCounters(game).getCount(CounterType.BOUNTY) < 1) {
|
||||
Permanent creature = game.getPermanent(this.targetPointer.getFirst(game, source));
|
||||
if (creature != null && creature.getCounters(game).getCount(CounterType.BOUNTY) < 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -129,7 +127,7 @@ class OpponentsGainLifeEffect extends OneShotEffect {
|
|||
|
||||
public OpponentsGainLifeEffect() {
|
||||
super(Outcome.GainLife);
|
||||
staticText = "Each opponent gains 2 life.";
|
||||
staticText = "and gains 2 life.";
|
||||
}
|
||||
|
||||
public OpponentsGainLifeEffect(final OpponentsGainLifeEffect effect) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -50,6 +49,8 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.stack.Spell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -132,6 +133,6 @@ class MelekIzzetParagonTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you cast an instant or sorcery from your library, copy it. You may choose new targets for the copy.";
|
||||
return "Whenever you cast an instant or sorcery spell from your library, copy it. You may choose new targets for the copy.";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility {
|
|||
&& event.getSourceId().equals(getSourceId())
|
||||
&& !event.getSourceId().equals(event.getTargetId())) {
|
||||
Permanent sacrificed = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||
if (sacrificed != null && sacrificed.hasSubtype(SubType.FAERIE, game)) {
|
||||
if (sacrificed != null) {// no longer checks for Faerie as LKI isn't always accurate, can't think of how that could matter anyway - TheElk801
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
67
Mage.Sets/src/mage/cards/n/NecraSanctuary.java
Normal file
67
Mage.Sets/src/mage/cards/n/NecraSanctuary.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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.n;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SanctuaryTriggeredAbility;
|
||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class NecraSanctuary extends CardImpl {
|
||||
|
||||
public NecraSanctuary(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
|
||||
|
||||
// At the beginning of your upkeep, if you control a green or white permanent, target player loses 1 life. If you control a green permanent and a white permanent, that player loses 3 life instead.
|
||||
Ability ability = new SanctuaryTriggeredAbility(
|
||||
new LoseLifeTargetEffect(1), new LoseLifeTargetEffect(3), ObjectColor.GREEN, ObjectColor.WHITE,
|
||||
"At the beginning of your upkeep, if you control a green or white permanent, "
|
||||
+ "target player loses 1 life. If you control a green permanent and a white permanent, that player loses 3 life instead."
|
||||
);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public NecraSanctuary(final NecraSanctuary card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NecraSanctuary copy() {
|
||||
return new NecraSanctuary(this);
|
||||
}
|
||||
}
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
package mage.cards.o;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
|
@ -43,13 +42,15 @@ import mage.filter.predicate.permanent.AnotherPredicate;
|
|||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class OblivionRing extends CardImpl {
|
||||
|
||||
private static final FilterNonlandPermanent anotherNonlandPermanent = new FilterNonlandPermanent("another nonland permanent");
|
||||
private static final FilterNonlandPermanent anotherNonlandPermanent = new FilterNonlandPermanent("another target nonland permanent");
|
||||
|
||||
static {
|
||||
anotherNonlandPermanent.add(new AnotherPredicate());
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.o;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CopyTargetSpellEffect;
|
||||
|
@ -38,12 +37,13 @@ import mage.constants.CardType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterAttackingCreature;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class OddsEnds extends SplitCard {
|
||||
|
||||
public OddsEnds(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
@ -56,7 +56,7 @@ public class OddsEnds extends SplitCard {
|
|||
|
||||
// Ends
|
||||
// Target player sacrifices two attacking creatures.
|
||||
getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(new FilterAttackingCreature(), 2, "Target player"));
|
||||
getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_ATTACKING_CREATURES, 2, "Target player"));
|
||||
getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer());
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.o;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -35,7 +34,9 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterAttackingCreature;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -48,7 +49,7 @@ public class OrcishOriflamme extends CardImpl {
|
|||
|
||||
|
||||
// Attacking creatures you control get +1/+0.
|
||||
BoostControlledEffect boostEffect = new BoostControlledEffect(1, 0, Duration.WhileOnBattlefield, new FilterAttackingCreature(), false);
|
||||
BoostControlledEffect boostEffect = new BoostControlledEffect(1, 0, Duration.WhileOnBattlefield, StaticFilters.FILTER_ATTACKING_CREATURES, false);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, boostEffect));
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
@ -36,19 +35,21 @@ import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lopho
|
||||
*/
|
||||
public class PlagueRats extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent plagueRatsFilter = new FilterCreaturePermanent("Plague Rats on the battlefield");
|
||||
private static final FilterCreaturePermanent plagueRatsFilter = new FilterCreaturePermanent("creatures named Plague Rats on the battlefield");
|
||||
static {
|
||||
plagueRatsFilter.add(new NamePredicate("Plague Rats"));
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -41,6 +40,8 @@ import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wehk
|
||||
|
@ -48,7 +49,7 @@ import mage.target.TargetPermanent;
|
|||
public class PureSimple extends SplitCard {
|
||||
|
||||
private static final FilterPermanent filterDestroy = new FilterPermanent("Auras and Equipment");
|
||||
private static final FilterPermanent filterMulticolor = new FilterPermanent("multicolor permanent");
|
||||
private static final FilterPermanent filterMulticolor = new FilterPermanent("multicolored permanent");
|
||||
|
||||
static {
|
||||
filterDestroy.add(Predicates.or(new SubtypePredicate(SubType.AURA), new SubtypePredicate(SubType.EQUIPMENT)));
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.q;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
|
@ -43,13 +42,15 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jonubuu
|
||||
*/
|
||||
public class QuirionRanger extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Forest");
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Forest");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.FOREST));
|
||||
|
|
67
Mage.Sets/src/mage/cards/r/RakaSanctuary.java
Normal file
67
Mage.Sets/src/mage/cards/r/RakaSanctuary.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SanctuaryTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class RakaSanctuary extends CardImpl {
|
||||
|
||||
public RakaSanctuary(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||
|
||||
// At the beginning of your upkeep, if you control a white or blue permanent, Raka Sanctuary deals 1 damage to target creature. If you control a white permanent and a blue permanent, Raka Sanctuary deals 3 damage to that creature instead.
|
||||
Ability ability = new SanctuaryTriggeredAbility(
|
||||
new DamageTargetEffect(1), new DamageTargetEffect(3), ObjectColor.WHITE, ObjectColor.BLUE,
|
||||
"At the beginning of your upkeep, if you control a white or blue permanent, Raka Sanctuary deals 1 damage to target creature. "
|
||||
+ "If you control a white permanent and a blue permanent, Raka Sanctuary deals 3 damage to that creature instead."
|
||||
);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public RakaSanctuary(final RakaSanctuary card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RakaSanctuary copy() {
|
||||
return new RakaSanctuary(this);
|
||||
}
|
||||
}
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
|
||||
|
@ -42,13 +41,15 @@ import mage.filter.common.FilterCreatureCard;
|
|||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class RecurringNightmare extends CardImpl {
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card in your graveyard");
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card");
|
||||
private static final FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("creature");
|
||||
|
||||
public RecurringNightmare(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
140
Mage.Sets/src/mage/cards/r/RimefeatherOwl.java
Normal file
140
Mage.Sets/src/mage/cards/r/RimefeatherOwl.java
Normal file
|
@ -0,0 +1,140 @@
|
|||
/*
|
||||
* 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.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.filter.predicate.permanent.CounterPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class RimefeatherOwl extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("Permanents with ice counters on them");
|
||||
private static final FilterPermanent filter2 = new FilterPermanent("snow permanents on the battlefield");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new CounterPredicate(CounterType.ICE)));
|
||||
filter2.add(Predicates.not(new SupertypePredicate(SuperType.SNOW)));
|
||||
}
|
||||
|
||||
public RimefeatherOwl(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
|
||||
|
||||
this.addSuperType(SuperType.SNOW);
|
||||
this.subtype.add(SubType.BIRD);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Rimefeather Owl's power and toughness are each equal to the number of snow permanents on the battlefield.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter2), Duration.EndOfGame)));
|
||||
|
||||
// {1}{snow}: Put an ice counter on target permanent.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.ICE.createInstance()), new ManaCostsImpl("{1}{S}"));
|
||||
ability.addTarget(new TargetPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Permanents with ice counters on them are snow.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new RimefeatherOwlEffect(Duration.WhileOnBattlefield, filter)));
|
||||
}
|
||||
|
||||
public RimefeatherOwl(final RimefeatherOwl card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RimefeatherOwl copy() {
|
||||
return new RimefeatherOwl(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RimefeatherOwlEffect extends ContinuousEffectImpl {
|
||||
|
||||
private final FilterPermanent filter;
|
||||
|
||||
public RimefeatherOwlEffect(Duration duration, FilterPermanent filter) {
|
||||
super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Detriment);
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
public RimefeatherOwlEffect(final RimefeatherOwlEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RimefeatherOwlEffect copy() {
|
||||
return new RimefeatherOwlEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
permanent.addSuperType(SuperType.SNOW);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return "All nonland permanents are legendary";
|
||||
}
|
||||
}
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -49,13 +48,15 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SkirkDrillSergeant extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Goblin");
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("or another Goblin");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.GOBLIN));
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
|
@ -43,6 +42,8 @@ import mage.filter.common.FilterControlledPermanent;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.permanent.token.KnightToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -68,7 +69,7 @@ public class SunspireGatekeepers extends CardImpl {
|
|||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KnightToken())),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 1),
|
||||
"When {this} enter the battlefield, if you control two or more Gates, create a 2/2 white Knight creature token with vigilance."));
|
||||
"When {this} enters the battlefield, if you control two or more Gates, create a 2/2 white Knight creature token with vigilance."));
|
||||
}
|
||||
|
||||
public SunspireGatekeepers (final SunspireGatekeepers card) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.DiscardTargetCost;
|
||||
|
@ -43,13 +42,15 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class SurvivalOfTheFittest extends CardImpl {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("creature card");
|
||||
private static final FilterCard filter = new FilterCard("a creature card");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
@ -43,6 +42,8 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author FenrisulfrX
|
||||
|
@ -58,12 +59,12 @@ public class TemporaryInsanity extends CardImpl {
|
|||
|
||||
// and gain control of it until end of turn.
|
||||
Effect effect = new GainControlTargetEffect(Duration.EndOfTurn);
|
||||
effect.setText("and gain control of it until end of the turn. ");
|
||||
effect.setText("and gain control of it until end of turn. ");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
|
||||
// That creature gains haste until end of turn.
|
||||
effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setText("That creature gains haste until end of the turn.");
|
||||
effect.setText("That creature gains haste until end of turn.");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,25 +27,26 @@
|
|||
*/
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
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.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
|
@ -72,6 +73,7 @@ public class TinWingChimera extends CardImpl {
|
|||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P2P2.createInstance()), new SacrificeSourceCost());
|
||||
ability.addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
addAbility(ability);
|
||||
}
|
||||
|
||||
public TinWingChimera(final TinWingChimera card) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.v;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
|
@ -38,13 +37,15 @@ import mage.constants.SubType;
|
|||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class VerduranEnchantress extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("an Enchantment spell");
|
||||
private static final FilterSpell filter = new FilterSpell("an enchantment spell");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.w;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
|
@ -39,13 +38,15 @@ import mage.filter.common.FilterLandCard;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class WoodElves extends CardImpl {
|
||||
|
||||
private static final FilterLandCard filter = new FilterLandCard("Forest");
|
||||
private static final FilterLandCard filter = new FilterLandCard("Forest card");
|
||||
static{
|
||||
filter.add(new SubtypePredicate(SubType.FOREST));
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ public class Apocalypse extends ExpansionSet {
|
|||
this.ratioBoosterMythic = 0;
|
||||
cards.add(new SetCardInfo("Aether Mutation", 91, Rarity.UNCOMMON, mage.cards.a.AetherMutation.class));
|
||||
cards.add(new SetCardInfo("Ana Disciple", 73, Rarity.COMMON, mage.cards.a.AnaDisciple.class));
|
||||
cards.add(new SetCardInfo("Ana Sanctuary", 74, Rarity.UNCOMMON, mage.cards.a.AnaSanctuary.class));
|
||||
cards.add(new SetCardInfo("Anavolver", 75, Rarity.RARE, mage.cards.a.Anavolver.class));
|
||||
cards.add(new SetCardInfo("Angelfire Crusader", 1, Rarity.COMMON, mage.cards.a.AngelfireCrusader.class));
|
||||
cards.add(new SetCardInfo("Battlefield Forge", 139, Rarity.RARE, mage.cards.b.BattlefieldForge.class));
|
||||
|
@ -45,6 +46,7 @@ public class Apocalypse extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Death Grasp", 95, Rarity.RARE, mage.cards.d.DeathGrasp.class));
|
||||
cards.add(new SetCardInfo("Death Mutation", 96, Rarity.UNCOMMON, mage.cards.d.DeathMutation.class));
|
||||
cards.add(new SetCardInfo("Dega Disciple", 4, Rarity.COMMON, mage.cards.d.DegaDisciple.class));
|
||||
cards.add(new SetCardInfo("Dega Sanctuary", 5, Rarity.UNCOMMON, mage.cards.d.DegaSanctuary.class));
|
||||
cards.add(new SetCardInfo("Degavolver", 6, Rarity.RARE, mage.cards.d.Degavolver.class));
|
||||
cards.add(new SetCardInfo("Desolation Angel", 38, Rarity.RARE, mage.cards.d.DesolationAngel.class));
|
||||
cards.add(new SetCardInfo("Desolation Giant", 59, Rarity.RARE, mage.cards.d.DesolationGiant.class));
|
||||
|
@ -99,6 +101,7 @@ public class Apocalypse extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Mournful Zombie", 43, Rarity.COMMON, mage.cards.m.MournfulZombie.class));
|
||||
cards.add(new SetCardInfo("Mystic Snake", 112, Rarity.RARE, mage.cards.m.MysticSnake.class));
|
||||
cards.add(new SetCardInfo("Necra Disciple", 44, Rarity.COMMON, mage.cards.n.NecraDisciple.class));
|
||||
cards.add(new SetCardInfo("Necra Sanctuary", 45, Rarity.UNCOMMON, mage.cards.n.NecraSanctuary.class));
|
||||
cards.add(new SetCardInfo("Necravolver", 46, Rarity.RARE, mage.cards.n.Necravolver.class));
|
||||
cards.add(new SetCardInfo("Night // Day", 131, Rarity.UNCOMMON, mage.cards.n.NightDay.class));
|
||||
cards.add(new SetCardInfo("Order // Chaos", 132, Rarity.UNCOMMON, mage.cards.o.OrderChaos.class));
|
||||
|
@ -118,6 +121,7 @@ public class Apocalypse extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Quagmire Druid", 51, Rarity.COMMON, mage.cards.q.QuagmireDruid.class));
|
||||
cards.add(new SetCardInfo("Quicksilver Dagger", 118, Rarity.COMMON, mage.cards.q.QuicksilverDagger.class));
|
||||
cards.add(new SetCardInfo("Raka Disciple", 66, Rarity.COMMON, mage.cards.r.RakaDisciple.class));
|
||||
cards.add(new SetCardInfo("Raka Sanctuary", 67, Rarity.UNCOMMON, mage.cards.r.RakaSanctuary.class));
|
||||
cards.add(new SetCardInfo("Rakavolver", 68, Rarity.RARE, mage.cards.r.Rakavolver.class));
|
||||
cards.add(new SetCardInfo("Razorfin Hunter", 119, Rarity.COMMON, mage.cards.r.RazorfinHunter.class));
|
||||
cards.add(new SetCardInfo("Reef Shaman", 29, Rarity.COMMON, mage.cards.r.ReefShaman.class));
|
||||
|
|
|
@ -141,6 +141,7 @@ public class Coldsnap extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Resize", 117, Rarity.UNCOMMON, mage.cards.r.Resize.class));
|
||||
cards.add(new SetCardInfo("Rimebound Dead", 69, Rarity.COMMON, mage.cards.r.RimeboundDead.class));
|
||||
cards.add(new SetCardInfo("Rime Transfusion", 68, Rarity.UNCOMMON, mage.cards.r.RimeTransfusion.class));
|
||||
cards.add(new SetCardInfo("Rimefeather Owl", 42, Rarity.RARE, mage.cards.r.RimefeatherOwl.class));
|
||||
cards.add(new SetCardInfo("Rimescale Dragon", 95, Rarity.RARE, mage.cards.r.RimescaleDragon.class));
|
||||
cards.add(new SetCardInfo("Rimewind Cryomancer", 43, Rarity.UNCOMMON, mage.cards.r.RimewindCryomancer.class));
|
||||
cards.add(new SetCardInfo("Rimewind Taskmage", 44, Rarity.COMMON, mage.cards.r.RimewindTaskmage.class));
|
||||
|
|
|
@ -27,7 +27,7 @@ public class Ixalan extends ExpansionSet {
|
|||
this.hasBoosters = true;
|
||||
this.hasBasicLands = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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.common;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.condition.CompoundCondition;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class SanctuaryTriggeredAbility extends ConditionalTriggeredAbility {
|
||||
|
||||
private static Condition makeOrCondition(ObjectColor color1, ObjectColor color2) {
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(Predicates.or(
|
||||
new ColorPredicate(color1),
|
||||
new ColorPredicate(color2)
|
||||
));
|
||||
return new PermanentsOnTheBattlefieldCondition(filter);
|
||||
}
|
||||
|
||||
private static Condition makeAndCondition(ObjectColor color1, ObjectColor color2) {
|
||||
FilterPermanent filter1 = new FilterPermanent();
|
||||
filter1.add(new ColorPredicate(color1));
|
||||
Condition condition1 = new PermanentsOnTheBattlefieldCondition(filter1);
|
||||
FilterPermanent filter2 = new FilterPermanent();
|
||||
filter2.add(new ColorPredicate(color2));
|
||||
Condition condition2 = new PermanentsOnTheBattlefieldCondition(filter2);
|
||||
return new CompoundCondition(condition1, condition2);
|
||||
}
|
||||
|
||||
private static TriggeredAbility makeTrigger(OneShotEffect effect1, OneShotEffect effect2, ObjectColor color1, ObjectColor color2) {
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(
|
||||
new ConditionalOneShotEffect(effect1, new InvertCondition(makeAndCondition(color1, color2))), TargetController.YOU, false
|
||||
);
|
||||
ability.addEffect(new ConditionalOneShotEffect(effect2, makeAndCondition(color1, color2)));
|
||||
return ability;
|
||||
}
|
||||
|
||||
public SanctuaryTriggeredAbility(OneShotEffect effect1, OneShotEffect effect2, ObjectColor color1, ObjectColor color2, String text) {
|
||||
super(makeTrigger(effect1, effect2, color1, color2), makeOrCondition(color1, color2), text);
|
||||
}
|
||||
}
|
|
@ -68,7 +68,7 @@ public final class StaticFilters {
|
|||
|
||||
public static final FilterPermanent FILTER_CREATURE_TOKENS = new FilterCreaturePermanent("creature tokens");
|
||||
|
||||
public static final FilterPermanent FILTER_ATTACKING_CREATURES = new FilterCreaturePermanent("attacking creatures");
|
||||
public static final FilterCreaturePermanent FILTER_ATTACKING_CREATURES = new FilterCreaturePermanent("attacking creatures");
|
||||
|
||||
public static final FilterPermanent FILTER_PERMANENT_AURA = new FilterPermanent();
|
||||
public static final FilterPermanent FILTER_PERMANENT_EQUIPMENT = new FilterPermanent();
|
||||
|
|
Loading…
Reference in a new issue