mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Implemented Word of Command
This commit is contained in:
parent
b368d3f832
commit
d7da3930b6
7 changed files with 248 additions and 0 deletions
|
|
@ -59,6 +59,10 @@ public class LoseControlOnOtherPlayersControllerEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.resetOtherTurnsControlled();
|
||||
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.setGameUnderYourControl(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ public class Spell extends StackObjImpl implements Card {
|
|||
private boolean faceDown;
|
||||
private boolean countered;
|
||||
private boolean resolving = false;
|
||||
private UUID commandedBy = null; // for Word of Command
|
||||
|
||||
private boolean doneActivatingManaAbilities; // if this is true, the player is no longer allowed to pay the spell costs with activating of mana abilies
|
||||
|
||||
|
|
@ -147,6 +148,7 @@ public class Spell extends StackObjImpl implements Card {
|
|||
this.faceDown = spell.faceDown;
|
||||
this.countered = spell.countered;
|
||||
this.resolving = spell.resolving;
|
||||
this.commandedBy = spell.commandedBy;
|
||||
|
||||
this.doneActivatingManaAbilities = spell.doneActivatingManaAbilities;
|
||||
this.targetChanged = spell.targetChanged;
|
||||
|
|
@ -205,6 +207,12 @@ public class Spell extends StackObjImpl implements Card {
|
|||
return false;
|
||||
}
|
||||
this.resolving = true;
|
||||
if (commandedBy != null && !commandedBy.equals(getControllerId())) {
|
||||
Player turnController = game.getPlayer(commandedBy);
|
||||
if (turnController != null) {
|
||||
turnController.controlPlayersTurn(game, controller.getId());
|
||||
}
|
||||
}
|
||||
if (this.isInstant() || this.isSorcery()) {
|
||||
int index = 0;
|
||||
result = false;
|
||||
|
|
@ -1050,4 +1058,8 @@ public class Spell extends StackObjImpl implements Card {
|
|||
throw new UnsupportedOperationException("Not supported."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
public void setCommandedBy(UUID playerId) {
|
||||
this.commandedBy = playerId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue