* Correct `get_object_data` indexes
Currently they are raw offset pointers. This does not work with CE since pointers are wide (64bit) on some (most) platforms. So, we can treat these offsets like constants and return the appropriate fields instead.
There are already used for the most part as enum constants:
* Implement HOOK_RESTTIMER
Et tu + other mods use this
* PR comments + missing doc for ce-dat-tool
* chore: auto-format with clang-format
* document timer wrap
* cleanups
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Implement HOOK_CALCAPCOST
An opcode a day keeps the stimpak away.
https://sfall-team.github.io/sfall/hook-types/#calcapcost
Same as Sfall, but also calls the hook on game load to display the correct AP cost on load.
Also fix a minor bug where the attack mode of the current hand sometimes leaked when loading a save game. Normally attack mode (burst/reload/&c) isn't saved. But if you are in aimed mode (say), and load a game with the same weapon equipped, the attack mode will persist. This is pretty weird, so changed it to always be in the default mode when loading a save.
* test script
* PR comments
* doc tweaks
* hooks: an empty cc and a list of hook types with useful comments
* Deobfuscate some script-related procedures and flags
* Script hooks WIP
* Interpreter: add programPrintError(), Program->procedureCount(), rename string-related functions
* ScriptHookCall refactoring and all basic hook script opcode implementation
* HOOK_KEYPRESS and first working hooks
* mf_obj_under_cursor + some test script
* HOOK_TOHIT
* chore: auto-format with clang-format
* Add hooks: useobj, useobjon
* chore: auto-format with clang-format
* opcode: get_sfall_args
* Code review fixes
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>