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

View file

@ -58,7 +58,7 @@ class ArboriaEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

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

View file

@ -1,4 +1,3 @@
package mage.cards.b;
import mage.MageInt;
@ -22,13 +21,12 @@ import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class BoldwyrIntimidator extends CardImpl {
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.power = new MageInt(5);
this.toughness = new MageInt(5);
@ -75,14 +73,11 @@ class BoldwyrIntimidatorEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) {
return true;
}
return false;
return sourcePermanent != null;
}
@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) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null && attacker.hasSubtype(SubType.WARRIOR, game)) {

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
@ -14,13 +12,15 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author noxx
*/
public final class BowerPassage extends CardImpl {
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.
@ -59,11 +59,8 @@ class BowerPassageEffect extends RestrictionEffect {
}
@Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (attacker != null && attacker.isControlledBy(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) {
return false;
}
return true;
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
return attacker == null || !attacker.isControlledBy(source.getControllerId()) || !blocker.getAbilities().contains(FlyingAbility.getInstance());
}
}

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -10,8 +8,8 @@ import mage.abilities.effects.common.combat.CantAttackIfDefenderControlsPermanen
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent;
@ -21,12 +19,15 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
* @author L_J
*/
public final class BrandedBrawlers extends CardImpl {
static final private FilterLandPermanent filter = new FilterLandPermanent("an untapped land");
static {
filter.add(Predicates.not(TappedPredicate.instance));
}
@ -78,12 +79,10 @@ class BrandedBrawlersCantBlockEffect extends RestrictionEffect {
}
@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());
if (player != null) {
if (game.getBattlefield().countAll(filter, player.getId(), game) > 0) {
return false;
}
return game.getBattlefield().countAll(filter, player.getId(), game) <= 0;
}
return true;
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
@ -20,6 +18,8 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author noxx
*/
@ -71,15 +71,13 @@ class CanopyCoverEffect extends RestrictionEffect {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
Permanent equipped = game.getPermanent(equipment.getAttachedTo());
if (equipped != null && permanent.getId().equals(equipped.getId())) {
return true;
}
return equipped != null && permanent.getId().equals(equipped.getId());
}
return false;
}
@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());
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
@ -10,12 +8,13 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.constants.Zone;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class CavernsOfDespair extends CardImpl {
@ -64,7 +63,7 @@ class CavernsOfDespairAttackRestrictionEffect extends RestrictionEffect {
}
@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;
}
}
@ -91,7 +90,7 @@ class CavernsOfDespairBlockRestrictionEffect extends RestrictionEffect {
}
@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;
}
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -10,22 +8,23 @@ import mage.abilities.keyword.InfectAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author North
*/
public final class ChainedThroatseeker extends CardImpl {
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.power = new MageInt(5);
@ -65,12 +64,10 @@ class ChainedThroatseekerCantAttackEffect extends RestrictionEffect {
}
@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);
if (targetPlayer != null) {
if (targetPlayer.getCounters().containsKey(CounterType.POISON)) {
return true;
}
return targetPlayer.getCounters().containsKey(CounterType.POISON);
}
return false;
}

View file

