mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 12:19:59 -08:00
New ConditionalMana support.
This commit is contained in:
parent
67a6c9dcf5
commit
ed3f96c668
58 changed files with 612 additions and 145 deletions
|
|
@ -93,7 +93,7 @@ class GhostlyPrisonReplacementEffect extends ReplacementEffectImpl<GhostlyPrison
|
|||
if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Constants.Outcome.Benefit, "Pay {2} to declare attacker?", game) )
|
||||
{
|
||||
propagandaTax.pay(game, this.getId(), event.getPlayerId(), false);
|
||||
propagandaTax.pay(source, game, this.getId(), event.getPlayerId(), false);
|
||||
|
||||
if ( propagandaTax.isPaid() ) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import mage.Constants.ColoredManaSymbol;
|
|||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.costs.mana.ColoredManaCost;
|
||||
|
|
@ -132,7 +133,7 @@ class AncientHellkiteCost extends CostImpl<AncientHellkiteCost> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
this.paid = true;
|
||||
return paid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class GreenhiltTraineeCost extends CostImpl<GreenhiltTraineeCost> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
this.paid = true;
|
||||
return paid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class NornsAnnexReplacementEffect extends ReplacementEffectImpl<NornsAnnexReplac
|
|||
ManaCostsImpl propagandaTax = new ManaCostsImpl("{WP}");
|
||||
if (propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Constants.Outcome.Benefit, "Pay {WP} to declare attacker?", game)) {
|
||||
propagandaTax.pay(game, this.getId(), event.getPlayerId(), false);
|
||||
propagandaTax.pay(source, game, this.getId(), event.getPlayerId(), false);
|
||||
|
||||
if (propagandaTax.isPaid()) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import mage.Constants.CardType;
|
|||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
|
|
@ -100,7 +101,7 @@ class BloodshotTraineeCost extends CostImpl<BloodshotTraineeCost> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
this.paid = true;
|
||||
return paid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class EmbersmithEffect extends OneShotEffect<EmbersmithEffect> {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Cost cost = new GenericManaCost(1);
|
||||
cost.clearPaid();
|
||||
if (cost.pay(game, source.getId(), source.getControllerId(), false)) {
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.damage(1, source.getId(), game, true, false);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class LeoninArbiterReplacementEffect extends ReplacementEffectImpl<LeoninArbiter
|
|||
if ( arbiterTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Neutral, "Pay {2} to search your library?", game) )
|
||||
{
|
||||
arbiterTax.pay(game, this.getId(), event.getPlayerId(), false);
|
||||
arbiterTax.pay(source, game, this.getId(), event.getPlayerId(), false);
|
||||
|
||||
if ( arbiterTax.isPaid() ) {
|
||||
paidPlayers.add(event.getPlayerId());
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class LifesmithEffect extends OneShotEffect<LifesmithEffect> {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Cost cost = new GenericManaCost(1);
|
||||
cost.clearPaid();
|
||||
if (cost.pay(game, source.getId(), source.getControllerId(), false)) {
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.gainLife(3, game);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class MyrBattlesphereAbility extends TriggeredAbilityImpl<MyrBattlesphereAbility
|
|||
public boolean checkInterveningIfClause(Game game) {
|
||||
if (costs.isPaid())
|
||||
return true;
|
||||
return costs.pay(game, this.getId(), this.getControllerId(), false);
|
||||
return costs.pay(this, game, this.getId(), this.getControllerId(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class MyrsmithEffect extends OneShotEffect<MyrsmithEffect> {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Cost cost = new GenericManaCost(1);
|
||||
cost.clearPaid();
|
||||
if (cost.pay(game, source.getId(), source.getControllerId(), false)) {
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
new MyrToken().putOntoBattlefield(game, source.getControllerId(), source.getControllerId());
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class NimDeathmantleEffect extends OneShotEffect<NimDeathmantleEffect> {
|
|||
if (player != null && equipment != null) {
|
||||
if (player.chooseUse(Constants.Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + "?", game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(game, source.getId(), source.getControllerId(), false)) {
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
UUID target = targetPointer.getFirst(source);
|
||||
if (target != null && equipment != null) {
|
||||
Card card = game.getCard(target);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class PainfulQuandryEffect extends OneShotEffect<PainfulQuandryEffect> {
|
|||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
Cost cost = new DiscardTargetCost(new TargetCardInHand());
|
||||
if (!cost.pay(game, player.getId(), player.getId(), false)) {
|
||||
if (!cost.pay(source, game, player.getId(), player.getId(), false)) {
|
||||
player.loseLife(5, game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class VigilForTheLostEffect extends OneShotEffect<VigilForTheLostEffect> {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
ManaCostsImpl cost = new ManaCostsImpl("{X}");
|
||||
cost.clearPaid();
|
||||
if (cost.pay(game, source.getId(), source.getControllerId(), false)) {
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
player.gainLife(((VariableCost)cost.getVariableCosts().get(0)).getAmount(), game);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class FlameblastDragonEffect extends OneShotEffect<FlameblastDragonEffect> {
|
|||
if (player != null) {
|
||||
if (player.chooseUse(Constants.Outcome.Damage, "Pay " + cost.getText() + "? If you do, Flameblast Dragon deals X damage to target creature or player", game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(game, source.getId(), source.getControllerId(), false)) {
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
int costX = ((VariableCost) cost.getVariableCosts().get(0)).getAmount();
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class PropagandaReplacementEffect extends ReplacementEffectImpl<PropagandaReplac
|
|||
if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Constants.Outcome.Neutral, "Pay {2} to declare attacker?", game) )
|
||||
{
|
||||
propagandaTax.pay(game, this.getId(), event.getPlayerId(), false);
|
||||
propagandaTax.pay(source, game, this.getId(), event.getPlayerId(), false);
|
||||
|
||||
if ( propagandaTax.isPaid() ) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class TectonicEdgeCost extends CostImpl<TectonicEdgeCost> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
this.paid = true;
|
||||
return paid;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue