We may want to migrate this to 1 file per monster but for now the
migration is as close to the hard-coded version as possible.
Sprites that are used by multiple monsters are only loaded from disk
once.
For monsters with the same sprite, load the sprite from the file system only once.
Example:
```
VERBOSE: Loaded monster graphics: falspear\phall 452 KiB x1
VERBOSE: Loaded monster graphics: skelbow\sklbw 618 KiB x1
VERBOSE: Loaded monster graphics: skelsd\sklsr 610 KiB x1
VERBOSE: Loaded monster graphics: goatbow\goatb 832 KiB x1
VERBOSE: Loaded monster graphics: bat\bat 282 KiB x2 <-- here we only load the sprite once
VERBOSE: Loaded monster graphics: rhino\rhino 1306 KiB x1
VERBOSE: Loaded monster graphics: golem\golem 298 KiB x1
VERBOSE: Total monster graphics: 4401 KiB 4684 KiB
```
Here, the bat sprite will be loaded from the MPQ only once.
For the second sprite, we simply clone the first sprite before applying TRNs.
This also reduces the size of `MonsterData` from 88 bytes to 80.
When we migrate monster data to a TSV, the sprite IDs can be generated automatically at load time.
The code that the gmock macros end up generating appears to obscure the type mismatch so there's no warning (in msvc on my system anyway) no matter what types are involved, for clarity the comparison ends up being between std::pair<int, unsigned int> and testing::Pair<int, testing::AllOf<testing::Matchers<unsigned int>>>
Fully migrates debug commands to Lua and organizes them into logical
groups.
The CLI `+` syntax now runs Lua, e.g.:
```bash
build/devilutionx '+dev.player.trn.plr("infra")'
```
Chat hotkeys run Lua code if they start with `/lua`, e.g.:
```ini
[NetMsg]
QuickMessage1=/lua message(dev.player.info())
```
1. `Events` global is replaced with `require('devilutionx.events')`.
2. Table is simplified and documented.
3. `On` removed from the event names as it was a bit redundant.
4. Functions are camelCase for consistency (e.g. `add` instead of
`Add`).
Example script:
```lua
local events = require("devilutionx.events")
local render = require("devilutionx.render")
local message = require("devilutionx.message")
local function greet()
message("Hello from " .. _VERSION)
print("Hello from ", _VERSION)
end
events.GameStart.add(greet)
local function drawGreet()
render.string("Hello from " .. _VERSION, 10, 40)
end
events.GameDrawComplete.add(drawGreet)
```
Runs lua/repl_prelude.lua at console initialization.
The default prelude contains global assignments for all devilutionx
modules. This should save us on typing.
Implements a `require` function that supports built-in modules like so:
```lua
local log = require('devilutionx.log')
```
It falls back to reading from assets, so this loads `lua/user.lua`:
```lua
local user = require('lua.user')
```
The bytecode for the asset scripts is cached, in case we want to later
support multiple isolated environments.
There may be a simpler or better way to do this.
It's good enough for now until someone more knowledgeable
about Lua comes along.