Hengband  2.2.1
マクロ定義 | 関数 | 変数
player-status.c ファイル
#include "angband.h"
#include "core.h"
#include "util.h"
#include "bldg.h"
#include "quest.h"
#include "player-move.h"
#include "player-status.h"
#include "player-effects.h"
#include "player-skill.h"
#include "player-race.h"
#include "player-class.h"
#include "player-personality.h"
#include "player-damage.h"
#include "floor.h"
#include "floor-events.h"
#include "feature.h"
#include "artifact.h"
#include "avatar.h"
#include "spells.h"
#include "spells-status.h"
#include "object.h"
#include "object-hook.h"
#include "object-ego.h"
#include "monster.h"
#include "monster-status.h"
#include "monsterrace-hook.h"
#include "mutation.h"
#include "patron.h"
#include "realm-hex.h"
#include "realm-song.h"
#include "cmd-pet.h"
#include "cmd-spell.h"
#include "dungeon.h"
#include "objectkind.h"
#include "monsterrace.h"
#include "autopick.h"
#include "cmd-dump.h"
#include "melee.h"
#include "world.h"
#include "view-mainwindow.h"
#include "files.h"
#include "cmd-magiceat.h"
player-status.c の依存先関係図:

マクロ定義

#define MAX_SAN_HORROR   20
 恐ろしい対象の形容数(正常時) [詳解]
 
#define MAX_SAN_FUNNY   22
 恐ろしい対象の形容数(幻覚時) [詳解]
 
#define MAX_SAN_COMMENT   5
 恐ろしい対象を見たときの絶叫メッセージ数(幻覚時) [詳解]
 

関数

concptr your_alignment (player_type *creature_ptr)
 
int weapon_exp_level (int weapon_exp)
 
int riding_exp_level (int riding_exp)
 
int spell_exp_level (int spell_exp)
 
void calc_bonuses (player_type *creature_ptr)
 プレイヤーの全ステータスを更新する / Calculate the players current "state", taking into account not only race/class intrinsics, but also objects being worn and temporary spell effects. [詳解]
 
static void calc_alignment (player_type *creature_ptr)
 
static void calc_hitpoints (player_type *creature_ptr)
 プレイヤーの最大HPを計算する / Calculate the players (maximal) hit points Adjust current hitpoints if necessary [詳解]
 
static void calc_torch (player_type *creature_ptr)
 プレイヤーの光源半径を計算する / Extract and set the current "lite radius" [詳解]
 
static void calc_spells (player_type *creature_ptr)
 プレイヤーの現在学習可能な魔法数を計算し、増減に応じて魔法の忘却、再学習を処置する。 / Calculate number of spells player should have, and forget, or remember, spells until that number is properly reflected. [詳解]
 
static void calc_mana (player_type *creature_ptr)
 プレイヤーの最大MPを計算する / Calculate maximum mana. [詳解]
 
s16b calc_num_fire (player_type *creature_ptr, object_type *o_ptr)
 装備中の射撃武器の威力倍率を返す / calcurate the fire rate of target object [詳解]
 
WEIGHT weight_limit (player_type *creature_ptr)
 プレイヤーの所持重量制限を計算する / Computes current weight limit. [詳解]
 
bool has_melee_weapon (player_type *creature_ptr, int i)
 プレイヤーが現在右手/左手に武器を持っているか判定する / [詳解]
 
BIT_FLAGS16 empty_hands (player_type *creature_ptr, bool riding_control)
 プレイヤーの現在開いている手の状態を返す [詳解]
 
bool heavy_armor (player_type *creature_ptr)
 プレイヤーが防具重量制限のある職業時にペナルティを受ける状態にあるかどうかを返す。 [詳解]
 
void update_creature (player_type *creature_ptr)
 update のフラグに応じた更新をまとめて行う / Handle "update" [詳解]
 
bool player_has_no_spellbooks (player_type *creature_ptr)
 プレイヤーが魔道書を一冊も持っていないかを判定する [詳解]
 
void take_turn (player_type *creature_ptr, PERCENTAGE need_cost)
 
void free_turn (player_type *creature_ptr)
 
bool player_place (player_type *creature_ptr, POSITION y, POSITION x)
 プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX [詳解]
 
