* Fixed cards with skip untap optional ability that cause game freezes (#5606)

This commit is contained in:
Oleg Agafonov 2019-03-01 18:10:32 +04:00
parent 4a14940414
commit 6846db75f4
169 changed files with 754 additions and 1172 deletions

View file

@ -1,7 +1,5 @@
package mage.cards.a; package mage.cards.a;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -18,8 +16,9 @@ import mage.game.permanent.Permanent;
import mage.watchers.common.CastSpellLastTurnWatcher; import mage.watchers.common.CastSpellLastTurnWatcher;
import mage.watchers.common.PlayerAttackedWatcher; import mage.watchers.common.PlayerAttackedWatcher;
import java.util.UUID;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public final class AngelicArbiter extends CardImpl { public final class AngelicArbiter extends CardImpl {
@ -67,15 +66,13 @@ class AngelicArbiterCantAttackTargetEffect extends RestrictionEffect {
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (game.isActivePlayer(permanent.getControllerId()) && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) { if (game.isActivePlayer(permanent.getControllerId()) && game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) {
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class); CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(permanent.getControllerId()) > 0) { return watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(permanent.getControllerId()) > 0;
return true;
}
} }
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@ -115,9 +112,7 @@ class AngelicArbiterEffect2 extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (game.isActivePlayer(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { if (game.isActivePlayer(event.getPlayerId()) && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
PlayerAttackedWatcher watcher = game.getState().getWatcher(PlayerAttackedWatcher.class); PlayerAttackedWatcher watcher = game.getState().getWatcher(PlayerAttackedWatcher.class);
if (watcher != null && watcher.getNumberOfAttackersCurrentTurn(event.getPlayerId()) > 0) { return watcher != null && watcher.getNumberOfAttackersCurrentTurn(event.getPlayerId()) > 0;
return true;
}
} }
return false; return false;
} }

View file

@ -58,7 +58,7 @@ class ArboriaEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (defenderId == null) { if (defenderId == null) {
return true; return true;
} }

View file

@ -1,5 +1,3 @@
package mage.cards.b; package mage.cards.b;
import mage.MageInt; import mage.MageInt;
@ -62,7 +60,7 @@ class BloodcrazedGoblinEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,4 +1,3 @@
package mage.cards.b; package mage.cards.b;
import mage.MageInt; import mage.MageInt;
@ -22,27 +21,26 @@ import mage.target.common.TargetCreaturePermanent;
import java.util.UUID; import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class BoldwyrIntimidator extends CardImpl { public final class BoldwyrIntimidator extends CardImpl {
public BoldwyrIntimidator(UUID ownerId, CardSetInfo setInfo) { public BoldwyrIntimidator(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");
this.subtype.add(SubType.GIANT, SubType.WARRIOR); this.subtype.add(SubType.GIANT, SubType.WARRIOR);
this.power = new MageInt(5); this.power = new MageInt(5);
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// Cowards can't block Warriors. // Cowards can't block Warriors.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoldwyrIntimidatorEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoldwyrIntimidatorEffect()));
// {R}: Target creature becomes a Coward until end of turn. // {R}: Target creature becomes a Coward until end of turn.
Effect effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, SubType.COWARD); Effect effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, SubType.COWARD);
effect.setText("Target creature becomes a Coward until end of turn"); effect.setText("Target creature becomes a Coward until end of turn");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{R}"));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
// {2}{R}: Target creature becomes a Warrior until end of turn. // {2}{R}: Target creature becomes a Warrior until end of turn.
effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, SubType.WARRIOR); effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, SubType.WARRIOR);
effect.setText("Target creature becomes a Warrior until end of turn"); effect.setText("Target creature becomes a Warrior until end of turn");
@ -75,14 +73,11 @@ class BoldwyrIntimidatorEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) { return sourcePermanent != null;
return true;
}
return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker != null && blocker != null) { if (attacker != null && blocker != null) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null && attacker.hasSubtype(SubType.WARRIOR, game)) { if (sourcePermanent != null && attacker.hasSubtype(SubType.WARRIOR, game)) {

View file

@ -1,7 +1,5 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -25,8 +23,9 @@ import mage.players.Player;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
import mage.watchers.common.CreaturesDiedWatcher; import mage.watchers.common.CreaturesDiedWatcher;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class BontuTheGlorified extends CardImpl { public final class BontuTheGlorified extends CardImpl {
@ -85,12 +84,12 @@ class BontuTheGlorifiedRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -14,13 +12,15 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
* @author noxx * @author noxx
*/ */
public final class BowerPassage extends CardImpl { public final class BowerPassage extends CardImpl {
public BowerPassage(UUID ownerId, CardSetInfo setInfo) { public BowerPassage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
// Creatures with flying can't block creatures you control. // Creatures with flying can't block creatures you control.
@ -59,11 +59,8 @@ class BowerPassageEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker != null && attacker.isControlledBy(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) { return attacker == null || !attacker.isControlledBy(source.getControllerId()) || !blocker.getAbilities().contains(FlyingAbility.getInstance());
return false;
}
return true;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,8 +8,8 @@ import mage.abilities.effects.common.combat.CantAttackIfDefenderControlsPermanen
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
@ -21,16 +19,19 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
* @author L_J * @author L_J
*/ */
public final class BrandedBrawlers extends CardImpl { public final class BrandedBrawlers extends CardImpl {
static final private FilterLandPermanent filter = new FilterLandPermanent("an untapped land"); static final private FilterLandPermanent filter = new FilterLandPermanent("an untapped land");
static { static {
filter.add(Predicates.not(TappedPredicate.instance)); filter.add(Predicates.not(TappedPredicate.instance));
} }
static final private String rule = "{this} can't block if you control an untapped land"; static final private String rule = "{this} can't block if you control an untapped land";
public BrandedBrawlers(UUID ownerId, CardSetInfo setInfo) { public BrandedBrawlers(UUID ownerId, CardSetInfo setInfo) {
@ -78,12 +79,10 @@ class BrandedBrawlersCantBlockEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
Player player = game.getPlayer(blocker.getControllerId()); Player player = game.getPlayer(blocker.getControllerId());
if (player != null) { if (player != null) {
if (game.getBattlefield().countAll(filter, player.getId(), game) > 0) { return game.getBattlefield().countAll(filter, player.getId(), game) <= 0;
return false;
}
} }
return true; return true;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -13,27 +10,24 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author Loki * @author Loki
*/ */
public final class CageOfHands extends CardImpl { public final class CageOfHands extends CardImpl {
public CageOfHands (UUID ownerId, CardSetInfo setInfo) { public CageOfHands(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.subtype.add(SubType.AURA); this.subtype.add(SubType.AURA);
// Enchant creature // Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
@ -48,7 +42,7 @@ public final class CageOfHands extends CardImpl {
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{1}{W}"))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{1}{W}")));
} }
public CageOfHands (final CageOfHands card) { public CageOfHands(final CageOfHands card) {
super(card); super(card);
} }
@ -71,19 +65,16 @@ class CageOfHandsEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getAttachments().contains((source.getSourceId()))) { return permanent.getAttachments().contains((source.getSourceId()));
return true; }
}
@Override
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}
@Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -20,6 +18,8 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* @author noxx * @author noxx
*/ */
@ -71,15 +71,13 @@ class CanopyCoverEffect extends RestrictionEffect {
Permanent equipment = game.getPermanent(source.getSourceId()); Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) { if (equipment != null && equipment.getAttachedTo() != null) {
Permanent equipped = game.getPermanent(equipment.getAttachedTo()); Permanent equipped = game.getPermanent(equipment.getAttachedTo());
if (equipped != null && permanent.getId().equals(equipped.getId())) { return equipped != null && permanent.getId().equals(equipped.getId());
return true;
}
} }
return false; return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance()); return blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance());
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -10,12 +8,13 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.constants.Zone;
import java.util.UUID;
/** /**
*
* @author TheElk801 * @author TheElk801
*/ */
public final class CavernsOfDespair extends CardImpl { public final class CavernsOfDespair extends CardImpl {
@ -64,7 +63,7 @@ class CavernsOfDespairAttackRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
return game.getCombat().getAttackers().size() < 2; return game.getCombat().getAttackers().size() < 2;
} }
} }
@ -91,7 +90,7 @@ class CavernsOfDespairBlockRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return game.getCombat().getBlockers().size() < 2; return game.getCombat().getBlockers().size() < 2;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,22 +8,23 @@ import mage.abilities.keyword.InfectAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
*
* @author North * @author North
*/ */
public final class ChainedThroatseeker extends CardImpl { public final class ChainedThroatseeker extends CardImpl {
public ChainedThroatseeker(UUID ownerId, CardSetInfo setInfo) { public ChainedThroatseeker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}");
this.subtype.add(SubType.HORROR); this.subtype.add(SubType.HORROR);
this.power = new MageInt(5); this.power = new MageInt(5);
@ -65,12 +64,10 @@ class ChainedThroatseekerCantAttackEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
Player targetPlayer = game.getPlayer(defenderId); Player targetPlayer = game.getPlayer(defenderId);
if (targetPlayer != null) { if (targetPlayer != null) {
if (targetPlayer.getCounters().containsKey(CounterType.POISON)) { return targetPlayer.getCounters().containsKey(CounterType.POISON);
return true;
}
} }
return false; return false;
} }

View file

@ -73,7 +73,7 @@ class ChampionOfLambholtEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null && attacker != null && attacker.isControlledBy(sourcePermanent.getControllerId())) { if (sourcePermanent != null && attacker != null && attacker.isControlledBy(sourcePermanent.getControllerId())) {
return blocker.getPower().getValue() >= sourcePermanent.getPower().getValue(); return blocker.getPower().getValue() >= sourcePermanent.getPower().getValue();

View file

@ -78,7 +78,7 @@ class ChaosphereEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.common.MetalcraftCondition; import mage.abilities.condition.common.MetalcraftCondition;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -17,8 +15,9 @@ import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetPlayerOrPlaneswalker; import mage.target.common.TargetPlayerOrPlaneswalker;
import java.util.UUID;
/** /**
*
* @author North * @author North
*/ */
public final class ConcussiveBolt extends CardImpl { public final class ConcussiveBolt extends CardImpl {
@ -89,14 +88,11 @@ class ConcussiveBoltRestrictionEffect extends RestrictionEffect {
if (player == null) { if (player == null) {
return false; return false;
} }
if (metalcraft && permanent.isControlledBy(player.getId())) { return metalcraft && permanent.isControlledBy(player.getId());
return true;
}
return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
} }

View file

@ -64,7 +64,7 @@ class CrownHunterHirelingCantAttackEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (defenderId == null) { if (defenderId == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -13,14 +11,15 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author Plopman * @author Plopman
*/ */
public final class CursedTotem extends CardImpl { public final class CursedTotem extends CardImpl {
public CursedTotem(UUID ownerId, CardSetInfo setInfo) { public CursedTotem(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
// Activated abilities of creatures can't be activated. // Activated abilities of creatures can't be activated.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CursedTotemCantActivateEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CursedTotemCantActivateEffect()));
@ -53,7 +52,7 @@ class CursedTotemCantActivateEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -20,14 +18,15 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlaneswalker; import mage.target.common.TargetCreatureOrPlaneswalker;
import java.util.UUID;
/** /**
*
* @author spjspj * @author spjspj
*/ */
public final class DeadlockTrap extends CardImpl { public final class DeadlockTrap extends CardImpl {
public DeadlockTrap(UUID ownerId, CardSetInfo setInfo) { public DeadlockTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Deadlock Trap enters the battlefield tapped. // Deadlock Trap enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility()); this.addAbility(new EntersBattlefieldTappedAbility());
@ -70,7 +69,7 @@ class DeadlockTrapCantActivateEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -15,14 +13,15 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class DeathcultRogue extends CardImpl { public final class DeathcultRogue extends CardImpl {
public DeathcultRogue(UUID ownerId, CardSetInfo setInfo) { public DeathcultRogue(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.HUMAN); this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE); this.subtype.add(SubType.ROGUE);
@ -44,7 +43,7 @@ public final class DeathcultRogue extends CardImpl {
} }
} }
class DeathcultRogueRestrictionEffect extends RestrictionEffect { class DeathcultRogueRestrictionEffect extends RestrictionEffect {
public DeathcultRogueRestrictionEffect() { public DeathcultRogueRestrictionEffect() {
super(Duration.WhileOnBattlefield); super(Duration.WhileOnBattlefield);
@ -57,18 +56,12 @@ class DeathcultRogueRestrictionEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { return permanent.getId().equals(source.getSourceId());
return true;
}
return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (blocker.hasSubtype(SubType.ROGUE, game)) { return blocker.hasSubtype(SubType.ROGUE, game);
return true;
}
return false;
} }
@Override @Override

View file

@ -62,7 +62,7 @@ class DenseCanopyCantBlockEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,23 +1,22 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
import mage.constants.SubType;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author TheElk801 * @author TheElk801
*/ */
public final class DesperateCastaways extends CardImpl { public final class DesperateCastaways extends CardImpl {
@ -61,17 +60,14 @@ class DesperateCastawaysEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { if (permanent.getId().equals(source.getSourceId())) {
if (game.getBattlefield().countAll(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT, source.getControllerId(), game) > 0) { return game.getBattlefield().countAll(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT, source.getControllerId(), game) <= 0;
return false;
}
return true;
} // do not apply to other creatures. } // do not apply to other creatures.
return false; return false;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.d; package mage.cards.d;
import java.util.Set;
import java.util.UUID;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -18,8 +15,10 @@ import mage.game.permanent.Permanent;
import mage.watchers.common.AttackedThisTurnWatcher; import mage.watchers.common.AttackedThisTurnWatcher;
import mage.watchers.common.BlockedThisTurnWatcher; import mage.watchers.common.BlockedThisTurnWatcher;
import java.util.Set;
import java.util.UUID;
/** /**
*
* @author Quercitron * @author Quercitron
*/ */
public final class DuelingGrounds extends CardImpl { public final class DuelingGrounds extends CardImpl {
@ -70,12 +69,12 @@ class NoMoreThanOneCreatureCanAttackEachTurnEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (!game.getCombat().getAttackers().isEmpty()) { if (!game.getCombat().getAttackers().isEmpty()) {
return false; return false;
} }
AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class); AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class);
if(watcher == null){ if (watcher == null) {
return false; return false;
} }
Set<MageObjectReference> attackedThisTurnCreatures = watcher.getAttackedThisTurnCreatures(); Set<MageObjectReference> attackedThisTurnCreatures = watcher.getAttackedThisTurnCreatures();
@ -107,12 +106,12 @@ class NoMoreThanOneCreatureCanBlockEachTurnEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (!game.getCombat().getBlockers().isEmpty()) { if (!game.getCombat().getBlockers().isEmpty()) {
return false; return false;
} }
BlockedThisTurnWatcher watcher = game.getState().getWatcher(BlockedThisTurnWatcher.class); BlockedThisTurnWatcher watcher = game.getState().getWatcher(BlockedThisTurnWatcher.class);
if(watcher == null){ if (watcher == null) {
return false; return false;
} }
Set<MageObjectReference> blockedThisTurnCreatures = watcher.getBlockedThisTurnCreatures(); Set<MageObjectReference> blockedThisTurnCreatures = watcher.getBlockedThisTurnCreatures();

View file

@ -1,7 +1,5 @@
package mage.cards.e; package mage.cards.e;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
@ -15,19 +13,16 @@ import mage.abilities.effects.common.combat.CantAttackTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.turn.Step; import mage.game.turn.Step;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class EdificeOfAuthority extends CardImpl { public final class EdificeOfAuthority extends CardImpl {
@ -133,24 +128,21 @@ class EdificeOfAuthorityRestrictionEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (this.targetPointer.getTargets(game, source).contains(permanent.getId())) { return this.targetPointer.getTargets(game, source).contains(permanent.getId());
return true; }
}
@Override
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.e; package mage.cards.e;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -14,8 +12,9 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
*
* @author Plopman * @author Plopman
*/ */
public final class EnsnaringBridge extends CardImpl { public final class EnsnaringBridge extends CardImpl {
@ -59,7 +58,7 @@ class EnsnaringBridgeRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.e; package mage.cards.e;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -19,8 +17,9 @@ import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.UUID;
/** /**
*
* @author TheElk801 & L_J * @author TheElk801 & L_J
*/ */
public final class EunuchsIntrigues extends CardImpl { public final class EunuchsIntrigues extends CardImpl {
@ -83,7 +82,7 @@ class EunuchsIntriguesEffect extends OneShotEffect {
} }
class EunuchsIntriguesRestrictionEffect extends RestrictionEffect { class EunuchsIntriguesRestrictionEffect extends RestrictionEffect {
protected UUID targetId; protected UUID targetId;
public EunuchsIntriguesRestrictionEffect(UUID targetId) { public EunuchsIntriguesRestrictionEffect(UUID targetId) {
@ -103,17 +102,11 @@ class EunuchsIntriguesRestrictionEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.isControlledBy(source.getFirstTarget())) { return permanent.isControlledBy(source.getFirstTarget());
return true;
}
return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (targetId != null && blocker.getId().equals(targetId)) { return targetId != null && blocker.getId().equals(targetId);
return true;
}
return false;
} }
} }

View file

@ -82,7 +82,7 @@ class CanBlockOnlySpaceflightEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.f; package mage.cards.f;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,19 +8,21 @@ import mage.abilities.keyword.SoulbondAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
* @author noxx * @author noxx
*/ */
public final class FloweringLumberknot extends CardImpl { public final class FloweringLumberknot extends CardImpl {
public FloweringLumberknot(UUID ownerId, CardSetInfo setInfo) { public FloweringLumberknot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add(SubType.TREEFOLK); this.subtype.add(SubType.TREEFOLK);
this.power = new MageInt(5); this.power = new MageInt(5);
@ -66,9 +66,8 @@ class FloweringLumberknotEffect extends RestrictionEffect {
break; break;
} }
} }
if (found) { // paired => can attack or block
return false;// paired => can attack or block return !found;
}
} }
} }
// can't attack or block // can't attack or block
@ -79,12 +78,12 @@ class FloweringLumberknotEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.g; package mage.cards.g;
import java.util.Set;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -18,8 +15,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.watchers.common.AttackedLastTurnWatcher; import mage.watchers.common.AttackedLastTurnWatcher;
import java.util.Set;
import java.util.UUID;
/** /**
*
* @author TheElk801 * @author TheElk801
*/ */
public final class GiantTurtle extends CardImpl { public final class GiantTurtle extends CardImpl {
@ -62,14 +61,12 @@ class CantAttackIfAttackedLastTurnEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
AttackedLastTurnWatcher watcher = game.getState().getWatcher(AttackedLastTurnWatcher.class); AttackedLastTurnWatcher watcher = game.getState().getWatcher(AttackedLastTurnWatcher.class);
if (watcher != null) { if (watcher != null) {
Set<MageObjectReference> attackingCreatures = watcher.getAttackedLastTurnCreatures(attacker.getControllerId()); Set<MageObjectReference> attackingCreatures = watcher.getAttackedLastTurnCreatures(attacker.getControllerId());
MageObjectReference mor = new MageObjectReference(attacker, game); MageObjectReference mor = new MageObjectReference(attacker, game);
if (attackingCreatures.contains(mor)) { return !attackingCreatures.contains(mor);
return false;
}
} }
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -18,14 +16,15 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class GlacialCrasher extends CardImpl { public final class GlacialCrasher extends CardImpl {
public GlacialCrasher(UUID ownerId, CardSetInfo setInfo) { public GlacialCrasher(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}");
this.subtype.add(SubType.ELEMENTAL); this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(5); this.power = new MageInt(5);
@ -71,16 +70,14 @@ class GlacialCrasherEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { if (permanent.getId().equals(source.getSourceId())) {
if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 1) { return game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 1;
return true;
}
} }
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -9,21 +7,22 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.watchers.common.PlayerCastCreatureWatcher; import mage.watchers.common.PlayerCastCreatureWatcher;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class GoblinCohort extends CardImpl { public final class GoblinCohort extends CardImpl {
public GoblinCohort(UUID ownerId, CardSetInfo setInfo) { public GoblinCohort(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.GOBLIN);
this.subtype.add(SubType.WARRIOR); this.subtype.add(SubType.WARRIOR);
@ -62,7 +61,7 @@ class GoblinCohortEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@ -70,9 +69,7 @@ class GoblinCohortEffect extends RestrictionEffect {
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { if (permanent.getId().equals(source.getSourceId())) {
PlayerCastCreatureWatcher watcher = game.getState().getWatcher(PlayerCastCreatureWatcher.class); PlayerCastCreatureWatcher watcher = game.getState().getWatcher(PlayerCastCreatureWatcher.class);
if (watcher != null && !watcher.playerDidCastCreatureThisTurn(source.getControllerId())) { return watcher != null && !watcher.playerDidCastCreatureThisTurn(source.getControllerId());
return true;
}
} }
return false; return false;
} }

View file

@ -63,7 +63,7 @@ class GoblinGoonCantAttackEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (defenderId == null) { if (defenderId == null) {
return true; return true;
} }
@ -110,7 +110,7 @@ class GoblinGoonCantBlockEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -19,8 +17,9 @@ import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.UUID;
/** /**
*
* @author TheElk801 & L_J * @author TheElk801 & L_J
*/ */
public final class GoblinWarCry extends CardImpl { public final class GoblinWarCry extends CardImpl {
@ -83,7 +82,7 @@ class GoblinWarCryEffect extends OneShotEffect {
} }
class GoblinWarCryRestrictionEffect extends RestrictionEffect { class GoblinWarCryRestrictionEffect extends RestrictionEffect {
protected UUID targetId; protected UUID targetId;
public GoblinWarCryRestrictionEffect(UUID targetId) { public GoblinWarCryRestrictionEffect(UUID targetId) {
@ -103,17 +102,11 @@ class GoblinWarCryRestrictionEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.isControlledBy(source.getFirstTarget())) { return permanent.isControlledBy(source.getFirstTarget());
return true;
}
return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (targetId != null && blocker.getId().equals(targetId)) { return targetId != null && blocker.getId().equals(targetId);
return true;
}
return false;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.g; package mage.cards.g;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -21,20 +19,21 @@ import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class GwafaHazidProfiteer extends CardImpl { public final class GwafaHazidProfiteer extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static { static {
filter.add(new ControllerPredicate(TargetController.NOT_YOU)); filter.add(new ControllerPredicate(TargetController.NOT_YOU));
} }
public GwafaHazidProfiteer(UUID ownerId, CardSetInfo setInfo) { public GwafaHazidProfiteer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{U}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE); this.subtype.add(SubType.ROGUE);
@ -47,10 +46,10 @@ public final class GwafaHazidProfiteer extends CardImpl {
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter)); ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability); this.addAbility(ability);
// Creatures with bribery counters on them can't attack or block. // Creatures with bribery counters on them can't attack or block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GwafaHazidProfiteerEffect2())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GwafaHazidProfiteerEffect2()));
} }
public GwafaHazidProfiteer(final GwafaHazidProfiteer card) { public GwafaHazidProfiteer(final GwafaHazidProfiteer card) {
@ -64,7 +63,7 @@ public final class GwafaHazidProfiteer extends CardImpl {
} }
class GwafaHazidProfiteerEffect1 extends OneShotEffect { class GwafaHazidProfiteerEffect1 extends OneShotEffect {
GwafaHazidProfiteerEffect1() { GwafaHazidProfiteerEffect1() {
super(Outcome.Detriment); super(Outcome.Detriment);
staticText = "Put a bribery counter on target creature you don't control. Its controller draws a card"; staticText = "Put a bribery counter on target creature you don't control. Its controller draws a card";
@ -113,12 +112,12 @@ class GwafaHazidProfiteerEffect2 extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.h; package mage.cards.h;
import java.util.Set;
import java.util.UUID;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -18,8 +15,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.watchers.common.AttackedLastTurnWatcher; import mage.watchers.common.AttackedLastTurnWatcher;
import java.util.Set;
import java.util.UUID;
/** /**
*
* @author L_J * @author L_J
*/ */
public final class HallsOfMist extends CardImpl { public final class HallsOfMist extends CardImpl {
@ -61,14 +60,12 @@ class CantAttackIfAttackedLastTurnAllEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
AttackedLastTurnWatcher watcher = game.getState().getWatcher(AttackedLastTurnWatcher.class); AttackedLastTurnWatcher watcher = game.getState().getWatcher(AttackedLastTurnWatcher.class);
if (watcher != null) { if (watcher != null) {
Set<MageObjectReference> attackingCreatures = watcher.getAttackedLastTurnCreatures(attacker.getControllerId()); Set<MageObjectReference> attackingCreatures = watcher.getAttackedLastTurnCreatures(attacker.getControllerId());
MageObjectReference mor = new MageObjectReference(attacker, game); MageObjectReference mor = new MageObjectReference(attacker, game);
if (attackingCreatures.contains(mor)) { return !attackingCreatures.contains(mor);
return false;
}
} }
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -17,15 +15,16 @@ import mage.filter.common.FilterLandPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
* @author North * @author North
*/ */
public final class HarborSerpent extends CardImpl { public final class HarborSerpent extends CardImpl {
public HarborSerpent(UUID ownerId, CardSetInfo setInfo) { public HarborSerpent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}");
this.subtype.add(SubType.SERPENT); this.subtype.add(SubType.SERPENT);
this.power = new MageInt(5); this.power = new MageInt(5);
@ -67,13 +66,13 @@ class HarborSerpentEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
return permanent.getId().equals(source.getSourceId()) && return permanent.getId().equals(source.getSourceId()) &&
game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 5; game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 5;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.AttacksTriggeredAbility;
@ -11,19 +9,20 @@ import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public final class HeroOfOxidRidge extends CardImpl { public final class HeroOfOxidRidge extends CardImpl {
public HeroOfOxidRidge(UUID ownerId, CardSetInfo setInfo) { public HeroOfOxidRidge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT); this.subtype.add(SubType.KNIGHT);
@ -68,7 +67,7 @@ class HeroOfOxidRidgeEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.h; package mage.cards.h;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleEvasionAbility; import mage.abilities.common.SimpleEvasionAbility;
@ -9,28 +7,29 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class HoodedHorror extends CardImpl { public final class HoodedHorror extends CardImpl {
public HoodedHorror(UUID ownerId, CardSetInfo setInfo) { public HoodedHorror(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.subtype.add(SubType.HORROR); this.subtype.add(SubType.HORROR);
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// Hooded Horror can't be blocked as long as defending player controls the most creatures or is tied for the most. // Hooded Horror can't be blocked as long as defending player controls the most creatures or is tied for the most.
this.addAbility(new SimpleEvasionAbility(new HoodedHorrorCantBeBlockedEffect())); this.addAbility(new SimpleEvasionAbility(new HoodedHorrorCantBeBlockedEffect()));
} }
public HoodedHorror(final HoodedHorror card) { public HoodedHorror(final HoodedHorror card) {
@ -58,28 +57,23 @@ class HoodedHorrorCantBeBlockedEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId()) && permanent.isAttacking()) { return permanent.getId().equals(source.getSourceId()) && permanent.isAttacking();
return true;
}
return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
int maxCreatures = 0; int maxCreatures = 0;
UUID playerIdWithMax = null; UUID playerIdWithMax = null;
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
int creatures = game.getBattlefield().countAll(filter, playerId, game); int creatures = game.getBattlefield().countAll(filter, playerId, game);
if (creatures > maxCreatures || (creatures == maxCreatures && playerId.equals(blocker.getControllerId())) ) { if (creatures > maxCreatures || (creatures == maxCreatures && playerId.equals(blocker.getControllerId()))) {
maxCreatures = creatures; maxCreatures = creatures;
playerIdWithMax = playerId; playerIdWithMax = playerId;
} }
} }
if (playerIdWithMax != null && playerIdWithMax.equals(blocker.getControllerId())) { return playerIdWithMax == null || !playerIdWithMax.equals(blocker.getControllerId());
return false;
}
} }
return true; return true;
} }

View file

@ -165,7 +165,7 @@ class IllusionistsGambitRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (defenderId == null) { if (defenderId == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.i; package mage.cards.i;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
@ -12,12 +10,7 @@ import mage.abilities.keyword.DefenderAbility;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
@ -27,20 +20,22 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class InfiltratorsMagemark extends CardImpl { public final class InfiltratorsMagemark extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control that are enchanted"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control that are enchanted");
static { static {
filter.add(EnchantedPredicate.instance); filter.add(EnchantedPredicate.instance);
filter.add(new ControllerPredicate(TargetController.YOU)); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public InfiltratorsMagemark(UUID ownerId, CardSetInfo setInfo) { public InfiltratorsMagemark(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
this.subtype.add(SubType.AURA); this.subtype.add(SubType.AURA);
@ -51,7 +46,7 @@ public final class InfiltratorsMagemark extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// Creatures you control that are enchanted get +1/+1 and can't be blocked except by creatures with defender. // Creatures you control that are enchanted get +1/+1 and can't be blocked except by creatures with defender.
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1,1, Duration.WhileOnBattlefield, filter, false)); ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false));
Effect effect = new InfiltratorsMagemarkCantBeBlockedAllEffect(filter, Duration.WhileOnBattlefield); Effect effect = new InfiltratorsMagemarkCantBeBlockedAllEffect(filter, Duration.WhileOnBattlefield);
ability.addEffect(effect); ability.addEffect(effect);
this.addAbility(ability); this.addAbility(ability);
@ -88,7 +83,7 @@ class InfiltratorsMagemarkCantBeBlockedAllEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return blocker.getAbilities().contains(DefenderAbility.getInstance()); return blocker.getAbilities().contains(DefenderAbility.getInstance());
} }

View file

@ -1,7 +1,5 @@
package mage.cards.i; package mage.cards.i;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -20,11 +18,11 @@ import mage.game.permanent.Permanent;
import mage.game.stack.StackAbility; import mage.game.stack.StackAbility;
import mage.game.stack.StackObject; import mage.game.stack.StackObject;
import mage.target.common.TargetActivatedAbility; import mage.target.common.TargetActivatedAbility;
import mage.target.common.TargetActivatedOrTriggeredAbility;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
*
* @author TheElk801 * @author TheElk801
*/ */
public final class Interdict extends CardImpl { public final class Interdict extends CardImpl {
@ -126,7 +124,7 @@ class InterdictCantActivateEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.i; package mage.cards.i;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
@ -13,23 +11,22 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class IntimidationBolt extends CardImpl { public final class IntimidationBolt extends CardImpl {
public IntimidationBolt(UUID ownerId, CardSetInfo setInfo) { public IntimidationBolt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}{W}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}{W}");
// Intimidation Bolt deals 3 damage to target creature. Other creatures can't attack this turn. // Intimidation Bolt deals 3 damage to target creature. Other creatures can't attack this turn.
this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addEffect(new DamageTargetEffect(3));
this.getSpellAbility().addEffect(new IntimidationEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new IntimidationEffect(Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }
public IntimidationBolt(final IntimidationBolt card) { public IntimidationBolt(final IntimidationBolt card) {
@ -55,14 +52,11 @@ class IntimidationEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (!permanent.getId().equals(source.getFirstTarget())) { return !permanent.getId().equals(source.getFirstTarget());
return true;
}
return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -66,7 +66,7 @@ class IronclawCurseEffect extends CantBlockAttachedEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,4 +1,3 @@
package mage.cards.k; package mage.cards.k;
import mage.MageObject; import mage.MageObject;
@ -25,7 +24,6 @@ import java.util.Optional;
import java.util.UUID; import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class KatabaticWinds extends CardImpl { public final class KatabaticWinds extends CardImpl {
@ -76,12 +74,12 @@ class KatabaticWindsRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@ -126,9 +124,7 @@ class KatabaticWindsRuleModifyingEffect extends ContinuousRuleModifyingEffectImp
&& object.isCreature() && object.isCreature()
&& object.getAbilities().contains(FlyingAbility.getInstance()) && object.getAbilities().contains(FlyingAbility.getInstance())
&& game.getState().getPlayersInRange(source.getControllerId(), game).contains(event.getPlayerId())) { && game.getState().getPlayersInRange(source.getControllerId(), game).contains(event.getPlayerId())) {
if (ability.get().getCosts().stream().anyMatch((cost) -> (cost instanceof TapSourceCost))) { return ability.get().getCosts().stream().anyMatch((cost) -> (cost instanceof TapSourceCost));
return true;
}
} }
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -15,20 +13,16 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class KefnetTheMindful extends CardImpl { public final class KefnetTheMindful extends CardImpl {
@ -83,12 +77,12 @@ class KefnetTheMindfulRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -19,21 +17,22 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class KrakenOfTheStraits extends CardImpl { public final class KrakenOfTheStraits extends CardImpl {
public KrakenOfTheStraits(UUID ownerId, CardSetInfo setInfo) { public KrakenOfTheStraits(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
this.subtype.add(SubType.KRAKEN); this.subtype.add(SubType.KRAKEN);
this.power = new MageInt(6); this.power = new MageInt(6);
this.toughness = new MageInt(6); this.toughness = new MageInt(6);
// Creatures with power less than the number of Islands you control can't block Kraken of the Straits. // Creatures with power less than the number of Islands you control can't block Kraken of the Straits.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByCreaturesWithLessPowerEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByCreaturesWithLessPowerEffect()));
} }
public KrakenOfTheStraits(final KrakenOfTheStraits card) { public KrakenOfTheStraits(final KrakenOfTheStraits card) {
@ -49,13 +48,13 @@ public final class KrakenOfTheStraits extends CardImpl {
class CantBeBlockedByCreaturesWithLessPowerEffect extends RestrictionEffect { class CantBeBlockedByCreaturesWithLessPowerEffect extends RestrictionEffect {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Islands"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Islands");
static { static {
filter.add(new SubtypePredicate(SubType.ISLAND)); filter.add(new SubtypePredicate(SubType.ISLAND));
} }
private final DynamicValue dynamicValue = new PermanentsOnBattlefieldCount(filter); private final DynamicValue dynamicValue = new PermanentsOnBattlefieldCount(filter);
public CantBeBlockedByCreaturesWithLessPowerEffect() { public CantBeBlockedByCreaturesWithLessPowerEffect() {
super(Duration.WhileOnBattlefield); super(Duration.WhileOnBattlefield);
staticText = "Creatures with power less than the number of Islands you control can't block {this}"; staticText = "Creatures with power less than the number of Islands you control can't block {this}";
@ -71,7 +70,7 @@ class CantBeBlockedByCreaturesWithLessPowerEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return blocker.getPower().getValue() >= dynamicValue.calculate(game, source, this); return blocker.getPower().getValue() >= dynamicValue.calculate(game, source, this);
} }

View file

@ -1,7 +1,5 @@
package mage.cards.k; package mage.cards.k;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,25 +8,22 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.WitherAbility; import mage.abilities.keyword.WitherAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
import mage.filter.predicate.permanent.CounterAnyPredicate; import mage.filter.predicate.permanent.CounterAnyPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class KulrathKnight extends CardImpl { public final class KulrathKnight extends CardImpl {
public KulrathKnight(UUID ownerId, CardSetInfo setInfo) { public KulrathKnight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B/R}{B/R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B/R}{B/R}");
this.subtype.add(SubType.ELEMENTAL); this.subtype.add(SubType.ELEMENTAL);
this.subtype.add(SubType.KNIGHT); this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(3); this.power = new MageInt(3);
@ -79,12 +74,12 @@ class KulrathKnightRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbility; import mage.abilities.TriggeredAbility;
@ -14,25 +12,21 @@ import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility; import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.ComparisonType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate; import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class LambholtPacifist extends CardImpl { public final class LambholtPacifist extends CardImpl {
public LambholtPacifist(UUID ownerId, CardSetInfo setInfo) { public LambholtPacifist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SHAMAN); this.subtype.add(SubType.SHAMAN);
this.subtype.add(SubType.WEREWOLF); this.subtype.add(SubType.WEREWOLF);
@ -84,17 +78,14 @@ class LambholtPacifistEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { if (permanent.getId().equals(source.getSourceId())) {
if (game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { return game.getBattlefield().countAll(filter, source.getControllerId(), game) <= 0;
return false;
}
return true;
} // do not apply to other creatures. } // do not apply to other creatures.
return false; return false;
} }

View file

@ -1,6 +1,5 @@
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -20,8 +19,9 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken; import mage.game.permanent.PermanentToken;
import java.util.UUID;
/** /**
*
* @author Plopman * @author Plopman
*/ */
public final class LegionLoyalist extends CardImpl { public final class LegionLoyalist extends CardImpl {
@ -75,18 +75,12 @@ class CantBeBlockedByTokenEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (affectedObjectList.contains(new MageObjectReference(permanent, game))) { return affectedObjectList.contains(new MageObjectReference(permanent, game));
return true;
}
return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (blocker instanceof PermanentToken) { return !(blocker instanceof PermanentToken);
return false;
}
return true;
} }
@Override @Override

View file

@ -1,7 +1,5 @@
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -9,16 +7,13 @@ import mage.abilities.effects.RestrictionEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author Loki * @author Loki
*/ */
public final class LinvalaKeeperOfSilence extends CardImpl { public final class LinvalaKeeperOfSilence extends CardImpl {
@ -66,7 +61,7 @@ class LinvalaKeeperOfSilenceCantActivateEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -9,21 +7,22 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class LupinePrototype extends CardImpl { public final class LupinePrototype extends CardImpl {
public LupinePrototype(UUID ownerId, CardSetInfo setInfo) { public LupinePrototype(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{2}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}");
this.subtype.add(SubType.WOLF); this.subtype.add(SubType.WOLF);
this.subtype.add(SubType.CONSTRUCT); this.subtype.add(SubType.CONSTRUCT);
this.power = new MageInt(5); this.power = new MageInt(5);
@ -69,12 +68,12 @@ class LupinePrototypeEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.m; package mage.cards.m;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,14 +8,15 @@ import mage.abilities.keyword.MonstrosityAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author Styxo * @author Styxo
*/ */
public final class MantellianSavrip extends CardImpl { public final class MantellianSavrip extends CardImpl {
@ -64,7 +63,7 @@ class MantellianSavripRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return (blocker.getPower().getValue() >= attacker.getPower().getValue()); return (blocker.getPower().getValue() >= attacker.getPower().getValue());
} }

View file

@ -78,7 +78,7 @@ class MirriWeatherlightDuelistBlockRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.m; package mage.cards.m;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -9,21 +7,22 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.watchers.common.PlayerCastCreatureWatcher; import mage.watchers.common.PlayerCastCreatureWatcher;
import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class MoggConscripts extends CardImpl { public final class MoggConscripts extends CardImpl {
public MoggConscripts(UUID ownerId, CardSetInfo setInfo) { public MoggConscripts(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.GOBLIN);
this.power = new MageInt(2); this.power = new MageInt(2);
@ -60,7 +59,7 @@ class MoggConscriptsEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@ -68,9 +67,7 @@ class MoggConscriptsEffect extends RestrictionEffect {
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { if (permanent.getId().equals(source.getSourceId())) {
PlayerCastCreatureWatcher watcher = game.getState().getWatcher(PlayerCastCreatureWatcher.class); PlayerCastCreatureWatcher watcher = game.getState().getWatcher(PlayerCastCreatureWatcher.class);
if (watcher != null && !watcher.playerDidCastCreatureThisTurn(source.getControllerId())) { return watcher != null && !watcher.playerDidCastCreatureThisTurn(source.getControllerId());
return true;
}
} }
return false; return false;
} }

View file

@ -62,7 +62,7 @@ class MoggToadyCantAttackEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (defenderId == null) { if (defenderId == null) {
return true; return true;
} }
@ -109,7 +109,7 @@ class MoggToadyCantBlockEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -70,7 +70,7 @@ class CantAttackUnlessControllerControlsMoreLandsEffect extends RestrictionEffec
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (defenderId == null) { if (defenderId == null) {
return true; return true;
} }
@ -118,7 +118,7 @@ class CantBlockUnlessControllerControlsMoreLandsEffect extends RestrictionEffect
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.m; package mage.cards.m;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -13,11 +11,13 @@ import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
* @author fireshoes * @author fireshoes
*/ */
@ -76,7 +76,7 @@ class MournwillowEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.n; package mage.cards.n;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -13,14 +11,15 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class NullRod extends CardImpl { public final class NullRod extends CardImpl {
public NullRod(UUID ownerId, CardSetInfo setInfo) { public NullRod(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
// Activated abilities of artifacts can't be activated. // Activated abilities of artifacts can't be activated.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NullRodCantActivateEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NullRodCantActivateEffect()));
@ -53,7 +52,7 @@ class NullRodCantActivateEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,16 +1,12 @@
package mage.cards.o; package mage.cards.o;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.combat.CantAttackBlockTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
@ -21,15 +17,16 @@ import mage.game.permanent.Permanent;
import mage.game.turn.Step; import mage.game.turn.Step;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author NinthWorld * @author NinthWorld
*/ */
public final class Occupation extends CardImpl { public final class Occupation extends CardImpl {
public Occupation(UUID ownerId, CardSetInfo setInfo) { public Occupation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{B}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{B}");
// Creatures your opponents control enter the battlefield tapped. // Creatures your opponents control enter the battlefield tapped.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OccupationTapEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OccupationTapEffect()));
@ -81,9 +78,7 @@ class OccupationTapEffect extends ReplacementEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
if (permanent != null && permanent.isCreature()) { return permanent != null && permanent.isCreature();
return true;
}
} }
return false; return false;
} }
@ -164,24 +159,21 @@ class OccupationRestrictionEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (this.targetPointer.getTargets(game, source).contains(permanent.getId())) { return this.targetPointer.getTargets(game, source).contains(permanent.getId());
return true; }
}
@Override
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.o; package mage.cards.o;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -13,12 +11,7 @@ import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.ComparisonType;
import mage.constants.Duration;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
@ -26,8 +19,9 @@ import mage.game.permanent.Permanent;
import mage.game.permanent.token.WarriorVigilantToken; import mage.game.permanent.token.WarriorVigilantToken;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class OketraTheTrue extends CardImpl { public final class OketraTheTrue extends CardImpl {
@ -80,12 +74,12 @@ class OketraTheTrueRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.o; package mage.cards.o;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -9,22 +7,23 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.filter.common.FilterBlockingCreature; import mage.filter.common.FilterBlockingCreature;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author icetc * @author icetc
*/ */
public final class Okk extends CardImpl { public final class Okk extends CardImpl {
public Okk(UUID ownerId, CardSetInfo setInfo) { public Okk(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.GOBLIN);
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
@ -65,7 +64,7 @@ class OkkAttackEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game) { public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@ -103,7 +102,7 @@ class OkkBlockEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlockCheckAfter(Ability source, Game game) { public boolean canBlockCheckAfter(Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,4 +1,3 @@
package mage.cards.o; package mage.cards.o;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -92,7 +91,7 @@ class OpenSeasonRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.o; package mage.cards.o;
import java.util.List;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -18,12 +15,7 @@ import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TurnPhase;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -35,8 +27,10 @@ import mage.target.common.TargetOpponent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import mage.watchers.common.AttackedThisTurnWatcher; import mage.watchers.common.AttackedThisTurnWatcher;
import java.util.List;
import java.util.UUID;
/** /**
*
* @author emerald000 * @author emerald000
*/ */
public final class OracleEnVec extends CardImpl { public final class OracleEnVec extends CardImpl {
@ -169,7 +163,7 @@ class OracleEnVecCantAttackRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,6 +1,5 @@
package mage.cards.p; package mage.cards.p;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.ContinuousRuleModifyingEffect; import mage.abilities.effects.ContinuousRuleModifyingEffect;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
@ -15,8 +14,9 @@ import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class PeaceTalks extends CardImpl { public final class PeaceTalks extends CardImpl {
@ -86,7 +86,7 @@ class PeaceTalksCantAttackEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@ -146,7 +146,7 @@ class PeaceTalksPlayersAndPermanentsCantBeTargetsOfSpellsOrActivatedAbilities ex
public PeaceTalksPlayersAndPermanentsCantBeTargetsOfSpellsOrActivatedAbilities copy() { public PeaceTalksPlayersAndPermanentsCantBeTargetsOfSpellsOrActivatedAbilities copy() {
return new PeaceTalksPlayersAndPermanentsCantBeTargetsOfSpellsOrActivatedAbilities(this); return new PeaceTalksPlayersAndPermanentsCantBeTargetsOfSpellsOrActivatedAbilities(this);
} }
@Override @Override
public boolean isInactive(Ability source, Game game) { public boolean isInactive(Ability source, Game game) {
if (startingTurn + 2 == game.getTurnNum()) { if (startingTurn + 2 == game.getTurnNum()) {

View file

@ -1,7 +1,5 @@
package mage.cards.p; package mage.cards.p;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -11,22 +9,19 @@ import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class Peacekeeper extends CardImpl { public final class Peacekeeper extends CardImpl {
public Peacekeeper(UUID ownerId, CardSetInfo setInfo) { public Peacekeeper(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN);
this.power = new MageInt(1); this.power = new MageInt(1);
@ -66,7 +61,7 @@ class PeacekeeperCantAttackEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.r; package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -17,14 +15,15 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author Loki * @author Loki
*/ */
public final class RecumbentBliss extends CardImpl { public final class RecumbentBliss extends CardImpl {
public RecumbentBliss(UUID ownerId, CardSetInfo setInfo) { public RecumbentBliss(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.subtype.add(SubType.AURA); this.subtype.add(SubType.AURA);
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
@ -59,19 +58,16 @@ class RecumbentBlissEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getAttachments().contains((source.getSourceId()))) { return permanent.getAttachments().contains((source.getSourceId()));
return true; }
}
@Override
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}
@Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.r; package mage.cards.r;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -26,6 +24,8 @@ import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* @author fireshoes * @author fireshoes
*/ */
@ -92,12 +92,12 @@ class RhonasTheIndomitableRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.r; package mage.cards.r;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -12,21 +10,22 @@ import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author stravant * @author stravant
*/ */
public final class RiverSerpent extends CardImpl { public final class RiverSerpent extends CardImpl {
public RiverSerpent(UUID ownerId, CardSetInfo setInfo) { public RiverSerpent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}");
this.subtype.add(SubType.SERPENT); this.subtype.add(SubType.SERPENT);
this.power = new MageInt(5); this.power = new MageInt(5);
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
@ -64,7 +63,7 @@ class RiverSerpentEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.r; package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -12,19 +9,20 @@ import mage.constants.Duration;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author Loki * @author Loki
*/ */
public final class RuthlessInvasion extends CardImpl { public final class RuthlessInvasion extends CardImpl {
public RuthlessInvasion (UUID ownerId, CardSetInfo setInfo) { public RuthlessInvasion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R/P}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R/P}");
this.getSpellAbility().addEffect(new RuthlessInvasionEffect()); this.getSpellAbility().addEffect(new RuthlessInvasionEffect());
} }
public RuthlessInvasion (final RuthlessInvasion card) { public RuthlessInvasion(final RuthlessInvasion card) {
super(card); super(card);
} }
@ -47,10 +45,7 @@ class RuthlessInvasionEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (!permanent.isArtifact()) { return !permanent.isArtifact();
return true;
}
return false;
} }
@Override @Override
@ -59,7 +54,7 @@ class RuthlessInvasionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.Objects;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -11,21 +8,23 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.Objects;
import java.util.UUID;
/** /**
*
* @author Derpthemeus * @author Derpthemeus
*/ */
public final class ScarredPuma extends CardImpl { public final class ScarredPuma extends CardImpl {
public ScarredPuma(UUID ownerId, CardSetInfo setInfo) { public ScarredPuma(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
this.subtype.add(SubType.CAT); this.subtype.add(SubType.CAT);
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
@ -62,7 +61,7 @@ public final class ScarredPuma extends CardImpl {
} }
@Override @Override
public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game) { public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -15,42 +13,36 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author Saga * @author Saga
*/ */
public final class ShaukuEndbringer extends CardImpl{ public final class ShaukuEndbringer extends CardImpl {
public ShaukuEndbringer(UUID ownerId, CardSetInfo setInfo) { public ShaukuEndbringer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}{B}");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.VAMPIRE); this.subtype.add(SubType.VAMPIRE);
this.power = new MageInt(5); this.power = new MageInt(5);
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Shauku, Endbringer can't attack if there's another creature on the battlefield. // Shauku, Endbringer can't attack if there's another creature on the battlefield.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShaukuEndbringerEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShaukuEndbringerEffect()));
// At the beginning of your upkeep, you lose 3 life. // At the beginning of your upkeep, you lose 3 life.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(3), TargetController.YOU, false)); this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(3), TargetController.YOU, false));
// {T}: Exile target creature and put a +1/+1 counter on Shauku. // {T}: Exile target creature and put a +1/+1 counter on Shauku.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new TapSourceCost());
ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance())); ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
@ -68,13 +60,14 @@ public final class ShaukuEndbringer extends CardImpl{
} }
} }
class ShaukuEndbringerEffect extends RestrictionEffect { class ShaukuEndbringerEffect extends RestrictionEffect {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static { static {
filter.add(AnotherPredicate.instance); filter.add(AnotherPredicate.instance);
} }
public ShaukuEndbringerEffect() { public ShaukuEndbringerEffect() {
super(Duration.WhileOnBattlefield); super(Duration.WhileOnBattlefield);
staticText = "{this} can't attack if there's another creature on the battlefield."; staticText = "{this} can't attack if there's another creature on the battlefield.";
@ -90,13 +83,13 @@ public final class ShaukuEndbringer extends CardImpl{
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
return permanent.getId().equals(source.getSourceId()) && return permanent.getId().equals(source.getSourceId()) &&
game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0; game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -14,11 +12,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect; import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
@ -27,28 +21,28 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** import java.util.UUID;
*
* @author jeffwadsworth
/**
* @author jeffwadsworth
*/ */
public final class ShrewdHatchling extends CardImpl { public final class ShrewdHatchling extends CardImpl {
private static final FilterSpell filter = new FilterSpell("blue spell"); private static final FilterSpell filter = new FilterSpell("blue spell");
private static final FilterSpell filter2 = new FilterSpell("red spell"); private static final FilterSpell filter2 = new FilterSpell("red spell");
static { static {
filter.add(new ControllerPredicate(TargetController.YOU)); filter.add(new ControllerPredicate(TargetController.YOU));
filter.add(new ColorPredicate(ObjectColor.BLUE)); filter.add(new ColorPredicate(ObjectColor.BLUE));
filter2.add(new ControllerPredicate(TargetController.YOU)); filter2.add(new ControllerPredicate(TargetController.YOU));
filter2.add(new ColorPredicate(ObjectColor.RED)); filter2.add(new ColorPredicate(ObjectColor.RED));
} }
private String rule = "Whenever you cast a blue spell, remove a -1/-1 counter from Shrewd Hatchling."; private String rule = "Whenever you cast a blue spell, remove a -1/-1 counter from Shrewd Hatchling.";
private String rule2 = "Whenever you cast a red spell, remove a -1/-1 counter from Shrewd Hatchling."; private String rule2 = "Whenever you cast a red spell, remove a -1/-1 counter from Shrewd Hatchling.";
public ShrewdHatchling(UUID ownerId, CardSetInfo setInfo) { public ShrewdHatchling(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U/R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U/R}");
this.subtype.add(SubType.ELEMENTAL); this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(6); this.power = new MageInt(6);
@ -56,18 +50,18 @@ public final class ShrewdHatchling extends CardImpl {
// Shrewd Hatchling enters the battlefield with four -1/-1 counters on it. // Shrewd Hatchling enters the battlefield with four -1/-1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)))); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4))));
// {UR}: Target creature can't block Shrewd Hatchling this turn. // {UR}: Target creature can't block Shrewd Hatchling this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShrewdHatchlingEffect(), new ManaCostsImpl("{U/R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShrewdHatchlingEffect(), new ManaCostsImpl("{U/R}"));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
// Whenever you cast a blue spell, remove a -1/-1 counter from Shrewd Hatchling. // Whenever you cast a blue spell, remove a -1/-1 counter from Shrewd Hatchling.
this.addAbility(new SpellCastAllTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filter, false, rule)); this.addAbility(new SpellCastAllTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filter, false, rule));
// Whenever you cast a red spell, remove a -1/-1 counter from Shrewd Hatchling. // Whenever you cast a red spell, remove a -1/-1 counter from Shrewd Hatchling.
this.addAbility(new SpellCastAllTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filter2, false, rule2)); this.addAbility(new SpellCastAllTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filter2, false, rule2));
} }
public ShrewdHatchling(final ShrewdHatchling card) { public ShrewdHatchling(final ShrewdHatchling card) {
@ -93,18 +87,13 @@ class ShrewdHatchlingEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { return permanent.getId().equals(source.getSourceId());
return true;
}
return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
UUID targetId = source.getFirstTarget(); UUID targetId = source.getFirstTarget();
if (targetId != null && blocker.getId().equals(targetId)) return targetId == null || !blocker.getId().equals(targetId);
return false;
return true;
} }
@Override @Override

View file

@ -88,7 +88,7 @@ class SidarKondoOfJamuraaCantBlockCreaturesSourceEffect extends RestrictionEffec
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.List;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,22 +7,24 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.watchers.common.SpellsCastWatcher; import mage.watchers.common.SpellsCastWatcher;
import java.util.List;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class SilburlindSnapper extends CardImpl { public final class SilburlindSnapper extends CardImpl {
public SilburlindSnapper(UUID ownerId, CardSetInfo setInfo) { public SilburlindSnapper(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}");
this.subtype.add(SubType.TURTLE); this.subtype.add(SubType.TURTLE);
this.power = new MageInt(6); this.power = new MageInt(6);
this.toughness = new MageInt(6); this.toughness = new MageInt(6);
@ -61,8 +60,7 @@ class SilburlindSnapperEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -9,27 +7,28 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author emerald000 * @author emerald000
*/ */
public final class SilentArbiter extends CardImpl { public final class SilentArbiter extends CardImpl {
public SilentArbiter(UUID ownerId, CardSetInfo setInfo) { public SilentArbiter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{4}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
this.subtype.add(SubType.CONSTRUCT); this.subtype.add(SubType.CONSTRUCT);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// No more than one creature can attack each combat. // No more than one creature can attack each combat.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SilentArbiterAttackRestrictionEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SilentArbiterAttackRestrictionEffect()));
// No more than one creature can block each combat. // No more than one creature can block each combat.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SilentArbiterBlockRestrictionEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SilentArbiterBlockRestrictionEffect()));
} }
@ -45,55 +44,55 @@ public final class SilentArbiter extends CardImpl {
} }
class SilentArbiterAttackRestrictionEffect extends RestrictionEffect { class SilentArbiterAttackRestrictionEffect extends RestrictionEffect {
SilentArbiterAttackRestrictionEffect() { SilentArbiterAttackRestrictionEffect() {
super(Duration.WhileOnBattlefield); super(Duration.WhileOnBattlefield);
staticText = "No more than one creature can attack each combat"; staticText = "No more than one creature can attack each combat";
} }
SilentArbiterAttackRestrictionEffect(final SilentArbiterAttackRestrictionEffect effect) { SilentArbiterAttackRestrictionEffect(final SilentArbiterAttackRestrictionEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public SilentArbiterAttackRestrictionEffect copy() { public SilentArbiterAttackRestrictionEffect copy() {
return new SilentArbiterAttackRestrictionEffect(this); return new SilentArbiterAttackRestrictionEffect(this);
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
return true; return true;
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
return game.getCombat().getAttackers().isEmpty(); return game.getCombat().getAttackers().isEmpty();
} }
} }
class SilentArbiterBlockRestrictionEffect extends RestrictionEffect { class SilentArbiterBlockRestrictionEffect extends RestrictionEffect {
SilentArbiterBlockRestrictionEffect() { SilentArbiterBlockRestrictionEffect() {
super(Duration.WhileOnBattlefield); super(Duration.WhileOnBattlefield);
staticText = "No more than one creature can block each combat"; staticText = "No more than one creature can block each combat";
} }
SilentArbiterBlockRestrictionEffect(final SilentArbiterBlockRestrictionEffect effect) { SilentArbiterBlockRestrictionEffect(final SilentArbiterBlockRestrictionEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public SilentArbiterBlockRestrictionEffect copy() { public SilentArbiterBlockRestrictionEffect copy() {
return new SilentArbiterBlockRestrictionEffect(this); return new SilentArbiterBlockRestrictionEffect(this);
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
return true; return true;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return game.getCombat().getBlockers().isEmpty(); return game.getCombat().getBlockers().isEmpty();
} }
} }

View file

@ -1,8 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -12,20 +9,21 @@ import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class SilhanaLedgewalker extends CardImpl { public final class SilhanaLedgewalker extends CardImpl {
public SilhanaLedgewalker (UUID ownerId, CardSetInfo setInfo) { public SilhanaLedgewalker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add(SubType.ELF); this.subtype.add(SubType.ELF);
this.subtype.add(SubType.ROGUE); this.subtype.add(SubType.ROGUE);
@ -39,7 +37,7 @@ public final class SilhanaLedgewalker extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SilhanaLedgewalkerEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SilhanaLedgewalkerEffect()));
} }
public SilhanaLedgewalker (final SilhanaLedgewalker card) { public SilhanaLedgewalker(final SilhanaLedgewalker card) {
super(card); super(card);
} }
@ -63,18 +61,12 @@ class SilhanaLedgewalkerEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (source.getSourceId().equals(permanent.getId())) { return source.getSourceId().equals(permanent.getId());
return true;
}
return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (blocker.getAbilities().contains(FlyingAbility.getInstance())) { return blocker.getAbilities().contains(FlyingAbility.getInstance());
return true;
}
return false;
} }
@Override @Override

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
@ -15,21 +13,22 @@ import mage.constants.*;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class SkyblinderStaff extends CardImpl { public final class SkyblinderStaff extends CardImpl {
public SkyblinderStaff(UUID ownerId, CardSetInfo setInfo) { public SkyblinderStaff(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
this.subtype.add(SubType.EQUIPMENT); this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +1/+0 and can't be blocked by creatures with flying. // Equipped creature gets +1/+0 and can't be blocked by creatures with flying.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0)); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0));
ability.addEffect(new CantBeBlockedByCreaturesWithFlyingAttachedEffect()); ability.addEffect(new CantBeBlockedByCreaturesWithFlyingAttachedEffect());
this.addAbility(ability); this.addAbility(ability);
// Equip {3} // Equip {3}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(3))); this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(3)));
@ -63,7 +62,7 @@ class CantBeBlockedByCreaturesWithFlyingAttachedEffect extends RestrictionEffect
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return !blocker.getAbilities().contains(FlyingAbility.getInstance()); return !blocker.getAbilities().contains(FlyingAbility.getInstance());
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.AttacksAllTriggeredAbility; import mage.abilities.common.AttacksAllTriggeredAbility;
@ -11,18 +9,15 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class SlumberingDragon extends CardImpl { public final class SlumberingDragon extends CardImpl {
@ -68,22 +63,19 @@ class SlumberingDragonEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { if (permanent.getId().equals(source.getSourceId())) {
if (permanent.getCounters(game).getCount(CounterType.P1P1) >= 5) { return permanent.getCounters(game).getCount(CounterType.P1P1) < 5;
return false;
}
return true;
} }
// don't apply for all other creatures! // don't apply for all other creatures!
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -15,8 +13,9 @@ import mage.filter.predicate.permanent.EnchantedPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class SongOfSerenity extends CardImpl { public final class SongOfSerenity extends CardImpl {
@ -62,12 +61,12 @@ class SongOfSerenityRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -10,21 +8,22 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public final class SpinEngine extends CardImpl { public final class SpinEngine extends CardImpl {
public SpinEngine(UUID ownerId, CardSetInfo setInfo) { public SpinEngine(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
this.subtype.add(SubType.CONSTRUCT); this.subtype.add(SubType.CONSTRUCT);
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
@ -59,18 +58,13 @@ class SpinEngineEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { return permanent.getId().equals(source.getSourceId());
return true;
}
return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
UUID targetId = source.getFirstTarget(); UUID targetId = source.getFirstTarget();
if (targetId != null && blocker.getId().equals(targetId)) return targetId == null || !blocker.getId().equals(targetId);
return false;
return true;
} }
@Override @Override

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -11,20 +9,21 @@ import mage.abilities.keyword.ReachAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class SpireTracer extends CardImpl { public final class SpireTracer extends CardImpl {
public SpireTracer(UUID ownerId, CardSetInfo setInfo) { public SpireTracer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
this.subtype.add(SubType.ELF); this.subtype.add(SubType.ELF);
this.subtype.add(SubType.SCOUT); this.subtype.add(SubType.SCOUT);
@ -59,19 +58,13 @@ class CantBeBlockedExceptByCreaturesWithFlyingOrReachEffect extends RestrictionE
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { return permanent.getId().equals(source.getSourceId());
return true;
}
return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (blocker.getAbilities().containsKey(FlyingAbility.getInstance().getId()) return blocker.getAbilities().containsKey(FlyingAbility.getInstance().getId())
|| blocker.getAbilities().containsKey(ReachAbility.getInstance().getId())) { || blocker.getAbilities().containsKey(ReachAbility.getInstance().getId());
return true;
}
return false;
} }
@Override @Override

View file

@ -61,7 +61,7 @@ class SpitfireHandlerCantBlockEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) { if (attacker == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -9,8 +7,8 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
@ -18,14 +16,15 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author Plopman * @author Plopman
*/ */
public final class SteelcladSerpent extends CardImpl { public final class SteelcladSerpent extends CardImpl {
public SteelcladSerpent(UUID ownerId, CardSetInfo setInfo) { public SteelcladSerpent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{5}{U}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}{U}");
this.subtype.add(SubType.SERPENT); this.subtype.add(SubType.SERPENT);
this.power = new MageInt(4); this.power = new MageInt(4);
@ -48,7 +47,7 @@ public final class SteelcladSerpent extends CardImpl {
class SteelcladSerpentEffect extends RestrictionEffect { class SteelcladSerpentEffect extends RestrictionEffect {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("another artifact"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("another artifact");
static { static {
filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(AnotherPredicate.instance); filter.add(AnotherPredicate.instance);
@ -69,18 +68,15 @@ class SteelcladSerpentEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { if (permanent.getId().equals(source.getSourceId())) {
if (!game.getBattlefield().getActivePermanents(filter, source.getControllerId(), permanent.getId(), game).isEmpty()) { return game.getBattlefield().getActivePermanents(filter, source.getControllerId(), permanent.getId(), game).isEmpty();
return false; }
}
return true;
}
return false; return false;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -13,14 +11,15 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author BetaSteward * @author BetaSteward
*/ */
public final class StonySilence extends CardImpl { public final class StonySilence extends CardImpl {
public StonySilence(UUID ownerId, CardSetInfo setInfo) { public StonySilence(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
// Activated abilities of artifacts can't be activated. // Activated abilities of artifacts can't be activated.
@ -55,7 +54,7 @@ class StonySilenceCantActivateEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,9 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -19,8 +15,11 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class StorageMatrix extends CardImpl { public final class StorageMatrix extends CardImpl {
@ -53,6 +52,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect {
choice.add(CardType.CREATURE.toString()); choice.add(CardType.CREATURE.toString());
choice.add(CardType.LAND.toString()); choice.add(CardType.LAND.toString());
} }
private CardType type; private CardType type;
public StorageMatrixRestrictionEffect() { public StorageMatrixRestrictionEffect() {
@ -104,7 +104,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBeUntapped(Permanent permanent, Ability source, Game game) { public boolean canBeUntapped(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -11,24 +9,21 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class StupefyingTouch extends CardImpl { public final class StupefyingTouch extends CardImpl {
public StupefyingTouch(UUID ownerId, CardSetInfo setInfo) { public StupefyingTouch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
this.subtype.add(SubType.AURA); this.subtype.add(SubType.AURA);
// Enchant creature // Enchant creature
@ -37,10 +32,10 @@ public final class StupefyingTouch extends CardImpl {
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// When Stupefying Touch enters the battlefield, draw a card. // When Stupefying Touch enters the battlefield, draw a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false));
// Enchanted creature's activated abilities can't be activated. // Enchanted creature's activated abilities can't be activated.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantActivateAbilitiesAttachedEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantActivateAbilitiesAttachedEffect()));
} }
@ -70,15 +65,13 @@ class CantActivateAbilitiesAttachedEffect extends RestrictionEffect {
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent enchantment = game.getPermanent(source.getSourceId()); Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null && enchantment.getAttachedTo() != null) { if (enchantment != null && enchantment.getAttachedTo() != null) {
if (permanent.getId().equals(enchantment.getAttachedTo())) { return permanent.getId().equals(enchantment.getAttachedTo());
return true;
}
} }
return false; return false;
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -64,7 +64,7 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (defenderId == null) { if (defenderId == null) {
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -12,18 +10,15 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.UUID;
/** /**
*
* @author L_J * @author L_J
*/ */
public final class TheFallenApart extends CardImpl { public final class TheFallenApart extends CardImpl {
@ -162,7 +157,7 @@ class TheFallenApartRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
MageObject mageObject = game.getObject(source.getSourceId()); MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) { if (mageObject != null) {
return (Integer) game.getState().getValue(mageObject.getId() + "_arms") > 0; return (Integer) game.getState().getValue(mageObject.getId() + "_arms") > 0;
@ -171,7 +166,7 @@ class TheFallenApartRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
MageObject mageObject = game.getObject(source.getSourceId()); MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) { if (mageObject != null) {
return (Integer) game.getState().getValue(mageObject.getId() + "_legs") > 0; return (Integer) game.getState().getValue(mageObject.getId() + "_legs") > 0;

View file

@ -1,7 +1,5 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -16,18 +14,15 @@ import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.UUID;
/** /**
*
* @author L_J * @author L_J
*/ */
public final class Togglodyte extends CardImpl { public final class Togglodyte extends CardImpl {
@ -144,12 +139,12 @@ class TogglodyteRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@ -178,9 +173,7 @@ class TogglodytePreventionEffect extends PreventionEffectImpl {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (super.applies(event, source, game)) { if (super.applies(event, source, game)) {
if (event.getSourceId().equals(source.getSourceId())) { return event.getSourceId().equals(source.getSourceId());
return true;
}
} }
return false; return false;
} }

View file

@ -1,8 +1,5 @@
package mage.cards.t; package mage.cards.t;
import java.util.List;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,20 +7,22 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.List;
import java.util.UUID;
/** /**
*
* @author North * @author North
*/ */
public final class TrainingDrone extends CardImpl { public final class TrainingDrone extends CardImpl {
public TrainingDrone(UUID ownerId, CardSetInfo setInfo) { public TrainingDrone(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
this.subtype.add(SubType.DRONE); this.subtype.add(SubType.DRONE);
this.power = new MageInt(4); this.power = new MageInt(4);
@ -71,12 +70,12 @@ class TrainingDroneEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,6 +1,5 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -17,10 +16,10 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author Jason E. Wall * @author Jason E. Wall
*
*/ */
public final class TreetopBracers extends CardImpl { public final class TreetopBracers extends CardImpl {
@ -67,15 +66,13 @@ class TreetopBracersRestrictEffect extends RestrictionEffect {
Permanent equipment = game.getPermanent(source.getSourceId()); Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) { if (equipment != null && equipment.getAttachedTo() != null) {
Permanent equipped = game.getPermanent(equipment.getAttachedTo()); Permanent equipped = game.getPermanent(equipment.getAttachedTo());
if (permanent != null && permanent.getId().equals(equipped.getId())) { return permanent != null && permanent.getId().equals(equipped.getId());
return true;
}
} }
return false; return false;
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance()); return blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance());
} }

View file

@ -1,7 +1,5 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
@ -17,14 +15,15 @@ import mage.game.stack.StackObject;
import mage.target.common.TargetActivatedOrTriggeredAbility; import mage.target.common.TargetActivatedOrTriggeredAbility;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class Trickbind extends CardImpl { public final class Trickbind extends CardImpl {
public Trickbind(UUID ownerId, CardSetInfo setInfo) { public Trickbind(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Split second // Split second
@ -64,7 +63,7 @@ class TrickbindCounterEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget());
if(stackObject != null && game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) { if (stackObject != null && game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
TrickbindCantActivateEffect effect = new TrickbindCantActivateEffect(); TrickbindCantActivateEffect effect = new TrickbindCantActivateEffect();
effect.setTargetPointer(new FixedTarget(stackObject.getSourceId())); effect.setTargetPointer(new FixedTarget(stackObject.getSourceId()));
game.getContinuousEffects().addEffect(effect, source); game.getContinuousEffects().addEffect(effect, source);
@ -92,7 +91,7 @@ class TrickbindCantActivateEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }

View file

@ -1,9 +1,5 @@
package mage.cards.t; package mage.cards.t;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -24,8 +20,11 @@ import mage.game.Game;
import mage.game.combat.CombatGroup; import mage.game.combat.CombatGroup;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class Tromokratis extends CardImpl { public final class Tromokratis extends CardImpl {
@ -78,7 +77,7 @@ class CantBeBlockedUnlessAllEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
// check if all creatures of defender are able to block this permanent // check if all creatures of defender are able to block this permanent
// permanent.canBlock() can't be used because causing recursive call // permanent.canBlock() can't be used because causing recursive call
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, blocker.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, blocker.getControllerId(), game)) {
@ -88,7 +87,7 @@ class CantBeBlockedUnlessAllEffect extends RestrictionEffect {
// check blocker restrictions // check blocker restrictions
for (Map.Entry<RestrictionEffect, Set<Ability>> entry : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game).entrySet()) { for (Map.Entry<RestrictionEffect, Set<Ability>> entry : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game).entrySet()) {
for (Ability ability : entry.getValue()) { for (Ability ability : entry.getValue()) {
if (!entry.getKey().canBlock(attacker, permanent, ability, game)) { if (!entry.getKey().canBlock(attacker, permanent, ability, game, canUseChooseDialogs)) {
return false; return false;
} }
} }
@ -97,7 +96,7 @@ class CantBeBlockedUnlessAllEffect extends RestrictionEffect {
for (Map.Entry<RestrictionEffect, Set<Ability>> restrictionEntry : game.getContinuousEffects().getApplicableRestrictionEffects(attacker, game).entrySet()) { for (Map.Entry<RestrictionEffect, Set<Ability>> restrictionEntry : game.getContinuousEffects().getApplicableRestrictionEffects(attacker, game).entrySet()) {
for (Ability ability : restrictionEntry.getValue()) { for (Ability ability : restrictionEntry.getValue()) {
if (!(restrictionEntry.getKey() instanceof CantBeBlockedUnlessAllEffect) if (!(restrictionEntry.getKey() instanceof CantBeBlockedUnlessAllEffect)
&& !restrictionEntry.getKey().canBeBlocked(attacker, permanent, ability, game)) { && !restrictionEntry.getKey().canBeBlocked(attacker, permanent, ability, game, canUseChooseDialogs)) {
return false; return false;
} }
} }
@ -110,7 +109,7 @@ class CantBeBlockedUnlessAllEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBeBlockedCheckAfter(Permanent attacker, Ability source, Game game) { public boolean canBeBlockedCheckAfter(Permanent attacker, Ability source, Game game, boolean canUseChooseDialogs) {
for (CombatGroup combatGroup : game.getCombat().getGroups()) { for (CombatGroup combatGroup : game.getCombat().getGroups()) {
if (combatGroup.getAttackers().contains(source.getSourceId())) { if (combatGroup.getAttackers().contains(source.getSourceId())) {
for (UUID blockerId : combatGroup.getBlockers()) { for (UUID blockerId : combatGroup.getBlockers()) {

View file

@ -1,32 +1,25 @@
package mage.cards.u; package mage.cards.u;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.common.FilterArtifactPermanent; import mage.filter.common.FilterArtifactPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author BetaSteward * @author BetaSteward
*/ */
public final class UnwindingClock extends CardImpl { public final class UnwindingClock extends CardImpl {
public UnwindingClock(UUID ownerId, CardSetInfo setInfo) { public UnwindingClock(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
// Untap all artifacts you control during each other player's untap step. // Untap all artifacts you control during each other player's untap step.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UnwindingClockEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UnwindingClockEffect()));
@ -72,7 +65,7 @@ class UnwindingClockEffect extends ContinuousEffectImpl {
for (Permanent artifact : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { for (Permanent artifact : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
boolean untap = true; boolean untap = true;
for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(artifact, game).keySet()) { for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(artifact, game).keySet()) {
untap &= effect.canBeUntapped(artifact, source, game); untap &= effect.canBeUntapped(artifact, source, game, true);
} }
if (untap) { if (untap) {
artifact.untap(game); artifact.untap(game);

View file

@ -1,7 +1,5 @@
package mage.cards.u; package mage.cards.u;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ContinuousEffectImpl;
@ -11,22 +9,15 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.AttachmentType; import mage.constants.*;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent; import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class UrbanBurgeoning extends CardImpl { public final class UrbanBurgeoning extends CardImpl {
@ -34,7 +25,7 @@ public final class UrbanBurgeoning extends CardImpl {
static final String rule = "Enchanted land has \"Untap this land during each other player's untap step.\""; static final String rule = "Enchanted land has \"Untap this land during each other player's untap step.\"";
public UrbanBurgeoning(UUID ownerId, CardSetInfo setInfo) { public UrbanBurgeoning(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.subtype.add(SubType.AURA); this.subtype.add(SubType.AURA);
// Enchant land // Enchant land
@ -87,7 +78,7 @@ class UrbanBurgeoningUntapEffect extends ContinuousEffectImpl {
Permanent land = game.getPermanent(source.getSourceId()); Permanent land = game.getPermanent(source.getSourceId());
boolean untap = true; boolean untap = true;
for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(land, game).keySet()) { for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(land, game).keySet()) {
untap &= effect.canBeUntapped(land, source, game); untap &= effect.canBeUntapped(land, source, game, true);
} }
if (untap) { if (untap) {
land.untap(game); land.untap(game);

View file

@ -1,7 +1,5 @@
package mage.cards.v; package mage.cards.v;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,8 +8,8 @@ import mage.abilities.effects.common.combat.CantAttackIfDefenderControlsPermanen
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
@ -21,16 +19,19 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
* @author L_J * @author L_J
*/ */
public final class VeteranBrawlers extends CardImpl { public final class VeteranBrawlers extends CardImpl {
static final private FilterLandPermanent filter = new FilterLandPermanent("an untapped land"); static final private FilterLandPermanent filter = new FilterLandPermanent("an untapped land");
static { static {
filter.add(Predicates.not(TappedPredicate.instance)); filter.add(Predicates.not(TappedPredicate.instance));
} }
static final private String rule = "{this} can't block if you control an untapped land"; static final private String rule = "{this} can't block if you control an untapped land";
public VeteranBrawlers(UUID ownerId, CardSetInfo setInfo) { public VeteranBrawlers(UUID ownerId, CardSetInfo setInfo) {
@ -78,12 +79,10 @@ class VeteranBrawlersCantBlockEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
Player player = game.getPlayer(blocker.getControllerId()); Player player = game.getPlayer(blocker.getControllerId());
if (player != null) { if (player != null) {
if (game.getBattlefield().countAll(filter, player.getId(), game) > 0) { return game.getBattlefield().countAll(filter, player.getId(), game) <= 0;
return false;
}
} }
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.v; package mage.cards.v;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -10,20 +8,21 @@ import mage.abilities.keyword.GraftAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author JotaPeRL * @author JotaPeRL
*/ */
public final class VigeanHydropon extends CardImpl { public final class VigeanHydropon extends CardImpl {
public VigeanHydropon(UUID ownerId, CardSetInfo setInfo) { public VigeanHydropon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{U}");
this.subtype.add(SubType.PLANT); this.subtype.add(SubType.PLANT);
this.subtype.add(SubType.MUTANT); this.subtype.add(SubType.MUTANT);
this.power = new MageInt(0); this.power = new MageInt(0);
@ -31,7 +30,7 @@ public final class VigeanHydropon extends CardImpl {
// Graft 5 // Graft 5
this.addAbility(new GraftAbility(this, 5)); this.addAbility(new GraftAbility(this, 5));
// Vigean Hydropon can't attack or block. // Vigean Hydropon can't attack or block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VigeanHydroponEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VigeanHydroponEffect()));
} }
@ -63,20 +62,17 @@ class VigeanHydroponEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { return permanent.getId().equals(source.getSourceId());
return true;
}
return false;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.v; package mage.cards.v;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -10,25 +8,22 @@ import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class VoidWinnower extends CardImpl { public final class VoidWinnower extends CardImpl {
public VoidWinnower(UUID ownerId, CardSetInfo setInfo) { public VoidWinnower(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{9}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{9}");
this.subtype.add(SubType.ELDRAZI); this.subtype.add(SubType.ELDRAZI);
this.power = new MageInt(11); this.power = new MageInt(11);
@ -125,7 +120,7 @@ class VoidWinnowerCantBlockEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.v; package mage.cards.v;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.ActivatedAbilityImpl; import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.SpecialAction; import mage.abilities.SpecialAction;
@ -17,13 +15,7 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import static mage.cards.v.VolrathsCurse.keyString; import mage.constants.*;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -31,8 +23,11 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
import static mage.cards.v.VolrathsCurse.keyString;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class VolrathsCurse extends CardImpl { public final class VolrathsCurse extends CardImpl {
@ -40,7 +35,7 @@ public final class VolrathsCurse extends CardImpl {
static final String keyString = "_ignoreEffectForTurn"; static final String keyString = "_ignoreEffectForTurn";
public VolrathsCurse(UUID ownerId, CardSetInfo setInfo) { public VolrathsCurse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
this.subtype.add(SubType.AURA); this.subtype.add(SubType.AURA);
// Enchant creature // Enchant creature
@ -94,12 +89,12 @@ class VolrathsCurseRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@ -188,8 +183,8 @@ class VolrathsCurseIgnoreEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
String key = source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter() + keyString + game.getTurnNum() + ((ActivatedAbilityImpl)source).getActivatorId(); String key = source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter() + keyString + game.getTurnNum() + ((ActivatedAbilityImpl) source).getActivatorId();
game.getState().setValue(key,true); game.getState().setValue(key, true);
return true; return true;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.w; package mage.cards.w;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -11,14 +9,15 @@ import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.TurnPhase; import mage.constants.TurnPhase;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author L_J (based on LevelX2) * @author L_J (based on LevelX2)
*/ */
public final class WallOfDust extends CardImpl { public final class WallOfDust extends CardImpl {
@ -95,14 +94,12 @@ class WallOfDustRestrictionEffect extends RestrictionEffect {
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) { if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) {
if (game.isActivePlayer(permanent.getControllerId())) { return game.isActivePlayer(permanent.getControllerId());
return true;
}
} }
return false; return false;
} }
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
} }

View file

@ -1,7 +1,5 @@
package mage.cards.w; package mage.cards.w;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -19,14 +17,15 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
*
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public final class WarFalcon extends CardImpl { public final class WarFalcon extends CardImpl {
public WarFalcon(UUID ownerId, CardSetInfo setInfo) { public WarFalcon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
this.subtype.add(SubType.BIRD); this.subtype.add(SubType.BIRD);
this.power = new MageInt(2); this.power = new MageInt(2);
@ -34,7 +33,7 @@ public final class WarFalcon extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// War Falcon can't attack unless you control a Knight or a Soldier. // War Falcon can't attack unless you control a Knight or a Soldier.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WarFalconEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WarFalconEffect()));
} }
@ -52,11 +51,11 @@ public final class WarFalcon extends CardImpl {
class WarFalconEffect extends RestrictionEffect { class WarFalconEffect extends RestrictionEffect {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Knight or a Soldier"); private static final FilterControlledPermanent filter = new FilterControlledPermanent("Knight or a Soldier");
static { static {
filter.add(Predicates.or( filter.add(Predicates.or(
new SubtypePredicate(SubType.KNIGHT), new SubtypePredicate(SubType.KNIGHT),
new SubtypePredicate(SubType.SOLDIER))); new SubtypePredicate(SubType.SOLDIER)));
} }
public WarFalconEffect() { public WarFalconEffect() {
@ -74,17 +73,14 @@ class WarFalconEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Game game) { public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false; return false;
} }
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) { if (permanent.getId().equals(source.getSourceId())) {
if (game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { return game.getBattlefield().countAll(filter, source.getControllerId(), game) <= 0;
return false;
}
return true;
} // do not apply to other creatures. } // do not apply to other creatures.
return false; return false;
} }

View file

@ -104,7 +104,7 @@ class WebOfInertiaRestrictionEffect extends RestrictionEffect {
} }
@Override @Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game, boolean canUseChooseDialogs) {
if (defenderId == null) { if (defenderId == null) {
return true; return true;
} }

Some files were not shown because too many files have changed in this diff Show more