- Fix for Aluren. Cleanup.

This commit is contained in:
Sloth
2012-02-05 10:26:00 +00:00
parent 2458eb8c71
commit 667d42960f
4 changed files with 10 additions and 8 deletions

View File

@@ -1881,10 +1881,10 @@ public class GameAction {
// for uncastables like lotus bloom, check if manaCost is blank
sa.setActivatingPlayer(human);
if (sa.canPlay() && (!sa.isSpell() || !sa.getManaCost().equals(""))) {
boolean flashb = false;
boolean extraMode = false;
// check for flashback keywords
if (c.isInZone(Constant.Zone.Graveyard) && sa.isSpell() && (c.isInstant() || c.isSorcery())) {
if (zone.is(Constant.Zone.Graveyard) && sa.isSpell() && (c.isInstant() || c.isSorcery())) {
for (final String keyword : c.getKeyword()) {
if (keyword.startsWith("Flashback")) {
final SpellAbility flashback = sa.copy();
@@ -1898,7 +1898,7 @@ public class GameAction {
}
choices.add(flashback.toString());
map.put(flashback.toString(), flashback);
flashb = true;
extraMode = true;
}
}
}
@@ -1916,9 +1916,10 @@ public class GameAction {
newSA.setDescription(sa.getDescription() + " (without paying its mana cost)");
choices.add(newSA.toString());
map.put(newSA.toString(), newSA);
extraMode = true;
}
SpellAbilityRestriction restrictions = sa.getRestrictions();
if (restrictions != null && restrictions.checkZoneRestrictions(zone, c, sa)) {
if (!extraMode || (restrictions != null && restrictions.checkZoneRestrictions(zone, c, sa))) {
choices.add(sa.toString());
map.put(sa.toString(), sa);
}

View File

@@ -95,7 +95,8 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
final Player activator = this.getActivatingPlayer();
if (!(card.isInstant() || card.hasKeyword("Flash") || PhaseHandler.canCastSorcery(activator))) {
if (!(card.isInstant() || card.hasKeyword("Flash") || PhaseHandler.canCastSorcery(activator)
|| card.hasKeyword("May be played without paying its mana cost and as though it has flash"))) {
return false;
}

View File

@@ -180,7 +180,7 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
this.setSvarOperand(params.get("SVarCompare").substring(2));
}
} // end setRestrictions()
/**
* <p>
* checkZoneRestrictions.
@@ -228,7 +228,7 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
if (!checkZoneRestrictions(cardZone, c, sa)) {
if (!sa.isSpell() || cardZone.is(Zone.Battlefield) || !this.getZone().equals(Zone.Hand)) {
return false;
} else if (!c.hasStartOfKeyword("May be played")
} else if (!c.hasKeyword("May be played without paying its mana cost")
&& !(c.hasStartOfKeyword("Flashback") && cardZone.is(Zone.Graveyard))) {
return false;
}