mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
...
This commit is contained in:
parent
e78bbcd4fe
commit
85844c0165
1 changed files with 13 additions and 0 deletions
|
@ -42,6 +42,7 @@ import mage.Constants.TargetController;
|
|||
import mage.Constants.Zone;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.ActivatedAbility;
|
||||
import mage.abilities.SpecialAction;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.VariableManaCost;
|
||||
import mage.filter.common.FilterCreatureForCombat;
|
||||
|
@ -171,6 +172,8 @@ public class HumanPlayer extends PlayerImpl {
|
|||
} else if (response.getInteger() != null) {
|
||||
passed = true;
|
||||
passedTurn = true;
|
||||
} else if (response.getString() != null && response.getString().equals("special")) {
|
||||
specialAction(game);
|
||||
} else if (response.getUUID() != null) {
|
||||
MageObject object = game.getObject(response.getUUID());
|
||||
if (object != null) {
|
||||
|
@ -355,6 +358,16 @@ public class HumanPlayer extends PlayerImpl {
|
|||
return response.getInteger();
|
||||
}
|
||||
|
||||
protected void specialAction(Game game) {
|
||||
Map<UUID, SpecialAction> specialActions = game.getState().getSpecialActions().getControlledBy(playerId);
|
||||
game.fireGetChoiceEvent(playerId, name, specialActions.values());
|
||||
waitForResponse();
|
||||
if (response.getUUID() != null) {
|
||||
if (specialActions.containsKey(response.getUUID()))
|
||||
activateAbility(specialActions.get(response.getUUID()), game);
|
||||
}
|
||||
}
|
||||
|
||||
protected void activateAbility(Map<UUID, ? extends ActivatedAbility> abilities, Game game) {
|
||||
if (abilities.size() == 1) {
|
||||
activateAbility(abilities.values().iterator().next(), game);
|
||||
|
|
Loading…
Reference in a new issue