void wreck_the_pattern (player_type *creature_ptr)
 種族アンバライトが出血時パターンの上に乗った際のペナルティ処理 [詳解]
 
void sanity_blast (player_type *creature_ptr, monster_type *m_ptr, bool necro)
 ELDRITCH_HORRORによるプレイヤーの精神破壊処理 [詳解]
 
void check_experience (player_type *creature_ptr)
 プレイヤーの経験値について整合性のためのチェックと調整を行う / Advance experience levels and print experience [詳解]
 
void cnv_stat (int val, char *out_val)
 現在の修正後能力値を3~17及び18/xxx形式に変換する / Converts stat num into a six-char (right justified) string [詳解]
 
s16b modify_stat_value (int value, int amount)
 能力値現在値から3~17及び18/xxx様式に基づく加減算を行う。 Modify a stat value by a "modifier", return new value [詳解]
 
long calc_score (player_type *creature_ptr)
 スコアを計算する / Hack – Calculates the total number of points earned -JWT- [詳解]
 
void cheat_death (player_type *creature_ptr)
 

変数

const concptr stat_names [6]
 能力値テーブル / Abbreviations of healthy stats [詳解]
 
const concptr stat_names_reduced [6]
 能力値テーブル(能力低下時) / Abbreviations of damaged stats [詳解]
 
static concptr horror_desc [MAX_SAN_HORROR]
 ELDRITCH HORROR効果時のモンスターの形容メッセージ(通常時) [詳解]
 
static concptr funny_desc [MAX_SAN_FUNNY]
 ELDRITCH HORROR効果時のモンスターの形容メッセージ(幻覚状態時) [詳解]
 
static concptr funny_comments [MAX_SAN_COMMENT]
 ELDRITCH HORROR効果時の幻覚時間延長を示す錯乱表現 [詳解]
 
const s32b player_exp [PY_MAX_LEVEL]
 基本必要経験値テーブル / Base experience levels, may be adjusted up for race and/or class [詳解]
 
const s32b player_exp_a [PY_MAX_LEVEL]
 基本必要強化値テーブル(アンドロイド専用) [詳解]
 
const byte adj_mag_study []
 知力/賢さによるレベル毎の習得可能魔法数テーブル Stat Table (INT/WIS) – Number of half-spells per level [詳解]
 
const byte adj_mag_mana []
 知力/賢さによるMP修正テーブル Stat Table (INT/WIS) – extra 1/4-mana-points per level [詳解]
 
const byte adj_mag_fail []
 知力/賢さによる最低魔法失敗率テーブル Stat Table (INT/WIS) – Minimum failure rate (percentage) [詳解]
 
const byte adj_mag_stat []
 知力/賢さによる魔法失敗率修正テーブル Stat Table (INT/WIS) – Various things [詳解]
 
const byte adj_chr_gold []
 魅力による店での取引修正テーブル Stat Table (CHR) – payment percentages [詳解]
 
const byte adj_int_dev []
 知力による魔道具使用修正テーブル Stat Table (INT) – Magic devices [詳解]
 
const byte adj_wis_sav []
 賢さによる魔法防御修正テーブル Stat Table (WIS) – Saving throw [詳解]
 
const byte adj_dex_dis []
 器用さによるトラップ解除修正テーブル Stat Table (DEX) – disarming [詳解]
 
const byte adj_int_dis []
 知力によるトラップ解除修正テーブル Stat Table (INT) – disarming [詳解]
 
const byte adj_dex_ta []
 器用さによるAC修正テーブル Stat Table (DEX) – bonus to ac (plus 128) [詳解]
 
const byte adj_str_td []
 腕力によるダメージ修正テーブル Stat Table (STR) – bonus to dam (plus 128) [詳解]
 
const byte adj_dex_th []
 器用度による命中修正テーブル Stat Table (DEX) – bonus to hit (plus 128) [詳解]
 
const byte adj_str_th []
 腕力による命中修正テーブル Stat Table (STR) – bonus to hit (plus 128) [詳解]
 
const byte adj_str_wgt []
 腕力による基本所持重量値テーブル Stat Table (STR) – weight limit in deca-pounds [詳解]
 
const byte adj_str_hold []
 腕力による武器重量限界値テーブル Stat Table (STR) – weapon weight limit in pounds [詳解]
 