@ -73,7 +73,7 @@ class ChampionOfLambholtEffect extends RestrictionEffect {
}
@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());
if (sourcePermanent != null && attacker != null && attacker.isControlledBy(sourcePermanent.getControllerId())) {
return blocker.getPower().getValue() >= sourcePermanent.getPower().getValue();

View file

@ -78,7 +78,7 @@ class ChaosphereEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

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

View file

@ -64,7 +64,7 @@ class CrownHunterHirelingCantAttackEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
@ -13,14 +11,15 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author Plopman
*/
public final class CursedTotem extends CardImpl {
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.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CursedTotemCantActivateEffect()));
@ -53,7 +52,7 @@ class CursedTotemCantActivateEffect extends RestrictionEffect {
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -1,7 +1,5 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -20,14 +18,15 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlaneswalker;
import java.util.UUID;
/**
*
* @author spjspj
*/
public final class DeadlockTrap extends CardImpl {
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.
this.addAbility(new EntersBattlefieldTappedAbility());
@ -70,7 +69,7 @@ class DeadlockTrapCantActivateEffect extends RestrictionEffect {
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}

View file

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

View file

@ -62,7 +62,7 @@ class DenseCanopyCantBlockEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

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

View file

@ -1,8 +1,5 @@
package mage.cards.d;
import java.util.Set;
import java.util.UUID;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -18,8 +15,10 @@ import mage.game.permanent.Permanent;
import mage.watchers.common.AttackedThisTurnWatcher;
import mage.watchers.common.BlockedThisTurnWatcher;
import java.util.Set;
import java.util.UUID;
/**
*
* @author Quercitron
*/
public final class DuelingGrounds extends CardImpl {
@ -70,12 +69,12 @@ class NoMoreThanOneCreatureCanAttackEachTurnEffect extends RestrictionEffect {
}
@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()) {
return false;
}
AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class);
if(watcher == null){
if (watcher == null) {
return false;
}
Set<MageObjectReference> attackedThisTurnCreatures = watcher.getAttackedThisTurnCreatures();
@ -107,12 +106,12 @@ class NoMoreThanOneCreatureCanBlockEachTurnEffect extends RestrictionEffect {
}
@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()) {
return false;
}
BlockedThisTurnWatcher watcher = game.getState().getWatcher(BlockedThisTurnWatcher.class);
if(watcher == null){
if (watcher == null) {
return false;
}
Set<MageObjectReference> blockedThisTurnCreatures = watcher.getBlockedThisTurnCreatures();

View file

@ -1,7 +1,5 @@
package mage.cards.e;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
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.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.turn.Step;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class EdificeOfAuthority extends CardImpl {
@ -133,24 +128,21 @@ class EdificeOfAuthorityRestrictionEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (this.targetPointer.getTargets(game, source).contains(permanent.getId())) {
return true;
}
return this.targetPointer.getTargets(game, source).contains(permanent.getId());
}
@Override
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@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;
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}

View file

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

View file

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

View file

@ -82,7 +82,7 @@ class CanBlockOnlySpaceflightEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

@ -1,7 +1,5 @@
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -10,19 +8,21 @@ import mage.abilities.keyword.SoulbondAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author noxx
*/
public final class FloweringLumberknot extends CardImpl {
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.power = new MageInt(5);
@ -66,9 +66,8 @@ class FloweringLumberknotEffect extends RestrictionEffect {
break;
}
}
if (found) {
return false;// paired => can attack or block
}
// paired => can attack or block
return !found;
}
}
// can't attack or block
@ -79,12 +78,12 @@ class FloweringLumberknotEffect extends RestrictionEffect {
}
@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;
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -18,14 +16,15 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class GlacialCrasher extends CardImpl {
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.power = new MageInt(5);
@ -71,16 +70,14 @@ class GlacialCrasherEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 1) {
return true;
}
return game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 1;
}
return false;
}

View file

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

View file

@ -63,7 +63,7 @@ class GoblinGoonCantAttackEffect extends RestrictionEffect {
}
@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) {
return true;
}
@ -110,7 +110,7 @@ class GoblinGoonCantBlockEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -21,8 +19,9 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class GwafaHazidProfiteer extends CardImpl {
@ -34,7 +33,7 @@ public final class GwafaHazidProfiteer extends CardImpl {
}
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);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
@ -113,12 +112,12 @@ class GwafaHazidProfiteerEffect2 extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@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;
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -17,15 +15,16 @@ import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
* @author North
*/
public final class HarborSerpent extends CardImpl {
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.power = new MageInt(5);
@ -67,7 +66,7 @@ class HarborSerpentEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -1,7 +1,5 @@
package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
@ -11,19 +9,20 @@ import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public final class HeroOfOxidRidge extends CardImpl {
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.KNIGHT);
@ -68,7 +67,7 @@ class HeroOfOxidRidgeEffect extends RestrictionEffect {
}
@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;
}

View file

