mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
update ChooseCardAi with "NotSelf" consumable
This commit is contained in:
@@ -162,9 +162,17 @@ public class ChooseCardAi extends SpellAbilityAi {
|
||||
public Card chooseSingleCard(final Player ai, final SpellAbility sa, Iterable<Card> options, boolean isOptional, Player targetedPlayer, Map<String, Object> params) {
|
||||
final Card host = sa.getHostCard();
|
||||
final Player ctrl = host.getController();
|
||||
final String logic = sa.getParam("AILogic");
|
||||
String logic = sa.getParamOrDefault("AILogic", "");
|
||||
if (logic.contains("NotSelf")) {
|
||||
CardCollection opt = (CardCollection) options;
|
||||
if (opt.contains(host)) {
|
||||
opt.remove(host);
|
||||
}
|
||||
options = opt;
|
||||
logic = logic.replace("NotSelf", "");
|
||||
}
|
||||
Card choice = null;
|
||||
if (logic == null) {
|
||||
if (logic.equals("")) {
|
||||
// Base Logic is choose "best"
|
||||
choice = ComputerUtilCard.getBestAI(options);
|
||||
} else if ("WorstCard".equals(logic)) {
|
||||
|
||||
Reference in New Issue
Block a user