KhymChanur: It should be easy to create addons that are associated with a birth option, and only do anything when that option is turned on. This way the joke birth option could be an addon, rather than being hardcoded in /data or /scripts, plus players could install third-party addons and only use them in a some of games they're playing concurrently, rather than having to use it in all of them.
We'd need:
- Engine functions to let addons register new birth options.
- A hook that gets called either right after the birth options are set, or right after a saved game is loaded. The addons would use the hooks to test if their birth option had been set, and if so do any per-session initalization needed.
- A "birth option" field for item kinds, egos, and so forth (with the field being absent/nil for things in the core module). Before the start of each game session, the engine would remove from woking memory the item/ego/etc definitions that whose birth_option field don't match any of the birth options chosen by the user.
Hmmmm, if we did it that way, then it wouldn't be a problem for the joke birth option to activate joke items, egos, artifacts, terrain types, and so forth. That would be cool.
ToME Wiki