forked from External/mage
implement Orcish Conscripts, rework can't block alone ability
This commit is contained in:
parent
d785193b97
commit
00ff663c40
24 changed files with 289 additions and 186 deletions
|
|
@ -1,28 +1,29 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantAttackAloneSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class BondedConstruct extends CardImpl {
|
||||
|
||||
public BondedConstruct(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{1}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}");
|
||||
this.subtype.add(SubType.CONSTRUCT);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Bonded Construct can't attack alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(new SimpleStaticAbility(new CantAttackAloneSourceEffect()));
|
||||
}
|
||||
|
||||
private BondedConstruct(final BondedConstruct card) {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.keyword.CantBlockAloneAbility;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.CantAttackOrBlockAloneAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -24,8 +24,7 @@ public final class BondedHorncrest extends CardImpl {
|
|||
this.toughness = new MageInt(5);
|
||||
|
||||
// Bonded Horncrest can't attack or block alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(CantBlockAloneAbility.getInstance());
|
||||
this.addAbility(new CantAttackOrBlockAloneAbility());
|
||||
}
|
||||
|
||||
private BondedHorncrest(final BondedHorncrest card) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantBlockAloneAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantBlockAloneSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -23,7 +24,7 @@ public final class CravenHulk extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Craven Hulk can't block alone.
|
||||
this.addAbility(CantBlockAloneAbility.getInstance());
|
||||
this.addAbility(new SimpleStaticAbility(new CantBlockAloneSourceEffect()));
|
||||
}
|
||||
|
||||
private CravenHulk(final CravenHulk card) {
|
||||
|
|
|
|||
|
|
@ -1,31 +1,29 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.keyword.CantBlockAloneAbility;
|
||||
import mage.abilities.keyword.CantAttackOrBlockAloneAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class EmberBeast extends CardImpl {
|
||||
|
||||
public EmberBeast(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.subtype.add(SubType.BEAST);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Ember Beast can't attack or block alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(CantBlockAloneAbility.getInstance());
|
||||
this.addAbility(new CantAttackOrBlockAloneAbility());
|
||||
}
|
||||
|
||||
private EmberBeast(final EmberBeast card) {
|
||||
|
|
|
|||
|
|
@ -1,30 +1,29 @@
|
|||
|
||||
package mage.cards.j;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.keyword.CantBlockAloneAbility;
|
||||
import mage.abilities.keyword.CantAttackOrBlockAloneAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author magenoxx_at_gmail.com
|
||||
*/
|
||||
public final class JackalFamiliar extends CardImpl {
|
||||
|
||||
public JackalFamiliar(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
|
||||
this.subtype.add(SubType.JACKAL);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Jackal Familiar can't attack or block alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(CantBlockAloneAbility.getInstance());
|
||||
this.addAbility(new CantAttackOrBlockAloneAbility());
|
||||
}
|
||||
|
||||
private JackalFamiliar(final JackalFamiliar card) {
|
||||
|
|
|
|||
|
|
@ -1,24 +1,23 @@
|
|||
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.keyword.CantBlockAloneAbility;
|
||||
import mage.abilities.keyword.CantAttackOrBlockAloneAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class LoyalPegasus extends CardImpl {
|
||||
|
||||
public LoyalPegasus(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
|
||||
this.subtype.add(SubType.PEGASUS);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
|
|
@ -27,8 +26,7 @@ public final class LoyalPegasus extends CardImpl {
|
|||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// Loyal Pegasus can't attack or block alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(CantBlockAloneAbility.getInstance());
|
||||
this.addAbility(new CantAttackOrBlockAloneAbility());
|
||||
}
|
||||
|
||||
private LoyalPegasus(final LoyalPegasus card) {
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ package mage.cards.m;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.effects.common.combat.CantAttackAloneSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -27,7 +28,7 @@ public final class MilitiaRallier extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Militia Rallier can't attack alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(new SimpleStaticAbility(new CantAttackAloneSourceEffect()));
|
||||
|
||||
// Whenever Militia Rallier attacks, untap target creature.
|
||||
Ability ability = new AttacksTriggeredAbility(new UntapTargetEffect());
|
||||
|
|
|
|||
|
|
@ -1,30 +1,29 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.keyword.CantBlockAloneAbility;
|
||||
import mage.abilities.keyword.CantAttackOrBlockAloneAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author magenoxx_at_gmail.com
|
||||
*/
|
||||
public final class MoggFlunkies extends CardImpl {
|
||||
|
||||
public MoggFlunkies(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(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Mogg Flunkies can't attack or block alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(CantBlockAloneAbility.getInstance());
|
||||
this.addAbility(new CantAttackOrBlockAloneAbility());
|
||||
}
|
||||
|
||||
private MoggFlunkies(final MoggFlunkies card) {
|
||||
|
|
|
|||
105
Mage.Sets/src/mage/cards/o/OrcishConscripts.java
Normal file
105
Mage.Sets/src/mage/cards/o/OrcishConscripts.java
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
package mage.cards.o;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterBlockingCreature;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author notgreat
|
||||
*/
|
||||
public final class OrcishConscripts extends CardImpl {
|
||||
|
||||
public OrcishConscripts(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
|
||||
|
||||
this.subtype.add(SubType.ORC);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Orcish Conscripts can't attack unless at least two other creatures attack.
|
||||
this.addAbility(new SimpleStaticAbility(new OrcishConscriptsAttackEffect()));
|
||||
|
||||
// Orcish Conscripts can't block unless at least two other creatures block.
|
||||
this.addAbility(new SimpleStaticAbility(new OrcishConscriptsBlockEffect()));
|
||||
}
|
||||
|
||||
private OrcishConscripts(final OrcishConscripts card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrcishConscripts copy() {
|
||||
return new OrcishConscripts(this);
|
||||
}
|
||||
}
|
||||
|
||||
class OrcishConscriptsAttackEffect extends RestrictionEffect {
|
||||
|
||||
OrcishConscriptsAttackEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = "{this} can't attack unless at least two other creatures attack";
|
||||
}
|
||||
|
||||
private OrcishConscriptsAttackEffect(final OrcishConscriptsAttackEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrcishConscriptsAttackEffect copy() {
|
||||
return new OrcishConscriptsAttackEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game, boolean canUseChooseDialogs) {
|
||||
return numberOfAttackers > 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return source.getSourceId().equals(permanent.getId());
|
||||
}
|
||||
}
|
||||
|
||||
class OrcishConscriptsBlockEffect extends RestrictionEffect {
|
||||
|
||||
private static final FilterBlockingCreature filter = new FilterBlockingCreature("Blocking creatures");
|
||||
|
||||
public OrcishConscriptsBlockEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = "{this} can't block unless at least two other creatures block";
|
||||
}
|
||||
|
||||
private OrcishConscriptsBlockEffect(final OrcishConscriptsBlockEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrcishConscriptsBlockEffect copy() {
|
||||
return new OrcishConscriptsBlockEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockCheckAfter(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 game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).size() <= 2;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantAttackAloneSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -22,7 +23,7 @@ public final class RagingKronch extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Raging Kronch can't attack alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(new SimpleStaticAbility(new CantAttackAloneSourceEffect()));
|
||||
}
|
||||
|
||||
private RagingKronch(final RagingKronch card) {
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAloneAttachedEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAloneSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.keyword.BestowAbility;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
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.Zone;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -35,7 +35,7 @@ public final class SightlessBrawler extends CardImpl {
|
|||
// Bestow 4W (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)
|
||||
this.addAbility(new BestowAbility(this, "{4}{W}"));
|
||||
// Sightless Brawler can't attack alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(new SimpleStaticAbility(new CantAttackAloneSourceEffect()));
|
||||
// Enchanted creature gets +3/+2 and can't attack alone.
|
||||
Effect effect = new BoostEnchantedEffect(3, 2, Duration.WhileOnBattlefield);
|
||||
effect.setText("Enchanted creature gets +3/+2");
|
||||
|
|
|
|||
|
|
@ -1,23 +1,24 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantAttackAloneSourceEffect;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class TrustyCompanion extends CardImpl {
|
||||
|
||||
public TrustyCompanion(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||
this.subtype.add(SubType.HYENA);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
|
|
@ -25,7 +26,7 @@ public final class TrustyCompanion extends CardImpl {
|
|||
// Vigilance
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
// Trusty Companion can't attack alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(new SimpleStaticAbility(new CantAttackAloneSourceEffect()));
|
||||
}
|
||||
|
||||
private TrustyCompanion(final TrustyCompanion card) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ 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;
|
||||
|
|
@ -39,39 +38,39 @@ public final class Wirecat extends CardImpl {
|
|||
public Wirecat copy() {
|
||||
return new Wirecat(this);
|
||||
}
|
||||
}
|
||||
|
||||
static class WirecatEffect extends RestrictionEffect {
|
||||
class WirecatEffect extends RestrictionEffect {
|
||||
|
||||
public WirecatEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = "{this} can't attack or block if an enchantment is on the battlefield";
|
||||
}
|
||||
|
||||
private WirecatEffect(final WirecatEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WirecatEffect copy() {
|
||||
return new WirecatEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game, boolean canUseChooseDialogs) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockCheckAfter(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 game.getBattlefield().contains(StaticFilters.FILTER_PERMANENT_ENCHANTMENT, source, game, 1);
|
||||
}
|
||||
return false;
|
||||
WirecatEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = "{this} can't attack or block if an enchantment is on the battlefield";
|
||||
}
|
||||
|
||||
private WirecatEffect(final WirecatEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WirecatEffect copy() {
|
||||
return new WirecatEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game, boolean canUseChooseDialogs) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockCheckAfter(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 game.getBattlefield().contains(StaticFilters.FILTER_PERMANENT_ENCHANTMENT, source, game, 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package mage.cards.w;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.keyword.CantBlockAloneAbility;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.CantAttackOrBlockAloneAbility;
|
||||
import mage.abilities.keyword.MentorAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -28,8 +28,7 @@ public final class WojekBodyguard extends CardImpl {
|
|||
this.addAbility(new MentorAbility());
|
||||
|
||||
// Wojek Bodyguard can't attack or block alone.
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(CantBlockAloneAbility.getInstance());
|
||||
this.addAbility(new CantAttackOrBlockAloneAbility());
|
||||
}
|
||||
|
||||
private WojekBodyguard(final WojekBodyguard card) {
|
||||
|
|
|
|||
|
|
@ -317,6 +317,7 @@ public final class FifthEdition extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Obelisk of Undoing", 392, Rarity.RARE, mage.cards.o.ObeliskOfUndoing.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Artillery", 253, Rarity.UNCOMMON, mage.cards.o.OrcishArtillery.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Captain", 254, Rarity.UNCOMMON, mage.cards.o.OrcishCaptain.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Conscripts", 255, Rarity.COMMON, mage.cards.o.OrcishConscripts.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Farmer", 256, Rarity.COMMON, mage.cards.o.OrcishFarmer.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Oriflamme", 257, Rarity.UNCOMMON, mage.cards.o.OrcishOriflamme.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Squatters", 258, Rarity.RARE, mage.cards.o.OrcishSquatters.class, RETRO_ART));
|
||||
|
|
|
|||
|
|
@ -264,6 +264,7 @@ public final class IceAge extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Oath of Lim-Dul", 156, Rarity.RARE, mage.cards.o.OathOfLimDul.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Onyx Talisman", 331, Rarity.UNCOMMON, mage.cards.o.OnyxTalisman.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Cannoneers", 205, Rarity.UNCOMMON, mage.cards.o.OrcishCannoneers.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Conscripts", 206, Rarity.COMMON, mage.cards.o.OrcishConscripts.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Farmer", 207, Rarity.COMMON, mage.cards.o.OrcishFarmer.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Healer", 208, Rarity.UNCOMMON, mage.cards.o.OrcishHealer.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Librarian", 209, Rarity.RARE, mage.cards.o.OrcishLibrarian.class, RETRO_ART));
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ public final class MastersEditionII extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Orc General", 137, Rarity.UNCOMMON, mage.cards.o.OrcGeneral.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Cannoneers", 138, Rarity.UNCOMMON, mage.cards.o.OrcishCannoneers.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Captain", 139, Rarity.UNCOMMON, mage.cards.o.OrcishCaptain.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Conscripts", 140, Rarity.COMMON, mage.cards.o.OrcishConscripts.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Farmer", 141, Rarity.COMMON, mage.cards.o.OrcishFarmer.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Lumberjack", 142, Rarity.COMMON, mage.cards.o.OrcishLumberjack.class, RETRO_ART));
|
||||
cards.add(new SetCardInfo("Orcish Squatters", 143, Rarity.RARE, mage.cards.o.OrcishSquatters.class, RETRO_ART));
|
||||
|
|
|
|||
|
|
@ -88,16 +88,35 @@ public class CantAttackOrBlockAloneTest extends CardTestPlayerBase {
|
|||
@Test
|
||||
public void testCantBlockAlone2() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mogg Flunkies");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Llanowar Elves");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Ember Beast");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Elite Vanguard");
|
||||
|
||||
attack(2, playerB, "Elite Vanguard");
|
||||
block(2, playerA, "Mogg Flunkies", "Elite Vanguard");
|
||||
block(2, playerA, "Llanowar Elves", "Elite Vanguard");
|
||||
block(2, playerA, "Ember Beast", "Elite Vanguard");
|
||||
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to attack with three Orcish Conscripts (can't attack unless 2 others attack)
|
||||
*/
|
||||
@Test
|
||||
public void testCanAttackWithThree() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Orcish Conscripts", 3); // 2/2
|
||||
|
||||
attack(1, playerA, "Orcish Conscripts");
|
||||
attack(1, playerA, "Orcish Conscripts");
|
||||
attack(1, playerA, "Orcish Conscripts");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 14);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package mage.abilities.effects.common.combat;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.common.FilterBlockingCreature;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class CantBlockAloneSourceEffect extends RestrictionEffect {
|
||||
|
||||
private static final FilterBlockingCreature filter = new FilterBlockingCreature("Blocking creatures");
|
||||
public CantBlockAloneSourceEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = "{this} can't block alone";
|
||||
}
|
||||
|
||||
protected CantBlockAloneSourceEffect(final CantBlockAloneSourceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CantBlockAloneSourceEffect copy() {
|
||||
return new CantBlockAloneSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockCheckAfter(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 game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).size() <= 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantAttackAloneSourceEffect;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
* @author magenoxx_at_googlemail.com
|
||||
*/
|
||||
public class CantAttackAloneAbility extends SimpleStaticAbility {
|
||||
|
||||
public CantAttackAloneAbility() {
|
||||
super(Zone.BATTLEFIELD, new CantAttackAloneSourceEffect());
|
||||
}
|
||||
|
||||
private CantAttackAloneAbility(CantAttackAloneAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CantAttackAloneAbility copy() {
|
||||
return new CantAttackAloneAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantAttackAloneSourceEffect;
|
||||
import mage.abilities.effects.common.combat.CantBlockAloneSourceEffect;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
* @author notgreat
|
||||
*/
|
||||
public class CantAttackOrBlockAloneAbility extends SimpleStaticAbility {
|
||||
|
||||
public CantAttackOrBlockAloneAbility() {
|
||||
super(Zone.BATTLEFIELD, new CantAttackAloneSourceEffect().setText("{this} can't attack or block alone"));
|
||||
this.addEffect(new CantBlockAloneSourceEffect().setText(""));
|
||||
}
|
||||
|
||||
private CantAttackOrBlockAloneAbility(CantAttackOrBlockAloneAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CantAttackOrBlockAloneAbility copy() {
|
||||
return new CantAttackOrBlockAloneAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
|
||||
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.StaticAbility;
|
||||
|
||||
import java.io.ObjectStreamException;
|
||||
|
||||
/**
|
||||
* @author magenoxx_at_googlemail.com
|
||||
*/
|
||||
public class CantBlockAloneAbility extends StaticAbility implements MageSingleton {
|
||||
|
||||
private static final CantBlockAloneAbility instance = new CantBlockAloneAbility();
|
||||
|
||||
private Object readResolve() throws ObjectStreamException {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static CantBlockAloneAbility getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private CantBlockAloneAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{this} can't block alone.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public CantBlockAloneAbility copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -679,29 +679,6 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
possibleBlockers.put(attacker.getId(), goodBlockers);
|
||||
}
|
||||
|
||||
// effects: can't block alone
|
||||
// too much blockers
|
||||
if (blockersCount == 1) {
|
||||
List<UUID> toBeRemoved = new ArrayList<>();
|
||||
for (UUID blockerId : getBlockers()) {
|
||||
Permanent blocker = game.getPermanent(blockerId);
|
||||
if (blocker != null && blocker.getAbilities().containsKey(CantBlockAloneAbility.getInstance().getId())) {
|
||||
blockWasLegal = false;
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(blocker.getLogName() + " can't block alone. Removing it from combat.");
|
||||
}
|
||||
toBeRemoved.add(blockerId);
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID blockerId : toBeRemoved) {
|
||||
game.getCombat().removeBlocker(blockerId, game);
|
||||
}
|
||||
if (blockers.isEmpty()) {
|
||||
this.blocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
for (UUID uuid : attackers) {
|
||||
Permanent attacker = game.getPermanent(uuid);
|
||||
if (attacker != null && this.blocked) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||
import mage.abilities.keyword.CantBlockAloneAbility;
|
||||
import mage.abilities.keyword.CantAttackOrBlockAloneAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
|
|
@ -19,8 +18,7 @@ public final class BeastieToken extends TokenImpl {
|
|||
power = new MageInt(4);
|
||||
toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(new CantAttackAloneAbility());
|
||||
this.addAbility(CantBlockAloneAbility.getInstance());
|
||||
this.addAbility(new CantAttackOrBlockAloneAbility());
|
||||
}
|
||||
|
||||
private BeastieToken(final BeastieToken token) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue