From 2a3456d0e22b6c696e7e7d2427b13c89e697dfb0 Mon Sep 17 00:00:00 2001 From: Agetian Date: Sun, 3 Jun 2018 07:58:34 +0300 Subject: [PATCH] - Corrected the base logic for AssignGroupAi. - Added AILogic to Pir's Whim. --- forge-ai/src/main/java/forge/ai/ability/AssignGroupAi.java | 5 +---- forge-gui/res/cardsfolder/upcoming/pirs_whim.txt | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/AssignGroupAi.java b/forge-ai/src/main/java/forge/ai/ability/AssignGroupAi.java index caed42cdf5f..fb1b769347d 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AssignGroupAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AssignGroupAi.java @@ -16,10 +16,7 @@ public class AssignGroupAi extends SpellAbilityAi { } public SpellAbility chooseSingleSpellAbility(Player player, SpellAbility sa, List spells, Map params) { - if (sa.hasParam("AILogic")) { - return Iterables.getFirst(spells, null); - } - final String logic = sa.getParam("AILogic"); + final String logic = sa.getParamOrDefault("AILogic", ""); if (logic.equals("FriendOrFoe")) { if (params.containsKey("Affected") && spells.size() >= 2) { diff --git a/forge-gui/res/cardsfolder/upcoming/pirs_whim.txt b/forge-gui/res/cardsfolder/upcoming/pirs_whim.txt index d4cf2289588..dafdee4b0e7 100644 --- a/forge-gui/res/cardsfolder/upcoming/pirs_whim.txt +++ b/forge-gui/res/cardsfolder/upcoming/pirs_whim.txt @@ -1,7 +1,7 @@ Name:Pir's Whim ManaCost:3 G Types:Sorcery -A:SP$ AssignGroup | Cost$ 3 G | Defined$ Player | Choices$ DBSearch,DBSacrifice | SpellDescription$ For each player, choose friend or foe. Each friend searches their library for a land card, puts it onto the battlefield tapped, then shuffles their library. Each foe sacrifices an artifact or enchantment they control. +A:SP$ AssignGroup | Cost$ 3 G | Defined$ Player | Choices$ DBSearch,DBSacrifice | AILogic$ FriendOrFoe | SpellDescription$ For each player, choose friend or foe. Each friend searches their library for a land card, puts it onto the battlefield tapped, then shuffles their library. Each foe sacrifices an artifact or enchantment they control. SVar:DBSearch:DB$ChangeZone | Origin$ Library | Destination$ Battlefield | DefinedPlayer$ Remembered | ChangeType$ Land | ChangeNum$ 1 | StackDescription$ Each friend searches their library for a land card, puts it onto the battlefield tapped, then shuffles their library. | SpellDescription$ Friend searches their library for a land card, puts it onto the battlefield tapped, then shuffles their library. SVar:DBSacrifice:DB$Sacrifice | Defined$ Remembered | SacValid$ Artifact,Enchantment | SacMessage$ artifact or enchantment | StackDescription$ Each foe sacrifices an artifact or enchantment they control. | SpellDescription$ Foe sacrifices an artifact or enchantment they control. SVar:Picture:http://www.wizards.com/global/images/magic/general/pirs_whim.jpg