World.testMap() sets World.seenAll. The latter is true when the whole map has been explored.
World.testMap() is called:
* on world init
* on return home (when the map is updated)
* on applyMap() (when the map is bought from the scout)
Limited subset of commits:
* unified function for healing (Events.doHeal);
* unified function for attacks (Events.damage);
* check if health is max, and disable healing buttons (Events.setHeal and related calls)
* grouping buttons (attackButtons, healButtons and exitButtons for weapon attacks, meat & meds, continue/leave)
As some of them are related to each other, this commit involves a lot of updates.
* Autopause on blur. This is an idea I took from Gridland (!), if window loses focus the fight pauses (timed check courtesy of the enemy), and it restarts when the window has focus again (if the pause button is clicked, then the player must click again in order to resume).
* Delayed start for fights. This will allow players to read the description without the player attacking them. No way to cheat, buttons are not enabled. I used Events._LEAVE_COOLDOWN as cooldown time, not for laziness, but because I guess the two durations have the same purpose: to allow (force) the player to read stuff.
* Take everything and leave just by name. If the player can just take something, the text is "take all you can", if they can take everything but there are several options it's "take everything", if the option is only one the text is "take everything and X", where X is the verb of the only possible option (note: in the latter case, the button cools down together with the option itself).
* success/failure mechanics no longer relies upon try/catch, but on a simple mechanism: a variable taking a bool value, set to true when one of the end conditions happens. The precedence goes to the enemy (if the player kills and dies the fight is lost).