mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- ORI:Added Alhammaret, High Arbiter
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package forge.ai.ability;
|
package forge.ai.ability;
|
||||||
|
|
||||||
import forge.ai.ComputerUtil;
|
import forge.ai.ComputerUtil;
|
||||||
|
import forge.ai.ComputerUtilCard;
|
||||||
import forge.ai.ComputerUtilMana;
|
import forge.ai.ComputerUtilMana;
|
||||||
import forge.ai.SpellAbilityAi;
|
import forge.ai.SpellAbilityAi;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
@@ -59,5 +60,12 @@ public class ChooseCardNameAi extends SpellAbilityAi {
|
|||||||
// TODO - there is no AILogic implemented yet
|
// TODO - there is no AILogic implemented yet
|
||||||
return false;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,18 +4,22 @@ import com.google.common.base.Predicate;
|
|||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import forge.StaticData;
|
import forge.StaticData;
|
||||||
import forge.card.CardRules;
|
import forge.card.CardRules;
|
||||||
import forge.card.CardRulesPredicates;
|
import forge.card.CardRulesPredicates;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
import forge.game.ability.SpellAbilityEffect;
|
import forge.game.ability.SpellAbilityEffect;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
|
import forge.game.card.CardCollection;
|
||||||
|
import forge.game.card.CardLists;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.spellability.TargetRestrictions;
|
import forge.game.spellability.TargetRestrictions;
|
||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
import forge.util.Aggregates;
|
import forge.util.Aggregates;
|
||||||
import forge.util.ComparableOp;
|
import forge.util.ComparableOp;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -49,6 +53,7 @@ public class ChooseCardNameEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean randomChoice = sa.hasParam("AtRandom");
|
boolean randomChoice = sa.hasParam("AtRandom");
|
||||||
|
boolean chooseFromDefined = sa.hasParam("ChooseFromDefinedCards");
|
||||||
for (final Player p : tgtPlayers) {
|
for (final Player p : tgtPlayers) {
|
||||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||||
String chosen = "";
|
String chosen = "";
|
||||||
@@ -72,7 +77,11 @@ public class ChooseCardNameEffect extends SpellAbilityEffect {
|
|||||||
} else {
|
} else {
|
||||||
chosen = "";
|
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 {
|
} else {
|
||||||
final String message = validDesc.equals("card") ? "Name a card" : "Name a " + validDesc + " card.";
|
final String message = validDesc.equals("card") ? "Name a card" : "Name a " + validDesc + " card.";
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Types:Creature Human Advisor
|
|||||||
PT:2/4
|
PT:2/4
|
||||||
K:ETBReplacement:Other:DBNameCard
|
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.
|
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.
|
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:RemRandomDeck:True
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/council_of_the_absolute.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/council_of_the_absolute.jpg
|
||||||
|
|||||||
Reference in New Issue
Block a user