This commit is contained in:
BetaSteward 2010-12-02 04:40:21 +00:00
parent 53d7e5623b
commit 3384d27ea8
13 changed files with 107 additions and 64 deletions

View file

@ -28,7 +28,6 @@
package mage.abilities.common;
import java.io.ObjectStreamException;
import mage.Constants.Zone;
import mage.abilities.StaticAbility;
import mage.abilities.effects.EntersBattlefieldEffect;

View file

@ -78,17 +78,17 @@ public class EntersBattlefieldEffect extends ReplacementEffectImpl<EntersBattlef
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Spell spell = game.getStack().getSpell(event.getSourceId());
for (Effect effect: baseEffects) {
if (effect instanceof ContinuousEffect) {
if (spell != null)
game.addEffect((ContinuousEffect) effect, spell.getSpellAbility());
else
if (source.activate(game, false)) {
if (effect instanceof ContinuousEffect) {
game.addEffect((ContinuousEffect) effect, source);
}
else {
if (spell != null)
effect.apply(game, spell.getSpellAbility());
else
effect.apply(game, source);
}
}
else
if (spell != null)
effect.apply(game, spell.getSpellAbility());
else
effect.apply(game, source);
}
return false;
}

View file

@ -33,7 +33,6 @@ import mage.Constants.Duration;
import mage.Constants.Layer;
import mage.Constants.Outcome;
import mage.Constants.SubLayer;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.Card;

View file

@ -257,8 +257,8 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
PermanentCard permanent = new PermanentCard(this, controllerId);
game.getBattlefield().addPermanent(permanent);
game.setZone(objectId, Zone.BATTLEFIELD);
permanent.entersBattlefield(sourceId, game);
game.applyEffects();
permanent.entersBattlefield(sourceId, game);
game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));
return true;
}

View file

@ -106,8 +106,8 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
return false;
}
else {
result = card.putOntoBattlefield(game, Zone.HAND, ability.getId(), controllerId);
resolveKicker(game);
result = card.putOntoBattlefield(game, Zone.HAND, ability.getId(), controllerId);
return result;
}
}