mostly good ideas. however, in some places you seem to want to do the work of the parser for it. You don't need to be a pre-parser. Just put everything you want to use into the parser and hit the button, and it'll tell you if you can't cast a spell or run out of energy or whatever. No need to estimate that beforehand.