mirror of
https://github.com/correl/mage.git
synced 2024-11-29 03:00:12 +00:00
Merge origin/master
This commit is contained in:
commit
4cf957a4a9
2 changed files with 4 additions and 4 deletions
|
@ -103,10 +103,7 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject {
|
|||
@Override
|
||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||
StackObject stackObject = game.getStack().getStackObject(id);
|
||||
if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return (stackObject instanceof Spell) || (stackObject instanceof StackAbility);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -105,6 +105,9 @@ public class SpellStack extends ArrayDeque<StackObject> {
|
|||
counteredObjectName = "Ability (" + stackObject.getStackAbility().getRule(targetSourceName) + ") of " + targetSourceName;
|
||||
}
|
||||
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);
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(counteredObjectName + " is countered by " + sourceObject.getLogName());
|
||||
|
|
Loading…
Reference in a new issue