* Polis Crusher - Fixed that it can't be the target of enchantments.

* Polis Crusher - Fixed that the targeted enchantment of it's second ability was chosen too late during resolution.
This commit is contained in:
LevelX2 2014-02-27 16:42:44 +01:00
parent 5a454cfad2
commit 8fa23501ee
5 changed files with 52 additions and 56 deletions

View file

@ -3,6 +3,7 @@ package mage.abilities.decorator;
import mage.abilities.TriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.condition.Condition;
import mage.abilities.effects.Effects;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -51,10 +52,7 @@ public class ConditionalTriggeredAbility extends TriggeredAbilityImpl<Conditiona
public boolean checkTrigger(GameEvent event, Game game) {
ability.setSourceId(this.getSourceId());
ability.setControllerId(this.getControllerId());
if (ability.checkTrigger(event, game)) {
return true;
}
return false;
return ability.checkTrigger(event, game);
}
@Override
@ -64,4 +62,10 @@ public class ConditionalTriggeredAbility extends TriggeredAbilityImpl<Conditiona
}
return text;
}
@Override
public Effects getEffects() {
return ability.getEffects();
}
}

View file

@ -121,7 +121,7 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl<GainAbilityTar
}
StringBuilder sb = new StringBuilder();
Target target = mode.getTargets().get(0);
if(target.getNumberOfTargets() > 1){
if(target.getMaxNumberOfTargets() > 1){
if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) {
sb.append("Up to");
}

View file

@ -39,12 +39,12 @@ import mage.cards.Card;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import static mage.constants.Layer.TypeChangingEffects_4;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;

View file

@ -97,8 +97,8 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
protected int maxBlockedBy = 0;
protected boolean loyaltyUsed;
protected boolean deathtouched;
protected List<UUID> attachments = new ArrayList<UUID>();
protected Map<String, List<UUID>> connectedCards = new HashMap<String, List<UUID>>();
protected List<UUID> attachments = new ArrayList<>();
protected Map<String, List<UUID>> connectedCards = new HashMap<>();
protected List<UUID> dealtDamageByThisTurn;
protected UUID attachedTo;
protected UUID pairedCard;
@ -139,9 +139,9 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
this.connectedCards.put(entry.getKey(), entry.getValue());
}
if (permanent.dealtDamageByThisTurn != null) {
dealtDamageByThisTurn = new ArrayList<UUID>(permanent.dealtDamageByThisTurn);
dealtDamageByThisTurn = new ArrayList<>(permanent.dealtDamageByThisTurn);
if (permanent.markedDamage != null) {
markedDamage = new ArrayList<Counter>();
markedDamage = new ArrayList<>();
for (Counter counter : permanent.markedDamage) {
markedDamage.add(counter.copy());
}
@ -552,7 +552,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
if (this.connectedCards.containsKey(key)) {
this.connectedCards.get(key).add(connectedCard);
} else {
List<UUID> list = new ArrayList<UUID>();
List<UUID> list = new ArrayList<>();
list.add(connectedCard);
this.connectedCards.put(key, list);
}
@ -643,7 +643,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
deathtouched = true;
}
if (dealtDamageByThisTurn == null) {
dealtDamageByThisTurn = new ArrayList<UUID>();
dealtDamageByThisTurn = new ArrayList<>();
}
dealtDamageByThisTurn.add(sourceId);
}
@ -736,7 +736,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
private void markDamage(Counter counter) {
if (markedDamage == null) {
markedDamage = new ArrayList<Counter>();
markedDamage = new ArrayList<>();
}
markedDamage.add(counter);
}
@ -1001,7 +1001,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
if (connectedCards.containsKey("imprint")) {
this.connectedCards.get("imprint").add(imprintedCard);
} else {
List<UUID> imprinted = new ArrayList<UUID>();
List<UUID> imprinted = new ArrayList<>();
imprinted.add(imprintedCard);
this.connectedCards.put("imprint", imprinted);
}