const byte adj_str_dig []
 腕力による採掘能力修正値テーブル Stat Table (STR) – digging value [詳解]
 
const byte adj_dex_safe []
 器用さによる盗難防止&体当たり成功判定修正テーブル Stat Table (DEX) – chance of avoiding "theft" and "falling" [詳解]
 
const byte adj_con_fix []
 耐久による基本HP自然治癒値テーブル / Stat Table (CON) – base regeneration rate [詳解]
 
const byte adj_con_mhp []
 耐久による基本HP自然治癒値テーブル / Stat Table (CON) – extra 1/4-hitpoints per level (plus 128) [詳解]
 
const byte adj_chr_chm []
 魅力による魅了能力修正テーブル / Stat Table (CHR) – charm [詳解]
 
player_type p_body
 
player_typep_ptr = &p_body
 

マクロ定義詳解

◆ MAX_SAN_COMMENT

#define MAX_SAN_COMMENT   5

恐ろしい対象を見たときの絶叫メッセージ数(幻覚時)

◆ MAX_SAN_FUNNY

#define MAX_SAN_FUNNY   22

恐ろしい対象の形容数(幻覚時)

◆ MAX_SAN_HORROR

#define MAX_SAN_HORROR   20

恐ろしい対象の形容数(正常時)

関数詳解

◆ calc_alignment()

static void calc_alignment ( player_type creature_ptr)
static
呼び出し関係図:
被呼び出し関係図:

◆ calc_bonuses()

void calc_bonuses ( player_type creature_ptr)

プレイヤーの全ステータスを更新する / Calculate the players current "state", taking into account not only race/class intrinsics, but also objects being worn and temporary spell effects.

戻り値
なし
See also calc_mana() and calc_hitpoints().
Take note of the new "speed code", in particular, a very strong
player will start slowing down as soon as he reaches 150 pounds,
but not until he reaches 450 pounds will he be half as fast as
a normal kobold.  This both hurts and helps the player, hurts
because in the old days a player could just avoid 300 pounds,
and helps because now carrying 300 pounds is not very painful.
The "weapon" and "bow" do *not* add to the bonuses to hit or to
damage, since that would affect non-combat things.  These values
are actually added in later, at the appropriate place.
This function induces various "status" messages.
呼び出し関係図:

◆ calc_hitpoints()

static void calc_hitpoints ( player_type creature_ptr)
static

プレイヤーの最大HPを計算する / Calculate the players (maximal) hit points Adjust current hitpoints if necessary

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

◆ calc_mana()

static void calc_mana ( player_type creature_ptr)
static

プレイヤーの最大MPを計算する / Calculate maximum mana.

You do not need to know any spells. Note that mana is lowered by heavy (or inappropriate) armor.

戻り値
なし

This function induces status messages.

呼び出し関係図:
被呼び出し関係図:

◆ calc_num_fire()

s16b calc_num_fire ( player_type creature_ptr,
object_type o_ptr 
)

装備中の射撃武器の威力倍率を返す / calcurate the fire rate of target object

引数
o_ptr計算する射撃武器のアイテム情報参照ポインタ
戻り値
射撃倍率の値(100で1.00倍)
呼び出し関係図:

◆ calc_score()

long calc_score ( player_type creature_ptr)

スコアを計算する / Hack – Calculates the total number of points earned -JWT-

戻り値
なし

◆ calc_spells()

static void calc_spells ( player_type creature_ptr)
static

プレイヤーの現在学習可能な魔法数を計算し、増減に応じて魔法の忘却、再学習を処置する。 / Calculate number of spells player should have, and forget, or remember, spells until that number is properly reflected.

戻り値
なし

Note that this function induces various "status" messages, which must be bypasses until the character is created.

呼び出し関係図:
被呼び出し関係図:

◆ calc_torch()

static void calc_torch ( player_type creature_ptr)
static

プレイヤーの光源半径を計算する / Extract and set the current "lite radius"

戻り値
なし

SWD: Experimental modification: multiple light sources have additive effect.

呼び出し関係図:
被呼び出し関係図:

◆ cheat_death()

void cheat_death ( player_type creature_ptr)
呼び出し関係図:

◆ check_experience()

void check_experience ( player_type creature_ptr)

