jonoxia / rpgbase

Generic Node.js/HTML5 role-playing game client/server
8 stars 6 forks source link

It's possible (but shouldn't be) to get in a fight in the same step that takes you into a new map #25

Closed jonoxia closed 11 years ago

jonoxia commented 11 years ago

And then the battle menus get drawn over the new map screen and it looks really weird. Disallow rolling for random encounters on a step that takes you into a town or cave!

jonoxia commented 11 years ago

It's also possible to get a random encounter just as you step onboard the ship, which is also weird. Should disallow that too.

jonoxia commented 11 years ago

...or OUT of a cave. Only one mode transition at a time!

jonoxia commented 11 years ago

New, related bug: getting into a fight in the same move as stepping onto a trap causes big problems.

Possible solution: onStep handlers have priorities, are activated from highest to lowest priority, and can return a value which tells whether to cancel subsequent handlers or continue processing them. Generally, onStep handlers that trigger at SPECIFIC x-y should be higher priority than ones that trigger anywhere.