Hengband  2.2.1
マクロ定義 | 関数 | 変数
birth.c ファイル

プレイヤーの作成を行う / Create a player character [詳解]

#include "angband.h"
#include "util.h"
#include "bldg.h"
#include "core.h"
#include "term.h"
#include "object-ego.h"
#include "artifact.h"
#include "avatar.h"
#include "cmd-dump.h"
#include "dungeon.h"
#include "history.h"
#include "monsterrace-hook.h"
#include "store.h"
#include "patron.h"
#include "quest.h"
#include "player-class.h"
#include "player-status.h"
#include "player-personality.h"
#include "player-sex.h"
#include "spells.h"
#include "spells-status.h"
#include "wild.h"
#include "floor.h"
#include "cmd-pet.h"
#include "dungeon-file.h"
#include "floor-town.h"
#include "files.h"
#include "birth.h"
#include "player-race.h"
#include "player-skill.h"
#include "world.h"
#include "objectkind.h"
#include "monsterrace.h"
#include "autopick.h"
#include "save.h"
#include "realm.h"
#include "japanese.h"
#include "view-mainwindow.h"
birth.c の依存先関係図:

マクロ定義

#define AUTOROLLER_STEP   5431L
 オートローラーの内容を描画する間隔 / How often the autoroller will update the display and pause to check for user interuptions. [詳解]
 
#define MAX_TRIES   100
 ランダムクエストのモンスターを確定するために試行する回数 / Maximum number of tries for selection of a proper quest monster [詳解]
 
#define MAX_CLASS_CHOICE   MAX_CLASS
 
#define MAXITEMS   8
 
#define HISTPREF_LIMIT   1024
 

関数

static void birth_quit (void)
 プレイヤー作成を中断して変愚蛮怒を終了する [詳解]
 
static void show_help (concptr helpfile)
 指定されたヘルプファイルを表示する / Show specific help file [詳解]
 
static byte choose_realm (player_type *creature_ptr, s32b choices, int *count)
 プレイヤーの魔法領域を選択する / Choose from one of the available magical realms [詳解]
 
static bool get_player_realms (player_type *creature_ptr)
 選択した魔法領域の解説を表示する / Choose the magical realms [詳解]
 
static void save_prev_data (player_type *creature_ptr, birther *birther_ptr)
 プレイヤーのクイックスタート情報をプレイヤー構造体から保存する / Save the current data for later [詳解]
 
static void load_prev_data (player_type *creature_ptr, bool swap)
 プレイヤーのクイックスタート情報をプレイヤー構造体へ読み込む / Load the previous data [詳解]
 
static int adjust_stat (int value, int amount)
 プレイヤーの能力値表現に基づいて加減算を行う。 [詳解]
 
static void get_stats (player_type *creature_ptr)
 プレイヤーの能力値を一通りロールする。 / Roll for a characters stats [詳解]
 
void get_max_stats (player_type *creature_ptr)
 プレイヤーの限界ステータスを決める。 [詳解]
 
static void get_extra (player_type *creature_ptr, bool roll_hitdie)
 その他「オートローラ中は算出の対象にしない」副次ステータスを処理する / Roll for some info that the auto-roller ignores [詳解]
 
static void get_history (player_type *creature_ptr)
 プレイヤーの生い立ちの自動生成を行う。 / Get the racial history, and social class, using the "history charts". [詳解]
 
void get_height_weight (player_type *creature_ptr)
 プレイヤーの身長体重を決める / Get character's height and weight [詳解]
 
static void get_ahw (player_type *creature_ptr)
 プレイヤーの年齢を決める。 / Computes character's age, height, and weight by henkma [詳解]
 
static void get_money (player_type *creature_ptr)
 プレイヤーの初期所持金を決める。 / Get the player's starting money [詳解]
 
static void birth_put_stats (player_type *creature_ptr)
 put_stats()のサブルーチンとして、オートロール中のステータスを表示する / Display stat values, subset of "put_stats()" [詳解]
 
static void k_info_reset (void)
 ベースアイテム構造体の鑑定済みフラグをリセットする。 [詳解]
 
static void player_wipe_without_name (player_type *creature_ptr)
 プレイヤー構造体の内容を初期値で消去する(名前を除く) / Clear all the global "character" data (without name) [詳解]
 
static void init_dungeon_quests (player_type *creature_ptr)
 ダンジョン内部のクエストを初期化する / Initialize random quests and final quests [詳解]
 
static void init_turn (player_type *creature_ptr)
 ゲームターンを初期化する / Reset turn [詳解]
 