@ -1,7 +1,5 @@
package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleEvasionAbility;
@ -9,28 +7,29 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class HoodedHorror extends CardImpl {
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.power = 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.
this.addAbility(new SimpleEvasionAbility(new HoodedHorrorCantBeBlockedEffect()));
this.addAbility(new SimpleEvasionAbility(new HoodedHorrorCantBeBlockedEffect()));
}
public HoodedHorror(final HoodedHorror card) {
@ -58,28 +57,23 @@ class HoodedHorrorCantBeBlockedEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId()) && permanent.isAttacking()) {
return true;
}
return false;
return permanent.getId().equals(source.getSourceId()) && permanent.isAttacking();
}
@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());
if (controller != null) {
int maxCreatures = 0;
UUID playerIdWithMax = null;
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), 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;
playerIdWithMax = playerId;
}
}
if (playerIdWithMax != null && playerIdWithMax.equals(blocker.getControllerId())) {
return false;
}
return playerIdWithMax == null || !playerIdWithMax.equals(blocker.getControllerId());
}
return true;
}

View file

@ -165,7 +165,7 @@ class IllusionistsGambitRestrictionEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

@ -1,7 +1,5 @@
package mage.cards.i;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
@ -12,12 +10,7 @@ import mage.abilities.keyword.DefenderAbility;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -27,20 +20,22 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class InfiltratorsMagemark extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control that are enchanted");
static {
filter.add(EnchantedPredicate.instance);
filter.add(new ControllerPredicate(TargetController.YOU));
}
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);
@ -51,7 +46,7 @@ public final class InfiltratorsMagemark extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// 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);
ability.addEffect(effect);
this.addAbility(ability);
@ -88,7 +83,7 @@ class InfiltratorsMagemarkCantBeBlockedAllEffect extends RestrictionEffect {
}
@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());
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.i;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.DamageTargetEffect;
@ -13,16 +11,15 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class IntimidationBolt extends CardImpl {
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.
@ -55,14 +52,11 @@ class IntimidationEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (!permanent.getId().equals(source.getFirstTarget())) {
return true;
}
return false;
return !permanent.getId().equals(source.getFirstTarget());
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -66,7 +66,7 @@ class IronclawCurseEffect extends CantBlockAttachedEffect {
}
@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) {
return true;
}

View file

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

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -19,14 +17,15 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class KrakenOfTheStraits extends CardImpl {
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.power = new MageInt(6);
@ -71,7 +70,7 @@ class CantBeBlockedByCreaturesWithLessPowerEffect extends RestrictionEffect {
}
@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);
}

View file

@ -1,7 +1,5 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -10,25 +8,22 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.WitherAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.filter.predicate.permanent.CounterAnyPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class KulrathKnight extends CardImpl {
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.KNIGHT);
this.power = new MageInt(3);
@ -79,12 +74,12 @@ class KulrathKnightRestrictionEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@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;
}

View file

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

View file

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

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -9,21 +7,22 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class LupinePrototype extends CardImpl {
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.CONSTRUCT);
this.power = new MageInt(5);
@ -69,12 +68,12 @@ class LupinePrototypeEffect extends RestrictionEffect {
}
@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;
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -1,7 +1,5 @@
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -10,14 +8,15 @@ import mage.abilities.keyword.MonstrosityAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author Styxo
*/
public final class MantellianSavrip extends CardImpl {
@ -64,7 +63,7 @@ class MantellianSavripRestrictionEffect extends RestrictionEffect {
}
@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());
}

View file

@ -78,7 +78,7 @@ class MirriWeatherlightDuelistBlockRestrictionEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

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

View file

@ -62,7 +62,7 @@ class MoggToadyCantAttackEffect extends RestrictionEffect {
}
@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) {
return true;
}
@ -109,7 +109,7 @@ class MoggToadyCantBlockEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

@ -70,7 +70,7 @@ class CantAttackUnlessControllerControlsMoreLandsEffect extends RestrictionEffec
}
@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) {
return true;
}
@ -118,7 +118,7 @@ class CantBlockUnlessControllerControlsMoreLandsEffect extends RestrictionEffect
}
@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) {
return true;
}

View file