プレイヤーの経験値について整合性のためのチェックと調整を行う / Advance experience levels and print experience

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

◆ cnv_stat()

void cnv_stat ( int  val,
char *  out_val 
)

現在の修正後能力値を3~17及び18/xxx形式に変換する / Converts stat num into a six-char (right justified) string

引数
val能力値
out_val出力先文字列ポインタ
戻り値
なし

◆ empty_hands()

BIT_FLAGS16 empty_hands ( player_type creature_ptr,
bool  riding_control 
)

プレイヤーの現在開いている手の状態を返す

引数
riding_control乗馬中により片手を必要としている状態ならばTRUEを返す。
戻り値
開いている手のビットフラグ

◆ free_turn()

void free_turn ( player_type creature_ptr)

◆ has_melee_weapon()

bool has_melee_weapon ( player_type creature_ptr,
int  i 
)

プレイヤーが現在右手/左手に武器を持っているか判定する /

引数
i判定する手のID(右手:0 左手:1)
戻り値
持っているならばTRUE
呼び出し関係図:

◆ heavy_armor()

bool heavy_armor ( player_type creature_ptr)

プレイヤーが防具重量制限のある職業時にペナルティを受ける状態にあるかどうかを返す。

戻り値
ペナルティが適用されるならばTRUE。

◆ modify_stat_value()

s16b modify_stat_value ( int  value,
int  amount 
)

能力値現在値から3~17及び18/xxx様式に基づく加減算を行う。 Modify a stat value by a "modifier", return new value

引数
value現在値
amount加減算値
戻り値
加減算後の値
Stats go up: 3,4,...,17,18,18/10,18/20,...,18/220
Or even: 18/13, 18/23, 18/33, ..., 18/220
Stats go down: 18/220, 18/210,..., 18/10, 18, 17, ..., 3
Or even: 18/13, 18/03, 18, 17, ..., 3

◆ player_has_no_spellbooks()

bool player_has_no_spellbooks ( player_type creature_ptr)

プレイヤーが魔道書を一冊も持っていないかを判定する

戻り値
魔道書を一冊も持っていないならTRUEを返す
呼び出し関係図:

◆ player_place()

bool player_place ( player_type creature_ptr,
POSITION  y,
POSITION  x 
)

プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX

引数
x配置先X座標
y配置先Y座標
戻り値
配置に成功したらTRUE

◆ riding_exp_level()

int riding_exp_level ( int  riding_exp)

◆ sanity_blast()

void sanity_blast ( player_type creature_ptr,
monster_type m_ptr,
bool  necro 
)

ELDRITCH_HORRORによるプレイヤーの精神破壊処理

引数
m_ptrELDRITCH_HORRORを引き起こしたモンスターの参照ポインタ
necro暗黒領域魔法の詠唱失敗によるものならばTRUEを返す
戻り値
なし
呼び出し関係図:

◆ spell_exp_level()

int spell_exp_level ( int  spell_exp)

◆ take_turn()

void take_turn ( player_type creature_ptr,
PERCENTAGE  need_cost 
)

◆ update_creature()

void update_creature ( player_type creature_ptr)

update のフラグに応じた更新をまとめて行う / Handle "update"

戻り値
なし

更新処理の対象はプレイヤーの能力修正/光源寿命/HP/MP/魔法の学習状態、他多数の外界の状態判定。

呼び出し関係図:

◆ weapon_exp_level()

int weapon_exp_level ( int  weapon_exp)

◆ weight_limit()

WEIGHT weight_limit ( player_type creature_ptr)

プレイヤーの所持重量制限を計算する / Computes current weight limit.

戻り値
制限重量(ポンド)

◆ wreck_the_pattern()

void wreck_the_pattern ( player_type creature_ptr)

種族アンバライトが出血時パターンの上に乗った際のペナルティ処理

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

◆ your_alignment()

concptr your_alignment ( player_type creature_ptr)

変数詳解

◆ adj_chr_chm

const byte adj_chr_chm[]

魅力による魅了能力修正テーブル / Stat Table (CHR) – charm

◆ adj_chr_gold

const byte adj_chr_gold[]

魅力による店での取引修正テーブル Stat Table (CHR) – payment percentages

◆ adj_con_fix

const byte adj_con_fix[]

