mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
*Fixed MayEffectFromOpeningHand for AI
This commit is contained in:
@@ -1416,6 +1416,8 @@ public class GameAction {
|
|||||||
|
|
||||||
void handleLeylinesAndChancellors() {
|
void handleLeylinesAndChancellors() {
|
||||||
for (Player p : game.getPlayers()) {
|
for (Player p : game.getPlayers()) {
|
||||||
|
if(p.isComputer())
|
||||||
|
System.out.println("AI");
|
||||||
final List<Card> openingHand = new ArrayList<Card>(p.getCardsIn(ZoneType.Hand));
|
final List<Card> openingHand = new ArrayList<Card>(p.getCardsIn(ZoneType.Hand));
|
||||||
|
|
||||||
for (final Card c : openingHand) {
|
for (final Card c : openingHand) {
|
||||||
@@ -1425,6 +1427,7 @@ public class GameAction {
|
|||||||
final String effName = kw.split(":")[1];
|
final String effName = kw.split(":")[1];
|
||||||
|
|
||||||
final SpellAbility effect = AbilityFactory.getAbility(c.getSVar(effName), c);
|
final SpellAbility effect = AbilityFactory.getAbility(c.getSVar(effName), c);
|
||||||
|
effect.setActivatingPlayer(p);
|
||||||
if (GuiDialog.confirm(c, "Use " + c +"'s ability?")) {
|
if (GuiDialog.confirm(c, "Use " + c +"'s ability?")) {
|
||||||
// If we ever let the AI memorize cards in the players
|
// If we ever let the AI memorize cards in the players
|
||||||
// hand, this would be a place to do so.
|
// hand, this would be a place to do so.
|
||||||
@@ -1444,7 +1447,7 @@ public class GameAction {
|
|||||||
final String effName = kw.split(":")[1];
|
final String effName = kw.split(":")[1];
|
||||||
|
|
||||||
final SpellAbility effect = AbilityFactory.getAbility(c.getSVar(effName), c);
|
final SpellAbility effect = AbilityFactory.getAbility(c.getSVar(effName), c);
|
||||||
|
effect.setActivatingPlayer(p);
|
||||||
// Is there a better way for the AI to decide this?
|
// Is there a better way for the AI to decide this?
|
||||||
if (effect.doTrigger(false, (AIPlayer)p)) {
|
if (effect.doTrigger(false, (AIPlayer)p)) {
|
||||||
GuiDialog.message("Computer reveals " + c.getName() + "(" + c.getUniqueNumber() + ").");
|
GuiDialog.message("Computer reveals " + c.getName() + "(" + c.getUniqueNumber() + ").");
|
||||||
|
|||||||
Reference in New Issue
Block a user