- ORI:Added Alhammaret, High Arbiter

This commit is contained in:
swordshine
2015-06-23 12:33:40 +00:00
parent 05e5966a0d
commit 640ce4a6de
3 changed files with 19 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package forge.ai.ability;
import forge.ai.ComputerUtil;
import forge.ai.ComputerUtilCard;
import forge.ai.ComputerUtilMana;
import forge.ai.SpellAbilityAi;
import forge.game.card.Card;
@@ -59,5 +60,12 @@ public class ChooseCardNameAi extends SpellAbilityAi {
// TODO - there is no AILogic implemented yet
return false;
}
/* (non-Javadoc)
* @see forge.card.ability.SpellAbilityAi#chooseSingleCard(forge.card.spellability.SpellAbility, java.util.List, boolean)
*/
@Override
public Card chooseSingleCard(final Player ai, SpellAbility sa, Iterable<Card> options, boolean isOptional, Player targetedPlayer) {
return ComputerUtilCard.getBestAI(options);
}
}

View File

@@ -4,18 +4,22 @@ import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import forge.StaticData;
import forge.card.CardRules;
import forge.card.CardRulesPredicates;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.card.CardCollection;
import forge.game.card.CardLists;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.TargetRestrictions;
import forge.item.PaperCard;
import forge.util.Aggregates;
import forge.util.ComparableOp;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
@@ -49,6 +53,7 @@ public class ChooseCardNameEffect extends SpellAbilityEffect {
}
boolean randomChoice = sa.hasParam("AtRandom");
boolean chooseFromDefined = sa.hasParam("ChooseFromDefinedCards");
for (final Player p : tgtPlayers) {
if ((tgt == null) || p.canBeTargetedBy(sa)) {
String chosen = "";
@@ -72,7 +77,11 @@ public class ChooseCardNameEffect extends SpellAbilityEffect {
} else {
chosen = "";
}
} else if (chooseFromDefined) {
CardCollection choices = AbilityUtils.getDefinedCards(host, sa.getParam("ChooseFromDefinedCards"), sa);
choices = CardLists.getValidCards(choices, valid, host.getController(), host);
Card c = p.getController().chooseSingleEntityForEffect(choices, sa, "Choose a card name");
chosen = c != null ? c.getName() : "";
} else {
final String message = validDesc.equals("card") ? "Name a card" : "Name a " + validDesc + " card.";

View File

@@ -4,7 +4,7 @@ Types:Creature Human Advisor
PT:2/4
K:ETBReplacement:Other:DBNameCard
SVar:DBNameCard:DB$ NameCard | Defined$ You | ValidCards$ Card.nonLand+nonCreature | ValidDesc$ card other than a creature or a land card. | SpellDescription$ As CARDNAME enters the battlefield, name a card other than a creature or a land card.
S:Mode$ CantBeCast | ValidCard$ Card.NamedCard | Caster$ Player.Opponent | Description$ Your opponents can't cast the chosen card.
S:Mode$ CantBeCast | ValidCard$ Card.NamedCard | Caster$ Player.Opponent | Description$ Your opponents can't cast cards with the chosen name.
S:Mode$ ReduceCost | ValidCard$ Card.NamedCard | Type$ Spell | Activator$ You | Amount$ 2 | Description$ Spells with the chosen name cost 2 less for you to cast.
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/council_of_the_absolute.jpg