@ -1,7 +1,5 @@
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -13,11 +11,13 @@ import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author fireshoes
*/
@ -76,7 +76,7 @@ class MournwillowEffect extends RestrictionEffect {
}
@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;
}
}

View file

@ -1,7 +1,5 @@
package mage.cards.n;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
@ -13,14 +11,15 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class NullRod extends CardImpl {
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.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NullRodCantActivateEffect()));
@ -53,7 +52,7 @@ class NullRodCantActivateEffect extends RestrictionEffect {
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -1,16 +1,12 @@
package mage.cards.o;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.combat.CantAttackBlockTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -21,8 +17,9 @@ import mage.game.permanent.Permanent;
import mage.game.turn.Step;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author NinthWorld
*/
public final class Occupation extends CardImpl {
@ -81,9 +78,7 @@ class OccupationTapEffect extends ReplacementEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
if (permanent != null && permanent.isCreature()) {
return true;
}
return permanent != null && permanent.isCreature();
}
return false;
}
@ -164,24 +159,21 @@ class OccupationRestrictionEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (this.targetPointer.getTargets(game, source).contains(permanent.getId())) {
return true;
}
return this.targetPointer.getTargets(game, source).contains(permanent.getId());
}
@Override
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@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;
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -11,22 +9,19 @@ import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class Peacekeeper extends CardImpl {
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.power = new MageInt(1);
@ -66,7 +61,7 @@ class PeacekeeperCantAttackEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -1,7 +1,5 @@
package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -17,14 +15,15 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Loki
*/
public final class RecumbentBliss extends CardImpl {
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);
TargetPermanent auraTarget = new TargetCreaturePermanent();
@ -59,19 +58,16 @@ class RecumbentBlissEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getAttachments().contains((source.getSourceId()))) {
return true;
}
return permanent.getAttachments().contains((source.getSourceId()));
}
@Override
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@Override
public boolean canAttack(Game game) {
return false;
}
@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;
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -12,14 +10,15 @@ import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author stravant
*/
public final class RiverSerpent extends CardImpl {
@ -64,7 +63,7 @@ class RiverSerpentEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}

View file

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

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -15,29 +13,23 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Saga
*/
public final class ShaukuEndbringer extends CardImpl{
public final class ShaukuEndbringer extends CardImpl {
public ShaukuEndbringer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{B}{B}");
public ShaukuEndbringer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}{B}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.VAMPIRE);
this.power = new MageInt(5);
@ -46,7 +38,7 @@ public final class ShaukuEndbringer extends CardImpl{
this.addAbility(FlyingAbility.getInstance());
// 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.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(3), TargetController.YOU, false));
@ -68,9 +60,10 @@ public final class ShaukuEndbringer extends CardImpl{
}
}
class ShaukuEndbringerEffect extends RestrictionEffect {
class ShaukuEndbringerEffect extends RestrictionEffect {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(AnotherPredicate.instance);
}
@ -90,7 +83,7 @@ public final class ShaukuEndbringer extends CardImpl{
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
@ -14,11 +12,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.ColorPredicate;
@ -27,10 +21,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author jeffwadsworth
import java.util.UUID;
/**
* @author jeffwadsworth
*/
public final class ShrewdHatchling extends CardImpl {
@ -48,7 +42,7 @@ public final class ShrewdHatchling extends CardImpl {
private String rule2 = "Whenever you cast a red spell, remove a -1/-1 counter from Shrewd Hatchling.";
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.power = new MageInt(6);
@ -93,18 +87,13 @@ class ShrewdHatchlingEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
return true;
}
return false;
return permanent.getId().equals(source.getSourceId());
}
@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();
if (targetId != null && blocker.getId().equals(targetId))
return false;
return true;
return targetId == null || !blocker.getId().equals(targetId);
}
@Override

View file

@ -88,7 +88,7 @@ class SidarKondoOfJamuraaCantBlockCreaturesSourceEffect extends RestrictionEffec
}
@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) {
return true;
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -9,20 +7,21 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author emerald000
*/
public final class SilentArbiter extends CardImpl {
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.power = new MageInt(1);
this.toughness = new MageInt(5);
@ -66,7 +65,7 @@ class SilentArbiterAttackRestrictionEffect extends RestrictionEffect {
}
@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();
}
}
@ -93,7 +92,7 @@ class SilentArbiterBlockRestrictionEffect extends RestrictionEffect {
}
@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();
}
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
@ -15,14 +13,15 @@ import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class SkyblinderStaff extends CardImpl {
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);
// Equipped creature gets +1/+0 and can't be blocked by creatures with flying.
@ -63,7 +62,7 @@ class CantBeBlockedByCreaturesWithFlyingAttachedEffect extends RestrictionEffect
}
@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());
}

