It is currently 19 Apr 2024, 06:05
   
Text Size

X (costs)

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: X (costs)

Postby mtgrares » 15 Jul 2009, 19:52

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.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: Marek14 and 50 guests


Who is online

In total there are 51 users online :: 1 registered, 0 hidden and 50 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: Marek14 and 50 guests

Login Form