Cards compatibility with oathbreaker format;

This commit is contained in:
Oleg Agafonov 2019-05-27 17:21:17 +04:00
parent e1259d0dd6
commit 913ee65f36
22 changed files with 99 additions and 46 deletions

View file

@ -1,8 +1,8 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.constants.CommanderCardType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -22,7 +22,7 @@ public enum CommanderInPlayCondition implements Condition {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (UUID commanderId : controller.getCommandersIds()) {
for (UUID commanderId : game.getCommandersIds(controller, CommanderCardType.COMMANDER_OR_OATHBREAKER)) {
Permanent commander = game.getPermanent(commanderId);
if (commander != null && commander.isControlledBy(source.getControllerId())) {
return true;