View file

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

View file

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

View file

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

View file

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

View file

@ -61,7 +61,7 @@ class SpitfireHandlerCantBlockEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -9,8 +7,8 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
@ -18,14 +16,15 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author Plopman
*/
public final class SteelcladSerpent extends CardImpl {
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.power = new MageInt(4);
@ -69,17 +68,14 @@ class SteelcladSerpentEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
if (!game.getBattlefield().getActivePermanents(filter, source.getControllerId(), permanent.getId(), game).isEmpty()) {
return false;
}
return true;
return game.getBattlefield().getActivePermanents(filter, source.getControllerId(), permanent.getId(), game).isEmpty();
}
return false;
}

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
@ -13,14 +11,15 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author BetaSteward
*/
public final class StonySilence extends CardImpl {
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.
@ -55,7 +54,7 @@ class StonySilenceCantActivateEffect extends RestrictionEffect {
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -11,24 +9,21 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class StupefyingTouch extends CardImpl {
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);
// Enchant creature
@ -70,15 +65,13 @@ class CantActivateAbilitiesAttachedEffect extends RestrictionEffect {
public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null && enchantment.getAttachedTo() != null) {
if (permanent.getId().equals(enchantment.getAttachedTo())) {
return true;
}
return permanent.getId().equals(enchantment.getAttachedTo());
}
return false;
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -64,7 +64,7 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect {
}
@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) {
return true;
}

View file

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

View file

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

View file

@ -1,8 +1,5 @@
package mage.cards.t;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -10,20 +7,22 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.List;
import java.util.UUID;
/**
*
* @author North
*/
public final class TrainingDrone extends CardImpl {
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.power = new MageInt(4);
@ -71,12 +70,12 @@ class TrainingDroneEffect extends RestrictionEffect {
}
@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;
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}

View file

@ -1,6 +1,5 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
@ -17,10 +16,10 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Jason E. Wall
*
*/
public final class TreetopBracers extends CardImpl {
@ -67,15 +66,13 @@ class TreetopBracersRestrictEffect extends RestrictionEffect {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
Permanent equipped = game.getPermanent(equipment.getAttachedTo());
if (permanent != null && permanent.getId().equals(equipped.getId())) {
return true;
}
return permanent != null && permanent.getId().equals(equipped.getId());
}
return false;
}
@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());
}

View file

@ -1,7 +1,5 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RestrictionEffect;
@ -17,14 +15,15 @@ import mage.game.stack.StackObject;
import mage.target.common.TargetActivatedOrTriggeredAbility;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class Trickbind extends CardImpl {
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
@ -64,7 +63,7 @@ class TrickbindCounterEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
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();
effect.setTargetPointer(new FixedTarget(stackObject.getSourceId()));
game.getContinuousEffects().addEffect(effect, source);
@ -92,7 +91,7 @@ class TrickbindCantActivateEffect extends RestrictionEffect {
}
@Override
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game, boolean canUseChooseDialogs) {
return false;
}

View file

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

View file

