removal of setBeforePayMana

This commit is contained in:
Maxmtg
2013-03-20 04:39:23 +00:00
parent a0de29bc13
commit 10389722dc
5 changed files with 5 additions and 59 deletions

View File

@@ -14,7 +14,6 @@ import forge.card.spellability.SpellAbility;
import forge.card.spellability.Target; import forge.card.spellability.Target;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.gui.GuiChoose;
import forge.util.Aggregates; import forge.util.Aggregates;
public class ChooseCardEffect extends SpellAbilityEffect { public class ChooseCardEffect extends SpellAbilityEffect {

View File

@@ -23,11 +23,8 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Vector;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import forge.Card; import forge.Card;
@@ -41,18 +38,14 @@ import forge.card.CardType;
import forge.card.cost.Cost; import forge.card.cost.Cost;
import forge.card.spellability.Spell; import forge.card.spellability.Spell;
import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbility;
import forge.control.input.Input;
import forge.control.input.InputPayManaExecuteCommands; import forge.control.input.InputPayManaExecuteCommands;
import forge.control.input.InputPayManaSimple;
import forge.game.GameState; import forge.game.GameState;
import forge.game.ai.ComputerUtil; import forge.game.ai.ComputerUtil;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.player.PlayerUtil; import forge.game.player.PlayerUtil;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.gui.GuiChoose; import forge.gui.GuiChoose;
import forge.gui.match.CMatchUI;
import forge.util.Aggregates; import forge.util.Aggregates;
import forge.view.ButtonUtil;
/** /**
* <p> * <p>

View File

@@ -35,7 +35,6 @@ import forge.card.cost.CostPart;
import forge.card.cost.CostPartMana; import forge.card.cost.CostPartMana;
import forge.card.mana.Mana; import forge.card.mana.Mana;
import forge.card.mana.ManaCost; import forge.card.mana.ManaCost;
import forge.control.input.Input;
import forge.game.player.AIPlayer; import forge.game.player.AIPlayer;
import forge.game.player.Player; import forge.game.player.Player;
@@ -83,8 +82,6 @@ public abstract class SpellAbility implements ISpellAbility {
private boolean cycling = false; private boolean cycling = false;
private boolean delve = false; private boolean delve = false;
private Input beforePayMana;
/** The pay costs. */ /** The pay costs. */
private Cost payCosts = null; private Cost payCosts = null;
@@ -557,29 +554,6 @@ public abstract class SpellAbility implements ISpellAbility {
} }
// begin - Input methods // begin - Input methods
/**
* <p>
* Getter for the field <code>beforePayMana</code>.
* </p>
*
* @return a {@link forge.control.input.Input} object.
*/
public Input getBeforePayMana() {
return this.beforePayMana;
}
/**
* <p>
* Setter for the field <code>beforePayMana</code>.
* </p>
*
* @param in
* a {@link forge.control.input.Input} object.
*/
public void setBeforePayMana(final Input in) {
this.beforePayMana = in;
}
/** /**
* <p> * <p>
* Getter for the field <code>payCosts</code>. * Getter for the field <code>payCosts</code>.

View File

@@ -16,7 +16,6 @@ import forge.card.spellability.ISpellAbility;
import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbility;
import forge.card.spellability.SpellAbilityRestriction; import forge.card.spellability.SpellAbilityRestriction;
import forge.card.spellability.Target; import forge.card.spellability.Target;
import forge.control.input.Input;
import forge.game.GameState; import forge.game.GameState;
import forge.game.ai.ComputerUtil; import forge.game.ai.ComputerUtil;
import forge.game.player.AIPlayer; import forge.game.player.AIPlayer;
@@ -154,11 +153,6 @@ public class WrappedAbility extends Ability implements ISpellAbility {
return sa.getActivatingPlayer(); return sa.getActivatingPlayer();
} }
@Override
public Input getBeforePayMana() {
return sa.getBeforePayMana();
}
@Override @Override
public String getDescription() { public String getDescription() {
return sa.getDescription(); return sa.getDescription();
@@ -280,11 +274,6 @@ public class WrappedAbility extends Ability implements ISpellAbility {
sa.setActivatingPlayer(player); sa.setActivatingPlayer(player);
} }
@Override
public void setBeforePayMana(final Input in) {
sa.setBeforePayMana(in);
}
@Override @Override
public void setDescription(final String s) { public void setDescription(final String s) {
sa.setDescription(s); sa.setDescription(s);

View File

@@ -16,7 +16,6 @@ import forge.card.ability.ApiType;
import forge.card.ability.effects.CharmEffect; import forge.card.ability.effects.CharmEffect;
import forge.card.cost.Cost; import forge.card.cost.Cost;
import forge.card.cost.CostPayment; import forge.card.cost.CostPayment;
import forge.card.mana.ManaCost;
import forge.card.mana.ManaCostBeingPaid; import forge.card.mana.ManaCostBeingPaid;
import forge.card.mana.ManaCostShard; import forge.card.mana.ManaCostShard;
import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbility;
@@ -85,7 +84,7 @@ public class GameActionPlay {
final SpellAbilityRequirements req = new SpellAbilityRequirements(sa, ts, payment); final SpellAbilityRequirements req = new SpellAbilityRequirements(sa, ts, payment);
req.setFree(true); req.setFree(true);
req.fillRequirements(); req.fillRequirements();
} else if (sa.getBeforePayMana() == null) { } else {
if (sa.isSpell()) { if (sa.isSpell()) {
final Card c = sa.getSourceCard(); final Card c = sa.getSourceCard();
if (!c.isCopiedSpell()) { if (!c.isCopiedSpell()) {
@@ -95,9 +94,6 @@ public class GameActionPlay {
boolean x = sa.getSourceCard().getManaCost().getShardCount(ManaCostShard.X) > 0; boolean x = sa.getSourceCard().getManaCost().getShardCount(ManaCostShard.X) > 0;
game.getStack().add(sa, x); game.getStack().add(sa, x);
} else {
sa.setManaCost(ManaCost.ZERO); // Beached As
matchInput.setInput(sa.getBeforePayMana());
} }
} }
@@ -407,17 +403,14 @@ public class GameActionPlay {
} else { } else {
manaCost = this.getSpellCostChange(sa, new ManaCostBeingPaid(sa.getManaCost())); manaCost = this.getSpellCostChange(sa, new ManaCostBeingPaid(sa.getManaCost()));
} }
if (manaCost.isPaid() && (sa.getBeforePayMana() == null)) { if (manaCost.isPaid()) {
if (sa.isSpell() && !source.isCopiedSpell()) { if (sa.isSpell() && !source.isCopiedSpell()) {
sa.setSourceCard(game.getAction().moveToStack(source)); sa.setSourceCard(game.getAction().moveToStack(source));
} }
game.getStack().add(sa); game.getStack().add(sa);
return;
} else if (sa.getBeforePayMana() == null) {
matchInput.setInput(new InputPayManaSimple(game, sa, manaCost));
} else { } else {
matchInput.setInput(sa.getBeforePayMana()); matchInput.setInput(new InputPayManaSimple(game, sa, manaCost));
} }
} }
} }
@@ -453,13 +446,11 @@ public class GameActionPlay {
} else { } else {
manaCost = this.getSpellCostChange(sa, new ManaCostBeingPaid(sa.getManaCost())); manaCost = this.getSpellCostChange(sa, new ManaCostBeingPaid(sa.getManaCost()));
} }
if (manaCost.isPaid() && (sa.getBeforePayMana() == null)) { if (manaCost.isPaid()) {
AbilityUtils.resolve(sa, false); AbilityUtils.resolve(sa, false);
return; return;
} else if (sa.getBeforePayMana() == null) {
matchInput.setInput(new InputPayManaSimple(game, sa, true));
} else { } else {
matchInput.setInput(sa.getBeforePayMana()); matchInput.setInput(new InputPayManaSimple(game, sa, true));
} }
} }
} }