static void wield_all (player_type *creature_ptr)
 所持状態にあるアイテムの中から一部枠の装備可能なものを装備させる。 [詳解]
 
static void add_outfit (player_type *creature_ptr, object_type *o_ptr)
 初期所持アイテムの処理 / Add an outfit object [詳解]
 
void player_outfit (player_type *creature_ptr)
 種族/職業/性格などに基づき初期所持アイテムを設定するメインセット関数。 / Init players with some belongings [詳解]
 
static bool get_player_race (player_type *creature_ptr)
 プレイヤーの種族選択を行う / Player race [詳解]
 
static bool get_player_class (player_type *creature_ptr)
 プレイヤーの職業選択を行う / Player class [詳解]
 
static bool get_player_seikaku (player_type *creature_ptr)
 プレイヤーの性格選択を行う / Player Player seikaku [詳解]
 
static bool get_stat_limits (void)
 オートローラで得たい能力値の基準を決める。 [詳解]
 
static bool get_chara_limits (player_type *creature_ptr)
 オートローラで得たい年齢、身長、体重、社会的地位の基準を決める。 [詳解]
 
void add_history_from_pref_line (concptr t)
 生い立ちメッセージの内容をバッファに加える。 / Hook function for reading the histpref.prf file. [詳解]
 
static bool do_cmd_histpref (player_type *creature_ptr)
 生い立ちメッセージをファイルからロードする。 [詳解]
 
static void edit_history (player_type *creature_ptr)
 生い立ちメッセージを編集する。/Character background edit-mode [詳解]
 
static bool player_birth_aux (player_type *creature_ptr)
 player_birth()関数のサブセット/Helper function for 'player_birth()' [詳解]
 
static bool ask_quick_start (player_type *creature_ptr)
 クイックスタート処理の問い合わせと実行を行う。/Ask whether the player use Quick Start or not. [詳解]
 
void player_birth (player_type *creature_ptr)
 プレイヤー作成処理のメインルーチン/ Create a new character. [詳解]
 
void dump_yourself (player_type *creature_ptr, FILE *fff)
 プレイヤー作成処理中のステータス表示処理 [詳解]
 

変数

birther previous_char
 
static concptr race_jouhou [MAX_RACES]
 種族の解説メッセージテーブル [詳解]
 
static concptr class_jouhou [MAX_CLASS]
 職業の解説メッセージテーブル [詳解]
 
static concptr seikaku_jouhou [MAX_SEIKAKU]
 性格の解説メッセージテーブル [詳解]
 
static concptr realm_jouhou [VALID_REALM]
 魔法領域の詳細解説メッセージテーブル [詳解]
 
static concptr realm_subinfo [VALID_REALM]
 魔法領域の簡易解説メッセージテーブル [詳解]
 
static s16b stat_limit [6]
 オートローラの能力値的要求水準 / Autoroll limit [詳解]
 
struct {
   s16b   agemin
 
   s16b   agemax
 
   s16b   htmin
 
   s16b   htmax
 
   s16b   wtmin
 
   s16b   wtmax
 
   s16b   scmin
 
