* Batterskull - Fixed effect handling so that the Germ token no longer dies before the equipment from living weapon is attached.

This commit is contained in:
LevelX2 2014-06-02 15:03:14 +02:00
parent c9db56d189
commit 7af040e70b
3 changed files with 82 additions and 6 deletions

View file

@ -10,6 +10,7 @@ import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.players.Player;
public class LivingWeaponAbility extends EntersBattlefieldTriggeredAbility {
public LivingWeaponAbility() {
@ -42,11 +43,15 @@ class LivingWeaponEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
GermToken token = new GermToken();
token.putOntoBattlefield(1, game, source.getId(), source.getControllerId());
Permanent p = game.getPermanent(token.getLastAddedToken());
if (p != null) {
p.addAttachment(source.getSourceId(), game);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
GermToken token = new GermToken();
token.putOntoBattlefield(1, game, source.getId(), source.getControllerId());
Permanent p = game.getPermanent(token.getLastAddedToken());
if (p != null) {
p.addAttachment(source.getSourceId(), game);
return true;
}
}
return false;
}

View file

@ -1120,7 +1120,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
state.getStack().remove(top);
while (state.hasSimultaneousEvents()) {
state.handleSimultaneousEvent(this);
checkStateAndTriggered();
checkTriggered();
}
}
}