Merge origin/master

This commit is contained in:
fireshoes 2015-11-05 09:05:50 -06:00
commit 4cf957a4a9
2 changed files with 4 additions and 4 deletions

View file

@ -103,10 +103,7 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject {
@Override @Override
public boolean canTarget(UUID id, Ability source, Game game) { public boolean canTarget(UUID id, Ability source, Game game) {
StackObject stackObject = game.getStack().getStackObject(id); StackObject stackObject = game.getStack().getStackObject(id);
if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) { return (stackObject instanceof Spell) || (stackObject instanceof StackAbility);
return true;
}
return false;
} }
@Override @Override

View file

@ -105,6 +105,9 @@ public class SpellStack extends ArrayDeque<StackObject> {
counteredObjectName = "Ability (" + stackObject.getStackAbility().getRule(targetSourceName) + ") of " + targetSourceName; counteredObjectName = "Ability (" + stackObject.getStackAbility().getRule(targetSourceName) + ") of " + targetSourceName;
} }
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) {
if (!(stackObject instanceof Spell)) { // spells are removed from stack by the card movement
this.remove(stackObject);
}
stackObject.counter(sourceId, game, zone, owner, onTop); stackObject.counter(sourceId, game, zone, owner, onTop);
if (!game.isSimulation()) { if (!game.isSimulation()) {
game.informPlayers(counteredObjectName + " is countered by " + sourceObject.getLogName()); game.informPlayers(counteredObjectName + " is countered by " + sourceObject.getLogName());