*Fixed how state triggers could go on the stack twice if they triggered within the same checkStateEffects "cycle". Fixes Garruk Relentless' Transform trigger.

*Fixed other cases of double triggering and some code duplication.
*Fixed Max's Cut&Paste Deck importer' interaction with alternate card faces.
This commit is contained in:
Hellfish
2011-10-26 08:03:54 +00:00
parent 71a93a3b19
commit e033d9045e
4 changed files with 23 additions and 20 deletions

View File

@@ -136,6 +136,14 @@ public class GameAction {
if (copied.isToken() && !zone.is(Constant.Zone.Battlefield)) {
zone.remove(copied);
}
if (prev != null) {
if (prev.is(Constant.Zone.Battlefield) && c.isCreature()) {
AllZone.getCombat().removeFromCombat(c);
}
prev.remove(c);
}
HashMap<String, Object> runParams = new HashMap<String, Object>();
runParams.put("Card", lastKnownInfo);
@@ -152,14 +160,6 @@ public class GameAction {
AllZone.getTriggerHandler().clearSuppression("ChangesZone");
}
if (prev != null) {
if (prev.is(Constant.Zone.Battlefield) && c.isCreature()) {
AllZone.getCombat().removeFromCombat(c);
}
prev.remove(c);
}
/*
if (!(c.isToken() || suppress || zone.is(Constant.Zone.Battlefield)) && !zone.is(Constant.Zone.Battlefield))
copied = AllZone.getCardFactory().copyCard(copied);

View File

@@ -1294,6 +1294,12 @@ public class MagicStack extends MyObservable {
return true;
}
}
for(SpellAbility sa : simultaneousStackEntryList) {
if(sa.getSourceTrigger() == triggerID) {
return true;
}
}
return false;
}

View File

@@ -870,17 +870,9 @@ public abstract class Player extends GameEntity {
Card[] cards = zone == Zone.Stack ? AllZone.getStackZone().getCards() : getZone(zone).getCards();
return new CardList(cards);
}
private static ArrayList<Zone> allZones = new ArrayList<Zone>();
static {
for(Zone z : Constant.Zone.values()) {
allZones.add(z);
}
}
public CardList getAllCards() {
return getCardsIn(allZones);
return getCardsIn(ALL_ZONES);
}
public CardList getCardsIncludePhasingIn(final Constant.Zone zone) {

View File

@@ -30,6 +30,7 @@ import forge.deck.DeckRecognizer;
import forge.deck.DeckRecognizer.TokenType;
import forge.game.GameType;
import forge.gui.GuiUtils;
import forge.item.CardPrinted;
/**
* Dialog for quick import of decks
@@ -176,10 +177,14 @@ public class DeckImport extends JDialog {
DeckRecognizer.TokenType type = t.getType();
if (type == DeckRecognizer.TokenType.SectionName && t.getText().toLowerCase().contains("side") ) { isMain = false; }
if (type != DeckRecognizer.TokenType.KnownCard) { continue; }
CardPrinted crd = t.getCard();
if(crd.isAlternate()) {
continue;
}
if (isMain) {
result.addMain(t.getCard(), t.getNumber());
result.addMain(crd, t.getNumber());
} else {
result.addSideboard(t.getCard(), t.getNumber());
result.addSideboard(crd, t.getNumber());
}
}
return result;