mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Added AI support for Duneblast.
This commit is contained in:
@@ -105,6 +105,25 @@ public class ChooseCardAi extends SpellAbilityAi {
|
|||||||
if (CardLists.getValidCards(choices, "Card.nonLand", host.getController(), host).isEmpty()) {
|
if (CardLists.getValidCards(choices, "Card.nonLand", host.getController(), host).isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if (logic.equals("Duneblast")) {
|
||||||
|
List<Card> aiCreatures = ai.getCreaturesInPlay();
|
||||||
|
List<Card> oppCreatures = ai.getOpponent().getCreaturesInPlay();
|
||||||
|
aiCreatures = CardLists.getNotKeyword(aiCreatures, "Indestructible");
|
||||||
|
oppCreatures = CardLists.getNotKeyword(oppCreatures, "Indestructible");
|
||||||
|
|
||||||
|
// Use it as a wrath, when the human creatures threat the ai's life
|
||||||
|
if (aiCreatures.isEmpty() && ComputerUtilCombat.sumDamageIfUnblocked(oppCreatures, ai) >= ai.getLife()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Card chosen = ComputerUtilCard.getBestCreatureAI(aiCreatures);
|
||||||
|
aiCreatures.remove(chosen);
|
||||||
|
int minGain = 200;
|
||||||
|
|
||||||
|
if ((ComputerUtilCard.evaluateCreatureList(aiCreatures) + minGain) >= ComputerUtilCard
|
||||||
|
.evaluateCreatureList(oppCreatures)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,6 +223,16 @@ public class ChooseCardAi extends SpellAbilityAi {
|
|||||||
} else {
|
} else {
|
||||||
choice = ComputerUtilCard.getWorstPermanentAI(options, false, false, false, false);
|
choice = ComputerUtilCard.getWorstPermanentAI(options, false, false, false, false);
|
||||||
}
|
}
|
||||||
|
} else if (logic.equals("Duneblast")) {
|
||||||
|
List<Card> aiCreatures = ai.getCreaturesInPlay();
|
||||||
|
aiCreatures = CardLists.getNotKeyword(aiCreatures, "Indestructible");
|
||||||
|
|
||||||
|
if (aiCreatures.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Card chosen = ComputerUtilCard.getBestCreatureAI(aiCreatures);
|
||||||
|
return chosen;
|
||||||
} else {
|
} else {
|
||||||
choice = ComputerUtilCard.getBestAI(options);
|
choice = ComputerUtilCard.getBestAI(options);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
Name:Duneblast
|
Name:Duneblast
|
||||||
ManaCost:4 W B G
|
ManaCost:4 W B G
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
A:SP$ ChooseCard | Cost$ 4 W G B | Defined$ You | Amount$ 1 | Choices$ Creature | ChoiceTitle$ Choose a creature | SubAbility$ DBDestroyAll | RememberChosen$ True | SpellDescription$ Choose up to one creature. Destroy the rest.
|
A:SP$ ChooseCard | Cost$ 4 W G B | Defined$ You | Amount$ 1 | Choices$ Creature | ChoiceTitle$ Choose a creature | AILogic$ Duneblast | SubAbility$ DBDestroyAll | RememberChosen$ True | SpellDescription$ Choose up to one creature. Destroy the rest.
|
||||||
SVar:DBDestroyAll:DB$ DestroyAll | ValidCards$ Creature.IsNotRemembered | SubAbility$ DBCleanup
|
SVar:DBDestroyAll:DB$ DestroyAll | ValidCards$ Creature.IsNotRemembered | SubAbility$ DBCleanup
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
SVar:RemAIDeck:True
|
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/duneblast.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/duneblast.jpg
|
||||||
Oracle:Choose up to one creature. Destroy the rest.
|
Oracle:Choose up to one creature. Destroy the rest.
|
||||||
Reference in New Issue
Block a user