   s16b   scmax
 
chara_limit
 オートローラの年齢、身長、体重、社会的地位の要求水準 [詳解]
 
static s32b stat_match [6]
 オートローラ中、各能力値が水準を超えた回数 / Autoroll matches [詳解]
 
static s32b auto_round
 オートローラの試行回数 / Autoroll round [詳解]
 
static byte player_init [MAX_CLASS][3][2]
 プレイヤーの職業毎の初期装備テーブル。/
Each player starts out with a few items, given as tval/sval pairs. [詳解]
 
static char * histpref_buf = NULL
 

詳解

プレイヤーの作成を行う / Create a player character

日付
2013/12/28
著者
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke

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.
2013 Deskull Doxygen向けのコメント整理

マクロ定義詳解

◆ AUTOROLLER_STEP

#define AUTOROLLER_STEP   5431L

オートローラーの内容を描画する間隔 / How often the autoroller will update the display and pause to check for user interuptions.

Bigger values will make the autoroller faster, but slower system may have problems because the user can't stop the autoroller for this number of rolls.

◆ HISTPREF_LIMIT

#define HISTPREF_LIMIT   1024

◆ MAX_CLASS_CHOICE

#define MAX_CLASS_CHOICE   MAX_CLASS

◆ MAX_TRIES

#define MAX_TRIES   100

ランダムクエストのモンスターを確定するために試行する回数 / Maximum number of tries for selection of a proper quest monster

◆ MAXITEMS

#define MAXITEMS   8

関数詳解

◆ add_history_from_pref_line()

void add_history_from_pref_line ( concptr  t)

生い立ちメッセージの内容をバッファに加える。 / Hook function for reading the histpref.prf file.

戻り値
なし
呼び出し関係図:

◆ add_outfit()

static void add_outfit ( player_type creature_ptr,
object_type o_ptr 
)
static

初期所持アイテムの処理 / Add an outfit object

アイテムを既知のものとした上でwield_all()関数により装備させる。

引数
o_ptr処理したいオブジェクト構造体の参照ポインタ
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ adjust_stat()

static int adjust_stat ( int  value,
int  amount 
)
static

プレイヤーの能力値表現に基づいて加減算を行う。

引数
value現在の能力値
amount加減算する値
戻り値
加減算の結果
被呼び出し関係図:

◆ ask_quick_start()

static bool ask_quick_start ( player_type creature_ptr)
static

クイックスタート処理の問い合わせと実行を行う。/Ask whether the player use Quick Start or not.

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ birth_put_stats()

static void birth_put_stats ( player_type creature_ptr)
static

put_stats()のサブルーチンとして、オートロール中のステータスを表示する / Display stat values, subset of "put_stats()"

See 'display_player(p_ptr, )' for screen layout constraints.

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ birth_quit()

static void birth_quit ( void  )
static

プレイヤー作成を中断して変愚蛮怒を終了する

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ choose_realm()

static byte choose_realm ( player_type creature_ptr,
s32b  choices,
int *  count 
)
static

プレイヤーの魔法領域を選択する / Choose from one of the available magical realms

引数
choices選択可能な魔法領域のビット配列
count選択可能な魔法領域を返すポインタ群。
戻り値
選択した魔法領域のID
呼び出し関係図:
被呼び出し関係図:

◆ do_cmd_histpref()

static bool do_cmd_histpref ( player_type creature_ptr)
static

生い立ちメッセージをファイルからロードする。

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ dump_yourself()

void dump_yourself ( player_type creature_ptr,
FILE *  fff 
)

プレイヤー作成処理中のステータス表示処理

引数
fffファイルポインタ
戻り値
なし
呼び出し関係図:

◆ edit_history()

static void edit_history ( player_type creature_ptr)
static

生い立ちメッセージを編集する。/Character background edit-mode

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_ahw()

static void get_ahw ( player_type creature_ptr)
static

プレイヤーの年齢を決める。 / Computes character's age, height, and weight by henkma

内部でget_height_weight()も呼び出している。

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_chara_limits()

static bool get_chara_limits ( player_type creature_ptr)
static

オートローラで得たい年齢、身長、体重、社会的地位の基準を決める。

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_extra()

static void get_extra ( player_type creature_ptr,
bool  roll_hitdie 
)
static

その他「オートローラ中は算出の対象にしない」副次ステータスを処理する / Roll for some info that the auto-roller ignores

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_height_weight()

void get_height_weight ( player_type creature_ptr)

プレイヤーの身長体重を決める / Get character's height and weight

戻り値
なし
呼び出し関係図:

◆ get_history()

static void get_history ( player_type creature_ptr)
static

プレイヤーの生い立ちの自動生成を行う。 / Get the racial history, and social class, using the "history charts".

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_max_stats()

void get_max_stats ( player_type creature_ptr)

プレイヤーの限界ステータスを決める。

戻り値
なし

◆ get_money()

static void get_money ( player_type creature_ptr)
static

プレイヤーの初期所持金を決める。 / Get the player's starting money

戻り値
なし
被呼び出し関係図:

◆ get_player_class()

static bool get_player_class ( player_type creature_ptr)
static

プレイヤーの職業選択を行う / Player class

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_player_race()

static bool get_player_race ( player_type creature_ptr)
static

プレイヤーの種族選択を行う / Player race

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_player_realms()

static bool get_player_realms ( player_type creature_ptr)
static

選択した魔法領域の解説を表示する / Choose the magical realms

戻り値
ユーザが魔法領域の確定を選んだらTRUEを返す。
呼び出し関係図:
被呼び出し関係図:

◆ get_player_seikaku()

static bool get_player_seikaku ( player_type creature_ptr)
static

プレイヤーの性格選択を行う / Player Player seikaku

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_stat_limits()

static bool get_stat_limits ( void  )
static

オートローラで得たい能力値の基準を決める。

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ get_stats()

static void get_stats ( player_type creature_ptr)
static

プレイヤーの能力値を一通りロールする。 / Roll for a characters stats

calc_bonuses()による、独立ステータスからの副次ステータス算出も行っている。 For efficiency, we include a chunk of "calc_bonuses()".

戻り値
なし
被呼び出し関係図:

◆ init_dungeon_quests()

static void init_dungeon_quests ( player_type creature_ptr)
static

ダンジョン内部のクエストを初期化する / Initialize random quests and final quests

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ init_turn()

static void init_turn ( player_type creature_ptr)
static

ゲームターンを初期化する / Reset turn

アンデッド系種族は開始時刻を夜からにする。

戻り値
なし
被呼び出し関係図:

◆ k_info_reset()

static void k_info_reset ( void  )
static

ベースアイテム構造体の鑑定済みフラグをリセットする。

戻り値
なし
被呼び出し関係図:

◆ load_prev_data()

static void load_prev_data ( player_type creature_ptr,
bool  swap 
)
static

プレイヤーのクイックスタート情報をプレイヤー構造体へ読み込む / Load the previous data

引数
swapTRUEならば現在のプレイヤー構造体上との内容をスワップする形で読み込む。
戻り値
なし。
呼び出し関係図:
被呼び出し関係図:

◆ player_birth()

void player_birth ( player_type creature_ptr)

プレイヤー作成処理のメインルーチン/ Create a new character.

Note that we may be called with "junk" leftover in the various fields, so we must be sure to clear them first.

戻り値
なし
呼び出し関係図:

◆ player_birth_aux()

static bool player_birth_aux ( player_type creature_ptr)
static

player_birth()関数のサブセット/Helper function for 'player_birth()'

The delay may be reduced, but is recommended to keep players from continuously rolling up characters, which can be VERY expensive CPU wise. And it cuts down on player stupidity.

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ player_outfit()

void player_outfit ( player_type creature_ptr)

種族/職業/性格などに基づき初期所持アイテムを設定するメインセット関数。 / Init players with some belongings

Having an item makes the player "aware" of its purpose.

戻り値
なし
呼び出し関係図:

◆ player_wipe_without_name()

static void player_wipe_without_name ( player_type creature_ptr)
static

プレイヤー構造体の内容を初期値で消去する(名前を除く) / Clear all the global "character" data (without name)

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ save_prev_data()

static void save_prev_data ( player_type creature_ptr,
birther birther_ptr 
)
static

プレイヤーのクイックスタート情報をプレイヤー構造体から保存する / Save the current data for later

引数
birther_ptrクイックスタート構造体の参照ポインタ
戻り値
なし。
被呼び出し関係図:

◆ show_help()

static void show_help ( concptr  helpfile)
static

指定されたヘルプファイルを表示する / Show specific help file

引数
helpfileファイル名
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ wield_all()

static void wield_all ( player_type creature_ptr)
static

所持状態にあるアイテムの中から一部枠の装備可能なものを装備させる。

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

変数詳解

◆ agemax

s16b agemax

◆ agemin

s16b agemin

◆ auto_round

s32b auto_round
static

オートローラの試行回数 / Autoroll round

◆ chara_limit

struct { ... } chara_limit

オートローラの年齢、身長、体重、社会的地位の要求水準

◆ class_jouhou

concptr class_jouhou[MAX_CLASS]
static

職業の解説メッセージテーブル

◆ histpref_buf

char* histpref_buf = NULL
static

◆ htmax

s16b htmax

◆ htmin

s16b htmin

◆ player_init

byte player_init[MAX_CLASS][3][2]
static

プレイヤーの職業毎の初期装備テーブル。/
Each player starts out with a few items, given as tval/sval pairs.


In addition, he always has some food and a few torches.

◆ previous_char

birther previous_char

◆ race_jouhou

concptr race_jouhou[MAX_RACES]
static

種族の解説メッセージテーブル

◆ realm_jouhou

concptr realm_jouhou[VALID_REALM]
static

魔法領域の詳細解説メッセージテーブル

◆ realm_subinfo

concptr realm_subinfo[VALID_REALM]
static

魔法領域の簡易解説メッセージテーブル

◆ scmax

s16b scmax

◆ scmin

s16b scmin

◆ seikaku_jouhou

concptr seikaku_jouhou[MAX_SEIKAKU]
static

性格の解説メッセージテーブル

◆ stat_limit

s16b stat_limit[6]
static

オートローラの能力値的要求水準 / Autoroll limit

◆ stat_match

s32b stat_match[6]
static

オートローラ中、各能力値が水準を超えた回数 / Autoroll matches

◆ wtmax

s16b wtmax

◆ wtmin

s16b wtmin