mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08: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.Constants.Zone;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.ActivatedAbility;
|
import mage.abilities.ActivatedAbility;
|
||||||
|
import mage.abilities.SpecialAction;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.VariableManaCost;
|
import mage.abilities.costs.mana.VariableManaCost;
|
||||||
import mage.filter.common.FilterCreatureForCombat;
|
import mage.filter.common.FilterCreatureForCombat;
|
||||||
|
|
@ -171,6 +172,8 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
} else if (response.getInteger() != null) {
|
} else if (response.getInteger() != null) {
|
||||||
passed = true;
|
passed = true;
|
||||||
passedTurn = true;
|
passedTurn = true;
|
||||||
|
} else if (response.getString() != null && response.getString().equals("special")) {
|
||||||
|
specialAction(game);
|
||||||
} else if (response.getUUID() != null) {
|
} else if (response.getUUID() != null) {
|
||||||
MageObject object = game.getObject(response.getUUID());
|
MageObject object = game.getObject(response.getUUID());
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
|
|
@ -355,6 +358,16 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
return response.getInteger();
|
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) {
|
protected void activateAbility(Map<UUID, ? extends ActivatedAbility> abilities, Game game) {
|
||||||
if (abilities.size() == 1) {
|
if (abilities.size() == 1) {
|
||||||
activateAbility(abilities.values().iterator().next(), game);
|
activateAbility(abilities.values().iterator().next(), game);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue