Merge branch 'master' into 'master'

Improve AI targeting logic for Transmogrifying Wand.

Closes #994

See merge request core-developers/forge!1692
This commit is contained in:
Michael Kamensky
2019-05-23 03:28:26 +00:00
2 changed files with 16 additions and 7 deletions

View File

@@ -2989,14 +2989,23 @@ public class ComputerUtil {
if (sa.hasParam("AITgts")) { if (sa.hasParam("AITgts")) {
CardCollection list; CardCollection list;
if (sa.getParam("AITgts").equals("BetterThanSource")) { String aiTgts = sa.getParam("AITgts");
int value = ComputerUtilCard.evaluateCreature(source); if (aiTgts.startsWith("BetterThan")) {
if (source.isEnchanted()) { int value = 0;
for (Card enc : source.getEnchantedBy()) { if (aiTgts.endsWith("Source")) {
if (enc.getController().equals(ai)) { value = ComputerUtilCard.evaluateCreature(source);
value += 100; // is 100 per AI's own aura enough? if (source.isEnchanted()) {
for (Card enc : source.getEnchantedBy()) {
if (enc.getController().equals(ai)) {
value += 100; // is 100 per AI's own aura enough?
}
} }
} }
} else if (aiTgts.contains("EvalRating.")) {
value = AbilityUtils.calculateAmount(source, aiTgts.substring(aiTgts.indexOf(".") + 1), sa);
} else {
System.err.println("Warning: Unspecified AI target evaluation rating for SA " + sa);
value = ComputerUtilCard.evaluateCreature(source);
} }
final int totalValue = value; final int totalValue = value;
list = CardLists.filter(srcList, new Predicate<Card>() { list = CardLists.filter(srcList, new Predicate<Card>() {

View File

@@ -2,7 +2,7 @@ Name:Transmogrifying Wand
ManaCost:3 ManaCost:3
Types:Artifact Types:Artifact
K:etbCounter:CHARGE:3 K:etbCounter:CHARGE:3
A:AB$ Destroy | Cost$ 1 T SubCounter<1/CHARGE> | ValidTgts$ Creature | TgtPrompt$ Select target creature | SorcerySpeed$ True | SubAbility$ OxToken | SpellDescription$ Destroy target creature. A:AB$ Destroy | Cost$ 1 T SubCounter<1/CHARGE> | ValidTgts$ Creature | AITgts$ BetterThanEvalRating.130 | TgtPrompt$ Select target creature | SorcerySpeed$ True | SubAbility$ OxToken | SpellDescription$ Destroy target creature.
SVar:OxToken:DB$Token | TokenAmount$ 1 | TokenScript$ w_2_4_ox | TokenOwner$ TargetedController | LegacyImage$ w 2 4 ox | SpellDescription$ Its controller creates a 2/4 white Ox creature token. Activate this ability only any time you could cast a sorcery. SVar:OxToken:DB$Token | TokenAmount$ 1 | TokenScript$ w_2_4_ox | TokenOwner$ TargetedController | LegacyImage$ w 2 4 ox | SpellDescription$ Its controller creates a 2/4 white Ox creature token. Activate this ability only any time you could cast a sorcery.
SVar:Picture:http://www.wizards.com/global/images/magic/general/transmogrifying_wand.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/transmogrifying_wand.jpg
Oracle:Transmogrifying Wand enters the battlefield with three charge counters on it.\n{1}, {T}, Remove a charge counter from Transmogrifying Wand: Destroy target creature. Its controller creates a 2/4 white Ox creature token. Activate this ability only any time you could cast a sorcery. Oracle:Transmogrifying Wand enters the battlefield with three charge counters on it.\n{1}, {T}, Remove a charge counter from Transmogrifying Wand: Destroy target creature. Its controller creates a 2/4 white Ox creature token. Activate this ability only any time you could cast a sorcery.