耐久による基本HP自然治癒値テーブル / Stat Table (CON) – base regeneration rate

◆ adj_con_mhp

const byte adj_con_mhp[]

耐久による基本HP自然治癒値テーブル / Stat Table (CON) – extra 1/4-hitpoints per level (plus 128)

◆ adj_dex_dis

const byte adj_dex_dis[]

器用さによるトラップ解除修正テーブル Stat Table (DEX) – disarming

◆ adj_dex_safe

const byte adj_dex_safe[]

器用さによる盗難防止&体当たり成功判定修正テーブル Stat Table (DEX) – chance of avoiding "theft" and "falling"

◆ adj_dex_ta

const byte adj_dex_ta[]

器用さによるAC修正テーブル Stat Table (DEX) – bonus to ac (plus 128)

◆ adj_dex_th

const byte adj_dex_th[]

器用度による命中修正テーブル Stat Table (DEX) – bonus to hit (plus 128)

◆ adj_int_dev

const byte adj_int_dev[]

知力による魔道具使用修正テーブル Stat Table (INT) – Magic devices

◆ adj_int_dis

const byte adj_int_dis[]

知力によるトラップ解除修正テーブル Stat Table (INT) – disarming

◆ adj_mag_fail

const byte adj_mag_fail[]

知力/賢さによる最低魔法失敗率テーブル Stat Table (INT/WIS) – Minimum failure rate (percentage)

◆ adj_mag_mana

const byte adj_mag_mana[]

知力/賢さによるMP修正テーブル Stat Table (INT/WIS) – extra 1/4-mana-points per level

◆ adj_mag_stat

const byte adj_mag_stat[]

知力/賢さによる魔法失敗率修正テーブル Stat Table (INT/WIS) – Various things

◆ adj_mag_study

const byte adj_mag_study[]

知力/賢さによるレベル毎の習得可能魔法数テーブル Stat Table (INT/WIS) – Number of half-spells per level

◆ adj_str_dig

const byte adj_str_dig[]

腕力による採掘能力修正値テーブル Stat Table (STR) – digging value

◆ adj_str_hold

const byte adj_str_hold[]

腕力による武器重量限界値テーブル Stat Table (STR) – weapon weight limit in pounds

◆ adj_str_td

const byte adj_str_td[]

腕力によるダメージ修正テーブル Stat Table (STR) – bonus to dam (plus 128)

◆ adj_str_th

const byte adj_str_th[]

腕力による命中修正テーブル Stat Table (STR) – bonus to hit (plus 128)

◆ adj_str_wgt

const byte adj_str_wgt[]

腕力による基本所持重量値テーブル Stat Table (STR) – weight limit in deca-pounds

◆ adj_wis_sav

const byte adj_wis_sav[]

賢さによる魔法防御修正テーブル Stat Table (WIS) – Saving throw

◆ funny_comments

funny_comments
static
初期値:
=
{
"Wow, cosmic, man!",
"Rad!",
"Groovy!",
"Cool!",
"Far out!"
}

ELDRITCH HORROR効果時の幻覚時間延長を示す錯乱表現

◆ funny_desc

funny_desc
static

ELDRITCH HORROR効果時のモンスターの形容メッセージ(幻覚状態時)

◆ horror_desc

horror_desc
static

ELDRITCH HORROR効果時のモンスターの形容メッセージ(通常時)

◆ p_body

player_type p_body

◆ p_ptr

player_type* p_ptr = &p_body

◆ player_exp

const s32b player_exp[PY_MAX_LEVEL]

基本必要経験値テーブル / Base experience levels, may be adjusted up for race and/or class

◆ player_exp_a

const s32b player_exp_a[PY_MAX_LEVEL]

基本必要強化値テーブル(アンドロイド専用)

◆ stat_names

const concptr stat_names[6]
初期値:
=
{
"STR : ", "INT : ", "WIS : ", "DEX : ", "CON : ", "CHR : "
}

能力値テーブル / Abbreviations of healthy stats

◆ stat_names_reduced

const concptr stat_names_reduced[6]
初期値:
=
{
"Str : ", "Int : ", "Wis : ", "Dex : ", "Con : ", "Chr : "
}

能力値テーブル(能力低下時) / Abbreviations of damaged stats