mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Some target pointer changes and code clean up.
This commit is contained in:
parent
142681c354
commit
7a78be8c6a
207 changed files with 531 additions and 358 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -7,13 +6,11 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
@ -25,7 +22,7 @@ import mage.players.Player;
|
|||
public final class AbattoirGhoul extends CardImpl {
|
||||
|
||||
public AbattoirGhoul(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
this.subtype.add(SubType.ZOMBIE);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
|
@ -65,18 +62,15 @@ class AbattoirGhoulEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||
if (card != null) {
|
||||
Permanent creature = (Permanent) game.getLastKnownInformation(card.getId(), Zone.BATTLEFIELD);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (creature != null) {
|
||||
int toughness = creature.getToughness().getValue();
|
||||
if (you != null) {
|
||||
you.gainLife(toughness, game, source);
|
||||
if (controller != null) {
|
||||
controller.gainLife(toughness, game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -76,7 +76,7 @@ class AbbotOfKeralKeepExileEffect extends OneShotEffect {
|
|||
String exileName = sourcePermanent.getIdName() + " <this card may be played the turn it was exiled>";
|
||||
controller.moveCardsToExile(card, source, game, true, source.getSourceId(), exileName);
|
||||
ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -28,7 +27,7 @@ public final class AcornCatapult extends CardImpl {
|
|||
public AcornCatapult(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||
|
||||
// {1}, {tap}: Acorn Catapult deals 1 damage to any target. That creature's controller or that player creates a 1/1 green Squirrel creature token.
|
||||
// {1}, {T}: Acorn Catapult deals 1 damage to any target. That creature's controller or that player creates a 1/1 green Squirrel creature token.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addEffect(new AcornCatapultEffect());
|
||||
|
@ -64,10 +63,9 @@ class AcornCatapultEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID targetId = getTargetPointer().getFirst(game, source);
|
||||
Player player = game.getPlayer(targetId);
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player == null) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
player = game.getPlayer(permanent.getControllerId());
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -66,7 +65,7 @@ class ActOfAuthorityEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent targetPermanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetPermanent != null && new ExileTargetEffect().apply(game, source)) {
|
||||
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (sourcePermanent != null) {
|
||||
|
|
|
@ -81,7 +81,7 @@ class AerialCaravanExileEffect extends OneShotEffect {
|
|||
String exileName = sourcePermanent.getIdName() + " <this card may be played the turn it was exiled>";
|
||||
controller.moveCardsToExile(card, source, game, true, source.getSourceId(), exileName);
|
||||
ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -21,7 +20,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
public final class Afterlife extends CardImpl {
|
||||
|
||||
public Afterlife(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}");
|
||||
|
||||
// Destroy target creature. It can't be regenerated. Its controller puts a
|
||||
// 1/1 white Spirit creature token with flying.
|
||||
|
@ -58,7 +57,7 @@ class AfterlifeEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
SpiritWhiteToken token = new SpiritWhiteToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), permanent.getControllerId());
|
||||
|
|
|
@ -115,7 +115,7 @@ class AkoumHellkiteDamageEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent land = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (land != null && player != null) {
|
||||
if (land.hasSubtype(SubType.MOUNTAIN, game)) {
|
||||
|
|
|
@ -172,7 +172,7 @@ class AminatouUltimateEffect extends OneShotEffect {
|
|||
continue;
|
||||
}
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, currentPlayer);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
currentPlayer = nextPlayer;
|
||||
|
|
|
@ -104,7 +104,7 @@ class AminatousAuguryEffect extends OneShotEffect {
|
|||
}
|
||||
for (Card card : cardsToCast.getCards(StaticFilters.FILTER_CARD_NON_LAND, game)) {
|
||||
AminatousAuguryCastFromExileEffect effect = new AminatousAuguryCastFromExileEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
|
@ -13,8 +14,6 @@ import mage.game.permanent.token.AngelToken;
|
|||
import mage.game.permanent.token.Token;
|
||||
import mage.target.common.TargetCreatureOrPlaneswalker;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
|
@ -59,7 +58,7 @@ class AngelicAscensionEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class ApexOfPowerSpellEffect extends OneShotEffect {
|
|||
continue;
|
||||
}
|
||||
ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility;
|
||||
|
@ -18,8 +19,6 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
|
@ -75,7 +74,7 @@ class ArchonOfRedemptionEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (player == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ class AssassinsTrophyEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
Player controller = game.getPlayer(permanent.getControllerId());
|
||||
if (controller != null) {
|
||||
|
|
|
@ -70,7 +70,7 @@ class AvengerEnDalEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class BeastWithinEffect extends OneShotEffect {
|
|||
// If the permanent is an illegal target when Beast Within tries to resolve, the spell won’t resolve and none
|
||||
// of its effects will happen. The permanent’s controller won’t get a Beast token.
|
||||
// (2011-06-01)
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); // must use LKI
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); // must use LKI
|
||||
if (permanent != null) {
|
||||
new BeastToken().putOntoBattlefield(1, game, source.getSourceId(), permanent.getControllerId());
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import mage.constants.SubType;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -69,7 +68,7 @@ class BellowingFiendEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean applied = false;
|
||||
Permanent damagedCreature = ((FixedTarget) targetPointer).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent damagedCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (damagedCreature != null) {
|
||||
Player controller = game.getPlayer(damagedCreature.getControllerId());
|
||||
if (controller != null) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
|
@ -13,8 +14,6 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetAnyTarget;
|
||||
import mage.target.common.TargetDiscard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
@ -43,7 +42,7 @@ class BlastOfGeniusEffect extends OneShotEffect {
|
|||
|
||||
public BlastOfGeniusEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Choose any target. Draw three cards and discard a card. Blast of Genius deals damage equal to the converted mana cost of the discard card to that permanent or player";
|
||||
this.staticText = "Choose any target. Draw three cards and discard a card. {this} deals damage equal to the converted mana cost of the discard card to that permanent or player";
|
||||
}
|
||||
|
||||
public BlastOfGeniusEffect(final BlastOfGeniusEffect effect) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -32,7 +31,7 @@ public final class BlowflyInfestation extends CardImpl {
|
|||
private static final String rule = "Whenever a creature dies, if it had a -1/-1 counter on it, put a -1/-1 counter on target creature.";
|
||||
|
||||
public BlowflyInfestation(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
|
||||
|
||||
//Whenever a creature dies, if it had a -1/-1 counter on it, put a -1/-1 counter on target creature.
|
||||
Effect effect = new BlowflyInfestationEffect();
|
||||
|
@ -61,7 +60,7 @@ class BlowflyInfestationCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
for (Effect effect : source.getEffects()) {
|
||||
if (effect.getTargetPointer().getFirst(game, source) != null) {
|
||||
permanent = game.getPermanentOrLKIBattlefield(effect.getTargetPointer().getFirst(game, source));
|
||||
permanent = effect.getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
}
|
||||
}
|
||||
if (permanent != null) {
|
||||
|
|
|
@ -94,7 +94,7 @@ class BombSquadTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (permanent != null && filter.match(permanent, game)) {
|
||||
if (4 <= permanent.getCounters(game).getCount(CounterType.FUSE)) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.ManaWasSpentCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
|
@ -18,12 +19,11 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Dilnu
|
||||
*/
|
||||
public final class BorosFuryShield extends CardImpl {
|
||||
|
||||
private static final FilterAttackingOrBlockingCreature filter = new FilterAttackingOrBlockingCreature();
|
||||
|
||||
public BorosFuryShield(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
@ -49,6 +49,7 @@ public final class BorosFuryShield extends CardImpl {
|
|||
}
|
||||
|
||||
static class BorosFuryShieldDamageEffect extends OneShotEffect {
|
||||
|
||||
BorosFuryShieldDamageEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "{this} deals damage to that creature's controller equal to the creature's power";
|
||||
|
@ -60,7 +61,7 @@ public final class BorosFuryShield extends CardImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent target = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
Permanent target = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (target != null) {
|
||||
Player player = game.getPlayer(target.getControllerId());
|
||||
if (player != null) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -9,12 +8,12 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
@ -81,7 +80,7 @@ class BrambleSovereignEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(permanent.getControllerId());
|
||||
effect.setTargetPointer(targetPointer);
|
||||
|
|
|
@ -69,7 +69,7 @@ class BrokenVisageEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
permanent.destroy(source.getSourceId(), game, true);
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new BrokenVisageSpiritToken(permanent.getPower().getValue(), permanent.getToughness().getValue()));
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -16,7 +15,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -30,7 +28,7 @@ import mage.util.functions.EmptyApplyToPermanent;
|
|||
public final class CemeteryPuca extends CardImpl {
|
||||
|
||||
public CemeteryPuca(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U/B}{U/B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U/B}{U/B}");
|
||||
this.subtype.add(SubType.SHAPESHIFTER);
|
||||
|
||||
this.power = new MageInt(1);
|
||||
|
@ -71,7 +69,7 @@ class CemeteryPucaEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent copyToCreature = game.getPermanent(source.getSourceId());
|
||||
if (copyToCreature != null) {
|
||||
Permanent copyFromCreature = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
|
||||
Permanent copyFromCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (copyFromCreature != null) {
|
||||
game.copyPermanent(Duration.WhileOnBattlefield, copyFromCreature, copyToCreature.getId(), source, new EmptyApplyToPermanent());
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new CemeteryPucaEffect(), new ManaCostsImpl("{1}")), false, new FilterCreaturePermanent("a creature"), true), Duration.WhileOnBattlefield);
|
||||
|
|
|
@ -147,7 +147,7 @@ class ChandraAcolyteOfFlameGraveyardEffect extends OneShotEffect {
|
|||
Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
|
||||
if (card != null) {
|
||||
ContinuousEffect effect = new ChandraAcolyteOfFlameCastFromGraveyardEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
game.addEffect(effect, source);
|
||||
effect = new ChandraAcolyteOfFlameReplacementEffect(card.getId());
|
||||
game.addEffect(effect, source);
|
||||
|
|
|
@ -58,7 +58,7 @@ class ChastiseEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
int power = permanent.getPower().getValue();
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
@ -14,7 +13,6 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -69,10 +67,7 @@ class CloudstoneCurioEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent triggeringCreature = ((FixedTarget) getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
|
||||
if (triggeringCreature == null) {
|
||||
triggeringCreature = (Permanent) game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.BATTLEFIELD);
|
||||
}
|
||||
Permanent triggeringCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (triggeringCreature != null) {
|
||||
FilterPermanent filter = new FilterPermanent("another permanent you control that shares a permanent type with " + triggeringCreature.getName());
|
||||
filter.add(Predicates.not(new PermanentIdPredicate(triggeringCreature.getId())));
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -23,11 +22,8 @@ import mage.target.common.TargetControlledPermanent;
|
|||
*/
|
||||
public final class ConsumingVapors extends CardImpl {
|
||||
|
||||
|
||||
|
||||
public ConsumingVapors(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
|
||||
|
||||
// Target player sacrifices a creature. You gain life equal to that creature's toughness.
|
||||
this.getSpellAbility().addEffect(new ConsumingVaporsEffect());
|
||||
|
@ -49,12 +45,12 @@ public final class ConsumingVapors extends CardImpl {
|
|||
|
||||
class ConsumingVaporsEffect extends OneShotEffect {
|
||||
|
||||
ConsumingVaporsEffect ( ) {
|
||||
ConsumingVaporsEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
staticText = "Target player sacrifices a creature. You gain life equal to that creature's toughness";
|
||||
}
|
||||
|
||||
ConsumingVaporsEffect ( ConsumingVaporsEffect effect ) {
|
||||
ConsumingVaporsEffect(ConsumingVaporsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
@ -68,15 +64,13 @@ class ConsumingVaporsEffect extends OneShotEffect {
|
|||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true);
|
||||
|
||||
//A spell or ability could have removed the only legal target this player
|
||||
//had, if thats the case this ability should fizzle.
|
||||
if (player != null && target.canChoose(player.getId(), game)) {
|
||||
player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if ( permanent != null ) {
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
controller.gainLife(permanent.getToughness().getValue(), game, source);
|
||||
return permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -16,8 +16,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetAttackingOrBlockingCreature;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
|
@ -25,7 +23,7 @@ import java.util.UUID;
|
|||
public final class CoordinatedBarrage extends CardImpl {
|
||||
|
||||
public CoordinatedBarrage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}");
|
||||
|
||||
// Choose a creature type. Coordinated Barrage deals damage to target attacking or blocking creature equal to the number of permanents you control of the chosen type.
|
||||
this.getSpellAbility().addEffect(new CoordinatedBarrageEffect());
|
||||
|
@ -46,7 +44,7 @@ class CoordinatedBarrageEffect extends OneShotEffect {
|
|||
|
||||
CoordinatedBarrageEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "Choose a creature type. Coordinated Barrage deals damage to target attacking or blocking creature equal to the number of permanents you control of the chosen type";
|
||||
this.staticText = "Choose a creature type. {this} deals damage to target attacking or blocking creature equal to the number of permanents you control of the chosen type";
|
||||
}
|
||||
|
||||
CoordinatedBarrageEffect(final CoordinatedBarrageEffect effect) {
|
||||
|
|
|
@ -72,7 +72,7 @@ class CreamOfTheCropEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = ((FixedTarget) getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null && permanent != null) {
|
||||
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, permanent.getPower().getValue()));
|
||||
if (!cards.isEmpty()) {
|
||||
|
|
|
@ -66,7 +66,7 @@ class CribSwapEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent targetCreature = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent targetCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (targetCreature != null) {
|
||||
CribSwapShapeshifterWhiteToken token = new CribSwapShapeshifterWhiteToken();
|
||||
return token.putOntoBattlefield(1, game, source.getSourceId(), targetCreature.getControllerId());
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
|
@ -12,8 +13,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetArtifactPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author fireshoes
|
||||
*/
|
||||
|
@ -58,9 +57,7 @@ class CrumbleEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
// If the target artifact becomes illegal before resolution, the player does not gain any life.
|
||||
// (2004-10-04)
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); // must use LKI
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); // must use LKI
|
||||
if (permanent != null) {
|
||||
int cost = permanent.getConvertedManaCost();
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
|
|
|
@ -154,7 +154,7 @@ class DarettiScrapSavantEffect extends OneShotEffect {
|
|||
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
|
||||
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
effect.setText("return that card to the battlefield at the beginning of the next end step");
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.COMMAND, effect, TargetController.ANY), source);
|
||||
return true;
|
||||
|
|
|
@ -66,7 +66,7 @@ class DarkDabblingEffect extends OneShotEffect {
|
|||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
|
||||
if (!permanent.getId().equals(getTargetPointer().getFirst(game, source))) {
|
||||
RegenerateTargetEffect regenEffect = new RegenerateTargetEffect();
|
||||
regenEffect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
regenEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(regenEffect, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ class DarkImpostorExileTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (permanent != null) {
|
||||
permanent.moveToExile(null, null, source.getSourceId(), game);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -25,7 +24,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class DazzlingReflection extends CardImpl {
|
||||
|
||||
public DazzlingReflection(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
|
||||
|
||||
// You gain life equal to target creature's power. The next time that creature would deal damage this turn, prevent that damage.
|
||||
getSpellAbility().addEffect(new DazzlingReflectionEffect());
|
||||
|
@ -62,13 +61,15 @@ class DazzlingReflectionEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent targetCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent targetCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (targetCreature != null) {
|
||||
controller.gainLife(targetCreature.getPower().getValue(), game, source);
|
||||
ContinuousEffect effect = new DazzlingReflectionPreventEffect();
|
||||
effect.setTargetPointer(new FixedTarget(targetCreature, game));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class DeadshotDamageEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent ownCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent ownCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (ownCreature != null) {
|
||||
int damage = ownCreature.getPower().getValue();
|
||||
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
|
|
|
@ -101,7 +101,7 @@ class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (zEvent.isDiesEvent()) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (permanent != null && filter.match(permanent, this.getSourceId(), this.getControllerId(), game)) {
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class DesecratedEarthEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class DestroyTheEvidenceEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent landPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent landPermanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (landPermanent != null) {
|
||||
Player player = game.getPlayer(landPermanent.getControllerId());
|
||||
if (player == null) {
|
||||
|
|
|
@ -61,7 +61,7 @@ class DevourInShadowEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent target = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent target = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (player != null && target != null) {
|
||||
player.loseLife(target.getToughness().getValue(), game, false);
|
||||
return true;
|
||||
|
|
|
@ -92,7 +92,7 @@ class DraconicRoarEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher = game.getState().getWatcher(DragonOnTheBattlefieldWhileSpellWasCastWatcher.class);
|
||||
if (watcher != null && watcher.castWithConditionTrue(source.getId())) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
|
|
|
@ -126,7 +126,7 @@ class DreadWightEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
// add paralyzation counter
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.PARALYZATION.createInstance());
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
effect.apply(game, source);
|
||||
// tap permanent
|
||||
permanent.tap(game);
|
||||
|
@ -146,7 +146,7 @@ class DreadWightEffect extends OneShotEffect {
|
|||
ability,
|
||||
Duration.WhileOnBattlefield);
|
||||
ability.setRuleVisible(true);
|
||||
effect3.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect3.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect3, source);
|
||||
// each gains 4: remove paralyzation counter
|
||||
Ability activatedAbility = new SimpleActivatedAbility(
|
||||
|
@ -156,7 +156,7 @@ class DreadWightEffect extends OneShotEffect {
|
|||
ContinuousEffect effect4 = new GainAbilityTargetEffect(
|
||||
activatedAbility,
|
||||
Duration.WhileOnBattlefield);
|
||||
effect4.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect4.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect4, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class BecomesColorOrColorsEnchantedEffect extends OneShotEffect {
|
|||
String colors = new String(sb);
|
||||
ObjectColor chosenColors = new ObjectColor(colors);
|
||||
ContinuousEffect effect = new BecomesColorTargetEffect(chosenColors, Duration.Custom);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -86,7 +86,7 @@ class DualNatureCreateTokenEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(permanent.getControllerId());
|
||||
effect.setTargetPointer(targetPointer);
|
||||
|
@ -127,7 +127,7 @@ class DualNatureCreatureLeavesEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (creature != null) {
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(TokenPredicate.instance);
|
||||
|
|
|
@ -73,7 +73,7 @@ class EldraziMimicEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent permanent = ((FixedTarget) getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
ContinuousEffect effect = new SetPowerToughnessTargetEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId()));
|
||||
|
|
|
@ -65,7 +65,7 @@ class EnfysNestEffect extends ExileTargetEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if(permanent != null) {
|
||||
// you may exile target creature an opponent controls
|
||||
if(!super.apply(game, source)) {
|
||||
|
|
|
@ -60,7 +60,7 @@ class EngulfingSlagwurmEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent creature = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (creature != null && controller != null) {
|
||||
controller.gainLife(creature.getPower().getValue(), game, source);
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ class EyeOfSingularityTriggeredEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Map<UUID, Integer> toDestroy = new HashMap<>();
|
||||
Permanent etbPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent etbPermanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
|
||||
if (etbPermanent == null) {
|
||||
return false;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||
|
@ -19,9 +21,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
@ -80,7 +79,7 @@ class FaerieArtisansEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanentToCopy = game.getPermanentOrLKIBattlefield(targetPointer.getFixedTarget(game, source).getTarget());
|
||||
Permanent permanentToCopy = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && permanentToCopy != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(null, CardType.ARTIFACT, false);
|
||||
|
|
|
@ -78,7 +78,7 @@ class FelhideSpiritbinderEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(null, CardType.ENCHANTMENT, true);
|
||||
effect.setTargetPointer(getTargetPointer());
|
||||
|
|
|
@ -58,7 +58,7 @@ class FellTheMightyEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent targetCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent targetCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null && targetCreature != null) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) {
|
||||
if (permanent.getPower().getValue() > targetCreature.getPower().getValue()) {
|
||||
|
|
|
@ -67,7 +67,7 @@ class FierceInvocationEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(2));
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
return effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ class FightOrFlightEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
RestrictionEffect effect = new CantAttackTargetEffect(Duration.EndOfTurn);
|
||||
effect.setText("");
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ class FlamerushRiderEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null && permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true, 1, true, true);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
|
|
|
@ -77,7 +77,7 @@ class FlameshadowConjuringEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = ((FixedTarget) getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(null, null, true);
|
||||
effect.setTargetPointer(getTargetPointer());
|
||||
|
|
|
@ -67,7 +67,7 @@ class FlayedNimEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = ((FixedTarget) targetPointer).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (creature == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ class FleshAllergyEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FleshAllergyWatcher watcher = game.getState().getWatcher(FleshAllergyWatcher.class);
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null && watcher != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
|
|
|
@ -68,7 +68,7 @@ class ForceProjectionEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null && permanent != null) {
|
||||
// Create a token that is a copy of target creature
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true);
|
||||
|
|
|
@ -82,7 +82,7 @@ class FullMoonsRiseEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||
ReplacementEffect effect = new RegenerateTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -97,7 +97,7 @@ class GarrukApexPredatorEffect3 extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent creature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (player != null && creature != null) {
|
||||
player.gainLife(creature.getToughness().getValue(), game, source);
|
||||
return true;
|
||||
|
|
|
@ -144,7 +144,7 @@ class GauntletOfPowerTapForManaAllTriggeredAbility extends TriggeredManaAbility
|
|||
}
|
||||
switch (setTargetPointer) {
|
||||
case PERMANENT:
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game));
|
||||
break;
|
||||
case PLAYER:
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
|
||||
|
@ -182,7 +182,7 @@ class GauntletOfPowerManaEffect2 extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public Player getPlayer(Game game, Ability source) {
|
||||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent land = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (land != null) {
|
||||
return game.getPlayer(land.getControllerId());
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ class GauntletOfPowerManaEffect2 extends ManaEffect {
|
|||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
if (game != null) {
|
||||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent land = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (land != null) {
|
||||
Mana mana = (Mana) getValue("mana");
|
||||
if (mana != null) {
|
||||
|
|
|
@ -92,7 +92,7 @@ class GenesisChamberEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = ((FixedTarget) targetPointer).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
MyrToken token = new MyrToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), permanent.getControllerId());
|
||||
|
|
|
@ -66,7 +66,7 @@ class GeomancersGambitEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ class GhostQuarterEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
Player controller = game.getPlayer(permanent.getControllerId());
|
||||
if (controller != null && controller.chooseUse(Outcome.PutLandInPlay, "Do you wish to search for a basic land, put it onto the battlefield and then shuffle your library?", source, game)) {
|
||||
|
|
|
@ -60,7 +60,7 @@ class GloomlanceEffect extends OneShotEffect {
|
|||
if (targetCreature != null) {
|
||||
Player targetController = game.getPlayer(targetCreature.getControllerId());
|
||||
targetCreature.destroy(source.getSourceId(), game, false);
|
||||
Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent destroyedCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (destroyedCreature.getColor(game).isGreen()
|
||||
|| destroyedCreature.getColor(game).isWhite()) {
|
||||
if(targetController != null) {
|
||||
|
|
|
@ -71,7 +71,7 @@ class GloomwidowsFeastEffect extends OneShotEffect {
|
|||
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
|
||||
if (targetCreature != null) {
|
||||
targetCreature.destroy(source.getSourceId(), game, false);
|
||||
Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent destroyedCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (destroyedCreature.getColor(game).isBlue()
|
||||
|| destroyedCreature.getColor(game).isBlack()) {
|
||||
SpiderToken token = new SpiderToken();
|
||||
|
|
|
@ -80,7 +80,7 @@ class GlyphOfReincarnationEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent targetWall = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent targetWall = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null && targetWall != null) {
|
||||
BlockedAttackerWatcher watcher = game.getState().getWatcher(BlockedAttackerWatcher.class);
|
||||
if (watcher != null) {
|
||||
|
|
|
@ -71,7 +71,7 @@ class GoblinTinkererDamageEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent targetArtifact = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent targetArtifact = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null && targetArtifact != null) {
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
int damage = targetArtifact.getConvertedManaCost();
|
||||
|
|
|
@ -79,7 +79,7 @@ class GraveBetrayalTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Card card = (Card) game.getObject(permanent.getId());
|
||||
if (card != null) {
|
||||
Effect effect = new GraveBetrayalEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
|
||||
game.addDelayedTriggeredAbility(delayedAbility, this);
|
||||
return true;
|
||||
|
|
|
@ -62,7 +62,7 @@ class GraviticPunchEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent controlledCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent controlledCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget());
|
||||
if (player == null || controlledCreature == null) {
|
||||
return false;
|
||||
|
|
|
@ -72,7 +72,7 @@ class GreaterWerewolfEffect extends OneShotEffect {
|
|||
filter.add(Predicates.or(new BlockedByIdPredicate(sourcePermanent.getId()), new BlockingAttackerIdPredicate(sourcePermanent.getId())));
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
|
||||
Effect effect = new AddCountersTargetEffect(new BoostCounter(0, -2), Outcome.UnboostCreature);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
effect.apply(game, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -91,7 +91,7 @@ class GrimFeastEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = ((FixedTarget) targetPointer).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (creature == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ class GrislySpectacleEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (creature != null) {
|
||||
Player controller = game.getPlayer(creature.getControllerId());
|
||||
if (controller != null) {
|
||||
|
|
|
@ -86,7 +86,7 @@ class GuardDogsEffect extends PreventionEffectImpl {
|
|||
if (mageObject != null
|
||||
&& controlledTarget.getFirstTarget() != null) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(controlledTarget.getFirstTarget());
|
||||
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
Permanent targetPermanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null
|
||||
&& targetPermanent != null
|
||||
&& this.getTargetPointer().getTargets(game, source).contains(event.getSourceId())
|
||||
|
|
|
@ -119,7 +119,7 @@ class GuardianOfTazeemEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent land = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
|
||||
if (land != null && targetCreature != null && land.hasSubtype(SubType.ISLAND, game)) {
|
||||
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("that creature");
|
||||
|
|
|
@ -63,7 +63,7 @@ class GuulDrazOverseerEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent land = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null && land != null) {
|
||||
int boost = 1;
|
||||
if (land.hasSubtype(SubType.SWAMP, game)) {
|
||||
|
|
|
@ -99,7 +99,7 @@ class GyrusWakerOfCorpsesEffect extends OneShotEffect {
|
|||
}
|
||||
controller.moveCards(card, Zone.EXILED, source, game);
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true, 1, true, true);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
effect.apply(game, source);
|
||||
for (Permanent addedToken : effect.getAddedPermanent()) {
|
||||
Effect exileEffect = new ExileTargetEffect();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -18,9 +19,8 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class HamletbackGoliath extends CardImpl {
|
||||
|
@ -74,7 +74,7 @@ class HamletbackGoliathTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (permanent != null && permanent.isCreature()
|
||||
&& !(targetId.equals(this.getSourceId()))) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -99,11 +99,8 @@ class HamletbackGoliathEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (creature == null) {
|
||||
creature = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
|
||||
}
|
||||
if (creature != null && sourceObject != null) {
|
||||
sourceObject.addCounters(CounterType.P1P1.createInstance(creature.getPower().getValue()), source, game);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class HealTheScarsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
|
|
|
@ -61,7 +61,7 @@ class HeatShimmerEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null
|
||||
&& permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true);
|
||||
|
|
|
@ -101,7 +101,7 @@ class HellkiteTyrantEffect extends OneShotEffect {
|
|||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
|
||||
for (Permanent permanent : permanents) {
|
||||
ContinuousEffect effect = new HellkiteTyrantControlEffect(source.getControllerId());
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -141,7 +141,7 @@ class HeraldOfLeshracLeavesEffect extends OneShotEffect {
|
|||
filter.add(new ControllerIdPredicate(source.getControllerId()));
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, playerId);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class HeroismEffect extends OneShotEffect {
|
|||
|
||||
for (Permanent permanent : permanentsToPrevent) {
|
||||
ContinuousEffect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true);
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -108,7 +108,7 @@ class IdentityThiefEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent targetPermanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.i;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
|
@ -16,9 +14,9 @@ import mage.abilities.keyword.TrampleAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
@ -45,7 +43,7 @@ public final class ImpelledGiant extends CardImpl {
|
|||
}
|
||||
|
||||
public ImpelledGiant(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}");
|
||||
this.subtype.add(SubType.GIANT);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
|
||||
|
@ -87,13 +85,14 @@ class ImpelledGiantCost extends CostImpl {
|
|||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
if (target.choose(Outcome.Tap, controllerId, sourceId, game)) {
|
||||
for (UUID targetId: target.getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent == null)
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
paid |= permanent.tap(game);
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,10 +109,8 @@ class ImpelledGiantCost extends CostImpl {
|
|||
return new ImpelledGiantCost(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class ImpelledGiantBoostEffect extends OneShotEffect {
|
||||
|
||||
public ImpelledGiantBoostEffect() {
|
||||
|
@ -128,7 +125,7 @@ class ImpelledGiantBoostEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent impelledGiant = game.getPermanent(source.getSourceId());
|
||||
Permanent tappedCreature = game.getPermanentOrLKIBattlefield(this.targetPointer.getFirst(game, source));
|
||||
Permanent tappedCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (tappedCreature != null && impelledGiant != null) {
|
||||
int amount = tappedCreature.getPower().getValue();
|
||||
game.addEffect(new BoostSourceEffect(amount, 0, Duration.EndOfTurn), source);
|
||||
|
|
|
@ -141,7 +141,7 @@ class ImprisonUnblockEffect extends OneShotEffect {
|
|||
|
||||
// Remove it from combat
|
||||
Effect effect = new RemoveFromCombatTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
effect.apply(game, source);
|
||||
|
||||
// Make blocked creatures unblocked
|
||||
|
|
|
@ -110,7 +110,7 @@ class InallaArchmageRitualistEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = ((FixedTarget) getTargetPointer()).getTargetedPermanentOrLKIBattlefield(game);
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(null, null, true);
|
||||
effect.setTargetPointer(getTargetPointer());
|
||||
|
|
|
@ -74,7 +74,7 @@ class IncongruityEffect extends OneShotEffect {
|
|||
// If the target creature is an illegal target by the time Incongruity tries to resolve, the spell doesn’t resolve.
|
||||
// No player creates a Frog Lizard token.
|
||||
// (2019-01-25)
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(targetPointer.getFirst(game, source)); // must use LKI
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); // must use LKI
|
||||
if (permanent != null) {
|
||||
FrogLizardToken token = new FrogLizardToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), permanent.getControllerId());
|
||||
|
|
|
@ -62,7 +62,7 @@ class InfernalJudgmentEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (permanent == null || player == null) {
|
||||
return false;
|
||||
|
|
|
@ -65,7 +65,7 @@ class JoragaInvocationEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game)) {
|
||||
ContinuousEffect effect = new MustBeBlockedByAtLeastOneTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -20,9 +18,9 @@ import mage.abilities.keyword.TrampleAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
@ -39,12 +37,13 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public final class KeldonBattlewagon extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("an untapped creature you control");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(TappedPredicate.instance));
|
||||
}
|
||||
|
||||
public KeldonBattlewagon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{5}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
|
||||
this.subtype.add(SubType.JUGGERNAUT);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(3);
|
||||
|
@ -90,13 +89,14 @@ class KeldonBattlewagonCost extends CostImpl {
|
|||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
if (target.choose(Outcome.Tap, controllerId, sourceId, game)) {
|
||||
for (UUID targetId: target.getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent == null)
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
paid |= permanent.tap(game);
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ class KeldonBattlewagonBoostEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent KeldonBattlewagon = game.getPermanent(source.getSourceId());
|
||||
Permanent tappedCreature = game.getPermanentOrLKIBattlefield(this.targetPointer.getFirst(game, source));
|
||||
Permanent tappedCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (tappedCreature != null && KeldonBattlewagon != null) {
|
||||
int amount = tappedCreature.getPower().getValue();
|
||||
game.addEffect(new BoostSourceEffect(amount, 0, Duration.EndOfTurn), source);
|
||||
|
|
|
@ -83,7 +83,7 @@ class KikiJikiMirrorBreakerEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
|
|
|
@ -68,7 +68,7 @@ class KitsunePalliatorEffect extends OneShotEffect {
|
|||
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
|
||||
for (Permanent permanent : permanents) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -12,7 +11,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -24,7 +22,7 @@ import mage.game.permanent.Permanent;
|
|||
public final class KreshTheBloodbraided extends CardImpl {
|
||||
|
||||
public KreshTheBloodbraided(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{R}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{R}{G}");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
|
@ -59,7 +57,7 @@ class KreshTheBloodbraidedEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Permanent kreshTheBloodbraided = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null && kreshTheBloodbraided != null) {
|
||||
int amount = permanent.getPower().getValue();
|
||||
|
|
|
@ -92,7 +92,7 @@ class LabyrinthRaptorEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(targetPointer.getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -10,7 +9,6 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.game.Game;
|
||||
|
@ -25,13 +23,13 @@ import mage.target.TargetPermanent;
|
|||
public final class LastBreath extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 2 or less");
|
||||
|
||||
static {
|
||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3));
|
||||
}
|
||||
|
||||
public LastBreath(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
|
||||
|
||||
// Exile target creature with power 2 or less. Its controller gains 4 life.
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
|
@ -51,6 +49,7 @@ public final class LastBreath extends CardImpl {
|
|||
}
|
||||
|
||||
class LastBreathEffect extends OneShotEffect {
|
||||
|
||||
LastBreathEffect() {
|
||||
super(Outcome.GainLife);
|
||||
staticText = "Its controller gains 4 life";
|
||||
|
@ -62,7 +61,7 @@ class LastBreathEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent target = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
|
||||
Permanent target = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (target != null) {
|
||||
Player player = game.getPlayer(target.getControllerId());
|
||||
if (player != null) {
|
||||
|
|
|
@ -67,7 +67,7 @@ class LifelineEffect extends OneShotEffect {
|
|||
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
if (card != null) {
|
||||
Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
effect.setText("return that card to the battlefield under it's owner's control at the beginning of the next end step");
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.ANY), source);
|
||||
return true;
|
||||
|
|
|
@ -61,7 +61,7 @@ class ManaEchoesEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (controller != null && permanent != null) {
|
||||
int foundCreatures = 0;
|
||||
for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
|
||||
|
|
|
@ -75,7 +75,7 @@ class MartyrsBondTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (permanent.isControlledBy(this.getControllerId()) && !permanent.isLand()) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ class MartyrsBondEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
List<UUID> perms = new ArrayList<>();
|
||||
if (source != null) {
|
||||
Permanent saccedPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
Permanent saccedPermanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && saccedPermanent != null) {
|
||||
FilterControlledPermanent filter = new FilterControlledPermanent();
|
||||
|
|
|
@ -168,7 +168,7 @@ class MasterWarcraftChooseAttackersEffect extends ContinuousRuleModifyingEffectI
|
|||
if (target.getTargets().contains(permanent.getId())) {
|
||||
RequirementEffect effect = new AttacksIfAbleTargetEffect(Duration.EndOfCombat);
|
||||
effect.setText("");
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
game.informPlayers(controller.getLogName() + " has decided that " + permanent.getLogName() + " attacks this combat if able");
|
||||
|
||||
|
@ -184,7 +184,7 @@ class MasterWarcraftChooseAttackersEffect extends ContinuousRuleModifyingEffectI
|
|||
if (!hasToAttack) {
|
||||
RestrictionEffect effect = new CantAttackTargetEffect(Duration.EndOfCombat);
|
||||
effect.setText("");
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue