mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00: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.condition.Condition;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
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
|
||||
*/
|
||||
|
@ -42,7 +42,8 @@ public class CommanderInPlayCondition implements Condition {
|
|||
|
||||
private static CommanderInPlayCondition fInstance = null;
|
||||
|
||||
private CommanderInPlayCondition() {}
|
||||
private CommanderInPlayCondition() {
|
||||
}
|
||||
|
||||
public static Condition getInstance() {
|
||||
if (fInstance == null) {
|
||||
|
@ -55,7 +56,8 @@ public class CommanderInPlayCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
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;
|
||||
}
|
||||
|
@ -65,4 +67,4 @@ public class CommanderInPlayCondition implements Condition {
|
|||
return "As long as you control your commander";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue