mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Add Ask AI button
This commit is contained in:
@@ -59,6 +59,8 @@ public interface IDevModeCheats {
|
||||
|
||||
void planeswalkTo();
|
||||
|
||||
void askAI();
|
||||
|
||||
/**
|
||||
* Implementation of {@link IDevModeCheats} that disallows cheating by
|
||||
* performing no action whatsoever when any of its methods is called.
|
||||
@@ -141,6 +143,9 @@ public interface IDevModeCheats {
|
||||
@Override
|
||||
public void removeCardsFromGame() {
|
||||
}
|
||||
@Override
|
||||
public void askAI() {
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@@ -36,6 +36,7 @@ import com.google.common.collect.Multimap;
|
||||
import forge.LobbyPlayer;
|
||||
import forge.StaticData;
|
||||
import forge.ai.GameState;
|
||||
import forge.ai.PlayerControllerAi;
|
||||
import forge.card.CardDb;
|
||||
import forge.card.CardStateName;
|
||||
import forge.card.CardType;
|
||||
@@ -2942,6 +2943,18 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void askAI() {
|
||||
PlayerControllerAi ai = new PlayerControllerAi(player.getGame(), player, player.getOriginalLobbyPlayer());
|
||||
player.runWithController(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<SpellAbility> sas = ai.chooseSpellAbilityToPlay();
|
||||
SpellAbility chosen = sas == null ? null : sas.get(0);
|
||||
getGui().message(chosen == null ? "AI doesn't want to play anything right now" : chosen.getHostCard().toString(), "AI Play Suggestion");
|
||||
}
|
||||
}, ai);
|
||||
}
|
||||
}
|
||||
|
||||
private IMacroSystem macros;
|
||||
|
||||
Reference in New Issue
Block a user