@ -1,32 +1,25 @@
package mage.cards.u;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterArtifactPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author BetaSteward
*/
public final class UnwindingClock extends CardImpl {
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.
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)) {
boolean untap = true;
for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(artifact, game).keySet()) {
untap &= effect.canBeUntapped(artifact, source, game);
untap &= effect.canBeUntapped(artifact, source, game, true);
}
if (untap) {
artifact.untap(game);

View file

@ -1,7 +1,5 @@
package mage.cards.u;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
@ -11,22 +9,15 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
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.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
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.\"";
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);
// Enchant land
@ -87,7 +78,7 @@ class UrbanBurgeoningUntapEffect extends ContinuousEffectImpl {
Permanent land = game.getPermanent(source.getSourceId());
boolean untap = true;
for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(land, game).keySet()) {
untap &= effect.canBeUntapped(land, source, game);
untap &= effect.canBeUntapped(land, source, game, true);
}
if (untap) {
land.untap(game);

View file

@ -1,7 +1,5 @@
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -10,8 +8,8 @@ import mage.abilities.effects.common.combat.CantAttackIfDefenderControlsPermanen
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent;
@ -21,12 +19,15 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
* @author L_J
*/
public final class VeteranBrawlers extends CardImpl {
static final private FilterLandPermanent filter = new FilterLandPermanent("an untapped land");
static {
filter.add(Predicates.not(TappedPredicate.instance));
}
@ -78,12 +79,10 @@ class VeteranBrawlersCantBlockEffect extends RestrictionEffect {
}
@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());
if (player != null) {
if (game.getBattlefield().countAll(filter, player.getId(), game) > 0) {
return false;
}
return game.getBattlefield().countAll(filter, player.getId(), game) <= 0;
}
return true;
}

View file

@ -1,7 +1,5 @@
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -10,20 +8,21 @@ import mage.abilities.keyword.GraftAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author JotaPeRL
*/
public final class VigeanHydropon extends CardImpl {
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.MUTANT);
this.power = new MageInt(0);
@ -63,20 +62,17 @@ class VigeanHydroponEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@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;
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
return true;
}
return false;
return permanent.getId().equals(source.getSourceId());
}
}

View file

@ -1,7 +1,5 @@
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -10,25 +8,22 @@ import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class VoidWinnower extends CardImpl {
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.power = new MageInt(11);
@ -125,7 +120,7 @@ class VoidWinnowerCantBlockEffect extends RestrictionEffect {
}
@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;
}
}

View file

@ -1,7 +1,5 @@
package mage.cards.v;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.SpecialAction;
@ -17,13 +15,7 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import static mage.cards.v.VolrathsCurse.keyString;
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.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -31,8 +23,11 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
import static mage.cards.v.VolrathsCurse.keyString;
/**
*
* @author LevelX2
*/
public final class VolrathsCurse extends CardImpl {
@ -40,7 +35,7 @@ public final class VolrathsCurse extends CardImpl {
static final String keyString = "_ignoreEffectForTurn";
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);
// Enchant creature
@ -94,12 +89,12 @@ class VolrathsCurseRestrictionEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@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;
}
@ -188,8 +183,8 @@ class VolrathsCurseIgnoreEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
String key = source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter() + keyString + game.getTurnNum() + ((ActivatedAbilityImpl)source).getActivatorId();
game.getState().setValue(key,true);
String key = source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter() + keyString + game.getTurnNum() + ((ActivatedAbilityImpl) source).getActivatorId();
game.getState().setValue(key, true);
return true;
}
}

View file

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

View file

@ -1,7 +1,5 @@
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -19,14 +17,15 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class WarFalcon extends CardImpl {
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.power = new MageInt(2);
@ -55,8 +54,8 @@ class WarFalconEffect extends RestrictionEffect {
static {
filter.add(Predicates.or(
new SubtypePredicate(SubType.KNIGHT),
new SubtypePredicate(SubType.SOLDIER)));
new SubtypePredicate(SubType.KNIGHT),
new SubtypePredicate(SubType.SOLDIER)));
}
public WarFalconEffect() {
@ -74,17 +73,14 @@ class WarFalconEffect extends RestrictionEffect {
}
@Override
public boolean canAttack(Game game) {
public boolean canAttack(Game game, boolean canUseChooseDialogs) {
return false;
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
if (game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) {
return false;
}
return true;
return game.getBattlefield().countAll(filter, source.getControllerId(), game) <= 0;
} // do not apply to other creatures.
return false;
}

View file

@ -104,7 +104,7 @@ class WebOfInertiaRestrictionEffect extends RestrictionEffect {
}
@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) {
return true;
}

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