Halvayin --
I noticed that in the latest revision, you changed the event sequencing rules. The problem is that these rules introduce a bug, as follows:
Here's beethro pointing his sword at a roach:
B-R
Now, suppose Beethro moves a step to the East. Thus, the roach gets hit with the sword, dies, and a MONSTER_KILLED event gets queued up.
Here's the issue: that MONSTER_KILLED event absolutely
must be processed, through GameScreen.processEvents(), before processMonsters() gets called. If it isn't, the roach will remain in the active monster list, and will move West "
underneath"
the sword and kill Beethro!
That's why the sequence needs to be "
player turn, events, monster turn, events"
- you can't put processMonsters() into processCommand() without getting bizarre results (and trouble allowing for haste potions).
There's similar things in other contexts - for example, if Beethro hits an orb with his sword, then monsters can immediately move onto the open door, instead of having to wait a turn because the door doesn't open until after their movement.
You can see this: if you check out Rev. 27 and kill a roach, it works fine. If you check out Rev. 28, then whenever you kill a roach, you get the "
beethro died"
trace as well, even if he shouldn't have. Also, often a random roach disappears (this is the result of killMonster() trying to kill the same monster twice)
I obvously don't want to start a fight on SVN
so if you could sort this out in some way that's in tune with how you want event handling to work it would be much appreciated
[Last edited by hyphz at 08-17-2008 10:31 PM]