Sorry for the off-topic but I just wanted to say it's really cool looking at code with variable names like $wizard and $goblin, and dealing with algorithms to do combat resolution in a fantasy RPG type setting..
I wrote a lot of that kind of stuff when learning to program. Please feel invited to post more along these lines.