Merge pull request #4993 from Zzooouhh/Zzooouhh-woc

Implemented Word of Command (presumably buggy)
This commit is contained in:
LevelX2 2018-07-14 10:40:38 +02:00 committed by GitHub
commit 0d9f8ad19a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 443 additions and 17 deletions

View file

@ -67,6 +67,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
@ -121,6 +122,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;
@ -179,6 +181,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;
@ -1024,4 +1032,12 @@ 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;
}
public UUID getCommandedBy() {
return commandedBy;
}
}