Page 2 of 2

Re: X (costs)

PostPosted: 15 Jul 2009, 19:52
by mtgrares
where is the AI mana paying code anyways?
In ComputerAI_General.java and ComputerUtil.java. ComputerAI_General is the "input wrapper" that calls ComputerUtil. By "input wrapper" I mean usually the Input class handles mouse input but it is also used when a phase changes, so when the phase changes and it is the computer's turn, input ComputerAI_General is used. (The other ComputerAI classes like ComputerAI_Rats, ComputerAI_Burn, ComputerAI_Burn2, ComputerAI_StackNotEmpty, and ComputerAI_Race are old classes and are not used anywhere in the program.)

The "heart" of the AI is ComputerUtil.playCards() which plays cards for the computer, this includes paying mana cost, tapping the card, removing it from the computer's hand and putting it on the stack. Most of the stuff in ComputerUtil hasn't been updated and has been the same since the beginning (for better or worse). ComputerUtil is all static methods and it could be put into ComputerAI_General.

The comments in ComputerUtil are a little funny like "I hope this fixes 'the problem' that I can't re-create". lol The AI could be updated for the 10th Edition painlands like Adarkar Wastes since the AI doesn't receive any damage from them.