mickey_brown wrote:The AI needs to
1.)Start with the strongest attacking creature, and check to see if any of its defenders are strong enough to survive blocking it. If so, it blocks with it.
2.)Repeat step 1 for each attacking creature, starting with the strongest and ending with the weakest.
3.)If it doesn't have a creature remaining that is strong enough to block an attacking creature, it must determine if not blocking that creature will cause it to lose. If so, it has no choice but to block anyway.
4.)If the attacker isn't strong enough to kill the AI, but it has a high attack (lets say >4) and doesn't have trample, the AI chump blocks with its weakest defending creature.
As for wrath of god, damnation, ect...
When the ai plays any spell that "targets all X"
it needs to check if the enemy actually has any X.
Do you do that when you block?
There are at least three questions you should do.
The first question is "when should I block?"
a) When you're gonna die.
b) When you can destroy a card that could be dangerous. (This involucrates, moreover, spells and habilities of direct damage)
c) When you have lot of chances to block without loose any creature. (Blocking 1/1 with 2/2 and without any card in battlefield wich can give advantage to the 1/1 creature. This almost depends on the enemy deck)
The second question is "when could I don't block?"
a) When the enemy damage is asumible.
b) When you need one of your cards, and it's preferible to keep that card in game than have more lives. (Combo cards or creatures you need in the next turn to win the game, for example)
c) When it is good to you.
As you can see, these answers are related to each deck, and his strategies.
And the third question is "I should block wich creatures with wich creatures?" This is very related to the other two questions, and the solution is different in each specific situation, depending almost on the strategies of the decks. Some general rules that can help are:
a) Try to minimize the damage the enemy would do to you. E. g. blocking an Spark Elemental
(3/1, sacrifice it at the beginning of the end step) with the Tundra wolves
(1/1 with first strike), or the Angelic wall
(0/4) is the same, because the Spark elemental would not do damage to the player, it would die and none of your creatures would die. But if that Spark elemental has first strike and trample (because of habilities or spells), the best thing to do is block it with the Angelic wall. With more creatures, the complexity of the decision increases.
b) Try to maximize the damage that you do to enemy creatures. It is very difficult to decide, because this depends too much in the enemy's and own strategies. Sometimes is better to block a Tarmogoyf
with the entire army (with the risk of loosing the battle and making it more powerful), and sometimes better to wait until next turn in order to cast a killing spell or put in game a powerful card. The best which fit this example is the Scion of the Wild
(*/*, power and toughness are each equal to the number of creatures you control). This involucrates almost some damage spells and habilities, combining it witth the damage your creatures do.