- Spells cast with Isochron Scepter can now be kicked (and buybacked, etc.).

This commit is contained in:
Sloth
2012-10-17 13:08:33 +00:00
parent 6653e937b7
commit 16dfb95a16
6 changed files with 22 additions and 28 deletions

View File

@@ -1969,7 +1969,6 @@ public class GameAction {
if (sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
manaCost = new ManaCost("0");
} else {
manaCost = this.getSpellCostChange(sa, new ManaCost(sa.getManaCost()));
}
if (manaCost.isPaid() && (sa.getBeforePayMana() == null)) {
@@ -2027,7 +2026,6 @@ public class GameAction {
if (sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
manaCost = new ManaCost("0");
} else {
manaCost = this.getSpellCostChange(sa, new ManaCost(sa.getManaCost()));
}
if (manaCost.isPaid() && (sa.getBeforePayMana() == null)) {

View File

@@ -467,11 +467,18 @@ public final class AbilityFactoryPlay {
ArrayList<SpellAbility> spellAbilities = tgtCard.getBasicSpells();
ArrayList<SpellAbility> sas = new ArrayList<SpellAbility>();
for (SpellAbility s : spellAbilities) {
s.setActivatingPlayer(controller);
SpellAbilityRestriction res = s.getRestrictions();
final SpellAbility newSA = s.copy();
newSA.setActivatingPlayer(controller);
SpellAbilityRestriction res = new SpellAbilityRestriction();
// timing restrictions still apply
if (res.checkTimingRestrictions(tgtCard, s)) {
sas.add(s);
res.setPlayerTurn(s.getRestrictions().getPlayerTurn());
res.setOpponentTurn(s.getRestrictions().getOpponentTurn());
res.setPhases(s.getRestrictions().getPhases());
res.setZone(null);
newSA.setRestrictions(res);
// timing restrictions still apply
if (res.checkTimingRestrictions(tgtCard, newSA)) {
sas.add(newSA);
}
}
if (sas.isEmpty()) {

View File

@@ -28,6 +28,8 @@ import forge.CardCharacteristicName;
import forge.CardUtil;
import forge.Singletons;
import forge.card.CardRules;
import forge.card.cost.Cost;
import forge.card.mana.ManaCost;
import forge.card.spellability.Spell;
import forge.card.spellability.SpellAbility;
import forge.card.spellability.SpellPermanent;
@@ -155,10 +157,6 @@ public class CardFactory implements CardFactoryInterface {
final boolean bCopyDetails) {
Player originalController = original.getController();
Player controller = sa.getActivatingPlayer();
/*if (sa.getPayCosts() == null) {
this.copySpellontoStack(source, original, bCopyDetails);
return;
}*/
final Card c = AllZone.getCardFactory().copyCard(original);
// change the color of the copy (eg: Fork)
@@ -185,16 +183,12 @@ public class CardFactory implements CardFactoryInterface {
c.refreshUniqueNumber();
final SpellAbility copySA = sa.copy();
//remove all costs
copySA.setPayCosts(new Cost(c, "", sa.isAbility()));
if (sa.getTarget() != null) {
Target target = new Target(sa.getTarget());
target.setSourceCard(c);
copySA.setTarget(target);
/*if (copySA.getAbilityFactory() != null) {
AbilityFactory af = new AbilityFactory(sa.getAbilityFactory());
af.setAbTgt(target);
af.setHostCard(source);
copySA.setAbilityFactory(af);
}*/
}
copySA.setSourceCard(c);

View File

@@ -189,10 +189,11 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
}
PlayerZone cardZone = AllZone.getZoneOf(c);
Player activator = sa.getActivatingPlayer();
if (!cardZone.is(this.getZone())) {
if (cardZone == null || !cardZone.is(this.getZone())) {
// If Card is not in the default activating zone, do some additional checks
// Not a Spell, or on Battlefield, return false
if (!sa.isSpell() || cardZone.is(ZoneType.Battlefield) || !this.getZone().equals(ZoneType.Hand)) {
if (!sa.isSpell() || (cardZone != null && ZoneType.Battlefield.equals(cardZone.getZoneType()))
|| !this.getZone().equals(ZoneType.Hand)) {
return false;
}
if (c.hasKeyword("May be played") && activator.equals(c.getController())) {

View File

@@ -130,9 +130,7 @@ public class InputPayManaCost extends InputMana {
AllZone.getStack().add(this.spell);
}
} else {
this.manaCost = manaCostToPay; // Singletons.getModel().getGameAction().getSpellCostChange(sa,
// new
// ManaCost(this.originalManaCost));
this.manaCost = manaCostToPay;
}
} else {
this.manaCost = new ManaCost(sa.getManaCost());

View File

@@ -471,13 +471,9 @@ public class InputPayManaCostUtil {
final ManaCost manaCost;
if (PhaseHandler.getGameBegins() == 1) {
if (sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
manaCost = new ManaCost("0");
} else {
final String mana = costMana.getManaToPay();
manaCost = new ManaCost(mana);
manaCost.increaseColorlessMana(manaToAdd);
}
final String mana = costMana.getManaToPay();
manaCost = new ManaCost(mana);
manaCost.increaseColorlessMana(manaToAdd);
} else {
System.out.println("Is input_payMana ever called when the Game isn't in progress?");
manaCost = new ManaCost(sa.getManaCost());