mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
* Lieutenant - Fixed that the Lieutenant effects were also applied if the commander was controlled by another player as the commander owner.
This commit is contained in:
parent
4774015343
commit
447e42409b
1 changed files with 7 additions and 5 deletions
|
|
@ -30,11 +30,11 @@ package mage.abilities.condition.common;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the player has its commander in play
|
* Checks if the player has its commander in play and controls it
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
|
|
@ -42,7 +42,8 @@ public class CommanderInPlayCondition implements Condition {
|
||||||
|
|
||||||
private static CommanderInPlayCondition fInstance = null;
|
private static CommanderInPlayCondition fInstance = null;
|
||||||
|
|
||||||
private CommanderInPlayCondition() {}
|
private CommanderInPlayCondition() {
|
||||||
|
}
|
||||||
|
|
||||||
public static Condition getInstance() {
|
public static Condition getInstance() {
|
||||||
if (fInstance == null) {
|
if (fInstance == null) {
|
||||||
|
|
@ -55,7 +56,8 @@ public class CommanderInPlayCondition implements Condition {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
return game.getPermanent(controller.getCommanderId()) != null;
|
Permanent commander = game.getPermanent(controller.getCommanderId());
|
||||||
|
return commander != null && commander.getControllerId().equals(source.getControllerId());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -65,4 +67,4 @@ public class CommanderInPlayCondition implements Condition {
|
||||||
return "As long as you control your commander";
|
return "As long as you control your commander";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue