mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
[HOU] Nimble Obstructionist - Fixed that the Cycle ability blocked the game if no valid target to counter is on the stack (fixes +3615).
This commit is contained in:
parent
16e7e3a346
commit
28cfbad76a
1 changed files with 126 additions and 124 deletions
|
@ -24,8 +24,7 @@
|
||||||
* The views and conclusions contained in the software and documentation are those of the
|
* The views and conclusions contained in the software and documentation are those of the
|
||||||
* 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.target.common;
|
package mage.target.common;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -40,8 +39,6 @@ import mage.game.Game;
|
||||||
import mage.game.stack.StackObject;
|
import mage.game.stack.StackObject;
|
||||||
import mage.target.TargetObject;
|
import mage.target.TargetObject;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class TargetActivatedOrTriggeredAbility extends TargetObject {
|
public class TargetActivatedOrTriggeredAbility extends TargetObject {
|
||||||
|
|
||||||
protected final FilterStackObject filter;
|
protected final FilterStackObject filter;
|
||||||
|
@ -63,7 +60,6 @@ public class TargetActivatedOrTriggeredAbility extends TargetObject {
|
||||||
this.filter = target.filter.copy();
|
this.filter = target.filter.copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||||
// rule 114.4. A spell or ability on the stack is an illegal target for itself.
|
// rule 114.4. A spell or ability on the stack is an illegal target for itself.
|
||||||
|
@ -77,7 +73,13 @@ public class TargetActivatedOrTriggeredAbility extends TargetObject {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||||
return canChoose(sourceControllerId, game);
|
for (StackObject stackObject : game.getStack()) {
|
||||||
|
if (isActivatedOrTriggeredAbility(stackObject)
|
||||||
|
&& filter.match(stackObject, sourceId, sourceControllerId, game)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue