Detailed Description

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

An arabic numeral is accepted in parameter n, and the corresponding upper-case roman numeral is placed in the parameter roman. The length of the buffer must be passed in the bufsize parameter. When there is insufficient room in the buffer, or a roman numeral does not exist (e.g. non-positive integers) a value of 0 is returned and the roman buffer will be the empty string. On success, a value of 1 is returned and the zero-terminated roman numeral is placed in the parameter roman.

Overview

To follow the code, start at player_birth towards the bottom of the file - that is the only external entry point to the functions defined here.

Player (in the Angband sense of character) birth is modelled as a a series of commands from the UI to the game to manipulate the character and corresponding events to inform the UI of the outcomes of these changes.

The current aim of this section is that after any birth command is carried out, the character should be left in a playable state. In particular, this means that if a savefile is supplied, the character will be set up according to the "quickstart" rules until another race or class is chosen, or until the stats are reset by the UI.

Once the UI signals that the player is happy with the character, the game does housekeeping to ensure the character is ready to start the game (clearing the history log, making sure options are set, etc) before returning control to the game proper.

The null-terminated roman numeral is accepted in the roman parameter and the corresponding integer arabic numeral is returned. Only upper-case values are considered. When the roman parameter is empty or does not resemble a roman numeral, a value of -1 is returned.

XXX This function will parse certain non-sense strings as roman numerals, such as IVXCCCVIII