Merge origin/master

This commit is contained in:
LevelX2 2016-08-11 17:41:57 +02:00
commit 318a0745f0
4 changed files with 232 additions and 7 deletions

View file

@ -625,6 +625,13 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
@Override
public boolean changeControllerId(UUID controllerId, Game game) {
Player newController = game.getPlayer(controllerId);
GameEvent loseControlEvent = GameEvent.getEvent(GameEvent.EventType.LOSE_CONTROL, this.getId(), null, controllerId);
if (game.replaceEvent(loseControlEvent)) {
return false;
}
if (newController != null && (!newController.hasLeft() || !newController.hasLost())) {
this.controllerId = controllerId;
return true;