mirror of
https://github.com/correl/mage.git
synced 2024-11-14 11:09:31 +00:00
- Added requested card Barbed Wire
This commit is contained in:
parent
cb340e4709
commit
f432365197
2 changed files with 108 additions and 2 deletions
105
Mage.Sets/src/mage/cards/b/BarbedWire.java
Normal file
105
Mage.Sets/src/mage/cards/b/BarbedWire.java
Normal file
|
@ -0,0 +1,105 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class BarbedWire extends CardImpl {
|
||||
|
||||
private final String rule = "At the beginning of each player's upkeep, "
|
||||
+ "Barbed Wire deals 1 damage to that player.";
|
||||
|
||||
public BarbedWire(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
// At the beginning of each player's upkeep, Barbed Wire deals 1 damage to that player.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new BarbwireDamageEffect(),
|
||||
TargetController.ACTIVE,
|
||||
false, true, rule));
|
||||
|
||||
// {2}: Prevent the next 1 damage that would be dealt by Barbed Wire this turn.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new BarbedWirePreventionEffect(), new ManaCostsImpl("{2}")));
|
||||
|
||||
}
|
||||
|
||||
private BarbedWire(final BarbedWire card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarbedWire copy() {
|
||||
return new BarbedWire(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BarbwireDamageEffect extends OneShotEffect {
|
||||
|
||||
public BarbwireDamageEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "";
|
||||
}
|
||||
|
||||
public BarbwireDamageEffect(final BarbwireDamageEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarbwireDamageEffect copy() {
|
||||
return new BarbwireDamageEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player activePlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (activePlayer != null) {
|
||||
activePlayer.damage(1, source.getSourceId(), game);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class BarbedWirePreventionEffect extends PreventionEffectImpl {
|
||||
|
||||
public BarbedWirePreventionEffect() {
|
||||
super(Duration.EndOfTurn, 1, false);
|
||||
staticText = "Prevent the next 1 damage that would be dealt by {this} this turn";
|
||||
}
|
||||
|
||||
public BarbedWirePreventionEffect(final BarbedWirePreventionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarbedWirePreventionEffect copy() {
|
||||
return new BarbedWirePreventionEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return super.applies(event, source, game)
|
||||
&& event.getSourceId().equals(source.getSourceId());
|
||||
}
|
||||
}
|
|
@ -35,6 +35,7 @@ public final class MercadianMasques extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Assembly Hall", 286, Rarity.RARE, mage.cards.a.AssemblyHall.class));
|
||||
cards.add(new SetCardInfo("Ballista Squad", 5, Rarity.UNCOMMON, mage.cards.b.BallistaSquad.class));
|
||||
cards.add(new SetCardInfo("Balloon Peddler", 59, Rarity.COMMON, mage.cards.b.BalloonPeddler.class));
|
||||
cards.add(new SetCardInfo("Barbed Wire", 287, Rarity.UNCOMMON, mage.cards.b.BarbedWire.class));
|
||||
cards.add(new SetCardInfo("Battle Rampart", 173, Rarity.COMMON, mage.cards.b.BattleRampart.class));
|
||||
cards.add(new SetCardInfo("Battle Squadron", 174, Rarity.RARE, mage.cards.b.BattleSquadron.class));
|
||||
cards.add(new SetCardInfo("Bifurcate", 230, Rarity.RARE, mage.cards.b.Bifurcate.class));
|
||||
|
@ -235,7 +236,7 @@ public final class MercadianMasques extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Plains", 334, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Power Matrix", 309, Rarity.RARE, mage.cards.p.PowerMatrix.class));
|
||||
cards.add(new SetCardInfo("Primeval Shambler", 152, Rarity.UNCOMMON, mage.cards.p.PrimevalShambler.class));
|
||||
cards.add(new SetCardInfo("Puffer Extract", 310, Rarity.UNCOMMON, mage.cards.p.PufferExtract.class));
|
||||
cards.add(new SetCardInfo("Puffer Extract", 310, Rarity.UNCOMMON, mage.cards.p.PufferExtract.class));
|
||||
cards.add(new SetCardInfo("Pulverize", 207, Rarity.RARE, mage.cards.p.Pulverize.class));
|
||||
cards.add(new SetCardInfo("Putrefaction", 153, Rarity.UNCOMMON, mage.cards.p.Putrefaction.class));
|
||||
cards.add(new SetCardInfo("Puppet's Verdict", 208, Rarity.RARE, mage.cards.p.PuppetsVerdict.class));
|
||||
|
@ -287,7 +288,7 @@ public final class MercadianMasques extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sever Soul", 159, Rarity.COMMON, mage.cards.s.SeverSoul.class));
|
||||
cards.add(new SetCardInfo("Shock Troops", 212, Rarity.COMMON, mage.cards.s.ShockTroops.class));
|
||||
cards.add(new SetCardInfo("Shoving Match", 103, Rarity.UNCOMMON, mage.cards.s.ShovingMatch.class));
|
||||
cards.add(new SetCardInfo("Silent Assassin", 160, Rarity.RARE, mage.cards.s.SilentAssassin.class));
|
||||
cards.add(new SetCardInfo("Silent Assassin", 160, Rarity.RARE, mage.cards.s.SilentAssassin.class));
|
||||
cards.add(new SetCardInfo("Silverglade Elemental", 269, Rarity.COMMON, mage.cards.s.SilvergladeElemental.class));
|
||||
cards.add(new SetCardInfo("Silverglade Pathfinder", 270, Rarity.UNCOMMON, mage.cards.s.SilvergladePathfinder.class));
|
||||
cards.add(new SetCardInfo("Sizzle", 213, Rarity.COMMON, mage.cards.s.Sizzle.class));
|
||||
|
|
Loading…
Reference in a new issue