mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
[MMQ] Implement Bargaining Table, Erithizon and Ley Line
This commit is contained in:
parent
2fff240353
commit
9b5d508e2c
4 changed files with 221 additions and 0 deletions
72
Mage.Sets/src/mage/cards/b/BargainingTable.java
Normal file
72
Mage.Sets/src/mage/cards/b/BargainingTable.java
Normal file
|
@ -0,0 +1,72 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.CostAdjuster;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author awjackson
|
||||
*/
|
||||
public final class BargainingTable extends CardImpl {
|
||||
|
||||
public BargainingTable(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
|
||||
|
||||
// {X}, {T}: Draw a card. X is the number of cards in an opponent's hand.
|
||||
Ability ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(1), new ManaCostsImpl<>("{X}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addEffect(new InfoEffect("X is the number of cards in an opponent's hand"));
|
||||
// You choose an opponent on announcement. This is not targeted, but a choice is still made.
|
||||
// This choice is made before determining the value for X that is used in the cost. (2004-10-04)
|
||||
ability.addTarget(new TargetOpponent(true));
|
||||
ability.setCostAdjuster(BargainingTableAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private BargainingTable(final BargainingTable card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BargainingTable copy() {
|
||||
return new BargainingTable(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum BargainingTableAdjuster implements CostAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
int handSize = Integer.MAX_VALUE;
|
||||
if (game.inCheckPlayableState()) {
|
||||
for (UUID playerId : CardUtil.getAllPossibleTargets(ability, game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
handSize = Math.min(handSize, player.getHand().size());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Player player = game.getPlayer(ability.getFirstTarget());
|
||||
if (player != null) {
|
||||
handSize = player.getHand().size();
|
||||
}
|
||||
}
|
||||
ability.getManaCostsToPay().clear();
|
||||
ability.getManaCostsToPay().add(new GenericManaCost(handSize));
|
||||
}
|
||||
}
|
61
Mage.Sets/src/mage/cards/e/Erithizon.java
Normal file
61
Mage.Sets/src/mage/cards/e/Erithizon.java
Normal file
|
@ -0,0 +1,61 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author awjackson
|
||||
*/
|
||||
public final class Erithizon extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature of defending player's choice");
|
||||
|
||||
public Erithizon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
|
||||
this.subtype.add(SubType.BEAST);
|
||||
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Whenever Erithizon attacks, put a +1/+1 counter on target creature of defending player's choice.
|
||||
Ability ability = new AttacksTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
ability.setTargetAdjuster(ErithizonAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private Erithizon(final Erithizon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Erithizon copy() {
|
||||
return new Erithizon(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum ErithizonAdjuster implements TargetAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent();
|
||||
target.setAbilityController(ability.getControllerId());
|
||||
target.setTargetController(game.getCombat().getDefendingPlayerId(ability.getSourceId(), game));
|
||||
ability.getTargets().clear();
|
||||
ability.getTargets().add(target);
|
||||
}
|
||||
}
|
85
Mage.Sets/src/mage/cards/l/LeyLine.java
Normal file
85
Mage.Sets/src/mage/cards/l/LeyLine.java
Normal file
|
@ -0,0 +1,85 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author awjackson
|
||||
*/
|
||||
public final class LeyLine extends CardImpl {
|
||||
|
||||
public LeyLine(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
|
||||
|
||||
// At the beginning of each player's upkeep, that player may put a +1/+1 counter on target creature of their choice.
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new LeyLineEffect(), TargetController.ANY, false);
|
||||
ability.setTargetAdjuster(LeyLineAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private LeyLine(final LeyLine card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeyLine copy() {
|
||||
return new LeyLine(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum LeyLineAdjuster implements TargetAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent();
|
||||
target.setAbilityController(ability.getControllerId());
|
||||
target.setTargetController(game.getActivePlayerId());
|
||||
ability.getTargets().clear();
|
||||
ability.getTargets().add(target);
|
||||
}
|
||||
}
|
||||
|
||||
class LeyLineEffect extends OneShotEffect {
|
||||
|
||||
public LeyLineEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
staticText = "that player may put a +1/+1 counter on target creature of their choice";
|
||||
}
|
||||
|
||||
public LeyLineEffect(LeyLineEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (player == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (player.chooseUse(Outcome.BoostCreature, "Put a +1/+1 counter on " + permanent.getName() + "?", source, game)) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(), player.getId(), source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeyLineEffect copy() {
|
||||
return new LeyLineEffect(this);
|
||||
}
|
||||
}
|
|
@ -36,6 +36,7 @@ public final class MercadianMasques extends ExpansionSet {
|
|||
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("Bargaining Table", 288, Rarity.RARE, mage.cards.b.BargainingTable.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));
|
||||
|
@ -121,6 +122,7 @@ public final class MercadianMasques extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Embargo", 77, Rarity.RARE, mage.cards.e.Embargo.class));
|
||||
cards.add(new SetCardInfo("Energy Flux", 78, Rarity.UNCOMMON, mage.cards.e.EnergyFlux.class));
|
||||
cards.add(new SetCardInfo("Enslaved Horror", 134, Rarity.UNCOMMON, mage.cards.e.EnslavedHorror.class));
|
||||
cards.add(new SetCardInfo("Erithizon", 244, Rarity.RARE, mage.cards.e.Erithizon.class));
|
||||
cards.add(new SetCardInfo("Extortion", 135, Rarity.RARE, mage.cards.e.Extortion.class));
|
||||
cards.add(new SetCardInfo("Extravagant Spirit", 79, Rarity.RARE, mage.cards.e.ExtravagantSpirit.class));
|
||||
cards.add(new SetCardInfo("Eye of Ramos", 294, Rarity.RARE, mage.cards.e.EyeOfRamos.class));
|
||||
|
@ -194,6 +196,7 @@ public final class MercadianMasques extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Larceny", 143, Rarity.UNCOMMON, mage.cards.l.Larceny.class));
|
||||
cards.add(new SetCardInfo("Last Breath", 27, Rarity.UNCOMMON, mage.cards.l.LastBreath.class));
|
||||
cards.add(new SetCardInfo("Lava Runner", 200, Rarity.RARE, mage.cards.l.LavaRunner.class));
|
||||
cards.add(new SetCardInfo("Ley Line", 256, Rarity.UNCOMMON, mage.cards.l.LeyLine.class));
|
||||
cards.add(new SetCardInfo("Liability", 144, Rarity.RARE, mage.cards.l.Liability.class));
|
||||
cards.add(new SetCardInfo("Lightning Hounds", 201, Rarity.COMMON, mage.cards.l.LightningHounds.class));
|
||||
cards.add(new SetCardInfo("Lithophage", 202, Rarity.RARE, mage.cards.l.Lithophage.class));
|
||||
|
|
Loading…
Reference in a new issue