* Fixed a bug that self scope were checked for non relevant events (fixes #1350).

This commit is contained in:
LevelX2 2015-11-07 13:32:15 +01:00
parent b1c3d690f5
commit d596a1ef83
5 changed files with 38 additions and 32 deletions

View file

@ -131,7 +131,7 @@ class NayaSoulbeastReplacementEffect extends ReplacementEffectImpl {
public static final String SOURCE_CAST_SPELL_ABILITY = "sourceCastSpellAbility"; public static final String SOURCE_CAST_SPELL_ABILITY = "sourceCastSpellAbility";
public NayaSoulbeastReplacementEffect() { public NayaSoulbeastReplacementEffect() {
super(Duration.OneUse, Outcome.BoostCreature, true); super(Duration.OneUse, Outcome.BoostCreature);
staticText = "{this} enters the battlefield with X +1/+1 counters on it, where X is the total converted mana cost of all cards revealed this way"; staticText = "{this} enters the battlefield with X +1/+1 counters on it, where X is the total converted mana cost of all cards revealed this way";
} }

View file

@ -388,7 +388,9 @@ public class ContinuousEffects implements Serializable {
// for replacment effects of static abilities do not use LKI to check if to apply // for replacment effects of static abilities do not use LKI to check if to apply
if (ability.getAbilityType() != AbilityType.STATIC || ability.isInUseableZone(game, null, event)) { if (ability.getAbilityType() != AbilityType.STATIC || ability.isInUseableZone(game, null, event)) {
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) { if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
if (!game.getScopeRelevant() || effect.hasSelfScope() || !event.getTargetId().equals(ability.getSourceId())) { if (!game.getScopeRelevant()
|| effect.hasSelfScope()
|| !event.getTargetId().equals(ability.getSourceId())) {
if (effect.applies(event, ability, game)) { if (effect.applies(event, ability, game)) {
applicableAbilities.add(ability); applicableAbilities.add(ability);
} }

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.abilities.effects; package mage.abilities.effects;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -50,13 +49,19 @@ public abstract class ReplacementEffectImpl extends ContinuousEffectImpl impleme
// the resolution of spells or abilities that changed the permanent's characteristics on the stack // the resolution of spells or abilities that changed the permanent's characteristics on the stack
// (see rule 400.7a), and continuous effects from the permanent's own static abilities, but ignoring // (see rule 400.7a), and continuous effects from the permanent's own static abilities, but ignoring
// continuous effects from any other source that would affect it. // continuous effects from any other source that would affect it.
protected boolean selfScope; protected boolean selfScope;
public ReplacementEffectImpl(Duration duration, Outcome outcome) { public ReplacementEffectImpl(Duration duration, Outcome outcome) {
this(duration, outcome, true); this(duration, outcome, true);
} }
/**
*
* @param duration
* @param outcome
* @param selfScope - is only relevant while permanents entering the
* battlefield events
*/
public ReplacementEffectImpl(Duration duration, Outcome outcome, boolean selfScope) { public ReplacementEffectImpl(Duration duration, Outcome outcome, boolean selfScope) {
super(duration, outcome); super(duration, outcome);
this.effectType = EffectType.REPLACEMENT; this.effectType = EffectType.REPLACEMENT;

View file

@ -421,7 +421,7 @@ public interface Game extends MageItem, Serializable {
void cheat(UUID ownerId, List<Card> library, List<Card> hand, List<PermanentCard> battlefield, List<Card> graveyard); void cheat(UUID ownerId, List<Card> library, List<Card> hand, List<PermanentCard> battlefield, List<Card> graveyard);
// controlling the behaviour of replacement effects // controlling the behaviour of replacement effects while permanents entering the battlefield
void setScopeRelevant(boolean scopeRelevant); void setScopeRelevant(boolean scopeRelevant);
public boolean getScopeRelevant(); public boolean getScopeRelevant();

View file

@ -3094,7 +3094,6 @@ public abstract class PlayerImpl implements Player, Serializable {
game.addPermanent(permanent); game.addPermanent(permanent);
permanent.setZone(Zone.BATTLEFIELD, game); permanent.setZone(Zone.BATTLEFIELD, game);
game.getPermanentsEntering().remove(permanent.getId()); game.getPermanentsEntering().remove(permanent.getId());
game.setScopeRelevant(true);
successfulMovedCards.add(permanent); successfulMovedCards.add(permanent);
game.addSimultaneousEvent(new ZoneChangeEvent(permanent, permanent.getControllerId(), fromZone, Zone.BATTLEFIELD)); game.addSimultaneousEvent(new ZoneChangeEvent(permanent, permanent.getControllerId(), fromZone, Zone.BATTLEFIELD));
if (!game.isSimulation()) { if (!game.isSimulation()) {