forked from External/mage
cheats: added default commands to take and remove control over another player (related to #12878)
This commit is contained in:
parent
c076f4925f
commit
5626c5f932
4 changed files with 46 additions and 4 deletions
|
|
@ -248,7 +248,6 @@ public class Turn implements Serializable {
|
|||
// add new under control
|
||||
TurnMod newControllerMod = game.getState().getTurnMods().useNextNewController(activePlayerId);
|
||||
if (newControllerMod != null && !newControllerMod.getNewControllerId().equals(activePlayerId)) {
|
||||
// set player under new control
|
||||
// game logs added in child's call (controlPlayersTurn)
|
||||
game.getPlayer(newControllerMod.getNewControllerId()).controlPlayersTurn(game, activePlayerId, newControllerMod.getInfo());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,14 @@ public class TurnMods extends ArrayList<TurnMod> implements Serializable, Copyab
|
|||
}
|
||||
|
||||
public TurnMod useNextNewController(UUID playerId) {
|
||||
// 720.1a
|
||||
// Multiple player-controlling effects that affect the same player overwrite each other.
|
||||
// The last one to be created is the one that works.
|
||||
//
|
||||
// 720.1b
|
||||
// If a turn is skipped, any pending player-controlling effects wait until the player
|
||||
// who would be affected actually takes a turn.
|
||||
|
||||
TurnMod lastNewControllerMod = null;
|
||||
|
||||
// find last/actual mod
|
||||
|
|
|
|||
|
|
@ -1380,7 +1380,7 @@ public final class CardUtil {
|
|||
public static void takeControlUnderPlayerEnd(Game game, Ability source, Player controller, Player playerUnderControl) {
|
||||
playerUnderControl.setGameUnderYourControl(true, false);
|
||||
if (!playerUnderControl.getTurnControlledBy().equals(controller.getId())) {
|
||||
game.informPlayers(controller + " return control of the turn to " + playerUnderControl.getLogName() + CardUtil.getSourceLogName(game, source));
|
||||
game.informPlayers(controller.getLogName() + " return control of the turn to " + playerUnderControl.getLogName() + CardUtil.getSourceLogName(game, source));
|
||||
controller.getPlayersUnderYourControl().remove(playerUnderControl.getId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue