mirror of
https://github.com/correl/mage.git
synced 2025-04-09 17:00:09 -09:00
* Enters battlefield, played land triggered abilities - fixed multiple rollback errors on missing target;
This commit is contained in:
parent
9cf1ee2f42
commit
49ea0205d0
18 changed files with 89 additions and 106 deletions
Mage.Sets/src/mage/cards
a
b
c
d
f
j
l
r
s
u
w
Mage/src/main/java/mage/abilities/common
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
@ -20,8 +18,9 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetOpponentOrPlaneswalker;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public final class AetherCharge extends CardImpl {
|
||||
|
@ -69,7 +68,7 @@ class AetherChargeTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isCreature() && permanent.hasSubtype(SubType.BEAST, game)
|
||||
if (permanent != null && permanent.isCreature() && permanent.hasSubtype(SubType.BEAST, game)
|
||||
&& permanent.isControlledBy(this.controllerId)) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setValue("damageSource", event.getTargetId());
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -16,14 +14,15 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Backfir3
|
||||
*/
|
||||
public final class AngelicChorus extends CardImpl {
|
||||
|
||||
public AngelicChorus(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{W}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}");
|
||||
|
||||
// Whenever a creature enters the battlefield under your control, you gain life equal to its toughness.
|
||||
this.addAbility(new AngelicChorusTriggeredAbility());
|
||||
|
@ -57,7 +56,8 @@ class AngelicChorusTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isCreature()
|
||||
if (permanent != null
|
||||
&& permanent.isCreature()
|
||||
&& permanent.isControlledBy(this.controllerId)) {
|
||||
this.getEffects().get(0).setValue("lifeSource", event.getTargetId());
|
||||
return true;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
|
@ -16,6 +14,8 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
|
@ -66,7 +66,8 @@ class ArchonOfRedemptionTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isControlledBy(getControllerId())
|
||||
if (permanent != null
|
||||
&& permanent.isControlledBy(getControllerId())
|
||||
&& permanent.isCreature()
|
||||
&& (permanent.getId().equals(getSourceId())
|
||||
|| (permanent.getAbilities().contains(FlyingAbility.getInstance())))) {
|
||||
|
|
|
@ -1,29 +1,28 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.SubType;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.PayCostToAttackBlockEffectImpl;
|
||||
import mage.abilities.effects.PayCostToAttackBlockEffectImpl.RestrictType;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class AwesomePresence extends CardImpl {
|
||||
|
@ -63,7 +62,7 @@ class AwesomePresenceRestrictionEffect extends PayCostToAttackBlockEffectImpl {
|
|||
+ " can't be blocked "
|
||||
+ "unless defending player pays "
|
||||
+ (manaCosts == null ? "" : manaCosts.getText()
|
||||
+ " for each creature they control that's blocking it");
|
||||
+ " for each creature they control that's blocking it");
|
||||
}
|
||||
|
||||
public AwesomePresenceRestrictionEffect(AwesomePresenceRestrictionEffect effect) {
|
||||
|
@ -77,13 +76,12 @@ class AwesomePresenceRestrictionEffect extends PayCostToAttackBlockEffectImpl {
|
|||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
if (blockingCreature != null
|
||||
&& enchantedAttackingCreature != null
|
||||
&& enchantment != null
|
||||
&& enchantment.isAttachedTo(enchantedAttackingCreature.getId())) {
|
||||
Player defendingPlayer = game.getPlayer(blockingCreature.getControllerId());
|
||||
if (defendingPlayer != null) {
|
||||
if (manaCosts.canPay(source, source.getSourceId(), defendingPlayer.getId(), game)
|
||||
&& manaCosts.pay(source, game, source.getSourceId(), defendingPlayer.getId(), false)) {
|
||||
return false;
|
||||
}
|
||||
return !manaCosts.canPay(source, source.getSourceId(), defendingPlayer.getId(), game)
|
||||
|| !manaCosts.pay(source, game, source.getSourceId(), defendingPlayer.getId(), false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -14,6 +12,8 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author duncant
|
||||
*/
|
||||
|
@ -54,7 +54,7 @@ class BurgeoningTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
return game.getOpponents(controllerId).contains(land.getControllerId());
|
||||
return land != null && game.getOpponents(controllerId).contains(land.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
|
@ -17,14 +14,16 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class CityOfTraitors extends CardImpl {
|
||||
|
||||
public CityOfTraitors(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
|
||||
// When you play another land, sacrifice City of Traitors.
|
||||
this.addAbility(new CityOfTraitorsTriggeredAbility());
|
||||
|
@ -61,7 +60,8 @@ class CityOfTraitorsTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
return land.isLand()
|
||||
return land != null
|
||||
&& land.isLand()
|
||||
&& land.isControlledBy(this.controllerId)
|
||||
&& !Objects.equals(event.getTargetId(), this.getSourceId());
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
|
@ -16,14 +14,15 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class DirtcowlWurm extends CardImpl {
|
||||
|
||||
public DirtcowlWurm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
|
||||
this.subtype.add(SubType.WURM);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(4);
|
||||
|
@ -59,7 +58,7 @@ class DirtcowlWurmTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
return game.getOpponents(controllerId).contains(land.getControllerId());
|
||||
return land != null && game.getOpponents(controllerId).contains(land.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -11,8 +9,8 @@ import mage.abilities.keyword.UndyingAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.EntersTheBattlefieldEvent;
|
||||
|
@ -22,14 +20,15 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public final class FlayerOfTheHatebound extends CardImpl {
|
||||
|
||||
public FlayerOfTheHatebound(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}");
|
||||
this.subtype.add(SubType.DEVIL);
|
||||
|
||||
this.power = new MageInt(4);
|
||||
|
@ -71,7 +70,8 @@ class FlayerTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD
|
||||
if (permanent != null
|
||||
&& ((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD
|
||||
&& permanent.isOwnedBy(controllerId)
|
||||
&& permanent.isCreature()) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesTappedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -9,19 +8,16 @@ import mage.abilities.effects.ReplacementEffectImpl;
|
|||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class FreyalisesWinds extends CardImpl {
|
||||
|
@ -73,8 +69,11 @@ class FreyalisesWindsReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanentUntapping = game.getPermanent(event.getTargetId());
|
||||
permanentUntapping.removeCounters(CounterType.WIND.createInstance(), game);
|
||||
return true;
|
||||
if (permanentUntapping != null) {
|
||||
permanentUntapping.removeCounters(CounterType.WIND.createInstance(), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.j;
|
||||
|
||||
import mage.MageInt;
|
||||
|
@ -27,7 +26,6 @@ import mage.target.common.TargetControlledPermanent;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class Jokulmorder extends CardImpl {
|
||||
|
@ -85,7 +83,8 @@ class JokulmorderTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
return land.hasSubtype(SubType.ISLAND, game)
|
||||
return land != null
|
||||
&& land.hasSubtype(SubType.ISLAND, game)
|
||||
&& land.isControlledBy(this.controllerId);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -18,15 +16,15 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LoneFox
|
||||
*/
|
||||
public final class LashknifeBarrier extends CardImpl {
|
||||
|
||||
public LashknifeBarrier(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
|
||||
// When Lashknife Barrier enters the battlefield, draw a card.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
|
||||
|
@ -79,7 +77,7 @@ class LashknifeBarrierEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent creature = game.getPermanent(event.getTargetId());
|
||||
return creature.isControlledBy(source.getControllerId());
|
||||
return creature != null && creature.isControlledBy(source.getControllerId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -12,8 +10,8 @@ import mage.abilities.keyword.EquipAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -22,23 +20,24 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class RoninWarclub extends CardImpl {
|
||||
|
||||
public RoninWarclub(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
this.subtype.add(SubType.EQUIPMENT);
|
||||
// Equipped creature gets +2/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 1)));
|
||||
|
||||
|
||||
// Whenever a creature enters the battlefield under your control, attach Ronin Warclub to that creature.
|
||||
Ability ability = new RoninWarclubTriggeredAbility();
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// Equip {5} ({5}: Attach to target creature you control. Equip only as a sorcery.)
|
||||
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(5)));
|
||||
}
|
||||
|
@ -51,11 +50,11 @@ public final class RoninWarclub extends CardImpl {
|
|||
public RoninWarclub copy() {
|
||||
return new RoninWarclub(this);
|
||||
}
|
||||
|
||||
|
||||
private class RoninWarclubTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public RoninWarclubTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new RoninWarclubAttachEffect(), false);
|
||||
super(Zone.BATTLEFIELD, new RoninWarclubAttachEffect(), false);
|
||||
}
|
||||
|
||||
public RoninWarclubTriggeredAbility(RoninWarclubTriggeredAbility ability) {
|
||||
|
@ -70,8 +69,9 @@ public final class RoninWarclub extends CardImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isCreature()
|
||||
&& (permanent.isControlledBy(this.controllerId))) {
|
||||
if (permanent != null
|
||||
&& permanent.isCreature()
|
||||
&& permanent.isControlledBy(this.controllerId)) {
|
||||
|
||||
if (!this.getTargets().isEmpty()) {
|
||||
// remove previous target
|
||||
|
@ -94,7 +94,7 @@ public final class RoninWarclub extends CardImpl {
|
|||
return new RoninWarclubTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class RoninWarclubAttachEffect extends OneShotEffect {
|
||||
|
||||
public RoninWarclubAttachEffect() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
|
@ -14,14 +15,12 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.WolfToken;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class SilverfurPartisan extends CardImpl {
|
||||
|
@ -79,8 +78,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI
|
|||
&& permanent.isControlledBy(this.controllerId)
|
||||
&& (permanent.hasSubtype(SubType.WOLF, game)
|
||||
|| permanent.hasSubtype(SubType.WEREWOLF, game))) {
|
||||
if (object instanceof Spell
|
||||
|| object instanceof StackObject) {
|
||||
if (object instanceof StackObject) {
|
||||
if (object.isInstant()
|
||||
|| object.isSorcery()) {
|
||||
if (getTargets().isEmpty()) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.u;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
@ -24,8 +22,9 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public final class UnconventionalTactics extends CardImpl {
|
||||
|
@ -91,12 +90,10 @@ class UnconventionalTacticsTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isCreature()
|
||||
return permanent != null
|
||||
&& permanent.isCreature()
|
||||
&& permanent.isControlledBy(this.controllerId)
|
||||
&& filter.match(permanent, game)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
&& filter.match(permanent, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.w;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
@ -18,14 +16,15 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class WarstormSurge extends CardImpl {
|
||||
|
||||
public WarstormSurge(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{5}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{R}");
|
||||
|
||||
// Whenever a creature enters the battlefield under your control, it deals damage equal to its power to any target.
|
||||
Ability ability = new WarstormSurgeTriggeredAbility();
|
||||
|
@ -61,7 +60,8 @@ class WarstormSurgeTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.isCreature()
|
||||
if (permanent != null
|
||||
&& permanent.isCreature()
|
||||
&& permanent.isControlledBy(this.controllerId)) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setValue("damageSource", event.getTargetId());
|
||||
|
|
|
@ -14,7 +14,6 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class ControllerPlaysLandTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
@ -35,7 +34,7 @@ public class ControllerPlaysLandTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
return land.getControllerId().equals(controllerId);
|
||||
return land != null && land.getControllerId().equals(controllerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,7 +13,6 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class OpponentPlaysLandTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
@ -34,7 +33,7 @@ public class OpponentPlaysLandTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
return game.getOpponents(controllerId).contains(land.getControllerId());
|
||||
return land != null && game.getOpponents(controllerId).contains(land.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.MageObject;
|
||||
|
@ -14,7 +12,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
|
@ -27,7 +24,7 @@ public class TurnedFaceUpAllTriggeredAbility extends TriggeredAbilityImpl {
|
|||
this(effect, filter, false);
|
||||
}
|
||||
|
||||
public TurnedFaceUpAllTriggeredAbility(Effect effect, FilterPermanent filter, boolean setTargetPointer) {
|
||||
public TurnedFaceUpAllTriggeredAbility(Effect effect, FilterPermanent filter, boolean setTargetPointer) {
|
||||
this(Zone.BATTLEFIELD, effect, filter, setTargetPointer, false);
|
||||
}
|
||||
|
||||
|
@ -60,7 +57,7 @@ public class TurnedFaceUpAllTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (!event.getTargetId().equals(getSourceId())) {
|
||||
MageObject sourceObj = this.getSourceObject(game);
|
||||
if (sourceObj != null) {
|
||||
if (sourceObj instanceof Card && ((Card)sourceObj).isFaceDown(game)) {
|
||||
if (sourceObj instanceof Card && ((Card) sourceObj).isFaceDown(game)) {
|
||||
// if face down and it's not itself that is turned face up, it does not trigger
|
||||
return false;
|
||||
}
|
||||
|
@ -70,9 +67,9 @@ public class TurnedFaceUpAllTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
}
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
|
||||
if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) {
|
||||
if (setTargetPointer) {
|
||||
for (Effect effect: getEffects()) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue