- Fix targeting SubAbility issue incorrect fizzling

This commit is contained in:
Sol
2012-08-19 20:19:46 +00:00
parent c80a291d06
commit 79fbb2e8bb
2 changed files with 8 additions and 4 deletions

View File

@@ -931,7 +931,7 @@ public class MagicStack extends MyObservable {
final Card source = sa.getSourceCard();
curResolvingCard = source;
if (this.hasFizzled(sa, source)) { // Fizzle
if (this.hasFizzled(sa, source, false)) { // Fizzle
// TODO: Spell fizzles, what's the best way to alert player?
Log.debug(source.getName() + " ability fizzles.");
AllZone.getGameLog().add("ResolveStack", source.getName() + " ability fizzles.", 2);
@@ -1162,7 +1162,7 @@ public class MagicStack extends MyObservable {
* a {@link forge.Card} object.
* @return a boolean.
*/
public final boolean hasFizzled(final SpellAbility sa, final Card source) {
public final boolean hasFizzled(final SpellAbility sa, final Card source, final boolean parentFizzled) {
// Can't fizzle unless there are some targets
boolean fizzle = false;
@@ -1219,12 +1219,16 @@ public class MagicStack extends MyObservable {
else if (sa.getTargetPlayer() != null) {
fizzle = !sa.getTargetPlayer().canBeTargetedBy(sa);
}
else {
// Set fizzle to the same as the parent if there's no target info
fizzle = parentFizzled;
}
if (sa.getSubAbility() == null) {
return fizzle;
}
return hasFizzled(sa.getSubAbility(), source) && fizzle;
return hasFizzled(sa.getSubAbility(), source, fizzle) && fizzle;
}
/**

View File

@@ -116,7 +116,7 @@ public class ControlWinLose {
} else { //compy won
CardList humanAntes = AllZone.getHumanPlayer().getCardsIn(ZoneType.Ante);
//remove compy's ante cards form his deck
//remove humans ante cards form his deck
for (Card c : humanAntes) {
CardPrinted toRemove = CardDb.instance().getCard(c);
hDeck.getMain().remove(toRemove);