Fix for LKI. Ratchet Bomb works.

This commit is contained in:
magenoxx 2011-01-20 18:47:26 +03:00
parent 465e8c3093
commit 4adc937b3c
3 changed files with 34 additions and 29 deletions

View file

@ -87,15 +87,17 @@ public class RatchetBomb extends CardImpl<RatchetBomb> {
Permanent p = game.getBattlefield().getPermanent(source.getSourceId());
if (p == null) {
p = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
if (p == null)
if (p == null) {
return false;
}
}
int count = p.getCounters().getCount(CounterType.CHARGE);
for (Permanent perm: game.getBattlefield().getAllActivePermanents()) {
if (perm.getManaCost().convertedManaCost() == count && !(perm.getCardType().contains(CardType.LAND)))
if (perm.getManaCost().convertedManaCost() == count && !(perm.getCardType().contains(CardType.LAND))) {
perm.destroy(source.getId(), game, false);
}
}
return true;
}

View file

@ -473,6 +473,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
@Override
public void playPriority(UUID activePlayerId) {
try {
while (!isGameOver()) {
state.getPlayers().resetPassed();
state.getPlayerList().setCurrent(activePlayerId);
@ -487,7 +488,6 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
player.priority(this);
if (isGameOver()) return;
applyEffects();
resetLKI();
}
if (isGameOver()) return;
if (allPassed()) {
@ -498,13 +498,15 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
state.getPlayers().resetPassed();
fireUpdatePlayersEvent();
break;
}
else
} else
return;
}
state.getPlayerList().getNext();
}
}
} finally {
resetLKI();
}
}
protected boolean allPassed() {

View file

@ -153,6 +153,7 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
if (!game.replaceEvent(event)) {
Card card = game.getCard(objectId);
Player owner = game.getPlayer(ownerId);
game.rememberLKI(objectId, Zone.BATTLEFIELD, this);
if (owner != null) {
switch (event.getToZone()) {
case GRAVEYARD: