From: Deskull <61610939+sikabane-works@users.noreply.github.com> Date: Fri, 12 Nov 2021 14:29:27 +0000 (+0900) Subject: [Refactor] struct player_type を class PlayerType に置換。 X-Git-Tag: vmacos3.0.0-alpha52~39^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=91d4519e2312ace0f5342efb8a5421222aa51d2d;p=hengbandforosx%2Fhengbandosx.git [Refactor] struct player_type を class PlayerType に置換。 --- diff --git a/src/action/action-limited.cpp b/src/action/action-limited.cpp index 0cb5dd998..38fc9c4fc 100644 --- a/src/action/action-limited.cpp +++ b/src/action/action-limited.cpp @@ -22,7 +22,7 @@ * @brief 魔法系コマンドが制限されているかを返す。 * @return 魔法系コマンドを使用可能ならFALSE、不可能ならば理由をメッセージ表示してTRUEを返す。 */ -bool cmd_limit_cast(player_type *player_ptr) +bool cmd_limit_cast(PlayerType *player_ptr) { if (is_in_dungeon(player_ptr) && (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MAGIC))) { msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!")); @@ -43,7 +43,7 @@ bool cmd_limit_cast(player_type *player_ptr) return false; } -bool cmd_limit_confused(player_type *player_ptr) +bool cmd_limit_confused(PlayerType *player_ptr) { if (player_ptr->confused) { msg_print(_("混乱していてできない!", "You are too confused!")); @@ -53,7 +53,7 @@ bool cmd_limit_confused(player_type *player_ptr) return false; } -bool cmd_limit_image(player_type *player_ptr) +bool cmd_limit_image(PlayerType *player_ptr) { if (player_ptr->hallucinated) { msg_print(_("幻覚が見えて集中できない!", "Your hallucinations prevent you from concentrating!")); @@ -63,7 +63,7 @@ bool cmd_limit_image(player_type *player_ptr) return false; } -bool cmd_limit_stun(player_type *player_ptr) +bool cmd_limit_stun(PlayerType *player_ptr) { if (player_ptr->effects()->stun()->is_stunned()) { msg_print(_("頭が朦朧としていて集中できない!", "You are too stunned!")); @@ -73,7 +73,7 @@ bool cmd_limit_stun(player_type *player_ptr) return false; } -bool cmd_limit_arena(player_type *player_ptr) +bool cmd_limit_arena(PlayerType *player_ptr) { if (player_ptr->current_floor_ptr->inside_arena) { msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!")); @@ -84,7 +84,7 @@ bool cmd_limit_arena(player_type *player_ptr) return false; } -bool cmd_limit_blind(player_type *player_ptr) +bool cmd_limit_blind(PlayerType *player_ptr) { if (player_ptr->blind) { msg_print(_("目が見えない。", "You can't see anything.")); @@ -99,7 +99,7 @@ bool cmd_limit_blind(player_type *player_ptr) return false; } -bool cmd_limit_time_walk(player_type *player_ptr) +bool cmd_limit_time_walk(PlayerType *player_ptr) { if (player_ptr->timewalk) { if (flush_failure) diff --git a/src/action/action-limited.h b/src/action/action-limited.h index 8dc9705f3..9fcb309b0 100644 --- a/src/action/action-limited.h +++ b/src/action/action-limited.h @@ -4,11 +4,11 @@ * @brief プレイヤーの行動制約判定ヘッダ */ -struct player_type; -bool cmd_limit_cast(player_type *player_ptr); -bool cmd_limit_arena(player_type *player_ptr); -bool cmd_limit_time_walk(player_type *player_ptr); -bool cmd_limit_blind(player_type *player_ptr); -bool cmd_limit_confused(player_type *player_ptr); -bool cmd_limit_image(player_type *player_ptr); -bool cmd_limit_stun(player_type *player_ptr); +class PlayerType; +bool cmd_limit_cast(PlayerType *player_ptr); +bool cmd_limit_arena(PlayerType *player_ptr); +bool cmd_limit_time_walk(PlayerType *player_ptr); +bool cmd_limit_blind(PlayerType *player_ptr); +bool cmd_limit_confused(PlayerType *player_ptr); +bool cmd_limit_image(PlayerType *player_ptr); +bool cmd_limit_stun(PlayerType *player_ptr); diff --git a/src/action/activation-execution.cpp b/src/action/activation-execution.cpp index 3a4146b19..3565d1dc7 100644 --- a/src/action/activation-execution.cpp +++ b/src/action/activation-execution.cpp @@ -67,7 +67,7 @@ static void decide_activation_level(ae_type *ae_ptr) ae_ptr->lev = e_info[ae_ptr->o_ptr->name2].level; } -static void decide_chance_fail(player_type *player_ptr, ae_type *ae_ptr) +static void decide_chance_fail(PlayerType *player_ptr, ae_type *ae_ptr) { ae_ptr->chance = player_ptr->skill_dev; if (player_ptr->confused) @@ -86,7 +86,7 @@ static void decide_chance_fail(player_type *player_ptr, ae_type *ae_ptr) ae_ptr->chance = USE_DEVICE; } -static void decide_activation_success(player_type *player_ptr, ae_type *ae_ptr) +static void decide_activation_success(PlayerType *player_ptr, ae_type *ae_ptr) { if (player_ptr->pclass == PlayerClassType::BERSERKER) { ae_ptr->success = false; @@ -114,7 +114,7 @@ static bool check_activation_success(ae_type *ae_ptr) return false; } -static bool check_activation_conditions(player_type *player_ptr, ae_type *ae_ptr) +static bool check_activation_conditions(PlayerType *player_ptr, ae_type *ae_ptr) { if (!check_activation_success(ae_ptr)) return false; @@ -139,7 +139,7 @@ static bool check_activation_conditions(player_type *player_ptr, ae_type *ae_ptr * @param o_ptr 対象のオブジェクト構造体ポインタ * @return 発動実行の是非を返す。 */ -static bool activate_artifact(player_type *player_ptr, object_type *o_ptr) +static bool activate_artifact(PlayerType *player_ptr, object_type *o_ptr) { concptr name = k_info[o_ptr->k_idx].name.c_str(); auto tmp_act_ptr = find_activation_info(o_ptr); @@ -179,7 +179,7 @@ static bool activate_artifact(player_type *player_ptr, object_type *o_ptr) } } -static bool activate_whistle(player_type *player_ptr, ae_type *ae_ptr) +static bool activate_whistle(PlayerType *player_ptr, ae_type *ae_ptr) { if (ae_ptr->o_ptr->tval != ItemKindType::WHISTLE) return false; @@ -219,7 +219,7 @@ static bool activate_whistle(player_type *player_ptr, ae_type *ae_ptr) * the user hits "escape" at the "direction" prompt. * */ -void exe_activate(player_type *player_ptr, INVENTORY_IDX item) +void exe_activate(PlayerType *player_ptr, INVENTORY_IDX item) { PlayerEnergy(player_ptr).set_player_turn_energy(100); ae_type tmp_ae; diff --git a/src/action/activation-execution.h b/src/action/activation-execution.h index 7855adf3f..f2ae6a951 100644 --- a/src/action/activation-execution.h +++ b/src/action/activation-execution.h @@ -6,5 +6,5 @@ #include "system/angband.h" -struct player_type; -void exe_activate(player_type *player_ptr, INVENTORY_IDX item); +class PlayerType; +void exe_activate(PlayerType *player_ptr, INVENTORY_IDX item); diff --git a/src/action/movement-execution.cpp b/src/action/movement-execution.cpp index ce6c5cad5..a826d133e 100644 --- a/src/action/movement-execution.cpp +++ b/src/action/movement-execution.cpp @@ -79,7 +79,7 @@ static bool boundary_floor(grid_type *g_ptr, feature_type *f_ptr, feature_type * * any monster which might be in the destination grid. Previously,\n * moving into walls was "free" and did NOT hit invisible monsters.\n */ -void exe_movement(player_type *player_ptr, DIRECTION dir, bool do_pickup, bool break_trap) +void exe_movement(PlayerType *player_ptr, DIRECTION dir, bool do_pickup, bool break_trap) { POSITION y = player_ptr->y + ddy[dir]; POSITION x = player_ptr->x + ddx[dir]; diff --git a/src/action/movement-execution.h b/src/action/movement-execution.h index aaf330822..084022d19 100644 --- a/src/action/movement-execution.h +++ b/src/action/movement-execution.h @@ -6,5 +6,5 @@ #include "system/angband.h" -struct player_type; -void exe_movement(player_type *player_ptr, DIRECTION dir, bool do_pickup, bool break_trap); +class PlayerType; +void exe_movement(PlayerType *player_ptr, DIRECTION dir, bool do_pickup, bool break_trap); diff --git a/src/action/mutation-execution.cpp b/src/action/mutation-execution.cpp index 5d0b7639b..542c68871 100644 --- a/src/action/mutation-execution.cpp +++ b/src/action/mutation-execution.cpp @@ -61,7 +61,7 @@ * @param power 発動させる突然変異レイシャルのID * @return レイシャルを実行した場合TRUE、キャンセルした場合FALSEを返す */ -bool exe_mutation_power(player_type *player_ptr, PlayerMutationType power) +bool exe_mutation_power(PlayerType *player_ptr, PlayerMutationType power) { DIRECTION dir = 0; PLAYER_LEVEL lvl = player_ptr->lev; diff --git a/src/action/mutation-execution.h b/src/action/mutation-execution.h index 28ca64812..55400a4c2 100644 --- a/src/action/mutation-execution.h +++ b/src/action/mutation-execution.h @@ -5,5 +5,5 @@ */ enum class PlayerMutationType; -struct player_type; -bool exe_mutation_power(player_type *player_ptr, PlayerMutationType power); +class PlayerType; +bool exe_mutation_power(PlayerType *player_ptr, PlayerMutationType power); diff --git a/src/action/open-close-execution.cpp b/src/action/open-close-execution.cpp index 19b9ae2ad..514193bcd 100644 --- a/src/action/open-close-execution.cpp +++ b/src/action/open-close-execution.cpp @@ -36,7 +36,7 @@ * @param x 対象を行うマスのX座標 * @return 連続でコマンドを実行する時のみTRUE、1回きりの時はFALSE */ -bool exe_open(player_type *player_ptr, POSITION y, POSITION x) +bool exe_open(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; feature_type *f_ptr = &f_info[g_ptr->feat]; @@ -91,7 +91,7 @@ bool exe_open(player_type *player_ptr, POSITION y, POSITION x) * Returns TRUE if repeated commands may continue * @todo 常にFALSEを返している */ -bool exe_close(player_type *player_ptr, POSITION y, POSITION x) +bool exe_close(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; FEAT_IDX old_feat = g_ptr->feat; @@ -130,7 +130,7 @@ bool exe_close(player_type *player_ptr, POSITION y, POSITION x) * do_cmd_open_test() and exe_open(). * */ -bool easy_open_door(player_type *player_ptr, POSITION y, POSITION x) +bool easy_open_door(PlayerType *player_ptr, POSITION y, POSITION x) { int i, j; grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; @@ -186,7 +186,7 @@ bool easy_open_door(player_type *player_ptr, POSITION y, POSITION x) * Returns TRUE if repeated commands may continue * */ -bool exe_disarm_chest(player_type *player_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx) +bool exe_disarm_chest(PlayerType *player_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx) { bool more = false; object_type *o_ptr = &player_ptr->current_floor_ptr->o_list[o_idx]; @@ -242,7 +242,7 @@ bool exe_disarm_chest(player_type *player_ptr, POSITION y, POSITION x, OBJECT_ID * */ -bool exe_disarm(player_type *player_ptr, POSITION y, POSITION x, DIRECTION dir) +bool exe_disarm(PlayerType *player_ptr, POSITION y, POSITION x, DIRECTION dir) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; feature_type *f_ptr = &f_info[g_ptr->feat]; @@ -294,7 +294,7 @@ bool exe_disarm(player_type *player_ptr, POSITION y, POSITION x, DIRECTION dir) * Returns TRUE if repeated commands may continue * */ -bool exe_bash(player_type *player_ptr, POSITION y, POSITION x, DIRECTION dir) +bool exe_bash(PlayerType *player_ptr, POSITION y, POSITION x, DIRECTION dir) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; feature_type *f_ptr = &f_info[g_ptr->feat]; diff --git a/src/action/open-close-execution.h b/src/action/open-close-execution.h index aa0e455f7..7911f61d8 100644 --- a/src/action/open-close-execution.h +++ b/src/action/open-close-execution.h @@ -6,10 +6,10 @@ #include "system/angband.h" -struct player_type; -bool exe_open(player_type *player_ptr, POSITION y, POSITION x); -bool exe_close(player_type *player_ptr, POSITION y, POSITION x); -bool easy_open_door(player_type *player_ptr, POSITION y, POSITION x); -bool exe_disarm(player_type *player_ptr, POSITION y, POSITION x, DIRECTION dir); -bool exe_disarm_chest(player_type *player_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx); -bool exe_bash(player_type *player_ptr, POSITION y, POSITION x, DIRECTION dir); +class PlayerType; +bool exe_open(PlayerType *player_ptr, POSITION y, POSITION x); +bool exe_close(PlayerType *player_ptr, POSITION y, POSITION x); +bool easy_open_door(PlayerType *player_ptr, POSITION y, POSITION x); +bool exe_disarm(PlayerType *player_ptr, POSITION y, POSITION x, DIRECTION dir); +bool exe_disarm_chest(PlayerType *player_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx); +bool exe_bash(PlayerType *player_ptr, POSITION y, POSITION x, DIRECTION dir); diff --git a/src/action/open-util.cpp b/src/action/open-util.cpp index 08d7c5da3..68f92bb10 100644 --- a/src/action/open-util.cpp +++ b/src/action/open-util.cpp @@ -44,7 +44,7 @@ OBJECT_IDX chest_check(floor_type *floor_ptr, POSITION y, POSITION x, bool trapp * @details * If requested, count only trapped chests. */ -int count_chests(player_type *player_ptr, POSITION *y, POSITION *x, bool trapped) +int count_chests(PlayerType *player_ptr, POSITION *y, POSITION *x, bool trapped) { int count = 0; for (DIRECTION d = 0; d < 9; d++) { diff --git a/src/action/open-util.h b/src/action/open-util.h index 5b06239d8..cc6adf368 100644 --- a/src/action/open-util.h +++ b/src/action/open-util.h @@ -7,6 +7,6 @@ #include "system/angband.h" struct floor_type; -struct player_type; +class PlayerType; OBJECT_IDX chest_check(floor_type *floor_ptr, POSITION y, POSITION x, bool trapped); -int count_chests(player_type *player_ptr, POSITION *y, POSITION *x, bool trapped); +int count_chests(PlayerType *player_ptr, POSITION *y, POSITION *x, bool trapped); diff --git a/src/action/racial-execution.cpp b/src/action/racial-execution.cpp index ea4455114..a8aa9191b 100644 --- a/src/action/racial-execution.cpp +++ b/src/action/racial-execution.cpp @@ -25,7 +25,7 @@ * @param command 発動するレイシャルのID * @return 処理を実際に実行した場合はTRUE、キャンセルした場合FALSEを返す。 */ -bool exe_racial_power(player_type *player_ptr, const int32_t command) +bool exe_racial_power(PlayerType *player_ptr, const int32_t command) { if (command <= -3) return switch_class_racial_execution(player_ptr, command); @@ -41,7 +41,7 @@ bool exe_racial_power(player_type *player_ptr, const int32_t command) * @param rpi_ptr 発動したいレイシャル・パワー情報の構造体参照ポインタ * @return 成功率(%)を返す */ -PERCENTAGE racial_chance(player_type *player_ptr, rpi_type *rpi_ptr) +PERCENTAGE racial_chance(PlayerType *player_ptr, rpi_type *rpi_ptr) { if ((player_ptr->lev < rpi_ptr->min_level) || player_ptr->confused) return 0; @@ -86,7 +86,7 @@ PERCENTAGE racial_chance(player_type *player_ptr, rpi_type *rpi_ptr) return ((sum * 100) / difficulty) / stat; } -static void adjust_racial_power_difficulty(player_type *player_ptr, rpi_type *rpi_ptr, int *difficulty) +static void adjust_racial_power_difficulty(PlayerType *player_ptr, rpi_type *rpi_ptr, int *difficulty) { if (*difficulty == 0) return; @@ -110,7 +110,7 @@ static void adjust_racial_power_difficulty(player_type *player_ptr, rpi_type *rp * @param rpi_ptr 発動したいレイシャル・パワー情報の構造体参照ポインタ * @return racial_level_check_result */ -racial_level_check_result check_racial_level(player_type *player_ptr, rpi_type *rpi_ptr) +racial_level_check_result check_racial_level(PlayerType *player_ptr, rpi_type *rpi_ptr) { PLAYER_LEVEL min_level = rpi_ptr->min_level; int use_stat = rpi_ptr->stat; diff --git a/src/action/racial-execution.h b/src/action/racial-execution.h index 8eff8785f..a3ba0f787 100644 --- a/src/action/racial-execution.h +++ b/src/action/racial-execution.h @@ -13,7 +13,7 @@ enum racial_level_check_result { }; struct rpi_type; -struct player_type; -PERCENTAGE racial_chance(player_type *player_ptr, rpi_type *rpi_ptr); -racial_level_check_result check_racial_level(player_type *player_ptr, rpi_type *rpi_ptr); -bool exe_racial_power(player_type *player_ptr, const int32_t command); +class PlayerType; +PERCENTAGE racial_chance(PlayerType *player_ptr, rpi_type *rpi_ptr); +racial_level_check_result check_racial_level(PlayerType *player_ptr, rpi_type *rpi_ptr); +bool exe_racial_power(PlayerType *player_ptr, const int32_t command); diff --git a/src/action/run-execution.cpp b/src/action/run-execution.cpp index 77b871f87..44d6d4903 100644 --- a/src/action/run-execution.cpp +++ b/src/action/run-execution.cpp @@ -55,7 +55,7 @@ static bool find_breakleft; * @param x 移動元のX座標 * @return 移動先が既知の壁ならばTRUE */ -static bool see_wall(player_type *player_ptr, DIRECTION dir, POSITION y, POSITION x) +static bool see_wall(PlayerType *player_ptr, DIRECTION dir, POSITION y, POSITION x) { y += ddy[dir]; x += ddx[dir]; @@ -99,7 +99,7 @@ static bool see_wall(player_type *player_ptr, DIRECTION dir, POSITION y, POSITIO * \#x\# \@x\#\n * \@\@p. p\n */ -static void run_init(player_type *player_ptr, DIRECTION dir) +static void run_init(PlayerType *player_ptr, DIRECTION dir) { find_current = dir; find_prevdir = dir; @@ -164,7 +164,7 @@ static void run_init(player_type *player_ptr, DIRECTION dir) * @param x 移動元のX座標 * @return 移動先が未知の地形ならばTRUE */ -static bool see_nothing(player_type *player_ptr, DIRECTION dir, POSITION y, POSITION x) +static bool see_nothing(PlayerType *player_ptr, DIRECTION dir, POSITION y, POSITION x) { y += ddy[dir]; x += ddx[dir]; @@ -190,7 +190,7 @@ static bool see_nothing(player_type *player_ptr, DIRECTION dir, POSITION y, POSI * ダッシュ移動が継続できるならばTRUEを返す。 * Return TRUE if the running should be stopped */ -static bool run_test(player_type *player_ptr) +static bool run_test(PlayerType *player_ptr) { DIRECTION prev_dir = find_prevdir; int max = (prev_dir & 0x01) + 1; @@ -358,7 +358,7 @@ static bool run_test(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param dir 移動を試みる方向ID */ -void run_step(player_type *player_ptr, DIRECTION dir) +void run_step(PlayerType *player_ptr, DIRECTION dir) { if (dir) { ignore_avoid_run = true; diff --git a/src/action/run-execution.h b/src/action/run-execution.h index c0c3f6dc9..f4f79a4e5 100644 --- a/src/action/run-execution.h +++ b/src/action/run-execution.h @@ -13,5 +13,5 @@ extern bool ignore_avoid_run; extern byte cycle[MAX_RUN_CYCLES]; extern byte chome[MAX_RUN_CHOME]; -struct player_type; -void run_step(player_type *player_ptr, DIRECTION dir); +class PlayerType; +void run_step(PlayerType *player_ptr, DIRECTION dir); diff --git a/src/action/travel-execution.cpp b/src/action/travel-execution.cpp index abb9d1b06..9bfa523f0 100644 --- a/src/action/travel-execution.cpp +++ b/src/action/travel-execution.cpp @@ -30,7 +30,7 @@ travel_type travel; * @param prev_dir 前回移動を行った元の方角ID * @return 次の方向 */ -static DIRECTION travel_test(player_type *player_ptr, DIRECTION prev_dir) +static DIRECTION travel_test(PlayerType *player_ptr, DIRECTION prev_dir) { if (player_ptr->blind || no_lite(player_ptr)) { msg_print(_("目が見えない!", "You cannot see!")); @@ -91,7 +91,7 @@ static DIRECTION travel_test(player_type *player_ptr, DIRECTION prev_dir) * Travel command * @param player_ptr プレイヤーへの参照ポインタ */ -void travel_step(player_type *player_ptr) +void travel_step(PlayerType *player_ptr) { travel.dir = travel_test(player_ptr, travel.dir); if (!travel.dir) { diff --git a/src/action/travel-execution.h b/src/action/travel-execution.h index 4b40c6a95..863b13dcb 100644 --- a/src/action/travel-execution.h +++ b/src/action/travel-execution.h @@ -19,6 +19,6 @@ typedef struct travel_type { extern travel_type travel; struct floor_type; -struct player_type; -void travel_step(player_type *player_ptr); +class PlayerType; +void travel_step(PlayerType *player_ptr); void forget_travel_flow(floor_type *floor_ptr); diff --git a/src/action/tunnel-execution.cpp b/src/action/tunnel-execution.cpp index b713ee43e..b9b5a4e70 100644 --- a/src/action/tunnel-execution.cpp +++ b/src/action/tunnel-execution.cpp @@ -53,7 +53,7 @@ static bool do_cmd_tunnel_test(floor_type *floor_ptr, POSITION y, POSITION x) * Do not use twall anymore * Returns TRUE if repeated commands may continue */ -bool exe_tunnel(player_type *player_ptr, POSITION y, POSITION x) +bool exe_tunnel(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr; feature_type *f_ptr, *mimic_f_ptr; diff --git a/src/action/tunnel-execution.h b/src/action/tunnel-execution.h index 7709f85f8..6ecc77ec4 100644 --- a/src/action/tunnel-execution.h +++ b/src/action/tunnel-execution.h @@ -6,5 +6,5 @@ #include "system/angband.h" -struct player_type; -bool exe_tunnel(player_type *player_ptr, POSITION y, POSITION x); +class PlayerType; +bool exe_tunnel(PlayerType *player_ptr, POSITION y, POSITION x); diff --git a/src/action/weapon-shield.cpp b/src/action/weapon-shield.cpp index 05f3d04da..4125fd829 100644 --- a/src/action/weapon-shield.cpp +++ b/src/action/weapon-shield.cpp @@ -20,7 +20,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param item 持ち替えを行いたい装備部位ID */ -void verify_equip_slot(player_type *player_ptr, INVENTORY_IDX item) +void verify_equip_slot(PlayerType *player_ptr, INVENTORY_IDX item) { object_type *o_ptr, *new_o_ptr; GAME_TEXT o_name[MAX_NLEN]; diff --git a/src/action/weapon-shield.h b/src/action/weapon-shield.h index 0f287e42c..7ee5fa3ba 100644 --- a/src/action/weapon-shield.h +++ b/src/action/weapon-shield.h @@ -6,5 +6,5 @@ #include "system/angband.h" -struct player_type; -void verify_equip_slot(player_type *player_ptr, INVENTORY_IDX item); +class PlayerType; +void verify_equip_slot(PlayerType *player_ptr, INVENTORY_IDX item); diff --git a/src/artifact/fixed-art-generator.cpp b/src/artifact/fixed-art-generator.cpp index 14e7467f4..4904193de 100644 --- a/src/artifact/fixed-art-generator.cpp +++ b/src/artifact/fixed-art-generator.cpp @@ -39,7 +39,7 @@ * 純戦士系職業は追加能力/耐性がもらえる。 * それ以外では、反感、太古の怨念、呪いが付き追加能力/耐性はもらえない。 */ -static bool invest_terror_mask(player_type *player_ptr, object_type *o_ptr) +static bool invest_terror_mask(PlayerType *player_ptr, object_type *o_ptr) { if (o_ptr->name1 != ART_TERROR) return false; @@ -64,7 +64,7 @@ static bool invest_terror_mask(player_type *player_ptr, object_type *o_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param o_ptr 対象のオブジェクト構造体への参照ポインタ */ -static void milim_swimsuit(player_type *player_ptr, object_type *o_ptr) +static void milim_swimsuit(PlayerType *player_ptr, object_type *o_ptr) { if ((o_ptr->name1 != ART_MILIM) || (player_ptr->ppersonality != PERSONALITY_SEXY)) return; @@ -88,7 +88,7 @@ static void milim_swimsuit(player_type *player_ptr, object_type *o_ptr) * @details * 対象は村正、ロビントンのハープ、龍争虎鬪、ブラッディムーン、羽衣、天女の羽衣、ミリム */ -static void invest_special_artifact_abilities(player_type *player_ptr, object_type *o_ptr) +static void invest_special_artifact_abilities(PlayerType *player_ptr, object_type *o_ptr) { switch (o_ptr->name1) { case ART_MURAMASA: @@ -126,7 +126,7 @@ static void invest_special_artifact_abilities(player_type *player_ptr, object_ty * @param a_ptr 固定アーティファクト情報への参照ポインタ * @param q_ptr オブジェクト情報への参照ポインタ */ -static void fixed_artifact_random_abilities(player_type *player_ptr, artifact_type *a_ptr, object_type *o_ptr) +static void fixed_artifact_random_abilities(PlayerType *player_ptr, artifact_type *a_ptr, object_type *o_ptr) { auto give_power = false; auto give_resistance = false; @@ -203,7 +203,7 @@ static void invest_curse_to_fixed_artifact(artifact_type *a_ptr, object_type *o_ * @param o_ptr 生成に割り当てたいオブジェクトの構造体参照ポインタ * @return 適用したアーティファクト情報への参照ポインタ */ -artifact_type *apply_artifact(player_type *player_ptr, object_type *o_ptr) +artifact_type *apply_artifact(PlayerType *player_ptr, object_type *o_ptr) { auto a_ptr = &a_info[o_ptr->name1]; o_ptr->pval = a_ptr->pval; @@ -234,7 +234,7 @@ artifact_type *apply_artifact(player_type *player_ptr, object_type *o_ptr) * 仮に2個以上存在可能かつ装備品以外の固定アーティファクトが作成されれば * drop_near()関数の返り値は信用できなくなる. */ -bool create_named_art(player_type *player_ptr, ARTIFACT_IDX a_idx, POSITION y, POSITION x) +bool create_named_art(PlayerType *player_ptr, ARTIFACT_IDX a_idx, POSITION y, POSITION x) { auto a_ptr = &a_info[a_idx]; if (a_ptr->name.empty()) @@ -265,7 +265,7 @@ bool create_named_art(player_type *player_ptr, ARTIFACT_IDX a_idx, POSITION y, P * This routine should only be called by "apply_magic()"\n * Note -- see "make_artifact_special()" and "apply_magic()"\n */ -bool make_artifact(player_type *player_ptr, object_type *o_ptr) +bool make_artifact(PlayerType *player_ptr, object_type *o_ptr) { auto floor_ptr = player_ptr->current_floor_ptr; if (floor_ptr->dun_level == 0) @@ -321,7 +321,7 @@ bool make_artifact(player_type *player_ptr, object_type *o_ptr) *\n * Note -- see "make_artifact()" and "apply_magic()"\n */ -bool make_artifact_special(player_type *player_ptr, object_type *o_ptr) +bool make_artifact_special(PlayerType *player_ptr, object_type *o_ptr) { KIND_OBJECT_IDX k_idx = 0; diff --git a/src/artifact/fixed-art-generator.h b/src/artifact/fixed-art-generator.h index 0fa401c2c..b40ece65a 100644 --- a/src/artifact/fixed-art-generator.h +++ b/src/artifact/fixed-art-generator.h @@ -8,8 +8,8 @@ typedef struct artifact_type artifact_type; struct object_type; -struct player_type; -bool create_named_art(player_type *player_ptr, ARTIFACT_IDX a_idx, POSITION y, POSITION x); -bool make_artifact(player_type *player_ptr, object_type *o_ptr); -artifact_type *apply_artifact(player_type *player_ptr, object_type *o_ptr); -bool make_artifact_special(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool create_named_art(PlayerType *player_ptr, ARTIFACT_IDX a_idx, POSITION y, POSITION x); +bool make_artifact(PlayerType *player_ptr, object_type *o_ptr); +artifact_type *apply_artifact(PlayerType *player_ptr, object_type *o_ptr); +bool make_artifact_special(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/artifact/random-art-characteristics.cpp b/src/artifact/random-art-characteristics.cpp index 3a72677ed..f273eb2c1 100644 --- a/src/artifact/random-art-characteristics.cpp +++ b/src/artifact/random-art-characteristics.cpp @@ -73,7 +73,7 @@ static void add_negative_flags(object_type *o_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param o_ptr 対象のオブジェクト構造体ポインタ */ -void curse_artifact(player_type *player_ptr, object_type *o_ptr) +void curse_artifact(PlayerType *player_ptr, object_type *o_ptr) { pval_subtraction(o_ptr); o_ptr->curse_flags.set({ CurseTraitType::HEAVY_CURSE, CurseTraitType::CURSED }); @@ -144,7 +144,7 @@ void get_random_name(object_type *o_ptr, char *return_name, bool armour, int pow } /*対邪平均ダメージの計算処理*/ -static HIT_POINT calc_arm_avgdamage(player_type *player_ptr, object_type *o_ptr) +static HIT_POINT calc_arm_avgdamage(PlayerType *player_ptr, object_type *o_ptr) { auto flgs = object_flags(o_ptr); HIT_POINT base, forced, vorpal; @@ -172,7 +172,7 @@ static HIT_POINT calc_arm_avgdamage(player_type *player_ptr, object_type *o_ptr) return dam; } -bool has_extreme_damage_rate(player_type *player_ptr, object_type *o_ptr) +bool has_extreme_damage_rate(PlayerType *player_ptr, object_type *o_ptr) { auto flgs = object_flags(o_ptr); if (flgs.has(TR_VAMPIRIC)) { diff --git a/src/artifact/random-art-characteristics.h b/src/artifact/random-art-characteristics.h index d09039ada..6e7c27f13 100644 --- a/src/artifact/random-art-characteristics.h +++ b/src/artifact/random-art-characteristics.h @@ -5,7 +5,7 @@ */ struct object_type; -struct player_type; -void curse_artifact(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +void curse_artifact(PlayerType *player_ptr, object_type *o_ptr); void get_random_name(object_type *o_ptr, char *return_name, bool armour, int power); -bool has_extreme_damage_rate(player_type *player_ptr, object_type *o_ptr); +bool has_extreme_damage_rate(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/artifact/random-art-generator.cpp b/src/artifact/random-art-generator.cpp index 6067cf0d6..dfa3c4aee 100644 --- a/src/artifact/random-art-generator.cpp +++ b/src/artifact/random-art-generator.cpp @@ -73,7 +73,7 @@ static bool weakening_artifact(object_type *o_ptr) return false; } -static void set_artifact_bias(player_type *player_ptr, object_type *o_ptr, int *warrior_artifact_bias) +static void set_artifact_bias(PlayerType *player_ptr, object_type *o_ptr, int *warrior_artifact_bias) { switch (player_ptr->pclass) { case PlayerClassType::WARRIOR: @@ -153,7 +153,7 @@ static void set_artifact_bias(player_type *player_ptr, object_type *o_ptr, int * } } -static void decide_warrior_bias(player_type *player_ptr, object_type *o_ptr, const bool a_scroll) +static void decide_warrior_bias(PlayerType *player_ptr, object_type *o_ptr, const bool a_scroll) { int warrior_artifact_bias = 0; if (a_scroll && one_in_(4)) @@ -189,7 +189,7 @@ static int decide_random_art_power(const bool a_cursed) return powers; } -static void invest_powers(player_type *player_ptr, object_type *o_ptr, int *powers, bool *has_pval, const bool a_cursed) +static void invest_powers(PlayerType *player_ptr, object_type *o_ptr, int *powers, bool *has_pval, const bool a_cursed) { int max_type = o_ptr->is_weapon_ammo() ? 7 : 5; while ((*powers)--) { @@ -349,7 +349,7 @@ static int decide_random_art_power_level(object_type *o_ptr, const bool a_cursed return 3; } -static void name_unnatural_random_artifact(player_type *player_ptr, object_type *o_ptr, const bool a_scroll, const int power_level, GAME_TEXT *new_name) +static void name_unnatural_random_artifact(PlayerType *player_ptr, object_type *o_ptr, const bool a_scroll, const int power_level, GAME_TEXT *new_name) { if (!a_scroll) { get_random_name(o_ptr, new_name, o_ptr->is_armour(), power_level); @@ -377,7 +377,7 @@ static void name_unnatural_random_artifact(player_type *player_ptr, object_type } static void generate_unnatural_random_artifact( - player_type *player_ptr, object_type *o_ptr, const bool a_scroll, const int power_level, const int max_powers, const int total_flags) + PlayerType *player_ptr, object_type *o_ptr, const bool a_scroll, const int power_level, const int max_powers, const int total_flags) { GAME_TEXT new_name[1024]; strcpy(new_name, ""); @@ -397,7 +397,7 @@ static void generate_unnatural_random_artifact( * @param a_scroll アーティファクト生成の巻物上の処理。呪いのアーティファクトが生成対象外となる。 * @return 常にTRUE(1)を返す */ -bool become_random_artifact(player_type *player_ptr, object_type *o_ptr, bool a_scroll) +bool become_random_artifact(PlayerType *player_ptr, object_type *o_ptr, bool a_scroll) { o_ptr->artifact_bias = 0; o_ptr->name1 = 0; diff --git a/src/artifact/random-art-generator.h b/src/artifact/random-art-generator.h index b31f44939..caef290a1 100644 --- a/src/artifact/random-art-generator.h +++ b/src/artifact/random-art-generator.h @@ -5,5 +5,5 @@ */ struct object_type; -struct player_type; -bool become_random_artifact(player_type *player_ptr, object_type *o_ptr, bool a_scroll); +class PlayerType; +bool become_random_artifact(PlayerType *player_ptr, object_type *o_ptr, bool a_scroll); diff --git a/src/artifact/random-art-misc.cpp b/src/artifact/random-art-misc.cpp index d604fea36..7e5e34c1f 100644 --- a/src/artifact/random-art-misc.cpp +++ b/src/artifact/random-art-misc.cpp @@ -246,7 +246,7 @@ static void invest_misc_weak_esps(object_type *o_ptr) * @attention オブジェクトのtval、svalに依存したハードコーディング処理がある。 * @param o_ptr 対象のオブジェクト構造体ポインタ */ -void random_misc(player_type *player_ptr, object_type *o_ptr) +void random_misc(PlayerType *player_ptr, object_type *o_ptr) { if (switch_misc_bias(o_ptr)) return; diff --git a/src/artifact/random-art-misc.h b/src/artifact/random-art-misc.h index ca95f4b5d..7d3dbc67a 100644 --- a/src/artifact/random-art-misc.h +++ b/src/artifact/random-art-misc.h @@ -5,5 +5,5 @@ */ struct object_type; -struct player_type; -void random_misc(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +void random_misc(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/autopick/autopick-destroyer.cpp b/src/autopick/autopick-destroyer.cpp index 3bebed28b..35a85f11d 100644 --- a/src/autopick/autopick-destroyer.cpp +++ b/src/autopick/autopick-destroyer.cpp @@ -36,7 +36,7 @@ * @param o_ptr アイテムへの参照ポインタ * @return 特別なクラス、かつそのクラス特有のアイテムであればFALSE、それ以外はTRUE */ -static bool is_leave_special_item(player_type *player_ptr, object_type *o_ptr) +static bool is_leave_special_item(PlayerType *player_ptr, object_type *o_ptr) { if (!leave_special) return true; @@ -61,7 +61,7 @@ static bool is_leave_special_item(player_type *player_ptr, object_type *o_ptr) /*! * @brief Automatically destroy items in this grid. */ -static bool is_opt_confirm_destroy(player_type *player_ptr, object_type *o_ptr) +static bool is_opt_confirm_destroy(PlayerType *player_ptr, object_type *o_ptr) { if (!destroy_items) return false; @@ -99,7 +99,7 @@ static bool is_opt_confirm_destroy(player_type *player_ptr, object_type *o_ptr) return true; } -void auto_destroy_item(player_type *player_ptr, object_type *o_ptr, int autopick_idx) +void auto_destroy_item(PlayerType *player_ptr, object_type *o_ptr, int autopick_idx) { bool destroy = false; if (is_opt_confirm_destroy(player_ptr, o_ptr)) diff --git a/src/autopick/autopick-destroyer.h b/src/autopick/autopick-destroyer.h index eb9187110..da61ccdf6 100644 --- a/src/autopick/autopick-destroyer.h +++ b/src/autopick/autopick-destroyer.h @@ -1,5 +1,5 @@ #pragma once struct object_type; -struct player_type; -void auto_destroy_item(player_type *player_ptr, object_type *o_ptr, int autopick_idx); +class PlayerType; +void auto_destroy_item(PlayerType *player_ptr, object_type *o_ptr, int autopick_idx); diff --git a/src/autopick/autopick-drawer.cpp b/src/autopick/autopick-drawer.cpp index f9303dfd2..0ebaf882c 100644 --- a/src/autopick/autopick-drawer.cpp +++ b/src/autopick/autopick-drawer.cpp @@ -17,7 +17,7 @@ #define DESCRIPT_HGT 3 -static void process_dirty_expression(player_type *player_ptr, text_body_type *tb) +static void process_dirty_expression(PlayerType *player_ptr, text_body_type *tb) { if ((tb->dirty_flags & DIRTY_EXPRESSION) == 0) return; @@ -57,7 +57,7 @@ static void process_dirty_expression(player_type *player_ptr, text_body_type *tb /*! * @brief Draw text */ -void draw_text_editor(player_type *player_ptr, text_body_type *tb) +void draw_text_editor(PlayerType *player_ptr, text_body_type *tb) { int by1 = 0, by2 = 0; diff --git a/src/autopick/autopick-drawer.h b/src/autopick/autopick-drawer.h index 565c0ffb5..1dd4c8e38 100644 --- a/src/autopick/autopick-drawer.h +++ b/src/autopick/autopick-drawer.h @@ -1,5 +1,5 @@ #pragma once struct text_body_type; -struct player_type; -void draw_text_editor(player_type *player_ptr, text_body_type *tb); +class PlayerType; +void draw_text_editor(PlayerType *player_ptr, text_body_type *tb); diff --git a/src/autopick/autopick-editor-command.cpp b/src/autopick/autopick-editor-command.cpp index 3fac8f61f..819f9ad2d 100644 --- a/src/autopick/autopick-editor-command.cpp +++ b/src/autopick/autopick-editor-command.cpp @@ -34,7 +34,7 @@ * @return * @details Execute a single editor command */ -ape_quittance do_editor_command(player_type *player_ptr, text_body_type *tb, int com_id) +ape_quittance do_editor_command(PlayerType *player_ptr, text_body_type *tb, int com_id) { switch (com_id) { case EC_QUIT: { diff --git a/src/autopick/autopick-editor-command.h b/src/autopick/autopick-editor-command.h index f8732c87a..6eac11eae 100644 --- a/src/autopick/autopick-editor-command.h +++ b/src/autopick/autopick-editor-command.h @@ -7,6 +7,6 @@ enum ape_quittance { APE_QUIT_AND_SAVE = 2 }; -struct player_type; +class PlayerType; struct text_body_type; -ape_quittance do_editor_command(player_type *player_ptr, text_body_type *tb, int com_id); +ape_quittance do_editor_command(PlayerType *player_ptr, text_body_type *tb, int com_id); diff --git a/src/autopick/autopick-entry.cpp b/src/autopick/autopick-entry.cpp index c3d57e89d..3150f7a93 100644 --- a/src/autopick/autopick-entry.cpp +++ b/src/autopick/autopick-entry.cpp @@ -285,7 +285,7 @@ bool autopick_new_entry(autopick_type *entry, concptr str, bool allow_default) /*! * @brief Get auto-picker entry from o_ptr. */ -void autopick_entry_from_object(player_type *player_ptr, autopick_type *entry, object_type *o_ptr) +void autopick_entry_from_object(PlayerType *player_ptr, autopick_type *entry, object_type *o_ptr) { /* Assume that object name is to be added */ bool name = true; @@ -642,7 +642,7 @@ concptr autopick_line_from_entry_kill(autopick_type *entry) /*! * @brief Choose an item and get auto-picker entry from it. */ -bool entry_from_choosed_object(player_type *player_ptr, autopick_type *entry) +bool entry_from_choosed_object(PlayerType *player_ptr, autopick_type *entry) { concptr q = _("どのアイテムを登録しますか? ", "Enter which item? "); concptr s = _("アイテムを持っていない。", "You have nothing to enter."); diff --git a/src/autopick/autopick-entry.h b/src/autopick/autopick-entry.h index c32b5b90a..b5b8a26f0 100644 --- a/src/autopick/autopick-entry.h +++ b/src/autopick/autopick-entry.h @@ -4,9 +4,9 @@ typedef struct autopick_type autopick_type; struct object_type; -struct player_type; +class PlayerType; bool autopick_new_entry(autopick_type *entry, concptr str, bool allow_default); -void autopick_entry_from_object(player_type *player_ptr, autopick_type *entry, object_type *o_ptr); +void autopick_entry_from_object(PlayerType *player_ptr, autopick_type *entry, object_type *o_ptr); concptr autopick_line_from_entry(autopick_type *entry); concptr autopick_line_from_entry_kill(autopick_type *entry); -bool entry_from_choosed_object(player_type *player_ptr, autopick_type *entry); +bool entry_from_choosed_object(PlayerType *player_ptr, autopick_type *entry); diff --git a/src/autopick/autopick-finder.cpp b/src/autopick/autopick-finder.cpp index 937f463e7..393824093 100644 --- a/src/autopick/autopick-finder.cpp +++ b/src/autopick/autopick-finder.cpp @@ -33,7 +33,7 @@ * A function for Auto-picker/destroyer * Examine whether the object matches to the list of keywords or not. */ -int find_autopick_list(player_type *player_ptr, object_type *o_ptr) +int find_autopick_list(PlayerType *player_ptr, object_type *o_ptr) { GAME_TEXT o_name[MAX_NLEN]; if (o_ptr->tval == ItemKindType::GOLD) @@ -53,7 +53,7 @@ int find_autopick_list(player_type *player_ptr, object_type *o_ptr) /*! * @brief Choose an item for search */ -bool get_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp) +bool get_object_for_search(PlayerType *player_ptr, object_type **o_handle, concptr *search_strp) { concptr q = _("どのアイテムを検索しますか? ", "Enter which item? "); concptr s = _("アイテムを持っていない。", "You have nothing to enter."); @@ -73,7 +73,7 @@ bool get_object_for_search(player_type *player_ptr, object_type **o_handle, conc /*! * @brief Prepare for search by destroyed object */ -bool get_destroyed_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp) +bool get_destroyed_object_for_search(PlayerType *player_ptr, object_type **o_handle, concptr *search_strp) { if (!autopick_last_destroyed_object.k_idx) return false; @@ -93,7 +93,7 @@ bool get_destroyed_object_for_search(player_type *player_ptr, object_type **o_ha * TERM_YELLOW : Overwrite mode * TERM_WHITE : Insert mode */ -byte get_string_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp) +byte get_string_for_search(PlayerType *player_ptr, object_type **o_handle, concptr *search_strp) { byte color = TERM_YELLOW; char buf[MAX_NLEN + 20]; @@ -288,7 +288,7 @@ byte get_string_for_search(player_type *player_ptr, object_type **o_handle, conc /*! * @brief Search next line matches for o_ptr */ -void search_for_object(player_type *player_ptr, text_body_type *tb, object_type *o_ptr, bool forward) +void search_for_object(PlayerType *player_ptr, text_body_type *tb, object_type *o_ptr, bool forward) { autopick_type an_entry, *entry = &an_entry; GAME_TEXT o_name[MAX_NLEN]; diff --git a/src/autopick/autopick-finder.h b/src/autopick/autopick-finder.h index 4e9c758ff..ef56f4564 100644 --- a/src/autopick/autopick-finder.h +++ b/src/autopick/autopick-finder.h @@ -3,11 +3,11 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; struct text_body_type; -int find_autopick_list(player_type *player_ptr, object_type *o_ptr); -bool get_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp); -bool get_destroyed_object_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp); -byte get_string_for_search(player_type *player_ptr, object_type **o_handle, concptr *search_strp); -void search_for_object(player_type *player_ptr, text_body_type *tb, object_type *o_ptr, bool forward); +int find_autopick_list(PlayerType *player_ptr, object_type *o_ptr); +bool get_object_for_search(PlayerType *player_ptr, object_type **o_handle, concptr *search_strp); +bool get_destroyed_object_for_search(PlayerType *player_ptr, object_type **o_handle, concptr *search_strp); +byte get_string_for_search(PlayerType *player_ptr, object_type **o_handle, concptr *search_strp); +void search_for_object(PlayerType *player_ptr, text_body_type *tb, object_type *o_ptr, bool forward); void search_for_string(text_body_type *tb, concptr search_str, bool forward); diff --git a/src/autopick/autopick-matcher.cpp b/src/autopick/autopick-matcher.cpp index 5f2f20f4e..7bb424e55 100644 --- a/src/autopick/autopick-matcher.cpp +++ b/src/autopick/autopick-matcher.cpp @@ -32,7 +32,7 @@ /*! * @brief A function for Auto-picker/destroyer Examine whether the object matches to the entry */ -bool is_autopick_match(player_type *player_ptr, object_type *o_ptr, autopick_type *entry, concptr o_name) +bool is_autopick_match(PlayerType *player_ptr, object_type *o_ptr, autopick_type *entry, concptr o_name) { concptr ptr = entry->name.c_str(); if (IS_FLG(FLG_UNAWARE) && o_ptr->is_aware()) diff --git a/src/autopick/autopick-matcher.h b/src/autopick/autopick-matcher.h index 20402bbb1..e3204507d 100644 --- a/src/autopick/autopick-matcher.h +++ b/src/autopick/autopick-matcher.h @@ -4,5 +4,5 @@ typedef struct autopick_type autopick_type; struct object_type; -struct player_type; -bool is_autopick_match(player_type *player_ptr, object_type *o_ptr, autopick_type *entry, concptr o_name); +class PlayerType; +bool is_autopick_match(PlayerType *player_ptr, object_type *o_ptr, autopick_type *entry, concptr o_name); diff --git a/src/autopick/autopick-reader-writer.cpp b/src/autopick/autopick-reader-writer.cpp index 0e7d4b82f..841733c07 100644 --- a/src/autopick/autopick-reader-writer.cpp +++ b/src/autopick/autopick-reader-writer.cpp @@ -12,7 +12,7 @@ /*! * @brief Load an autopick preference file */ -void autopick_load_pref(player_type *player_ptr, bool disp_mes) +void autopick_load_pref(PlayerType *player_ptr, bool disp_mes) { GAME_TEXT buf[80]; init_autopick(); @@ -38,7 +38,7 @@ void autopick_load_pref(player_type *player_ptr, bool disp_mes) /*! * @brief Get file name for autopick preference */ -concptr pickpref_filename(player_type *player_ptr, int filename_mode) +concptr pickpref_filename(PlayerType *player_ptr, int filename_mode) { static const char namebase[] = _("picktype", "pickpref"); @@ -86,7 +86,7 @@ static std::vector read_text_lines(concptr filename) /*! * @brief Copy the default autopick file to the user directory */ -static void prepare_default_pickpref(player_type *player_ptr) +static void prepare_default_pickpref(PlayerType *player_ptr) { const concptr messages[] = { _("あなたは「自動拾いエディタ」を初めて起動しました。", "You have activated the Auto-Picker Editor for the first time."), _("自動拾いのユーザー設定ファイルがまだ書かれていないので、", "Since user pref file for autopick is not yet created,"), @@ -132,7 +132,7 @@ static void prepare_default_pickpref(player_type *player_ptr) * @brief Read an autopick prefence file to memory * Prepare default if no user file is found */ -std::vector read_pickpref_text_lines(player_type *player_ptr, int *filename_mode_p) +std::vector read_pickpref_text_lines(PlayerType *player_ptr, int *filename_mode_p) { /* Try a filename with player name */ *filename_mode_p = PT_WITH_PNAME; diff --git a/src/autopick/autopick-reader-writer.h b/src/autopick/autopick-reader-writer.h index e5c7ff80c..64e852f20 100644 --- a/src/autopick/autopick-reader-writer.h +++ b/src/autopick/autopick-reader-writer.h @@ -4,8 +4,8 @@ #include -struct player_type; -void autopick_load_pref(player_type *player_ptr, bool disp_mes); -std::vector read_pickpref_text_lines(player_type *player_ptr, int *filename_mode_p); +class PlayerType; +void autopick_load_pref(PlayerType *player_ptr, bool disp_mes); +std::vector read_pickpref_text_lines(PlayerType *player_ptr, int *filename_mode_p); bool write_text_lines(concptr filename, concptr *lines_list); -concptr pickpref_filename(player_type *player_ptr, int filename_mode); +concptr pickpref_filename(PlayerType *player_ptr, int filename_mode); diff --git a/src/autopick/autopick-registry.cpp b/src/autopick/autopick-registry.cpp index c13c0d4ea..ffd0e1ab5 100644 --- a/src/autopick/autopick-registry.cpp +++ b/src/autopick/autopick-registry.cpp @@ -26,7 +26,7 @@ static const char autoregister_header[] = "?:$AUTOREGISTER"; /*! * @brief Clear auto registered lines in the picktype.prf . */ -static bool clear_auto_register(player_type *player_ptr) +static bool clear_auto_register(PlayerType *player_ptr) { char pref_file[1024]; path_build(pref_file, sizeof(pref_file), ANGBAND_DIR_USER, pickpref_filename(player_ptr, PT_WITH_PNAME)); @@ -106,7 +106,7 @@ static bool clear_auto_register(player_type *player_ptr) /*! * @brief Automatically register an auto-destroy preference line */ -bool autopick_autoregister(player_type *player_ptr, object_type *o_ptr) +bool autopick_autoregister(PlayerType *player_ptr, object_type *o_ptr) { autopick_type an_entry, *entry = &an_entry; int autopick_registered = find_autopick_list(player_ptr, o_ptr); diff --git a/src/autopick/autopick-registry.h b/src/autopick/autopick-registry.h index f4eec89f4..88663b1c4 100644 --- a/src/autopick/autopick-registry.h +++ b/src/autopick/autopick-registry.h @@ -1,5 +1,5 @@ #pragma once struct object_type; -struct player_type; -bool autopick_autoregister(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool autopick_autoregister(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/autopick/autopick-util.cpp b/src/autopick/autopick-util.cpp index 5f029a09b..f3ab1ad10 100644 --- a/src/autopick/autopick-util.cpp +++ b/src/autopick/autopick-util.cpp @@ -52,7 +52,7 @@ int get_com_id(char key) /*! * @brief Auto inscription */ -void auto_inscribe_item(player_type *player_ptr, object_type *o_ptr, int idx) +void auto_inscribe_item(PlayerType *player_ptr, object_type *o_ptr, int idx) { if (idx < 0 || autopick_list[idx].insc.empty()) return; diff --git a/src/autopick/autopick-util.h b/src/autopick/autopick-util.h index 10fbb3837..c6100952e 100644 --- a/src/autopick/autopick-util.h +++ b/src/autopick/autopick-util.h @@ -80,10 +80,10 @@ typedef struct text_body_type { extern std::vector autopick_list; extern object_type autopick_last_destroyed_object; -struct player_type; +class PlayerType; void free_text_lines(std::vector &lines_list); int get_com_id(char key); -void auto_inscribe_item(player_type *player_ptr, object_type *o_ptr, int idx); +void auto_inscribe_item(PlayerType *player_ptr, object_type *o_ptr, int idx); int count_line(text_body_type *tb); /*! diff --git a/src/autopick/autopick.cpp b/src/autopick/autopick.cpp index 9080fb779..41a5727d7 100644 --- a/src/autopick/autopick.cpp +++ b/src/autopick/autopick.cpp @@ -37,7 +37,7 @@ /*! * @brief Auto-destroy marked item */ -static void autopick_delayed_alter_aux(player_type *player_ptr, INVENTORY_IDX item) +static void autopick_delayed_alter_aux(PlayerType *player_ptr, INVENTORY_IDX item) { object_type *o_ptr; o_ptr = ref_item(player_ptr, item); @@ -63,7 +63,7 @@ static void autopick_delayed_alter_aux(player_type *player_ptr, INVENTORY_IDX it * Scan inventry in reverse order to prevent * skipping after inven_item_optimize() */ -void autopick_delayed_alter(player_type *player_ptr) +void autopick_delayed_alter(PlayerType *player_ptr) { for (INVENTORY_IDX item = INVEN_TOTAL - 1; item >= 0; item--) autopick_delayed_alter_aux(player_ptr, item); @@ -84,7 +84,7 @@ void autopick_delayed_alter(player_type *player_ptr) * Auto-destroyer works only on inventory or on floor stack only when * requested. */ -void autopick_alter_item(player_type *player_ptr, INVENTORY_IDX item, bool destroy) +void autopick_alter_item(PlayerType *player_ptr, INVENTORY_IDX item, bool destroy) { object_type *o_ptr; o_ptr = ref_item(player_ptr, item); @@ -97,7 +97,7 @@ void autopick_alter_item(player_type *player_ptr, INVENTORY_IDX item, bool destr /*! * @brief Automatically pickup/destroy items in this grid. */ -void autopick_pickup_items(player_type *player_ptr, grid_type *g_ptr) +void autopick_pickup_items(PlayerType *player_ptr, grid_type *g_ptr) { for (auto it = g_ptr->o_idx_list.begin(); it != g_ptr->o_idx_list.end();) { OBJECT_IDX this_o_idx = *it++; diff --git a/src/autopick/autopick.h b/src/autopick/autopick.h index 66af9ca0d..ef673a996 100644 --- a/src/autopick/autopick.h +++ b/src/autopick/autopick.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct grid_type;; -struct player_type; -void autopick_alter_item(player_type *player_ptr, INVENTORY_IDX item, bool destroy); -void autopick_delayed_alter(player_type *player_ptr); -void autopick_pickup_items(player_type *player_ptr, grid_type *g_ptr); +class PlayerType; +void autopick_alter_item(PlayerType *player_ptr, INVENTORY_IDX item, bool destroy); +void autopick_delayed_alter(PlayerType *player_ptr); +void autopick_pickup_items(PlayerType *player_ptr, grid_type *g_ptr); diff --git a/src/avatar/avatar-changer.cpp b/src/avatar/avatar-changer.cpp index 912edb74d..148de8e70 100644 --- a/src/avatar/avatar-changer.cpp +++ b/src/avatar/avatar-changer.cpp @@ -23,7 +23,7 @@ /*! * @brief AvaterChangerコンストラクタ */ -AvatarChanger::AvatarChanger(player_type *player_ptr, monster_type *m_ptr) +AvatarChanger::AvatarChanger(PlayerType *player_ptr, monster_type *m_ptr) : player_ptr(player_ptr) , m_ptr(m_ptr) { diff --git a/src/avatar/avatar-changer.h b/src/avatar/avatar-changer.h index 9172ab1be..e9337df1a 100644 --- a/src/avatar/avatar-changer.h +++ b/src/avatar/avatar-changer.h @@ -3,15 +3,15 @@ #include "system/angband.h" struct monster_type; -struct player_type; +class PlayerType; class AvatarChanger { public: - AvatarChanger(player_type *player_ptr, monster_type *m_ptr); + AvatarChanger(PlayerType *player_ptr, monster_type *m_ptr); virtual ~AvatarChanger() = default; void change_virtue(); private: - player_type *player_ptr; + PlayerType *player_ptr; monster_type *m_ptr; void change_virtue_non_beginner(); void change_virtue_unique(); diff --git a/src/avatar/avatar.cpp b/src/avatar/avatar.cpp index 4218eb926..92af6b4ce 100644 --- a/src/avatar/avatar.cpp +++ b/src/avatar/avatar.cpp @@ -53,7 +53,7 @@ concptr virtue[MAX_VIRTUE] = { * @return 比較の真偽値を返す * @todo 引数名を直しておく */ -bool compare_virtue(player_type *player_ptr, int type, int num, int tekitou) +bool compare_virtue(PlayerType *player_ptr, int type, int num, int tekitou) { int vir = virtue_number(player_ptr, type) ? player_ptr->virtues[virtue_number(player_ptr, type) - 1] : 0; switch (tekitou) { @@ -77,7 +77,7 @@ bool compare_virtue(player_type *player_ptr, int type, int num, int tekitou) * @param type 確認したい徳のID * @return スロットがあるならばスロットのID(0~7)+1、ない場合は0を返す。 */ -int virtue_number(player_type *player_ptr, int type) +int virtue_number(PlayerType *player_ptr, int type) { for (int i = 0; i < 8; i++) if (player_ptr->vir_types[i] == type) @@ -90,7 +90,7 @@ int virtue_number(player_type *player_ptr, int type) * @brief プレイヤーの職業や種族に依存しないランダムな徳を取得する / Aux function * @param which 確認したい徳のID */ -static void get_random_virtue(player_type *player_ptr, int which) +static void get_random_virtue(PlayerType *player_ptr, int which) { int type = 0; while (!(type) || virtue_number(player_ptr, type)) { @@ -153,7 +153,7 @@ static void get_random_virtue(player_type *player_ptr, int which) * @param realm 魔法領域のID * @return 対応する徳のID */ -static enum virtue_idx get_realm_virtues(player_type *player_ptr, int16_t realm) +static enum virtue_idx get_realm_virtues(PlayerType *player_ptr, int16_t realm) { switch (realm) { case REALM_LIFE: @@ -211,7 +211,7 @@ static enum virtue_idx get_realm_virtues(player_type *player_ptr, int16_t realm) * @brief 作成中のプレイヤーキャラクターに徳8種類を与える。 / Select virtues & reset values for a new character * @details 職業に応じて1~4種が固定、種族に応じて1種類が与えられ、後は重複なくランダムに選択される。 */ -void initialize_virtues(player_type *player_ptr) +void initialize_virtues(PlayerType *player_ptr) { int i = 0, j = 0; int16_t tmp_vir; @@ -441,7 +441,7 @@ void initialize_virtues(player_type *player_ptr) * @param virtue 徳のID * @param amount 加減量 */ -void chg_virtue(player_type *player_ptr, int virtue_id, int amount) +void chg_virtue(PlayerType *player_ptr, int virtue_id, int amount) { for (int i = 0; i < 8; i++) { if (player_ptr->vir_types[i] != virtue_id) @@ -499,7 +499,7 @@ void chg_virtue(player_type *player_ptr, int virtue_id, int amount) * @param virtue 徳のID * @param amount セットしたい値 */ -void set_virtue(player_type *player_ptr, int virtue_id, int amount) +void set_virtue(PlayerType *player_ptr, int virtue_id, int amount) { for (int i = 0; i < 8; i++) if (player_ptr->vir_types[i] == virtue_id) { @@ -512,7 +512,7 @@ void set_virtue(player_type *player_ptr, int virtue_id, int amount) * @brief 徳のダンプ表示を行う * @param out_file ファイルポインタ */ -void dump_virtues(player_type *player_ptr, FILE *out_file) +void dump_virtues(PlayerType *player_ptr, FILE *out_file) { if (!out_file) return; diff --git a/src/avatar/avatar.h b/src/avatar/avatar.h index a26028820..a7be51ed6 100644 --- a/src/avatar/avatar.h +++ b/src/avatar/avatar.h @@ -29,11 +29,11 @@ enum virtue_idx { #define VIRTUE_LARGE 1 #define VIRTUE_SMALL 2 -struct player_type; -bool compare_virtue(player_type *player_ptr, int type, int num, int tekitou); -int virtue_number(player_type *player_ptr, int type); +class PlayerType; +bool compare_virtue(PlayerType *player_ptr, int type, int num, int tekitou); +int virtue_number(PlayerType *player_ptr, int type); extern concptr virtue[MAX_VIRTUE]; -void initialize_virtues(player_type *player_ptr); -void chg_virtue(player_type *player_ptr, int virtue, int amount); -void set_virtue(player_type *player_ptr, int virtue, int amount); -void dump_virtues(player_type *player_ptr, FILE *OutFile); +void initialize_virtues(PlayerType *player_ptr); +void chg_virtue(PlayerType *player_ptr, int virtue, int amount); +void set_virtue(PlayerType *player_ptr, int virtue, int amount); +void dump_virtues(PlayerType *player_ptr, FILE *OutFile); diff --git a/src/birth/auto-roller.cpp b/src/birth/auto-roller.cpp index 1f15b36f9..b2fd3e52b 100644 --- a/src/birth/auto-roller.cpp +++ b/src/birth/auto-roller.cpp @@ -109,7 +109,7 @@ static int32_t get_autoroller_prob(int *minval) * 純メイジ系は耐と魔法の能力が17で腕器16。 * デュアルかどうかは最大攻撃回数で決定。(4回以上) */ -static void decide_initial_stat(player_type *player_ptr, int *cval) +static void decide_initial_stat(PlayerType *player_ptr, int *cval) { auto pclass = enum2i(player_ptr->pclass); auto &class_ptr = class_info[pclass]; @@ -196,7 +196,7 @@ static void display_autoroller_chance(int *cval) * @brief オートローラで得たい能力値の基準を決める。 * @param player_ptr プレイヤーへの参照ポインタ */ -bool get_stat_limits(player_type *player_ptr) +bool get_stat_limits(PlayerType *player_ptr) { clear_from(10); put_str(_("能力値を抽選します。最低限得たい能力値を設定して下さい。", "Set minimum stats for picking up your charactor."), 10, 10); @@ -343,7 +343,7 @@ void initialize_chara_limit(chara_limit_type *chara_limit_ptr) /*! * @brief オートローラで得たい年齢、身長、体重、社会的地位の基準を決める。 */ -bool get_chara_limits(player_type *player_ptr, chara_limit_type *chara_limit_ptr) +bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr) { #define MAXITEMS 8 diff --git a/src/birth/auto-roller.h b/src/birth/auto-roller.h index 5824647a1..97ba5ce24 100644 --- a/src/birth/auto-roller.h +++ b/src/birth/auto-roller.h @@ -15,7 +15,7 @@ extern int32_t auto_round; extern int32_t auto_upper_round; extern int32_t autoroll_chance; -struct player_type; -bool get_stat_limits(player_type *player_ptr); +class PlayerType; +bool get_stat_limits(PlayerType *player_ptr); void initialize_chara_limit(chara_limit_type *chara_limit_ptr); -bool get_chara_limits(player_type *player_ptr, chara_limit_type *chara_limit_ptr); +bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr); diff --git a/src/birth/birth-body-spec.cpp b/src/birth/birth-body-spec.cpp index 11fedde48..41f7456ba 100644 --- a/src/birth/birth-body-spec.cpp +++ b/src/birth/birth-body-spec.cpp @@ -8,7 +8,7 @@ /*! * @brief プレイヤーの身長体重を決める / Get character's height and weight */ -void get_height_weight(player_type *player_ptr) +void get_height_weight(PlayerType *player_ptr) { int deviation; switch (player_ptr->psex) { @@ -30,7 +30,7 @@ void get_height_weight(player_type *player_ptr) * @brief プレイヤーの年齢を決める。 / Computes character's age, height, and weight by henkma * @details 内部でget_height_weight()も呼び出している。 */ -void get_ahw(player_type *player_ptr) +void get_ahw(PlayerType *player_ptr) { player_ptr->age = rp_ptr->b_age + randint1(rp_ptr->m_age); get_height_weight(player_ptr); @@ -40,7 +40,7 @@ void get_ahw(player_type *player_ptr) * @brief プレイヤーの初期所持金を決める。 / Get the player's starting money * @param player_ptr プレイヤーへの参照ポインタ */ -void get_money(player_type *player_ptr) +void get_money(PlayerType *player_ptr) { int gold = (player_ptr->sc * 6) + randint1(100) + 300; if (player_ptr->pclass == PlayerClassType::TOURIST) diff --git a/src/birth/birth-body-spec.h b/src/birth/birth-body-spec.h index 45b3ca17f..af8f3e512 100644 --- a/src/birth/birth-body-spec.h +++ b/src/birth/birth-body-spec.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void get_height_weight(player_type *player_ptr); -void get_ahw(player_type *player_ptr); -void get_money(player_type *player_ptr); +class PlayerType; +void get_height_weight(PlayerType *player_ptr); +void get_ahw(PlayerType *player_ptr); +void get_money(PlayerType *player_ptr); diff --git a/src/birth/birth-select-class.cpp b/src/birth/birth-select-class.cpp index 60c69a4e6..9a337cd2e 100644 --- a/src/birth/birth-select-class.cpp +++ b/src/birth/birth-select-class.cpp @@ -113,7 +113,7 @@ static void interpret_class_select_key_move(char c, int *cs) } } -static bool select_class(player_type *player_ptr, char *cur, char *sym, int *k) +static bool select_class(PlayerType *player_ptr, char *cur, char *sym, int *k) { auto cs = player_ptr->pclass; auto os = PlayerClassType::MAX; @@ -176,7 +176,7 @@ static bool select_class(player_type *player_ptr, char *cur, char *sym, int *k) /*! * @brief プレイヤーの職業選択を行う / Player class */ -bool get_player_class(player_type *player_ptr) +bool get_player_class(PlayerType *player_ptr) { clear_from(10); put_str( diff --git a/src/birth/birth-select-class.h b/src/birth/birth-select-class.h index ec24b2533..ca724dd92 100644 --- a/src/birth/birth-select-class.h +++ b/src/birth/birth-select-class.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool get_player_class(player_type *player_ptr); +class PlayerType; +bool get_player_class(PlayerType *player_ptr); diff --git a/src/birth/birth-select-personality.cpp b/src/birth/birth-select-personality.cpp index e0a2db961..075003af7 100644 --- a/src/birth/birth-select-personality.cpp +++ b/src/birth/birth-select-personality.cpp @@ -9,7 +9,7 @@ static const char p2 = ')'; -static void enumerate_personality_list(player_type *player_ptr, concptr *str, char *sym) +static void enumerate_personality_list(PlayerType *player_ptr, concptr *str, char *sym) { char buf[80]; for (int n = 0; n < MAX_PERSONALITIES; n++) { @@ -65,7 +65,7 @@ static void display_personality_stat(int cs, int *os, concptr *str, char *cur, c *os = cs; } -static void interpret_personality_select_key_move(player_type *player_ptr, char c, int *cs) +static void interpret_personality_select_key_move(PlayerType *player_ptr, char c, int *cs) { if (c == '8') { if (*cs >= 4) @@ -112,7 +112,7 @@ static void interpret_personality_select_key_move(player_type *player_ptr, char } } -static bool select_personality(player_type *player_ptr, int *k, concptr *str, char *sym) +static bool select_personality(PlayerType *player_ptr, int *k, concptr *str, char *sym) { char cur[80]; sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random")); @@ -184,7 +184,7 @@ static bool select_personality(player_type *player_ptr, int *k, concptr *str, ch /*! * @brief プレイヤーの性格選択を行う / Select player's personality */ -bool get_player_personality(player_type *player_ptr) +bool get_player_personality(PlayerType *player_ptr) { clear_from(10); put_str(_("注意:《性格》によってキャラクターの能力やボーナスが変化します。", "Note: Your personality determines various intrinsic abilities and bonuses."), diff --git a/src/birth/birth-select-personality.h b/src/birth/birth-select-personality.h index e8297ee31..dd8c6485a 100644 --- a/src/birth/birth-select-personality.h +++ b/src/birth/birth-select-personality.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool get_player_personality(player_type *player_ptr); +class PlayerType; +bool get_player_personality(PlayerType *player_ptr); diff --git a/src/birth/birth-select-race.cpp b/src/birth/birth-select-race.cpp index 0501cd970..34e887d1c 100644 --- a/src/birth/birth-select-race.cpp +++ b/src/birth/birth-select-race.cpp @@ -92,7 +92,7 @@ static void interpret_race_select_key_move(char c, int *cs) } } -static bool select_race(player_type *player_ptr, char *sym, int *k) +static bool select_race(PlayerType *player_ptr, char *sym, int *k) { char cur[80]; sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random")); @@ -153,7 +153,7 @@ static bool select_race(player_type *player_ptr, char *sym, int *k) /*! * @brief プレイヤーの種族選択を行う / Player race */ -bool get_player_race(player_type *player_ptr) +bool get_player_race(PlayerType *player_ptr) { clear_from(10); put_str( diff --git a/src/birth/birth-select-race.h b/src/birth/birth-select-race.h index 94bc49f6e..2b3a93a98 100644 --- a/src/birth/birth-select-race.h +++ b/src/birth/birth-select-race.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool get_player_race(player_type *player_ptr); +class PlayerType; +bool get_player_race(PlayerType *player_ptr); diff --git a/src/birth/birth-select-realm.cpp b/src/birth/birth-select-realm.cpp index dd604c6fa..310851b98 100644 --- a/src/birth/birth-select-realm.cpp +++ b/src/birth/birth-select-realm.cpp @@ -109,7 +109,7 @@ static birth_realm_type *initialize_birth_realm_type(birth_realm_type *birth_rea return birth_realm_ptr; } -static void impose_first_realm(const player_type *player_ptr, uint32_t *choices) +static void impose_first_realm(const PlayerType *player_ptr, uint32_t *choices) { if (player_ptr->realm2 == REALM_SELECT_CANCEL) return; @@ -124,7 +124,7 @@ static void impose_first_realm(const player_type *player_ptr, uint32_t *choices) } } -static void analyze_realms(const player_type *player_ptr, const uint32_t choices, birth_realm_type *birth_realm_ptr) +static void analyze_realms(const PlayerType *player_ptr, const uint32_t choices, birth_realm_type *birth_realm_ptr) { for (int i = 0; i < 32; i++) { if ((choices & (1UL << i)) == 0) @@ -196,7 +196,7 @@ static void interpret_realm_select_key(birth_realm_type *birth_realm_ptr, char c } } -static bool get_a_realm(player_type *player_ptr, birth_realm_type *birth_realm_ptr) +static bool get_a_realm(PlayerType *player_ptr, birth_realm_type *birth_realm_ptr) { birth_realm_ptr->os = birth_realm_ptr->n; while (true) { @@ -254,7 +254,7 @@ static bool get_a_realm(player_type *player_ptr, birth_realm_type *birth_realm_p * @return 選択した魔法領域のID * @details 領域数が0 (戦士等)or 1 (観光客等)なら自動での値を返す */ -static byte select_realm(player_type *player_ptr, uint32_t choices, int *count) +static byte select_realm(PlayerType *player_ptr, uint32_t choices, int *count) { byte auto_select = count_realm_selection(choices, count); clear_from(10); @@ -289,7 +289,7 @@ static void cleanup_realm_selection_window(void) * @param count 魔法領域の数 * @return 選んだ魔法領域で良ければTRUE、再選択ならばFALSE */ -static bool check_realm_selection(player_type *player_ptr, int count) +static bool check_realm_selection(PlayerType *player_ptr, int count) { if (count < 2) { prt(_("何かキーを押してください", "Hit any key."), 0, 0); @@ -306,7 +306,7 @@ static bool check_realm_selection(player_type *player_ptr, int count) * @brief 選択した魔法領域の解説を表示する / Choose the magical realms * @return ユーザが魔法領域の確定を選んだらTRUEを返す。 */ -bool get_player_realms(player_type *player_ptr) +bool get_player_realms(PlayerType *player_ptr) { /* Clean up infomation of modifications */ put_str(" ", 3, 40); diff --git a/src/birth/birth-select-realm.h b/src/birth/birth-select-realm.h index 8990b7901..ec348b4a6 100644 --- a/src/birth/birth-select-realm.h +++ b/src/birth/birth-select-realm.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool get_player_realms(player_type *player_ptr); +class PlayerType; +bool get_player_realms(PlayerType *player_ptr); diff --git a/src/birth/birth-stat.cpp b/src/birth/birth-stat.cpp index dca586854..02f866066 100644 --- a/src/birth/birth-stat.cpp +++ b/src/birth/birth-stat.cpp @@ -59,7 +59,7 @@ int adjust_stat(int value, int amount) * calc_bonuses()による、独立ステータスからの副次ステータス算出も行っている。 * For efficiency, we include a chunk of "calc_bonuses()".\n */ -void get_stats(player_type *player_ptr) +void get_stats(PlayerType *player_ptr) { while (true) { int sum = 0; @@ -88,7 +88,7 @@ void get_stats(player_type *player_ptr) /*! * @brief 経験値修正の合計値を計算 */ -uint16_t get_expfact(player_type *player_ptr) +uint16_t get_expfact(PlayerType *player_ptr) { uint16_t expfact = rp_ptr->r_exp; @@ -104,7 +104,7 @@ uint16_t get_expfact(player_type *player_ptr) /*! * @brief その他「オートローラ中は算出の対象にしない」副次ステータスを処理する / Roll for some info that the auto-roller ignores */ -void get_extra(player_type *player_ptr, bool roll_hitdie) +void get_extra(PlayerType *player_ptr, bool roll_hitdie) { player_ptr->expfact = get_expfact(player_ptr); @@ -150,7 +150,7 @@ void get_extra(player_type *player_ptr, bool roll_hitdie) * @param player_ptr プレイヤーへの参照ポインタ * @details 新生の薬やステータスシャッフルでもこの関数が呼ばれる */ -void get_max_stats(player_type *player_ptr) +void get_max_stats(PlayerType *player_ptr) { int dice[6]; while (true) { diff --git a/src/birth/birth-stat.h b/src/birth/birth-stat.h index 493fcc10c..d0a56037e 100644 --- a/src/birth/birth-stat.h +++ b/src/birth/birth-stat.h @@ -2,10 +2,10 @@ #include "system/angband.h" -struct player_type; +class PlayerType; int adjust_stat(int value, int amount); -void get_stats(player_type* player_ptr); -uint16_t get_expfact(player_type *player_ptr); -void get_extra(player_type *player_ptr, bool roll_hitdie); +void get_stats(PlayerType* player_ptr); +uint16_t get_expfact(PlayerType *player_ptr); +void get_extra(PlayerType *player_ptr, bool roll_hitdie); -void get_max_stats(player_type* player_ptr); +void get_max_stats(PlayerType* player_ptr); diff --git a/src/birth/birth-util.cpp b/src/birth/birth-util.cpp index 4e50c97da..edcb0c5fa 100644 --- a/src/birth/birth-util.cpp +++ b/src/birth/birth-util.cpp @@ -18,14 +18,14 @@ void birth_quit(void) * @param player_ptr プレイヤーへの参照ポインタ * @param helpfile ファイル名 */ -void show_help(player_type* player_ptr, concptr helpfile) +void show_help(PlayerType* player_ptr, concptr helpfile) { screen_save(); (void)show_file(player_ptr, true, helpfile, nullptr, 0, 0); screen_load(); } -void birth_help_option(player_type *player_ptr, char c, birth_kind bk) +void birth_help_option(PlayerType *player_ptr, char c, birth_kind bk) { concptr help_file; switch (bk) { diff --git a/src/birth/birth-util.h b/src/birth/birth-util.h index ac6714718..5d0ad8a4e 100644 --- a/src/birth/birth-util.h +++ b/src/birth/birth-util.h @@ -11,7 +11,7 @@ enum birth_kind BK_AUTO_ROLLER, }; -struct player_type; +class PlayerType; void birth_quit(void); -void show_help(player_type* player_ptr, concptr helpfile); -void birth_help_option(player_type *player_ptr, char c, birth_kind bk); +void show_help(PlayerType* player_ptr, concptr helpfile); +void birth_help_option(PlayerType *player_ptr, char c, birth_kind bk); diff --git a/src/birth/birth-wizard.cpp b/src/birth/birth-wizard.cpp index 5b60929e2..7fcad5990 100644 --- a/src/birth/birth-wizard.cpp +++ b/src/birth/birth-wizard.cpp @@ -51,7 +51,7 @@ */ #define AUTOROLLER_STEP 54321L -static void display_initial_birth_message(player_type *player_ptr) +static void display_initial_birth_message(PlayerType *player_ptr) { term_clear(); put_str(_("名前 :", "Name :"), 1, 26); @@ -69,7 +69,7 @@ static void display_initial_birth_message(player_type *player_ptr) * @param c 入力したコマンド * @details 他の関数名と被りそうだったので少し眺め */ -static void display_help_on_sex_select(player_type *player_ptr, char c) +static void display_help_on_sex_select(PlayerType *player_ptr, char c) { if (c == '?') do_cmd_help(player_ptr); @@ -87,7 +87,7 @@ static void display_help_on_sex_select(player_type *player_ptr, char c) * @buf 表示用バッファ * @return やり直すならFALSE、それ以外はTRUE */ -static bool get_player_sex(player_type *player_ptr, char *buf) +static bool get_player_sex(PlayerType *player_ptr, char *buf) { const char p2 = ')'; char cur[80]; @@ -158,7 +158,7 @@ static bool get_player_sex(player_type *player_ptr, char *buf) return true; } -static bool let_player_select_race(player_type *player_ptr) +static bool let_player_select_race(PlayerType *player_ptr) { clear_from(10); player_ptr->prace = PlayerRaceType::HUMAN; @@ -188,7 +188,7 @@ static bool let_player_select_race(player_type *player_ptr) return true; } -static bool let_player_select_class(player_type *player_ptr) +static bool let_player_select_class(PlayerType *player_ptr) { clear_from(10); player_ptr->pclass = PlayerClassType::WARRIOR; @@ -218,7 +218,7 @@ static bool let_player_select_class(player_type *player_ptr) return true; } -static bool let_player_select_personality(player_type *player_ptr) +static bool let_player_select_personality(PlayerType *player_ptr) { player_ptr->ppersonality = PERSONALITY_ORDINARY; while (true) { @@ -248,7 +248,7 @@ static bool let_player_select_personality(player_type *player_ptr) return true; } -static bool let_player_build_character(player_type *player_ptr) +static bool let_player_build_character(PlayerType *player_ptr) { char buf[80]; if (!get_player_sex(player_ptr, buf)) @@ -271,7 +271,7 @@ static bool let_player_build_character(player_type *player_ptr) return true; } -static void display_initial_options(player_type *player_ptr) +static void display_initial_options(PlayerType *player_ptr) { uint16_t expfact = get_expfact(player_ptr) - 100; int16_t adj[A_MAX]; @@ -348,7 +348,7 @@ static void auto_roller_count(void) auto_upper_round++; } -static bool decide_initial_stat(player_type *player_ptr) +static bool decide_initial_stat(PlayerType *player_ptr) { if (!autoroller) return true; @@ -364,7 +364,7 @@ static bool decide_initial_stat(player_type *player_ptr) return accept; } -static bool decide_body_spec(player_type *player_ptr, chara_limit_type chara_limit, bool *accept) +static bool decide_body_spec(PlayerType *player_ptr, chara_limit_type chara_limit, bool *accept) { if (!*accept) return false; @@ -386,7 +386,7 @@ static bool decide_body_spec(player_type *player_ptr, chara_limit_type chara_lim return *accept; } -static bool display_auto_roller_count(player_type *player_ptr, const int col) +static bool display_auto_roller_count(PlayerType *player_ptr, const int col) { if ((auto_round % AUTOROLLER_STEP) != 0) return false; @@ -407,7 +407,7 @@ static bool display_auto_roller_count(player_type *player_ptr, const int col) return false; } -static void exe_auto_roller(player_type *player_ptr, chara_limit_type chara_limit, const int col) +static void exe_auto_roller(PlayerType *player_ptr, chara_limit_type chara_limit, const int col) { while (autoroller || autochara) { get_stats(player_ptr); @@ -422,7 +422,7 @@ static void exe_auto_roller(player_type *player_ptr, chara_limit_type chara_limi } } -static bool display_auto_roller_result(player_type *player_ptr, bool prev, char *c) +static bool display_auto_roller_result(PlayerType *player_ptr, bool prev, char *c) { BIT_FLAGS mode = 0; while (true) { @@ -482,7 +482,7 @@ static bool display_auto_roller_result(player_type *player_ptr, bool prev, char * @param chara_limit 社会的地位の要求水準 * @details 2つめの結果以降は、'p'キーで1つ前のロール結果に戻せる。 */ -static bool display_auto_roller(player_type *player_ptr, chara_limit_type chara_limit) +static bool display_auto_roller(PlayerType *player_ptr, chara_limit_type chara_limit) { bool prev = false; @@ -529,7 +529,7 @@ static bool display_auto_roller(player_type *player_ptr, chara_limit_type chara_ * @param player_ptr プレイヤーへの参照ポインタ * @details ついでにステータス限界もここで決めている */ -static void set_name_history(player_type *player_ptr) +static void set_name_history(PlayerType *player_ptr) { clear_from(23); get_name(player_ptr); @@ -547,7 +547,7 @@ static void set_name_history(player_type *player_ptr) * from continuously rolling up characters, which can be VERY * expensive CPU wise. And it cuts down on player stupidity. */ -bool player_birth_wizard(player_type *player_ptr) +bool player_birth_wizard(PlayerType *player_ptr) { display_initial_birth_message(player_ptr); const char p2 = ')'; diff --git a/src/birth/birth-wizard.h b/src/birth/birth-wizard.h index 04672db7c..3f0ea957c 100644 --- a/src/birth/birth-wizard.h +++ b/src/birth/birth-wizard.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool player_birth_wizard(player_type *player_ptr); +class PlayerType; +bool player_birth_wizard(PlayerType *player_ptr); diff --git a/src/birth/character-builder.cpp b/src/birth/character-builder.cpp index 31275b2e0..0cf3c7777 100644 --- a/src/birth/character-builder.cpp +++ b/src/birth/character-builder.cpp @@ -43,7 +43,7 @@ * @brief プレイヤーキャラの作成結果を日記に書く * @param player_ptr プレイヤーへの参照ポインタ */ -static void write_birth_diary(player_type *player_ptr) +static void write_birth_diary(PlayerType *player_ptr) { concptr indent = " "; @@ -85,7 +85,7 @@ static void write_birth_diary(player_type *player_ptr) * Note that we may be called with "junk" leftover in the various * fields, so we must be sure to clear them first. */ -void player_birth(player_type *player_ptr) +void player_birth(PlayerType *player_ptr) { w_ptr->play_time = 0; wipe_monsters_list(player_ptr); diff --git a/src/birth/character-builder.h b/src/birth/character-builder.h index c53a595b7..451717ddc 100644 --- a/src/birth/character-builder.h +++ b/src/birth/character-builder.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void player_birth(player_type *player_ptr); +class PlayerType; +void player_birth(PlayerType *player_ptr); diff --git a/src/birth/game-play-initializer.cpp b/src/birth/game-play-initializer.cpp index c0ce39e8d..d043d0665 100644 --- a/src/birth/game-play-initializer.cpp +++ b/src/birth/game-play-initializer.cpp @@ -40,7 +40,7 @@ static void k_info_reset(void) * @param player_ptr プレイヤーへの参照ポインタ * @details 少し長いが、これ1つで処理が完結しているので分割は見送る */ -void player_wipe_without_name(player_type *player_ptr) +void player_wipe_without_name(PlayerType *player_ptr) { #ifdef SET_UID int uid = player_ptr->player_uid; @@ -170,7 +170,7 @@ void player_wipe_without_name(player_type *player_ptr) * @brief ダンジョン内部のクエストを初期化する / Initialize random quests and final quests * @param player_ptr プレイヤーへの参照ポインタ */ -void init_dungeon_quests(player_type *player_ptr) +void init_dungeon_quests(PlayerType *player_ptr) { int number_of_quests = MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1; init_flags = INIT_ASSIGN; @@ -205,7 +205,7 @@ void init_dungeon_quests(player_type *player_ptr) * @details アンデッド系種族は開始時刻を夜からにする / Undead start just sunset * @details */ -void init_turn(player_type *player_ptr) +void init_turn(PlayerType *player_ptr) { if (PlayerRace(player_ptr).life() == PlayerRaceLifeType::UNDEAD) { w_ptr->game_turn = (TURNS_PER_TICK * 3 * TOWN_DAWN) / 4 + 1; diff --git a/src/birth/game-play-initializer.h b/src/birth/game-play-initializer.h index 14119cf4e..ff3614403 100644 --- a/src/birth/game-play-initializer.h +++ b/src/birth/game-play-initializer.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void player_wipe_without_name(player_type *player_ptr); -void init_dungeon_quests(player_type *player_ptr); -void init_turn(player_type *player_ptr); +class PlayerType; +void player_wipe_without_name(PlayerType *player_ptr); +void init_dungeon_quests(PlayerType *player_ptr); +void init_turn(PlayerType *player_ptr); diff --git a/src/birth/history-editor.cpp b/src/birth/history-editor.cpp index 9ae027c29..93e4c0500 100644 --- a/src/birth/history-editor.cpp +++ b/src/birth/history-editor.cpp @@ -12,7 +12,7 @@ * @brief 生い立ちメッセージを編集する。/Character background edit-mode * @param player_ptr プレイヤーへの参照ポインタ */ -void edit_history(player_type *player_ptr) +void edit_history(PlayerType *player_ptr) { char old_history[4][60]; for (int i = 0; i < 4; i++) { diff --git a/src/birth/history-editor.h b/src/birth/history-editor.h index 68d76a747..0d7ce7e05 100644 --- a/src/birth/history-editor.h +++ b/src/birth/history-editor.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void edit_history(player_type *player_ptr); +class PlayerType; +void edit_history(PlayerType *player_ptr); diff --git a/src/birth/history-generator.cpp b/src/birth/history-generator.cpp index dc60f6c43..37043ebb3 100644 --- a/src/birth/history-generator.cpp +++ b/src/birth/history-generator.cpp @@ -4,7 +4,7 @@ #include "system/player-type-definition.h" #include "util/buffer-shaper.h" -static int get_history_chart(player_type *player_ptr) +static int get_history_chart(PlayerType *player_ptr) { switch (player_ptr->prace) { case PlayerRaceType::AMBERITE: @@ -91,7 +91,7 @@ static int get_history_chart(player_type *player_ptr) * @param buf 生い立ち情報のバッファ * @details 画面表示と社会的地位の決定が密結合していて分離できない */ -static void decide_social_class(player_type *player_ptr, char *buf) +static void decide_social_class(PlayerType *player_ptr, char *buf) { int social_class = randint1(4); int chart = get_history_chart(player_ptr); @@ -118,7 +118,7 @@ static void decide_social_class(player_type *player_ptr, char *buf) /*! * @brief プレイヤーの生い立ちの自動生成を行う。 / Get the racial history, and social class, using the "history charts". */ -void get_history(player_type *player_ptr) +void get_history(PlayerType *player_ptr) { for (int i = 0; i < 4; i++) player_ptr->history[i][0] = '\0'; diff --git a/src/birth/history-generator.h b/src/birth/history-generator.h index d5c35ee99..b843996e9 100644 --- a/src/birth/history-generator.h +++ b/src/birth/history-generator.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void get_history(player_type *player_ptr); +class PlayerType; +void get_history(PlayerType *player_ptr); diff --git a/src/birth/inventory-initializer.cpp b/src/birth/inventory-initializer.cpp index fb9b14ada..1c4d6a042 100644 --- a/src/birth/inventory-initializer.cpp +++ b/src/birth/inventory-initializer.cpp @@ -35,7 +35,7 @@ /*! * @brief 所持状態にあるアイテムの中から一部枠の装備可能なものを装備させる。 */ -void wield_all(player_type *player_ptr) +void wield_all(PlayerType *player_ptr) { object_type object_type_body; for (INVENTORY_IDX item = INVEN_PACK - 1; item >= 0; item--) { @@ -76,7 +76,7 @@ void wield_all(player_type *player_ptr) * @details アイテムを既知のものとした上でwield_all()関数により装備させる。 * @param o_ptr 処理したいオブジェクト構造体の参照ポインタ */ -void add_outfit(player_type *player_ptr, object_type *o_ptr) +void add_outfit(PlayerType *player_ptr, object_type *o_ptr) { object_aware(player_ptr, o_ptr); object_known(o_ptr); @@ -85,7 +85,7 @@ void add_outfit(player_type *player_ptr, object_type *o_ptr) wield_all(player_ptr); } -static void decide_initial_items(player_type *player_ptr, object_type *q_ptr) +static void decide_initial_items(PlayerType *player_ptr, object_type *q_ptr) { switch (player_ptr->prace) { case PlayerRaceType::VAMPIRE: @@ -139,7 +139,7 @@ static void decide_initial_items(player_type *player_ptr, object_type *q_ptr) * @brief 種族/職業/性格などに基づき初期所持アイテムを設定するメインセット関数。 / Init players with some belongings * @details Having an item makes the player "aware" of its purpose. */ -void player_outfit(player_type *player_ptr) +void player_outfit(PlayerType *player_ptr) { object_type *q_ptr; object_type forge; diff --git a/src/birth/inventory-initializer.h b/src/birth/inventory-initializer.h index 953fd45ba..9e4e2cd42 100644 --- a/src/birth/inventory-initializer.h +++ b/src/birth/inventory-initializer.h @@ -1,7 +1,7 @@ #pragma once struct object_type; -struct player_type; -void wield_all(player_type *player_ptr); -void add_outfit(player_type *player_ptr, object_type *o_ptr); -void player_outfit(player_type *player_ptr); +class PlayerType; +void wield_all(PlayerType *player_ptr); +void add_outfit(PlayerType *player_ptr, object_type *o_ptr); +void player_outfit(PlayerType *player_ptr); diff --git a/src/birth/quick-start.cpp b/src/birth/quick-start.cpp index 6013d7aa7..c4a644888 100644 --- a/src/birth/quick-start.cpp +++ b/src/birth/quick-start.cpp @@ -25,7 +25,7 @@ birther previous_char; /*! * @brief クイックスタート処理の問い合わせと実行を行う。/Ask whether the player use Quick Start or not. */ -bool ask_quick_start(player_type *player_ptr) +bool ask_quick_start(PlayerType *player_ptr) { if (!previous_char.quick_ok) return false; @@ -74,7 +74,7 @@ bool ask_quick_start(player_type *player_ptr) * @param birther_ptr クイックスタート構造体の参照ポインタ * @return なし。 */ -void save_prev_data(player_type *player_ptr, birther *birther_ptr) +void save_prev_data(PlayerType *player_ptr, birther *birther_ptr) { birther_ptr->psex = player_ptr->psex; birther_ptr->prace = player_ptr->prace; @@ -117,7 +117,7 @@ void save_prev_data(player_type *player_ptr, birther *birther_ptr) * @param swap TRUEならば現在のプレイヤー構造体上との内容をスワップする形で読み込む。 * @return なし。 */ -void load_prev_data(player_type *player_ptr, bool swap) +void load_prev_data(PlayerType *player_ptr, bool swap) { birther temp; if (swap) diff --git a/src/birth/quick-start.h b/src/birth/quick-start.h index 6e5e923d1..0295798fb 100644 --- a/src/birth/quick-start.h +++ b/src/birth/quick-start.h @@ -40,7 +40,7 @@ struct birther { extern birther previous_char; -struct player_type; -bool ask_quick_start(player_type *player_ptr); -void save_prev_data(player_type *player_ptr, birther *birther_ptr); -void load_prev_data(player_type *player_ptr, bool swap); +class PlayerType; +bool ask_quick_start(PlayerType *player_ptr); +void save_prev_data(PlayerType *player_ptr, birther *birther_ptr); +void load_prev_data(PlayerType *player_ptr, bool swap); diff --git a/src/blue-magic/blue-magic-ball-bolt.cpp b/src/blue-magic/blue-magic-ball-bolt.cpp index 1376d8fc4..02f914af5 100644 --- a/src/blue-magic/blue-magic-ball-bolt.cpp +++ b/src/blue-magic/blue-magic-ball-bolt.cpp @@ -13,7 +13,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool cast_blue_ball_acid(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_acid(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -24,7 +24,7 @@ bool cast_blue_ball_acid(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_elec(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_elec(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -35,7 +35,7 @@ bool cast_blue_ball_elec(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_fire(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_fire(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -46,7 +46,7 @@ bool cast_blue_ball_fire(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_cold(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_cold(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -57,7 +57,7 @@ bool cast_blue_ball_cold(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_pois(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_pois(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -68,7 +68,7 @@ bool cast_blue_ball_pois(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_nuke(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_nuke(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -79,7 +79,7 @@ bool cast_blue_ball_nuke(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_nether(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_nether(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -90,7 +90,7 @@ bool cast_blue_ball_nether(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_chaos(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_chaos(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -108,7 +108,7 @@ bool cast_blue_ball_chaos(player_type *player_ptr, bmc_type *bmc_ptr) * @param bmc_ptr 青魔法詠唱への参照ポインタ * @details All my worries are blown away. */ -bool cast_blue_ball_water(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_water(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -119,7 +119,7 @@ bool cast_blue_ball_water(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_star_burst(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_star_burst(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -130,7 +130,7 @@ bool cast_blue_ball_star_burst(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_dark_storm(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_dark_storm(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -141,7 +141,7 @@ bool cast_blue_ball_dark_storm(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_ball_mana_storm(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_ball_mana_storm(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -152,7 +152,7 @@ bool cast_blue_ball_mana_storm(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_acid(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_acid(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -163,7 +163,7 @@ bool cast_blue_bolt_acid(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_elec(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_elec(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -174,7 +174,7 @@ bool cast_blue_bolt_elec(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_fire(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_fire(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -185,7 +185,7 @@ bool cast_blue_bolt_fire(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_cold(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_cold(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -196,7 +196,7 @@ bool cast_blue_bolt_cold(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_nether(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_nether(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -207,7 +207,7 @@ bool cast_blue_bolt_nether(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_water(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_water(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -218,7 +218,7 @@ bool cast_blue_bolt_water(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_mana(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_mana(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -229,7 +229,7 @@ bool cast_blue_bolt_mana(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_plasma(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_plasma(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -240,7 +240,7 @@ bool cast_blue_bolt_plasma(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_icee(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_icee(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -251,7 +251,7 @@ bool cast_blue_bolt_icee(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_bolt_missile(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_bolt_missile(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; diff --git a/src/blue-magic/blue-magic-ball-bolt.h b/src/blue-magic/blue-magic-ball-bolt.h index dbe8e7d03..145187df5 100644 --- a/src/blue-magic/blue-magic-ball-bolt.h +++ b/src/blue-magic/blue-magic-ball-bolt.h @@ -5,27 +5,27 @@ */ struct bmc_type; -struct player_type; -bool cast_blue_ball_acid(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_elec(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_fire(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_cold(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_pois(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_nuke(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_nether(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_chaos(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_water(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_star_burst(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_dark_storm(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_ball_mana_storm(player_type *player_ptr, bmc_type *bmc_ptr); +class PlayerType; +bool cast_blue_ball_acid(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_elec(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_fire(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_cold(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_pois(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_nuke(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_nether(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_chaos(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_water(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_star_burst(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_dark_storm(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_ball_mana_storm(PlayerType *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_acid(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_elec(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_fire(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_cold(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_nether(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_water(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_mana(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_plasma(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_icee(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_bolt_missile(player_type *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_acid(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_elec(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_fire(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_cold(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_nether(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_water(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_mana(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_plasma(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_icee(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_bolt_missile(PlayerType *player_ptr, bmc_type *bmc_ptr); diff --git a/src/blue-magic/blue-magic-breath.cpp b/src/blue-magic/blue-magic-breath.cpp index 95b8c4f67..36d9e25dc 100644 --- a/src/blue-magic/blue-magic-breath.cpp +++ b/src/blue-magic/blue-magic-breath.cpp @@ -14,7 +14,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool cast_blue_breath_acid(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_acid(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -25,7 +25,7 @@ bool cast_blue_breath_acid(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_elec(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_elec(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -36,7 +36,7 @@ bool cast_blue_breath_elec(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_fire(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_fire(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -47,7 +47,7 @@ bool cast_blue_breath_fire(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_cold(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_cold(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -58,7 +58,7 @@ bool cast_blue_breath_cold(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_pois(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_pois(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -69,7 +69,7 @@ bool cast_blue_breath_pois(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_nether(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_nether(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -80,7 +80,7 @@ bool cast_blue_breath_nether(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_lite(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_lite(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -91,7 +91,7 @@ bool cast_blue_breath_lite(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_dark(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_dark(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -102,7 +102,7 @@ bool cast_blue_breath_dark(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_conf(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_conf(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -113,7 +113,7 @@ bool cast_blue_breath_conf(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_sound(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_sound(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -124,7 +124,7 @@ bool cast_blue_breath_sound(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_chaos(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_chaos(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -135,7 +135,7 @@ bool cast_blue_breath_chaos(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_disenchant(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_disenchant(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -146,7 +146,7 @@ bool cast_blue_breath_disenchant(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_nexus(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_nexus(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -157,7 +157,7 @@ bool cast_blue_breath_nexus(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_time(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_time(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -168,7 +168,7 @@ bool cast_blue_breath_time(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_inertia(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_inertia(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -179,7 +179,7 @@ bool cast_blue_breath_inertia(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_gravity(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_gravity(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -190,7 +190,7 @@ bool cast_blue_breath_gravity(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_shards(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_shards(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -201,7 +201,7 @@ bool cast_blue_breath_shards(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_plasma(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_plasma(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -212,7 +212,7 @@ bool cast_blue_breath_plasma(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_force(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_force(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -223,7 +223,7 @@ bool cast_blue_breath_force(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_mana(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_mana(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -234,7 +234,7 @@ bool cast_blue_breath_mana(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_breath_nuke(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_nuke(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -251,7 +251,7 @@ bool cast_blue_breath_nuke(player_type *player_ptr, bmc_type *bmc_ptr) * @param bmc_ptr 青魔法詠唱への参照ポインタ * @details 永久の刻は過ぎ去れリ. */ -bool cast_blue_breath_disintegration(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_breath_disintegration(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; diff --git a/src/blue-magic/blue-magic-breath.h b/src/blue-magic/blue-magic-breath.h index d4540bdac..2eb91800e 100644 --- a/src/blue-magic/blue-magic-breath.h +++ b/src/blue-magic/blue-magic-breath.h @@ -5,26 +5,26 @@ */ struct bmc_type; -struct player_type; -bool cast_blue_breath_acid(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_elec(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_fire(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_cold(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_pois(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_nether(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_lite(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_dark(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_conf(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_sound(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_chaos(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_disenchant(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_nexus(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_time(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_inertia(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_gravity(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_shards(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_plasma(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_force(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_mana(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_nuke(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_breath_disintegration(player_type *player_ptr, bmc_type *bmc_ptr); +class PlayerType; +bool cast_blue_breath_acid(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_elec(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_fire(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_cold(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_pois(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_nether(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_lite(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_dark(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_conf(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_sound(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_chaos(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_disenchant(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_nexus(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_time(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_inertia(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_gravity(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_shards(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_plasma(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_force(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_mana(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_nuke(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_breath_disintegration(PlayerType *player_ptr, bmc_type *bmc_ptr); diff --git a/src/blue-magic/blue-magic-caster.cpp b/src/blue-magic/blue-magic-caster.cpp index 26673e306..15a23f851 100644 --- a/src/blue-magic/blue-magic-caster.cpp +++ b/src/blue-magic/blue-magic-caster.cpp @@ -44,7 +44,7 @@ #include "target/target-types.h" #include "view/display-messages.h" -static bool cast_blue_dispel(player_type *player_ptr) +static bool cast_blue_dispel(PlayerType *player_ptr) { if (!target_set(player_ptr, TARGET_KILL)) return false; @@ -58,7 +58,7 @@ static bool cast_blue_dispel(player_type *player_ptr) return true; } -static bool cast_blue_rocket(player_type *player_ptr, bmc_type *bmc_ptr) +static bool cast_blue_rocket(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -69,7 +69,7 @@ static bool cast_blue_rocket(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -static bool cast_blue_shoot(player_type *player_ptr, bmc_type *bmc_ptr) +static bool cast_blue_shoot(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -80,7 +80,7 @@ static bool cast_blue_shoot(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -static bool cast_blue_hand_doom(player_type *player_ptr, bmc_type *bmc_ptr) +static bool cast_blue_hand_doom(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -90,7 +90,7 @@ static bool cast_blue_hand_doom(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -static bool exe_blue_teleport_back(player_type *player_ptr, GAME_TEXT *m_name) +static bool exe_blue_teleport_back(PlayerType *player_ptr, GAME_TEXT *m_name) { monster_type *m_ptr; monster_race *r_ptr; @@ -123,7 +123,7 @@ static bool exe_blue_teleport_back(player_type *player_ptr, GAME_TEXT *m_name) return true; } -static bool cast_blue_teleport_back(player_type *player_ptr) +static bool cast_blue_teleport_back(PlayerType *player_ptr) { if (!target_set(player_ptr, TARGET_KILL)) return false; @@ -138,7 +138,7 @@ static bool cast_blue_teleport_back(player_type *player_ptr) return true; } -static bool cast_blue_teleport_away(player_type *player_ptr, bmc_type *bmc_ptr) +static bool cast_blue_teleport_away(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -147,7 +147,7 @@ static bool cast_blue_teleport_away(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -static bool cast_blue_psy_spear(player_type *player_ptr, bmc_type *bmc_ptr) +static bool cast_blue_psy_spear(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -158,7 +158,7 @@ static bool cast_blue_psy_spear(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -static bool cast_blue_make_trap(player_type *player_ptr) +static bool cast_blue_make_trap(PlayerType *player_ptr) { if (!target_set(player_ptr, TARGET_KILL)) return false; @@ -168,7 +168,7 @@ static bool cast_blue_make_trap(player_type *player_ptr) return true; } -static bool switch_cast_blue_magic(player_type *player_ptr, bmc_type *bmc_ptr, MonsterAbilityType spell) +static bool switch_cast_blue_magic(PlayerType *player_ptr, bmc_type *bmc_ptr, MonsterAbilityType spell) { switch (spell) { case MonsterAbilityType::SHRIEK: @@ -392,7 +392,7 @@ static bool switch_cast_blue_magic(player_type *player_ptr, bmc_type *bmc_ptr, M * @param success TRUEは成功時、FALSEは失敗時の処理を行う * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -bool cast_learned_spell(player_type *player_ptr, MonsterAbilityType spell, const bool success) +bool cast_learned_spell(PlayerType *player_ptr, MonsterAbilityType spell, const bool success) { bmc_type tmp_bm; bmc_type *bmc_ptr = initialize_blue_magic_type(player_ptr, &tmp_bm, success, get_pseudo_monstetr_level); diff --git a/src/blue-magic/blue-magic-caster.h b/src/blue-magic/blue-magic-caster.h index 53dde2cd3..cff0d0c79 100644 --- a/src/blue-magic/blue-magic-caster.h +++ b/src/blue-magic/blue-magic-caster.h @@ -6,5 +6,5 @@ enum class MonsterAbilityType; -struct player_type; -bool cast_learned_spell(player_type *player_ptr, MonsterAbilityType spell, const bool success); +class PlayerType; +bool cast_learned_spell(PlayerType *player_ptr, MonsterAbilityType spell, const bool success); diff --git a/src/blue-magic/blue-magic-checker.cpp b/src/blue-magic/blue-magic-checker.cpp index 0c7a9b57f..e84879439 100644 --- a/src/blue-magic/blue-magic-checker.cpp +++ b/src/blue-magic/blue-magic-checker.cpp @@ -30,7 +30,7 @@ * @brief 青魔法のラーニング判定と成功した場合のラーニング処理 * @param monspell ラーニングを試みるモンスター攻撃のID */ -void learn_spell(player_type *player_ptr, MonsterAbilityType monspell) +void learn_spell(PlayerType *player_ptr, MonsterAbilityType monspell) { if (player_ptr->action != ACTION_LEARN) return; diff --git a/src/blue-magic/blue-magic-checker.h b/src/blue-magic/blue-magic-checker.h index 88c5453b2..61e60dc3a 100644 --- a/src/blue-magic/blue-magic-checker.h +++ b/src/blue-magic/blue-magic-checker.h @@ -10,6 +10,6 @@ enum class BlueMagicType; -struct player_type; -void learn_spell(player_type *player_ptr, MonsterAbilityType monspell); +class PlayerType; +void learn_spell(PlayerType *player_ptr, MonsterAbilityType monspell); void set_rf_masks(EnumClassFlagGroup &ability_flags, BlueMagicType type); diff --git a/src/blue-magic/blue-magic-spirit-curse.cpp b/src/blue-magic/blue-magic-spirit-curse.cpp index 1da5649ba..18bb21557 100644 --- a/src/blue-magic/blue-magic-spirit-curse.cpp +++ b/src/blue-magic/blue-magic-spirit-curse.cpp @@ -14,7 +14,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool cast_blue_drain_mana(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_drain_mana(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -24,7 +24,7 @@ bool cast_blue_drain_mana(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_mind_blast(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_mind_blast(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -34,7 +34,7 @@ bool cast_blue_mind_blast(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_brain_smash(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_brain_smash(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -44,7 +44,7 @@ bool cast_blue_brain_smash(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_curse_1(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_curse_1(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -54,7 +54,7 @@ bool cast_blue_curse_1(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_curse_2(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_curse_2(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -64,7 +64,7 @@ bool cast_blue_curse_2(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_curse_3(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_curse_3(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -74,7 +74,7 @@ bool cast_blue_curse_3(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_curse_4(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_curse_4(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; diff --git a/src/blue-magic/blue-magic-spirit-curse.h b/src/blue-magic/blue-magic-spirit-curse.h index 72fedd309..f3e65162b 100644 --- a/src/blue-magic/blue-magic-spirit-curse.h +++ b/src/blue-magic/blue-magic-spirit-curse.h @@ -5,11 +5,11 @@ */ struct bmc_type; -struct player_type; -bool cast_blue_drain_mana(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_mind_blast(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_brain_smash(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_curse_1(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_curse_2(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_curse_3(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_curse_4(player_type *player_ptr, bmc_type *bmc_ptr); +class PlayerType; +bool cast_blue_drain_mana(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_mind_blast(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_brain_smash(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_curse_1(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_curse_2(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_curse_3(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_curse_4(PlayerType *player_ptr, bmc_type *bmc_ptr); diff --git a/src/blue-magic/blue-magic-status.cpp b/src/blue-magic/blue-magic-status.cpp index 6ea962063..d8f6539d8 100644 --- a/src/blue-magic/blue-magic-status.cpp +++ b/src/blue-magic/blue-magic-status.cpp @@ -10,7 +10,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool cast_blue_scare(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_scare(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -20,7 +20,7 @@ bool cast_blue_scare(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_blind(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_blind(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -29,7 +29,7 @@ bool cast_blue_blind(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_confusion(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_confusion(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -39,7 +39,7 @@ bool cast_blue_confusion(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_slow(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_slow(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; @@ -48,7 +48,7 @@ bool cast_blue_slow(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_sleep(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_sleep(PlayerType *player_ptr, bmc_type *bmc_ptr) { if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; diff --git a/src/blue-magic/blue-magic-status.h b/src/blue-magic/blue-magic-status.h index a78575d0e..c3ca2d8fd 100644 --- a/src/blue-magic/blue-magic-status.h +++ b/src/blue-magic/blue-magic-status.h @@ -5,9 +5,9 @@ */ struct bmc_type; -struct player_type; -bool cast_blue_scare(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_blind(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_confusion(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_slow(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_sleep(player_type *player_ptr, bmc_type *bmc_ptr); +class PlayerType; +bool cast_blue_scare(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_blind(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_confusion(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_slow(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_sleep(PlayerType *player_ptr, bmc_type *bmc_ptr); diff --git a/src/blue-magic/blue-magic-summon.cpp b/src/blue-magic/blue-magic-summon.cpp index 7be7e52df..b2a73b2f4 100644 --- a/src/blue-magic/blue-magic-summon.cpp +++ b/src/blue-magic/blue-magic-summon.cpp @@ -12,7 +12,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -bool cast_blue_summon_kin(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_kin(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("援軍を召喚した。", "You summon one of your kin.")); for (int k = 0; k < 1; k++) { @@ -27,7 +27,7 @@ bool cast_blue_summon_kin(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_cyber(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_cyber(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("サイバーデーモンを召喚した!", "You summon a Cyberdemon!")); for (int k = 0; k < 1; k++) { @@ -42,7 +42,7 @@ bool cast_blue_summon_cyber(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_monster(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_monster(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("仲間を召喚した。", "You summon help.")); for (int k = 0; k < 1; k++) { @@ -57,7 +57,7 @@ bool cast_blue_summon_monster(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_monsters(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_monsters(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("モンスターを召喚した!", "You summon monsters!")); for (int k = 0; k < bmc_ptr->plev / 15 + 2; k++) { @@ -72,7 +72,7 @@ bool cast_blue_summon_monsters(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_ant(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_ant(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("アリを召喚した。", "You summon ants.")); if (summon_specific( @@ -86,7 +86,7 @@ bool cast_blue_summon_ant(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_spider(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_spider(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("蜘蛛を召喚した。", "You summon spiders.")); if (summon_specific( @@ -100,7 +100,7 @@ bool cast_blue_summon_spider(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_hound(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_hound(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("ハウンドを召喚した。", "You summon hounds.")); if (summon_specific( @@ -114,7 +114,7 @@ bool cast_blue_summon_hound(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_hydra(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_hydra(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("ヒドラを召喚した。", "You summon a hydras.")); if (summon_specific( @@ -128,7 +128,7 @@ bool cast_blue_summon_hydra(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_angel(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_angel(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("天使を召喚した!", "You summon an angel!")); if (summon_specific( @@ -142,7 +142,7 @@ bool cast_blue_summon_angel(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_demon(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_demon(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!")); if (summon_specific( @@ -156,7 +156,7 @@ bool cast_blue_summon_demon(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_undead(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_undead(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!")); if (summon_specific( @@ -170,7 +170,7 @@ bool cast_blue_summon_undead(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_dragon(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_dragon(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("ドラゴンを召喚した!", "You summon a dragon!")); if (summon_specific( @@ -184,7 +184,7 @@ bool cast_blue_summon_dragon(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_high_undead(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_high_undead(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("強力なアンデッドを召喚した!", "You summon a greater undead!")); if (summon_specific(player_ptr, (bmc_ptr->pet ? -1 : 0), player_ptr->y, player_ptr->x, bmc_ptr->summon_lev, SUMMON_HI_UNDEAD, @@ -198,7 +198,7 @@ bool cast_blue_summon_high_undead(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_high_dragon(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_high_dragon(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("古代ドラゴンを召喚した!", "You summon an ancient dragon!")); if (summon_specific(player_ptr, (bmc_ptr->pet ? -1 : 0), player_ptr->y, player_ptr->x, bmc_ptr->summon_lev, SUMMON_HI_DRAGON, @@ -212,7 +212,7 @@ bool cast_blue_summon_high_dragon(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_amberite(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_amberite(PlayerType *player_ptr, bmc_type *bmc_ptr) { msg_print(_("アンバーの王族を召喚した!", "You summon a Lord of Amber!")); if (summon_specific(player_ptr, (bmc_ptr->pet ? -1 : 0), player_ptr->y, player_ptr->x, bmc_ptr->summon_lev, SUMMON_AMBERITES, @@ -226,7 +226,7 @@ bool cast_blue_summon_amberite(player_type *player_ptr, bmc_type *bmc_ptr) return true; } -bool cast_blue_summon_unique(player_type *player_ptr, bmc_type *bmc_ptr) +bool cast_blue_summon_unique(PlayerType *player_ptr, bmc_type *bmc_ptr) { int count = 0; msg_print(_("特別な強敵を召喚した!", "You summon a special opponent!")); diff --git a/src/blue-magic/blue-magic-summon.h b/src/blue-magic/blue-magic-summon.h index 997045e2f..79d90b228 100644 --- a/src/blue-magic/blue-magic-summon.h +++ b/src/blue-magic/blue-magic-summon.h @@ -5,20 +5,20 @@ */ struct bmc_type; -struct player_type; -bool cast_blue_summon_kin(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_cyber(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_monster(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_monsters(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_ant(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_spider(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_hound(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_hydra(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_angel(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_demon(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_undead(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_dragon(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_high_undead(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_high_dragon(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_amberite(player_type *player_ptr, bmc_type *bmc_ptr); -bool cast_blue_summon_unique(player_type *player_ptr, bmc_type *bmc_ptr); +class PlayerType; +bool cast_blue_summon_kin(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_cyber(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_monster(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_monsters(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_ant(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_spider(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_hound(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_hydra(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_angel(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_demon(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_undead(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_dragon(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_high_undead(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_high_dragon(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_amberite(PlayerType *player_ptr, bmc_type *bmc_ptr); +bool cast_blue_summon_unique(PlayerType *player_ptr, bmc_type *bmc_ptr); diff --git a/src/blue-magic/blue-magic-util.cpp b/src/blue-magic/blue-magic-util.cpp index 3f643fe92..2ffeb0e31 100644 --- a/src/blue-magic/blue-magic-util.cpp +++ b/src/blue-magic/blue-magic-util.cpp @@ -8,7 +8,7 @@ #include "system/player-type-definition.h" bmc_type *initialize_blue_magic_type( - player_type *player_ptr, bmc_type *bmc_ptr, const bool success, get_pseudo_monstetr_level_pf get_pseudo_monstetr_level) + PlayerType *player_ptr, bmc_type *bmc_ptr, const bool success, get_pseudo_monstetr_level_pf get_pseudo_monstetr_level) { bmc_ptr->plev = (*get_pseudo_monstetr_level)(player_ptr); bmc_ptr->summon_lev = player_ptr->lev * 2 / 3 + randint1(player_ptr->lev / 2); diff --git a/src/blue-magic/blue-magic-util.h b/src/blue-magic/blue-magic-util.h index 575cb3547..0ebefb20e 100644 --- a/src/blue-magic/blue-magic-util.h +++ b/src/blue-magic/blue-magic-util.h @@ -19,7 +19,7 @@ typedef struct bmc_type { BIT_FLAGS g_mode; } bmc_type; -struct player_type; -typedef PLAYER_LEVEL (*get_pseudo_monstetr_level_pf)(player_type *player_ptr); +class PlayerType; +typedef PLAYER_LEVEL (*get_pseudo_monstetr_level_pf)(PlayerType *player_ptr); bmc_type *initialize_blue_magic_type( - player_type *player_ptr, bmc_type *bmc_ptr, const bool success, get_pseudo_monstetr_level_pf get_pseudo_monstetr_level); + PlayerType *player_ptr, bmc_type *bmc_ptr, const bool success, get_pseudo_monstetr_level_pf get_pseudo_monstetr_level); diff --git a/src/blue-magic/learnt-info.cpp b/src/blue-magic/learnt-info.cpp index 07bab31bd..0ff3342da 100644 --- a/src/blue-magic/learnt-info.cpp +++ b/src/blue-magic/learnt-info.cpp @@ -15,7 +15,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param 換算レベル */ -PLAYER_LEVEL get_pseudo_monstetr_level(player_type *player_ptr) +PLAYER_LEVEL get_pseudo_monstetr_level(PlayerType *player_ptr) { PLAYER_LEVEL monster_level = player_ptr->lev + 40; return (monster_level * monster_level - 1550) / 130; @@ -28,7 +28,7 @@ PLAYER_LEVEL get_pseudo_monstetr_level(player_type *player_ptr) * @param msg 表示する文字列 * @param tmp 返すメッセージを格納する配列 */ -static void set_bluemage_damage(player_type *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, concptr msg, char *tmp) +static void set_bluemage_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, concptr msg, char *tmp) { int base_damage = monspell_bluemage_damage(player_ptr, ms_type, plev, BASE_DAM); int dice_num = monspell_bluemage_damage(player_ptr, ms_type, plev, DICE_NUM); @@ -46,7 +46,7 @@ static void set_bluemage_damage(player_type *player_ptr, MonsterAbilityType ms_t * @param p 情報を返す文字列参照ポインタ * @param power モンスター魔法のID */ -void learnt_info(player_type *player_ptr, char *p, MonsterAbilityType power) +void learnt_info(PlayerType *player_ptr, char *p, MonsterAbilityType power) { PLAYER_LEVEL plev = get_pseudo_monstetr_level(player_ptr); diff --git a/src/blue-magic/learnt-info.h b/src/blue-magic/learnt-info.h index e1894bc3a..f073fd3ec 100644 --- a/src/blue-magic/learnt-info.h +++ b/src/blue-magic/learnt-info.h @@ -8,6 +8,6 @@ enum class MonsterAbilityType; -struct player_type; -PLAYER_LEVEL get_pseudo_monstetr_level(player_type *player_ptr); -void learnt_info(player_type *player_ptr, char *p, MonsterAbilityType power); +class PlayerType; +PLAYER_LEVEL get_pseudo_monstetr_level(PlayerType *player_ptr); +void learnt_info(PlayerType *player_ptr, char *p, MonsterAbilityType power); diff --git a/src/blue-magic/learnt-power-getter.cpp b/src/blue-magic/learnt-power-getter.cpp index 40a5690f4..0fdc182fe 100644 --- a/src/blue-magic/learnt-power-getter.cpp +++ b/src/blue-magic/learnt-power-getter.cpp @@ -250,7 +250,7 @@ static bool switch_blue_magic_choice(char key, int &menu_line, const bluemage_da * @param need_mana 青魔法を使うのに必要なMP * @return int 失敗率(%)を返す */ -int calculate_blue_magic_failure_probability(player_type *player_ptr, const monster_power &mp, int need_mana) +int calculate_blue_magic_failure_probability(PlayerType *player_ptr, const monster_power &mp, int need_mana) { auto chance = mp.fail; if (player_ptr->lev > mp.level) { @@ -312,7 +312,7 @@ static void close_blue_magic_name(char *buf, size_t buf_size, int index, int men * @param bluemage_data 青魔道士の固有データへの参照 * @param blue_magics 青魔法のリスト(覚えていないものも含まれているが、覚えていないものは表示をスキップする) */ -static void describe_blue_magic_name(player_type *player_ptr, int menu_line, const bluemage_data_type &bluemage_data, const std::vector &blue_magics) +static void describe_blue_magic_name(PlayerType *player_ptr, int menu_line, const bluemage_data_type &bluemage_data, const std::vector &blue_magics) { constexpr TERM_LEN y_base = 1; constexpr TERM_LEN x_base = 18; @@ -360,7 +360,7 @@ static bool confirm_cast_blue_magic(MonsterAbilityType spell) * @param blue_magics 青魔法のリスト(覚えていないものも含まれているが、覚えていない物は候補に出ず選択できない) * @return 選択した青魔法。選択をキャンセルした場合は std::nullopt */ -static std::optional select_learnt_spells_by_symbol(player_type *player_ptr, const bluemage_data_type &bluemage_data, std::vector spells) +static std::optional select_learnt_spells_by_symbol(PlayerType *player_ptr, const bluemage_data_type &bluemage_data, std::vector spells) { char out_val[80]; (void)strnfmt(out_val, sizeof(out_val), _("(%c-%c, '*'で一覧, ESC) どの%sを唱えますか?", "(%c-%c, *=List, ESC=exit) Use which %s? "), @@ -417,7 +417,7 @@ static std::optional select_learnt_spells_by_symbol(player_t * @param blue_magics 青魔法のリスト(覚えていないものも含まれているが、覚えていない物は候補に出ず選択できない) * @return 選択した青魔法。選択をキャンセルした場合は std::nullopt */ -static std::optional select_learnt_spells_by_menu(player_type *player_ptr, const bluemage_data_type &bluemage_data, std::vector spells) +static std::optional select_learnt_spells_by_menu(PlayerType *player_ptr, const bluemage_data_type &bluemage_data, std::vector spells) { char out_val[80]; angband_strcpy(out_val, _("(ESC=中断) どの魔法を唱えますか?", "(ESC=exit) Use which magic? "), sizeof(out_val)); @@ -472,7 +472,7 @@ static std::optional select_learnt_spells_by_menu(player_typ * when you run it. It's probably easy to fix but I haven't tried,\n * sorry.\n */ -std::optional get_learned_power(player_type *player_ptr) +std::optional get_learned_power(PlayerType *player_ptr) { auto bluemage_data = PlayerClass(player_ptr).get_specific_data(); if (!bluemage_data) { diff --git a/src/blue-magic/learnt-power-getter.h b/src/blue-magic/learnt-power-getter.h index 2fbb2f6f5..c3049a30a 100644 --- a/src/blue-magic/learnt-power-getter.h +++ b/src/blue-magic/learnt-power-getter.h @@ -9,7 +9,7 @@ #include enum class MonsterAbilityType; -struct player_type; +class PlayerType; struct monster_power; -int calculate_blue_magic_failure_probability(player_type *player_ptr, const monster_power &mp, int need_mana); -std::optional get_learned_power(player_type *player_ptr); +int calculate_blue_magic_failure_probability(PlayerType *player_ptr, const monster_power &mp, int need_mana); +std::optional get_learned_power(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-attack.cpp b/src/cmd-action/cmd-attack.cpp index af2727cbd..cd984d6cb 100644 --- a/src/cmd-action/cmd-attack.cpp +++ b/src/cmd-action/cmd-attack.cpp @@ -66,7 +66,7 @@ * @param fear 攻撃を受けたモンスターが恐慌状態に陥ったかを返す参照ポインタ * @param mdeath 攻撃を受けたモンスターが死亡したかを返す参照ポインタ */ -static void natural_attack(player_type *player_ptr, MONSTER_IDX m_idx, PlayerMutationType attack, bool *fear, bool *mdeath) +static void natural_attack(PlayerType *player_ptr, MONSTER_IDX m_idx, PlayerMutationType attack, bool *fear, bool *mdeath) { WEIGHT n_weight = 0; monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; @@ -167,7 +167,7 @@ static void natural_attack(player_type *player_ptr, MONSTER_IDX m_idx, PlayerMut * @details * If no "weapon" is available, then "punch" the monster one time. */ -bool do_cmd_attack(player_type *player_ptr, POSITION y, POSITION x, combat_options mode) +bool do_cmd_attack(PlayerType *player_ptr, POSITION y, POSITION x, combat_options mode) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx]; diff --git a/src/cmd-action/cmd-attack.h b/src/cmd-action/cmd-attack.h index a25e26841..62fdd6650 100644 --- a/src/cmd-action/cmd-attack.h +++ b/src/cmd-action/cmd-attack.h @@ -3,5 +3,5 @@ #include "combat/combat-options-type.h" #include "system/angband.h" -struct player_type; -bool do_cmd_attack(player_type *player_ptr, POSITION y, POSITION x, combat_options mode); +class PlayerType; +bool do_cmd_attack(PlayerType *player_ptr, POSITION y, POSITION x, combat_options mode); diff --git a/src/cmd-action/cmd-hissatsu.cpp b/src/cmd-action/cmd-hissatsu.cpp index 9b51e3d5e..205ab0424 100644 --- a/src/cmd-action/cmd-hissatsu.cpp +++ b/src/cmd-action/cmd-hissatsu.cpp @@ -61,7 +61,7 @@ * when you run it. It's probably easy to fix but I haven't tried,\n * sorry.\n */ -static int get_hissatsu_power(player_type *player_ptr, SPELL_IDX *sn) +static int get_hissatsu_power(PlayerType *player_ptr, SPELL_IDX *sn) { SPELL_IDX i; int j = 0; @@ -308,7 +308,7 @@ static int get_hissatsu_power(player_type *player_ptr, SPELL_IDX *sn) /*! * @brief 剣術コマンドのメインルーチン */ -void do_cmd_hissatsu(player_type *player_ptr) +void do_cmd_hissatsu(PlayerType *player_ptr) { SPELL_IDX n = 0; magic_type spell; @@ -363,7 +363,7 @@ void do_cmd_hissatsu(player_type *player_ptr) /*! * @brief 剣術コマンドの学習 */ -void do_cmd_gain_hissatsu(player_type *player_ptr) +void do_cmd_gain_hissatsu(PlayerType *player_ptr) { OBJECT_IDX item; int i, j; diff --git a/src/cmd-action/cmd-hissatsu.h b/src/cmd-action/cmd-hissatsu.h index d32874849..cdafa6e02 100644 --- a/src/cmd-action/cmd-hissatsu.h +++ b/src/cmd-action/cmd-hissatsu.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void do_cmd_hissatsu(player_type *player_ptr); -void do_cmd_gain_hissatsu(player_type *player_ptr); +class PlayerType; +void do_cmd_hissatsu(PlayerType *player_ptr); +void do_cmd_gain_hissatsu(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-mane.cpp b/src/cmd-action/cmd-mane.cpp index 0aca06de5..d791668c9 100644 --- a/src/cmd-action/cmd-mane.cpp +++ b/src/cmd-action/cmd-mane.cpp @@ -82,7 +82,7 @@ static int damage; * @param power ものまねの効力の種類 * @param dam ものまねの威力 */ -static void mane_info(player_type *player_ptr, char *p, MonsterAbilityType power, HIT_POINT dam) +static void mane_info(PlayerType *player_ptr, char *p, MonsterAbilityType power, HIT_POINT dam) { PLAYER_LEVEL plev = player_ptr->lev; @@ -139,7 +139,7 @@ static void mane_info(player_type *player_ptr, char *p, MonsterAbilityType power * when you run it. It's probably easy to fix but I haven't tried, * sorry. */ -static int get_mane_power(player_type *player_ptr, int *sn, bool baigaesi) +static int get_mane_power(PlayerType *player_ptr, int *sn, bool baigaesi) { int i = 0; int num = 0; @@ -310,7 +310,7 @@ static int get_mane_power(player_type *player_ptr, int *sn, bool baigaesi) * @param spell 発動するモンスター攻撃のID * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -static bool use_mane(player_type *player_ptr, MonsterAbilityType spell) +static bool use_mane(PlayerType *player_ptr, MonsterAbilityType spell) { DIRECTION dir; PLAYER_LEVEL plev = player_ptr->lev; @@ -1079,7 +1079,7 @@ static bool use_mane(player_type *player_ptr, MonsterAbilityType spell) * when you run it. It's probably easy to fix but I haven't tried, * sorry. */ -bool do_cmd_mane(player_type *player_ptr, bool baigaesi) +bool do_cmd_mane(PlayerType *player_ptr, bool baigaesi) { int n = 0; PERCENTAGE chance; diff --git a/src/cmd-action/cmd-mane.h b/src/cmd-action/cmd-mane.h index b5aa72ab2..6338c346d 100644 --- a/src/cmd-action/cmd-mane.h +++ b/src/cmd-action/cmd-mane.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool do_cmd_mane(player_type *player_ptr, bool baigaesi); +class PlayerType; +bool do_cmd_mane(PlayerType *player_ptr, bool baigaesi); diff --git a/src/cmd-action/cmd-mind.cpp b/src/cmd-action/cmd-mind.cpp index 0a054b7f2..d250fab1b 100644 --- a/src/cmd-action/cmd-mind.cpp +++ b/src/cmd-action/cmd-mind.cpp @@ -74,7 +74,7 @@ typedef struct cm_type { /*! * @brief 職業技能処理構造体の初期化 */ -static cm_type *initialize_cm_type(player_type *player_ptr, cm_type *cm_ptr) +static cm_type *initialize_cm_type(PlayerType *player_ptr, cm_type *cm_ptr) { cm_ptr->n = 0; cm_ptr->b = 0; @@ -88,7 +88,7 @@ static cm_type *initialize_cm_type(player_type *player_ptr, cm_type *cm_ptr) /*! * @brief 職業別の行使可能な技能種別を構造体に付加する */ -static void switch_mind_kind(player_type *player_ptr, cm_type *cm_ptr) +static void switch_mind_kind(PlayerType *player_ptr, cm_type *cm_ptr) { switch (player_ptr->pclass) { case PlayerClassType::MINDCRAFTER: @@ -118,7 +118,7 @@ static void switch_mind_kind(player_type *player_ptr, cm_type *cm_ptr) } } -static void decide_mind_ki_chance(player_type *player_ptr, cm_type *cm_ptr) +static void decide_mind_ki_chance(PlayerType *player_ptr, cm_type *cm_ptr) { if (cm_ptr->use_mind != MindKindType::KI) return; @@ -141,7 +141,7 @@ static void decide_mind_ki_chance(player_type *player_ptr, cm_type *cm_ptr) cm_ptr->mana_cost += (j + 1) * 3 / 2; } -static bool check_mind_hp_mp_sufficiency(player_type *player_ptr, cm_type *cm_ptr) +static bool check_mind_hp_mp_sufficiency(PlayerType *player_ptr, cm_type *cm_ptr) { if ((cm_ptr->use_mind == MindKindType::BERSERKER) || (cm_ptr->use_mind == MindKindType::NINJUTSU)) { if (cm_ptr->mana_cost > player_ptr->chp) { @@ -162,7 +162,7 @@ static bool check_mind_hp_mp_sufficiency(player_type *player_ptr, cm_type *cm_pt return get_check(_("それでも挑戦しますか? ", "Attempt it anyway? ")); } -static void decide_mind_chance(player_type *player_ptr, cm_type *cm_ptr) +static void decide_mind_chance(PlayerType *player_ptr, cm_type *cm_ptr) { if (cm_ptr->chance == 0) return; @@ -193,7 +193,7 @@ static void decide_mind_chance(player_type *player_ptr, cm_type *cm_ptr) cm_ptr->chance += 5; } -static void check_mind_mindcrafter(player_type *player_ptr, cm_type *cm_ptr) +static void check_mind_mindcrafter(PlayerType *player_ptr, cm_type *cm_ptr) { if (cm_ptr->use_mind != MindKindType::MINDCRAFTER) return; @@ -228,7 +228,7 @@ static void check_mind_mindcrafter(player_type *player_ptr, cm_type *cm_ptr) player_ptr->csp = std::max(0, player_ptr->csp - cm_ptr->plev * std::max(1, cm_ptr->plev / 10)); } -static void check_mind_mirror_master(player_type *player_ptr, cm_type *cm_ptr) +static void check_mind_mirror_master(PlayerType *player_ptr, cm_type *cm_ptr) { if (cm_ptr->use_mind != MindKindType::MIRROR_MASTER) return; @@ -254,7 +254,7 @@ static void check_mind_mirror_master(player_type *player_ptr, cm_type *cm_ptr) player_ptr->csp = std::max(0, player_ptr->csp - cm_ptr->plev * std::max(1, cm_ptr->plev / 10)); } -static void check_mind_class(player_type *player_ptr, cm_type *cm_ptr) +static void check_mind_class(PlayerType *player_ptr, cm_type *cm_ptr) { if ((cm_ptr->use_mind == MindKindType::BERSERKER) || (cm_ptr->use_mind == MindKindType::NINJUTSU)) return; @@ -272,7 +272,7 @@ static void check_mind_class(player_type *player_ptr, cm_type *cm_ptr) check_mind_mirror_master(player_ptr, cm_ptr); } -static bool switch_mind_class(player_type *player_ptr, cm_type *cm_ptr) +static bool switch_mind_class(PlayerType *player_ptr, cm_type *cm_ptr) { switch (cm_ptr->use_mind) { case MindKindType::MINDCRAFTER: @@ -299,7 +299,7 @@ static bool switch_mind_class(player_type *player_ptr, cm_type *cm_ptr) } } -static void mind_turn_passing(player_type *player_ptr, cm_type *cm_ptr) +static void mind_turn_passing(PlayerType *player_ptr, cm_type *cm_ptr) { PlayerEnergy energy(player_ptr); if (cm_ptr->on_mirror && (player_ptr->pclass == PlayerClassType::MIRROR_MASTER)) { @@ -312,7 +312,7 @@ static void mind_turn_passing(player_type *player_ptr, cm_type *cm_ptr) energy.set_player_turn_energy(100); } -static bool judge_mind_chance(player_type *player_ptr, cm_type *cm_ptr) +static bool judge_mind_chance(PlayerType *player_ptr, cm_type *cm_ptr) { if (randint0(100) >= cm_ptr->chance) { sound(SOUND_ZAP); @@ -328,7 +328,7 @@ static bool judge_mind_chance(player_type *player_ptr, cm_type *cm_ptr) return true; } -static void mind_reflection(player_type *player_ptr, cm_type *cm_ptr) +static void mind_reflection(PlayerType *player_ptr, cm_type *cm_ptr) { int oops = cm_ptr->mana_cost - cm_ptr->old_csp; if ((player_ptr->csp - cm_ptr->mana_cost) < 0) @@ -345,7 +345,7 @@ static void mind_reflection(player_type *player_ptr, cm_type *cm_ptr) (void)dec_stat(player_ptr, A_WIS, 15 + randint1(10), perm); } -static void process_hard_concentration(player_type *player_ptr, cm_type *cm_ptr) +static void process_hard_concentration(PlayerType *player_ptr, cm_type *cm_ptr) { if ((cm_ptr->use_mind == MindKindType::BERSERKER) || (cm_ptr->use_mind == MindKindType::NINJUTSU)) { take_hit(player_ptr, DAMAGE_USELIFE, cm_ptr->mana_cost, _("過度の集中", "concentrating too hard")); @@ -371,7 +371,7 @@ static void process_hard_concentration(player_type *player_ptr, cm_type *cm_ptr) /*! * @brief 特殊技能コマンドのメインルーチン / */ -void do_cmd_mind(player_type *player_ptr) +void do_cmd_mind(PlayerType *player_ptr) { cm_type tmp_cm; cm_type *cm_ptr = initialize_cm_type(player_ptr, &tmp_cm); @@ -400,7 +400,7 @@ void do_cmd_mind(player_type *player_ptr) player_ptr->window_flags |= PW_SPELL; } -static MindKindType decide_use_mind_browse(player_type *player_ptr) +static MindKindType decide_use_mind_browse(PlayerType *player_ptr) { switch (player_ptr->pclass) { case PlayerClassType::MINDCRAFTER: @@ -421,7 +421,7 @@ static MindKindType decide_use_mind_browse(player_type *player_ptr) /*! * @brief 現在プレイヤーが使用可能な特殊技能の一覧表示 / */ -void do_cmd_mind_browse(player_type *player_ptr) +void do_cmd_mind_browse(PlayerType *player_ptr) { SPELL_IDX n = 0; char temp[62 * 5]; diff --git a/src/cmd-action/cmd-mind.h b/src/cmd-action/cmd-mind.h index be51b140d..b8d053d5a 100644 --- a/src/cmd-action/cmd-mind.h +++ b/src/cmd-action/cmd-mind.h @@ -1,7 +1,7 @@ #pragma once -struct player_type; -void do_cmd_mind(player_type *player_ptr); -void do_cmd_mind_browse(player_type *player_ptr); -void do_cmd_mind_browse(player_type *player_ptr); +class PlayerType; +void do_cmd_mind(PlayerType *player_ptr); +void do_cmd_mind_browse(PlayerType *player_ptr); +void do_cmd_mind_browse(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-move.cpp b/src/cmd-action/cmd-move.cpp index 8472a0645..38d4ffd6e 100644 --- a/src/cmd-action/cmd-move.cpp +++ b/src/cmd-action/cmd-move.cpp @@ -51,7 +51,7 @@ * @param down_stair TRUEならば階段を降りる処理、FALSEなら階段を昇る処理による内容 * @return フロア移動を実際に行うならTRUE、キャンセルする場合はFALSE */ -static bool confirm_leave_level(player_type *player_ptr, bool down_stair) +static bool confirm_leave_level(PlayerType *player_ptr, bool down_stair) { quest_type *q_ptr = &quest[player_ptr->current_floor_ptr->inside_quest]; if (confirm_quest && player_ptr->current_floor_ptr->inside_quest @@ -68,7 +68,7 @@ static bool confirm_leave_level(player_type *player_ptr, bool down_stair) /*! * @brief 階段を使って階層を昇る処理 / Go up one level */ -void do_cmd_go_up(player_type *player_ptr) +void do_cmd_go_up(PlayerType *player_ptr) { bool go_up = false; grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x]; @@ -176,7 +176,7 @@ void do_cmd_go_up(player_type *player_ptr) * @brief 階段を使って階層を降りる処理 / Go down one level * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_go_down(player_type *player_ptr) +void do_cmd_go_down(PlayerType *player_ptr) { bool fall_trap = false; int down_num = 0; @@ -308,7 +308,7 @@ void do_cmd_go_down(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pickup アイテムの自動拾いを行うならTRUE */ -void do_cmd_walk(player_type *player_ptr, bool pickup) +void do_cmd_walk(PlayerType *player_ptr, bool pickup) { if (command_arg) { command_rep = command_arg - 1; @@ -361,7 +361,7 @@ void do_cmd_walk(player_type *player_ptr, bool pickup) * Start running. * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_run(player_type *player_ptr) +void do_cmd_run(PlayerType *player_ptr) { DIRECTION dir; if (cmd_limit_confused(player_ptr)) @@ -382,7 +382,7 @@ void do_cmd_run(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pickup アイテムの自動拾いを行うならTRUE */ -void do_cmd_stay(player_type *player_ptr, bool pickup) +void do_cmd_stay(PlayerType *player_ptr, bool pickup) { uint32_t mpe_mode = MPE_STAYING | MPE_ENERGY_USE; if (command_arg) { @@ -403,7 +403,7 @@ void do_cmd_stay(player_type *player_ptr, bool pickup) * Resting allows a player to safely restore his hp -RAK- * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_rest(player_type *player_ptr) +void do_cmd_rest(PlayerType *player_ptr) { set_action(player_ptr, ACTION_NONE); if ((player_ptr->pclass == PlayerClassType::BARD) && ((get_singing_song_effect(player_ptr) != 0) || (get_interrupting_song_effect(player_ptr) != 0))) diff --git a/src/cmd-action/cmd-move.h b/src/cmd-action/cmd-move.h index ecd3dd2c5..9871eaad7 100644 --- a/src/cmd-action/cmd-move.h +++ b/src/cmd-action/cmd-move.h @@ -1,9 +1,9 @@ #pragma once -struct player_type; -void do_cmd_go_up(player_type *player_ptr); -void do_cmd_go_down(player_type *player_ptr); -void do_cmd_walk(player_type *player_ptr, bool pickup); -void do_cmd_run(player_type *player_ptr); -void do_cmd_stay(player_type *player_ptr, bool pickup); -void do_cmd_rest(player_type *player_ptr); +class PlayerType; +void do_cmd_go_up(PlayerType *player_ptr); +void do_cmd_go_down(PlayerType *player_ptr); +void do_cmd_walk(PlayerType *player_ptr, bool pickup); +void do_cmd_run(PlayerType *player_ptr); +void do_cmd_stay(PlayerType *player_ptr, bool pickup); +void do_cmd_rest(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-open-close.cpp b/src/cmd-action/cmd-open-close.cpp index 903f715e8..f4cc56dfd 100644 --- a/src/cmd-action/cmd-open-close.cpp +++ b/src/cmd-action/cmd-open-close.cpp @@ -39,7 +39,7 @@ * @details * Assume there is no monster blocking the destination */ -static bool exe_open_chest(player_type *player_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx) +static bool exe_open_chest(PlayerType *player_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx) { bool flag = true; bool more = false; @@ -86,7 +86,7 @@ static bool exe_open_chest(player_type *player_ptr, POSITION y, POSITION x, OBJE * @details * Unlocking a locked door/chest is worth one experience point. */ -void do_cmd_open(player_type *player_ptr) +void do_cmd_open(PlayerType *player_ptr) { POSITION y, x; DIRECTION dir; @@ -144,7 +144,7 @@ void do_cmd_open(player_type *player_ptr) * @details * Unlocking a locked door/chest is worth one experience point. */ -void do_cmd_close(player_type *player_ptr) +void do_cmd_close(PlayerType *player_ptr) { POSITION y, x; DIRECTION dir; @@ -189,7 +189,7 @@ void do_cmd_close(player_type *player_ptr) * @brief 箱、床のトラップ解除処理双方の統合メインルーチン / * Disarms a trap, or chest */ -void do_cmd_disarm(player_type *player_ptr) +void do_cmd_disarm(PlayerType *player_ptr) { POSITION y, x; DIRECTION dir; @@ -257,7 +257,7 @@ void do_cmd_disarm(player_type *player_ptr) * Creatures can also open or bash doors, see elsewhere. * */ -void do_cmd_bash(player_type *player_ptr) +void do_cmd_bash(PlayerType *player_ptr) { POSITION y, x; DIRECTION dir; @@ -306,7 +306,7 @@ void do_cmd_bash(player_type *player_ptr) * Let user choose a pile of spikes, perhaps? * */ -static bool get_spike(player_type *player_ptr, INVENTORY_IDX *ip) +static bool get_spike(PlayerType *player_ptr, INVENTORY_IDX *ip) { for (INVENTORY_IDX i = 0; i < INVEN_PACK; i++) { object_type *o_ptr = &player_ptr->inventory_list[i]; @@ -331,7 +331,7 @@ static bool get_spike(player_type *player_ptr, INVENTORY_IDX *ip) * This command may NOT be repeated * */ -void do_cmd_spike(player_type *player_ptr) +void do_cmd_spike(PlayerType *player_ptr) { DIRECTION dir; if (player_ptr->wild_mode) diff --git a/src/cmd-action/cmd-open-close.h b/src/cmd-action/cmd-open-close.h index 642226d87..68b4c717e 100644 --- a/src/cmd-action/cmd-open-close.h +++ b/src/cmd-action/cmd-open-close.h @@ -1,8 +1,8 @@ #pragma once -struct player_type; -void do_cmd_open(player_type *player_ptr); -void do_cmd_close(player_type *player_ptr); -void do_cmd_disarm(player_type *player_ptr); -void do_cmd_bash(player_type *player_ptr); -void do_cmd_spike(player_type *player_ptr); +class PlayerType; +void do_cmd_open(PlayerType *player_ptr); +void do_cmd_close(PlayerType *player_ptr); +void do_cmd_disarm(PlayerType *player_ptr); +void do_cmd_bash(PlayerType *player_ptr); +void do_cmd_spike(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-others.cpp b/src/cmd-action/cmd-others.cpp index 4ae3e6012..c5de2a5fe 100644 --- a/src/cmd-action/cmd-others.cpp +++ b/src/cmd-action/cmd-others.cpp @@ -44,7 +44,7 @@ /*! * @brief 探索コマンドのメインルーチン / Simple command to "search" for one turn */ -void do_cmd_search(player_type *player_ptr) +void do_cmd_search(PlayerType *player_ptr) { if (command_arg) { command_rep = command_arg - 1; @@ -59,7 +59,7 @@ void do_cmd_search(player_type *player_ptr) search(player_ptr); } -static bool exe_alter(player_type *player_ptr) +static bool exe_alter(PlayerType *player_ptr) { DIRECTION dir; if (!get_rep_dir(player_ptr, &dir, true)) @@ -101,7 +101,7 @@ static bool exe_alter(player_type *player_ptr) * @brief 特定のマスに影響を及ぼすための汎用的コマンド / Manipulate an adjacent grid in some way * @details */ -void do_cmd_alter(player_type *player_ptr) +void do_cmd_alter(PlayerType *player_ptr) { PlayerClass(player_ptr).break_samurai_stance({ SamuraiStanceType::MUSOU }); @@ -132,7 +132,7 @@ static bool decide_suicide(void) return i == '@'; } -static void accept_winner_message(player_type *player_ptr) +static void accept_winner_message(PlayerType *player_ptr) { if (!w_ptr->total_winner || !last_words) return; @@ -155,7 +155,7 @@ static void accept_winner_message(player_type *player_ptr) * commit suicide * @details */ -void do_cmd_suicide(player_type *player_ptr) +void do_cmd_suicide(PlayerType *player_ptr) { flush(); if (w_ptr->total_winner) { diff --git a/src/cmd-action/cmd-others.h b/src/cmd-action/cmd-others.h index e6e657491..8c0ac9cb1 100644 --- a/src/cmd-action/cmd-others.h +++ b/src/cmd-action/cmd-others.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void do_cmd_search(player_type *player_ptr); -void do_cmd_alter(player_type *player_ptr); -void do_cmd_suicide(player_type *player_ptr); +class PlayerType; +void do_cmd_search(PlayerType *player_ptr); +void do_cmd_alter(PlayerType *player_ptr); +void do_cmd_suicide(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-pet.cpp b/src/cmd-action/cmd-pet.cpp index 0425c8ba3..a3fb88be0 100644 --- a/src/cmd-action/cmd-pet.cpp +++ b/src/cmd-action/cmd-pet.cpp @@ -70,7 +70,7 @@ /*! * @brief ペットを開放するコマンドのメインルーチン */ -void do_cmd_pet_dismiss(player_type *player_ptr) +void do_cmd_pet_dismiss(PlayerType *player_ptr) { monster_type *m_ptr; bool all_pets = false; @@ -192,7 +192,7 @@ void do_cmd_pet_dismiss(player_type *player_ptr) * @param force 強制的に騎乗/下馬するならばTRUE * @return 騎乗/下馬できたらTRUE */ -bool do_cmd_riding(player_type *player_ptr, bool force) +bool do_cmd_riding(PlayerType *player_ptr, bool force) { POSITION x, y; DIRECTION dir = 0; @@ -303,7 +303,7 @@ bool do_cmd_riding(player_type *player_ptr, bool force) /*! * @brief ペットに名前をつけるコマンドのメインルーチン */ -static void do_name_pet(player_type *player_ptr) +static void do_name_pet(PlayerType *player_ptr) { monster_type *m_ptr; char out_val[20]; @@ -369,7 +369,7 @@ static void do_name_pet(player_type *player_ptr) * @brief ペットに関するコマンドリストのメインルーチン / * Issue a pet command */ -void do_cmd_pet(player_type *player_ptr) +void do_cmd_pet(PlayerType *player_ptr) { COMMAND_CODE i = 0; int num; diff --git a/src/cmd-action/cmd-pet.h b/src/cmd-action/cmd-pet.h index 81fd47c46..ad4911086 100644 --- a/src/cmd-action/cmd-pet.h +++ b/src/cmd-action/cmd-pet.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -bool do_cmd_riding(player_type *player_ptr, bool force); -void do_cmd_pet_dismiss(player_type *player_ptr); -void do_cmd_pet(player_type *player_ptr); +class PlayerType; +bool do_cmd_riding(PlayerType *player_ptr, bool force); +void do_cmd_pet_dismiss(PlayerType *player_ptr); +void do_cmd_pet(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-racial.cpp b/src/cmd-action/cmd-racial.cpp index 59984cd65..ec8632dfe 100644 --- a/src/cmd-action/cmd-racial.cpp +++ b/src/cmd-action/cmd-racial.cpp @@ -55,7 +55,7 @@ static void racial_power_erase_cursor(rc_type *rc_ptr) * @param rc_ptr レイシャルパワー情報への参照ポインタ * @return キャンセルしたらRC_CANCEL、それ以外ならRC_CONTINUE */ -static void racial_power_display_list(player_type *player_ptr, rc_type *rc_ptr) +static void racial_power_display_list(PlayerType *player_ptr, rc_type *rc_ptr) { TERM_LEN x = 11; char dummy[256]; @@ -118,7 +118,7 @@ static void racial_power_make_prompt(rc_type *rc_ptr) * @param rc_ptr レイシャルパワー情報への参照ポインタ * @param i カーソル増分 */ -static void racial_power_add_index(player_type *player_ptr, rc_type *rc_ptr, int i) +static void racial_power_add_index(PlayerType *player_ptr, rc_type *rc_ptr, int i) { auto n = rc_ptr->menu_line + i; if (i < -1 || i > 1) { @@ -147,7 +147,7 @@ static void racial_power_add_index(player_type *player_ptr, rc_type *rc_ptr, int * @param rc_ptr レイシャルパワー情報への参照ポインタ * @return キャンセルならRC_CANCEL、そうでないならRC_CONTINUE */ -static bool racial_power_interpret_menu_keys(player_type *player_ptr, rc_type *rc_ptr) +static bool racial_power_interpret_menu_keys(PlayerType *player_ptr, rc_type *rc_ptr) { switch (rc_ptr->choice) { case '0': @@ -194,7 +194,7 @@ static bool racial_power_interpret_menu_keys(player_type *player_ptr, rc_type *r * @param rc_ptr レイシャルパワー情報への参照ポインタ * @return キャンセルしたらRC_CANCEL、それ以外ならRC_CONTINUE */ -static bool racial_power_select_by_menu(player_type *player_ptr, rc_type *rc_ptr) +static bool racial_power_select_by_menu(PlayerType *player_ptr, rc_type *rc_ptr) { if (!use_menu || rc_ptr->choice == ' ') return RC_CONTINUE; @@ -214,7 +214,7 @@ static bool racial_power_select_by_menu(player_type *player_ptr, rc_type *rc_ptr * @param rc_ptr レイシャルパワー情報への参照ポインタ * @return コマンド選択していたらtrue、していなかったらfalse */ -static bool racial_power_interpret_choise(player_type *player_ptr, rc_type *rc_ptr) +static bool racial_power_interpret_choise(PlayerType *player_ptr, rc_type *rc_ptr) { if (use_menu) return false; @@ -277,7 +277,7 @@ static bool ask_invoke_racial_power(rc_type *rc_ptr) return get_check(tmp_val); } -static void racial_power_display_explanation(player_type *player_ptr, rc_type *rc_ptr) +static void racial_power_display_explanation(PlayerType *player_ptr, rc_type *rc_ptr) { auto &rpi = rc_ptr->power_desc[rc_ptr->command_code]; char temp[62 * 5]; @@ -309,7 +309,7 @@ static void racial_power_display_explanation(player_type *player_ptr, rc_type *r * @param rc_ptr レイシャルパワー情報への参照ポインタ * @return コマンド選択したらRC_CONTINUE、キャンセルしたらRC_CANCEL */ -static bool racial_power_process_input(player_type *player_ptr, rc_type *rc_ptr) +static bool racial_power_process_input(PlayerType *player_ptr, rc_type *rc_ptr) { rc_ptr->choice = (always_show_list || use_menu) ? ESCAPE : 1; @@ -345,7 +345,7 @@ static bool racial_power_process_input(player_type *player_ptr, rc_type *rc_ptr) * @param rc_ptr レイシャルパワー情報への参照ポインタ * @return コマンド選択したらRC_CONTINUE、キャンセルしたらRC_CANCEL */ -static bool racial_power_select_power(player_type *player_ptr, rc_type *rc_ptr) +static bool racial_power_select_power(PlayerType *player_ptr, rc_type *rc_ptr) { if (repeat_pull(&rc_ptr->command_code) && rc_ptr->command_code >= 0 && rc_ptr->command_code < rc_ptr->power_count()) return RC_CONTINUE; @@ -373,7 +373,7 @@ static bool racial_power_select_power(player_type *player_ptr, rc_type *rc_ptr) * @details * 戻り値の代わりにrc_ptr->castに使用の有無を入れる。 */ -static void racial_power_cast_power(player_type *player_ptr, rc_type *rc_ptr) +static void racial_power_cast_power(PlayerType *player_ptr, rc_type *rc_ptr) { auto *rpi_ptr = &rc_ptr->power_desc[rc_ptr->command_code]; @@ -402,7 +402,7 @@ static void racial_power_cast_power(player_type *player_ptr, rc_type *rc_ptr) * MPが足りない場合はHPを減らす。 * 戻り値はHP/MPの再描画が必要か判定するのに使用。 */ -static bool racial_power_reduce_mana(player_type *player_ptr, rc_type *rc_ptr) +static bool racial_power_reduce_mana(PlayerType *player_ptr, rc_type *rc_ptr) { int racial_cost = rc_ptr->power_desc[rc_ptr->command_code].racial_cost; if (racial_cost == 0) @@ -425,7 +425,7 @@ static bool racial_power_reduce_mana(player_type *player_ptr, rc_type *rc_ptr) * @brief レイシャル・パワーコマンドのメインルーチン / Allow user to choose a power (racial / mutation) to activate * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_racial_power(player_type *player_ptr) +void do_cmd_racial_power(PlayerType *player_ptr) { if (player_ptr->wild_mode) return; diff --git a/src/cmd-action/cmd-racial.h b/src/cmd-action/cmd-racial.h index a1f0e589e..191696d58 100644 --- a/src/cmd-action/cmd-racial.h +++ b/src/cmd-action/cmd-racial.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_racial_power(player_type *player_ptr); +class PlayerType; +void do_cmd_racial_power(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-shoot.cpp b/src/cmd-action/cmd-shoot.cpp index 29cd92917..c8cbd67d8 100644 --- a/src/cmd-action/cmd-shoot.cpp +++ b/src/cmd-action/cmd-shoot.cpp @@ -24,7 +24,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param snipe_type スナイパーの射撃術の種類 */ -void do_cmd_fire(player_type *player_ptr, SPELL_IDX snipe_type) +void do_cmd_fire(PlayerType *player_ptr, SPELL_IDX snipe_type) { OBJECT_IDX item; object_type *j_ptr, *ammo_ptr; diff --git a/src/cmd-action/cmd-shoot.h b/src/cmd-action/cmd-shoot.h index a03cefd0f..ae6e94a58 100644 --- a/src/cmd-action/cmd-shoot.h +++ b/src/cmd-action/cmd-shoot.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -void do_cmd_fire(player_type *player_ptr, SPELL_IDX snipe_type); +class PlayerType; +void do_cmd_fire(PlayerType *player_ptr, SPELL_IDX snipe_type); diff --git a/src/cmd-action/cmd-spell.cpp b/src/cmd-action/cmd-spell.cpp index d76f55f19..b8cd35782 100644 --- a/src/cmd-action/cmd-spell.cpp +++ b/src/cmd-action/cmd-spell.cpp @@ -246,7 +246,7 @@ concptr info_weight(WEIGHT weight) * @param use_realm 魔法領域ID * @return 失敗率(%) */ -static bool spell_okay(player_type *player_ptr, int spell, bool learned, bool study_pray, int use_realm) +static bool spell_okay(PlayerType *player_ptr, int spell, bool learned, bool study_pray, int use_realm) { const magic_type *s_ptr; @@ -299,7 +299,7 @@ static bool spell_okay(player_type *player_ptr, int spell, bool learned, bool st * The "known" should be TRUE for cast/pray, FALSE for study * */ -static int get_spell(player_type *player_ptr, SPELL_IDX *sn, concptr prompt, OBJECT_SUBTYPE_VALUE sval, bool learned, int16_t use_realm) +static int get_spell(PlayerType *player_ptr, SPELL_IDX *sn, concptr prompt, OBJECT_SUBTYPE_VALUE sval, bool learned, int16_t use_realm) { int i; SPELL_IDX spell = -1; @@ -542,7 +542,7 @@ static int get_spell(player_type *player_ptr, SPELL_IDX *sn, concptr prompt, OBJ * @param browse_only 魔法と技能の閲覧を行うならばTRUE * @return 魔道書を一冊も持っていないならTRUEを返す */ -static void confirm_use_force(player_type *player_ptr, bool browse_only) +static void confirm_use_force(PlayerType *player_ptr, bool browse_only) { char which; COMMAND_CODE code; @@ -576,12 +576,12 @@ static void confirm_use_force(player_type *player_ptr, bool browse_only) } } -static FuncItemTester get_castable_spellbook_tester(player_type *player_ptr) +static FuncItemTester get_castable_spellbook_tester(PlayerType *player_ptr) { return FuncItemTester([](auto p_ptr, auto o_ptr) { return check_book_realm(p_ptr, o_ptr->tval, o_ptr->sval); }, player_ptr); } -static FuncItemTester get_learnable_spellbook_tester(player_type *player_ptr) +static FuncItemTester get_learnable_spellbook_tester(PlayerType *player_ptr) { if (player_ptr->realm2 == REALM_NONE) { return get_castable_spellbook_tester(player_ptr); @@ -601,7 +601,7 @@ static FuncItemTester get_learnable_spellbook_tester(player_type *player_ptr) * and in the dark, primarily to allow browsing in stores. * */ -void do_cmd_browse(player_type *player_ptr) +void do_cmd_browse(PlayerType *player_ptr) { OBJECT_IDX item; OBJECT_SUBTYPE_VALUE sval; @@ -714,7 +714,7 @@ void do_cmd_browse(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param next_realm 変更先の魔法領域ID */ -static void change_realm2(player_type *player_ptr, int16_t next_realm) +static void change_realm2(PlayerType *player_ptr, int16_t next_realm) { int i, j = 0; char tmp[80]; @@ -751,7 +751,7 @@ static void change_realm2(player_type *player_ptr, int16_t next_realm) * @brief 魔法を学習するコマンドのメインルーチン / * Study a book to gain a new spell/prayer */ -void do_cmd_study(player_type *player_ptr) +void do_cmd_study(PlayerType *player_ptr) { int i; OBJECT_IDX item; @@ -959,7 +959,7 @@ void do_cmd_study(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 詠唱したらtrue */ -bool do_cmd_cast(player_type *player_ptr) +bool do_cmd_cast(PlayerType *player_ptr) { OBJECT_IDX item; OBJECT_SUBTYPE_VALUE sval; diff --git a/src/cmd-action/cmd-spell.h b/src/cmd-action/cmd-spell.h index d5fac4617..dc2ad550f 100644 --- a/src/cmd-action/cmd-spell.h +++ b/src/cmd-action/cmd-spell.h @@ -26,7 +26,7 @@ concptr info_power_dice(DICE_NUMBER dice, DICE_SID sides); concptr info_radius(POSITION rad); concptr info_weight(WEIGHT weight); -struct player_type; -void do_cmd_browse(player_type *player_ptr); -void do_cmd_study(player_type *player_ptr); -bool do_cmd_cast(player_type *player_ptr); +class PlayerType; +void do_cmd_browse(PlayerType *player_ptr); +void do_cmd_study(PlayerType *player_ptr); +bool do_cmd_cast(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-travel.cpp b/src/cmd-action/cmd-travel.cpp index 3685d3a75..e488cbb92 100644 --- a/src/cmd-action/cmd-travel.cpp +++ b/src/cmd-action/cmd-travel.cpp @@ -23,7 +23,7 @@ * @param x 該当地点のX座標 * @return コスト値 */ -static int travel_flow_cost(player_type *player_ptr, POSITION y, POSITION x) +static int travel_flow_cost(PlayerType *player_ptr, POSITION y, POSITION x) { int cost = 1; auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; @@ -67,7 +67,7 @@ static int travel_flow_cost(player_type *player_ptr, POSITION y, POSITION x) * @param n 現在のコスト * @param wall プレイヤーが壁の中にいるならばTRUE */ -static void travel_flow_aux(player_type *player_ptr, POSITION y, POSITION x, int n, bool wall) +static void travel_flow_aux(PlayerType *player_ptr, POSITION y, POSITION x, int n, bool wall) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; @@ -111,7 +111,7 @@ static void travel_flow_aux(player_type *player_ptr, POSITION y, POSITION x, int * @param ty 目標地点のY座標 * @param tx 目標地点のX座標 */ -static void travel_flow(player_type *player_ptr, POSITION ty, POSITION tx) +static void travel_flow(PlayerType *player_ptr, POSITION ty, POSITION tx) { flow_head = flow_tail = 0; bool wall = false; @@ -137,7 +137,7 @@ static void travel_flow(player_type *player_ptr, POSITION ty, POSITION tx) /*! * @brief トラベル処理のメインルーチン */ -void do_cmd_travel(player_type *player_ptr) +void do_cmd_travel(PlayerType *player_ptr) { POSITION x, y; if ((travel.x != 0) && (travel.y != 0) && (travel.x != player_ptr->x) && (travel.y != player_ptr->y) diff --git a/src/cmd-action/cmd-travel.h b/src/cmd-action/cmd-travel.h index 0eb7ad63f..d4a34b6fd 100644 --- a/src/cmd-action/cmd-travel.h +++ b/src/cmd-action/cmd-travel.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_travel(player_type *player_ptr); +class PlayerType; +void do_cmd_travel(PlayerType *player_ptr); diff --git a/src/cmd-action/cmd-tunnel.cpp b/src/cmd-action/cmd-tunnel.cpp index b8f073e7c..b849b5721 100644 --- a/src/cmd-action/cmd-tunnel.cpp +++ b/src/cmd-action/cmd-tunnel.cpp @@ -32,7 +32,7 @@ * accomplished by strong players using heavy weapons. * */ -void do_cmd_tunnel(player_type *player_ptr) +void do_cmd_tunnel(PlayerType *player_ptr) { bool more = false; PlayerClass(player_ptr).break_samurai_stance({ SamuraiStanceType::MUSOU }); diff --git a/src/cmd-action/cmd-tunnel.h b/src/cmd-action/cmd-tunnel.h index 23771174a..264ba963a 100644 --- a/src/cmd-action/cmd-tunnel.h +++ b/src/cmd-action/cmd-tunnel.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_tunnel(player_type *player_ptr); +class PlayerType; +void do_cmd_tunnel(PlayerType *player_ptr); diff --git a/src/cmd-building/cmd-building.cpp b/src/cmd-building/cmd-building.cpp index 5e6dcd4b2..0a1336198 100644 --- a/src/cmd-building/cmd-building.cpp +++ b/src/cmd-building/cmd-building.cpp @@ -80,7 +80,7 @@ bool reinit_wilderness = false; * @brief 町に関するヘルプを表示する / Display town history * @param player_ptr プレイヤーへの参照ポインタ */ -static void town_history(player_type *player_ptr) +static void town_history(PlayerType *player_ptr) { screen_save(); (void)show_file(player_ptr, true, _("jbldg.txt", "bldg.txt"), nullptr, 0, 0); @@ -93,7 +93,7 @@ static void town_history(player_type *player_ptr) * @param bldg 施設構造体の参照ポインタ * @param i 実行したい施設のサービステーブルの添字 */ -static void bldg_process_command(player_type *player_ptr, building_type *bldg, int i) +static void bldg_process_command(PlayerType *player_ptr, building_type *bldg, int i) { msg_flag = false; msg_erase(); @@ -297,7 +297,7 @@ static void bldg_process_command(player_type *player_ptr, building_type *bldg, i * @brief 施設入り口にプレイヤーが乗った際の処理 / Do building commands * @param プレイヤーへの参照ポインタ */ -void do_cmd_building(player_type *player_ptr) +void do_cmd_building(PlayerType *player_ptr) { if (player_ptr->wild_mode) return; diff --git a/src/cmd-building/cmd-building.h b/src/cmd-building/cmd-building.h index a8a83570b..90107dccf 100644 --- a/src/cmd-building/cmd-building.h +++ b/src/cmd-building/cmd-building.h @@ -21,5 +21,5 @@ extern int battle_odds; extern PRICE kakekin; extern int sel_monster; -struct player_type; -void do_cmd_building(player_type *player_ptr); +class PlayerType; +void do_cmd_building(PlayerType *player_ptr); diff --git a/src/cmd-building/cmd-inn.cpp b/src/cmd-building/cmd-inn.cpp index 983803580..4101f88af 100644 --- a/src/cmd-building/cmd-inn.cpp +++ b/src/cmd-building/cmd-inn.cpp @@ -26,7 +26,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 満腹ならFALSE、そうでないならTRUE */ -static bool buy_food(player_type *player_ptr) +static bool buy_food(PlayerType *player_ptr) { if (player_ptr->food >= PY_FOOD_FULL) { msg_print(_("今は満腹だ。", "You are full now.")); @@ -43,7 +43,7 @@ static bool buy_food(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 毒でも切り傷でもないならTRUE、そうでないならFALSE */ -static bool is_healthy_stay(player_type *player_ptr) +static bool is_healthy_stay(PlayerType *player_ptr) { if (!player_ptr->poisoned && !player_ptr->effects()->cut()->is_cut()) { return true; @@ -56,7 +56,7 @@ static bool is_healthy_stay(player_type *player_ptr) } #ifdef JP -static bool is_player_undead(player_type *player_ptr) +static bool is_player_undead(PlayerType *player_ptr) { return PlayerRace(player_ptr, true).life() == PlayerRaceLifeType::UNDEAD; } @@ -67,7 +67,7 @@ static bool is_player_undead(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param prev_hour 宿屋に入った直後のゲーム内時刻 */ -static void write_diary_stay_inn(player_type *player_ptr, int prev_hour) +static void write_diary_stay_inn(PlayerType *player_ptr, int prev_hour) { if ((prev_hour >= 6) && (prev_hour < 18)) { concptr stay_message = _(is_player_undead(player_ptr) ? "宿屋に泊まった。" : "日が暮れるまで宿屋で過ごした。", "stayed during the day at the inn."); @@ -100,7 +100,7 @@ static void pass_game_turn_by_stay(void) * @param player_ptr プレイヤーへの参照ポインタ * @return 悪夢モードならばTRUE */ -static bool has_a_nightmare(player_type *player_ptr) +static bool has_a_nightmare(PlayerType *player_ptr) { if (!ironman_nightmare) return false; @@ -122,7 +122,7 @@ static bool has_a_nightmare(player_type *player_ptr) * @brief 体調を元に戻す * @param player_ptr プレイヤーへの参照ポインタ */ -static void back_to_health(player_type *player_ptr) +static void back_to_health(PlayerType *player_ptr) { BadStatusSetter bss(player_ptr); (void)bss.blindness(0); @@ -136,7 +136,7 @@ static void back_to_health(player_type *player_ptr) * @brief 魔道具術師の取り込んだ魔法をすべて完全に回復した状態にする * @param player_ptr プレイヤーへの参照ポインタ */ -static void charge_magic_eating_energy(player_type *player_ptr) +static void charge_magic_eating_energy(PlayerType *player_ptr) { auto magic_eater_data = PlayerClass(player_ptr).get_specific_data(); if (!magic_eater_data) { @@ -158,7 +158,7 @@ static void charge_magic_eating_energy(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param prev_hour 宿屋に入った直後のゲーム内時刻 */ -static void display_stay_result(player_type *player_ptr, int prev_hour) +static void display_stay_result(PlayerType *player_ptr, int prev_hour) { if ((prev_hour >= 6) && (prev_hour < 18)) { #if JP @@ -183,7 +183,7 @@ static void display_stay_result(player_type *player_ptr, int prev_hour) * @param player_ptr プレイヤーへの参照ポインタ * @return 泊まれたらTRUE */ -static bool stay_inn(player_type *player_ptr) +static bool stay_inn(PlayerType *player_ptr) { if (!is_healthy_stay(player_ptr)) return false; @@ -225,7 +225,7 @@ static bool stay_inn(player_type *player_ptr) * Resting at night is also a quick way to restock stores -KMW- * @todo 悪夢を見る前後に全回復しているが、何か意図がある? */ -bool inn_comm(player_type *player_ptr, int cmd) +bool inn_comm(PlayerType *player_ptr, int cmd) { switch (cmd) { case BACT_FOOD: diff --git a/src/cmd-building/cmd-inn.h b/src/cmd-building/cmd-inn.h index 21819d19f..d98267de9 100644 --- a/src/cmd-building/cmd-inn.h +++ b/src/cmd-building/cmd-inn.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool inn_comm(player_type *player_ptr, int cmd); +class PlayerType; +bool inn_comm(PlayerType *player_ptr, int cmd); diff --git a/src/cmd-io/cmd-autopick.cpp b/src/cmd-io/cmd-autopick.cpp index 0dea5b647..03c7293e3 100644 --- a/src/cmd-io/cmd-autopick.cpp +++ b/src/cmd-io/cmd-autopick.cpp @@ -80,7 +80,7 @@ static int analyze_move_key(text_body_type *tb, int skey) * In-game editor of Object Auto-picker/Destoryer * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_edit_autopick(player_type *player_ptr) +void do_cmd_edit_autopick(PlayerType *player_ptr) { static int cx_save = 0; static int cy_save = 0; diff --git a/src/cmd-io/cmd-autopick.h b/src/cmd-io/cmd-autopick.h index d16c0f3c8..32a19c968 100644 --- a/src/cmd-io/cmd-autopick.h +++ b/src/cmd-io/cmd-autopick.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_edit_autopick(player_type *player_ptr); +class PlayerType; +void do_cmd_edit_autopick(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-diary.cpp b/src/cmd-io/cmd-diary.cpp index 0ca234592..398c2ce53 100644 --- a/src/cmd-io/cmd-diary.cpp +++ b/src/cmd-io/cmd-diary.cpp @@ -21,7 +21,7 @@ * @brief 日記のタイトル表記と内容出力 * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_diary(player_type *player_ptr) +static void display_diary(PlayerType *player_ptr) { char diary_title[256]; GAME_TEXT file_name[MAX_NLEN]; @@ -50,7 +50,7 @@ static void display_diary(player_type *player_ptr) /*! * @brief 日記に任意の内容を表記するコマンドのメインルーチン / */ -static void add_diary_note(player_type *player_ptr) +static void add_diary_note(PlayerType *player_ptr) { char tmp[80] = "\0"; char bunshou[80] = "\0"; @@ -63,7 +63,7 @@ static void add_diary_note(player_type *player_ptr) /*! * @brief 最後に取得したアイテムの情報を日記に追加するメインルーチン / */ -static void do_cmd_last_get(player_type *player_ptr) +static void do_cmd_last_get(PlayerType *player_ptr) { if (record_o_name[0] == '\0') return; @@ -110,7 +110,7 @@ static void do_cmd_erase_diary(void) * @brief 日記コマンド * @param crerature_ptr プレイヤーへの参照ポインタ */ -void do_cmd_diary(player_type *player_ptr) +void do_cmd_diary(PlayerType *player_ptr) { screen_save(); while (true) { diff --git a/src/cmd-io/cmd-diary.h b/src/cmd-io/cmd-diary.h index 0cf819160..dea2d4800 100644 --- a/src/cmd-io/cmd-diary.h +++ b/src/cmd-io/cmd-diary.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_diary(player_type *player_ptr); +class PlayerType; +void do_cmd_diary(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-dump.cpp b/src/cmd-io/cmd-dump.cpp index 106f9d440..308de138b 100644 --- a/src/cmd-io/cmd-dump.cpp +++ b/src/cmd-io/cmd-dump.cpp @@ -46,7 +46,7 @@ * @details * Allow absolute file names? */ -void do_cmd_pref(player_type *player_ptr) +void do_cmd_pref(PlayerType *player_ptr) { char buf[80]; strcpy(buf, ""); @@ -59,7 +59,7 @@ void do_cmd_pref(player_type *player_ptr) /* * Interact with "colors" */ -void do_cmd_colors(player_type *player_ptr) +void do_cmd_colors(PlayerType *player_ptr) { int i; char tmp[160]; @@ -203,7 +203,7 @@ void do_cmd_version(void) * Note that "feeling" is set to zero unless some time has passed. * Note that this is done when the level is GENERATED, not entered. */ -void do_cmd_feeling(player_type *player_ptr) +void do_cmd_feeling(PlayerType *player_ptr) { if (player_ptr->wild_mode) return; @@ -240,7 +240,7 @@ void do_cmd_feeling(player_type *player_ptr) * Display the time and date * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_time(player_type *player_ptr) +void do_cmd_time(PlayerType *player_ptr) { int day, hour, min; extract_day_hour_min(player_ptr, &day, &hour, &min); diff --git a/src/cmd-io/cmd-dump.h b/src/cmd-io/cmd-dump.h index 4fc9b57a2..1932e9605 100644 --- a/src/cmd-io/cmd-dump.h +++ b/src/cmd-io/cmd-dump.h @@ -1,9 +1,9 @@ #pragma once -struct player_type; -void do_cmd_pref(player_type *player_ptr); -void do_cmd_colors(player_type *player_ptr); +class PlayerType; +void do_cmd_pref(PlayerType *player_ptr); +void do_cmd_colors(PlayerType *player_ptr); void do_cmd_note(void); void do_cmd_version(void); -void do_cmd_feeling(player_type *player_ptr); -void do_cmd_time(player_type *player_ptr); +void do_cmd_feeling(PlayerType *player_ptr); +void do_cmd_time(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-floor.cpp b/src/cmd-io/cmd-floor.cpp index 3f64fe655..2f32e2658 100644 --- a/src/cmd-io/cmd-floor.cpp +++ b/src/cmd-io/cmd-floor.cpp @@ -21,7 +21,7 @@ * @brief ターゲットを設定するコマンドのメインルーチン * Target command */ -void do_cmd_target(player_type *player_ptr) +void do_cmd_target(PlayerType *player_ptr) { if (player_ptr->wild_mode) return; @@ -36,7 +36,7 @@ void do_cmd_target(player_type *player_ptr) * @brief 周囲を見渡すコマンドのメインルーチン * Look command */ -void do_cmd_look(player_type *player_ptr) +void do_cmd_look(PlayerType *player_ptr) { set_bits(player_ptr->window_flags, PW_MONSTER_LIST | PW_FLOOR_ITEM_LIST); handle_stuff(player_ptr); @@ -48,7 +48,7 @@ void do_cmd_look(player_type *player_ptr) * @brief 位置を確認するコマンドのメインルーチン * Allow the player to examine other sectors on the map */ -void do_cmd_locate(player_type *player_ptr) +void do_cmd_locate(PlayerType *player_ptr) { DIRECTION dir; POSITION y1, x1; diff --git a/src/cmd-io/cmd-floor.h b/src/cmd-io/cmd-floor.h index c9e6a47f0..b6db78b20 100644 --- a/src/cmd-io/cmd-floor.h +++ b/src/cmd-io/cmd-floor.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void do_cmd_target(player_type *player_ptr); -void do_cmd_look(player_type *player_ptr); -void do_cmd_locate(player_type *player_ptr); +class PlayerType; +void do_cmd_target(PlayerType *player_ptr); +void do_cmd_look(PlayerType *player_ptr); +void do_cmd_locate(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-gameoption.cpp b/src/cmd-io/cmd-gameoption.cpp index 3f65e55d2..e8414bde6 100644 --- a/src/cmd-io/cmd-gameoption.cpp +++ b/src/cmd-io/cmd-gameoption.cpp @@ -89,7 +89,7 @@ static int16_t toggle_frequency(int16_t current) * @brief 自動セーブオプションを変更するコマンドのメインルーチン * @param info 表示メッセージ */ -static void do_cmd_options_autosave(player_type *player_ptr, concptr info) +static void do_cmd_options_autosave(PlayerType *player_ptr, concptr info) { char ch; int i, k = 0, n = 2; @@ -213,7 +213,7 @@ static void clear_window_flag(int x, int y) * @brief ウィンドウオプションを変更するコマンドのメインルーチン / * Modify the "window" options */ -static void do_cmd_options_win(player_type *player_ptr) +static void do_cmd_options_win(PlayerType *player_ptr) { int i, j, d; TERM_LEN y = 0; @@ -318,7 +318,7 @@ static void do_cmd_options_win(player_type *player_ptr) * Interact with some options for cheating * @param info 表示メッセージ */ -static void do_cmd_options_cheat(player_type *player_ptr, concptr info) +static void do_cmd_options_cheat(PlayerType *player_ptr, concptr info) { term_clear(); auto k = 0U; @@ -422,7 +422,7 @@ void extract_option_vars(void) * in any options which control "visual" aspects of the game. * */ -void do_cmd_options(player_type *player_ptr) +void do_cmd_options(PlayerType *player_ptr) { char k; int d, skey; @@ -617,7 +617,7 @@ void do_cmd_options(player_type *player_ptr) * @param page オプションページ番号 * @param info 表示メッセージ */ -void do_cmd_options_aux(player_type *player_ptr, game_option_types page, concptr info) +void do_cmd_options_aux(PlayerType *player_ptr, game_option_types page, concptr info) { char ch; int i, k = 0, n = 0, l; diff --git a/src/cmd-io/cmd-gameoption.h b/src/cmd-io/cmd-gameoption.h index f21323dc2..fa9b02336 100644 --- a/src/cmd-io/cmd-gameoption.h +++ b/src/cmd-io/cmd-gameoption.h @@ -3,7 +3,7 @@ #include "system/angband.h" #include "system/game-option-types.h" -struct player_type; +class PlayerType; void extract_option_vars(void); -void do_cmd_options_aux(player_type *player_ptr, game_option_types page, concptr info); -void do_cmd_options(player_type *player_ptr); +void do_cmd_options_aux(PlayerType *player_ptr, game_option_types page, concptr info); +void do_cmd_options(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-help.cpp b/src/cmd-io/cmd-help.cpp index d90630b1f..5ff571d0f 100644 --- a/src/cmd-io/cmd-help.cpp +++ b/src/cmd-io/cmd-help.cpp @@ -9,7 +9,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @details */ -void do_cmd_help(player_type *player_ptr) +void do_cmd_help(PlayerType *player_ptr) { screen_save(); (void)show_file(player_ptr, true, _("jhelp.hlp", "help.hlp"), nullptr, 0, 0); diff --git a/src/cmd-io/cmd-help.h b/src/cmd-io/cmd-help.h index bb631e0e8..f3ed4a06a 100644 --- a/src/cmd-io/cmd-help.h +++ b/src/cmd-io/cmd-help.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_help(player_type *player_ptr); +class PlayerType; +void do_cmd_help(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-knowledge.cpp b/src/cmd-io/cmd-knowledge.cpp index 80b67c109..77fc2f590 100644 --- a/src/cmd-io/cmd-knowledge.cpp +++ b/src/cmd-io/cmd-knowledge.cpp @@ -22,7 +22,7 @@ /* * Interact with "knowledge" */ -void do_cmd_knowledge(player_type *player_ptr) +void do_cmd_knowledge(PlayerType *player_ptr) { int i, p = 0; bool need_redraw = false; diff --git a/src/cmd-io/cmd-knowledge.h b/src/cmd-io/cmd-knowledge.h index 7f4cacda3..f0a92df3e 100644 --- a/src/cmd-io/cmd-knowledge.h +++ b/src/cmd-io/cmd-knowledge.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_knowledge(player_type *player_ptr); +class PlayerType; +void do_cmd_knowledge(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-lore.cpp b/src/cmd-io/cmd-lore.cpp index 1e786fd5e..bb8f7aab8 100644 --- a/src/cmd-io/cmd-lore.cpp +++ b/src/cmd-io/cmd-lore.cpp @@ -34,7 +34,7 @@ * Note that the player ghosts are ignored. * */ -void do_cmd_query_symbol(player_type *player_ptr) +void do_cmd_query_symbol(PlayerType *player_ptr) { char sym, query; char buf[256]; diff --git a/src/cmd-io/cmd-lore.h b/src/cmd-io/cmd-lore.h index 4e402bf3b..e4b2b42a2 100644 --- a/src/cmd-io/cmd-lore.h +++ b/src/cmd-io/cmd-lore.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_query_symbol(player_type *player_ptr); +class PlayerType; +void do_cmd_query_symbol(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-macro.cpp b/src/cmd-io/cmd-macro.cpp index f6a1ead38..cdd561572 100644 --- a/src/cmd-io/cmd-macro.cpp +++ b/src/cmd-io/cmd-macro.cpp @@ -146,7 +146,7 @@ static errr keymap_dump(concptr fname) * Could use some helpful instructions on this page. * */ -void do_cmd_macros(player_type *player_ptr) +void do_cmd_macros(PlayerType *player_ptr) { char tmp[1024]; char buf[1024]; diff --git a/src/cmd-io/cmd-macro.h b/src/cmd-io/cmd-macro.h index 8ad913740..0f951080a 100644 --- a/src/cmd-io/cmd-macro.h +++ b/src/cmd-io/cmd-macro.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_macros(player_type *player_ptr); +class PlayerType; +void do_cmd_macros(PlayerType *player_ptr); diff --git a/src/cmd-io/cmd-process-screen.cpp b/src/cmd-io/cmd-process-screen.cpp index 5b28e4753..1808edb8f 100644 --- a/src/cmd-io/cmd-process-screen.cpp +++ b/src/cmd-io/cmd-process-screen.cpp @@ -336,7 +336,7 @@ static bool do_cmd_save_screen_text(int wid, int hgt) * @param player_ptr プレイヤーへの参照ポインタ * @return 記念撮影直前のグラフィックオプション */ -static bool update_use_graphics(player_type *player_ptr) +static bool update_use_graphics(PlayerType *player_ptr) { if (!use_graphics) return true; @@ -352,7 +352,7 @@ static bool update_use_graphics(player_type *player_ptr) * Save a screen dump to a file * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_save_screen(player_type *player_ptr) +void do_cmd_save_screen(PlayerType *player_ptr) { prt(_("記念撮影しますか? [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0); bool html_dump; diff --git a/src/cmd-io/cmd-process-screen.h b/src/cmd-io/cmd-process-screen.h index 424448bf0..42b81c334 100644 --- a/src/cmd-io/cmd-process-screen.h +++ b/src/cmd-io/cmd-process-screen.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; +class PlayerType; void do_cmd_save_screen_html_aux(char *filename, int message); -void do_cmd_save_screen(player_type *player_ptr); +void do_cmd_save_screen(PlayerType *player_ptr); void do_cmd_load_screen(void); diff --git a/src/cmd-io/cmd-save.cpp b/src/cmd-io/cmd-save.cpp index b928cb0f3..3c448415e 100644 --- a/src/cmd-io/cmd-save.cpp +++ b/src/cmd-io/cmd-save.cpp @@ -18,7 +18,7 @@ * @param is_autosave オートセーブ中の処理ならばTRUE * @details */ -void do_cmd_save_game(player_type *player_ptr, int is_autosave) +void do_cmd_save_game(PlayerType *player_ptr, int is_autosave) { if (is_autosave) msg_print(_("自動セーブ中", "Autosaving the game...")); @@ -46,7 +46,7 @@ void do_cmd_save_game(player_type *player_ptr, int is_autosave) * Save the game and exit * @details */ -void do_cmd_save_and_exit(player_type *player_ptr) +void do_cmd_save_and_exit(PlayerType *player_ptr) { player_ptr->playing = false; player_ptr->leaving = true; diff --git a/src/cmd-io/cmd-save.h b/src/cmd-io/cmd-save.h index f65ff0bb9..f72b6a72e 100644 --- a/src/cmd-io/cmd-save.h +++ b/src/cmd-io/cmd-save.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void do_cmd_save_game(player_type *player_ptr, int is_autosave); -void do_cmd_save_and_exit(player_type *player_ptr); +class PlayerType; +void do_cmd_save_game(PlayerType *player_ptr, int is_autosave); +void do_cmd_save_and_exit(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-destroy.cpp b/src/cmd-item/cmd-destroy.cpp index 851445aff..37c71ece1 100644 --- a/src/cmd-item/cmd-destroy.cpp +++ b/src/cmd-item/cmd-destroy.cpp @@ -54,7 +54,7 @@ static destroy_type *initialize_destroy_type(destroy_type *destroy_ptr, object_t return destroy_ptr; } -static bool check_destory_item(player_type *player_ptr, destroy_type *destroy_ptr) +static bool check_destory_item(PlayerType *player_ptr, destroy_type *destroy_ptr) { if (destroy_ptr->force || (!confirm_destroy && (object_value(destroy_ptr->o_ptr) <= 0))) return true; @@ -85,7 +85,7 @@ static bool check_destory_item(player_type *player_ptr, destroy_type *destroy_pt } } -static bool select_destroying_item(player_type *player_ptr, destroy_type *destroy_ptr) +static bool select_destroying_item(PlayerType *player_ptr, destroy_type *destroy_ptr) { concptr q = _("どのアイテムを壊しますか? ", "Destroy which item? "); concptr s = _("壊せるアイテムを持っていない。", "You have nothing to destroy."); @@ -109,7 +109,7 @@ static bool select_destroying_item(player_type *player_ptr, destroy_type *destro * @param destory_ptr アイテム破壊構造体への参照ポインタ * return 魔法書の破壊によって経験値が入るならばTRUE */ -static bool decide_magic_book_exp(player_type *player_ptr, destroy_type *destroy_ptr) +static bool decide_magic_book_exp(PlayerType *player_ptr, destroy_type *destroy_ptr) { if (player_ptr->prace == PlayerRaceType::ANDROID) return false; @@ -132,7 +132,7 @@ static bool decide_magic_book_exp(player_type *player_ptr, destroy_type *destroy return gain_expr; } -static void gain_exp_by_destroying_magic_book(player_type *player_ptr, destroy_type *destroy_ptr) +static void gain_exp_by_destroying_magic_book(PlayerType *player_ptr, destroy_type *destroy_ptr) { bool gain_expr = decide_magic_book_exp(player_ptr, destroy_ptr); if (!gain_expr || (player_ptr->exp >= PY_MAX_EXP)) @@ -152,7 +152,7 @@ static void gain_exp_by_destroying_magic_book(player_type *player_ptr, destroy_t gain_exp(player_ptr, tester_exp * destroy_ptr->amt); } -static void process_destroy_magic_book(player_type *player_ptr, destroy_type *destroy_ptr) +static void process_destroy_magic_book(PlayerType *player_ptr, destroy_type *destroy_ptr) { if (!item_tester_high_level_book(destroy_ptr->q_ptr)) return; @@ -175,7 +175,7 @@ static void process_destroy_magic_book(player_type *player_ptr, destroy_type *de chg_virtue(player_ptr, V_SACRIFICE, 1); } -static void exe_destroy_item(player_type *player_ptr, destroy_type *destroy_ptr) +static void exe_destroy_item(PlayerType *player_ptr, destroy_type *destroy_ptr) { destroy_ptr->q_ptr->copy_from(destroy_ptr->o_ptr); msg_format(_("%sを壊した。", "You destroy %s."), destroy_ptr->o_name); @@ -194,7 +194,7 @@ static void exe_destroy_item(player_type *player_ptr, destroy_type *destroy_ptr) * @brief アイテムを破壊するコマンドのメインルーチン / Destroy an item * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_destroy(player_type *player_ptr) +void do_cmd_destroy(PlayerType *player_ptr) { PlayerClass(player_ptr).break_samurai_stance({ SamuraiStanceType::MUSOU }); diff --git a/src/cmd-item/cmd-destroy.h b/src/cmd-item/cmd-destroy.h index e48f318cd..366ad5df7 100644 --- a/src/cmd-item/cmd-destroy.h +++ b/src/cmd-item/cmd-destroy.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_destroy(player_type *player_ptr); +class PlayerType; +void do_cmd_destroy(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-eat.cpp b/src/cmd-item/cmd-eat.cpp index 63e214856..59bb70d51 100644 --- a/src/cmd-item/cmd-eat.cpp +++ b/src/cmd-item/cmd-eat.cpp @@ -58,7 +58,7 @@ * @param o_ptr 食べるオブジェクト * @return 鑑定されるならTRUE、されないならFALSE */ -bool exe_eat_food_type_object(player_type *player_ptr, object_type *o_ptr) +bool exe_eat_food_type_object(PlayerType *player_ptr, object_type *o_ptr) { if (o_ptr->tval != ItemKindType::FOOD) return false; @@ -150,7 +150,7 @@ bool exe_eat_food_type_object(player_type *player_ptr, object_type *o_ptr) * @param item オブジェクトのインベントリ番号 * @return 食べようとしたらTRUE、しなかったらFALSE */ -bool exe_eat_charge_of_magic_device(player_type *player_ptr, object_type *o_ptr, INVENTORY_IDX item) +bool exe_eat_charge_of_magic_device(PlayerType *player_ptr, object_type *o_ptr, INVENTORY_IDX item) { if (o_ptr->tval != ItemKindType::STAFF && o_ptr->tval != ItemKindType::WAND) return false; @@ -218,7 +218,7 @@ bool exe_eat_charge_of_magic_device(player_type *player_ptr, object_type *o_ptr, * @brief 食料を食べるコマンドのサブルーチン * @param item 食べるオブジェクトの所持品ID */ -void exe_eat_food(player_type *player_ptr, INVENTORY_IDX item) +void exe_eat_food(PlayerType *player_ptr, INVENTORY_IDX item) { if (music_singing_any(player_ptr)) stop_singing(player_ptr); @@ -332,7 +332,7 @@ void exe_eat_food(player_type *player_ptr, INVENTORY_IDX item) * @brief 食料を食べるコマンドのメインルーチン / * Eat some food (from the pack or floor) */ -void do_cmd_eat_food(player_type *player_ptr) +void do_cmd_eat_food(PlayerType *player_ptr) { OBJECT_IDX item; concptr q, s; diff --git a/src/cmd-item/cmd-eat.h b/src/cmd-item/cmd-eat.h index 689750290..7af061122 100644 --- a/src/cmd-item/cmd-eat.h +++ b/src/cmd-item/cmd-eat.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void do_cmd_eat_food(player_type *player_ptr); -void exe_eat_food(player_type *player_ptr, INVENTORY_IDX item); +class PlayerType; +void do_cmd_eat_food(PlayerType *player_ptr); +void exe_eat_food(PlayerType *player_ptr, INVENTORY_IDX item); diff --git a/src/cmd-item/cmd-equipment.cpp b/src/cmd-item/cmd-equipment.cpp index 3bb39fe67..712cbcfca 100644 --- a/src/cmd-item/cmd-equipment.cpp +++ b/src/cmd-item/cmd-equipment.cpp @@ -53,7 +53,7 @@ /*! * @brief 装備一覧を表示するコマンドのメインルーチン / Display equipment */ -void do_cmd_equip(player_type *player_ptr) +void do_cmd_equip(PlayerType *player_ptr) { char out_val[160]; command_wrk = true; @@ -89,7 +89,7 @@ void do_cmd_equip(player_type *player_ptr) * @brief 装備するコマンドのメインルーチン / Wield or wear a single item from the pack or floor * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_wield(player_type *player_ptr) +void do_cmd_wield(PlayerType *player_ptr) { OBJECT_IDX item, slot; object_type forge; @@ -297,7 +297,7 @@ void do_cmd_wield(player_type *player_ptr) /*! * @brief 装備を外すコマンドのメインルーチン / Take off an item */ -void do_cmd_takeoff(player_type *player_ptr) +void do_cmd_takeoff(PlayerType *player_ptr) { OBJECT_IDX item; object_type *o_ptr; diff --git a/src/cmd-item/cmd-equipment.h b/src/cmd-item/cmd-equipment.h index 7938ecf82..2163ff734 100644 --- a/src/cmd-item/cmd-equipment.h +++ b/src/cmd-item/cmd-equipment.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void do_cmd_equip(player_type *player_ptr); -void do_cmd_wield(player_type *player_ptr); -void do_cmd_takeoff(player_type *player_ptr); +class PlayerType; +void do_cmd_equip(PlayerType *player_ptr); +void do_cmd_wield(PlayerType *player_ptr); +void do_cmd_takeoff(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-item.cpp b/src/cmd-item/cmd-item.cpp index ee3b50755..6e2d42b43 100644 --- a/src/cmd-item/cmd-item.cpp +++ b/src/cmd-item/cmd-item.cpp @@ -72,7 +72,7 @@ /*! * @brief 持ち物一覧を表示するコマンドのメインルーチン / Display inventory_list */ -void do_cmd_inven(player_type *player_ptr) +void do_cmd_inven(PlayerType *player_ptr) { char out_val[160]; command_wrk = false; @@ -107,7 +107,7 @@ void do_cmd_inven(player_type *player_ptr) /*! * @brief アイテムを落とすコマンドのメインルーチン / Drop an item */ -void do_cmd_drop(player_type *player_ptr) +void do_cmd_drop(PlayerType *player_ptr) { OBJECT_IDX item; int amt = 1; @@ -144,7 +144,7 @@ void do_cmd_drop(player_type *player_ptr) /*! * @brief アイテムを調査するコマンドのメインルーチン / Observe an item which has been *identify*-ed */ -void do_cmd_observe(player_type *player_ptr) +void do_cmd_observe(PlayerType *player_ptr) { OBJECT_IDX item; object_type *o_ptr; @@ -170,7 +170,7 @@ void do_cmd_observe(player_type *player_ptr) * @brief アイテムの銘を消すコマンドのメインルーチン * Remove the inscription from an object XXX Mention item (when done)? */ -void do_cmd_uninscribe(player_type *player_ptr) +void do_cmd_uninscribe(PlayerType *player_ptr) { OBJECT_IDX item; object_type *o_ptr; @@ -196,7 +196,7 @@ void do_cmd_uninscribe(player_type *player_ptr) * @brief アイテムの銘を刻むコマンドのメインルーチン * Inscribe an object with a comment */ -void do_cmd_inscribe(player_type *player_ptr) +void do_cmd_inscribe(PlayerType *player_ptr) { OBJECT_IDX item; object_type *o_ptr; @@ -229,7 +229,7 @@ void do_cmd_inscribe(player_type *player_ptr) * @details * XXX - Add actions for other item types */ -void do_cmd_use(player_type *player_ptr) +void do_cmd_use(PlayerType *player_ptr) { OBJECT_IDX item; object_type *o_ptr; @@ -285,7 +285,7 @@ void do_cmd_use(player_type *player_ptr) * @brief 装備を発動するコマンドのメインルーチン / * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_activate(player_type *player_ptr) +void do_cmd_activate(PlayerType *player_ptr) { OBJECT_IDX item; if (player_ptr->wild_mode || cmd_limit_arena(player_ptr)) diff --git a/src/cmd-item/cmd-item.h b/src/cmd-item/cmd-item.h index 9270dd3e5..e3c0eef56 100644 --- a/src/cmd-item/cmd-item.h +++ b/src/cmd-item/cmd-item.h @@ -1,10 +1,10 @@ #pragma once -struct player_type; -void do_cmd_inven(player_type *player_ptr); -void do_cmd_drop(player_type *player_ptr); -void do_cmd_observe(player_type *player_ptr); -void do_cmd_uninscribe(player_type *player_ptr); -void do_cmd_inscribe(player_type *player_ptr); -void do_cmd_use(player_type *player_ptr); -void do_cmd_activate(player_type *player_ptr); +class PlayerType; +void do_cmd_inven(PlayerType *player_ptr); +void do_cmd_drop(PlayerType *player_ptr); +void do_cmd_observe(PlayerType *player_ptr); +void do_cmd_uninscribe(PlayerType *player_ptr); +void do_cmd_inscribe(PlayerType *player_ptr); +void do_cmd_use(PlayerType *player_ptr); +void do_cmd_activate(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-magiceat.cpp b/src/cmd-item/cmd-magiceat.cpp index 15fec08e7..7d996b29e 100644 --- a/src/cmd-item/cmd-magiceat.cpp +++ b/src/cmd-item/cmd-magiceat.cpp @@ -137,7 +137,7 @@ static std::optional> check_magic * @param only_browse 閲覧するだけならばTRUE * @return 選択した魔力のID、キャンセルならば-1を返す */ -static std::optional> select_magic_eater(player_type *player_ptr, bool only_browse) +static std::optional> select_magic_eater(PlayerType *player_ptr, bool only_browse) { char choice; bool flag, request_list; @@ -545,7 +545,7 @@ static std::optional> select_magi * @param powerful 強力発動中の処理ならばTRUE * @return 実際にコマンドを実行したならばTRUEを返す。 */ -bool do_cmd_magic_eater(player_type *player_ptr, bool only_browse, bool powerful) +bool do_cmd_magic_eater(PlayerType *player_ptr, bool only_browse, bool powerful) { bool use_charge = true; diff --git a/src/cmd-item/cmd-magiceat.h b/src/cmd-item/cmd-magiceat.h index 6ce4a6205..18224edd7 100644 --- a/src/cmd-item/cmd-magiceat.h +++ b/src/cmd-item/cmd-magiceat.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool do_cmd_magic_eater(player_type *player_ptr, bool only_browse, bool powerful); +class PlayerType; +bool do_cmd_magic_eater(PlayerType *player_ptr, bool only_browse, bool powerful); diff --git a/src/cmd-item/cmd-quaff.cpp b/src/cmd-item/cmd-quaff.cpp index 9dccc4b5e..2b74a51b8 100644 --- a/src/cmd-item/cmd-quaff.cpp +++ b/src/cmd-item/cmd-quaff.cpp @@ -24,7 +24,7 @@ * @brief 薬を飲むコマンドのメインルーチン / * Quaff some potion (from the pack or floor) */ -void do_cmd_quaff_potion(player_type *player_ptr) +void do_cmd_quaff_potion(PlayerType *player_ptr) { if (player_ptr->wild_mode) return; diff --git a/src/cmd-item/cmd-quaff.h b/src/cmd-item/cmd-quaff.h index e532f858a..335a526a7 100644 --- a/src/cmd-item/cmd-quaff.h +++ b/src/cmd-item/cmd-quaff.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_quaff_potion(player_type *player_ptr); +class PlayerType; +void do_cmd_quaff_potion(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-read.cpp b/src/cmd-item/cmd-read.cpp index 3ee10a4a2..ebf6ccc12 100644 --- a/src/cmd-item/cmd-read.cpp +++ b/src/cmd-item/cmd-read.cpp @@ -25,7 +25,7 @@ * @brief 読むコマンドのメインルーチン / * Eat some food (from the pack or floor) */ -void do_cmd_read_scroll(player_type *player_ptr) +void do_cmd_read_scroll(PlayerType *player_ptr) { if (player_ptr->wild_mode || cmd_limit_arena(player_ptr)) return; diff --git a/src/cmd-item/cmd-read.h b/src/cmd-item/cmd-read.h index a5ec58755..afb5da370 100644 --- a/src/cmd-item/cmd-read.h +++ b/src/cmd-item/cmd-read.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_read_scroll(player_type *player_ptr); +class PlayerType; +void do_cmd_read_scroll(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-refill.cpp b/src/cmd-item/cmd-refill.cpp index 889922ee3..e4c72678e 100644 --- a/src/cmd-item/cmd-refill.cpp +++ b/src/cmd-item/cmd-refill.cpp @@ -26,7 +26,7 @@ * @brief ランタンに燃料を加えるコマンドのメインルーチン * Refill the players lamp (from the pack or floor) */ -static void do_cmd_refill_lamp(player_type *player_ptr) +static void do_cmd_refill_lamp(PlayerType *player_ptr) { OBJECT_IDX item; object_type *o_ptr; @@ -63,7 +63,7 @@ static void do_cmd_refill_lamp(player_type *player_ptr) * @brief 松明を束ねるコマンドのメインルーチン * Refuel the players torch (from the pack or floor) */ -static void do_cmd_refill_torch(player_type *player_ptr) +static void do_cmd_refill_torch(PlayerType *player_ptr) { OBJECT_IDX item; object_type *o_ptr; @@ -101,7 +101,7 @@ static void do_cmd_refill_torch(player_type *player_ptr) * @brief 燃料を補充するコマンドのメインルーチン * Refill the players lamp, or restock his torches */ -void do_cmd_refill(player_type *player_ptr) +void do_cmd_refill(PlayerType *player_ptr) { object_type *o_ptr; o_ptr = &player_ptr->inventory_list[INVEN_LITE]; diff --git a/src/cmd-item/cmd-refill.h b/src/cmd-item/cmd-refill.h index 1aef5d82b..90d28fef1 100644 --- a/src/cmd-item/cmd-refill.h +++ b/src/cmd-item/cmd-refill.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_refill(player_type *player_ptr); +class PlayerType; +void do_cmd_refill(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-throw.cpp b/src/cmd-item/cmd-throw.cpp index 2b0643e25..f69d7a727 100644 --- a/src/cmd-item/cmd-throw.cpp +++ b/src/cmd-item/cmd-throw.cpp @@ -18,7 +18,7 @@ #include "system/object-type-definition.h" #include "system/player-type-definition.h" -ThrowCommand::ThrowCommand(player_type *player_ptr) +ThrowCommand::ThrowCommand(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/cmd-item/cmd-throw.h b/src/cmd-item/cmd-throw.h index 8a77dbd1e..afeab2734 100644 --- a/src/cmd-item/cmd-throw.h +++ b/src/cmd-item/cmd-throw.h @@ -2,13 +2,13 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ThrowCommand { public: - ThrowCommand(player_type *player_ptr); + ThrowCommand(PlayerType *player_ptr); virtual ~ThrowCommand() = default; bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken); private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/cmd-item/cmd-usestaff.cpp b/src/cmd-item/cmd-usestaff.cpp index fdf66c166..f139bc159 100644 --- a/src/cmd-item/cmd-usestaff.cpp +++ b/src/cmd-item/cmd-usestaff.cpp @@ -50,7 +50,7 @@ * @param known 判明済ならばTRUE * @return 発動により効果内容が確定したならばTRUEを返す */ -int staff_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, bool magic, bool known) +int staff_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, bool magic, bool known) { int k; bool ident = false; @@ -283,7 +283,7 @@ int staff_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_c /*! * @brief 杖を使うコマンドのメインルーチン / */ -void do_cmd_use_staff(player_type *player_ptr) +void do_cmd_use_staff(PlayerType *player_ptr) { OBJECT_IDX item; concptr q, s; diff --git a/src/cmd-item/cmd-usestaff.h b/src/cmd-item/cmd-usestaff.h index 22909b441..8fc9b1d44 100644 --- a/src/cmd-item/cmd-usestaff.h +++ b/src/cmd-item/cmd-usestaff.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -int staff_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, bool magic, bool known); -void do_cmd_use_staff(player_type *player_ptr); +class PlayerType; +int staff_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, bool magic, bool known); +void do_cmd_use_staff(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-zaprod.cpp b/src/cmd-item/cmd-zaprod.cpp index 7594b7d54..6c3b9a1cb 100644 --- a/src/cmd-item/cmd-zaprod.cpp +++ b/src/cmd-item/cmd-zaprod.cpp @@ -42,7 +42,7 @@ * @param powerful 強力発動上の処理ならばTRUE * @return 発動により効果内容が確定したならばTRUEを返す */ -int rod_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool powerful) +int rod_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool powerful) { int ident = false; PLAYER_LEVEL lev = powerful ? player_ptr->lev * 2 : player_ptr->lev; @@ -263,7 +263,7 @@ int rod_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir * @brief ロッドを使うコマンドのメインルーチン / * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_zap_rod(player_type *player_ptr) +void do_cmd_zap_rod(PlayerType *player_ptr) { if (player_ptr->wild_mode) { return; diff --git a/src/cmd-item/cmd-zaprod.h b/src/cmd-item/cmd-zaprod.h index 63be19d1a..847d4ba76 100644 --- a/src/cmd-item/cmd-zaprod.h +++ b/src/cmd-item/cmd-zaprod.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -int rod_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool powerful); -void do_cmd_zap_rod(player_type *player_ptr); +class PlayerType; +int rod_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool powerful); +void do_cmd_zap_rod(PlayerType *player_ptr); diff --git a/src/cmd-item/cmd-zapwand.cpp b/src/cmd-item/cmd-zapwand.cpp index 5e5bdb823..a55ca6aa8 100644 --- a/src/cmd-item/cmd-zapwand.cpp +++ b/src/cmd-item/cmd-zapwand.cpp @@ -51,7 +51,7 @@ * @param magic 魔道具術上の処理ならばTRUE * @return 発動により効果内容が確定したならばTRUEを返す */ -bool wand_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic) +bool wand_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic) { bool ident = false; PLAYER_LEVEL lev = powerful ? player_ptr->lev * 2 : player_ptr->lev; @@ -318,7 +318,7 @@ bool wand_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d /*! * @brief 魔法棒を使うコマンドのメインルーチン / */ -void do_cmd_aim_wand(player_type *player_ptr) +void do_cmd_aim_wand(PlayerType *player_ptr) { OBJECT_IDX item; concptr q, s; diff --git a/src/cmd-item/cmd-zapwand.h b/src/cmd-item/cmd-zapwand.h index a29cd8bb0..d52173e39 100644 --- a/src/cmd-item/cmd-zapwand.h +++ b/src/cmd-item/cmd-zapwand.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -bool wand_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic); -void do_cmd_aim_wand(player_type *player_ptr); +class PlayerType; +bool wand_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic); +void do_cmd_aim_wand(PlayerType *player_ptr); diff --git a/src/cmd-visual/cmd-draw.cpp b/src/cmd-visual/cmd-draw.cpp index 168d6aa11..f7ff5ccdd 100644 --- a/src/cmd-visual/cmd-draw.cpp +++ b/src/cmd-visual/cmd-draw.cpp @@ -35,7 +35,7 @@ * the "TERM_XTRA_REACT" hook before redrawing the windows. * */ -void do_cmd_redraw(player_type *player_ptr) +void do_cmd_redraw(PlayerType *player_ptr) { term_xtra(TERM_XTRA_REACT, 0); @@ -71,7 +71,7 @@ void do_cmd_redraw(player_type *player_ptr) /*! * @brief プレイヤーのステータス表示 */ -void do_cmd_player_status(player_type *player_ptr) +void do_cmd_player_status(PlayerType *player_ptr) { int mode = 0; char tmp[160]; diff --git a/src/cmd-visual/cmd-draw.h b/src/cmd-visual/cmd-draw.h index 95ac13d6f..1363d8b38 100644 --- a/src/cmd-visual/cmd-draw.h +++ b/src/cmd-visual/cmd-draw.h @@ -1,7 +1,7 @@ #pragma once -struct player_type; -void do_cmd_redraw(player_type *player_ptr); -void do_cmd_player_status(player_type *player_ptr); +class PlayerType; +void do_cmd_redraw(PlayerType *player_ptr); +void do_cmd_player_status(PlayerType *player_ptr); void do_cmd_message_one(void); void do_cmd_messages(int num_now); diff --git a/src/cmd-visual/cmd-map.cpp b/src/cmd-visual/cmd-map.cpp index beb62e08e..b92ae6a97 100644 --- a/src/cmd-visual/cmd-map.cpp +++ b/src/cmd-visual/cmd-map.cpp @@ -12,7 +12,7 @@ * * Currently, the "player" is displayed on the map. */ -void do_cmd_view_map(player_type *player_ptr) +void do_cmd_view_map(PlayerType *player_ptr) { screen_save(); prt(_("お待ち下さい...", "Please wait..."), 0, 0); diff --git a/src/cmd-visual/cmd-map.h b/src/cmd-visual/cmd-map.h index 5791c0886..999f78b4a 100644 --- a/src/cmd-visual/cmd-map.h +++ b/src/cmd-visual/cmd-map.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_view_map(player_type *player_ptr); +class PlayerType; +void do_cmd_view_map(PlayerType *player_ptr); diff --git a/src/cmd-visual/cmd-visuals.cpp b/src/cmd-visual/cmd-visuals.cpp index 6bb4e5bd9..490a7109c 100644 --- a/src/cmd-visual/cmd-visuals.cpp +++ b/src/cmd-visual/cmd-visuals.cpp @@ -75,7 +75,7 @@ static void print_visuals_menu(concptr choice_msg) /* * Interact with "visuals" */ -void do_cmd_visuals(player_type *player_ptr) +void do_cmd_visuals(PlayerType *player_ptr) { FILE *auto_dump_stream; char tmp[160]; diff --git a/src/cmd-visual/cmd-visuals.h b/src/cmd-visual/cmd-visuals.h index e93c1aef0..81968f798 100644 --- a/src/cmd-visual/cmd-visuals.h +++ b/src/cmd-visual/cmd-visuals.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_visuals(player_type *player_ptr); +class PlayerType; +void do_cmd_visuals(PlayerType *player_ptr); diff --git a/src/combat/attack-accuracy.cpp b/src/combat/attack-accuracy.cpp index a3da1a5b7..79568f084 100644 --- a/src/combat/attack-accuracy.cpp +++ b/src/combat/attack-accuracy.cpp @@ -25,7 +25,7 @@ * @return 命中と判定された場合TRUEを返す * @note Always miss 5%, always hit 5%, otherwise random. */ -bool test_hit_norm(player_type *player_ptr, int chance, ARMOUR_CLASS ac, bool visible) +bool test_hit_norm(PlayerType *player_ptr, int chance, ARMOUR_CLASS ac, bool visible) { if (!visible) chance = (chance + 1) / 2; @@ -39,7 +39,7 @@ bool test_hit_norm(player_type *player_ptr, int chance, ARMOUR_CLASS ac, bool vi * @param ac 敵AC * @return 命中確率 */ -PERCENTAGE hit_chance(player_type *player_ptr, int reli, ARMOUR_CLASS ac) +PERCENTAGE hit_chance(PlayerType *player_ptr, int reli, ARMOUR_CLASS ac) { PERCENTAGE chance = 5, chance_left = 90; if (reli <= 0) @@ -63,7 +63,7 @@ PERCENTAGE hit_chance(player_type *player_ptr, int reli, ARMOUR_CLASS ac) * Always miss 5% of the time, Always hit 5% of the time. * Otherwise, match monster power against player armor. */ -bool check_hit_from_monster_to_player(player_type *player_ptr, int power, DEPTH level, int stun) +bool check_hit_from_monster_to_player(PlayerType *player_ptr, int power, DEPTH level, int stun) { int k = randint0(100); if (stun && one_in_(2)) @@ -109,7 +109,7 @@ bool check_hit_from_monster_to_monster(int power, DEPTH level, ARMOUR_CLASS ac, * @param pa_ptr 直接攻撃構造体への参照ポインタ * @param chance 基本命中値 */ -static bool decide_attack_hit(player_type *player_ptr, player_attack_type *pa_ptr, int chance) +static bool decide_attack_hit(PlayerType *player_ptr, player_attack_type *pa_ptr, int chance) { bool success_hit = false; object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; @@ -142,7 +142,7 @@ static bool decide_attack_hit(player_type *player_ptr, player_attack_type *pa_pt * @param chance 基本命中値 * @return 当たればTRUE、外れればFALSE */ -bool process_attack_hit(player_type *player_ptr, player_attack_type *pa_ptr, int chance) +bool process_attack_hit(PlayerType *player_ptr, player_attack_type *pa_ptr, int chance) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; if (decide_attack_hit(player_ptr, pa_ptr, chance)) diff --git a/src/combat/attack-accuracy.h b/src/combat/attack-accuracy.h index 5d60edbc0..01f2b77d8 100644 --- a/src/combat/attack-accuracy.h +++ b/src/combat/attack-accuracy.h @@ -3,9 +3,9 @@ #include "system/angband.h" struct player_attack_type; -struct player_type; -bool test_hit_norm(player_type *player_ptr, int chance, ARMOUR_CLASS ac, bool visible); -PERCENTAGE hit_chance(player_type *player_ptr, int chance, ARMOUR_CLASS ac); -bool check_hit_from_monster_to_player(player_type *player_ptr, int power, DEPTH level, int stun); +class PlayerType; +bool test_hit_norm(PlayerType *player_ptr, int chance, ARMOUR_CLASS ac, bool visible); +PERCENTAGE hit_chance(PlayerType *player_ptr, int chance, ARMOUR_CLASS ac); +bool check_hit_from_monster_to_player(PlayerType *player_ptr, int power, DEPTH level, int stun); bool check_hit_from_monster_to_monster(int power, DEPTH level, ARMOUR_CLASS ac, int stun); -bool process_attack_hit(player_type *player_ptr, player_attack_type *pa_ptr, int chance); +bool process_attack_hit(PlayerType *player_ptr, player_attack_type *pa_ptr, int chance); diff --git a/src/combat/attack-criticality.cpp b/src/combat/attack-criticality.cpp index 095de4ddd..a55b91a4d 100644 --- a/src/combat/attack-criticality.cpp +++ b/src/combat/attack-criticality.cpp @@ -48,7 +48,7 @@ std::tuple apply_critical_norm_damage(int k, HIT * @param mode オプションフラグ * @return クリティカル修正が入ったダメージ値 */ -HIT_POINT critical_norm(player_type *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, combat_options mode, bool impact) +HIT_POINT critical_norm(PlayerType *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, combat_options mode, bool impact) { /* Extract "blow" power */ int i = (weight + (meichuu * 3 + plus * 5) + player_ptr->skill_thn); @@ -82,7 +82,7 @@ HIT_POINT critical_norm(player_type *player_ptr, WEIGHT weight, int plus, HIT_PO * チェックを通ったら、ユニークならば2倍ダメージ、それ以外は一撃死 * @todo 3つの処理をdetailsに書くよりは関数自体を分割すべきだが、一旦後回しにする。他の項目と一緒に処理する */ -static void ninja_critical(player_type *player_ptr, player_attack_type *pa_ptr) +static void ninja_critical(PlayerType *player_ptr, player_attack_type *pa_ptr) { monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx]; int maxhp = pa_ptr->m_ptr->maxhp; @@ -115,7 +115,7 @@ static void ninja_critical(player_type *player_ptr, player_attack_type *pa_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -void critical_attack(player_type *player_ptr, player_attack_type *pa_ptr) +void critical_attack(PlayerType *player_ptr, player_attack_type *pa_ptr) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx]; diff --git a/src/combat/attack-criticality.h b/src/combat/attack-criticality.h index 1f9f0a8d9..ab0975ca8 100644 --- a/src/combat/attack-criticality.h +++ b/src/combat/attack-criticality.h @@ -7,7 +7,7 @@ #include struct player_attack_type; -struct player_type; +class PlayerType; std::tuple apply_critical_norm_damage(int k, HIT_POINT base_dam); -HIT_POINT critical_norm(player_type *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, combat_options mode, bool impact = false); -void critical_attack(player_type *player_ptr, player_attack_type *pa_ptr); +HIT_POINT critical_norm(PlayerType *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, combat_options mode, bool impact = false); +void critical_attack(PlayerType *player_ptr, player_attack_type *pa_ptr); diff --git a/src/combat/aura-counterattack.cpp b/src/combat/aura-counterattack.cpp index 3c9c9a76f..700334ae3 100644 --- a/src/combat/aura-counterattack.cpp +++ b/src/combat/aura-counterattack.cpp @@ -30,7 +30,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -static void aura_fire_by_monster_attack(player_type *player_ptr, monap_type *monap_ptr) +static void aura_fire_by_monster_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!has_sh_fire(player_ptr) || !monap_ptr->alive || player_ptr->is_dead) return; @@ -53,7 +53,7 @@ static void aura_fire_by_monster_attack(player_type *player_ptr, monap_type *mon } } -static void aura_elec_by_monster_attack(player_type *player_ptr, monap_type *monap_ptr) +static void aura_elec_by_monster_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!has_sh_elec(player_ptr) || !monap_ptr->alive || player_ptr->is_dead) return; @@ -76,7 +76,7 @@ static void aura_elec_by_monster_attack(player_type *player_ptr, monap_type *mon } } -static void aura_cold_by_monster_attack(player_type *player_ptr, monap_type *monap_ptr) +static void aura_cold_by_monster_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!has_sh_cold(player_ptr) || !monap_ptr->alive || player_ptr->is_dead) return; @@ -99,7 +99,7 @@ static void aura_cold_by_monster_attack(player_type *player_ptr, monap_type *mon } } -static void aura_shards_by_monster_attack(player_type *player_ptr, monap_type *monap_ptr) +static void aura_shards_by_monster_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!player_ptr->dustrobe || !monap_ptr->alive || player_ptr->is_dead) return; @@ -123,7 +123,7 @@ static void aura_shards_by_monster_attack(player_type *player_ptr, monap_type *m teleport_player(player_ptr, 10, TELEPORT_SPONTANEOUS); } -static void aura_holy_by_monster_attack(player_type *player_ptr, monap_type *monap_ptr) +static void aura_holy_by_monster_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!player_ptr->tim_sh_holy || !monap_ptr->alive || player_ptr->is_dead) return; @@ -152,7 +152,7 @@ static void aura_holy_by_monster_attack(player_type *player_ptr, monap_type *mon r_ptr->r_flags3 |= RF3_EVIL; } -static void aura_force_by_monster_attack(player_type *player_ptr, monap_type *monap_ptr) +static void aura_force_by_monster_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!player_ptr->tim_sh_touki || !monap_ptr->alive || player_ptr->is_dead) return; @@ -175,7 +175,7 @@ static void aura_force_by_monster_attack(player_type *player_ptr, monap_type *mo } } -static void aura_shadow_by_monster_attack(player_type *player_ptr, monap_type *monap_ptr) +static void aura_shadow_by_monster_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!SpellHex(player_ptr).is_spelling_specific(HEX_SHADOW_CLOAK) || !monap_ptr->alive || player_ptr->is_dead) return; @@ -220,7 +220,7 @@ static void aura_shadow_by_monster_attack(player_type *player_ptr, monap_type *m } } -void process_aura_counterattack(player_type *player_ptr, monap_type *monap_ptr) +void process_aura_counterattack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!monap_ptr->touched) return; diff --git a/src/combat/aura-counterattack.h b/src/combat/aura-counterattack.h index 6da105fb4..4751e1335 100644 --- a/src/combat/aura-counterattack.h +++ b/src/combat/aura-counterattack.h @@ -1,5 +1,5 @@ #pragma once typedef struct monap_type monap_type; -struct player_type; -void process_aura_counterattack(player_type *player_ptr, monap_type *monap_ptr); +class PlayerType; +void process_aura_counterattack(PlayerType *player_ptr, monap_type *monap_ptr); diff --git a/src/combat/shoot.cpp b/src/combat/shoot.cpp index 05884fa0b..9915864d8 100644 --- a/src/combat/shoot.cpp +++ b/src/combat/shoot.cpp @@ -75,7 +75,7 @@ * @param arrow_ptr 矢弾のオブジェクト構造体参照ポインタ * @return スナイパーの射撃属性、弓矢の属性を考慮する。デフォルトはGF_PLAYER_SHOOT。 */ -AttributeFlags shot_attribute(player_type *player_ptr, object_type *bow_ptr, object_type *arrow_ptr, SPELL_IDX snipe_type) +AttributeFlags shot_attribute(PlayerType *player_ptr, object_type *bow_ptr, object_type *arrow_ptr, SPELL_IDX snipe_type) { AttributeFlags attribute_flags{}; attribute_flags.set(AttributeType::PLAYER_SHOOT); @@ -146,7 +146,7 @@ AttributeFlags shot_attribute(player_type *player_ptr, object_type *bow_ptr, obj * @return スレイ倍率をかけたダメージ量 */ static MULTIPLY calc_shot_damage_with_slay( - player_type *player_ptr, object_type *bow_ptr, object_type *arrow_ptr, HIT_POINT tdam, monster_type *monster_ptr, SPELL_IDX snipe_type) + PlayerType *player_ptr, object_type *bow_ptr, object_type *arrow_ptr, HIT_POINT tdam, monster_type *monster_ptr, SPELL_IDX snipe_type) { MULTIPLY mult = 10; @@ -447,7 +447,7 @@ static MULTIPLY calc_shot_damage_with_slay( * Note that Bows of "Extra Shots" give an extra shot. * */ -void exe_fire(player_type *player_ptr, INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type) +void exe_fire(PlayerType *player_ptr, INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type) { DIRECTION dir; int i; @@ -944,7 +944,7 @@ void exe_fire(player_type *player_ptr, INVENTORY_IDX item, object_type *j_ptr, S * @return 命中と判定された場合TRUEを返す * @note Always miss 5%, always hit 5%, otherwise random. */ -bool test_hit_fire(player_type *player_ptr, int chance, monster_type *m_ptr, int vis, char *o_name) +bool test_hit_fire(PlayerType *player_ptr, int chance, monster_type *m_ptr, int vis, char *o_name) { int k; ARMOUR_CLASS ac; @@ -1006,7 +1006,7 @@ bool test_hit_fire(player_type *player_ptr, int chance, monster_type *m_ptr, int * @param dam 現在算出中のダメージ値 * @return クリティカル修正が入ったダメージ値 */ -HIT_POINT critical_shot(player_type *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam) +HIT_POINT critical_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam) { int i, k; object_type *j_ptr = &player_ptr->inventory_list[INVEN_BOW]; @@ -1157,7 +1157,7 @@ int bow_tmul(OBJECT_SUBTYPE_VALUE sval) * @return ダメージ期待値 * @note 基本ダメージ量と重量はこの部位では計算に加わらない。 */ -HIT_POINT calc_crit_ratio_shot(player_type *player_ptr, HIT_POINT plus_ammo, HIT_POINT plus_bow) +HIT_POINT calc_crit_ratio_shot(PlayerType *player_ptr, HIT_POINT plus_ammo, HIT_POINT plus_bow) { HIT_POINT i; object_type *j_ptr = &player_ptr->inventory_list[INVEN_BOW]; @@ -1195,7 +1195,7 @@ HIT_POINT calc_crit_ratio_shot(player_type *player_ptr, HIT_POINT plus_ammo, HIT * @param dam 基本ダメージ量 * @return ダメージ期待値 */ -HIT_POINT calc_expect_crit_shot(player_type *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam) +HIT_POINT calc_expect_crit_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam) { uint32_t num; int i, k, crit; @@ -1238,7 +1238,7 @@ HIT_POINT calc_expect_crit_shot(player_type *player_ptr, WEIGHT weight, int plus * @param impact 強撃かどうか * @return ダメージ期待値 */ -HIT_POINT calc_expect_crit(player_type *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, bool dokubari, bool impact) +HIT_POINT calc_expect_crit(PlayerType *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, bool dokubari, bool impact) { if (dokubari) return dam; diff --git a/src/combat/shoot.h b/src/combat/shoot.h index 0e455faed..3069014d8 100644 --- a/src/combat/shoot.h +++ b/src/combat/shoot.h @@ -4,12 +4,12 @@ struct monster_type; struct object_type; -struct player_type; -bool test_hit_fire(player_type *player_ptr, int chance, monster_type *m_ptr, int vis, char *o_name); -HIT_POINT critical_shot(player_type *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam); +class PlayerType; +bool test_hit_fire(PlayerType *player_ptr, int chance, monster_type *m_ptr, int vis, char *o_name); +HIT_POINT critical_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam); ENERGY bow_energy(OBJECT_SUBTYPE_VALUE sval); int bow_tmul(OBJECT_SUBTYPE_VALUE sval); -HIT_POINT calc_crit_ratio_shot(player_type *player_ptr, HIT_POINT plus_ammo, HIT_POINT plus_bow); -HIT_POINT calc_expect_crit_shot(player_type *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam); -HIT_POINT calc_expect_crit(player_type *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, bool dokubari, bool impact); -void exe_fire(player_type *player_ptr, INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type); +HIT_POINT calc_crit_ratio_shot(PlayerType *player_ptr, HIT_POINT plus_ammo, HIT_POINT plus_bow); +HIT_POINT calc_expect_crit_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam); +HIT_POINT calc_expect_crit(PlayerType *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, bool dokubari, bool impact); +void exe_fire(PlayerType *player_ptr, INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type); diff --git a/src/combat/slaying.cpp b/src/combat/slaying.cpp index 597d371bc..34c441b13 100644 --- a/src/combat/slaying.cpp +++ b/src/combat/slaying.cpp @@ -29,7 +29,7 @@ * @param m_ptr 目標モンスターの構造体参照ポインタ * @return スレイング加味後の倍率(/10倍) */ -MULTIPLY mult_slaying(player_type *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr) +MULTIPLY mult_slaying(PlayerType *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr) { static const struct slay_table_t { tr_type slay_flag; @@ -87,7 +87,7 @@ MULTIPLY mult_slaying(player_type *player_ptr, MULTIPLY mult, const TrFlags &flg * @param m_ptr 目標モンスターの構造体参照ポインタ * @return スレイング加味後の倍率(/10倍) */ -MULTIPLY mult_brand(player_type *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr) +MULTIPLY mult_brand(PlayerType *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr) { static const struct brand_table_t { tr_type brand_flag; @@ -149,7 +149,7 @@ MULTIPLY mult_brand(player_type *player_ptr, MULTIPLY mult, const TrFlags &flgs, * Note that most brands and slays are x3, except Slay Animal (x2),\n * Slay Evil (x2), and Kill dragon (x5).\n */ -HIT_POINT calc_attack_damage_with_slay(player_type *player_ptr, object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, combat_options mode, bool thrown) +HIT_POINT calc_attack_damage_with_slay(PlayerType *player_ptr, object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, combat_options mode, bool thrown) { auto flgs = object_flags(o_ptr); torch_flags(o_ptr, flgs); /* torches has secret flags */ @@ -208,7 +208,7 @@ HIT_POINT calc_attack_damage_with_slay(player_type *player_ptr, object_type *o_p return (tdam * mult / 10); } -AttributeFlags melee_attribute(player_type *player_ptr, object_type *o_ptr, combat_options mode) +AttributeFlags melee_attribute(PlayerType *player_ptr, object_type *o_ptr, combat_options mode) { AttributeFlags attribute_flags{}; attribute_flags.set(AttributeType::PLAYER_MELEE); diff --git a/src/combat/slaying.h b/src/combat/slaying.h index 1708c5dc2..e1f532ee3 100644 --- a/src/combat/slaying.h +++ b/src/combat/slaying.h @@ -8,8 +8,8 @@ struct monster_type; struct object_type; -struct player_type; -MULTIPLY mult_slaying(player_type *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr); -MULTIPLY mult_brand(player_type *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr); -HIT_POINT calc_attack_damage_with_slay(player_type *player_ptr, object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, combat_options mode, bool thrown); -AttributeFlags melee_attribute(player_type *player_ptr, object_type *o_ptr, combat_options mode); +class PlayerType; +MULTIPLY mult_slaying(PlayerType *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr); +MULTIPLY mult_brand(PlayerType *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr); +HIT_POINT calc_attack_damage_with_slay(PlayerType *player_ptr, object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, combat_options mode, bool thrown); +AttributeFlags melee_attribute(PlayerType *player_ptr, object_type *o_ptr, combat_options mode); diff --git a/src/core/asking-player.cpp b/src/core/asking-player.cpp index af30ce25c..149e664ce 100644 --- a/src/core/asking-player.cpp +++ b/src/core/asking-player.cpp @@ -242,7 +242,7 @@ bool get_check(concptr prompt) { return get_check_strict(p_ptr, prompt, 0); } * mode & CHECK_NO_HISTORY : no message_add * mode & CHECK_DEFAULT_Y : accept any key as y, except n and Esc. */ -bool get_check_strict(player_type *player_ptr, concptr prompt, BIT_FLAGS mode) +bool get_check_strict(PlayerType *player_ptr, concptr prompt, BIT_FLAGS mode) { char buf[80]; if (!rogue_like_commands) diff --git a/src/core/asking-player.h b/src/core/asking-player.h index 577d8095a..cf347a1c7 100644 --- a/src/core/asking-player.h +++ b/src/core/asking-player.h @@ -10,12 +10,12 @@ #define CHECK_NO_HISTORY 0x04 #define CHECK_DEFAULT_Y 0x08 -struct player_type; +class PlayerType; bool askfor_aux(char *buf, int len, bool numpad_cursor); bool askfor(char *buf, int len); bool get_string(concptr prompt, char *buf, int len); bool get_check(concptr prompt); -bool get_check_strict(player_type *player_ptr, concptr prompt, BIT_FLAGS mode); +bool get_check_strict(PlayerType *player_ptr, concptr prompt, BIT_FLAGS mode); bool get_com(concptr prompt, char *command, bool z_escape); QUANTITY get_quantity(concptr prompt, QUANTITY max); void pause_line(int row); diff --git a/src/core/disturbance.cpp b/src/core/disturbance.cpp index 0b69e93b2..3b8fc7764 100644 --- a/src/core/disturbance.cpp +++ b/src/core/disturbance.cpp @@ -17,7 +17,7 @@ * The second arg is currently unused, but could induce output flush. * All disturbance cancels repeated commands, resting, and running. */ -void disturb(player_type *player_ptr, bool stop_search, bool stop_travel) +void disturb(PlayerType *player_ptr, bool stop_search, bool stop_travel) { if (command_rep) { command_rep = 0; diff --git a/src/core/disturbance.h b/src/core/disturbance.h index e856508b1..1421e4b1b 100644 --- a/src/core/disturbance.h +++ b/src/core/disturbance.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void disturb(player_type *player_ptr, bool stop_search, bool flush_output); +class PlayerType; +void disturb(PlayerType *player_ptr, bool stop_search, bool flush_output); diff --git a/src/core/game-closer.cpp b/src/core/game-closer.cpp index 3b2418487..2cca64d06 100644 --- a/src/core/game-closer.cpp +++ b/src/core/game-closer.cpp @@ -32,7 +32,7 @@ #include "view/display-scores.h" #include "world/world.h" -static void clear_floor(player_type *player_ptr) +static void clear_floor(PlayerType *player_ptr) { (void)fd_close(highscore_fd); highscore_fd = -1; @@ -40,7 +40,7 @@ static void clear_floor(player_type *player_ptr) signals_handle_tstp(); } -static void send_world_score_on_closing(player_type *player_ptr, bool do_send) +static void send_world_score_on_closing(PlayerType *player_ptr, bool do_send) { if (send_world_score(player_ptr, do_send, display_player)) return; @@ -60,7 +60,7 @@ static void send_world_score_on_closing(player_type *player_ptr, bool do_send) * @param player_ptr プレイヤー構造体参照ポインタ。 * @return 死亡していればTRUE, まだ生きているならば各処理を済ませた上ででFALSE。 */ -static bool check_death(player_type *player_ptr) +static bool check_death(PlayerType *player_ptr) { if (player_ptr->is_dead) return true; @@ -79,7 +79,7 @@ static bool check_death(player_type *player_ptr) * @brief 勝利者用の引退演出処理 / * Change the player into a King! -RAK- */ -static void kingly(player_type *player_ptr) +static void kingly(PlayerType *player_ptr) { bool seppuku = streq(player_ptr->died_from, "Seppuku"); player_ptr->current_floor_ptr->dun_level = 0; @@ -139,7 +139,7 @@ static void kingly(player_type *player_ptr) * This function is called only from "main.c" and "signals.c". * */ -void close_game(player_type *player_ptr) +void close_game(PlayerType *player_ptr) { bool do_send = true; handle_stuff(player_ptr); diff --git a/src/core/game-closer.h b/src/core/game-closer.h index 0a53dbc5d..e6571e68c 100644 --- a/src/core/game-closer.h +++ b/src/core/game-closer.h @@ -7,5 +7,5 @@ * @date 2020/03/09 */ -struct player_type; -void close_game(player_type *player_ptr); +class PlayerType; +void close_game(PlayerType *player_ptr); diff --git a/src/core/game-play.cpp b/src/core/game-play.cpp index 88858e8a6..0bf2229bc 100644 --- a/src/core/game-play.cpp +++ b/src/core/game-play.cpp @@ -94,7 +94,7 @@ #include "wizard/wizard-special-process.h" #include "world/world.h" -static void restore_windows(player_type *player_ptr) +static void restore_windows(PlayerType *player_ptr) { player_ptr->hack_mutation = false; w_ptr->character_icky_depth = 1; @@ -107,7 +107,7 @@ static void restore_windows(player_type *player_ptr) (void)term_set_cursor(0); } -static void send_waiting_record(player_type *player_ptr) +static void send_waiting_record(PlayerType *player_ptr) { if (!player_ptr->wait_report_score) return; @@ -144,7 +144,7 @@ static void send_waiting_record(player_type *player_ptr) quit(0); } -static void init_random_seed(player_type *player_ptr, bool new_game) +static void init_random_seed(PlayerType *player_ptr, bool new_game) { bool init_random_seed = false; if (!w_ptr->character_loaded) { @@ -162,7 +162,7 @@ static void init_random_seed(player_type *player_ptr, bool new_game) Rand_state_init(); } -static void init_world_floor_info(player_type *player_ptr) +static void init_world_floor_info(PlayerType *player_ptr) { w_ptr->character_dungeon = false; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -188,7 +188,7 @@ static void init_world_floor_info(player_type *player_ptr) * 1.0.9 以前はセーブ前に player_ptr->riding = -1 としていたので、再設定が必要だった。 * もう不要だが、以前のセーブファイルとの互換のために残しておく。 */ -static void restore_world_floor_info(player_type *player_ptr) +static void restore_world_floor_info(PlayerType *player_ptr) { write_level = false; exe_write_diary(player_ptr, DIARY_GAMESTART, 1, _(" ----ゲーム再開----", " --- Restarted Game ---")); @@ -205,7 +205,7 @@ static void restore_world_floor_info(player_type *player_ptr) } } -static void reset_world_info(player_type *player_ptr) +static void reset_world_info(PlayerType *player_ptr) { w_ptr->creating_savefile = false; player_ptr->teleport_town = false; @@ -217,7 +217,7 @@ static void reset_world_info(player_type *player_ptr) record_o_name[0] = '\0'; } -static void generate_wilderness(player_type *player_ptr) +static void generate_wilderness(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if ((floor_ptr->dun_level == 0) && floor_ptr->inside_quest) @@ -229,7 +229,7 @@ static void generate_wilderness(player_type *player_ptr) select_floor_music(player_ptr); } -static void change_floor_if_error(player_type *player_ptr) +static void change_floor_if_error(PlayerType *player_ptr) { if (!w_ptr->character_dungeon) { change_floor(player_ptr); @@ -250,7 +250,7 @@ static void change_floor_if_error(player_type *player_ptr) player_ptr->panic_save = 0; } -static void generate_world(player_type *player_ptr, bool new_game) +static void generate_world(PlayerType *player_ptr, bool new_game) { reset_world_info(player_ptr); floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -283,7 +283,7 @@ static void generate_world(player_type *player_ptr, bool new_game) exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, buf); } -static void init_io(player_type *player_ptr) +static void init_io(PlayerType *player_ptr) { term_xtra(TERM_XTRA_REACT, 0); player_ptr->window_flags = PW_ALL; @@ -295,7 +295,7 @@ static void init_io(player_type *player_ptr) rogue_like_commands = true; } -static void init_riding_pet(player_type *player_ptr, bool new_game) +static void init_riding_pet(PlayerType *player_ptr, bool new_game) { if (!new_game || ((player_ptr->pclass != PlayerClassType::CAVALRY) && (player_ptr->pclass != PlayerClassType::BEASTMASTER))) return; @@ -312,7 +312,7 @@ static void init_riding_pet(player_type *player_ptr, bool new_game) m_ptr->energy_need = ENERGY_NEED() + ENERGY_NEED(); } -static void decide_arena_death(player_type *player_ptr) +static void decide_arena_death(PlayerType *player_ptr) { if (!player_ptr->playing || !player_ptr->is_dead) return; @@ -341,7 +341,7 @@ static void decide_arena_death(player_type *player_ptr) leave_floor(player_ptr); } -static void process_game_turn(player_type *player_ptr) +static void process_game_turn(PlayerType *player_ptr) { bool load_game = true; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -382,7 +382,7 @@ static void process_game_turn(player_type *player_ptr) * savefile, we will commit suicide, if necessary, to allow the * player to start a new game. */ -void play_game(player_type *player_ptr, bool new_game, bool browsing_movie) +void play_game(PlayerType *player_ptr, bool new_game, bool browsing_movie) { if (browsing_movie) { reset_visuals(player_ptr); diff --git a/src/core/game-play.h b/src/core/game-play.h index 844dd61b3..738ff8777 100644 --- a/src/core/game-play.h +++ b/src/core/game-play.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void play_game(player_type *player_ptr, bool new_game, bool browsing_movie); +class PlayerType; +void play_game(PlayerType *player_ptr, bool new_game, bool browsing_movie); diff --git a/src/core/magic-effects-timeout-reducer.cpp b/src/core/magic-effects-timeout-reducer.cpp index 815365c21..c50931b15 100644 --- a/src/core/magic-effects-timeout-reducer.cpp +++ b/src/core/magic-effects-timeout-reducer.cpp @@ -25,7 +25,7 @@ * @brief 10ゲームターンが進行するごとに魔法効果の残りターンを減らしていく処理 * / Handle timeout every 10 game turns */ -void reduce_magic_effects_timeout(player_type *player_ptr) +void reduce_magic_effects_timeout(PlayerType *player_ptr) { if (player_ptr->tim_mimic) { (void)set_mimic(player_ptr, player_ptr->tim_mimic - 1, player_ptr->mimic_form, true); diff --git a/src/core/magic-effects-timeout-reducer.h b/src/core/magic-effects-timeout-reducer.h index ff1df7cdc..2ab31b68b 100644 --- a/src/core/magic-effects-timeout-reducer.h +++ b/src/core/magic-effects-timeout-reducer.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void reduce_magic_effects_timeout(player_type *player_ptr); +class PlayerType; +void reduce_magic_effects_timeout(PlayerType *player_ptr); diff --git a/src/core/object-compressor.cpp b/src/core/object-compressor.cpp index 831319466..5b2a59824 100644 --- a/src/core/object-compressor.cpp +++ b/src/core/object-compressor.cpp @@ -51,7 +51,7 @@ static void compact_objects_aux(floor_type *floor_ptr, OBJECT_IDX i1, OBJECT_IDX * After "compacting" (if needed), we "reorder" the objects into a more\n * compact order, and we reset the allocation info, and the "live" array.\n */ -void compact_objects(player_type *player_ptr, int size) +void compact_objects(PlayerType *player_ptr, int size) { object_type *o_ptr; if (size) { diff --git a/src/core/object-compressor.h b/src/core/object-compressor.h index 1e4bb9e91..cd9e6fb3d 100644 --- a/src/core/object-compressor.h +++ b/src/core/object-compressor.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void compact_objects(player_type *player_ptr, int size); +class PlayerType; +void compact_objects(PlayerType *player_ptr, int size); diff --git a/src/core/player-processor.cpp b/src/core/player-processor.cpp index 5138d25a4..7d2f72979 100644 --- a/src/core/player-processor.cpp +++ b/src/core/player-processor.cpp @@ -67,7 +67,7 @@ bool load = true; bool can_save = false; -static void process_fishing(player_type *player_ptr) +static void process_fishing(PlayerType *player_ptr) { term_xtra(TERM_XTRA_DELAY, 10); if (one_in_(1000)) { @@ -99,7 +99,7 @@ static void process_fishing(player_type *player_ptr) } } -bool continuous_action_running(player_type *player_ptr) +bool continuous_action_running(PlayerType *player_ptr) { return player_ptr->running || travel.run || command_rep || (player_ptr->action == ACTION_REST) || (player_ptr->action == ACTION_FISH); } @@ -111,7 +111,7 @@ bool continuous_action_running(player_type *player_ptr) * must come first just in case somebody manages to corrupt\n * the savefiles by clever use of menu commands or something.\n */ -void process_player(player_type *player_ptr) +void process_player(PlayerType *player_ptr) { if (player_ptr->hack_mutation) { msg_print(_("何か変わった気がする!", "You feel different!")); @@ -421,7 +421,7 @@ void process_player(player_type *player_ptr) /*! * @brief プレイヤーの行動エネルギーが充填される(=プレイヤーのターンが回る)毎に行われる処理 / process the effects per 100 energy at player speed. */ -void process_upkeep_with_speed(player_type *player_ptr) +void process_upkeep_with_speed(PlayerType *player_ptr) { if (!load && player_ptr->enchant_energy_need > 0 && !player_ptr->leaving) { player_ptr->enchant_energy_need -= SPEED_TO_ENERGY(player_ptr->pspeed); diff --git a/src/core/player-processor.h b/src/core/player-processor.h index f5d4966c1..e6c209d87 100644 --- a/src/core/player-processor.h +++ b/src/core/player-processor.h @@ -3,7 +3,7 @@ extern bool load; /*!<ロード処理中の分岐フラグ*/ extern bool can_save; -struct player_type; -bool continuous_action_running(player_type *player_ptr); -void process_player(player_type *player_ptr); -void process_upkeep_with_speed(player_type *player_ptr); +class PlayerType; +bool continuous_action_running(PlayerType *player_ptr); +void process_player(PlayerType *player_ptr); +void process_upkeep_with_speed(PlayerType *player_ptr); diff --git a/src/core/scores.cpp b/src/core/scores.cpp index 7176cced9..e493649a2 100644 --- a/src/core/scores.cpp +++ b/src/core/scores.cpp @@ -133,7 +133,7 @@ static int highscore_add(high_score *score) * @param do_send 実際に転送ア処置を行うか否か * @return 転送が成功したらTRUEを返す */ -bool send_world_score(player_type *current_player_ptr, bool do_send, display_player_pf display_player) +bool send_world_score(PlayerType *current_player_ptr, bool do_send, display_player_pf display_player) { #ifdef WORLD_SCORE if (!send_score || !do_send) { @@ -175,7 +175,7 @@ bool send_world_score(player_type *current_player_ptr, bool do_send, display_pla * @details * Assumes "signals_ignore_tstp()" has been called. */ -errr top_twenty(player_type *current_player_ptr) +errr top_twenty(PlayerType *current_player_ptr) { high_score the_score = {}; char buf[32]; @@ -276,7 +276,7 @@ errr top_twenty(player_type *current_player_ptr) * Predict the players location, and display it. * @return エラーコード */ -errr predict_score(player_type *current_player_ptr) +errr predict_score(PlayerType *current_player_ptr) { high_score the_score; char buf[32]; @@ -343,7 +343,7 @@ errr predict_score(player_type *current_player_ptr) * @brief スコアランキングの簡易表示 / * show_highclass - selectively list highscores based on class -KMW- */ -void show_highclass(player_type *current_player_ptr) +void show_highclass(PlayerType *current_player_ptr) { screen_save(); char buf[1024], out_val[256]; @@ -412,7 +412,7 @@ void show_highclass(player_type *current_player_ptr) * Race Legends -KMW- * @param race_num 種族ID */ -void race_score(player_type *current_player_ptr, int race_num) +void race_score(PlayerType *current_player_ptr, int race_num) { int i = 0, j, m = 0; int pr, clev, lastlev; @@ -487,7 +487,7 @@ void race_score(player_type *current_player_ptr, int race_num) * @brief スコアランキングの簡易表示(種族毎)メインルーチン / * Race Legends -KMW- */ -void race_legends(player_type *current_player_ptr) +void race_legends(PlayerType *current_player_ptr) { for (int i = 0; i < MAX_RACES; i++) { race_score(current_player_ptr, i); @@ -502,7 +502,7 @@ void race_legends(player_type *current_player_ptr) * @brief スコアファイル出力 * Display some character info */ -bool check_score(player_type *current_player_ptr) +bool check_score(PlayerType *current_player_ptr) { term_clear(); diff --git a/src/core/scores.h b/src/core/scores.h index c81396cfd..bde11b416 100644 --- a/src/core/scores.h +++ b/src/core/scores.h @@ -3,11 +3,11 @@ #include "io/files-util.h" #include "system/angband.h" -struct player_type; -bool send_world_score(player_type *current_player_ptr, bool do_send, display_player_pf display_player); -errr top_twenty(player_type *current_player_ptr); -errr predict_score(player_type *current_player_ptr); -void race_legends(player_type *current_player_ptr); -void race_score(player_type *current_player_ptr, int race_num); -void show_highclass(player_type *current_player_ptr); -bool check_score(player_type *current_player_ptr); +class PlayerType; +bool send_world_score(PlayerType *current_player_ptr, bool do_send, display_player_pf display_player); +errr top_twenty(PlayerType *current_player_ptr); +errr predict_score(PlayerType *current_player_ptr); +void race_legends(PlayerType *current_player_ptr); +void race_score(PlayerType *current_player_ptr, int race_num); +void show_highclass(PlayerType *current_player_ptr); +bool check_score(PlayerType *current_player_ptr); diff --git a/src/core/show-file.cpp b/src/core/show-file.cpp index 89ec4a2ce..00aa34fae 100644 --- a/src/core/show-file.cpp +++ b/src/core/show-file.cpp @@ -125,7 +125,7 @@ static void show_file_aux_line(concptr str, int cy, concptr shower) * * @todo 表示とそれ以外を分割する */ -bool show_file(player_type *player_ptr, bool show_version, concptr name, concptr what, int line, BIT_FLAGS mode) +bool show_file(PlayerType *player_ptr, bool show_version, concptr name, concptr what, int line, BIT_FLAGS mode) { int wid, hgt; term_get_size(&wid, &hgt); diff --git a/src/core/show-file.h b/src/core/show-file.h index 73319b1a0..682a56b5c 100644 --- a/src/core/show-file.h +++ b/src/core/show-file.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -bool show_file(player_type *player_ptr, bool show_version, concptr name, concptr what, int line, BIT_FLAGS mode); +class PlayerType; +bool show_file(PlayerType *player_ptr, bool show_version, concptr name, concptr what, int line, BIT_FLAGS mode); void str_tolower(char *str); diff --git a/src/core/stuff-handler.cpp b/src/core/stuff-handler.cpp index f1b07d606..3bb68793b 100644 --- a/src/core/stuff-handler.cpp +++ b/src/core/stuff-handler.cpp @@ -9,7 +9,7 @@ * @brief 全更新処理をチェックして処理していく * Handle "player_ptr->update" and "player_ptr->redraw" and "player_ptr->window" */ -void handle_stuff(player_type* player_ptr) +void handle_stuff(PlayerType* player_ptr) { if (player_ptr->update) update_creature(player_ptr); @@ -22,7 +22,7 @@ void handle_stuff(player_type* player_ptr) /* * Track the given monster race */ -void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx) +void monster_race_track(PlayerType *player_ptr, MONRACE_IDX r_idx) { player_ptr->monster_race_idx = r_idx; player_ptr->window_flags |= (PW_MONSTER); @@ -31,7 +31,7 @@ void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx) /* * Track the given object kind */ -void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx) +void object_kind_track(PlayerType *player_ptr, KIND_OBJECT_IDX k_idx) { player_ptr->object_kind_idx = k_idx; player_ptr->window_flags |= (PW_OBJECT); @@ -43,7 +43,7 @@ void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx) * @param m_idx トラッキング対象のモンスターID。0の時キャンセル * @param なし */ -void health_track(player_type *player_ptr, MONSTER_IDX m_idx) +void health_track(PlayerType *player_ptr, MONSTER_IDX m_idx) { if (m_idx && m_idx == player_ptr->riding) return; @@ -52,14 +52,14 @@ void health_track(player_type *player_ptr, MONSTER_IDX m_idx) player_ptr->redraw |= (PR_HEALTH); } -bool update_player(player_type *player_ptr) +bool update_player(PlayerType *player_ptr) { player_ptr->update |= PU_COMBINE | PU_REORDER; player_ptr->window_flags |= PW_INVEN; return true; } -bool redraw_player(player_type *player_ptr) +bool redraw_player(PlayerType *player_ptr) { if (player_ptr->csp > player_ptr->msp) { player_ptr->csp = player_ptr->msp; diff --git a/src/core/stuff-handler.h b/src/core/stuff-handler.h index eab42fcce..6ba5109a8 100644 --- a/src/core/stuff-handler.h +++ b/src/core/stuff-handler.h @@ -2,11 +2,11 @@ #include "system/angband.h" -struct player_type; -void handle_stuff(player_type *player_ptr); -void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx); -void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx); -void health_track(player_type *player_ptr, MONSTER_IDX m_idx); +class PlayerType; +void handle_stuff(PlayerType *player_ptr); +void monster_race_track(PlayerType *player_ptr, MONRACE_IDX r_idx); +void object_kind_track(PlayerType *player_ptr, KIND_OBJECT_IDX k_idx); +void health_track(PlayerType *player_ptr, MONSTER_IDX m_idx); -bool update_player(player_type *player_ptr); -bool redraw_player(player_type *player_ptr); +bool update_player(PlayerType *player_ptr); +bool redraw_player(PlayerType *player_ptr); diff --git a/src/core/turn-compensator.cpp b/src/core/turn-compensator.cpp index ba27e653f..36624e54f 100644 --- a/src/core/turn-compensator.cpp +++ b/src/core/turn-compensator.cpp @@ -14,7 +14,7 @@ * @details アンデッド種族は18:00からゲームを開始するので、この修正を予め行う。 * @return 修正をかけた後のゲームターン */ -int32_t turn_real(player_type *player_ptr, int32_t hoge) +int32_t turn_real(PlayerType *player_ptr, int32_t hoge) { switch (player_ptr->start_race) { case PlayerRaceType::VAMPIRE: @@ -33,7 +33,7 @@ int32_t turn_real(player_type *player_ptr, int32_t hoge) * @details ターン及びターンを記録する変数をターンの限界の1日前まで巻き戻す. * @return 修正をかけた後のゲームターン */ -void prevent_turn_overflow(player_type *player_ptr) +void prevent_turn_overflow(PlayerType *player_ptr) { if (w_ptr->game_turn < w_ptr->game_turn_limit) return; diff --git a/src/core/turn-compensator.h b/src/core/turn-compensator.h index d7ed844e8..8e233e35d 100644 --- a/src/core/turn-compensator.h +++ b/src/core/turn-compensator.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -int32_t turn_real(player_type *player_ptr, int32_t hoge); -void prevent_turn_overflow(player_type* player_ptr); +class PlayerType; +int32_t turn_real(PlayerType *player_ptr, int32_t hoge); +void prevent_turn_overflow(PlayerType* player_ptr); diff --git a/src/core/visuals-reseter.cpp b/src/core/visuals-reseter.cpp index 8606f878a..63aeed965 100644 --- a/src/core/visuals-reseter.cpp +++ b/src/core/visuals-reseter.cpp @@ -11,7 +11,7 @@ * @brief オブジェクト、地形の表示シンボルなど初期化する / Reset the "visual" lists * @param player_ptr プレイヤーへの参照ポインタ */ -void reset_visuals(player_type *player_ptr) +void reset_visuals(PlayerType *player_ptr) { for (auto &f_ref : f_info) { for (int j = 0; j < F_LIT_MAX; j++) { diff --git a/src/core/visuals-reseter.h b/src/core/visuals-reseter.h index f75c1037b..385f2a7d9 100644 --- a/src/core/visuals-reseter.h +++ b/src/core/visuals-reseter.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void reset_visuals(player_type *player_ptr); +class PlayerType; +void reset_visuals(PlayerType *player_ptr); diff --git a/src/core/window-redrawer.cpp b/src/core/window-redrawer.cpp index a2f4b22af..c2cbc6313 100644 --- a/src/core/window-redrawer.cpp +++ b/src/core/window-redrawer.cpp @@ -29,7 +29,7 @@ /*! * @brief コンソールを再描画する / * Redraw a term when it is resized - * @todo ここにplayer_type を追加するとz-termに影響が行くので保留 + * @todo ここにPlayerType を追加するとz-termに影響が行くので保留 */ void redraw_window(void) { @@ -46,7 +46,7 @@ void redraw_window(void) * @brief 現在のマップ名を描画する / Print dungeon * @param player_ptr プレイヤーへの参照ポインタ */ -static void print_dungeon(player_type *player_ptr) +static void print_dungeon(PlayerType *player_ptr) { c_put_str(TERM_WHITE, " ", ROW_DUNGEON, COL_DUNGEON); concptr dungeon_name = map_name(player_ptr); @@ -61,7 +61,7 @@ static void print_dungeon(player_type *player_ptr) * @brief redraw のフラグに応じた更新をまとめて行う / Handle "redraw" * @details 更新処理の対象はゲーム中の全描画処理 */ -void redraw_stuff(player_type *player_ptr) +void redraw_stuff(PlayerType *player_ptr) { if (!player_ptr->redraw) return; @@ -222,7 +222,7 @@ void redraw_stuff(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @details 更新処理の対象はサブウィンドウ全般 */ -void window_stuff(player_type *player_ptr) +void window_stuff(PlayerType *player_ptr) { if (!player_ptr->window_flags) return; diff --git a/src/core/window-redrawer.h b/src/core/window-redrawer.h index f5358d208..aed06cb57 100644 --- a/src/core/window-redrawer.h +++ b/src/core/window-redrawer.h @@ -24,7 +24,7 @@ enum window_redraw_type { }; // clang-format on -struct player_type; +class PlayerType; void redraw_window(void); -void window_stuff(player_type *player_ptr); -void redraw_stuff(player_type *player_ptr); +void window_stuff(PlayerType *player_ptr); +void redraw_stuff(PlayerType *player_ptr); diff --git a/src/dungeon/dungeon-processor.cpp b/src/dungeon/dungeon-processor.cpp index f645ecb56..ed315fd34 100644 --- a/src/dungeon/dungeon-processor.cpp +++ b/src/dungeon/dungeon-processor.cpp @@ -56,7 +56,7 @@ * the user dies, or the game is terminated.\n *

*/ -void process_dungeon(player_type *player_ptr, bool load_game) +void process_dungeon(PlayerType *player_ptr, bool load_game) { floor_type *floor_ptr = player_ptr->current_floor_ptr; floor_ptr->base_level = floor_ptr->dun_level; diff --git a/src/dungeon/dungeon-processor.h b/src/dungeon/dungeon-processor.h index 737c3fd28..83fbdcb2f 100644 --- a/src/dungeon/dungeon-processor.h +++ b/src/dungeon/dungeon-processor.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void process_dungeon(player_type *player_ptr, bool load_game); +class PlayerType; +void process_dungeon(PlayerType *player_ptr, bool load_game); diff --git a/src/dungeon/dungeon.cpp b/src/dungeon/dungeon.cpp index 81621d065..5848de1e0 100644 --- a/src/dungeon/dungeon.cpp +++ b/src/dungeon/dungeon.cpp @@ -93,7 +93,7 @@ DUNGEON_IDX choose_dungeon(concptr note, POSITION y, POSITION x) * @brief プレイヤーが現在ダンジョンに潜っているかどうかを返す。 * @memo 現在はdun_levelが0でないかそうでないかに限るが可読性を高めるため。 */ -bool is_in_dungeon(player_type *player_ptr) +bool is_in_dungeon(PlayerType *player_ptr) { return player_ptr->current_floor_ptr->dun_level > 0; } diff --git a/src/dungeon/dungeon.h b/src/dungeon/dungeon.h index 0b0019f67..fdc108b7d 100644 --- a/src/dungeon/dungeon.h +++ b/src/dungeon/dungeon.h @@ -89,6 +89,6 @@ typedef struct dungeon_type { extern std::vector max_dlv; extern std::vector d_info; -struct player_type; +class PlayerType; DUNGEON_IDX choose_dungeon(concptr note, POSITION y, POSITION x); -bool is_in_dungeon(player_type *player_ptr); +bool is_in_dungeon(PlayerType *player_ptr); diff --git a/src/dungeon/quest-completion-checker.cpp b/src/dungeon/quest-completion-checker.cpp index 4b744c616..f4abdd653 100644 --- a/src/dungeon/quest-completion-checker.cpp +++ b/src/dungeon/quest-completion-checker.cpp @@ -21,7 +21,7 @@ #include "util/bit-flags-calculator.h" #include "view/display-messages.h" -QuestCompletionChecker::QuestCompletionChecker(player_type *player_ptr, monster_type *m_ptr) +QuestCompletionChecker::QuestCompletionChecker(PlayerType *player_ptr, monster_type *m_ptr) : player_ptr(player_ptr) , m_ptr(m_ptr) { diff --git a/src/dungeon/quest-completion-checker.h b/src/dungeon/quest-completion-checker.h index 40ad90a78..fc35ae588 100644 --- a/src/dungeon/quest-completion-checker.h +++ b/src/dungeon/quest-completion-checker.h @@ -6,17 +6,17 @@ struct monster_type; struct object_type; -struct player_type; +class PlayerType; struct quest_type; class QuestCompletionChecker { public: - QuestCompletionChecker(player_type *player_ptr, monster_type *m_ptr); + QuestCompletionChecker(PlayerType *player_ptr, monster_type *m_ptr); virtual ~QuestCompletionChecker() = default; void complete(); private: - player_type *player_ptr; + PlayerType *player_ptr; monster_type *m_ptr; short quest_idx; quest_type *q_ptr = nullptr; diff --git a/src/dungeon/quest-monster-placer.cpp b/src/dungeon/quest-monster-placer.cpp index 541cf70af..f85bd395a 100644 --- a/src/dungeon/quest-monster-placer.cpp +++ b/src/dungeon/quest-monster-placer.cpp @@ -19,7 +19,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 成功したならばTRUEを返す */ -bool place_quest_monsters(player_type *player_ptr) +bool place_quest_monsters(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (int i = 0; i < max_q_idx; i++) { diff --git a/src/dungeon/quest-monster-placer.h b/src/dungeon/quest-monster-placer.h index c13b19709..0241423b6 100644 --- a/src/dungeon/quest-monster-placer.h +++ b/src/dungeon/quest-monster-placer.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool place_quest_monsters(player_type *player_ptr); +class PlayerType; +bool place_quest_monsters(PlayerType *player_ptr); diff --git a/src/dungeon/quest.cpp b/src/dungeon/quest.cpp index 95b311194..7fdf85702 100644 --- a/src/dungeon/quest.cpp +++ b/src/dungeon/quest.cpp @@ -67,7 +67,7 @@ bool quest_type::is_fixed(short quest_idx) * @brief ランダムクエストの討伐ユニークを決める / Determine the random quest uniques * @param q_ptr クエスト構造体の参照ポインタ */ -void determine_random_questor(player_type *player_ptr, quest_type *q_ptr) +void determine_random_questor(PlayerType *player_ptr, quest_type *q_ptr) { get_mon_num_prep(player_ptr, mon_hook_quest, nullptr); @@ -111,7 +111,7 @@ void determine_random_questor(player_type *player_ptr, quest_type *q_ptr) /*! * @brief クエストの最終状態を記録する(成功or失敗、時間) - * @param player_type プレイヤー情報への参照ポインタ + * @param PlayerType プレイヤー情報への参照ポインタ * @param q_ptr クエスト情報への参照ポインタ * @param stat ステータス(成功or失敗) */ @@ -128,7 +128,7 @@ void record_quest_final_status(quest_type *q_ptr, PLAYER_LEVEL lev, QuestStatusT * @param player_ptr プレイヤーへの参照ポインタ * @param quest_num 達成状態にしたいクエストのID */ -void complete_quest(player_type *player_ptr, QUEST_IDX quest_num) +void complete_quest(PlayerType *player_ptr, QUEST_IDX quest_num) { quest_type *const q_ptr = &quest[quest_num]; @@ -159,7 +159,7 @@ void complete_quest(player_type *player_ptr, QUEST_IDX quest_num) * @param player_ptr プレイヤーへの参照ポインタ * @param o_ptr 入手したオブジェクトの構造体参照ポインタ */ -void check_find_art_quest_completion(player_type *player_ptr, object_type *o_ptr) +void check_find_art_quest_completion(PlayerType *player_ptr, object_type *o_ptr) { /* Check if completed a quest */ for (QUEST_IDX i = 0; i < max_q_idx; i++) { @@ -215,7 +215,7 @@ void quest_discovery(QUEST_IDX q_idx) * @param level 検索対象になる階 * @return クエストIDを返す。該当がない場合0を返す。 */ -QUEST_IDX quest_number(player_type *player_ptr, DEPTH level) +QUEST_IDX quest_number(PlayerType *player_ptr, DEPTH level) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (floor_ptr->inside_quest) @@ -239,7 +239,7 @@ QUEST_IDX quest_number(player_type *player_ptr, DEPTH level) * @param level 検索対象になる階 * @return クエストIDを返す。該当がない場合0を返す。 */ -QUEST_IDX random_quest_number(player_type *player_ptr, DEPTH level) +QUEST_IDX random_quest_number(PlayerType *player_ptr, DEPTH level) { if (player_ptr->dungeon_idx != DUNGEON_ANGBAND) return 0; @@ -258,7 +258,7 @@ QUEST_IDX random_quest_number(player_type *player_ptr, DEPTH level) * @brief クエスト階層から離脱する際の処理 * @param player_ptr プレイヤーへの参照ポインタ */ -void leave_quest_check(player_type *player_ptr) +void leave_quest_check(PlayerType *player_ptr) { leaving_quest = player_ptr->current_floor_ptr->inside_quest; if (!leaving_quest) @@ -302,7 +302,7 @@ void leave_quest_check(player_type *player_ptr) /*! * @brief 「塔」クエストの各階層から離脱する際の処理 */ -void leave_tower_check(player_type *player_ptr) +void leave_tower_check(PlayerType *player_ptr) { leaving_quest = player_ptr->current_floor_ptr->inside_quest; bool is_leaving_from_tower = leaving_quest != 0; @@ -322,7 +322,7 @@ void leave_tower_check(player_type *player_ptr) /*! * @brief Player enters a new quest */ -void exe_enter_quest(player_type *player_ptr, QUEST_IDX quest_idx) +void exe_enter_quest(PlayerType *player_ptr, QUEST_IDX quest_idx) { if (quest[quest_idx].type != QuestKindType::RANDOM) player_ptr->current_floor_ptr->dun_level = 1; @@ -335,7 +335,7 @@ void exe_enter_quest(player_type *player_ptr, QUEST_IDX quest_idx) * @brief クエスト入り口にプレイヤーが乗った際の処理 / Do building commands * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_quest(player_type *player_ptr) +void do_cmd_quest(PlayerType *player_ptr) { if (player_ptr->wild_mode) return; diff --git a/src/dungeon/quest.h b/src/dungeon/quest.h index 66edc8de8..01f968954 100644 --- a/src/dungeon/quest.h +++ b/src/dungeon/quest.h @@ -84,15 +84,15 @@ extern int quest_text_line; extern int leaving_quest; struct object_type; -struct player_type; -void determine_random_questor(player_type *player_ptr, quest_type *q_ptr); +class PlayerType; +void determine_random_questor(PlayerType *player_ptr, quest_type *q_ptr); void record_quest_final_status(quest_type *q_ptr, PLAYER_LEVEL lev, QuestStatusType stat); -void complete_quest(player_type *player_ptr, QUEST_IDX quest_num); -void check_find_art_quest_completion(player_type *player_ptr, object_type *o_ptr); +void complete_quest(PlayerType *player_ptr, QUEST_IDX quest_num); +void check_find_art_quest_completion(PlayerType *player_ptr, object_type *o_ptr); void quest_discovery(QUEST_IDX q_idx); -QUEST_IDX quest_number(player_type *player_ptr, DEPTH level); -QUEST_IDX random_quest_number(player_type *player_ptr, DEPTH level); -void leave_quest_check(player_type *player_ptr); -void leave_tower_check(player_type *player_ptr); -void exe_enter_quest(player_type *player_ptr, QUEST_IDX quest_idx); -void do_cmd_quest(player_type *player_ptr); +QUEST_IDX quest_number(PlayerType *player_ptr, DEPTH level); +QUEST_IDX random_quest_number(PlayerType *player_ptr, DEPTH level); +void leave_quest_check(PlayerType *player_ptr); +void leave_tower_check(PlayerType *player_ptr); +void exe_enter_quest(PlayerType *player_ptr, QUEST_IDX quest_idx); +void do_cmd_quest(PlayerType *player_ptr); diff --git a/src/effect/effect-feature.cpp b/src/effect/effect-feature.cpp index 506581108..8ee664dc8 100644 --- a/src/effect/effect-feature.cpp +++ b/src/effect/effect-feature.cpp @@ -31,7 +31,7 @@ * Line 2 -- forbid monsters * Line 3 -- forbid the player */ -static bool cave_naked_bold(player_type *player_ptr, POSITION y, POSITION x) +static bool cave_naked_bold(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; return cave_clean_bold(floor_ptr, y, x) && (floor_ptr->grid_array[y][x].m_idx == 0) && !player_bold(player_ptr, y, x); @@ -63,7 +63,7 @@ static bool cave_naked_bold(player_type *player_ptr, POSITION y, POSITION x) * Perhaps we should affect doors? * */ -bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ) +bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; diff --git a/src/effect/effect-feature.h b/src/effect/effect-feature.h index 05fdb1d96..9aab52015 100644 --- a/src/effect/effect-feature.h +++ b/src/effect/effect-feature.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "effect/attribute-types.h" -struct player_type; -bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ); +class PlayerType; +bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ); diff --git a/src/effect/effect-item.cpp b/src/effect/effect-item.cpp index b1f29257d..1b7d57459 100644 --- a/src/effect/effect-item.cpp +++ b/src/effect/effect-item.cpp @@ -39,7 +39,7 @@ * @param typ 効果属性 / Type of damage to apply to monsters (and objects) * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE */ -bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ) +bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; diff --git a/src/effect/effect-item.h b/src/effect/effect-item.h index 298a1a932..9ed643cc1 100644 --- a/src/effect/effect-item.h +++ b/src/effect/effect-item.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "effect/attribute-types.h" -struct player_type; -bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ); +class PlayerType; +bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ); diff --git a/src/effect/effect-monster-charm.cpp b/src/effect/effect-monster-charm.cpp index 121a741c6..e660b3898 100644 --- a/src/effect/effect-monster-charm.cpp +++ b/src/effect/effect-monster-charm.cpp @@ -29,7 +29,7 @@ #include "util/bit-flags-calculator.h" #include "view/display-messages.h" -static void effect_monster_charm_resist(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_charm_resist(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (common_saving_throw_charm(player_ptr, em_ptr->dam, em_ptr->m_ptr)) { em_ptr->note = _("には効果がなかった。", " is unaffected."); @@ -51,7 +51,7 @@ static void effect_monster_charm_resist(player_type *player_ptr, effect_monster_ } } -process_result effect_monster_charm(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_charm(PlayerType *player_ptr, effect_monster_type *em_ptr) { int vir = virtue_number(player_ptr, V_HARMONY); if (vir) { @@ -71,7 +71,7 @@ process_result effect_monster_charm(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_control_undead(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_control_undead(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -104,7 +104,7 @@ process_result effect_monster_control_undead(player_type *player_ptr, effect_mon return PROCESS_CONTINUE; } -process_result effect_monster_control_demon(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_control_demon(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -137,7 +137,7 @@ process_result effect_monster_control_demon(player_type *player_ptr, effect_mons return PROCESS_CONTINUE; } -process_result effect_monster_control_animal(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_control_animal(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -172,7 +172,7 @@ process_result effect_monster_control_animal(player_type *player_ptr, effect_mon return PROCESS_CONTINUE; } -process_result effect_monster_charm_living(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_charm_living(PlayerType *player_ptr, effect_monster_type *em_ptr) { int vir = virtue_number(player_ptr, V_UNLIFE); if (em_ptr->seen) @@ -210,7 +210,7 @@ process_result effect_monster_charm_living(player_type *player_ptr, effect_monst return PROCESS_CONTINUE; } -static void effect_monster_domination_corrupted_addition(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_domination_corrupted_addition(PlayerType *player_ptr, effect_monster_type *em_ptr) { BadStatusSetter bss(player_ptr); switch (randint1(4)) { @@ -232,7 +232,7 @@ static void effect_monster_domination_corrupted_addition(player_type *player_ptr } // Powerful demons & undead can turn a mindcrafter's attacks back on them. -static void effect_monster_domination_corrupted(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_domination_corrupted(PlayerType *player_ptr, effect_monster_type *em_ptr) { bool is_corrupted = ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) != 0) && (em_ptr->r_ptr->level > player_ptr->lev / 2) && (one_in_(2)); if (!is_corrupted) { @@ -267,7 +267,7 @@ static void effect_monster_domination_addition(effect_monster_type *em_ptr) } } -process_result effect_monster_domination(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_domination(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!is_hostile(em_ptr->m_ptr)) return PROCESS_CONTINUE; @@ -298,7 +298,7 @@ process_result effect_monster_domination(player_type *player_ptr, effect_monster return PROCESS_CONTINUE; } -static bool effect_monster_crusade_domination(player_type *player_ptr, effect_monster_type *em_ptr) +static bool effect_monster_crusade_domination(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (((em_ptr->r_ptr->flags3 & RF3_GOOD) == 0) || player_ptr->current_floor_ptr->inside_arena) return false; @@ -331,7 +331,7 @@ static bool effect_monster_crusade_domination(player_type *player_ptr, effect_mo return true; } -process_result effect_monster_crusade(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_crusade(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -357,7 +357,7 @@ process_result effect_monster_crusade(player_type *player_ptr, effect_monster_ty * @param hp 計算対象のHP * @return 捕まえられる最大HP */ -static HIT_POINT calcutate_capturable_hp(player_type *player_ptr, monster_type *m_ptr, HIT_POINT hp) +static HIT_POINT calcutate_capturable_hp(PlayerType *player_ptr, monster_type *m_ptr, HIT_POINT hp) { if (is_pet(m_ptr)) return hp * 4L; @@ -373,7 +373,7 @@ static HIT_POINT calcutate_capturable_hp(player_type *player_ptr, monster_type * * @param player_ptr プレイヤー情報への参照ポインタ * @param em_ptr 効果情報への参照ポインタ */ -static void effect_monster_captured(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_captured(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->m_ptr->mflag2.has(MonsterConstantFlagType::CHAMELEON)) choose_new_monster(player_ptr, em_ptr->g_ptr->m_idx, false, MON_CHAMELEON); @@ -397,7 +397,7 @@ static void effect_monster_captured(player_type *player_ptr, effect_monster_type * @param em_ptr 効果情報への参照ポインタ * @return 効果発動結果 */ -process_result effect_monster_capture(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_capture(PlayerType *player_ptr, effect_monster_type *em_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if ((floor_ptr->inside_quest && (quest[floor_ptr->inside_quest].type == QuestKindType::KILL_ALL) && !is_pet(em_ptr->m_ptr)) diff --git a/src/effect/effect-monster-charm.h b/src/effect/effect-monster-charm.h index b87a5cbfd..8ab5ed2bd 100644 --- a/src/effect/effect-monster-charm.h +++ b/src/effect/effect-monster-charm.h @@ -4,12 +4,12 @@ enum process_result; struct effect_monster_type; -struct player_type; -process_result effect_monster_charm(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_control_undead(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_control_demon(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_control_animal(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_charm_living(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_domination(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_crusade(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_capture(player_type *player_ptr, effect_monster_type *em_ptr); +class PlayerType; +process_result effect_monster_charm(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_control_undead(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_control_demon(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_control_animal(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_charm_living(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_domination(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_crusade(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_capture(PlayerType *player_ptr, effect_monster_type *em_ptr); diff --git a/src/effect/effect-monster-evil.cpp b/src/effect/effect-monster-evil.cpp index c66322f3d..67035eac1 100644 --- a/src/effect/effect-monster-evil.cpp +++ b/src/effect/effect-monster-evil.cpp @@ -10,7 +10,7 @@ #include "system/monster-type-definition.h" #include "system/player-type-definition.h" -static bool effect_monster_away_resist(player_type *player_ptr, effect_monster_type *em_ptr) +static bool effect_monster_away_resist(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flagsr & RFR_RES_TELE) == 0) return false; @@ -32,7 +32,7 @@ static bool effect_monster_away_resist(player_type *player_ptr, effect_monster_t } -process_result effect_monster_away_undead(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_away_undead(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD)) == 0) { @@ -56,7 +56,7 @@ process_result effect_monster_away_undead(player_type *player_ptr, effect_monste } -process_result effect_monster_away_evil(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_away_evil(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_EVIL)) == 0) { @@ -80,7 +80,7 @@ process_result effect_monster_away_evil(player_type *player_ptr, effect_monster_ } -process_result effect_monster_away_all(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_away_all(PlayerType *player_ptr, effect_monster_type *em_ptr) { bool resists_tele = effect_monster_away_resist(player_ptr, em_ptr); if (!resists_tele) @@ -95,7 +95,7 @@ process_result effect_monster_away_all(player_type *player_ptr, effect_monster_t } -process_result effect_monster_turn_undead(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_turn_undead(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD)) == 0) { @@ -121,7 +121,7 @@ process_result effect_monster_turn_undead(player_type *player_ptr, effect_monste } -process_result effect_monster_turn_evil(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_turn_evil(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_EVIL)) == 0) { @@ -166,7 +166,7 @@ process_result effect_monster_turn_all(effect_monster_type *em_ptr) } -process_result effect_monster_disp_undead(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_disp_undead(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD)) == 0) { @@ -186,7 +186,7 @@ process_result effect_monster_disp_undead(player_type *player_ptr, effect_monste } -process_result effect_monster_disp_evil(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_disp_evil(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_EVIL)) == 0) { @@ -205,7 +205,7 @@ process_result effect_monster_disp_evil(player_type *player_ptr, effect_monster_ } -process_result effect_monster_disp_good(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_disp_good(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_GOOD)) == 0) { @@ -241,7 +241,7 @@ process_result effect_monster_disp_living(effect_monster_type *em_ptr) } -process_result effect_monster_disp_demon(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_disp_demon(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_DEMON)) == 0) { diff --git a/src/effect/effect-monster-evil.h b/src/effect/effect-monster-evil.h index cf43cdd15..c538c279b 100644 --- a/src/effect/effect-monster-evil.h +++ b/src/effect/effect-monster-evil.h @@ -3,16 +3,16 @@ #include "system/angband.h" struct effect_monster_type; -struct player_type; -process_result effect_monster_away_undead(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_away_evil(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_away_all(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_turn_undead(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_turn_evil(player_type *player_ptr, effect_monster_type *em_ptr); +class PlayerType; +process_result effect_monster_away_undead(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_away_evil(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_away_all(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_turn_undead(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_turn_evil(PlayerType *player_ptr, effect_monster_type *em_ptr); process_result effect_monster_turn_all(effect_monster_type *em_ptr); -process_result effect_monster_disp_undead(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_disp_evil(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_disp_good(player_type *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_disp_undead(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_disp_evil(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_disp_good(PlayerType *player_ptr, effect_monster_type *em_ptr); process_result effect_monster_disp_living(effect_monster_type *em_ptr); -process_result effect_monster_disp_demon(player_type *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_disp_demon(PlayerType *player_ptr, effect_monster_type *em_ptr); process_result effect_monster_disp_all(effect_monster_type *em_ptr); diff --git a/src/effect/effect-monster-lite-dark.cpp b/src/effect/effect-monster-lite-dark.cpp index 7414594c3..31728ebcb 100644 --- a/src/effect/effect-monster-lite-dark.cpp +++ b/src/effect/effect-monster-lite-dark.cpp @@ -7,7 +7,7 @@ #include "system/monster-race-definition.h" #include "system/player-type-definition.h" -process_result effect_monster_lite_weak(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_lite_weak(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!em_ptr->dam) { @@ -32,7 +32,7 @@ process_result effect_monster_lite_weak(player_type *player_ptr, effect_monster_ } -process_result effect_monster_lite(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_lite(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -57,7 +57,7 @@ process_result effect_monster_lite(player_type *player_ptr, effect_monster_type } -process_result effect_monster_dark(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_dark(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; diff --git a/src/effect/effect-monster-lite-dark.h b/src/effect/effect-monster-lite-dark.h index c8a435ae7..a50525844 100644 --- a/src/effect/effect-monster-lite-dark.h +++ b/src/effect/effect-monster-lite-dark.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct effect_monster_type; -struct player_type; -process_result effect_monster_lite_weak(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_lite(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_dark(player_type *player_ptr, effect_monster_type *em_ptr); +class PlayerType; +process_result effect_monster_lite_weak(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_lite(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_dark(PlayerType *player_ptr, effect_monster_type *em_ptr); diff --git a/src/effect/effect-monster-oldies.cpp b/src/effect/effect-monster-oldies.cpp index 644ca85df..747e473ec 100644 --- a/src/effect/effect-monster-oldies.cpp +++ b/src/effect/effect-monster-oldies.cpp @@ -36,7 +36,7 @@ process_result effect_monster_old_poly(effect_monster_type *em_ptr) return PROCESS_CONTINUE; } -process_result effect_monster_old_clone(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_old_clone(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -56,7 +56,7 @@ process_result effect_monster_old_clone(player_type *player_ptr, effect_monster_ return PROCESS_CONTINUE; } -process_result effect_monster_star_heal(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_star_heal(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -83,7 +83,7 @@ process_result effect_monster_star_heal(player_type *player_ptr, effect_monster_ } // who == 0ならばプレイヤーなので、それの判定. -static void effect_monster_old_heal_check_player(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_old_heal_check_player(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->who != 0) return; @@ -105,7 +105,7 @@ static void effect_monster_old_heal_check_player(player_type *player_ptr, effect chg_virtue(player_ptr, V_NATURE, 1); } -static void effect_monster_old_heal_recovery(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_old_heal_recovery(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (monster_stunned_remaining(em_ptr->m_ptr)) { if (em_ptr->seen_msg) @@ -129,7 +129,7 @@ static void effect_monster_old_heal_recovery(player_type *player_ptr, effect_mon } } -process_result effect_monster_old_heal(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_old_heal(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -159,7 +159,7 @@ process_result effect_monster_old_heal(player_type *player_ptr, effect_monster_t return PROCESS_CONTINUE; } -process_result effect_monster_old_speed(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_old_speed(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -179,7 +179,7 @@ process_result effect_monster_old_speed(player_type *player_ptr, effect_monster_ return PROCESS_CONTINUE; } -process_result effect_monster_old_slow(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_old_slow(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -203,7 +203,7 @@ process_result effect_monster_old_slow(player_type *player_ptr, effect_monster_t * @todo 「ユニークは (魔法では)常に眠らない」はr_infoの趣旨に反すると思われる * 眠る確率を半分にするとかしておいた方が良さそう */ -process_result effect_monster_old_sleep(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_old_sleep(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -230,7 +230,7 @@ process_result effect_monster_old_sleep(player_type *player_ptr, effect_monster_ * @todo 「ユニークは (魔法では)常に混乱しない」はr_infoの趣旨に反すると思われる * 眠る確率を半分にするとかしておいた方が良さそう */ -process_result effect_monster_old_conf(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_old_conf(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; diff --git a/src/effect/effect-monster-oldies.h b/src/effect/effect-monster-oldies.h index 744a10d82..d93179712 100644 --- a/src/effect/effect-monster-oldies.h +++ b/src/effect/effect-monster-oldies.h @@ -3,14 +3,14 @@ #include "system/angband.h" struct effect_monster_type; -struct player_type; +class PlayerType; process_result effect_monster_old_poly(effect_monster_type *em_ptr); -process_result effect_monster_old_clone(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_star_heal(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_old_heal(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_old_speed(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_old_slow(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_old_sleep(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_old_conf(player_type *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_old_clone(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_star_heal(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_old_heal(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_old_speed(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_old_slow(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_old_sleep(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_old_conf(PlayerType *player_ptr, effect_monster_type *em_ptr); process_result effect_monster_stasis(effect_monster_type *em_ptr, bool to_evil); process_result effect_monster_stun(effect_monster_type *em_ptr); diff --git a/src/effect/effect-monster-psi.cpp b/src/effect/effect-monster-psi.cpp index 0f8e4375c..8603027e7 100644 --- a/src/effect/effect-monster-psi.cpp +++ b/src/effect/effect-monster-psi.cpp @@ -27,7 +27,7 @@ * @param em_ptr モンスター効果への参照ポインタ * @return 完全な耐性を発動した場合TRUE、そうでなければFALSE */ -static bool resisted_psi_because_empty_mind(player_type *player_ptr, effect_monster_type *em_ptr) +static bool resisted_psi_because_empty_mind(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (none_bits(em_ptr->r_ptr->flags2, RF2_EMPTY_MIND)) return false; @@ -72,7 +72,7 @@ static bool resisted_psi_because_weird_mind_or_powerful(effect_monster_type *em_ * 1) UNDEADまたはDEMONである * 2) レベルが詠唱者の レベル/2 より大きい */ -static bool reflects_psi_with_currupted_mind(player_type *player_ptr, effect_monster_type *em_ptr) +static bool reflects_psi_with_currupted_mind(PlayerType *player_ptr, effect_monster_type *em_ptr) { bool is_corrupted = any_bits(em_ptr->r_ptr->flags3, RF3_UNDEAD | RF3_DEMON) && (em_ptr->r_ptr->level > player_ptr->lev / 2) && one_in_(2); if (!is_corrupted) @@ -93,7 +93,7 @@ static bool reflects_psi_with_currupted_mind(player_type *player_ptr, effect_mon * 効果は、混乱、朦朧、恐怖、麻痺 * 3/4の確率または影分身時はダメージ及び追加効果はない。 */ -static void effect_monster_psi_reflect_extra_effect(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_psi_reflect_extra_effect(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!one_in_(4) || check_multishadow(player_ptr)) { return; @@ -131,7 +131,7 @@ static void effect_monster_psi_reflect_extra_effect(player_type *player_ptr, eff * @details * 耐性を発動した精神の堕落したモンスターは効力を跳ね返すことがある。 */ -static void effect_monster_psi_resist(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_psi_resist(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (resisted_psi_because_empty_mind(player_ptr, em_ptr)) return; @@ -193,7 +193,7 @@ static void effect_monster_psi_extra_effect(effect_monster_type *em_ptr) * 視界による影響を発動する。 * モンスターの耐性とそれに不随した効果を発動する。 */ -process_result effect_monster_psi(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_psi(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -218,7 +218,7 @@ process_result effect_monster_psi(player_type *player_ptr, effect_monster_type * * @details * 耐性を発動した精神の堕落したモンスターは効力を跳ね返すことがある。 */ -static void effect_monster_psi_drain_resist(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_psi_drain_resist(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (resisted_psi_because_empty_mind(player_ptr, em_ptr)) return; @@ -257,7 +257,7 @@ static void effect_monster_psi_drain_resist(player_type *player_ptr, effect_mons * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果への参照ポインタ */ -static void effect_monster_psi_drain_change_power(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_psi_drain_change_power(PlayerType *player_ptr, effect_monster_type *em_ptr) { int b = damroll(5, em_ptr->dam) / 4; concptr str = (player_ptr->pclass == PlayerClassType::MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana"); @@ -278,7 +278,7 @@ static void effect_monster_psi_drain_change_power(player_type *player_ptr, effec * @details * ダメージがないか3/4の確率で追加効果なし */ -process_result effect_monster_psi_drain(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_psi_drain(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -299,7 +299,7 @@ process_result effect_monster_psi_drain(player_type *player_ptr, effect_monster_ * @details * 朦朧+ショートテレポートアウェイ */ -process_result effect_monster_telekinesis(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_telekinesis(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; diff --git a/src/effect/effect-monster-psi.h b/src/effect/effect-monster-psi.h index 854fda0f7..24e416ac3 100644 --- a/src/effect/effect-monster-psi.h +++ b/src/effect/effect-monster-psi.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct effect_monster_type; -struct player_type; -process_result effect_monster_psi(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_psi_drain(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_telekinesis(player_type *player_ptr, effect_monster_type *em_ptr); +class PlayerType; +process_result effect_monster_psi(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_psi_drain(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_telekinesis(PlayerType *player_ptr, effect_monster_type *em_ptr); diff --git a/src/effect/effect-monster-resist-hurt.cpp b/src/effect/effect-monster-resist-hurt.cpp index ae8874bb5..02f01e5cd 100644 --- a/src/effect/effect-monster-resist-hurt.cpp +++ b/src/effect/effect-monster-resist-hurt.cpp @@ -29,7 +29,7 @@ process_result effect_monster_nothing(effect_monster_type *em_ptr) return PROCESS_CONTINUE; } -process_result effect_monster_acid(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_acid(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -45,7 +45,7 @@ process_result effect_monster_acid(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_elec(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_elec(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -61,7 +61,7 @@ process_result effect_monster_elec(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_fire(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_fire(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -86,7 +86,7 @@ process_result effect_monster_fire(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_cold(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_cold(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -111,7 +111,7 @@ process_result effect_monster_cold(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_pois(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_pois(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -127,7 +127,7 @@ process_result effect_monster_pois(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_nuke(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_nuke(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -148,7 +148,7 @@ process_result effect_monster_nuke(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_hell_fire(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_hell_fire(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -164,7 +164,7 @@ process_result effect_monster_hell_fire(player_type *player_ptr, effect_monster_ return PROCESS_CONTINUE; } -process_result effect_monster_holy_fire(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_holy_fire(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -192,7 +192,7 @@ process_result effect_monster_holy_fire(player_type *player_ptr, effect_monster_ return PROCESS_CONTINUE; } -process_result effect_monster_plasma(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_plasma(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -209,7 +209,7 @@ process_result effect_monster_plasma(player_type *player_ptr, effect_monster_typ return PROCESS_CONTINUE; } -static bool effect_monster_nether_resist(player_type *player_ptr, effect_monster_type *em_ptr) +static bool effect_monster_nether_resist(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flagsr & RFR_RES_NETH) == 0) return false; @@ -231,7 +231,7 @@ static bool effect_monster_nether_resist(player_type *player_ptr, effect_monster return true; } -process_result effect_monster_nether(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_nether(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -247,7 +247,7 @@ process_result effect_monster_nether(player_type *player_ptr, effect_monster_typ return PROCESS_CONTINUE; } -process_result effect_monster_water(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_water(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -270,7 +270,7 @@ process_result effect_monster_water(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_chaos(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_chaos(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -295,7 +295,7 @@ process_result effect_monster_chaos(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_shards(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_shards(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -312,7 +312,7 @@ process_result effect_monster_shards(player_type *player_ptr, effect_monster_typ return PROCESS_CONTINUE; } -process_result effect_monster_rocket(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_rocket(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -328,7 +328,7 @@ process_result effect_monster_rocket(player_type *player_ptr, effect_monster_typ return PROCESS_CONTINUE; } -process_result effect_monster_sound(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_sound(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -347,7 +347,7 @@ process_result effect_monster_sound(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_confusion(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_confusion(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -366,7 +366,7 @@ process_result effect_monster_confusion(player_type *player_ptr, effect_monster_ return PROCESS_CONTINUE; } -process_result effect_monster_disenchant(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_disenchant(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -383,7 +383,7 @@ process_result effect_monster_disenchant(player_type *player_ptr, effect_monster return PROCESS_CONTINUE; } -process_result effect_monster_nexus(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_nexus(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -400,7 +400,7 @@ process_result effect_monster_nexus(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -process_result effect_monster_force(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_force(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -420,7 +420,7 @@ process_result effect_monster_force(player_type *player_ptr, effect_monster_type } // Powerful monsters can resists and normal monsters slow down. -process_result effect_monster_inertial(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_inertial(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -446,7 +446,7 @@ process_result effect_monster_inertial(player_type *player_ptr, effect_monster_t return PROCESS_CONTINUE; } -process_result effect_monster_time(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_time(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -465,7 +465,7 @@ process_result effect_monster_time(player_type *player_ptr, effect_monster_type return PROCESS_CONTINUE; } -static bool effect_monster_gravity_resist_teleport(player_type *player_ptr, effect_monster_type *em_ptr) +static bool effect_monster_gravity_resist_teleport(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -491,7 +491,7 @@ static bool effect_monster_gravity_resist_teleport(player_type *player_ptr, effe return true; } -static void effect_monster_gravity_slow(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_monster_gravity_slow(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)) em_ptr->obvious = false; @@ -514,7 +514,7 @@ static void effect_monster_gravity_stun(effect_monster_type *em_ptr) * Powerful monsters can resist and normal monsters slow down * Furthermore, this magic can make non-unique monsters slow/stun. */ -process_result effect_monster_gravity(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_gravity(PlayerType *player_ptr, effect_monster_type *em_ptr) { em_ptr->do_dist = effect_monster_gravity_resist_teleport(player_ptr, em_ptr) ? 0 : 10; if (player_ptr->riding && (em_ptr->g_ptr->m_idx == player_ptr->riding)) @@ -536,7 +536,7 @@ process_result effect_monster_gravity(player_type *player_ptr, effect_monster_ty return PROCESS_CONTINUE; } -process_result effect_monster_disintegration(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_disintegration(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -553,7 +553,7 @@ process_result effect_monster_disintegration(player_type *player_ptr, effect_mon return PROCESS_CONTINUE; } -process_result effect_monster_icee_bolt(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_icee_bolt(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -582,7 +582,7 @@ process_result effect_monster_icee_bolt(player_type *player_ptr, effect_monster_ * @details * 量子生物に倍打、壁抜けに1.5倍打、テレポート耐性が耐性 */ -process_result effect_monster_void(player_type* player_ptr, effect_monster_type* em_ptr) +process_result effect_monster_void(PlayerType* player_ptr, effect_monster_type* em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -627,7 +627,7 @@ process_result effect_monster_void(player_type* player_ptr, effect_monster_type* * 飛ばないテレポート耐性に1.25倍打、暗黒耐性が耐性 * 1/3で追加に混乱か恐怖 */ -process_result effect_monster_abyss(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_abyss(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; diff --git a/src/effect/effect-monster-resist-hurt.h b/src/effect/effect-monster-resist-hurt.h index 03c5bfa27..3a9b828a8 100644 --- a/src/effect/effect-monster-resist-hurt.h +++ b/src/effect/effect-monster-resist-hurt.h @@ -3,31 +3,31 @@ #include "system/angband.h" struct effect_monster_type; -struct player_type; +class PlayerType; process_result effect_monster_nothing(effect_monster_type *em_ptr); -process_result effect_monster_acid(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_elec(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_fire(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_cold(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_pois(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_nuke(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_hell_fire(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_holy_fire(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_plasma(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_nether(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_water(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_chaos(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_shards(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_rocket(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_sound(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_confusion(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_disenchant(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_nexus(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_force(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_inertial(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_time(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_gravity(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_disintegration(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_icee_bolt(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_void(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_abyss(player_type *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_acid(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_elec(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_fire(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_cold(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_pois(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_nuke(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_hell_fire(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_holy_fire(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_plasma(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_nether(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_water(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_chaos(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_shards(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_rocket(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_sound(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_confusion(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_disenchant(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_nexus(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_force(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_inertial(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_time(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_gravity(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_disintegration(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_icee_bolt(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_void(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_abyss(PlayerType *player_ptr, effect_monster_type *em_ptr); diff --git a/src/effect/effect-monster-spirit.cpp b/src/effect/effect-monster-spirit.cpp index 1d68829a6..b581dffde 100644 --- a/src/effect/effect-monster-spirit.cpp +++ b/src/effect/effect-monster-spirit.cpp @@ -17,7 +17,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -process_result effect_monster_drain_mana(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_drain_mana(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -62,7 +62,7 @@ process_result effect_monster_drain_mana(player_type *player_ptr, effect_monster return PROCESS_CONTINUE; } -process_result effect_monster_mind_blast(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_mind_blast(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -101,7 +101,7 @@ process_result effect_monster_mind_blast(player_type *player_ptr, effect_monster return PROCESS_CONTINUE; } -process_result effect_monster_brain_smash(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_brain_smash(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; diff --git a/src/effect/effect-monster-spirit.h b/src/effect/effect-monster-spirit.h index ab4cd0d56..6eb3d2454 100644 --- a/src/effect/effect-monster-spirit.h +++ b/src/effect/effect-monster-spirit.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct effect_monster_type; -struct player_type; -process_result effect_monster_drain_mana(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_mind_blast(player_type *player_ptr, effect_monster_type *em_ptr); -process_result effect_monster_brain_smash(player_type *player_ptr, effect_monster_type *em_ptr); +class PlayerType; +process_result effect_monster_drain_mana(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_mind_blast(PlayerType *player_ptr, effect_monster_type *em_ptr); +process_result effect_monster_brain_smash(PlayerType *player_ptr, effect_monster_type *em_ptr); diff --git a/src/effect/effect-monster-switcher.cpp b/src/effect/effect-monster-switcher.cpp index 8218e65da..01183c685 100644 --- a/src/effect/effect-monster-switcher.cpp +++ b/src/effect/effect-monster-switcher.cpp @@ -38,7 +38,7 @@ #include "util/bit-flags-calculator.h" #include "view/display-messages.h" -process_result effect_monster_hypodynamia(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_hypodynamia(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -66,7 +66,7 @@ process_result effect_monster_hypodynamia(player_type *player_ptr, effect_monste /*! * @todo リファクタリング前のコード時点で、単に耐性があるだけでもダメージ0だった. */ -process_result effect_monster_death_ray(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_death_ray(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -97,7 +97,7 @@ process_result effect_monster_death_ray(player_type *player_ptr, effect_monster_ return PROCESS_CONTINUE; } -process_result effect_monster_kill_wall(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_kill_wall(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags3 & (RF3_HURT_ROCK)) == 0) { em_ptr->dam = 0; @@ -149,7 +149,7 @@ process_result effect_monster_hand_doom(effect_monster_type *em_ptr) * 寝た場合は試行終了。 * 与える効果は減速、朦朧、混乱、睡眠。 */ -process_result effect_monster_engetsu(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_engetsu(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -239,7 +239,7 @@ process_result effect_monster_engetsu(player_type *player_ptr, effect_monster_ty return PROCESS_CONTINUE; } -process_result effect_monster_genocide(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_genocide(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->seen) em_ptr->obvious = true; @@ -254,7 +254,7 @@ process_result effect_monster_genocide(player_type *player_ptr, effect_monster_t return PROCESS_CONTINUE; } -process_result effect_monster_photo(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_photo(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!em_ptr->who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), em_ptr->m_name); @@ -294,7 +294,7 @@ process_result effect_monster_wounds(effect_monster_type *em_ptr) * @param em_ptr モンスター効果構造体への参照ポインタ * @return ここのスイッチングで終るならTRUEかFALSE、後続処理を実行するならCONTINUE */ -process_result switch_effects_monster(player_type *player_ptr, effect_monster_type *em_ptr) +process_result switch_effects_monster(PlayerType *player_ptr, effect_monster_type *em_ptr) { switch (em_ptr->attribute) { case AttributeType::PSY_SPEAR: diff --git a/src/effect/effect-monster-switcher.h b/src/effect/effect-monster-switcher.h index bf5b4b01e..d54a191dc 100644 --- a/src/effect/effect-monster-switcher.h +++ b/src/effect/effect-monster-switcher.h @@ -3,5 +3,5 @@ #include "system/angband.h" struct effect_monster_type; -struct player_type; -process_result switch_effects_monster(player_type *player_ptr, effect_monster_type *em_ptr); +class PlayerType; +process_result switch_effects_monster(PlayerType *player_ptr, effect_monster_type *em_ptr); diff --git a/src/effect/effect-monster-util.cpp b/src/effect/effect-monster-util.cpp index 4d287a512..8c02d6688 100644 --- a/src/effect/effect-monster-util.cpp +++ b/src/effect/effect-monster-util.cpp @@ -54,7 +54,7 @@ static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX w * @param flag 効果フラグ * @param see_s_msg TRUEならばメッセージを表示する */ -effect_monster_type *initialize_effect_monster(player_type *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg) +effect_monster_type *initialize_effect_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg) { substitute_effect_monster(em_ptr, who, r, y, x, dam, attribute, flag, see_s_msg); diff --git a/src/effect/effect-monster-util.h b/src/effect/effect-monster-util.h index fccfc496f..bec2d8038 100644 --- a/src/effect/effect-monster-util.h +++ b/src/effect/effect-monster-util.h @@ -44,6 +44,6 @@ typedef struct effect_monster_type { bool see_s_msg; } effect_monster_type; -struct player_type; -effect_monster_type *initialize_effect_monster(player_type *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, +class PlayerType; +effect_monster_type *initialize_effect_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg); diff --git a/src/effect/effect-monster.cpp b/src/effect/effect-monster.cpp index 59557248b..224c36938 100644 --- a/src/effect/effect-monster.cpp +++ b/src/effect/effect-monster.cpp @@ -59,7 +59,7 @@ * @param em_ptr モンスター効果構造体への参照ポインタ * @return 効果が何もないならFALSE、何かあるならTRUE */ -static process_result is_affective(player_type *player_ptr, effect_monster_type *em_ptr) +static process_result is_affective(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!em_ptr->g_ptr->m_idx) return PROCESS_FALSE; @@ -97,7 +97,7 @@ static process_result is_affective(player_type *player_ptr, effect_monster_type * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void make_description_of_affecred_monster(player_type *player_ptr, effect_monster_type *em_ptr) +static void make_description_of_affecred_monster(PlayerType *player_ptr, effect_monster_type *em_ptr) { em_ptr->dam = (em_ptr->dam + em_ptr->r) / (em_ptr->r + 1); monster_desc(player_ptr, em_ptr->m_name, em_ptr->m_ptr, 0); @@ -113,7 +113,7 @@ static void make_description_of_affecred_monster(player_type *player_ptr, effect * 完全な耐性を持っていたら、一部属性を除いて影響は及ぼさない * 射撃属性 (デバッグ用)であれば貫通する */ -static process_result exe_affect_monster_by_effect(player_type *player_ptr, effect_monster_type *em_ptr) +static process_result exe_affect_monster_by_effect(PlayerType *player_ptr, effect_monster_type *em_ptr) { process_result result = is_affective(player_ptr, em_ptr); if (result != PROCESS_TRUE) { @@ -148,7 +148,7 @@ static process_result exe_affect_monster_by_effect(player_type *player_ptr, effe * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void effect_damage_killed_pet(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_damage_killed_pet(PlayerType *player_ptr, effect_monster_type *em_ptr) { bool sad = is_pet(em_ptr->m_ptr) && !(em_ptr->m_ptr->ml); if (em_ptr->known && em_ptr->note) { @@ -173,7 +173,7 @@ static void effect_damage_killed_pet(player_type *player_ptr, effect_monster_typ * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void effect_damage_makes_sleep(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_damage_makes_sleep(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->note && em_ptr->seen_msg) msg_format("%^s%s", em_ptr->m_name, em_ptr->note); @@ -194,7 +194,7 @@ static void effect_damage_makes_sleep(player_type *player_ptr, effect_monster_ty * @details * モンスターIDがプレイヤー(0)の場合は処理しない。 */ -static bool deal_effect_damage_from_monster(player_type *player_ptr, effect_monster_type *em_ptr) +static bool deal_effect_damage_from_monster(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->who <= 0) return false; @@ -220,7 +220,7 @@ static bool deal_effect_damage_from_monster(player_type *player_ptr, effect_mons * @param em_ptr モンスター効果構造体への参照ポインタ * @return 大賞モンスターが不潔な病人だった場合はTRUE、それ以外はFALSE */ -static bool heal_leaper(player_type *player_ptr, effect_monster_type *em_ptr) +static bool heal_leaper(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!em_ptr->heal_leper) return false; @@ -246,7 +246,7 @@ static bool heal_leaper(player_type *player_ptr, effect_monster_type *em_ptr) * @details * em_ptr->do_fearによる恐怖メッセージもここで表示。 */ -static bool deal_effect_damage_from_player(player_type *player_ptr, effect_monster_type *em_ptr) +static bool deal_effect_damage_from_player(PlayerType *player_ptr, effect_monster_type *em_ptr) { bool fear = false; MonsterDamageProcessor mdp(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, &fear, em_ptr->attribute); @@ -283,7 +283,7 @@ static bool deal_effect_damage_from_player(player_type *player_ptr, effect_monst * 3.プレイヤーによる効果ダメージの処理 * 4.睡眠する処理 */ -static void deal_effect_damage_to_monster(player_type *player_ptr, effect_monster_type *em_ptr) +static void deal_effect_damage_to_monster(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->attribute == AttributeType::DRAIN_MANA) return; @@ -307,7 +307,7 @@ static void deal_effect_damage_to_monster(player_type *player_ptr, effect_monste * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void effect_makes_change_virtues(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_makes_change_virtues(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->who > 0) || !em_ptr->slept) return; @@ -323,7 +323,7 @@ static void effect_makes_change_virtues(player_type *player_ptr, effect_monster_ * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void affected_monster_prevents_bad_status(player_type *player_ptr, effect_monster_type *em_ptr) +static void affected_monster_prevents_bad_status(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) || (em_ptr->r_ptr->flags1 & RF1_QUESTOR) || (player_ptr->riding && (em_ptr->g_ptr->m_idx == player_ptr->riding))) em_ptr->do_polymorph = false; @@ -338,7 +338,7 @@ static void affected_monster_prevents_bad_status(player_type *player_ptr, effect * @param em_ptr モンスター効果構造体への参照ポインタ * @param stun_damage 朦朧値 */ -static void effect_damage_piles_stun(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_damage_piles_stun(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->do_stun == 0) || (em_ptr->r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) || (em_ptr->r_ptr->flags3 & RF3_NO_STUN)) return; @@ -365,7 +365,7 @@ static void effect_damage_piles_stun(player_type *player_ptr, effect_monster_typ * @param em_ptr モンスター効果構造体への参照ポインタ * @param stun_damage 混乱値 */ -static void effect_damage_piles_confusion(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_damage_piles_confusion(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->do_conf == 0) || (em_ptr->r_ptr->flags3 & RF3_NO_CONF) || (em_ptr->r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK)) return; @@ -394,7 +394,7 @@ static void effect_damage_piles_confusion(player_type *player_ptr, effect_monste * @details * 打撃ダメージによる恐怖もあるため、メッセージは後で表示。 */ -static void effect_damage_piles_fear(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_damage_piles_fear(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->do_fear == 0 || any_bits(em_ptr->r_ptr->flags3, RF3_NO_FEAR)) return; @@ -433,7 +433,7 @@ static void effect_damage_makes_weak(effect_monster_type *em_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void effect_damage_makes_polymorph(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_damage_makes_polymorph(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!em_ptr->do_polymorph || (randint1(90) <= em_ptr->r_ptr->level)) return; @@ -455,7 +455,7 @@ static void effect_damage_makes_polymorph(player_type *player_ptr, effect_monste * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void effect_damage_makes_teleport(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_damage_makes_teleport(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->do_dist == 0) return; @@ -486,7 +486,7 @@ static void effect_damage_makes_teleport(player_type *player_ptr, effect_monster * 2.ダメージ量が現HPを上回る場合 * 3.通常時(デバフをかける) */ -static void effect_damage_gives_bad_status(player_type *player_ptr, effect_monster_type *em_ptr) +static void effect_damage_gives_bad_status(PlayerType *player_ptr, effect_monster_type *em_ptr) { int tmp_damage = em_ptr->dam; em_ptr->dam = mon_damage_mod(player_ptr, em_ptr->m_ptr, em_ptr->dam, (bool)(em_ptr->attribute == AttributeType::PSY_SPEAR)); @@ -517,7 +517,7 @@ static void effect_damage_gives_bad_status(player_type *player_ptr, effect_monst * 4.ダメージ処理及び恐怖メッセージ * 5.悪魔領域血の呪いによる事後処理 */ -static void exe_affect_monster_by_damage(player_type *player_ptr, effect_monster_type *em_ptr) +static void exe_affect_monster_by_damage(PlayerType *player_ptr, effect_monster_type *em_ptr) { effect_makes_change_virtues(player_ptr, em_ptr); affected_monster_prevents_bad_status(player_ptr, em_ptr); @@ -532,7 +532,7 @@ static void exe_affect_monster_by_damage(player_type *player_ptr, effect_monster * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void update_phase_out_stat(player_type *player_ptr, effect_monster_type *em_ptr) +static void update_phase_out_stat(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!player_ptr->phase_out) return; @@ -547,7 +547,7 @@ static void update_phase_out_stat(player_type *player_ptr, effect_monster_type * * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void postprocess_by_effected_pet(player_type *player_ptr, effect_monster_type *em_ptr) +static void postprocess_by_effected_pet(PlayerType *player_ptr, effect_monster_type *em_ptr) { if ((em_ptr->dam <= 0) || is_pet(em_ptr->m_ptr) || is_friendly(em_ptr->m_ptr)) return; @@ -568,7 +568,7 @@ static void postprocess_by_effected_pet(player_type *player_ptr, effect_monster_ * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void postprocess_by_riding_pet_effected(player_type *player_ptr, effect_monster_type *em_ptr) +static void postprocess_by_riding_pet_effected(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (!player_ptr->riding || (player_ptr->riding != em_ptr->g_ptr->m_idx) || (em_ptr->dam <= 0)) return; @@ -585,7 +585,7 @@ static void postprocess_by_riding_pet_effected(player_type *player_ptr, effect_m * @param em_ptr モンスター効果構造体への参照ポインタ * @details 写真のフラッシュは弱閃光属性 */ -static void postprocess_by_taking_photo(player_type *player_ptr, effect_monster_type *em_ptr) +static void postprocess_by_taking_photo(PlayerType *player_ptr, effect_monster_type *em_ptr) { if (em_ptr->photo == 0) return; @@ -604,7 +604,7 @@ static void postprocess_by_taking_photo(player_type *player_ptr, effect_monster_ * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果構造体への参照ポインタ */ -static void exe_affect_monster_postprocess(player_type *player_ptr, effect_monster_type *em_ptr) +static void exe_affect_monster_postprocess(PlayerType *player_ptr, effect_monster_type *em_ptr) { postprocess_by_effected_pet(player_ptr, em_ptr); postprocess_by_riding_pet_effected(player_ptr, em_ptr); @@ -633,7 +633,7 @@ static void exe_affect_monster_postprocess(player_type *player_ptr, effect_monst * 3.ペット及び撮影による事後効果 */ bool affect_monster( - player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg) + PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg) { effect_monster_type tmp_effect; effect_monster_type *em_ptr = initialize_effect_monster(player_ptr, &tmp_effect, who, r, y, x, dam, attribute, flag, see_s_msg); diff --git a/src/effect/effect-monster.h b/src/effect/effect-monster.h index 7ff36db2b..fe97f2aed 100644 --- a/src/effect/effect-monster.h +++ b/src/effect/effect-monster.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "effect/attribute-types.h" -struct player_type; -bool affect_monster(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg); +class PlayerType; +bool affect_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg); diff --git a/src/effect/effect-player-curse.cpp b/src/effect/effect-player-curse.cpp index 80fabadfe..8c0a1123d 100644 --- a/src/effect/effect-player-curse.cpp +++ b/src/effect/effect-player-curse.cpp @@ -11,7 +11,7 @@ #include "view/display-messages.h" #include "world/world.h" -void effect_player_curse_1(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_curse_1(PlayerType *player_ptr, effect_player_type *ep_ptr) { if ((randint0(100 + ep_ptr->rlev / 2) < player_ptr->skill_sav) && !check_multishadow(player_ptr)) { msg_print(_("しかし効力を跳ね返した!", "You resist the effects!")); @@ -22,7 +22,7 @@ void effect_player_curse_1(player_type *player_ptr, effect_player_type *ep_ptr) } } -void effect_player_curse_2(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_curse_2(PlayerType *player_ptr, effect_player_type *ep_ptr) { if ((randint0(100 + ep_ptr->rlev / 2) < player_ptr->skill_sav) && !check_multishadow(player_ptr)) { msg_print(_("しかし効力を跳ね返した!", "You resist the effects!")); @@ -33,7 +33,7 @@ void effect_player_curse_2(player_type *player_ptr, effect_player_type *ep_ptr) } } -void effect_player_curse_3(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_curse_3(PlayerType *player_ptr, effect_player_type *ep_ptr) { if ((randint0(100 + ep_ptr->rlev / 2) < player_ptr->skill_sav) && !check_multishadow(player_ptr)) { msg_print(_("しかし効力を跳ね返した!", "You resist the effects!")); @@ -44,7 +44,7 @@ void effect_player_curse_3(player_type *player_ptr, effect_player_type *ep_ptr) } } -void effect_player_curse_4(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_curse_4(PlayerType *player_ptr, effect_player_type *ep_ptr) { if ((randint0(100 + ep_ptr->rlev / 2) < player_ptr->skill_sav) && (ep_ptr->m_ptr->r_idx != MON_KENSHIROU) && !check_multishadow(player_ptr)) { msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!")); diff --git a/src/effect/effect-player-curse.h b/src/effect/effect-player-curse.h index 129af72e8..b797adf1b 100644 --- a/src/effect/effect-player-curse.h +++ b/src/effect/effect-player-curse.h @@ -1,8 +1,8 @@ #pragma once struct effect_player_type; -struct player_type; -void effect_player_curse_1(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_curse_2(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_curse_3(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_curse_4(player_type *player_ptr, effect_player_type *ep_ptr); +class PlayerType; +void effect_player_curse_1(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_curse_2(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_curse_3(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_curse_4(PlayerType *player_ptr, effect_player_type *ep_ptr); diff --git a/src/effect/effect-player-oldies.cpp b/src/effect/effect-player-oldies.cpp index 5713f14f5..ca0ff6cbc 100644 --- a/src/effect/effect-player-oldies.cpp +++ b/src/effect/effect-player-oldies.cpp @@ -9,7 +9,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -void effect_player_old_heal(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_old_heal(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!")); @@ -18,7 +18,7 @@ void effect_player_old_heal(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->dam = 0; } -void effect_player_old_speed(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_old_speed(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かで攻撃された!", "You are hit by something!")); @@ -27,7 +27,7 @@ void effect_player_old_speed(player_type *player_ptr, effect_player_type *ep_ptr ep_ptr->dam = 0; } -void effect_player_old_slow(player_type *player_ptr) +void effect_player_old_slow(PlayerType *player_ptr) { if (player_ptr->blind) { msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!")); @@ -36,7 +36,7 @@ void effect_player_old_slow(player_type *player_ptr) (void)BadStatusSetter(player_ptr).mod_slowness(randint0(4) + 4, false); } -void effect_player_old_sleep(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_old_sleep(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->free_act) return; diff --git a/src/effect/effect-player-oldies.h b/src/effect/effect-player-oldies.h index 09b1d81a3..9095dbcbf 100644 --- a/src/effect/effect-player-oldies.h +++ b/src/effect/effect-player-oldies.h @@ -1,8 +1,8 @@ #pragma once struct effect_player_type; -struct player_type; -void effect_player_old_heal(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_old_speed(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_old_slow(player_type *player_ptr); -void effect_player_old_sleep(player_type *player_ptr, effect_player_type *ep_ptr); +class PlayerType; +void effect_player_old_heal(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_old_speed(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_old_slow(PlayerType *player_ptr); +void effect_player_old_sleep(PlayerType *player_ptr, effect_player_type *ep_ptr); diff --git a/src/effect/effect-player-resist-hurt.cpp b/src/effect/effect-player-resist-hurt.cpp index c783c9bdf..6435b23ac 100644 --- a/src/effect/effect-player-resist-hurt.cpp +++ b/src/effect/effect-player-resist-hurt.cpp @@ -35,7 +35,7 @@ // 毒を除く4元素. void effect_player_elements( - player_type *player_ptr, effect_player_type *ep_ptr, concptr attack_message, HIT_POINT (*damage_func)(player_type *, HIT_POINT, concptr, bool)) + PlayerType *player_ptr, effect_player_type *ep_ptr, concptr attack_message, HIT_POINT (*damage_func)(PlayerType *, HIT_POINT, concptr, bool)) { if (player_ptr->blind) msg_print(attack_message); @@ -43,7 +43,7 @@ void effect_player_elements( ep_ptr->get_damage = (*damage_func)(player_ptr, ep_ptr->dam, ep_ptr->killer, false); } -void effect_player_poison(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_poison(PlayerType *player_ptr, effect_player_type *ep_ptr) { bool double_resist = is_oppose_pois(player_ptr); if (player_ptr->blind) @@ -62,7 +62,7 @@ void effect_player_poison(player_type *player_ptr, effect_player_type *ep_ptr) } } -void effect_player_nuke(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_nuke(PlayerType *player_ptr, effect_player_type *ep_ptr) { bool double_resist = is_oppose_pois(player_ptr); if (player_ptr->blind) @@ -88,7 +88,7 @@ void effect_player_nuke(player_type *player_ptr, effect_player_type *ep_ptr) inventory_damage(player_ptr, BreakerAcid(), 2); } -void effect_player_missile(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_missile(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かで攻撃された!", "You are hit by something!")); @@ -96,7 +96,7 @@ void effect_player_missile(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_holy_fire(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_holy_fire(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かで攻撃された!", "You are hit by something!")); @@ -106,7 +106,7 @@ void effect_player_holy_fire(player_type *player_ptr, effect_player_type *ep_ptr ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_hell_fire(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_hell_fire(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かで攻撃された!", "You are hit by something!")); @@ -116,7 +116,7 @@ void effect_player_hell_fire(player_type *player_ptr, effect_player_type *ep_ptr ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_arrow(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_arrow(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) { sound(SOUND_SHOOT_HIT); @@ -134,7 +134,7 @@ void effect_player_arrow(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_plasma(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_plasma(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!")); @@ -158,7 +158,7 @@ void effect_player_plasma(player_type *player_ptr, effect_player_type *ep_ptr) * 幽霊は回復する。追加効果で経験値吸収。 */ -void effect_player_nether(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_nether(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!")); @@ -189,7 +189,7 @@ void effect_player_nether(player_type *player_ptr, effect_player_type *ep_ptr) * @details * 追加効果で朦朧と混乱、冷気同様のインベントリ破壊。 */ -void effect_player_water(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_water(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) { msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!")); @@ -221,7 +221,7 @@ void effect_player_water(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_chaos(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_chaos(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) { msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!")); @@ -257,7 +257,7 @@ void effect_player_chaos(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_shards(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_shards(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!")); @@ -274,7 +274,7 @@ void effect_player_shards(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_sound(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_sound(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!")); @@ -292,7 +292,7 @@ void effect_player_sound(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_confusion(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_confusion(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) { msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!")); @@ -307,7 +307,7 @@ void effect_player_confusion(player_type *player_ptr, effect_player_type *ep_ptr ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_disenchant(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_disenchant(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!")); @@ -321,7 +321,7 @@ void effect_player_disenchant(player_type *player_ptr, effect_player_type *ep_pt ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_nexus(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_nexus(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!")); @@ -335,7 +335,7 @@ void effect_player_nexus(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_force(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_force(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!")); @@ -346,7 +346,7 @@ void effect_player_force(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_rocket(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_rocket(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) { msg_print(_("爆発があった!", "There is an explosion!")); @@ -369,7 +369,7 @@ void effect_player_rocket(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_inertial(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_inertial(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) { msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!")); @@ -382,7 +382,7 @@ void effect_player_inertial(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_lite(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_lite(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かで攻撃された!", "You are hit by something!")); @@ -411,7 +411,7 @@ void effect_player_lite(player_type *player_ptr, effect_player_type *ep_ptr) player_ptr->window_flags |= (PW_OVERHEAD | PW_DUNGEON); } -void effect_player_dark(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_dark(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かで攻撃された!", "You are hit by something!")); @@ -425,7 +425,7 @@ void effect_player_dark(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -static void effect_player_time_one_disability(player_type *player_ptr) +static void effect_player_time_one_disability(PlayerType *player_ptr) { int k = 0; concptr act = nullptr; @@ -464,7 +464,7 @@ static void effect_player_time_one_disability(player_type *player_ptr) player_ptr->update |= (PU_BONUS); } -static void effect_player_time_all_disabilities(player_type *player_ptr) +static void effect_player_time_all_disabilities(PlayerType *player_ptr) { msg_print(_("あなたは以前ほど力強くなくなってしまった...。", "You're not as powerful as you used to be...")); for (int k = 0; k < A_MAX; k++) { @@ -476,7 +476,7 @@ static void effect_player_time_all_disabilities(player_type *player_ptr) player_ptr->update |= (PU_BONUS); } -static void effect_player_time_addition(player_type *player_ptr) +static void effect_player_time_addition(PlayerType *player_ptr) { switch (randint1(10)) { case 1: @@ -508,7 +508,7 @@ static void effect_player_time_addition(player_type *player_ptr) * @param player_ptr プレイヤー情報への参照ポインタ * @param em_ptr プレイヤー効果情報への参照ポインタ */ -void effect_player_time(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_time(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!")); @@ -526,7 +526,7 @@ void effect_player_time(player_type *player_ptr, effect_player_type *ep_ptr) effect_player_time_addition(player_ptr); } -void effect_player_gravity(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_gravity(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) { msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!")); @@ -555,7 +555,7 @@ void effect_player_gravity(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_disintegration(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_disintegration(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!")); @@ -563,7 +563,7 @@ void effect_player_disintegration(player_type *player_ptr, effect_player_type *e ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_death_ray(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_death_ray(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!")); @@ -572,7 +572,7 @@ void effect_player_death_ray(player_type *player_ptr, effect_player_type *ep_ptr ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_mana(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_mana(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!")); @@ -580,7 +580,7 @@ void effect_player_mana(player_type *player_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_psy_spear(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_psy_spear(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!")); @@ -588,7 +588,7 @@ void effect_player_psy_spear(player_type *player_ptr, effect_player_type *ep_ptr ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_FORCE, ep_ptr->dam, ep_ptr->killer); } -void effect_player_meteor(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_meteor(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!")); @@ -601,7 +601,7 @@ void effect_player_meteor(player_type *player_ptr, effect_player_type *ep_ptr) } } -void effect_player_icee(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_icee(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (player_ptr->blind) { msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!")); @@ -628,7 +628,7 @@ void effect_player_icee(player_type *player_ptr, effect_player_type *ep_ptr) } } -void effect_player_hand_doom(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_hand_doom(PlayerType *player_ptr, effect_player_type *ep_ptr) { if ((randint0(100 + ep_ptr->rlev / 2) < player_ptr->skill_sav) && !check_multishadow(player_ptr)) { msg_print(_("しかし効力を跳ね返した!", "You resist the effects!")); @@ -645,7 +645,7 @@ void effect_player_hand_doom(player_type *player_ptr, effect_player_type *ep_ptr } } -void effect_player_void(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_void(PlayerType *player_ptr, effect_player_type *ep_ptr) { auto effect_mes = player_ptr->blind ? _("何かに身体が引っ張りこまれる!", "Something absorbs you!") : _("周辺の空間が歪んだ。", "Sight warps around you."); @@ -660,7 +660,7 @@ void effect_player_void(player_type *player_ptr, effect_player_type *ep_ptr) } } -void effect_player_abyss(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_abyss(PlayerType *player_ptr, effect_player_type *ep_ptr) { auto effect_mes = player_ptr->blind ? _("身体が沈み込む気がする!", "You feel you are sinking into something!") : _("深淵があなたを誘い込んでいる!", "You are falling in abyss!"); diff --git a/src/effect/effect-player-resist-hurt.h b/src/effect/effect-player-resist-hurt.h index 1a4b15d15..e27e94a9a 100644 --- a/src/effect/effect-player-resist-hurt.h +++ b/src/effect/effect-player-resist-hurt.h @@ -3,35 +3,35 @@ #include "system/angband.h" struct effect_player_type; -struct player_type; +class PlayerType; void effect_player_elements( - player_type *player_ptr, effect_player_type *ep_ptr, concptr attack_message, HIT_POINT (*damage_func)(player_type *, HIT_POINT, concptr, bool)); -void effect_player_poison(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_nuke(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_missile(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_holy_fire(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_hell_fire(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_arrow(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_plasma(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_nether(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_water(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_chaos(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_shards(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_sound(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_confusion(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_disenchant(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_nexus(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_force(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_rocket(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_inertial(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_lite(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_dark(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_time(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_gravity(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_disintegration(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_death_ray(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_mana(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_psy_spear(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_meteor(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_icee(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_hand_doom(player_type *player_ptr, effect_player_type *ep_ptr); + PlayerType *player_ptr, effect_player_type *ep_ptr, concptr attack_message, HIT_POINT (*damage_func)(PlayerType *, HIT_POINT, concptr, bool)); +void effect_player_poison(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_nuke(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_missile(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_holy_fire(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_hell_fire(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_arrow(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_plasma(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_nether(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_water(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_chaos(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_shards(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_sound(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_confusion(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_disenchant(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_nexus(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_force(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_rocket(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_inertial(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_lite(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_dark(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_time(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_gravity(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_disintegration(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_death_ray(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_mana(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_psy_spear(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_meteor(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_icee(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_hand_doom(PlayerType *player_ptr, effect_player_type *ep_ptr); diff --git a/src/effect/effect-player-spirit.cpp b/src/effect/effect-player-spirit.cpp index 463de744b..0f673665c 100644 --- a/src/effect/effect-player-spirit.cpp +++ b/src/effect/effect-player-spirit.cpp @@ -13,7 +13,7 @@ #include "view/display-messages.h" #include "world/world.h" -void effect_player_drain_mana(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_drain_mana(PlayerType *player_ptr, effect_player_type *ep_ptr) { if (check_multishadow(player_ptr)) { msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, but you are unharmed!")); @@ -63,7 +63,7 @@ void effect_player_drain_mana(player_type *player_ptr, effect_player_type *ep_pt ep_ptr->dam = 0; } -void effect_player_mind_blast(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_mind_blast(PlayerType *player_ptr, effect_player_type *ep_ptr) { if ((randint0(100 + ep_ptr->rlev / 2) < std::max(5, player_ptr->skill_sav)) && !check_multishadow(player_ptr)) { msg_print(_("しかし効力を跳ね返した!", "You resist the effects!")); @@ -95,7 +95,7 @@ void effect_player_mind_blast(player_type *player_ptr, effect_player_type *ep_pt ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer); } -void effect_player_brain_smash(player_type *player_ptr, effect_player_type *ep_ptr) +void effect_player_brain_smash(PlayerType *player_ptr, effect_player_type *ep_ptr) { if ((randint0(100 + ep_ptr->rlev / 2) < std::max(5, player_ptr->skill_sav)) && !check_multishadow(player_ptr)) { msg_print(_("しかし効力を跳ね返した!", "You resist the effects!")); diff --git a/src/effect/effect-player-spirit.h b/src/effect/effect-player-spirit.h index 32fabb904..eedcb1ae9 100644 --- a/src/effect/effect-player-spirit.h +++ b/src/effect/effect-player-spirit.h @@ -1,7 +1,7 @@ #pragma once struct effect_player_type; -struct player_type; -void effect_player_drain_mana(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_mind_blast(player_type *player_ptr, effect_player_type *ep_ptr); -void effect_player_brain_smash(player_type *player_ptr, effect_player_type *ep_ptr); +class PlayerType; +void effect_player_drain_mana(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_mind_blast(PlayerType *player_ptr, effect_player_type *ep_ptr); +void effect_player_brain_smash(PlayerType *player_ptr, effect_player_type *ep_ptr); diff --git a/src/effect/effect-player-switcher.cpp b/src/effect/effect-player-switcher.cpp index 388d93bd4..8088da232 100644 --- a/src/effect/effect-player-switcher.cpp +++ b/src/effect/effect-player-switcher.cpp @@ -14,7 +14,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr プレイヤー効果構造体への参照ポインタ */ -void switch_effects_player(player_type *player_ptr, effect_player_type *ep_ptr) +void switch_effects_player(PlayerType *player_ptr, effect_player_type *ep_ptr) { switch (ep_ptr->attribute) { case AttributeType::ACID: diff --git a/src/effect/effect-player-switcher.h b/src/effect/effect-player-switcher.h index 1034f5f74..2ff0247c8 100644 --- a/src/effect/effect-player-switcher.h +++ b/src/effect/effect-player-switcher.h @@ -1,5 +1,5 @@ #pragma once struct effect_player_type; -struct player_type; -void switch_effects_player(player_type *player_ptr, effect_player_type *ep_ptr); +class PlayerType; +void switch_effects_player(PlayerType *player_ptr, effect_player_type *ep_ptr); diff --git a/src/effect/effect-player.cpp b/src/effect/effect-player.cpp index d251f478e..516c701a7 100644 --- a/src/effect/effect-player.cpp +++ b/src/effect/effect-player.cpp @@ -64,7 +64,7 @@ static effect_player_type *initialize_effect_player(effect_player_type *ep_ptr, * @param ep_ptr プレイヤー効果構造体への参照ポインタ * @return 当たったらFALSE、反射したらTRUE */ -static bool process_bolt_reflection(player_type *player_ptr, effect_player_type *ep_ptr, project_func project) +static bool process_bolt_reflection(PlayerType *player_ptr, effect_player_type *ep_ptr, project_func project) { auto can_reflect = (has_reflect(player_ptr) != 0); can_reflect &= any_bits(ep_ptr->flag, PROJECT_REFLECTABLE); @@ -119,7 +119,7 @@ static bool process_bolt_reflection(player_type *player_ptr, effect_player_type * @param x 目標X座標 * @return 当たらなかったらFALSE、反射したらTRUE、当たったらCONTINUE */ -static process_result check_continue_player_effect(player_type *player_ptr, effect_player_type *ep_ptr, POSITION y, POSITION x, project_func project) +static process_result check_continue_player_effect(PlayerType *player_ptr, effect_player_type *ep_ptr, POSITION y, POSITION x, project_func project) { if (!player_bold(player_ptr, y, x)) { return PROCESS_FALSE; @@ -150,7 +150,7 @@ static process_result check_continue_player_effect(player_type *player_ptr, effe * @param ep_ptr プレイヤー効果構造体への参照ポインタ * @param who_name モンスター名 */ -static void describe_effect_source(player_type *player_ptr, effect_player_type *ep_ptr, concptr who_name) +static void describe_effect_source(PlayerType *player_ptr, effect_player_type *ep_ptr, concptr who_name) { if (ep_ptr->who > 0) { ep_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[ep_ptr->who]; @@ -188,7 +188,7 @@ static void describe_effect_source(player_type *player_ptr, effect_player_type * * @param monspell 効果元のモンスター魔法ID * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE */ -bool affect_player(MONSTER_IDX who, player_type *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, +bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, project_func project) { effect_player_type tmp_effect; diff --git a/src/effect/effect-player.h b/src/effect/effect-player.h index 866ce6399..3c63a4cc9 100644 --- a/src/effect/effect-player.h +++ b/src/effect/effect-player.h @@ -5,9 +5,9 @@ struct ProjectResult; -struct player_type; +class PlayerType; using project_func = ProjectResult (*)( - player_type *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag); + PlayerType *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag); -bool affect_player(MONSTER_IDX who, player_type *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag, +bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag, project_func project); diff --git a/src/effect/effect-processor.cpp b/src/effect/effect-processor.cpp index 99cd453f8..d48393ebe 100644 --- a/src/effect/effect-processor.cpp +++ b/src/effect/effect-processor.cpp @@ -45,7 +45,7 @@ * @param cury 現在の鏡のy座標 * @param curx 現在の鏡のx座標 */ -static void next_mirror(player_type *player_ptr, POSITION *next_y, POSITION *next_x, POSITION cury, POSITION curx) +static void next_mirror(PlayerType *player_ptr, POSITION *next_y, POSITION *next_x, POSITION cury, POSITION curx) { POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */ int mirror_num = 0; /* 鏡の数 */ @@ -87,7 +87,7 @@ static void next_mirror(player_type *player_ptr, POSITION *next_y, POSITION *nex * @todo 似たような処理が山ほど並んでいる、何とかならないものか * @todo 引数にそのまま再代入していてカオスすぎる。直すのは簡単ではない */ -ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, +ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, const AttributeType typ, BIT_FLAGS flag) { int dist; diff --git a/src/effect/effect-processor.h b/src/effect/effect-processor.h index 8418d3ae2..c383f4799 100644 --- a/src/effect/effect-processor.h +++ b/src/effect/effect-processor.h @@ -12,7 +12,7 @@ struct ProjectResult { }; struct effect_player_type; -struct player_type; +class PlayerType; ProjectResult project( - player_type *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, const AttributeType typ, + PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, const AttributeType typ, BIT_FLAGS flag); diff --git a/src/flavor/flavor-describer.cpp b/src/flavor/flavor-describer.cpp index cf7fddd00..c2cb4393c 100644 --- a/src/flavor/flavor-describer.cpp +++ b/src/flavor/flavor-describer.cpp @@ -127,7 +127,7 @@ static void decide_tval_show(flavor_type *flavor_ptr) flavor_ptr->show_armour = true; } -static void describe_weapon_dice(player_type *player_ptr, flavor_type *flavor_ptr) +static void describe_weapon_dice(PlayerType *player_ptr, flavor_type *flavor_ptr) { if (!flavor_ptr->known && object_is_quest_target(player_ptr->current_floor_ptr->inside_quest, flavor_ptr->o_ptr)) return; @@ -142,7 +142,7 @@ static void describe_weapon_dice(player_type *player_ptr, flavor_type *flavor_pt flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2); } -static void describe_bow(player_type *player_ptr, flavor_type *flavor_ptr) +static void describe_bow(PlayerType *player_ptr, flavor_type *flavor_ptr) { flavor_ptr->power = bow_tmul(flavor_ptr->o_ptr->sval); if (flavor_ptr->tr_flags.has(TR_XTRA_MIGHT)) @@ -175,7 +175,7 @@ static void describe_bow(player_type *player_ptr, flavor_type *flavor_ptr) flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2); } -static void describe_tval(player_type *player_ptr, flavor_type *flavor_ptr) +static void describe_tval(PlayerType *player_ptr, flavor_type *flavor_ptr) { switch (flavor_ptr->o_ptr->tval) { case ItemKindType::SHOT: @@ -227,7 +227,7 @@ static void describe_named_item_tval(flavor_type *flavor_ptr) } } -static void describe_fire_energy(player_type *player_ptr, flavor_type *flavor_ptr) +static void describe_fire_energy(PlayerType *player_ptr, flavor_type *flavor_ptr) { ENERGY energy_fire = bow_energy(flavor_ptr->bow_ptr->sval); if (player_ptr->num_fire == 0) { @@ -253,7 +253,7 @@ static void describe_fire_energy(player_type *player_ptr, flavor_type *flavor_pt flavor_ptr->t = object_desc_str(flavor_ptr->t, show_ammo_detail ? "% crit" : "%"); } -static void describe_bow_power(player_type *player_ptr, flavor_type *flavor_ptr) +static void describe_bow_power(PlayerType *player_ptr, flavor_type *flavor_ptr) { flavor_ptr->avgdam = flavor_ptr->o_ptr->dd * (flavor_ptr->o_ptr->ds + 1) * 10 / 2; int tmul = bow_tmul(flavor_ptr->bow_ptr->sval); @@ -289,7 +289,7 @@ static void describe_bow_power(player_type *player_ptr, flavor_type *flavor_ptr) flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2); } -static void describe_spike_power(player_type *player_ptr, flavor_type *flavor_ptr) +static void describe_spike_power(PlayerType *player_ptr, flavor_type *flavor_ptr) { int avgdam = player_ptr->mighty_throw ? (1 + 3) : 1; int16_t energy_fire = 100 - player_ptr->lev; @@ -502,7 +502,7 @@ static void decide_item_feeling(flavor_type *flavor_ptr) * @param mode 表記に関するオプション指定 * @return 現在クエスト達成目的のアイテムならばTRUEを返す */ -void describe_flavor(player_type *player_ptr, char *buf, object_type *o_ptr, BIT_FLAGS mode) +void describe_flavor(PlayerType *player_ptr, char *buf, object_type *o_ptr, BIT_FLAGS mode) { flavor_type tmp_flavor; flavor_type *flavor_ptr = initialize_flavor_type(&tmp_flavor, buf, o_ptr, mode); diff --git a/src/flavor/flavor-describer.h b/src/flavor/flavor-describer.h index eae02f82f..fbad406c8 100644 --- a/src/flavor/flavor-describer.h +++ b/src/flavor/flavor-describer.h @@ -3,5 +3,5 @@ #include "system/angband.h" struct object_type; -struct player_type; -void describe_flavor(player_type *player_ptr, char *buf, object_type *o_ptr, BIT_FLAGS mode); +class PlayerType; +void describe_flavor(PlayerType *player_ptr, char *buf, object_type *o_ptr, BIT_FLAGS mode); diff --git a/src/flavor/flavor-util.h b/src/flavor/flavor-util.h index ee5b202c8..e3c31d1fc 100644 --- a/src/flavor/flavor-util.h +++ b/src/flavor/flavor-util.h @@ -40,7 +40,7 @@ typedef struct flavor_type { int avgdam; } flavor_type; -struct player_type; +class PlayerType; flavor_type *initialize_flavor_type(flavor_type *flavor_ptr, char *buf, object_type *o_ptr, BIT_FLAGS mode); char *object_desc_chr(char *t, char c); char *object_desc_str(char *t, concptr s); diff --git a/src/flavor/named-item-describer.cpp b/src/flavor/named-item-describer.cpp index e71654f4c..39cfa71ef 100644 --- a/src/flavor/named-item-describer.cpp +++ b/src/flavor/named-item-describer.cpp @@ -350,7 +350,7 @@ static void describe_inscription(flavor_type *flavor_ptr) } } -void describe_named_item(player_type *player_ptr, flavor_type *flavor_ptr) +void describe_named_item(PlayerType *player_ptr, flavor_type *flavor_ptr) { check_object_known_aware(flavor_ptr); switch_tval_description(flavor_ptr); diff --git a/src/flavor/named-item-describer.h b/src/flavor/named-item-describer.h index 4935e42df..642a98adb 100644 --- a/src/flavor/named-item-describer.h +++ b/src/flavor/named-item-describer.h @@ -1,5 +1,5 @@ #pragma once struct flavor_type; -struct player_type; -void describe_named_item(player_type *player_ptr, flavor_type *flavor_ptr); +class PlayerType; +void describe_named_item(PlayerType *player_ptr, flavor_type *flavor_ptr); diff --git a/src/floor/cave-generator.cpp b/src/floor/cave-generator.cpp index 6004a2657..0821bcb18 100644 --- a/src/floor/cave-generator.cpp +++ b/src/floor/cave-generator.cpp @@ -48,7 +48,7 @@ static dun_data_type *initialize_dun_data_type(dun_data_type *dd_ptr, concptr *w return dd_ptr; } -static void check_arena_floor(player_type *player_ptr, dun_data_type *dd_ptr) +static void check_arena_floor(PlayerType *player_ptr, dun_data_type *dd_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!dd_ptr->empty_level) { @@ -74,7 +74,7 @@ static void check_arena_floor(player_type *player_ptr, dun_data_type *dd_ptr) } } -static void place_cave_contents(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) +static void place_cave_contents(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (floor_ptr->dun_level == 1) @@ -99,7 +99,7 @@ static void place_cave_contents(player_type *player_ptr, dun_data_type *dd_ptr, } } -static bool decide_tunnel_planned_site(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr, dt_type *dt_ptr, int i) +static bool decide_tunnel_planned_site(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr, dt_type *dt_ptr, int i) { dd_ptr->tunn_n = 0; dd_ptr->wall_n = 0; @@ -116,7 +116,7 @@ static bool decide_tunnel_planned_site(player_type *player_ptr, dun_data_type *d return true; } -static void make_tunnels(player_type *player_ptr, dun_data_type *dd_ptr) +static void make_tunnels(PlayerType *player_ptr, dun_data_type *dd_ptr) { for (int j = 0; j < dd_ptr->tunn_n; j++) { grid_type *g_ptr; @@ -132,7 +132,7 @@ static void make_tunnels(player_type *player_ptr, dun_data_type *dd_ptr) } } -static void make_walls(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr, dt_type *dt_ptr) +static void make_walls(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr, dt_type *dt_ptr) { for (int j = 0; j < dd_ptr->wall_n; j++) { grid_type *g_ptr; @@ -146,7 +146,7 @@ static void make_walls(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_t } } -static bool make_centers(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr, dt_type *dt_ptr) +static bool make_centers(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr, dt_type *dt_ptr) { dd_ptr->tunnel_fail_count = 0; dd_ptr->door_n = 0; @@ -165,7 +165,7 @@ static bool make_centers(player_type *player_ptr, dun_data_type *dd_ptr, dungeon return true; } -static void make_doors(player_type *player_ptr, dun_data_type *dd_ptr, dt_type *dt_ptr) +static void make_doors(PlayerType *player_ptr, dun_data_type *dd_ptr, dt_type *dt_ptr) { for (int i = 0; i < dd_ptr->door_n; i++) { dd_ptr->tunnel_y = dd_ptr->door[i].y; @@ -187,7 +187,7 @@ static void make_only_tunnel_points(floor_type *floor_ptr, dun_data_type *dd_ptr } } -static bool make_one_floor(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) +static bool make_one_floor(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -220,7 +220,7 @@ static bool make_one_floor(player_type *player_ptr, dun_data_type *dd_ptr, dunge return true; } -static bool switch_making_floor(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) +static bool switch_making_floor(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) { if (d_ptr->flags.has(DungeonFeatureType::MAZE)) { floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -244,7 +244,7 @@ static bool switch_making_floor(player_type *player_ptr, dun_data_type *dd_ptr, return true; } -static void make_aqua_streams(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) +static void make_aqua_streams(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) { if (dd_ptr->laketype != 0) return; @@ -262,7 +262,7 @@ static void make_aqua_streams(player_type *player_ptr, dun_data_type *dd_ptr, du * @brief マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall * @param g_ptr 永久壁を配置したいマス構造体の参照ポインタ */ -static void place_bound_perm_wall(player_type *player_ptr, grid_type *g_ptr) +static void place_bound_perm_wall(PlayerType *player_ptr, grid_type *g_ptr) { if (bound_walls_perm) { g_ptr->mimic = 0; @@ -279,7 +279,7 @@ static void place_bound_perm_wall(player_type *player_ptr, grid_type *g_ptr) place_grid(player_ptr, g_ptr, GB_SOLID_PERM); } -static void make_perm_walls(player_type *player_ptr) +static void make_perm_walls(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (POSITION x = 0; x < floor_ptr->width; x++) { @@ -293,7 +293,7 @@ static void make_perm_walls(player_type *player_ptr) } } -static bool check_place_necessary_objects(player_type *player_ptr, dun_data_type *dd_ptr) +static bool check_place_necessary_objects(PlayerType *player_ptr, dun_data_type *dd_ptr) { if (!new_player_spot(player_ptr)) { *dd_ptr->why = _("プレイヤー配置に失敗", "Failed to place a player"); @@ -308,7 +308,7 @@ static bool check_place_necessary_objects(player_type *player_ptr, dun_data_type return true; } -static void decide_dungeon_data_allocation(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) +static void decide_dungeon_data_allocation(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; dd_ptr->alloc_object_num = floor_ptr->dun_level / 3; @@ -333,7 +333,7 @@ static void decide_dungeon_data_allocation(player_type *player_ptr, dun_data_typ dd_ptr->alloc_monster_num); } -static bool allocate_dungeon_data(player_type *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) +static bool allocate_dungeon_data(PlayerType *player_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr) { dd_ptr->alloc_monster_num += randint1(8); for (dd_ptr->alloc_monster_num = dd_ptr->alloc_monster_num + dd_ptr->alloc_object_num; dd_ptr->alloc_monster_num > 0; dd_ptr->alloc_monster_num--) @@ -378,7 +378,7 @@ static void decide_grid_glowing(floor_type *floor_ptr, dun_data_type *dd_ptr, du * @param why エラー原因メッセージを返す * @return ダンジョン生成が全て無事に成功したらTRUEを返す。 */ -bool cave_gen(player_type *player_ptr, concptr *why) +bool cave_gen(PlayerType *player_ptr, concptr *why) { floor_type *floor_ptr = player_ptr->current_floor_ptr; reset_lite_area(floor_ptr); diff --git a/src/floor/cave-generator.h b/src/floor/cave-generator.h index efffc0f88..e54bd7764 100644 --- a/src/floor/cave-generator.h +++ b/src/floor/cave-generator.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool cave_gen(player_type *player_ptr, concptr *why); +class PlayerType; +bool cave_gen(PlayerType *player_ptr, concptr *why); diff --git a/src/floor/cave.cpp b/src/floor/cave.cpp index fa7539145..f6839a802 100644 --- a/src/floor/cave.cpp +++ b/src/floor/cave.cpp @@ -39,7 +39,7 @@ bool in_bounds2u(floor_type *floor_ptr, POSITION y, POSITION x) { return (y < fl * Line 2 -- forbid normal monsters * Line 3 -- forbid the player */ -bool is_cave_empty_bold(player_type *player_ptr, POSITION y, POSITION x) +bool is_cave_empty_bold(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; bool is_empty_grid = cave_has_flag_bold(floor_ptr, y, x, FloorFeatureType::PLACE); @@ -55,7 +55,7 @@ bool is_cave_empty_bold(player_type *player_ptr, POSITION y, POSITION x) * Line 1 -- forbid non-empty grids * Line 2 -- forbid trees while dungeon generation */ -bool is_cave_empty_bold2(player_type *player_ptr, POSITION y, POSITION x) +bool is_cave_empty_bold2(PlayerType *player_ptr, POSITION y, POSITION x) { bool is_empty_grid = is_cave_empty_bold(player_ptr, y, x); is_empty_grid &= w_ptr->character_dungeon || !cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, FloorFeatureType::TREE); @@ -70,7 +70,7 @@ bool cave_has_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, FloorFeat /* * Determine if a "legal" grid is within "los" of the player */ -bool player_has_los_bold(player_type *player_ptr, POSITION y, POSITION x) +bool player_has_los_bold(PlayerType *player_ptr, POSITION y, POSITION x) { return ((player_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_VIEW) != 0) || player_ptr->phase_out; } @@ -78,7 +78,7 @@ bool player_has_los_bold(player_type *player_ptr, POSITION y, POSITION x) /* * Determine if player is on this grid */ -bool player_bold(player_type *player_ptr, POSITION y, POSITION x) { return (y == player_ptr->y) && (x == player_ptr->x); } +bool player_bold(PlayerType *player_ptr, POSITION y, POSITION x) { return (y == player_ptr->y) && (x == player_ptr->x); } /* * Does the grid stop disintegration? diff --git a/src/floor/cave.h b/src/floor/cave.h index 97ede1567..649c7483e 100644 --- a/src/floor/cave.h +++ b/src/floor/cave.h @@ -4,16 +4,16 @@ struct floor_type; struct grid_type; -struct player_type; +class PlayerType; enum class FloorFeatureType; bool in_bounds(floor_type *floor_ptr, POSITION y, POSITION x); bool in_bounds2(floor_type *floor_ptr, POSITION y, POSITION x); bool in_bounds2u(floor_type *floor_ptr, POSITION y, POSITION x); -bool is_cave_empty_bold(player_type *player_ptr, POSITION x, POSITION y); -bool is_cave_empty_bold2(player_type *player_ptr, POSITION x, POSITION y); +bool is_cave_empty_bold(PlayerType *player_ptr, POSITION x, POSITION y); +bool is_cave_empty_bold2(PlayerType *player_ptr, POSITION x, POSITION y); bool cave_has_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, FloorFeatureType f_idx); -bool player_has_los_bold(player_type *player_ptr, POSITION y, POSITION x); -bool player_bold(player_type *player_ptr, POSITION y, POSITION x); +bool player_has_los_bold(PlayerType *player_ptr, POSITION y, POSITION x); +bool player_bold(PlayerType *player_ptr, POSITION y, POSITION x); bool cave_stop_disintegration(floor_type *floor_ptr, POSITION y, POSITION x); bool cave_los_bold(floor_type *floor_ptr, POSITION y, POSITION x); bool feat_supports_los(FEAT_IDX f_idx); diff --git a/src/floor/fixed-map-generator.cpp b/src/floor/fixed-map-generator.cpp index 9c90460a4..17e5d12d8 100644 --- a/src/floor/fixed-map-generator.cpp +++ b/src/floor/fixed-map-generator.cpp @@ -74,7 +74,7 @@ static void drop_here(floor_type *floor_ptr, object_type *j_ptr, POSITION y, POS g_ptr->o_idx_list.add(floor_ptr, o_idx); } -static void generate_artifact(player_type *player_ptr, qtwg_type *qtwg_ptr, const ARTIFACT_IDX artifact_index) +static void generate_artifact(PlayerType *player_ptr, qtwg_type *qtwg_ptr, const ARTIFACT_IDX artifact_index) { if (artifact_index == 0) return; @@ -91,7 +91,7 @@ static void generate_artifact(player_type *player_ptr, qtwg_type *qtwg_ptr, cons drop_here(player_ptr->current_floor_ptr, q_ptr, *qtwg_ptr->y, *qtwg_ptr->x); } -static void parse_qtw_D(player_type *player_ptr, qtwg_type *qtwg_ptr, char *s) +static void parse_qtw_D(PlayerType *player_ptr, qtwg_type *qtwg_ptr, char *s) { *qtwg_ptr->x = qtwg_ptr->xmin; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -311,7 +311,7 @@ static int parse_qtw_Q(qtwg_type *qtwg_ptr, char **zz) return PARSE_ERROR_GENERIC; } -static bool parse_qtw_P(player_type *player_ptr, qtwg_type *qtwg_ptr, char **zz) +static bool parse_qtw_P(PlayerType *player_ptr, qtwg_type *qtwg_ptr, char **zz) { if (qtwg_ptr->buf[0] != 'P') return false; @@ -393,7 +393,7 @@ static bool parse_qtw_M(qtwg_type *qtwg_ptr, char **zz) * @return エラーコード * @todo クエスト情報のみを読み込む手段と実際にフロアデータまで読み込む処理は分離したい */ -parse_error_type generate_fixed_map_floor(player_type *player_ptr, qtwg_type *qtwg_ptr, process_dungeon_file_pf parse_fixed_map) +parse_error_type generate_fixed_map_floor(PlayerType *player_ptr, qtwg_type *qtwg_ptr, process_dungeon_file_pf parse_fixed_map) { char *zz[33]; if (!qtwg_ptr->buf[0]) diff --git a/src/floor/fixed-map-generator.h b/src/floor/fixed-map-generator.h index 2bbb8884c..b6cc3c5b3 100644 --- a/src/floor/fixed-map-generator.h +++ b/src/floor/fixed-map-generator.h @@ -14,8 +14,8 @@ typedef struct qtwg_type { int *x; } qtwg_type; -struct player_type; -typedef parse_error_type (*process_dungeon_file_pf)(player_type *, concptr, int, int, int, int); +class PlayerType; +typedef parse_error_type (*process_dungeon_file_pf)(PlayerType *, concptr, int, int, int, int); qtwg_type *initialize_quest_generator_type(qtwg_type *qg_ptr, char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x); -parse_error_type generate_fixed_map_floor(player_type *player_ptr, qtwg_type *qg_ptr, process_dungeon_file_pf parse_fixed_map); +parse_error_type generate_fixed_map_floor(PlayerType *player_ptr, qtwg_type *qg_ptr, process_dungeon_file_pf parse_fixed_map); diff --git a/src/floor/floor-changer.cpp b/src/floor/floor-changer.cpp index d49883718..958f35851 100644 --- a/src/floor/floor-changer.cpp +++ b/src/floor/floor-changer.cpp @@ -49,7 +49,7 @@ /*! * @brief 階段移動先のフロアが生成できない時に簡単な行き止まりマップを作成する / Builds the dead end */ -static void build_dead_end(player_type *player_ptr) +static void build_dead_end(PlayerType *player_ptr) { clear_cave(player_ptr); player_ptr->x = player_ptr->y = 0; @@ -66,7 +66,7 @@ static void build_dead_end(player_type *player_ptr) wipe_generate_random_floor_flags(player_ptr->current_floor_ptr); } -static MONSTER_IDX decide_pet_index(player_type *player_ptr, const int current_monster, POSITION *cy, POSITION *cx) +static MONSTER_IDX decide_pet_index(PlayerType *player_ptr, const int current_monster, POSITION *cy, POSITION *cx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (current_monster == 0) { @@ -96,7 +96,7 @@ static MONSTER_IDX decide_pet_index(player_type *player_ptr, const int current_m return (d == 6) ? 0 : m_pop(floor_ptr); } -static void set_pet_params(player_type *player_ptr, monster_race **r_ptr, const int current_monster, MONSTER_IDX m_idx, const POSITION cy, const POSITION cx) +static void set_pet_params(PlayerType *player_ptr, monster_race **r_ptr, const int current_monster, MONSTER_IDX m_idx, const POSITION cy, const POSITION cx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; player_ptr->current_floor_ptr->grid_array[cy][cx].m_idx = m_idx; @@ -119,7 +119,7 @@ static void set_pet_params(player_type *player_ptr, monster_race **r_ptr, const * @brief 移動先のフロアに伴ったペットを配置する / Place preserved pet monsters on new floor * @param player_ptr プレイヤーへの参照ポインタ */ -static void place_pet(player_type *player_ptr) +static void place_pet(PlayerType *player_ptr) { int max_num = player_ptr->wild_mode ? 1 : MAX_PARTY_MON; for (int current_monster = 0; current_monster < max_num; current_monster++) { @@ -186,7 +186,7 @@ static void update_unique_artifact(floor_type *floor_ptr, int16_t cur_floor_id) } } -static void check_visited_floor(player_type *player_ptr, saved_floor_type *sf_ptr, bool *loaded) +static void check_visited_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr, bool *loaded) { if ((sf_ptr->last_visit == 0) || !load_floor(player_ptr, sf_ptr, 0)) return; @@ -205,7 +205,7 @@ static void check_visited_floor(player_type *player_ptr, saved_floor_type *sf_pt g_ptr->special = 0; } -static void update_floor_id(player_type *player_ptr, saved_floor_type *sf_ptr) +static void update_floor_id(PlayerType *player_ptr, saved_floor_type *sf_ptr) { if (player_ptr->floor_id == 0) { if (player_ptr->change_floor_mode & CFM_UP) @@ -228,7 +228,7 @@ static void update_floor_id(player_type *player_ptr, saved_floor_type *sf_ptr) sf_ptr->upper_floor_id = player_ptr->floor_id; } -static void reset_unique_by_floor_change(player_type *player_ptr) +static void reset_unique_by_floor_change(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (MONSTER_IDX i = 1; i < floor_ptr->m_max; i++) { @@ -256,7 +256,7 @@ static void reset_unique_by_floor_change(player_type *player_ptr) } } -static void new_floor_allocation(player_type *player_ptr, saved_floor_type *sf_ptr) +static void new_floor_allocation(PlayerType *player_ptr, saved_floor_type *sf_ptr) { GAME_TURN tmp_last_visit = sf_ptr->last_visit; int alloc_chance = d_info[player_ptr->dungeon_idx].max_m_alloc_chance; @@ -285,7 +285,7 @@ static void new_floor_allocation(player_type *player_ptr, saved_floor_type *sf_p (void)alloc_monster(player_ptr, 0, 0, summon_specific); } -static void check_dead_end(player_type *player_ptr, saved_floor_type *sf_ptr) +static void check_dead_end(PlayerType *player_ptr, saved_floor_type *sf_ptr) { if (sf_ptr->last_visit == 0) { generate_floor(player_ptr); @@ -300,7 +300,7 @@ static void check_dead_end(player_type *player_ptr, saved_floor_type *sf_ptr) sf_ptr->lower_floor_id = 0; } -static void update_new_floor_feature(player_type *player_ptr, saved_floor_type *sf_ptr, const bool loaded) +static void update_new_floor_feature(PlayerType *player_ptr, saved_floor_type *sf_ptr, const bool loaded) { if (loaded) { new_floor_allocation(player_ptr, sf_ptr); @@ -323,7 +323,7 @@ static void update_new_floor_feature(player_type *player_ptr, saved_floor_type * g_ptr->special = player_ptr->floor_id; } -static void cut_off_the_upstair(player_type *player_ptr) +static void cut_off_the_upstair(PlayerType *player_ptr) { if (player_ptr->change_floor_mode & CFM_RAND_PLACE) { (void)new_player_spot(player_ptr); @@ -339,7 +339,7 @@ static void cut_off_the_upstair(player_type *player_ptr) msg_print(_("ゴトゴトと何か音がした。", "You hear some noises.")); } -static void update_floor(player_type *player_ptr) +static void update_floor(PlayerType *player_ptr) { if (!(player_ptr->change_floor_mode & CFM_SAVE_FLOORS) && !(player_ptr->change_floor_mode & CFM_FIRST_FLOOR)) { generate_floor(player_ptr); @@ -368,7 +368,7 @@ static void update_floor(player_type *player_ptr) * restored from the temporary file. If the floor is new one, new floor\n * will be generated.\n */ -void change_floor(player_type *player_ptr) +void change_floor(PlayerType *player_ptr) { w_ptr->character_dungeon = false; player_ptr->dtrap = false; diff --git a/src/floor/floor-changer.h b/src/floor/floor-changer.h index 206285ec2..21ea1a6c0 100644 --- a/src/floor/floor-changer.h +++ b/src/floor/floor-changer.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void change_floor(player_type *player_ptr); +class PlayerType; +void change_floor(PlayerType *player_ptr); diff --git a/src/floor/floor-events.cpp b/src/floor/floor-events.cpp index 583e74379..68fcb4fe5 100644 --- a/src/floor/floor-events.cpp +++ b/src/floor/floor-events.cpp @@ -43,7 +43,7 @@ #include "view/display-messages.h" #include "world/world.h" -void day_break(player_type *player_ptr) +void day_break(PlayerType *player_ptr) { msg_print(_("夜が明けた。", "The sun has risen.")); floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -67,7 +67,7 @@ void day_break(player_type *player_ptr) set_superstealth(player_ptr, false); } -void night_falls(player_type *player_ptr) +void night_falls(PlayerType *player_ptr) { msg_print(_("日が沈んだ。", "The sun has fallen.")); floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -108,7 +108,7 @@ static int rating_boost(int delta) { return delta * delta + 50 * delta; } * / Examine all monsters and unidentified objects, and get the feeling of current dungeon floor * @return 算出されたダンジョンの雰囲気ランク */ -static byte get_dungeon_feeling(player_type *player_ptr) +static byte get_dungeon_feeling(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!floor_ptr->dun_level) @@ -228,7 +228,7 @@ static byte get_dungeon_feeling(player_type *player_ptr) * @brief ダンジョンの雰囲気を更新し、変化があった場合メッセージを表示する * / Update dungeon feeling, and announce it if changed */ -void update_dungeon_feeling(player_type *player_ptr) +void update_dungeon_feeling(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!floor_ptr->dun_level) @@ -262,7 +262,7 @@ void update_dungeon_feeling(player_type *player_ptr) /* * Glow deep lava and building entrances in the floor */ -void glow_deep_lava_and_bldg(player_type *player_ptr) +void glow_deep_lava_and_bldg(PlayerType *player_ptr) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) return; diff --git a/src/floor/floor-events.h b/src/floor/floor-events.h index 141902a7e..d0568438d 100644 --- a/src/floor/floor-events.h +++ b/src/floor/floor-events.h @@ -1,10 +1,10 @@ #pragma once -struct player_type; +class PlayerType; struct floor_type; -void day_break(player_type *player_ptr); -void night_falls(player_type *player_ptr); -void update_dungeon_feeling(player_type *player_ptr); -void glow_deep_lava_and_bldg(player_type *player_ptr); +void day_break(PlayerType *player_ptr); +void night_falls(PlayerType *player_ptr); +void update_dungeon_feeling(PlayerType *player_ptr); +void glow_deep_lava_and_bldg(PlayerType *player_ptr); void forget_lite(floor_type *floor_ptr); void forget_view(floor_type *floor_ptr); diff --git a/src/floor/floor-generator.cpp b/src/floor/floor-generator.cpp index 04fcce7de..dd519b94a 100644 --- a/src/floor/floor-generator.cpp +++ b/src/floor/floor-generator.cpp @@ -59,7 +59,7 @@ * @brief 闘技場用のアリーナ地形を作成する / Builds the on_defeat_arena_monster after it is entered -KMW- * @param player_ptr プレイヤーへの参照ポインタ */ -static void build_arena(player_type *player_ptr, POSITION *start_y, POSITION *start_x) +static void build_arena(PlayerType *player_ptr, POSITION *start_y, POSITION *start_x) { POSITION yval = SCREEN_HGT / 2; POSITION xval = SCREEN_WID / 2; @@ -110,7 +110,7 @@ static void build_arena(player_type *player_ptr, POSITION *start_y, POSITION *st /*! * @brief 挑戦時闘技場への入場処理 / Town logic flow for generation of on_defeat_arena_monster -KMW- */ -static void generate_challenge_arena(player_type *player_ptr) +static void generate_challenge_arena(PlayerType *player_ptr) { POSITION qy = 0; POSITION qx = 0; @@ -143,7 +143,7 @@ static void generate_challenge_arena(player_type *player_ptr) * @brief モンスター闘技場のフロア生成 / Builds the on_defeat_arena_monster after it is entered -KMW- * @param player_ptr プレイヤーへの参照ポインタ */ -static void build_battle(player_type *player_ptr, POSITION *y, POSITION *x) +static void build_battle(PlayerType *player_ptr, POSITION *y, POSITION *x) { POSITION yval = SCREEN_HGT / 2; POSITION xval = SCREEN_WID / 2; @@ -202,7 +202,7 @@ static void build_battle(player_type *player_ptr, POSITION *y, POSITION *x) /*! * @brief モンスター闘技場への導入処理 / Town logic flow for generation of on_defeat_arena_monster -KMW- */ -static void generate_gambling_arena(player_type *player_ptr) +static void generate_gambling_arena(PlayerType *player_ptr) { POSITION y, x; POSITION qy = 0; @@ -239,7 +239,7 @@ static void generate_gambling_arena(player_type *player_ptr) * @brief 固定マップクエストのフロア生成 / Generate a quest level * @param player_ptr プレイヤーへの参照ポインタ */ -static void generate_fixed_floor(player_type *player_ptr) +static void generate_fixed_floor(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (POSITION y = 0; y < floor_ptr->height; y++) @@ -264,7 +264,7 @@ static void generate_fixed_floor(player_type *player_ptr) * @param concptr * @return フロアの生成に成功したらTRUE */ -static bool level_gen(player_type *player_ptr, concptr *why) +static bool level_gen(PlayerType *player_ptr, concptr *why) { floor_type *floor_ptr = player_ptr->current_floor_ptr; DUNGEON_IDX d_idx = floor_ptr->dungeon_idx; @@ -328,7 +328,7 @@ void wipe_generate_random_floor_flags(floor_type *floor_ptr) * @brief フロアの全情報を初期化する / Clear and empty floor. * @parama player_ptr プレイヤーへの参照ポインタ */ -void clear_cave(player_type *player_ptr) +void clear_cave(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; std::fill_n(floor_ptr->o_list.begin(), floor_ptr->o_max, object_type{}); @@ -453,7 +453,7 @@ static bool floor_is_connected(const floor_type *const floor_ptr, const IsWallFu * @parama player_ptr プレイヤーへの参照ポインタ * @note Hack -- regenerate any "overflow" levels */ -void generate_floor(player_type *player_ptr) +void generate_floor(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; floor_ptr->dungeon_idx = player_ptr->dungeon_idx; diff --git a/src/floor/floor-generator.h b/src/floor/floor-generator.h index 2e1e9de49..b7e722eff 100644 --- a/src/floor/floor-generator.h +++ b/src/floor/floor-generator.h @@ -1,7 +1,7 @@ #pragma once struct floor_type; -struct player_type; +class PlayerType; void wipe_generate_random_floor_flags(floor_type *floor_ptr); -void clear_cave(player_type *player_ptr); -void generate_floor(player_type *player_ptr); +void clear_cave(PlayerType *player_ptr); +void generate_floor(PlayerType *player_ptr); diff --git a/src/floor/floor-leaver.cpp b/src/floor/floor-leaver.cpp index 972b1efcc..3d9517fe4 100644 --- a/src/floor/floor-leaver.cpp +++ b/src/floor/floor-leaver.cpp @@ -42,7 +42,7 @@ #include "view/display-messages.h" #include "world/world.h" -static void check_riding_preservation(player_type *player_ptr) +static void check_riding_preservation(PlayerType *player_ptr) { if (!player_ptr->riding) return; @@ -58,7 +58,7 @@ static void check_riding_preservation(player_type *player_ptr) } } -static bool check_pet_preservation_conditions(player_type *player_ptr, monster_type *m_ptr) +static bool check_pet_preservation_conditions(PlayerType *player_ptr, monster_type *m_ptr) { if (reinit_wilderness) return false; @@ -79,7 +79,7 @@ static bool check_pet_preservation_conditions(player_type *player_ptr, monster_t return false; } -static void sweep_preserving_pet(player_type *player_ptr) +static void sweep_preserving_pet(PlayerType *player_ptr) { if (player_ptr->wild_mode || player_ptr->current_floor_ptr->inside_arena || player_ptr->phase_out) return; @@ -95,7 +95,7 @@ static void sweep_preserving_pet(player_type *player_ptr) } } -static void record_pet_diary(player_type *player_ptr) +static void record_pet_diary(PlayerType *player_ptr) { if (!record_named_pet) return; @@ -115,7 +115,7 @@ static void record_pet_diary(player_type *player_ptr) * @brief フロア移動時のペット保存処理 / Preserve_pets * @param player_ptr プレイヤーへの参照ポインタ */ -static void preserve_pet(player_type *player_ptr) +static void preserve_pet(PlayerType *player_ptr) { for (MONSTER_IDX party_monster_num = 0; party_monster_num < MAX_PARTY_MON; party_monster_num++) party_mon[party_monster_num].r_idx = 0; @@ -142,7 +142,7 @@ static void preserve_pet(player_type *player_ptr) * @brief 新フロアに移動元フロアに繋がる階段を配置する / Virtually teleport onto the stairs that is connecting between two floors. * @param sf_ptr 移動元の保存フロア構造体参照ポインタ */ -static void locate_connected_stairs(player_type *player_ptr, floor_type *floor_ptr, saved_floor_type *sf_ptr, BIT_FLAGS floor_mode) +static void locate_connected_stairs(PlayerType *player_ptr, floor_type *floor_ptr, saved_floor_type *sf_ptr, BIT_FLAGS floor_mode) { POSITION sx = 0; POSITION sy = 0; @@ -206,7 +206,7 @@ static void locate_connected_stairs(player_type *player_ptr, floor_type *floor_p /*! * @brief フロア移動時、プレイヤーの移動先モンスターが既にいた場合ランダムな近隣に移動させる / When a monster is at a place where player will return, */ -static void get_out_monster(player_type *player_ptr) +static void get_out_monster(PlayerType *player_ptr) { int tries = 0; POSITION dis = 1; @@ -245,7 +245,7 @@ static void get_out_monster(player_type *player_ptr) * @brief クエスト・フロア内のモンスター・インベントリ情報を保存する * @param player_ptr プレイヤーへの参照ポインタ */ -static void preserve_info(player_type *player_ptr) +static void preserve_info(PlayerType *player_ptr) { MONRACE_IDX quest_r_idx = 0; for (DUNGEON_IDX i = 0; i < max_q_idx; i++) { @@ -279,7 +279,7 @@ static void preserve_info(player_type *player_ptr) } } -static void set_grid_by_leaving_floor(player_type *player_ptr, grid_type **g_ptr) +static void set_grid_by_leaving_floor(PlayerType *player_ptr, grid_type **g_ptr) { if ((player_ptr->change_floor_mode & CFM_SAVE_FLOORS) == 0) return; @@ -293,7 +293,7 @@ static void set_grid_by_leaving_floor(player_type *player_ptr, grid_type **g_ptr prepare_change_floor_mode(player_ptr, CFM_SHAFT); } -static void jump_floors(player_type *player_ptr) +static void jump_floors(PlayerType *player_ptr) { if (none_bits(player_ptr->change_floor_mode, CFM_DOWN | CFM_UP)) { return; @@ -323,7 +323,7 @@ static void jump_floors(player_type *player_ptr) player_ptr->current_floor_ptr->dun_level += move_num; } -static void exit_to_wilderness(player_type *player_ptr) +static void exit_to_wilderness(PlayerType *player_ptr) { if (is_in_dungeon(player_ptr) || (player_ptr->dungeon_idx == 0)) return; @@ -340,7 +340,7 @@ static void exit_to_wilderness(player_type *player_ptr) player_ptr->change_floor_mode &= ~CFM_SAVE_FLOORS; // TODO } -static void kill_saved_floors(player_type *player_ptr, saved_floor_type *sf_ptr) +static void kill_saved_floors(PlayerType *player_ptr, saved_floor_type *sf_ptr) { if (!(player_ptr->change_floor_mode & CFM_SAVE_FLOORS)) { for (DUNGEON_IDX i = 0; i < MAX_SAVED_FLOORS; i++) @@ -354,7 +354,7 @@ static void kill_saved_floors(player_type *player_ptr, saved_floor_type *sf_ptr) kill_saved_floor(player_ptr, sf_ptr); } -static void refresh_new_floor_id(player_type *player_ptr, grid_type *g_ptr) +static void refresh_new_floor_id(PlayerType *player_ptr, grid_type *g_ptr) { if (new_floor_id != 0) return; @@ -364,7 +364,7 @@ static void refresh_new_floor_id(player_type *player_ptr, grid_type *g_ptr) g_ptr->special = new_floor_id; } -static void update_upper_lower_or_floor_id(player_type *player_ptr, saved_floor_type *sf_ptr) +static void update_upper_lower_or_floor_id(PlayerType *player_ptr, saved_floor_type *sf_ptr) { if ((player_ptr->change_floor_mode & CFM_RAND_CONNECT) == 0) return; @@ -375,7 +375,7 @@ static void update_upper_lower_or_floor_id(player_type *player_ptr, saved_floor_ sf_ptr->lower_floor_id = new_floor_id; } -static void exe_leave_floor(player_type *player_ptr, saved_floor_type *sf_ptr) +static void exe_leave_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr) { grid_type *g_ptr = nullptr; set_grid_by_leaving_floor(player_ptr, &g_ptr); @@ -407,7 +407,7 @@ static void exe_leave_floor(player_type *player_ptr, saved_floor_type *sf_ptr) * / Maintain quest monsters, mark next floor_id at stairs, save current floor, and prepare to enter next floor. * @param player_ptr プレイヤーへの参照ポインタ */ -void leave_floor(player_type *player_ptr) +void leave_floor(PlayerType *player_ptr) { preserve_pet(player_ptr); remove_all_mirrors(player_ptr, false); @@ -427,7 +427,7 @@ void leave_floor(player_type *player_ptr) * @brief 任意のダンジョン及び階層に飛ぶ * Go to any level */ -void jump_floor(player_type *player_ptr, DUNGEON_IDX dun_idx, DEPTH depth) +void jump_floor(PlayerType *player_ptr, DUNGEON_IDX dun_idx, DEPTH depth) { player_ptr->dungeon_idx = dun_idx; player_ptr->current_floor_ptr->dun_level = depth; diff --git a/src/floor/floor-leaver.h b/src/floor/floor-leaver.h index d90b4915c..16a112c3f 100644 --- a/src/floor/floor-leaver.h +++ b/src/floor/floor-leaver.h @@ -1,6 +1,6 @@ #pragma once #include "system/angband.h" -struct player_type; -void leave_floor(player_type *player_ptr); -void jump_floor(player_type *player_ptr, DUNGEON_IDX dun_idx, DEPTH depth); +class PlayerType; +void leave_floor(PlayerType *player_ptr); +void jump_floor(PlayerType *player_ptr, DUNGEON_IDX dun_idx, DEPTH depth); diff --git a/src/floor/floor-mode-changer.cpp b/src/floor/floor-mode-changer.cpp index 672f62159..7157a6102 100644 --- a/src/floor/floor-mode-changer.cpp +++ b/src/floor/floor-mode-changer.cpp @@ -6,4 +6,4 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param mode 追加したい所持フラグ */ -void prepare_change_floor_mode(player_type *player_ptr, BIT_FLAGS mode) { player_ptr->change_floor_mode |= mode; } +void prepare_change_floor_mode(PlayerType *player_ptr, BIT_FLAGS mode) { player_ptr->change_floor_mode |= mode; } diff --git a/src/floor/floor-mode-changer.h b/src/floor/floor-mode-changer.h index b3a9388a9..ff27769e8 100644 --- a/src/floor/floor-mode-changer.h +++ b/src/floor/floor-mode-changer.h @@ -18,5 +18,5 @@ enum cfm_type { CFM_FIRST_FLOOR = 0x0200, /*!< ダンジョンに入った最初のフロアである / Create exit from the dungeon */ }; -struct player_type; -void prepare_change_floor_mode(player_type *player_ptr, BIT_FLAGS mode); +class PlayerType; +void prepare_change_floor_mode(PlayerType *player_ptr, BIT_FLAGS mode); diff --git a/src/floor/floor-object.cpp b/src/floor/floor-object.cpp index c1df82bc1..cce6eb115 100644 --- a/src/floor/floor-object.cpp +++ b/src/floor/floor-object.cpp @@ -70,7 +70,7 @@ static errr get_obj_num_prep(void) * @param player_ptr プレイヤーへの参照ポインタ * @param o_ptr デバッグ出力するオブジェクトの構造体参照ポインタ */ -static void object_mention(player_type *player_ptr, object_type *o_ptr) +static void object_mention(PlayerType *player_ptr, object_type *o_ptr) { object_aware(player_ptr, o_ptr); object_known(o_ptr); @@ -118,7 +118,7 @@ static void set_ammo_quantity(object_type *j_ptr) * @param rq_mon_level ランダムクエスト討伐対象のレベル。ランダムクエスト以外の生成であれば無効値 * @return アイテムの生成成功可否 */ -bool make_object(player_type *player_ptr, object_type *j_ptr, BIT_FLAGS mode, std::optional rq_mon_level) +bool make_object(PlayerType *player_ptr, object_type *j_ptr, BIT_FLAGS mode, std::optional rq_mon_level) { auto *floor_ptr = player_ptr->current_floor_ptr; auto prob = any_bits(mode, AM_GOOD) ? 10 : 1000; @@ -163,7 +163,7 @@ bool make_object(player_type *player_ptr, object_type *j_ptr, BIT_FLAGS mode, st * @details * The location must be a legal, clean, floor grid. */ -bool make_gold(player_type *player_ptr, object_type *j_ptr) +bool make_gold(PlayerType *player_ptr, object_type *j_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; int i = ((randint1(floor_ptr->object_level + 2) + 2) / 2) - 1; @@ -190,7 +190,7 @@ bool make_gold(player_type *player_ptr, object_type *j_ptr) * @param y 削除したフロアマスのY座標 * @param x 削除したフロアマスのX座標 */ -void delete_all_items_from_floor(player_type *player_ptr, POSITION y, POSITION x) +void delete_all_items_from_floor(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -216,7 +216,7 @@ void delete_all_items_from_floor(player_type *player_ptr, POSITION y, POSITION x * @param item 増やしたいアイテムの所持スロット * @param num 増やしたいアイテムの数 */ -void floor_item_increase(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num) +void floor_item_increase(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num) { floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -239,7 +239,7 @@ void floor_item_increase(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBE * @param player_ptr プレイヤーへの参照ポインタ * @param item 消去したいアイテムの所持スロット */ -void floor_item_optimize(player_type *player_ptr, INVENTORY_IDX item) +void floor_item_optimize(PlayerType *player_ptr, INVENTORY_IDX item) { object_type *o_ptr = &player_ptr->current_floor_ptr->o_list[item]; if (!o_ptr->k_idx) @@ -260,7 +260,7 @@ void floor_item_optimize(player_type *player_ptr, INVENTORY_IDX item) * @details * Handle "stacks" of objects correctly. */ -void delete_object_idx(player_type *player_ptr, OBJECT_IDX o_idx) +void delete_object_idx(PlayerType *player_ptr, OBJECT_IDX o_idx) { object_type *j_ptr; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -330,7 +330,7 @@ ObjectIndexList &get_o_idx_list_contains(floor_type *floor_ptr, OBJECT_IDX o_idx * the object can combine, stack, or be placed. Artifacts will try very\n * hard to be placed, including "teleporting" to a useful grid if needed.\n */ -OBJECT_IDX drop_near(player_type *player_ptr, object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION x) +OBJECT_IDX drop_near(PlayerType *player_ptr, object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION x) { int i, k, d, s; POSITION dy, dx; @@ -569,7 +569,7 @@ void floor_item_charges(floor_type *floor_ptr, INVENTORY_IDX item) * @param floo_ptr 現在フロアへの参照ポインタ * @param item メッセージの対象にしたいアイテム所持スロット */ -void floor_item_describe(player_type *player_ptr, INVENTORY_IDX item) +void floor_item_describe(PlayerType *player_ptr, INVENTORY_IDX item) { object_type *o_ptr = &player_ptr->current_floor_ptr->o_list[item]; GAME_TEXT o_name[MAX_NLEN]; @@ -588,7 +588,7 @@ void floor_item_describe(player_type *player_ptr, INVENTORY_IDX item) /* * Choose an item and get auto-picker entry from it. */ -object_type *choose_object(player_type *player_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, const ItemTester& item_tester) +object_type *choose_object(PlayerType *player_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, const ItemTester& item_tester) { OBJECT_IDX item; diff --git a/src/floor/floor-object.h b/src/floor/floor-object.h index 5aca50785..70d02f075 100644 --- a/src/floor/floor-object.h +++ b/src/floor/floor-object.h @@ -8,17 +8,17 @@ class ObjectIndexList; struct floor_type; struct object_type; -struct player_type; +class PlayerType; class ItemTester; -bool make_object(player_type *player_ptr, object_type *j_ptr, BIT_FLAGS mode, std::optional rq_mon_level = std::nullopt); -bool make_gold(player_type *player_ptr, object_type *j_ptr); -void delete_all_items_from_floor(player_type *player_ptr, POSITION y, POSITION x); -void floor_item_increase(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num); -void floor_item_optimize(player_type *player_ptr, INVENTORY_IDX item); -void delete_object_idx(player_type *player_ptr, OBJECT_IDX o_idx); +bool make_object(PlayerType *player_ptr, object_type *j_ptr, BIT_FLAGS mode, std::optional rq_mon_level = std::nullopt); +bool make_gold(PlayerType *player_ptr, object_type *j_ptr); +void delete_all_items_from_floor(PlayerType *player_ptr, POSITION y, POSITION x); +void floor_item_increase(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num); +void floor_item_optimize(PlayerType *player_ptr, INVENTORY_IDX item); +void delete_object_idx(PlayerType *player_ptr, OBJECT_IDX o_idx); void excise_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx); ObjectIndexList &get_o_idx_list_contains(floor_type *floor_ptr, OBJECT_IDX o_idx); -OBJECT_IDX drop_near(player_type *player_ptr, object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x); +OBJECT_IDX drop_near(PlayerType *player_ptr, object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x); void floor_item_charges(floor_type *player_ptr, INVENTORY_IDX item); -void floor_item_describe(player_type *player_ptr, INVENTORY_IDX item); -object_type *choose_object(player_type *player_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, const ItemTester& item_tester = AllMatchItemTester()); +void floor_item_describe(PlayerType *player_ptr, INVENTORY_IDX item); +object_type *choose_object(PlayerType *player_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, const ItemTester& item_tester = AllMatchItemTester()); diff --git a/src/floor/floor-save.cpp b/src/floor/floor-save.cpp index 084b45b6d..bc0a1c22d 100644 --- a/src/floor/floor-save.cpp +++ b/src/floor/floor-save.cpp @@ -50,7 +50,7 @@ static void check_saved_tmp_files(const int fd, bool *force) * @param force テンポラリファイルが残っていた場合も警告なしで強制的に削除するフラグ * @details Make sure that old temporary files are not remaining as gurbages. */ -void init_saved_floors(player_type *player_ptr, bool force) +void init_saved_floors(PlayerType *player_ptr, bool force) { char floor_savefile[sizeof(savefile) + 32]; int fd = -1; @@ -80,7 +80,7 @@ void init_saved_floors(player_type *player_ptr, bool force) * @details Should be called just before the game quit. * @param player_ptr プレイヤーへの参照ポインタ */ -void clear_saved_floor_files(player_type *player_ptr) +void clear_saved_floor_files(PlayerType *player_ptr) { char floor_savefile[sizeof(savefile) + 32]; for (int i = 0; i < MAX_SAVED_FLOORS; i++) { @@ -119,7 +119,7 @@ saved_floor_type *get_sf_ptr(FLOOR_IDX floor_id) * @param player_ptr プレイヤーへの参照ポインタ * @param sf_ptr 保存フロアの参照ポインタ */ -void kill_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr) +void kill_saved_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr) { char floor_savefile[sizeof(savefile) + 32]; if (!sf_ptr || (sf_ptr->floor_id == 0)) @@ -138,7 +138,7 @@ void kill_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr) sf_ptr->floor_id = 0; } -static FLOOR_IDX find_oldest_floor_idx(player_type *player_ptr) +static FLOOR_IDX find_oldest_floor_idx(PlayerType *player_ptr) { FLOOR_IDX oldest_floor_idx = 0; uint32_t oldest_visit = 0xffffffffL; @@ -162,7 +162,7 @@ static FLOOR_IDX find_oldest_floor_idx(player_type *player_ptr) * @details * If number of saved floors are already MAX_SAVED_FLOORS, kill the oldest one. */ -FLOOR_IDX get_new_floor_id(player_type *player_ptr) +FLOOR_IDX get_new_floor_id(PlayerType *player_ptr) { saved_floor_type *sf_ptr = nullptr; FLOOR_IDX fl_idx; @@ -199,7 +199,7 @@ FLOOR_IDX get_new_floor_id(player_type *player_ptr) * @details * To prevent multiple generation of unique monster who is the minion of player */ -void precalc_cur_num_of_pet(player_type *player_ptr) +void precalc_cur_num_of_pet(PlayerType *player_ptr) { monster_type *m_ptr; int max_num = player_ptr->wild_mode ? 1 : MAX_PARTY_MON; diff --git a/src/floor/floor-save.h b/src/floor/floor-save.h index 65e1a0659..3df5223ca 100644 --- a/src/floor/floor-save.h +++ b/src/floor/floor-save.h @@ -2,12 +2,12 @@ #include "system/angband.h" -struct player_type; +class PlayerType; struct saved_floor_type; -void init_saved_floors(player_type *player_ptr, bool force); -void clear_saved_floor_files(player_type *player_ptr); +void init_saved_floors(PlayerType *player_ptr, bool force); +void clear_saved_floor_files(PlayerType *player_ptr); saved_floor_type *get_sf_ptr(FLOOR_IDX floor_id); -void kill_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr); -FLOOR_IDX get_new_floor_id(player_type *player_ptr); -void precalc_cur_num_of_pet(player_type *player_ptr); +void kill_saved_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr); +FLOOR_IDX get_new_floor_id(PlayerType *player_ptr); +void precalc_cur_num_of_pet(PlayerType *player_ptr); extern FLOOR_IDX max_floor_id; diff --git a/src/floor/floor-streams.cpp b/src/floor/floor-streams.cpp index c765f7a45..c3336f31e 100644 --- a/src/floor/floor-streams.cpp +++ b/src/floor/floor-streams.cpp @@ -273,7 +273,7 @@ void add_river(floor_type *floor_ptr, dun_data_type *dd_ptr) * hidden gold types are currently unused. * */ -void build_streamer(player_type *player_ptr, FEAT_IDX feat, int chance) +void build_streamer(PlayerType *player_ptr, FEAT_IDX feat, int chance) { int i; POSITION y, x, tx, ty; @@ -413,7 +413,7 @@ void build_streamer(player_type *player_ptr, FEAT_IDX feat, int chance) * This happens in real world lava tubes. * */ -void place_trees(player_type *player_ptr, POSITION x, POSITION y) +void place_trees(PlayerType *player_ptr, POSITION x, POSITION y) { int i, j; grid_type *g_ptr; @@ -465,7 +465,7 @@ void place_trees(player_type *player_ptr, POSITION x, POSITION y) * @brief ダンジョンに*破壊*済み地形ランダムに施す / * Build a destroyed level */ -void destroy_level(player_type *player_ptr) +void destroy_level(PlayerType *player_ptr) { msg_print_wizard(player_ptr, CHEAT_DUNGEON, _("階に*破壊*の痕跡を生成しました。", "Destroyed Level.")); diff --git a/src/floor/floor-streams.h b/src/floor/floor-streams.h index 42572fa54..34f676917 100644 --- a/src/floor/floor-streams.h +++ b/src/floor/floor-streams.h @@ -4,8 +4,8 @@ struct dun_data_type; struct floor_type; -struct player_type; +class PlayerType; void add_river(floor_type *floor_ptr, dun_data_type *dd_ptr); -void build_streamer(player_type *player_ptr, FEAT_IDX feat, int chance); -void place_trees(player_type *player_ptr, POSITION x, POSITION y); -void destroy_level(player_type *player_ptr); +void build_streamer(PlayerType *player_ptr, FEAT_IDX feat, int chance); +void place_trees(PlayerType *player_ptr, POSITION x, POSITION y); +void destroy_level(PlayerType *player_ptr); diff --git a/src/floor/floor-util.cpp b/src/floor/floor-util.cpp index ad1f24aa3..e4c0128d7 100644 --- a/src/floor/floor-util.cpp +++ b/src/floor/floor-util.cpp @@ -48,7 +48,7 @@ static int scent_when = 0; * Whenever the age count loops, most of the scent trail is erased and * the age of the remainder is recalculated. */ -void update_smell(floor_type *floor_ptr, player_type *player_ptr) +void update_smell(floor_type *floor_ptr, PlayerType *player_ptr) { /* Create a table that controls the spread of scent */ const int scent_adjust[5][5] = { @@ -149,7 +149,7 @@ void wipe_o_list(floor_type *floor_ptr) * * Currently the "m" parameter is unused. */ -void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode) +void scatter(PlayerType *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode) { floor_type *floor_ptr = player_ptr->current_floor_ptr; POSITION nx, ny; @@ -180,7 +180,7 @@ void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, PO * @param player_ptr プレイヤーへの参照ポインタ * @return マップ名の文字列参照ポインタ */ -concptr map_name(player_type *player_ptr) +concptr map_name(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (floor_ptr->inside_quest && quest_type::is_fixed(floor_ptr->inside_quest) && (quest[floor_ptr->inside_quest].flags & QUEST_FLAG_PRESET)) diff --git a/src/floor/floor-util.h b/src/floor/floor-util.h index 3b4692599..a67c64f98 100644 --- a/src/floor/floor-util.h +++ b/src/floor/floor-util.h @@ -5,9 +5,9 @@ struct floor_type; extern floor_type floor_info; -struct player_type; -void update_smell(floor_type *floor_ptr, player_type *player_ptr); +class PlayerType; +void update_smell(floor_type *floor_ptr, PlayerType *player_ptr); void forget_flow(floor_type *floor_ptr); void wipe_o_list(floor_type *floor_ptr); -void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode); -concptr map_name(player_type *player_ptr); +void scatter(PlayerType *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode); +concptr map_name(PlayerType *player_ptr); diff --git a/src/floor/geometry.cpp b/src/floor/geometry.cpp index 13bbeacd3..05964276d 100644 --- a/src/floor/geometry.cpp +++ b/src/floor/geometry.cpp @@ -97,7 +97,7 @@ POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2) * @param x 方角を確認したX座標 * @return 方向ID */ -DIRECTION coords_to_dir(player_type *player_ptr, POSITION y, POSITION x) +DIRECTION coords_to_dir(PlayerType *player_ptr, POSITION y, POSITION x) { DIRECTION d[3][3] = { { 7, 4, 1 }, { 8, 5, 2 }, { 9, 6, 3 } }; POSITION dy, dx; @@ -145,7 +145,7 @@ DIRECTION coords_to_dir(player_type *player_ptr, POSITION y, POSITION x) * "glowing" grid. This prevents the player from being able to "see" the\n * walls of illuminated rooms from a corridor outside the room.\n */ -bool player_can_see_bold(player_type *player_ptr, POSITION y, POSITION x) +bool player_can_see_bold(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr; @@ -238,7 +238,7 @@ void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POS * @return 個々のモンスターがプレイヤーが見えたらTRUE * @todo is_seen() の関数マクロをバラそうとしたがインクルード関係のコンパイルエラーで失敗 */ -bool is_seen(player_type *player_ptr, monster_type *m_ptr) +bool is_seen(PlayerType *player_ptr, monster_type *m_ptr) { bool is_inside_view = !ignore_unview; is_inside_view |= player_ptr->phase_out; diff --git a/src/floor/geometry.h b/src/floor/geometry.h index 40ec1289f..5551d7120 100644 --- a/src/floor/geometry.h +++ b/src/floor/geometry.h @@ -28,11 +28,11 @@ extern const POSITION cdd[8]; extern const POSITION ddx_cdd[8]; extern const POSITION ddy_cdd[8]; -struct player_type; -DIRECTION coords_to_dir(player_type *player_ptr, POSITION y, POSITION x); +class PlayerType; +DIRECTION coords_to_dir(PlayerType *player_ptr, POSITION y, POSITION x); POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2); void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POSITION x2); -bool player_can_see_bold(player_type *player_ptr, POSITION y, POSITION x); +bool player_can_see_bold(PlayerType *player_ptr, POSITION y, POSITION x); struct monster_type; -bool is_seen(player_type *player_ptr, monster_type *m_ptr); +bool is_seen(PlayerType *player_ptr, monster_type *m_ptr); diff --git a/src/floor/line-of-sight.cpp b/src/floor/line-of-sight.cpp index 72a2b0fd1..cf5a64367 100644 --- a/src/floor/line-of-sight.cpp +++ b/src/floor/line-of-sight.cpp @@ -46,7 +46,7 @@ *\n * Use the "update_view()" function to determine player line-of-sight.\n */ -bool los(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2) +bool los(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2) { POSITION dy = y2 - y1; POSITION dx = x2 - x1; diff --git a/src/floor/line-of-sight.h b/src/floor/line-of-sight.h index 1757ded71..cd5b537b1 100644 --- a/src/floor/line-of-sight.h +++ b/src/floor/line-of-sight.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool los(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2); +class PlayerType; +bool los(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2); diff --git a/src/floor/object-allocator.cpp b/src/floor/object-allocator.cpp index dfd3956e8..df6e9b071 100644 --- a/src/floor/object-allocator.cpp +++ b/src/floor/object-allocator.cpp @@ -54,7 +54,7 @@ static int next_to_walls(floor_type *floor_ptr, POSITION y, POSITION x) * @param walls 最低減隣接させたい外壁の数 * @return 階段を生成して問題がないならばTRUEを返す。 */ -static bool alloc_stairs_aux(player_type *player_ptr, POSITION y, POSITION x, int walls) +static bool alloc_stairs_aux(PlayerType *player_ptr, POSITION y, POSITION x, int walls) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; @@ -72,7 +72,7 @@ static bool alloc_stairs_aux(player_type *player_ptr, POSITION y, POSITION x, in * @param walls 最低減隣接させたい外壁の数 * @return 規定数通りに生成に成功したらTRUEを返す。 */ -bool alloc_stairs(player_type *player_ptr, FEAT_IDX feat, int num, int walls) +bool alloc_stairs(PlayerType *player_ptr, FEAT_IDX feat, int num, int walls) { int shaft_num = 0; feature_type *f_ptr = &f_info[feat]; @@ -161,7 +161,7 @@ static void place_rubble(floor_type *floor_ptr, POSITION y, POSITION x) * @param num 配置したい数 * @return 規定数通りに生成に成功したらTRUEを返す。 */ -void alloc_object(player_type *player_ptr, dap_type set, EFFECT_ID typ, int num) +void alloc_object(PlayerType *player_ptr, dap_type set, EFFECT_ID typ, int num) { POSITION y = 0; POSITION x = 0; diff --git a/src/floor/object-allocator.h b/src/floor/object-allocator.h index 0e6b54436..6a96c05c2 100644 --- a/src/floor/object-allocator.h +++ b/src/floor/object-allocator.h @@ -4,6 +4,6 @@ #include "effect/attribute-types.h" enum dap_type : int; -struct player_type; -bool alloc_stairs(player_type *player_ptr, FEAT_IDX feat, int num, int walls); -void alloc_object(player_type *player_ptr, dap_type set, EFFECT_ID typ, int num); +class PlayerType; +bool alloc_stairs(PlayerType *player_ptr, FEAT_IDX feat, int num, int walls); +void alloc_object(PlayerType *player_ptr, dap_type set, EFFECT_ID typ, int num); diff --git a/src/floor/object-scanner.cpp b/src/floor/object-scanner.cpp index 09f4067ff..d8949ea37 100644 --- a/src/floor/object-scanner.cpp +++ b/src/floor/object-scanner.cpp @@ -29,7 +29,7 @@ * mode & 0x02 -- Marked items only * mode & 0x04 -- Stop after first */ -ITEM_NUMBER scan_floor_items(player_type *player_ptr, OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode, const ItemTester &item_tester) +ITEM_NUMBER scan_floor_items(PlayerType *player_ptr, OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode, const ItemTester &item_tester) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!in_bounds(floor_ptr, y, x)) @@ -91,7 +91,7 @@ static void prepare_label_string_floor(floor_type *floor_ptr, char *label, FLOOR * @return 選択したアイテムの添え字 * @details */ -COMMAND_CODE show_floor_items(player_type *player_ptr, int target_item, POSITION y, POSITION x, TERM_LEN *min_width, const ItemTester &item_tester) +COMMAND_CODE show_floor_items(PlayerType *player_ptr, int target_item, POSITION y, POSITION x, TERM_LEN *min_width, const ItemTester &item_tester) { COMMAND_CODE i, m; int j, k, l; diff --git a/src/floor/object-scanner.h b/src/floor/object-scanner.h index f72bd7c76..15d609108 100644 --- a/src/floor/object-scanner.h +++ b/src/floor/object-scanner.h @@ -12,7 +12,7 @@ enum scan_floor_mode { SCAN_FLOOR_AT_MOST_ONE = 1U << 2, /*!< 高々1つのアイテムしか取得しない */ }; -struct player_type; +class PlayerType; class ItemTester; -ITEM_NUMBER scan_floor_items(player_type *player_ptr, OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode, const ItemTester& item_tester); -COMMAND_CODE show_floor_items(player_type *player_ptr, int target_item, POSITION y, POSITION x, TERM_LEN *min_width, const ItemTester& item_tester); +ITEM_NUMBER scan_floor_items(PlayerType *player_ptr, OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode, const ItemTester& item_tester); +COMMAND_CODE show_floor_items(PlayerType *player_ptr, int target_item, POSITION y, POSITION x, TERM_LEN *min_width, const ItemTester& item_tester); diff --git a/src/floor/pattern-walk.cpp b/src/floor/pattern-walk.cpp index 0f7e6fafc..e2619930b 100644 --- a/src/floor/pattern-walk.cpp +++ b/src/floor/pattern-walk.cpp @@ -34,7 +34,7 @@ * @brief パターン終点到達時のテレポート処理を行う * @param player_ptr プレイヤーへの参照ポインタ */ -void pattern_teleport(player_type *player_ptr) +void pattern_teleport(PlayerType *player_ptr) { DEPTH min_level = 0; DEPTH max_level = 99; @@ -101,7 +101,7 @@ void pattern_teleport(player_type *player_ptr) * @brief 各種パターン地形上の特別な処理 / Returns TRUE if we are on the Pattern... * @return 実際にパターン地形上にプレイヤーが居た場合はTRUEを返す。 */ -bool pattern_effect(player_type *player_ptr) +bool pattern_effect(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!pattern_tile(floor_ptr, player_ptr->y, player_ptr->x)) @@ -164,7 +164,7 @@ bool pattern_effect(player_type *player_ptr) * @param n_x プレイヤーの移動先X座標 * @return 移動処理が可能である場合(可能な場合に選択した場合)TRUEを返す。 */ -bool pattern_seq(player_type *player_ptr, POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x) +bool pattern_seq(PlayerType *player_ptr, POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x) { feature_type *cur_f_ptr = &f_info[player_ptr->current_floor_ptr->grid_array[c_y][c_x].feat]; feature_type *new_f_ptr = &f_info[player_ptr->current_floor_ptr->grid_array[n_y][n_x].feat]; diff --git a/src/floor/pattern-walk.h b/src/floor/pattern-walk.h index f53dfbf3e..1c798ebfd 100644 --- a/src/floor/pattern-walk.h +++ b/src/floor/pattern-walk.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -bool pattern_effect(player_type *player_ptr); -bool pattern_seq(player_type *player_ptr, POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x); -void pattern_teleport(player_type *player_ptr); +class PlayerType; +bool pattern_effect(PlayerType *player_ptr); +bool pattern_seq(PlayerType *player_ptr, POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x); +void pattern_teleport(PlayerType *player_ptr); diff --git a/src/floor/tunnel-generator.cpp b/src/floor/tunnel-generator.cpp index e2d81d44f..8b3a74952 100644 --- a/src/floor/tunnel-generator.cpp +++ b/src/floor/tunnel-generator.cpp @@ -50,7 +50,7 @@ static void correct_dir(POSITION *rdir, POSITION *cdir, POSITION y1, POSITION x1 * @param col2 終点X座標 * @return 生成に成功したらTRUEを返す */ -bool build_tunnel(player_type *player_ptr, dun_data_type *dd_ptr, dt_type *dt_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2) +bool build_tunnel(PlayerType *player_ptr, dun_data_type *dd_ptr, dt_type *dt_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2) { POSITION tmp_row, tmp_col; POSITION row_dir, col_dir; @@ -158,7 +158,7 @@ bool build_tunnel(player_type *player_ptr, dun_data_type *dd_ptr, dt_type *dt_pt * @param affectwall (調査中) * @todo 特に詳細な処理の意味を調査すべし */ -static bool set_tunnel(player_type *player_ptr, dun_data_type *dd_ptr, POSITION *x, POSITION *y, bool affectwall) +static bool set_tunnel(PlayerType *player_ptr, dun_data_type *dd_ptr, POSITION *x, POSITION *y, bool affectwall) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[*y][*x]; @@ -230,7 +230,7 @@ static bool set_tunnel(player_type *player_ptr, dun_data_type *dd_ptr, POSITION * @param x 基準点のX座標 * @param y 基準点のY座標 */ -static void create_cata_tunnel(player_type *player_ptr, dun_data_type *dd_ptr, POSITION x, POSITION y) +static void create_cata_tunnel(PlayerType *player_ptr, dun_data_type *dd_ptr, POSITION x, POSITION y) { POSITION x1 = x - 1; POSITION y1 = y; @@ -255,7 +255,7 @@ static void create_cata_tunnel(player_type *player_ptr, dun_data_type *dd_ptr, P * @todo 詳細用調査 */ static void short_seg_hack( - player_type *player_ptr, dun_data_type *dd_ptr, const POSITION x1, const POSITION y1, const POSITION x2, const POSITION y2, int type, int count, bool *fail) + PlayerType *player_ptr, dun_data_type *dd_ptr, const POSITION x1, const POSITION y1, const POSITION x2, const POSITION y2, int type, int count, bool *fail) { if (!(*fail)) return; @@ -341,7 +341,7 @@ static void short_seg_hack( * @brief 特定の壁(永久壁など)を避けながら部屋間の通路を作成する / This routine maps a path from (x1, y1) to (x2, y2) avoiding SOLID walls. * @todo 詳細要調査 */ -bool build_tunnel2(player_type *player_ptr, dun_data_type *dd_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff) +bool build_tunnel2(PlayerType *player_ptr, dun_data_type *dd_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff) { POSITION x3, y3, dx, dy; POSITION changex, changey; diff --git a/src/floor/tunnel-generator.h b/src/floor/tunnel-generator.h index c56a03548..65ed31f9d 100644 --- a/src/floor/tunnel-generator.h +++ b/src/floor/tunnel-generator.h @@ -4,6 +4,6 @@ struct dun_data_type; struct dt_type; -struct player_type; -bool build_tunnel(player_type *player_ptr, dun_data_type *dd_ptr, dt_type *dt_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2); -bool build_tunnel2(player_type *player_ptr, dun_data_type *dd_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff); +class PlayerType; +bool build_tunnel(PlayerType *player_ptr, dun_data_type *dd_ptr, dt_type *dt_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2); +bool build_tunnel2(PlayerType *player_ptr, dun_data_type *dd_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff); diff --git a/src/floor/wild.cpp b/src/floor/wild.cpp index da9a8b836..d5c3bdf88 100644 --- a/src/floor/wild.cpp +++ b/src/floor/wild.cpp @@ -285,7 +285,7 @@ static void generate_wilderness_area(floor_type *floor_ptr, int terrain, uint32_ * If corner is set then only the corners of the area are needed. * */ -static void generate_area(player_type *player_ptr, POSITION y, POSITION x, bool border, bool corner) +static void generate_area(PlayerType *player_ptr, POSITION y, POSITION x, bool border, bool corner) { player_ptr->town_num = wilderness[y][x].town; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -370,10 +370,10 @@ static border_type border; /*! * @brief 広域マップの生成 / * Build the wilderness area outside of the town. - * @todo 広域マップは恒常生成にする予定、player_typeによる処理分岐は最終的に排除する。 + * @todo 広域マップは恒常生成にする予定、PlayerTypeによる処理分岐は最終的に排除する。 * @param player_ptr プレイヤーへの参照ポインタ */ -void wilderness_gen(player_type *player_ptr) +void wilderness_gen(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; floor_ptr->height = MAX_HGT; @@ -550,7 +550,7 @@ static int16_t conv_terrain2feat[MAX_WILDERNESS]; * @brief 広域マップの生成(簡易処理版) / * Build the wilderness area. -DG- */ -void wilderness_gen_small(player_type *player_ptr) +void wilderness_gen_small(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (int i = 0; i < MAX_WID; i++) @@ -621,7 +621,7 @@ static wilderness_grid w_letter[255]; * @param y 広域マップの高さを返す参照ポインタ * @param x 広域マップの幅を返す参照ポインタ */ -parse_error_type parse_line_wilderness(player_type *player_ptr, char *buf, int xmin, int xmax, int *y, int *x) +parse_error_type parse_line_wilderness(PlayerType *player_ptr, char *buf, int xmin, int xmax, int *y, int *x) { if (!(buf[0] == 'W')) return (PARSE_ERROR_GENERIC); @@ -833,7 +833,7 @@ void init_wilderness_terrains(void) * @param encount 襲撃時TRUE * @return 切り替えが行われた場合はTRUEを返す。 */ -bool change_wild_mode(player_type *player_ptr, bool encount) +bool change_wild_mode(PlayerType *player_ptr, bool encount) { generate_encounter = encount; if (player_ptr->leaving) diff --git a/src/floor/wild.h b/src/floor/wild.h index 163858080..48eaa0eff 100644 --- a/src/floor/wild.h +++ b/src/floor/wild.h @@ -40,12 +40,12 @@ typedef struct wilderness_type { extern std::vector> wilderness; -struct player_type; +class PlayerType; void set_floor_and_wall(DUNGEON_IDX type); -void wilderness_gen(player_type *player_ptr); -void wilderness_gen_small(player_type *player_ptr); +void wilderness_gen(PlayerType *player_ptr); +void wilderness_gen_small(PlayerType *player_ptr); errr init_wilderness(void); void init_wilderness_terrains(void); void seed_wilderness(void); -parse_error_type parse_line_wilderness(player_type *player_ptr, char *buf, int xmin, int xmax, int *y, int *x); -bool change_wild_mode(player_type *player_ptr, bool encount); +parse_error_type parse_line_wilderness(PlayerType *player_ptr, char *buf, int xmin, int xmax, int *y, int *x); +bool change_wild_mode(PlayerType *player_ptr, bool encount); diff --git a/src/grid/door.cpp b/src/grid/door.cpp index e6f675d5d..0359a22be 100644 --- a/src/grid/door.cpp +++ b/src/grid/door.cpp @@ -16,7 +16,7 @@ * * The doors must be INSIDE the allocated region. */ -void add_door(player_type *player_ptr, POSITION x, POSITION y) +void add_door(PlayerType *player_ptr, POSITION x, POSITION y) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!floor_ptr->grid_array[y][x].is_outer()) @@ -61,7 +61,7 @@ void add_door(player_type *player_ptr, POSITION x, POSITION y) * @param x 配置したいフロアのX座標 * @param type DOOR_DEFAULT / DOOR_DOOR / DOOR_GLASS_DOOR / DOOR_CURTAIN のいずれか */ -void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type) +void place_secret_door(PlayerType *player_ptr, POSITION y, POSITION x, int type) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (d_info[floor_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_DOORS)) { @@ -98,7 +98,7 @@ void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type * @param y 配置したいフロアのY座標 * @param x 配置したいフロアのX座標 */ -void place_locked_door(player_type *player_ptr, POSITION y, POSITION x) +void place_locked_door(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (d_info[floor_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_DOORS)) { @@ -118,7 +118,7 @@ void place_locked_door(player_type *player_ptr, POSITION y, POSITION x) * @param x ドアの配置を試みたいマスのX座標 * @param room 部屋に接している場合向けのドア生成か否か */ -void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool room) +void place_random_door(PlayerType *player_ptr, POSITION y, POSITION x, bool room) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; @@ -176,7 +176,7 @@ void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool roo * @param x ドアの配置を試みたいマスのX座標 * @param type ドアの地形ID */ -void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type) +void place_closed_door(PlayerType *player_ptr, POSITION y, POSITION x, int type) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (d_info[floor_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_DOORS)) { diff --git a/src/grid/door.h b/src/grid/door.h index 47f7260ef..5d7061b5c 100644 --- a/src/grid/door.h +++ b/src/grid/door.h @@ -2,9 +2,9 @@ #include "system/angband.h" -struct player_type; -void add_door(player_type *player_ptr, POSITION x, POSITION y); -void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type); -void place_locked_door(player_type *player_ptr, POSITION y, POSITION x); -void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool room); -void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type); +class PlayerType; +void add_door(PlayerType *player_ptr, POSITION x, POSITION y); +void place_secret_door(PlayerType *player_ptr, POSITION y, POSITION x, int type); +void place_locked_door(PlayerType *player_ptr, POSITION y, POSITION x); +void place_random_door(PlayerType *player_ptr, POSITION y, POSITION x, bool room); +void place_closed_door(PlayerType *player_ptr, POSITION y, POSITION x, int type); diff --git a/src/grid/feature-generator.cpp b/src/grid/feature-generator.cpp index adda9f440..19164330d 100644 --- a/src/grid/feature-generator.cpp +++ b/src/grid/feature-generator.cpp @@ -22,7 +22,7 @@ * @brief フロアに洞窟や湖を配置する / Generate various caverns and lakes * @details There were moved from cave_gen(). */ -void gen_caverns_and_lakes(player_type *player_ptr, dungeon_type *dungeon_ptr, dun_data_type *dd_ptr) +void gen_caverns_and_lakes(PlayerType *player_ptr, dungeon_type *dungeon_ptr, dun_data_type *dd_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if ((floor_ptr->dun_level > 30) && one_in_(DUN_DEST * 2) && small_levels && dungeon_ptr->flags.has(DungeonFeatureType::DESTROY)) { @@ -157,7 +157,7 @@ static bool possible_doorway(floor_type *floor_ptr, POSITION y, POSITION x) * @param y 設置を行いたいマスのY座標 * @param x 設置を行いたいマスのX座標 */ -void try_door(player_type *player_ptr, dt_type *dt_ptr, POSITION y, POSITION x) +void try_door(PlayerType *player_ptr, dt_type *dt_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!in_bounds(floor_ptr, y, x) || cave_has_flag_bold(floor_ptr, y, x, FloorFeatureType::WALL) || floor_ptr->grid_array[y][x].is_room()) diff --git a/src/grid/feature-generator.h b/src/grid/feature-generator.h index 3c8f191b7..1a810bf5f 100644 --- a/src/grid/feature-generator.h +++ b/src/grid/feature-generator.h @@ -5,7 +5,7 @@ struct dungeon_type; struct dun_data_type; struct dt_type; -struct player_type; -void gen_caverns_and_lakes(player_type *player_ptr, dungeon_type *dungeon_ptr, dun_data_type *dd_ptr); +class PlayerType; +void gen_caverns_and_lakes(PlayerType *player_ptr, dungeon_type *dungeon_ptr, dun_data_type *dd_ptr); bool has_river_flag(dungeon_type *dungeon_ptr); -void try_door(player_type *player_ptr, dt_type *dt_ptr, POSITION y, POSITION x); +void try_door(PlayerType *player_ptr, dt_type *dt_ptr, POSITION y, POSITION x); diff --git a/src/grid/feature.cpp b/src/grid/feature.cpp index d87096883..cf36bbc93 100644 --- a/src/grid/feature.cpp +++ b/src/grid/feature.cpp @@ -120,7 +120,7 @@ FEAT_IDX feat_ground_type[100], feat_wall_type[100]; * @param feat 地形情報のID * @return 罠持ちの地形ならばTRUEを返す。 */ -bool is_trap(player_type *player_ptr, FEAT_IDX feat) +bool is_trap(PlayerType *player_ptr, FEAT_IDX feat) { /* 関数ポインタの都合 */ (void)player_ptr; @@ -132,7 +132,7 @@ bool is_trap(player_type *player_ptr, FEAT_IDX feat) * @param feat 地形情報のID * @return 閉じたドアのある地形ならばTRUEを返す。 */ -bool is_closed_door(player_type *player_ptr, FEAT_IDX feat) +bool is_closed_door(PlayerType *player_ptr, FEAT_IDX feat) { /* 関数ポインタの都合 */ (void)player_ptr; @@ -189,7 +189,7 @@ FEAT_IDX feat_jammed_door_random(int door_type) /* * Change the "feat" flag for a grid, and notice/redraw the grid */ -void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat) +void cave_set_feat(PlayerType *player_ptr, POSITION y, POSITION x, FEAT_IDX feat) { auto *floor_ptr = player_ptr->current_floor_ptr; auto *g_ptr = &floor_ptr->grid_array[y][x]; diff --git a/src/grid/feature.h b/src/grid/feature.h index 3c8355cdf..d6cd9900d 100644 --- a/src/grid/feature.h +++ b/src/grid/feature.h @@ -114,13 +114,13 @@ extern FEAT_IDX feat_ground_type[100]; extern FEAT_IDX feat_wall_type[100]; struct floor_type; -struct player_type; -bool is_closed_door(player_type *player_ptr, FEAT_IDX feat); -bool is_trap(player_type *player_ptr, FEAT_IDX feat); +class PlayerType; +bool is_closed_door(PlayerType *player_ptr, FEAT_IDX feat); +bool is_trap(PlayerType *player_ptr, FEAT_IDX feat); void apply_default_feat_lighting(TERM_COLOR *f_attr, SYMBOL_CODE *f_char); bool is_ascii_graphics(char x); bool permanent_wall(feature_type *f_ptr); FEAT_IDX feat_locked_door_random(int door_type); FEAT_IDX feat_jammed_door_random(int door_type); -void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat); +void cave_set_feat(PlayerType *player_ptr, POSITION y, POSITION x, FEAT_IDX feat); FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat); diff --git a/src/grid/grid.cpp b/src/grid/grid.cpp index f50b6cab7..dbb05e32a 100644 --- a/src/grid/grid.cpp +++ b/src/grid/grid.cpp @@ -70,7 +70,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 配置に成功したらTRUEを返す */ -bool new_player_spot(player_type *player_ptr) +bool new_player_spot(PlayerType *player_ptr) { POSITION y = 0, x = 0; int max_attempts = 10000; @@ -135,7 +135,7 @@ bool new_player_spot(player_type *player_ptr) * @param g_ptr マス構造体の参照ポインタ * @return 隠されたドアがあるならTRUEを返す。 */ -bool is_hidden_door(player_type *player_ptr, grid_type *g_ptr) +bool is_hidden_door(PlayerType *player_ptr, grid_type *g_ptr) { if ((g_ptr->mimic || g_ptr->cave_has_flag(FloorFeatureType::SECRET)) && is_closed_door(player_ptr, g_ptr->feat)) return true; @@ -149,7 +149,7 @@ bool is_hidden_door(player_type *player_ptr, grid_type *g_ptr) * @param x x座標 * @return 指定された座標に照明がかかっているならTRUEを返す。。 */ -bool check_local_illumination(player_type *player_ptr, POSITION y, POSITION x) +bool check_local_illumination(PlayerType *player_ptr, POSITION y, POSITION x) { /* Hack -- move towards player */ POSITION yy = (y < player_ptr->y) ? (y + 1) : (y > player_ptr->y) ? (y - 1) : y; @@ -187,7 +187,7 @@ bool check_local_illumination(player_type *player_ptr, POSITION y, POSITION x) * @param y 視界先y座標 * @param x 視界先x座標 */ -void update_local_illumination(player_type *player_ptr, POSITION y, POSITION x) +void update_local_illumination(PlayerType *player_ptr, POSITION y, POSITION x) { int i; POSITION yy, xx; @@ -238,7 +238,7 @@ void update_local_illumination(player_type *player_ptr, POSITION y, POSITION x) * @return 視覚に収められていないならTRUEを返す * @details player_can_see_bold()関数の返り値の否定を返している。 */ -bool no_lite(player_type *player_ptr) +bool no_lite(PlayerType *player_ptr) { return (!player_can_see_bold(player_ptr, player_ptr->y, player_ptr->x)); } @@ -246,7 +246,7 @@ bool no_lite(player_type *player_ptr) /* * Place an attr/char pair at the given map coordinate, if legal. */ -void print_rel(player_type *player_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, POSITION x) +void print_rel(PlayerType *player_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, POSITION x) { /* Only do "legal" locations */ if (panel_contains(y, x)) { @@ -266,7 +266,7 @@ void print_rel(player_type *player_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, } /*! - * @todo ここにplayer_type を追加した時のコンパイルエラーに対処できなかったので保留 + * @todo ここにPlayerType を追加した時のコンパイルエラーに対処できなかったので保留 * Memorize interesting viewable object/features in the given grid * * This function should only be called on "legal" grids. @@ -305,7 +305,7 @@ void print_rel(player_type *player_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, * optimized primarily for the most common cases, that is, for the * non-marked floor grids. */ -void note_spot(player_type *player_ptr, POSITION y, POSITION x) +void note_spot(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; @@ -383,7 +383,7 @@ void note_spot(player_type *player_ptr, POSITION y, POSITION x) * * This function should only be called on "legal" grids */ -void lite_spot(player_type *player_ptr, POSITION y, POSITION x) +void lite_spot(PlayerType *player_ptr, POSITION y, POSITION x) { /* Redraw if on screen */ if (panel_contains(y, x) && in_bounds2(player_ptr->current_floor_ptr, y, x)) { @@ -639,7 +639,7 @@ static POSITION flow_y = 0; * We do not need a priority queue because the cost from grid * to grid is always "one" and we process them in order. */ -void update_flow(player_type *player_ptr) +void update_flow(PlayerType *player_ptr) { POSITION x, y; DIRECTION d; @@ -753,7 +753,7 @@ FEAT_IDX feat_state(floor_type *floor_ptr, FEAT_IDX feat, FloorFeatureType actio * Takes a location and action and changes the feature at that * location through applying the given action. */ -void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, FloorFeatureType action) +void cave_alter_feat(PlayerType *player_ptr, POSITION y, POSITION x, FloorFeatureType action) { /* Set old feature */ floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -804,7 +804,7 @@ void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, FloorFeatu } /* Remove a mirror */ -void remove_mirror(player_type *player_ptr, POSITION y, POSITION x) +void remove_mirror(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; @@ -836,7 +836,7 @@ void remove_mirror(player_type *player_ptr, POSITION y, POSITION x) * @param mode オプション * @return テレポート先として妥当ならばtrue */ -bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, teleport_flags mode) +bool cave_monster_teleportable_bold(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, teleport_flags mode) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; @@ -873,7 +873,7 @@ bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, * @param mode オプション * @return テレポート先として妥当ならばtrue */ -bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION x, teleport_flags mode) +bool cave_player_teleportable_bold(PlayerType *player_ptr, POSITION y, POSITION x, teleport_flags mode) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; feature_type *f_ptr = &f_info[g_ptr->feat]; @@ -922,7 +922,7 @@ bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION * @param feat 地形ID * @return 開いた地形である場合TRUEを返す / Return TRUE if the given feature is an open door */ -bool is_open(player_type *player_ptr, FEAT_IDX feat) +bool is_open(PlayerType *player_ptr, FEAT_IDX feat) { return f_info[feat].flags.has(FloorFeatureType::CLOSE) && (feat != feat_state(player_ptr->current_floor_ptr, feat, FloorFeatureType::CLOSE)); } @@ -933,7 +933,7 @@ bool is_open(player_type *player_ptr, FEAT_IDX feat) * @param mode 移動に関するオプションフラグ * @return 移動可能ならばTRUEを返す */ -bool player_can_enter(player_type *player_ptr, FEAT_IDX feature, BIT_FLAGS16 mode) +bool player_can_enter(PlayerType *player_ptr, FEAT_IDX feature, BIT_FLAGS16 mode) { feature_type *f_ptr = &f_info[feature]; @@ -959,7 +959,7 @@ bool player_can_enter(player_type *player_ptr, FEAT_IDX feature, BIT_FLAGS16 mod return true; } -void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type gb_type) +void place_grid(PlayerType *player_ptr, grid_type *g_ptr, grid_bold_type gb_type) { switch (gb_type) { case GB_FLOOR: { @@ -1047,12 +1047,12 @@ void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type gb_typ * @param g_ptr グリッドへの参照ポインタ * @return 照明が消されている地形ならばTRUE */ -bool darkened_grid(player_type *player_ptr, grid_type *g_ptr) +bool darkened_grid(PlayerType *player_ptr, grid_type *g_ptr) { return ((g_ptr->info & (CAVE_VIEW | CAVE_LITE | CAVE_MNLT | CAVE_MNDK)) == (CAVE_VIEW | CAVE_MNDK)) && !player_ptr->see_nocto; } -void place_bold(player_type *player_ptr, POSITION y, POSITION x, grid_bold_type gb_type) +void place_bold(PlayerType *player_ptr, POSITION y, POSITION x, grid_bold_type gb_type) { grid_type *const g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; place_grid(player_ptr, g_ptr, gb_type); @@ -1074,7 +1074,7 @@ void set_cave_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX featu * @details Return the number of features around (or under) the character. * Usually look for doors and floor traps. */ -int count_dt(player_type *player_ptr, POSITION *y, POSITION *x, bool (*test)(player_type *, FEAT_IDX), bool under) +int count_dt(PlayerType *player_ptr, POSITION *y, POSITION *x, bool (*test)(PlayerType *, FEAT_IDX), bool under) { int count = 0; for (DIRECTION d = 0; d < 9; d++) { diff --git a/src/grid/grid.h b/src/grid/grid.h index 73a367e25..7a819ebb0 100644 --- a/src/grid/grid.h +++ b/src/grid/grid.h @@ -42,32 +42,32 @@ enum grid_bold_type { struct floor_type; struct grid_type; -struct player_type; +class PlayerType; struct monster_race; enum class FloorFeatureType; -bool new_player_spot(player_type *player_ptr); -bool is_hidden_door(player_type *player_ptr, grid_type *g_ptr); -bool player_can_enter(player_type *player_ptr, FEAT_IDX feature, BIT_FLAGS16 mode); +bool new_player_spot(PlayerType *player_ptr); +bool is_hidden_door(PlayerType *player_ptr, grid_type *g_ptr); +bool player_can_enter(PlayerType *player_ptr, FEAT_IDX feature, BIT_FLAGS16 mode); bool feat_uses_special(FEAT_IDX f_idx); -void update_local_illumination(player_type *player_ptr, POSITION y, POSITION x); -bool no_lite(player_type *player_ptr); -void print_rel(player_type *player_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, POSITION x); -void note_spot(player_type *player_ptr, POSITION y, POSITION x); -void lite_spot(player_type *player_ptr, POSITION y, POSITION x); -void update_flow(player_type *player_ptr); +void update_local_illumination(PlayerType *player_ptr, POSITION y, POSITION x); +bool no_lite(PlayerType *player_ptr); +void print_rel(PlayerType *player_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, POSITION x); +void note_spot(PlayerType *player_ptr, POSITION y, POSITION x); +void lite_spot(PlayerType *player_ptr, POSITION y, POSITION x); +void update_flow(PlayerType *player_ptr); FEAT_IDX feat_state(floor_type *floor_ptr, FEAT_IDX feat, FloorFeatureType action); -void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, FloorFeatureType action); -void remove_mirror(player_type *player_ptr, POSITION y, POSITION x); -bool is_open(player_type *player_ptr, FEAT_IDX feat); -bool check_local_illumination(player_type *player_ptr, POSITION y, POSITION x); -bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, teleport_flags mode); -bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION x, teleport_flags mode); -void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type pg_type); -bool darkened_grid(player_type *player_ptr, grid_type *g_ptr); -void delete_monster(player_type *player_ptr, POSITION y, POSITION x); -void place_bold(player_type *player_ptr, POSITION y, POSITION x, grid_bold_type gh_type); +void cave_alter_feat(PlayerType *player_ptr, POSITION y, POSITION x, FloorFeatureType action); +void remove_mirror(PlayerType *player_ptr, POSITION y, POSITION x); +bool is_open(PlayerType *player_ptr, FEAT_IDX feat); +bool check_local_illumination(PlayerType *player_ptr, POSITION y, POSITION x); +bool cave_monster_teleportable_bold(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, teleport_flags mode); +bool cave_player_teleportable_bold(PlayerType *player_ptr, POSITION y, POSITION x, teleport_flags mode); +void place_grid(PlayerType *player_ptr, grid_type *g_ptr, grid_bold_type pg_type); +bool darkened_grid(PlayerType *player_ptr, grid_type *g_ptr); +void delete_monster(PlayerType *player_ptr, POSITION y, POSITION x); +void place_bold(PlayerType *player_ptr, POSITION y, POSITION x, grid_bold_type gh_type); void set_cave_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feature_idx); -int count_dt(player_type *player_ptr, POSITION *y, POSITION *x, bool (*test)(player_type *, FEAT_IDX), bool under); +int count_dt(PlayerType *player_ptr, POSITION *y, POSITION *x, bool (*test)(PlayerType *, FEAT_IDX), bool under); void cave_lite_hack(floor_type *floor_ptr, POSITION y, POSITION x); void cave_redraw_later(floor_type *floor_ptr, POSITION y, POSITION x); void cave_note_and_redraw_later(floor_type *floor_ptr, POSITION y, POSITION x); diff --git a/src/grid/object-placer.cpp b/src/grid/object-placer.cpp index 3a6a2f0f3..349693577 100644 --- a/src/grid/object-placer.cpp +++ b/src/grid/object-placer.cpp @@ -19,7 +19,7 @@ * @details * The location must be a legal, clean, floor grid. */ -void place_gold(player_type *player_ptr, POSITION y, POSITION x) +void place_gold(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; @@ -66,7 +66,7 @@ void place_gold(player_type *player_ptr, POSITION y, POSITION x) * This routine uses "object_level" for the "generation level".\n * This routine requires a clean floor grid destination.\n */ -void place_object(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode) +void place_object(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; diff --git a/src/grid/object-placer.h b/src/grid/object-placer.h index ea55cf174..203675ff7 100644 --- a/src/grid/object-placer.h +++ b/src/grid/object-placer.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void place_gold(player_type *player_ptr, POSITION y, POSITION x); -void place_object(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode); +class PlayerType; +void place_gold(PlayerType *player_ptr, POSITION y, POSITION x); +void place_object(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode); diff --git a/src/grid/stair.cpp b/src/grid/stair.cpp index 12bae4257..c5432e755 100644 --- a/src/grid/stair.cpp +++ b/src/grid/stair.cpp @@ -16,7 +16,7 @@ * @param y 配置を試みたいマスのY座標 * @param x 配置を試みたいマスのX座標 */ -void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x) +void place_random_stairs(PlayerType *player_ptr, POSITION y, POSITION x) { bool up_stairs = true; bool down_stairs = true; diff --git a/src/grid/stair.h b/src/grid/stair.h index 6aad7e47b..5b42d4016 100644 --- a/src/grid/stair.h +++ b/src/grid/stair.h @@ -3,6 +3,6 @@ #include "system/angband.h" struct floor_type; -struct player_type; -void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x); +class PlayerType; +void place_random_stairs(PlayerType *player_ptr, POSITION y, POSITION x); bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x); diff --git a/src/grid/trap.cpp b/src/grid/trap.cpp index 40b4a3ea1..4a8182a02 100644 --- a/src/grid/trap.cpp +++ b/src/grid/trap.cpp @@ -163,7 +163,7 @@ void init_normal_traps(void) * Actually, it is not this routine, but the "trap instantiation"\n * code, which should also check for "trap doors" on quest levels.\n */ -FEAT_IDX choose_random_trap(player_type *player_ptr) +FEAT_IDX choose_random_trap(PlayerType *player_ptr) { FEAT_IDX feat; @@ -198,7 +198,7 @@ FEAT_IDX choose_random_trap(player_type *player_ptr) * @param y 秘匿したいマスのY座標 * @param x 秘匿したいマスのX座標 */ -void disclose_grid(player_type *player_ptr, POSITION y, POSITION x) +void disclose_grid(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; @@ -224,7 +224,7 @@ void disclose_grid(player_type *player_ptr, POSITION y, POSITION x) * when they are "discovered" (by detecting them or setting them off),\n * the trap is "instantiated" as a visible, "typed", trap.\n */ -void place_trap(player_type *player_ptr, POSITION y, POSITION x) +void place_trap(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; @@ -251,7 +251,7 @@ void place_trap(player_type *player_ptr, POSITION y, POSITION x) * Always miss 5% of the time, Always hit 5% of the time. * Otherwise, match trap power against player armor. */ -static int check_hit_from_monster_to_player(player_type *player_ptr, int power) +static int check_hit_from_monster_to_player(PlayerType *player_ptr, int power) { int k; ARMOUR_CLASS ac; @@ -286,7 +286,7 @@ static int check_hit_from_monster_to_player(player_type *player_ptr, int power) * @brief 落とし穴系トラップの判定とプレイヤーの被害処理 * @param trap_feat_type トラップの種別ID */ -static void hit_trap_pit(player_type *player_ptr, enum trap_type trap_feat_type) +static void hit_trap_pit(PlayerType *player_ptr, enum trap_type trap_feat_type) { HIT_POINT dam; concptr trap_name = ""; @@ -344,7 +344,7 @@ static void hit_trap_pit(player_type *player_ptr, enum trap_type trap_feat_type) * @brief ダーツ系トラップ(通常ダメージ)の判定とプレイヤーの被害処理 * @return ダーツが命中した場合TRUEを返す */ -static bool hit_trap_dart(player_type *player_ptr) +static bool hit_trap_dart(PlayerType *player_ptr) { bool hit = false; @@ -364,7 +364,7 @@ static bool hit_trap_dart(player_type *player_ptr) * @brief ダーツ系トラップ(通常ダメージ+能力値減少)の判定とプレイヤーの被害処理 * @param stat 低下する能力値ID */ -static void hit_trap_lose_stat(player_type *player_ptr, int stat) +static void hit_trap_lose_stat(PlayerType *player_ptr, int stat) { if (hit_trap_dart(player_ptr)) { do_dec_stat(player_ptr, stat); @@ -374,7 +374,7 @@ static void hit_trap_lose_stat(player_type *player_ptr, int stat) /*! * @brief ダーツ系トラップ(通常ダメージ+減速)の判定とプレイヤーの被害処理 */ -static void hit_trap_slow(player_type *player_ptr) +static void hit_trap_slow(PlayerType *player_ptr) { if (hit_trap_dart(player_ptr)) { (void)BadStatusSetter(player_ptr).mod_slowness(randint0(20) + 20, false); @@ -387,7 +387,7 @@ static void hit_trap_slow(player_type *player_ptr) * @param break_trap 作動後のトラップ破壊が確定しているならばTRUE * @todo cmd-save.h への依存あり。コールバックで何とかしたい */ -void hit_trap(player_type *player_ptr, bool break_trap) +void hit_trap(PlayerType *player_ptr, bool break_trap) { int i, num, dam; POSITION x = player_ptr->x, y = player_ptr->y; diff --git a/src/grid/trap.h b/src/grid/trap.h index ef741e5c7..139c3490a 100644 --- a/src/grid/trap.h +++ b/src/grid/trap.h @@ -57,9 +57,9 @@ const int MAX_NORMAL_TRAPS = TRAP_ALARM + 1; extern const std::vector> chest_traps; -struct player_type; +class PlayerType; void init_normal_traps(void); -FEAT_IDX choose_random_trap(player_type *player_ptr); -void disclose_grid(player_type *player_ptr, POSITION y, POSITION x); -void place_trap(player_type *player_ptr, POSITION y, POSITION x); -void hit_trap(player_type *player_ptr, bool break_trap); +FEAT_IDX choose_random_trap(PlayerType *player_ptr); +void disclose_grid(PlayerType *player_ptr, POSITION y, POSITION x); +void place_trap(PlayerType *player_ptr, POSITION y, POSITION x); +void hit_trap(PlayerType *player_ptr, bool break_trap); diff --git a/src/hpmp/hp-mp-processor.cpp b/src/hpmp/hp-mp-processor.cpp index 25aa3eb5e..f57136664 100644 --- a/src/hpmp/hp-mp-processor.cpp +++ b/src/hpmp/hp-mp-processor.cpp @@ -61,8 +61,8 @@ * @details * ダメージを受けた場合、自然回復できない。 */ -static bool deal_damege_by_feat(player_type *player_ptr, grid_type *g_ptr, concptr msg_levitation, concptr msg_normal, - std::function damage_rate, std::function additional_effect) +static bool deal_damege_by_feat(PlayerType *player_ptr, grid_type *g_ptr, concptr msg_levitation, concptr msg_normal, + std::function damage_rate, std::function additional_effect) { feature_type *f_ptr = &f_info[g_ptr->feat]; int damage = 0; @@ -106,7 +106,7 @@ static bool deal_damege_by_feat(player_type *player_ptr, grid_type *g_ptr, concp * @brief 10ゲームターンが進行するごとにプレイヤーのHPとMPの増減処理を行う。 * / Handle timed damage and regeneration every 10 game turns */ -void process_player_hp_mp(player_type *player_ptr) +void process_player_hp_mp(PlayerType *player_ptr) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x]; feature_type *f_ptr = &f_info[g_ptr->feat]; @@ -190,7 +190,7 @@ void process_player_hp_mp(player_type *player_ptr) if (f_ptr->flags.has(FloorFeatureType::POISON_PUDDLE) && !is_invuln(player_ptr)) { if (deal_damege_by_feat(player_ptr, g_ptr, _("毒気を吸い込んだ!", "The gas poisons you!"), _("に毒された!", "poisons you!"), calc_acid_damage_rate, - [](player_type *player_ptr, int damage) { + [](PlayerType *player_ptr, int damage) { if (!has_resist_pois(player_ptr)) (void)BadStatusSetter(player_ptr).mod_poison(static_cast(damage)); })) { @@ -390,7 +390,7 @@ void process_player_hp_mp(player_type *player_ptr) /* * Increase players hit points, notice effects */ -bool hp_player(player_type *player_ptr, int num) +bool hp_player(PlayerType *player_ptr, int num) { int vir; vir = virtue_number(player_ptr, V_VITALITY); diff --git a/src/hpmp/hp-mp-processor.h b/src/hpmp/hp-mp-processor.h index 420e58e49..47d849b88 100644 --- a/src/hpmp/hp-mp-processor.h +++ b/src/hpmp/hp-mp-processor.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void process_player_hp_mp(player_type *player_ptr); -bool hp_player(player_type *player_ptr, int num); +class PlayerType; +void process_player_hp_mp(PlayerType *player_ptr); +bool hp_player(PlayerType *player_ptr, int num); diff --git a/src/hpmp/hp-mp-regenerator.cpp b/src/hpmp/hp-mp-regenerator.cpp index 583ed88b4..1f4cacfe6 100644 --- a/src/hpmp/hp-mp-regenerator.cpp +++ b/src/hpmp/hp-mp-regenerator.cpp @@ -26,7 +26,7 @@ int wild_regen = 20; * @brief プレイヤーのHP自然回復処理 / Regenerate hit points -RAK- * @param percent 回復比率 */ -void regenhp(player_type *player_ptr, int percent) +void regenhp(PlayerType *player_ptr, int percent) { if (PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::KOUKIJIN)) return; @@ -61,7 +61,7 @@ void regenhp(player_type *player_ptr, int percent) * @param upkeep_factor ペット維持によるMPコスト量 * @param regen_amount 回復量 */ -void regenmana(player_type *player_ptr, MANA_POINT upkeep_factor, MANA_POINT regen_amount) +void regenmana(PlayerType *player_ptr, MANA_POINT upkeep_factor, MANA_POINT regen_amount) { MANA_POINT old_csp = player_ptr->csp; int32_t regen_rate = regen_amount * 100 - upkeep_factor * PY_REGEN_NORMAL; @@ -117,7 +117,7 @@ void regenmana(player_type *player_ptr, MANA_POINT upkeep_factor, MANA_POINT reg * @brief 取り込んだ魔道具の自然回復処理 / Regenerate magic regen_amount: PY_REGEN_NORMAL * 2 (if resting) * 2 (if having regenarate) * @param regen_amount 回復量 */ -void regenmagic(player_type *player_ptr, int regen_amount) +void regenmagic(PlayerType *player_ptr, int regen_amount) { auto magic_eater_data = PlayerClass(player_ptr).get_specific_data(); if (!magic_eater_data) { @@ -164,7 +164,7 @@ void regenmagic(player_type *player_ptr, int regen_amount) * @param player_ptr プレイヤーへの参照ポインタ * @note Should probably be done during monster turns. */ -void regenerate_monsters(player_type *player_ptr) +void regenerate_monsters(PlayerType *player_ptr) { for (int i = 1; i < player_ptr->current_floor_ptr->m_max; i++) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[i]; @@ -199,7 +199,7 @@ void regenerate_monsters(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @note Should probably be done during monster turns. */ -void regenerate_captured_monsters(player_type *player_ptr) +void regenerate_captured_monsters(PlayerType *player_ptr) { bool heal = false; for (int i = 0; i < INVEN_TOTAL; i++) { diff --git a/src/hpmp/hp-mp-regenerator.h b/src/hpmp/hp-mp-regenerator.h index 25a7566b3..299ca403b 100644 --- a/src/hpmp/hp-mp-regenerator.h +++ b/src/hpmp/hp-mp-regenerator.h @@ -13,9 +13,9 @@ extern int wild_regen; -struct player_type; -void regenhp(player_type *player_ptr, int percent); -void regenmana(player_type *player_ptr, MANA_POINT upkeep_factor, MANA_POINT regen_amount); -void regenmagic(player_type *player_ptr, int regen_amount); -void regenerate_monsters(player_type *player_ptr); -void regenerate_captured_monsters(player_type *player_ptr); +class PlayerType; +void regenhp(PlayerType *player_ptr, int percent); +void regenmana(PlayerType *player_ptr, MANA_POINT upkeep_factor, MANA_POINT regen_amount); +void regenmagic(PlayerType *player_ptr, int regen_amount); +void regenerate_monsters(PlayerType *player_ptr); +void regenerate_captured_monsters(PlayerType *player_ptr); diff --git a/src/info-reader/fixed-map-parser.cpp b/src/info-reader/fixed-map-parser.cpp index a829750ef..b739c927c 100644 --- a/src/info-reader/fixed-map-parser.cpp +++ b/src/info-reader/fixed-map-parser.cpp @@ -34,7 +34,7 @@ static concptr variant = "ZANGBAND"; * @param fp * @return エラーコード */ -static concptr parse_fixed_map_expression(player_type *player_ptr, char **sp, char *fp) +static concptr parse_fixed_map_expression(PlayerType *player_ptr, char **sp, char *fp) { char b1 = '['; char b2 = ']'; @@ -232,7 +232,7 @@ static concptr parse_fixed_map_expression(player_type *player_ptr, char **sp, ch * @param xmax 詳細不明 * @return エラーコード */ -parse_error_type parse_fixed_map(player_type *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax) +parse_error_type parse_fixed_map(PlayerType *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax) { char buf[1024]; path_build(buf, sizeof(buf), ANGBAND_DIR_EDIT, name); diff --git a/src/info-reader/fixed-map-parser.h b/src/info-reader/fixed-map-parser.h index 9ee0f7b51..e92702c1c 100644 --- a/src/info-reader/fixed-map-parser.h +++ b/src/info-reader/fixed-map-parser.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "info-reader/parse-error-types.h" -struct player_type; -parse_error_type parse_fixed_map(player_type *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax); +class PlayerType; +parse_error_type parse_fixed_map(PlayerType *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax); diff --git a/src/inventory/floor-item-getter.cpp b/src/inventory/floor-item-getter.cpp index 0d69be891..8931085ef 100644 --- a/src/inventory/floor-item-getter.cpp +++ b/src/inventory/floor-item-getter.cpp @@ -42,7 +42,7 @@ * @return プレイヤーによりアイテムが選択されたならTRUEを返す * @todo 適切な関数名をどうしても付けられなかったので暫定でauxとした */ -static bool check_floor_item_tag_aux(player_type *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester) +static bool check_floor_item_tag_aux(PlayerType *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester) { if (!fis_ptr->floor || (*fis_ptr->cp >= 0)) return false; @@ -74,7 +74,7 @@ static bool check_floor_item_tag_aux(player_type *player_ptr, fis_type *fis_ptr, * @param prev_tag 前回選択したアイテムのタグ (のはず) * @return プレイヤーによりアイテムが選択されたならTRUEを返す */ -static bool get_floor_item_tag_inventory(player_type *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester) +static bool get_floor_item_tag_inventory(PlayerType *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester) { bool flag = false; item_use_flag use_flag = (*fis_ptr->cp >= INVEN_MAIN_HAND) ? USE_EQUIP : USE_INVEN; @@ -104,7 +104,7 @@ static bool get_floor_item_tag_inventory(player_type *player_ptr, fis_type *fis_ * @param prev_tag 前回選択したアイテムのタグ (のはず) * @return プレイヤーによりアイテムが選択されたならTRUEを返す */ -static bool check_floor_item_tag_inventory(player_type *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester) +static bool check_floor_item_tag_inventory(PlayerType *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester) { if ((!fis_ptr->inven || (*fis_ptr->cp < 0) || (*fis_ptr->cp >= INVEN_PACK)) && (!fis_ptr->equip || (*fis_ptr->cp < INVEN_MAIN_HAND) || (*fis_ptr->cp >= INVEN_TOTAL))) @@ -128,7 +128,7 @@ static bool check_floor_item_tag_inventory(player_type *player_ptr, fis_type *fi * @param prev_tag 前回選択したアイテムのタグ (のはず) * @return プレイヤーによりアイテムが選択されたならTRUEを返す */ -static bool check_floor_item_tag(player_type *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester) +static bool check_floor_item_tag(PlayerType *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester) { if (!repeat_pull(fis_ptr->cp)) return false; @@ -149,7 +149,7 @@ static bool check_floor_item_tag(player_type *player_ptr, fis_type *fis_ptr, cha * @param player_ptr プレイヤーへの参照ポインタ * @param fis_ptr 床上アイテムへの参照ポインタ */ -static void test_inventory_floor(player_type *player_ptr, fis_type *fis_ptr, const ItemTester& item_tester) +static void test_inventory_floor(PlayerType *player_ptr, fis_type *fis_ptr, const ItemTester& item_tester) { if (!fis_ptr->inven) { fis_ptr->i2 = -1; @@ -169,7 +169,7 @@ static void test_inventory_floor(player_type *player_ptr, fis_type *fis_ptr, con * @param player_ptr プレイヤーへの参照ポインタ * @param fis_ptr 床上アイテムへの参照ポインタ */ -static void test_equipment_floor(player_type *player_ptr, fis_type *fis_ptr, const ItemTester& item_tester) +static void test_equipment_floor(PlayerType *player_ptr, fis_type *fis_ptr, const ItemTester& item_tester) { if (!fis_ptr->equip) { fis_ptr->e2 = -1; @@ -194,7 +194,7 @@ static void test_equipment_floor(player_type *player_ptr, fis_type *fis_ptr, con * @param mode オプションフラグ * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/ */ -bool get_item_floor(player_type *player_ptr, COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester) +bool get_item_floor(PlayerType *player_ptr, COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester) { fis_type tmp_fis; fis_type *fis_ptr = initialize_fis_type(&tmp_fis, cp, mode); diff --git a/src/inventory/floor-item-getter.h b/src/inventory/floor-item-getter.h index ed64925ef..006ce0d9d 100644 --- a/src/inventory/floor-item-getter.h +++ b/src/inventory/floor-item-getter.h @@ -3,6 +3,6 @@ #include "object/tval-types.h" #include "system/angband.h" -struct player_type; +class PlayerType; class ItemTester; -bool get_item_floor(player_type *player_ptr, COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester); +bool get_item_floor(PlayerType *player_ptr, COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester); diff --git a/src/inventory/inventory-curse.cpp b/src/inventory/inventory-curse.cpp index 5dd58141d..190d6bb7c 100644 --- a/src/inventory/inventory-curse.cpp +++ b/src/inventory/inventory-curse.cpp @@ -134,7 +134,7 @@ static void choise_cursed_item(CurseTraitType flag, object_type *o_ptr, int *cho * @return 該当の呪いが一つでもあった場合にランダムに選ばれた装備品のオブジェクト構造体参照ポインタを返す。\n * 呪いがない場合nullptrを返す。 */ -object_type *choose_cursed_obj_name(player_type *player_ptr, CurseTraitType flag) +object_type *choose_cursed_obj_name(PlayerType *player_ptr, CurseTraitType flag) { int choices[INVEN_TOTAL - INVEN_MAIN_HAND]; int number = 0; @@ -159,7 +159,7 @@ object_type *choose_cursed_obj_name(player_type *player_ptr, CurseTraitType flag * @brief 呪われている、トランプエゴ等による装備品由来のテレポートを実行する * @param player_ptr プレイヤーへの参照ポインタ */ -static void curse_teleport(player_type *player_ptr) +static void curse_teleport(PlayerType *player_ptr) { if ((player_ptr->cursed_special.has_not(CurseSpecialTraitType::TELEPORT_SELF)) || !one_in_(200)) return; @@ -200,7 +200,7 @@ static void curse_teleport(player_type *player_ptr) /*! * @details 元々呪い効果の発揮ルーチン中にいたので、整合性保持のためここに置いておく */ -static void occur_chainsword_effect(player_type *player_ptr) +static void occur_chainsword_effect(PlayerType *player_ptr) { if ((player_ptr->cursed_special.has_not(CurseSpecialTraitType::CHAINSWORD)) || !one_in_(CHAINSWORD_NOISE)) return; @@ -211,7 +211,7 @@ static void occur_chainsword_effect(player_type *player_ptr) disturb(player_ptr, false, false); } -static void curse_drain_exp(player_type *player_ptr) +static void curse_drain_exp(PlayerType *player_ptr) { if ((player_ptr->prace == PlayerRaceType::ANDROID) || (player_ptr->cursed.has_not(CurseTraitType::DRAIN_EXP)) || !one_in_(4)) return; @@ -227,7 +227,7 @@ static void curse_drain_exp(player_type *player_ptr) check_experience(player_ptr); } -static void multiply_low_curse(player_type *player_ptr) +static void multiply_low_curse(PlayerType *player_ptr) { if ((player_ptr->cursed.has_not(CurseTraitType::ADD_L_CURSE)) || !one_in_(2000)) return; @@ -246,7 +246,7 @@ static void multiply_low_curse(player_type *player_ptr) player_ptr->update |= (PU_BONUS); } -static void multiply_high_curse(player_type *player_ptr) +static void multiply_high_curse(PlayerType *player_ptr) { if ((player_ptr->cursed.has_not(CurseTraitType::ADD_H_CURSE)) || !one_in_(2000)) return; @@ -265,7 +265,7 @@ static void multiply_high_curse(player_type *player_ptr) player_ptr->update |= (PU_BONUS); } -static void curse_call_monster(player_type *player_ptr) +static void curse_call_monster(PlayerType *player_ptr) { const int call_type = PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET; const int obj_desc_type = OD_OMIT_PREFIX | OD_NAME_ONLY; @@ -307,7 +307,7 @@ static void curse_call_monster(player_type *player_ptr) } } -static void curse_cowardice(player_type *player_ptr) +static void curse_cowardice(PlayerType *player_ptr) { if ((player_ptr->cursed.has_not(CurseTraitType::COWARDICE)) || !one_in_(1500)) return; @@ -324,7 +324,7 @@ static void curse_cowardice(player_type *player_ptr) * @brief 装備による狂戦士化の発作を引き起こす * @param player_ptr プレイヤー情報への参照ポインタ */ -static void curse_berserk_rage(player_type *player_ptr) +static void curse_berserk_rage(PlayerType *player_ptr) { if ((player_ptr->cursed.has_not(CurseTraitType::BERS_RAGE)) || !one_in_(1500)) return; @@ -336,7 +336,7 @@ static void curse_berserk_rage(player_type *player_ptr) (void)BadStatusSetter(player_ptr).afraidness(0); } -static void curse_drain_hp(player_type *player_ptr) +static void curse_drain_hp(PlayerType *player_ptr) { if ((player_ptr->cursed.has_not(CurseTraitType::DRAIN_HP)) || !one_in_(666)) return; @@ -347,7 +347,7 @@ static void curse_drain_hp(player_type *player_ptr) take_hit(player_ptr, DAMAGE_LOSELIFE, std::min(player_ptr->lev * 2, 100), o_name); } -static void curse_drain_mp(player_type *player_ptr) +static void curse_drain_mp(PlayerType *player_ptr) { if ((player_ptr->cursed.has_not(CurseTraitType::DRAIN_MANA)) || (player_ptr->csp == 0) || !one_in_(666)) return; @@ -364,7 +364,7 @@ static void curse_drain_mp(player_type *player_ptr) player_ptr->redraw |= PR_MANA; } -static void occur_curse_effects(player_type *player_ptr) +static void occur_curse_effects(PlayerType *player_ptr) { if ((player_ptr->cursed.has_none_of(TRC_P_FLAG_MASK) && player_ptr->cursed_special.has_none_of(TRCS_P_FLAG_MASK)) || player_ptr->phase_out || player_ptr->wild_mode) @@ -397,7 +397,7 @@ static void occur_curse_effects(player_type *player_ptr) * / Handle curse effects once every 10 game turns * @param player_ptr プレイヤーへの参照ポインタ */ -void execute_cursed_items_effect(player_type *player_ptr) +void execute_cursed_items_effect(PlayerType *player_ptr) { occur_curse_effects(player_ptr); if (!one_in_(999) || player_ptr->anti_magic || (one_in_(2) && has_resist_curse(player_ptr))) diff --git a/src/inventory/inventory-curse.h b/src/inventory/inventory-curse.h index 6bc2437ce..52def975f 100644 --- a/src/inventory/inventory-curse.h +++ b/src/inventory/inventory-curse.h @@ -3,6 +3,6 @@ #include "system/angband.h" struct object_type; -struct player_type; -object_type *choose_cursed_obj_name(player_type *player_ptr, BIT_FLAGS flag); -void execute_cursed_items_effect(player_type *player_ptr); +class PlayerType; +object_type *choose_cursed_obj_name(PlayerType *player_ptr, BIT_FLAGS flag); +void execute_cursed_items_effect(PlayerType *player_ptr); diff --git a/src/inventory/inventory-damage.cpp b/src/inventory/inventory-damage.cpp index 435ab367e..b2bf98f14 100644 --- a/src/inventory/inventory-damage.cpp +++ b/src/inventory/inventory-damage.cpp @@ -25,7 +25,7 @@ * Destruction taken from "melee.c" code for "stealing". * New-style wands and rods handled correctly. -LM- */ -void inventory_damage(player_type *player_ptr, const ObjectBreaker& breaker, int perc) +void inventory_damage(PlayerType *player_ptr, const ObjectBreaker& breaker, int perc) { INVENTORY_IDX i; int j, amt; diff --git a/src/inventory/inventory-damage.h b/src/inventory/inventory-damage.h index 663d9697a..d01610236 100644 --- a/src/inventory/inventory-damage.h +++ b/src/inventory/inventory-damage.h @@ -6,6 +6,6 @@ * This seems like a pretty standard "typedef" */ struct object_type; -struct player_type; +class PlayerType; -void inventory_damage(player_type *player_ptr, const ObjectBreaker& breaker, int perc); +void inventory_damage(PlayerType *player_ptr, const ObjectBreaker& breaker, int perc); diff --git a/src/inventory/inventory-describer.cpp b/src/inventory/inventory-describer.cpp index e6119f94d..5b07da3bb 100644 --- a/src/inventory/inventory-describer.cpp +++ b/src/inventory/inventory-describer.cpp @@ -13,7 +13,7 @@ * @param i 部位表現を求めるプレイヤーの所持/装備オブジェクトID * @return 部位表現の文字列ポインタ */ -concptr mention_use(player_type *player_ptr, int i) +concptr mention_use(PlayerType *player_ptr, int i) { concptr p; @@ -89,7 +89,7 @@ concptr mention_use(player_type *player_ptr, int i) * @details * Currently, only used for items in the equipment, inventory. */ -concptr describe_use(player_type *player_ptr, int i) +concptr describe_use(PlayerType *player_ptr, int i) { concptr p; switch (i) { diff --git a/src/inventory/inventory-describer.h b/src/inventory/inventory-describer.h index 9b80b2eb5..711801700 100644 --- a/src/inventory/inventory-describer.h +++ b/src/inventory/inventory-describer.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "system/player-type-definition.h" -concptr mention_use(player_type *player_ptr, int i); -concptr describe_use(player_type *player_ptr, int i); +concptr mention_use(PlayerType *player_ptr, int i); +concptr describe_use(PlayerType *player_ptr, int i); diff --git a/src/inventory/inventory-object.cpp b/src/inventory/inventory-object.cpp index 4db1f8b93..399df2d14 100644 --- a/src/inventory/inventory-object.cpp +++ b/src/inventory/inventory-object.cpp @@ -17,7 +17,7 @@ #include "view/display-messages.h" #include "view/object-describer.h" -void vary_item(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num) +void vary_item(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num) { if (item >= 0) { inven_item_increase(player_ptr, item, num); @@ -38,7 +38,7 @@ void vary_item(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num) * @param item 所持数を増やしたいプレイヤーのアイテム所持スロット * @param num 増やしたい量 */ -void inven_item_increase(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num) +void inven_item_increase(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num) { object_type *o_ptr = &player_ptr->inventory_list[item]; num += o_ptr->number; @@ -73,7 +73,7 @@ void inven_item_increase(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBE * @param player_ptr プレイヤーへの参照ポインタ * @param item 消去したいプレイヤーのアイテム所持スロット */ -void inven_item_optimize(player_type *player_ptr, INVENTORY_IDX item) +void inven_item_optimize(PlayerType *player_ptr, INVENTORY_IDX item) { object_type *o_ptr = &player_ptr->inventory_list[item]; if (!o_ptr->k_idx) @@ -113,7 +113,7 @@ void inven_item_optimize(player_type *player_ptr, INVENTORY_IDX item) * @details * The object will be dropped "near" the current location */ -void drop_from_inventory(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER amt) +void drop_from_inventory(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER amt) { object_type forge; object_type *q_ptr; @@ -148,7 +148,7 @@ void drop_from_inventory(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBE * @details * Note special handling of the "overflow" slot */ -void combine_pack(player_type *player_ptr) +void combine_pack(PlayerType *player_ptr) { bool flag = false; bool is_first_combination = true; @@ -221,7 +221,7 @@ void combine_pack(player_type *player_ptr) * @details * Note special handling of the "overflow" slot */ -void reorder_pack(player_type *player_ptr) +void reorder_pack(PlayerType *player_ptr) { int i, j, k; int32_t o_value; @@ -282,7 +282,7 @@ void reorder_pack(player_type *player_ptr) * Note that this code must remove any location/stack information\n * from the object once it is placed into the inventory.\n */ -int16_t store_item_to_inventory(player_type *player_ptr, object_type *o_ptr) +int16_t store_item_to_inventory(PlayerType *player_ptr, object_type *o_ptr) { INVENTORY_IDX i, j, k; INVENTORY_IDX n = -1; @@ -348,7 +348,7 @@ int16_t store_item_to_inventory(player_type *player_ptr, object_type *o_ptr) * @param o_ptr 拾いたいオブジェクトの構造体参照ポインタ * @return 溢れずに済むならTRUEを返す */ -bool check_store_item_to_inventory(player_type *player_ptr, const object_type *o_ptr) +bool check_store_item_to_inventory(PlayerType *player_ptr, const object_type *o_ptr) { if (player_ptr->inven_cnt < INVEN_PACK) return true; @@ -378,7 +378,7 @@ bool check_store_item_to_inventory(player_type *player_ptr, const object_type *o * to fall to the ground.\n * Return the inventory slot into which the item is placed.\n */ -INVENTORY_IDX inven_takeoff(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER amt) +INVENTORY_IDX inven_takeoff(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER amt) { INVENTORY_IDX slot; object_type forge; diff --git a/src/inventory/inventory-object.h b/src/inventory/inventory-object.h index 256019fc6..c775f4214 100644 --- a/src/inventory/inventory-object.h +++ b/src/inventory/inventory-object.h @@ -3,13 +3,13 @@ #include "system/angband.h" struct object_type; -struct player_type; -void vary_item(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num); -void inven_item_increase(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num); -void inven_item_optimize(player_type *player_ptr, INVENTORY_IDX item); -void drop_from_inventory(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER amt); -void combine_pack(player_type *player_ptr); -void reorder_pack(player_type *player_ptr); -int16_t store_item_to_inventory(player_type *player_ptr, object_type *o_ptr); -bool check_store_item_to_inventory(player_type *player_ptr, const object_type *o_ptr); -INVENTORY_IDX inven_takeoff(player_type *player_ptr, INVENTORY_IDX item, ITEM_NUMBER amt); +class PlayerType; +void vary_item(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num); +void inven_item_increase(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num); +void inven_item_optimize(PlayerType *player_ptr, INVENTORY_IDX item); +void drop_from_inventory(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER amt); +void combine_pack(PlayerType *player_ptr); +void reorder_pack(PlayerType *player_ptr); +int16_t store_item_to_inventory(PlayerType *player_ptr, object_type *o_ptr); +bool check_store_item_to_inventory(PlayerType *player_ptr, const object_type *o_ptr); +INVENTORY_IDX inven_takeoff(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER amt); diff --git a/src/inventory/inventory-util.cpp b/src/inventory/inventory-util.cpp index be01fb639..082744da8 100644 --- a/src/inventory/inventory-util.cpp +++ b/src/inventory/inventory-util.cpp @@ -99,7 +99,7 @@ bool get_tag_floor(floor_type *floor_ptr, COMMAND_CODE *cp, char tag, FLOOR_IDX * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n * and "x" is the "current" command_cmd code.\n */ -bool get_tag(player_type *player_ptr, COMMAND_CODE *cp, char tag, BIT_FLAGS mode, const ItemTester& item_tester) +bool get_tag(PlayerType *player_ptr, COMMAND_CODE *cp, char tag, BIT_FLAGS mode, const ItemTester& item_tester) { COMMAND_CODE start, end; switch (mode) { @@ -167,7 +167,7 @@ bool get_tag(player_type *player_ptr, COMMAND_CODE *cp, char tag, BIT_FLAGS mode * @param i 選択アイテムID * @return 正規のIDならばTRUEを返す。 */ -bool get_item_okay(player_type *player_ptr, OBJECT_IDX i, const ItemTester& item_tester) +bool get_item_okay(PlayerType *player_ptr, OBJECT_IDX i, const ItemTester& item_tester) { if ((i < 0) || (i >= INVEN_TOTAL)) return false; @@ -186,7 +186,7 @@ bool get_item_okay(player_type *player_ptr, OBJECT_IDX i, const ItemTester& item * @details The item can be negative to mean "item on floor". * Hack -- allow user to "prevent" certain choices */ -bool get_item_allow(player_type *player_ptr, INVENTORY_IDX item) +bool get_item_allow(PlayerType *player_ptr, INVENTORY_IDX item) { if (!command_cmd) return true; @@ -218,7 +218,7 @@ bool get_item_allow(player_type *player_ptr, INVENTORY_IDX item) * Convert a label into the index of a item in the "equip" * @return 対応するID。該当スロットにオブジェクトが存在しなかった場合-1を返す / Return "-1" if the label does not indicate a real item */ -INVENTORY_IDX label_to_equipment(player_type *player_ptr, int c) +INVENTORY_IDX label_to_equipment(PlayerType *player_ptr, int c) { INVENTORY_IDX i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1) + INVEN_MAIN_HAND; @@ -242,7 +242,7 @@ INVENTORY_IDX label_to_equipment(player_type *player_ptr, int c) * @return 対応するID。該当スロットにオブジェクトが存在しなかった場合-1を返す / Return "-1" if the label does not indicate a real item * @details Note that the label does NOT distinguish inven/equip. */ -INVENTORY_IDX label_to_inventory(player_type *player_ptr, int c) +INVENTORY_IDX label_to_inventory(PlayerType *player_ptr, int c) { INVENTORY_IDX i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1); @@ -261,7 +261,7 @@ INVENTORY_IDX label_to_inventory(player_type *player_ptr, int c) * @return 確認がYesならTRUEを返す。 * @details The item can be negative to mean "item on floor". */ -bool verify(player_type *player_ptr, concptr prompt, INVENTORY_IDX item) +bool verify(PlayerType *player_ptr, concptr prompt, INVENTORY_IDX item) { GAME_TEXT o_name[MAX_NLEN]; char out_val[MAX_NLEN + 20]; @@ -283,7 +283,7 @@ bool verify(player_type *player_ptr, concptr prompt, INVENTORY_IDX item) * @param label ラベルリストを取得する文字列参照ポインタ * @param mode 所持品リストか装備品リストかの切り替え */ -void prepare_label_string(player_type *player_ptr, char *label, BIT_FLAGS mode, const ItemTester& item_tester) +void prepare_label_string(PlayerType *player_ptr, char *label, BIT_FLAGS mode, const ItemTester& item_tester) { concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int offset = (mode == USE_EQUIP) ? INVEN_MAIN_HAND : 0; diff --git a/src/inventory/inventory-util.h b/src/inventory/inventory-util.h index ce3f82e70..fa1070544 100644 --- a/src/inventory/inventory-util.h +++ b/src/inventory/inventory-util.h @@ -4,14 +4,14 @@ #include "system/angband.h" struct floor_type; -struct player_type; +class PlayerType; class ItemTester; bool is_ring_slot(int i); bool get_tag_floor(floor_type *floor_ptr, COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num); -bool get_tag(player_type *player_ptr, COMMAND_CODE *cp, char tag, BIT_FLAGS mode, const ItemTester& item_tester); -bool get_item_okay(player_type *player_ptr, OBJECT_IDX i, const ItemTester& item_tester); -bool get_item_allow(player_type *player_ptr, INVENTORY_IDX item); -INVENTORY_IDX label_to_equipment(player_type *player_ptr, int c); -INVENTORY_IDX label_to_inventory(player_type *player_ptr, int c); -bool verify(player_type *player_ptr, concptr prompt, INVENTORY_IDX item); -void prepare_label_string(player_type *player_ptr, char *label, BIT_FLAGS mode, const ItemTester& item_tester); +bool get_tag(PlayerType *player_ptr, COMMAND_CODE *cp, char tag, BIT_FLAGS mode, const ItemTester& item_tester); +bool get_item_okay(PlayerType *player_ptr, OBJECT_IDX i, const ItemTester& item_tester); +bool get_item_allow(PlayerType *player_ptr, INVENTORY_IDX item); +INVENTORY_IDX label_to_equipment(PlayerType *player_ptr, int c); +INVENTORY_IDX label_to_inventory(PlayerType *player_ptr, int c); +bool verify(PlayerType *player_ptr, concptr prompt, INVENTORY_IDX item); +void prepare_label_string(PlayerType *player_ptr, char *label, BIT_FLAGS mode, const ItemTester& item_tester); diff --git a/src/inventory/item-getter.cpp b/src/inventory/item-getter.cpp index fc3b66986..370ccc1e5 100644 --- a/src/inventory/item-getter.cpp +++ b/src/inventory/item-getter.cpp @@ -51,7 +51,7 @@ static void check_item_selection_mode(item_selection_type *item_selection_ptr) * @return プレイヤーによりアイテムが選択されたならTRUEを返す * @todo 適切な関数名をどうしても付けられなかったので暫定でauxとした */ -static bool check_item_tag_aux(player_type *player_ptr, item_selection_type *item_selection_ptr, const ItemTester& item_tester) +static bool check_item_tag_aux(PlayerType *player_ptr, item_selection_type *item_selection_ptr, const ItemTester& item_tester) { if (!item_selection_ptr->floor || (*item_selection_ptr->cp >= 0)) return false; @@ -73,7 +73,7 @@ static bool check_item_tag_aux(player_type *player_ptr, item_selection_type *ite * @param prev_tag 前回選択したアイテムのタグ (のはず) * @return プレイヤーによりアイテムが選択されたならTRUEを返す */ -static bool check_item_tag_inventory(player_type *player_ptr, item_selection_type *item_selection_ptr, char *prev_tag, const ItemTester& item_tester) +static bool check_item_tag_inventory(PlayerType *player_ptr, item_selection_type *item_selection_ptr, char *prev_tag, const ItemTester& item_tester) { if ((!item_selection_ptr->inven || (*item_selection_ptr->cp < 0) || (*item_selection_ptr->cp >= INVEN_PACK)) && (!item_selection_ptr->equip || (*item_selection_ptr->cp < INVEN_MAIN_HAND) || (*item_selection_ptr->cp >= INVEN_TOTAL))) @@ -116,7 +116,7 @@ static bool check_item_tag_inventory(player_type *player_ptr, item_selection_typ * @param prev_tag 前回選択したアイテムのタグ (のはず) * @return プレイヤーによりアイテムが選択されたならTRUEを返す */ -static bool check_item_tag(player_type *player_ptr, item_selection_type *item_selection_ptr, char *prev_tag, const ItemTester& item_tester) +static bool check_item_tag(PlayerType *player_ptr, item_selection_type *item_selection_ptr, char *prev_tag, const ItemTester& item_tester) { if (!repeat_pull(item_selection_ptr->cp)) return false; @@ -137,7 +137,7 @@ static bool check_item_tag(player_type *player_ptr, item_selection_type *item_se * @param player_ptr プレイヤーへの参照ポインタ * @param fis_ptr アイテム選択への参照ポインタ */ -static void test_inventory(player_type *player_ptr, item_selection_type *item_selection_ptr, const ItemTester& item_tester) +static void test_inventory(PlayerType *player_ptr, item_selection_type *item_selection_ptr, const ItemTester& item_tester) { if (!item_selection_ptr->inven) { item_selection_ptr->i2 = -1; @@ -157,7 +157,7 @@ static void test_inventory(player_type *player_ptr, item_selection_type *item_se * @param player_ptr プレイヤーへの参照ポインタ * @param fis_ptr アイテム選択への参照ポインタ */ -static void test_equipment(player_type *player_ptr, item_selection_type *item_selection_ptr, const ItemTester& item_tester) +static void test_equipment(PlayerType *player_ptr, item_selection_type *item_selection_ptr, const ItemTester& item_tester) { if (!item_selection_ptr->equip) { item_selection_ptr->e2 = -1; @@ -187,7 +187,7 @@ static void test_equipment(player_type *player_ptr, item_selection_type *item_se * @return プレイヤーによりアイテムが選択されたならTRUEを返す * Return TRUE only if an acceptable item was chosen by the user */ -bool get_item(player_type *player_ptr, OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester) +bool get_item(PlayerType *player_ptr, OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester) { static char prev_tag = '\0'; if (easy_floor || use_menu) diff --git a/src/inventory/item-getter.h b/src/inventory/item-getter.h index c087f280f..60f165aee 100644 --- a/src/inventory/item-getter.h +++ b/src/inventory/item-getter.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ItemTester; -bool get_item(player_type *player_ptr, OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester); +bool get_item(PlayerType *player_ptr, OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester); diff --git a/src/inventory/pack-overflow.cpp b/src/inventory/pack-overflow.cpp index 4d9c6da66..3cdb1e470 100644 --- a/src/inventory/pack-overflow.cpp +++ b/src/inventory/pack-overflow.cpp @@ -14,7 +14,7 @@ /*! * @brief アイテムの所持種類数が超えた場合にアイテムを床に落とす処理 */ -void pack_overflow(player_type *player_ptr) +void pack_overflow(PlayerType *player_ptr) { if (player_ptr->inventory_list[INVEN_PACK].k_idx == 0) return; diff --git a/src/inventory/pack-overflow.h b/src/inventory/pack-overflow.h index 0709bcace..8870728ec 100644 --- a/src/inventory/pack-overflow.h +++ b/src/inventory/pack-overflow.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void pack_overflow(player_type *player_ptr); +class PlayerType; +void pack_overflow(PlayerType *player_ptr); diff --git a/src/inventory/player-inventory.cpp b/src/inventory/player-inventory.cpp index 89fbe504a..ebdf84496 100644 --- a/src/inventory/player-inventory.cpp +++ b/src/inventory/player-inventory.cpp @@ -44,7 +44,7 @@ * @return アイテムを拾えるならばTRUEを返す。 * @details assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR). */ -bool can_get_item(player_type *player_ptr, const ItemTester& item_tester) +bool can_get_item(PlayerType *player_ptr, const ItemTester& item_tester) { for (int j = 0; j < INVEN_TOTAL; j++) if (item_tester.okay(&player_ptr->inventory_list[j])) @@ -59,7 +59,7 @@ bool can_get_item(player_type *player_ptr, const ItemTester& item_tester) * @brief 床上のアイテムを拾う選択用サブルーチン * @return プレイヤーによりアイテムが選択されたならTRUEを返す。 */ -static bool py_pickup_floor_aux(player_type *player_ptr) +static bool py_pickup_floor_aux(PlayerType *player_ptr) { OBJECT_IDX this_o_idx; OBJECT_IDX item; @@ -80,7 +80,7 @@ static bool py_pickup_floor_aux(player_type *player_ptr) * @details * This is called by py_pickup() when easy_floor is TRUE. */ -void py_pickup_floor(player_type *player_ptr, bool pickup) +void py_pickup_floor(PlayerType *player_ptr, bool pickup) { GAME_TEXT o_name[MAX_NLEN]; object_type *o_ptr; @@ -172,7 +172,7 @@ void py_pickup_floor(player_type *player_ptr, bool pickup) * Add the given dungeon object to the character's inventory.\n * Delete the object afterwards.\n */ -void describe_pickup_item(player_type *player_ptr, OBJECT_IDX o_idx) +void describe_pickup_item(PlayerType *player_ptr, OBJECT_IDX o_idx) { #ifdef JP GAME_TEXT o_name[MAX_NLEN]; @@ -235,7 +235,7 @@ void describe_pickup_item(player_type *player_ptr, OBJECT_IDX o_idx) * @param player_ptr プレイヤーへの参照ポインタ * @param pickup 自動拾い処理を行うならばTRUEとする */ -void carry(player_type *player_ptr, bool pickup) +void carry(PlayerType *player_ptr, bool pickup) { verify_panel(player_ptr); player_ptr->update |= PU_MONSTERS; diff --git a/src/inventory/player-inventory.h b/src/inventory/player-inventory.h index 596391f15..d6e79ae3a 100644 --- a/src/inventory/player-inventory.h +++ b/src/inventory/player-inventory.h @@ -3,9 +3,9 @@ #include "object/tval-types.h" #include "system/angband.h" -struct player_type; +class PlayerType; class ItemTester; -bool can_get_item(player_type *player_ptr, const ItemTester& item_tester); -void py_pickup_floor(player_type *player_ptr, bool pickup); -void describe_pickup_item(player_type *player_ptr, OBJECT_IDX o_idx); -void carry(player_type *player_ptr, bool pickup); +bool can_get_item(PlayerType *player_ptr, const ItemTester& item_tester); +void py_pickup_floor(PlayerType *player_ptr, bool pickup); +void describe_pickup_item(PlayerType *player_ptr, OBJECT_IDX o_idx); +void carry(PlayerType *player_ptr, bool pickup); diff --git a/src/inventory/recharge-processor.cpp b/src/inventory/recharge-processor.cpp index 25accef30..b62f15206 100644 --- a/src/inventory/recharge-processor.cpp +++ b/src/inventory/recharge-processor.cpp @@ -19,7 +19,7 @@ * If player has inscribed the object with "!!", let him know when it's recharged. -LM- * @param o_ptr 対象オブジェクトの構造体参照ポインタ */ -static void recharged_notice(player_type *player_ptr, object_type *o_ptr) +static void recharged_notice(PlayerType *player_ptr, object_type *o_ptr) { if (!o_ptr->inscription) return; @@ -49,7 +49,7 @@ static void recharged_notice(player_type *player_ptr, object_type *o_ptr) * @brief 10ゲームターンが進行するごとに魔道具の自然充填を行う処理 * / Handle recharging objects once every 10 game turns */ -void recharge_magic_items(player_type *player_ptr) +void recharge_magic_items(PlayerType *player_ptr) { int i; bool changed; diff --git a/src/inventory/recharge-processor.h b/src/inventory/recharge-processor.h index 6b5360421..dbd54c80b 100644 --- a/src/inventory/recharge-processor.h +++ b/src/inventory/recharge-processor.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void recharge_magic_items(player_type *player_ptr); +class PlayerType; +void recharge_magic_items(PlayerType *player_ptr); diff --git a/src/io-dump/character-dump.cpp b/src/io-dump/character-dump.cpp index 19037ab13..a6007f484 100644 --- a/src/io-dump/character-dump.cpp +++ b/src/io-dump/character-dump.cpp @@ -54,7 +54,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_pet(player_type *player_ptr, FILE *fff) +static void dump_aux_pet(PlayerType *player_ptr, FILE *fff) { bool pet = false; bool pet_settings = false; @@ -109,7 +109,7 @@ static void dump_aux_pet(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_quest(player_type *player_ptr, FILE *fff) +static void dump_aux_quest(PlayerType *player_ptr, FILE *fff) { fprintf(fff, _("\n\n [クエスト情報]\n", "\n\n [Quest Information]\n")); std::vector quest_num(max_q_idx); @@ -130,7 +130,7 @@ static void dump_aux_quest(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_last_message(player_type *player_ptr, FILE *fff) +static void dump_aux_last_message(PlayerType *player_ptr, FILE *fff) { if (!player_ptr->is_dead) return; @@ -234,7 +234,7 @@ static void dump_aux_options(FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_arena(player_type *player_ptr, FILE *fff) +static void dump_aux_arena(PlayerType *player_ptr, FILE *fff) { if (lite_town || vanilla_town) return; @@ -281,7 +281,7 @@ static void dump_aux_arena(player_type *player_ptr, FILE *fff) * @brief 撃破モンスターの情報をファイルにダンプする * @param fff ファイルポインタ */ -static void dump_aux_monsters(player_type *player_ptr, FILE *fff) +static void dump_aux_monsters(PlayerType *player_ptr, FILE *fff) { fprintf(fff, _("\n [倒したモンスター]\n\n", "\n [Defeated Monsters]\n\n")); @@ -360,7 +360,7 @@ static void dump_aux_monsters(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_race_history(player_type *player_ptr, FILE *fff) +static void dump_aux_race_history(PlayerType *player_ptr, FILE *fff) { if (!player_ptr->old_race1 && !player_ptr->old_race2) return; @@ -388,7 +388,7 @@ static void dump_aux_race_history(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_realm_history(player_type *player_ptr, FILE *fff) +static void dump_aux_realm_history(PlayerType *player_ptr, FILE *fff) { if (player_ptr->old_realm == 0) return; @@ -408,7 +408,7 @@ static void dump_aux_realm_history(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_virtues(player_type *player_ptr, FILE *fff) +static void dump_aux_virtues(PlayerType *player_ptr, FILE *fff) { fprintf(fff, _("\n\n [自分に関する情報]\n\n", "\n\n [HP-rate & Max stat & Virtues]\n\n")); @@ -445,7 +445,7 @@ static void dump_aux_virtues(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_mutations(player_type *player_ptr, FILE *fff) +static void dump_aux_mutations(PlayerType *player_ptr, FILE *fff) { if (player_ptr->muta.any()) { fprintf(fff, _("\n\n [突然変異]\n\n", "\n\n [Mutations]\n\n")); @@ -458,7 +458,7 @@ static void dump_aux_mutations(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_aux_equipment_inventory(player_type *player_ptr, FILE *fff) +static void dump_aux_equipment_inventory(PlayerType *player_ptr, FILE *fff) { GAME_TEXT o_name[MAX_NLEN]; if (player_ptr->equip_cnt) { @@ -490,7 +490,7 @@ static void dump_aux_equipment_inventory(player_type *player_ptr, FILE *fff) * @brief 我が家と博物館のオブジェクト情報をファイルにダンプする * @param fff ファイルポインタ */ -static void dump_aux_home_museum(player_type *player_ptr, FILE *fff) +static void dump_aux_home_museum(PlayerType *player_ptr, FILE *fff) { store_type *store_ptr; store_ptr = &town_info[1].store[enum2i(StoreSaleType::HOME)]; @@ -552,7 +552,7 @@ static concptr get_check_sum(void) * @param fff ファイルポインタ * @return エラーコード */ -void make_character_dump(player_type *player_ptr, FILE *fff, display_player_pf display_player) +void make_character_dump(PlayerType *player_ptr, FILE *fff, display_player_pf display_player) { char title[127]; put_version(title); diff --git a/src/io-dump/character-dump.h b/src/io-dump/character-dump.h index 7c1331de1..373eb3519 100644 --- a/src/io-dump/character-dump.h +++ b/src/io-dump/character-dump.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "io/files-util.h" -struct player_type; -void make_character_dump(player_type *player_ptr, FILE *fff, display_player_pf display_player); +class PlayerType; +void make_character_dump(PlayerType *player_ptr, FILE *fff, display_player_pf display_player); diff --git a/src/io-dump/player-status-dump.cpp b/src/io-dump/player-status-dump.cpp index 301573a86..fffbbe366 100644 --- a/src/io-dump/player-status-dump.cpp +++ b/src/io-dump/player-status-dump.cpp @@ -11,7 +11,7 @@ * @param change_color バッファへ詰める文字の変更有無 */ static void dump_player_status_with_screen_num( - player_type *player_ptr, FILE *fff, display_player_pf display_player, + PlayerType *player_ptr, FILE *fff, display_player_pf display_player, int screen_num, TERM_LEN start_y, TERM_LEN end_y, bool change_color) { TERM_COLOR a; @@ -51,7 +51,7 @@ static void dump_player_status_with_screen_num( * @param fff ファイルポインタ * @param display_player 画面表示へのコールバック */ -void dump_aux_player_status(player_type *player_ptr, FILE *fff, display_player_pf display_player) +void dump_aux_player_status(PlayerType *player_ptr, FILE *fff, display_player_pf display_player) { dump_player_status_with_screen_num(player_ptr, fff, display_player, 0, 1, 22, false); dump_player_status_with_screen_num(player_ptr, fff, display_player, 1, 10, 19, false); diff --git a/src/io-dump/player-status-dump.h b/src/io-dump/player-status-dump.h index b5c4346c7..9cffe656a 100644 --- a/src/io-dump/player-status-dump.h +++ b/src/io-dump/player-status-dump.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "io/files-util.h" -struct player_type; -void dump_aux_player_status(player_type *player_ptr, FILE *fff, display_player_pf display_player); +class PlayerType; +void dump_aux_player_status(PlayerType *player_ptr, FILE *fff, display_player_pf display_player); diff --git a/src/io-dump/random-art-info-dumper.cpp b/src/io-dump/random-art-info-dumper.cpp index 58765a51e..1edf8738a 100644 --- a/src/io-dump/random-art-info-dumper.cpp +++ b/src/io-dump/random-art-info-dumper.cpp @@ -52,7 +52,7 @@ static void spoiler_print_randart(object_type *o_ptr, obj_desc_list *art_ptr) * @param o_ptr ランダムアーティファクトのオブジェクト構造体参照ポインタ * @param tval 出力したいランダムアーティファクトの種類 */ -static void spoil_random_artifact_aux(player_type *player_ptr, object_type *o_ptr, ItemKindType tval) +static void spoil_random_artifact_aux(PlayerType *player_ptr, object_type *o_ptr, ItemKindType tval) { obj_desc_list artifact; if (!o_ptr->is_known() || !o_ptr->art_name || o_ptr->tval != tval) @@ -67,7 +67,7 @@ static void spoil_random_artifact_aux(player_type *player_ptr, object_type *o_pt * Create a list file for random artifacts * @param fname 出力ファイル名 */ -void spoil_random_artifact(player_type *player_ptr, concptr fname) +void spoil_random_artifact(PlayerType *player_ptr, concptr fname) { store_type *store_ptr; object_type *q_ptr; diff --git a/src/io-dump/random-art-info-dumper.h b/src/io-dump/random-art-info-dumper.h index cd79127e3..7d49fe4a3 100644 --- a/src/io-dump/random-art-info-dumper.h +++ b/src/io-dump/random-art-info-dumper.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -void spoil_random_artifact(player_type *player_ptr, concptr fname); +class PlayerType; +void spoil_random_artifact(PlayerType *player_ptr, concptr fname); diff --git a/src/io-dump/special-class-dump.cpp b/src/io-dump/special-class-dump.cpp index 8321c6267..ca4f7c7e2 100644 --- a/src/io-dump/special-class-dump.cpp +++ b/src/io-dump/special-class-dump.cpp @@ -34,7 +34,7 @@ typedef struct { * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_magic_eater(player_type *player_ptr, FILE *fff) +static void dump_magic_eater(PlayerType *player_ptr, FILE *fff) { auto magic_eater_data = PlayerClass(player_ptr).get_specific_data(); if (!magic_eater_data) { @@ -98,7 +98,7 @@ static void dump_magic_eater(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_smith(player_type *player_ptr, FILE *fff) +static void dump_smith(PlayerType *player_ptr, FILE *fff) { fprintf(fff, _("\n\n [手に入れたエッセンス]\n\n", "\n\n [Get Essence]\n\n")); fprintf(fff, _("エッセンス 個数 エッセンス 個数 エッセンス 個数", "Essence Num Essence Num Essence Num ")); @@ -161,7 +161,7 @@ static void add_monster_spell_type(char p[][80], int col, BlueMagicType SpellPro * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_blue_mage(player_type *player_ptr, FILE *fff) +static void dump_blue_mage(PlayerType *player_ptr, FILE *fff) { const auto bluemage_data = PlayerClass(player_ptr).get_specific_data(); if (!bluemage_data) { @@ -228,7 +228,7 @@ static void dump_blue_mage(player_type *player_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -void dump_aux_class_special(player_type *player_ptr, FILE *fff) +void dump_aux_class_special(PlayerType *player_ptr, FILE *fff) { switch (player_ptr->pclass) { case PlayerClassType::MAGIC_EATER: { diff --git a/src/io-dump/special-class-dump.h b/src/io-dump/special-class-dump.h index 27a8147f0..76bb44e7e 100644 --- a/src/io-dump/special-class-dump.h +++ b/src/io-dump/special-class-dump.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -void dump_aux_class_special(player_type *player_ptr, FILE *fff); +class PlayerType; +void dump_aux_class_special(PlayerType *player_ptr, FILE *fff); diff --git a/src/io/cursor.cpp b/src/io/cursor.cpp index b782e06c9..ca8b9a713 100644 --- a/src/io/cursor.cpp +++ b/src/io/cursor.cpp @@ -35,7 +35,7 @@ void move_cursor_relative(int row, int col) * @param y 目標地点のY座標 * @param x 目標地点のX座標 */ -void print_path(player_type *player_ptr, POSITION y, POSITION x) +void print_path(PlayerType *player_ptr, POSITION y, POSITION x) { uint16_t path_g[512]; byte default_color = TERM_SLATE; @@ -101,7 +101,7 @@ void print_path(player_type *player_ptr, POSITION y, POSITION x) * Also used in do_cmd_locate * @return 実際に再描画が必要だった場合TRUEを返す */ -bool change_panel(player_type *player_ptr, POSITION dy, POSITION dx) +bool change_panel(PlayerType *player_ptr, POSITION dy, POSITION dx) { TERM_LEN wid, hgt; get_screen_size(&wid, &hgt); diff --git a/src/io/cursor.h b/src/io/cursor.h index 63808f2c6..dda94060d 100644 --- a/src/io/cursor.h +++ b/src/io/cursor.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; +class PlayerType; void move_cursor_relative(int row, int col); -void print_path(player_type *player_ptr, POSITION y, POSITION x); -bool change_panel(player_type *player_ptr, POSITION dy, POSITION dx); +void print_path(PlayerType *player_ptr, POSITION y, POSITION x); +bool change_panel(PlayerType *player_ptr, POSITION dy, POSITION dx); void panel_bounds_center(void); diff --git a/src/io/exit-panic.cpp b/src/io/exit-panic.cpp index 44cf09687..d743ecd14 100644 --- a/src/io/exit-panic.cpp +++ b/src/io/exit-panic.cpp @@ -24,7 +24,7 @@ * This routine is called only in very rare situations, and only * by certain visual systems, when they experience fatal errors. */ -void exit_game_panic(player_type *player_ptr) +void exit_game_panic(PlayerType *player_ptr) { if (!w_ptr->character_generated || w_ptr->character_saved) quit(_("緊急事態", "panic")); diff --git a/src/io/exit-panic.h b/src/io/exit-panic.h index 8c41b0113..7d7f0b4b0 100644 --- a/src/io/exit-panic.h +++ b/src/io/exit-panic.h @@ -5,5 +5,5 @@ #include "system/angband.h" -struct player_type; -void exit_game_panic(player_type *player_ptr); +class PlayerType; +void exit_game_panic(PlayerType *player_ptr); diff --git a/src/io/files-util.cpp b/src/io/files-util.cpp index 4d6f89379..025ca1649 100644 --- a/src/io/files-util.cpp +++ b/src/io/files-util.cpp @@ -57,7 +57,7 @@ char debug_savefile[1024]; * Allow the "full" flag to dump additional info, * and trigger its usage from various places in the code. */ -errr file_character(player_type *player_ptr, concptr name, display_player_pf display_player) +errr file_character(PlayerType *player_ptr, concptr name, display_player_pf display_player) { char buf[1024]; path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name); @@ -201,7 +201,7 @@ errr get_rnd_line_jonly(concptr file_name, int entry, char *output, int count) * @return エラーコード * @details */ -static errr counts_seek(player_type *player_ptr, int fd, uint32_t where, bool flag) +static errr counts_seek(PlayerType *player_ptr, int fd, uint32_t where, bool flag) { char temp1[128], temp2[128]; auto short_pclass = enum2i(player_ptr->pclass); @@ -244,7 +244,7 @@ static errr counts_seek(player_type *player_ptr, int fd, uint32_t where, bool fl * @return エラーコード * @details */ -uint32_t counts_read(player_type *player_ptr, int where) +uint32_t counts_read(PlayerType *player_ptr, int where) { char buf[1024]; path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, _("z_info_j.raw", "z_info.raw")); @@ -267,7 +267,7 @@ uint32_t counts_read(player_type *player_ptr, int where) * @return エラーコード * @details */ -errr counts_write(player_type *player_ptr, int where, uint32_t count) +errr counts_write(PlayerType *player_ptr, int where, uint32_t count) { char buf[1024]; path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, _("z_info_j.raw", "z_info.raw")); diff --git a/src/io/files-util.h b/src/io/files-util.h index 8c7e5c4d1..07208887b 100644 --- a/src/io/files-util.h +++ b/src/io/files-util.h @@ -21,16 +21,16 @@ extern concptr ANGBAND_DIR_DEBUG_SAVE; extern concptr ANGBAND_DIR_USER; extern concptr ANGBAND_DIR_XTRA; -struct player_type; -typedef void (*display_player_pf)(player_type *, int); +class PlayerType; +typedef void (*display_player_pf)(PlayerType *, int); typedef void(*update_playtime_pf)(void); -extern errr file_character(player_type *player_ptr, concptr name, display_player_pf display_player); +extern errr file_character(PlayerType *player_ptr, concptr name, display_player_pf display_player); extern errr get_rnd_line(concptr file_name, int entry, char *output); void read_dead_file(char* buf, size_t buf_size); #ifdef JP extern errr get_rnd_line_jonly(concptr file_name, int entry, char *output, int count); #endif -extern errr counts_write(player_type *player_ptr, int where, uint32_t count); -extern uint32_t counts_read(player_type *player_ptr, int where); +extern errr counts_write(PlayerType *player_ptr, int where, uint32_t count); +extern uint32_t counts_read(PlayerType *player_ptr, int where); diff --git a/src/io/input-key-processor.cpp b/src/io/input-key-processor.cpp index 45fdb2d19..a1675a9bd 100644 --- a/src/io/input-key-processor.cpp +++ b/src/io/input-key-processor.cpp @@ -102,7 +102,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 実際にデバッグコマンドへ移行したらTRUEを返す。 */ -static bool enter_debug_mode(player_type *player_ptr) +static bool enter_debug_mode(PlayerType *player_ptr) { if (!w_ptr->noscore) { if (!allow_debug_options) { @@ -130,7 +130,7 @@ static bool enter_debug_mode(player_type *player_ptr) * / Parse and execute the current command Give "Warning" on illegal commands. * @todo Make some "blocks" */ -void process_command(player_type *player_ptr) +void process_command(PlayerType *player_ptr) { COMMAND_CODE old_now_message = now_message; repeat_check(); diff --git a/src/io/input-key-processor.h b/src/io/input-key-processor.h index 3d296d762..bf318f5eb 100644 --- a/src/io/input-key-processor.h +++ b/src/io/input-key-processor.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void process_command(player_type* player_ptr); +class PlayerType; +void process_command(PlayerType* player_ptr); diff --git a/src/io/input-key-requester.cpp b/src/io/input-key-requester.cpp index 0aa3b26c1..6362cfc97 100644 --- a/src/io/input-key-requester.cpp +++ b/src/io/input-key-requester.cpp @@ -46,7 +46,7 @@ int16_t command_new; /* Command chaining from inven/equip view */ */ static char request_command_buffer[256]; -static char inkey_from_menu(player_type *player_ptr) +static char inkey_from_menu(PlayerType *player_ptr) { char cmd; int basey, basex; @@ -189,7 +189,7 @@ static char inkey_from_menu(player_type *player_ptr) * * Note that "player_ptr->command_new" may not work any more. */ -void request_command(player_type *player_ptr, int shopping) +void request_command(PlayerType *player_ptr, int shopping) { int16_t cmd; int mode; diff --git a/src/io/input-key-requester.h b/src/io/input-key-requester.h index 6959600af..dc4dd0e6a 100644 --- a/src/io/input-key-requester.h +++ b/src/io/input-key-requester.h @@ -16,5 +16,5 @@ extern TERM_LEN command_gap; extern int16_t command_wrk; extern int16_t command_new; -struct player_type; -void request_command(player_type *player_ptr, int shopping); +class PlayerType; +void request_command(PlayerType *player_ptr, int shopping); diff --git a/src/io/interpret-pref-file.cpp b/src/io/interpret-pref-file.cpp index 90bd894d3..20c494d87 100644 --- a/src/io/interpret-pref-file.cpp +++ b/src/io/interpret-pref-file.cpp @@ -291,7 +291,7 @@ static errr interpret_v_token(char *buf) * Process "X:" -- turn option off * Process "Y:" -- turn option on */ -static errr interpret_xy_token(player_type *player_ptr, char *buf) +static errr interpret_xy_token(PlayerType *player_ptr, char *buf) { for (int i = 0; option_info[i].o_desc; i++) { bool is_option = option_info[i].o_var != nullptr; @@ -470,7 +470,7 @@ static errr interpret_t_token(char *buf) * used for the "nothing" attr/char. * */ -errr interpret_pref_file(player_type *player_ptr, char *buf) +errr interpret_pref_file(PlayerType *player_ptr, char *buf) { if (buf[1] != ':') return 1; diff --git a/src/io/interpret-pref-file.h b/src/io/interpret-pref-file.h index df79a0263..0fc5f6502 100644 --- a/src/io/interpret-pref-file.h +++ b/src/io/interpret-pref-file.h @@ -6,6 +6,6 @@ extern char *histpref_buf; -struct player_type; -errr interpret_pref_file(player_type *player_ptr, char *buf); +class PlayerType; +errr interpret_pref_file(PlayerType *player_ptr, char *buf); void add_history_from_pref_line(concptr t); diff --git a/src/io/mutations-dump.cpp b/src/io/mutations-dump.cpp index 39c7810de..eb8c20140 100644 --- a/src/io/mutations-dump.cpp +++ b/src/io/mutations-dump.cpp @@ -13,7 +13,7 @@ * @brief ファイルポインタを通じて突然変異の一覧を出力する * @param out_file 出力先ファイルポインタ */ -void dump_mutations(player_type *player_ptr, FILE *out_file) +void dump_mutations(PlayerType *player_ptr, FILE *out_file) { if (!out_file) return; diff --git a/src/io/mutations-dump.h b/src/io/mutations-dump.h index f6861b443..887e16671 100644 --- a/src/io/mutations-dump.h +++ b/src/io/mutations-dump.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -void dump_mutations(player_type *player_ptr, FILE *out_file); +class PlayerType; +void dump_mutations(PlayerType *player_ptr, FILE *out_file); diff --git a/src/io/pref-file-expressor.cpp b/src/io/pref-file-expressor.cpp index 7f2a2fb76..2b12a37ca 100644 --- a/src/io/pref-file-expressor.cpp +++ b/src/io/pref-file-expressor.cpp @@ -24,7 +24,7 @@ * result * */ -concptr process_pref_file_expr(player_type *player_ptr, char **sp, char *fp) +concptr process_pref_file_expr(PlayerType *player_ptr, char **sp, char *fp) { char *s; s = (*sp); diff --git a/src/io/pref-file-expressor.h b/src/io/pref-file-expressor.h index ba7b13593..82311bf26 100644 --- a/src/io/pref-file-expressor.h +++ b/src/io/pref-file-expressor.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -concptr process_pref_file_expr(player_type *player_ptr, char **sp, char *fp); +class PlayerType; +concptr process_pref_file_expr(PlayerType *player_ptr, char **sp, char *fp); diff --git a/src/io/read-pref-file.cpp b/src/io/read-pref-file.cpp index cf18bba9c..1148f8804 100644 --- a/src/io/read-pref-file.cpp +++ b/src/io/read-pref-file.cpp @@ -54,7 +54,7 @@ static int auto_dump_line_num; * @return エラーコード * @todo 関数名を変更する */ -static errr process_pref_file_aux(player_type *player_ptr, concptr name, int preftype) +static errr process_pref_file_aux(PlayerType *player_ptr, concptr name, int preftype) { FILE *fp; fp = angband_fopen(name, "r"); @@ -153,7 +153,7 @@ static errr process_pref_file_aux(player_type *player_ptr, concptr name, int pre * allow conditional evaluation and filename inclusion. * */ -errr process_pref_file(player_type *player_ptr, concptr name, bool only_user_dir) +errr process_pref_file(PlayerType *player_ptr, concptr name, bool only_user_dir) { char buf[1024]; errr err1 = 0; @@ -179,7 +179,7 @@ errr process_pref_file(player_type *player_ptr, concptr name, bool only_user_dir * @param name ファイル名 * @details */ -errr process_autopick_file(player_type *player_ptr, concptr name) +errr process_autopick_file(PlayerType *player_ptr, concptr name) { char buf[1024]; path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name); @@ -195,7 +195,7 @@ errr process_autopick_file(player_type *player_ptr, concptr name) * @return エラーコード * @details */ -errr process_histpref_file(player_type *player_ptr, concptr name) +errr process_histpref_file(PlayerType *player_ptr, concptr name) { bool old_character_xtra = w_ptr->character_xtra; char buf[1024]; @@ -278,7 +278,7 @@ void close_auto_dump(FILE **fpp, concptr auto_dump_mark) * Modified by Arcum Dagsson to support * separate macro files for different realms. */ -void load_all_pref_files(player_type *player_ptr) +void load_all_pref_files(PlayerType *player_ptr) { char buf[1024]; sprintf(buf, "user.prf"); @@ -307,7 +307,7 @@ void load_all_pref_files(player_type *player_ptr) /*! * @brief 生い立ちメッセージをファイルからロードする。 */ -bool read_histpref(player_type *player_ptr) +bool read_histpref(PlayerType *player_ptr) { char buf[80]; errr err; diff --git a/src/io/read-pref-file.h b/src/io/read-pref-file.h index b12bceb61..00ae6a67d 100644 --- a/src/io/read-pref-file.h +++ b/src/io/read-pref-file.h @@ -5,14 +5,14 @@ extern char auto_dump_header[]; extern char auto_dump_footer[]; -struct player_type; -errr process_pref_file(player_type *player_ptr, concptr name, bool only_user_dir = false); -errr process_autopick_file(player_type *player_ptr, concptr name); -errr process_histpref_file(player_type *player_ptr, concptr name); -bool read_histpref(player_type *player_ptr); +class PlayerType; +errr process_pref_file(PlayerType *player_ptr, concptr name, bool only_user_dir = false); +errr process_autopick_file(PlayerType *player_ptr, concptr name); +errr process_histpref_file(PlayerType *player_ptr, concptr name); +bool read_histpref(PlayerType *player_ptr); void auto_dump_printf(FILE *auto_dump_stream, concptr fmt, ...); bool open_auto_dump(FILE **fpp, concptr buf, concptr mark); void close_auto_dump(FILE **fpp, concptr auto_dump_mark); -void load_all_pref_files(player_type* player_ptr); +void load_all_pref_files(PlayerType* player_ptr); diff --git a/src/io/record-play-movie.cpp b/src/io/record-play-movie.cpp index fdcef1e81..517de4700 100644 --- a/src/io/record-play-movie.cpp +++ b/src/io/record-play-movie.cpp @@ -268,7 +268,7 @@ void prepare_chuukei_hooks(void) /* * Prepare z-term hooks to call send_*_to_chuukei_server()'s */ -void prepare_movie_hooks(player_type *player_ptr) +void prepare_movie_hooks(PlayerType *player_ptr) { char buf[1024]; char tmp[80]; diff --git a/src/io/record-play-movie.h b/src/io/record-play-movie.h index 1fccbaa27..c079162a6 100644 --- a/src/io/record-play-movie.h +++ b/src/io/record-play-movie.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -void prepare_movie_hooks(player_type *player_ptr); +class PlayerType; +void prepare_movie_hooks(PlayerType *player_ptr); void prepare_browse_movie_without_path_build(concptr filename); void browse_movie(void); #ifndef WINDOWS diff --git a/src/io/report.cpp b/src/io/report.cpp index 476d4dc05..6895ddb17 100644 --- a/src/io/report.cpp +++ b/src/io/report.cpp @@ -235,7 +235,7 @@ static bool http_post(concptr url, BUF *buf) * @param dumpbuf 伝送内容バッファ * @return エラーコード */ -static errr make_dump(player_type *player_ptr, BUF *dumpbuf, display_player_pf display_player) +static errr make_dump(PlayerType *player_ptr, BUF *dumpbuf, display_player_pf display_player) { char buf[1024]; FILE *fff; @@ -274,7 +274,7 @@ static errr make_dump(player_type *player_ptr, BUF *dumpbuf, display_player_pf d * @brief スクリーンダンプを作成する/ Make screen dump to buffer * @return 作成したスクリーンダンプの参照ポインタ */ -concptr make_screen_dump(player_type *player_ptr) +concptr make_screen_dump(PlayerType *player_ptr) { static concptr html_head[] = { "\n\n", @@ -403,7 +403,7 @@ concptr make_screen_dump(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 正常にスコアを送信できたらtrue、失敗時に送信を中止したらfalse */ -bool report_score(player_type *player_ptr, display_player_pf display_player) +bool report_score(PlayerType *player_ptr, display_player_pf display_player) { auto *score = buf_new(); char personality_desc[128]; diff --git a/src/io/report.h b/src/io/report.h index bdc8c7146..9563d88ec 100644 --- a/src/io/report.h +++ b/src/io/report.h @@ -7,7 +7,7 @@ extern concptr screen_dump; #ifdef WORLD_SCORE #include "io/files-util.h" -struct player_type; -bool report_score(player_type *player_ptr, display_player_pf display_player); -concptr make_screen_dump(player_type *player_ptr); +class PlayerType; +bool report_score(PlayerType *player_ptr, display_player_pf display_player); +concptr make_screen_dump(PlayerType *player_ptr); #endif diff --git a/src/io/screen-util.cpp b/src/io/screen-util.cpp index 3ac8f96ed..d80cec4e7 100644 --- a/src/io/screen-util.cpp +++ b/src/io/screen-util.cpp @@ -41,7 +41,7 @@ /*! * @brief コンソールのリサイズに合わせてマップを再描画する / * Map resizing whenever the main term changes size - * @todo ここにplayer_type を追加するとz-termに影響が行くので保留 + * @todo ここにPlayerType を追加するとz-termに影響が行くので保留 */ void resize_map() { diff --git a/src/io/signal-handlers.cpp b/src/io/signal-handlers.cpp index de7b365fe..0ec3d68ec 100644 --- a/src/io/signal-handlers.cpp +++ b/src/io/signal-handlers.cpp @@ -58,7 +58,7 @@ static void handle_signal_suspend(int sig) * To prevent messy accidents, we should reset this global variable * whenever the user enters a keypress, or something like that. * - * @todo ここにplayer_typeを追加すると関数ポインタ周りの収拾がつかなくなるので保留 + * @todo ここにPlayerTypeを追加すると関数ポインタ周りの収拾がつかなくなるので保留 */ static void handle_signal_simple(int sig) { diff --git a/src/io/uid-checker.cpp b/src/io/uid-checker.cpp index 0b342e0e1..aae37fab4 100644 --- a/src/io/uid-checker.cpp +++ b/src/io/uid-checker.cpp @@ -38,7 +38,7 @@ void safe_setuid_drop(void) /*! * @brief ファイルのグラブパーミッションチェック / Hack -- grab permissions */ -void safe_setuid_grab(player_type *player_ptr) +void safe_setuid_grab(PlayerType *player_ptr) { #ifdef SET_UID #ifdef SAFE_SETUID diff --git a/src/io/uid-checker.h b/src/io/uid-checker.h index 33d09201e..daab89289 100644 --- a/src/io/uid-checker.h +++ b/src/io/uid-checker.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; +class PlayerType; void safe_setuid_drop(void); -void safe_setuid_grab(player_type *player_ptr); +void safe_setuid_grab(PlayerType *player_ptr); diff --git a/src/io/write-diary.cpp b/src/io/write-diary.cpp index 50eb558c9..beb9969da 100644 --- a/src/io/write-diary.cpp +++ b/src/io/write-diary.cpp @@ -72,7 +72,7 @@ static bool open_diary_file(FILE **fff, bool *disable_diary) * @param player_ptr プレイヤーへの参照ポインタ * @return クエストID */ -static QUEST_IDX write_floor(player_type *player_ptr, concptr *note_level, char *note_level_buf) +static QUEST_IDX write_floor(PlayerType *player_ptr, concptr *note_level, char *note_level_buf) { floor_type *floor_ptr = player_ptr->current_floor_ptr; QUEST_IDX q_idx = quest_number(player_ptr, floor_ptr->dun_level); @@ -165,7 +165,7 @@ static void write_diary_pet(FILE *fff, int num, concptr note) * @param note 日記内容のIDに応じた文字列参照ポインタ * @return エラーコード */ -errr exe_write_diary(player_type *player_ptr, int type, int num, concptr note) +errr exe_write_diary(PlayerType *player_ptr, int type, int num, concptr note) { static bool disable_diary = false; diff --git a/src/io/write-diary.h b/src/io/write-diary.h index f29e787d9..0f2f59b75 100644 --- a/src/io/write-diary.h +++ b/src/io/write-diary.h @@ -46,9 +46,9 @@ extern bool write_level; -struct player_type; +class PlayerType; #ifdef JP #else concptr get_ordinal_number_suffix(int num); #endif -errr exe_write_diary(player_type *player_ptr, int type, int num, concptr note); +errr exe_write_diary(PlayerType *player_ptr, int type, int num, concptr note); diff --git a/src/knowledge/knowledge-autopick.cpp b/src/knowledge/knowledge-autopick.cpp index 430569d76..4670d34ac 100644 --- a/src/knowledge/knowledge-autopick.cpp +++ b/src/knowledge/knowledge-autopick.cpp @@ -19,7 +19,7 @@ * @brief 自動拾い設定ファイルをロードするコマンドのメインルーチン / * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_reload_autopick(player_type *player_ptr) +void do_cmd_reload_autopick(PlayerType *player_ptr) { if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? "))) return; @@ -30,7 +30,7 @@ void do_cmd_reload_autopick(player_type *player_ptr) /* * Check the status of "autopick" */ -void do_cmd_knowledge_autopick(player_type *player_ptr) +void do_cmd_knowledge_autopick(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; diff --git a/src/knowledge/knowledge-autopick.h b/src/knowledge/knowledge-autopick.h index bcace0d69..58a0af168 100644 --- a/src/knowledge/knowledge-autopick.h +++ b/src/knowledge/knowledge-autopick.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void do_cmd_reload_autopick(player_type *player_ptr); -void do_cmd_knowledge_autopick(player_type *player_ptr); +class PlayerType; +void do_cmd_reload_autopick(PlayerType *player_ptr); +void do_cmd_knowledge_autopick(PlayerType *player_ptr); diff --git a/src/knowledge/knowledge-experiences.cpp b/src/knowledge/knowledge-experiences.cpp index da86d1144..0cd8a64d0 100644 --- a/src/knowledge/knowledge-experiences.cpp +++ b/src/knowledge/knowledge-experiences.cpp @@ -24,7 +24,7 @@ /* * Display weapon-exp */ -void do_cmd_knowledge_weapon_exp(player_type *player_ptr) +void do_cmd_knowledge_weapon_exp(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; @@ -69,7 +69,7 @@ void do_cmd_knowledge_weapon_exp(player_type *player_ptr) * @brief 魔法の経験値を表示するコマンドのメインルーチン * Display spell-exp */ -void do_cmd_knowledge_spell_exp(player_type *player_ptr) +void do_cmd_knowledge_spell_exp(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; @@ -149,7 +149,7 @@ void do_cmd_knowledge_spell_exp(player_type *player_ptr) * @brief スキル情報を表示するコマンドのメインルーチン / * Display skill-exp */ -void do_cmd_knowledge_skill_exp(player_type *player_ptr) +void do_cmd_knowledge_skill_exp(PlayerType *player_ptr) { FILE *fff = nullptr; char file_name[FILE_NAME_SIZE]; diff --git a/src/knowledge/knowledge-experiences.h b/src/knowledge/knowledge-experiences.h index 3259a5525..a97e8f48e 100644 --- a/src/knowledge/knowledge-experiences.h +++ b/src/knowledge/knowledge-experiences.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void do_cmd_knowledge_weapon_exp(player_type *player_ptr); -void do_cmd_knowledge_spell_exp(player_type *player_ptr); -void do_cmd_knowledge_skill_exp(player_type *player_ptr); +class PlayerType; +void do_cmd_knowledge_weapon_exp(PlayerType *player_ptr); +void do_cmd_knowledge_spell_exp(PlayerType *player_ptr); +void do_cmd_knowledge_skill_exp(PlayerType *player_ptr); diff --git a/src/knowledge/knowledge-features.cpp b/src/knowledge/knowledge-features.cpp index f43a1aa3e..c4ce05344 100644 --- a/src/knowledge/knowledge-features.cpp +++ b/src/knowledge/knowledge-features.cpp @@ -337,7 +337,7 @@ void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f /* * Dungeon */ -void do_cmd_knowledge_dungeon(player_type *player_ptr) +void do_cmd_knowledge_dungeon(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; diff --git a/src/knowledge/knowledge-features.h b/src/knowledge/knowledge-features.h index 8d1b97fef..7bcad5d22 100644 --- a/src/knowledge/knowledge-features.h +++ b/src/knowledge/knowledge-features.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; +class PlayerType; void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX direct_f_idx, IDX *lighting_level); -void do_cmd_knowledge_dungeon(player_type *player_ptr); +void do_cmd_knowledge_dungeon(PlayerType *player_ptr); diff --git a/src/knowledge/knowledge-inventory.cpp b/src/knowledge/knowledge-inventory.cpp index a80670e59..ff6ff0c05 100644 --- a/src/knowledge/knowledge-inventory.cpp +++ b/src/knowledge/knowledge-inventory.cpp @@ -140,7 +140,7 @@ static void display_identified_resistances_flag(object_type *o_ptr, FILE *fff) * @param o_ptr アイテムへの参照ポインタ * @param where アイテムの場所 (手持ち、家等) を示す文字列への参照ポインタ */ -static void do_cmd_knowledge_inventory_aux(player_type *player_ptr, FILE *fff, object_type *o_ptr, char *where) +static void do_cmd_knowledge_inventory_aux(PlayerType *player_ptr, FILE *fff, object_type *o_ptr, char *where) { int i = 0; GAME_TEXT o_name[MAX_NLEN]; @@ -211,7 +211,7 @@ static void reset_label_number(int *label_number, FILE *fff) * @param label_number 現在の行数 * @param fff ファイルへの参照ポインタ */ -static void show_wearing_equipment_resistances(player_type *player_ptr, ItemKindType tval, int *label_number, FILE *fff) +static void show_wearing_equipment_resistances(PlayerType *player_ptr, ItemKindType tval, int *label_number, FILE *fff) { char where[32]; strcpy(where, _("装", "E ")); @@ -232,7 +232,7 @@ static void show_wearing_equipment_resistances(player_type *player_ptr, ItemKind * @param label_number 現在の行数 * @param fff ファイルへの参照ポインタ */ -static void show_holding_equipment_resistances(player_type *player_ptr, ItemKindType tval, int *label_number, FILE *fff) +static void show_holding_equipment_resistances(PlayerType *player_ptr, ItemKindType tval, int *label_number, FILE *fff) { char where[32]; strcpy(where, _("持", "I ")); @@ -253,7 +253,7 @@ static void show_holding_equipment_resistances(player_type *player_ptr, ItemKind * @param label_number 現在の行数 * @param fff ファイルへの参照ポインタ */ -static void show_home_equipment_resistances(player_type *player_ptr, ItemKindType tval, int *label_number, FILE *fff) +static void show_home_equipment_resistances(PlayerType *player_ptr, ItemKindType tval, int *label_number, FILE *fff) { store_type *store_ptr; store_ptr = &town_info[1].store[enum2i(StoreSaleType::HOME)]; @@ -273,7 +273,7 @@ static void show_home_equipment_resistances(player_type *player_ptr, ItemKindTyp * @brief Display *ID* ed weapons/armors's resistances * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_knowledge_inventory(player_type *player_ptr) +void do_cmd_knowledge_inventory(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; diff --git a/src/knowledge/knowledge-inventory.h b/src/knowledge/knowledge-inventory.h index 72ddcb06b..791a8e018 100644 --- a/src/knowledge/knowledge-inventory.h +++ b/src/knowledge/knowledge-inventory.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_knowledge_inventory(player_type *player_ptr); +class PlayerType; +void do_cmd_knowledge_inventory(PlayerType *player_ptr); diff --git a/src/knowledge/knowledge-items.cpp b/src/knowledge/knowledge-items.cpp index 588d5542e..e2209934f 100644 --- a/src/knowledge/knowledge-items.cpp +++ b/src/knowledge/knowledge-items.cpp @@ -39,7 +39,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @todo okay = 既知のアーティファクト? と思われるが確証がない分かりやすい変数名へ変更求む&万が一未知である旨の配列なら負論理なのでゴソッと差し替えるべき */ -void do_cmd_knowledge_artifacts(player_type *player_ptr) +void do_cmd_knowledge_artifacts(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; @@ -215,7 +215,7 @@ static void display_object_list(int col, int row, int per_page, IDX object_idx[] /* * Describe fake object */ -static void desc_obj_fake(player_type *player_ptr, KIND_OBJECT_IDX k_idx) +static void desc_obj_fake(PlayerType *player_ptr, KIND_OBJECT_IDX k_idx) { object_type *o_ptr; object_type object_type_body; @@ -236,7 +236,7 @@ static void desc_obj_fake(player_type *player_ptr, KIND_OBJECT_IDX k_idx) /** * @brief Display known objects */ -void do_cmd_knowledge_objects(player_type *player_ptr, bool *need_redraw, bool visual_only, KIND_OBJECT_IDX direct_k_idx) +void do_cmd_knowledge_objects(PlayerType *player_ptr, bool *need_redraw, bool visual_only, KIND_OBJECT_IDX direct_k_idx) { KIND_OBJECT_IDX object_old, object_top; KIND_OBJECT_IDX grp_idx[100]; diff --git a/src/knowledge/knowledge-items.h b/src/knowledge/knowledge-items.h index 9bf936f9a..59b5e43bc 100644 --- a/src/knowledge/knowledge-items.h +++ b/src/knowledge/knowledge-items.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void do_cmd_knowledge_artifacts(player_type *player_ptr); -void do_cmd_knowledge_objects(player_type *player_ptr, bool *need_redraw, bool visual_only, KIND_OBJECT_IDX direct_k_idx); +class PlayerType; +void do_cmd_knowledge_artifacts(PlayerType *player_ptr); +void do_cmd_knowledge_objects(PlayerType *player_ptr, bool *need_redraw, bool visual_only, KIND_OBJECT_IDX direct_k_idx); diff --git a/src/knowledge/knowledge-monsters.cpp b/src/knowledge/knowledge-monsters.cpp index 4c8f0154f..15bf30175 100644 --- a/src/knowledge/knowledge-monsters.cpp +++ b/src/knowledge/knowledge-monsters.cpp @@ -50,7 +50,7 @@ * @param mode 思い出の扱いに関するモード * @return 得られたモンスターIDの数 / The number of monsters in the group */ -static IDX collect_monsters(player_type *player_ptr, IDX grp_cur, IDX mon_idx[], monster_lore_mode mode) +static IDX collect_monsters(PlayerType *player_ptr, IDX grp_cur, IDX mon_idx[], monster_lore_mode mode) { concptr group_char = monster_group_char[grp_cur]; bool grp_unique = (monster_group_char[grp_cur] == (char *)-1L); @@ -109,7 +109,7 @@ static IDX collect_monsters(player_type *player_ptr, IDX grp_cur, IDX mon_idx[], * Display current pets * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_knowledge_pets(player_type *player_ptr) +void do_cmd_knowledge_pets(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; @@ -150,7 +150,7 @@ void do_cmd_knowledge_pets(player_type *player_ptr) * Total kill count * @note the player ghosts are ignored. */ -void do_cmd_knowledge_kill_count(player_type *player_ptr) +void do_cmd_knowledge_kill_count(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; @@ -286,7 +286,7 @@ static void display_monster_list(int col, int row, int per_page, int16_t mon_idx * @param direct_r_idx モンスターID * @todo 引数の詳細について加筆求む */ -void do_cmd_knowledge_monsters(player_type *player_ptr, bool *need_redraw, bool visual_only, IDX direct_r_idx) +void do_cmd_knowledge_monsters(PlayerType *player_ptr, bool *need_redraw, bool visual_only, IDX direct_r_idx) { TERM_LEN wid, hgt; term_get_size(&wid, &hgt); @@ -463,7 +463,7 @@ void do_cmd_knowledge_monsters(player_type *player_ptr, bool *need_redraw, bool * List wanted monsters * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_knowledge_bounty(player_type *player_ptr) +void do_cmd_knowledge_bounty(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; diff --git a/src/knowledge/knowledge-monsters.h b/src/knowledge/knowledge-monsters.h index 63937db13..a76bd1a68 100644 --- a/src/knowledge/knowledge-monsters.h +++ b/src/knowledge/knowledge-monsters.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -void do_cmd_knowledge_monsters(player_type *player_ptr, bool *need_redraw, bool visual_only, IDX direct_r_idx); -void do_cmd_knowledge_pets(player_type *player_ptr); -void do_cmd_knowledge_kill_count(player_type *player_ptr); -void do_cmd_knowledge_bounty(player_type *player_ptr); +class PlayerType; +void do_cmd_knowledge_monsters(PlayerType *player_ptr, bool *need_redraw, bool visual_only, IDX direct_r_idx); +void do_cmd_knowledge_pets(PlayerType *player_ptr); +void do_cmd_knowledge_kill_count(PlayerType *player_ptr); +void do_cmd_knowledge_bounty(PlayerType *player_ptr); diff --git a/src/knowledge/knowledge-mutations.cpp b/src/knowledge/knowledge-mutations.cpp index f509b5a3a..f7f7254ce 100644 --- a/src/knowledge/knowledge-mutations.cpp +++ b/src/knowledge/knowledge-mutations.cpp @@ -13,7 +13,7 @@ /*! * @brief 突然変異表示コマンドの実装 / List mutations we have... */ -void do_cmd_knowledge_mutations(player_type *player_ptr) +void do_cmd_knowledge_mutations(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; diff --git a/src/knowledge/knowledge-mutations.h b/src/knowledge/knowledge-mutations.h index b09e16776..d1fba21b8 100644 --- a/src/knowledge/knowledge-mutations.h +++ b/src/knowledge/knowledge-mutations.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_knowledge_mutations(player_type *player_ptr); +class PlayerType; +void do_cmd_knowledge_mutations(PlayerType *player_ptr); diff --git a/src/knowledge/knowledge-quests.cpp b/src/knowledge/knowledge-quests.cpp index 695f324b1..0c1c5fbf1 100644 --- a/src/knowledge/knowledge-quests.cpp +++ b/src/knowledge/knowledge-quests.cpp @@ -30,7 +30,7 @@ * @brief Check on the status of an active quest * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_checkquest(player_type *player_ptr) +void do_cmd_checkquest(PlayerType *player_ptr) { screen_save(); do_cmd_knowledge_quests(player_ptr); @@ -40,9 +40,9 @@ void do_cmd_checkquest(player_type *player_ptr) /*! * @brief Print all active quests * @param player_ptr プレイヤーへの参照ポインタ - * @todo player_typeではなくQUEST_IDXを引数にすべきかもしれない + * @todo PlayerTypeではなくQUEST_IDXを引数にすべきかもしれない */ -static void do_cmd_knowledge_quests_current(player_type *player_ptr, FILE *fff) +static void do_cmd_knowledge_quests_current(PlayerType *player_ptr, FILE *fff) { char tmp_str[1024]; char rand_tmp_str[512] = "\0"; @@ -176,7 +176,7 @@ static void do_cmd_knowledge_quests_current(player_type *player_ptr, FILE *fff) fprintf(fff, _(" なし\n", " Nothing.\n")); } -static bool do_cmd_knowledge_quests_aux(player_type *player_ptr, FILE *fff, IDX q_idx) +static bool do_cmd_knowledge_quests_aux(PlayerType *player_ptr, FILE *fff, IDX q_idx) { char tmp_str[120]; char playtime_str[16]; @@ -222,7 +222,7 @@ static bool do_cmd_knowledge_quests_aux(player_type *player_ptr, FILE *fff, IDX * @param fff セーブファイル (展開済?) * @param quest_num[] 受注したことのあるクエスト群 */ -void do_cmd_knowledge_quests_completed(player_type *player_ptr, FILE *fff, QUEST_IDX quest_num[]) +void do_cmd_knowledge_quests_completed(PlayerType *player_ptr, FILE *fff, QUEST_IDX quest_num[]) { fprintf(fff, _("《達成したクエスト》\n", "< Completed Quest >\n")); QUEST_IDX total = 0; @@ -245,7 +245,7 @@ void do_cmd_knowledge_quests_completed(player_type *player_ptr, FILE *fff, QUEST * @param fff セーブファイル (展開済?) * @param quest_num[] 受注したことのあるクエスト群 */ -void do_cmd_knowledge_quests_failed(player_type *player_ptr, FILE *fff, QUEST_IDX quest_num[]) +void do_cmd_knowledge_quests_failed(PlayerType *player_ptr, FILE *fff, QUEST_IDX quest_num[]) { fprintf(fff, _("《失敗したクエスト》\n", "< Failed Quest >\n")); QUEST_IDX total = 0; @@ -289,7 +289,7 @@ static void do_cmd_knowledge_quests_wiz_random(FILE *fff) * Print quest status of all active quests * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_knowledge_quests(player_type *player_ptr) +void do_cmd_knowledge_quests(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; diff --git a/src/knowledge/knowledge-quests.h b/src/knowledge/knowledge-quests.h index 594080d4f..5a92013a7 100644 --- a/src/knowledge/knowledge-quests.h +++ b/src/knowledge/knowledge-quests.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -void do_cmd_checkquest(player_type *player_ptr); -void do_cmd_knowledge_quests_completed(player_type *player_ptr, FILE *fff, QUEST_IDX quest_num[]); -void do_cmd_knowledge_quests_failed(player_type *player_ptr, FILE *fff, QUEST_IDX quest_num[]); -void do_cmd_knowledge_quests(player_type *player_ptr); +class PlayerType; +void do_cmd_checkquest(PlayerType *player_ptr); +void do_cmd_knowledge_quests_completed(PlayerType *player_ptr, FILE *fff, QUEST_IDX quest_num[]); +void do_cmd_knowledge_quests_failed(PlayerType *player_ptr, FILE *fff, QUEST_IDX quest_num[]); +void do_cmd_knowledge_quests(PlayerType *player_ptr); diff --git a/src/knowledge/knowledge-self.cpp b/src/knowledge/knowledge-self.cpp index 789b47285..913587033 100644 --- a/src/knowledge/knowledge-self.cpp +++ b/src/knowledge/knowledge-self.cpp @@ -32,7 +32,7 @@ /* * List virtues & status */ -void do_cmd_knowledge_virtues(player_type *player_ptr) +void do_cmd_knowledge_virtues(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; @@ -52,7 +52,7 @@ void do_cmd_knowledge_virtues(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param fff ファイルポインタ */ -static void dump_yourself(player_type *player_ptr, FILE *fff) +static void dump_yourself(PlayerType *player_ptr, FILE *fff) { if (!fff) return; @@ -168,7 +168,7 @@ static void dump_winner_classes(FILE *fff) * List virtues & status * */ -void do_cmd_knowledge_stat(player_type *player_ptr) +void do_cmd_knowledge_stat(PlayerType *player_ptr) { FILE *fff = nullptr; GAME_TEXT file_name[FILE_NAME_SIZE]; @@ -210,7 +210,7 @@ void do_cmd_knowledge_stat(player_type *player_ptr) * List my home * @param player_ptr プレイヤーへの参照ポインタ */ -void do_cmd_knowledge_home(player_type *player_ptr) +void do_cmd_knowledge_home(PlayerType *player_ptr) { parse_fixed_map(player_ptr, "w_info.txt", 0, 0, w_ptr->max_wild_y, w_ptr->max_wild_x); diff --git a/src/knowledge/knowledge-self.h b/src/knowledge/knowledge-self.h index c7f2a16ff..c30fdb694 100644 --- a/src/knowledge/knowledge-self.h +++ b/src/knowledge/knowledge-self.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void do_cmd_knowledge_virtues(player_type *player_ptr); -void do_cmd_knowledge_stat(player_type *player_ptr); -void do_cmd_knowledge_home(player_type *player_ptr); +class PlayerType; +void do_cmd_knowledge_virtues(PlayerType *player_ptr); +void do_cmd_knowledge_stat(PlayerType *player_ptr); +void do_cmd_knowledge_home(PlayerType *player_ptr); diff --git a/src/knowledge/knowledge-uniques.cpp b/src/knowledge/knowledge-uniques.cpp index 7d7708d57..80c0e09f7 100644 --- a/src/knowledge/knowledge-uniques.cpp +++ b/src/knowledge/knowledge-uniques.cpp @@ -127,7 +127,7 @@ static void display_uniques(unique_list_type *unique_list_ptr, FILE *fff) * @param player_ptr プレイヤーへの参照ポインタ * @param is_alive 生きているユニークのリストならばTRUE、撃破したユニークのリストならばFALSE */ -void do_cmd_knowledge_uniques(player_type *player_ptr, bool is_alive) +void do_cmd_knowledge_uniques(PlayerType *player_ptr, bool is_alive) { unique_list_type tmp_list; unique_list_type *unique_list_ptr = initialize_unique_lsit_type(&tmp_list, is_alive); diff --git a/src/knowledge/knowledge-uniques.h b/src/knowledge/knowledge-uniques.h index ca271be7d..535d511d4 100644 --- a/src/knowledge/knowledge-uniques.h +++ b/src/knowledge/knowledge-uniques.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_knowledge_uniques(player_type *player_ptr, bool is_alive); +class PlayerType; +void do_cmd_knowledge_uniques(PlayerType *player_ptr, bool is_alive); diff --git a/src/load/dummy-loader.cpp b/src/load/dummy-loader.cpp index 2be275ea4..122a082a3 100644 --- a/src/load/dummy-loader.cpp +++ b/src/load/dummy-loader.cpp @@ -34,7 +34,7 @@ void rd_dummy2(void) * @param player_ptr プレイヤーへの参照ポインタ * @details もはや何に使われていたのか不明 */ -void rd_dummy_monsters(player_type *player_ptr) +void rd_dummy_monsters(PlayerType *player_ptr) { if (h_older_than(1, 5, 0, 2)) return; diff --git a/src/load/dummy-loader.h b/src/load/dummy-loader.h index 9f05047a8..fbde07241 100644 --- a/src/load/dummy-loader.h +++ b/src/load/dummy-loader.h @@ -1,8 +1,8 @@ #pragma once -struct player_type; +class PlayerType; void rd_dummy1(void); void rd_dummy2(void); -void rd_dummy_monsters(player_type *player_ptr); +void rd_dummy_monsters(PlayerType *player_ptr); void rd_ghost(void); void rd_dummy3(void); diff --git a/src/load/dungeon-loader.cpp b/src/load/dungeon-loader.cpp index 76b767e12..0022bd7e0 100644 --- a/src/load/dungeon-loader.cpp +++ b/src/load/dungeon-loader.cpp @@ -23,7 +23,7 @@ * The monsters/objects must be loaded in the same order * that they were stored, since the actual indexes matter. */ -static errr rd_dungeon(player_type *player_ptr) +static errr rd_dungeon(PlayerType *player_ptr) { init_saved_floors(player_ptr, false); errr err = 0; @@ -123,7 +123,7 @@ static errr rd_dungeon(player_type *player_ptr) return err; } -errr restore_dungeon(player_type *player_ptr) +errr restore_dungeon(PlayerType *player_ptr) { if (player_ptr->is_dead) { for (int i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++) diff --git a/src/load/dungeon-loader.h b/src/load/dungeon-loader.h index c4f786c21..822c82ba0 100644 --- a/src/load/dungeon-loader.h +++ b/src/load/dungeon-loader.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -errr restore_dungeon(player_type *player_ptr); +class PlayerType; +errr restore_dungeon(PlayerType *player_ptr); diff --git a/src/load/extra-loader.cpp b/src/load/extra-loader.cpp index 570123e4c..1836d8a16 100644 --- a/src/load/extra-loader.cpp +++ b/src/load/extra-loader.cpp @@ -17,7 +17,7 @@ * @brief その他の情報を読み込む / Read the "extra" information * @param player_ptr プレイヤーへの参照ポインタ */ -void rd_extra(player_type *player_ptr) +void rd_extra(PlayerType *player_ptr) { if (h_older_than(0, 0, 7)) player_ptr->riding = 0; diff --git a/src/load/extra-loader.h b/src/load/extra-loader.h index 662221182..feb3186b3 100644 --- a/src/load/extra-loader.h +++ b/src/load/extra-loader.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void rd_extra(player_type *player_ptr); +class PlayerType; +void rd_extra(PlayerType *player_ptr); diff --git a/src/load/floor-loader.cpp b/src/load/floor-loader.cpp index 01535d5bc..0fceb44d3 100644 --- a/src/load/floor-loader.cpp +++ b/src/load/floor-loader.cpp @@ -44,7 +44,7 @@ * The monsters/objects must be loaded in the same order * that they were stored, since the actual indexes matter. */ -errr rd_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr) +errr rd_saved_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; clear_cave(player_ptr); @@ -197,7 +197,7 @@ errr rd_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr) * @param sf_ptr 保存フロア読み込み先 * @return 成功したらtrue */ -static bool load_floor_aux(player_type *player_ptr, saved_floor_type *sf_ptr) +static bool load_floor_aux(PlayerType *player_ptr, saved_floor_type *sf_ptr) { load_xor_byte = 0; strip_bytes(1); @@ -234,7 +234,7 @@ static bool load_floor_aux(player_type *player_ptr, saved_floor_type *sf_ptr) * @param mode オプション * @return 成功したらtrue */ -bool load_floor(player_type *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mode) +bool load_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mode) { /* * Temporary files are always written in system depended kanji diff --git a/src/load/floor-loader.h b/src/load/floor-loader.h index 49b9c53f8..c8cc21b57 100644 --- a/src/load/floor-loader.h +++ b/src/load/floor-loader.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; +class PlayerType; struct saved_floor_type; -errr rd_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr); -bool load_floor(player_type *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mode); +errr rd_saved_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr); +bool load_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mode); diff --git a/src/load/inventory-loader.cpp b/src/load/inventory-loader.cpp index 0c737fc63..99af52fef 100644 --- a/src/load/inventory-loader.cpp +++ b/src/load/inventory-loader.cpp @@ -19,7 +19,7 @@ * * Note that the inventory is "re-sorted" later by "dungeon()". */ -static errr rd_inventory(player_type *player_ptr) +static errr rd_inventory(PlayerType *player_ptr) { player_ptr->inven_cnt = 0; player_ptr->equip_cnt = 0; @@ -62,7 +62,7 @@ static errr rd_inventory(player_type *player_ptr) return 0; } -errr load_inventory(player_type *player_ptr) +errr load_inventory(PlayerType *player_ptr) { for (int i = 0; i < 64; i++) { player_ptr->spell_order[i] = rd_byte(); diff --git a/src/load/inventory-loader.h b/src/load/inventory-loader.h index 64a664ffd..a22475b24 100644 --- a/src/load/inventory-loader.h +++ b/src/load/inventory-loader.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -errr load_inventory(player_type *player_ptr); +class PlayerType; +errr load_inventory(PlayerType *player_ptr); diff --git a/src/load/load-zangband.cpp b/src/load/load-zangband.cpp index 53e2b55e6..a8c5ff9e3 100644 --- a/src/load/load-zangband.cpp +++ b/src/load/load-zangband.cpp @@ -72,7 +72,7 @@ void load_zangband_options(void) option_flag[5] |= (0x00000001U << 3); } -void set_zangband_realm(player_type *player_ptr) +void set_zangband_realm(PlayerType *player_ptr) { if (player_ptr->realm1 == 9) player_ptr->realm1 = REALM_MUSIC; @@ -87,7 +87,7 @@ void set_zangband_realm(player_type *player_ptr) player_ptr->realm2 = REALM_HISSATSU; } -void set_zangband_skill(player_type *player_ptr) +void set_zangband_skill(PlayerType *player_ptr) { if (player_ptr->pclass != PlayerClassType::BEASTMASTER) player_ptr->skill_exp[PlayerSkillKindType::RIDING] /= 2; @@ -95,7 +95,7 @@ void set_zangband_skill(player_type *player_ptr) player_ptr->skill_exp[PlayerSkillKindType::RIDING] = std::min(player_ptr->skill_exp[PlayerSkillKindType::RIDING], s_info[enum2i(player_ptr->pclass)].s_max[PlayerSkillKindType::RIDING]); } -void set_zangband_race(player_type *player_ptr) +void set_zangband_race(PlayerType *player_ptr) { player_ptr->start_race = player_ptr->prace; player_ptr->old_race1 = 0L; @@ -103,7 +103,7 @@ void set_zangband_race(player_type *player_ptr) player_ptr->old_realm = 0; } -void set_zangband_bounty_uniques(player_type *player_ptr) +void set_zangband_bounty_uniques(PlayerType *player_ptr) { determine_bounty_uniques(player_ptr); for (int i = 0; i < MAX_BOUNTY; i++) { @@ -113,7 +113,7 @@ void set_zangband_bounty_uniques(player_type *player_ptr) } } -void set_zangband_mimic(player_type *player_ptr) +void set_zangband_mimic(PlayerType *player_ptr) { player_ptr->tim_res_time = 0; player_ptr->mimic_form = 0; @@ -121,13 +121,13 @@ void set_zangband_mimic(player_type *player_ptr) player_ptr->tim_sh_fire = 0; } -void set_zangband_holy_aura(player_type *player_ptr) +void set_zangband_holy_aura(PlayerType *player_ptr) { player_ptr->tim_sh_holy = 0; player_ptr->tim_eyeeye = 0; } -void set_zangband_reflection(player_type *player_ptr) +void set_zangband_reflection(PlayerType *player_ptr) { player_ptr->tim_reflect = 0; player_ptr->multishadow = 0; @@ -139,7 +139,7 @@ void rd_zangband_dungeon() max_dlv[DUNGEON_ANGBAND] = rd_s16b(); } -void set_zangband_game_turns(player_type *player_ptr) +void set_zangband_game_turns(PlayerType *player_ptr) { player_ptr->current_floor_ptr->generated_turn /= 2; player_ptr->feeling_turn /= 2; @@ -152,7 +152,7 @@ void set_zangband_gambling_monsters(int i) mon_odds[i] = rd_s16b(); } -void set_zangband_special_attack(player_type *player_ptr) +void set_zangband_special_attack(PlayerType *player_ptr) { if (rd_byte() != 0) player_ptr->special_attack = ATTACK_CONFUSE; @@ -160,25 +160,25 @@ void set_zangband_special_attack(player_type *player_ptr) player_ptr->ele_attack = 0; } -void set_zangband_special_defense(player_type *player_ptr) +void set_zangband_special_defense(PlayerType *player_ptr) { player_ptr->ele_immune = 0; player_ptr->special_defense = 0; } -void set_zangband_action(player_type *player_ptr) +void set_zangband_action(PlayerType *player_ptr) { if (rd_byte() != 0) player_ptr->action = ACTION_LEARN; } -void set_zangband_visited_towns(player_type *player_ptr) +void set_zangband_visited_towns(PlayerType *player_ptr) { strip_bytes(4); player_ptr->visit = 1L; } -void set_zangband_quest(player_type *player_ptr, quest_type *const q_ptr, int loading_quest_index, const QUEST_IDX old_inside_quest) +void set_zangband_quest(PlayerType *player_ptr, quest_type *const q_ptr, int loading_quest_index, const QUEST_IDX old_inside_quest) { if (q_ptr->flags & QUEST_FLAG_PRESET) { q_ptr->dungeon = 0; @@ -191,7 +191,7 @@ void set_zangband_quest(player_type *player_ptr, quest_type *const q_ptr, int lo player_ptr->current_floor_ptr->inside_quest = old_inside_quest; } -void set_zangband_class(player_type *player_ptr) +void set_zangband_class(PlayerType *player_ptr) { if (h_older_than(0, 2, 2) && (player_ptr->pclass == PlayerClassType::BEASTMASTER) && !player_ptr->is_dead) { player_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp; @@ -214,7 +214,7 @@ void set_zangband_class(player_type *player_ptr) } } -void set_zangband_learnt_spells(player_type *player_ptr) +void set_zangband_learnt_spells(PlayerType *player_ptr) { player_ptr->learned_spells = 0; for (int i = 0; i < 64; i++) @@ -222,7 +222,7 @@ void set_zangband_learnt_spells(player_type *player_ptr) player_ptr->learned_spells++; } -void set_zangband_pet(player_type *player_ptr) +void set_zangband_pet(PlayerType *player_ptr) { player_ptr->pet_extra_flags = 0; if (rd_byte() != 0) diff --git a/src/load/load-zangband.h b/src/load/load-zangband.h index 555f4c5ea..39e7ee932 100644 --- a/src/load/load-zangband.h +++ b/src/load/load-zangband.h @@ -2,24 +2,24 @@ #include "system/angband.h" -struct player_type; +class PlayerType; typedef struct quest_type quest_type; void load_zangband_options(void); -void set_zangband_realm(player_type *player_ptr); -void set_zangband_skill(player_type *player_ptr); -void set_zangband_race(player_type *player_ptr); -void set_zangband_bounty_uniques(player_type *player_ptr); -void set_zangband_mimic(player_type *player_ptr); -void set_zangband_holy_aura(player_type *player_ptr); -void set_zangband_reflection(player_type *player_ptr); +void set_zangband_realm(PlayerType *player_ptr); +void set_zangband_skill(PlayerType *player_ptr); +void set_zangband_race(PlayerType *player_ptr); +void set_zangband_bounty_uniques(PlayerType *player_ptr); +void set_zangband_mimic(PlayerType *player_ptr); +void set_zangband_holy_aura(PlayerType *player_ptr); +void set_zangband_reflection(PlayerType *player_ptr); void rd_zangband_dungeon(void); -void set_zangband_game_turns(player_type *player_ptr); +void set_zangband_game_turns(PlayerType *player_ptr); void set_zangband_gambling_monsters(int i); -void set_zangband_special_attack(player_type *player_ptr); -void set_zangband_special_defense(player_type *player_ptr); -void set_zangband_action(player_type *player_ptr); -void set_zangband_visited_towns(player_type *player_ptr); -void set_zangband_quest(player_type *player_ptr, quest_type *const q_ptr, int loading_quest_index, const QUEST_IDX old_inside_quest); -void set_zangband_class(player_type *player_ptr); -void set_zangband_learnt_spells(player_type *player_ptr); -void set_zangband_pet(player_type *player_ptr); +void set_zangband_special_attack(PlayerType *player_ptr); +void set_zangband_special_defense(PlayerType *player_ptr); +void set_zangband_action(PlayerType *player_ptr); +void set_zangband_visited_towns(PlayerType *player_ptr); +void set_zangband_quest(PlayerType *player_ptr, quest_type *const q_ptr, int loading_quest_index, const QUEST_IDX old_inside_quest); +void set_zangband_class(PlayerType *player_ptr); +void set_zangband_learnt_spells(PlayerType *player_ptr); +void set_zangband_pet(PlayerType *player_ptr); diff --git a/src/load/load.cpp b/src/load/load.cpp index cc2bdb6be..1e6006739 100644 --- a/src/load/load.cpp +++ b/src/load/load.cpp @@ -52,7 +52,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return エラーコード */ -static errr load_town_quest(player_type *player_ptr) +static errr load_town_quest(PlayerType *player_ptr) { if (h_older_than(2, 1, 3)) return 0; @@ -102,7 +102,7 @@ static void rd_winner_class() rd_FlagGroup(w_ptr->sf_retired, rd_byte); } -static void load_player_world(player_type *player_ptr) +static void load_player_world(PlayerType *player_ptr) { rd_total_play_time(); rd_winner_class(); @@ -120,7 +120,7 @@ static void load_player_world(player_type *player_ptr) load_note(_("特別情報をロードしました", "Loaded extra information")); } -static errr load_hp(player_type *player_ptr) +static errr load_hp(PlayerType *player_ptr) { auto tmp16u = rd_u16b(); if (tmp16u > PY_MAX_LEVEL) { @@ -135,7 +135,7 @@ static errr load_hp(player_type *player_ptr) return 0; } -static void load_spells(player_type *player_ptr) +static void load_spells(PlayerType *player_ptr) { player_ptr->spell_learned1 = rd_u32b(); player_ptr->spell_learned2 = rd_u32b(); @@ -179,7 +179,7 @@ static errr verify_encoded_checksum() * @brief セーブファイル読み込み処理の実体 / Actually read the savefile * @return エラーコード */ -static errr exe_reading_savefile(player_type *player_ptr) +static errr exe_reading_savefile(PlayerType *player_ptr) { rd_version_info(); rd_dummy3(); @@ -248,7 +248,7 @@ static errr exe_reading_savefile(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return エラーコード */ -static errr rd_savefile(player_type *player_ptr) +static errr rd_savefile(PlayerType *player_ptr) { safe_setuid_grab(player_ptr); loading_savefile = angband_fopen(savefile, "rb"); @@ -270,7 +270,7 @@ static errr rd_savefile(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 引き継ぎ可能ならtrue、そうでなければfalseを返す */ -static bool can_takeover_savefile(const player_type *player_ptr) +static bool can_takeover_savefile(const PlayerType *player_ptr) { if (loading_savefile_version_is_older_than(8) && player_ptr->pclass == PlayerClassType::SMITH) { return false; @@ -286,7 +286,7 @@ static bool can_takeover_savefile(const player_type *player_ptr) * @param new_game セーブデータの新規作成が必要か否か * @return セーブデータが読み込めればtrue */ -bool load_savedata(player_type *player_ptr, bool *new_game) +bool load_savedata(PlayerType *player_ptr, bool *new_game) { concptr what = "generic"; w_ptr->game_turn = 0; diff --git a/src/load/load.h b/src/load/load.h index 0e71eab05..f11e67546 100644 --- a/src/load/load.h +++ b/src/load/load.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool load_savedata(player_type *player_ptr, bool *new_game); +class PlayerType; +bool load_savedata(PlayerType *player_ptr, bool *new_game); diff --git a/src/load/monster/monster-loader-base.h b/src/load/monster/monster-loader-base.h index bfb113385..5e213302e 100644 --- a/src/load/monster/monster-loader-base.h +++ b/src/load/monster/monster-loader-base.h @@ -1,7 +1,7 @@ #pragma once struct monster_type; -struct player_type; +class PlayerType; class MonsterLoaderBase { public: virtual ~MonsterLoaderBase() = default; diff --git a/src/load/monster/monster-loader-factory.cpp b/src/load/monster/monster-loader-factory.cpp index 956871594..8c1126494 100644 --- a/src/load/monster/monster-loader-factory.cpp +++ b/src/load/monster/monster-loader-factory.cpp @@ -16,7 +16,7 @@ * @details MonsterLoaderBaseは純粋仮想関数を含むので参照を返す必要がある. * (値を返す設計はコンパイルエラー) */ -std::shared_ptr MonsterLoaderFactory::create_loader(player_type *player_ptr) +std::shared_ptr MonsterLoaderFactory::create_loader(PlayerType *player_ptr) { auto version = get_version(); switch (version) { diff --git a/src/load/monster/monster-loader-factory.h b/src/load/monster/monster-loader-factory.h index 3f93365da..20c1a20a1 100644 --- a/src/load/monster/monster-loader-factory.h +++ b/src/load/monster/monster-loader-factory.h @@ -3,12 +3,12 @@ #include enum class MonsterLoaderVersionType; -struct player_type; +class PlayerType; struct monster_type; class MonsterLoaderBase; class MonsterLoaderFactory { public: - static std::shared_ptr create_loader(player_type *player_ptr); + static std::shared_ptr create_loader(PlayerType *player_ptr); private: MonsterLoaderFactory() = delete; diff --git a/src/load/old/load-v1-5-0.cpp b/src/load/old/load-v1-5-0.cpp index 523d4fb39..7f31e6b08 100644 --- a/src/load/old/load-v1-5-0.cpp +++ b/src/load/old/load-v1-5-0.cpp @@ -323,7 +323,7 @@ void rd_item_old(object_type *o_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param m_ptr モンスター保存先ポインタ */ -void rd_monster_old(player_type *player_ptr, monster_type *m_ptr) +void rd_monster_old(PlayerType *player_ptr, monster_type *m_ptr) { m_ptr->r_idx = rd_s16b(); @@ -504,7 +504,7 @@ void set_old_lore(monster_race *r_ptr, BIT_FLAGS f4, const MONRACE_IDX r_idx) * The monsters/objects must be loaded in the same order * that they were stored, since the actual indexes matter. */ -errr rd_dungeon_old(player_type *player_ptr) +errr rd_dungeon_old(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; floor_ptr->dun_level = rd_s16b(); diff --git a/src/load/old/load-v1-5-0.h b/src/load/old/load-v1-5-0.h index e7c9c9d45..fc155ef05 100644 --- a/src/load/old/load-v1-5-0.h +++ b/src/load/old/load-v1-5-0.h @@ -37,8 +37,8 @@ extern const int QUEST_OLD_CASTLE; extern const int QUEST_ROYAL_CRYPT; struct object_type; -struct player_type; +class PlayerType; void rd_item_old(object_type *o_ptr); -void rd_monster_old(player_type *player_ptr, monster_type *m_ptr); +void rd_monster_old(PlayerType *player_ptr, monster_type *m_ptr); void set_old_lore(monster_race *r_ptr, BIT_FLAGS f4, const MONRACE_IDX r_idx); -errr rd_dungeon_old(player_type *player_ptr); +errr rd_dungeon_old(PlayerType *player_ptr); diff --git a/src/load/old/load-v1-7-0.cpp b/src/load/old/load-v1-7-0.cpp index c04ae4415..28b47e2cd 100644 --- a/src/load/old/load-v1-7-0.cpp +++ b/src/load/old/load-v1-7-0.cpp @@ -6,7 +6,7 @@ #include "system/floor-type-definition.h" #include "system/player-type-definition.h" -void set_hp_old(player_type *player_ptr) +void set_hp_old(PlayerType *player_ptr) { player_ptr->mhp = rd_s16b(); @@ -14,7 +14,7 @@ void set_hp_old(player_type *player_ptr) player_ptr->chp_frac = rd_u16b(); } -void set_mana_old(player_type *player_ptr) +void set_mana_old(PlayerType *player_ptr) { player_ptr->msp = rd_s16b(); @@ -22,12 +22,12 @@ void set_mana_old(player_type *player_ptr) player_ptr->csp_frac = rd_u16b(); } -void set_exp_frac_old(player_type *player_ptr) +void set_exp_frac_old(PlayerType *player_ptr) { player_ptr->exp_frac = rd_u16b(); } -void remove_water_cave(player_type *player_ptr) +void remove_water_cave(PlayerType *player_ptr) { if (player_ptr->current_floor_ptr->inside_quest != OLD_QUEST_WATER_CAVE) return; diff --git a/src/load/old/load-v1-7-0.h b/src/load/old/load-v1-7-0.h index 04b9ed9d2..581155721 100644 --- a/src/load/old/load-v1-7-0.h +++ b/src/load/old/load-v1-7-0.h @@ -1,7 +1,7 @@ #pragma once -struct player_type; -void set_hp_old(player_type *player_ptr); -void set_mana_old(player_type *player_ptr); -void set_exp_frac_old(player_type *player_ptr); -void remove_water_cave(player_type *player_ptr); +class PlayerType; +void set_hp_old(PlayerType *player_ptr); +void set_mana_old(PlayerType *player_ptr); +void set_exp_frac_old(PlayerType *player_ptr); +void remove_water_cave(PlayerType *player_ptr); diff --git a/src/load/old/monster-loader-savefile10.cpp b/src/load/old/monster-loader-savefile10.cpp index 125964782..df868914f 100644 --- a/src/load/old/monster-loader-savefile10.cpp +++ b/src/load/old/monster-loader-savefile10.cpp @@ -9,7 +9,7 @@ #include "util/enum-converter.h" #include "util/quarks.h" -MonsterLoader10::MonsterLoader10(player_type *player_ptr) +MonsterLoader10::MonsterLoader10(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/load/old/monster-loader-savefile10.h b/src/load/old/monster-loader-savefile10.h index 1fae762e3..bda3e332b 100644 --- a/src/load/old/monster-loader-savefile10.h +++ b/src/load/old/monster-loader-savefile10.h @@ -3,13 +3,13 @@ #include "load/monster/monster-loader-base.h" struct monster_type; -struct player_type; +class PlayerType; class MonsterLoader10 : public MonsterLoaderBase { public: - MonsterLoader10(player_type *player_ptr); + MonsterLoader10(PlayerType *player_ptr); void rd_monster(monster_type *m_ptr) override; private: - player_type *player_ptr; + PlayerType *player_ptr; monster_type *m_ptr = nullptr; }; diff --git a/src/load/player-attack-loader.cpp b/src/load/player-attack-loader.cpp index 6838f4f4a..df057b9c8 100644 --- a/src/load/player-attack-loader.cpp +++ b/src/load/player-attack-loader.cpp @@ -9,7 +9,7 @@ #include "player/special-defense-types.h" #include "system/player-type-definition.h" -void rd_special_attack(player_type *player_ptr) +void rd_special_attack(PlayerType *player_ptr) { if (h_older_than(0, 0, 9)) { set_zangband_special_attack(player_ptr); @@ -20,7 +20,7 @@ void rd_special_attack(player_type *player_ptr) player_ptr->special_attack = rd_u32b(); } -void rd_special_action(player_type *player_ptr) +void rd_special_action(PlayerType *player_ptr) { if (!PlayerClass(player_ptr).monk_stance_is(MonkStanceType::NONE)) { player_ptr->action = ACTION_MONK_STANCE; @@ -32,7 +32,7 @@ void rd_special_action(player_type *player_ptr) } } -void rd_special_defense(player_type *player_ptr) +void rd_special_defense(PlayerType *player_ptr) { if (h_older_than(0, 0, 12)) { set_zangband_special_defense(player_ptr); @@ -43,7 +43,7 @@ void rd_special_defense(player_type *player_ptr) player_ptr->special_defense = rd_u32b(); } -void rd_action(player_type *player_ptr) +void rd_action(PlayerType *player_ptr) { strip_bytes(1); player_ptr->action = rd_byte(); diff --git a/src/load/player-attack-loader.h b/src/load/player-attack-loader.h index 1f0b2c473..67736d628 100644 --- a/src/load/player-attack-loader.h +++ b/src/load/player-attack-loader.h @@ -1,7 +1,7 @@ #pragma once -struct player_type; -void rd_special_attack(player_type *player_ptr); -void rd_special_action(player_type *player_ptr); -void rd_special_defense(player_type *player_ptr); -void rd_action(player_type *player_ptr); +class PlayerType; +void rd_special_attack(PlayerType *player_ptr); +void rd_special_action(PlayerType *player_ptr); +void rd_special_defense(PlayerType *player_ptr); +void rd_action(PlayerType *player_ptr); diff --git a/src/load/player-info-loader.cpp b/src/load/player-info-loader.cpp index 864ed04f0..b539e7096 100644 --- a/src/load/player-info-loader.cpp +++ b/src/load/player-info-loader.cpp @@ -30,7 +30,7 @@ * @brief セーブデータから領域情報を読み込む / Read player realms * @param player_ptr プレイヤーへの参照ポインタ */ -static void rd_realms(player_type *player_ptr) +static void rd_realms(PlayerType *player_ptr) { if (player_ptr->pclass == PlayerClassType::ELEMENTALIST) player_ptr->element = rd_byte(); @@ -46,7 +46,7 @@ static void rd_realms(player_type *player_ptr) * @brief セーブデータからプレイヤー基本情報を読み込む / Read player's basic info * @param player_ptr プレイヤーへの参照ポインタ */ -void rd_base_info(player_type *player_ptr) +void rd_base_info(PlayerType *player_ptr) { rd_string(player_ptr->name, sizeof(player_ptr->name)); rd_string(player_ptr->died_from, sizeof(player_ptr->died_from)); @@ -81,7 +81,7 @@ void rd_base_info(player_type *player_ptr) player_ptr->wt = rd_s16b(); } -void rd_experience(player_type *player_ptr) +void rd_experience(PlayerType *player_ptr) { player_ptr->max_exp = rd_s32b(); if (h_older_than(1, 5, 4, 1)) @@ -115,7 +115,7 @@ void rd_experience(player_type *player_ptr) strip_bytes(sizeof(int16_t) * (MAX_SKILLS - PLAYER_SKILL_KIND_TYPE_RANGE.size())); } -void rd_skills(player_type *player_ptr) +void rd_skills(PlayerType *player_ptr) { if (h_older_than(0, 4, 1)) set_zangband_skill(player_ptr); @@ -127,7 +127,7 @@ void rd_skills(player_type *player_ptr) player_ptr->action = ACTION_SING; } -static void set_race(player_type *player_ptr) +static void set_race(PlayerType *player_ptr) { player_ptr->start_race = i2enum(rd_byte()); player_ptr->old_race1 = rd_u32b(); @@ -135,7 +135,7 @@ static void set_race(player_type *player_ptr) player_ptr->old_realm = rd_s16b(); } -void rd_race(player_type *player_ptr) +void rd_race(PlayerType *player_ptr) { if (h_older_than(1, 0, 7)) { set_zangband_race(player_ptr); @@ -145,7 +145,7 @@ void rd_race(player_type *player_ptr) set_race(player_ptr); } -void rd_bounty_uniques(player_type *player_ptr) +void rd_bounty_uniques(PlayerType *player_ptr) { if (h_older_than(0, 0, 3)) { set_zangband_bounty_uniques(player_ptr); @@ -160,7 +160,7 @@ void rd_bounty_uniques(player_type *player_ptr) * @brief 腕力などの基本ステータス情報を読み込む * @param player_ptr プレイヤーへの参照ポインタ */ -static void rd_base_status(player_type *player_ptr) +static void rd_base_status(PlayerType *player_ptr) { for (int i = 0; i < A_MAX; i++) player_ptr->stat_max[i] = rd_s16b(); @@ -172,7 +172,7 @@ static void rd_base_status(player_type *player_ptr) player_ptr->stat_cur[i] = rd_s16b(); } -static void set_imitation(player_type *player_ptr) +static void set_imitation(PlayerType *player_ptr) { if (h_older_than(0, 0, 1)) { return; @@ -206,7 +206,7 @@ static void set_imitation(player_type *player_ptr) } } -static void rd_phase_out(player_type *player_ptr) +static void rd_phase_out(PlayerType *player_ptr) { player_ptr->current_floor_ptr->inside_arena = rd_s16b() != 0; player_ptr->current_floor_ptr->inside_quest = rd_s16b(); @@ -217,7 +217,7 @@ static void rd_phase_out(player_type *player_ptr) } } -static void rd_arena(player_type *player_ptr) +static void rd_arena(PlayerType *player_ptr) { if (h_older_than(0, 0, 3)) update_gambling_monsters(player_ptr); @@ -246,7 +246,7 @@ static void rd_arena(player_type *player_ptr) * @brief プレイヤーの最大HP/現在HPを読み込む * @param player_ptr プレイヤーへの参照ポインタ */ -static void rd_hp(player_type *player_ptr) +static void rd_hp(PlayerType *player_ptr) { if (h_older_than(1, 7, 0, 3)) { set_hp_old(player_ptr); @@ -262,7 +262,7 @@ static void rd_hp(player_type *player_ptr) * @brief プレイヤーの最大MP/現在MPを読み込む * @param player_ptr プレイヤーへの参照ポインタ */ -static void rd_mana(player_type *player_ptr) +static void rd_mana(PlayerType *player_ptr) { if (h_older_than(1, 7, 0, 3)) { set_mana_old(player_ptr); @@ -278,7 +278,7 @@ static void rd_mana(player_type *player_ptr) * @brief プレイヤーのバッドステータス (と空腹)を読み込む * @param player_ptr プレイヤーへの参照ポインタ */ -static void rd_bad_status(player_type *player_ptr) +static void rd_bad_status(PlayerType *player_ptr) { strip_bytes(2); /* Old "rest" */ player_ptr->blind = rd_s16b(); @@ -288,7 +288,7 @@ static void rd_bad_status(player_type *player_ptr) strip_bytes(4); /* Old "food_digested" / "protection" */ } -static void rd_energy(player_type *player_ptr) +static void rd_energy(PlayerType *player_ptr) { player_ptr->energy_need = rd_s16b(); if (h_older_than(1, 0, 13)) @@ -305,7 +305,7 @@ static void rd_energy(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @todo 明らかに関数名がビッグワードだが他に思いつかなかった */ -static void rd_status(player_type *player_ptr) +static void rd_status(PlayerType *player_ptr) { player_ptr->fast = rd_s16b(); player_ptr->slow = rd_s16b(); @@ -322,7 +322,7 @@ static void rd_status(player_type *player_ptr) player_ptr->ult_res = rd_s16b(); } -static void rd_tsuyoshi(player_type *player_ptr) +static void rd_tsuyoshi(PlayerType *player_ptr) { if (h_older_than(0, 0, 2)) player_ptr->tsuyoshi = 0; @@ -330,7 +330,7 @@ static void rd_tsuyoshi(player_type *player_ptr) player_ptr->tsuyoshi = rd_s16b(); } -static void set_timed_effects(player_type *player_ptr) +static void set_timed_effects(PlayerType *player_ptr) { player_ptr->tim_esp = rd_s16b(); player_ptr->wraith_form = rd_s16b(); @@ -374,7 +374,7 @@ static void set_timed_effects(player_type *player_ptr) } } -static void set_mutations(player_type *player_ptr) +static void set_mutations(PlayerType *player_ptr) { if (loading_savefile_version_is_older_than(2)) { for (int i = 0; i < 3; i++) { @@ -386,7 +386,7 @@ static void set_mutations(player_type *player_ptr) } } -static void set_virtues(player_type *player_ptr) +static void set_virtues(PlayerType *player_ptr) { for (int i = 0; i < 8; i++) player_ptr->virtues[i] = rd_s16b(); @@ -399,7 +399,7 @@ static void set_virtues(player_type *player_ptr) * @brief 各種時限効果を読み込む * @param player_ptr プレイヤーへの参照ポインタ */ -static void rd_timed_effects(player_type *player_ptr) +static void rd_timed_effects(PlayerType *player_ptr) { set_timed_effects(player_ptr); player_ptr->chaos_patron = rd_s16b(); @@ -407,7 +407,7 @@ static void rd_timed_effects(player_type *player_ptr) set_virtues(player_ptr); } -static void rd_player_status(player_type *player_ptr) +static void rd_player_status(PlayerType *player_ptr) { rd_base_status(player_ptr); strip_bytes(24); @@ -456,7 +456,7 @@ static void rd_player_status(player_type *player_ptr) player_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(player_ptr); } -void rd_player_info(player_type *player_ptr) +void rd_player_info(PlayerType *player_ptr) { rd_player_status(player_ptr); rd_special_attack(player_ptr); diff --git a/src/load/player-info-loader.h b/src/load/player-info-loader.h index 1672ed83b..9a5d4ef39 100644 --- a/src/load/player-info-loader.h +++ b/src/load/player-info-loader.h @@ -1,9 +1,9 @@ #pragma once -struct player_type; -void rd_base_info(player_type *player_ptr); -void rd_experience(player_type *player_ptr); -void rd_skills(player_type *player_ptr); -void rd_race(player_type *player_ptr); -void rd_bounty_uniques(player_type *player_ptr); -void rd_player_info(player_type *player_ptr); +class PlayerType; +void rd_base_info(PlayerType *player_ptr); +void rd_experience(PlayerType *player_ptr); +void rd_skills(PlayerType *player_ptr); +void rd_race(PlayerType *player_ptr); +void rd_bounty_uniques(PlayerType *player_ptr); +void rd_player_info(PlayerType *player_ptr); diff --git a/src/load/quest-loader.cpp b/src/load/quest-loader.cpp index 89b2efe1c..bbb2dcd0f 100644 --- a/src/load/quest-loader.cpp +++ b/src/load/quest-loader.cpp @@ -66,7 +66,7 @@ static void load_quest_completion(quest_type *q_ptr) q_ptr->comptime = rd_u32b(); } -static void load_quest_details(player_type *player_ptr, quest_type *q_ptr, int loading_quest_index) +static void load_quest_details(PlayerType *player_ptr, quest_type *q_ptr, int loading_quest_index) { q_ptr->cur_num = rd_s16b(); q_ptr->max_num = rd_s16b(); @@ -83,7 +83,7 @@ static void load_quest_details(player_type *player_ptr, quest_type *q_ptr, int l q_ptr->flags = rd_byte(); } -void analyze_quests(player_type *player_ptr, const uint16_t max_quests_load, const byte max_rquests_load) +void analyze_quests(PlayerType *player_ptr, const uint16_t max_quests_load, const byte max_rquests_load) { QUEST_IDX old_inside_quest = player_ptr->current_floor_ptr->inside_quest; for (int i = 0; i < max_quests_load; i++) { diff --git a/src/load/quest-loader.h b/src/load/quest-loader.h index 72bc3c8c4..1dbb978a2 100644 --- a/src/load/quest-loader.h +++ b/src/load/quest-loader.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; +class PlayerType; errr load_town(void); errr load_quest_info(uint16_t *max_quests_load, byte *max_rquests_load); -void analyze_quests(player_type *player_ptr, const uint16_t max_quests_load, const byte max_rquests_load); +void analyze_quests(PlayerType *player_ptr, const uint16_t max_quests_load, const byte max_rquests_load); diff --git a/src/load/store-loader.cpp b/src/load/store-loader.cpp index 902e3e296..57f7144fd 100644 --- a/src/load/store-loader.cpp +++ b/src/load/store-loader.cpp @@ -26,7 +26,7 @@ * Also note that it may not correctly "adapt" to "knowledge" bacoming * known, the player may have to pick stuff up and drop it again. */ -static void home_carry_load(player_type *player_ptr, store_type *store_ptr, object_type *o_ptr) +static void home_carry_load(PlayerType *player_ptr, store_type *store_ptr, object_type *o_ptr) { for (auto i = 0; i < store_ptr->stock_num; i++) { auto *j_ptr = &store_ptr->stock[i]; @@ -65,7 +65,7 @@ static void home_carry_load(player_type *player_ptr, store_type *store_ptr, obje * @param store_number 店舗ID * @return エラーID */ -static void rd_store(player_type *player_ptr, int town_number, int store_number) +static void rd_store(PlayerType *player_ptr, int town_number, int store_number) { store_type *store_ptr; auto sort = false; @@ -116,7 +116,7 @@ static void rd_store(player_type *player_ptr, int town_number, int store_number) * @param player_ptr プレイヤー情報への参照ポインタ(未使用) * @return 読み込み終わったら0、失敗したら22 */ -void load_store(player_type *player_ptr) +void load_store(PlayerType *player_ptr) { int16_t town_count = rd_u16b(); int16_t store_count = rd_u16b(); diff --git a/src/load/store-loader.h b/src/load/store-loader.h index fc65285a2..7c162b02a 100644 --- a/src/load/store-loader.h +++ b/src/load/store-loader.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void load_store(player_type *player_ptr); +class PlayerType; +void load_store(PlayerType *player_ptr); diff --git a/src/load/world-loader.cpp b/src/load/world-loader.cpp index a7e7f071c..98d2c93c3 100644 --- a/src/load/world-loader.cpp +++ b/src/load/world-loader.cpp @@ -26,7 +26,7 @@ static void rd_hengband_dungeons(void) } } -void rd_dungeons(player_type *player_ptr) +void rd_dungeons(PlayerType *player_ptr) { if (h_older_than(0, 3, 8)) rd_zangband_dungeon(); @@ -41,7 +41,7 @@ void rd_dungeons(player_type *player_ptr) * @brief 現実変容処理の有無及びその残りターン数を読み込む * @param player_ptr プレイヤーへの参照ポインタ */ -void rd_alter_reality(player_type *player_ptr) +void rd_alter_reality(PlayerType *player_ptr) { if (h_older_than(0, 3, 8)) player_ptr->recall_dungeon = DUNGEON_ANGBAND; @@ -70,12 +70,12 @@ void set_gambling_monsters(void) /*! * @details 自動拾い関係はこれしかないのでworldに突っ込むことにする。必要があれば再分割する */ -void rd_autopick(player_type *player_ptr) +void rd_autopick(PlayerType *player_ptr) { player_ptr->autopick_autoregister = rd_byte() != 0; } -static void set_undead_turn_limit(player_type *player_ptr) +static void set_undead_turn_limit(PlayerType *player_ptr) { switch (player_ptr->start_race) { case PlayerRaceType::VAMPIRE: @@ -90,7 +90,7 @@ static void set_undead_turn_limit(player_type *player_ptr) } } -static void rd_world_info(player_type *player_ptr) +static void rd_world_info(PlayerType *player_ptr) { set_undead_turn_limit(player_ptr); w_ptr->dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4; @@ -122,7 +122,7 @@ static void rd_world_info(player_type *player_ptr) } } -void rd_visited_towns(player_type *player_ptr) +void rd_visited_towns(PlayerType *player_ptr) { if (h_older_than(0, 3, 9)) { player_ptr->visit = 1L; @@ -137,7 +137,7 @@ void rd_visited_towns(player_type *player_ptr) player_ptr->visit = rd_u32b(); } -void rd_global_configurations(player_type *player_ptr) +void rd_global_configurations(PlayerType *player_ptr) { w_ptr->seed_flavor = rd_u32b(); w_ptr->seed_town = rd_u32b(); @@ -152,7 +152,7 @@ void rd_global_configurations(player_type *player_ptr) rd_world_info(player_ptr); } -void load_wilderness_info(player_type *player_ptr) +void load_wilderness_info(PlayerType *player_ptr) { player_ptr->wilderness_x = rd_s32b(); player_ptr->wilderness_y = rd_s32b(); diff --git a/src/load/world-loader.h b/src/load/world-loader.h index afca595cb..1a4c53583 100644 --- a/src/load/world-loader.h +++ b/src/load/world-loader.h @@ -2,12 +2,12 @@ #include "system/angband.h" -struct player_type; -void rd_dungeons(player_type *player_ptr); -void rd_alter_reality(player_type *player_ptr); +class PlayerType; +void rd_dungeons(PlayerType *player_ptr); +void rd_alter_reality(PlayerType *player_ptr); void set_gambling_monsters(void); -void rd_autopick(player_type *player_ptr); -void rd_visited_towns(player_type *player_ptr); -void rd_global_configurations(player_type *player_ptr); -void load_wilderness_info(player_type *player_ptr); +void rd_autopick(PlayerType *player_ptr); +void rd_visited_towns(PlayerType *player_ptr); +void rd_global_configurations(PlayerType *player_ptr); +void load_wilderness_info(PlayerType *player_ptr); errr analyze_wilderness(void); diff --git a/src/lore/lore-calculator.cpp b/src/lore/lore-calculator.cpp index 2137107a2..5ab0aaaf8 100644 --- a/src/lore/lore-calculator.cpp +++ b/src/lore/lore-calculator.cpp @@ -111,7 +111,7 @@ bool know_damage(MONRACE_IDX r_idx, int i) * @param SPELL_NUM 呪文番号 * @param msg 表示する文字列 */ -void set_damage(player_type *player_ptr, lore_type *lore_ptr, MonsterAbilityType ms_type, concptr msg) +void set_damage(PlayerType *player_ptr, lore_type *lore_ptr, MonsterAbilityType ms_type, concptr msg) { MONRACE_IDX r_idx = lore_ptr->r_idx; int base_damage = monspell_race_damage(player_ptr, ms_type, r_idx, BASE_DAM); diff --git a/src/lore/lore-calculator.h b/src/lore/lore-calculator.h index 06687a592..593e52889 100644 --- a/src/lore/lore-calculator.h +++ b/src/lore/lore-calculator.h @@ -5,9 +5,9 @@ enum class MonsterAbilityType; struct lore_type; -struct player_type; +class PlayerType; void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char *msg); bool know_armour(MONRACE_IDX r_idx, const bool know_everything); bool know_damage(MONRACE_IDX r_idx, int i); -void set_damage(player_type *player_ptr, lore_type *lore_ptr, MonsterAbilityType ms_type, concptr msg); +void set_damage(PlayerType *player_ptr, lore_type *lore_ptr, MonsterAbilityType ms_type, concptr msg); void set_drop_flags(lore_type *lore_ptr); diff --git a/src/lore/lore-store.cpp b/src/lore/lore-store.cpp index f973617ca..9bc5415d7 100644 --- a/src/lore/lore-store.cpp +++ b/src/lore/lore-store.cpp @@ -22,7 +22,7 @@ * @details * Return the number of new flags learnt. -Mogami- */ -int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx) +int lore_do_probe(PlayerType *player_ptr, MONRACE_IDX r_idx) { int n = 0; monster_race *r_ptr = &r_info[r_idx]; @@ -96,7 +96,7 @@ int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx) * @param num_item 手に入れたアイテム数 * @param num_gold 手に入れた財宝の単位数 */ -void lore_treasure(player_type *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold) +void lore_treasure(PlayerType *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/lore/lore-store.h b/src/lore/lore-store.h index ce1cb17f4..e2bf31316 100644 --- a/src/lore/lore-store.h +++ b/src/lore/lore-store.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx); -void lore_treasure(player_type *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold); +class PlayerType; +int lore_do_probe(PlayerType *player_ptr, MONRACE_IDX r_idx); +void lore_treasure(PlayerType *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold); diff --git a/src/lore/magic-types-setter.cpp b/src/lore/magic-types-setter.cpp index 658b91619..f11f0ede3 100644 --- a/src/lore/magic-types-setter.cpp +++ b/src/lore/magic-types-setter.cpp @@ -7,7 +7,7 @@ #include "system/player-type-definition.h" #include "term/term-color-types.h" -void set_breath_types(player_type *player_ptr, lore_type *lore_ptr) +void set_breath_types(PlayerType *player_ptr, lore_type *lore_ptr) { lore_ptr->vn = 0; if (lore_ptr->ability_flags.has(MonsterAbilityType::BR_ACID)) { @@ -143,7 +143,7 @@ void set_breath_types(player_type *player_ptr, lore_type *lore_ptr) } } -void set_ball_types(player_type *player_ptr, lore_type *lore_ptr) +void set_ball_types(PlayerType *player_ptr, lore_type *lore_ptr) { if (lore_ptr->ability_flags.has(MonsterAbilityType::BA_ACID)) { set_damage(player_ptr, lore_ptr, MonsterAbilityType::BA_ACID, _("アシッド・ボール%s", "produce acid balls%s")); @@ -218,7 +218,7 @@ void set_ball_types(player_type *player_ptr, lore_type *lore_ptr) } } -void set_particular_types(player_type *player_ptr, lore_type *lore_ptr) +void set_particular_types(PlayerType *player_ptr, lore_type *lore_ptr) { if (lore_ptr->ability_flags.has(MonsterAbilityType::HAND_DOOM)) { lore_ptr->vp[lore_ptr->vn] = _("破滅の手(40%-60%)", "invoke the Hand of Doom(40%-60%)"); @@ -274,7 +274,7 @@ void set_particular_types(player_type *player_ptr, lore_type *lore_ptr) } } -void set_bolt_types(player_type *player_ptr, lore_type *lore_ptr) +void set_bolt_types(PlayerType *player_ptr, lore_type *lore_ptr) { if (lore_ptr->ability_flags.has(MonsterAbilityType::BO_ACID)) { set_damage(player_ptr, lore_ptr, MonsterAbilityType::BO_ACID, _("アシッド・ボルト%s", "produce acid bolts%s")); @@ -421,7 +421,7 @@ void set_teleport_types(lore_type *lore_ptr) } } -void set_floor_types(player_type *player_ptr, lore_type *lore_ptr) +void set_floor_types(PlayerType *player_ptr, lore_type *lore_ptr) { if (lore_ptr->ability_flags.has(MonsterAbilityType::DARKNESS)) { if ((player_ptr->pclass != PlayerClassType::NINJA) || (lore_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) || (lore_ptr->r_ptr->flags7 & RF7_DARK_MASK)) { diff --git a/src/lore/magic-types-setter.h b/src/lore/magic-types-setter.h index 8a23c5d94..0eb6632d4 100644 --- a/src/lore/magic-types-setter.h +++ b/src/lore/magic-types-setter.h @@ -1,12 +1,12 @@ #pragma once struct lore_type; -struct player_type; -void set_breath_types(player_type *player_ptr, lore_type *lore_ptr); -void set_ball_types(player_type *player_ptr, lore_type *lore_ptr); -void set_particular_types(player_type *player_ptr, lore_type *lore_ptr); -void set_bolt_types(player_type *player_ptr, lore_type *lore_ptr); +class PlayerType; +void set_breath_types(PlayerType *player_ptr, lore_type *lore_ptr); +void set_ball_types(PlayerType *player_ptr, lore_type *lore_ptr); +void set_particular_types(PlayerType *player_ptr, lore_type *lore_ptr); +void set_bolt_types(PlayerType *player_ptr, lore_type *lore_ptr); void set_status_types(lore_type *lore_ptr); void set_teleport_types(lore_type *lore_ptr); -void set_floor_types(player_type *player_ptr, lore_type *lore_ptr); +void set_floor_types(PlayerType *player_ptr, lore_type *lore_ptr); void set_summon_types(lore_type *lore_ptr); diff --git a/src/lore/monster-lore.cpp b/src/lore/monster-lore.cpp index b1c4329ab..55add508e 100644 --- a/src/lore/monster-lore.cpp +++ b/src/lore/monster-lore.cpp @@ -118,7 +118,7 @@ static void set_race_flags(lore_type *lore_ptr) * left edge of the screen, on a cleared line, in which the recall is * to take place. One extra blank line is left after the recall. */ -void process_monster_lore(player_type *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode) +void process_monster_lore(PlayerType *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode) { lore_type tmp_lore; lore_type *lore_ptr = initialize_lore_type(&tmp_lore, r_idx, mode); diff --git a/src/lore/monster-lore.h b/src/lore/monster-lore.h index 51d0ff311..4167dd11e 100644 --- a/src/lore/monster-lore.h +++ b/src/lore/monster-lore.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "lore/lore-util.h" -struct player_type; -void process_monster_lore(player_type *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode); +class PlayerType; +void process_monster_lore(PlayerType *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode); diff --git a/src/main-win.cpp b/src/main-win.cpp index cad5e3e15..e6ffd653d 100644 --- a/src/main-win.cpp +++ b/src/main-win.cpp @@ -792,7 +792,7 @@ static void rebuild_term(term_data *td, bool resize_window = true) /*! * @brief React to global changes */ -static errr term_xtra_win_react(player_type *player_ptr) +static errr term_xtra_win_react(PlayerType *player_ptr) { refresh_color_table(); @@ -929,7 +929,7 @@ static int term_xtra_win_delay(int v) /*! * @brief Do a "special thing" - * @todo z-termに影響があるのでplayer_typeの追加は保留 + * @todo z-termに影響があるのでPlayerTypeの追加は保留 */ static errr term_xtra_win(int n, int v) { @@ -1528,7 +1528,7 @@ static void check_for_save_file(const std::string &savefile_option) /*! * @brief Process a menu command */ -static void process_menus(player_type *player_ptr, WORD wCmd) +static void process_menus(PlayerType *player_ptr, WORD wCmd) { if (!initialized) { plog(_("まだ初期化中です...", "You cannot do that yet...")); diff --git a/src/main/angband-initializer.cpp b/src/main/angband-initializer.cpp index 42572fde0..76072d889 100644 --- a/src/main/angband-initializer.cpp +++ b/src/main/angband-initializer.cpp @@ -208,7 +208,7 @@ static void put_title(void) * @param no_term TRUEならゲーム画面無しの状態で初期化を行う。 * コマンドラインからスポイラーの出力のみを行う時の使用を想定する。 */ -void init_angband(player_type *player_ptr, bool no_term) +void init_angband(PlayerType *player_ptr, bool no_term) { char buf[1024]; path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt")); diff --git a/src/main/angband-initializer.h b/src/main/angband-initializer.h index 0d5d2c02f..eab8433af 100644 --- a/src/main/angband-initializer.h +++ b/src/main/angband-initializer.h @@ -11,6 +11,6 @@ * are included in all such copies. */ -struct player_type; -void init_angband(player_type *player_ptr, bool no_term); +class PlayerType; +void init_angband(PlayerType *player_ptr, bool no_term); void init_file_paths(char *path, char *varpath); diff --git a/src/main/game-data-initializer.cpp b/src/main/game-data-initializer.cpp index 281b10809..d65b0ac5e 100644 --- a/src/main/game-data-initializer.cpp +++ b/src/main/game-data-initializer.cpp @@ -51,7 +51,7 @@ void init_quests(void) * Initialize some other arrays * @return エラーコード */ -void init_other(player_type *player_ptr) +void init_other(PlayerType *player_ptr) { player_ptr->current_floor_ptr = &floor_info; // TODO:本当はこんなところで初期化したくない auto *floor_ptr = player_ptr->current_floor_ptr; diff --git a/src/main/game-data-initializer.h b/src/main/game-data-initializer.h index ea0a8ca42..478f91b4f 100644 --- a/src/main/game-data-initializer.h +++ b/src/main/game-data-initializer.h @@ -6,7 +6,7 @@ #include "system/angband.h" -struct player_type; +class PlayerType; void init_quests(void); -void init_other(player_type *player_ptr); +void init_other(PlayerType *player_ptr); void init_alloc(void); diff --git a/src/main/info-initializer.cpp b/src/main/info-initializer.cpp index 1e85be0d7..47710d924 100644 --- a/src/main/info-initializer.cpp +++ b/src/main/info-initializer.cpp @@ -47,7 +47,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return エラーコード */ -errr init_misc(player_type *player_ptr) +errr init_misc(PlayerType *player_ptr) { return parse_fixed_map(player_ptr, "misc.txt", 0, 0, 0, 0); } diff --git a/src/main/info-initializer.h b/src/main/info-initializer.h index b0bea953e..69581a9a0 100644 --- a/src/main/info-initializer.h +++ b/src/main/info-initializer.h @@ -6,8 +6,8 @@ #include "system/angband.h" -struct player_type; -errr init_misc(player_type *player_ptr); +class PlayerType; +errr init_misc(PlayerType *player_ptr); errr init_f_info(); errr init_k_info(); errr init_a_info(); diff --git a/src/main/scene-table-floor.cpp b/src/main/scene-table-floor.cpp index dc0fb6ef9..e1620698e 100644 --- a/src/main/scene-table-floor.cpp +++ b/src/main/scene-table-floor.cpp @@ -10,9 +10,9 @@ #include "system/floor-type-definition.h" #include "system/player-type-definition.h" -using scene_feel_func = bool (*)(player_type *player_ptr, scene_type *value); +using scene_feel_func = bool (*)(PlayerType *player_ptr, scene_type *value); -static bool scene_basic(player_type *player_ptr, scene_type *value) +static bool scene_basic(PlayerType *player_ptr, scene_type *value) { if (player_ptr->ambush_flag) { value->type = TERM_XTRA_MUSIC_BASIC; @@ -41,7 +41,7 @@ static bool scene_basic(player_type *player_ptr, scene_type *value) return false; } -static bool scene_quest(player_type *player_ptr, scene_type *value) +static bool scene_quest(PlayerType *player_ptr, scene_type *value) { const QUEST_IDX quest_id = quest_number(player_ptr, player_ptr->current_floor_ptr->dun_level); const bool enable = (quest_id > 0); @@ -53,7 +53,7 @@ static bool scene_quest(player_type *player_ptr, scene_type *value) return enable; } -static bool scene_quest_basic(player_type *player_ptr, scene_type *value) +static bool scene_quest_basic(PlayerType *player_ptr, scene_type *value) { const QUEST_IDX quest_id = quest_number(player_ptr, player_ptr->current_floor_ptr->dun_level); const bool enable = (quest_id > 0); @@ -65,7 +65,7 @@ static bool scene_quest_basic(player_type *player_ptr, scene_type *value) return enable; } -static bool scene_town(player_type *player_ptr, scene_type *value) +static bool scene_town(PlayerType *player_ptr, scene_type *value) { const bool enable = !is_in_dungeon(player_ptr) && (player_ptr->town_num > 0); if (enable) { @@ -75,7 +75,7 @@ static bool scene_town(player_type *player_ptr, scene_type *value) return enable; } -static bool scene_town_basic(player_type *player_ptr, scene_type *value) +static bool scene_town_basic(PlayerType *player_ptr, scene_type *value) { const bool enable = !is_in_dungeon(player_ptr) && (player_ptr->town_num > 0); if (enable) { @@ -85,7 +85,7 @@ static bool scene_town_basic(player_type *player_ptr, scene_type *value) return enable; } -static bool scene_field(player_type *player_ptr, scene_type *value) +static bool scene_field(PlayerType *player_ptr, scene_type *value) { const bool enable = !is_in_dungeon(player_ptr); if (enable) { @@ -101,7 +101,7 @@ static bool scene_field(player_type *player_ptr, scene_type *value) return enable; } -static bool scene_dungeon_feeling(player_type *player_ptr, scene_type *value) +static bool scene_dungeon_feeling(PlayerType *player_ptr, scene_type *value) { const bool enable = (player_ptr->feeling >= 2) && (player_ptr->feeling <= 5); if (enable) { @@ -115,7 +115,7 @@ static bool scene_dungeon_feeling(player_type *player_ptr, scene_type *value) return enable; } -static bool scene_dungeon(player_type *player_ptr, scene_type *value) +static bool scene_dungeon(PlayerType *player_ptr, scene_type *value) { const bool enable = (player_ptr->dungeon_idx > 0); if (enable) { @@ -125,7 +125,7 @@ static bool scene_dungeon(player_type *player_ptr, scene_type *value) return enable; } -static bool scene_dungeon_basic(player_type *player_ptr, scene_type *value) +static bool scene_dungeon_basic(PlayerType *player_ptr, scene_type *value) { const bool enable = is_in_dungeon(player_ptr); if (enable) { @@ -142,7 +142,7 @@ static bool scene_dungeon_basic(player_type *player_ptr, scene_type *value) return enable; } -static bool scene_mute(player_type *player_ptr, scene_type *value) +static bool scene_mute(PlayerType *player_ptr, scene_type *value) { (void)player_ptr; value->type = TERM_XTRA_MUSIC_MUTE; @@ -188,7 +188,7 @@ int get_scene_floor_count() * @param list BGM選曲リスト * @param from_index リストの更新開始位置 */ -void refresh_scene_floor(player_type *player_ptr, scene_type_list &list, int from_index) +void refresh_scene_floor(PlayerType *player_ptr, scene_type_list &list, int from_index) { for (auto func : scene_floor_def_list) { scene_type &item = list[from_index]; diff --git a/src/main/scene-table-floor.h b/src/main/scene-table-floor.h index a24c49182..9c6a902f6 100644 --- a/src/main/scene-table-floor.h +++ b/src/main/scene-table-floor.h @@ -8,4 +8,4 @@ #include "system/angband.h" int get_scene_floor_count(); -void refresh_scene_floor(player_type *player_ptr, scene_type_list &list, int start_index); +void refresh_scene_floor(PlayerType *player_ptr, scene_type_list &list, int start_index); diff --git a/src/main/scene-table-monster.cpp b/src/main/scene-table-monster.cpp index 6273f4c36..b0add8925 100644 --- a/src/main/scene-table-monster.cpp +++ b/src/main/scene-table-monster.cpp @@ -82,7 +82,7 @@ inline static bool can_mute_scene_monster() * @retval true モンスターAが優先 * @retval false モンスターBが優先 */ -static bool is_high_rate(player_type *player_ptr, MONSTER_IDX m_idx1, MONSTER_IDX m_idx2) +static bool is_high_rate(PlayerType *player_ptr, MONSTER_IDX m_idx1, MONSTER_IDX m_idx2) { // FIXME 視界内モンスターリストの比較関数と同じ処理 auto floor_ptr = player_ptr->current_floor_ptr; @@ -119,7 +119,7 @@ static bool is_high_rate(player_type *player_ptr, MONSTER_IDX m_idx1, MONSTER_ID * @param player_ptr プレイヤーへの参照ポインタ * @param m_idx BGM対象候補のモンスター */ -static void update_target_monster(player_type *player_ptr, MONSTER_IDX m_idx) +static void update_target_monster(PlayerType *player_ptr, MONSTER_IDX m_idx) { if (scene_target_monster.ap_r_ptr && (scene_target_monster.m_idx == m_idx)) { // 同一モンスター。最後に見たゲームターンを更新。 @@ -144,9 +144,9 @@ static void update_target_monster(player_type *player_ptr, MONSTER_IDX m_idx) } } -using scene_monster_func = bool (*)(player_type *player_ptr, scene_type *value); +using scene_monster_func = bool (*)(PlayerType *player_ptr, scene_type *value); -static bool scene_monster(player_type *player_ptr, scene_type *value) +static bool scene_monster(PlayerType *player_ptr, scene_type *value) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[scene_target_monster.m_idx]; @@ -161,7 +161,7 @@ static bool scene_monster(player_type *player_ptr, scene_type *value) } } -static bool scene_unique(player_type *player_ptr, scene_type *value) +static bool scene_unique(PlayerType *player_ptr, scene_type *value) { (void)player_ptr; @@ -174,7 +174,7 @@ static bool scene_unique(player_type *player_ptr, scene_type *value) return false; } -static bool scene_unknown(player_type *player_ptr, scene_type *value) +static bool scene_unknown(PlayerType *player_ptr, scene_type *value) { (void)player_ptr; if (is_unknown_monster(scene_target_monster.ap_r_ptr)) { @@ -186,7 +186,7 @@ static bool scene_unknown(player_type *player_ptr, scene_type *value) return false; } -static bool scene_high_level(player_type *player_ptr, scene_type *value) +static bool scene_high_level(PlayerType *player_ptr, scene_type *value) { if (!is_unknown_monster(scene_target_monster.ap_r_ptr) && (scene_target_monster.ap_r_ptr->level >= player_ptr->lev)) { value->type = TERM_XTRA_MUSIC_BASIC; @@ -226,7 +226,7 @@ int get_scene_monster_count() * @param list BGM選曲リスト * @param from_index リストの更新開始位置 */ -void refresh_scene_monster(player_type *player_ptr, const std::vector &monster_list, scene_type_list &list, int from_index) +void refresh_scene_monster(PlayerType *player_ptr, const std::vector &monster_list, scene_type_list &list, int from_index) { const bool mute = can_mute_scene_monster(); diff --git a/src/main/scene-table-monster.h b/src/main/scene-table-monster.h index 4fb7868d9..46f431bd0 100644 --- a/src/main/scene-table-monster.h +++ b/src/main/scene-table-monster.h @@ -7,8 +7,8 @@ #include "main/scene-table.h" #include "system/angband.h" -struct player_type; +class PlayerType; void clear_scene_target_monster(); void set_temp_mute_scene_monster(int sec); int get_scene_monster_count(); -void refresh_scene_monster(player_type *player_ptr, const std::vector &monster_list, scene_type_list &list, int from_index); +void refresh_scene_monster(PlayerType *player_ptr, const std::vector &monster_list, scene_type_list &list, int from_index); diff --git a/src/main/scene-table.cpp b/src/main/scene-table.cpp index fde86cfc7..be6fa9e65 100644 --- a/src/main/scene-table.cpp +++ b/src/main/scene-table.cpp @@ -50,7 +50,7 @@ void interrupt_scene(int type, int val) { * @brief 現在のフロアに合ったBGM選曲 * @param player_ptr プレイヤーへの参照ポインタ */ -void refresh_scene_table(player_type *player_ptr) +void refresh_scene_table(PlayerType *player_ptr) { // clear interrupt_scene interrupt_scene(0, 0); @@ -64,7 +64,7 @@ void refresh_scene_table(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monster_list 視界内モンスターリスト */ -void refresh_scene_table(player_type *player_ptr, const std::vector &monster_list) +void refresh_scene_table(PlayerType *player_ptr, const std::vector &monster_list) { resize_scene_list(); int index = 0; diff --git a/src/main/scene-table.h b/src/main/scene-table.h index ebf1cf230..56577ff41 100644 --- a/src/main/scene-table.h +++ b/src/main/scene-table.h @@ -15,8 +15,8 @@ struct scene_type { using scene_type_list = std::vector; -struct player_type; +class PlayerType; void interrupt_scene(int type, int val); -void refresh_scene_table(player_type *player_ptr); -void refresh_scene_table(player_type *player_ptr, const std::vector &monster_list); +void refresh_scene_table(PlayerType *player_ptr); +void refresh_scene_table(PlayerType *player_ptr, const std::vector &monster_list); scene_type_list &get_scene_type_list(int val); diff --git a/src/main/sound-of-music.cpp b/src/main/sound-of-music.cpp index 47fa809be..d608cde2e 100644 --- a/src/main/sound-of-music.cpp +++ b/src/main/sound-of-music.cpp @@ -54,7 +54,7 @@ errr play_music(int type, int val) * @param player_ptr プレイヤーへの参照ポインタ * @details 設定がない場合はミュートする。 */ -void select_floor_music(player_type *player_ptr) +void select_floor_music(PlayerType *player_ptr) { if (!use_music) return; @@ -68,7 +68,7 @@ void select_floor_music(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monster_list モンスターリスト */ -void select_monster_music(player_type *player_ptr, const std::vector &monster_list) +void select_monster_music(PlayerType *player_ptr, const std::vector &monster_list) { if (!use_music) return; diff --git a/src/main/sound-of-music.h b/src/main/sound-of-music.h index 914dbf047..7f20954f1 100644 --- a/src/main/sound-of-music.h +++ b/src/main/sound-of-music.h @@ -10,9 +10,9 @@ extern bool has_monster_music; -struct player_type; +class PlayerType; void bell(void); void sound(int num); errr play_music(int type, int num); -void select_floor_music(player_type *player_ptr); -void select_monster_music(player_type *player_ptr, const std::vector &monster_list); +void select_floor_music(PlayerType *player_ptr); +void select_monster_music(PlayerType *player_ptr, const std::vector &monster_list); diff --git a/src/market/arena.cpp b/src/market/arena.cpp index 7a16fba03..4e6be1b5d 100644 --- a/src/market/arena.cpp +++ b/src/market/arena.cpp @@ -33,7 +33,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return まだ優勝していないか、挑戦者モンスターとの戦いではFALSE */ -static bool process_ostensible_arena_victory(player_type *player_ptr) +static bool process_ostensible_arena_victory(PlayerType *player_ptr) { if (player_ptr->arena_number != MAX_ARENA_MONS) return false; @@ -57,7 +57,7 @@ static bool process_ostensible_arena_victory(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return まだパワー・ワイアーム以下を倒していないならFALSE、倒していたらTRUE */ -static bool battle_metal_babble(player_type *player_ptr) +static bool battle_metal_babble(PlayerType *player_ptr) { if (player_ptr->arena_number <= MAX_ARENA_MONS) return false; @@ -90,7 +90,7 @@ static bool battle_metal_babble(player_type *player_ptr) return true; } -static void go_to_arena(player_type *player_ptr) +static void go_to_arena(PlayerType *player_ptr) { if (process_ostensible_arena_victory(player_ptr)) return; @@ -113,7 +113,7 @@ static void go_to_arena(player_type *player_ptr) player_ptr->leave_bldg = true; } -static void see_arena_poster(player_type *player_ptr) +static void see_arena_poster(PlayerType *player_ptr) { if (player_ptr->arena_number == MAX_ARENA_MONS) { msg_print(_("あなたは勝利者だ。 アリーナでのセレモニーに参加しなさい。", "You are victorious. Enter the arena for the ceremony.")); @@ -140,7 +140,7 @@ static void see_arena_poster(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param cmd 闘技場処理のID */ -void arena_comm(player_type *player_ptr, int cmd) +void arena_comm(PlayerType *player_ptr, int cmd) { switch (cmd) { case BACT_ARENA: @@ -163,7 +163,7 @@ void arena_comm(player_type *player_ptr, int cmd) * @brief モンスター闘技場に参加するモンスターを更新する。 * @param player_ptr プレイヤーへの参照ポインタ */ -void update_gambling_monsters(player_type *player_ptr) +void update_gambling_monsters(PlayerType *player_ptr) { int total, i; int max_dl = 0; @@ -272,7 +272,7 @@ void update_gambling_monsters(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 賭けを開始したか否か */ -bool monster_arena_comm(player_type *player_ptr) +bool monster_arena_comm(PlayerType *player_ptr) { PRICE maxbet; PRICE wager; diff --git a/src/market/arena.h b/src/market/arena.h index 2006922df..da09489e8 100644 --- a/src/market/arena.h +++ b/src/market/arena.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void arena_comm(player_type *player_ptr, int cmd); -void update_gambling_monsters(player_type *player_ptr); -bool monster_arena_comm(player_type *player_ptr); +class PlayerType; +void arena_comm(PlayerType *player_ptr, int cmd); +void update_gambling_monsters(PlayerType *player_ptr); +bool monster_arena_comm(PlayerType *player_ptr); diff --git a/src/market/bounty.cpp b/src/market/bounty.cpp index c866caa33..6d9345eca 100644 --- a/src/market/bounty.cpp +++ b/src/market/bounty.cpp @@ -42,7 +42,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 各種賞金首のいずれかでも換金が行われたか否か。 */ -bool exchange_cash(player_type *player_ptr) +bool exchange_cash(PlayerType *player_ptr) { bool change = false; GAME_TEXT o_name[MAX_NLEN]; @@ -197,7 +197,7 @@ bool exchange_cash(player_type *player_ptr) * @brief 本日の賞金首情報を表示する。 * @param player_ptr プレイヤーへの参照ポインタ */ -void today_target(player_type *player_ptr) +void today_target(PlayerType *player_ptr) { char buf[160]; monster_race *r_ptr = &r_info[w_ptr->today_mon]; @@ -265,10 +265,10 @@ void show_bounty(void) /*! * @brief 今日の賞金首を確定する / Determine today's bounty monster - * @param player_type プレイヤーへの参照ポインタ + * @param PlayerType プレイヤーへの参照ポインタ * @note conv_old is used if loaded 0.0.3 or older save file */ -void determine_daily_bounty(player_type *player_ptr, bool conv_old) +void determine_daily_bounty(PlayerType *player_ptr, bool conv_old) { int max_dl = 3; if (!conv_old) { @@ -314,7 +314,7 @@ void determine_daily_bounty(player_type *player_ptr, bool conv_old) * @brief 賞金首となるユニークを確定する / Determine bounty uniques * @param player_ptr プレイヤーへの参照ポインタ */ -void determine_bounty_uniques(player_type *player_ptr) +void determine_bounty_uniques(PlayerType *player_ptr) { get_mon_num_prep_bounty(player_ptr); diff --git a/src/market/bounty.h b/src/market/bounty.h index 648478246..5a3ceb53d 100644 --- a/src/market/bounty.h +++ b/src/market/bounty.h @@ -1,9 +1,9 @@ #pragma once -struct player_type; -bool exchange_cash(player_type *player_ptr); -void today_target(player_type *player_ptr); +class PlayerType; +bool exchange_cash(PlayerType *player_ptr); +void today_target(PlayerType *player_ptr); void tsuchinoko(void); void show_bounty(void); -void determine_daily_bounty(player_type *player_ptr, bool conv_old); -void determine_bounty_uniques(player_type *player_ptr); +void determine_daily_bounty(PlayerType *player_ptr, bool conv_old); +void determine_bounty_uniques(PlayerType *player_ptr); diff --git a/src/market/building-craft-fix.cpp b/src/market/building-craft-fix.cpp index b19ae1e8d..c2acf49f0 100644 --- a/src/market/building-craft-fix.cpp +++ b/src/market/building-craft-fix.cpp @@ -88,7 +88,7 @@ static void give_one_ability_of_object(object_type *to_ptr, object_type *from_pt * @param bcost 基本修復費用 * @return 実際にかかった費用 */ -static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) +static PRICE repair_broken_weapon_aux(PlayerType *player_ptr, PRICE bcost) { clear_bldg(0, 22); int row = 7; @@ -276,7 +276,7 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) * @param bcost 基本鑑定費用 * @return 実際にかかった費用 */ -int repair_broken_weapon(player_type *player_ptr, PRICE bcost) +int repair_broken_weapon(PlayerType *player_ptr, PRICE bcost) { PRICE cost; screen_save(); diff --git a/src/market/building-craft-fix.h b/src/market/building-craft-fix.h index 22a24a462..2b22b2fe4 100644 --- a/src/market/building-craft-fix.h +++ b/src/market/building-craft-fix.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -int repair_broken_weapon(player_type *player_ptr, PRICE bcost); +class PlayerType; +int repair_broken_weapon(PlayerType *player_ptr, PRICE bcost); diff --git a/src/market/building-craft-weapon.cpp b/src/market/building-craft-weapon.cpp index 28b70b863..364c0d0d4 100644 --- a/src/market/building-craft-weapon.cpp +++ b/src/market/building-craft-weapon.cpp @@ -70,7 +70,7 @@ static HIT_POINT calc_slaydam(HIT_POINT dam, int mult, int div, bool force) * @return ダメージ期待値 */ static uint32_t calc_expect_dice( - player_type *player_ptr, uint32_t dam, int mult, int div, bool force, WEIGHT weight, int plus, int16_t meichuu, bool dokubari, bool impact, int vorpal_mult, int vorpal_div) + PlayerType *player_ptr, uint32_t dam, int mult, int div, bool force, WEIGHT weight, int plus, int16_t meichuu, bool dokubari, bool impact, int vorpal_mult, int vorpal_div) { dam = calc_slaydam(dam, mult, div, force); dam = calc_expect_crit(player_ptr, weight, plus, dam, meichuu, dokubari, impact); @@ -116,7 +116,7 @@ static void show_weapon_dmg(int r, int c, int mindice, int maxdice, int blows, i * Only accurate for the current weapon, because it includes\n * the current number of blows for the player.\n */ -static void compare_weapon_aux(player_type *player_ptr, object_type *o_ptr, int col, int r) +static void compare_weapon_aux(PlayerType *player_ptr, object_type *o_ptr, int col, int r) { int blow = player_ptr->num_blow[0]; bool force = false; @@ -296,7 +296,7 @@ static void compare_weapon_aux(player_type *player_ptr, object_type *o_ptr, int /*! * @brief 武器匠における武器一つ毎の完全情報を表示する。 - * @param player_type プレイヤーへの参照ポインタ + * @param PlayerType プレイヤーへの参照ポインタ * @param o_ptr オブジェクトの構造体の参照ポインタ。 * @param row 表示する列の左端 * @param col 表示する行の上端 @@ -306,7 +306,7 @@ static void compare_weapon_aux(player_type *player_ptr, object_type *o_ptr, int * Only accurate for the current weapon, because it includes * various info about the player's +to_dam and number of blows. */ -static void list_weapon(player_type *player_ptr, object_type *o_ptr, TERM_LEN row, TERM_LEN col) +static void list_weapon(PlayerType *player_ptr, object_type *o_ptr, TERM_LEN row, TERM_LEN col) { GAME_TEXT o_name[MAX_NLEN]; GAME_TEXT tmp_str[80]; @@ -345,7 +345,7 @@ static void list_weapon(player_type *player_ptr, object_type *o_ptr, TERM_LEN ro * @param bcost 基本鑑定費用 * @return 最終的にかかった費用 */ -PRICE compare_weapons(player_type *player_ptr, PRICE bcost) +PRICE compare_weapons(PlayerType *player_ptr, PRICE bcost) { object_type *o_ptr[2]; object_type orig_weapon; diff --git a/src/market/building-craft-weapon.h b/src/market/building-craft-weapon.h index d7c44cde7..5452dac37 100644 --- a/src/market/building-craft-weapon.h +++ b/src/market/building-craft-weapon.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -PRICE compare_weapons(player_type *player_ptr, PRICE bcost); +class PlayerType; +PRICE compare_weapons(PlayerType *player_ptr, PRICE bcost); diff --git a/src/market/building-enchanter.cpp b/src/market/building-enchanter.cpp index cdc19d7e2..a158cb7a2 100644 --- a/src/market/building-enchanter.cpp +++ b/src/market/building-enchanter.cpp @@ -22,7 +22,7 @@ * @param to_ac ACをアップさせる量 * @return 実際に行ったらTRUE */ -bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, const ItemTester& item_tester) +bool enchant_item(PlayerType *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, const ItemTester& item_tester) { clear_bldg(4, 18); int maxenchant = (player_ptr->lev / 5); diff --git a/src/market/building-enchanter.h b/src/market/building-enchanter.h index c5dc31170..c03deb8fa 100644 --- a/src/market/building-enchanter.h +++ b/src/market/building-enchanter.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ItemTester; -bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, const ItemTester &item_tester); +bool enchant_item(PlayerType *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, const ItemTester &item_tester); diff --git a/src/market/building-monster.cpp b/src/market/building-monster.cpp index 219010a69..bfd64630c 100644 --- a/src/market/building-monster.cpp +++ b/src/market/building-monster.cpp @@ -22,7 +22,7 @@ * @return 常にTRUEを返す。 * @todo 返り値が意味不明なので直した方が良いかもしれない。 */ -bool research_mon(player_type *player_ptr) +bool research_mon(PlayerType *player_ptr) { char buf[256]; bool notpicked; diff --git a/src/market/building-monster.h b/src/market/building-monster.h index 62544e4ef..55aac3847 100644 --- a/src/market/building-monster.h +++ b/src/market/building-monster.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool research_mon(player_type *player_ptr); +class PlayerType; +bool research_mon(PlayerType *player_ptr); diff --git a/src/market/building-quest.cpp b/src/market/building-quest.cpp index 374052858..d158694d6 100644 --- a/src/market/building-quest.cpp +++ b/src/market/building-quest.cpp @@ -21,7 +21,7 @@ * @param questnum クエストのID * @param do_init クエストの開始処理か(true)、結果処理か(FALSE) */ -static void get_questinfo(player_type *player_ptr, IDX questnum, bool do_init) +static void get_questinfo(PlayerType *player_ptr, IDX questnum, bool do_init) { for (int i = 0; i < 10; i++) { quest_text[i][0] = '\0'; @@ -47,7 +47,7 @@ static void get_questinfo(player_type *player_ptr, IDX questnum, bool do_init) * @param questnum クエストのID * @param do_init クエストの開始処理か(true)、結果処理か(FALSE) */ -void print_questinfo(player_type *player_ptr, IDX questnum, bool do_init) +void print_questinfo(PlayerType *player_ptr, IDX questnum, bool do_init) { get_questinfo(player_ptr, questnum, do_init); @@ -65,7 +65,7 @@ void print_questinfo(player_type *player_ptr, IDX questnum, bool do_init) * @brief クエスト処理のメインルーチン / Request a quest from the Lord. * @param player_ptr プレイヤーへの参照ポインタ */ -void castle_quest(player_type *player_ptr) +void castle_quest(PlayerType *player_ptr) { clear_bldg(4, 18); QUEST_IDX q_index = player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x].special; diff --git a/src/market/building-quest.h b/src/market/building-quest.h index 3c4f6da1e..6c090a675 100644 --- a/src/market/building-quest.h +++ b/src/market/building-quest.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void castle_quest(player_type *player_ptr); +class PlayerType; +void castle_quest(PlayerType *player_ptr); diff --git a/src/market/building-recharger.cpp b/src/market/building-recharger.cpp index 6c5616fb4..6ba006a32 100644 --- a/src/market/building-recharger.cpp +++ b/src/market/building-recharger.cpp @@ -31,7 +31,7 @@ * the base-item.\n * @param player_ptr プレイヤーへの参照ポインタ */ -void building_recharge(player_type *player_ptr) +void building_recharge(PlayerType *player_ptr) { msg_flag = false; clear_bldg(4, 18); @@ -173,7 +173,7 @@ void building_recharge(player_type *player_ptr) * the base-item.\n * @param player_ptr プレイヤーへの参照ポインタ */ -void building_recharge_all(player_type *player_ptr) +void building_recharge_all(PlayerType *player_ptr) { msg_flag = false; clear_bldg(4, 18); diff --git a/src/market/building-recharger.h b/src/market/building-recharger.h index 27e588aeb..9197c068b 100644 --- a/src/market/building-recharger.h +++ b/src/market/building-recharger.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void building_recharge(player_type *player_ptr); -void building_recharge_all(player_type *player_ptr); +class PlayerType; +void building_recharge(PlayerType *player_ptr); +void building_recharge_all(PlayerType *player_ptr); diff --git a/src/market/building-service.cpp b/src/market/building-service.cpp index 02afa9631..22315ad8f 100644 --- a/src/market/building-service.cpp +++ b/src/market/building-service.cpp @@ -15,7 +15,7 @@ * @param bldg 施設構造体の参照ポインタ * @return 種族、職業、魔法領域のいずれかが一致しているかの是非。 */ -bool is_owner(player_type *player_ptr, building_type *bldg) +bool is_owner(PlayerType *player_ptr, building_type *bldg) { if (bldg->member_class[enum2i(player_ptr->pclass)] == BUILDING_OWNER) { return true; @@ -44,7 +44,7 @@ bool is_owner(player_type *player_ptr, building_type *bldg) * @return 種族、職業、魔法領域のいずれかが一致しているかの是非。 * @todo is_owner()との実質的な多重実装なので、リファクタリングを行うべきである。 */ -bool is_member(player_type *player_ptr, building_type *bldg) +bool is_member(PlayerType *player_ptr, building_type *bldg) { if (static_cast(bldg->member_class[enum2i(player_ptr->pclass)])) { return true; @@ -76,7 +76,7 @@ bool is_member(player_type *player_ptr, building_type *bldg) * @param player_ptr プレイヤーへの参照ポインタ * @param bldg 施設構造体の参照ポインタ */ -void display_buikding_service(player_type *player_ptr, building_type *bldg) +void display_buikding_service(PlayerType *player_ptr, building_type *bldg) { char buff[20]; byte action_color; diff --git a/src/market/building-service.h b/src/market/building-service.h index 4c076ab3b..5f6fc9691 100644 --- a/src/market/building-service.h +++ b/src/market/building-service.h @@ -1,7 +1,7 @@ #pragma once typedef struct building_type building_type; -struct player_type; -bool is_owner(player_type *player_ptr, building_type *bldg); -bool is_member(player_type *player_ptr, building_type *bldg); -void display_buikding_service(player_type *player_ptr, building_type *bldg); +class PlayerType; +bool is_owner(PlayerType *player_ptr, building_type *bldg); +bool is_member(PlayerType *player_ptr, building_type *bldg); +void display_buikding_service(PlayerType *player_ptr, building_type *bldg); diff --git a/src/market/building-util.cpp b/src/market/building-util.cpp index b3fb26923..df63bde50 100644 --- a/src/market/building-util.cpp +++ b/src/market/building-util.cpp @@ -20,7 +20,7 @@ void clear_bldg(int min_row, int max_row) * @brief 所持金を表示する。 * @param player_ptr プレイヤーへの参照ポインタ */ -void building_prt_gold(player_type *player_ptr) +void building_prt_gold(PlayerType *player_ptr) { char tmp_str[80]; prt(_("手持ちのお金: ", "Gold Remaining: "), 23, 53); diff --git a/src/market/building-util.h b/src/market/building-util.h index df9d484a7..34e57566d 100644 --- a/src/market/building-util.h +++ b/src/market/building-util.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; +class PlayerType; void clear_bldg(int min_row, int max_row); -void building_prt_gold(player_type *player_ptr); +void building_prt_gold(PlayerType *player_ptr); diff --git a/src/market/play-gamble.cpp b/src/market/play-gamble.cpp index 9e28bbdaa..62418419c 100644 --- a/src/market/play-gamble.cpp +++ b/src/market/play-gamble.cpp @@ -18,7 +18,7 @@ * @param cmd プレイするゲームID * @return プレイ成立やルール説明のみ等ならTRUE、賭け金不足で不成立ならFALSE */ -bool gamble_comm(player_type *player_ptr, int cmd) +bool gamble_comm(PlayerType *player_ptr, int cmd) { int i; int roll1, roll2, roll3, choice, odds, win; diff --git a/src/market/play-gamble.h b/src/market/play-gamble.h index c9ba88e6e..0090cc673 100644 --- a/src/market/play-gamble.h +++ b/src/market/play-gamble.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool gamble_comm(player_type *player_ptr, int cmd); +class PlayerType; +bool gamble_comm(PlayerType *player_ptr, int cmd); diff --git a/src/melee/melee-postprocess.cpp b/src/melee/melee-postprocess.cpp index 7fa54b756..d0e843fbc 100644 --- a/src/melee/melee-postprocess.cpp +++ b/src/melee/melee-postprocess.cpp @@ -59,7 +59,7 @@ typedef struct mam_pp_type { } mam_pp_type; mam_pp_type *initialize_mam_pp_type( - player_type *player_ptr, mam_pp_type *mam_pp_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who) + PlayerType *player_ptr, mam_pp_type *mam_pp_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who) { mam_pp_ptr->m_idx = m_idx; mam_pp_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; @@ -73,7 +73,7 @@ mam_pp_type *initialize_mam_pp_type( return mam_pp_ptr; } -static void prepare_redraw(player_type *player_ptr, mam_pp_type *mam_pp_ptr) +static void prepare_redraw(PlayerType *player_ptr, mam_pp_type *mam_pp_ptr) { if (!mam_pp_ptr->m_ptr->ml) return; @@ -135,7 +135,7 @@ static bool process_all_resistances(mam_pp_type *mam_pp_ptr) * 見えない位置で死んだら何も表示しない * 爆発して粉々になった等ならその旨を、残りは生命か無生命かで分岐 */ -static void print_monster_dead_by_monster(player_type *player_ptr, mam_pp_type *mam_pp_ptr) +static void print_monster_dead_by_monster(PlayerType *player_ptr, mam_pp_type *mam_pp_ptr) { if (!mam_pp_ptr->known) return; @@ -169,7 +169,7 @@ static void print_monster_dead_by_monster(player_type *player_ptr, mam_pp_type * * @param mam_pp_ptr 標的モンスター構造体への参照ポインタ * @return 生きていたらTRUE、それ以外 (ユニークは@以外の攻撃では死なない)はFALSE */ -static bool check_monster_hp(player_type *player_ptr, mam_pp_type *mam_pp_ptr) +static bool check_monster_hp(PlayerType *player_ptr, mam_pp_type *mam_pp_ptr) { monster_race *r_ptr = &r_info[mam_pp_ptr->m_ptr->r_idx]; if (mam_pp_ptr->m_ptr->hp < 0) @@ -194,7 +194,7 @@ static bool check_monster_hp(player_type *player_ptr, mam_pp_type *mam_pp_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param mam_pp_ptr 標的モンスター構造体への参照ポインタ */ -static void cancel_fear_by_pain(player_type *player_ptr, mam_pp_type *mam_pp_ptr) +static void cancel_fear_by_pain(PlayerType *player_ptr, mam_pp_type *mam_pp_ptr) { if (!monster_fear_remaining(mam_pp_ptr->m_ptr) || (mam_pp_ptr->dam <= 0) || !set_monster_monfear(player_ptr, mam_pp_ptr->m_idx, monster_fear_remaining(mam_pp_ptr->m_ptr) - randint1(mam_pp_ptr->dam / 4))) @@ -208,7 +208,7 @@ static void cancel_fear_by_pain(player_type *player_ptr, mam_pp_type *mam_pp_ptr * @param player_ptr プレイヤーへの参照ポインタ * @param mam_pp_ptr 標的モンスター構造体への参照ポインタ */ -static void make_monster_fear(player_type *player_ptr, mam_pp_type *mam_pp_ptr) +static void make_monster_fear(PlayerType *player_ptr, mam_pp_type *mam_pp_ptr) { monster_race *r_ptr = &r_info[mam_pp_ptr->m_ptr->r_idx]; if (monster_fear_remaining(mam_pp_ptr->m_ptr) || ((r_ptr->flags3 & RF3_NO_FEAR) == 0)) @@ -229,7 +229,7 @@ static void make_monster_fear(player_type *player_ptr, mam_pp_type *mam_pp_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param mam_pp_ptr 標的モンスター構造体への参照ポインタ */ -static void fall_off_horse_by_melee(player_type *player_ptr, mam_pp_type *mam_pp_ptr) +static void fall_off_horse_by_melee(PlayerType *player_ptr, mam_pp_type *mam_pp_ptr) { if (!player_ptr->riding || (player_ptr->riding != mam_pp_ptr->m_idx) || (mam_pp_ptr->dam <= 0)) return; @@ -253,7 +253,7 @@ static void fall_off_horse_by_melee(player_type *player_ptr, mam_pp_type *mam_pp * @param who 打撃を行ったモンスターの参照ID * @todo 打撃が当たった時の後処理 (爆発持ちのモンスターを爆発させる等)なので、関数名を変更する必要あり */ -void mon_take_hit_mon(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who) +void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; diff --git a/src/melee/melee-postprocess.h b/src/melee/melee-postprocess.h index c8aeab1ca..c237ef8ef 100644 --- a/src/melee/melee-postprocess.h +++ b/src/melee/melee-postprocess.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "combat/combat-options-type.h" -struct player_type; -void mon_take_hit_mon(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who); +class PlayerType; +void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who); diff --git a/src/melee/melee-spell-flags-checker.cpp b/src/melee/melee-spell-flags-checker.cpp index aecd035ee..06e21c853 100644 --- a/src/melee/melee-spell-flags-checker.cpp +++ b/src/melee/melee-spell-flags-checker.cpp @@ -29,7 +29,7 @@ #include -static void decide_melee_spell_target(player_type *player_ptr, melee_spell_type *ms_ptr) +static void decide_melee_spell_target(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if ((player_ptr->pet_t_m_idx == 0) || !ms_ptr->pet) return; @@ -40,7 +40,7 @@ static void decide_melee_spell_target(player_type *player_ptr, melee_spell_type ms_ptr->target_idx = 0; } -static void decide_indirection_melee_spell(player_type *player_ptr, melee_spell_type *ms_ptr) +static void decide_indirection_melee_spell(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if ((ms_ptr->target_idx != 0) || (ms_ptr->m_ptr->target_y == 0)) return; @@ -62,7 +62,7 @@ static void decide_indirection_melee_spell(player_type *player_ptr, melee_spell_ ms_ptr->ability_flags &= RF_ABILITY_INDIRECT_MASK; } -static bool check_melee_spell_projection(player_type *player_ptr, melee_spell_type *ms_ptr) +static bool check_melee_spell_projection(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (ms_ptr->target_idx != 0) return true; @@ -94,7 +94,7 @@ static bool check_melee_spell_projection(player_type *player_ptr, melee_spell_ty return false; } -static void check_darkness(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_darkness(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (ms_ptr->ability_flags.has_not(MonsterAbilityType::DARKNESS)) return; @@ -121,7 +121,7 @@ static void check_stupid(melee_spell_type *ms_ptr) ms_ptr->ability_flags &= RF_ABILITY_NOMAGIC_MASK; } -static void check_arena(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_arena(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (!player_ptr->current_floor_ptr->inside_arena && !player_ptr->phase_out) return; @@ -131,7 +131,7 @@ static void check_arena(player_type *player_ptr, melee_spell_type *ms_ptr) ms_ptr->ability_flags.reset(MonsterAbilityType::SPECIAL); } -static void check_melee_spell_distance(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_melee_spell_distance(PlayerType *player_ptr, melee_spell_type *ms_ptr) { auto ball_mask_except_rocket = RF_ABILITY_BALL_MASK; ball_mask_except_rocket.reset(MonsterAbilityType::ROCKET); @@ -160,7 +160,7 @@ static void check_melee_spell_distance(player_type *player_ptr, melee_spell_type ms_ptr->ability_flags.reset(RF_ABILITY_BIG_BALL_MASK); } -static void check_melee_spell_rocket(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_melee_spell_rocket(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (ms_ptr->ability_flags.has_not(MonsterAbilityType::ROCKET)) return; @@ -172,7 +172,7 @@ static void check_melee_spell_rocket(player_type *player_ptr, melee_spell_type * ms_ptr->ability_flags.reset(MonsterAbilityType::ROCKET); } -static void check_melee_spell_beam(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_melee_spell_beam(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (ms_ptr->ability_flags.has_none_of(RF_ABILITY_BEAM_MASK) || direct_beam(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, ms_ptr->m_ptr)) @@ -181,7 +181,7 @@ static void check_melee_spell_beam(player_type *player_ptr, melee_spell_type *ms ms_ptr->ability_flags.reset(RF_ABILITY_BEAM_MASK); } -static void check_melee_spell_breath(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_melee_spell_breath(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (ms_ptr->ability_flags.has_none_of(RF_ABILITY_BREATH_MASK)) return; @@ -204,7 +204,7 @@ static void check_melee_spell_breath(player_type *player_ptr, melee_spell_type * } } -static void check_melee_spell_special(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_melee_spell_special(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (ms_ptr->ability_flags.has_not(MonsterAbilityType::SPECIAL)) return; @@ -226,7 +226,7 @@ static void check_melee_spell_special(player_type *player_ptr, melee_spell_type ms_ptr->ability_flags.reset(MonsterAbilityType::SPECIAL); } -static void check_riding(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_riding(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (ms_ptr->m_idx != player_ptr->riding) return; @@ -234,7 +234,7 @@ static void check_riding(player_type *player_ptr, melee_spell_type *ms_ptr) ms_ptr->ability_flags.reset(RF_ABILITY_RIDING_MASK); } -static void check_pet(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_pet(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (!ms_ptr->pet) return; @@ -261,7 +261,7 @@ static void check_pet(player_type *player_ptr, melee_spell_type *ms_ptr) check_melee_spell_special(player_ptr, ms_ptr); } -static void check_non_stupid(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_non_stupid(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if ((ms_ptr->r_ptr->flags2 & RF2_STUPID) != 0) return; @@ -286,7 +286,7 @@ static void check_non_stupid(player_type *player_ptr, melee_spell_type *ms_ptr) ms_ptr->ability_flags.reset(MonsterAbilityType::SPECIAL); } -static void check_smart(player_type *player_ptr, melee_spell_type *ms_ptr) +static void check_smart(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if ((ms_ptr->r_ptr->flags2 & RF2_SMART) == 0) return; @@ -300,7 +300,7 @@ static void check_smart(player_type *player_ptr, melee_spell_type *ms_ptr) ms_ptr->ability_flags.reset(MonsterAbilityType::TELE_LEVEL); } -static bool set_melee_spell_set(player_type *player_ptr, melee_spell_type *ms_ptr) +static bool set_melee_spell_set(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (ms_ptr->ability_flags.none()) return false; @@ -310,7 +310,7 @@ static bool set_melee_spell_set(player_type *player_ptr, melee_spell_type *ms_pt return !ms_ptr->spells.empty() && player_ptr->playing && !player_ptr->is_dead && !player_ptr->leaving; } -bool check_melee_spell_set(player_type *player_ptr, melee_spell_type *ms_ptr) +bool check_melee_spell_set(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (monster_confused_remaining(ms_ptr->m_ptr)) return false; diff --git a/src/melee/melee-spell-flags-checker.h b/src/melee/melee-spell-flags-checker.h index 8f38128f3..84b02d73f 100644 --- a/src/melee/melee-spell-flags-checker.h +++ b/src/melee/melee-spell-flags-checker.h @@ -1,5 +1,5 @@ #pragma once typedef struct melee_spell_type melee_spell_type; -struct player_type; -bool check_melee_spell_set(player_type *player_ptr, melee_spell_type *ms_ptr); +class PlayerType; +bool check_melee_spell_set(PlayerType *player_ptr, melee_spell_type *ms_ptr); diff --git a/src/melee/melee-spell-util.cpp b/src/melee/melee-spell-util.cpp index 9cc66e926..a796d236b 100644 --- a/src/melee/melee-spell-util.cpp +++ b/src/melee/melee-spell-util.cpp @@ -11,7 +11,7 @@ #include "system/monster-type-definition.h" #include "system/player-type-definition.h" -melee_spell_type *initialize_melee_spell_type(player_type *player_ptr, melee_spell_type *ms_ptr, MONSTER_IDX m_idx) +melee_spell_type *initialize_melee_spell_type(PlayerType *player_ptr, melee_spell_type *ms_ptr, MONSTER_IDX m_idx) { ms_ptr->m_idx = m_idx; ms_ptr->y = 0; diff --git a/src/melee/melee-spell-util.h b/src/melee/melee-spell-util.h index 2c442f0aa..57e33815b 100644 --- a/src/melee/melee-spell-util.h +++ b/src/melee/melee-spell-util.h @@ -33,5 +33,5 @@ typedef struct melee_spell_type { EnumClassFlagGroup ability_flags; } melee_spell_type; -struct player_type; -melee_spell_type *initialize_melee_spell_type(player_type *player_ptr, melee_spell_type *ms_ptr, MONSTER_IDX m_idx); +class PlayerType; +melee_spell_type *initialize_melee_spell_type(PlayerType *player_ptr, melee_spell_type *ms_ptr, MONSTER_IDX m_idx); diff --git a/src/melee/melee-spell.cpp b/src/melee/melee-spell.cpp index d4405fe1e..41ebedf27 100644 --- a/src/melee/melee-spell.cpp +++ b/src/melee/melee-spell.cpp @@ -29,7 +29,7 @@ #define RF5_SPELL_SIZE 32 #define RF6_SPELL_SIZE 32 -static bool try_melee_spell(player_type *player_ptr, melee_spell_type *ms_ptr) +static bool try_melee_spell(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (spell_is_inate(ms_ptr->thrown_spell) || (!ms_ptr->in_no_magic_dungeon && (!monster_stunned_remaining(ms_ptr->m_ptr) || one_in_(2)))) return false; @@ -41,7 +41,7 @@ static bool try_melee_spell(player_type *player_ptr, melee_spell_type *ms_ptr) return true; } -static bool disturb_melee_spell(player_type *player_ptr, melee_spell_type *ms_ptr) +static bool disturb_melee_spell(PlayerType *player_ptr, melee_spell_type *ms_ptr) { if (spell_is_inate(ms_ptr->thrown_spell) || !SpellHex(player_ptr).check_hex_barrier(ms_ptr->m_idx, HEX_ANTI_MAGIC)) return false; @@ -52,7 +52,7 @@ static bool disturb_melee_spell(player_type *player_ptr, melee_spell_type *ms_pt return true; } -static void process_special_melee_spell(player_type *player_ptr, melee_spell_type *ms_ptr) +static void process_special_melee_spell(PlayerType *player_ptr, melee_spell_type *ms_ptr) { bool is_special_magic = ms_ptr->m_ptr->ml; is_special_magic &= ms_ptr->maneable; @@ -86,7 +86,7 @@ static void process_rememberance(melee_spell_type *ms_ptr) ms_ptr->r_ptr->r_cast_spell++; } -static void describe_melee_spell(player_type *player_ptr, melee_spell_type *ms_ptr) +static void describe_melee_spell(PlayerType *player_ptr, melee_spell_type *ms_ptr) { /* Get the monster name (or "it") */ monster_desc(player_ptr, ms_ptr->m_name, ms_ptr->m_ptr, 0x00); @@ -110,7 +110,7 @@ static void describe_melee_spell(player_type *player_ptr, melee_spell_type *ms_p * @details * The player is only disturbed if able to be affected by the spell. */ -bool monst_spell_monst(player_type *player_ptr, MONSTER_IDX m_idx) +bool monst_spell_monst(PlayerType *player_ptr, MONSTER_IDX m_idx) { melee_spell_type tmp_ms; melee_spell_type *ms_ptr = initialize_melee_spell_type(player_ptr, &tmp_ms, m_idx); diff --git a/src/melee/melee-spell.h b/src/melee/melee-spell.h index abef9514b..81304dff1 100644 --- a/src/melee/melee-spell.h +++ b/src/melee/melee-spell.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool monst_spell_monst(player_type *player_ptr, MONSTER_IDX m_idx); +class PlayerType; +bool monst_spell_monst(PlayerType *player_ptr, MONSTER_IDX m_idx); diff --git a/src/melee/melee-switcher.cpp b/src/melee/melee-switcher.cpp index 2975e61b1..5115c0a56 100644 --- a/src/melee/melee-switcher.cpp +++ b/src/melee/melee-switcher.cpp @@ -14,7 +14,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -void describe_melee_method(player_type *player_ptr, mam_type *mam_ptr) +void describe_melee_method(PlayerType *player_ptr, mam_type *mam_ptr) { switch (mam_ptr->method) { case RBM_HIT: { @@ -148,7 +148,7 @@ void describe_melee_method(player_type *player_ptr, mam_type *mam_ptr) } } -void decide_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr) +void decide_monster_attack_effect(PlayerType *player_ptr, mam_type *mam_ptr) { switch (mam_ptr->effect) { case RaceBlowEffectType::NONE: @@ -251,7 +251,7 @@ void decide_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr) } } -void describe_monster_missed_monster(player_type *player_ptr, mam_type *mam_ptr) +void describe_monster_missed_monster(PlayerType *player_ptr, mam_type *mam_ptr) { switch (mam_ptr->method) { case RBM_HIT: diff --git a/src/melee/melee-switcher.h b/src/melee/melee-switcher.h index eff81860c..4abb3e566 100644 --- a/src/melee/melee-switcher.h +++ b/src/melee/melee-switcher.h @@ -8,7 +8,7 @@ enum be_type { }; typedef struct mam_type mam_type; -struct player_type; -void describe_melee_method(player_type *player_ptr, mam_type *mam_ptr); -void decide_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr); -void describe_monster_missed_monster(player_type *player_ptr, mam_type *mam_ptr); +class PlayerType; +void describe_melee_method(PlayerType *player_ptr, mam_type *mam_ptr); +void decide_monster_attack_effect(PlayerType *player_ptr, mam_type *mam_ptr); +void describe_monster_missed_monster(PlayerType *player_ptr, mam_type *mam_ptr); diff --git a/src/melee/melee-util.cpp b/src/melee/melee-util.cpp index 8bf46d889..9c9f585ce 100644 --- a/src/melee/melee-util.cpp +++ b/src/melee/melee-util.cpp @@ -7,7 +7,7 @@ #include "system/monster-type-definition.h" #include "system/player-type-definition.h" -mam_type *initialize_mam_type(player_type *player_ptr, mam_type *mam_ptr, MONRACE_IDX m_idx, MONRACE_IDX t_idx) +mam_type *initialize_mam_type(PlayerType *player_ptr, mam_type *mam_ptr, MONRACE_IDX m_idx, MONRACE_IDX t_idx) { mam_ptr->attribute = 0; mam_ptr->m_idx = m_idx; diff --git a/src/melee/melee-util.h b/src/melee/melee-util.h index 6574d98dc..3d73dcefd 100644 --- a/src/melee/melee-util.h +++ b/src/melee/melee-util.h @@ -40,5 +40,5 @@ typedef struct mam_type { bool dead; } mam_type; -struct player_type; -mam_type *initialize_mam_type(player_type *player_ptr, mam_type *mam_ptr, MONRACE_IDX m_idx, MONRACE_IDX t_idx); +class PlayerType; +mam_type *initialize_mam_type(PlayerType *player_ptr, mam_type *mam_ptr, MONRACE_IDX m_idx, MONRACE_IDX t_idx); diff --git a/src/melee/monster-attack-monster.cpp b/src/melee/monster-attack-monster.cpp index 41c222a80..cbbdbac52 100644 --- a/src/melee/monster-attack-monster.cpp +++ b/src/melee/monster-attack-monster.cpp @@ -38,7 +38,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -static void heal_monster_by_melee(player_type *player_ptr, mam_type *mam_ptr) +static void heal_monster_by_melee(PlayerType *player_ptr, mam_type *mam_ptr) { if (!monster_living(mam_ptr->m_idx) || (mam_ptr->damage <= 2)) return; @@ -58,7 +58,7 @@ static void heal_monster_by_melee(player_type *player_ptr, mam_type *mam_ptr) msg_format(_("%sは体力を回復したようだ。", "%^s appears healthier."), mam_ptr->m_name); } -static void process_blow_effect(player_type *player_ptr, mam_type *mam_ptr) +static void process_blow_effect(PlayerType *player_ptr, mam_type *mam_ptr) { monster_race *r_ptr = &r_info[mam_ptr->m_ptr->r_idx]; switch (mam_ptr->attribute) { @@ -76,7 +76,7 @@ static void process_blow_effect(player_type *player_ptr, mam_type *mam_ptr) } } -static void aura_fire_by_melee(player_type *player_ptr, mam_type *mam_ptr) +static void aura_fire_by_melee(PlayerType *player_ptr, mam_type *mam_ptr) { monster_race *r_ptr = &r_info[mam_ptr->m_ptr->r_idx]; monster_race *tr_ptr = &r_info[mam_ptr->t_ptr->r_idx]; @@ -98,7 +98,7 @@ static void aura_fire_by_melee(player_type *player_ptr, mam_type *mam_ptr) PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); } -static void aura_cold_by_melee(player_type *player_ptr, mam_type *mam_ptr) +static void aura_cold_by_melee(PlayerType *player_ptr, mam_type *mam_ptr) { monster_race *r_ptr = &r_info[mam_ptr->m_ptr->r_idx]; monster_race *tr_ptr = &r_info[mam_ptr->t_ptr->r_idx]; @@ -120,7 +120,7 @@ static void aura_cold_by_melee(player_type *player_ptr, mam_type *mam_ptr) PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); } -static void aura_elec_by_melee(player_type *player_ptr, mam_type *mam_ptr) +static void aura_elec_by_melee(PlayerType *player_ptr, mam_type *mam_ptr) { monster_race *r_ptr = &r_info[mam_ptr->m_ptr->r_idx]; monster_race *tr_ptr = &r_info[mam_ptr->t_ptr->r_idx]; @@ -142,7 +142,7 @@ static void aura_elec_by_melee(player_type *player_ptr, mam_type *mam_ptr) PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); } -static bool check_same_monster(player_type *player_ptr, mam_type *mam_ptr) +static bool check_same_monster(PlayerType *player_ptr, mam_type *mam_ptr) { if (mam_ptr->m_idx == mam_ptr->t_idx) return false; @@ -157,7 +157,7 @@ static bool check_same_monster(player_type *player_ptr, mam_type *mam_ptr) return true; } -static void redraw_health_bar(player_type *player_ptr, mam_type *mam_ptr) +static void redraw_health_bar(PlayerType *player_ptr, mam_type *mam_ptr) { if (!mam_ptr->t_ptr->ml) return; @@ -192,7 +192,7 @@ static void describe_silly_melee(mam_type *mam_ptr) #endif } -static void process_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr) +static void process_monster_attack_effect(PlayerType *player_ptr, mam_type *mam_ptr) { if (mam_ptr->pt == AttributeType::NONE) return; @@ -210,7 +210,7 @@ static void process_monster_attack_effect(player_type *player_ptr, mam_type *mam aura_elec_by_melee(player_ptr, mam_ptr); } -static void process_melee(player_type *player_ptr, mam_type *mam_ptr) +static void process_melee(PlayerType *player_ptr, mam_type *mam_ptr) { if (mam_ptr->effect != RaceBlowEffectType::NONE && !check_hit_from_monster_to_monster(mam_ptr->power, mam_ptr->rlev, mam_ptr->ac, monster_stunned_remaining(mam_ptr->m_ptr))) { describe_monster_missed_monster(player_ptr, mam_ptr); @@ -229,7 +229,7 @@ static void process_melee(player_type *player_ptr, mam_type *mam_ptr) process_monster_attack_effect(player_ptr, mam_ptr); } -static void thief_runaway_by_melee(player_type *player_ptr, mam_type *mam_ptr) +static void thief_runaway_by_melee(PlayerType *player_ptr, mam_type *mam_ptr) { if (SpellHex(player_ptr).check_hex_barrier(mam_ptr->m_idx, HEX_ANTI_TELE)) { if (mam_ptr->see_m) { @@ -248,7 +248,7 @@ static void thief_runaway_by_melee(player_type *player_ptr, mam_type *mam_ptr) } } -static void explode_monster_by_melee(player_type *player_ptr, mam_type *mam_ptr) +static void explode_monster_by_melee(PlayerType *player_ptr, mam_type *mam_ptr) { if (!mam_ptr->explode) return; @@ -265,7 +265,7 @@ static void explode_monster_by_melee(player_type *player_ptr, mam_type *mam_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param mam_ptr モンスター乱闘構造体への参照ポインタ */ -void repeat_melee(player_type *player_ptr, mam_type *mam_ptr) +void repeat_melee(PlayerType *player_ptr, mam_type *mam_ptr) { monster_race *r_ptr = &r_info[mam_ptr->m_ptr->r_idx]; for (int ap_cnt = 0; ap_cnt < MAX_NUM_BLOWS; ap_cnt++) { @@ -299,7 +299,7 @@ void repeat_melee(player_type *player_ptr, mam_type *mam_ptr) * @param t_idx 目標側モンスターの参照ID * @return 実際に打撃処理が行われた場合TRUEを返す */ -bool monst_attack_monst(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx) +bool monst_attack_monst(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx) { mam_type tmp_mam; mam_type *mam_ptr = initialize_mam_type(player_ptr, &tmp_mam, m_idx, t_idx); diff --git a/src/melee/monster-attack-monster.h b/src/melee/monster-attack-monster.h index 0015f8231..0c7c20c10 100644 --- a/src/melee/monster-attack-monster.h +++ b/src/melee/monster-attack-monster.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool monst_attack_monst(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx); +class PlayerType; +bool monst_attack_monst(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx); diff --git a/src/mind/mind-archer.cpp b/src/mind/mind-archer.cpp index d045c3440..a1f414832 100644 --- a/src/mind/mind-archer.cpp +++ b/src/mind/mind-archer.cpp @@ -89,7 +89,7 @@ static bool select_ammo_creation_type(ammo_creation_type &type, PLAYER_LEVEL ple * Hook to determine if an object is contertible in an arrow/bolt * @return 製造を実際に行ったらTRUE、キャンセルしたらFALSEを返す */ -bool create_ammo(player_type *player_ptr) +bool create_ammo(PlayerType *player_ptr) { if (cmd_limit_confused(player_ptr) || cmd_limit_blind(player_ptr)) return false; diff --git a/src/mind/mind-archer.h b/src/mind/mind-archer.h index c38f5761a..a6a1f7906 100644 --- a/src/mind/mind-archer.h +++ b/src/mind/mind-archer.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool create_ammo(player_type *player_ptr); +class PlayerType; +bool create_ammo(PlayerType *player_ptr); diff --git a/src/mind/mind-berserker.cpp b/src/mind/mind-berserker.cpp index b8b11339c..dfc768f98 100644 --- a/src/mind/mind-berserker.cpp +++ b/src/mind/mind-berserker.cpp @@ -22,7 +22,7 @@ * @param spell 発動する特殊技能のID * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -bool cast_berserk_spell(player_type *player_ptr, mind_berserker_type spell) +bool cast_berserk_spell(PlayerType *player_ptr, mind_berserker_type spell) { POSITION y, x; DIRECTION dir; diff --git a/src/mind/mind-berserker.h b/src/mind/mind-berserker.h index 7081793a6..3cb7ee6fa 100644 --- a/src/mind/mind-berserker.h +++ b/src/mind/mind-berserker.h @@ -1,5 +1,5 @@ #pragma once enum mind_berserker_type : int; -struct player_type; -bool cast_berserk_spell(player_type *player_ptr, mind_berserker_type spell); +class PlayerType; +bool cast_berserk_spell(PlayerType *player_ptr, mind_berserker_type spell); diff --git a/src/mind/mind-blue-mage.cpp b/src/mind/mind-blue-mage.cpp index c57056655..3a4161d89 100644 --- a/src/mind/mind-blue-mage.cpp +++ b/src/mind/mind-blue-mage.cpp @@ -29,7 +29,7 @@ * do_cmd_cast calls this function if the player's class is 'Blue-Mage'. * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -bool do_cmd_cast_learned(player_type *player_ptr) +bool do_cmd_cast_learned(PlayerType *player_ptr) { if (cmd_limit_confused(player_ptr)) return false; diff --git a/src/mind/mind-blue-mage.h b/src/mind/mind-blue-mage.h index 8e0dd8325..732ab0986 100644 --- a/src/mind/mind-blue-mage.h +++ b/src/mind/mind-blue-mage.h @@ -10,8 +10,8 @@ enum class BlueMagicType { OTHER = 5, }; -struct player_type; -bool do_cmd_cast_learned(player_type *player_ptr); +class PlayerType; +bool do_cmd_cast_learned(PlayerType *player_ptr); inline constexpr std::array BLUE_MAGIC_TYPE_LIST = { BlueMagicType::BOLT, diff --git a/src/mind/mind-cavalry.cpp b/src/mind/mind-cavalry.cpp index 506873a32..57cd5a1db 100644 --- a/src/mind/mind-cavalry.cpp +++ b/src/mind/mind-cavalry.cpp @@ -26,7 +26,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 結果はどうあれ騎乗したらTRUE */ -bool rodeo(player_type *player_ptr) +bool rodeo(PlayerType *player_ptr) { GAME_TEXT m_name[MAX_NLEN]; monster_type *m_ptr; diff --git a/src/mind/mind-cavalry.h b/src/mind/mind-cavalry.h index f2e1cdad4..638ba6621 100644 --- a/src/mind/mind-cavalry.h +++ b/src/mind/mind-cavalry.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool rodeo(player_type *player_ptr); +class PlayerType; +bool rodeo(PlayerType *player_ptr); diff --git a/src/mind/mind-chaos-warrior.cpp b/src/mind/mind-chaos-warrior.cpp index 8067aa0bb..00ef9ee0a 100644 --- a/src/mind/mind-chaos-warrior.cpp +++ b/src/mind/mind-chaos-warrior.cpp @@ -8,7 +8,7 @@ #include "system/object-type-definition.h" #include "system/player-type-definition.h" -void acquire_chaos_weapon(player_type *player_ptr) +void acquire_chaos_weapon(PlayerType *player_ptr) { object_type forge; object_type *q_ptr = &forge; diff --git a/src/mind/mind-chaos-warrior.h b/src/mind/mind-chaos-warrior.h index a041f256a..8053e2fc1 100644 --- a/src/mind/mind-chaos-warrior.h +++ b/src/mind/mind-chaos-warrior.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void acquire_chaos_weapon(player_type *player_ptr); +class PlayerType; +void acquire_chaos_weapon(PlayerType *player_ptr); diff --git a/src/mind/mind-elementalist.cpp b/src/mind/mind-elementalist.cpp index 56119965f..566a17fe0 100644 --- a/src/mind/mind-elementalist.cpp +++ b/src/mind/mind-elementalist.cpp @@ -329,7 +329,7 @@ AttributeType get_element_type(int realm_idx, int n) * @param n 属性の何番目か * @return 属性タイプ */ -static AttributeType get_element_spells_type(player_type *player_ptr, int n) +static AttributeType get_element_spells_type(PlayerType *player_ptr, int n) { auto realm = element_types.at(i2enum(player_ptr->element)); auto t = realm.type.at(n); @@ -368,7 +368,7 @@ concptr get_element_name(int realm_idx, int n) * @param spell_idx 呪文番号 * @return 説明文 */ -static concptr get_element_tip(player_type *player_ptr, int spell_idx) +static concptr get_element_tip(PlayerType *player_ptr, int spell_idx) { auto realm = i2enum(player_ptr->element); auto spell = i2enum(spell_idx); @@ -382,7 +382,7 @@ static concptr get_element_tip(player_type *player_ptr, int spell_idx) * @param spell_idx 呪文番号 * @return 説明文 */ -static int get_elemental_elem(player_type *player_ptr, int spell_idx) +static int get_elemental_elem(PlayerType *player_ptr, int spell_idx) { (void)player_ptr; auto spell = i2enum(spell_idx); @@ -395,7 +395,7 @@ static int get_elemental_elem(player_type *player_ptr, int spell_idx) * @param spell_idx 呪文番号 * @return 説明文 */ -static mind_type get_elemental_info(player_type *player_ptr, int spell_idx) +static mind_type get_elemental_info(PlayerType *player_ptr, int spell_idx) { (void)player_ptr; auto spell = i2enum(spell_idx); @@ -409,7 +409,7 @@ static mind_type get_elemental_info(player_type *player_ptr, int spell_idx) * @param p バッファ * @return なし(pを更新) */ -void get_element_effect_info(player_type *player_ptr, int spell_idx, char *p) +void get_element_effect_info(PlayerType *player_ptr, int spell_idx, char *p) { PLAYER_LEVEL plev = player_ptr->lev; auto spell = i2enum(spell_idx); @@ -471,7 +471,7 @@ void get_element_effect_info(player_type *player_ptr, int spell_idx, char *p) * @param spell_idx 呪文番号 * @return 実行したらTRUE、キャンセルならFALSE */ -static bool cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx) +static bool cast_element_spell(PlayerType *player_ptr, SPELL_IDX spell_idx) { auto spell = i2enum(spell_idx); auto power = element_powers.at(spell); @@ -624,7 +624,7 @@ static bool cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx) * @param spell_idx 呪文番号 * @return 失敗率 */ -static PERCENTAGE decide_element_chance(player_type *player_ptr, mind_type spell) +static PERCENTAGE decide_element_chance(PlayerType *player_ptr, mind_type spell) { PERCENTAGE chance = spell.fail; @@ -659,7 +659,7 @@ static PERCENTAGE decide_element_chance(player_type *player_ptr, mind_type spell * @param spell_idx 呪文番号 * @return 消費MP */ -static MANA_POINT decide_element_mana_cost(player_type *player_ptr, mind_type spell) +static MANA_POINT decide_element_mana_cost(PlayerType *player_ptr, mind_type spell) { (void)player_ptr; return spell.mana_cost; @@ -672,7 +672,7 @@ static MANA_POINT decide_element_mana_cost(player_type *player_ptr, mind_type sp * @param only_browse 閲覧モードかどうか * @return 選んだらTRUE、選ばなかったらFALSE */ -bool get_element_power(player_type *player_ptr, SPELL_IDX *sn, bool only_browse) +bool get_element_power(PlayerType *player_ptr, SPELL_IDX *sn, bool only_browse) { SPELL_IDX i; int num = 0; @@ -843,7 +843,7 @@ bool get_element_power(player_type *player_ptr, SPELL_IDX *sn, bool only_browse) * @param mana_cost 消費MP * @return 詠唱するならTRUE、しないならFALSE */ -static bool check_element_mp_sufficiency(player_type *player_ptr, int mana_cost) +static bool check_element_mp_sufficiency(PlayerType *player_ptr, int mana_cost) { if (mana_cost <= player_ptr->csp) return true; @@ -862,7 +862,7 @@ static bool check_element_mp_sufficiency(player_type *player_ptr, int mana_cost) * @param chance 失敗率 * @return 詠唱して実行したらTRUE、されなかったらFALSE */ -static bool try_cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx, PERCENTAGE chance) +static bool try_cast_element_spell(PlayerType *player_ptr, SPELL_IDX spell_idx, PERCENTAGE chance) { if (randint0(100) >= chance) { sound(SOUND_ZAP); @@ -896,7 +896,7 @@ static bool try_cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx, * @brief 元素魔法コマンドのメインルーチン * @param player_ptr プレイヤー情報への参照ポインタ */ -void do_cmd_element(player_type *player_ptr) +void do_cmd_element(PlayerType *player_ptr) { SPELL_IDX i; if (cmd_limit_confused(player_ptr) || !get_element_power(player_ptr, &i, false)) @@ -937,7 +937,7 @@ void do_cmd_element(player_type *player_ptr) * @brief 現在プレイヤーが使用可能な元素魔法の一覧表示 * @param player_ptr プレイヤー情報への参照ポインタ */ -void do_cmd_element_browse(player_type *player_ptr) +void do_cmd_element_browse(PlayerType *player_ptr) { SPELL_IDX n = 0; char temp[62 * 5]; @@ -1020,7 +1020,7 @@ bool is_elemental_genocide_effective(monster_race *r_ptr, AttributeType type) * @param em_ptr 魔法効果情報への参照ポインタ * @return 効果処理を続けるかどうか */ -process_result effect_monster_elemental_genocide(player_type *player_ptr, effect_monster_type *em_ptr) +process_result effect_monster_elemental_genocide(PlayerType *player_ptr, effect_monster_type *em_ptr) { auto type = get_element_type(player_ptr->element, 0); auto name = get_element_name(player_ptr->element, 0); @@ -1060,7 +1060,7 @@ process_result effect_monster_elemental_genocide(player_type *player_ptr, effect * @details * レベルに応じて取得する耐性などの判定に使用する */ -bool has_element_resist(player_type *player_ptr, ElementRealmType realm, PLAYER_LEVEL lev) +bool has_element_resist(PlayerType *player_ptr, ElementRealmType realm, PLAYER_LEVEL lev) { if (player_ptr->pclass != PlayerClassType::ELEMENTALIST) return false; @@ -1129,7 +1129,7 @@ static int interpret_realm_select_key(int cs, int n, char c) * @param n 最後尾の位置 * @return 領域番号 */ -static int get_element_realm(player_type *player_ptr, int is, int n) +static int get_element_realm(PlayerType *player_ptr, int is, int n) { int cs = std::max(0, is); int os = cs; @@ -1195,7 +1195,7 @@ static int get_element_realm(player_type *player_ptr, int is, int n) * @param player_ptr プレイヤー情報への参照ポインタ * @return 領域番号 */ -byte select_element_realm(player_type *player_ptr) +byte select_element_realm(PlayerType *player_ptr) { clear_from(10); @@ -1241,7 +1241,7 @@ byte select_element_realm(player_type *player_ptr) * @param player_ptr プレイヤー情報への参照ポインタ * @param rc_ptr レイシャルパワー情報への参照ポインタ */ -void switch_element_racial(player_type *player_ptr, rc_type *rc_ptr) +void switch_element_racial(PlayerType *player_ptr, rc_type *rc_ptr) { auto plev = player_ptr->lev; auto realm = i2enum(player_ptr->element); @@ -1330,14 +1330,14 @@ void switch_element_racial(player_type *player_ptr, rc_type *rc_ptr) /*! * @todo 宣言だけ。後日適切な場所に移動 */ -static bool door_to_darkness(player_type *player_ptr, POSITION dist); +static bool door_to_darkness(PlayerType *player_ptr, POSITION dist); /*! * @brief クラスパワーを実行 * @param player_ptr プレイヤー情報への参照ポインタ * @return 実行したらTRUE、しなかったらFALSE */ -bool switch_element_execution(player_type *player_ptr) +bool switch_element_execution(PlayerType *player_ptr) { auto realm = i2enum(player_ptr->element); PLAYER_LEVEL plev = player_ptr->lev; @@ -1424,7 +1424,7 @@ static bool is_target_grid_dark(floor_type *f_ptr, POSITION y, POSITION x) * @breif 暗いところ限定での次元の扉 * @param player_ptr プレイヤー情報への参照ポインタ */ -static bool door_to_darkness(player_type *player_ptr, POSITION dist) +static bool door_to_darkness(PlayerType *player_ptr, POSITION dist) { POSITION y = player_ptr->y; POSITION x = player_ptr->x; diff --git a/src/mind/mind-elementalist.h b/src/mind/mind-elementalist.h index b9db8a2b5..5420c7144 100644 --- a/src/mind/mind-elementalist.h +++ b/src/mind/mind-elementalist.h @@ -15,17 +15,17 @@ enum class ElementRealmType { MAX }; -struct player_type; +class PlayerType; struct effect_monster_type; struct rc_type; concptr get_element_title(int realm_idx); AttributeType get_element_type(int realm_idx, int n); concptr get_element_name(int realm_idx, int n); -void do_cmd_element(player_type *player_ptr); -void do_cmd_element_browse(player_type *player_ptr); -process_result effect_monster_elemental_genocide(player_type *player_ptr, effect_monster_type *em_ptr); -bool has_element_resist(player_type *player_ptr, ElementRealmType realm, PLAYER_LEVEL lev); -byte select_element_realm(player_type *player_ptr); -void switch_element_racial(player_type *player_ptr, rc_type *rc_ptr); -bool switch_element_execution(player_type *player_ptr); +void do_cmd_element(PlayerType *player_ptr); +void do_cmd_element_browse(PlayerType *player_ptr); +process_result effect_monster_elemental_genocide(PlayerType *player_ptr, effect_monster_type *em_ptr); +bool has_element_resist(PlayerType *player_ptr, ElementRealmType realm, PLAYER_LEVEL lev); +byte select_element_realm(PlayerType *player_ptr); +void switch_element_racial(PlayerType *player_ptr, rc_type *rc_ptr); +bool switch_element_execution(PlayerType *player_ptr); diff --git a/src/mind/mind-force-trainer.cpp b/src/mind/mind-force-trainer.cpp index f0f652a5d..97cede648 100644 --- a/src/mind/mind-force-trainer.cpp +++ b/src/mind/mind-force-trainer.cpp @@ -45,7 +45,7 @@ * @param player_ptr プレイヤーの参照ポインタ * @return 現在溜まっている気の量 */ -int32_t get_current_ki(player_type *player_ptr) +int32_t get_current_ki(PlayerType *player_ptr) { auto data = PlayerClass(player_ptr).get_specific_data(); @@ -58,7 +58,7 @@ int32_t get_current_ki(player_type *player_ptr) * @param is_reset TRUEなら気の量をkiにセットし、FALSEなら加減算を行う * @param ki 気の量 */ -void set_current_ki(player_type *player_ptr, bool is_reset, int32_t ki) +void set_current_ki(PlayerType *player_ptr, bool is_reset, int32_t ki) { auto data = PlayerClass(player_ptr).get_specific_data(); if (!data) { @@ -73,7 +73,7 @@ void set_current_ki(player_type *player_ptr, bool is_reset, int32_t ki) data->ki += ki; } -bool clear_mind(player_type *player_ptr) +bool clear_mind(PlayerType *player_ptr) { if (total_friends) { msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention.")); @@ -97,7 +97,7 @@ bool clear_mind(player_type *player_ptr) * @param v 継続時間 * @param do_dec 現在の継続時間より長い値のみ上書きする */ -void set_lightspeed(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +void set_lightspeed(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -142,7 +142,7 @@ void set_lightspeed(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_sh_force(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_sh_force(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -182,7 +182,7 @@ bool set_tim_sh_force(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param player_ptr プレイヤーへの参照ポインタ * @return 命中したらTRUE */ -bool shock_power(player_type *player_ptr) +bool shock_power(PlayerType *player_ptr) { int boost = get_current_ki(player_ptr); if (heavy_armor(player_ptr)) @@ -252,7 +252,7 @@ bool shock_power(player_type *player_ptr) * @param spell 発動する特殊技能のID * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -bool cast_force_spell(player_type *player_ptr, mind_force_trainer_type spell) +bool cast_force_spell(PlayerType *player_ptr, mind_force_trainer_type spell) { DIRECTION dir; PLAYER_LEVEL plev = player_ptr->lev; diff --git a/src/mind/mind-force-trainer.h b/src/mind/mind-force-trainer.h index b3fa110bd..84d28761c 100644 --- a/src/mind/mind-force-trainer.h +++ b/src/mind/mind-force-trainer.h @@ -2,13 +2,13 @@ #include "system/angband.h" -struct player_type; -int32_t get_current_ki(player_type *player_ptr); -void set_current_ki(player_type *player_ptr, bool is_reset, int32_t ki); -bool clear_mind(player_type *player_ptr); -void set_lightspeed(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tim_sh_force(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool shock_power(player_type *player_ptr); +class PlayerType; +int32_t get_current_ki(PlayerType *player_ptr); +void set_current_ki(PlayerType *player_ptr, bool is_reset, int32_t ki); +bool clear_mind(PlayerType *player_ptr); +void set_lightspeed(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tim_sh_force(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool shock_power(PlayerType *player_ptr); enum mind_force_trainer_type : int; -bool cast_force_spell(player_type *player_ptr, mind_force_trainer_type spell); +bool cast_force_spell(PlayerType *player_ptr, mind_force_trainer_type spell); diff --git a/src/mind/mind-hobbit.cpp b/src/mind/mind-hobbit.cpp index e7d025588..96dac2fff 100644 --- a/src/mind/mind-hobbit.cpp +++ b/src/mind/mind-hobbit.cpp @@ -6,7 +6,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -bool create_ration(player_type *player_ptr) +bool create_ration(PlayerType *player_ptr) { object_type forge; object_type *q_ptr = &forge; diff --git a/src/mind/mind-hobbit.h b/src/mind/mind-hobbit.h index f15e8f811..b16c3e3f0 100644 --- a/src/mind/mind-hobbit.h +++ b/src/mind/mind-hobbit.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool create_ration(player_type *player_ptr); +class PlayerType; +bool create_ration(PlayerType *player_ptr); diff --git a/src/mind/mind-info.cpp b/src/mind/mind-info.cpp index 97a482516..8f2a661a4 100644 --- a/src/mind/mind-info.cpp +++ b/src/mind/mind-info.cpp @@ -6,7 +6,7 @@ #include "player-info/equipment-info.h" #include "system/player-type-definition.h" -static void switch_mind_mindcrafter(player_type *player_ptr, const PLAYER_LEVEL plev, const int power, char *p) +static void switch_mind_mindcrafter(PlayerType *player_ptr, const PLAYER_LEVEL plev, const int power, char *p) { switch (power) { case 0: @@ -57,7 +57,7 @@ static void switch_mind_mindcrafter(player_type *player_ptr, const PLAYER_LEVEL } } -static void switch_mind_ki(player_type *player_ptr, const PLAYER_LEVEL plev, const int power, char *p) +static void switch_mind_ki(PlayerType *player_ptr, const PLAYER_LEVEL plev, const int power, char *p) { int boost = get_current_ki(player_ptr); if (heavy_armor(player_ptr)) @@ -220,7 +220,7 @@ static void switch_mind_ninja(const PLAYER_LEVEL plev, const int power, char *p) * @param use_mind 職業毎の特殊技能ID * @param power モンスター魔法のID */ -void mindcraft_info(player_type *player_ptr, char *p, MindKindType use_mind, int power) +void mindcraft_info(PlayerType *player_ptr, char *p, MindKindType use_mind, int power) { const PLAYER_LEVEL plev = player_ptr->lev; strcpy(p, ""); diff --git a/src/mind/mind-info.h b/src/mind/mind-info.h index 00ad3c24a..bca6cf58d 100644 --- a/src/mind/mind-info.h +++ b/src/mind/mind-info.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; +class PlayerType; enum class MindKindType; -void mindcraft_info(player_type *player_ptr, char *p, MindKindType use_mind, int power); +void mindcraft_info(PlayerType *player_ptr, char *p, MindKindType use_mind, int power); diff --git a/src/mind/mind-mage.cpp b/src/mind/mind-mage.cpp index c239c1755..2ef72b4d2 100644 --- a/src/mind/mind-mage.cpp +++ b/src/mind/mind-mage.cpp @@ -26,7 +26,7 @@ * @param power 基本効力 * @return ターンを消費した場合TRUEを返す */ -bool eat_magic(player_type *player_ptr, int power) +bool eat_magic(PlayerType *player_ptr, int power) { byte fail_type = 1; GAME_TEXT o_name[MAX_NLEN]; diff --git a/src/mind/mind-mage.h b/src/mind/mind-mage.h index e3f5fb777..7133fb802 100644 --- a/src/mind/mind-mage.h +++ b/src/mind/mind-mage.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool eat_magic(player_type *player_ptr, int power); +class PlayerType; +bool eat_magic(PlayerType *player_ptr, int power); diff --git a/src/mind/mind-magic-eater.cpp b/src/mind/mind-magic-eater.cpp index 69ee1a80d..d8f8ba794 100644 --- a/src/mind/mind-magic-eater.cpp +++ b/src/mind/mind-magic-eater.cpp @@ -19,7 +19,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 取り込みを実行したらTRUE、キャンセルしたらFALSEを返す */ -bool import_magic_device(player_type *player_ptr) +bool import_magic_device(PlayerType *player_ptr) { concptr q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? "); concptr s = _("魔力を取り込めるアイテムがない。", "There's nothing with power to absorb."); diff --git a/src/mind/mind-magic-eater.h b/src/mind/mind-magic-eater.h index 74a3fc8c6..f22550447 100644 --- a/src/mind/mind-magic-eater.h +++ b/src/mind/mind-magic-eater.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool import_magic_device(player_type *player_ptr); +class PlayerType; +bool import_magic_device(PlayerType *player_ptr); diff --git a/src/mind/mind-magic-resistance.cpp b/src/mind/mind-magic-resistance.cpp index 8974de77e..bf2f7c073 100644 --- a/src/mind/mind-magic-resistance.cpp +++ b/src/mind/mind-magic-resistance.cpp @@ -13,7 +13,7 @@ * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_resist_magic(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_resist_magic(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; diff --git a/src/mind/mind-magic-resistance.h b/src/mind/mind-magic-resistance.h index 641e042ef..7e365c2b3 100644 --- a/src/mind/mind-magic-resistance.h +++ b/src/mind/mind-magic-resistance.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool set_resist_magic(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +bool set_resist_magic(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); diff --git a/src/mind/mind-mindcrafter.cpp b/src/mind/mind-mindcrafter.cpp index c3b649652..e39b3cb15 100644 --- a/src/mind/mind-mindcrafter.cpp +++ b/src/mind/mind-mindcrafter.cpp @@ -51,7 +51,7 @@ * good (Cure Light Wounds, Restore Strength, etc) or * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc). */ -bool psychometry(player_type *player_ptr) +bool psychometry(PlayerType *player_ptr) { concptr q = _("どのアイテムを調べますか?", "Meditate on which item? "); concptr s = _("調べるアイテムがありません。", "You have nothing appropriate."); @@ -129,7 +129,7 @@ bool psychometry(player_type *player_ptr) * @param spell 発動する特殊技能のID * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -bool cast_mindcrafter_spell(player_type *player_ptr, mind_mindcrafter_type spell) +bool cast_mindcrafter_spell(PlayerType *player_ptr, mind_mindcrafter_type spell) { bool b = false; int dam = 0; diff --git a/src/mind/mind-mindcrafter.h b/src/mind/mind-mindcrafter.h index 52327803a..aa7c9d451 100644 --- a/src/mind/mind-mindcrafter.h +++ b/src/mind/mind-mindcrafter.h @@ -1,7 +1,7 @@ #pragma once -struct player_type; -bool psychometry(player_type *player_ptr); +class PlayerType; +bool psychometry(PlayerType *player_ptr); enum mind_mindcrafter_type : int; -bool cast_mindcrafter_spell(player_type *player_ptr, mind_mindcrafter_type spell); +bool cast_mindcrafter_spell(PlayerType *player_ptr, mind_mindcrafter_type spell); diff --git a/src/mind/mind-mirror-master.cpp b/src/mind/mind-mirror-master.cpp index 64e3e1aa3..e943b79ec 100644 --- a/src/mind/mind-mirror-master.cpp +++ b/src/mind/mind-mirror-master.cpp @@ -46,14 +46,14 @@ /* * @brief Multishadow effects is determined by turn */ -bool check_multishadow(player_type *player_ptr) { return (player_ptr->multishadow != 0) && ((w_ptr->game_turn & 1) != 0); } +bool check_multishadow(PlayerType *player_ptr) { return (player_ptr->multishadow != 0) && ((w_ptr->game_turn & 1) != 0); } /*! * 静水 * @param player_ptr プレイヤーへの参照ポインタ * @return ペットを操っている場合を除きTRUE */ -bool mirror_concentration(player_type *player_ptr) +bool mirror_concentration(PlayerType *player_ptr) { if (total_friends) { msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention.")); @@ -82,7 +82,7 @@ bool mirror_concentration(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param explode 爆発処理を伴うならばTRUE */ -void remove_all_mirrors(player_type *player_ptr, bool explode) +void remove_all_mirrors(PlayerType *player_ptr, bool explode) { for (POSITION x = 0; x < player_ptr->current_floor_ptr->width; x++) { for (POSITION y = 0; y < player_ptr->current_floor_ptr->height; y++) { @@ -104,7 +104,7 @@ void remove_all_mirrors(player_type *player_ptr, bool explode) * @param dam ダメージ量 * @return 効果があったらTRUEを返す */ -bool binding_field(player_type *player_ptr, HIT_POINT dam) +bool binding_field(PlayerType *player_ptr, HIT_POINT dam) { POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */ int mirror_num = 0; /* 鏡の数 */ @@ -228,7 +228,7 @@ bool binding_field(player_type *player_ptr, HIT_POINT dam) * @param dam ダメージ量 * @return 効果があったらTRUEを返す */ -void seal_of_mirror(player_type *player_ptr, HIT_POINT dam) +void seal_of_mirror(PlayerType *player_ptr, HIT_POINT dam) { for (POSITION x = 0; x < player_ptr->current_floor_ptr->width; x++) { for (POSITION y = 0; y < player_ptr->current_floor_ptr->height; y++) { @@ -250,7 +250,7 @@ void seal_of_mirror(player_type *player_ptr, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 常にTRUE */ -bool confusing_light(player_type *player_ptr) +bool confusing_light(PlayerType *player_ptr) { msg_print(_("辺りを睨んだ...", "You glare at nearby monsters...")); slow_monsters(player_ptr, player_ptr->lev); @@ -265,7 +265,7 @@ bool confusing_light(player_type *player_ptr) * @brief 鏡設置処理 * @return 実際に設置が行われた場合TRUEを返す */ -bool place_mirror(player_type *player_ptr) +bool place_mirror(PlayerType *player_ptr) { if (!cave_clean_bold(player_ptr->current_floor_ptr, player_ptr->y, player_ptr->x)) { msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell.")); @@ -292,7 +292,7 @@ bool place_mirror(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return ターンを消費した場合TRUEを返す */ -bool mirror_tunnel(player_type *player_ptr) +bool mirror_tunnel(PlayerType *player_ptr) { POSITION x = 0, y = 0; if (!tgt_pt(player_ptr, &x, &y)) @@ -307,7 +307,7 @@ bool mirror_tunnel(player_type *player_ptr) /* * Set "multishadow", notice observable changes */ -bool set_multishadow(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_multishadow(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -349,7 +349,7 @@ bool set_multishadow(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_dustrobe(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_dustrobe(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -408,7 +408,7 @@ static int number_of_mirrors(floor_type *floor_ptr) * @param spell 発動する特殊技能のID * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -bool cast_mirror_spell(player_type *player_ptr, mind_mirror_master_type spell) +bool cast_mirror_spell(PlayerType *player_ptr, mind_mirror_master_type spell) { DIRECTION dir; PLAYER_LEVEL plev = player_ptr->lev; diff --git a/src/mind/mind-mirror-master.h b/src/mind/mind-mirror-master.h index 600c62f53..6b2bbdd5d 100644 --- a/src/mind/mind-mirror-master.h +++ b/src/mind/mind-mirror-master.h @@ -2,17 +2,17 @@ #include "system/angband.h" -struct player_type; -bool check_multishadow(player_type *player_ptr); -bool mirror_concentration(player_type *player_ptr); -void remove_all_mirrors(player_type *player_ptr, bool explode); -bool binding_field(player_type *player_ptr, HIT_POINT dam); -void seal_of_mirror(player_type *player_ptr, HIT_POINT dam); -bool confusing_light(player_type *player_ptr); -bool place_mirror(player_type *player_ptr); -bool mirror_tunnel(player_type *player_ptr); -bool set_multishadow(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_dustrobe(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +bool check_multishadow(PlayerType *player_ptr); +bool mirror_concentration(PlayerType *player_ptr); +void remove_all_mirrors(PlayerType *player_ptr, bool explode); +bool binding_field(PlayerType *player_ptr, HIT_POINT dam); +void seal_of_mirror(PlayerType *player_ptr, HIT_POINT dam); +bool confusing_light(PlayerType *player_ptr); +bool place_mirror(PlayerType *player_ptr); +bool mirror_tunnel(PlayerType *player_ptr); +bool set_multishadow(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_dustrobe(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); enum mind_mirror_master_type : int; -bool cast_mirror_spell(player_type *player_ptr, mind_mirror_master_type spell); +bool cast_mirror_spell(PlayerType *player_ptr, mind_mirror_master_type spell); diff --git a/src/mind/mind-monk.cpp b/src/mind/mind-monk.cpp index 36b99355b..e4fdef201 100644 --- a/src/mind/mind-monk.cpp +++ b/src/mind/mind-monk.cpp @@ -14,7 +14,7 @@ #include "util/int-char-converter.h" #include "view/display-messages.h" -static void set_stance(player_type *player_ptr, const MonkStanceType new_stance) +static void set_stance(PlayerType *player_ptr, const MonkStanceType new_stance) { set_action(player_ptr, ACTION_MONK_STANCE); PlayerClass pc(player_ptr); @@ -33,7 +33,7 @@ static void set_stance(player_type *player_ptr, const MonkStanceType new_stance) * @brief 修行僧の構え設定処理 * @return 構えを変化させたらTRUE、構え不能かキャンセルしたらFALSEを返す。 */ -bool choose_monk_stance(player_type *player_ptr) +bool choose_monk_stance(PlayerType *player_ptr) { if (cmd_limit_confused(player_ptr)) return false; diff --git a/src/mind/mind-monk.h b/src/mind/mind-monk.h index 4a1a79898..4c3b4c071 100644 --- a/src/mind/mind-monk.h +++ b/src/mind/mind-monk.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool choose_monk_stance(player_type *player_ptr); +class PlayerType; +bool choose_monk_stance(PlayerType *player_ptr); diff --git a/src/mind/mind-ninja.cpp b/src/mind/mind-ninja.cpp index 1b06f966d..a26f55116 100644 --- a/src/mind/mind-ninja.cpp +++ b/src/mind/mind-ninja.cpp @@ -68,7 +68,7 @@ * @param success 判定成功上の処理ならばTRUE * @return 作用が実際にあった場合TRUEを返す */ -bool kawarimi(player_type *player_ptr, bool success) +bool kawarimi(PlayerType *player_ptr, bool success) { auto ninja_data = PlayerClass(player_ptr).get_specific_data(); if (!ninja_data || !ninja_data->kawarimi) { @@ -124,7 +124,7 @@ bool kawarimi(player_type *player_ptr, bool success) * @param mdeath 目標モンスターが死亡したかを返す * @return 作用が実際にあった場合TRUEを返す / Return value is for checking "done" */ -bool rush_attack(player_type *player_ptr, bool *mdeath) +bool rush_attack(PlayerType *player_ptr, bool *mdeath) { if (mdeath) *mdeath = false; @@ -217,7 +217,7 @@ bool rush_attack(player_type *player_ptr, bool *mdeath) * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -void process_surprise_attack(player_type *player_ptr, player_attack_type *pa_ptr) +void process_surprise_attack(PlayerType *player_ptr, player_attack_type *pa_ptr) { monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx]; if (!has_melee_weapon(player_ptr, INVEN_MAIN_HAND + pa_ptr->hand) || player_ptr->is_icky_wield[pa_ptr->hand]) @@ -260,7 +260,7 @@ void print_surprise_attack(player_attack_type *pa_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -void calc_surprise_attack_damage(player_type *player_ptr, player_attack_type *pa_ptr) +void calc_surprise_attack_damage(PlayerType *player_ptr, player_attack_type *pa_ptr) { if (pa_ptr->backstab) { pa_ptr->attack_damage *= (3 + (player_ptr->lev / 20)); @@ -281,7 +281,7 @@ void calc_surprise_attack_damage(player_type *player_ptr, player_attack_type *pa * @param player_ptr プレイヤーへの参照ポインタ * @return 常にTRUE */ -bool hayagake(player_type *player_ptr) +bool hayagake(PlayerType *player_ptr) { PlayerEnergy energy(player_ptr); if (player_ptr->action == ACTION_HAYAGAKE) { @@ -308,7 +308,7 @@ bool hayagake(player_type *player_ptr) * @param set TRUEならば超隠密状態になる。 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_superstealth(player_type *player_ptr, bool set) +bool set_superstealth(PlayerType *player_ptr, bool set) { bool notice = false; @@ -353,7 +353,7 @@ bool set_superstealth(player_type *player_ptr, bool set) * @param spell 発動する特殊技能のID * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -bool cast_ninja_spell(player_type *player_ptr, mind_ninja_type spell) +bool cast_ninja_spell(PlayerType *player_ptr, mind_ninja_type spell) { POSITION x = 0, y = 0; DIRECTION dir; diff --git a/src/mind/mind-ninja.h b/src/mind/mind-ninja.h index 2cc4618a6..e8c8aac8f 100644 --- a/src/mind/mind-ninja.h +++ b/src/mind/mind-ninja.h @@ -1,14 +1,14 @@ #pragma once struct player_attack_type; -struct player_type; -bool kawarimi(player_type *player_ptr, bool success); -bool rush_attack(player_type *player_ptr, bool *mdeath); -void process_surprise_attack(player_type *player_ptr, player_attack_type *pa_ptr); +class PlayerType; +bool kawarimi(PlayerType *player_ptr, bool success); +bool rush_attack(PlayerType *player_ptr, bool *mdeath); +void process_surprise_attack(PlayerType *player_ptr, player_attack_type *pa_ptr); void print_surprise_attack(player_attack_type *pa_ptr); -void calc_surprise_attack_damage(player_type *player_ptr, player_attack_type *pa_ptr); -bool hayagake(player_type *player_ptr); -bool set_superstealth(player_type *player_ptr, bool set); +void calc_surprise_attack_damage(PlayerType *player_ptr, player_attack_type *pa_ptr); +bool hayagake(PlayerType *player_ptr); +bool set_superstealth(PlayerType *player_ptr, bool set); enum mind_ninja_type : int; -bool cast_ninja_spell(player_type *player_ptr, mind_ninja_type spell); +bool cast_ninja_spell(PlayerType *player_ptr, mind_ninja_type spell); diff --git a/src/mind/mind-power-getter.cpp b/src/mind/mind-power-getter.cpp index 761f087d3..fdab6138b 100644 --- a/src/mind/mind-power-getter.cpp +++ b/src/mind/mind-power-getter.cpp @@ -21,7 +21,7 @@ #include "util/enum-converter.h" #include "util/int-char-converter.h" -MindPowerGetter::MindPowerGetter(player_type *player_ptr) +MindPowerGetter::MindPowerGetter(PlayerType *player_ptr) : player_ptr(player_ptr) , menu_line(use_menu ? 1 : 0) { diff --git a/src/mind/mind-power-getter.h b/src/mind/mind-power-getter.h index 4c03e175f..a15afe8d9 100644 --- a/src/mind/mind-power-getter.h +++ b/src/mind/mind-power-getter.h @@ -5,15 +5,15 @@ struct mind_power; struct mind_type; -struct player_type; +class PlayerType; class MindPowerGetter { public: - MindPowerGetter(player_type *player_ptr); + MindPowerGetter(PlayerType *player_ptr); virtual ~MindPowerGetter() = default; bool get_mind_power(SPELL_IDX *sn, bool only_browse); private: - player_type *player_ptr; + PlayerType *player_ptr; SPELL_IDX index = 0; int num = 0; TERM_LEN y = 1; diff --git a/src/mind/mind-priest.cpp b/src/mind/mind-priest.cpp index 1832b3322..e3f071352 100644 --- a/src/mind/mind-priest.cpp +++ b/src/mind/mind-priest.cpp @@ -23,7 +23,7 @@ * Bless a weapon * @return ターン消費を要する処理を行ったならばTRUEを返す */ -bool bless_weapon(player_type *player_ptr) +bool bless_weapon(PlayerType *player_ptr) { concptr q = _("どのアイテムを祝福しますか?", "Bless which weapon? "); concptr s = _("祝福できる武器がありません。", "You have weapon to bless."); diff --git a/src/mind/mind-priest.h b/src/mind/mind-priest.h index 4d748b958..6fbfa4327 100644 --- a/src/mind/mind-priest.h +++ b/src/mind/mind-priest.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool bless_weapon(player_type *player_ptr); +class PlayerType; +bool bless_weapon(PlayerType *player_ptr); diff --git a/src/mind/mind-samurai.cpp b/src/mind/mind-samurai.cpp index 9278c0ede..8ffed6ab3 100644 --- a/src/mind/mind-samurai.cpp +++ b/src/mind/mind-samurai.cpp @@ -66,7 +66,7 @@ static samurai_slaying_type *initialize_samurai_slaying_type( * @param player_ptr プレイヤーへの参照ポインタ * @param samurai_slaying_ptr スレイ計算に必要なパラメータ群への参照ポインタ */ -static void hissatsu_burning_strike(player_type *player_ptr, samurai_slaying_type *samurai_slaying_ptr) +static void hissatsu_burning_strike(PlayerType *player_ptr, samurai_slaying_type *samurai_slaying_ptr) { if (samurai_slaying_ptr->mode != HISSATSU_FIRE) return; @@ -109,7 +109,7 @@ static void hissatsu_burning_strike(player_type *player_ptr, samurai_slaying_typ * @param player_ptr プレイヤーへの参照ポインタ * @param samurai_slaying_ptr スレイ計算に必要なパラメータ群への参照ポインタ */ -static void hissatsu_serpent_tongue(player_type *player_ptr, samurai_slaying_type *samurai_slaying_ptr) +static void hissatsu_serpent_tongue(PlayerType *player_ptr, samurai_slaying_type *samurai_slaying_ptr) { if (samurai_slaying_ptr->mode != HISSATSU_POISON) return; @@ -152,7 +152,7 @@ static void hissatsu_zanma_ken(samurai_slaying_type *samurai_slaying_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param samurai_slaying_ptr スレイ計算に必要なパラメータ群への参照ポインタ */ -static void hissatsu_rock_smash(player_type *player_ptr, samurai_slaying_type *samurai_slaying_ptr) +static void hissatsu_rock_smash(PlayerType *player_ptr, samurai_slaying_type *samurai_slaying_ptr) { if (samurai_slaying_ptr->mode != HISSATSU_HAGAN) return; @@ -173,7 +173,7 @@ static void hissatsu_rock_smash(player_type *player_ptr, samurai_slaying_type *s * @param player_ptr プレイヤーへの参照ポインタ * @param samurai_slaying_ptr スレイ計算に必要なパラメータ群への参照ポインタ */ -static void hissatsu_midare_setsugetsuka(player_type *player_ptr, samurai_slaying_type *samurai_slaying_ptr) +static void hissatsu_midare_setsugetsuka(PlayerType *player_ptr, samurai_slaying_type *samurai_slaying_ptr) { if (samurai_slaying_ptr->mode != HISSATSU_COLD) return; @@ -215,7 +215,7 @@ static void hissatsu_midare_setsugetsuka(player_type *player_ptr, samurai_slayin * @param player_ptr プレイヤーへの参照ポインタ * @param samurai_slaying_ptr スレイ計算に必要なパラメータ群への参照ポインタ */ -static void hissatsu_lightning_eagle(player_type *player_ptr, samurai_slaying_type *samurai_slaying_ptr) +static void hissatsu_lightning_eagle(PlayerType *player_ptr, samurai_slaying_type *samurai_slaying_ptr) { if (samurai_slaying_ptr->mode != HISSATSU_ELEC) return; @@ -241,7 +241,7 @@ static void hissatsu_lightning_eagle(player_type *player_ptr, samurai_slaying_ty * @param player_ptr プレイヤーへの参照ポインタ * @param samurai_slaying_ptr スレイ計算に必要なパラメータ群への参照ポインタ */ -static void hissatsu_bloody_maelstroem(player_type *player_ptr, samurai_slaying_type *samurai_slaying_ptr) +static void hissatsu_bloody_maelstroem(PlayerType *player_ptr, samurai_slaying_type *samurai_slaying_ptr) { auto player_cut = player_ptr->effects()->cut(); if ((samurai_slaying_ptr->mode == HISSATSU_SEKIRYUKA) && player_cut->is_cut() && monster_living(samurai_slaying_ptr->m_ptr->r_idx)) { @@ -256,7 +256,7 @@ static void hissatsu_bloody_maelstroem(player_type *player_ptr, samurai_slaying_ * @param player_ptr プレイヤーへの参照ポインタ * @param samurai_slaying_ptr スレイ計算に必要なパラメータ群への参照ポインタ */ -static void hissatsu_keiun_kininken(player_type *player_ptr, samurai_slaying_type *samurai_slaying_ptr) +static void hissatsu_keiun_kininken(PlayerType *player_ptr, samurai_slaying_type *samurai_slaying_ptr) { if (samurai_slaying_ptr->mode != HISSATSU_UNDEAD) return; @@ -286,7 +286,7 @@ static void hissatsu_keiun_kininken(player_type *player_ptr, samurai_slaying_typ * @param mode 剣術のスレイ型ID * @return スレイの倍率(/10倍) */ -MULTIPLY mult_hissatsu(player_type *player_ptr, MULTIPLY mult, const TrFlags &flags, monster_type *m_ptr, combat_options mode) +MULTIPLY mult_hissatsu(PlayerType *player_ptr, MULTIPLY mult, const TrFlags &flags, monster_type *m_ptr, combat_options mode) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; samurai_slaying_type tmp_slaying; @@ -306,7 +306,7 @@ MULTIPLY mult_hissatsu(player_type *player_ptr, MULTIPLY mult, const TrFlags &fl return samurai_slaying_ptr->mult; } -void concentration(player_type *player_ptr) +void concentration(PlayerType *player_ptr) { int max_csp = std::max(player_ptr->msp * 4, player_ptr->lev * 5 + 5); @@ -335,7 +335,7 @@ void concentration(player_type *player_ptr) * @brief 剣術家の型設定処理 * @return 型を変化させたらTRUE、型の構え不能かキャンセルしたらFALSEを返す。 */ -bool choose_samurai_stance(player_type *player_ptr) +bool choose_samurai_stance(PlayerType *player_ptr) { char choice; char buf[80]; @@ -415,7 +415,7 @@ bool choose_samurai_stance(player_type *player_ptr) * @param pa_ptr 直接攻撃構造体への参照ポインタ * @return 上昇後の命中率 */ -int calc_attack_quality(player_type *player_ptr, player_attack_type *pa_ptr) +int calc_attack_quality(PlayerType *player_ptr, player_attack_type *pa_ptr) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; int bonus = player_ptr->to_h[pa_ptr->hand] + o_ptr->to_h; @@ -442,7 +442,7 @@ int calc_attack_quality(player_type *player_ptr, player_attack_type *pa_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -void mineuchi(player_type *player_ptr, player_attack_type *pa_ptr) +void mineuchi(PlayerType *player_ptr, player_attack_type *pa_ptr) { if (pa_ptr->mode != HISSATSU_MINEUCHI) return; @@ -471,7 +471,7 @@ void mineuchi(player_type *player_ptr, player_attack_type *pa_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -void musou_counterattack(player_type *player_ptr, monap_type *monap_ptr) +void musou_counterattack(PlayerType *player_ptr, monap_type *monap_ptr) { if ((!player_ptr->counter && !PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU)) || !monap_ptr->alive || player_ptr->is_dead || !monap_ptr->m_ptr->ml || (player_ptr->csp <= 7)) diff --git a/src/mind/mind-samurai.h b/src/mind/mind-samurai.h index 6df4ce5d6..5117d8df4 100644 --- a/src/mind/mind-samurai.h +++ b/src/mind/mind-samurai.h @@ -8,10 +8,10 @@ typedef struct monap_type monap_type; struct monster_type; struct player_attack_type; -struct player_type; -MULTIPLY mult_hissatsu(player_type *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr, combat_options mode); -void concentration(player_type *player_ptr); -bool choose_samurai_stance(player_type* player_ptr); -int calc_attack_quality(player_type *player_ptr, player_attack_type *pa_ptr); -void mineuchi(player_type *player_ptr, player_attack_type *pa_ptr); -void musou_counterattack(player_type *player_ptr, monap_type *monap_ptr); +class PlayerType; +MULTIPLY mult_hissatsu(PlayerType *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr, combat_options mode); +void concentration(PlayerType *player_ptr); +bool choose_samurai_stance(PlayerType* player_ptr); +int calc_attack_quality(PlayerType *player_ptr, player_attack_type *pa_ptr); +void mineuchi(PlayerType *player_ptr, player_attack_type *pa_ptr); +void musou_counterattack(PlayerType *player_ptr, monap_type *monap_ptr); diff --git a/src/mind/mind-sniper.cpp b/src/mind/mind-sniper.cpp index 04910a66b..f11d8c2b2 100644 --- a/src/mind/mind-sniper.cpp +++ b/src/mind/mind-sniper.cpp @@ -130,7 +130,7 @@ static snipe_power const snipe_powers[MAX_SNIPE_POWERS] = { * @brief スナイパーの集中度加算 * @return 集中度を加算した場合は true、そうでなければ false */ -static bool snipe_concentrate(player_type *player_ptr) +static bool snipe_concentrate(PlayerType *player_ptr) { auto sniper_data = PlayerClass(player_ptr).get_specific_data(); if (!sniper_data) { @@ -153,7 +153,7 @@ static bool snipe_concentrate(player_type *player_ptr) * スナイパーではない、もしくは集中度がすでに0であればなにもしない。 * @param msg TRUEならばメッセージを表示する */ -void reset_concentration(player_type *player_ptr, bool msg) +void reset_concentration(PlayerType *player_ptr, bool msg) { auto sniper_data = PlayerClass(player_ptr).get_specific_data(); if (!sniper_data) { @@ -176,7 +176,7 @@ void reset_concentration(player_type *player_ptr, bool msg) * @param tdam 算出中のダメージ * @return 集中度修正を加えたダメージ */ -int boost_concentration_damage(player_type *player_ptr, int tdam) +int boost_concentration_damage(PlayerType *player_ptr, int tdam) { auto sniper_data = PlayerClass(player_ptr).get_specific_data(); const auto sniper_concent = sniper_data ? sniper_data->concent : 0; @@ -189,7 +189,7 @@ int boost_concentration_damage(player_type *player_ptr, int tdam) /*! * @brief スナイパーの技能リストを表示する */ -void display_snipe_list(player_type *player_ptr) +void display_snipe_list(PlayerType *player_ptr) { int i; TERM_LEN y = 1; @@ -238,7 +238,7 @@ void display_snipe_list(player_type *player_ptr) * when you run it. It's probably easy to fix but I haven't tried,\n * sorry.\n */ -static int get_snipe_power(player_type *player_ptr, COMMAND_CODE *sn, bool only_browse) +static int get_snipe_power(PlayerType *player_ptr, COMMAND_CODE *sn, bool only_browse) { COMMAND_CODE i; int num = 0; @@ -410,7 +410,7 @@ static int get_snipe_power(player_type *player_ptr, COMMAND_CODE *sn, bool only_ * @param m_ptr 目標となるモンスターの構造体参照ポインタ * @return スレイの倍率(/10倍) */ -MULTIPLY calc_snipe_damage_with_slay(player_type *player_ptr, MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type) +MULTIPLY calc_snipe_damage_with_slay(PlayerType *player_ptr, MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; bool seen = is_seen(player_ptr, m_ptr); @@ -523,7 +523,7 @@ MULTIPLY calc_snipe_damage_with_slay(player_type *player_ptr, MULTIPLY mult, mon * @param spell 発動する特殊技能のID * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ -static bool cast_sniper_spell(player_type *player_ptr, int spell) +static bool cast_sniper_spell(PlayerType *player_ptr, int spell) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_BOW]; SPELL_IDX snipe_type = SP_NONE; @@ -599,7 +599,7 @@ static bool cast_sniper_spell(player_type *player_ptr, int spell) /*! * @brief スナイパー技能コマンドのメインルーチン / */ -void do_cmd_snipe(player_type *player_ptr) +void do_cmd_snipe(PlayerType *player_ptr) { COMMAND_CODE n = 0; bool cast; @@ -626,7 +626,7 @@ void do_cmd_snipe(player_type *player_ptr) /*! * @brief スナイパー技能コマンドの表示 / */ -void do_cmd_snipe_browse(player_type *player_ptr) +void do_cmd_snipe_browse(PlayerType *player_ptr) { COMMAND_CODE n = 0; int j, line; diff --git a/src/mind/mind-sniper.h b/src/mind/mind-sniper.h index 03043363e..7ecdb608b 100644 --- a/src/mind/mind-sniper.h +++ b/src/mind/mind-sniper.h @@ -3,10 +3,10 @@ #include "system/angband.h" struct monster_type; -struct player_type; -void reset_concentration(player_type *player_ptr, bool msg); -void display_snipe_list(player_type *player_ptr); -MULTIPLY calc_snipe_damage_with_slay(player_type *player_ptr, MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type); -void do_cmd_snipe(player_type *player_ptr); -void do_cmd_snipe_browse(player_type *player_ptr); -int boost_concentration_damage(player_type *player_ptr, int tdam); +class PlayerType; +void reset_concentration(PlayerType *player_ptr, bool msg); +void display_snipe_list(PlayerType *player_ptr); +MULTIPLY calc_snipe_damage_with_slay(PlayerType *player_ptr, MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type); +void do_cmd_snipe(PlayerType *player_ptr); +void do_cmd_snipe_browse(PlayerType *player_ptr); +int boost_concentration_damage(PlayerType *player_ptr, int tdam); diff --git a/src/mind/mind-warrior-mage.cpp b/src/mind/mind-warrior-mage.cpp index ad14b5f93..33a2e744f 100644 --- a/src/mind/mind-warrior-mage.cpp +++ b/src/mind/mind-warrior-mage.cpp @@ -5,7 +5,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -bool comvert_hp_to_mp(player_type *player_ptr) +bool comvert_hp_to_mp(PlayerType *player_ptr) { int gain_sp = take_hit(player_ptr, DAMAGE_USELIFE, player_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless conversion from HP to SP")) / 5; if (!gain_sp) { @@ -24,7 +24,7 @@ bool comvert_hp_to_mp(player_type *player_ptr) return true; } -bool comvert_mp_to_hp(player_type *player_ptr) +bool comvert_mp_to_hp(PlayerType *player_ptr) { if (player_ptr->csp >= player_ptr->lev / 5) { player_ptr->csp -= player_ptr->lev / 5; diff --git a/src/mind/mind-warrior-mage.h b/src/mind/mind-warrior-mage.h index 2281542a5..840c00d72 100644 --- a/src/mind/mind-warrior-mage.h +++ b/src/mind/mind-warrior-mage.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -bool comvert_hp_to_mp(player_type *player_ptr); -bool comvert_mp_to_hp(player_type *player_ptr); +class PlayerType; +bool comvert_hp_to_mp(PlayerType *player_ptr); +bool comvert_mp_to_hp(PlayerType *player_ptr); diff --git a/src/mind/mind-warrior.cpp b/src/mind/mind-warrior.cpp index d665e7e87..1cc253f55 100644 --- a/src/mind/mind-warrior.cpp +++ b/src/mind/mind-warrior.cpp @@ -13,7 +13,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return コマンドの入力先にモンスターがいたらTRUE */ -bool hit_and_away(player_type *player_ptr) +bool hit_and_away(PlayerType *player_ptr) { DIRECTION dir; if (!get_direction(player_ptr, &dir, false, false)) @@ -39,7 +39,7 @@ bool hit_and_away(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 常にTRUE */ -bool sword_dancing(player_type *player_ptr) +bool sword_dancing(PlayerType *player_ptr) { DIRECTION dir; POSITION y = 0, x = 0; diff --git a/src/mind/mind-warrior.h b/src/mind/mind-warrior.h index 3dcdc172d..da44de89b 100644 --- a/src/mind/mind-warrior.h +++ b/src/mind/mind-warrior.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -bool hit_and_away(player_type *player_ptr); -bool sword_dancing(player_type *player_ptr); +class PlayerType; +bool hit_and_away(PlayerType *player_ptr); +bool sword_dancing(PlayerType *player_ptr); diff --git a/src/mind/mind-weaponsmith.cpp b/src/mind/mind-weaponsmith.cpp index 8894214a8..2226baf7a 100644 --- a/src/mind/mind-weaponsmith.cpp +++ b/src/mind/mind-weaponsmith.cpp @@ -50,7 +50,7 @@ static concptr const kaji_tips[5] = { /*! * @brief 所持しているエッセンス一覧を表示する */ -static void display_essence(player_type *player_ptr) +static void display_essence(PlayerType *player_ptr) { constexpr auto row_count = 21U; constexpr auto column_width = 22U; @@ -108,7 +108,7 @@ static void display_essence(player_type *player_ptr) * @brief エッセンスの抽出処理 * @param player_ptr プレイヤーへの参照ポインタ */ -static void drain_essence(player_type *player_ptr) +static void drain_essence(PlayerType *player_ptr) { auto q = _("どのアイテムから抽出しますか?", "Extract from which item? "); auto s = _("抽出できるアイテムがありません。", "You have nothing you can extract from."); @@ -294,7 +294,7 @@ static void display_smith_effect_list(const Smith &smith, const std::vectorm_ptr->r_idx]; if ((special_effect == MA_KNEE) && ((pa_ptr->attack_damage + player_ptr->to_d[pa_ptr->hand]) < pa_ptr->m_ptr->hp)) { @@ -208,7 +208,7 @@ static void process_attack_vital_spot(player_type *player_ptr, player_attack_typ * @param stun_effect 朦朧の残りターン * @param resist_stun 朦朧への抵抗値 */ -static void print_stun_effect(player_type *player_ptr, player_attack_type *pa_ptr, const int stun_effect, const int resist_stun) +static void print_stun_effect(PlayerType *player_ptr, player_attack_type *pa_ptr, const int stun_effect, const int resist_stun) { monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx]; if (stun_effect && ((pa_ptr->attack_damage + player_ptr->to_d[pa_ptr->hand]) < pa_ptr->m_ptr->hp)) { @@ -228,7 +228,7 @@ static void print_stun_effect(player_type *player_ptr, player_attack_type *pa_pt * @param pa_ptr 直接攻撃構造体への参照ポインタ * @param g_ptr グリッドへの参照ポインタ */ -void process_monk_attack(player_type *player_ptr, player_attack_type *pa_ptr) +void process_monk_attack(PlayerType *player_ptr, player_attack_type *pa_ptr) { int resist_stun = calc_stun_resistance(pa_ptr); int max_blow_selection_times = calc_max_blow_selection_times(player_ptr); @@ -246,7 +246,7 @@ void process_monk_attack(player_type *player_ptr, player_attack_type *pa_ptr) print_stun_effect(player_ptr, pa_ptr, stun_effect, resist_stun); } -bool double_attack(player_type *player_ptr) +bool double_attack(PlayerType *player_ptr) { DIRECTION dir; if (!get_rep_dir(player_ptr, &dir, false)) diff --git a/src/mind/monk-attack.h b/src/mind/monk-attack.h index 9b482dd8d..999d785b2 100644 --- a/src/mind/monk-attack.h +++ b/src/mind/monk-attack.h @@ -1,6 +1,6 @@ #pragma once struct player_attack_type; -struct player_type; -void process_monk_attack(player_type *player_ptr, player_attack_type *pa_ptr); -bool double_attack(player_type *player_ptr); +class PlayerType; +void process_monk_attack(PlayerType *player_ptr, player_attack_type *pa_ptr); +bool double_attack(PlayerType *player_ptr); diff --git a/src/monster-attack/monster-attack-lose.cpp b/src/monster-attack/monster-attack-lose.cpp index 68f2df84f..a1184bc7b 100644 --- a/src/monster-attack/monster-attack-lose.cpp +++ b/src/monster-attack/monster-attack-lose.cpp @@ -17,7 +17,7 @@ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ * @details 10% (毒の一次耐性があれば4%、二重耐性ならば1.6%)の確率で耐久が低下し、更に1/10の確率で永久低下する */ -void calc_blow_disease(player_type *player_ptr, monap_type *monap_ptr) +void calc_blow_disease(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_resist_pois(player_ptr)) monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9; @@ -48,7 +48,7 @@ void calc_blow_disease(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -void calc_blow_lose_strength(player_type *player_ptr, monap_type *monap_ptr) +void calc_blow_lose_strength(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_sustain_str(player_ptr)) monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; @@ -66,7 +66,7 @@ void calc_blow_lose_strength(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -void calc_blow_lose_intelligence(player_type *player_ptr, monap_type *monap_ptr) +void calc_blow_lose_intelligence(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_sustain_int(player_ptr)) monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; @@ -84,7 +84,7 @@ void calc_blow_lose_intelligence(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -void calc_blow_lose_wisdom(player_type *player_ptr, monap_type *monap_ptr) +void calc_blow_lose_wisdom(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_sustain_wis(player_ptr)) monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; @@ -102,7 +102,7 @@ void calc_blow_lose_wisdom(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -void calc_blow_lose_dexterity(player_type *player_ptr, monap_type *monap_ptr) +void calc_blow_lose_dexterity(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_sustain_dex(player_ptr)) monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; @@ -120,7 +120,7 @@ void calc_blow_lose_dexterity(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -void calc_blow_lose_constitution(player_type *player_ptr, monap_type *monap_ptr) +void calc_blow_lose_constitution(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_sustain_con(player_ptr)) monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; @@ -138,7 +138,7 @@ void calc_blow_lose_constitution(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -void calc_blow_lose_charisma(player_type *player_ptr, monap_type *monap_ptr) +void calc_blow_lose_charisma(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_sustain_chr(player_ptr)) monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; @@ -156,7 +156,7 @@ void calc_blow_lose_charisma(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -void calc_blow_lose_all(player_type *player_ptr, monap_type *monap_ptr) +void calc_blow_lose_all(PlayerType *player_ptr, monap_type *monap_ptr) { int damage_ratio = 100; if (has_sustain_str(player_ptr)) diff --git a/src/monster-attack/monster-attack-lose.h b/src/monster-attack/monster-attack-lose.h index a93a85d28..45c0f5f8f 100644 --- a/src/monster-attack/monster-attack-lose.h +++ b/src/monster-attack/monster-attack-lose.h @@ -1,12 +1,12 @@ #pragma once typedef struct monap_type monap_type; -struct player_type; -void calc_blow_disease(player_type *player_ptr, monap_type *monap_ptr); -void calc_blow_lose_strength(player_type *player_ptr, monap_type *monap_ptr); -void calc_blow_lose_intelligence(player_type *player_ptr, monap_type *monap_ptr); -void calc_blow_lose_wisdom(player_type *player_ptr, monap_type *monap_ptr); -void calc_blow_lose_dexterity(player_type *player_ptr, monap_type *monap_ptr); -void calc_blow_lose_constitution(player_type *player_ptr, monap_type *monap_ptr); -void calc_blow_lose_charisma(player_type *player_ptr, monap_type *monap_ptr); -void calc_blow_lose_all(player_type *player_ptr, monap_type *monap_ptr); +class PlayerType; +void calc_blow_disease(PlayerType *player_ptr, monap_type *monap_ptr); +void calc_blow_lose_strength(PlayerType *player_ptr, monap_type *monap_ptr); +void calc_blow_lose_intelligence(PlayerType *player_ptr, monap_type *monap_ptr); +void calc_blow_lose_wisdom(PlayerType *player_ptr, monap_type *monap_ptr); +void calc_blow_lose_dexterity(PlayerType *player_ptr, monap_type *monap_ptr); +void calc_blow_lose_constitution(PlayerType *player_ptr, monap_type *monap_ptr); +void calc_blow_lose_charisma(PlayerType *player_ptr, monap_type *monap_ptr); +void calc_blow_lose_all(PlayerType *player_ptr, monap_type *monap_ptr); diff --git a/src/monster-attack/monster-attack-player.cpp b/src/monster-attack/monster-attack-player.cpp index 0e1a6953a..e56b980c1 100644 --- a/src/monster-attack/monster-attack-player.cpp +++ b/src/monster-attack/monster-attack-player.cpp @@ -57,7 +57,7 @@ #include "util/bit-flags-calculator.h" #include "view/display-messages.h" -static bool check_no_blow(player_type *player_ptr, monap_type *monap_ptr) +static bool check_no_blow(PlayerType *player_ptr, monap_type *monap_ptr) { auto *r_ptr = &r_info[monap_ptr->m_ptr->r_idx]; if (any_bits(r_ptr->flags1, RF1_NEVER_BLOW)) { @@ -77,7 +77,7 @@ static bool check_no_blow(player_type *player_ptr, monap_type *monap_ptr) * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ * @return 攻撃続行ならばTRUE、打ち切りになったらFALSE */ -static bool check_monster_continuous_attack(player_type *player_ptr, monap_type *monap_ptr) +static bool check_monster_continuous_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (!monster_is_valid(monap_ptr->m_ptr) || (monap_ptr->method == RBM_NONE)) { return false; @@ -99,7 +99,7 @@ static bool check_monster_continuous_attack(player_type *player_ptr, monap_type * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ * @return briefに書いた条件+確率が満たされたらTRUE、それ以外はFALSE */ -static bool effect_protecion_from_evil(player_type *player_ptr, monap_type *monap_ptr) +static bool effect_protecion_from_evil(PlayerType *player_ptr, monap_type *monap_ptr) { auto *r_ptr = &r_info[monap_ptr->m_ptr->r_idx]; if ((player_ptr->protevil <= 0) || none_bits(r_ptr->flags3, RF3_EVIL) || (player_ptr->lev < monap_ptr->rlev) || ((randint0(100) + player_ptr->lev) <= 50)) { @@ -166,7 +166,7 @@ static void select_cut_stun(monap_type *monap_ptr) } } -static void calc_player_cut(player_type *player_ptr, monap_type *monap_ptr) +static void calc_player_cut(PlayerType *player_ptr, monap_type *monap_ptr) { if (monap_ptr->do_cut == 0) { return; @@ -180,7 +180,7 @@ static void calc_player_cut(player_type *player_ptr, monap_type *monap_ptr) /*! * @brief 能力値の実値を求める - * @param raw player_typeに格納されている生値 + * @param raw PlayerTypeに格納されている生値 * @return 実値 * @details AD&Dの記法に則り、19以上の値を取らなくしているので、格納方法が面倒 */ @@ -202,7 +202,7 @@ static int stat_value(const int raw) * 2%の確率で朦朧蓄積ランクを1上げる. * 肉体のパラメータが合計80を超える水準に強化されていたら朦朧蓄積ランクを1下げる. */ -static void process_player_stun(player_type *player_ptr, monap_type *monap_ptr) +static void process_player_stun(PlayerType *player_ptr, monap_type *monap_ptr) { if (monap_ptr->do_stun == 0) { return; @@ -236,7 +236,7 @@ static void process_player_stun(player_type *player_ptr, monap_type *monap_ptr) } } -static void monster_explode(player_type *player_ptr, monap_type *monap_ptr) +static void monster_explode(PlayerType *player_ptr, monap_type *monap_ptr) { if (!monap_ptr->explode) { return; @@ -250,7 +250,7 @@ static void monster_explode(player_type *player_ptr, monap_type *monap_ptr) } } -static void describe_attack_evasion(player_type *player_ptr, monap_type *monap_ptr) +static void describe_attack_evasion(PlayerType *player_ptr, monap_type *monap_ptr) { if (!monap_ptr->m_ptr->ml) { return; @@ -271,7 +271,7 @@ static void describe_attack_evasion(player_type *player_ptr, monap_type *monap_p #endif } -static void gain_armor_exp(player_type *player_ptr, monap_type *monap_ptr) +static void gain_armor_exp(PlayerType *player_ptr, monap_type *monap_ptr) { const auto o_ptr_mh = &player_ptr->inventory_list[INVEN_MAIN_HAND]; const auto o_ptr_sh = &player_ptr->inventory_list[INVEN_SUB_HAND]; @@ -304,7 +304,7 @@ static void gain_armor_exp(player_type *player_ptr, monap_type *monap_ptr) * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ * @details 最大4 回/モンスター/ターン、このルーチンを通る */ -static bool process_monster_attack_hit(player_type *player_ptr, monap_type *monap_ptr) +static bool process_monster_attack_hit(PlayerType *player_ptr, monap_type *monap_ptr) { disturb(player_ptr, true, true); if (effect_protecion_from_evil(player_ptr, monap_ptr)) { @@ -335,7 +335,7 @@ static bool process_monster_attack_hit(player_type *player_ptr, monap_type *mona * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void process_monster_attack_evasion(player_type *player_ptr, monap_type *monap_ptr) +static void process_monster_attack_evasion(PlayerType *player_ptr, monap_type *monap_ptr) { switch (monap_ptr->method) { case RBM_HIT: @@ -368,7 +368,7 @@ static void process_monster_attack_evasion(player_type *player_ptr, monap_type * * 非自明な類の打撃については、そのダメージが 0 ならば基本的に知識が増えない. * 但し、既に一定以上の知識があれば常に知識が増える(何をされたのか察知できる). */ -static void increase_blow_type_seen(player_type *player_ptr, monap_type *monap_ptr, const int ap_cnt) +static void increase_blow_type_seen(PlayerType *player_ptr, monap_type *monap_ptr, const int ap_cnt) { if (!is_original_ap_and_seen(player_ptr, monap_ptr->m_ptr) || monap_ptr->do_silly_attack) { return; @@ -388,7 +388,7 @@ static void increase_blow_type_seen(player_type *player_ptr, monap_type *monap_p * @brief モンスターからプレイヤーへの打撃処理本体 * @return 打撃に反応してプレイヤーがその場から離脱したかどうか */ -static bool process_monster_blows(player_type *player_ptr, monap_type *monap_ptr) +static bool process_monster_blows(PlayerType *player_ptr, monap_type *monap_ptr) { auto *r_ptr = &r_info[monap_ptr->m_ptr->r_idx]; for (auto ap_cnt = 0; ap_cnt < MAX_NUM_BLOWS; ap_cnt++) { @@ -454,7 +454,7 @@ static bool process_monster_blows(player_type *player_ptr, monap_type *monap_ptr return false; } -static void postprocess_monster_blows(player_type *player_ptr, monap_type *monap_ptr) +static void postprocess_monster_blows(PlayerType *player_ptr, monap_type *monap_ptr) { SpellHex spell_hex(player_ptr, monap_ptr); spell_hex.store_vengeful_damage(monap_ptr->get_damage); @@ -479,7 +479,7 @@ static void postprocess_monster_blows(player_type *player_ptr, monap_type *monap * @param m_idx 打撃を行うモンスターのID * @return 実際に攻撃処理を行った場合TRUEを返す */ -bool make_attack_normal(player_type *player_ptr, MONSTER_IDX m_idx) +bool make_attack_normal(PlayerType *player_ptr, MONSTER_IDX m_idx) { monap_type tmp_monap; monap_type *monap_ptr = initialize_monap_type(player_ptr, &tmp_monap, m_idx); diff --git a/src/monster-attack/monster-attack-player.h b/src/monster-attack/monster-attack-player.h index 19a1fa05c..ddfb5c26b 100644 --- a/src/monster-attack/monster-attack-player.h +++ b/src/monster-attack/monster-attack-player.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool make_attack_normal(player_type *player_ptr, MONSTER_IDX m_idx); +class PlayerType; +bool make_attack_normal(PlayerType *player_ptr, MONSTER_IDX m_idx); diff --git a/src/monster-attack/monster-attack-processor.cpp b/src/monster-attack/monster-attack-processor.cpp index 53f8e9237..56b6ba88f 100644 --- a/src/monster-attack/monster-attack-processor.cpp +++ b/src/monster-attack/monster-attack-processor.cpp @@ -33,7 +33,7 @@ * @details * 反攻撃の洞窟など、直接攻撃ができない場所では処理をスキップする */ -void exe_monster_attack_to_player(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx) +void exe_monster_attack_to_player(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -70,7 +70,7 @@ void exe_monster_attack_to_player(player_type *player_ptr, turn_flags *turn_flag * @param m_idx モンスターID * @param g_ptr グリッドへの参照ポインタ */ -static bool exe_monster_attack_to_monster(player_type *player_ptr, MONSTER_IDX m_idx, grid_type *g_ptr) +static bool exe_monster_attack_to_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, grid_type *g_ptr) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -108,7 +108,7 @@ static bool exe_monster_attack_to_monster(player_type *player_ptr, MONSTER_IDX m * @param can_cross モンスターが地形を踏破できるならばTRUE * @return ターン消費が発生したらTRUE */ -bool process_monster_attack_to_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, grid_type *g_ptr, bool can_cross) +bool process_monster_attack_to_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, grid_type *g_ptr, bool can_cross) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/monster-attack/monster-attack-processor.h b/src/monster-attack/monster-attack-processor.h index ae713dab6..c0f9a36e1 100644 --- a/src/monster-attack/monster-attack-processor.h +++ b/src/monster-attack/monster-attack-processor.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct grid_type;; -struct player_type; +class PlayerType; struct turn_flags; -void exe_monster_attack_to_player(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx); -bool process_monster_attack_to_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, grid_type *g_ptr, bool can_cross); +void exe_monster_attack_to_player(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx); +bool process_monster_attack_to_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, grid_type *g_ptr, bool can_cross); diff --git a/src/monster-attack/monster-attack-status.cpp b/src/monster-attack/monster-attack-status.cpp index 1b78f3905..1f88fa902 100644 --- a/src/monster-attack/monster-attack-status.cpp +++ b/src/monster-attack/monster-attack-status.cpp @@ -20,7 +20,7 @@ #include "timed-effect/timed-effects.h" #include "view/display-messages.h" -void process_blind_attack(player_type *player_ptr, monap_type *monap_ptr) +void process_blind_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_resist_blind(player_ptr) || check_multishadow(player_ptr)) { return; @@ -45,7 +45,7 @@ void process_blind_attack(player_type *player_ptr, monap_type *monap_ptr) monap_ptr->obvious = true; } -void process_terrify_attack(player_type *player_ptr, monap_type *monap_ptr) +void process_terrify_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (check_multishadow(player_ptr)) { return; @@ -69,7 +69,7 @@ void process_terrify_attack(player_type *player_ptr, monap_type *monap_ptr) } } -void process_paralyze_attack(player_type *player_ptr, monap_type *monap_ptr) +void process_paralyze_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (check_multishadow(player_ptr)) { return; @@ -93,7 +93,7 @@ void process_paralyze_attack(player_type *player_ptr, monap_type *monap_ptr) } } -void process_lose_all_attack(player_type *player_ptr, monap_type *monap_ptr) +void process_lose_all_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (do_dec_stat(player_ptr, A_STR)) { monap_ptr->obvious = true; @@ -120,7 +120,7 @@ void process_lose_all_attack(player_type *player_ptr, monap_type *monap_ptr) } } -void process_stun_attack(player_type *player_ptr, monap_type *monap_ptr) +void process_stun_attack(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_resist_sound(player_ptr) || check_multishadow(player_ptr)) { return; @@ -137,7 +137,7 @@ void process_stun_attack(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @monap_ptr モンスターからモンスターへの直接攻撃構造体への参照ポインタ */ -static void describe_disability(player_type *player_ptr, monap_type *monap_ptr) +static void describe_disability(PlayerType *player_ptr, monap_type *monap_ptr) { int stat = randint0(6); switch (stat) { @@ -168,7 +168,7 @@ static void describe_disability(player_type *player_ptr, monap_type *monap_ptr) } } -void process_monster_attack_time(player_type *player_ptr, monap_type *monap_ptr) +void process_monster_attack_time(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_resist_time(player_ptr) || check_multishadow(player_ptr)) { return; diff --git a/src/monster-attack/monster-attack-status.h b/src/monster-attack/monster-attack-status.h index e805c095c..5ac96d070 100644 --- a/src/monster-attack/monster-attack-status.h +++ b/src/monster-attack/monster-attack-status.h @@ -3,10 +3,10 @@ #include "system/angband.h" typedef struct monap_type monap_type; -struct player_type; -void process_blind_attack(player_type *player_ptr, monap_type *monap_ptr); -void process_terrify_attack(player_type *player_ptr, monap_type *monap_ptr); -void process_paralyze_attack(player_type *player_ptr, monap_type *monap_ptr); -void process_lose_all_attack(player_type *player_ptr, monap_type *monap_ptr); -void process_stun_attack(player_type *player_ptr, monap_type *monap_ptr); -void process_monster_attack_time(player_type *player_ptr, monap_type *monap_ptr); +class PlayerType; +void process_blind_attack(PlayerType *player_ptr, monap_type *monap_ptr); +void process_terrify_attack(PlayerType *player_ptr, monap_type *monap_ptr); +void process_paralyze_attack(PlayerType *player_ptr, monap_type *monap_ptr); +void process_lose_all_attack(PlayerType *player_ptr, monap_type *monap_ptr); +void process_stun_attack(PlayerType *player_ptr, monap_type *monap_ptr); +void process_monster_attack_time(PlayerType *player_ptr, monap_type *monap_ptr); diff --git a/src/monster-attack/monster-attack-switcher.cpp b/src/monster-attack/monster-attack-switcher.cpp index 669a54191..48a841d73 100644 --- a/src/monster-attack/monster-attack-switcher.cpp +++ b/src/monster-attack/monster-attack-switcher.cpp @@ -36,7 +36,7 @@ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ * @details 減衰の計算式がpoisではなくnukeなのは仕様 (1/3では減衰が強すぎると判断したため) */ -static void calc_blow_poison(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_poison(PlayerType *player_ptr, monap_type *monap_ptr) { if (monap_ptr->explode) return; @@ -55,7 +55,7 @@ static void calc_blow_poison(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_disenchant(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_disenchant(PlayerType *player_ptr, monap_type *monap_ptr) { if (monap_ptr->explode) return; @@ -78,7 +78,7 @@ static void calc_blow_disenchant(player_type *player_ptr, monap_type *monap_ptr) * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ * @detals 魔道具使用能力向上フラグがあれば、吸収対象のアイテムをスキャンされる回数が半分で済む */ -static void calc_blow_un_power(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_un_power(PlayerType *player_ptr, monap_type *monap_ptr) { int damage_ratio = 1000; if (has_dec_mana(player_ptr)) @@ -113,7 +113,7 @@ static void calc_blow_un_power(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_blind(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_blind(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_resist_blind(player_ptr)) monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8; @@ -131,7 +131,7 @@ static void calc_blow_blind(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_confusion(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_confusion(PlayerType *player_ptr, monap_type *monap_ptr) { if (monap_ptr->explode) { return; @@ -158,7 +158,7 @@ static void calc_blow_confusion(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_fear(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_fear(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_resist_fear(player_ptr)) monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8; @@ -176,7 +176,7 @@ static void calc_blow_fear(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_paralysis(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_paralysis(PlayerType *player_ptr, monap_type *monap_ptr) { if (has_free_act(player_ptr)) monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8; @@ -194,7 +194,7 @@ static void calc_blow_paralysis(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_drain_exp(player_type *player_ptr, monap_type *monap_ptr, const int drain_value, const int hold_exp_prob) +static void calc_blow_drain_exp(PlayerType *player_ptr, monap_type *monap_ptr, const int drain_value, const int hold_exp_prob) { int32_t d = damroll(drain_value, 6) + (player_ptr->exp / 100) * MON_DRAIN_LIFE; monap_ptr->obvious = true; @@ -218,7 +218,7 @@ static void calc_blow_drain_exp(player_type *player_ptr, monap_type *monap_ptr, * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_time(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_time(PlayerType *player_ptr, monap_type *monap_ptr) { if (monap_ptr->explode) return; @@ -235,7 +235,7 @@ static void calc_blow_time(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_drain_life(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_drain_life(PlayerType *player_ptr, monap_type *monap_ptr) { int32_t d = damroll(60, 6) + (player_ptr->exp / 100) * MON_DRAIN_LIFE; monap_ptr->obvious = true; @@ -255,7 +255,7 @@ static void calc_blow_drain_life(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -static void calc_blow_drain_mana(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_drain_mana(PlayerType *player_ptr, monap_type *monap_ptr) { monap_ptr->obvious = true; int damage_ratio = 100; @@ -273,7 +273,7 @@ static void calc_blow_drain_mana(player_type *player_ptr, monap_type *monap_ptr) update_smart_learn(player_ptr, monap_ptr->m_idx, DRS_MANA); } -static void calc_blow_inertia(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_inertia(PlayerType *player_ptr, monap_type *monap_ptr) { if ((player_ptr->fast > 0) || (player_ptr->pspeed >= 130)) monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9; @@ -289,7 +289,7 @@ static void calc_blow_inertia(player_type *player_ptr, monap_type *monap_ptr) /*! * @brief 空腹進行度を計算する (急速回復があれば+100%、遅消化があれば-50%) */ -static void calc_blow_hungry(player_type *player_ptr, monap_type *monap_ptr) +static void calc_blow_hungry(PlayerType *player_ptr, monap_type *monap_ptr) { if (player_ptr->regenerate) monap_ptr->damage = monap_ptr->damage * 2; @@ -299,7 +299,7 @@ static void calc_blow_hungry(player_type *player_ptr, monap_type *monap_ptr) process_monster_attack_hungry(player_ptr, monap_ptr); } -void switch_monster_blow_to_player(player_type *player_ptr, monap_type *monap_ptr) +void switch_monster_blow_to_player(PlayerType *player_ptr, monap_type *monap_ptr) { switch (monap_ptr->effect) { case RaceBlowEffectType::NONE: diff --git a/src/monster-attack/monster-attack-switcher.h b/src/monster-attack/monster-attack-switcher.h index e75877456..e7160b29a 100644 --- a/src/monster-attack/monster-attack-switcher.h +++ b/src/monster-attack/monster-attack-switcher.h @@ -1,5 +1,5 @@ #pragma once typedef struct monap_type monap_type; -struct player_type; -void switch_monster_blow_to_player(player_type *player_ptr, monap_type *monap_ptr); +class PlayerType; +void switch_monster_blow_to_player(PlayerType *player_ptr, monap_type *monap_ptr); diff --git a/src/monster-attack/monster-attack-util.cpp b/src/monster-attack/monster-attack-util.cpp index 856802b9e..ae6aafdee 100644 --- a/src/monster-attack/monster-attack-util.cpp +++ b/src/monster-attack/monster-attack-util.cpp @@ -9,7 +9,7 @@ #include "system/monster-type-definition.h" #include "system/player-type-definition.h" -monap_type *initialize_monap_type(player_type *player_ptr, monap_type *monap_ptr, MONSTER_IDX m_idx) +monap_type *initialize_monap_type(PlayerType *player_ptr, monap_type *monap_ptr, MONSTER_IDX m_idx) { #ifdef JP monap_ptr->abbreviate = 0; diff --git a/src/monster-attack/monster-attack-util.h b/src/monster-attack/monster-attack-util.h index 05aeb9297..1e45abf74 100644 --- a/src/monster-attack/monster-attack-util.h +++ b/src/monster-attack/monster-attack-util.h @@ -37,5 +37,5 @@ typedef struct monap_type { bool fear; } monap_type; -struct player_type; -monap_type *initialize_monap_type(player_type *player_ptr, monap_type *monap_ptr, MONSTER_IDX m_idx); +class PlayerType; +monap_type *initialize_monap_type(PlayerType *player_ptr, monap_type *monap_ptr, MONSTER_IDX m_idx); diff --git a/src/monster-attack/monster-eating.cpp b/src/monster-attack/monster-eating.cpp index 2e68556f6..6ee1ab462 100644 --- a/src/monster-attack/monster-eating.cpp +++ b/src/monster-attack/monster-eating.cpp @@ -32,7 +32,7 @@ #include "view/display-messages.h" #include "world/world-object.h" -void process_eat_gold(player_type *player_ptr, monap_type *monap_ptr) +void process_eat_gold(PlayerType *player_ptr, monap_type *monap_ptr) { if (!player_ptr->paralyzed && (randint0(100) < (adj_dex_safe[player_ptr->stat_index[A_DEX]] + player_ptr->lev))) { msg_print(_("しかし素早く財布を守った!", "You quickly protect your money pouch!")); @@ -76,7 +76,7 @@ void process_eat_gold(player_type *player_ptr, monap_type *monap_ptr) * @monap_ptr モンスターからモンスターへの直接攻撃構造体への参照ポインタ * @return 盗まれたらTRUE、何も盗まれなかったらFALSE */ -bool check_eat_item(player_type *player_ptr, monap_type *monap_ptr) +bool check_eat_item(PlayerType *player_ptr, monap_type *monap_ptr) { if (monster_confused_remaining(monap_ptr->m_ptr)) return false; @@ -99,7 +99,7 @@ bool check_eat_item(player_type *player_ptr, monap_type *monap_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @monap_ptr モンスターからモンスターへの直接攻撃構造体への参照ポインタ */ -static void move_item_to_monster(player_type *player_ptr, monap_type *monap_ptr, const OBJECT_IDX o_idx) +static void move_item_to_monster(PlayerType *player_ptr, monap_type *monap_ptr, const OBJECT_IDX o_idx) { if (o_idx == 0) return; @@ -124,7 +124,7 @@ static void move_item_to_monster(player_type *player_ptr, monap_type *monap_ptr, * @monap_ptr モンスターからモンスターへの直接攻撃構造体への参照ポインタ * @details eatとあるがお金や食べ物と違ってなくならない、盗んだモンスターを倒せば取り戻せる */ -void process_eat_item(player_type *player_ptr, monap_type *monap_ptr) +void process_eat_item(PlayerType *player_ptr, monap_type *monap_ptr) { for (int i = 0; i < 10; i++) { OBJECT_IDX o_idx; @@ -153,7 +153,7 @@ void process_eat_item(player_type *player_ptr, monap_type *monap_ptr) } } -void process_eat_food(player_type *player_ptr, monap_type *monap_ptr) +void process_eat_food(PlayerType *player_ptr, monap_type *monap_ptr) { for (int i = 0; i < 10; i++) { INVENTORY_IDX i_idx = (INVENTORY_IDX)randint0(INVEN_PACK); @@ -177,7 +177,7 @@ void process_eat_food(player_type *player_ptr, monap_type *monap_ptr) } } -void process_eat_lite(player_type *player_ptr, monap_type *monap_ptr) +void process_eat_lite(PlayerType *player_ptr, monap_type *monap_ptr) { if ((monap_ptr->o_ptr->xtra4 <= 0) || monap_ptr->o_ptr->is_fixed_artifact()) return; @@ -202,7 +202,7 @@ void process_eat_lite(player_type *player_ptr, monap_type *monap_ptr) * @details 魔道具使用能力向上フラグがあれば、吸収量は全部ではない * 詳細はOSDN #40911の議論を参照のこと */ -bool process_un_power(player_type *player_ptr, monap_type *monap_ptr) +bool process_un_power(PlayerType *player_ptr, monap_type *monap_ptr) { if (((monap_ptr->o_ptr->tval != ItemKindType::STAFF) && (monap_ptr->o_ptr->tval != ItemKindType::WAND)) || (monap_ptr->o_ptr->pval == 0)) return false; @@ -240,7 +240,7 @@ bool process_un_power(player_type *player_ptr, monap_type *monap_ptr) return true; } -bool check_drain_hp(player_type *player_ptr, const int32_t d) +bool check_drain_hp(PlayerType *player_ptr, const int32_t d) { bool resist_drain = !drain_exp(player_ptr, d, d / 10, 50); if (player_ptr->mimic_form) { @@ -261,7 +261,7 @@ bool check_drain_hp(player_type *player_ptr, const int32_t d) } } -void process_drain_life(player_type *player_ptr, monap_type *monap_ptr, const bool resist_drain) +void process_drain_life(PlayerType *player_ptr, monap_type *monap_ptr, const bool resist_drain) { if ((monap_ptr->damage <= 5) || resist_drain) return; @@ -281,7 +281,7 @@ void process_drain_life(player_type *player_ptr, monap_type *monap_ptr, const bo msg_format(_("%sは体力を回復したようだ。", "%^s appears healthier."), monap_ptr->m_name); } -void process_drain_mana(player_type *player_ptr, monap_type *monap_ptr) +void process_drain_mana(PlayerType *player_ptr, monap_type *monap_ptr) { if (check_multishadow(player_ptr)) { msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, but you are unharmed!")); @@ -304,7 +304,7 @@ void process_drain_mana(player_type *player_ptr, monap_type *monap_ptr) * @monap_ptr モンスターからモンスターへの直接攻撃構造体への参照ポインタ * @details 空腹、衰弱の一歩手前で止める優しさは残す。 */ -void process_monster_attack_hungry(player_type *player_ptr, monap_type *monap_ptr) +void process_monster_attack_hungry(PlayerType *player_ptr, monap_type *monap_ptr) { msg_format(_("あなたは腹が減った!", "You feel hungry!")); auto subtracted_food = static_cast(player_ptr->food - monap_ptr->damage); diff --git a/src/monster-attack/monster-eating.h b/src/monster-attack/monster-eating.h index 8b0d646f8..2c0f37a7e 100644 --- a/src/monster-attack/monster-eating.h +++ b/src/monster-attack/monster-eating.h @@ -3,15 +3,15 @@ #include "system/angband.h" typedef struct monap_type monap_type; -struct player_type; -void process_eat_gold(player_type *player_ptr, monap_type *monap_ptr); -bool check_eat_item(player_type *player_ptr, monap_type *monap_ptr); -void process_eat_item(player_type *player_ptr, monap_type *monap_ptr); -void process_eat_food(player_type *player_ptr, monap_type *monap_ptr); -void process_eat_lite(player_type *player_ptr, monap_type *monap_ptr); +class PlayerType; +void process_eat_gold(PlayerType *player_ptr, monap_type *monap_ptr); +bool check_eat_item(PlayerType *player_ptr, monap_type *monap_ptr); +void process_eat_item(PlayerType *player_ptr, monap_type *monap_ptr); +void process_eat_food(PlayerType *player_ptr, monap_type *monap_ptr); +void process_eat_lite(PlayerType *player_ptr, monap_type *monap_ptr); -bool process_un_power(player_type *player_ptr, monap_type *monap_ptr); -bool check_drain_hp(player_type *player_ptr, const int32_t d); -void process_drain_life(player_type *player_ptr, monap_type *monap_ptr, const bool resist_drain); -void process_drain_mana(player_type *player_ptr, monap_type *monap_ptr); -void process_monster_attack_hungry(player_type *player_ptr, monap_type *monap_ptr); +bool process_un_power(PlayerType *player_ptr, monap_type *monap_ptr); +bool check_drain_hp(PlayerType *player_ptr, const int32_t d); +void process_drain_life(PlayerType *player_ptr, monap_type *monap_ptr, const bool resist_drain); +void process_drain_mana(PlayerType *player_ptr, monap_type *monap_ptr); +void process_monster_attack_hungry(PlayerType *player_ptr, monap_type *monap_ptr); diff --git a/src/monster-floor/monster-death-util.cpp b/src/monster-floor/monster-death-util.cpp index 50f7783c7..3eaedd38c 100644 --- a/src/monster-floor/monster-death-util.cpp +++ b/src/monster-floor/monster-death-util.cpp @@ -38,7 +38,7 @@ static OBJECT_SUBTYPE_VALUE get_coin_type(MONRACE_IDX r_idx) return MON_PLAYER; } -monster_death_type *initialize_monster_death_type(player_type *player_ptr, monster_death_type *md_ptr, MONSTER_IDX m_idx, bool drop_item) +monster_death_type *initialize_monster_death_type(PlayerType *player_ptr, monster_death_type *md_ptr, MONSTER_IDX m_idx, bool drop_item) { floor_type *floor_ptr = player_ptr->current_floor_ptr; md_ptr->m_idx = m_idx; diff --git a/src/monster-floor/monster-death-util.h b/src/monster-floor/monster-death-util.h index 86e8ade59..d71c1d377 100644 --- a/src/monster-floor/monster-death-util.h +++ b/src/monster-floor/monster-death-util.h @@ -18,5 +18,5 @@ typedef struct monster_death_type { uint32_t mo_mode; } monster_death_type; -struct player_type; -monster_death_type *initialize_monster_death_type(player_type *player_ptr, monster_death_type *md_ptr, MONSTER_IDX m_idx, bool drop_item); +class PlayerType; +monster_death_type *initialize_monster_death_type(PlayerType *player_ptr, monster_death_type *md_ptr, MONSTER_IDX m_idx, bool drop_item); diff --git a/src/monster-floor/monster-death.cpp b/src/monster-floor/monster-death.cpp index 3ebf108cd..70b253236 100644 --- a/src/monster-floor/monster-death.cpp +++ b/src/monster-floor/monster-death.cpp @@ -49,7 +49,7 @@ #include "view/display-messages.h" #include "world/world.h" -static void write_pet_death(player_type *player_ptr, monster_death_type *md_ptr) +static void write_pet_death(PlayerType *player_ptr, monster_death_type *md_ptr) { md_ptr->md_y = md_ptr->m_ptr->fy; md_ptr->md_x = md_ptr->m_ptr->fx; @@ -60,7 +60,7 @@ static void write_pet_death(player_type *player_ptr, monster_death_type *md_ptr) } } -static void on_dead_explosion(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_explosion(PlayerType *player_ptr, monster_death_type *md_ptr) { for (int i = 0; i < 4; i++) { if (md_ptr->r_ptr->blow[i].method != RBM_EXPLODE) @@ -76,7 +76,7 @@ static void on_dead_explosion(player_type *player_ptr, monster_death_type *md_pt } } -static void on_defeat_arena_monster(player_type *player_ptr, monster_death_type *md_ptr) +static void on_defeat_arena_monster(PlayerType *player_ptr, monster_death_type *md_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!floor_ptr->inside_arena || is_pet(md_ptr->m_ptr)) @@ -108,7 +108,7 @@ static void on_defeat_arena_monster(player_type *player_ptr, monster_death_type exe_write_diary(player_ptr, DIARY_ARENA, player_ptr->arena_number, m_name); } -static void drop_corpse(player_type *player_ptr, monster_death_type *md_ptr) +static void drop_corpse(PlayerType *player_ptr, monster_death_type *md_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; bool is_drop_corpse = one_in_(md_ptr->r_ptr->flags1 & RF1_UNIQUE ? 1 : 4); @@ -147,7 +147,7 @@ static void drop_corpse(player_type *player_ptr, monster_death_type *md_ptr) * @param md_ptr モンスター死亡構造体への参照ポインタ * @return 何かドロップするなら1以上、何もドロップしないなら0 */ -static ARTIFACT_IDX drop_artifact_index(player_type *player_ptr, monster_death_type *md_ptr) +static ARTIFACT_IDX drop_artifact_index(PlayerType *player_ptr, monster_death_type *md_ptr) { ARTIFACT_IDX a_idx = 0; PERCENTAGE chance = 0; @@ -179,7 +179,7 @@ static ARTIFACT_IDX drop_artifact_index(player_type *player_ptr, monster_death_t * @param a_ix ドロップを試みるアーティファクトID * @return ドロップするならtrue */ -bool drop_single_artifact(player_type *player_ptr, monster_death_type *md_ptr, ARTIFACT_IDX a_idx) +bool drop_single_artifact(PlayerType *player_ptr, monster_death_type *md_ptr, ARTIFACT_IDX a_idx) { artifact_type *a_ptr = &a_info[a_idx]; if (a_ptr->cur_num == 1) @@ -201,7 +201,7 @@ bool drop_single_artifact(player_type *player_ptr, monster_death_type *md_ptr, A return false; } -static KIND_OBJECT_IDX drop_dungeon_final_artifact(player_type *player_ptr, monster_death_type *md_ptr, ARTIFACT_IDX a_idx) +static KIND_OBJECT_IDX drop_dungeon_final_artifact(PlayerType *player_ptr, monster_death_type *md_ptr, ARTIFACT_IDX a_idx) { auto k_idx = d_info[player_ptr->dungeon_idx].final_object != 0 ? d_info[player_ptr->dungeon_idx].final_object : lookup_kind(ItemKindType::SCROLL, SV_SCROLL_ACQUIREMENT); if (d_info[player_ptr->dungeon_idx].final_artifact == 0) @@ -222,7 +222,7 @@ static KIND_OBJECT_IDX drop_dungeon_final_artifact(player_type *player_ptr, mons return d_info[player_ptr->dungeon_idx].final_object ? k_idx : 0; } -static void drop_artifact(player_type *player_ptr, monster_death_type *md_ptr) +static void drop_artifact(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!md_ptr->drop_chosen_item) return; @@ -253,7 +253,7 @@ static void decide_drop_quality(monster_death_type *md_ptr) md_ptr->mo_mode |= (AM_GOOD | AM_GREAT); } -static int decide_drop_numbers(player_type *player_ptr, monster_death_type *md_ptr, const bool drop_item) +static int decide_drop_numbers(PlayerType *player_ptr, monster_death_type *md_ptr, const bool drop_item) { int drop_numbers = 0; if ((md_ptr->r_ptr->flags1 & RF1_DROP_60) && (randint0(100) < 60)) @@ -289,7 +289,7 @@ static int decide_drop_numbers(player_type *player_ptr, monster_death_type *md_p return drop_numbers; } -static void drop_items_golds(player_type *player_ptr, monster_death_type *md_ptr, int drop_numbers) +static void drop_items_golds(PlayerType *player_ptr, monster_death_type *md_ptr, int drop_numbers) { int dump_item = 0; int dump_gold = 0; @@ -324,7 +324,7 @@ static void drop_items_golds(player_type *player_ptr, monster_death_type *md_ptr * @brief 最終ボス(混沌のサーペント)を倒したときの処理 * @param player_ptr プレイヤー情報への参照ポインタ */ -static void on_defeat_last_boss(player_type *player_ptr) +static void on_defeat_last_boss(PlayerType *player_ptr) { w_ptr->total_winner = true; add_winner_class(player_ptr->pclass); @@ -345,7 +345,7 @@ static void on_defeat_last_boss(player_type *player_ptr) * @param drop_item TRUEならばモンスターのドロップ処理を行う * @param type ラストアタックの属性 (単一属性) */ -void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeType type) +void monster_death(PlayerType *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeType type) { AttributeFlags flags; flags.clear(); @@ -370,7 +370,7 @@ void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, A * it drops all of its objects, which may disappear in crowded rooms. * */ -void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeFlags attribute_flags) +void monster_death(PlayerType *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeFlags attribute_flags) { monster_death_type tmp_md; monster_death_type *md_ptr = initialize_monster_death_type(player_ptr, &tmp_md, m_idx, drop_item); diff --git a/src/monster-floor/monster-death.h b/src/monster-floor/monster-death.h index 28b7835b6..c208d86ab 100644 --- a/src/monster-floor/monster-death.h +++ b/src/monster-floor/monster-death.h @@ -4,8 +4,8 @@ #include "monster-floor/monster-death-util.h" #include "effect/attribute-types.h" -struct player_type; -void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeFlags attribute_flags); -void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeType type); -bool drop_single_artifact(player_type *player_ptr, monster_death_type *md_ptr, ARTIFACT_IDX a_idx); +class PlayerType; +void monster_death(PlayerType *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeFlags attribute_flags); +void monster_death(PlayerType *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeType type); +bool drop_single_artifact(PlayerType *player_ptr, monster_death_type *md_ptr, ARTIFACT_IDX a_idx); concptr extract_note_dies(MONRACE_IDX r_idx); diff --git a/src/monster-floor/monster-direction.cpp b/src/monster-floor/monster-direction.cpp index ad1c0ff1c..1d3fd6e2f 100644 --- a/src/monster-floor/monster-direction.cpp +++ b/src/monster-floor/monster-direction.cpp @@ -30,7 +30,7 @@ * @param plus モンスターIDの増減 (1/2 の確率で+1、1/2の確率で-1) * @return ペットがモンスターに近づくならばTRUE */ -static bool decide_pet_approch_direction(player_type *player_ptr, monster_type *m_ptr, monster_type *t_ptr) +static bool decide_pet_approch_direction(PlayerType *player_ptr, monster_type *m_ptr, monster_type *t_ptr) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!is_pet(m_ptr)) @@ -56,7 +56,7 @@ static bool decide_pet_approch_direction(player_type *player_ptr, monster_type * * @param y モンスターの移動方向Y * @param x モンスターの移動方向X */ -static void decide_enemy_approch_direction(player_type *player_ptr, MONSTER_IDX m_idx, int start, int plus, POSITION *y, POSITION *x) +static void decide_enemy_approch_direction(PlayerType *player_ptr, MONSTER_IDX m_idx, int start, int plus, POSITION *y, POSITION *x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -101,7 +101,7 @@ static void decide_enemy_approch_direction(player_type *player_ptr, MONSTER_IDX * @param mm 移動するべき方角IDを返す参照ポインタ * @return 方向が確定した場合TRUE、接近する敵がそもそもいない場合FALSEを返す */ -bool get_enemy_dir(player_type *player_ptr, MONSTER_IDX m_idx, int *mm) +bool get_enemy_dir(PlayerType *player_ptr, MONSTER_IDX m_idx, int *mm) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -145,7 +145,7 @@ bool get_enemy_dir(player_type *player_ptr, MONSTER_IDX m_idx, int *mm) * @return 不規則な方向へ歩くことになったらTRUE * @todo "5"とはもしかして「その場に留まる」という意味か? */ -static bool random_walk(player_type *player_ptr, DIRECTION *mm, monster_type *m_ptr) +static bool random_walk(PlayerType *player_ptr, DIRECTION *mm, monster_type *m_ptr) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (((r_ptr->flags1 & (RF1_RAND_50 | RF1_RAND_25)) == (RF1_RAND_50 | RF1_RAND_25)) && (randint0(100) < 75)) { @@ -219,7 +219,7 @@ static bool decide_pet_movement_direction(MonsterSweepGrid *msd) * @param aware モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE * @return 移動先が存在すればTRUE */ -bool decide_monster_movement_direction(player_type *player_ptr, DIRECTION *mm, MONSTER_IDX m_idx, bool aware) +bool decide_monster_movement_direction(PlayerType *player_ptr, DIRECTION *mm, MONSTER_IDX m_idx, bool aware) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/monster-floor/monster-direction.h b/src/monster-floor/monster-direction.h index 5ed13bdc3..b51b732d0 100644 --- a/src/monster-floor/monster-direction.h +++ b/src/monster-floor/monster-direction.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -bool get_enemy_dir(player_type *player_ptr, MONSTER_IDX m_idx, int *mm); -bool decide_monster_movement_direction(player_type *player_ptr, DIRECTION *mm, MONSTER_IDX m_idx, bool aware); +class PlayerType; +bool get_enemy_dir(PlayerType *player_ptr, MONSTER_IDX m_idx, int *mm); +bool decide_monster_movement_direction(PlayerType *player_ptr, DIRECTION *mm, MONSTER_IDX m_idx, bool aware); diff --git a/src/monster-floor/monster-generator.cpp b/src/monster-floor/monster-generator.cpp index 815858984..4d43fdfe2 100644 --- a/src/monster-floor/monster-generator.cpp +++ b/src/monster-floor/monster-generator.cpp @@ -66,7 +66,7 @@ static MONSTER_IDX place_monster_m_idx = 0; * @return 成功したらtrue * */ -bool mon_scatter(player_type *player_ptr, MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist) +bool mon_scatter(PlayerType *player_ptr, MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist) { POSITION place_x[MON_SCAT_MAXD]; POSITION place_y[MON_SCAT_MAXD]; @@ -131,7 +131,7 @@ bool mon_scatter(player_type *player_ptr, MONRACE_IDX r_idx, POSITION *yp, POSIT * @details * Note that "reproduction" REQUIRES empty space. */ -bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode) +bool multiply_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -161,7 +161,7 @@ bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BI * @param mode 生成オプション * @return 成功したらtrue */ -static bool place_monster_group(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode) +static bool place_monster_group(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode) { monster_race *r_ptr = &r_info[r_idx]; int total = randint1(10); @@ -217,7 +217,7 @@ static bool place_monster_group(player_type *player_ptr, MONSTER_IDX who, POSITI * @param r_idx チェックするモンスター種族のID * @return 護衛にできるならばtrue */ -static bool place_monster_can_escort(player_type *player_ptr, MONRACE_IDX r_idx) +static bool place_monster_can_escort(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[place_monster_idx]; monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[place_monster_m_idx]; @@ -262,7 +262,7 @@ static bool place_monster_can_escort(player_type *player_ptr, MONRACE_IDX r_idx) * @param mode 生成オプション * @return 生成に成功したらtrue */ -bool place_monster_aux(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode) +bool place_monster_aux(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode) { monster_race *r_ptr = &r_info[r_idx]; @@ -334,7 +334,7 @@ bool place_monster_aux(player_type *player_ptr, MONSTER_IDX who, POSITION y, POS * @param mode 生成オプション * @return 生成に成功したらtrue */ -bool place_monster(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode) +bool place_monster(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode) { get_mon_num_prep(player_ptr, get_monster_hook(player_ptr), get_monster_hook2(player_ptr, y, x)); MONRACE_IDX r_idx; @@ -360,7 +360,7 @@ bool place_monster(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mo * @param x 生成地点x座標 * @return 生成に成功したらtrue */ -bool alloc_horde(player_type *player_ptr, POSITION y, POSITION x, summon_specific_pf summon_specific) +bool alloc_horde(PlayerType *player_ptr, POSITION y, POSITION x, summon_specific_pf summon_specific) { get_mon_num_prep(player_ptr, get_monster_hook(player_ptr), get_monster_hook2(player_ptr, y, x)); @@ -419,7 +419,7 @@ bool alloc_horde(player_type *player_ptr, POSITION y, POSITION x, summon_specifi * @param def_val 現在の主の生成状態 * @return 生成に成功したらtrue */ -bool alloc_guardian(player_type *player_ptr, bool def_val) +bool alloc_guardian(PlayerType *player_ptr, bool def_val) { MONRACE_IDX guardian = d_info[player_ptr->dungeon_idx].final_guardian; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -462,7 +462,7 @@ bool alloc_guardian(player_type *player_ptr, bool def_val) * Use "slp" to choose the initial "sleep" status * Use "floor_ptr->monster_level" for the monster level */ -bool alloc_monster(player_type *player_ptr, POSITION dis, BIT_FLAGS mode, summon_specific_pf summon_specific) +bool alloc_monster(PlayerType *player_ptr, POSITION dis, BIT_FLAGS mode, summon_specific_pf summon_specific) { if (alloc_guardian(player_ptr, false)) return true; diff --git a/src/monster-floor/monster-generator.h b/src/monster-floor/monster-generator.h index 5832f327d..e5ccbd20e 100644 --- a/src/monster-floor/monster-generator.h +++ b/src/monster-floor/monster-generator.h @@ -3,13 +3,13 @@ #include "system/angband.h" enum summon_type : int; -struct player_type; -typedef bool (*summon_specific_pf)(player_type *, MONSTER_IDX, POSITION, POSITION, DEPTH, summon_type, BIT_FLAGS); +class PlayerType; +typedef bool (*summon_specific_pf)(PlayerType *, MONSTER_IDX, POSITION, POSITION, DEPTH, summon_type, BIT_FLAGS); -bool mon_scatter(player_type *player_ptr, MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist); -bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode); -bool place_monster_aux(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode); -bool place_monster(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode); -bool alloc_horde(player_type *player_ptr, POSITION y, POSITION x, summon_specific_pf summon_specific); -bool alloc_guardian(player_type *player_ptr, bool def_val); -bool alloc_monster(player_type *player_ptr, POSITION dis, BIT_FLAGS mode, summon_specific_pf summon_specific); +bool mon_scatter(PlayerType *player_ptr, MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist); +bool multiply_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode); +bool place_monster_aux(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode); +bool place_monster(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode); +bool alloc_horde(PlayerType *player_ptr, POSITION y, POSITION x, summon_specific_pf summon_specific); +bool alloc_guardian(PlayerType *player_ptr, bool def_val); +bool alloc_monster(PlayerType *player_ptr, POSITION dis, BIT_FLAGS mode, summon_specific_pf summon_specific); diff --git a/src/monster-floor/monster-lite.cpp b/src/monster-floor/monster-lite.cpp index df3f13704..4a2e9c806 100644 --- a/src/monster-floor/monster-lite.cpp +++ b/src/monster-floor/monster-lite.cpp @@ -30,7 +30,7 @@ * @param x X座標 */ static void update_monster_lite( - player_type *const player_ptr, std::vector &points, const POSITION y, const POSITION x, const monster_lite_type *const ml_ptr) + PlayerType *const player_ptr, std::vector &points, const POSITION y, const POSITION x, const monster_lite_type *const ml_ptr) { grid_type *g_ptr; int dpf, d; @@ -82,7 +82,7 @@ static void update_monster_lite( * Add a square to the changes array */ static void update_monster_dark( - player_type *const player_ptr, std::vector &points, const POSITION y, const POSITION x, const monster_lite_type *const ml_ptr) + PlayerType *const player_ptr, std::vector &points, const POSITION y, const POSITION x, const monster_lite_type *const ml_ptr) { grid_type *g_ptr; int midpoint, dpf, d; @@ -131,12 +131,12 @@ static void update_monster_dark( * changes are drawn via lite_spot(). * @todo player-status からのみ呼ばれている。しかしあちらは行数が酷いので要調整 */ -void update_mon_lite(player_type *player_ptr) +void update_mon_lite(PlayerType *player_ptr) { // 座標たちを記録する配列。 std::vector points; - void (*add_mon_lite)(player_type *, std::vector &, const POSITION, const POSITION, const monster_lite_type *); + void (*add_mon_lite)(PlayerType *, std::vector &, const POSITION, const POSITION, const monster_lite_type *); int dis_lim = (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS) && !player_ptr->see_nocto) ? (MAX_SIGHT / 2 + 1) : (MAX_SIGHT + 3); floor_type *floor_ptr = player_ptr->current_floor_ptr; for (int i = 0; i < floor_ptr->mon_lite_n; i++) { diff --git a/src/monster-floor/monster-lite.h b/src/monster-floor/monster-lite.h index a2cb5c732..a62a12e10 100644 --- a/src/monster-floor/monster-lite.h +++ b/src/monster-floor/monster-lite.h @@ -1,6 +1,6 @@ #pragma once struct floor_type; -struct player_type; -void update_mon_lite(player_type *player_ptr); +class PlayerType; +void update_mon_lite(PlayerType *player_ptr); void clear_mon_lite(floor_type *floor_ptr); diff --git a/src/monster-floor/monster-move.cpp b/src/monster-floor/monster-move.cpp index cccd0e372..5ba84c96d 100644 --- a/src/monster-floor/monster-move.cpp +++ b/src/monster-floor/monster-move.cpp @@ -57,7 +57,7 @@ static bool check_hp_for_feat_destruction(feature_type *f_ptr, monster_type *m_p * @param can_cross モンスターが地形を踏破できるならばTRUE * @return 透過も破壊もしなかった場合はFALSE、それ以外はTRUE */ -static bool process_wall(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx, bool can_cross) +static bool process_wall(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx, bool can_cross) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; grid_type *g_ptr; @@ -104,7 +104,7 @@ static bool process_wall(player_type *player_ptr, turn_flags *turn_flags_ptr, mo * @param nx モンスターのX座標 * @return ここではドアを開けず、ガラスのドアを開ける可能性があるならTRUE */ -static bool bash_normal_door(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) +static bool bash_normal_door(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; grid_type *g_ptr; @@ -138,7 +138,7 @@ static bool bash_normal_door(player_type *player_ptr, turn_flags *turn_flags_ptr * @param g_ptr グリッドへの参照ポインタ * @param f_ptr 地形への参照ポインタ */ -static void bash_glass_door(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, feature_type *f_ptr, bool may_bash) +static void bash_glass_door(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, feature_type *f_ptr, bool may_bash) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!may_bash || ((r_ptr->flags2 & RF2_BASH_DOOR) == 0) || f_ptr->flags.has_not(FloorFeatureType::BASH) @@ -170,7 +170,7 @@ static void bash_glass_door(player_type *player_ptr, turn_flags *turn_flags_ptr, * @param nx モンスターのX座標 * @return モンスターが死亡した場合のみFALSE */ -static bool process_door(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) +static bool process_door(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; grid_type *g_ptr; @@ -215,7 +215,7 @@ static bool process_door(player_type *player_ptr, turn_flags *turn_flags_ptr, mo * @param nx モンスターのX座標 * @return ルーンのある/なし */ -static bool process_protection_rune(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) +static bool process_protection_rune(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) { grid_type *g_ptr; g_ptr = &player_ptr->current_floor_ptr->grid_array[ny][nx]; @@ -248,7 +248,7 @@ static bool process_protection_rune(player_type *player_ptr, turn_flags *turn_fl * @param nx モンスターのX座標 * @return モンスターが死亡した場合のみFALSE */ -static bool process_explosive_rune(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) +static bool process_explosive_rune(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) { grid_type *g_ptr; g_ptr = &player_ptr->current_floor_ptr->grid_array[ny][nx]; @@ -293,7 +293,7 @@ static bool process_explosive_rune(player_type *player_ptr, turn_flags *turn_fla * @param nx モンスターのX座標 * @return モンスターが死亡した場合のみFALSE */ -static bool process_post_dig_wall(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) +static bool process_post_dig_wall(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, POSITION ny, POSITION nx) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; grid_type *g_ptr; @@ -339,7 +339,7 @@ static bool process_post_dig_wall(player_type *player_ptr, turn_flags *turn_flag * @return 移動が阻害される何か (ドア等)があったらFALSE * @todo 少し長いが、これといってブロックとしてまとまった部分もないので暫定でこのままとする */ -bool process_monster_movement(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, DIRECTION *mm, POSITION oy, POSITION ox, int *count) +bool process_monster_movement(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, DIRECTION *mm, POSITION oy, POSITION ox, int *count) { for (int i = 0; mm[i]; i++) { int d = mm[i]; @@ -450,7 +450,7 @@ bool process_monster_movement(player_type *player_ptr, turn_flags *turn_flags_pt * @param ox モンスターが元々いたX座標 * @param aware モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE */ -void process_speak_sound(player_type *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox, bool aware) +void process_speak_sound(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox, bool aware) { if (player_ptr->phase_out) return; diff --git a/src/monster-floor/monster-move.h b/src/monster-floor/monster-move.h index cefc1396a..ff49cff8c 100644 --- a/src/monster-floor/monster-move.h +++ b/src/monster-floor/monster-move.h @@ -3,9 +3,9 @@ #include "system/angband.h" struct monster_type; -struct player_type; +class PlayerType; struct turn_flags; -bool process_monster_movement(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, DIRECTION *mm, POSITION oy, POSITION ox, int *count); -void process_speak_sound(player_type *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox, bool aware); +bool process_monster_movement(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, DIRECTION *mm, POSITION oy, POSITION ox, int *count); +void process_speak_sound(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox, bool aware); void set_target(monster_type *m_ptr, POSITION y, POSITION x); void reset_target(monster_type *m_ptr); diff --git a/src/monster-floor/monster-object.cpp b/src/monster-floor/monster-object.cpp index 5f2bff855..0c483d94b 100644 --- a/src/monster-floor/monster-object.cpp +++ b/src/monster-floor/monster-object.cpp @@ -100,7 +100,7 @@ static void update_object_flags(const TrFlags &flgs, BIT_FLAGS *flg2, BIT_FLAGS * @param o_name アイテム名 * @param this_o_idx モンスターが乗ったオブジェクトID */ -static void monster_pickup_object(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, object_type *o_ptr, bool is_special_object, +static void monster_pickup_object(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, object_type *o_ptr, bool is_special_object, POSITION ny, POSITION nx, GAME_TEXT *m_name, GAME_TEXT *o_name, OBJECT_IDX this_o_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; @@ -149,7 +149,7 @@ static void monster_pickup_object(player_type *player_ptr, turn_flags *turn_flag * @param ny 移動後の、モンスターのY座標 * @param nx 移動後の、モンスターのX座標 */ -void update_object_by_monster_movement(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx) +void update_object_by_monster_movement(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -185,7 +185,7 @@ void update_object_by_monster_movement(player_type *player_ptr, turn_flags *turn * @param player_ptr プレイヤーへの参照ポインタ * @param m_ptr モンスター参照ポインタ */ -void monster_drop_carried_objects(player_type *player_ptr, monster_type *m_ptr) +void monster_drop_carried_objects(PlayerType *player_ptr, monster_type *m_ptr) { for (auto it = m_ptr->hold_o_idx_list.begin(); it != m_ptr->hold_o_idx_list.end();) { object_type forge; diff --git a/src/monster-floor/monster-object.h b/src/monster-floor/monster-object.h index 3bf5e4640..0e184896b 100644 --- a/src/monster-floor/monster-object.h +++ b/src/monster-floor/monster-object.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct monster_type; -struct player_type; +class PlayerType; struct turn_flags; -void update_object_by_monster_movement(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx); -void monster_drop_carried_objects(player_type *player_ptr, monster_type *m_ptr); +void update_object_by_monster_movement(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION ny, POSITION nx); +void monster_drop_carried_objects(PlayerType *player_ptr, monster_type *m_ptr); diff --git a/src/monster-floor/monster-remover.cpp b/src/monster-floor/monster-remover.cpp index 37453b864..d996a799d 100644 --- a/src/monster-floor/monster-remover.cpp +++ b/src/monster-floor/monster-remover.cpp @@ -26,7 +26,7 @@ * モンスターを削除するとそのモンスターが拾っていたアイテムも同時に削除される。 / * When a monster is deleted, all of its objects are deleted. */ -void delete_monster_idx(player_type *player_ptr, MONSTER_IDX i) +void delete_monster_idx(PlayerType *player_ptr, MONSTER_IDX i) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[i]; @@ -97,7 +97,7 @@ void delete_monster_idx(player_type *player_ptr, MONSTER_IDX i) * This is an efficient method of simulating multiple calls to the * "delete_monster()" function, with no visual effects. */ -void wipe_monsters_list(player_type *player_ptr) +void wipe_monsters_list(PlayerType *player_ptr) { if (!r_info[MON_BANORLUPART].max_num) { if (r_info[MON_BANOR].max_num) { @@ -153,7 +153,7 @@ void wipe_monsters_list(player_type *player_ptr) * @param x 削除位置x座標 * @param y 削除位置y座標 */ -void delete_monster(player_type *player_ptr, POSITION y, POSITION x) +void delete_monster(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr; floor_type *floor_ptr = player_ptr->current_floor_ptr; diff --git a/src/monster-floor/monster-remover.h b/src/monster-floor/monster-remover.h index d39e7a8ce..5a69da7ce 100644 --- a/src/monster-floor/monster-remover.h +++ b/src/monster-floor/monster-remover.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -void delete_monster_idx(player_type *player_ptr, MONSTER_IDX i); -void wipe_monsters_list(player_type *player_ptr); -void delete_monster(player_type *player_ptr, POSITION y, POSITION x); +class PlayerType; +void delete_monster_idx(PlayerType *player_ptr, MONSTER_IDX i); +void wipe_monsters_list(PlayerType *player_ptr); +void delete_monster(PlayerType *player_ptr, POSITION y, POSITION x); diff --git a/src/monster-floor/monster-runaway.cpp b/src/monster-floor/monster-runaway.cpp index 42a8412ed..8570fb3c1 100644 --- a/src/monster-floor/monster-runaway.cpp +++ b/src/monster-floor/monster-runaway.cpp @@ -34,7 +34,7 @@ * @param m_name モンスター名称 * @param see_m モンスターが視界内にいたらTRUE */ -static void escape_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, GAME_TEXT *m_name) +static void escape_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, GAME_TEXT *m_name) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (turn_flags_ptr->is_riding_mon) { @@ -67,7 +67,7 @@ static void escape_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, * @param see_m モンスターが視界内にいたらTRUE * @return モンスターがフロアから消えたらTRUE */ -bool runaway_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx) +bool runaway_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/monster-floor/monster-runaway.h b/src/monster-floor/monster-runaway.h index d02059796..e175cb141 100644 --- a/src/monster-floor/monster-runaway.h +++ b/src/monster-floor/monster-runaway.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; +class PlayerType; struct turn_flags; -bool runaway_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx); +bool runaway_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx); diff --git a/src/monster-floor/monster-safety-hiding.cpp b/src/monster-floor/monster-safety-hiding.cpp index debb15775..9910848ef 100644 --- a/src/monster-floor/monster-safety-hiding.cpp +++ b/src/monster-floor/monster-safety-hiding.cpp @@ -30,7 +30,7 @@ * @param d モンスターがいる地点からの距離 * @return 逃げ込める地点の候補地 */ -static coordinate_candidate sweep_safe_coordinate(player_type *player_ptr, MONSTER_IDX m_idx, const POSITION *y_offsets, const POSITION *x_offsets, int d) +static coordinate_candidate sweep_safe_coordinate(PlayerType *player_ptr, MONSTER_IDX m_idx, const POSITION *y_offsets, const POSITION *x_offsets, int d) { coordinate_candidate candidate = init_coordinate_candidate(); floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -91,7 +91,7 @@ static coordinate_candidate sweep_safe_coordinate(player_type *player_ptr, MONST *\n * Return TRUE if a safe location is available.\n */ -bool find_safety(player_type *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp) +bool find_safety(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; for (POSITION d = 1; d < 10; d++) { @@ -124,7 +124,7 @@ bool find_safety(player_type *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSIT * @param candidate 隠れられる地点の候補地 */ static void sweep_hiding_candidate( - player_type *player_ptr, monster_type *m_ptr, const POSITION *y_offsets, const POSITION *x_offsets, coordinate_candidate *candidate) + PlayerType *player_ptr, monster_type *m_ptr, const POSITION *y_offsets, const POSITION *x_offsets, coordinate_candidate *candidate) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; for (POSITION i = 0, dx = x_offsets[0], dy = y_offsets[0]; dx != 0 || dy != 0; i++, dx = x_offsets[i], dy = y_offsets[i]) { @@ -160,7 +160,7 @@ static void sweep_hiding_candidate( *\n * Return TRUE if a good location is available.\n */ -bool find_hiding(player_type *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp) +bool find_hiding(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; coordinate_candidate candidate = init_coordinate_candidate(); diff --git a/src/monster-floor/monster-safety-hiding.h b/src/monster-floor/monster-safety-hiding.h index e12f78e18..4663bc13d 100644 --- a/src/monster-floor/monster-safety-hiding.h +++ b/src/monster-floor/monster-safety-hiding.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -bool find_safety(player_type *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp); -bool find_hiding(player_type *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp); +class PlayerType; +bool find_safety(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp); +bool find_hiding(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp); diff --git a/src/monster-floor/monster-summon.cpp b/src/monster-floor/monster-summon.cpp index 5eed02bc2..590d7b101 100644 --- a/src/monster-floor/monster-summon.cpp +++ b/src/monster-floor/monster-summon.cpp @@ -40,7 +40,7 @@ bool summon_unique_okay = false; * @param r_idx チェックするモンスター種族ID * @return 召喚対象にできるならばTRUE */ -static bool summon_specific_okay(player_type *player_ptr, MONRACE_IDX r_idx) +static bool summon_specific_okay(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!mon_hook_dungeon(player_ptr, r_idx)) @@ -97,7 +97,7 @@ static bool is_dead_summoning(summon_type type) * ダンジョン及びクエストはdun_level>0となる。 * 荒野はdun_level==0なので、その場合荒野レベルを返す。 */ -DEPTH get_dungeon_or_wilderness_level(player_type *player_ptr) +DEPTH get_dungeon_or_wilderness_level(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (floor_ptr->dun_level > 0) @@ -117,7 +117,7 @@ DEPTH get_dungeon_or_wilderness_level(player_type *player_ptr) * @param mode 生成オプション * @return 召喚できたらtrueを返す */ -bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode) +bool summon_specific(PlayerType *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (floor_ptr->inside_arena) @@ -180,7 +180,7 @@ bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSI * @param mode 生成オプション * @return 召喚できたらtrueを返す */ -bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode) +bool summon_named_creature(PlayerType *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode) { if ((r_idx <= 0) || (r_idx >= static_cast(r_info.size()))) { return false; diff --git a/src/monster-floor/monster-summon.h b/src/monster-floor/monster-summon.h index 318572de9..0074fcf01 100644 --- a/src/monster-floor/monster-summon.h +++ b/src/monster-floor/monster-summon.h @@ -6,6 +6,6 @@ extern int summon_specific_who; extern bool summon_unique_okay; enum summon_type : int; -struct player_type; -bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode); -bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode); +class PlayerType; +bool summon_specific(PlayerType *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode); +bool summon_named_creature(PlayerType *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode); diff --git a/src/monster-floor/monster-sweep-grid.cpp b/src/monster-floor/monster-sweep-grid.cpp index 40edba258..4d1ea16a4 100644 --- a/src/monster-floor/monster-sweep-grid.cpp +++ b/src/monster-floor/monster-sweep-grid.cpp @@ -35,7 +35,7 @@ * @param m_idx 逃走するモンスターの参照ID * @param mm 移動方向を返す方向IDの参照ポインタ */ -MonsterSweepGrid::MonsterSweepGrid(player_type *player_ptr, MONSTER_IDX m_idx, DIRECTION *mm) +MonsterSweepGrid::MonsterSweepGrid(PlayerType *player_ptr, MONSTER_IDX m_idx, DIRECTION *mm) : player_ptr(player_ptr) , m_idx(m_idx) , mm(mm) diff --git a/src/monster-floor/monster-sweep-grid.h b/src/monster-floor/monster-sweep-grid.h index 28ce2a4e9..fc543419d 100644 --- a/src/monster-floor/monster-sweep-grid.h +++ b/src/monster-floor/monster-sweep-grid.h @@ -2,12 +2,12 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class MonsterSweepGrid { public: - MonsterSweepGrid(player_type *player_ptr, MONSTER_IDX m_idx, DIRECTION *mm); + MonsterSweepGrid(PlayerType *player_ptr, MONSTER_IDX m_idx, DIRECTION *mm); virtual ~MonsterSweepGrid() = default; - player_type *player_ptr; + PlayerType *player_ptr; MONSTER_IDX m_idx; DIRECTION *mm; bool get_movable_grid(); diff --git a/src/monster-floor/one-monster-placer.cpp b/src/monster-floor/one-monster-placer.cpp index b79cc9645..35c6ef839 100644 --- a/src/monster-floor/one-monster-placer.cpp +++ b/src/monster-floor/one-monster-placer.cpp @@ -46,7 +46,7 @@ #include "wizard/wizard-messages.h" #include "world/world.h" -static bool is_friendly_idx(player_type *player_ptr, MONSTER_IDX m_idx) +static bool is_friendly_idx(PlayerType *player_ptr, MONSTER_IDX m_idx) { return m_idx > 0 && is_friendly(&player_ptr->current_floor_ptr->m_list[(m_idx)]); } @@ -57,7 +57,7 @@ static bool is_friendly_idx(player_type *player_ptr, MONSTER_IDX m_idx) * @return 対象にできるならtrueを返す * @todo グローバル変数対策の上 monster_hook.cへ移す。 */ -static bool monster_hook_tanuki(player_type *player_ptr, MONRACE_IDX r_idx) +static bool monster_hook_tanuki(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; bool unselectable = any_bits(r_ptr->flags1, RF1_UNIQUE); @@ -80,7 +80,7 @@ static bool monster_hook_tanuki(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx モンスター種族ID * @return モンスター種族の表層ID */ -static MONRACE_IDX initial_r_appearance(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS generate_mode) +static MONRACE_IDX initial_r_appearance(PlayerType *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS generate_mode) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (is_chargeman(player_ptr) && any_bits(generate_mode, PM_JURAL) && none_bits(generate_mode, PM_MULTIPLY | PM_KAGE)) @@ -107,7 +107,7 @@ static MONRACE_IDX initial_r_appearance(player_type *player_ptr, MONRACE_IDX r_i * @param r_idx 生成モンスター種族 * @return ユニークの生成が不可能な条件ならFALSE、それ以外はTRUE */ -static bool check_unique_placeable(player_type *player_ptr, MONRACE_IDX r_idx) +static bool check_unique_placeable(PlayerType *player_ptr, MONRACE_IDX r_idx) { if (player_ptr->phase_out) return true; @@ -142,7 +142,7 @@ static bool check_unique_placeable(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 生成モンスター種族 * @return 生成が可能ならTRUE、不可能ならFALSE */ -static bool check_quest_placeable(player_type *player_ptr, MONRACE_IDX r_idx) +static bool check_quest_placeable(PlayerType *player_ptr, MONRACE_IDX r_idx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (quest_number(player_ptr, floor_ptr->dun_level) == 0) @@ -175,7 +175,7 @@ static bool check_quest_placeable(player_type *player_ptr, MONRACE_IDX r_idx) * @param x 生成位置x座標 * @return 生成が可能ならTRUE、不可能ならFALSE */ -static bool check_procection_rune(player_type *player_ptr, MONRACE_IDX r_idx, POSITION y, POSITION x) +static bool check_procection_rune(PlayerType *player_ptr, MONRACE_IDX r_idx, POSITION y, POSITION x) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; if (!g_ptr->is_rune_protection()) @@ -195,7 +195,7 @@ static bool check_procection_rune(player_type *player_ptr, MONRACE_IDX r_idx, PO return true; } -static void warn_unique_generation(player_type *player_ptr, MONRACE_IDX r_idx) +static void warn_unique_generation(PlayerType *player_ptr, MONRACE_IDX r_idx) { if (!player_ptr->warning || !w_ptr->character_dungeon) return; @@ -239,7 +239,7 @@ static void warn_unique_generation(player_type *player_ptr, MONRACE_IDX r_idx) * @param mode 生成オプション * @return 成功したらtrue */ -bool place_monster_one(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode) +bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; diff --git a/src/monster-floor/one-monster-placer.h b/src/monster-floor/one-monster-placer.h index 1f58c1ec3..6dfaa1576 100644 --- a/src/monster-floor/one-monster-placer.h +++ b/src/monster-floor/one-monster-placer.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool place_monster_one(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode); +class PlayerType; +bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode); diff --git a/src/monster-floor/quantum-effect.cpp b/src/monster-floor/quantum-effect.cpp index 3dc7b89bf..80e5556f8 100644 --- a/src/monster-floor/quantum-effect.cpp +++ b/src/monster-floor/quantum-effect.cpp @@ -25,7 +25,7 @@ * @param m_idx モンスターID * @param see_m モンスターが視界内にいたらTRUE */ -static void vanish_nonunique(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m) +static void vanish_nonunique(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; if (see_m) { @@ -52,7 +52,7 @@ static void vanish_nonunique(player_type *player_ptr, MONSTER_IDX m_idx, bool se * パターンは収縮どころか拡散しているが、この際気にしてはいけない * @todo ユニークとプレイヤーとの間でしか効果が発生しない。ユニークとその他のモンスター間では何もしなくてよい? */ -static void produce_quantum_effect(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m) +static void produce_quantum_effect(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; bool coherent = los(player_ptr, m_ptr->fy, m_ptr->fx, player_ptr->y, player_ptr->x); @@ -80,7 +80,7 @@ static void produce_quantum_effect(player_type *player_ptr, MONSTER_IDX m_idx, b * @param see_m モンスターが視界内にいたらTRUE * @return モンスターが量子的効果により消滅したらTRUE */ -bool process_quantum_effect(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m) +bool process_quantum_effect(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/monster-floor/quantum-effect.h b/src/monster-floor/quantum-effect.h index 16db4e36f..88c54e90a 100644 --- a/src/monster-floor/quantum-effect.h +++ b/src/monster-floor/quantum-effect.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool process_quantum_effect(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m); +class PlayerType; +bool process_quantum_effect(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m); diff --git a/src/monster-floor/special-death-switcher.cpp b/src/monster-floor/special-death-switcher.cpp index 0ef7b8a2a..857678e97 100644 --- a/src/monster-floor/special-death-switcher.cpp +++ b/src/monster-floor/special-death-switcher.cpp @@ -53,7 +53,7 @@ * @param radius 召喚半径 (モンスターが死亡した座標から半径何マス以内に召喚させるか) * @param message 召喚時のメッセージ */ -static void summon_self(player_type *player_ptr, monster_death_type *md_ptr, summon_type type, int probability, POSITION radius, concptr message) +static void summon_self(PlayerType *player_ptr, monster_death_type *md_ptr, summon_type type, int probability, POSITION radius, concptr message) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (floor_ptr->inside_arena || player_ptr->phase_out || one_in_(probability)) @@ -75,7 +75,7 @@ static void summon_self(player_type *player_ptr, monster_death_type *md_ptr, sum msg_print(message); } -static void on_dead_pink_horror(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_pink_horror(PlayerType *player_ptr, monster_death_type *md_ptr) { if (player_ptr->current_floor_ptr->inside_arena || player_ptr->phase_out) return; @@ -97,7 +97,7 @@ static void on_dead_pink_horror(player_type *player_ptr, monster_death_type *md_ } } -static void on_dead_bloodletter(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_bloodletter(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!md_ptr->drop_chosen_item || (randint1(100) >= 15)) return; @@ -109,7 +109,7 @@ static void on_dead_bloodletter(player_type *player_ptr, monster_death_type *md_ (void)drop_near(player_ptr, q_ptr, -1, md_ptr->md_y, md_ptr->md_x); } -static void on_dead_raal(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_raal(PlayerType *player_ptr, monster_death_type *md_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!md_ptr->drop_chosen_item || (floor_ptr->dun_level <= 9)) @@ -132,12 +132,12 @@ static void on_dead_raal(player_type *player_ptr, monster_death_type *md_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param md_ptr モンスター撃破構造体への参照ポインタ */ -static void on_dead_dawn(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_dawn(PlayerType *player_ptr, monster_death_type *md_ptr) { summon_self(player_ptr, md_ptr, SUMMON_DAWN, 7, 20, _("新たな戦士が現れた!", "A new warrior steps forth!")); } -static void on_dead_unmaker(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_unmaker(PlayerType *player_ptr, monster_death_type *md_ptr) { if (is_seen(player_ptr, md_ptr->m_ptr)) { GAME_TEXT m_name[MAX_NLEN]; @@ -148,7 +148,7 @@ static void on_dead_unmaker(player_type *player_ptr, monster_death_type *md_ptr) (void)project(player_ptr, md_ptr->m_idx, 6, md_ptr->md_y, md_ptr->md_x, 100, AttributeType::CHAOS, PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); } -static void on_dead_sacred_treasures(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_sacred_treasures(PlayerType *player_ptr, monster_death_type *md_ptr) { if ((player_ptr->ppersonality != PERSONALITY_LAZY) || !md_ptr->drop_chosen_item) return; @@ -183,7 +183,7 @@ static void on_dead_sacred_treasures(player_type *player_ptr, monster_death_type a_ptr->cur_num = 1; } -static void on_dead_serpent(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_serpent(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!md_ptr->drop_chosen_item) return; @@ -201,7 +201,7 @@ static void on_dead_serpent(player_type *player_ptr, monster_death_type *md_ptr) (void)drop_near(player_ptr, q_ptr, -1, md_ptr->md_y, md_ptr->md_x); } -static void on_dead_death_sword(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_death_sword(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!md_ptr->drop_chosen_item) return; @@ -212,7 +212,7 @@ static void on_dead_death_sword(player_type *player_ptr, monster_death_type *md_ (void)drop_near(player_ptr, q_ptr, -1, md_ptr->md_y, md_ptr->md_x); } -static void on_dead_can_angel(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_can_angel(PlayerType *player_ptr, monster_death_type *md_ptr) { bool is_drop_can = md_ptr->drop_chosen_item; bool is_silver = md_ptr->m_ptr->r_idx == MON_A_SILVER; @@ -228,7 +228,7 @@ static void on_dead_can_angel(player_type *player_ptr, monster_death_type *md_pt (void)drop_near(player_ptr, q_ptr, -1, md_ptr->md_y, md_ptr->md_x); } -static void on_dead_rolento(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_rolento(PlayerType *player_ptr, monster_death_type *md_ptr) { if (is_seen(player_ptr, md_ptr->m_ptr)) { GAME_TEXT m_name[MAX_NLEN]; @@ -239,7 +239,7 @@ static void on_dead_rolento(player_type *player_ptr, monster_death_type *md_ptr) (void)project(player_ptr, md_ptr->m_idx, 3, md_ptr->md_y, md_ptr->md_x, damroll(20, 10), AttributeType::FIRE, PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); } -static void on_dead_aqua_illusion(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_aqua_illusion(PlayerType *player_ptr, monster_death_type *md_ptr) { if (player_ptr->current_floor_ptr->inside_arena || player_ptr->phase_out) return; @@ -267,12 +267,12 @@ static void on_dead_aqua_illusion(player_type *player_ptr, monster_death_type *m * @param player_ptr プレイヤーへの参照ポインタ * @param md_ptr モンスター撃破構造体への参照ポインタ */ -static void on_dead_totem_moai(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_totem_moai(PlayerType *player_ptr, monster_death_type *md_ptr) { summon_self(player_ptr, md_ptr, SUMMON_TOTEM_MOAI, 8, 5, _("新たなモアイが現れた!", "A new moai steps forth!")); } -static void on_dead_demon_slayer_senior(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_demon_slayer_senior(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!is_seen(player_ptr, md_ptr->m_ptr)) return; @@ -282,7 +282,7 @@ static void on_dead_demon_slayer_senior(player_type *player_ptr, monster_death_t msg_format(_("あなたの闘気が%sの身体をサイコロ状に切り刻んだ!", "Your fighting spirit chopped %^s's body into dice!"), m_name); } -static void on_dead_mirmulnir(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_mirmulnir(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!is_seen(player_ptr, md_ptr->m_ptr)) return; @@ -292,7 +292,7 @@ static void on_dead_mirmulnir(player_type *player_ptr, monster_death_type *md_pt msg_format(_("%s「ドヴ@ーキン、やめろぉ!」", "%^s says, 'Dov@hkiin! No!!'"), m_name); } -static void on_dead_dragon_centipede(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_dragon_centipede(PlayerType *player_ptr, monster_death_type *md_ptr) { if (player_ptr->current_floor_ptr->inside_arena || player_ptr->phase_out) return; @@ -321,7 +321,7 @@ static void on_dead_dragon_centipede(player_type *player_ptr, monster_death_type * @brief ビッグキューちゃん撃破時メッセージ * @todo 死亡時の特殊メッセージを表示するだけの処理を複数作るなら、switch/case文に分けられるように汎用化すること */ -static void on_dead_big_raven(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_big_raven(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!is_seen(player_ptr, md_ptr->m_ptr)) return; @@ -340,7 +340,7 @@ static void on_dead_big_raven(player_type *player_ptr, monster_death_type *md_pt * @return 生成したアイテムが装備品ならtrue、それ以外ならfalse * @todo 汎用的に使えそうだがどこかにいいファイルはないか? */ -static bool make_equipment(player_type *player_ptr, object_type *q_ptr, const BIT_FLAGS drop_mode, const bool is_object_hook_null) +static bool make_equipment(PlayerType *player_ptr, object_type *q_ptr, const BIT_FLAGS drop_mode, const bool is_object_hook_null) { q_ptr->wipe(); (void)make_object(player_ptr, q_ptr, drop_mode); @@ -383,7 +383,7 @@ static bool make_equipment(player_type *player_ptr, object_type *q_ptr, const BI * 最初のアイテム生成でいきなり☆が生成された場合を除き、中途半端な☆ (例:呪われている)は生成しない. * このルーチンで★は生成されないので、★生成フラグのキャンセルも不要 */ -static void on_dead_random_artifact(player_type *player_ptr, monster_death_type *md_ptr, bool (*object_hook_pf)(KIND_OBJECT_IDX k_idx)) +static void on_dead_random_artifact(PlayerType *player_ptr, monster_death_type *md_ptr, bool (*object_hook_pf)(KIND_OBJECT_IDX k_idx)) { object_type forge; object_type *q_ptr = &forge; @@ -423,7 +423,7 @@ static void on_dead_random_artifact(player_type *player_ptr, monster_death_type * @brief マニマニのあくま撃破時メッセージ * @todo 死亡時の特殊メッセージを表示するだけの処理を複数作るなら、switch/case文に分けられるように汎用化すること */ -static void on_dead_manimani(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_manimani(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!is_seen(player_ptr, md_ptr->m_ptr)) return; @@ -431,7 +431,7 @@ static void on_dead_manimani(player_type *player_ptr, monster_death_type *md_ptr msg_print(_("どこからか声が聞こえる…「ハロー! そして…グッドバイ!」", "Heard a voice from somewhere... 'Hello! And... good bye!'")); } -static void drop_specific_item_on_dead(player_type *player_ptr, monster_death_type *md_ptr, bool (*object_hook_pf)(KIND_OBJECT_IDX k_idx)) +static void drop_specific_item_on_dead(PlayerType *player_ptr, monster_death_type *md_ptr, bool (*object_hook_pf)(KIND_OBJECT_IDX k_idx)) { object_type forge; object_type *q_ptr = &forge; @@ -441,7 +441,7 @@ static void drop_specific_item_on_dead(player_type *player_ptr, monster_death_ty (void)drop_near(player_ptr, q_ptr, -1, md_ptr->md_y, md_ptr->md_x); } -static void on_dead_chest_mimic(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_chest_mimic(PlayerType *player_ptr, monster_death_type *md_ptr) { if (player_ptr->current_floor_ptr->inside_arena || player_ptr->phase_out) return; @@ -486,7 +486,7 @@ static void on_dead_chest_mimic(player_type *player_ptr, monster_death_type *md_ } } -static void on_dead_mimics(player_type *player_ptr, monster_death_type *md_ptr) +static void on_dead_mimics(PlayerType *player_ptr, monster_death_type *md_ptr) { if (!md_ptr->drop_chosen_item) return; @@ -533,7 +533,7 @@ static void on_dead_mimics(player_type *player_ptr, monster_death_type *md_ptr) } } -static void on_dead_swordfish(player_type *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags) +static void on_dead_swordfish(PlayerType *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags) { if (attribute_flags.has_not(AttributeType::COLD) || !md_ptr->drop_chosen_item || (randint1(100) >= 10)) return; @@ -541,7 +541,7 @@ static void on_dead_swordfish(player_type *player_ptr, monster_death_type *md_pt drop_single_artifact(player_ptr, md_ptr, ART_FROZEN_SWORDFISH); } -void switch_special_death(player_type *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags) +void switch_special_death(PlayerType *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags) { switch (md_ptr->m_ptr->r_idx) { case MON_PINK_HORROR: diff --git a/src/monster-floor/special-death-switcher.h b/src/monster-floor/special-death-switcher.h index 018dc4847..ee3cd285d 100644 --- a/src/monster-floor/special-death-switcher.h +++ b/src/monster-floor/special-death-switcher.h @@ -3,5 +3,5 @@ #include "effect/attribute-types.h" typedef struct monster_death_type monster_death_type; -struct player_type; -void switch_special_death(player_type *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags); +class PlayerType; +void switch_special_death(PlayerType *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags); diff --git a/src/monster-race/monster-race-hook.cpp b/src/monster-race/monster-race-hook.cpp index 11173b548..f6db500ac 100644 --- a/src/monster-race/monster-race-hook.cpp +++ b/src/monster-race/monster-race-hook.cpp @@ -33,7 +33,7 @@ EnumClassFlagGroup vault_aux_dragon_mask4; * @brief pit/nestの基準となる単種モンスターを決める / * @param player_ptr プレイヤーへの参照ポインタ */ -void vault_prep_clone(player_type *player_ptr) +void vault_prep_clone(PlayerType *player_ptr) { get_mon_num_prep(player_ptr, vault_aux_simple, nullptr); vault_aux_race = get_mon_num(player_ptr, 0, player_ptr->current_floor_ptr->dun_level + 10, 0); @@ -44,7 +44,7 @@ void vault_prep_clone(player_type *player_ptr) * @brief pit/nestの基準となるモンスターシンボルを決める / * @param player_ptr プレイヤーへの参照ポインタ */ -void vault_prep_symbol(player_type *player_ptr) +void vault_prep_symbol(PlayerType *player_ptr) { get_mon_num_prep(player_ptr, vault_aux_simple, nullptr); MONRACE_IDX r_idx = get_mon_num(player_ptr, 0, player_ptr->current_floor_ptr->dun_level + 10, 0); @@ -56,7 +56,7 @@ void vault_prep_symbol(player_type *player_ptr) * @brief pit/nestの基準となるドラゴンの種類を決める / * @param player_ptr プレイヤーへの参照ポインタ */ -void vault_prep_dragon(player_type *player_ptr) +void vault_prep_dragon(PlayerType *player_ptr) { /* Unused */ (void)player_ptr; @@ -89,7 +89,7 @@ void vault_prep_dragon(player_type *player_ptr) * @param r_idx モンスターID * @return 討伐対象にできるならTRUEを返す。 */ -bool mon_hook_quest(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_quest(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -123,7 +123,7 @@ bool mon_hook_quest(player_type *player_ptr, MONRACE_IDX r_idx) * ダンジョンが火山の場合は、荒野の火山(WILD_VOLCANO)に出ない水棲動物(AQUATIC)は許可しない。 * */ -bool mon_hook_dungeon(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_dungeon(PlayerType *player_ptr, MONRACE_IDX r_idx) { if (!is_in_dungeon(player_ptr) && !player_ptr->current_floor_ptr->inside_quest) return true; @@ -145,7 +145,7 @@ bool mon_hook_dungeon(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 海洋に出現するならばTRUEを返す */ -bool mon_hook_ocean(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_ocean(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -159,7 +159,7 @@ bool mon_hook_ocean(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 海岸に出現するならばTRUEを返す */ -bool mon_hook_shore(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_shore(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -173,7 +173,7 @@ bool mon_hook_shore(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 荒地に出現するならばTRUEを返す */ -bool mon_hook_waste(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_waste(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -187,7 +187,7 @@ bool mon_hook_waste(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 荒地に出現するならばTRUEを返す */ -bool mon_hook_town(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_town(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -201,7 +201,7 @@ bool mon_hook_town(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 森林に出現するならばTRUEを返す */ -bool mon_hook_wood(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_wood(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -215,7 +215,7 @@ bool mon_hook_wood(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 火山に出現するならばTRUEを返す */ -bool mon_hook_volcano(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_volcano(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -229,7 +229,7 @@ bool mon_hook_volcano(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 山地に出現するならばTRUEを返す */ -bool mon_hook_mountain(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_mountain(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -243,7 +243,7 @@ bool mon_hook_mountain(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 森林に出現するならばTRUEを返す */ -bool mon_hook_grass(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_grass(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -257,7 +257,7 @@ bool mon_hook_grass(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 深い水地形に出現するならばTRUEを返す */ -bool mon_hook_deep_water(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_deep_water(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!mon_hook_dungeon(player_ptr, r_idx)) @@ -271,7 +271,7 @@ bool mon_hook_deep_water(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 浅い水地形に出現するならばTRUEを返す */ -bool mon_hook_shallow_water(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_shallow_water(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!mon_hook_dungeon(player_ptr, r_idx)) @@ -285,7 +285,7 @@ bool mon_hook_shallow_water(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 溶岩地形に出現するならばTRUEを返す */ -bool mon_hook_lava(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_lava(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!mon_hook_dungeon(player_ptr, r_idx)) @@ -299,7 +299,7 @@ bool mon_hook_lava(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定するモンスターの種族ID * @return 通常の床地形に出現するならばTRUEを返す */ -bool mon_hook_floor(player_type *player_ptr, MONRACE_IDX r_idx) +bool mon_hook_floor(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -314,7 +314,7 @@ bool mon_hook_floor(player_type *player_ptr, MONRACE_IDX r_idx) /* * Helper function for "glass room" */ -bool vault_aux_lite(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_lite(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -338,7 +338,7 @@ bool vault_aux_lite(player_type *player_ptr, MONRACE_IDX r_idx) /* * Helper function for "glass room" */ -bool vault_aux_shards(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_shards(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -356,7 +356,7 @@ bool vault_aux_shards(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return Vault生成の最低必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_simple(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_simple(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -370,7 +370,7 @@ bool vault_aux_simple(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_jelly(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_jelly(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -394,7 +394,7 @@ bool vault_aux_jelly(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_animal(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_animal(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -412,7 +412,7 @@ bool vault_aux_animal(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_undead(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_undead(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -430,7 +430,7 @@ bool vault_aux_undead(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_chapel_g(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_chapel_g(PlayerType *player_ptr, MONRACE_IDX r_idx) { static int chapel_list[] = { MON_NOV_PRIEST, MON_NOV_PALADIN, MON_NOV_PRIEST_G, MON_NOV_PALADIN_G, MON_PRIEST, MON_JADE_MONK, MON_IVORY_MONK, MON_ULTRA_PALADIN, MON_EBONY_MONK, MON_W_KNIGHT, MON_KNI_TEMPLAR, MON_PALADIN, MON_TOPAZ_MONK, 0 }; @@ -461,7 +461,7 @@ bool vault_aux_chapel_g(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_kennel(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_kennel(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -479,7 +479,7 @@ bool vault_aux_kennel(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_mimic(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_mimic(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -497,7 +497,7 @@ bool vault_aux_mimic(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_clone(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_clone(PlayerType *player_ptr, MONRACE_IDX r_idx) { if (!vault_monster_okay(player_ptr, r_idx)) return false; @@ -511,7 +511,7 @@ bool vault_aux_clone(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_symbol_e(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_symbol_e(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -535,7 +535,7 @@ bool vault_aux_symbol_e(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_symbol_g(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_symbol_g(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -559,7 +559,7 @@ bool vault_aux_symbol_g(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_orc(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_orc(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -580,7 +580,7 @@ bool vault_aux_orc(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_troll(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_troll(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -601,7 +601,7 @@ bool vault_aux_troll(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_giant(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_giant(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -625,7 +625,7 @@ bool vault_aux_giant(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_dragon(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_dragon(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -652,7 +652,7 @@ bool vault_aux_dragon(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_demon(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_demon(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -673,7 +673,7 @@ bool vault_aux_demon(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_cthulhu(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_cthulhu(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (!vault_monster_okay(player_ptr, r_idx)) @@ -694,7 +694,7 @@ bool vault_aux_cthulhu(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 確認したいモンスター種族ID * @return 生成必要条件を満たしているならTRUEを返す。 */ -bool vault_aux_dark_elf(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_aux_dark_elf(PlayerType *player_ptr, MONRACE_IDX r_idx) { static int dark_elf_list[] = { MON_D_ELF, @@ -764,7 +764,7 @@ bool no_questor_or_bounty_uniques(MONRACE_IDX r_idx) * @param r_idx モンスターID * @return 死体を食べられるならTRUEを返す。 */ -bool monster_hook_human(player_type *player_ptr, MONRACE_IDX r_idx) +bool monster_hook_human(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -784,7 +784,7 @@ bool monster_hook_human(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定対象となるモンスターのID * @return 悪夢の元凶となり得るか否か。 */ -bool get_nightmare(player_type *player_ptr, MONRACE_IDX r_idx) +bool get_nightmare(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if (none_bits(r_ptr->flags2, RF2_ELDRITCH_HORROR)) @@ -801,7 +801,7 @@ bool get_nightmare(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx 判定したいモンスター種族のID * @return 釣れる対象ならばTRUEを返す */ -bool monster_is_fishing_target(player_type *player_ptr, MONRACE_IDX r_idx) +bool monster_is_fishing_target(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -820,7 +820,7 @@ bool monster_is_fishing_target(player_type *player_ptr, MONRACE_IDX r_idx) * 自爆以外のなんらかのHP攻撃手段を持っていること。 * @return 参加できるか否か */ -bool monster_can_entry_arena(player_type *player_ptr, MONRACE_IDX r_idx) +bool monster_can_entry_arena(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -854,7 +854,7 @@ bool monster_can_entry_arena(player_type *player_ptr, MONRACE_IDX r_idx) * @param r_idx チェックしたいモンスター種族のID * @return 人形にできるならTRUEを返す */ -bool item_monster_okay(player_type *player_ptr, MONRACE_IDX r_idx) +bool item_monster_okay(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -890,7 +890,7 @@ bool item_monster_okay(player_type *player_ptr, MONRACE_IDX r_idx) * Line 2 -- forbid uniques * Line 3 -- forbid aquatic monsters */ -bool vault_monster_okay(player_type *player_ptr, MONRACE_IDX r_idx) +bool vault_monster_okay(PlayerType *player_ptr, MONRACE_IDX r_idx) { return (mon_hook_dungeon(player_ptr, r_idx) && none_bits(r_info[r_idx].flags1, RF1_UNIQUE) && none_bits(r_info[r_idx].flags7, RF7_UNIQUE2) && none_bits(r_info[r_idx].flagsr, RFR_RES_ALL) && none_bits(r_info[r_idx].flags7, RF7_AQUATIC)); diff --git a/src/monster-race/monster-race-hook.h b/src/monster-race/monster-race-hook.h index 14059e9a1..4fb52952a 100644 --- a/src/monster-race/monster-race-hook.h +++ b/src/monster-race/monster-race-hook.h @@ -9,54 +9,54 @@ extern int vault_aux_race; extern char vault_aux_char; extern EnumClassFlagGroup vault_aux_dragon_mask4; -struct player_type; -bool mon_hook_quest(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_dungeon(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_ocean(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_shore(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_waste(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_town(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_wood(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_volcano(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_wood(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_volcano(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_mountain(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_grass(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_deep_water(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_shallow_water(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_lava(player_type *player_ptr, MONRACE_IDX r_idx); -bool mon_hook_floor(player_type *player_ptr, MONRACE_IDX r_idx); - -void vault_prep_clone(player_type *player_ptr); -void vault_prep_dragon(player_type *player_ptr); -void vault_prep_symbol(player_type *player_ptr); - -bool vault_aux_lite(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_shards(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_simple(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_jelly(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_animal(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_undead(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_chapel_g(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_kennel(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_mimic(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_clone(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_symbol_e(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_symbol_g(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_orc(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_troll(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_giant(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_dragon(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_demon(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_cthulhu(player_type *player_ptr, MONRACE_IDX r_idx); -bool vault_aux_dark_elf(player_type *player_ptr, MONRACE_IDX r_idx); - -bool vault_monster_okay(player_type *player_ptr, MONRACE_IDX r_idx); +class PlayerType; +bool mon_hook_quest(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_dungeon(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_ocean(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_shore(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_waste(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_town(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_wood(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_volcano(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_wood(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_volcano(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_mountain(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_grass(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_deep_water(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_shallow_water(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_lava(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool mon_hook_floor(PlayerType *player_ptr, MONRACE_IDX r_idx); + +void vault_prep_clone(PlayerType *player_ptr); +void vault_prep_dragon(PlayerType *player_ptr); +void vault_prep_symbol(PlayerType *player_ptr); + +bool vault_aux_lite(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_shards(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_simple(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_jelly(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_animal(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_undead(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_chapel_g(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_kennel(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_mimic(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_clone(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_symbol_e(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_symbol_g(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_orc(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_troll(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_giant(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_dragon(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_demon(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_cthulhu(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool vault_aux_dark_elf(PlayerType *player_ptr, MONRACE_IDX r_idx); + +bool vault_monster_okay(PlayerType *player_ptr, MONRACE_IDX r_idx); bool monster_living(MONRACE_IDX r_idx); bool no_questor_or_bounty_uniques(MONRACE_IDX r_idx); -bool monster_hook_human(player_type *player_ptr, MONRACE_IDX r_idx); -bool get_nightmare(player_type *player_ptr, MONRACE_IDX r_idx); -bool monster_is_fishing_target(player_type *player_ptr, MONRACE_IDX r_idx); -bool monster_can_entry_arena(player_type *player_ptr, MONRACE_IDX r_idx); -bool item_monster_okay(player_type *player_ptr, MONRACE_IDX r_idx); +bool monster_hook_human(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool get_nightmare(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool monster_is_fishing_target(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool monster_can_entry_arena(PlayerType *player_ptr, MONRACE_IDX r_idx); +bool item_monster_okay(PlayerType *player_ptr, MONRACE_IDX r_idx); diff --git a/src/monster/monster-compaction.cpp b/src/monster/monster-compaction.cpp index 68cff351c..526afc9b8 100644 --- a/src/monster/monster-compaction.cpp +++ b/src/monster/monster-compaction.cpp @@ -24,7 +24,7 @@ * @param i1 配列移動元添字 * @param i2 配列移動先添字 */ -static void compact_monsters_aux(player_type *player_ptr, MONSTER_IDX i1, MONSTER_IDX i2) +static void compact_monsters_aux(PlayerType *player_ptr, MONSTER_IDX i1, MONSTER_IDX i2) { if (i1 == i2) return; @@ -92,7 +92,7 @@ static void compact_monsters_aux(player_type *player_ptr, MONSTER_IDX i1, MONSTE * After "compacting" (if needed), we "reorder" the monsters into a more * compact order, and we reset the allocation info, and the "live" array. */ -void compact_monsters(player_type *player_ptr, int size) +void compact_monsters(PlayerType *player_ptr, int size) { if (size) msg_print(_("モンスター情報を圧縮しています...", "Compacting monsters...")); diff --git a/src/monster/monster-compaction.h b/src/monster/monster-compaction.h index 5483f5ec4..1b8e0f65f 100644 --- a/src/monster/monster-compaction.h +++ b/src/monster/monster-compaction.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void compact_monsters(player_type *player_ptr, int size); +class PlayerType; +void compact_monsters(PlayerType *player_ptr, int size); diff --git a/src/monster/monster-damage.cpp b/src/monster/monster-damage.cpp index 09b921fb0..9538e2470 100644 --- a/src/monster/monster-damage.cpp +++ b/src/monster/monster-damage.cpp @@ -58,7 +58,7 @@ * @param attribute 与えたダメージの種類 (単一属性) * @param note モンスターが倒された際の特別なメッセージ述語 */ -MonsterDamageProcessor::MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeType attribute) +MonsterDamageProcessor::MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeType attribute) : player_ptr(player_ptr) , m_idx(m_idx) , dam(dam) @@ -77,7 +77,7 @@ MonsterDamageProcessor::MonsterDamageProcessor(player_type *player_ptr, MONSTER_ * @param attribute_flags 与えたダメージの種類 (複数属性) * @param note モンスターが倒された際の特別なメッセージ述語 */ -MonsterDamageProcessor::MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeFlags attribute_flags) +MonsterDamageProcessor::MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeFlags attribute_flags) : player_ptr(player_ptr) , m_idx(m_idx) , dam(dam) diff --git a/src/monster/monster-damage.h b/src/monster/monster-damage.h index 0802e02b9..c012de094 100644 --- a/src/monster/monster-damage.h +++ b/src/monster/monster-damage.h @@ -9,17 +9,17 @@ struct monster_race; struct monster_type; -struct player_type; +class PlayerType; typedef std::vector> combined_uniques; class MonsterDamageProcessor { public: - MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeType type); - MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeFlags attribute_flags); + MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeType type); + MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeFlags attribute_flags); virtual ~MonsterDamageProcessor() = default; bool mon_take_hit(concptr note); private: - player_type *player_ptr; + PlayerType *player_ptr; MONSTER_IDX m_idx; HIT_POINT dam; bool *fear; diff --git a/src/monster/monster-describer.cpp b/src/monster/monster-describer.cpp index 82c5c01db..f69b50cbd 100644 --- a/src/monster/monster-describer.cpp +++ b/src/monster/monster-describer.cpp @@ -20,7 +20,7 @@ * @param m_ptr モンスターの参照ポインタ * @param mode 呼称オプション */ -void monster_desc(player_type *player_ptr, char *desc, monster_type *m_ptr, BIT_FLAGS mode) +void monster_desc(PlayerType *player_ptr, char *desc, monster_type *m_ptr, BIT_FLAGS mode) { monster_race *r_ptr; r_ptr = &r_info[m_ptr->ap_r_idx]; @@ -247,7 +247,7 @@ void monster_desc(player_type *player_ptr, char *desc, monster_type *m_ptr, BIT_ * @details * Technically should attempt to treat "Beholder"'s as jelly's */ -void message_pain(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam) +void message_pain(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/monster/monster-describer.h b/src/monster/monster-describer.h index ad7c8cc74..299373b8e 100644 --- a/src/monster/monster-describer.h +++ b/src/monster/monster-describer.h @@ -3,6 +3,6 @@ #include "system/angband.h" struct monster_type; -struct player_type; -void monster_desc(player_type *player_ptr, char *desc, monster_type *m_ptr, BIT_FLAGS mode); -void message_pain(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam); +class PlayerType; +void monster_desc(PlayerType *player_ptr, char *desc, monster_type *m_ptr, BIT_FLAGS mode); +void message_pain(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam); diff --git a/src/monster/monster-info.cpp b/src/monster/monster-info.cpp index 55318ad01..392a318c4 100644 --- a/src/monster/monster-info.cpp +++ b/src/monster/monster-info.cpp @@ -49,7 +49,7 @@ void set_friendly(monster_type *m_ptr) { m_ptr->mflag2.set(MonsterConstantFlagTy * @param mode オプション * @return 踏破可能ならばTRUEを返す */ -bool monster_can_cross_terrain(player_type *player_ptr, FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode) +bool monster_can_cross_terrain(PlayerType *player_ptr, FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode) { feature_type *f_ptr = &f_info[feat]; @@ -126,7 +126,7 @@ bool monster_can_cross_terrain(player_type *player_ptr, FEAT_IDX feat, monster_r * @param mode オプション * @return 踏破可能ならばTRUEを返す */ -bool monster_can_enter(player_type *player_ptr, POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode) +bool monster_can_enter(PlayerType *player_ptr, POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; if (player_bold(player_ptr, y, x)) @@ -161,7 +161,7 @@ static bool check_hostile_align(byte sub_align1, byte sub_align2) * @param n_ptr モンスター2の構造体参照ポインタ * @return 敵対関係にあるならばTRUEを返す */ -bool are_enemies(player_type *player_ptr, monster_type *m_ptr, monster_type *n_ptr) +bool are_enemies(PlayerType *player_ptr, monster_type *m_ptr, monster_type *n_ptr) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; monster_race *s_ptr = &r_info[n_ptr->r_idx]; @@ -201,7 +201,7 @@ bool are_enemies(player_type *player_ptr, monster_type *m_ptr, monster_type *n_p * @details * If user is player, m_ptr == nullptr. */ -bool monster_has_hostile_align(player_type *player_ptr, monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr) +bool monster_has_hostile_align(PlayerType *player_ptr, monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr) { byte sub_align1 = SUB_ALIGN_NEUTRAL; byte sub_align2 = SUB_ALIGN_NEUTRAL; @@ -229,7 +229,7 @@ bool monster_has_hostile_align(player_type *player_ptr, monster_type *m_ptr, int return false; } -bool is_original_ap_and_seen(player_type *player_ptr, monster_type *m_ptr) { return m_ptr->ml && !player_ptr->hallucinated && (m_ptr->ap_r_idx == m_ptr->r_idx); } +bool is_original_ap_and_seen(PlayerType *player_ptr, monster_type *m_ptr) { return m_ptr->ml && !player_ptr->hallucinated && (m_ptr->ap_r_idx == m_ptr->r_idx); } /* Determine monster race appearance index is same as race index */ bool is_original_ap(monster_type *m_ptr) { return m_ptr->ap_r_idx == m_ptr->r_idx; } @@ -297,7 +297,7 @@ MONRACE_IDX real_r_idx(monster_type *m_ptr) * @param m_idx モンスターID * @param m_name モンスター名を入力する配列 */ -void monster_name(player_type *player_ptr, MONSTER_IDX m_idx, char *m_name) +void monster_name(PlayerType *player_ptr, MONSTER_IDX m_idx, char *m_name) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_desc(player_ptr, m_name, m_ptr, 0x00); diff --git a/src/monster/monster-info.h b/src/monster/monster-info.h index 25a317acb..3f7087f81 100644 --- a/src/monster/monster-info.h +++ b/src/monster/monster-info.h @@ -9,12 +9,12 @@ #define CEM_P_CAN_ENTER_PATTERN 0x0002 struct monster_race; struct monster_type; -struct player_type; -bool monster_can_cross_terrain(player_type *player_ptr, FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode); -bool monster_can_enter(player_type *player_ptr, POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode); -bool are_enemies(player_type *player_ptr, monster_type *m_ptr1, monster_type *m_ptr2); -bool monster_has_hostile_align(player_type *player_ptr, monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr); -bool is_original_ap_and_seen(player_type *player_ptr, monster_type *m_ptr); +class PlayerType; +bool monster_can_cross_terrain(PlayerType *player_ptr, FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode); +bool monster_can_enter(PlayerType *player_ptr, POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode); +bool are_enemies(PlayerType *player_ptr, monster_type *m_ptr1, monster_type *m_ptr2); +bool monster_has_hostile_align(PlayerType *player_ptr, monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr); +bool is_original_ap_and_seen(PlayerType *player_ptr, monster_type *m_ptr); bool is_friendly(monster_type *m_ptr); bool is_pet(monster_type *m_ptr); @@ -24,4 +24,4 @@ bool is_mimicry(monster_type *m_ptr); monster_race *real_r_ptr(monster_type *m_ptr); MONRACE_IDX real_r_idx(monster_type *m_ptr); -void monster_name(player_type *player_ptr, MONSTER_IDX m_idx, char *m_name); +void monster_name(PlayerType *player_ptr, MONSTER_IDX m_idx, char *m_name); diff --git a/src/monster/monster-list.cpp b/src/monster/monster-list.cpp index f4c7eb5a7..74928a9e4 100644 --- a/src/monster/monster-list.cpp +++ b/src/monster/monster-list.cpp @@ -86,7 +86,7 @@ MONSTER_IDX m_pop(floor_type *floor_ptr) * @param max_level 最大生成階 * @return 選択されたモンスター生成種族 */ -MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS option) +MONRACE_IDX get_mon_num(PlayerType *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS option) { int r_idx; monster_race *r_ptr; @@ -195,7 +195,7 @@ MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH min_level, DEPTH max_leve * @param r_idx モンスター種族ID * @return 対象にできるならtrueを返す */ -static bool monster_hook_chameleon_lord(player_type *player_ptr, MONRACE_IDX r_idx) +static bool monster_hook_chameleon_lord(PlayerType *player_ptr, MONRACE_IDX r_idx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_race *r_ptr = &r_info[r_idx]; @@ -234,7 +234,7 @@ static bool monster_hook_chameleon_lord(player_type *player_ptr, MONRACE_IDX r_i * @return 対象にできるならtrueを返す * @todo グローバル変数対策の上 monster_hook.cへ移す。 */ -static bool monster_hook_chameleon(player_type *player_ptr, MONRACE_IDX r_idx) +static bool monster_hook_chameleon(PlayerType *player_ptr, MONRACE_IDX r_idx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_race *r_ptr = &r_info[r_idx]; @@ -277,7 +277,7 @@ static bool monster_hook_chameleon(player_type *player_ptr, MONRACE_IDX r_idx) * @param born 生成時の初変身先指定ならばtrue * @param r_idx 旧モンスター種族のID */ -void choose_new_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx) +void choose_new_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; diff --git a/src/monster/monster-list.h b/src/monster/monster-list.h index bc5b089bf..0995cff72 100644 --- a/src/monster/monster-list.h +++ b/src/monster/monster-list.h @@ -6,10 +6,10 @@ struct floor_type; struct monster_race; -struct player_type; +class PlayerType; MONSTER_IDX m_pop(floor_type *floor_ptr); -MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS option); -void choose_new_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx); +MONRACE_IDX get_mon_num(PlayerType *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS option); +void choose_new_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx); SPEED get_mspeed(floor_type *player_ptr, monster_race *r_ptr); int get_monster_crowd_number(floor_type *floor_ptr, MONSTER_IDX m_idx); diff --git a/src/monster/monster-processor-util.cpp b/src/monster/monster-processor-util.cpp index 2a5503be8..6d2bae87e 100644 --- a/src/monster/monster-processor-util.cpp +++ b/src/monster/monster-processor-util.cpp @@ -3,7 +3,7 @@ * @date 2020/03/07 * @author Hourier * @details - * 概ね、player_type 構造体が引数でない場合はここへ移動させることを検討しても良い + * 概ね、PlayerType 構造体が引数でない場合はここへ移動させることを検討しても良い * 引数に入っていたらここには移動させないこと */ diff --git a/src/monster/monster-processor.cpp b/src/monster/monster-processor.cpp index 87525cead..8d3796a9a 100644 --- a/src/monster/monster-processor.cpp +++ b/src/monster/monster-processor.cpp @@ -68,20 +68,20 @@ #include "target/projection-path-calculator.h" #include "view/display-messages.h" -void decide_drop_from_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool is_riding_mon); -bool process_stealth(player_type *player_ptr, MONSTER_IDX m_idx); -bool vanish_summoned_children(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m); -bool awake_monster(player_type *player_ptr, MONSTER_IDX m_idx); -void process_angar(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m); -bool explode_grenade(player_type *player_ptr, MONSTER_IDX m_idx); -bool decide_monster_multiplication(player_type *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox); -void process_special(player_type *player_ptr, MONSTER_IDX m_idx); -bool cast_spell(player_type *player_ptr, MONSTER_IDX m_idx, bool aware); +void decide_drop_from_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool is_riding_mon); +bool process_stealth(PlayerType *player_ptr, MONSTER_IDX m_idx); +bool vanish_summoned_children(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m); +bool awake_monster(PlayerType *player_ptr, MONSTER_IDX m_idx); +void process_angar(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m); +bool explode_grenade(PlayerType *player_ptr, MONSTER_IDX m_idx); +bool decide_monster_multiplication(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox); +void process_special(PlayerType *player_ptr, MONSTER_IDX m_idx); +bool cast_spell(PlayerType *player_ptr, MONSTER_IDX m_idx, bool aware); -bool process_monster_fear(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx); +bool process_monster_fear(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx); -void sweep_monster_process(player_type *player_ptr); -bool decide_process_continue(player_type *player_ptr, monster_type *m_ptr); +void sweep_monster_process(PlayerType *player_ptr); +bool decide_process_continue(PlayerType *player_ptr, monster_type *m_ptr); /*! * @brief モンスター単体の1ターン行動処理メインルーチン / @@ -112,7 +112,7 @@ bool decide_process_continue(player_type *player_ptr, monster_type *m_ptr); *\n * A "direction" of "5" means "pick a random direction".\n */ -void process_monster(player_type *player_ptr, MONSTER_IDX m_idx) +void process_monster(PlayerType *player_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -190,7 +190,7 @@ void process_monster(player_type *player_ptr, MONSTER_IDX m_idx) * @param m_idx モンスターID * @return モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE */ -bool process_stealth(player_type *player_ptr, MONSTER_IDX m_idx) +bool process_stealth(PlayerType *player_ptr, MONSTER_IDX m_idx) { auto ninja_data = PlayerClass(player_ptr).get_specific_data(); if (!ninja_data || !ninja_data->s_stealth) @@ -217,7 +217,7 @@ bool process_stealth(player_type *player_ptr, MONSTER_IDX m_idx) * @param m_idx モンスターID * @param is_riding_mon 騎乗中であればTRUE */ -void decide_drop_from_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool is_riding_mon) +void decide_drop_from_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool is_riding_mon) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -242,7 +242,7 @@ void decide_drop_from_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool i * @param see_m モンスターが視界内にいたらTRUE * @return 召喚モンスターが消滅したらTRUE */ -bool vanish_summoned_children(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m) +bool vanish_summoned_children(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; @@ -275,7 +275,7 @@ bool vanish_summoned_children(player_type *player_ptr, MONSTER_IDX m_idx, bool s * @param m_idx モンスターID * @return 寝たままならFALSE、起きているor起きたらTRUE */ -bool awake_monster(player_type *player_ptr, MONSTER_IDX m_idx) +bool awake_monster(PlayerType *player_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -304,7 +304,7 @@ bool awake_monster(player_type *player_ptr, MONSTER_IDX m_idx) * @param m_idx モンスターID * @param see_m モンスターが視界内にいたらTRUE */ -void process_angar(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m) +void process_angar(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -348,7 +348,7 @@ void process_angar(player_type *player_ptr, MONSTER_IDX m_idx, bool see_m) * @param m_idx モンスターID * @return 爆死したらTRUE */ -bool explode_grenade(player_type *player_ptr, MONSTER_IDX m_idx) +bool explode_grenade(PlayerType *player_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; if (m_ptr->r_idx != MON_GRENADE) @@ -364,7 +364,7 @@ bool explode_grenade(player_type *player_ptr, MONSTER_IDX m_idx) * @param player_ptr プレイヤーへの参照ポインタ * @param m_idx モンスターID */ -void process_special(player_type *player_ptr, MONSTER_IDX m_idx) +void process_special(PlayerType *player_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -395,7 +395,7 @@ void process_special(player_type *player_ptr, MONSTER_IDX m_idx) * @param ox 分裂元モンスターのX座標 * @return 実際に分裂したらTRUEを返す */ -bool decide_monster_multiplication(player_type *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox) +bool decide_monster_multiplication(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -435,7 +435,7 @@ bool decide_monster_multiplication(player_type *player_ptr, MONSTER_IDX m_idx, P * @param aware モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE * @return 魔法を唱えられなければ強制的にFALSE、その後モンスターが実際に魔法を唱えればTRUE */ -bool cast_spell(player_type *player_ptr, MONSTER_IDX m_idx, bool aware) +bool cast_spell(PlayerType *player_ptr, MONSTER_IDX m_idx, bool aware) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -470,7 +470,7 @@ bool cast_spell(player_type *player_ptr, MONSTER_IDX m_idx, bool aware) * @param aware モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE * @return モンスターが戦いを決意したらTRUE */ -bool process_monster_fear(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx) +bool process_monster_fear(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; bool is_battle_determined = !turn_flags_ptr->do_turn && !turn_flags_ptr->do_move && monster_fear_remaining(m_ptr) && turn_flags_ptr->aware; @@ -520,7 +520,7 @@ bool process_monster_fear(player_type *player_ptr, turn_flags *turn_flags_ptr, M * changes (flags, attacks, spells), we induce a redraw of the monster\n * recall window.\n */ -void process_monsters(player_type *player_ptr) +void process_monsters(PlayerType *player_ptr) { old_race_flags tmp_flags; old_race_flags *old_race_flags_ptr = init_old_race_flags(&tmp_flags); @@ -539,7 +539,7 @@ void process_monsters(player_type *player_ptr) * @brief フロア内のモンスターについてターン終了時の処理を繰り返す * @param player_ptr プレイヤーへの参照ポインタ */ -void sweep_monster_process(player_type *player_ptr) +void sweep_monster_process(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (MONSTER_IDX i = floor_ptr->m_max - 1; i >= 1; i--) { @@ -583,7 +583,7 @@ void sweep_monster_process(player_type *player_ptr) * @param m_ptr モンスターへの参照ポインタ * @return 後続処理が必要ならTRUE */ -bool decide_process_continue(player_type *player_ptr, monster_type *m_ptr) +bool decide_process_continue(PlayerType *player_ptr, monster_type *m_ptr) { monster_race *r_ptr; r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/monster/monster-processor.h b/src/monster/monster-processor.h index cd4b58226..076c5d473 100644 --- a/src/monster/monster-processor.h +++ b/src/monster/monster-processor.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void process_monsters(player_type *player_ptr); -void process_monster(player_type *player_ptr, MONSTER_IDX m_idx); +class PlayerType; +void process_monsters(PlayerType *player_ptr); +void process_monster(PlayerType *player_ptr, MONSTER_IDX m_idx); diff --git a/src/monster/monster-status-setter.cpp b/src/monster/monster-status-setter.cpp index aac3fcdae..5761a77ee 100644 --- a/src/monster/monster-status-setter.cpp +++ b/src/monster/monster-status-setter.cpp @@ -29,10 +29,10 @@ /*! * @brief モンスターをペットにする - * @param player_type プレイヤーへの参照ポインタ + * @param PlayerType プレイヤーへの参照ポインタ * @param m_ptr モンスター情報構造体の参照ポインタ */ -void set_pet(player_type *player_ptr, monster_type *m_ptr) +void set_pet(PlayerType *player_ptr, monster_type *m_ptr) { QuestCompletionChecker(player_ptr, m_ptr).complete(); m_ptr->mflag2.set(MonsterConstantFlagType::PET); @@ -45,7 +45,7 @@ void set_pet(player_type *player_ptr, monster_type *m_ptr) * Makes the monster hostile towards the player * @param m_ptr モンスター情報構造体の参照ポインタ */ -void set_hostile(player_type *player_ptr, monster_type *m_ptr) +void set_hostile(PlayerType *player_ptr, monster_type *m_ptr) { if (player_ptr->phase_out) return; @@ -58,7 +58,7 @@ void set_hostile(player_type *player_ptr, monster_type *m_ptr) * Anger the monster * @param m_ptr モンスター情報構造体の参照ポインタ */ -void anger_monster(player_type *player_ptr, monster_type *m_ptr) +void anger_monster(PlayerType *player_ptr, monster_type *m_ptr) { if (player_ptr->phase_out || !is_friendly(m_ptr)) return; @@ -94,7 +94,7 @@ static void mproc_remove(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_typ * @param v セットする値 * @return 別途更新処理が必要な場合TRUEを返す */ -bool set_monster_csleep(player_type *player_ptr, MONSTER_IDX m_idx, int v) +bool set_monster_csleep(PlayerType *player_ptr, MONSTER_IDX m_idx, int v) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -138,7 +138,7 @@ bool set_monster_csleep(player_type *player_ptr, MONSTER_IDX m_idx, int v) * @param v セットする値 * @return 別途更新処理が必要な場合TRUEを返す */ -bool set_monster_fast(player_type *player_ptr, MONSTER_IDX m_idx, int v) +bool set_monster_fast(PlayerType *player_ptr, MONSTER_IDX m_idx, int v) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -169,7 +169,7 @@ bool set_monster_fast(player_type *player_ptr, MONSTER_IDX m_idx, int v) /* * Set "m_ptr->mtimed[MTIMED_SLOW]", notice observable changes */ -bool set_monster_slow(player_type *player_ptr, MONSTER_IDX m_idx, int v) +bool set_monster_slow(PlayerType *player_ptr, MONSTER_IDX m_idx, int v) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -205,7 +205,7 @@ bool set_monster_slow(player_type *player_ptr, MONSTER_IDX m_idx, int v) * @param v セットする値 * @return 別途更新処理が必要な場合TRUEを返す */ -bool set_monster_stunned(player_type *player_ptr, MONSTER_IDX m_idx, int v) +bool set_monster_stunned(PlayerType *player_ptr, MONSTER_IDX m_idx, int v) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -235,7 +235,7 @@ bool set_monster_stunned(player_type *player_ptr, MONSTER_IDX m_idx, int v) * @param v セットする値 * @return 別途更新処理が必要な場合TRUEを返す */ -bool set_monster_confused(player_type *player_ptr, MONSTER_IDX m_idx, int v) +bool set_monster_confused(PlayerType *player_ptr, MONSTER_IDX m_idx, int v) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -265,7 +265,7 @@ bool set_monster_confused(player_type *player_ptr, MONSTER_IDX m_idx, int v) * @param v セットする値 * @return 別途更新処理が必要な場合TRUEを返す */ -bool set_monster_monfear(player_type *player_ptr, MONSTER_IDX m_idx, int v) +bool set_monster_monfear(PlayerType *player_ptr, MONSTER_IDX m_idx, int v) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -308,7 +308,7 @@ bool set_monster_monfear(player_type *player_ptr, MONSTER_IDX m_idx, int v) * @param energy_need TRUEならば無敵解除時に行動ターン消費を行う * @return 別途更新処理が必要な場合TRUEを返す */ -bool set_monster_invulner(player_type *player_ptr, MONSTER_IDX m_idx, int v, bool energy_need) +bool set_monster_invulner(PlayerType *player_ptr, MONSTER_IDX m_idx, int v, bool energy_need) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -351,7 +351,7 @@ bool set_monster_invulner(player_type *player_ptr, MONSTER_IDX m_idx, int v, boo * @param vs_player TRUEならば時間停止開始処理を行う * @return 時間停止が行われている状態ならばTRUEを返す */ -bool set_monster_timewalk(player_type *player_ptr, int num, MONRACE_IDX who, bool vs_player) +bool set_monster_timewalk(PlayerType *player_ptr, int num, MONRACE_IDX who, bool vs_player) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[hack_m_idx]; if (w_ptr->timewalk_m_idx) diff --git a/src/monster/monster-status-setter.h b/src/monster/monster-status-setter.h index 506108ff6..20de43d29 100644 --- a/src/monster/monster-status-setter.h +++ b/src/monster/monster-status-setter.h @@ -3,16 +3,16 @@ #include "system/angband.h" struct monster_type; -struct player_type; +class PlayerType; void set_friendly(monster_type *m_ptr); -void set_pet(player_type *player_ptr, monster_type *m_ptr); -void set_hostile(player_type *player_ptr, monster_type *m_ptr); -void anger_monster(player_type *player_ptr, monster_type *m_ptr); -bool set_monster_csleep(player_type *player_ptr, MONSTER_IDX m_idx, int v); -bool set_monster_fast(player_type *player_ptr, MONSTER_IDX m_idx, int v); -bool set_monster_slow(player_type *player_ptr, MONSTER_IDX m_idx, int v); -bool set_monster_stunned(player_type *player_ptr, MONSTER_IDX m_idx, int v); -bool set_monster_confused(player_type *player_ptr, MONSTER_IDX m_idx, int v); -bool set_monster_monfear(player_type *player_ptr, MONSTER_IDX m_idx, int v); -bool set_monster_invulner(player_type *player_ptr, MONSTER_IDX m_idx, int v, bool energy_need); -bool set_monster_timewalk(player_type *player_ptr, int num, MONRACE_IDX who, bool vs_player); +void set_pet(PlayerType *player_ptr, monster_type *m_ptr); +void set_hostile(PlayerType *player_ptr, monster_type *m_ptr); +void anger_monster(PlayerType *player_ptr, monster_type *m_ptr); +bool set_monster_csleep(PlayerType *player_ptr, MONSTER_IDX m_idx, int v); +bool set_monster_fast(PlayerType *player_ptr, MONSTER_IDX m_idx, int v); +bool set_monster_slow(PlayerType *player_ptr, MONSTER_IDX m_idx, int v); +bool set_monster_stunned(PlayerType *player_ptr, MONSTER_IDX m_idx, int v); +bool set_monster_confused(PlayerType *player_ptr, MONSTER_IDX m_idx, int v); +bool set_monster_monfear(PlayerType *player_ptr, MONSTER_IDX m_idx, int v); +bool set_monster_invulner(PlayerType *player_ptr, MONSTER_IDX m_idx, int v, bool energy_need); +bool set_monster_timewalk(PlayerType *player_ptr, int num, MONRACE_IDX who, bool vs_player); diff --git a/src/monster/monster-status.cpp b/src/monster/monster-status.cpp index d8c42749f..fa2d703e4 100644 --- a/src/monster/monster-status.cpp +++ b/src/monster/monster-status.cpp @@ -67,7 +67,7 @@ DEPTH monster_level_idx(floor_type *floor_ptr, MONSTER_IDX m_idx) * @return 修正を行った結果のダメージ量 * @details RES_ALL持ちはAC軽減後のダメージを1/100に補正する. 光の剣は無敵を無効化する. 一定確率で無敵は貫通できる. */ -HIT_POINT mon_damage_mod(player_type *player_ptr, monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear) +HIT_POINT mon_damage_mod(PlayerType *player_ptr, monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear) { auto *r_ptr = &r_info[m_ptr->r_idx]; if ((r_ptr->flagsr & RFR_RES_ALL) && dam > 0) { @@ -158,7 +158,7 @@ void mproc_init(floor_type *floor_ptr) * @param m_idx モンスター参照ID * @param mtimed_idx 更新するモンスターの時限ステータスID */ -static void process_monsters_mtimed_aux(player_type *player_ptr, MONSTER_IDX m_idx, int mtimed_idx) +static void process_monsters_mtimed_aux(PlayerType *player_ptr, MONSTER_IDX m_idx, int mtimed_idx) { auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; switch (mtimed_idx) { @@ -341,7 +341,7 @@ static void process_monsters_mtimed_aux(player_type *player_ptr, MONSTER_IDX m_i * Process the counters of monsters (once per 10 game turns)\n * These functions are to process monsters' counters same as player's. */ -void process_monsters_mtimed(player_type *player_ptr, int mtimed_idx) +void process_monsters_mtimed(PlayerType *player_ptr, int mtimed_idx) { auto *floor_ptr = player_ptr->current_floor_ptr; const auto &cur_mproc_list = floor_ptr->mproc_list[mtimed_idx]; @@ -362,7 +362,7 @@ void process_monsters_mtimed(player_type *player_ptr, int mtimed_idx) * @param player_ptr プレイヤーへの参照ポインタ * @param m_idx 魔力消去を受けるモンスターの参照ID */ -void dispel_monster_status(player_type *player_ptr, MONSTER_IDX m_idx) +void dispel_monster_status(PlayerType *player_ptr, MONSTER_IDX m_idx) { auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; GAME_TEXT m_name[MAX_NLEN]; @@ -393,7 +393,7 @@ void dispel_monster_status(player_type *player_ptr, MONSTER_IDX m_idx) * @param m_idx 経験値を得るモンスターの参照ID * @param s_idx 撃破されたモンスター種族の参照ID */ -void monster_gain_exp(player_type *player_ptr, MONSTER_IDX m_idx, MONRACE_IDX s_idx) +void monster_gain_exp(PlayerType *player_ptr, MONSTER_IDX m_idx, MONRACE_IDX s_idx) { if (m_idx <= 0 || s_idx <= 0) { return; diff --git a/src/monster/monster-status.h b/src/monster/monster-status.h index 9c32e1c3f..d53534708 100644 --- a/src/monster/monster-status.h +++ b/src/monster/monster-status.h @@ -3,18 +3,18 @@ #include "system/angband.h" struct floor_type; -struct player_type; +class PlayerType; struct monster_type; bool monster_is_powerful(floor_type *floor_ptr, MONSTER_IDX m_idx); DEPTH monster_level_idx(floor_type *floor_ptr, MONSTER_IDX m_idx); -HIT_POINT mon_damage_mod(player_type *player_ptr, monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear); +HIT_POINT mon_damage_mod(PlayerType *player_ptr, monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear); bool monster_is_valid(monster_type *m_ptr); -void dispel_monster_status(player_type *player_ptr, MONSTER_IDX m_idx); -void monster_gain_exp(player_type *player_ptr, MONSTER_IDX m_idx, MONRACE_IDX s_idx); +void dispel_monster_status(PlayerType *player_ptr, MONSTER_IDX m_idx); +void monster_gain_exp(PlayerType *player_ptr, MONSTER_IDX m_idx, MONRACE_IDX s_idx); -void process_monsters_mtimed(player_type *player_ptr, int mtimed_idx); +void process_monsters_mtimed(PlayerType *player_ptr, int mtimed_idx); TIME_EFFECT monster_csleep_remaining(monster_type *m_ptr); TIME_EFFECT monster_fast_remaining(monster_type *m_ptr); diff --git a/src/monster/monster-update.cpp b/src/monster/monster-update.cpp index a8612ba69..2e18fa534 100644 --- a/src/monster/monster-update.cpp +++ b/src/monster/monster-update.cpp @@ -67,7 +67,7 @@ typedef struct um_type { * @param ox 移動後の、モンスターのX座標 * @return アイテム等に影響を及ぼしたらTRUE */ -bool update_riding_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox, POSITION ny, POSITION nx) +bool update_riding_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox, POSITION ny, POSITION nx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[ny][nx]; @@ -97,7 +97,7 @@ bool update_riding_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, * @param player_ptr プレイヤーへの参照ポインタ * @param turn_flags_ptr ターン経過処理フラグへの参照ポインタ */ -void update_player_type(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_race *r_ptr) +void update_player_type(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_race *r_ptr) { if (turn_flags_ptr->do_view) { player_ptr->update |= PU_FLOW; @@ -117,7 +117,7 @@ void update_player_type(player_type *player_ptr, turn_flags *turn_flags_ptr, mon * @param turn_flags_ptr ターン経過処理フラグへの参照ポインタ * @param m_ptr モンスターへの参照ポインタ */ -void update_monster_race_flags(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr) +void update_monster_race_flags(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!is_original_ap_and_seen(player_ptr, m_ptr)) @@ -151,7 +151,7 @@ void update_monster_race_flags(player_type *player_ptr, turn_flags *turn_flags_p * @param window ウィンドウフラグ * @param old_race_flags_ptr モンスターフラグへの参照ポインタ */ -void update_player_window(player_type *player_ptr, old_race_flags *old_race_flags_ptr) +void update_player_window(PlayerType *player_ptr, old_race_flags *old_race_flags_ptr) { monster_race *r_ptr; r_ptr = &r_info[player_ptr->monster_race_idx]; @@ -164,7 +164,7 @@ void update_player_window(player_type *player_ptr, old_race_flags *old_race_flag } } -static um_type *initialize_um_type(player_type *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx, bool full) +static um_type *initialize_um_type(PlayerType *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx, bool full) { um_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; um_ptr->do_disturb = disturb_move; @@ -177,7 +177,7 @@ static um_type *initialize_um_type(player_type *player_ptr, um_type *um_ptr, MON return um_ptr; } -static POSITION decide_updated_distance(player_type *player_ptr, um_type *um_ptr) +static POSITION decide_updated_distance(PlayerType *player_ptr, um_type *um_ptr) { if (!um_ptr->full) return um_ptr->m_ptr->cdis; @@ -211,7 +211,7 @@ static void update_smart_stupid_flags(monster_race *r_ptr) * @param m_idx モンスターID * @return WEIRD_MINDフラグがあるならTRUE */ -static bool update_weird_telepathy(player_type *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) +static bool update_weird_telepathy(PlayerType *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) { monster_race *r_ptr = &r_info[um_ptr->m_ptr->r_idx]; if ((r_ptr->flags2 & RF2_WEIRD_MIND) == 0) @@ -230,7 +230,7 @@ static bool update_weird_telepathy(player_type *player_ptr, um_type *um_ptr, MON return true; } -static void update_telepathy_sight(player_type *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) +static void update_telepathy_sight(PlayerType *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) { monster_race *r_ptr = &r_info[um_ptr->m_ptr->r_idx]; if (PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU)) { @@ -261,7 +261,7 @@ static void update_telepathy_sight(player_type *player_ptr, um_type *um_ptr, MON update_smart_stupid_flags(r_ptr); } -static void update_specific_race_telepathy(player_type *player_ptr, um_type *um_ptr) +static void update_specific_race_telepathy(PlayerType *player_ptr, um_type *um_ptr) { monster_race *r_ptr = &r_info[um_ptr->m_ptr->r_idx]; if ((player_ptr->esp_animal) && (r_ptr->flags3 & RF3_ANIMAL)) { @@ -349,7 +349,7 @@ static void update_specific_race_telepathy(player_type *player_ptr, um_type *um_ } } -static bool check_cold_blood(player_type *player_ptr, um_type *um_ptr, const POSITION distance) +static bool check_cold_blood(PlayerType *player_ptr, um_type *um_ptr, const POSITION distance) { if (distance > player_ptr->see_infra) return false; @@ -363,7 +363,7 @@ static bool check_cold_blood(player_type *player_ptr, um_type *um_ptr, const POS return true; } -static bool check_invisible(player_type *player_ptr, um_type *um_ptr) +static bool check_invisible(PlayerType *player_ptr, um_type *um_ptr) { if (!player_can_see_bold(player_ptr, um_ptr->fy, um_ptr->fx)) return false; @@ -387,7 +387,7 @@ static bool check_invisible(player_type *player_ptr, um_type *um_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param um_ptr モンスター情報アップデート構造体への参照ポインタ */ -static void decide_sight_invisible_monster(player_type *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) +static void decide_sight_invisible_monster(PlayerType *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) { POSITION distance = decide_updated_distance(player_ptr, um_ptr); monster_race *r_ptr = &r_info[um_ptr->m_ptr->r_idx]; @@ -431,7 +431,7 @@ static void decide_sight_invisible_monster(player_type *player_ptr, um_type *um_ * @param m_idx フロアのモンスター番号 * @details 感知した結果、エルドリッチホラー持ちがいたら精神を破壊する */ -static void update_invisible_monster(player_type *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) +static void update_invisible_monster(PlayerType *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) { if (um_ptr->m_ptr->ml) return; @@ -465,7 +465,7 @@ static void update_invisible_monster(player_type *player_ptr, um_type *um_ptr, M } } -static void update_visible_monster(player_type *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) +static void update_visible_monster(PlayerType *player_ptr, um_type *um_ptr, MONSTER_IDX m_idx) { if (!um_ptr->m_ptr->ml) return; @@ -483,7 +483,7 @@ static void update_visible_monster(player_type *player_ptr, um_type *um_ptr, MON disturb(player_ptr, true, true); } -static bool update_clear_monster(player_type *player_ptr, um_type *um_ptr) +static bool update_clear_monster(PlayerType *player_ptr, um_type *um_ptr) { if (!um_ptr->easy) return false; @@ -502,7 +502,7 @@ static bool update_clear_monster(player_type *player_ptr, um_type *um_ptr) * @param m_idx 更新するモンスター情報のID * @param full プレイヤーとの距離更新を行うならばtrue */ -void update_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool full) +void update_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool full) { um_type tmp_um; um_type *um_ptr = initialize_um_type(player_ptr, &tmp_um, m_idx, full); @@ -535,7 +535,7 @@ void update_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool full) * @param full 距離更新を行うならtrue * @todo モンスターの感知状況しか更新していないように見える。関数名変更を検討する */ -void update_monsters(player_type *player_ptr, bool full) +void update_monsters(PlayerType *player_ptr, bool full) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (MONSTER_IDX i = 1; i < floor_ptr->m_max; i++) { @@ -552,7 +552,7 @@ void update_monsters(player_type *player_ptr, bool full) * @param m_idx 更新を行う「モンスター情報ID * @param what 学習対象ID */ -void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what) +void update_smart_learn(PlayerType *player_ptr, MONSTER_IDX m_idx, int what) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/monster/monster-update.h b/src/monster/monster-update.h index 19d0a1dc0..9292cfce4 100644 --- a/src/monster/monster-update.h +++ b/src/monster/monster-update.h @@ -5,12 +5,12 @@ struct monster_race; struct monster_type; struct old_race_flags;; -struct player_type; +class PlayerType; struct turn_flags; -bool update_riding_monster(player_type *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox, POSITION ny, POSITION nx); -void update_player_type(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_race *r_ptr); -void update_monster_race_flags(player_type *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr); -void update_player_window(player_type *player_ptr, old_race_flags *old_race_flags_ptr); -void update_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool full); -void update_monsters(player_type *player_ptr, bool full); -void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what); +bool update_riding_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox, POSITION ny, POSITION nx); +void update_player_type(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_race *r_ptr); +void update_monster_race_flags(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr); +void update_player_window(PlayerType *player_ptr, old_race_flags *old_race_flags_ptr); +void update_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool full); +void update_monsters(PlayerType *player_ptr, bool full); +void update_smart_learn(PlayerType *player_ptr, MONSTER_IDX m_idx, int what); diff --git a/src/monster/monster-util.cpp b/src/monster/monster-util.cpp index e4250f4f4..48837ed98 100644 --- a/src/monster/monster-util.cpp +++ b/src/monster/monster-util.cpp @@ -51,7 +51,7 @@ summon_type summon_specific_type = SUMMON_NONE; * @param r_idx チェックするモンスター種族ID * @return 召喚条件が一致するならtrue / Return TRUE is the monster is OK and FALSE otherwise */ -static bool restrict_monster_to_dungeon(player_type *player_ptr, MONRACE_IDX r_idx) +static bool restrict_monster_to_dungeon(PlayerType *player_ptr, MONRACE_IDX r_idx) { DUNGEON_IDX d_idx = player_ptr->dungeon_idx; dungeon_type *d_ptr = &d_info[d_idx]; @@ -239,7 +239,7 @@ static bool restrict_monster_to_dungeon(player_type *player_ptr, MONRACE_IDX r_i * @param player_ptr プレイヤーへの参照ポインタ * @return 地勢にあったモンスターの生成条件関数 */ -monsterrace_hook_type get_monster_hook(player_type *player_ptr) +monsterrace_hook_type get_monster_hook(PlayerType *player_ptr) { if ((player_ptr->current_floor_ptr->dun_level > 0) || (player_ptr->current_floor_ptr->inside_quest > 0)) return (monsterrace_hook_type)mon_hook_dungeon; @@ -273,7 +273,7 @@ monsterrace_hook_type get_monster_hook(player_type *player_ptr) * @brief 指定された広域マップ座標の地勢を元にモンスターの生成条件関数を返す * @return 地勢にあったモンスターの生成条件関数 */ -monsterrace_hook_type get_monster_hook2(player_type *player_ptr, POSITION y, POSITION x) +monsterrace_hook_type get_monster_hook2(PlayerType *player_ptr, POSITION y, POSITION x) { feature_type *f_ptr = &f_info[player_ptr->current_floor_ptr->grid_array[y][x].feat]; if (f_ptr->flags.has(FloorFeatureType::WATER)) @@ -296,7 +296,7 @@ monsterrace_hook_type get_monster_hook2(player_type *player_ptr, POSITION y, POS * モンスター生成テーブル alloc_race_table の各要素の基本重み prob1 を指定条件 * に従って変更し、結果を prob2 に書き込む。 */ -static errr do_get_mon_num_prep(player_type *player_ptr, const monsterrace_hook_type hook1, const monsterrace_hook_type hook2, const bool restrict_to_dungeon) +static errr do_get_mon_num_prep(PlayerType *player_ptr, const monsterrace_hook_type hook1, const monsterrace_hook_type hook2, const bool restrict_to_dungeon) { const floor_type *const floor_ptr = player_ptr->current_floor_ptr; @@ -392,7 +392,7 @@ static errr do_get_mon_num_prep(player_type *player_ptr, const monsterrace_hook_ * * get_mon_num() を呼ぶ前に get_mon_num_prep() 系関数のいずれかを呼ぶこと。 */ -errr get_mon_num_prep(player_type *player_ptr, const monsterrace_hook_type hook1, const monsterrace_hook_type hook2) +errr get_mon_num_prep(PlayerType *player_ptr, const monsterrace_hook_type hook1, const monsterrace_hook_type hook2) { return do_get_mon_num_prep(player_ptr, hook1, hook2, true); } @@ -403,7 +403,7 @@ errr get_mon_num_prep(player_type *player_ptr, const monsterrace_hook_type hook1 * * get_mon_num() を呼ぶ前に get_mon_num_prep 系関数のいずれかを呼ぶこと。 */ -errr get_mon_num_prep_bounty(player_type *player_ptr) +errr get_mon_num_prep_bounty(PlayerType *player_ptr) { return do_get_mon_num_prep(player_ptr, nullptr, nullptr, false); } diff --git a/src/monster/monster-util.h b/src/monster/monster-util.h index fca0d21ef..331dde1fd 100644 --- a/src/monster/monster-util.h +++ b/src/monster/monster-util.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -typedef bool (*monsterrace_hook_type)(player_type *, MONRACE_IDX); +class PlayerType; +typedef bool (*monsterrace_hook_type)(PlayerType *, MONRACE_IDX); extern MONSTER_IDX hack_m_idx; extern MONSTER_IDX hack_m_idx_ii; @@ -11,7 +11,7 @@ extern int chameleon_change_m_idx; enum summon_type : int; extern summon_type summon_specific_type; -monsterrace_hook_type get_monster_hook(player_type *player_ptr); -monsterrace_hook_type get_monster_hook2(player_type *player_ptr, POSITION y, POSITION x); -errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type hook1, monsterrace_hook_type hook2); -errr get_mon_num_prep_bounty(player_type *player_ptr); +monsterrace_hook_type get_monster_hook(PlayerType *player_ptr); +monsterrace_hook_type get_monster_hook2(PlayerType *player_ptr, POSITION y, POSITION x); +errr get_mon_num_prep(PlayerType *player_ptr, monsterrace_hook_type hook1, monsterrace_hook_type hook2); +errr get_mon_num_prep_bounty(PlayerType *player_ptr); diff --git a/src/mspell/assign-monster-spell.cpp b/src/mspell/assign-monster-spell.cpp index 8f04c5d04..f27fbcf45 100644 --- a/src/mspell/assign-monster-spell.cpp +++ b/src/mspell/assign-monster-spell.cpp @@ -24,7 +24,7 @@ #include "system/player-type-definition.h" #include "util/enum-converter.h" -static MonsterSpellResult monspell_to_player_impl(player_type *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx) +static MonsterSpellResult monspell_to_player_impl(PlayerType *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx) { // clang-format off switch (ms_type) { @@ -132,7 +132,7 @@ static MonsterSpellResult monspell_to_player_impl(player_type *player_ptr, Monst } static MonsterSpellResult monspell_to_monster_impl( - player_type *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, bool is_special_spell) + PlayerType *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, bool is_special_spell) { // clang-format off switch (ms_type) { @@ -246,7 +246,7 @@ static MonsterSpellResult monspell_to_monster_impl( * @param x 対象の地点のx座標 * @param m_idx 呪文を唱えるモンスターID */ -MonsterSpellResult monspell_to_player(player_type *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx) +MonsterSpellResult monspell_to_player(PlayerType *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx) { // 特技使用前の時点でプレイヤーがモンスターを視認できているかチェック(ラーニングの必要条件)。 const bool player_could_see_monster = spell_learnable(player_ptr, m_idx); @@ -272,10 +272,10 @@ MonsterSpellResult monspell_to_player(player_type *player_ptr, MonsterAbilityTyp * @param m_idx 呪文を唱えるモンスターID * @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。 * @param is_special_spell 特殊な行動である時TRUE - * @todo モンスターからモンスターへの呪文なのにplayer_typeが引数になり得るのは間違っている…… + * @todo モンスターからモンスターへの呪文なのにPlayerTypeが引数になり得るのは間違っている…… */ MonsterSpellResult monspell_to_monster( - player_type *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, bool is_special_spell) + PlayerType *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, bool is_special_spell) { // 特技使用前の時点でプレイヤーがモンスターを視認できているかチェック(ラーニングの必要条件)。 const bool player_could_see_monster = spell_learnable(player_ptr, m_idx); diff --git a/src/mspell/assign-monster-spell.h b/src/mspell/assign-monster-spell.h index 7a090b649..dc0306b3a 100644 --- a/src/mspell/assign-monster-spell.h +++ b/src/mspell/assign-monster-spell.h @@ -6,7 +6,7 @@ struct MonsterSpellResult; enum class MonsterAbilityType; -struct player_type; -MonsterSpellResult monspell_to_player(player_type *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx); +class PlayerType; +MonsterSpellResult monspell_to_player(PlayerType *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx); MonsterSpellResult monspell_to_monster( - player_type *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, bool is_special_spell); + PlayerType *player_ptr, MonsterAbilityType ms_type, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, bool is_special_spell); diff --git a/src/mspell/element-resistance-checker.cpp b/src/mspell/element-resistance-checker.cpp index 84b0f1601..9a6a3d3e6 100644 --- a/src/mspell/element-resistance-checker.cpp +++ b/src/mspell/element-resistance-checker.cpp @@ -8,7 +8,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -void add_cheat_remove_flags_element(player_type *player_ptr, msr_type *msr_ptr) +void add_cheat_remove_flags_element(PlayerType *player_ptr, msr_type *msr_ptr) { if (has_resist_acid(player_ptr)) msr_ptr->smart.set(MonsterSmartLearnType::RES_ACID); diff --git a/src/mspell/element-resistance-checker.h b/src/mspell/element-resistance-checker.h index bbe6a43f3..a0b12d83b 100644 --- a/src/mspell/element-resistance-checker.h +++ b/src/mspell/element-resistance-checker.h @@ -1,6 +1,6 @@ #pragma once typedef struct msr_type msr_type; -struct player_type; -void add_cheat_remove_flags_element(player_type *player_ptr, msr_type *msr_ptr); +class PlayerType; +void add_cheat_remove_flags_element(PlayerType *player_ptr, msr_type *msr_ptr); void check_element_resistance(msr_type *msr_ptr); diff --git a/src/mspell/high-resistance-checker.cpp b/src/mspell/high-resistance-checker.cpp index 150c4da85..022f940de 100644 --- a/src/mspell/high-resistance-checker.cpp +++ b/src/mspell/high-resistance-checker.cpp @@ -7,7 +7,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -void add_cheat_remove_flags_others(player_type *player_ptr, msr_type *msr_ptr) +void add_cheat_remove_flags_others(PlayerType *player_ptr, msr_type *msr_ptr) { if (has_resist_neth(player_ptr)) msr_ptr->smart.set(MonsterSmartLearnType::RES_NETH); @@ -52,7 +52,7 @@ void add_cheat_remove_flags_others(player_type *player_ptr, msr_type *msr_ptr) msr_ptr->smart.set(MonsterSmartLearnType::IMM_MANA); } -static void check_nether_resistance(player_type *player_ptr, msr_type *msr_ptr) +static void check_nether_resistance(PlayerType *player_ptr, msr_type *msr_ptr) { if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_NETH)) return; @@ -86,7 +86,7 @@ static void check_lite_resistance(msr_type *msr_ptr) msr_ptr->ability_flags.reset(MonsterAbilityType::BA_LITE); } -static void check_dark_resistance(player_type *player_ptr, msr_type *msr_ptr) +static void check_dark_resistance(PlayerType *player_ptr, msr_type *msr_ptr) { if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_DARK)) return; @@ -173,7 +173,7 @@ static void check_reflection(msr_type *msr_ptr) msr_ptr->ability_flags.reset(MonsterAbilityType::MISSILE); } -void check_high_resistances(player_type *player_ptr, msr_type *msr_ptr) +void check_high_resistances(PlayerType *player_ptr, msr_type *msr_ptr) { check_nether_resistance(player_ptr, msr_ptr); check_lite_resistance(msr_ptr); diff --git a/src/mspell/high-resistance-checker.h b/src/mspell/high-resistance-checker.h index 72d695783..b6b8c1abb 100644 --- a/src/mspell/high-resistance-checker.h +++ b/src/mspell/high-resistance-checker.h @@ -1,6 +1,6 @@ #pragma once typedef struct msr_type msr_type; -struct player_type; -void add_cheat_remove_flags_others(player_type *player_ptr, msr_type *msr_ptr); -void check_high_resistances(player_type *player_ptr, msr_type *msr_ptr); +class PlayerType; +void add_cheat_remove_flags_others(PlayerType *player_ptr, msr_type *msr_ptr); +void check_high_resistances(PlayerType *player_ptr, msr_type *msr_ptr); diff --git a/src/mspell/improper-mspell-remover.cpp b/src/mspell/improper-mspell-remover.cpp index f367c6a48..41bd75b27 100644 --- a/src/mspell/improper-mspell-remover.cpp +++ b/src/mspell/improper-mspell-remover.cpp @@ -11,7 +11,7 @@ #include "system/monster-type-definition.h" #include "system/player-type-definition.h" -static void add_cheat_remove_flags(player_type *player_ptr, msr_type *msr_ptr) +static void add_cheat_remove_flags(PlayerType *player_ptr, msr_type *msr_ptr) { if (!smart_cheat) return; @@ -28,7 +28,7 @@ static void add_cheat_remove_flags(player_type *player_ptr, msr_type *msr_ptr) * @param f5p モンスター魔法のフラグリスト2 * @param f6p モンスター魔法のフラグリスト3 */ -void remove_bad_spells(MONSTER_IDX m_idx, player_type *player_ptr, EnumClassFlagGroup &ability_flags) +void remove_bad_spells(MONSTER_IDX m_idx, PlayerType *player_ptr, EnumClassFlagGroup &ability_flags) { msr_type tmp_msr; msr_type *msr_ptr = initialize_msr_type(player_ptr, &tmp_msr, m_idx, ability_flags); diff --git a/src/mspell/improper-mspell-remover.h b/src/mspell/improper-mspell-remover.h index 1b9c82223..ba8ebe942 100644 --- a/src/mspell/improper-mspell-remover.h +++ b/src/mspell/improper-mspell-remover.h @@ -5,5 +5,5 @@ #include "monster-race/race-ability-flags.h" #include "util/flag-group.h" -struct player_type; -void remove_bad_spells(MONSTER_IDX m_idx, player_type *player_ptr, EnumClassFlagGroup &ability_flags); +class PlayerType; +void remove_bad_spells(MONSTER_IDX m_idx, PlayerType *player_ptr, EnumClassFlagGroup &ability_flags); diff --git a/src/mspell/mspell-attack-util.cpp b/src/mspell/mspell-attack-util.cpp index 7084cad27..c6c86f495 100644 --- a/src/mspell/mspell-attack-util.cpp +++ b/src/mspell/mspell-attack-util.cpp @@ -5,7 +5,7 @@ #include "system/monster-type-definition.h" #include "system/player-type-definition.h" -msa_type *initialize_msa_type(player_type *player_ptr, msa_type *msa_ptr, MONSTER_IDX m_idx) +msa_type *initialize_msa_type(PlayerType *player_ptr, msa_type *msa_ptr, MONSTER_IDX m_idx) { msa_ptr->m_idx = m_idx; msa_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; diff --git a/src/mspell/mspell-attack-util.h b/src/mspell/mspell-attack-util.h index bdbfff243..68d147620 100644 --- a/src/mspell/mspell-attack-util.h +++ b/src/mspell/mspell-attack-util.h @@ -38,5 +38,5 @@ typedef struct msa_type { DEPTH rlev; } msa_type; -struct player_type; -msa_type *initialize_msa_type(player_type *player_ptr, msa_type *msa_ptr, MONSTER_IDX m_idx); +class PlayerType; +msa_type *initialize_msa_type(PlayerType *player_ptr, msa_type *msa_ptr, MONSTER_IDX m_idx); diff --git a/src/mspell/mspell-attack.cpp b/src/mspell/mspell-attack.cpp index ba0c8ec34..682ef1fa9 100644 --- a/src/mspell/mspell-attack.cpp +++ b/src/mspell/mspell-attack.cpp @@ -51,7 +51,7 @@ static void set_no_magic_mask(msa_type *msa_ptr) msa_ptr->ability_flags.reset(RF_ABILITY_NOMAGIC_MASK); } -static void check_mspell_stupid(player_type *player_ptr, msa_type *msa_ptr) +static void check_mspell_stupid(PlayerType *player_ptr, msa_type *msa_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; msa_ptr->in_no_magic_dungeon = d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MAGIC) && floor_ptr->dun_level @@ -62,7 +62,7 @@ static void check_mspell_stupid(player_type *player_ptr, msa_type *msa_ptr) msa_ptr->ability_flags &= RF_ABILITY_NOMAGIC_MASK; } -static void check_mspell_smart(player_type *player_ptr, msa_type *msa_ptr) +static void check_mspell_smart(PlayerType *player_ptr, msa_type *msa_ptr) { if ((msa_ptr->r_ptr->flags2 & RF2_SMART) == 0) return; @@ -76,7 +76,7 @@ static void check_mspell_smart(player_type *player_ptr, msa_type *msa_ptr) } } -static void check_mspell_arena(player_type *player_ptr, msa_type *msa_ptr) +static void check_mspell_arena(PlayerType *player_ptr, msa_type *msa_ptr) { if (!player_ptr->current_floor_ptr->inside_arena && !player_ptr->phase_out) return; @@ -87,7 +87,7 @@ static void check_mspell_arena(player_type *player_ptr, msa_type *msa_ptr) msa_ptr->ability_flags.reset(MonsterAbilityType::SPECIAL); } -static bool check_mspell_non_stupid(player_type *player_ptr, msa_type *msa_ptr) +static bool check_mspell_non_stupid(PlayerType *player_ptr, msa_type *msa_ptr) { if ((msa_ptr->r_ptr->flags2 & RF2_STUPID) != 0) return true; @@ -119,7 +119,7 @@ static void set_mspell_list(msa_type *msa_ptr) EnumClassFlagGroup::get_flags(msa_ptr->ability_flags, std::back_inserter(msa_ptr->mspells)); } -static void describe_mspell_monster(player_type *player_ptr, msa_type *msa_ptr) +static void describe_mspell_monster(PlayerType *player_ptr, msa_type *msa_ptr) { monster_desc(player_ptr, msa_ptr->m_name, msa_ptr->m_ptr, 0x00); @@ -131,7 +131,7 @@ static void describe_mspell_monster(player_type *player_ptr, msa_type *msa_ptr) #endif } -static bool switch_do_spell(player_type *player_ptr, msa_type *msa_ptr) +static bool switch_do_spell(PlayerType *player_ptr, msa_type *msa_ptr) { switch (msa_ptr->do_spell) { case DO_SPELL_NONE: { @@ -158,7 +158,7 @@ static bool switch_do_spell(player_type *player_ptr, msa_type *msa_ptr) } } -static bool check_mspell_continuation(player_type *player_ptr, msa_type *msa_ptr) +static bool check_mspell_continuation(PlayerType *player_ptr, msa_type *msa_ptr) { if (msa_ptr->ability_flags.none()) return false; @@ -179,7 +179,7 @@ static bool check_mspell_continuation(player_type *player_ptr, msa_type *msa_ptr return true; } -static bool check_mspell_unexploded(player_type *player_ptr, msa_type *msa_ptr) +static bool check_mspell_unexploded(PlayerType *player_ptr, msa_type *msa_ptr) { PERCENTAGE fail_rate = 25 - (msa_ptr->rlev + 3) / 4; if (msa_ptr->r_ptr->flags2 & RF2_STUPID) @@ -205,7 +205,7 @@ static bool check_mspell_unexploded(player_type *player_ptr, msa_type *msa_ptr) * * ターゲット (msa_ptr->y, msa_ptr->x) は設定済みとする。 */ -static bool check_thrown_mspell(player_type *player_ptr, msa_type *msa_ptr) +static bool check_thrown_mspell(PlayerType *player_ptr, msa_type *msa_ptr) { // プレイヤーがモンスターを正しく視認できていれば思い出に残る。 // FIXME: ここで処理するのはおかしいような? @@ -256,7 +256,7 @@ static bool check_thrown_mspell(player_type *player_ptr, msa_type *msa_ptr) } } -static void check_mspell_imitation(player_type *player_ptr, msa_type *msa_ptr) +static void check_mspell_imitation(PlayerType *player_ptr, msa_type *msa_ptr) { bool seen = (!player_ptr->blind && msa_ptr->m_ptr->ml); bool can_imitate = player_has_los_bold(player_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx); @@ -295,7 +295,7 @@ static void remember_mspell(msa_type *msa_ptr) * @param m_idx モンスター構造体配列のID * @return 実際に特殊技能を利用したらTRUEを返す */ -bool make_attack_spell(player_type *player_ptr, MONSTER_IDX m_idx) +bool make_attack_spell(PlayerType *player_ptr, MONSTER_IDX m_idx) { msa_type tmp_msa; msa_type *msa_ptr = initialize_msa_type(player_ptr, &tmp_msa, m_idx); diff --git a/src/mspell/mspell-attack.h b/src/mspell/mspell-attack.h index ca654c76b..9f7ef0a69 100644 --- a/src/mspell/mspell-attack.h +++ b/src/mspell/mspell-attack.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool make_attack_spell(player_type *player_ptr, MONSTER_IDX m_idx); +class PlayerType; +bool make_attack_spell(PlayerType *player_ptr, MONSTER_IDX m_idx); diff --git a/src/mspell/mspell-ball.cpp b/src/mspell/mspell-ball.cpp index c4a74fc6a..6e83c7123 100644 --- a/src/mspell/mspell-ball.cpp +++ b/src/mspell/mspell-ball.cpp @@ -28,7 +28,7 @@ * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF4_BA_NUKE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF4_BA_NUKE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが放射能球を放った。", "%^s casts a ball of radiation."), _("%^sが%sに放射能球を放った。", "%^s casts a ball of radiation at %s.")); @@ -57,7 +57,7 @@ MonsterSpellResult spell_RF4_BA_NUKE(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF4_BA_CHAO(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF4_BA_CHAO(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが恐ろしげにつぶやいた。", "%^s mumbles frighteningly."), _("%^sが純ログルスを放った。", "%^s invokes a raw Logrus."), _("%^sが%sに純ログルスを放った。", "%^s invokes raw Logrus upon %s.")); @@ -86,7 +86,7 @@ MonsterSpellResult spell_RF4_BA_CHAO(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_ACID(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_ACID(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがアシッド・ボールの呪文を唱えた。", "%^s casts an acid ball."), @@ -117,7 +117,7 @@ MonsterSpellResult spell_RF5_BA_ACID(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_ELEC(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_ELEC(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがサンダー・ボールの呪文を唱えた。", "%^s casts a lightning ball."), @@ -148,7 +148,7 @@ MonsterSpellResult spell_RF5_BA_ELEC(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_FIRE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_FIRE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg; monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; @@ -188,7 +188,7 @@ MonsterSpellResult spell_RF5_BA_FIRE(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_COLD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_COLD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがアイス・ボールの呪文を唱えた。", "%^s casts a frost ball."), @@ -219,7 +219,7 @@ MonsterSpellResult spell_RF5_BA_COLD(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_POIS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_POIS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが悪臭雲の呪文を唱えた。", "%^s casts a stinking cloud."), _("%^sが%sに向かって悪臭雲の呪文を唱えた。", "%^s casts a stinking cloud at %s.")); @@ -248,7 +248,7 @@ MonsterSpellResult spell_RF5_BA_POIS(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_NETH(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_NETH(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが地獄球の呪文を唱えた。", "%^s casts a nether ball."), _("%^sが%sに向かって地獄球の呪文を唱えた。", "%^s casts a nether ball at %s.")); @@ -277,7 +277,7 @@ MonsterSpellResult spell_RF5_BA_NETH(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_WATE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_WATE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { bool known = monster_near_player(player_ptr->current_floor_ptr, m_idx, t_idx); bool see_either = see_monster(player_ptr, m_idx) || see_monster(player_ptr, t_idx); @@ -317,7 +317,7 @@ MonsterSpellResult spell_RF5_BA_WATE(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_MANA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_MANA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."), _("%^sが魔力の嵐の呪文を念じた。", "%^s invokes a mana storm."), _("%^sが%sに対して魔力の嵐の呪文を念じた。", "%^s invokes a mana storm upon %s.")); @@ -344,7 +344,7 @@ MonsterSpellResult spell_RF5_BA_MANA(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_DARK(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_DARK(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."), _("%^sが暗黒の嵐の呪文を念じた。", "%^s invokes a darkness storm."), @@ -374,7 +374,7 @@ MonsterSpellResult spell_RF5_BA_DARK(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BA_LITE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BA_LITE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."), _("%^sがスターバーストの呪文を念じた。", "%^s invokes a starburst."), diff --git a/src/mspell/mspell-ball.h b/src/mspell/mspell-ball.h index 4d79b6a64..8ab2026b0 100644 --- a/src/mspell/mspell-ball.h +++ b/src/mspell/mspell-ball.h @@ -4,16 +4,16 @@ struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF4_BA_NUKE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF4_BA_CHAO(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_ACID(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_ELEC(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_FIRE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_COLD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_POIS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_NETH(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_WATE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_MANA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_DARK(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BA_LITE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF4_BA_NUKE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF4_BA_CHAO(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_ACID(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_ELEC(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_FIRE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_COLD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_POIS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_NETH(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_WATE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_MANA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_DARK(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BA_LITE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-bolt.cpp b/src/mspell/mspell-bolt.cpp index fde6b6b67..8d4e370b3 100644 --- a/src/mspell/mspell-bolt.cpp +++ b/src/mspell/mspell-bolt.cpp @@ -25,7 +25,7 @@ * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF4_SHOOT(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF4_SHOOT(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが奇妙な音を発した。", "%^s makes a strange noise."), _("%^sが矢を放った。", "%^s fires an arrow."), @@ -57,7 +57,7 @@ MonsterSpellResult spell_RF4_SHOOT(player_type *player_ptr, POSITION y, POSITION * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_ACID(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_ACID(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがアシッド・ボルトの呪文を唱えた。", "%^s casts an acid bolt."), @@ -89,7 +89,7 @@ MonsterSpellResult spell_RF5_BO_ACID(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_ELEC(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_ELEC(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがサンダー・ボルトの呪文を唱えた。", "%^s casts a lightning bolt."), @@ -121,7 +121,7 @@ MonsterSpellResult spell_RF5_BO_ELEC(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_FIRE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_FIRE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがファイア・ボルトの呪文を唱えた。", "%^s casts a fire bolt."), @@ -153,7 +153,7 @@ MonsterSpellResult spell_RF5_BO_FIRE(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_COLD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_COLD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがアイス・ボルトの呪文を唱えた。", "%^s casts a frost bolt."), @@ -185,7 +185,7 @@ MonsterSpellResult spell_RF5_BO_COLD(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_NETH(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_NETH(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが地獄の矢の呪文を唱えた。", "%^s casts a nether bolt."), _("%^sが%sに向かって地獄の矢の呪文を唱えた。", "%^s casts a nether bolt at %s.")); @@ -216,7 +216,7 @@ MonsterSpellResult spell_RF5_BO_NETH(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_WATE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_WATE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがウォーター・ボルトの呪文を唱えた。", "%^s casts a water bolt."), @@ -247,7 +247,7 @@ MonsterSpellResult spell_RF5_BO_WATE(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_MANA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_MANA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔力の矢の呪文を唱えた。", "%^s casts a mana bolt."), _("%^sが%sに向かって魔力の矢の呪文を唱えた。", "%^s casts a mana bolt at %s.")); @@ -277,7 +277,7 @@ MonsterSpellResult spell_RF5_BO_MANA(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_PLAS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_PLAS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがプラズマ・ボルトの呪文を唱えた。", "%^s casts a plasma bolt."), @@ -308,7 +308,7 @@ MonsterSpellResult spell_RF5_BO_PLAS(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BO_ICEE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BO_ICEE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが極寒の矢の呪文を唱えた。", "%^s casts an ice bolt."), _("%^sが%sに向かって極寒の矢の呪文を唱えた。", "%^s casts an ice bolt at %s.")); @@ -339,7 +339,7 @@ MonsterSpellResult spell_RF5_BO_ICEE(player_type *player_ptr, POSITION y, POSITI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_MISSILE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_MISSILE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがマジック・ミサイルの呪文を唱えた。", "%^s casts a magic missile."), diff --git a/src/mspell/mspell-bolt.h b/src/mspell/mspell-bolt.h index a0ea45b59..36af844e8 100644 --- a/src/mspell/mspell-bolt.h +++ b/src/mspell/mspell-bolt.h @@ -4,15 +4,15 @@ struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF4_SHOOT(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_ACID(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_ELEC(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_FIRE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_COLD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_NETH(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_WATE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_MANA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_PLAS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BO_ICEE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_MISSILE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF4_SHOOT(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_ACID(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_ELEC(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_FIRE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_COLD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_NETH(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_WATE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_MANA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_PLAS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BO_ICEE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_MISSILE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-breath.cpp b/src/mspell/mspell-breath.cpp index 3b3c2db11..02fef1f19 100644 --- a/src/mspell/mspell-breath.cpp +++ b/src/mspell/mspell-breath.cpp @@ -56,7 +56,7 @@ static bool spell_RF4_BREATH_special_message(MONSTER_IDX r_idx, AttributeType GF * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF4_BREATH(player_type *player_ptr, AttributeType GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF4_BREATH(PlayerType *player_ptr, AttributeType GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { HIT_POINT dam, drs_type = 0; concptr type_s; diff --git a/src/mspell/mspell-breath.h b/src/mspell/mspell-breath.h index df08b530d..cd9a46452 100644 --- a/src/mspell/mspell-breath.h +++ b/src/mspell/mspell-breath.h @@ -5,5 +5,5 @@ struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF4_BREATH(player_type *player_ptr, AttributeType GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF4_BREATH(PlayerType *player_ptr, AttributeType GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-checker.cpp b/src/mspell/mspell-checker.cpp index 097e6052f..c516bc907 100644 --- a/src/mspell/mspell-checker.cpp +++ b/src/mspell/mspell-checker.cpp @@ -66,7 +66,7 @@ * @param x1 判定を行いたいマスのX座標 * @return 召還に相応しいならばTRUEを返す */ -bool summon_possible(player_type *player_ptr, POSITION y1, POSITION x1) +bool summon_possible(PlayerType *player_ptr, POSITION y1, POSITION x1) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (POSITION y = y1 - 2; y <= y1 + 2; y++) { @@ -95,7 +95,7 @@ bool summon_possible(player_type *player_ptr, POSITION y1, POSITION x1) * @param m_ptr 判定を行いたいモンスターの構造体参照ポインタ * @return 死者復活が有効な状態ならばTRUEを返す。 */ -bool raise_possible(player_type *player_ptr, monster_type *m_ptr) +bool raise_possible(PlayerType *player_ptr, monster_type *m_ptr) { POSITION y = m_ptr->fy; POSITION x = m_ptr->fx; @@ -144,7 +144,7 @@ bool raise_possible(player_type *player_ptr, monster_type *m_ptr) * no equally friendly monster is\n * between the attacker and target.\n */ -bool clean_shot(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend) +bool clean_shot(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend) { floor_type *floor_ptr = player_ptr->current_floor_ptr; uint16_t grid_g[512]; @@ -187,7 +187,7 @@ bool clean_shot(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, * @param monspell モンスター魔法のID * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER */ -ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type) +ProjectResult bolt(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type) { BIT_FLAGS flg = 0; switch (target_type) { @@ -216,7 +216,7 @@ ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSIT * @param monspell モンスター魔法のID * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER */ -ProjectResult beam(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type) +ProjectResult beam(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type) { BIT_FLAGS flg = 0; switch (target_type) { @@ -245,7 +245,7 @@ ProjectResult beam(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSIT * @param monspell モンスター魔法のID * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER */ -ProjectResult breath(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, bool breath, int target_type) +ProjectResult breath(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, bool breath, int target_type) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/mspell/mspell-checker.h b/src/mspell/mspell-checker.h index df0d5a4e1..a5ca0f3c9 100644 --- a/src/mspell/mspell-checker.h +++ b/src/mspell/mspell-checker.h @@ -7,12 +7,12 @@ struct ProjectResult; enum class MonsterAbilityType; struct monster_type; -struct player_type; -bool clean_shot(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend); -bool summon_possible(player_type *player_ptr, POSITION y1, POSITION x1); -bool raise_possible(player_type *player_ptr, monster_type *m_ptr); +class PlayerType; +bool clean_shot(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend); +bool summon_possible(PlayerType *player_ptr, POSITION y1, POSITION x1); +bool raise_possible(PlayerType *player_ptr, monster_type *m_ptr); bool spell_is_inate(MonsterAbilityType spell); -ProjectResult beam(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type); -ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type); +ProjectResult beam(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type); +ProjectResult bolt(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type); ProjectResult breath( - player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, bool breath, int target_type); + PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, bool breath, int target_type); diff --git a/src/mspell/mspell-curse.cpp b/src/mspell/mspell-curse.cpp index 46648a885..5f6c77322 100644 --- a/src/mspell/mspell-curse.cpp +++ b/src/mspell/mspell-curse.cpp @@ -27,7 +27,7 @@ * @param MS_TYPE 呪文の番号 * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER */ -static MonsterSpellResult spell_RF5_CAUSE(player_type *player_ptr, AttributeType GF_TYPE, HIT_POINT dam, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, +static MonsterSpellResult spell_RF5_CAUSE(PlayerType *player_ptr, AttributeType GF_TYPE, HIT_POINT dam, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, concptr msg1, concptr msg2, concptr msg3, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(dam); @@ -71,7 +71,7 @@ static MonsterSpellResult spell_RF5_CAUSE(player_type *player_ptr, AttributeType * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_CAUSE_1(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_CAUSE_1(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { concptr msg1 = _("%^sが何かをつぶやいた。", "%^s mumbles."); concptr msg2 = _("%^sがあなたを指さして呪った。", "%^s points at you and curses."); @@ -93,7 +93,7 @@ MonsterSpellResult spell_RF5_CAUSE_1(player_type *player_ptr, POSITION y, POSITI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_CAUSE_2(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_CAUSE_2(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { concptr msg1 = _("%^sが何かをつぶやいた。", "%^s mumbles."); concptr msg2 = _("%^sがあなたを指さして恐ろしげに呪った。", "%^s points at you and curses horribly."); @@ -115,7 +115,7 @@ MonsterSpellResult spell_RF5_CAUSE_2(player_type *player_ptr, POSITION y, POSITI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_CAUSE_3(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_CAUSE_3(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { concptr msg1 = _("%^sが何かを大声で叫んだ。", "%^s mumbles loudly."); concptr msg2 = _("%^sがあなたを指さして恐ろしげに呪文を唱えた!", "%^s points at you, incanting terribly!"); @@ -137,7 +137,7 @@ MonsterSpellResult spell_RF5_CAUSE_3(player_type *player_ptr, POSITION y, POSITI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_CAUSE_4(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_CAUSE_4(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { concptr msg1 = _("%^sが「お前は既に死んでいる」と叫んだ。", "%^s screams the word 'DIE!'"); concptr msg2 = _("%^sがあなたの秘孔を突いて「お前は既に死んでいる」と叫んだ。", "%^s points at you, screaming the word DIE!"); diff --git a/src/mspell/mspell-curse.h b/src/mspell/mspell-curse.h index fbb89d7e7..1623605f7 100644 --- a/src/mspell/mspell-curse.h +++ b/src/mspell/mspell-curse.h @@ -4,8 +4,8 @@ struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF5_CAUSE_1(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_CAUSE_2(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_CAUSE_3(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_CAUSE_4(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF5_CAUSE_1(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_CAUSE_2(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_CAUSE_3(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_CAUSE_4(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-damage-calculator.cpp b/src/mspell/mspell-damage-calculator.cpp index e03762696..4fff7682e 100644 --- a/src/mspell/mspell-damage-calculator.cpp +++ b/src/mspell/mspell-damage-calculator.cpp @@ -66,7 +66,7 @@ static HIT_POINT monspell_damage_roll(HIT_POINT dam, int dice_num, int dice_side * @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。 */ static HIT_POINT monspell_damage_base( - player_type *player_ptr, MonsterAbilityType ms_type, int hp, int rlev, bool powerful, int shoot_dd, int shoot_ds, int shoot_base, int TYPE) + PlayerType *player_ptr, MonsterAbilityType ms_type, int hp, int rlev, bool powerful, int shoot_dd, int shoot_ds, int shoot_base, int TYPE) { HIT_POINT dam = 0, dice_num = 0, dice_side = 0, mult = 1, div = 1; @@ -450,7 +450,7 @@ void monspell_shoot_dice(monster_race *r_ptr, int *dd, int *ds) * @param TYPE DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。 * @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。 */ -HIT_POINT monspell_damage(player_type *player_ptr, MonsterAbilityType ms_type, MONSTER_IDX m_idx, int TYPE) +HIT_POINT monspell_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONSTER_IDX m_idx, int TYPE) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -471,7 +471,7 @@ HIT_POINT monspell_damage(player_type *player_ptr, MonsterAbilityType ms_type, M * @param TYPE DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。 * @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。 */ -HIT_POINT monspell_race_damage(player_type *player_ptr, MonsterAbilityType ms_type, MONRACE_IDX r_idx, int TYPE) +HIT_POINT monspell_race_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONRACE_IDX r_idx, int TYPE) { monster_race *r_ptr = &r_info[r_idx]; DEPTH rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1); @@ -491,7 +491,7 @@ HIT_POINT monspell_race_damage(player_type *player_ptr, MonsterAbilityType ms_ty * @param TYPE DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。 * @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。 */ -HIT_POINT monspell_bluemage_damage(player_type *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, int TYPE) +HIT_POINT monspell_bluemage_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, int TYPE) { int hp = player_ptr->chp; int shoot_dd = 1, shoot_ds = 1, shoot_base = 0; diff --git a/src/mspell/mspell-damage-calculator.h b/src/mspell/mspell-damage-calculator.h index de5d97025..35520ac85 100644 --- a/src/mspell/mspell-damage-calculator.h +++ b/src/mspell/mspell-damage-calculator.h @@ -14,7 +14,7 @@ enum spell_flag_type { }; enum class MonsterAbilityType; -struct player_type; -HIT_POINT monspell_damage(player_type *player_ptr, MonsterAbilityType ms_type, MONSTER_IDX m_idx, int TYPE); -HIT_POINT monspell_race_damage(player_type *player_ptr, MonsterAbilityType ms_type, MONRACE_IDX r_idx, int TYPE); -HIT_POINT monspell_bluemage_damage(player_type *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, int TYPE); +class PlayerType; +HIT_POINT monspell_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONSTER_IDX m_idx, int TYPE); +HIT_POINT monspell_race_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONRACE_IDX r_idx, int TYPE); +HIT_POINT monspell_bluemage_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, int TYPE); diff --git a/src/mspell/mspell-dispel.cpp b/src/mspell/mspell-dispel.cpp index fdc5bff5e..c2b80b356 100644 --- a/src/mspell/mspell-dispel.cpp +++ b/src/mspell/mspell-dispel.cpp @@ -34,7 +34,7 @@ /*! * @brief プレイヤーに魔力消去効果を与える。 */ -static void dispel_player(player_type *player_ptr) +static void dispel_player(PlayerType *player_ptr) { (void)set_fast(player_ptr, 0, true); set_lightspeed(player_ptr, 0, true); @@ -112,7 +112,7 @@ static void dispel_player(player_type *player_ptr) * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF4_DISPEL(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF4_DISPEL(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(); res.learnable = TARGET_TYPE == MONSTER_TO_PLAYER; diff --git a/src/mspell/mspell-dispel.h b/src/mspell/mspell-dispel.h index b437933a2..26d6def1f 100644 --- a/src/mspell/mspell-dispel.h +++ b/src/mspell/mspell-dispel.h @@ -4,5 +4,5 @@ struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF4_DISPEL(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF4_DISPEL(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-floor.cpp b/src/mspell/mspell-floor.cpp index c1715b589..b13d294e0 100644 --- a/src/mspell/mspell-floor.cpp +++ b/src/mspell/mspell-floor.cpp @@ -50,7 +50,7 @@ * * ラーニング不可。 */ -MonsterSpellResult spell_RF4_SHRIEK(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int target_type) +MonsterSpellResult spell_RF4_SHRIEK(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int target_type) { mspell_cast_msg_simple msg(_("%^sがかん高い金切り声をあげた。", "%^s makes a high pitched shriek."), _("%^sが%sに向かって叫んだ。", "%^s shrieks at %s.")); @@ -80,7 +80,7 @@ MonsterSpellResult spell_RF4_SHRIEK(MONSTER_IDX m_idx, player_type *player_ptr, * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_WORLD(player_type *player_ptr, MONSTER_IDX m_idx) +MonsterSpellResult spell_RF6_WORLD(PlayerType *player_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; GAME_TEXT m_name[MAX_NLEN]; @@ -100,7 +100,7 @@ MonsterSpellResult spell_RF6_WORLD(player_type *player_ptr, MONSTER_IDX m_idx) * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_BLINK(player_type *player_ptr, MONSTER_IDX m_idx, int TARGET_TYPE, bool is_quantum_effect) +MonsterSpellResult spell_RF6_BLINK(PlayerType *player_ptr, MONSTER_IDX m_idx, int TARGET_TYPE, bool is_quantum_effect) { const auto res = MonsterSpellResult::make_valid(); @@ -135,7 +135,7 @@ MonsterSpellResult spell_RF6_BLINK(player_type *player_ptr, MONSTER_IDX m_idx, i * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_TPORT(player_type *player_ptr, MONSTER_IDX m_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_TPORT(PlayerType *player_ptr, MONSTER_IDX m_idx, int TARGET_TYPE) { const auto res = MonsterSpellResult::make_valid(); @@ -167,7 +167,7 @@ MonsterSpellResult spell_RF6_TPORT(player_type *player_ptr, MONSTER_IDX m_idx, i * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_TELE_TO(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_TELE_TO(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(); res.learnable = TARGET_TYPE == MONSTER_TO_PLAYER; @@ -235,7 +235,7 @@ MonsterSpellResult spell_RF6_TELE_TO(player_type *player_ptr, MONSTER_IDX m_idx, * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_TELE_AWAY(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_TELE_AWAY(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(); res.learnable = TARGET_TYPE == MONSTER_TO_PLAYER; @@ -311,7 +311,7 @@ MonsterSpellResult spell_RF6_TELE_AWAY(player_type *player_ptr, MONSTER_IDX m_id * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_TELE_LEVEL(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_TELE_LEVEL(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { const auto res = MonsterSpellResult::make_valid(); @@ -368,7 +368,7 @@ MonsterSpellResult spell_RF6_TELE_LEVEL(player_type *player_ptr, MONSTER_IDX m_i * * プレイヤーが対象かつ暗闇ならラーニング可。 */ -MonsterSpellResult spell_RF6_DARKNESS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_DARKNESS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg; concptr msg_done; @@ -439,7 +439,7 @@ MonsterSpellResult spell_RF6_DARKNESS(player_type *player_ptr, POSITION y, POSIT * * ラーニング可。 */ -MonsterSpellResult spell_RF6_TRAPS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) +MonsterSpellResult spell_RF6_TRAPS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) { GAME_TEXT m_name[MAX_NLEN]; monster_name(player_ptr, m_idx, m_name); @@ -467,7 +467,7 @@ MonsterSpellResult spell_RF6_TRAPS(player_type *player_ptr, POSITION y, POSITION * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_RAISE_DEAD(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_RAISE_DEAD(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), diff --git a/src/mspell/mspell-floor.h b/src/mspell/mspell-floor.h index 8f1882666..a738b93f3 100644 --- a/src/mspell/mspell-floor.h +++ b/src/mspell/mspell-floor.h @@ -4,14 +4,14 @@ struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF4_SHRIEK(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_WORLD(player_type *player_ptr, MONSTER_IDX m_idx); -MonsterSpellResult spell_RF6_BLINK(player_type *player_ptr, MONSTER_IDX m_idx, int TARGET_TYPE, bool is_quantum_effect); -MonsterSpellResult spell_RF6_TPORT(player_type *player_ptr, MONSTER_IDX m_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_TELE_TO(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_TELE_AWAY(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_TELE_LEVEL(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_DARKNESS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_TRAPS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); -MonsterSpellResult spell_RF6_RAISE_DEAD(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF4_SHRIEK(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_WORLD(PlayerType *player_ptr, MONSTER_IDX m_idx); +MonsterSpellResult spell_RF6_BLINK(PlayerType *player_ptr, MONSTER_IDX m_idx, int TARGET_TYPE, bool is_quantum_effect); +MonsterSpellResult spell_RF6_TPORT(PlayerType *player_ptr, MONSTER_IDX m_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_TELE_TO(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_TELE_AWAY(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_TELE_LEVEL(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_DARKNESS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_TRAPS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); +MonsterSpellResult spell_RF6_RAISE_DEAD(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-judgement.cpp b/src/mspell/mspell-judgement.cpp index a3737271e..1264fdffb 100644 --- a/src/mspell/mspell-judgement.cpp +++ b/src/mspell/mspell-judgement.cpp @@ -48,7 +48,7 @@ * @param m_ptr 使用するモンスターの構造体参照ポインタ * @return ビームが到達可能ならばTRUEを返す */ -bool direct_beam(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, monster_type *m_ptr) +bool direct_beam(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, monster_type *m_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; uint16_t grid_g[512]; @@ -90,7 +90,7 @@ bool direct_beam(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, * @param is_friend TRUEならば、プレイヤーを巻き込む時にブレスの判定をFALSEにする。 * @return ブレスを直接当てられるならばTRUEを返す */ -bool breath_direct(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, AttributeType typ, bool is_friend) +bool breath_direct(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, AttributeType typ, bool is_friend) { BIT_FLAGS flg; switch (typ) { @@ -185,7 +185,7 @@ bool breath_direct(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y * @param tx 目標X座標を返す参照ポインタ * @param flg 判定のフラグ配列 */ -void get_project_point(player_type *player_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg) +void get_project_point(PlayerType *player_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg) { uint16_t path_g[128]; int path_n = projection_path(player_ptr, path_g, get_max_range(player_ptr), sy, sx, *ty, *tx, flg); @@ -210,7 +210,7 @@ void get_project_point(player_type *player_ptr, POSITION sy, POSITION sx, POSITI * @param t_idx 目標のモンスターID * @return 魔力消去を使うべきならばTRUEを変えす。 */ -bool dispel_check_monster(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx) +bool dispel_check_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx) { monster_type *t_ptr = &player_ptr->current_floor_ptr->m_list[t_idx]; if (monster_invulner_remaining(t_ptr)) @@ -231,7 +231,7 @@ bool dispel_check_monster(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_ID * @param m_idx モンスターの構造体配列ID * @return 魔力消去をかけるべきならTRUEを返す。 */ -bool dispel_check(player_type *player_ptr, MONSTER_IDX m_idx) +bool dispel_check(PlayerType *player_ptr, MONSTER_IDX m_idx) { if (is_invuln(player_ptr)) return true; diff --git a/src/mspell/mspell-judgement.h b/src/mspell/mspell-judgement.h index d1c628cad..d996ddf6d 100644 --- a/src/mspell/mspell-judgement.h +++ b/src/mspell/mspell-judgement.h @@ -4,9 +4,9 @@ #include "effect/attribute-types.h" struct monster_type; -struct player_type; -bool direct_beam(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, monster_type *m_ptr); -bool breath_direct(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, AttributeType typ, bool is_friend); -void get_project_point(player_type *player_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg); -bool dispel_check_monster(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx); -bool dispel_check(player_type *player_ptr, MONSTER_IDX m_idx); +class PlayerType; +bool direct_beam(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, monster_type *m_ptr); +bool breath_direct(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, AttributeType typ, bool is_friend); +void get_project_point(PlayerType *player_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg); +bool dispel_check_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx); +bool dispel_check(PlayerType *player_ptr, MONSTER_IDX m_idx); diff --git a/src/mspell/mspell-learn-checker.cpp b/src/mspell/mspell-learn-checker.cpp index 42f3f0023..147d67d30 100644 --- a/src/mspell/mspell-learn-checker.cpp +++ b/src/mspell/mspell-learn-checker.cpp @@ -14,7 +14,7 @@ * * モンスターが特技を使う前にプレイヤーがモンスターを視認できているかどうかの判定用。 */ -bool spell_learnable(player_type *player_ptr, MONSTER_IDX m_idx) +bool spell_learnable(PlayerType *player_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; bool seen = (!player_ptr->blind && m_ptr->ml); diff --git a/src/mspell/mspell-learn-checker.h b/src/mspell/mspell-learn-checker.h index a4f64d268..ad2530340 100644 --- a/src/mspell/mspell-learn-checker.h +++ b/src/mspell/mspell-learn-checker.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool spell_learnable(player_type *player_ptr, MONSTER_IDX m_idx); +class PlayerType; +bool spell_learnable(PlayerType *player_ptr, MONSTER_IDX m_idx); diff --git a/src/mspell/mspell-lite.cpp b/src/mspell/mspell-lite.cpp index dc5bcacd3..a022a88ac 100644 --- a/src/mspell/mspell-lite.cpp +++ b/src/mspell/mspell-lite.cpp @@ -37,7 +37,7 @@ * @param path_check 射線を判定するための関数ポインタ * @return 有効な座標があった場合TRUEを返す */ -bool adjacent_grid_check(player_type *player_ptr, monster_type *m_ptr, POSITION *yp, POSITION *xp, FloorFeatureType f_flag, path_check_pf path_check) +bool adjacent_grid_check(PlayerType *player_ptr, monster_type *m_ptr, POSITION *yp, POSITION *xp, FloorFeatureType f_flag, path_check_pf path_check) { static int tonari_y[4][8] = { { -1, -1, -1, 0, 0, 1, 1, 1 }, { -1, -1, -1, 0, 0, 1, 1, 1 }, { 1, 1, 1, 0, 0, -1, -1, -1 }, { 1, 1, 1, 0, 0, -1, -1, -1 } }; static int tonari_x[4][8] = { { -1, 0, 1, -1, 1, -1, 0, 1 }, { 1, 0, -1, 1, -1, 1, 0, -1 }, { -1, 0, 1, -1, 1, -1, 0, 1 }, { 1, 0, -1, 1, -1, 1, 0, -1 } }; @@ -70,7 +70,7 @@ bool adjacent_grid_check(player_type *player_ptr, monster_type *m_ptr, POSITION return false; } -void decide_lite_range(player_type *player_ptr, msa_type *msa_ptr) +void decide_lite_range(PlayerType *player_ptr, msa_type *msa_ptr) { if (msa_ptr->ability_flags.has_not(MonsterAbilityType::BR_LITE)) return; @@ -106,7 +106,7 @@ static void feature_projection(floor_type *floor_ptr, msa_type *msa_ptr) msa_ptr->do_spell = DO_SPELL_BR_LITE; } -static void check_lite_area_by_mspell(player_type *player_ptr, msa_type *msa_ptr) +static void check_lite_area_by_mspell(PlayerType *player_ptr, msa_type *msa_ptr) { if (msa_ptr->ability_flags.has(MonsterAbilityType::BR_DISI) && (msa_ptr->m_ptr->cdis < get_max_range(player_ptr) / 2) && in_disintegration_range(player_ptr->current_floor_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, msa_ptr->y, msa_ptr->x) @@ -134,7 +134,7 @@ static void check_lite_area_by_mspell(player_type *player_ptr, msa_type *msa_ptr } } -static void decide_lite_breath(player_type *player_ptr, msa_type *msa_ptr) +static void decide_lite_breath(PlayerType *player_ptr, msa_type *msa_ptr) { if (msa_ptr->success) return; @@ -160,7 +160,7 @@ static void decide_lite_breath(player_type *player_ptr, msa_type *msa_ptr) msa_ptr->success = true; } -bool decide_lite_projection(player_type *player_ptr, msa_type *msa_ptr) +bool decide_lite_projection(PlayerType *player_ptr, msa_type *msa_ptr) { if (projectable(player_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, msa_ptr->y, msa_ptr->x)) { feature_projection(player_ptr->current_floor_ptr, msa_ptr); @@ -176,7 +176,7 @@ bool decide_lite_projection(player_type *player_ptr, msa_type *msa_ptr) return msa_ptr->success; } -void decide_lite_area(player_type *player_ptr, msa_type *msa_ptr) +void decide_lite_area(PlayerType *player_ptr, msa_type *msa_ptr) { if (msa_ptr->ability_flags.has_not(MonsterAbilityType::DARKNESS)) return; diff --git a/src/mspell/mspell-lite.h b/src/mspell/mspell-lite.h index 2859b2684..c3b652aff 100644 --- a/src/mspell/mspell-lite.h +++ b/src/mspell/mspell-lite.h @@ -4,10 +4,10 @@ struct monster_type; typedef struct msa_type msa_type; -struct player_type; -typedef bool (*path_check_pf)(player_type *, POSITION, POSITION, POSITION, POSITION); +class PlayerType; +typedef bool (*path_check_pf)(PlayerType *, POSITION, POSITION, POSITION, POSITION); enum class FloorFeatureType; -bool adjacent_grid_check(player_type *player_ptr, monster_type *m_ptr, POSITION *yp, POSITION *xp, FloorFeatureType f_flag, path_check_pf path_check); -void decide_lite_range(player_type *player_ptr, msa_type *msa_ptr); -bool decide_lite_projection(player_type *player_ptr, msa_type *msa_ptr); -void decide_lite_area(player_type *player_ptr, msa_type *msa_ptr); +bool adjacent_grid_check(PlayerType *player_ptr, monster_type *m_ptr, POSITION *yp, POSITION *xp, FloorFeatureType f_flag, path_check_pf path_check); +void decide_lite_range(PlayerType *player_ptr, msa_type *msa_ptr); +bool decide_lite_projection(PlayerType *player_ptr, msa_type *msa_ptr); +void decide_lite_area(PlayerType *player_ptr, msa_type *msa_ptr); diff --git a/src/mspell/mspell-particularity.cpp b/src/mspell/mspell-particularity.cpp index 7703b9c1e..893a7e923 100644 --- a/src/mspell/mspell-particularity.cpp +++ b/src/mspell/mspell-particularity.cpp @@ -31,7 +31,7 @@ * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF4_ROCKET(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF4_ROCKET(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かを射った。", "%^s shoots something."), _("%^sがロケットを発射した。", "%^s fires a rocket."), _("%^sが%sにロケットを発射した。", "%^s fires a rocket at %s.")); @@ -60,7 +60,7 @@ MonsterSpellResult spell_RF4_ROCKET(player_type *player_ptr, POSITION y, POSITIO * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF6_HAND_DOOM(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_HAND_DOOM(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_simple msg(_("%^sが<破滅の手>を放った!", "%^s invokes the Hand of Doom!"), _("%^sが%sに<破滅の手>を放った!", "%^s invokes the Hand of Doom upon %s!")); @@ -92,7 +92,7 @@ MonsterSpellResult spell_RF6_HAND_DOOM(player_type *player_ptr, POSITION y, POSI * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF6_PSY_SPEAR(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_PSY_SPEAR(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが光の剣を放った。", "%^s throw a Psycho-Spear."), _("%^sが%sに向かって光の剣を放った。", "%^s throw a Psycho-spear at %s.")); diff --git a/src/mspell/mspell-particularity.h b/src/mspell/mspell-particularity.h index c384d067f..e56f74db7 100644 --- a/src/mspell/mspell-particularity.h +++ b/src/mspell/mspell-particularity.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF4_ROCKET(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_HAND_DOOM(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_PSY_SPEAR(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF4_ROCKET(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_HAND_DOOM(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_PSY_SPEAR(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-selector.cpp b/src/mspell/mspell-selector.cpp index 784ba2843..63970a08e 100644 --- a/src/mspell/mspell-selector.cpp +++ b/src/mspell/mspell-selector.cpp @@ -198,7 +198,7 @@ static bool spell_world(MonsterAbilityType spell) * @param spell 判定対象のID * @return 特別効果魔法のIDならばTRUEを返す。 */ -static bool spell_special(player_type *player_ptr, MonsterAbilityType spell) +static bool spell_special(PlayerType *player_ptr, MonsterAbilityType spell) { if (player_ptr->phase_out) return false; @@ -260,7 +260,7 @@ static bool spell_dispel(MonsterAbilityType spell) * This function may well be an efficiency bottleneck.\n * @todo 長過ぎる。切り分けが必要 */ -MonsterAbilityType choose_attack_spell(player_type *player_ptr, msa_type *msa_ptr) +MonsterAbilityType choose_attack_spell(PlayerType *player_ptr, msa_type *msa_ptr) { std::vector escape; std::vector attack; diff --git a/src/mspell/mspell-selector.h b/src/mspell/mspell-selector.h index e77eed50c..ef3c76070 100644 --- a/src/mspell/mspell-selector.h +++ b/src/mspell/mspell-selector.h @@ -4,5 +4,5 @@ enum class MonsterAbilityType; typedef struct msa_type msa_type; -struct player_type; -MonsterAbilityType choose_attack_spell(player_type *player_ptr, msa_type *msa_ptr); +class PlayerType; +MonsterAbilityType choose_attack_spell(PlayerType *player_ptr, msa_type *msa_ptr); diff --git a/src/mspell/mspell-special.cpp b/src/mspell/mspell-special.cpp index dbfb931be..7755e52bd 100644 --- a/src/mspell/mspell-special.cpp +++ b/src/mspell/mspell-special.cpp @@ -42,7 +42,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param m_idx 呪文を唱えるモンスターID */ -static MonsterSpellResult spell_RF6_SPECIAL_BANORLUPART(player_type *player_ptr, MONSTER_IDX m_idx) +static MonsterSpellResult spell_RF6_SPECIAL_BANORLUPART(PlayerType *player_ptr, MONSTER_IDX m_idx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -109,7 +109,7 @@ static MonsterSpellResult spell_RF6_SPECIAL_BANORLUPART(player_type *player_ptr, * @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。 * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER */ -static MonsterSpellResult spell_RF6_SPECIAL_ROLENTO(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +static MonsterSpellResult spell_RF6_SPECIAL_ROLENTO(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { int count = 0, k; int num = 1 + randint1(3); @@ -138,7 +138,7 @@ static MonsterSpellResult spell_RF6_SPECIAL_ROLENTO(player_type *player_ptr, POS * @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。 * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER */ -static MonsterSpellResult spell_RF6_SPECIAL_B(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +static MonsterSpellResult spell_RF6_SPECIAL_B(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_simple msg; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -222,7 +222,7 @@ static MonsterSpellResult spell_RF6_SPECIAL_B(player_type *player_ptr, POSITION * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_SPECIAL(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_SPECIAL(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; diff --git a/src/mspell/mspell-special.h b/src/mspell/mspell-special.h index 5ec0a5e1b..7e1422758 100644 --- a/src/mspell/mspell-special.h +++ b/src/mspell/mspell-special.h @@ -4,5 +4,5 @@ struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF6_SPECIAL(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF6_SPECIAL(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-status.cpp b/src/mspell/mspell-status.cpp index 7d6f12586..99f46ce07 100644 --- a/src/mspell/mspell-status.cpp +++ b/src/mspell/mspell-status.cpp @@ -59,7 +59,7 @@ mspell_cast_msg_bad_status_to_monster::mspell_cast_msg_bad_status_to_monster(con * @param resist 耐性の有無を判別するフラグ * @param saved_throw 抵抗に成功したか判別するフラグ */ -void spell_badstatus_message_to_player(player_type *player_ptr, MONSTER_IDX m_idx, const mspell_cast_msg_bad_status_to_player &msgs, bool resist, +void spell_badstatus_message_to_player(PlayerType *player_ptr, MONSTER_IDX m_idx, const mspell_cast_msg_bad_status_to_player &msgs, bool resist, bool saved_throw) { GAME_TEXT m_name[MAX_NLEN]; @@ -89,7 +89,7 @@ void spell_badstatus_message_to_player(player_type *player_ptr, MONSTER_IDX m_id * @param resist 耐性の有無を判別するフラグ * @param saved_throw 抵抗に成功したか判別するフラグ */ -void spell_badstatus_message_to_mons(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_bad_status_to_monster &msgs, bool resist, +void spell_badstatus_message_to_mons(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_bad_status_to_monster &msgs, bool resist, bool saved_throw) { floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -133,7 +133,7 @@ void spell_badstatus_message_to_mons(player_type *player_ptr, MONSTER_IDX m_idx, * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_DRAIN_MANA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_DRAIN_MANA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { GAME_TEXT m_name[MAX_NLEN], t_name[MAX_NLEN]; monster_name(player_ptr, m_idx, m_name); @@ -168,7 +168,7 @@ MonsterSpellResult spell_RF5_DRAIN_MANA(player_type *player_ptr, POSITION y, POS * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_MIND_BLAST(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_MIND_BLAST(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; bool seen = (!player_ptr->blind && m_ptr->ml); @@ -206,7 +206,7 @@ MonsterSpellResult spell_RF5_MIND_BLAST(player_type *player_ptr, POSITION y, POS * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF5_BRAIN_SMASH(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BRAIN_SMASH(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; bool seen = (!player_ptr->blind && m_ptr->ml); @@ -241,7 +241,7 @@ MonsterSpellResult spell_RF5_BRAIN_SMASH(player_type *player_ptr, POSITION y, PO * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_SCARE(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_SCARE(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(); res.learnable = TARGET_TYPE == MONSTER_TO_PLAYER; @@ -297,7 +297,7 @@ MonsterSpellResult spell_RF5_SCARE(MONSTER_IDX m_idx, player_type *player_ptr, M * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_BLIND(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_BLIND(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(); res.learnable = TARGET_TYPE == MONSTER_TO_PLAYER; @@ -362,7 +362,7 @@ MonsterSpellResult spell_RF5_BLIND(MONSTER_IDX m_idx, player_type *player_ptr, M * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_CONF(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_CONF(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(); res.learnable = TARGET_TYPE == MONSTER_TO_PLAYER; @@ -419,7 +419,7 @@ MonsterSpellResult spell_RF5_CONF(MONSTER_IDX m_idx, player_type *player_ptr, MO * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_HOLD(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_HOLD(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(); res.learnable = TARGET_TYPE == MONSTER_TO_PLAYER; @@ -475,7 +475,7 @@ MonsterSpellResult spell_RF5_HOLD(MONSTER_IDX m_idx, player_type *player_ptr, MO * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_HASTE(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_HASTE(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { bool see_m = see_monster(player_ptr, m_idx); monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; @@ -507,7 +507,7 @@ MonsterSpellResult spell_RF6_HASTE(player_type *player_ptr, MONSTER_IDX m_idx, M * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF5_SLOW(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF5_SLOW(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(); res.learnable = TARGET_TYPE == MONSTER_TO_PLAYER; @@ -573,7 +573,7 @@ MonsterSpellResult spell_RF5_SLOW(MONSTER_IDX m_idx, player_type *player_ptr, MO * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_HEAL(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_HEAL(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { const auto res = MonsterSpellResult::make_valid(); @@ -639,7 +639,7 @@ MonsterSpellResult spell_RF6_HEAL(player_type *player_ptr, MONSTER_IDX m_idx, MO * * ラーニング不可。 */ -MonsterSpellResult spell_RF6_INVULNER(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_INVULNER(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; bool seen = (!player_ptr->blind && m_ptr->ml); @@ -680,7 +680,7 @@ MonsterSpellResult spell_RF6_INVULNER(player_type *player_ptr, MONSTER_IDX m_idx * * ラーニング可。 */ -MonsterSpellResult spell_RF6_FORGET(player_type *player_ptr, MONSTER_IDX m_idx) +MonsterSpellResult spell_RF6_FORGET(PlayerType *player_ptr, MONSTER_IDX m_idx) { DEPTH rlev = monster_level_idx(player_ptr->current_floor_ptr, m_idx); GAME_TEXT m_name[MAX_NLEN]; diff --git a/src/mspell/mspell-status.h b/src/mspell/mspell-status.h index 12c3df02b..b03ff62f7 100644 --- a/src/mspell/mspell-status.h +++ b/src/mspell/mspell-status.h @@ -4,7 +4,7 @@ struct MonsterSpellResult; -struct player_type; +class PlayerType; struct mspell_cast_msg_bad_status_to_player { mspell_cast_msg_bad_status_to_player(concptr blind, concptr not_blind, concptr resist, concptr saved_throw); @@ -24,19 +24,19 @@ struct mspell_cast_msg_bad_status_to_monster { concptr success; /*成功時*/ }; -void spell_badstatus_message_to_player(player_type *player_ptr, MONSTER_IDX m_idx, const mspell_cast_msg_bad_status_to_player &msgs, bool resist, +void spell_badstatus_message_to_player(PlayerType *player_ptr, MONSTER_IDX m_idx, const mspell_cast_msg_bad_status_to_player &msgs, bool resist, bool saved_throw); -void spell_badstatus_message_to_mons(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_bad_status_to_monster &msgs, bool resist, +void spell_badstatus_message_to_mons(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_bad_status_to_monster &msgs, bool resist, bool saved_throw); -MonsterSpellResult spell_RF5_DRAIN_MANA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_MIND_BLAST(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BRAIN_SMASH(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_SCARE(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_BLIND(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_CONF(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_HOLD(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_HASTE(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF5_SLOW(MONSTER_IDX m_idx, player_type *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_HEAL(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_INVULNER(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_FORGET(player_type *player_ptr, MONSTER_IDX m_idx); +MonsterSpellResult spell_RF5_DRAIN_MANA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_MIND_BLAST(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BRAIN_SMASH(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_SCARE(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_BLIND(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_CONF(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_HOLD(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_HASTE(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF5_SLOW(MONSTER_IDX m_idx, PlayerType *player_ptr, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_HEAL(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_INVULNER(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_FORGET(PlayerType *player_ptr, MONSTER_IDX m_idx); diff --git a/src/mspell/mspell-summon.cpp b/src/mspell/mspell-summon.cpp index e4375870c..85b68d0a3 100644 --- a/src/mspell/mspell-summon.cpp +++ b/src/mspell/mspell-summon.cpp @@ -56,7 +56,7 @@ static BIT_FLAGS monster_u_mode(floor_type *floor_ptr, MONSTER_IDX m_idx) * @param m_idx 呪文を唱えるモンスターID * @return 召喚したモンスターの数を返す。 */ -static MONSTER_NUMBER summon_Kin(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +static MONSTER_NUMBER summon_Kin(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { int count = 0; for (int k = 0; k < 4; k++) { @@ -67,7 +67,7 @@ static MONSTER_NUMBER summon_Kin(player_type *player_ptr, POSITION y, POSITION x } static void decide_summon_kin_caster( - player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type, concptr m_name, concptr m_poss, const bool known) + PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type, concptr m_name, concptr m_poss, const bool known) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -114,7 +114,7 @@ static void decide_summon_kin_caster( * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_KIN(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type) +MonsterSpellResult spell_RF6_S_KIN(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -211,7 +211,7 @@ MonsterSpellResult spell_RF6_S_KIN(player_type *player_ptr, POSITION y, POSITION * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_CYBER(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_CYBER(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { int count = 0; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -254,7 +254,7 @@ MonsterSpellResult spell_RF6_S_CYBER(player_type *player_ptr, POSITION y, POSITI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_MONSTER(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_MONSTER(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法で仲間を召喚した!", "%^s magically summons help!"), _("%^sが魔法で仲間を召喚した!", "%^s magically summons help!")); @@ -297,7 +297,7 @@ MonsterSpellResult spell_RF6_S_MONSTER(player_type *player_ptr, POSITION y, POSI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_MONSTERS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_MONSTERS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法でモンスターを召喚した!", "%^s magically summons monsters!"), _("%^sが魔法でモンスターを召喚した!", "%^s magically summons monsters!")); @@ -340,7 +340,7 @@ MonsterSpellResult spell_RF6_S_MONSTERS(player_type *player_ptr, POSITION y, POS * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_ANT(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_ANT(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法でアリを召喚した。", "%^s magically summons ants."), _("%^sが魔法でアリを召喚した。", "%^s magically summons ants.")); @@ -379,7 +379,7 @@ MonsterSpellResult spell_RF6_S_ANT(player_type *player_ptr, POSITION y, POSITION * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_SPIDER(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_SPIDER(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法でクモを召喚した。", "%^s magically summons spiders."), _("%^sが魔法でクモを召喚した。", "%^s magically summons spiders.")); @@ -418,7 +418,7 @@ MonsterSpellResult spell_RF6_S_SPIDER(player_type *player_ptr, POSITION y, POSIT * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_HOUND(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_HOUND(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法でハウンドを召喚した。", "%^s magically summons hounds."), _("%^sが魔法でハウンドを召喚した。", "%^s magically summons hounds.")); @@ -457,7 +457,7 @@ MonsterSpellResult spell_RF6_S_HOUND(player_type *player_ptr, POSITION y, POSITI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_HYDRA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_HYDRA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法でヒドラを召喚した。", "%^s magically summons hydras."), _("%^sが魔法でヒドラを召喚した。", "%^s magically summons hydras.")); @@ -496,7 +496,7 @@ MonsterSpellResult spell_RF6_S_HYDRA(player_type *player_ptr, POSITION y, POSITI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_ANGEL(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_ANGEL(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法で天使を召喚した!", "%^s magically summons an angel!"), _("%^sが魔法で天使を召喚した!", "%^s magically summons an angel!")); @@ -546,7 +546,7 @@ MonsterSpellResult spell_RF6_S_ANGEL(player_type *player_ptr, POSITION y, POSITI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_DEMON(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_DEMON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sは魔法で混沌の宮廷から悪魔を召喚した!", "%^s magically summons a demon from the Courts of Chaos!"), @@ -585,7 +585,7 @@ MonsterSpellResult spell_RF6_S_DEMON(player_type *player_ptr, POSITION y, POSITI * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_UNDEAD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_UNDEAD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法でアンデッドの強敵を召喚した!", "%^s magically summons an undead adversary!"), @@ -624,7 +624,7 @@ MonsterSpellResult spell_RF6_S_UNDEAD(player_type *player_ptr, POSITION y, POSIT * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_DRAGON(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_DRAGON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法でドラゴンを召喚した!", "%^s magically summons a dragon!"), _("%^sが魔法でドラゴンを召喚した!", "%^s magically summons a dragon!")); @@ -665,7 +665,7 @@ MonsterSpellResult spell_RF6_S_DRAGON(player_type *player_ptr, POSITION y, POSIT * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_HI_UNDEAD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_HI_UNDEAD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { GAME_TEXT m_name[MAX_NLEN]; monster_name(player_ptr, m_idx, m_name); @@ -720,7 +720,7 @@ MonsterSpellResult spell_RF6_S_HI_UNDEAD(player_type *player_ptr, POSITION y, PO * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_HI_DRAGON(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_HI_DRAGON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法で古代ドラゴンを召喚した!", "%^s magically summons ancient dragons!"), @@ -765,7 +765,7 @@ MonsterSpellResult spell_RF6_S_HI_DRAGON(player_type *player_ptr, POSITION y, PO * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_AMBERITES(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_AMBERITES(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sがアンバーの王族を召喚した!", "%^s magically summons Lords of Amber!"), @@ -806,7 +806,7 @@ MonsterSpellResult spell_RF6_S_AMBERITES(player_type *player_ptr, POSITION y, PO * * プレイヤーが対象ならラーニング可。 */ -MonsterSpellResult spell_RF6_S_UNIQUE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF6_S_UNIQUE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが魔法で特別な強敵を召喚した!", "%^s magically summons special opponents!"), diff --git a/src/mspell/mspell-summon.h b/src/mspell/mspell-summon.h index 17390b8da..38936b17f 100644 --- a/src/mspell/mspell-summon.h +++ b/src/mspell/mspell-summon.h @@ -4,20 +4,20 @@ struct MonsterSpellResult; -struct player_type; -MonsterSpellResult spell_RF6_S_KIN(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_CYBER(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_MONSTER(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_MONSTERS(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_ANT(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_SPIDER(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_HOUND(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_HYDRA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_ANGEL(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_DEMON(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_UNDEAD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_DRAGON(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_HI_UNDEAD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_HI_DRAGON(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_AMBERITES(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MonsterSpellResult spell_RF6_S_UNIQUE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +class PlayerType; +MonsterSpellResult spell_RF6_S_KIN(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_CYBER(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_MONSTER(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_MONSTERS(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_ANT(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_SPIDER(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_HOUND(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_HYDRA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_ANGEL(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_DEMON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_UNDEAD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_DRAGON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_HI_UNDEAD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_HI_DRAGON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_AMBERITES(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF6_S_UNIQUE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-util.cpp b/src/mspell/mspell-util.cpp index 7d6fbcbaa..d888c8e71 100644 --- a/src/mspell/mspell-util.cpp +++ b/src/mspell/mspell-util.cpp @@ -32,7 +32,7 @@ mspell_cast_msg_simple::mspell_cast_msg_simple(concptr to_player, concptr to_mon * @param m_idx モンスターID * @return プレイヤーがモンスターを見ることができるならTRUE、そうでなければFALSEを返す。 */ -bool see_monster(player_type* player_ptr, MONSTER_IDX m_idx) +bool see_monster(PlayerType* player_ptr, MONSTER_IDX m_idx) { monster_type* m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; return is_seen(player_ptr, m_ptr); @@ -62,7 +62,7 @@ bool monster_near_player(floor_type* floor_ptr, MONSTER_IDX m_idx, MONSTER_IDX t * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER * @return メッセージを表示した場合trueを返す。 */ -bool monspell_message_base(player_type* player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg &msgs, bool msg_flag_aux, int TARGET_TYPE) +bool monspell_message_base(PlayerType* player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg &msgs, bool msg_flag_aux, int TARGET_TYPE) { bool notice = false; floor_type* floor_ptr = player_ptr->current_floor_ptr; @@ -110,7 +110,7 @@ bool monspell_message_base(player_type* player_ptr, MONSTER_IDX m_idx, MONSTER_I * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER * @return メッセージを表示した場合trueを返す。 */ -bool monspell_message(player_type* player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_blind &msgs, int TARGET_TYPE) +bool monspell_message(PlayerType* player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_blind &msgs, int TARGET_TYPE) { return monspell_message_base(player_ptr, m_idx, t_idx, mspell_cast_msg(msgs.blind, msgs.blind, msgs.to_player, msgs.to_mons), player_ptr->blind > 0, TARGET_TYPE); } @@ -123,7 +123,7 @@ bool monspell_message(player_type* player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_ * @param msgs メッセージの構造体 * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER */ -void simple_monspell_message(player_type* player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_simple &msgs, int TARGET_TYPE) +void simple_monspell_message(PlayerType* player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_simple &msgs, int TARGET_TYPE) { monspell_message_base(player_ptr, m_idx, t_idx, mspell_cast_msg(msgs.to_player, msgs.to_mons, msgs.to_player, msgs.to_mons), player_ptr->blind > 0, TARGET_TYPE); diff --git a/src/mspell/mspell-util.h b/src/mspell/mspell-util.h index e017249ef..6f1d5ac53 100644 --- a/src/mspell/mspell-util.h +++ b/src/mspell/mspell-util.h @@ -12,7 +12,7 @@ #define RF6_SPELL_START 32 * 5 struct floor_type; -struct player_type; +class PlayerType; struct mspell_cast_msg { mspell_cast_msg(concptr to_player_true, concptr to_mons_true, concptr to_player_false, concptr to_mons_false); @@ -38,8 +38,8 @@ struct mspell_cast_msg_simple { concptr to_mons; /*!< モンスター対象*/ }; -bool see_monster(player_type *player_ptr, MONSTER_IDX m_idx); +bool see_monster(PlayerType *player_ptr, MONSTER_IDX m_idx); bool monster_near_player(floor_type *floor_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx); -bool monspell_message_base(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg &msgs, bool msg_flag_aux, int TARGET_TYPE); -bool monspell_message(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_blind &msgs, int TARGET_TYPE); -void simple_monspell_message(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_simple &msgs, int TARGET_TYPE); +bool monspell_message_base(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg &msgs, bool msg_flag_aux, int TARGET_TYPE); +bool monspell_message(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_blind &msgs, int TARGET_TYPE); +void simple_monspell_message(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_simple &msgs, int TARGET_TYPE); diff --git a/src/mspell/smart-mspell-util.cpp b/src/mspell/smart-mspell-util.cpp index 4b480b2f3..5e22f71da 100644 --- a/src/mspell/smart-mspell-util.cpp +++ b/src/mspell/smart-mspell-util.cpp @@ -8,7 +8,7 @@ #include "system/monster-type-definition.h" #include "system/player-type-definition.h" -msr_type *initialize_msr_type(player_type *player_ptr, msr_type *msr_ptr, MONSTER_IDX m_idx, const EnumClassFlagGroup &ability_flags) +msr_type *initialize_msr_type(PlayerType *player_ptr, msr_type *msr_ptr, MONSTER_IDX m_idx, const EnumClassFlagGroup &ability_flags) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; msr_ptr->r_ptr = &r_info[m_ptr->r_idx]; diff --git a/src/mspell/smart-mspell-util.h b/src/mspell/smart-mspell-util.h index 709390696..96dfaa196 100644 --- a/src/mspell/smart-mspell-util.h +++ b/src/mspell/smart-mspell-util.h @@ -13,6 +13,6 @@ typedef struct msr_type { EnumClassFlagGroup smart; } msr_type; -struct player_type; -msr_type *initialize_msr_type(player_type *player_ptr, msr_type *msr_ptr, MONSTER_IDX m_idx, const EnumClassFlagGroup &ability_flags); +class PlayerType; +msr_type *initialize_msr_type(PlayerType *player_ptr, msr_type *msr_ptr, MONSTER_IDX m_idx, const EnumClassFlagGroup &ability_flags); bool int_outof(monster_race *r_ptr, PERCENTAGE prob); diff --git a/src/mspell/specified-summon.cpp b/src/mspell/specified-summon.cpp index 18a399a99..ed2ed6648 100644 --- a/src/mspell/specified-summon.cpp +++ b/src/mspell/specified-summon.cpp @@ -26,7 +26,7 @@ * @param m_idx 呪文を唱えるモンスターID * @return 召喚したモンスターの数を返す。 */ -MONSTER_NUMBER summon_EAGLE(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_EAGLE(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { int count = 0; int num = 4 + randint1(3); @@ -46,7 +46,7 @@ MONSTER_NUMBER summon_EAGLE(player_type *player_ptr, POSITION y, POSITION x, int * @param m_idx 呪文を唱えるモンスターID * @return 召喚したモンスターの数を返す。 */ -MONSTER_NUMBER summon_EDGE(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_EDGE(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { int count = 0; int num = 2 + randint1(1 + rlev / 20); @@ -67,7 +67,7 @@ MONSTER_NUMBER summon_EDGE(player_type *player_ptr, POSITION y, POSITION x, int * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER * @return 召喚したモンスターの数を返す。 */ -MONSTER_NUMBER summon_guardian(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MONSTER_NUMBER summon_guardian(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { int num = 2 + randint1(3); bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER); @@ -101,7 +101,7 @@ MONSTER_NUMBER summon_guardian(player_type *player_ptr, POSITION y, POSITION x, * @param m_idx 呪文を唱えるモンスターID * @return 召喚したモンスターの数を返す。 */ -MONSTER_NUMBER summon_LOCKE_CLONE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_LOCKE_CLONE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) { int count = 0; int num = randint1(3); @@ -121,7 +121,7 @@ MONSTER_NUMBER summon_LOCKE_CLONE(player_type *player_ptr, POSITION y, POSITION * @param m_idx 呪文を唱えるモンスターID * @return 召喚したモンスターの数を返す。 */ -MONSTER_NUMBER summon_LOUSE(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_LOUSE(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { int count = 0; int num = 2 + randint1(3); @@ -131,7 +131,7 @@ MONSTER_NUMBER summon_LOUSE(player_type *player_ptr, POSITION y, POSITION x, int return count; } -MONSTER_NUMBER summon_MOAI(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_MOAI(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { int count = 0; int num = 3 + randint1(3); @@ -141,7 +141,7 @@ MONSTER_NUMBER summon_MOAI(player_type *player_ptr, POSITION y, POSITION x, int return count; } -MONSTER_NUMBER summon_DEMON_SLAYER(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_DEMON_SLAYER(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) { monster_race *r_ptr = &r_info[MON_DEMON_SLAYER_MEMBER]; if (r_ptr->max_num == 0) { @@ -167,7 +167,7 @@ MONSTER_NUMBER summon_DEMON_SLAYER(player_type *player_ptr, POSITION y, POSITION * @param m_idx 呪文を唱えるモンスターID * @return 召喚したモンスターの数を返す。 */ -MONSTER_NUMBER summon_NAZGUL(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_NAZGUL(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) { BIT_FLAGS mode = 0L; POSITION cy = y; @@ -218,7 +218,7 @@ MONSTER_NUMBER summon_NAZGUL(player_type *player_ptr, POSITION y, POSITION x, MO return count; } -MONSTER_NUMBER summon_APOCRYPHA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_APOCRYPHA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) { int count = 0; int num = 4 + randint1(4); @@ -229,7 +229,7 @@ MONSTER_NUMBER summon_APOCRYPHA(player_type *player_ptr, POSITION y, POSITION x, return count; } -MONSTER_NUMBER summon_HIGHEST_DRAGON(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_HIGHEST_DRAGON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) { int count = 0; int num = 4 + randint1(4); @@ -239,7 +239,7 @@ MONSTER_NUMBER summon_HIGHEST_DRAGON(player_type *player_ptr, POSITION y, POSITI return count; } -MONSTER_NUMBER summon_PYRAMID(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_PYRAMID(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { int count = 0; int num = 2 + randint1(3); @@ -249,7 +249,7 @@ MONSTER_NUMBER summon_PYRAMID(player_type *player_ptr, POSITION y, POSITION x, i return count; } -MONSTER_NUMBER summon_EYE_PHORN(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_EYE_PHORN(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { int count = 0; int num = 2 + randint1(1 + rlev / 20); @@ -259,7 +259,7 @@ MONSTER_NUMBER summon_EYE_PHORN(player_type *player_ptr, POSITION y, POSITION x, return count; } -MONSTER_NUMBER summon_VESPOID(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_VESPOID(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { int count = 0; int num = 2 + randint1(3); @@ -269,7 +269,7 @@ MONSTER_NUMBER summon_VESPOID(player_type *player_ptr, POSITION y, POSITION x, i return count; } -MONSTER_NUMBER summon_THUNDERS(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_THUNDERS(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { auto count = (MONSTER_NUMBER)0; auto num = 11; @@ -288,7 +288,7 @@ MONSTER_NUMBER summon_THUNDERS(player_type *player_ptr, POSITION y, POSITION x, * @param m_idx 呪文を唱えるモンスターID * @return 召喚したモンスターの数を返す。 */ -MONSTER_NUMBER summon_YENDER_WIZARD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_YENDER_WIZARD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx) { auto *r_ptr = &r_info[MON_YENDOR_WIZARD_2]; if (r_ptr->max_num == 0) { @@ -306,7 +306,7 @@ MONSTER_NUMBER summon_YENDER_WIZARD(player_type *player_ptr, POSITION y, POSITIO return count; } -MONSTER_NUMBER summon_PLASMA(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) +MONSTER_NUMBER summon_PLASMA(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx) { auto count = 0; auto num = 2 + randint1(1 + rlev / 20); diff --git a/src/mspell/specified-summon.h b/src/mspell/specified-summon.h index 247b87aa5..d97f49437 100644 --- a/src/mspell/specified-summon.h +++ b/src/mspell/specified-summon.h @@ -2,20 +2,20 @@ #include "system/angband.h" -struct player_type; -MONSTER_NUMBER summon_EAGLE(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_EDGE(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_guardian(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); -MONSTER_NUMBER summon_LOCKE_CLONE(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_LOUSE(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_MOAI(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_DEMON_SLAYER(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_NAZGUL(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_APOCRYPHA(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_HIGHEST_DRAGON(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_PYRAMID(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_EYE_PHORN(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_VESPOID(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_YENDER_WIZARD(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_THUNDERS(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); -MONSTER_NUMBER summon_PLASMA(player_type *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +class PlayerType; +MONSTER_NUMBER summon_EAGLE(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_EDGE(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_guardian(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MONSTER_NUMBER summon_LOCKE_CLONE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_LOUSE(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_MOAI(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_DEMON_SLAYER(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_NAZGUL(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_APOCRYPHA(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_HIGHEST_DRAGON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_PYRAMID(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_EYE_PHORN(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_VESPOID(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_YENDER_WIZARD(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_THUNDERS(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); +MONSTER_NUMBER summon_PLASMA(PlayerType *player_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx); diff --git a/src/mspell/summon-checker.cpp b/src/mspell/summon-checker.cpp index 2d8e1eb34..7e1d36e2b 100644 --- a/src/mspell/summon-checker.cpp +++ b/src/mspell/summon-checker.cpp @@ -21,7 +21,7 @@ * @return 召喚条件が一致するならtrue * @details */ -bool check_summon_specific(player_type *player_ptr, MONRACE_IDX summoner_idx, MONRACE_IDX r_idx) +bool check_summon_specific(PlayerType *player_ptr, MONRACE_IDX summoner_idx, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; bool is_match = false; diff --git a/src/mspell/summon-checker.h b/src/mspell/summon-checker.h index f3e01c004..63de2474c 100644 --- a/src/mspell/summon-checker.h +++ b/src/mspell/summon-checker.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool check_summon_specific(player_type *player_ptr, MONRACE_IDX summoner_idx, MONRACE_IDX r_idx); +class PlayerType; +bool check_summon_specific(PlayerType *player_ptr, MONRACE_IDX summoner_idx, MONRACE_IDX r_idx); diff --git a/src/mutation/gain-mutation-switcher.cpp b/src/mutation/gain-mutation-switcher.cpp index 54b545c53..dc7f95da9 100644 --- a/src/mutation/gain-mutation-switcher.cpp +++ b/src/mutation/gain-mutation-switcher.cpp @@ -3,7 +3,7 @@ #include "mutation/mutation-util.h" #include "system/player-type-definition.h" -void switch_gain_mutation(player_type *player_ptr, glm_type *glm_ptr) +void switch_gain_mutation(PlayerType *player_ptr, glm_type *glm_ptr) { switch (glm_ptr->choose_mut ? glm_ptr->choose_mut : (player_ptr->pclass == PlayerClassType::BERSERKER ? 74 + randint1(119) : randint1(193))) { case 1: diff --git a/src/mutation/gain-mutation-switcher.h b/src/mutation/gain-mutation-switcher.h index 023d3597a..3f507fee6 100644 --- a/src/mutation/gain-mutation-switcher.h +++ b/src/mutation/gain-mutation-switcher.h @@ -1,5 +1,5 @@ #pragma once typedef struct glm_type glm_type; -struct player_type; -void switch_gain_mutation(player_type *player_ptr, glm_type *gm_ptr); +class PlayerType; +void switch_gain_mutation(PlayerType *player_ptr, glm_type *gm_ptr); diff --git a/src/mutation/lose-mutation-switcher.cpp b/src/mutation/lose-mutation-switcher.cpp index eed86c695..e85eb804c 100644 --- a/src/mutation/lose-mutation-switcher.cpp +++ b/src/mutation/lose-mutation-switcher.cpp @@ -3,7 +3,7 @@ #include "mutation/mutation-util.h" #include "system/player-type-definition.h" -void switch_lose_mutation(player_type *player_ptr, glm_type *glm_ptr) +void switch_lose_mutation(PlayerType *player_ptr, glm_type *glm_ptr) { switch ((glm_ptr->choose_mut != 0) ? glm_ptr->choose_mut : randint1(193)) { case 1: diff --git a/src/mutation/lose-mutation-switcher.h b/src/mutation/lose-mutation-switcher.h index 69b1bbce7..72e7e4788 100644 --- a/src/mutation/lose-mutation-switcher.h +++ b/src/mutation/lose-mutation-switcher.h @@ -1,5 +1,5 @@ #pragma once typedef struct glm_type glm_type; -struct player_type; -void switch_lose_mutation(player_type *player_ptr, glm_type *glm_ptr); +class PlayerType; +void switch_lose_mutation(PlayerType *player_ptr, glm_type *glm_ptr); diff --git a/src/mutation/mutation-calculator.cpp b/src/mutation/mutation-calculator.cpp index a65888a4e..27e4f27f9 100644 --- a/src/mutation/mutation-calculator.cpp +++ b/src/mutation/mutation-calculator.cpp @@ -19,7 +19,7 @@ * @brief 現在プレイヤー得ている突然変異の数を返す。 * @return 現在得ている突然変異の数 */ -static int count_mutations(player_type *player_ptr) +static int count_mutations(PlayerType *player_ptr) { return player_ptr->muta.count(); } @@ -32,7 +32,7 @@ static int count_mutations(player_type *player_ptr) * Beastman get 10 "free" mutations and only 5% decrease per additional mutation. * Max 90% decrease in regeneration speed. */ -int calc_mutant_regenerate_mod(player_type *player_ptr) +int calc_mutant_regenerate_mod(PlayerType *player_ptr) { int regen; int mod = 10; diff --git a/src/mutation/mutation-calculator.h b/src/mutation/mutation-calculator.h index 30864f29b..62b95721b 100644 --- a/src/mutation/mutation-calculator.h +++ b/src/mutation/mutation-calculator.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -int calc_mutant_regenerate_mod(player_type *player_ptr); +class PlayerType; +int calc_mutant_regenerate_mod(PlayerType *player_ptr); diff --git a/src/mutation/mutation-investor-remover.cpp b/src/mutation/mutation-investor-remover.cpp index f72c81a67..b98050e81 100644 --- a/src/mutation/mutation-investor-remover.cpp +++ b/src/mutation/mutation-investor-remover.cpp @@ -11,7 +11,7 @@ #include "util/bit-flags-calculator.h" #include "view/display-messages.h" -static void sweep_gain_mutation(player_type *player_ptr, glm_type *gm_ptr) +static void sweep_gain_mutation(PlayerType *player_ptr, glm_type *gm_ptr) { int attempts_left = 20; if (gm_ptr->choose_mut) @@ -27,7 +27,7 @@ static void sweep_gain_mutation(player_type *player_ptr, glm_type *gm_ptr) } } -static void race_dependent_mutation(player_type *player_ptr, glm_type *gm_ptr) +static void race_dependent_mutation(PlayerType *player_ptr, glm_type *gm_ptr) { if (gm_ptr->choose_mut != 0) return; @@ -62,7 +62,7 @@ static void race_dependent_mutation(player_type *player_ptr, glm_type *gm_ptr) } } -static void neutralize_base_status(player_type *player_ptr, glm_type *gm_ptr) +static void neutralize_base_status(PlayerType *player_ptr, glm_type *gm_ptr) { if (gm_ptr->muta_which == PlayerMutationType::PUNY) { if (player_ptr->muta.has(PlayerMutationType::HYPER_STR)) { @@ -174,7 +174,7 @@ static void neutralize_base_status(player_type *player_ptr, glm_type *gm_ptr) } } -static void neutralize_other_status(player_type *player_ptr, glm_type *gm_ptr) +static void neutralize_other_status(PlayerType *player_ptr, glm_type *gm_ptr) { if (gm_ptr->muta_which == PlayerMutationType::COWARDICE) { if (player_ptr->muta.has(PlayerMutationType::FEARLESS)) { @@ -202,7 +202,7 @@ static void neutralize_other_status(player_type *player_ptr, glm_type *gm_ptr) * @brief プレイヤーに突然変異を与える * @param choose_mut 与えたい突然変異のID、0ならばランダムに選択 */ -bool gain_mutation(player_type *player_ptr, MUTATION_IDX choose_mut) +bool gain_mutation(PlayerType *player_ptr, MUTATION_IDX choose_mut) { glm_type tmp_gm; glm_type *gm_ptr = initialize_glm_type(&tmp_gm, choose_mut); @@ -228,7 +228,7 @@ bool gain_mutation(player_type *player_ptr, MUTATION_IDX choose_mut) return true; } -static void sweep_lose_mutation(player_type *player_ptr, glm_type *glm_ptr) +static void sweep_lose_mutation(PlayerType *player_ptr, glm_type *glm_ptr) { int attempts_left = 20; if (glm_ptr->choose_mut) @@ -251,7 +251,7 @@ static void sweep_lose_mutation(player_type *player_ptr, glm_type *glm_ptr) * @brief プレイヤーから突然変異を取り除く * @param choose_mut 取り除きたい突然変異のID、0ならばランダムに消去 */ -bool lose_mutation(player_type *player_ptr, MUTATION_IDX choose_mut) +bool lose_mutation(PlayerType *player_ptr, MUTATION_IDX choose_mut) { glm_type tmp_glm; glm_type *glm_ptr = initialize_glm_type(&tmp_glm, choose_mut); @@ -269,7 +269,7 @@ bool lose_mutation(player_type *player_ptr, MUTATION_IDX choose_mut) return true; } -void lose_all_mutations(player_type *player_ptr) +void lose_all_mutations(PlayerType *player_ptr) { if (player_ptr->muta.any()) { chg_virtue(player_ptr, V_CHANCE, -5); diff --git a/src/mutation/mutation-investor-remover.h b/src/mutation/mutation-investor-remover.h index e71cf4e80..f0ae0228a 100644 --- a/src/mutation/mutation-investor-remover.h +++ b/src/mutation/mutation-investor-remover.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -bool gain_mutation(player_type *player_ptr, MUTATION_IDX choose_mut); -bool lose_mutation(player_type *player_ptr, MUTATION_IDX choose_mut); -void lose_all_mutations(player_type *player_ptr); +class PlayerType; +bool gain_mutation(PlayerType *player_ptr, MUTATION_IDX choose_mut); +bool lose_mutation(PlayerType *player_ptr, MUTATION_IDX choose_mut); +void lose_all_mutations(PlayerType *player_ptr); diff --git a/src/mutation/mutation-processor.cpp b/src/mutation/mutation-processor.cpp index cbe6ff4dd..3f95e54af 100644 --- a/src/mutation/mutation-processor.cpp +++ b/src/mutation/mutation-processor.cpp @@ -52,7 +52,7 @@ #include "term/screen-processor.h" #include "view/display-messages.h" -static bool get_hack_dir(player_type *player_ptr, DIRECTION *dp) +static bool get_hack_dir(PlayerType *player_ptr, DIRECTION *dp) { *dp = 0; char command; @@ -112,7 +112,7 @@ static bool get_hack_dir(player_type *player_ptr, DIRECTION *dp) * @brief 10ゲームターンが進行するごとに突然変異の発動判定を行う処理 * / Handle mutation effects once every 10 game turns */ -void process_world_aux_mutation(player_type *player_ptr) +void process_world_aux_mutation(PlayerType *player_ptr) { if (player_ptr->muta.none() || player_ptr->phase_out || player_ptr->wild_mode) { return; @@ -471,7 +471,7 @@ void process_world_aux_mutation(player_type *player_ptr) } } -bool drop_weapons(player_type *player_ptr) +bool drop_weapons(PlayerType *player_ptr) { INVENTORY_IDX slot = 0; object_type *o_ptr = nullptr; diff --git a/src/mutation/mutation-processor.h b/src/mutation/mutation-processor.h index 1ab1b921e..4e2c45998 100644 --- a/src/mutation/mutation-processor.h +++ b/src/mutation/mutation-processor.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void process_world_aux_mutation(player_type *player_ptr); -bool drop_weapons(player_type *player_ptr); +class PlayerType; +void process_world_aux_mutation(PlayerType *player_ptr); +bool drop_weapons(PlayerType *player_ptr); diff --git a/src/mutation/mutation-techniques.cpp b/src/mutation/mutation-techniques.cpp index fbd3be849..20d5c498c 100644 --- a/src/mutation/mutation-techniques.cpp +++ b/src/mutation/mutation-techniques.cpp @@ -26,7 +26,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return コマンドの入力方向に地形があればTRUE */ -bool eat_rock(player_type *player_ptr) +bool eat_rock(PlayerType *player_ptr) { DIRECTION dir; if (!get_direction(player_ptr, &dir, false, false)) diff --git a/src/mutation/mutation-techniques.h b/src/mutation/mutation-techniques.h index b1df1b7da..ee9ac2663 100644 --- a/src/mutation/mutation-techniques.h +++ b/src/mutation/mutation-techniques.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool eat_rock(player_type *player_ptr); +class PlayerType; +bool eat_rock(PlayerType *player_ptr); diff --git a/src/object-activation/activation-bolt-ball.cpp b/src/object-activation/activation-bolt-ball.cpp index d792d8fe0..171e168a0 100644 --- a/src/object-activation/activation-bolt-ball.cpp +++ b/src/object-activation/activation-bolt-ball.cpp @@ -12,7 +12,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool activate_missile_1(player_type *player_ptr) +bool activate_missile_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly...")); @@ -23,7 +23,7 @@ bool activate_missile_1(player_type *player_ptr) return true; } -bool activate_missile_2(player_type *player_ptr) +bool activate_missile_2(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("魔法のトゲが現れた...", "It grows magical spikes...")); @@ -34,7 +34,7 @@ bool activate_missile_2(player_type *player_ptr) return true; } -bool activate_missile_3(player_type *player_ptr) +bool activate_missile_3(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -45,7 +45,7 @@ bool activate_missile_3(player_type *player_ptr) return true; } -bool activate_bolt_acid_1(player_type *player_ptr) +bool activate_bolt_acid_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは酸に覆われた...", "It is covered in acid...")); @@ -56,7 +56,7 @@ bool activate_bolt_acid_1(player_type *player_ptr) return true; } -bool activate_bolt_elec_1(player_type *player_ptr) +bool activate_bolt_elec_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは火花に覆われた...", "It is covered in sparks...")); @@ -67,7 +67,7 @@ bool activate_bolt_elec_1(player_type *player_ptr) return true; } -bool activate_bolt_fire_1(player_type *player_ptr) +bool activate_bolt_fire_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは炎に覆われた...", "It is covered in fire...")); @@ -78,7 +78,7 @@ bool activate_bolt_fire_1(player_type *player_ptr) return true; } -bool activate_bolt_cold_1(player_type *player_ptr) +bool activate_bolt_cold_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは霜に覆われた...", "It is covered in frost...")); @@ -89,7 +89,7 @@ bool activate_bolt_cold_1(player_type *player_ptr) return true; } -bool activate_bolt_hypodynamia_1(player_type *player_ptr, concptr name) +bool activate_bolt_hypodynamia_1(PlayerType *player_ptr, concptr name) { DIRECTION dir; msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name); @@ -100,7 +100,7 @@ bool activate_bolt_hypodynamia_1(player_type *player_ptr, concptr name) return true; } -bool activate_bolt_hypodynamia_2(player_type *player_ptr) +bool activate_bolt_hypodynamia_2(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("黒く輝いている...", "It glows black...")); @@ -111,7 +111,7 @@ bool activate_bolt_hypodynamia_2(player_type *player_ptr) return true; } -bool activate_bolt_drain_1(player_type *player_ptr) +bool activate_bolt_drain_1(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -124,7 +124,7 @@ bool activate_bolt_drain_1(player_type *player_ptr) return true; } -bool activate_bolt_drain_2(player_type *player_ptr) +bool activate_bolt_drain_2(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -137,7 +137,7 @@ bool activate_bolt_drain_2(player_type *player_ptr) return true; } -bool activate_bolt_mana(player_type *player_ptr, concptr name) +bool activate_bolt_mana(PlayerType *player_ptr, concptr name) { DIRECTION dir; msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name); @@ -148,7 +148,7 @@ bool activate_bolt_mana(player_type *player_ptr, concptr name) return true; } -bool activate_ball_pois_1(player_type *player_ptr) +bool activate_ball_pois_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは濃緑色に脈動している...", "It throbs deep green...")); @@ -159,7 +159,7 @@ bool activate_ball_pois_1(player_type *player_ptr) return true; } -bool activate_ball_cold_1(player_type *player_ptr) +bool activate_ball_cold_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは霜に覆われた...", "It is covered in frost...")); @@ -170,7 +170,7 @@ bool activate_ball_cold_1(player_type *player_ptr) return true; } -bool activate_ball_cold_2(player_type *player_ptr) +bool activate_ball_cold_2(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは青く激しく輝いた...", "It glows an intense blue...")); @@ -181,7 +181,7 @@ bool activate_ball_cold_2(player_type *player_ptr) return true; } -bool activate_ball_cold_3(player_type *player_ptr) +bool activate_ball_cold_3(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("明るく白色に輝いている...", "It glows bright white...")); @@ -192,7 +192,7 @@ bool activate_ball_cold_3(player_type *player_ptr) return true; } -bool activate_ball_fire_1(player_type *player_ptr) +bool activate_ball_fire_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは赤く激しく輝いた...", "It glows an intense red...")); @@ -203,7 +203,7 @@ bool activate_ball_fire_1(player_type *player_ptr) return true; } -bool activate_ball_fire_2(player_type *player_ptr, concptr name) +bool activate_ball_fire_2(PlayerType *player_ptr, concptr name) { DIRECTION dir; msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name); @@ -214,7 +214,7 @@ bool activate_ball_fire_2(player_type *player_ptr, concptr name) return true; } -bool activate_ball_fire_3(player_type *player_ptr) +bool activate_ball_fire_3(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("深赤色に輝いている...", "It glows deep red...")); @@ -225,7 +225,7 @@ bool activate_ball_fire_3(player_type *player_ptr) return true; } -bool activate_ball_fire_4(player_type *player_ptr) +bool activate_ball_fire_4(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは赤く激しく輝いた...", "It glows an intense red...")); @@ -236,7 +236,7 @@ bool activate_ball_fire_4(player_type *player_ptr) return true; } -bool activate_ball_elec_2(player_type *player_ptr) +bool activate_ball_elec_2(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity...")); @@ -247,7 +247,7 @@ bool activate_ball_elec_2(player_type *player_ptr) return true; } -bool activate_ball_elec_3(player_type *player_ptr) +bool activate_ball_elec_3(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("深青色に輝いている...", "It glows deep blue...")); @@ -258,7 +258,7 @@ bool activate_ball_elec_3(player_type *player_ptr) return true; } -bool activate_ball_acid_1(player_type *player_ptr) +bool activate_ball_acid_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは黒く激しく輝いた...", "It glows an intense black...")); @@ -269,7 +269,7 @@ bool activate_ball_acid_1(player_type *player_ptr) return true; } -bool activate_ball_nuke_1(player_type *player_ptr) +bool activate_ball_nuke_1(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("それは緑に激しく輝いた...", "It glows an intense green...")); @@ -280,7 +280,7 @@ bool activate_ball_nuke_1(player_type *player_ptr) return true; } -bool activate_rocket(player_type *player_ptr) +bool activate_rocket(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -291,7 +291,7 @@ bool activate_rocket(player_type *player_ptr) return true; } -bool activate_ball_water(player_type *player_ptr, concptr name) +bool activate_ball_water(PlayerType *player_ptr, concptr name) { DIRECTION dir; msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name); @@ -302,7 +302,7 @@ bool activate_ball_water(player_type *player_ptr, concptr name) return true; } -bool activate_ball_lite(player_type *player_ptr, concptr name) +bool activate_ball_lite(PlayerType *player_ptr, concptr name) { HIT_POINT num = damroll(5, 3); POSITION y = 0, x = 0; @@ -324,7 +324,7 @@ bool activate_ball_lite(player_type *player_ptr, concptr name) return true; } -bool activate_ball_dark(player_type *player_ptr, concptr name) +bool activate_ball_dark(PlayerType *player_ptr, concptr name) { DIRECTION dir; msg_format(_("%sが深い闇に覆われた...", "The %s is covered in pitch-darkness..."), name); @@ -335,7 +335,7 @@ bool activate_ball_dark(player_type *player_ptr, concptr name) return true; } -bool activate_ball_mana(player_type *player_ptr, concptr name) +bool activate_ball_mana(PlayerType *player_ptr, concptr name) { DIRECTION dir; msg_format(_("%sが青白く光った...", "The %s becomes pale..."), name); diff --git a/src/object-activation/activation-bolt-ball.h b/src/object-activation/activation-bolt-ball.h index dd0054c4a..7b162d9e8 100644 --- a/src/object-activation/activation-bolt-ball.h +++ b/src/object-activation/activation-bolt-ball.h @@ -2,33 +2,33 @@ #include "system/angband.h" -struct player_type; -bool activate_missile_1(player_type *player_ptr); -bool activate_missile_2(player_type *player_ptr); -bool activate_missile_3(player_type *player_ptr); -bool activate_bolt_acid_1(player_type *player_ptr); -bool activate_bolt_elec_1(player_type *player_ptr); -bool activate_bolt_fire_1(player_type *player_ptr); -bool activate_bolt_cold_1(player_type *player_ptr); -bool activate_bolt_hypodynamia_1(player_type *player_ptr, concptr name); -bool activate_bolt_hypodynamia_2(player_type *player_ptr); -bool activate_bolt_drain_1(player_type *player_ptr); -bool activate_bolt_drain_2(player_type *player_ptr); -bool activate_bolt_mana(player_type *player_ptr, concptr name); -bool activate_ball_pois_1(player_type *player_ptr); -bool activate_ball_cold_1(player_type *player_ptr); -bool activate_ball_cold_2(player_type *player_ptr); -bool activate_ball_cold_3(player_type *player_ptr); -bool activate_ball_fire_1(player_type *player_ptr); -bool activate_ball_fire_2(player_type *player_ptr, concptr name); -bool activate_ball_fire_3(player_type *player_ptr); -bool activate_ball_fire_4(player_type *player_ptr); -bool activate_ball_elec_2(player_type *player_ptr); -bool activate_ball_elec_3(player_type *player_ptr); -bool activate_ball_acid_1(player_type *player_ptr); -bool activate_ball_nuke_1(player_type *player_ptr); -bool activate_rocket(player_type *player_ptr); -bool activate_ball_water(player_type *player_ptr, concptr name); -bool activate_ball_lite(player_type *player_ptr, concptr name); -bool activate_ball_dark(player_type *player_ptr, concptr name); -bool activate_ball_mana(player_type *player_ptr, concptr name); +class PlayerType; +bool activate_missile_1(PlayerType *player_ptr); +bool activate_missile_2(PlayerType *player_ptr); +bool activate_missile_3(PlayerType *player_ptr); +bool activate_bolt_acid_1(PlayerType *player_ptr); +bool activate_bolt_elec_1(PlayerType *player_ptr); +bool activate_bolt_fire_1(PlayerType *player_ptr); +bool activate_bolt_cold_1(PlayerType *player_ptr); +bool activate_bolt_hypodynamia_1(PlayerType *player_ptr, concptr name); +bool activate_bolt_hypodynamia_2(PlayerType *player_ptr); +bool activate_bolt_drain_1(PlayerType *player_ptr); +bool activate_bolt_drain_2(PlayerType *player_ptr); +bool activate_bolt_mana(PlayerType *player_ptr, concptr name); +bool activate_ball_pois_1(PlayerType *player_ptr); +bool activate_ball_cold_1(PlayerType *player_ptr); +bool activate_ball_cold_2(PlayerType *player_ptr); +bool activate_ball_cold_3(PlayerType *player_ptr); +bool activate_ball_fire_1(PlayerType *player_ptr); +bool activate_ball_fire_2(PlayerType *player_ptr, concptr name); +bool activate_ball_fire_3(PlayerType *player_ptr); +bool activate_ball_fire_4(PlayerType *player_ptr); +bool activate_ball_elec_2(PlayerType *player_ptr); +bool activate_ball_elec_3(PlayerType *player_ptr); +bool activate_ball_acid_1(PlayerType *player_ptr); +bool activate_ball_nuke_1(PlayerType *player_ptr); +bool activate_rocket(PlayerType *player_ptr); +bool activate_ball_water(PlayerType *player_ptr, concptr name); +bool activate_ball_lite(PlayerType *player_ptr, concptr name); +bool activate_ball_dark(PlayerType *player_ptr, concptr name); +bool activate_ball_mana(PlayerType *player_ptr, concptr name); diff --git a/src/object-activation/activation-breath.cpp b/src/object-activation/activation-breath.cpp index efafc8ff7..a73987335 100644 --- a/src/object-activation/activation-breath.cpp +++ b/src/object-activation/activation-breath.cpp @@ -21,7 +21,7 @@ * @param o_ptr 対象のオブジェクト構造体ポインタ * @return 発動実行の是非を返す。 */ -bool activate_dragon_breath(player_type *player_ptr, object_type *o_ptr) +bool activate_dragon_breath(PlayerType *player_ptr, object_type *o_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -56,7 +56,7 @@ bool activate_dragon_breath(player_type *player_ptr, object_type *o_ptr) return true; } -bool activate_breath_fire(player_type *player_ptr, object_type *o_ptr) +bool activate_breath_fire(PlayerType *player_ptr, object_type *o_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -69,7 +69,7 @@ bool activate_breath_fire(player_type *player_ptr, object_type *o_ptr) return true; } -bool activate_breath_cold(player_type *player_ptr, object_type *o_ptr) +bool activate_breath_cold(PlayerType *player_ptr, object_type *o_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) diff --git a/src/object-activation/activation-breath.h b/src/object-activation/activation-breath.h index 21de64f70..38808c0a8 100644 --- a/src/object-activation/activation-breath.h +++ b/src/object-activation/activation-breath.h @@ -1,7 +1,7 @@ #pragma once struct object_type; -struct player_type; -bool activate_dragon_breath(player_type *player_ptr, object_type *o_ptr); -bool activate_breath_fire(player_type *player_ptr, object_type *o_ptr); -bool activate_breath_cold(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool activate_dragon_breath(PlayerType *player_ptr, object_type *o_ptr); +bool activate_breath_fire(PlayerType *player_ptr, object_type *o_ptr); +bool activate_breath_cold(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/object-activation/activation-charm.cpp b/src/object-activation/activation-charm.cpp index 5aa507b05..46e241b99 100644 --- a/src/object-activation/activation-charm.cpp +++ b/src/object-activation/activation-charm.cpp @@ -4,7 +4,7 @@ #include "system/player-type-definition.h" #include "target/target-getter.h" -bool activate_charm_animal(player_type *player_ptr) +bool activate_charm_animal(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -14,7 +14,7 @@ bool activate_charm_animal(player_type *player_ptr) return true; } -bool activate_charm_undead(player_type *player_ptr) +bool activate_charm_undead(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -24,7 +24,7 @@ bool activate_charm_undead(player_type *player_ptr) return true; } -bool activate_charm_other(player_type *player_ptr) +bool activate_charm_other(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -34,13 +34,13 @@ bool activate_charm_other(player_type *player_ptr) return true; } -bool activate_charm_animals(player_type *player_ptr) +bool activate_charm_animals(PlayerType *player_ptr) { (void)charm_animals(player_ptr, player_ptr->lev * 2); return true; } -bool activate_charm_others(player_type *player_ptr) +bool activate_charm_others(PlayerType *player_ptr) { (void)charm_monsters(player_ptr, player_ptr->lev * 2); return true; diff --git a/src/object-activation/activation-charm.h b/src/object-activation/activation-charm.h index 6932e1855..9ec35a190 100644 --- a/src/object-activation/activation-charm.h +++ b/src/object-activation/activation-charm.h @@ -1,8 +1,8 @@ #pragma once -struct player_type; -bool activate_charm_animal(player_type *player_ptr); -bool activate_charm_undead(player_type *player_ptr); -bool activate_charm_other(player_type *player_ptr); -bool activate_charm_animals(player_type *player_ptr); -bool activate_charm_others(player_type *player_ptr); +class PlayerType; +bool activate_charm_animal(PlayerType *player_ptr); +bool activate_charm_undead(PlayerType *player_ptr); +bool activate_charm_other(PlayerType *player_ptr); +bool activate_charm_animals(PlayerType *player_ptr); +bool activate_charm_others(PlayerType *player_ptr); diff --git a/src/object-activation/activation-genocide.cpp b/src/object-activation/activation-genocide.cpp index 13d22352b..a1c9d8776 100644 --- a/src/object-activation/activation-genocide.cpp +++ b/src/object-activation/activation-genocide.cpp @@ -3,14 +3,14 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -bool activate_genocide(player_type *player_ptr) +bool activate_genocide(PlayerType *player_ptr) { msg_print(_("深青色に輝いている...", "It glows deep blue...")); (void)symbol_genocide(player_ptr, 200, true); return true; } -bool activate_mass_genocide(player_type *player_ptr) +bool activate_mass_genocide(PlayerType *player_ptr) { msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note...")); (void)mass_genocide(player_ptr, 200, true); diff --git a/src/object-activation/activation-genocide.h b/src/object-activation/activation-genocide.h index a84d2ec48..2a390b321 100644 --- a/src/object-activation/activation-genocide.h +++ b/src/object-activation/activation-genocide.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -bool activate_genocide(player_type *player_ptr); -bool activate_mass_genocide(player_type *player_ptr); +class PlayerType; +bool activate_genocide(PlayerType *player_ptr); +bool activate_mass_genocide(PlayerType *player_ptr); diff --git a/src/object-activation/activation-others.cpp b/src/object-activation/activation-others.cpp index 42ed15e73..dc78f9a6d 100644 --- a/src/object-activation/activation-others.cpp +++ b/src/object-activation/activation-others.cpp @@ -54,7 +54,7 @@ #include "util/quarks.h" #include "view/display-messages.h" -bool activate_sunlight(player_type *player_ptr) +bool activate_sunlight(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -65,7 +65,7 @@ bool activate_sunlight(player_type *player_ptr) return true; } -bool activate_confusion(player_type *player_ptr) +bool activate_confusion(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours...")); @@ -76,7 +76,7 @@ bool activate_confusion(player_type *player_ptr) return true; } -bool activate_banish_evil(player_type *player_ptr) +bool activate_banish_evil(PlayerType *player_ptr) { if (banish_evil(player_ptr, 100)) msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!")); @@ -84,7 +84,7 @@ bool activate_banish_evil(player_type *player_ptr) return true; } -bool activate_scare(player_type *player_ptr) +bool activate_scare(PlayerType *player_ptr) { if (music_singing_any(player_ptr)) stop_singing(player_ptr); @@ -98,7 +98,7 @@ bool activate_scare(player_type *player_ptr) return true; } -bool activate_aggravation(player_type *player_ptr, object_type *o_ptr, concptr name) +bool activate_aggravation(PlayerType *player_ptr, object_type *o_ptr, concptr name) { if (o_ptr->name1 == ART_HYOUSIGI) msg_print(_("拍子木を打った。", "You beat your wooden clappers.")); @@ -109,7 +109,7 @@ bool activate_aggravation(player_type *player_ptr, object_type *o_ptr, concptr n return true; } -bool activate_stone_mud(player_type *player_ptr) +bool activate_stone_mud(PlayerType *player_ptr) { DIRECTION dir; msg_print(_("鼓動している...", "It pulsates...")); @@ -120,7 +120,7 @@ bool activate_stone_mud(player_type *player_ptr) return true; } -bool activate_judgement(player_type *player_ptr, concptr name) +bool activate_judgement(PlayerType *player_ptr, concptr name) { msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name); chg_virtue(player_ptr, V_KNOWLEDGE, 1); @@ -140,7 +140,7 @@ bool activate_judgement(player_type *player_ptr, concptr name) return true; } -bool activate_telekinesis(player_type *player_ptr, concptr name) +bool activate_telekinesis(PlayerType *player_ptr, concptr name) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -151,7 +151,7 @@ bool activate_telekinesis(player_type *player_ptr, concptr name) return true; } -bool activate_unique_detection(player_type *player_ptr) +bool activate_unique_detection(PlayerType *player_ptr) { monster_type *m_ptr; monster_race *r_ptr; @@ -172,7 +172,7 @@ bool activate_unique_detection(player_type *player_ptr) return true; } -bool activate_dispel_curse(player_type *player_ptr, concptr name) +bool activate_dispel_curse(PlayerType *player_ptr, concptr name) { msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name); (void)remove_all_curse(player_ptr); @@ -180,49 +180,49 @@ bool activate_dispel_curse(player_type *player_ptr, concptr name) return true; } -bool activate_cure_lw(player_type *player_ptr) +bool activate_cure_lw(PlayerType *player_ptr) { (void)BadStatusSetter(player_ptr).afraidness(0); (void)hp_player(player_ptr, 30); return true; } -bool activate_grand_cross(player_type *player_ptr) +bool activate_grand_cross(PlayerType *player_ptr) { msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'")); (void)project(player_ptr, 0, 8, player_ptr->y, player_ptr->x, (randint1(100) + 200) * 2, AttributeType::HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID); return true; } -bool activate_call_chaos(player_type *player_ptr) +bool activate_call_chaos(PlayerType *player_ptr) { msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours...")); call_chaos(player_ptr); return true; } -bool activate_dispel_evil(player_type *player_ptr) +bool activate_dispel_evil(PlayerType *player_ptr) { msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness...")); dispel_evil(player_ptr, player_ptr->lev * 5); return true; } -bool activate_dispel_good(player_type *player_ptr) +bool activate_dispel_good(PlayerType *player_ptr) { msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil...")); dispel_good(player_ptr, player_ptr->lev * 5); return true; } -bool activate_all_monsters_detection(player_type *player_ptr) +bool activate_all_monsters_detection(PlayerType *player_ptr) { (void)detect_monsters_invis(player_ptr, 255); (void)detect_monsters_normal(player_ptr, 255); return true; } -bool activate_all_detection(player_type *player_ptr) +bool activate_all_detection(PlayerType *player_ptr) { msg_print(_("白く明るく輝いている...", "It glows bright white...")); msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind...")); @@ -230,7 +230,7 @@ bool activate_all_detection(player_type *player_ptr) return true; } -bool activate_extra_detection(player_type *player_ptr) +bool activate_extra_detection(PlayerType *player_ptr) { msg_print(_("明るく輝いている...", "It glows brightly...")); detect_all(player_ptr, DETECT_RAD_DEFAULT); @@ -239,7 +239,7 @@ bool activate_extra_detection(player_type *player_ptr) return true; } -bool activate_fully_identification(player_type *player_ptr) +bool activate_fully_identification(PlayerType *player_ptr) { msg_print(_("黄色く輝いている...", "It glows yellow...")); identify_fully(player_ptr, false); @@ -251,12 +251,12 @@ bool activate_fully_identification(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 発動に成功したらTRUE */ -bool activate_identification(player_type *player_ptr) +bool activate_identification(PlayerType *player_ptr) { return ident_spell(player_ptr, false); } -bool activate_pesticide(player_type *player_ptr) +bool activate_pesticide(PlayerType *player_ptr) { msg_print(_("あなたは害虫を一掃した。", "You exterminate some pests.")); (void)dispel_monsters(player_ptr, 4); @@ -268,13 +268,13 @@ bool activate_pesticide(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 発動に成功したらTRUE */ -bool activate_whirlwind(player_type *player_ptr) +bool activate_whirlwind(PlayerType *player_ptr) { massacre(player_ptr); return true; } -bool activate_blinding_light(player_type *player_ptr, concptr name) +bool activate_blinding_light(PlayerType *player_ptr, concptr name) { msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name); (void)fire_ball(player_ptr, AttributeType::LITE, 0, 300, 6); @@ -282,39 +282,39 @@ bool activate_blinding_light(player_type *player_ptr, concptr name) return true; } -bool activate_sleep(player_type *player_ptr) +bool activate_sleep(PlayerType *player_ptr) { msg_print(_("深青色に輝いている...", "It glows deep blue...")); sleep_monsters_touch(player_ptr); return true; } -bool activate_door_destroy(player_type *player_ptr) +bool activate_door_destroy(PlayerType *player_ptr) { msg_print(_("明るい赤色に輝いている...", "It glows bright red...")); destroy_doors_touch(player_ptr); return true; } -bool activate_earthquake(player_type *player_ptr) +bool activate_earthquake(PlayerType *player_ptr) { earthquake(player_ptr, player_ptr->y, player_ptr->x, 5, 0); return true; } -bool activate_recharge(player_type *player_ptr) +bool activate_recharge(PlayerType *player_ptr) { recharge(player_ptr, 130); return true; } -bool activate_recharge_extra(player_type *player_ptr, concptr name) +bool activate_recharge_extra(PlayerType *player_ptr, concptr name) { msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name); return recharge(player_ptr, 1000); } -bool activate_shikofumi(player_type *player_ptr) +bool activate_shikofumi(PlayerType *player_ptr) { msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)")); (void)BadStatusSetter(player_ptr).afraidness(0); @@ -323,13 +323,13 @@ bool activate_shikofumi(player_type *player_ptr) return true; } -bool activate_terror(player_type *player_ptr) +bool activate_terror(PlayerType *player_ptr) { turn_monsters(player_ptr, 40 + player_ptr->lev); return true; } -bool activate_map_light(player_type *player_ptr) +bool activate_map_light(PlayerType *player_ptr) { msg_print(_("眩しく輝いた...", "It shines brightly...")); map_area(player_ptr, DETECT_RAD_MAP); @@ -337,21 +337,21 @@ bool activate_map_light(player_type *player_ptr) return true; } -bool activate_exploding_rune(player_type *player_ptr) +bool activate_exploding_rune(PlayerType *player_ptr) { msg_print(_("明るい赤色に輝いている...", "It glows bright red...")); create_rune_explosion(player_ptr, player_ptr->y, player_ptr->x); return true; } -bool activate_protection_rune(player_type *player_ptr) +bool activate_protection_rune(PlayerType *player_ptr) { msg_print(_("ブルーに明るく輝いている...", "It glows light blue...")); create_rune_protection_one(player_ptr); return true; } -bool activate_protection_elbereth(player_type *player_ptr) +bool activate_protection_elbereth(PlayerType *player_ptr) { BadStatusSetter bss(player_ptr); msg_print(_("エルベレスよ、我を護り給え!", "A Elbereth gilthoniel!")); @@ -364,26 +364,26 @@ bool activate_protection_elbereth(player_type *player_ptr) return true; } -bool activate_light(player_type *player_ptr, concptr name) +bool activate_light(PlayerType *player_ptr, concptr name) { msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name); (void)lite_area(player_ptr, damroll(2, 15), 3); return true; } -bool activate_recall(player_type *player_ptr) +bool activate_recall(PlayerType *player_ptr) { msg_print(_("やわらかな白色に輝いている...", "It glows soft white...")); return recall_player(player_ptr, randint0(21) + 15); } -bool activate_tree_creation(player_type *player_ptr, object_type *o_ptr, concptr name) +bool activate_tree_creation(PlayerType *player_ptr, object_type *o_ptr, concptr name) { msg_format(_("%s%sから明るい緑の光があふれ出た...", "The %s%s wells with clear light..."), name, quark_str(o_ptr->art_name)); return tree_creation(player_ptr, player_ptr->y, player_ptr->x); } -bool activate_animate_dead(player_type *player_ptr, object_type *o_ptr) +bool activate_animate_dead(PlayerType *player_ptr, object_type *o_ptr) { msg_print(_("黄金色の光が溢れ出た...", "It emitted a golden light...")); if (o_ptr->name1 > 0) @@ -392,7 +392,7 @@ bool activate_animate_dead(player_type *player_ptr, object_type *o_ptr) return animate_dead(player_ptr, 0, player_ptr->y, player_ptr->x); } -bool activate_detect_treasure(player_type *player_ptr) +bool activate_detect_treasure(PlayerType *player_ptr) { msg_print(_("金と銀に彩られている...", "It shines with gold and silver...")); return detect_treasure(player_ptr, DETECT_RAD_DEFAULT); diff --git a/src/object-activation/activation-others.h b/src/object-activation/activation-others.h index bdc4ef313..02e99b7ee 100644 --- a/src/object-activation/activation-others.h +++ b/src/object-activation/activation-others.h @@ -3,43 +3,43 @@ #include "system/angband.h" struct object_type; -struct player_type; -bool activate_sunlight(player_type *player_ptr); -bool activate_confusion(player_type *player_ptr); -bool activate_banish_evil(player_type *player_ptr); -bool activate_scare(player_type *player_ptr); -bool activate_aggravation(player_type *player_ptr, object_type *o_ptr, concptr name); -bool activate_stone_mud(player_type *player_ptr); -bool activate_judgement(player_type *player_ptr, concptr name); -bool activate_telekinesis(player_type *player_ptr, concptr name); -bool activate_unique_detection(player_type *player_ptr); -bool activate_dispel_curse(player_type *player_ptr, concptr name); -bool activate_cure_lw(player_type *player_ptr); -bool activate_grand_cross(player_type *player_ptr); -bool activate_call_chaos(player_type *player_ptr); -bool activate_dispel_evil(player_type *player_ptr); -bool activate_dispel_good(player_type *player_ptr); -bool activate_all_monsters_detection(player_type *player_ptr); -bool activate_all_detection(player_type *player_ptr); -bool activate_extra_detection(player_type *player_ptr); -bool activate_fully_identification(player_type *player_ptr); -bool activate_identification(player_type *player_ptr); -bool activate_pesticide(player_type *player_ptr); -bool activate_whirlwind(player_type *player_ptr); -bool activate_blinding_light(player_type *player_ptr, concptr name); -bool activate_sleep(player_type *player_ptr); -bool activate_door_destroy(player_type *player_ptr); -bool activate_earthquake(player_type *player_ptr); -bool activate_recharge(player_type *player_ptr); -bool activate_recharge_extra(player_type *player_ptr, concptr name); -bool activate_shikofumi(player_type *player_ptr); -bool activate_terror(player_type *player_ptr); -bool activate_map_light(player_type *player_ptr); -bool activate_exploding_rune(player_type *player_ptr); -bool activate_protection_rune(player_type *player_ptr); -bool activate_protection_elbereth(player_type *player_ptr); -bool activate_light(player_type *player_ptr, concptr name); -bool activate_recall(player_type *player_ptr); -bool activate_tree_creation(player_type *player_ptr, object_type *o_ptr, concptr name); -bool activate_animate_dead(player_type *player_ptr, object_type *o_ptr); -bool activate_detect_treasure(player_type *player_ptr); +class PlayerType; +bool activate_sunlight(PlayerType *player_ptr); +bool activate_confusion(PlayerType *player_ptr); +bool activate_banish_evil(PlayerType *player_ptr); +bool activate_scare(PlayerType *player_ptr); +bool activate_aggravation(PlayerType *player_ptr, object_type *o_ptr, concptr name); +bool activate_stone_mud(PlayerType *player_ptr); +bool activate_judgement(PlayerType *player_ptr, concptr name); +bool activate_telekinesis(PlayerType *player_ptr, concptr name); +bool activate_unique_detection(PlayerType *player_ptr); +bool activate_dispel_curse(PlayerType *player_ptr, concptr name); +bool activate_cure_lw(PlayerType *player_ptr); +bool activate_grand_cross(PlayerType *player_ptr); +bool activate_call_chaos(PlayerType *player_ptr); +bool activate_dispel_evil(PlayerType *player_ptr); +bool activate_dispel_good(PlayerType *player_ptr); +bool activate_all_monsters_detection(PlayerType *player_ptr); +bool activate_all_detection(PlayerType *player_ptr); +bool activate_extra_detection(PlayerType *player_ptr); +bool activate_fully_identification(PlayerType *player_ptr); +bool activate_identification(PlayerType *player_ptr); +bool activate_pesticide(PlayerType *player_ptr); +bool activate_whirlwind(PlayerType *player_ptr); +bool activate_blinding_light(PlayerType *player_ptr, concptr name); +bool activate_sleep(PlayerType *player_ptr); +bool activate_door_destroy(PlayerType *player_ptr); +bool activate_earthquake(PlayerType *player_ptr); +bool activate_recharge(PlayerType *player_ptr); +bool activate_recharge_extra(PlayerType *player_ptr, concptr name); +bool activate_shikofumi(PlayerType *player_ptr); +bool activate_terror(PlayerType *player_ptr); +bool activate_map_light(PlayerType *player_ptr); +bool activate_exploding_rune(PlayerType *player_ptr); +bool activate_protection_rune(PlayerType *player_ptr); +bool activate_protection_elbereth(PlayerType *player_ptr); +bool activate_light(PlayerType *player_ptr, concptr name); +bool activate_recall(PlayerType *player_ptr); +bool activate_tree_creation(PlayerType *player_ptr, object_type *o_ptr, concptr name); +bool activate_animate_dead(PlayerType *player_ptr, object_type *o_ptr); +bool activate_detect_treasure(PlayerType *player_ptr); diff --git a/src/object-activation/activation-resistance.cpp b/src/object-activation/activation-resistance.cpp index 7a63cca95..2e783eb22 100644 --- a/src/object-activation/activation-resistance.cpp +++ b/src/object-activation/activation-resistance.cpp @@ -12,7 +12,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool activate_resistance_elements(player_type *player_ptr) +bool activate_resistance_elements(PlayerType *player_ptr) { msg_print(_("様々な色に輝いている...", "It glows many colours...")); (void)set_oppose_acid(player_ptr, randint1(40) + 40, false); @@ -29,7 +29,7 @@ bool activate_resistance_elements(player_type *player_ptr) * @param name アイテム名 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す */ -bool activate_acid_ball_and_resistance(player_type *player_ptr, concptr name) +bool activate_acid_ball_and_resistance(PlayerType *player_ptr, concptr name) { msg_format(_("%sが黒く輝いた...", "The %s grows black."), name); @@ -49,7 +49,7 @@ bool activate_acid_ball_and_resistance(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す */ -bool activate_elec_ball_and_resistance(player_type *player_ptr, concptr name) +bool activate_elec_ball_and_resistance(PlayerType *player_ptr, concptr name) { msg_format(_("%sが青く輝いた...", "The %s grows blue."), name); @@ -69,7 +69,7 @@ bool activate_elec_ball_and_resistance(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す */ -bool activate_fire_ball_and_resistance(player_type *player_ptr, concptr name) +bool activate_fire_ball_and_resistance(PlayerType *player_ptr, concptr name) { msg_format(_("%sが赤く輝いた...", "The %s grows red."), name); @@ -89,7 +89,7 @@ bool activate_fire_ball_and_resistance(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す */ -bool activate_cold_ball_and_resistance(player_type *player_ptr, concptr name) +bool activate_cold_ball_and_resistance(PlayerType *player_ptr, concptr name) { msg_format(_("%sが白く輝いた...", "The %s grows white."), name); @@ -109,7 +109,7 @@ bool activate_cold_ball_and_resistance(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す */ -bool activate_pois_ball_and_resistance(player_type *player_ptr, concptr name) +bool activate_pois_ball_and_resistance(PlayerType *player_ptr, concptr name) { msg_format(_("%sが緑に輝いた...", "The %s grows green."), name); @@ -129,7 +129,7 @@ bool activate_pois_ball_and_resistance(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 常にTRUE */ -bool activate_resistance_acid(player_type *player_ptr, concptr name) +bool activate_resistance_acid(PlayerType *player_ptr, concptr name) { msg_format(_("%sが黒く輝いた...", "The %s grows black."), name); (void)set_oppose_acid(player_ptr, randint1(20) + 20, false); @@ -142,7 +142,7 @@ bool activate_resistance_acid(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 常にTRUE */ -bool activate_resistance_elec(player_type *player_ptr, concptr name) +bool activate_resistance_elec(PlayerType *player_ptr, concptr name) { msg_format(_("%sが青く輝いた...", "The %s grows blue."), name); (void)set_oppose_elec(player_ptr, randint1(20) + 20, false); @@ -155,7 +155,7 @@ bool activate_resistance_elec(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 常にTRUE */ -bool activate_resistance_fire(player_type *player_ptr, concptr name) +bool activate_resistance_fire(PlayerType *player_ptr, concptr name) { msg_format(_("%sが赤く輝いた...", "The %s grows red."), name); (void)set_oppose_fire(player_ptr, randint1(20) + 20, false); @@ -168,7 +168,7 @@ bool activate_resistance_fire(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 常にTRUE */ -bool activate_resistance_cold(player_type *player_ptr, concptr name) +bool activate_resistance_cold(PlayerType *player_ptr, concptr name) { msg_format(_("%sが白く輝いた...", "The %s grows white."), name); (void)set_oppose_cold(player_ptr, randint1(20) + 20, false); @@ -181,14 +181,14 @@ bool activate_resistance_cold(player_type *player_ptr, concptr name) * @param name アイテム名 * @return 常にTRUE */ -bool activate_resistance_pois(player_type *player_ptr, concptr name) +bool activate_resistance_pois(PlayerType *player_ptr, concptr name) { msg_format(_("%sが緑に輝いた...", "The %s grows green."), name); (void)set_oppose_pois(player_ptr, randint1(20) + 20, false); return true; } -bool activate_ultimate_resistance(player_type *player_ptr) +bool activate_ultimate_resistance(PlayerType *player_ptr) { TIME_EFFECT v = randint1(25) + 25; (void)BadStatusSetter(player_ptr).afraidness(0); diff --git a/src/object-activation/activation-resistance.h b/src/object-activation/activation-resistance.h index f27c1462e..c9ec17a55 100644 --- a/src/object-activation/activation-resistance.h +++ b/src/object-activation/activation-resistance.h @@ -2,16 +2,16 @@ #include "system/angband.h" -struct player_type; -bool activate_resistance_elements(player_type *player_ptr); -bool activate_resistance_acid(player_type *player_ptr, concptr name); -bool activate_resistance_elec(player_type *player_ptr, concptr name); -bool activate_resistance_fire(player_type *player_ptr, concptr name); -bool activate_resistance_cold(player_type *player_ptr, concptr name); -bool activate_resistance_pois(player_type *player_ptr, concptr name); -bool activate_acid_ball_and_resistance(player_type *player_ptr, concptr name); -bool activate_elec_ball_and_resistance(player_type *player_ptr, concptr name); -bool activate_fire_ball_and_resistance(player_type *player_ptr, concptr name); -bool activate_cold_ball_and_resistance(player_type *player_ptr, concptr name); -bool activate_pois_ball_and_resistance(player_type *player_ptr, concptr name); -bool activate_ultimate_resistance(player_type *player_ptr); +class PlayerType; +bool activate_resistance_elements(PlayerType *player_ptr); +bool activate_resistance_acid(PlayerType *player_ptr, concptr name); +bool activate_resistance_elec(PlayerType *player_ptr, concptr name); +bool activate_resistance_fire(PlayerType *player_ptr, concptr name); +bool activate_resistance_cold(PlayerType *player_ptr, concptr name); +bool activate_resistance_pois(PlayerType *player_ptr, concptr name); +bool activate_acid_ball_and_resistance(PlayerType *player_ptr, concptr name); +bool activate_elec_ball_and_resistance(PlayerType *player_ptr, concptr name); +bool activate_fire_ball_and_resistance(PlayerType *player_ptr, concptr name); +bool activate_cold_ball_and_resistance(PlayerType *player_ptr, concptr name); +bool activate_pois_ball_and_resistance(PlayerType *player_ptr, concptr name); +bool activate_ultimate_resistance(PlayerType *player_ptr); diff --git a/src/object-activation/activation-switcher.cpp b/src/object-activation/activation-switcher.cpp index 905101857..cf38b7060 100644 --- a/src/object-activation/activation-switcher.cpp +++ b/src/object-activation/activation-switcher.cpp @@ -40,7 +40,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -bool switch_activation(player_type *player_ptr, object_type **o_ptr_ptr, const activation_type *const act_ptr, concptr name) +bool switch_activation(PlayerType *player_ptr, object_type **o_ptr_ptr, const activation_type *const act_ptr, concptr name) { object_type *o_ptr = (*o_ptr_ptr); diff --git a/src/object-activation/activation-switcher.h b/src/object-activation/activation-switcher.h index 7d9077c87..2fd8e9d34 100644 --- a/src/object-activation/activation-switcher.h +++ b/src/object-activation/activation-switcher.h @@ -4,5 +4,5 @@ struct activation_type; struct object_type; -struct player_type; -bool switch_activation(player_type *player_ptr, object_type **o_ptr_ptr, const activation_type *const act_ptr, concptr name); +class PlayerType; +bool switch_activation(PlayerType *player_ptr, object_type **o_ptr_ptr, const activation_type *const act_ptr, concptr name); diff --git a/src/object-activation/activation-teleport.cpp b/src/object-activation/activation-teleport.cpp index a1375c0b9..3dac170f2 100644 --- a/src/object-activation/activation-teleport.cpp +++ b/src/object-activation/activation-teleport.cpp @@ -11,7 +11,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool activate_teleport_away(player_type *player_ptr) +bool activate_teleport_away(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -21,7 +21,7 @@ bool activate_teleport_away(player_type *player_ptr) return true; } -bool activate_escape(player_type *player_ptr) +bool activate_escape(PlayerType *player_ptr) { switch (randint1(13)) { case 1: @@ -54,7 +54,7 @@ bool activate_escape(player_type *player_ptr) } } -bool activate_teleport_level(player_type *player_ptr) +bool activate_teleport_level(PlayerType *player_ptr) { if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return false; @@ -63,20 +63,20 @@ bool activate_teleport_level(player_type *player_ptr) return true; } -bool activate_dimension_door(player_type *player_ptr) +bool activate_dimension_door(PlayerType *player_ptr) { msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination.")); return dimension_door(player_ptr); } -bool activate_teleport(player_type *player_ptr) +bool activate_teleport(PlayerType *player_ptr) { msg_print(_("周りの空間が歪んでいる...", "It twists space around you...")); teleport_player(player_ptr, 100, TELEPORT_SPONTANEOUS); return true; } -bool activate_phase_door(player_type *player_ptr) +bool activate_phase_door(PlayerType *player_ptr) { teleport_player(player_ptr, 10, TELEPORT_SPONTANEOUS); return true; diff --git a/src/object-activation/activation-teleport.h b/src/object-activation/activation-teleport.h index eaf218ede..54b890019 100644 --- a/src/object-activation/activation-teleport.h +++ b/src/object-activation/activation-teleport.h @@ -1,9 +1,9 @@ #pragma once -struct player_type; -bool activate_teleport_away(player_type *player_ptr); -bool activate_escape(player_type *player_ptr); -bool activate_teleport_level(player_type *player_ptr); -bool activate_dimension_door(player_type *player_ptr); -bool activate_teleport(player_type *player_ptr); -bool activate_phase_door(player_type *player_ptr); +class PlayerType; +bool activate_teleport_away(PlayerType *player_ptr); +bool activate_escape(PlayerType *player_ptr); +bool activate_teleport_level(PlayerType *player_ptr); +bool activate_dimension_door(PlayerType *player_ptr); +bool activate_teleport(PlayerType *player_ptr); +bool activate_phase_door(PlayerType *player_ptr); diff --git a/src/object-activation/activation-util.cpp b/src/object-activation/activation-util.cpp index 8bf4a471e..db30be1b0 100644 --- a/src/object-activation/activation-util.cpp +++ b/src/object-activation/activation-util.cpp @@ -4,7 +4,7 @@ #include "system/object-type-definition.h" #include "system/player-type-definition.h" -ae_type *initialize_ae_type(player_type *player_ptr, ae_type *ae_ptr, const INVENTORY_IDX item) +ae_type *initialize_ae_type(PlayerType *player_ptr, ae_type *ae_ptr, const INVENTORY_IDX item) { ae_ptr->o_ptr = ref_item(player_ptr, item); ae_ptr->lev = k_info[ae_ptr->o_ptr->k_idx].level; diff --git a/src/object-activation/activation-util.h b/src/object-activation/activation-util.h index a7a99e532..f96c5cd94 100644 --- a/src/object-activation/activation-util.h +++ b/src/object-activation/activation-util.h @@ -13,5 +13,5 @@ typedef struct ae_type { int fail; } ae_type; -struct player_type; -ae_type *initialize_ae_type(player_type *player_ptr, ae_type *ae_ptr, const INVENTORY_IDX item); +class PlayerType; +ae_type *initialize_ae_type(PlayerType *player_ptr, ae_type *ae_ptr, const INVENTORY_IDX item); diff --git a/src/object-enchant/apply-magic-amulet.cpp b/src/object-enchant/apply-magic-amulet.cpp index 90c35939e..5d5346e0e 100644 --- a/src/object-enchant/apply-magic-amulet.cpp +++ b/src/object-enchant/apply-magic-amulet.cpp @@ -23,7 +23,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -AmuletEnchanter::AmuletEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +AmuletEnchanter::AmuletEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : player_ptr(player_ptr) , o_ptr(o_ptr) , level(level) diff --git a/src/object-enchant/apply-magic-amulet.h b/src/object-enchant/apply-magic-amulet.h index 8fbafcfaa..6476d202b 100644 --- a/src/object-enchant/apply-magic-amulet.h +++ b/src/object-enchant/apply-magic-amulet.h @@ -4,10 +4,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class AmuletEnchanter : EnchanterBase { public: - AmuletEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + AmuletEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~AmuletEnchanter() = default; void apply_magic() override; @@ -18,7 +18,7 @@ protected: void give_cursed() override; private: - player_type *player_ptr; + PlayerType *player_ptr; object_type *o_ptr; DEPTH level; int power; diff --git a/src/object-enchant/apply-magic-armor.cpp b/src/object-enchant/apply-magic-armor.cpp index 78d15990f..f4fa60789 100644 --- a/src/object-enchant/apply-magic-armor.cpp +++ b/src/object-enchant/apply-magic-armor.cpp @@ -20,7 +20,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -ArmorEnchanter::ArmorEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +ArmorEnchanter::ArmorEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : AbstractProtectorEnchanter{ o_ptr, level, power } , player_ptr(player_ptr) { diff --git a/src/object-enchant/apply-magic-armor.h b/src/object-enchant/apply-magic-armor.h index f69a40b6d..7b50ae8e5 100644 --- a/src/object-enchant/apply-magic-armor.h +++ b/src/object-enchant/apply-magic-armor.h @@ -5,10 +5,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class ArmorEnchanter : AbstractProtectorEnchanter { public: - ArmorEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + ArmorEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~ArmorEnchanter() = default; void apply_magic() override; @@ -19,6 +19,6 @@ protected: void give_cursed() override; private: - player_type *player_ptr; + PlayerType *player_ptr; bool is_high_ego_generated = false; }; diff --git a/src/object-enchant/apply-magic-boots.cpp b/src/object-enchant/apply-magic-boots.cpp index e8fb61aa9..acc4b6ad5 100644 --- a/src/object-enchant/apply-magic-boots.cpp +++ b/src/object-enchant/apply-magic-boots.cpp @@ -20,7 +20,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -BootsEnchanter::BootsEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +BootsEnchanter::BootsEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : AbstractProtectorEnchanter{ o_ptr, level, power } , player_ptr(player_ptr) { diff --git a/src/object-enchant/apply-magic-boots.h b/src/object-enchant/apply-magic-boots.h index 9a244d8ad..cc4d69578 100644 --- a/src/object-enchant/apply-magic-boots.h +++ b/src/object-enchant/apply-magic-boots.h @@ -5,10 +5,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class BootsEnchanter : AbstractProtectorEnchanter { public: - BootsEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + BootsEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~BootsEnchanter() = default; void apply_magic() override; @@ -19,5 +19,5 @@ protected: void give_cursed() override{}; private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/object-enchant/apply-magic-cloak.cpp b/src/object-enchant/apply-magic-cloak.cpp index 30083b612..dab001f92 100644 --- a/src/object-enchant/apply-magic-cloak.cpp +++ b/src/object-enchant/apply-magic-cloak.cpp @@ -18,7 +18,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -CloakEnchanter::CloakEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +CloakEnchanter::CloakEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : AbstractProtectorEnchanter{ o_ptr, level, power } , player_ptr(player_ptr) { diff --git a/src/object-enchant/apply-magic-cloak.h b/src/object-enchant/apply-magic-cloak.h index bf2958a23..c4415dc7a 100644 --- a/src/object-enchant/apply-magic-cloak.h +++ b/src/object-enchant/apply-magic-cloak.h @@ -5,10 +5,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class CloakEnchanter : AbstractProtectorEnchanter { public: - CloakEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + CloakEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~CloakEnchanter() = default; void apply_magic() override; @@ -19,5 +19,5 @@ protected: void give_cursed() override{}; private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/object-enchant/apply-magic-crown.cpp b/src/object-enchant/apply-magic-crown.cpp index 6cd5ea465..cb9a374c5 100644 --- a/src/object-enchant/apply-magic-crown.cpp +++ b/src/object-enchant/apply-magic-crown.cpp @@ -18,7 +18,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -CrownEnchanter::CrownEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +CrownEnchanter::CrownEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : AbstractProtectorEnchanter{ o_ptr, level, power } , player_ptr(player_ptr) { diff --git a/src/object-enchant/apply-magic-crown.h b/src/object-enchant/apply-magic-crown.h index 78b7167d8..eb3ecd0a3 100644 --- a/src/object-enchant/apply-magic-crown.h +++ b/src/object-enchant/apply-magic-crown.h @@ -5,10 +5,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class CrownEnchanter : AbstractProtectorEnchanter { public: - CrownEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + CrownEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~CrownEnchanter() = default; void apply_magic() override; @@ -19,5 +19,5 @@ protected: void give_cursed() override; private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/object-enchant/apply-magic-gloves.cpp b/src/object-enchant/apply-magic-gloves.cpp index 55ed96941..fb9b42ee5 100644 --- a/src/object-enchant/apply-magic-gloves.cpp +++ b/src/object-enchant/apply-magic-gloves.cpp @@ -20,7 +20,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -GlovesEnchanter::GlovesEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +GlovesEnchanter::GlovesEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : AbstractProtectorEnchanter{ o_ptr, level, power } , player_ptr(player_ptr) { diff --git a/src/object-enchant/apply-magic-gloves.h b/src/object-enchant/apply-magic-gloves.h index a7bf1e8c2..de3f3be56 100644 --- a/src/object-enchant/apply-magic-gloves.h +++ b/src/object-enchant/apply-magic-gloves.h @@ -5,10 +5,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class GlovesEnchanter : AbstractProtectorEnchanter { public: - GlovesEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + GlovesEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~GlovesEnchanter() = default; void apply_magic() override; @@ -19,5 +19,5 @@ protected: void give_cursed() override{}; private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/object-enchant/apply-magic-helm.cpp b/src/object-enchant/apply-magic-helm.cpp index 67e4387d0..ae7236756 100644 --- a/src/object-enchant/apply-magic-helm.cpp +++ b/src/object-enchant/apply-magic-helm.cpp @@ -20,7 +20,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -HelmEnchanter::HelmEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +HelmEnchanter::HelmEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : AbstractProtectorEnchanter{ o_ptr, level, power } , player_ptr(player_ptr) { diff --git a/src/object-enchant/apply-magic-helm.h b/src/object-enchant/apply-magic-helm.h index e42adacf8..1f128a6d1 100644 --- a/src/object-enchant/apply-magic-helm.h +++ b/src/object-enchant/apply-magic-helm.h @@ -5,10 +5,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class HelmEnchanter : AbstractProtectorEnchanter { public: - HelmEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + HelmEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~HelmEnchanter() = default; void apply_magic() override; @@ -19,5 +19,5 @@ protected: void give_cursed() override; private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/object-enchant/apply-magic-others.cpp b/src/object-enchant/apply-magic-others.cpp index aac0a47ec..e94cb5342 100644 --- a/src/object-enchant/apply-magic-others.cpp +++ b/src/object-enchant/apply-magic-others.cpp @@ -38,7 +38,7 @@ * @details * Hack -- note the special code for various items */ -void apply_magic_others(player_type *player_ptr, object_type *o_ptr, int power) +void apply_magic_others(PlayerType *player_ptr, object_type *o_ptr, int power) { object_kind *k_ptr = &k_info[o_ptr->k_idx]; diff --git a/src/object-enchant/apply-magic-others.h b/src/object-enchant/apply-magic-others.h index e8aec98e0..dacd63333 100644 --- a/src/object-enchant/apply-magic-others.h +++ b/src/object-enchant/apply-magic-others.h @@ -1,5 +1,5 @@ #pragma once struct object_type; -struct player_type; -void apply_magic_others(player_type *player_ptr, object_type *o_ptr, int power); +class PlayerType; +void apply_magic_others(PlayerType *player_ptr, object_type *o_ptr, int power); diff --git a/src/object-enchant/apply-magic-ring.cpp b/src/object-enchant/apply-magic-ring.cpp index 264fed696..cc989dee1 100644 --- a/src/object-enchant/apply-magic-ring.cpp +++ b/src/object-enchant/apply-magic-ring.cpp @@ -23,7 +23,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -RingEnchanter::RingEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +RingEnchanter::RingEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : player_ptr(player_ptr) , o_ptr(o_ptr) , level(level) diff --git a/src/object-enchant/apply-magic-ring.h b/src/object-enchant/apply-magic-ring.h index 3421ec801..3cca710ba 100644 --- a/src/object-enchant/apply-magic-ring.h +++ b/src/object-enchant/apply-magic-ring.h @@ -4,10 +4,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class RingEnchanter : EnchanterBase { public: - RingEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + RingEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~RingEnchanter() = default; void apply_magic() override; @@ -18,7 +18,7 @@ protected: void give_cursed() override; private: - player_type *player_ptr; + PlayerType *player_ptr; object_type *o_ptr; DEPTH level; int power; diff --git a/src/object-enchant/apply-magic-shield.cpp b/src/object-enchant/apply-magic-shield.cpp index 5faa3d9f7..113247130 100644 --- a/src/object-enchant/apply-magic-shield.cpp +++ b/src/object-enchant/apply-magic-shield.cpp @@ -20,7 +20,7 @@ * @param level 生成基準階 * @param power 生成ランク */ -ShieldEnchanter::ShieldEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +ShieldEnchanter::ShieldEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) : AbstractProtectorEnchanter{ o_ptr, level, power } , player_ptr(player_ptr) { diff --git a/src/object-enchant/apply-magic-shield.h b/src/object-enchant/apply-magic-shield.h index 8e24c1a34..03091f6fb 100644 --- a/src/object-enchant/apply-magic-shield.h +++ b/src/object-enchant/apply-magic-shield.h @@ -5,10 +5,10 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class ShieldEnchanter : AbstractProtectorEnchanter { public: - ShieldEnchanter(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); + ShieldEnchanter(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); virtual ~ShieldEnchanter() = default; void apply_magic() override; @@ -19,5 +19,5 @@ protected: void give_cursed() override{}; private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/object-enchant/apply-magic-weapon.cpp b/src/object-enchant/apply-magic-weapon.cpp index 149da7021..9f958674d 100644 --- a/src/object-enchant/apply-magic-weapon.cpp +++ b/src/object-enchant/apply-magic-weapon.cpp @@ -29,7 +29,7 @@ * Hack -- note special base damage dice boosting\n * Hack -- note special processing for weapon/digger\n */ -void apply_magic_weapon(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power) +void apply_magic_weapon(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power) { HIT_PROB tohit1 = randint1(5) + (HIT_PROB)m_bonus(5, level); HIT_POINT todam1 = randint1(5) + (HIT_POINT)m_bonus(5, level); diff --git a/src/object-enchant/apply-magic-weapon.h b/src/object-enchant/apply-magic-weapon.h index 498f019c2..82644a56f 100644 --- a/src/object-enchant/apply-magic-weapon.h +++ b/src/object-enchant/apply-magic-weapon.h @@ -3,5 +3,5 @@ #include "system/angband.h" struct object_type; -struct player_type; -void apply_magic_weapon(player_type *player_ptr, object_type *o_ptr, DEPTH level, int power); +class PlayerType; +void apply_magic_weapon(PlayerType *player_ptr, object_type *o_ptr, DEPTH level, int power); diff --git a/src/object-enchant/apply-magic.cpp b/src/object-enchant/apply-magic.cpp index 865d00cab..0bf008d4d 100644 --- a/src/object-enchant/apply-magic.cpp +++ b/src/object-enchant/apply-magic.cpp @@ -49,7 +49,7 @@ * @details * エゴ&アーティファクトの生成、呪い、pval強化 */ -void apply_magic_to_object(player_type *player_ptr, object_type *o_ptr, DEPTH lev, BIT_FLAGS mode) +void apply_magic_to_object(PlayerType *player_ptr, object_type *o_ptr, DEPTH lev, BIT_FLAGS mode) { if (player_ptr->ppersonality == PERSONALITY_MUNCHKIN) lev += randint0(player_ptr->lev / 2 + 10); diff --git a/src/object-enchant/apply-magic.h b/src/object-enchant/apply-magic.h index c6f8e2d6b..1903f7a03 100644 --- a/src/object-enchant/apply-magic.h +++ b/src/object-enchant/apply-magic.h @@ -3,5 +3,5 @@ #include "system/angband.h" struct object_type; -struct player_type; -void apply_magic_to_object(player_type *player_ptr, object_type *o_ptr, DEPTH lev, BIT_FLAGS mode); +class PlayerType; +void apply_magic_to_object(PlayerType *player_ptr, object_type *o_ptr, DEPTH lev, BIT_FLAGS mode); diff --git a/src/object-enchant/enchanter-base.h b/src/object-enchant/enchanter-base.h index 4aa422f89..f491e65a4 100644 --- a/src/object-enchant/enchanter-base.h +++ b/src/object-enchant/enchanter-base.h @@ -11,7 +11,7 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; class EnchanterBase { public: virtual void apply_magic() = 0; diff --git a/src/object-enchant/object-curse.cpp b/src/object-enchant/object-curse.cpp index f4861b4f2..97813395d 100644 --- a/src/object-enchant/object-curse.cpp +++ b/src/object-enchant/object-curse.cpp @@ -59,7 +59,7 @@ CurseTraitType get_curse(int power, object_type *o_ptr) * @param chance 呪いの基本確率 * @param heavy_chance さらに重い呪いとなる確率 */ -void curse_equipment(player_type *player_ptr, PERCENTAGE chance, PERCENTAGE heavy_chance) +void curse_equipment(PlayerType *player_ptr, PERCENTAGE chance, PERCENTAGE heavy_chance) { if (randint1(100) > chance) return; diff --git a/src/object-enchant/object-curse.h b/src/object-enchant/object-curse.h index 5e55ad95b..54387feb5 100644 --- a/src/object-enchant/object-curse.h +++ b/src/object-enchant/object-curse.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; enum class CurseTraitType; CurseTraitType get_curse(int power, object_type *o_ptr); -void curse_equipment(player_type *player_ptr, PERCENTAGE chance, PERCENTAGE heavy_chance); +void curse_equipment(PlayerType *player_ptr, PERCENTAGE chance, PERCENTAGE heavy_chance); diff --git a/src/object-enchant/object-ego.h b/src/object-enchant/object-ego.h index e8c60dec2..293eb5cff 100644 --- a/src/object-enchant/object-ego.h +++ b/src/object-enchant/object-ego.h @@ -267,6 +267,6 @@ struct ego_item_type { extern std::vector e_info; struct object_type; -struct player_type; +class PlayerType; byte get_random_ego(byte slot, bool good); void apply_ego(object_type *o_ptr, DEPTH lev); diff --git a/src/object-enchant/object-smith.cpp b/src/object-enchant/object-smith.cpp index 00dc03da6..f488ad494 100644 --- a/src/object-enchant/object-smith.cpp +++ b/src/object-enchant/object-smith.cpp @@ -47,7 +47,7 @@ int addable_count(smith_data_type *smith_data, std::vector ess /*! * @brief 鍛冶クラスコンストラクタ */ -Smith::Smith(player_type *player_ptr) +Smith::Smith(PlayerType *player_ptr) : player_ptr(player_ptr) , smith_data(PlayerClass(player_ptr).get_specific_data()) { diff --git a/src/object-enchant/object-smith.h b/src/object-enchant/object-smith.h index aa668ae2d..70f4f41f7 100644 --- a/src/object-enchant/object-smith.h +++ b/src/object-enchant/object-smith.h @@ -9,7 +9,7 @@ #include struct object_type; -struct player_type; +class PlayerType; class ISmithInfo; struct essence_drain_type; class ItemTester; @@ -28,7 +28,7 @@ public: //! エッセンスとその抽出量を表すタプルのリスト using DrainEssenceResult = std::vector>; - Smith(player_type *player_ptr); + Smith(PlayerType *player_ptr); static const std::vector &get_essence_list(); static concptr get_essence_name(SmithEssenceType essence); @@ -58,6 +58,6 @@ private: static const std::vector essence_drain_info_table; static const std::vector> smith_info_table; - player_type *player_ptr; + PlayerType *player_ptr; std::shared_ptr smith_data; }; diff --git a/src/object-enchant/smith-info.cpp b/src/object-enchant/smith-info.cpp index 03a5f8ced..39173c4cb 100644 --- a/src/object-enchant/smith-info.cpp +++ b/src/object-enchant/smith-info.cpp @@ -26,7 +26,7 @@ BasicSmithInfo::BasicSmithInfo(SmithEffectType effect, concptr name, SmithCatego { } -bool BasicSmithInfo::add_essence(player_type *, object_type *o_ptr, int) const +bool BasicSmithInfo::add_essence(PlayerType *, object_type *o_ptr, int) const { o_ptr->smith_effect = effect; @@ -87,7 +87,7 @@ ActivationSmithInfo::ActivationSmithInfo(SmithEffectType effect, concptr name, S { } -bool ActivationSmithInfo::add_essence(player_type *, object_type *o_ptr, int) const +bool ActivationSmithInfo::add_essence(PlayerType *, object_type *o_ptr, int) const { o_ptr->smith_act_idx = this->act_idx; @@ -114,7 +114,7 @@ EnchantWeaponSmithInfo::EnchantWeaponSmithInfo(SmithEffectType effect, concptr n { } -bool EnchantWeaponSmithInfo::add_essence(player_type *player_ptr, object_type *o_ptr, int) const +bool EnchantWeaponSmithInfo::add_essence(PlayerType *player_ptr, object_type *o_ptr, int) const { const auto max_val = player_ptr->lev / 5 + 5; if ((o_ptr->to_h >= max_val) && (o_ptr->to_d >= max_val)) { @@ -141,7 +141,7 @@ EnchantArmourSmithInfo::EnchantArmourSmithInfo(SmithEffectType effect, concptr n { } -bool EnchantArmourSmithInfo::add_essence(player_type *player_ptr, object_type *o_ptr, int) const +bool EnchantArmourSmithInfo::add_essence(PlayerType *player_ptr, object_type *o_ptr, int) const { const auto max_val = player_ptr->lev / 5 + 5; if (o_ptr->to_a >= max_val) { @@ -163,7 +163,7 @@ SustainSmithInfo::SustainSmithInfo(SmithEffectType effect, concptr name, SmithCa { } -bool SustainSmithInfo::add_essence(player_type *, object_type *o_ptr, int) const +bool SustainSmithInfo::add_essence(PlayerType *, object_type *o_ptr, int) const { o_ptr->art_flags.set(TR_IGNORE_ACID); o_ptr->art_flags.set(TR_IGNORE_ELEC); @@ -183,7 +183,7 @@ SlayingGlovesSmithInfo::SlayingGlovesSmithInfo(SmithEffectType effect, concptr n { } -bool SlayingGlovesSmithInfo::add_essence(player_type *player_ptr, object_type *o_ptr, int number) const +bool SlayingGlovesSmithInfo::add_essence(PlayerType *player_ptr, object_type *o_ptr, int number) const { BasicSmithInfo::add_essence(player_ptr, o_ptr, number); diff --git a/src/object-enchant/smith-info.h b/src/object-enchant/smith-info.h index d8aafbeff..44e509921 100644 --- a/src/object-enchant/smith-info.h +++ b/src/object-enchant/smith-info.h @@ -12,7 +12,7 @@ enum class SmithCategoryType; enum class SmithEssenceType : int16_t; enum class RandomArtActType : short; -struct player_type; +class PlayerType; struct object_type; /*! @@ -29,7 +29,7 @@ public: * @param number 付与を行うエッセンスの個数 * @return 鍛冶効果の付与に成功した場合は true、失敗した場合は false */ - virtual bool add_essence(player_type *player_ptr, object_type *o_ptr, int number) const = 0; + virtual bool add_essence(PlayerType *player_ptr, object_type *o_ptr, int number) const = 0; /*! * @brief 鍛冶効果を消去する @@ -71,7 +71,7 @@ protected: class BasicSmithInfo : public ISmithInfo { public: BasicSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector need_essences, int consumption, TrFlags add_flags); - virtual bool add_essence(player_type *player_ptr, object_type *o_ptr, int number) const override; + virtual bool add_essence(PlayerType *player_ptr, object_type *o_ptr, int number) const override; virtual void erase_essence(object_type *o_ptr) const override; virtual TrFlags tr_flags() const override; virtual bool can_give_smith_effect(const object_type *o_ptr) const final override; @@ -88,7 +88,7 @@ private: class ActivationSmithInfo : public ISmithInfo { public: ActivationSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector need_essences, int consumption, RandomArtActType act_idx); - virtual bool add_essence(player_type *player_ptr, object_type *o_ptr, int number) const override; + virtual bool add_essence(PlayerType *player_ptr, object_type *o_ptr, int number) const override; virtual void erase_essence(object_type *) const override; virtual bool can_give_smith_effect(const object_type *o_ptr) const override; @@ -103,7 +103,7 @@ private: class EnchantWeaponSmithInfo : public ISmithInfo { public: EnchantWeaponSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector need_essences, int consumption); - virtual bool add_essence(player_type *player_ptr, object_type *o_ptr, int number) const override; + virtual bool add_essence(PlayerType *player_ptr, object_type *o_ptr, int number) const override; virtual void erase_essence(object_type *) const override {} virtual bool can_give_smith_effect(const object_type *o_ptr) const override; }; @@ -115,7 +115,7 @@ public: class EnchantArmourSmithInfo : public ISmithInfo { public: EnchantArmourSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector need_essences, int consumption); - virtual bool add_essence(player_type *player_ptr, object_type *o_ptr, int number) const override; + virtual bool add_essence(PlayerType *player_ptr, object_type *o_ptr, int number) const override; virtual void erase_essence(object_type *) const override {} virtual bool can_give_smith_effect(const object_type *o_ptr) const override; }; @@ -127,7 +127,7 @@ public: class SustainSmithInfo : public ISmithInfo { public: SustainSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector need_essences, int consumption); - virtual bool add_essence(player_type *player_ptr, object_type *o_ptr, int number) const override; + virtual bool add_essence(PlayerType *player_ptr, object_type *o_ptr, int number) const override; virtual void erase_essence(object_type *) const override {} virtual bool can_give_smith_effect(const object_type *o_ptr) const override; }; @@ -139,7 +139,7 @@ public: class SlayingGlovesSmithInfo : public BasicSmithInfo { public: SlayingGlovesSmithInfo(SmithEffectType effect, concptr name, SmithCategoryType category, std::vector need_essences, int consumption); - virtual bool add_essence(player_type *player_ptr, object_type *o_ptr, int number) const override; + virtual bool add_essence(PlayerType *player_ptr, object_type *o_ptr, int number) const override; virtual void erase_essence(object_type *) const override; private: diff --git a/src/object-enchant/vorpal-weapon.cpp b/src/object-enchant/vorpal-weapon.cpp index ffb20abcb..152b44f21 100644 --- a/src/object-enchant/vorpal-weapon.cpp +++ b/src/object-enchant/vorpal-weapon.cpp @@ -73,7 +73,7 @@ static void print_chainsword_noise(object_type *o_ptr) * @param vorpal_cut メッタ斬りにできるかどうか * @param vorpal_chance ヴォーパル倍率上昇の機会値 */ -void process_vorpal_attack(player_type *player_ptr, player_attack_type *pa_ptr, const bool vorpal_cut, const int vorpal_chance) +void process_vorpal_attack(PlayerType *player_ptr, player_attack_type *pa_ptr, const bool vorpal_cut, const int vorpal_chance) { if (!vorpal_cut) return; diff --git a/src/object-enchant/vorpal-weapon.h b/src/object-enchant/vorpal-weapon.h index 98473a130..4a1da30ef 100644 --- a/src/object-enchant/vorpal-weapon.h +++ b/src/object-enchant/vorpal-weapon.h @@ -1,5 +1,5 @@ #pragma once struct player_attack_type; -struct player_type; -void process_vorpal_attack(player_type *player_ptr, player_attack_type *pa_ptr, const bool vorpal_cut, const int vorpal_chance); +class PlayerType; +void process_vorpal_attack(PlayerType *player_ptr, player_attack_type *pa_ptr, const bool vorpal_cut, const int vorpal_chance); diff --git a/src/object-hook/hook-armor.cpp b/src/object-hook/hook-armor.cpp index be97026a9..e4d79ec3e 100644 --- a/src/object-hook/hook-armor.cpp +++ b/src/object-hook/hook-armor.cpp @@ -11,7 +11,7 @@ * @param o_ptr 判定するオブジェクトの構造体参照ポインタ * @return オブジェクトが防具として装備できるならTRUEを返す。 */ -bool item_tester_hook_wear(player_type *player_ptr, const object_type *o_ptr) +bool item_tester_hook_wear(PlayerType *player_ptr, const object_type *o_ptr) { if ((o_ptr->tval == ItemKindType::SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI)) if (player_ptr->psex == SEX_MALE) diff --git a/src/object-hook/hook-armor.h b/src/object-hook/hook-armor.h index f4e140230..7934bcaac 100644 --- a/src/object-hook/hook-armor.h +++ b/src/object-hook/hook-armor.h @@ -1,5 +1,5 @@ #pragma once struct object_type; -struct player_type; -bool item_tester_hook_wear(player_type *player_ptr, const object_type *o_ptr); +class PlayerType; +bool item_tester_hook_wear(PlayerType *player_ptr, const object_type *o_ptr); diff --git a/src/object-hook/hook-expendable.cpp b/src/object-hook/hook-expendable.cpp index 6c59a7979..3cb897b07 100644 --- a/src/object-hook/hook-expendable.cpp +++ b/src/object-hook/hook-expendable.cpp @@ -22,7 +22,7 @@ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ * @return 食べることが可能ならばTRUEを返す */ -bool item_tester_hook_eatable(player_type *player_ptr, const object_type *o_ptr) +bool item_tester_hook_eatable(PlayerType *player_ptr, const object_type *o_ptr) { if (o_ptr->tval == ItemKindType::FOOD) return true; @@ -45,7 +45,7 @@ bool item_tester_hook_eatable(player_type *player_ptr, const object_type *o_ptr) * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ * @return 飲むことが可能ならばTRUEを返す */ -bool item_tester_hook_quaff(player_type *player_ptr, const object_type *o_ptr) +bool item_tester_hook_quaff(PlayerType *player_ptr, const object_type *o_ptr) { if (o_ptr->tval == ItemKindType::POTION) return true; @@ -62,7 +62,7 @@ bool item_tester_hook_quaff(player_type *player_ptr, const object_type *o_ptr) * @param o_ptr 破壊可能かを確認したいオブジェクトの構造体参照ポインタ * @return オブジェクトが破壊可能ならばTRUEを返す */ -bool can_player_destroy_object(player_type *player_ptr, object_type *o_ptr) +bool can_player_destroy_object(PlayerType *player_ptr, object_type *o_ptr) { /* Artifacts cannot be destroyed */ if (!o_ptr->is_artifact()) diff --git a/src/object-hook/hook-expendable.h b/src/object-hook/hook-expendable.h index 1d3684670..ed5974f49 100644 --- a/src/object-hook/hook-expendable.h +++ b/src/object-hook/hook-expendable.h @@ -1,7 +1,7 @@ #pragma once struct object_type; -struct player_type; -bool item_tester_hook_eatable(player_type *player_ptr, const object_type *o_ptr); -bool item_tester_hook_quaff(player_type *player_ptr, const object_type *o_ptr); -bool can_player_destroy_object(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool item_tester_hook_eatable(PlayerType *player_ptr, const object_type *o_ptr); +bool item_tester_hook_quaff(PlayerType *player_ptr, const object_type *o_ptr); +bool can_player_destroy_object(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/object-hook/hook-magic.cpp b/src/object-hook/hook-magic.cpp index 7bf68e5d0..f5b628760 100644 --- a/src/object-hook/hook-magic.cpp +++ b/src/object-hook/hook-magic.cpp @@ -17,7 +17,7 @@ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ * @return 利用可能ならばTRUEを返す */ -bool item_tester_hook_use(player_type *player_ptr, const object_type *o_ptr) +bool item_tester_hook_use(PlayerType *player_ptr, const object_type *o_ptr) { if (o_ptr->tval == player_ptr->tval_ammo) return true; @@ -53,7 +53,7 @@ bool item_tester_hook_use(player_type *player_ptr, const object_type *o_ptr) * @param o_ptr 判定したいオブ会ジェクトの構造体参照ポインタ * @return 学習できる魔道書ならばTRUEを返す */ -bool item_tester_learn_spell(player_type *player_ptr, const object_type *o_ptr) +bool item_tester_learn_spell(PlayerType *player_ptr, const object_type *o_ptr) { int32_t choices = realm_choices2[enum2i(player_ptr->pclass)]; if (player_ptr->pclass == PlayerClassType::PRIEST) { diff --git a/src/object-hook/hook-magic.h b/src/object-hook/hook-magic.h index 8fe6551ec..d1fbeb08d 100644 --- a/src/object-hook/hook-magic.h +++ b/src/object-hook/hook-magic.h @@ -1,7 +1,7 @@ #pragma once struct object_type; -struct player_type; -bool item_tester_hook_use(player_type *player_ptr, const object_type *o_ptr); -bool item_tester_learn_spell(player_type *player_ptr, const object_type *o_ptr); +class PlayerType; +bool item_tester_hook_use(PlayerType *player_ptr, const object_type *o_ptr); +bool item_tester_learn_spell(PlayerType *player_ptr, const object_type *o_ptr); bool item_tester_high_level_book(const object_type *o_ptr); diff --git a/src/object-hook/hook-quest.cpp b/src/object-hook/hook-quest.cpp index 0ddf8f323..fc718b7aa 100644 --- a/src/object-hook/hook-quest.cpp +++ b/src/object-hook/hook-quest.cpp @@ -17,7 +17,7 @@ * @param o_ptr 対象のオブジェクト構造体ポインタ * @return オブジェクトが報酬対象になるならTRUEを返す */ -bool object_is_bounty(player_type *player_ptr, object_type *o_ptr) +bool object_is_bounty(PlayerType *player_ptr, object_type *o_ptr) { int i; diff --git a/src/object-hook/hook-quest.h b/src/object-hook/hook-quest.h index 4e6b6c663..918aa17f5 100644 --- a/src/object-hook/hook-quest.h +++ b/src/object-hook/hook-quest.h @@ -3,6 +3,6 @@ #include "system/angband.h" struct object_type; -struct player_type; -bool object_is_bounty(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool object_is_bounty(PlayerType *player_ptr, object_type *o_ptr); bool object_is_quest_target(QUEST_IDX quest_idx, object_type *o_ptr); diff --git a/src/object-hook/hook-weapon.cpp b/src/object-hook/hook-weapon.cpp index 95a6b8d68..ada561f1e 100644 --- a/src/object-hook/hook-weapon.cpp +++ b/src/object-hook/hook-weapon.cpp @@ -13,7 +13,7 @@ * @param o_ptr 対象のオブジェクト構造体ポインタ * @return オブジェクトが適正武器ならばTRUEを返す */ -bool object_is_favorite(player_type *player_ptr, const object_type *o_ptr) +bool object_is_favorite(PlayerType *player_ptr, const object_type *o_ptr) { /* Only melee weapons match */ if (!(o_ptr->tval == ItemKindType::POLEARM || o_ptr->tval == ItemKindType::SWORD || o_ptr->tval == ItemKindType::DIGGING || o_ptr->tval == ItemKindType::HAFTED)) { diff --git a/src/object-hook/hook-weapon.h b/src/object-hook/hook-weapon.h index b4cf19d5c..92519289d 100644 --- a/src/object-hook/hook-weapon.h +++ b/src/object-hook/hook-weapon.h @@ -1,5 +1,5 @@ #pragma once struct object_type; -struct player_type; -bool object_is_favorite(player_type *player_ptr, const object_type *o_ptr); +class PlayerType; +bool object_is_favorite(PlayerType *player_ptr, const object_type *o_ptr); diff --git a/src/object-use/item-use-checker.cpp b/src/object-use/item-use-checker.cpp index da22fc0ba..a0a62cf31 100644 --- a/src/object-use/item-use-checker.cpp +++ b/src/object-use/item-use-checker.cpp @@ -4,7 +4,7 @@ #include "timed-effect/player-stun.h" #include "view/display-messages.h" -ItemUseChecker::ItemUseChecker(player_type* player_ptr) +ItemUseChecker::ItemUseChecker(PlayerType* player_ptr) : player_ptr(player_ptr) { } diff --git a/src/object-use/item-use-checker.h b/src/object-use/item-use-checker.h index 9aaa8f551..3aac03e3a 100644 --- a/src/object-use/item-use-checker.h +++ b/src/object-use/item-use-checker.h @@ -2,14 +2,14 @@ #include -struct player_type; +class PlayerType; class ItemUseChecker { public: - ItemUseChecker(player_type *player_ptr); + ItemUseChecker(PlayerType *player_ptr); virtual ~ItemUseChecker() = default; bool check_stun(std::string_view mes) const; private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/object-use/quaff-execution.cpp b/src/object-use/quaff-execution.cpp index 40b78d321..0410a8183 100644 --- a/src/object-use/quaff-execution.cpp +++ b/src/object-use/quaff-execution.cpp @@ -56,7 +56,7 @@ * @brief コンストラクタ * @param player_ptr プレイヤーへの参照ポインタ */ -ObjectQuaffEntity::ObjectQuaffEntity(player_type *player_ptr) +ObjectQuaffEntity::ObjectQuaffEntity(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/object-use/quaff-execution.h b/src/object-use/quaff-execution.h index 3828e8d81..2269365e0 100644 --- a/src/object-use/quaff-execution.h +++ b/src/object-use/quaff-execution.h @@ -2,16 +2,16 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ObjectQuaffEntity { public: - ObjectQuaffEntity(player_type *player_ptr); + ObjectQuaffEntity(PlayerType *player_ptr); virtual ~ObjectQuaffEntity() = default; void execute(INVENTORY_IDX item); private: - player_type *player_ptr; + PlayerType *player_ptr; bool check_can_quaff(); bool booze(); diff --git a/src/object-use/read-execution.cpp b/src/object-use/read-execution.cpp index 3788d4147..ba680b0cf 100644 --- a/src/object-use/read-execution.cpp +++ b/src/object-use/read-execution.cpp @@ -71,7 +71,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param item 読むオブジェクトの所持品ID */ -ObjectReadEntity::ObjectReadEntity(player_type *player_ptr, INVENTORY_IDX item) +ObjectReadEntity::ObjectReadEntity(PlayerType *player_ptr, INVENTORY_IDX item) : player_ptr(player_ptr) , item(item) { diff --git a/src/object-use/read-execution.h b/src/object-use/read-execution.h index 88f02588a..3ce2e4401 100644 --- a/src/object-use/read-execution.h +++ b/src/object-use/read-execution.h @@ -2,16 +2,16 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ObjectReadEntity { public: - ObjectReadEntity(player_type *player_ptr, INVENTORY_IDX item); + ObjectReadEntity(PlayerType *player_ptr, INVENTORY_IDX item); virtual ~ObjectReadEntity() = default; void execute(bool known); private: - player_type *player_ptr; + PlayerType *player_ptr; INVENTORY_IDX item; bool check_can_read(); diff --git a/src/object-use/throw-execution.cpp b/src/object-use/throw-execution.cpp index 4da641d66..529acd2db 100644 --- a/src/object-use/throw-execution.cpp +++ b/src/object-use/throw-execution.cpp @@ -66,7 +66,7 @@ #include "view/object-describer.h" #include "wizard/wizard-messages.h" -ObjectThrowEntity::ObjectThrowEntity(player_type *player_ptr, object_type *q_ptr, const int delay_factor_val, const int mult, const bool boomerang, const OBJECT_IDX shuriken) +ObjectThrowEntity::ObjectThrowEntity(PlayerType *player_ptr, object_type *q_ptr, const int delay_factor_val, const int mult, const bool boomerang, const OBJECT_IDX shuriken) : q_ptr(q_ptr) , player_ptr(player_ptr) , shuriken(shuriken) diff --git a/src/object-use/throw-execution.h b/src/object-use/throw-execution.h index 798a4a2c5..5db2c0fef 100644 --- a/src/object-use/throw-execution.h +++ b/src/object-use/throw-execution.h @@ -13,12 +13,12 @@ struct grid_type; struct monster_type; struct object_type; -struct player_type; +class PlayerType; class ObjectThrowEntity { public: ObjectThrowEntity() = default; ObjectThrowEntity( - player_type *player_ptr, object_type *q_ptr, const int delay_factor_val, const int mult, const bool boomerang, const OBJECT_IDX shuriken); + PlayerType *player_ptr, object_type *q_ptr, const int delay_factor_val, const int mult, const bool boomerang, const OBJECT_IDX shuriken); virtual ~ObjectThrowEntity() = default; object_type *q_ptr; @@ -45,7 +45,7 @@ public: void drop_thrown_item(); private: - player_type *player_ptr; + PlayerType *player_ptr; OBJECT_IDX shuriken; int mult; int msec; diff --git a/src/object-use/use-execution.cpp b/src/object-use/use-execution.cpp index 3219de144..cf38e056f 100644 --- a/src/object-use/use-execution.cpp +++ b/src/object-use/use-execution.cpp @@ -33,7 +33,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param item 使うオブジェクトの所持品ID */ -ObjectUseEntity::ObjectUseEntity(player_type* player_ptr, INVENTORY_IDX item) +ObjectUseEntity::ObjectUseEntity(PlayerType* player_ptr, INVENTORY_IDX item) : player_ptr(player_ptr) , item(item) { diff --git a/src/object-use/use-execution.h b/src/object-use/use-execution.h index f6e8a5e05..4258361fa 100644 --- a/src/object-use/use-execution.h +++ b/src/object-use/use-execution.h @@ -2,16 +2,16 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ObjectUseEntity { public: - ObjectUseEntity(player_type *player_ptr, INVENTORY_IDX item); + ObjectUseEntity(PlayerType *player_ptr, INVENTORY_IDX item); virtual ~ObjectUseEntity() = default; void execute(); private: - player_type *player_ptr; + PlayerType *player_ptr; INVENTORY_IDX item; bool check_can_use(); diff --git a/src/object-use/zaprod-execution.cpp b/src/object-use/zaprod-execution.cpp index 1baf726e3..7a6e490ae 100644 --- a/src/object-use/zaprod-execution.cpp +++ b/src/object-use/zaprod-execution.cpp @@ -32,7 +32,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param item 使うオブジェクトの所持品ID */ -ObjectZapRodEntity::ObjectZapRodEntity(player_type* player_ptr) +ObjectZapRodEntity::ObjectZapRodEntity(PlayerType* player_ptr) : player_ptr(player_ptr) { } diff --git a/src/object-use/zaprod-execution.h b/src/object-use/zaprod-execution.h index be4dcb32f..d674da50e 100644 --- a/src/object-use/zaprod-execution.h +++ b/src/object-use/zaprod-execution.h @@ -2,16 +2,16 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ObjectZapRodEntity { public: - ObjectZapRodEntity(player_type *player_ptr); + ObjectZapRodEntity(PlayerType *player_ptr); virtual ~ObjectZapRodEntity() = default; void execute(INVENTORY_IDX item); private: - player_type *player_ptr; + PlayerType *player_ptr; bool check_can_zap(); }; diff --git a/src/object-use/zapwand-execution.cpp b/src/object-use/zapwand-execution.cpp index 16157a869..44a8abdc1 100644 --- a/src/object-use/zapwand-execution.cpp +++ b/src/object-use/zapwand-execution.cpp @@ -25,7 +25,7 @@ #include "view/display-messages.h" #include "view/object-describer.h" -ObjectZapWandEntity::ObjectZapWandEntity(player_type *player_ptr) +ObjectZapWandEntity::ObjectZapWandEntity(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/object-use/zapwand-execution.h b/src/object-use/zapwand-execution.h index 9494858ee..74299e7f8 100644 --- a/src/object-use/zapwand-execution.h +++ b/src/object-use/zapwand-execution.h @@ -2,16 +2,16 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ObjectZapWandEntity { public: - ObjectZapWandEntity(player_type *player_ptr); + ObjectZapWandEntity(PlayerType *player_ptr); virtual ~ObjectZapWandEntity() = default; void execute(INVENTORY_IDX item); private: - player_type *player_ptr; + PlayerType *player_ptr; bool check_can_zap() const; }; diff --git a/src/object/item-tester-hooker.cpp b/src/object/item-tester-hooker.cpp index 83325257b..08b253287 100644 --- a/src/object/item-tester-hooker.cpp +++ b/src/object/item-tester-hooker.cpp @@ -25,7 +25,7 @@ TvalItemTester::TvalItemTester(ItemKindType tval) * @param test_func そのオブジェクトが条件に合うならtrueを返すメンバ関数を指定する */ FuncItemTester::FuncItemTester(TestMemberFunctionPtr test_func) - : test_func([f = test_func](player_type *, const object_type *o_ptr) { return (o_ptr->*f)(); }) + : test_func([f = test_func](PlayerType *, const object_type *o_ptr) { return (o_ptr->*f)(); }) { } @@ -35,17 +35,17 @@ FuncItemTester::FuncItemTester(TestMemberFunctionPtr test_func) * @param test_func 引数に object_type へのポインタを取り、そのオブジェクトが条件に合うならtrueを返す関数を指定する */ FuncItemTester::FuncItemTester(std::function test_func) - : test_func([f = std::move(test_func)](player_type *, const object_type *o_ptr) { return f(o_ptr); }) + : test_func([f = std::move(test_func)](PlayerType *, const object_type *o_ptr) { return f(o_ptr); }) { } /*! * @brief Construct a new Func Item Tester:: Func Item Tester object * - * @param test_func 引数に player_type へのポインタと object_type へのポインタを取り、そのオブジェクトが条件に合うならtrueを返す関数を指定する - * @param player_ptr test_func の player_type へのポインタの引数に対して渡すポインタを指定する + * @param test_func 引数に PlayerType へのポインタと object_type へのポインタを取り、そのオブジェクトが条件に合うならtrueを返す関数を指定する + * @param player_ptr test_func の PlayerType へのポインタの引数に対して渡すポインタを指定する */ -FuncItemTester::FuncItemTester(std::function test_func, player_type *player_ptr) +FuncItemTester::FuncItemTester(std::function test_func, PlayerType *player_ptr) : test_func(std::move(test_func)) , player_ptr(player_ptr) { diff --git a/src/object/item-tester-hooker.h b/src/object/item-tester-hooker.h index a283bc17e..bab7af2f1 100644 --- a/src/object/item-tester-hooker.h +++ b/src/object/item-tester-hooker.h @@ -6,7 +6,7 @@ #include struct object_type; -struct player_type; +class PlayerType; /*! * @brief アイテムの絞り込み条件をテストする基底クラス @@ -73,11 +73,11 @@ public: using TestMemberFunctionPtr = bool (object_type::*)() const; explicit FuncItemTester(TestMemberFunctionPtr test_func); explicit FuncItemTester(std::function test_func); - explicit FuncItemTester(std::function test_func, player_type *player_ptr); + explicit FuncItemTester(std::function test_func, PlayerType *player_ptr); private: virtual bool okay_impl(const object_type *o_ptr) const; - std::function test_func; - player_type *player_ptr; + std::function test_func; + PlayerType *player_ptr; }; diff --git a/src/object/lite-processor.cpp b/src/object/lite-processor.cpp index 1cff56c5d..73870f49e 100644 --- a/src/object/lite-processor.cpp +++ b/src/object/lite-processor.cpp @@ -15,7 +15,7 @@ * @brief 10ゲームターンが進行する毎に光源の寿命を減らす処理 * / Handle burning fuel every 10 game turns */ -void reduce_lite_life(player_type* player_ptr) +void reduce_lite_life(PlayerType* player_ptr) { object_type* o_ptr = &player_ptr->inventory_list[INVEN_LITE]; if (o_ptr->tval != ItemKindType::LITE) @@ -38,7 +38,7 @@ void reduce_lite_life(player_type* player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param o_ptr 現在光源として使っているオブジェクトの構造体参照ポインタ */ -void notice_lite_change(player_type* player_ptr, object_type* o_ptr) +void notice_lite_change(PlayerType* player_ptr, object_type* o_ptr) { if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100))) { player_ptr->window_flags |= (PW_EQUIP); diff --git a/src/object/lite-processor.h b/src/object/lite-processor.h index 65776d19a..981fc2c4b 100644 --- a/src/object/lite-processor.h +++ b/src/object/lite-processor.h @@ -1,6 +1,6 @@ #pragma once struct object_type; -struct player_type; -void reduce_lite_life(player_type *player_ptr); -void notice_lite_change(player_type* player_ptr, object_type* o_ptr); +class PlayerType; +void reduce_lite_life(PlayerType *player_ptr); +void notice_lite_change(PlayerType* player_ptr, object_type* o_ptr); diff --git a/src/object/object-broken.cpp b/src/object/object-broken.cpp index dfdbb57cb..4e5bb3a8b 100644 --- a/src/object/object-broken.cpp +++ b/src/object/object-broken.cpp @@ -246,7 +246,7 @@ bool ObjectBreaker::can_destroy(object_type *o_ptr) const * o_ptr --- pointer to the potion object. * */ -bool potion_smash_effect(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx) +bool potion_smash_effect(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx) { int radius = 2; AttributeType dt = AttributeType::NONE; @@ -393,7 +393,7 @@ bool potion_smash_effect(player_type *player_ptr, MONSTER_IDX who, POSITION y, P * @details * Note that artifacts never break, see the "drop_near()" function. */ -PERCENTAGE breakage_chance(player_type *player_ptr, object_type *o_ptr, bool has_archer_bonus, SPELL_IDX snipe_type) +PERCENTAGE breakage_chance(PlayerType *player_ptr, object_type *o_ptr, bool has_archer_bonus, SPELL_IDX snipe_type) { /* Examine the snipe type */ if (snipe_type) { diff --git a/src/object/object-broken.h b/src/object/object-broken.h index b8d57ca03..9e6711db0 100644 --- a/src/object/object-broken.h +++ b/src/object/object-broken.h @@ -4,10 +4,10 @@ #include "object-enchant/tr-types.h" struct object_type; -struct player_type; +class PlayerType; -bool potion_smash_effect(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx); -PERCENTAGE breakage_chance(player_type *player_ptr, object_type *o_ptr, bool has_archer_bonus, SPELL_IDX snipe_type); +bool potion_smash_effect(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx); +PERCENTAGE breakage_chance(PlayerType *player_ptr, object_type *o_ptr, bool has_archer_bonus, SPELL_IDX snipe_type); class ObjectBreaker { protected: diff --git a/src/object/object-info.cpp b/src/object/object-info.cpp index 57e08efdd..47bd8e096 100644 --- a/src/object/object-info.cpp +++ b/src/object/object-info.cpp @@ -207,7 +207,7 @@ char index_to_label(int i) { return (i < INVEN_MAIN_HAND) ? (I2A(i)) : (I2A(i - * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ * @return 対応する装備部位ID */ -int16_t wield_slot(player_type *player_ptr, const object_type *o_ptr) +int16_t wield_slot(PlayerType *player_ptr, const object_type *o_ptr) { switch (o_ptr->tval) { case ItemKindType::DIGGING: @@ -278,7 +278,7 @@ int16_t wield_slot(player_type *player_ptr, const object_type *o_ptr) * @param book_sval ベースアイテムのsval * @return 使用可能な魔法書ならばTRUEを返す。 */ -bool check_book_realm(player_type *player_ptr, const ItemKindType book_tval, const OBJECT_SUBTYPE_VALUE book_sval) +bool check_book_realm(PlayerType *player_ptr, const ItemKindType book_tval, const OBJECT_SUBTYPE_VALUE book_sval) { if (book_tval < ItemKindType::LIFE_BOOK) return false; @@ -292,7 +292,7 @@ bool check_book_realm(player_type *player_ptr, const ItemKindType book_tval, con return (get_realm1_book(player_ptr) == book_tval) || (get_realm2_book(player_ptr) == book_tval); } -object_type *ref_item(player_type *player_ptr, INVENTORY_IDX item) +object_type *ref_item(PlayerType *player_ptr, INVENTORY_IDX item) { floor_type *floor_ptr = player_ptr->current_floor_ptr; return item >= 0 ? &player_ptr->inventory_list[item] : &(floor_ptr->o_list[0 - item]); diff --git a/src/object/object-info.h b/src/object/object-info.h index 98795c47a..15060a85d 100644 --- a/src/object/object-info.h +++ b/src/object/object-info.h @@ -6,10 +6,10 @@ #define OBJ_GOLD_LIST 480 /* First "gold" entry */ struct object_type; -struct player_type; +class PlayerType; concptr activation_explanation(object_type *o_ptr); char index_to_label(int i); -int16_t wield_slot(player_type *player_ptr, const object_type *o_ptr); -bool check_book_realm(player_type *player_ptr, const ItemKindType book_tval, const OBJECT_SUBTYPE_VALUE book_sval); -object_type *ref_item(player_type *player_ptr, INVENTORY_IDX item); +int16_t wield_slot(PlayerType *player_ptr, const object_type *o_ptr); +bool check_book_realm(PlayerType *player_ptr, const ItemKindType book_tval, const OBJECT_SUBTYPE_VALUE book_sval); +object_type *ref_item(PlayerType *player_ptr, INVENTORY_IDX item); TERM_COLOR object_attr(object_type *o_ptr); diff --git a/src/object/object-value-calc.h b/src/object/object-value-calc.h index ff632b191..d51ab7838 100644 --- a/src/object/object-value-calc.h +++ b/src/object/object-value-calc.h @@ -3,5 +3,5 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; int32_t flag_cost(const object_type *o_ptr, int plusses); diff --git a/src/object/object-value.h b/src/object/object-value.h index bcfbb8b88..330835900 100644 --- a/src/object/object-value.h +++ b/src/object/object-value.h @@ -3,6 +3,6 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; PRICE object_value(const object_type *o_ptr); PRICE object_value_real(const object_type *o_ptr); diff --git a/src/object/warning.cpp b/src/object/warning.cpp index 5608a655c..fe2a08850 100644 --- a/src/object/warning.cpp +++ b/src/object/warning.cpp @@ -45,7 +45,7 @@ * Calculate spell damages * @return 警告を行う */ -object_type *choose_warning_item(player_type *player_ptr) +object_type *choose_warning_item(PlayerType *player_ptr) { int choices[INVEN_TOTAL - INVEN_MAIN_HAND]; @@ -77,7 +77,7 @@ object_type *choose_warning_item(player_type *player_ptr) * @param dam 基本ダメージ * @param max 算出した最大ダメージを返すポインタ */ -static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, AttributeType typ, HIT_POINT dam, int *max) +static void spell_damcalc(PlayerType *player_ptr, monster_type *m_ptr, AttributeType typ, HIT_POINT dam, int *max) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; int rlev = r_ptr->level; @@ -250,7 +250,7 @@ static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, Attribut * @param m_idx 魔法を行使するモンスターのID * @param max 算出した最大ダメージを返すポインタ */ -static void spell_damcalc_by_spellnum(player_type *player_ptr, MonsterAbilityType ms_type, AttributeType typ, MONSTER_IDX m_idx, int *max) +static void spell_damcalc_by_spellnum(PlayerType *player_ptr, MonsterAbilityType ms_type, AttributeType typ, MONSTER_IDX m_idx, int *max) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; HIT_POINT dam = monspell_damage(player_ptr, ms_type, m_idx, DAM_MAX); @@ -264,7 +264,7 @@ static void spell_damcalc_by_spellnum(player_type *player_ptr, MonsterAbilityTyp * @param blow_ptr モンスターの打撃能力の構造体参照ポインタ * @return 算出された最大ダメージを返す。 */ -static int blow_damcalc(monster_type *m_ptr, player_type *player_ptr, monster_blow *blow_ptr) +static int blow_damcalc(monster_type *m_ptr, PlayerType *player_ptr, monster_blow *blow_ptr) { int dam = blow_ptr->d_dice * blow_ptr->d_side; int dummy_max = 0; @@ -339,7 +339,7 @@ static int blow_damcalc(monster_type *m_ptr, player_type *player_ptr, monster_bl * @param yy 危険性を調査するマスのY座標 * @return 警告を無視して進むことを選択するかか問題が無ければTRUE、警告に従ったならFALSEを返す。 */ -bool process_warning(player_type *player_ptr, POSITION xx, POSITION yy) +bool process_warning(PlayerType *player_ptr, POSITION xx, POSITION yy) { POSITION mx, my; grid_type *g_ptr; diff --git a/src/object/warning.h b/src/object/warning.h index 417eb136b..cb662a50d 100644 --- a/src/object/warning.h +++ b/src/object/warning.h @@ -3,6 +3,6 @@ #include "system/angband.h" struct object_type; -struct player_type; -object_type *choose_warning_item(player_type *player_ptr); -bool process_warning(player_type *player_ptr, POSITION xx, POSITION yy); +class PlayerType; +object_type *choose_warning_item(PlayerType *player_ptr); +bool process_warning(PlayerType *player_ptr, POSITION xx, POSITION yy); diff --git a/src/perception/identification.cpp b/src/perception/identification.cpp index 88d853dec..2bf7a8d57 100644 --- a/src/perception/identification.cpp +++ b/src/perception/identification.cpp @@ -32,7 +32,7 @@ * @param mode 表示オプション * @return 特筆すべき情報が一つでもあった場合TRUE、一つもなく表示がキャンセルされた場合FALSEを返す。 */ -bool screen_object(player_type *player_ptr, object_type *o_ptr, BIT_FLAGS mode) +bool screen_object(PlayerType *player_ptr, object_type *o_ptr, BIT_FLAGS mode) { char temp[70 * 20]; concptr info[128]; diff --git a/src/perception/identification.h b/src/perception/identification.h index 2342789e0..1374bd1d2 100644 --- a/src/perception/identification.h +++ b/src/perception/identification.h @@ -5,5 +5,5 @@ #define SCROBJ_FAKE_OBJECT 0x00000001 #define SCROBJ_FORCE_DETAIL 0x00000002 struct object_type; -struct player_type; -bool screen_object(player_type *player_ptr, object_type *o_ptr, BIT_FLAGS mode); +class PlayerType; +bool screen_object(PlayerType *player_ptr, object_type *o_ptr, BIT_FLAGS mode); diff --git a/src/perception/object-perception.cpp b/src/perception/object-perception.cpp index 4d2d189e1..4d1845748 100644 --- a/src/perception/object-perception.cpp +++ b/src/perception/object-perception.cpp @@ -42,7 +42,7 @@ void object_known(object_type *o_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param o_ptr *鑑定*済にするオブジェクトの構造体参照ポインタ */ -void object_aware(player_type *player_ptr, object_type *o_ptr) +void object_aware(PlayerType *player_ptr, object_type *o_ptr) { const bool is_already_awared = o_ptr->is_aware(); diff --git a/src/perception/object-perception.h b/src/perception/object-perception.h index da024a7b0..5827a7ad8 100644 --- a/src/perception/object-perception.h +++ b/src/perception/object-perception.h @@ -1,7 +1,7 @@ #pragma once struct object_type; -struct player_type; +class PlayerType; void object_known(object_type *o_ptr); -void object_aware(player_type *player_ptr, object_type *o_ptr); +void object_aware(PlayerType *player_ptr, object_type *o_ptr); void object_tried(object_type *o_ptr); diff --git a/src/perception/simple-perception.cpp b/src/perception/simple-perception.cpp index 88b0c4e72..7e4e46dd9 100644 --- a/src/perception/simple-perception.cpp +++ b/src/perception/simple-perception.cpp @@ -32,7 +32,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param heavy 重度の擬似鑑定を行うならばTRUE */ -static void sense_inventory_aux(player_type *player_ptr, INVENTORY_IDX slot, bool heavy) +static void sense_inventory_aux(PlayerType *player_ptr, INVENTORY_IDX slot, bool heavy) { object_type *o_ptr = &player_ptr->inventory_list[slot]; GAME_TEXT o_name[MAX_NLEN]; @@ -127,7 +127,7 @@ static void sense_inventory_aux(player_type *player_ptr, INVENTORY_IDX slot, boo * Class 4 = Ranger --> slow but heavy (changed!)\n * Class 5 = Paladin --> slow but heavy\n */ -void sense_inventory1(player_type *player_ptr) +void sense_inventory1(PlayerType *player_ptr) { PLAYER_LEVEL plev = player_ptr->lev; bool heavy = false; @@ -299,7 +299,7 @@ void sense_inventory1(player_type *player_ptr) /*! * @brief 1プレイヤーターン毎に武器、防具以外の擬似鑑定が行われるかを判定する。 */ -void sense_inventory2(player_type *player_ptr) +void sense_inventory2(PlayerType *player_ptr) { PLAYER_LEVEL plev = player_ptr->lev; object_type *o_ptr; diff --git a/src/perception/simple-perception.h b/src/perception/simple-perception.h index 3dfeb3fcd..025d3fc87 100644 --- a/src/perception/simple-perception.h +++ b/src/perception/simple-perception.h @@ -3,8 +3,8 @@ #include "object-enchant/item-feeling.h" struct object_type; -struct player_type; -void sense_inventory1(player_type *player_ptr); -void sense_inventory2(player_type* player_ptr); +class PlayerType; +void sense_inventory1(PlayerType *player_ptr); +void sense_inventory2(PlayerType* player_ptr); item_feel_type pseudo_value_check_heavy(object_type *o_ptr); item_feel_type pseudo_value_check_light(object_type *o_ptr); diff --git a/src/pet/pet-fall-off.cpp b/src/pet/pet-fall-off.cpp index e379b0a44..5811529ca 100644 --- a/src/pet/pet-fall-off.cpp +++ b/src/pet/pet-fall-off.cpp @@ -33,7 +33,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param monap_ptr モンスターからプレイヤーへの直接攻撃構造体への参照ポインタ */ -void check_fall_off_horse(player_type *player_ptr, monap_type *monap_ptr) +void check_fall_off_horse(PlayerType *player_ptr, monap_type *monap_ptr) { if ((player_ptr->riding == 0) || (monap_ptr->damage == 0)) return; @@ -53,7 +53,7 @@ void check_fall_off_horse(player_type *player_ptr, monap_type *monap_ptr) * @return FALSEなら落馬しないことで確定、TRUEなら処理続行 * @details レベルの低い乗馬からは落馬しにくい */ -static bool calc_fall_off_possibility(player_type *player_ptr, const HIT_POINT dam, const bool force, monster_race *r_ptr) +static bool calc_fall_off_possibility(PlayerType *player_ptr, const HIT_POINT dam, const bool force, monster_race *r_ptr) { if (force) return true; @@ -83,7 +83,7 @@ static bool calc_fall_off_possibility(player_type *player_ptr, const HIT_POINT d * @param force TRUEならば強制的に落馬する * @return 実際に落馬したらTRUEを返す */ -bool process_fall_off_horse(player_type *player_ptr, HIT_POINT dam, bool force) +bool process_fall_off_horse(PlayerType *player_ptr, HIT_POINT dam, bool force) { POSITION sy = 0; POSITION sx = 0; diff --git a/src/pet/pet-fall-off.h b/src/pet/pet-fall-off.h index 8f8c7c57a..31277d143 100644 --- a/src/pet/pet-fall-off.h +++ b/src/pet/pet-fall-off.h @@ -3,6 +3,6 @@ #include "system/angband.h" typedef struct monap_type monap_type; -struct player_type; -void check_fall_off_horse(player_type *player_ptr, monap_type *monap_ptr); -bool process_fall_off_horse(player_type *player_ptr, HIT_POINT dam, bool force); +class PlayerType; +void check_fall_off_horse(PlayerType *player_ptr, monap_type *monap_ptr); +bool process_fall_off_horse(PlayerType *player_ptr, HIT_POINT dam, bool force); diff --git a/src/pet/pet-util.cpp b/src/pet/pet-util.cpp index 95f33023b..c01ba4b8d 100644 --- a/src/pet/pet-util.cpp +++ b/src/pet/pet-util.cpp @@ -24,7 +24,7 @@ int total_friends = 0; * @param now_riding trueなら下馬処理、falseならば騎乗処理 * @return 可能ならばtrueを返す */ -bool can_player_ride_pet(player_type *player_ptr, grid_type *g_ptr, bool now_riding) +bool can_player_ride_pet(PlayerType *player_ptr, grid_type *g_ptr, bool now_riding) { bool old_character_xtra = w_ptr->character_xtra; MONSTER_IDX old_riding = player_ptr->riding; @@ -64,7 +64,7 @@ bool can_player_ride_pet(player_type *player_ptr, grid_type *g_ptr, bool now_rid * @brief ペットの維持コスト計算 * @return 維持コスト(%) */ -PERCENTAGE calculate_upkeep(player_type *player_ptr) +PERCENTAGE calculate_upkeep(PlayerType *player_ptr) { bool has_a_unique = false; DEPTH total_friend_levels = 0; diff --git a/src/pet/pet-util.h b/src/pet/pet-util.h index 652d00ed0..7a837f88d 100644 --- a/src/pet/pet-util.h +++ b/src/pet/pet-util.h @@ -43,6 +43,6 @@ enum pet_permission { extern int total_friends; struct grid_type;; -struct player_type; -bool can_player_ride_pet(player_type *player_ptr, grid_type *g_ptr, bool now_riding); -PERCENTAGE calculate_upkeep(player_type *player_ptr); +class PlayerType; +bool can_player_ride_pet(PlayerType *player_ptr, grid_type *g_ptr, bool now_riding); +PERCENTAGE calculate_upkeep(PlayerType *player_ptr); diff --git a/src/player-ability/player-charisma.cpp b/src/player-ability/player-charisma.cpp index f8003256b..0ed6941a3 100644 --- a/src/player-ability/player-charisma.cpp +++ b/src/player-ability/player-charisma.cpp @@ -13,7 +13,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerCharisma::PlayerCharisma(player_type *player_ptr) +PlayerCharisma::PlayerCharisma(PlayerType *player_ptr) : PlayerBasicStatistics(player_ptr) { } diff --git a/src/player-ability/player-charisma.h b/src/player-ability/player-charisma.h index 0e8502841..21012e926 100644 --- a/src/player-ability/player-charisma.h +++ b/src/player-ability/player-charisma.h @@ -2,10 +2,10 @@ #include "player-status/player-basic-statistics.h" -struct player_type; +class PlayerType; class PlayerCharisma : public PlayerBasicStatistics { public: - PlayerCharisma(player_type *player_ptr); + PlayerCharisma(PlayerType *player_ptr); BIT_FLAGS get_all_flags() override; BIT_FLAGS get_bad_flags() override; diff --git a/src/player-ability/player-constitution.cpp b/src/player-ability/player-constitution.cpp index b9ccd3e5d..ccc713373 100644 --- a/src/player-ability/player-constitution.cpp +++ b/src/player-ability/player-constitution.cpp @@ -14,7 +14,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerConstitution::PlayerConstitution(player_type *player_ptr) +PlayerConstitution::PlayerConstitution(PlayerType *player_ptr) : PlayerBasicStatistics(player_ptr) { } diff --git a/src/player-ability/player-constitution.h b/src/player-ability/player-constitution.h index 2ccf63cf7..668f857c2 100644 --- a/src/player-ability/player-constitution.h +++ b/src/player-ability/player-constitution.h @@ -2,10 +2,10 @@ #include "player-status/player-basic-statistics.h" -struct player_type; +class PlayerType; class PlayerConstitution : public PlayerBasicStatistics { public: - PlayerConstitution(player_type *player_ptr); + PlayerConstitution(PlayerType *player_ptr); protected: void set_locals() override; diff --git a/src/player-ability/player-dexterity.cpp b/src/player-ability/player-dexterity.cpp index 4048751cb..485bbb050 100644 --- a/src/player-ability/player-dexterity.cpp +++ b/src/player-ability/player-dexterity.cpp @@ -14,7 +14,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerDexterity::PlayerDexterity(player_type* player_ptr) +PlayerDexterity::PlayerDexterity(PlayerType* player_ptr) : PlayerBasicStatistics(player_ptr) { } diff --git a/src/player-ability/player-dexterity.h b/src/player-ability/player-dexterity.h index c10984187..e25b26632 100644 --- a/src/player-ability/player-dexterity.h +++ b/src/player-ability/player-dexterity.h @@ -2,10 +2,10 @@ #include "player-status/player-basic-statistics.h" -struct player_type; +class PlayerType; class PlayerDexterity : public PlayerBasicStatistics { public: - PlayerDexterity(player_type *player_ptr); + PlayerDexterity(PlayerType *player_ptr); protected: void set_locals() override; diff --git a/src/player-ability/player-intelligence.cpp b/src/player-ability/player-intelligence.cpp index d99a309e3..ac38451ca 100644 --- a/src/player-ability/player-intelligence.cpp +++ b/src/player-ability/player-intelligence.cpp @@ -14,7 +14,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerIntelligence::PlayerIntelligence(player_type *player_ptr) +PlayerIntelligence::PlayerIntelligence(PlayerType *player_ptr) : PlayerBasicStatistics(player_ptr) { } diff --git a/src/player-ability/player-intelligence.h b/src/player-ability/player-intelligence.h index a25088684..b0d32a0ed 100644 --- a/src/player-ability/player-intelligence.h +++ b/src/player-ability/player-intelligence.h @@ -2,10 +2,10 @@ #include "player-status/player-basic-statistics.h" -struct player_type; +class PlayerType; class PlayerIntelligence : public PlayerBasicStatistics { public: - PlayerIntelligence(player_type *player_ptr); + PlayerIntelligence(PlayerType *player_ptr); protected: void set_locals() override; diff --git a/src/player-ability/player-strength.cpp b/src/player-ability/player-strength.cpp index af0cdfdd5..af8236c38 100644 --- a/src/player-ability/player-strength.cpp +++ b/src/player-ability/player-strength.cpp @@ -14,7 +14,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerStrength::PlayerStrength(player_type *player_ptr) +PlayerStrength::PlayerStrength(PlayerType *player_ptr) : PlayerBasicStatistics(player_ptr) { } diff --git a/src/player-ability/player-strength.h b/src/player-ability/player-strength.h index 47455f4e5..1167fcd87 100644 --- a/src/player-ability/player-strength.h +++ b/src/player-ability/player-strength.h @@ -2,10 +2,10 @@ #include "player-status/player-basic-statistics.h" -struct player_type; +class PlayerType; class PlayerStrength : public PlayerBasicStatistics { public: - PlayerStrength(player_type *player_ptr); + PlayerStrength(PlayerType *player_ptr); protected: void set_locals() override; diff --git a/src/player-ability/player-wisdom.cpp b/src/player-ability/player-wisdom.cpp index ad71deeac..cd41a14af 100644 --- a/src/player-ability/player-wisdom.cpp +++ b/src/player-ability/player-wisdom.cpp @@ -12,7 +12,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerWisdom::PlayerWisdom(player_type *player_ptr) +PlayerWisdom::PlayerWisdom(PlayerType *player_ptr) : PlayerBasicStatistics(player_ptr) { } diff --git a/src/player-ability/player-wisdom.h b/src/player-ability/player-wisdom.h index 563b190d5..f88e90b24 100644 --- a/src/player-ability/player-wisdom.h +++ b/src/player-ability/player-wisdom.h @@ -2,10 +2,10 @@ #include "player-status/player-basic-statistics.h" -struct player_type; +class PlayerType; class PlayerWisdom : public PlayerBasicStatistics { public: - PlayerWisdom(player_type *player_ptr); + PlayerWisdom(PlayerType *player_ptr); protected: void set_locals() override; diff --git a/src/player-attack/attack-chaos-effect.cpp b/src/player-attack/attack-chaos-effect.cpp index 86415e7d4..fae2783da 100644 --- a/src/player-attack/attack-chaos-effect.cpp +++ b/src/player-attack/attack-chaos-effect.cpp @@ -47,7 +47,7 @@ * @details * カオス属性や混乱の手 */ -static void attack_confuse(player_type *player_ptr, player_attack_type *pa_ptr, bool can_resist = true) +static void attack_confuse(PlayerType *player_ptr, player_attack_type *pa_ptr, bool can_resist = true) { if (player_ptr->special_attack & ATTACK_CONFUSE) { player_ptr->special_attack &= ~(ATTACK_CONFUSE); @@ -77,7 +77,7 @@ static void attack_confuse(player_type *player_ptr, player_attack_type *pa_ptr, * @details * 魔術属性 */ -static void attack_stun(player_type *player_ptr, player_attack_type *pa_ptr, bool can_resist = true) +static void attack_stun(PlayerType *player_ptr, player_attack_type *pa_ptr, bool can_resist = true) { monster_race *r_ptr = pa_ptr->r_ptr; if (any_bits(r_ptr->flags3, RF3_NO_STUN)) { @@ -100,7 +100,7 @@ static void attack_stun(player_type *player_ptr, player_attack_type *pa_ptr, boo * @details * 魔術属性 */ -static void attack_scare(player_type *player_ptr, player_attack_type *pa_ptr, bool can_resist = true) +static void attack_scare(PlayerType *player_ptr, player_attack_type *pa_ptr, bool can_resist = true) { monster_race *r_ptr = pa_ptr->r_ptr; if (any_bits(r_ptr->flags3, RF3_NO_FEAR)) { @@ -122,7 +122,7 @@ static void attack_scare(player_type *player_ptr, player_attack_type *pa_ptr, bo * @details * 魔術属性 */ -static void attack_dispel(player_type *player_ptr, player_attack_type *pa_ptr) +static void attack_dispel(PlayerType *player_ptr, player_attack_type *pa_ptr) { if (pa_ptr->r_ptr->ability_flags.has_none_of(RF_ABILITY_ATTACK_MASK) && pa_ptr->r_ptr->ability_flags.has_none_of(RF_ABILITY_INDIRECT_MASK)) return; @@ -150,7 +150,7 @@ static void attack_dispel(player_type *player_ptr, player_attack_type *pa_ptr) * @details * 魔術属性 */ -static void attack_probe(player_type *player_ptr, player_attack_type *pa_ptr) +static void attack_probe(PlayerType *player_ptr, player_attack_type *pa_ptr) { msg_print(_("刃が敵を調査した...", "The blade probed your enemy...")); msg_print(nullptr); @@ -167,7 +167,7 @@ static void attack_probe(player_type *player_ptr, player_attack_type *pa_ptr) * @param pa_ptr 直接攻撃構造体への参照ポインタ * @return 抵抗されたらTRUE、アウェイされるならFALSE */ -static bool judge_tereprt_resistance(player_type *player_ptr, player_attack_type *pa_ptr) +static bool judge_tereprt_resistance(PlayerType *player_ptr, player_attack_type *pa_ptr) { monster_race *r_ptr = pa_ptr->r_ptr; if ((r_ptr->flagsr & RFR_RES_TELE) == 0) @@ -198,7 +198,7 @@ static bool judge_tereprt_resistance(player_type *player_ptr, player_attack_type * @param pa_ptr 直接攻撃構造体への参照ポインタ * @param num 現在の攻撃回数 (テレポートしてしまったら追加攻撃できないのでその補正) */ -static void attack_teleport_away(player_type *player_ptr, player_attack_type *pa_ptr, int *num) +static void attack_teleport_away(PlayerType *player_ptr, player_attack_type *pa_ptr, int *num) { if (judge_tereprt_resistance(player_ptr, pa_ptr)) return; @@ -216,7 +216,7 @@ static void attack_teleport_away(player_type *player_ptr, player_attack_type *pa * @param y モンスターのY座標 * @param x モンスターのX座標 */ -static void attack_polymorph(player_type *player_ptr, player_attack_type *pa_ptr, POSITION y, POSITION x) +static void attack_polymorph(PlayerType *player_ptr, player_attack_type *pa_ptr, POSITION y, POSITION x) { monster_race *r_ptr = pa_ptr->r_ptr; if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) != 0) || ((r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK) != 0)) @@ -238,7 +238,7 @@ static void attack_polymorph(player_type *player_ptr, player_attack_type *pa_ptr * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -static void attack_golden_hammer(player_type *player_ptr, player_attack_type *pa_ptr) +static void attack_golden_hammer(PlayerType *player_ptr, player_attack_type *pa_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[pa_ptr->m_idx]; @@ -263,7 +263,7 @@ static void attack_golden_hammer(player_type *player_ptr, player_attack_type *pa * @param x モンスターのX座標 * @param num 現在の攻撃回数 */ -void change_monster_stat(player_type *player_ptr, player_attack_type *pa_ptr, const POSITION y, const POSITION x, int *num) +void change_monster_stat(PlayerType *player_ptr, player_attack_type *pa_ptr, const POSITION y, const POSITION x, int *num) { monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx]; object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; diff --git a/src/player-attack/attack-chaos-effect.h b/src/player-attack/attack-chaos-effect.h index bf1c27d22..f17e57e63 100644 --- a/src/player-attack/attack-chaos-effect.h +++ b/src/player-attack/attack-chaos-effect.h @@ -3,5 +3,5 @@ #include "system/angband.h" struct player_attack_type; -struct player_type; -void change_monster_stat(player_type *player_ptr, player_attack_type *pa_ptr, const POSITION y, const POSITION x, int *num); +class PlayerType; +void change_monster_stat(PlayerType *player_ptr, player_attack_type *pa_ptr, const POSITION y, const POSITION x, int *num); diff --git a/src/player-attack/blood-sucking-processor.cpp b/src/player-attack/blood-sucking-processor.cpp index dfdf6ef48..9ae9d0ccb 100644 --- a/src/player-attack/blood-sucking-processor.cpp +++ b/src/player-attack/blood-sucking-processor.cpp @@ -25,7 +25,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -void decide_blood_sucking(player_type *player_ptr, player_attack_type *pa_ptr) +void decide_blood_sucking(PlayerType *player_ptr, player_attack_type *pa_ptr) { bool is_blood_sucker = pa_ptr->flags.has(TR_VAMPIRIC); is_blood_sucker |= pa_ptr->chaos_effect == CE_VAMPIRIC; @@ -56,7 +56,7 @@ void calc_drain(player_attack_type *pa_ptr) * @param pa_ptr 直接攻撃構造体への参照ポインタ * @param is_human モンスターが人間かどうか */ -static void drain_muramasa(player_type *player_ptr, player_attack_type *pa_ptr, const bool is_human) +static void drain_muramasa(PlayerType *player_ptr, player_attack_type *pa_ptr, const bool is_human) { if (!is_human) return; @@ -95,7 +95,7 @@ static void drain_muramasa(player_type *player_ptr, player_attack_type *pa_ptr, * @param drain_msg 吸血をした旨のメッセージを表示するかどうか * @details 1行目の5がマジックナンバーで良く分からなかったので、取り敢えず元々あったコメントをベースに定数宣言しておいた */ -static void drain_result(player_type *player_ptr, player_attack_type *pa_ptr, bool *drain_msg) +static void drain_result(PlayerType *player_ptr, player_attack_type *pa_ptr, bool *drain_msg) { const int real_drain = 5; if (pa_ptr->drain_result <= real_drain) @@ -137,7 +137,7 @@ static void drain_result(player_type *player_ptr, player_attack_type *pa_ptr, bo * @param drain_msg 吸血をした旨のメッセージを表示するかどうか * @details モンスターが死んだ場合、(ゲームのフレーバー的に)吸血しない */ -void process_drain(player_type *player_ptr, player_attack_type *pa_ptr, const bool is_human, bool *drain_msg) +void process_drain(PlayerType *player_ptr, player_attack_type *pa_ptr, const bool is_human, bool *drain_msg) { if (!pa_ptr->can_drain || (pa_ptr->drain_result <= 0)) return; diff --git a/src/player-attack/blood-sucking-processor.h b/src/player-attack/blood-sucking-processor.h index d77b0143e..ee1a2528e 100644 --- a/src/player-attack/blood-sucking-processor.h +++ b/src/player-attack/blood-sucking-processor.h @@ -1,7 +1,7 @@ #pragma once struct player_attack_type; -struct player_type; -void decide_blood_sucking(player_type *player_ptr, player_attack_type *pa_ptr); +class PlayerType; +void decide_blood_sucking(PlayerType *player_ptr, player_attack_type *pa_ptr); void calc_drain(player_attack_type *pa_ptr); -void process_drain(player_type *player_ptr, player_attack_type *pa_ptr, const bool is_human, bool *drain_msg); +void process_drain(PlayerType *player_ptr, player_attack_type *pa_ptr, const bool is_human, bool *drain_msg); diff --git a/src/player-attack/player-attack.cpp b/src/player-attack/player-attack.cpp index 12c4b1431..95e7b6e53 100644 --- a/src/player-attack/player-attack.cpp +++ b/src/player-attack/player-attack.cpp @@ -65,7 +65,7 @@ * @brief プレイヤーの攻撃情報を初期化する(コンストラクタ以外の分) */ static player_attack_type *initialize_player_attack_type( - player_attack_type *pa_ptr, player_type *player_ptr, POSITION y, POSITION x, int16_t hand, combat_options mode, bool *fear, bool *mdeath) + player_attack_type *pa_ptr, PlayerType *player_ptr, POSITION y, POSITION x, int16_t hand, combat_options mode, bool *fear, bool *mdeath) { auto floor_ptr = player_ptr->current_floor_ptr; auto g_ptr = &floor_ptr->grid_array[y][x]; @@ -90,7 +90,7 @@ static player_attack_type *initialize_player_attack_type( * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -static void attack_classify(player_type *player_ptr, player_attack_type *pa_ptr) +static void attack_classify(PlayerType *player_ptr, player_attack_type *pa_ptr) { switch (player_ptr->pclass) { case PlayerClassType::ROGUE: @@ -113,7 +113,7 @@ static void attack_classify(player_type *player_ptr, player_attack_type *pa_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -static void get_bare_knuckle_exp(player_type *player_ptr, player_attack_type *pa_ptr) +static void get_bare_knuckle_exp(PlayerType *player_ptr, player_attack_type *pa_ptr) { monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx]; if ((r_ptr->level + 10) <= player_ptr->lev) @@ -127,7 +127,7 @@ static void get_bare_knuckle_exp(player_type *player_ptr, player_attack_type *pa * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -static void get_weapon_exp(player_type *player_ptr, player_attack_type *pa_ptr) +static void get_weapon_exp(PlayerType *player_ptr, player_attack_type *pa_ptr) { auto *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; @@ -139,7 +139,7 @@ static void get_weapon_exp(player_type *player_ptr, player_attack_type *pa_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -static void get_attack_exp(player_type *player_ptr, player_attack_type *pa_ptr) +static void get_attack_exp(PlayerType *player_ptr, player_attack_type *pa_ptr) { monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx]; object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; @@ -160,7 +160,7 @@ static void get_attack_exp(player_type *player_ptr, player_attack_type *pa_ptr) * @param pa_ptr 直接攻撃構造体への参照ポインタ * @details 毒針は確定で1回 */ -static void calc_num_blow(player_type *player_ptr, player_attack_type *pa_ptr) +static void calc_num_blow(PlayerType *player_ptr, player_attack_type *pa_ptr) { if ((pa_ptr->mode == HISSATSU_KYUSHO) || (pa_ptr->mode == HISSATSU_MINEUCHI) || (pa_ptr->mode == HISSATSU_3DAN) || (pa_ptr->mode == HISSATSU_IAI)) pa_ptr->num_blow = 1; @@ -183,7 +183,7 @@ static void calc_num_blow(player_type *player_ptr, player_attack_type *pa_ptr) * 吸血20%、地震0.12%、混乱26.892%、テレポート・アウェイ1.494%、変身1.494% / * Vampiric 20%, Quake 0.12%, Confusion 26.892%, Teleport away 1.494% and Polymorph 1.494% */ -static chaotic_effect select_chaotic_effect(player_type *player_ptr, player_attack_type *pa_ptr) +static chaotic_effect select_chaotic_effect(PlayerType *player_ptr, player_attack_type *pa_ptr) { if (pa_ptr->flags.has_not(TR_CHAOTIC) || one_in_(2)) return CE_NONE; @@ -209,7 +209,7 @@ static chaotic_effect select_chaotic_effect(player_type *player_ptr, player_atta * @param pa_ptr プレイヤー攻撃情報への参照ポインタ * @return 魔術属性効果 */ -static MagicalBrandEffectType select_magical_brand_effect(player_type *player_ptr, player_attack_type *pa_ptr) +static MagicalBrandEffectType select_magical_brand_effect(PlayerType *player_ptr, player_attack_type *pa_ptr) { if (pa_ptr->flags.has_not(TR_BRAND_MAGIC)) return MagicalBrandEffectType::NONE; @@ -258,7 +258,7 @@ static DICE_NUMBER magical_brand_extra_dice(player_attack_type *pa_ptr) * 打撃に使用する武器または武器以外の装備品が地震を起こすなら、 * ダメージ量が50より多いか1/7で地震を起こす */ -static bool does_equip_cause_earthquake(player_type *player_ptr, player_attack_type *pa_ptr) +static bool does_equip_cause_earthquake(PlayerType *player_ptr, player_attack_type *pa_ptr) { if (!player_ptr->earthquake) return false; @@ -308,7 +308,7 @@ static bool does_weapon_has_flag(BIT_FLAGS &attacker_flags, player_attack_type * * @param vorpal_chance ヴォーパル倍率上昇の機会値 * @return 攻撃の結果、地震を起こすことになったらTRUE、それ以外はFALSE */ -static void process_weapon_attack(player_type *player_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool vorpal_cut, const int vorpal_chance) +static void process_weapon_attack(PlayerType *player_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool vorpal_cut, const int vorpal_chance) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; auto dd = o_ptr->dd + player_ptr->to_dd[pa_ptr->hand] + magical_brand_extra_dice(pa_ptr); @@ -339,7 +339,7 @@ static void process_weapon_attack(player_type *player_ptr, player_attack_type *p * @param vorpal_change ヴォーパル倍率上昇の機会値 * @details 取り敢えず素手と仮定し1とする. */ -static void calc_attack_damage(player_type *player_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool vorpal_cut, const int vorpal_chance) +static void calc_attack_damage(PlayerType *player_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool vorpal_cut, const int vorpal_chance) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; pa_ptr->attack_damage = 1; @@ -358,7 +358,7 @@ static void calc_attack_damage(player_type *player_ptr, player_attack_type *pa_p * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -static void apply_damage_bonus(player_type *player_ptr, player_attack_type *pa_ptr) +static void apply_damage_bonus(PlayerType *player_ptr, player_attack_type *pa_ptr) { pa_ptr->attack_damage += player_ptr->to_d[pa_ptr->hand]; pa_ptr->drain_result += player_ptr->to_d[pa_ptr->hand]; @@ -412,7 +412,7 @@ static void apply_damage_negative_effect(player_attack_type *pa_ptr, bool is_zan * @param pa_ptr 直接攻撃構造体への参照ポインタ * @return 死んだらTRUE、生きていたらFALSE */ -static bool check_fear_death(player_type *player_ptr, player_attack_type *pa_ptr, const int num, const bool is_lowlevel) +static bool check_fear_death(PlayerType *player_ptr, player_attack_type *pa_ptr, const int num, const bool is_lowlevel) { MonsterDamageProcessor mdp(player_ptr, pa_ptr->m_idx, pa_ptr->attack_damage, pa_ptr->fear, pa_ptr->attribute_flags); if (!mdp.mon_take_hit(nullptr)) @@ -452,7 +452,7 @@ static bool check_fear_death(player_type *player_ptr, player_attack_type *pa_ptr * @param is_ej_nullified 蜘蛛相手ならばTRUE */ static void apply_actual_attack( - player_type *player_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool is_zantetsu_nullified, const bool is_ej_nullified) + PlayerType *player_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool is_zantetsu_nullified, const bool is_ej_nullified) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand]; int vorpal_chance = ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) ? 2 : 4; @@ -487,7 +487,7 @@ static void apply_actual_attack( * @param y モンスターのY座標 * @param x モンスターのX座標 */ -static void cause_earthquake(player_type *player_ptr, player_attack_type *pa_ptr, const bool do_quake, const POSITION y, const POSITION x) +static void cause_earthquake(PlayerType *player_ptr, player_attack_type *pa_ptr, const bool do_quake, const POSITION y, const POSITION x) { if (!do_quake) return; @@ -509,7 +509,7 @@ static void cause_earthquake(player_type *player_ptr, player_attack_type *pa_ptr * @details * If no "weapon" is available, then "punch" the monster one time. */ -void exe_player_attack_to_monster(player_type *player_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, int16_t hand, combat_options mode) +void exe_player_attack_to_monster(PlayerType *player_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, int16_t hand, combat_options mode) { bool do_quake = false; bool drain_msg = true; @@ -571,7 +571,7 @@ void exe_player_attack_to_monster(player_type *player_ptr, POSITION y, POSITION * @brief 皆殺し(全方向攻撃)処理 * @param player_ptr プレイヤーへの参照ポインタ */ -void massacre(player_type *player_ptr) +void massacre(PlayerType *player_ptr) { grid_type *g_ptr; monster_type *m_ptr; diff --git a/src/player-attack/player-attack.h b/src/player-attack/player-attack.h index 11c2ae5c1..4ca4186da 100644 --- a/src/player-attack/player-attack.h +++ b/src/player-attack/player-attack.h @@ -3,6 +3,6 @@ #include "system/angband.h" #include "combat/combat-options-type.h" -struct player_type; -void exe_player_attack_to_monster(player_type *player_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, int16_t hand, combat_options mode); -void massacre(player_type *player_ptr); +class PlayerType; +void exe_player_attack_to_monster(PlayerType *player_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, int16_t hand, combat_options mode); +void massacre(PlayerType *player_ptr); diff --git a/src/player-base/player-class.cpp b/src/player-base/player-class.cpp index 16ab93804..6a743359f 100644 --- a/src/player-base/player-class.cpp +++ b/src/player-base/player-class.cpp @@ -29,7 +29,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerClass::PlayerClass(player_type *player_ptr) +PlayerClass::PlayerClass(PlayerType *player_ptr) : player_ptr(player_ptr) { } @@ -329,7 +329,7 @@ void PlayerClass::set_monk_stance(MonkStanceType stance) const /** * @brief プレイヤーの職業にで使用する職業固有データ領域を初期化する - * @details 事前条件: player_type の職業や領域が決定済みであること + * @details 事前条件: PlayerType の職業や領域が決定済みであること */ void PlayerClass::init_specific_data() { diff --git a/src/player-base/player-class.h b/src/player-base/player-class.h index 18261e6e7..80bfe0b90 100644 --- a/src/player-base/player-class.h +++ b/src/player-base/player-class.h @@ -14,7 +14,7 @@ enum class MonkStanceType : uint8_t; class PlayerClass { public: - PlayerClass(player_type *player_ptr); + PlayerClass(PlayerType *player_ptr); virtual ~PlayerClass() = default; TrFlags tr_flags() const; @@ -38,7 +38,7 @@ public: std::shared_ptr get_specific_data() const; private: - player_type *player_ptr; + PlayerType *player_ptr; }; /** diff --git a/src/player-base/player-race.cpp b/src/player-base/player-race.cpp index ea316bb97..1b1f760fa 100644 --- a/src/player-base/player-race.cpp +++ b/src/player-base/player-race.cpp @@ -20,7 +20,7 @@ * @param base_race true の場合、仮に変身している場合でも元の種族について扱う。 false の場合変身している種族について扱う。 * 引数を省略した場合は false */ -PlayerRace::PlayerRace(player_type *player_ptr, bool base_race) +PlayerRace::PlayerRace(PlayerType *player_ptr, bool base_race) : player_ptr(player_ptr) , base_race(base_race) { diff --git a/src/player-base/player-race.h b/src/player-base/player-race.h index 282d21c71..85e243ce0 100644 --- a/src/player-base/player-race.h +++ b/src/player-base/player-race.h @@ -5,11 +5,11 @@ enum class PlayerRaceType; enum class PlayerRaceLifeType; enum class PlayerRaceFoodType; -struct player_type; +class PlayerType; struct player_race_info; class PlayerRace { public: - PlayerRace(player_type *player_ptr, bool base_race = false); + PlayerRace(PlayerType *player_ptr, bool base_race = false); virtual ~PlayerRace() = default; TrFlags tr_flags() const; @@ -28,6 +28,6 @@ public: int16_t additional_constitution() const; private: - player_type *player_ptr; + PlayerType *player_ptr; bool base_race; }; diff --git a/src/player-info/alignment.cpp b/src/player-info/alignment.cpp index fd0d810a0..501a5d8c2 100644 --- a/src/player-info/alignment.cpp +++ b/src/player-info/alignment.cpp @@ -16,7 +16,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerAlignment::PlayerAlignment(player_type *player_ptr) +PlayerAlignment::PlayerAlignment(PlayerType *player_ptr) { this->player_ptr = player_ptr; } diff --git a/src/player-info/alignment.h b/src/player-info/alignment.h index f0c76d8b7..e38b6c7bd 100644 --- a/src/player-info/alignment.h +++ b/src/player-info/alignment.h @@ -2,15 +2,15 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class PlayerAlignment { public: - PlayerAlignment(player_type *player_ptr); + PlayerAlignment(PlayerType *player_ptr); virtual ~PlayerAlignment() = default; concptr get_alignment_description(bool with_value = false); void update_alignment(); private: - player_type *player_ptr; + PlayerType *player_ptr; concptr alignment_label(); void bias_good_alignment(int value); void bias_evil_alignment(int value); diff --git a/src/player-info/base-status-info.cpp b/src/player-info/base-status-info.cpp index adc552629..1f50bac06 100644 --- a/src/player-info/base-status-info.cpp +++ b/src/player-info/base-status-info.cpp @@ -7,7 +7,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -void set_equipment_influence(player_type *player_ptr, self_info_type *self_ptr) +void set_equipment_influence(PlayerType *player_ptr, self_info_type *self_ptr) { for (int k = INVEN_MAIN_HAND; k < INVEN_TOTAL; k++) { object_type *o_ptr = &player_ptr->inventory_list[k]; @@ -55,7 +55,7 @@ void set_equipment_influence(player_type *player_ptr, self_info_type *self_ptr) self_ptr->info[self_ptr->line++] = _("あなたの攻撃速度は装備によって影響を受けている。", "Your attack speed is affected by your equipment."); } -void set_status_sustain_info(player_type *player_ptr, self_info_type *self_ptr) +void set_status_sustain_info(PlayerType *player_ptr, self_info_type *self_ptr) { if (has_sustain_str(player_ptr)) { self_ptr->info[self_ptr->line++] = _("あなたの腕力は維持されている。", "Your strength is sustained."); diff --git a/src/player-info/base-status-info.h b/src/player-info/base-status-info.h index 8240033d9..bb59d9938 100644 --- a/src/player-info/base-status-info.h +++ b/src/player-info/base-status-info.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; +class PlayerType; struct self_info_type; -void set_equipment_influence(player_type *player_ptr, self_info_type *self_ptr); -void set_status_sustain_info(player_type *player_ptr, self_info_type *self_ptr); +void set_equipment_influence(PlayerType *player_ptr, self_info_type *self_ptr); +void set_status_sustain_info(PlayerType *player_ptr, self_info_type *self_ptr); diff --git a/src/player-info/body-improvement-info.cpp b/src/player-info/body-improvement-info.cpp index cd003b272..3f473fa7e 100644 --- a/src/player-info/body-improvement-info.cpp +++ b/src/player-info/body-improvement-info.cpp @@ -5,7 +5,7 @@ #include "system/player-type-definition.h" /*!< @todo 並び順の都合で連番を付ける。まとめても良いならまとめてしまう予定 */ -void set_body_improvement_info_1(player_type *player_ptr, self_info_type *self_ptr) +void set_body_improvement_info_1(PlayerType *player_ptr, self_info_type *self_ptr) { if (is_blessed(player_ptr)) self_ptr->info[self_ptr->line++] = _("あなたは高潔さを感じている。", "You feel rightous."); @@ -30,7 +30,7 @@ void set_body_improvement_info_1(player_type *player_ptr, self_info_type *self_p } /*!< @todo 並び順の都合で連番を付ける。まとめても良いならまとめてしまう予定 */ -void set_body_improvement_info_2(player_type *player_ptr, self_info_type *self_ptr) +void set_body_improvement_info_2(PlayerType *player_ptr, self_info_type *self_ptr) { if (player_ptr->new_spells) self_ptr->info[self_ptr->line++] = _("あなたは呪文や祈りを学ぶことができる。", "You can learn some spells/prayers."); @@ -61,7 +61,7 @@ void set_body_improvement_info_2(player_type *player_ptr, self_info_type *self_p } /*!< @todo 並び順の都合で連番を付ける。まとめても良いならまとめてしまう予定 */ -void set_body_improvement_info_3(player_type *player_ptr, self_info_type *self_ptr) +void set_body_improvement_info_3(PlayerType *player_ptr, self_info_type *self_ptr) { if (player_ptr->hold_exp) self_ptr->info[self_ptr->line++] = _("あなたは自己の経験値をしっかりと維持する。", "You have a firm hold on your experience."); @@ -122,7 +122,7 @@ void set_body_improvement_info_3(player_type *player_ptr, self_info_type *self_p } /*!< @todo 並び順の都合で連番を付ける。まとめても良いならまとめてしまう予定 */ -void set_body_improvement_info_4(player_type *player_ptr, self_info_type *self_ptr) +void set_body_improvement_info_4(PlayerType *player_ptr, self_info_type *self_ptr) { if (has_resist_fear(player_ptr)) self_ptr->info[self_ptr->line++] = _("あなたは全く恐怖を感じない。", "You are completely fearless."); diff --git a/src/player-info/body-improvement-info.h b/src/player-info/body-improvement-info.h index e63ea2292..29d20f61c 100644 --- a/src/player-info/body-improvement-info.h +++ b/src/player-info/body-improvement-info.h @@ -1,8 +1,8 @@ #pragma once -struct player_type; +class PlayerType; struct self_info_type; -void set_body_improvement_info_1(player_type *player_ptr, self_info_type *self_ptr); -void set_body_improvement_info_2(player_type *player_ptr, self_info_type *self_ptr); -void set_body_improvement_info_3(player_type *player_ptr, self_info_type *self_ptr); -void set_body_improvement_info_4(player_type *player_ptr, self_info_type *self_ptr); +void set_body_improvement_info_1(PlayerType *player_ptr, self_info_type *self_ptr); +void set_body_improvement_info_2(PlayerType *player_ptr, self_info_type *self_ptr); +void set_body_improvement_info_3(PlayerType *player_ptr, self_info_type *self_ptr); +void set_body_improvement_info_4(PlayerType *player_ptr, self_info_type *self_ptr); diff --git a/src/player-info/class-ability-info.cpp b/src/player-info/class-ability-info.cpp index 39ad26e8f..0e0ea1f2d 100644 --- a/src/player-info/class-ability-info.cpp +++ b/src/player-info/class-ability-info.cpp @@ -4,7 +4,7 @@ #include "realm/realm-types.h" #include "system/player-type-definition.h" -void set_class_ability_info(player_type *player_ptr, self_info_type *self_ptr) +void set_class_ability_info(PlayerType *player_ptr, self_info_type *self_ptr) { switch (player_ptr->pclass) { case PlayerClassType::WARRIOR: diff --git a/src/player-info/class-ability-info.h b/src/player-info/class-ability-info.h index de51664ee..dc695bc02 100644 --- a/src/player-info/class-ability-info.h +++ b/src/player-info/class-ability-info.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; +class PlayerType; struct self_info_type; -void set_class_ability_info(player_type *player_ptr, self_info_type *self_ptr); +void set_class_ability_info(PlayerType *player_ptr, self_info_type *self_ptr); diff --git a/src/player-info/equipment-info.cpp b/src/player-info/equipment-info.cpp index 595ee990b..ff393dad6 100644 --- a/src/player-info/equipment-info.cpp +++ b/src/player-info/equipment-info.cpp @@ -12,7 +12,7 @@ * @param i 判定する手のID(右手:INVEN_MAIN_HAND 左手:INVEN_SUB_HAND) * @return 持っているならばTRUE */ -bool has_melee_weapon(player_type *player_ptr, int slot) +bool has_melee_weapon(PlayerType *player_ptr, int slot) { const auto o_ptr = &player_ptr->inventory_list[slot]; return o_ptr->k_idx && o_ptr->is_melee_weapon(); @@ -23,7 +23,7 @@ bool has_melee_weapon(player_type *player_ptr, int slot) * @param riding_control 乗馬中により片手を必要としている状態ならばTRUEを返す。 * @return 開いている手のビットフラグ */ -BIT_FLAGS16 empty_hands(player_type *player_ptr, bool riding_control) +BIT_FLAGS16 empty_hands(PlayerType *player_ptr, bool riding_control) { BIT_FLAGS16 status = EMPTY_HAND_NONE; if (!player_ptr->inventory_list[INVEN_MAIN_HAND].k_idx) @@ -41,7 +41,7 @@ BIT_FLAGS16 empty_hands(player_type *player_ptr, bool riding_control) return status; } -bool can_two_hands_wielding(player_type *player_ptr) +bool can_two_hands_wielding(PlayerType *player_ptr) { return !player_ptr->riding || any_bits(player_ptr->pet_extra_flags, PF_TWO_HANDS); } @@ -50,7 +50,7 @@ bool can_two_hands_wielding(player_type *player_ptr) * @brief プレイヤーが防具重量制限のある職業時にペナルティを受ける状態にあるかどうかを返す。 * @return ペナルティが適用されるならばTRUE。 */ -bool heavy_armor(player_type *player_ptr) +bool heavy_armor(PlayerType *player_ptr) { if ((player_ptr->pclass != PlayerClassType::MONK) && (player_ptr->pclass != PlayerClassType::FORCETRAINER) && (player_ptr->pclass != PlayerClassType::NINJA)) return false; diff --git a/src/player-info/equipment-info.h b/src/player-info/equipment-info.h index fbf520645..ea5a98726 100644 --- a/src/player-info/equipment-info.h +++ b/src/player-info/equipment-info.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -bool has_melee_weapon(player_type *player_ptr, int i); -BIT_FLAGS16 empty_hands(player_type *player_ptr, bool riding_control); -bool can_two_hands_wielding(player_type *player_ptr); -bool heavy_armor(player_type *player_ptr); +class PlayerType; +bool has_melee_weapon(PlayerType *player_ptr, int i); +BIT_FLAGS16 empty_hands(PlayerType *player_ptr, bool riding_control); +bool can_two_hands_wielding(PlayerType *player_ptr); +bool heavy_armor(PlayerType *player_ptr); diff --git a/src/player-info/mutation-info.cpp b/src/player-info/mutation-info.cpp index 6e2414510..d0e79797c 100644 --- a/src/player-info/mutation-info.cpp +++ b/src/player-info/mutation-info.cpp @@ -6,7 +6,7 @@ #include "util/bit-flags-calculator.h" /*!< @todo FEAELESS フラグも記述して問題ないと思われる */ -void set_mutation_info(player_type *player_ptr, self_info_type *self_ptr) +void set_mutation_info(PlayerType *player_ptr, self_info_type *self_ptr) { if (player_ptr->muta.none()) return; diff --git a/src/player-info/mutation-info.h b/src/player-info/mutation-info.h index f39e1b93a..5c31bb2e8 100644 --- a/src/player-info/mutation-info.h +++ b/src/player-info/mutation-info.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; +class PlayerType; struct self_info_type; -void set_mutation_info(player_type *player_ptr, self_info_type *self_ptr); +void set_mutation_info(PlayerType *player_ptr, self_info_type *self_ptr); diff --git a/src/player-info/race-ability-info.cpp b/src/player-info/race-ability-info.cpp index 0833fe68e..05178e2ed 100644 --- a/src/player-info/race-ability-info.cpp +++ b/src/player-info/race-ability-info.cpp @@ -9,7 +9,7 @@ * @details * 使用可能レベル以上を条件とする。 */ -void set_race_ability_info(player_type *player_ptr, self_info_type *self_ptr) +void set_race_ability_info(PlayerType *player_ptr, self_info_type *self_ptr) { switch (player_ptr->prace) { case PlayerRaceType::DWARF: diff --git a/src/player-info/race-ability-info.h b/src/player-info/race-ability-info.h index 343f522ff..639458e41 100644 --- a/src/player-info/race-ability-info.h +++ b/src/player-info/race-ability-info.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; +class PlayerType; struct self_info_type; -void set_race_ability_info(player_type *player_ptr, self_info_type *self_ptr); +void set_race_ability_info(PlayerType *player_ptr, self_info_type *self_ptr); diff --git a/src/player-info/race-info.cpp b/src/player-info/race-info.cpp index 15aa24c46..bcd460498 100644 --- a/src/player-info/race-info.cpp +++ b/src/player-info/race-info.cpp @@ -17,7 +17,7 @@ const player_race_info *rp_ptr; * @param player_ptr プレイヤー情報への参照ポインタ * @return シンボル文字 */ -SYMBOL_CODE get_summon_symbol_from_player(player_type *player_ptr) +SYMBOL_CODE get_summon_symbol_from_player(PlayerType *player_ptr) { SYMBOL_CODE symbol = 'N'; auto mmc_ptr = PlayerRace(player_ptr).get_info(); diff --git a/src/player-info/race-info.h b/src/player-info/race-info.h index 786c5bb0f..90fc18856 100644 --- a/src/player-info/race-info.h +++ b/src/player-info/race-info.h @@ -111,5 +111,5 @@ struct player_race_info { extern const player_race_info *rp_ptr; -struct player_type; -SYMBOL_CODE get_summon_symbol_from_player(player_type *player_ptr); +class PlayerType; +SYMBOL_CODE get_summon_symbol_from_player(PlayerType *player_ptr); diff --git a/src/player-info/resistance-info.cpp b/src/player-info/resistance-info.cpp index 4665ee0e2..c39253e6c 100644 --- a/src/player-info/resistance-info.cpp +++ b/src/player-info/resistance-info.cpp @@ -6,7 +6,7 @@ #include "status/element-resistance.h" #include "system/player-type-definition.h" -void set_element_resistance_info(player_type *player_ptr, self_info_type *self_ptr) +void set_element_resistance_info(PlayerType *player_ptr, self_info_type *self_ptr) { const auto race_tr_flags = PlayerRace(player_ptr).tr_flags(); @@ -56,7 +56,7 @@ void set_element_resistance_info(player_type *player_ptr, self_info_type *self_p self_ptr->info[self_ptr->line++] = _("あなたは毒への耐性を持っている。", "You are resistant to poison."); } -void set_high_resistance_info(player_type *player_ptr, self_info_type *self_ptr) +void set_high_resistance_info(PlayerType *player_ptr, self_info_type *self_ptr) { if (has_resist_lite(player_ptr)) self_ptr->info[self_ptr->line++] = _("あなたは閃光への耐性を持っている。", "You are resistant to bright light."); diff --git a/src/player-info/resistance-info.h b/src/player-info/resistance-info.h index bfe65c0b7..8833af209 100644 --- a/src/player-info/resistance-info.h +++ b/src/player-info/resistance-info.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; +class PlayerType; struct self_info_type; -void set_element_resistance_info(player_type *player_ptr, self_info_type *self_ptr); -void set_high_resistance_info(player_type *player_ptr, self_info_type *self_ptr); +void set_element_resistance_info(PlayerType *player_ptr, self_info_type *self_ptr); +void set_high_resistance_info(PlayerType *player_ptr, self_info_type *self_ptr); diff --git a/src/player-info/self-info.cpp b/src/player-info/self-info.cpp index b75107530..6cea35fbf 100644 --- a/src/player-info/self-info.cpp +++ b/src/player-info/self-info.cpp @@ -32,7 +32,7 @@ #include "timed-effect/timed-effects.h" #include "view/display-self-info.h" -static void set_bad_status_info(player_type *player_ptr, self_info_type *self_ptr) +static void set_bad_status_info(PlayerType *player_ptr, self_info_type *self_ptr) { auto effects = player_ptr->effects(); if (player_ptr->blind) @@ -57,7 +57,7 @@ static void set_bad_status_info(player_type *player_ptr, self_info_type *self_pt self_ptr->info[self_ptr->line++] = _("あなたは幻覚を見ている。", "You are hallucinating."); } -static void set_curse_info(player_type *player_ptr, self_info_type *self_ptr) +static void set_curse_info(PlayerType *player_ptr, self_info_type *self_ptr) { if (player_ptr->cursed.has(CurseTraitType::TY_CURSE)) self_ptr->info[self_ptr->line++] = _("あなたは邪悪な怨念に包まれている。", "You carry an ancient foul curse."); @@ -114,7 +114,7 @@ static void set_curse_info(player_type *player_ptr, self_info_type *self_ptr) self_ptr->info[self_ptr->line++] = _("あなたは魔力を吸われている。", "You occasionally lose spell points for no reason."); } -static void set_special_attack_info(player_type *player_ptr, self_info_type *self_ptr) +static void set_special_attack_info(PlayerType *player_ptr, self_info_type *self_ptr) { if (player_ptr->special_attack & ATTACK_CONFUSE) self_ptr->info[self_ptr->line++] = _("あなたの手は赤く輝いている。", "Your hands are glowing dull red."); @@ -135,7 +135,7 @@ static void set_special_attack_info(player_type *player_ptr, self_info_type *sel self_ptr->info[self_ptr->line++] = _("あなたの手は毒に覆われている。", "You can strike the enemy with poison."); } -static void set_esp_info(player_type *player_ptr, self_info_type *self_ptr) +static void set_esp_info(PlayerType *player_ptr, self_info_type *self_ptr) { if (player_ptr->telepathy) self_ptr->info[self_ptr->line++] = _("あなたはテレパシー能力を持っている。", "You have ESP."); @@ -194,7 +194,7 @@ static void set_esp_info(player_type *player_ptr, self_info_type *self_ptr) * Use the "show_file()" method, perhaps. * */ -void self_knowledge(player_type *player_ptr) +void self_knowledge(PlayerType *player_ptr) { self_info_type tmp_si; self_info_type *self_ptr = initialize_self_info_type(&tmp_si); @@ -264,7 +264,7 @@ static concptr report_magic_durations[] = { _("ごく短い間", "for a short ti /*! * @brief 現在の一時的効果一覧を返す / Report all currently active magical effects. */ -void report_magics(player_type *player_ptr) +void report_magics(PlayerType *player_ptr) { int i = 0; concptr info[128]; diff --git a/src/player-info/self-info.h b/src/player-info/self-info.h index c01027af7..6241bd99d 100644 --- a/src/player-info/self-info.h +++ b/src/player-info/self-info.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void self_knowledge(player_type *player_ptr); -void report_magics(player_type *player_ptr); +class PlayerType; +void self_knowledge(PlayerType *player_ptr); +void report_magics(PlayerType *player_ptr); diff --git a/src/player-info/weapon-effect-info.cpp b/src/player-info/weapon-effect-info.cpp index 76d2f059e..f29ecc4c6 100644 --- a/src/player-info/weapon-effect-info.cpp +++ b/src/player-info/weapon-effect-info.cpp @@ -100,7 +100,7 @@ static void set_slay_info(self_info_type *self_ptr) self_ptr->info[self_ptr->line++] = _("あなたの武器はドラゴンに対して特に強い力を発揮する。", "Your weapon is especially deadly against dragons."); } -void set_weapon_effect_info(player_type *player_ptr, self_info_type *self_ptr) +void set_weapon_effect_info(PlayerType *player_ptr, self_info_type *self_ptr) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND]; if (o_ptr->k_idx == 0) diff --git a/src/player-info/weapon-effect-info.h b/src/player-info/weapon-effect-info.h index 420263525..f5a8a1146 100644 --- a/src/player-info/weapon-effect-info.h +++ b/src/player-info/weapon-effect-info.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; +class PlayerType; struct self_info_type; -void set_weapon_effect_info(player_type *player_ptr, self_info_type *self_ptr); +void set_weapon_effect_info(PlayerType *player_ptr, self_info_type *self_ptr); diff --git a/src/player-status/player-basic-statistics.cpp b/src/player-status/player-basic-statistics.cpp index c62645d9c..df7142500 100644 --- a/src/player-status/player-basic-statistics.cpp +++ b/src/player-status/player-basic-statistics.cpp @@ -17,7 +17,7 @@ #include "util/bit-flags-calculator.h" #include "util/enum-converter.h" -PlayerBasicStatistics::PlayerBasicStatistics(player_type *player_ptr) +PlayerBasicStatistics::PlayerBasicStatistics(PlayerType *player_ptr) : PlayerStatusBase(player_ptr) { } diff --git a/src/player-status/player-basic-statistics.h b/src/player-status/player-basic-statistics.h index 5493a25c9..1cc72e590 100644 --- a/src/player-status/player-basic-statistics.h +++ b/src/player-status/player-basic-statistics.h @@ -3,7 +3,7 @@ #include "player-ability/player-ability-types.h" #include "player-status/player-status-base.h" -struct player_type; +class PlayerType; class PlayerBasicStatistics : public PlayerStatusBase { public: void update_value(); @@ -11,7 +11,7 @@ public: int16_t get_value() override; protected: - PlayerBasicStatistics(player_type *player_ptr); + PlayerBasicStatistics(PlayerType *player_ptr); player_ability_type ability_type{}; int16_t race_value() override; diff --git a/src/player-status/player-energy.cpp b/src/player-status/player-energy.cpp index 7f70a44b5..2599fa215 100644 --- a/src/player-status/player-energy.cpp +++ b/src/player-status/player-energy.cpp @@ -8,7 +8,7 @@ #include "player-status/player-energy.h" #include "system/player-type-definition.h" -PlayerEnergy::PlayerEnergy(player_type *player_ptr) +PlayerEnergy::PlayerEnergy(PlayerType *player_ptr) { this->player_ptr = player_ptr; } @@ -46,7 +46,7 @@ void PlayerEnergy::div_player_turn_energy(ENERGY need_cost) /* * @brief ターン消費をなくす (主にコマンド実行に失敗した場合) - * @param player_type プレイヤーへの参照ポインタ + * @param PlayerType プレイヤーへの参照ポインタ */ void PlayerEnergy::reset_player_turn() { diff --git a/src/player-status/player-energy.h b/src/player-status/player-energy.h index 563147f42..673b9c69f 100644 --- a/src/player-status/player-energy.h +++ b/src/player-status/player-energy.h @@ -2,10 +2,10 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class PlayerEnergy { public: - PlayerEnergy(player_type *player_ptr); + PlayerEnergy(PlayerType *player_ptr); virtual ~PlayerEnergy() = default; void set_player_turn_energy(ENERGY need_cost); // 代入. void add_player_turn_energy(ENERGY need_cost); // 加算. @@ -14,5 +14,5 @@ public: void div_player_turn_energy(ENERGY need_cost); // 除算. void reset_player_turn(); private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/player-status/player-infravision.cpp b/src/player-status/player-infravision.cpp index c98692152..4c1aab798 100644 --- a/src/player-status/player-infravision.cpp +++ b/src/player-status/player-infravision.cpp @@ -7,7 +7,7 @@ #include "system/player-type-definition.h" #include "util/enum-converter.h" -PlayerInfravision::PlayerInfravision(player_type *player_ptr) +PlayerInfravision::PlayerInfravision(PlayerType *player_ptr) : PlayerStatusBase(player_ptr) { } diff --git a/src/player-status/player-infravision.h b/src/player-status/player-infravision.h index ef1daed4d..61e1e1467 100644 --- a/src/player-status/player-infravision.h +++ b/src/player-status/player-infravision.h @@ -3,7 +3,7 @@ class PlayerInfravision : public PlayerStatusBase { public: - PlayerInfravision(player_type *player_ptr); + PlayerInfravision(PlayerType *player_ptr); protected: void set_locals() override; diff --git a/src/player-status/player-speed.cpp b/src/player-status/player-speed.cpp index bd859e3b4..8cdb586d0 100644 --- a/src/player-status/player-speed.cpp +++ b/src/player-status/player-speed.cpp @@ -30,7 +30,7 @@ #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" -PlayerSpeed::PlayerSpeed(player_type *player_ptr) +PlayerSpeed::PlayerSpeed(PlayerType *player_ptr) : PlayerStatusBase(player_ptr) { } diff --git a/src/player-status/player-speed.h b/src/player-status/player-speed.h index a7b1e3a2d..dcc50ba76 100644 --- a/src/player-status/player-speed.h +++ b/src/player-status/player-speed.h @@ -3,7 +3,7 @@ class PlayerSpeed : public PlayerStatusBase { public: - PlayerSpeed(player_type *player_ptr); + PlayerSpeed(PlayerType *player_ptr); protected: void set_locals() override; diff --git a/src/player-status/player-status-base.cpp b/src/player-status/player-status-base.cpp index 4b9bbb170..f80331121 100644 --- a/src/player-status/player-status-base.cpp +++ b/src/player-status/player-status-base.cpp @@ -12,7 +12,7 @@ * @details * * コンストラクタでplayer_ptrをセット。メンバ変数を0クリア。 */ -PlayerStatusBase::PlayerStatusBase(player_type *player_ptr) +PlayerStatusBase::PlayerStatusBase(PlayerType *player_ptr) : player_ptr(player_ptr) { this->set_locals(); /* 初期化。基底クラスの0クリアが呼ばれる。*/ diff --git a/src/player-status/player-status-base.h b/src/player-status/player-status-base.h index 677df31dd..f648c52a3 100644 --- a/src/player-status/player-status-base.h +++ b/src/player-status/player-status-base.h @@ -2,7 +2,7 @@ #include "system/angband.h" #include "player/player-status-flags.h" -struct player_type; +class PlayerType; class PlayerStatusBase { public: virtual ~PlayerStatusBase() = default; @@ -12,12 +12,12 @@ public: virtual BIT_FLAGS get_bad_flags(); protected: - PlayerStatusBase(player_type *player_ptr); + PlayerStatusBase(PlayerType *player_ptr); int16_t default_value; int16_t min_value; int16_t max_value; - player_type *player_ptr; + PlayerType *player_ptr; tr_type tr_flag; tr_type tr_bad_flag; virtual void set_locals(); diff --git a/src/player-status/player-stealth.cpp b/src/player-status/player-stealth.cpp index 567fc7202..d083f1108 100644 --- a/src/player-status/player-stealth.cpp +++ b/src/player-status/player-stealth.cpp @@ -17,7 +17,7 @@ #include "util/bit-flags-calculator.h" #include "util/enum-converter.h" -PlayerStealth::PlayerStealth(player_type* player_ptr) +PlayerStealth::PlayerStealth(PlayerType* player_ptr) : PlayerStatusBase(player_ptr) { } diff --git a/src/player-status/player-stealth.h b/src/player-status/player-stealth.h index 2b1f11c63..229afc7f2 100644 --- a/src/player-status/player-stealth.h +++ b/src/player-status/player-stealth.h @@ -3,7 +3,7 @@ class PlayerStealth : public PlayerStatusBase { public: - PlayerStealth(player_type *player_ptr); + PlayerStealth(PlayerType *player_ptr); BIT_FLAGS get_bad_flags() override; diff --git a/src/player/digestion-processor.cpp b/src/player/digestion-processor.cpp index b30095ecd..717e7c444 100644 --- a/src/player/digestion-processor.cpp +++ b/src/player/digestion-processor.cpp @@ -25,7 +25,7 @@ * @brief 10ゲームターンが進行するごとにプレイヤーの腹を減らす * @param player_ptr プレイヤーへの参照ポインタ */ -void starve_player(player_type *player_ptr) +void starve_player(PlayerType *player_ptr) { if (player_ptr->phase_out) return; @@ -95,7 +95,7 @@ void starve_player(player_type *player_ptr) * game turns, or 500/(100/5) = 25 player turns (if nothing else is * affecting the player speed).\n */ -bool set_food(player_type *player_ptr, TIME_EFFECT v) +bool set_food(PlayerType *player_ptr, TIME_EFFECT v) { int old_aux, new_aux; diff --git a/src/player/digestion-processor.h b/src/player/digestion-processor.h index c30e32392..c59a5782c 100644 --- a/src/player/digestion-processor.h +++ b/src/player/digestion-processor.h @@ -9,6 +9,6 @@ #define PY_FOOD_FAINT 500 /*!< 衰弱~衰弱(赤表示/麻痺)の閾値 / Food value (Fainting) */ #define PY_FOOD_STARVE 100 /*!< 衰弱(赤表示/麻痺)~飢餓ダメージの閾値 / Food value (Starving) */ -struct player_type; -void starve_player(player_type *player_ptr); -bool set_food(player_type *player_ptr, TIME_EFFECT v); +class PlayerType; +void starve_player(PlayerType *player_ptr); +bool set_food(PlayerType *player_ptr, TIME_EFFECT v); diff --git a/src/player/eldritch-horror.cpp b/src/player/eldritch-horror.cpp index a163ee2d2..e4356843c 100644 --- a/src/player/eldritch-horror.cpp +++ b/src/player/eldritch-horror.cpp @@ -82,7 +82,7 @@ static void feel_eldritch_horror(concptr desc, monster_race *r_ptr) * @param m_ptr ELDRITCH_HORRORを引き起こしたモンスターの参照ポインタ。薬・罠・魔法の影響ならnullptr * @param necro 暗黒領域魔法の詠唱失敗によるものならばTRUEを返す */ -void sanity_blast(player_type *player_ptr, monster_type *m_ptr, bool necro) +void sanity_blast(PlayerType *player_ptr, monster_type *m_ptr, bool necro) { if (player_ptr->phase_out || !w_ptr->character_dungeon) return; diff --git a/src/player/eldritch-horror.h b/src/player/eldritch-horror.h index d5b96fddf..a4d9cb802 100644 --- a/src/player/eldritch-horror.h +++ b/src/player/eldritch-horror.h @@ -1,5 +1,5 @@ #pragma once struct monster_type; -struct player_type; -void sanity_blast(player_type *player_ptr, monster_type *m_ptr, bool necro); +class PlayerType; +void sanity_blast(PlayerType *player_ptr, monster_type *m_ptr, bool necro); diff --git a/src/player/patron.cpp b/src/player/patron.cpp index 44abc613f..c2c06c63f 100644 --- a/src/player/patron.cpp +++ b/src/player/patron.cpp @@ -139,7 +139,7 @@ Patron::Patron(const char *name, std::vector reward_table, player { } -void Patron::gain_level_reward(player_type *player_ptr_, int chosen_reward) +void Patron::gain_level_reward(PlayerType *player_ptr_, int chosen_reward) { this->player_ptr = player_ptr_; char wrath_reason[32] = ""; @@ -561,7 +561,7 @@ void Patron::gain_level_reward(player_type *player_ptr_, int chosen_reward) } } -void Patron::admire(player_type *player_ptr_) +void Patron::admire(PlayerType *player_ptr_) { this->player_ptr = player_ptr_; if ((this->player_ptr->pclass == PlayerClassType::CHAOS_WARRIOR) || this->player_ptr->muta.has(PlayerMutationType::CHAOS_GIFT)) { diff --git a/src/player/patron.h b/src/player/patron.h index d1ccf0cb3..0f752874b 100644 --- a/src/player/patron.h +++ b/src/player/patron.h @@ -46,7 +46,7 @@ enum patron_reward { REW_SER_MONS = 36, /*!< カオスパトロンからの報酬: モンスターの下僕下賜 */ }; -struct player_type; +class PlayerType; enum player_ability_type : int; /*! @@ -64,11 +64,11 @@ public: virtual ~Patron() = default; // @note C4458 クラスメンバーの隠蔽 への対応として末尾に「_」を付ける. - void gain_level_reward(player_type *player_ptr_, int chosen_reward); - void admire(player_type *player_ptr_); + void gain_level_reward(PlayerType *player_ptr_, int chosen_reward); + void admire(PlayerType *player_ptr_); private: - player_type *player_ptr = nullptr; //!< プレイヤー参照ポインタ + PlayerType *player_ptr = nullptr; //!< プレイヤー参照ポインタ std::vector reward_table; //!< 報酬テーブル player_ability_type boost_stat; //!< 強化能力値傾向 }; diff --git a/src/player/permanent-resistances.cpp b/src/player/permanent-resistances.cpp index 4090fb52b..774fdc272 100644 --- a/src/player/permanent-resistances.cpp +++ b/src/player/permanent-resistances.cpp @@ -20,7 +20,7 @@ * @param flags 耐性フラグの配列 * @todo 最終的にplayer-status系列と統合する */ -static void add_mutation_flags(player_type *player_ptr, TrFlags &flags) +static void add_mutation_flags(PlayerType *player_ptr, TrFlags &flags) { if (player_ptr->muta.none()) return; @@ -54,7 +54,7 @@ static void add_mutation_flags(player_type *player_ptr, TrFlags &flags) * @param flags 耐性フラグの配列 * @todo 最終的にplayer-status系列と統合する */ -static void add_personality_flags(player_type *player_ptr, TrFlags &flags) +static void add_personality_flags(PlayerType *player_ptr, TrFlags &flags) { if (player_ptr->ppersonality == PERSONALITY_SEXY) flags.set(TR_AGGRAVATE); @@ -82,7 +82,7 @@ static void add_personality_flags(player_type *player_ptr, TrFlags &flags) * Obtain the "flags" for the player as if he was an item * @todo 最終的にplayer-status系列と統合する */ -void player_flags(player_type *player_ptr, TrFlags &flags) +void player_flags(PlayerType *player_ptr, TrFlags &flags) { flags.clear(); @@ -93,7 +93,7 @@ void player_flags(player_type *player_ptr, TrFlags &flags) add_personality_flags(player_ptr, flags); } -void riding_flags(player_type *player_ptr, TrFlags &flags, TrFlags &negative_flags) +void riding_flags(PlayerType *player_ptr, TrFlags &flags, TrFlags &negative_flags) { flags.clear(); negative_flags.clear(); diff --git a/src/player/permanent-resistances.h b/src/player/permanent-resistances.h index 2b8f26a3b..d223e98ba 100644 --- a/src/player/permanent-resistances.h +++ b/src/player/permanent-resistances.h @@ -4,6 +4,6 @@ #include "object-enchant/tr-flags.h" -struct player_type; -void player_flags(player_type *player_ptr, TrFlags &flags); -void riding_flags(player_type *player_ptr, TrFlags &flags, TrFlags &negative_flags); +class PlayerType; +void player_flags(PlayerType *player_ptr, TrFlags &flags); +void riding_flags(PlayerType *player_ptr, TrFlags &flags, TrFlags &negative_flags); diff --git a/src/player/player-damage.cpp b/src/player/player-damage.cpp index d7bdca163..1758def89 100644 --- a/src/player/player-damage.cpp +++ b/src/player/player-damage.cpp @@ -70,7 +70,7 @@ #include "view/display-messages.h" #include "world/world.h" -using dam_func = HIT_POINT (*)(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); +using dam_func = HIT_POINT (*)(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); /*! * @brief 酸攻撃による装備のAC劣化処理 / @@ -82,7 +82,7 @@ using dam_func = HIT_POINT (*)(player_type *player_ptr, HIT_POINT dam, concptr k * Note that the "base armor" of an object never changes. * If any armor is damaged (or resists), the player takes less damage. */ -static bool acid_minus_ac(player_type *player_ptr) +static bool acid_minus_ac(PlayerType *player_ptr) { object_type *o_ptr = nullptr; switch (randint1(7)) { @@ -144,7 +144,7 @@ static bool acid_minus_ac(player_type *player_ptr) * @return 修正HPダメージ量 * @details 酸オーラは存在しないが関数ポインタのために引数だけは用意している */ -HIT_POINT acid_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura) +HIT_POINT acid_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura) { int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3; bool double_resist = is_oppose_acid(player_ptr); @@ -177,7 +177,7 @@ HIT_POINT acid_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool * @param aura オーラよるダメージが原因ならばTRUE * @return 修正HPダメージ量 */ -HIT_POINT elec_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura) +HIT_POINT elec_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura) { int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3; bool double_resist = is_oppose_elec(player_ptr); @@ -209,7 +209,7 @@ HIT_POINT elec_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool * @param aura オーラよるダメージが原因ならばTRUE * @return 修正HPダメージ量 */ -HIT_POINT fire_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura) +HIT_POINT fire_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura) { int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3; bool double_resist = is_oppose_fire(player_ptr); @@ -241,7 +241,7 @@ HIT_POINT fire_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool * @param aura オーラよるダメージが原因ならばTRUE * @return 修正HPダメージ量 */ -HIT_POINT cold_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura) +HIT_POINT cold_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura) { int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3; bool double_resist = is_oppose_cold(player_ptr); @@ -270,7 +270,7 @@ HIT_POINT cold_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool * the game when he dies, since the "You die." message is shown before * setting the player to "dead". */ -int take_hit(player_type *player_ptr, int damage_type, HIT_POINT damage, concptr hit_from) +int take_hit(PlayerType *player_ptr, int damage_type, HIT_POINT damage, concptr hit_from) { int old_chp = player_ptr->chp; @@ -556,7 +556,7 @@ int take_hit(player_type *player_ptr, int damage_type, HIT_POINT damage, concptr * @param dam_func ダメージ処理を行う関数の参照ポインタ * @param message オーラダメージを受けた際のメッセージ */ -static void process_aura_damage(monster_type *m_ptr, player_type *player_ptr, bool immune, MonsterAuraType aura_flag, dam_func dam_func, concptr message) +static void process_aura_damage(monster_type *m_ptr, PlayerType *player_ptr, bool immune, MonsterAuraType aura_flag, dam_func dam_func, concptr message) { auto *r_ptr = &r_info[m_ptr->r_idx]; if (r_ptr->aura_flags.has_not(aura_flag) || immune) { @@ -580,7 +580,7 @@ static void process_aura_damage(monster_type *m_ptr, player_type *player_ptr, bo * @param m_ptr オーラを持つモンスターの構造体参照ポインタ * @param player_ptr プレイヤーへの参照ポインタ */ -void touch_zap_player(monster_type *m_ptr, player_type *player_ptr) +void touch_zap_player(monster_type *m_ptr, PlayerType *player_ptr) { process_aura_damage(m_ptr, player_ptr, has_immune_fire(player_ptr) != 0, MonsterAuraType::FIRE, fire_dam, _("突然とても熱くなった!", "You are suddenly very hot!")); process_aura_damage(m_ptr, player_ptr, has_immune_cold(player_ptr) != 0, MonsterAuraType::COLD, cold_dam, _("突然とても寒くなった!", "You are suddenly very cold!")); diff --git a/src/player/player-damage.h b/src/player/player-damage.h index cc25f399e..16c251103 100644 --- a/src/player/player-damage.h +++ b/src/player/player-damage.h @@ -10,10 +10,10 @@ #define DAMAGE_USELIFE 6 struct monster_type; -struct player_type; -int take_hit(player_type *player_ptr, int damage_type, HIT_POINT damage, concptr kb_str); -HIT_POINT acid_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); -HIT_POINT elec_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); -HIT_POINT fire_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); -HIT_POINT cold_dam(player_type *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); -void touch_zap_player(monster_type *m_ptr, player_type *player_ptr); +class PlayerType; +int take_hit(PlayerType *player_ptr, int damage_type, HIT_POINT damage, concptr kb_str); +HIT_POINT acid_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); +HIT_POINT elec_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); +HIT_POINT fire_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); +HIT_POINT cold_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura); +void touch_zap_player(monster_type *m_ptr, PlayerType *player_ptr); diff --git a/src/player/player-move.cpp b/src/player/player-move.cpp index 52199eb73..650f76753 100644 --- a/src/player/player-move.cpp +++ b/src/player/player-move.cpp @@ -59,7 +59,7 @@ POSITION temp2_y[MAX_SHORT]; * @param y 対象となるマスのY座標 * @param x 対象となるマスのX座標 */ -static void discover_hidden_things(player_type *player_ptr, POSITION y, POSITION x) +static void discover_hidden_things(PlayerType *player_ptr, POSITION y, POSITION x) { grid_type *g_ptr; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -95,7 +95,7 @@ static void discover_hidden_things(player_type *player_ptr, POSITION y, POSITION * @brief プレイヤーの探索処理判定 * @param player_ptr プレイヤーへの参照ポインタ */ -void search(player_type *player_ptr) +void search(PlayerType *player_ptr) { PERCENTAGE chance = player_ptr->skill_srh; if (player_ptr->blind || no_lite(player_ptr)) @@ -117,7 +117,7 @@ void search(player_type *player_ptr) * @param mpe_mode 移動オプションフラグ * @return プレイヤーが死亡やフロア離脱を行わず、実際に移動が可能ならばTRUEを返す。 */ -bool move_player_effect(player_type *player_ptr, POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) +bool move_player_effect(PlayerType *player_ptr, POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) { POSITION oy = player_ptr->y; POSITION ox = player_ptr->x; @@ -271,7 +271,7 @@ bool move_player_effect(player_type *player_ptr, POSITION ny, POSITION nx, BIT_F * @param feat 地形ID * @return トラップが自動的に無効ならばTRUEを返す */ -bool trap_can_be_ignored(player_type *player_ptr, FEAT_IDX feat) +bool trap_can_be_ignored(PlayerType *player_ptr, FEAT_IDX feat) { feature_type *f_ptr = &f_info[feat]; if (f_ptr->flags.has_not(FloorFeatureType::TRAP)) diff --git a/src/player/player-move.h b/src/player/player-move.h index 0e5b27d2a..b32df4cc1 100644 --- a/src/player/player-move.h +++ b/src/player/player-move.h @@ -28,7 +28,7 @@ extern int flow_tail; extern POSITION temp2_x[MAX_SHORT]; extern POSITION temp2_y[MAX_SHORT]; -struct player_type; -bool move_player_effect(player_type *player_ptr, POSITION ny, POSITION nx, BIT_FLAGS mpe_mode); -bool trap_can_be_ignored(player_type *player_ptr, FEAT_IDX feat); -void search(player_type *player_ptr); +class PlayerType; +bool move_player_effect(PlayerType *player_ptr, POSITION ny, POSITION nx, BIT_FLAGS mpe_mode); +bool trap_can_be_ignored(PlayerType *player_ptr, FEAT_IDX feat); +void search(PlayerType *player_ptr); diff --git a/src/player/player-realm.cpp b/src/player/player-realm.cpp index 7bb3a20a0..cd116e3ec 100644 --- a/src/player/player-realm.cpp +++ b/src/player/player-realm.cpp @@ -72,12 +72,12 @@ const std::vector realm_choices2 = { (CH_NONE), /* Elementalist */ }; -ItemKindType get_realm1_book(player_type *player_ptr) +ItemKindType get_realm1_book(PlayerType *player_ptr) { return ItemKindType::LIFE_BOOK + player_ptr->realm1 - 1; } -ItemKindType get_realm2_book(player_type *player_ptr) +ItemKindType get_realm2_book(PlayerType *player_ptr) { return ItemKindType::LIFE_BOOK + player_ptr->realm2 - 1; } diff --git a/src/player/player-realm.h b/src/player/player-realm.h index 73a262bfb..f9d3a40b4 100644 --- a/src/player/player-realm.h +++ b/src/player/player-realm.h @@ -25,7 +25,7 @@ enum choosable_realm { extern const std::vector realm_choices1; extern const std::vector realm_choices2; -struct player_type; +class PlayerType; enum class ItemKindType : short; -ItemKindType get_realm1_book(player_type *player_ptr); -ItemKindType get_realm2_book(player_type *player_ptr); +ItemKindType get_realm1_book(PlayerType *player_ptr); +ItemKindType get_realm2_book(PlayerType *player_ptr); diff --git a/src/player/player-skill.cpp b/src/player/player-skill.cpp index 8ce3761eb..4c9d4405d 100644 --- a/src/player/player-skill.cpp +++ b/src/player/player-skill.cpp @@ -40,7 +40,7 @@ namespace { using GainAmountList = std::array; -void gain_attack_skill_exp(player_type *player_ptr, short &exp, const GainAmountList &gain_amount_list) +void gain_attack_skill_exp(PlayerType *player_ptr, short &exp, const GainAmountList &gain_amount_list) { auto gain_amount = 0; auto calc_gain_amount = [&gain_amount_list, exp](PlayerSkillRank rank, int next_rank_exp) { @@ -61,7 +61,7 @@ void gain_attack_skill_exp(player_type *player_ptr, short &exp, const GainAmount set_bits(player_ptr->update, PU_BONUS); } -void gain_spell_skill_exp_aux(player_type *player_ptr, short &exp, const GainAmountList &gain_amount_list, int spell_level) +void gain_spell_skill_exp_aux(PlayerType *player_ptr, short &exp, const GainAmountList &gain_amount_list, int spell_level) { const auto dlev = player_ptr->current_floor_ptr->dun_level; const auto plev = player_ptr->lev; @@ -93,7 +93,7 @@ void gain_spell_skill_exp_aux(player_type *player_ptr, short &exp, const GainAmo } -PlayerSkill::PlayerSkill(player_type *player_ptr) +PlayerSkill::PlayerSkill(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/player/player-skill.h b/src/player/player-skill.h index b1e646651..17888164c 100644 --- a/src/player/player-skill.h +++ b/src/player/player-skill.h @@ -43,11 +43,11 @@ extern std::vector s_info; struct monster_race; struct object_type; -struct player_type; +class PlayerType; class PlayerSkill { public: - PlayerSkill(player_type *player_ptr); + PlayerSkill(PlayerType *player_ptr); static SUB_EXP weapon_exp_at(PlayerSkillRank rank); static SUB_EXP spell_exp_at(PlayerSkillRank rank); @@ -72,5 +72,5 @@ public: EXP exp_of_spell(int realm, int spell_idx) const; private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/player/player-status-flags.cpp b/src/player/player-status-flags.cpp index 9729ec001..f8db0b345 100644 --- a/src/player/player-status-flags.cpp +++ b/src/player/player-status-flags.cpp @@ -51,7 +51,7 @@ namespace { * @param tr_flag 特性フラグ * @return tr_flag が得られる要因となるフラグの集合 */ -BIT_FLAGS common_cause_flags(player_type *player_ptr, tr_type tr_flag) +BIT_FLAGS common_cause_flags(PlayerType *player_ptr, tr_type tr_flag) { BIT_FLAGS result = check_equipment_flags(player_ptr, tr_flag); @@ -111,7 +111,7 @@ BIT_FLAGS convert_inventory_slot_type_to_flag_cause(inventory_slot_type inventor /*! * @brief 装備による所定の特性フラグを得ているかを一括して取得する関数。 */ -BIT_FLAGS check_equipment_flags(player_type *player_ptr, tr_type tr_flag) +BIT_FLAGS check_equipment_flags(PlayerType *player_ptr, tr_type tr_flag) { object_type *o_ptr; BIT_FLAGS result = 0L; @@ -128,7 +128,7 @@ BIT_FLAGS check_equipment_flags(player_type *player_ptr, tr_type tr_flag) return result; } -BIT_FLAGS player_flags_brand_pois(player_type *player_ptr) +BIT_FLAGS player_flags_brand_pois(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_BRAND_POIS); @@ -138,7 +138,7 @@ BIT_FLAGS player_flags_brand_pois(player_type *player_ptr) return result; } -BIT_FLAGS player_flags_brand_acid(player_type *player_ptr) +BIT_FLAGS player_flags_brand_acid(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_BRAND_ACID); @@ -148,7 +148,7 @@ BIT_FLAGS player_flags_brand_acid(player_type *player_ptr) return result; } -BIT_FLAGS player_flags_brand_elec(player_type *player_ptr) +BIT_FLAGS player_flags_brand_elec(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_BRAND_ELEC); @@ -158,7 +158,7 @@ BIT_FLAGS player_flags_brand_elec(player_type *player_ptr) return result; } -BIT_FLAGS player_flags_brand_fire(player_type *player_ptr) +BIT_FLAGS player_flags_brand_fire(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_BRAND_FIRE); @@ -168,7 +168,7 @@ BIT_FLAGS player_flags_brand_fire(player_type *player_ptr) return result; } -BIT_FLAGS player_flags_brand_cold(player_type *player_ptr) +BIT_FLAGS player_flags_brand_cold(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_BRAND_COLD); @@ -183,7 +183,7 @@ BIT_FLAGS player_flags_brand_cold(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param tr_flag 要求する装備フラグ */ -BIT_FLAGS get_player_flags(player_type *player_ptr, tr_type tr_flag) +BIT_FLAGS get_player_flags(PlayerType *player_ptr, tr_type tr_flag) { switch (tr_flag) { case TR_STR: @@ -464,7 +464,7 @@ BIT_FLAGS get_player_flags(player_type *player_ptr, tr_type tr_flag) /*! * @brief プレイヤーが壁破壊進行を持っているかを返す。 */ -bool has_kill_wall(player_type *player_ptr) +bool has_kill_wall(PlayerType *player_ptr) { if (player_ptr->mimic_form == MIMIC_DEMON_LORD || music_singing(player_ptr, MUSIC_WALL)) { return true; @@ -488,7 +488,7 @@ bool has_kill_wall(player_type *player_ptr) * * 時限で幽体化、壁抜けをもつか種族幽霊ならばひとまずTRUE。 * * 但し騎乗中は乗騎が壁抜けを持っていなければ不能になる。 */ -bool has_pass_wall(player_type *player_ptr) +bool has_pass_wall(PlayerType *player_ptr) { bool pow = false; @@ -511,7 +511,7 @@ bool has_pass_wall(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_xtra_might(player_type *player_ptr) +BIT_FLAGS has_xtra_might(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_XTRA_MIGHT); } @@ -521,7 +521,7 @@ BIT_FLAGS has_xtra_might(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_evil(player_type *player_ptr) +BIT_FLAGS has_esp_evil(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_ESP_EVIL); if (player_ptr->realm1 == REALM_HEX) { @@ -536,7 +536,7 @@ BIT_FLAGS has_esp_evil(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_animal(player_type *player_ptr) +BIT_FLAGS has_esp_animal(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_ANIMAL); } @@ -546,7 +546,7 @@ BIT_FLAGS has_esp_animal(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_undead(player_type *player_ptr) +BIT_FLAGS has_esp_undead(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_UNDEAD); } @@ -556,7 +556,7 @@ BIT_FLAGS has_esp_undead(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_demon(player_type *player_ptr) +BIT_FLAGS has_esp_demon(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_DEMON); } @@ -566,7 +566,7 @@ BIT_FLAGS has_esp_demon(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_orc(player_type *player_ptr) +BIT_FLAGS has_esp_orc(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_ORC); } @@ -576,7 +576,7 @@ BIT_FLAGS has_esp_orc(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_troll(player_type *player_ptr) +BIT_FLAGS has_esp_troll(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_TROLL); } @@ -586,7 +586,7 @@ BIT_FLAGS has_esp_troll(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_giant(player_type *player_ptr) +BIT_FLAGS has_esp_giant(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_GIANT); } @@ -596,7 +596,7 @@ BIT_FLAGS has_esp_giant(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_dragon(player_type *player_ptr) +BIT_FLAGS has_esp_dragon(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_DRAGON); } @@ -606,7 +606,7 @@ BIT_FLAGS has_esp_dragon(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_human(player_type *player_ptr) +BIT_FLAGS has_esp_human(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_HUMAN); } @@ -616,7 +616,7 @@ BIT_FLAGS has_esp_human(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_good(player_type *player_ptr) +BIT_FLAGS has_esp_good(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_GOOD); } @@ -626,7 +626,7 @@ BIT_FLAGS has_esp_good(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_nonliving(player_type *player_ptr) +BIT_FLAGS has_esp_nonliving(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_NONLIVING); } @@ -636,7 +636,7 @@ BIT_FLAGS has_esp_nonliving(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_unique(player_type *player_ptr) +BIT_FLAGS has_esp_unique(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_ESP_UNIQUE); } @@ -646,7 +646,7 @@ BIT_FLAGS has_esp_unique(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 持っていたら所持前提ビットフラグを返す。 */ -BIT_FLAGS has_esp_telepathy(player_type *player_ptr) +BIT_FLAGS has_esp_telepathy(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_TELEPATHY); @@ -661,27 +661,27 @@ BIT_FLAGS has_esp_telepathy(player_type *player_ptr) return result; } -BIT_FLAGS has_bless_blade(player_type *player_ptr) +BIT_FLAGS has_bless_blade(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_BLESSED); } -BIT_FLAGS has_easy2_weapon(player_type *player_ptr) +BIT_FLAGS has_easy2_weapon(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_EASY2_WEAPON); } -BIT_FLAGS has_down_saving(player_type *player_ptr) +BIT_FLAGS has_down_saving(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_DOWN_SAVING); } -BIT_FLAGS has_no_ac(player_type *player_ptr) +BIT_FLAGS has_no_ac(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_NO_AC); } -BIT_FLAGS has_invuln_arrow(player_type *player_ptr) +BIT_FLAGS has_invuln_arrow(PlayerType *player_ptr) { if (player_ptr->blind) return 0; @@ -689,7 +689,7 @@ BIT_FLAGS has_invuln_arrow(player_type *player_ptr) return common_cause_flags(player_ptr, TR_INVULN_ARROW); } -void check_no_flowed(player_type *player_ptr) +void check_no_flowed(PlayerType *player_ptr) { object_type *o_ptr; bool has_sw = false, has_kabe = false; @@ -735,17 +735,17 @@ void check_no_flowed(player_type *player_ptr) } } -BIT_FLAGS has_mighty_throw(player_type *player_ptr) +BIT_FLAGS has_mighty_throw(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_MIGHTY_THROW); } -BIT_FLAGS has_dec_mana(player_type *player_ptr) +BIT_FLAGS has_dec_mana(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_DEC_MANA); } -BIT_FLAGS has_reflect(player_type *player_ptr) +BIT_FLAGS has_reflect(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_REFLECT); @@ -756,12 +756,12 @@ BIT_FLAGS has_reflect(player_type *player_ptr) return result; } -BIT_FLAGS has_see_nocto(player_type *player_ptr) +BIT_FLAGS has_see_nocto(PlayerType *player_ptr) { return (player_ptr->pclass == PlayerClassType::NINJA) ? FLAG_CAUSE_CLASS : FLAG_CAUSE_NONE; } -BIT_FLAGS has_warning(player_type *player_ptr) +BIT_FLAGS has_warning(PlayerType *player_ptr) { BIT_FLAGS result = 0L; object_type *o_ptr; @@ -781,17 +781,17 @@ BIT_FLAGS has_warning(player_type *player_ptr) return result; } -BIT_FLAGS has_anti_magic(player_type *player_ptr) +BIT_FLAGS has_anti_magic(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_NO_MAGIC); } -BIT_FLAGS has_anti_tele(player_type *player_ptr) +BIT_FLAGS has_anti_tele(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_NO_TELE); } -BIT_FLAGS has_sh_fire(player_type *player_ptr) +BIT_FLAGS has_sh_fire(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SH_FIRE); @@ -806,7 +806,7 @@ BIT_FLAGS has_sh_fire(player_type *player_ptr) return result; } -BIT_FLAGS has_sh_elec(player_type *player_ptr) +BIT_FLAGS has_sh_elec(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SH_ELEC); @@ -820,7 +820,7 @@ BIT_FLAGS has_sh_elec(player_type *player_ptr) return result; } -BIT_FLAGS has_sh_cold(player_type *player_ptr) +BIT_FLAGS has_sh_cold(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SH_COLD); @@ -831,17 +831,17 @@ BIT_FLAGS has_sh_cold(player_type *player_ptr) return result; } -BIT_FLAGS has_easy_spell(player_type *player_ptr) +BIT_FLAGS has_easy_spell(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_EASY_SPELL); } -BIT_FLAGS has_heavy_spell(player_type *player_ptr) +BIT_FLAGS has_heavy_spell(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_HEAVY_SPELL); } -BIT_FLAGS has_hold_exp(player_type *player_ptr) +BIT_FLAGS has_hold_exp(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_HOLD_EXP); @@ -856,7 +856,7 @@ BIT_FLAGS has_hold_exp(player_type *player_ptr) return result; } -BIT_FLAGS has_see_inv(player_type *player_ptr) +BIT_FLAGS has_see_inv(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SEE_INVIS); @@ -867,12 +867,12 @@ BIT_FLAGS has_see_inv(player_type *player_ptr) return result; } -BIT_FLAGS has_magic_mastery(player_type *player_ptr) +BIT_FLAGS has_magic_mastery(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_MAGIC_MASTERY); } -BIT_FLAGS has_free_act(player_type *player_ptr) +BIT_FLAGS has_free_act(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_FREE_ACT); @@ -886,7 +886,7 @@ BIT_FLAGS has_free_act(player_type *player_ptr) return result; } -BIT_FLAGS has_sustain_str(player_type *player_ptr) +BIT_FLAGS has_sustain_str(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SUST_STR); @@ -897,7 +897,7 @@ BIT_FLAGS has_sustain_str(player_type *player_ptr) return result; } -BIT_FLAGS has_sustain_int(player_type *player_ptr) +BIT_FLAGS has_sustain_int(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SUST_INT); @@ -908,7 +908,7 @@ BIT_FLAGS has_sustain_int(player_type *player_ptr) return result; } -BIT_FLAGS has_sustain_wis(player_type *player_ptr) +BIT_FLAGS has_sustain_wis(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SUST_WIS); @@ -919,7 +919,7 @@ BIT_FLAGS has_sustain_wis(player_type *player_ptr) return result; } -BIT_FLAGS has_sustain_dex(player_type *player_ptr) +BIT_FLAGS has_sustain_dex(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SUST_DEX); @@ -930,7 +930,7 @@ BIT_FLAGS has_sustain_dex(player_type *player_ptr) return result; } -BIT_FLAGS has_sustain_con(player_type *player_ptr) +BIT_FLAGS has_sustain_con(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SUST_CON); @@ -941,7 +941,7 @@ BIT_FLAGS has_sustain_con(player_type *player_ptr) return result; } -BIT_FLAGS has_sustain_chr(player_type *player_ptr) +BIT_FLAGS has_sustain_chr(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SUST_CHR); @@ -952,7 +952,7 @@ BIT_FLAGS has_sustain_chr(player_type *player_ptr) return result; } -BIT_FLAGS has_levitation(player_type *player_ptr) +BIT_FLAGS has_levitation(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_LEVITATION); @@ -978,7 +978,7 @@ BIT_FLAGS has_levitation(player_type *player_ptr) return result; } -bool has_can_swim(player_type *player_ptr) +bool has_can_swim(PlayerType *player_ptr) { bool can_swim = false; if (player_ptr->riding) { @@ -991,7 +991,7 @@ bool has_can_swim(player_type *player_ptr) return can_swim; } -BIT_FLAGS has_slow_digest(player_type *player_ptr) +BIT_FLAGS has_slow_digest(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_SLOW_DIGEST); @@ -1002,7 +1002,7 @@ BIT_FLAGS has_slow_digest(player_type *player_ptr) return result; } -BIT_FLAGS has_regenerate(player_type *player_ptr) +BIT_FLAGS has_regenerate(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_REGEN); @@ -1019,7 +1019,7 @@ BIT_FLAGS has_regenerate(player_type *player_ptr) return result; } -void update_curses(player_type *player_ptr) +void update_curses(PlayerType *player_ptr) { object_type *o_ptr; player_ptr->cursed.clear(); @@ -1095,17 +1095,17 @@ void update_curses(player_type *player_ptr) player_ptr->cursed_special.reset(CurseSpecialTraitType::TELEPORT_SELF); } -BIT_FLAGS has_impact(player_type *player_ptr) +BIT_FLAGS has_impact(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_IMPACT); } -BIT_FLAGS has_earthquake(player_type *player_ptr) +BIT_FLAGS has_earthquake(PlayerType *player_ptr) { return common_cause_flags(player_ptr, TR_EARTHQUAKE); } -void update_extra_blows(player_type *player_ptr) +void update_extra_blows(PlayerType *player_ptr) { object_type *o_ptr; player_ptr->extra_blows[0] = player_ptr->extra_blows[1] = 0; @@ -1132,7 +1132,7 @@ void update_extra_blows(player_type *player_ptr) } } -BIT_FLAGS has_resist_acid(player_type *player_ptr) +BIT_FLAGS has_resist_acid(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_ACID); @@ -1145,7 +1145,7 @@ BIT_FLAGS has_resist_acid(player_type *player_ptr) return result; } -BIT_FLAGS has_vuln_acid(player_type *player_ptr) +BIT_FLAGS has_vuln_acid(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_VUL_ACID); @@ -1156,7 +1156,7 @@ BIT_FLAGS has_vuln_acid(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_elec(player_type *player_ptr) +BIT_FLAGS has_resist_elec(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_ELEC); @@ -1169,7 +1169,7 @@ BIT_FLAGS has_resist_elec(player_type *player_ptr) return result; } -BIT_FLAGS has_vuln_elec(player_type *player_ptr) +BIT_FLAGS has_vuln_elec(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_VUL_ELEC); @@ -1180,7 +1180,7 @@ BIT_FLAGS has_vuln_elec(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_fire(player_type *player_ptr) +BIT_FLAGS has_resist_fire(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_FIRE); @@ -1193,7 +1193,7 @@ BIT_FLAGS has_resist_fire(player_type *player_ptr) return result; } -BIT_FLAGS has_vuln_fire(player_type *player_ptr) +BIT_FLAGS has_vuln_fire(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_VUL_FIRE); @@ -1204,7 +1204,7 @@ BIT_FLAGS has_vuln_fire(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_cold(player_type *player_ptr) +BIT_FLAGS has_resist_cold(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_COLD); @@ -1217,7 +1217,7 @@ BIT_FLAGS has_resist_cold(player_type *player_ptr) return result; } -BIT_FLAGS has_vuln_cold(player_type *player_ptr) +BIT_FLAGS has_vuln_cold(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_VUL_COLD); @@ -1228,7 +1228,7 @@ BIT_FLAGS has_vuln_cold(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_pois(player_type *player_ptr) +BIT_FLAGS has_resist_pois(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_POIS); @@ -1239,7 +1239,7 @@ BIT_FLAGS has_resist_pois(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_conf(player_type *player_ptr) +BIT_FLAGS has_resist_conf(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_CONF); @@ -1254,7 +1254,7 @@ BIT_FLAGS has_resist_conf(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_sound(player_type *player_ptr) +BIT_FLAGS has_resist_sound(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_SOUND); @@ -1265,7 +1265,7 @@ BIT_FLAGS has_resist_sound(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_lite(player_type *player_ptr) +BIT_FLAGS has_resist_lite(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_LITE); @@ -1276,7 +1276,7 @@ BIT_FLAGS has_resist_lite(player_type *player_ptr) return result; } -BIT_FLAGS has_vuln_lite(player_type *player_ptr) +BIT_FLAGS has_vuln_lite(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_VUL_LITE); @@ -1287,7 +1287,7 @@ BIT_FLAGS has_vuln_lite(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_dark(player_type *player_ptr) +BIT_FLAGS has_resist_dark(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_DARK); @@ -1298,7 +1298,7 @@ BIT_FLAGS has_resist_dark(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_chaos(player_type *player_ptr) +BIT_FLAGS has_resist_chaos(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_CHAOS); @@ -1309,7 +1309,7 @@ BIT_FLAGS has_resist_chaos(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_disen(player_type *player_ptr) +BIT_FLAGS has_resist_disen(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_DISEN); @@ -1320,7 +1320,7 @@ BIT_FLAGS has_resist_disen(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_shard(player_type *player_ptr) +BIT_FLAGS has_resist_shard(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_SHARDS); @@ -1331,7 +1331,7 @@ BIT_FLAGS has_resist_shard(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_nexus(player_type *player_ptr) +BIT_FLAGS has_resist_nexus(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_NEXUS); @@ -1342,7 +1342,7 @@ BIT_FLAGS has_resist_nexus(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_blind(player_type *player_ptr) +BIT_FLAGS has_resist_blind(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_BLIND); @@ -1357,7 +1357,7 @@ BIT_FLAGS has_resist_blind(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_neth(player_type *player_ptr) +BIT_FLAGS has_resist_neth(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_NETHER); @@ -1368,7 +1368,7 @@ BIT_FLAGS has_resist_neth(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_time(player_type *player_ptr) +BIT_FLAGS has_resist_time(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_TIME); @@ -1379,7 +1379,7 @@ BIT_FLAGS has_resist_time(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_water(player_type *player_ptr) +BIT_FLAGS has_resist_water(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_WATER); @@ -1396,7 +1396,7 @@ BIT_FLAGS has_resist_water(player_type *player_ptr) * @param プレイヤー情報への参照ポインタ * @return 呪力耐性を所持していればTRUE、なければFALSE */ -BIT_FLAGS has_resist_curse(player_type *player_ptr) +BIT_FLAGS has_resist_curse(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_CURSE); @@ -1407,7 +1407,7 @@ BIT_FLAGS has_resist_curse(player_type *player_ptr) return result; } -BIT_FLAGS has_resist_fear(player_type *player_ptr) +BIT_FLAGS has_resist_fear(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_RES_FEAR); @@ -1421,7 +1421,7 @@ BIT_FLAGS has_resist_fear(player_type *player_ptr) return result; } -BIT_FLAGS has_immune_acid(player_type *player_ptr) +BIT_FLAGS has_immune_acid(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_IM_ACID); @@ -1433,7 +1433,7 @@ BIT_FLAGS has_immune_acid(player_type *player_ptr) return result; } -BIT_FLAGS has_immune_elec(player_type *player_ptr) +BIT_FLAGS has_immune_elec(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_IM_ELEC); @@ -1445,7 +1445,7 @@ BIT_FLAGS has_immune_elec(player_type *player_ptr) return result; } -BIT_FLAGS has_immune_fire(player_type *player_ptr) +BIT_FLAGS has_immune_fire(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_IM_FIRE); @@ -1457,7 +1457,7 @@ BIT_FLAGS has_immune_fire(player_type *player_ptr) return result; } -BIT_FLAGS has_immune_cold(player_type *player_ptr) +BIT_FLAGS has_immune_cold(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_IM_COLD); @@ -1469,7 +1469,7 @@ BIT_FLAGS has_immune_cold(player_type *player_ptr) return result; } -BIT_FLAGS has_immune_dark(player_type *player_ptr) +BIT_FLAGS has_immune_dark(PlayerType *player_ptr) { BIT_FLAGS result = common_cause_flags(player_ptr, TR_IM_DARK); @@ -1480,7 +1480,7 @@ BIT_FLAGS has_immune_dark(player_type *player_ptr) return result; } -melee_type player_melee_type(player_type *player_ptr) +melee_type player_melee_type(PlayerType *player_ptr) { if (has_two_handed_weapons(player_ptr)) return MELEE_TYPE_WEAPON_TWOHAND; @@ -1513,7 +1513,7 @@ melee_type player_melee_type(player_type *player_ptr) * 利き手が素手かつ左手も素手もしくは盾を装備している事を意味する。 * @details Includes martial arts and hand combats as weapons. */ -bool can_attack_with_main_hand(player_type *player_ptr) +bool can_attack_with_main_hand(PlayerType *player_ptr) { if (has_melee_weapon(player_ptr, INVEN_MAIN_HAND)) return true; @@ -1529,7 +1529,7 @@ bool can_attack_with_main_hand(player_type *player_ptr) * 非利き手で攻撃可能とは、非利き手に武器を持っている事に等しい * @details Exclude martial arts and hand combats from weapons. */ -bool can_attack_with_sub_hand(player_type *player_ptr) +bool can_attack_with_sub_hand(PlayerType *player_ptr) { return has_melee_weapon(player_ptr, INVEN_SUB_HAND); } @@ -1537,7 +1537,7 @@ bool can_attack_with_sub_hand(player_type *player_ptr) /* * @brief 両手持ち状態かどうかを判定する */ -bool has_two_handed_weapons(player_type *player_ptr) +bool has_two_handed_weapons(PlayerType *player_ptr) { if (can_two_hands_wielding(player_ptr)) { if (can_attack_with_main_hand(player_ptr) && (empty_hands(player_ptr, false) == EMPTY_HAND_SUB) @@ -1551,7 +1551,7 @@ bool has_two_handed_weapons(player_type *player_ptr) return false; } -BIT_FLAGS has_lite(player_type *player_ptr) +BIT_FLAGS has_lite(PlayerType *player_ptr) { BIT_FLAGS result = 0L; if (player_ptr->pclass == PlayerClassType::NINJA) @@ -1579,7 +1579,7 @@ BIT_FLAGS has_lite(player_type *player_ptr) * Only can get hit bonuses when wieids an enough light weapon which is lighter than 5 times of weight limit. * If its weight is 10 times heavier or more than weight limit, gets hit penalty in calc_to_hit(). */ -bool has_disable_two_handed_bonus(player_type *player_ptr, int i) +bool has_disable_two_handed_bonus(PlayerType *player_ptr, int i) { if (has_melee_weapon(player_ptr, INVEN_MAIN_HAND + i) && has_two_handed_weapons(player_ptr)) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + i]; @@ -1598,7 +1598,7 @@ bool has_disable_two_handed_bonus(player_type *player_ptr, int i) * @brief ふさわしくない武器を持っているかどうかを返す。 * @todo 相応しい時にFALSEで相応しくない時にTRUEという負論理は良くない、後で修正する */ -bool is_wielding_icky_weapon(player_type *player_ptr, int i) +bool is_wielding_icky_weapon(PlayerType *player_ptr, int i) { auto *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + i]; auto flgs = object_flags(o_ptr); @@ -1624,7 +1624,7 @@ bool is_wielding_icky_weapon(player_type *player_ptr, int i) * @param player_ptr プレイヤーへの参照ポインタ * @param i 武器を持っている手。0ならば利き手、1ならば反対の手 */ -bool is_wielding_icky_riding_weapon(player_type *player_ptr, int i) +bool is_wielding_icky_riding_weapon(PlayerType *player_ptr, int i) { auto *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + i]; auto flgs = object_flags(o_ptr); @@ -1633,7 +1633,7 @@ bool is_wielding_icky_riding_weapon(player_type *player_ptr, int i) return (player_ptr->riding > 0) && !has_no_weapon && !is_suitable; } -bool has_not_ninja_weapon(player_type *player_ptr, int i) +bool has_not_ninja_weapon(PlayerType *player_ptr, int i) { if (!has_melee_weapon(player_ptr, INVEN_MAIN_HAND + i)) { return false; @@ -1646,7 +1646,7 @@ bool has_not_ninja_weapon(player_type *player_ptr, int i) (player_ptr->inventory_list[INVEN_SUB_HAND - i].tval != ItemKindType::SHIELD)); } -bool has_not_monk_weapon(player_type *player_ptr, int i) +bool has_not_monk_weapon(PlayerType *player_ptr, int i) { if (!has_melee_weapon(player_ptr, INVEN_MAIN_HAND + i)) { return false; @@ -1657,12 +1657,12 @@ bool has_not_monk_weapon(player_type *player_ptr, int i) return ((player_ptr->pclass == PlayerClassType::MONK) || (player_ptr->pclass == PlayerClassType::FORCETRAINER)) && !(s_info[enum2i(player_ptr->pclass)].w_max[tval][sval]); } -bool has_good_luck(player_type *player_ptr) +bool has_good_luck(PlayerType *player_ptr) { return (player_ptr->ppersonality == PERSONALITY_LUCKY) || (player_ptr->muta.has(PlayerMutationType::GOOD_LUCK)); } -BIT_FLAGS player_aggravate_state(player_type *player_ptr) +BIT_FLAGS player_aggravate_state(PlayerType *player_ptr) { if (player_ptr->cursed.has(CurseTraitType::AGGRAVATE)) { if ((PlayerRace(player_ptr).equals(PlayerRaceType::S_FAIRY)) && (player_ptr->ppersonality != PERSONALITY_SEXY)) { @@ -1674,7 +1674,7 @@ BIT_FLAGS player_aggravate_state(player_type *player_ptr) return AGGRAVATE_NONE; } -bool has_aggravate(player_type *player_ptr) +bool has_aggravate(PlayerType *player_ptr) { return player_aggravate_state(player_ptr) == AGGRAVATE_NORMAL; } diff --git a/src/player/player-status-flags.h b/src/player/player-status-flags.h index e753d4b59..92b04168c 100644 --- a/src/player/player-status-flags.h +++ b/src/player/player-status-flags.h @@ -47,101 +47,101 @@ enum aggravate_state { AGGRAVATE_NORMAL = 0x00000002L, }; -struct player_type; +class PlayerType; BIT_FLAGS convert_inventory_slot_type_to_flag_cause(inventory_slot_type inventory_slot); -BIT_FLAGS check_equipment_flags(player_type *player_ptr, tr_type tr_flag); -BIT_FLAGS get_player_flags(player_type *player_ptr, tr_type tr_flag); -bool has_pass_wall(player_type *player_ptr); -bool has_kill_wall(player_type *player_ptr); -BIT_FLAGS has_xtra_might(player_type *player_ptr); -BIT_FLAGS has_esp_evil(player_type *player_ptr); -BIT_FLAGS has_esp_animal(player_type *player_ptr); -BIT_FLAGS has_esp_undead(player_type *player_ptr); -BIT_FLAGS has_esp_demon(player_type *player_ptr); -BIT_FLAGS has_esp_orc(player_type *player_ptr); -BIT_FLAGS has_esp_troll(player_type *player_ptr); -BIT_FLAGS has_esp_giant(player_type *player_ptr); -BIT_FLAGS has_esp_dragon(player_type *player_ptr); -BIT_FLAGS has_esp_human(player_type *player_ptr); -BIT_FLAGS has_esp_good(player_type *player_ptr); -BIT_FLAGS has_esp_nonliving(player_type *player_ptr); -BIT_FLAGS has_esp_unique(player_type *player_ptr); -BIT_FLAGS has_esp_telepathy(player_type *player_ptr); -BIT_FLAGS has_bless_blade(player_type *player_ptr); -BIT_FLAGS has_easy2_weapon(player_type *player_ptr); -BIT_FLAGS has_down_saving(player_type *player_ptr); -BIT_FLAGS has_no_ac(player_type *player_ptr); -BIT_FLAGS has_invuln_arrow(player_type *player_ptr); -void check_no_flowed(player_type *player_ptr); -BIT_FLAGS has_mighty_throw(player_type *player_ptr); -BIT_FLAGS has_dec_mana(player_type *player_ptr); -BIT_FLAGS has_reflect(player_type *player_ptr); -BIT_FLAGS has_see_nocto(player_type *player_ptr); -BIT_FLAGS has_warning(player_type *player_ptr); -BIT_FLAGS has_anti_magic(player_type *player_ptr); -BIT_FLAGS has_anti_tele(player_type *player_ptr); -BIT_FLAGS has_sh_fire(player_type *player_ptr); -BIT_FLAGS has_sh_elec(player_type *player_ptr); -BIT_FLAGS has_sh_cold(player_type *player_ptr); -BIT_FLAGS has_easy_spell(player_type *player_ptr); -BIT_FLAGS has_heavy_spell(player_type *player_ptr); -BIT_FLAGS has_hold_exp(player_type *player_ptr); -BIT_FLAGS has_see_inv(player_type *player_ptr); -BIT_FLAGS has_magic_mastery(player_type *player_ptr); -BIT_FLAGS has_free_act(player_type *player_ptr); -BIT_FLAGS has_sustain_str(player_type *player_ptr); -BIT_FLAGS has_sustain_int(player_type *player_ptr); -BIT_FLAGS has_sustain_wis(player_type *player_ptr); -BIT_FLAGS has_sustain_dex(player_type *player_ptr); -BIT_FLAGS has_sustain_con(player_type *player_ptr); -BIT_FLAGS has_sustain_chr(player_type *player_ptr); -BIT_FLAGS has_levitation(player_type *player_ptr); -bool has_can_swim(player_type *player_ptr); -BIT_FLAGS has_slow_digest(player_type *player_ptr); -BIT_FLAGS has_regenerate(player_type *player_ptr); -void update_curses(player_type *player_ptr); -BIT_FLAGS has_impact(player_type *player_ptr); -BIT_FLAGS has_earthquake(player_type *player_ptr); -void update_extra_blows(player_type *player_ptr); -BIT_FLAGS has_resist_acid(player_type *player_ptr); -BIT_FLAGS has_vuln_acid(player_type *player_ptr); -BIT_FLAGS has_resist_elec(player_type *player_ptr); -BIT_FLAGS has_vuln_elec(player_type *player_ptr); -BIT_FLAGS has_resist_fire(player_type *player_ptr); -BIT_FLAGS has_vuln_fire(player_type *player_ptr); -BIT_FLAGS has_resist_cold(player_type *player_ptr); -BIT_FLAGS has_vuln_cold(player_type *player_ptr); -BIT_FLAGS has_resist_pois(player_type *player_ptr); -BIT_FLAGS has_resist_conf(player_type *player_ptr); -BIT_FLAGS has_resist_sound(player_type *player_ptr); -BIT_FLAGS has_resist_lite(player_type *player_ptr); -BIT_FLAGS has_vuln_lite(player_type *player_ptr); -BIT_FLAGS has_resist_dark(player_type *player_ptr); -BIT_FLAGS has_resist_chaos(player_type *player_ptr); -BIT_FLAGS has_resist_disen(player_type *player_ptr); -BIT_FLAGS has_resist_shard(player_type *player_ptr); -BIT_FLAGS has_resist_nexus(player_type *player_ptr); -BIT_FLAGS has_resist_blind(player_type *player_ptr); -BIT_FLAGS has_resist_neth(player_type *player_ptr); -BIT_FLAGS has_resist_time(player_type *player_ptr); -BIT_FLAGS has_resist_water(player_type *player_ptr); -BIT_FLAGS has_resist_curse(player_type *player_ptr); -BIT_FLAGS has_resist_fear(player_type *player_ptr); -BIT_FLAGS has_immune_acid(player_type *player_ptr); -BIT_FLAGS has_immune_elec(player_type *player_ptr); -BIT_FLAGS has_immune_fire(player_type *player_ptr); -BIT_FLAGS has_immune_cold(player_type *player_ptr); -BIT_FLAGS has_immune_dark(player_type *player_ptr); -bool can_attack_with_main_hand(player_type *player_ptr); -bool can_attack_with_sub_hand(player_type *player_ptr); -bool has_two_handed_weapons(player_type *player_ptr); -BIT_FLAGS has_lite(player_type *player_ptr); -bool has_disable_two_handed_bonus(player_type *player_ptr, int i); -bool has_not_ninja_weapon(player_type *player_ptr, int i); -bool has_not_monk_weapon(player_type *player_ptr, int i); -bool is_wielding_icky_weapon(player_type *player_ptr, int i); -bool is_wielding_icky_riding_weapon(player_type *player_ptr, int i); -bool has_good_luck(player_type *player_ptr); -BIT_FLAGS player_aggravate_state(player_type *player_ptr); -melee_type player_melee_type(player_type *player_ptr); -bool has_aggravate(player_type *player_ptr); +BIT_FLAGS check_equipment_flags(PlayerType *player_ptr, tr_type tr_flag); +BIT_FLAGS get_player_flags(PlayerType *player_ptr, tr_type tr_flag); +bool has_pass_wall(PlayerType *player_ptr); +bool has_kill_wall(PlayerType *player_ptr); +BIT_FLAGS has_xtra_might(PlayerType *player_ptr); +BIT_FLAGS has_esp_evil(PlayerType *player_ptr); +BIT_FLAGS has_esp_animal(PlayerType *player_ptr); +BIT_FLAGS has_esp_undead(PlayerType *player_ptr); +BIT_FLAGS has_esp_demon(PlayerType *player_ptr); +BIT_FLAGS has_esp_orc(PlayerType *player_ptr); +BIT_FLAGS has_esp_troll(PlayerType *player_ptr); +BIT_FLAGS has_esp_giant(PlayerType *player_ptr); +BIT_FLAGS has_esp_dragon(PlayerType *player_ptr); +BIT_FLAGS has_esp_human(PlayerType *player_ptr); +BIT_FLAGS has_esp_good(PlayerType *player_ptr); +BIT_FLAGS has_esp_nonliving(PlayerType *player_ptr); +BIT_FLAGS has_esp_unique(PlayerType *player_ptr); +BIT_FLAGS has_esp_telepathy(PlayerType *player_ptr); +BIT_FLAGS has_bless_blade(PlayerType *player_ptr); +BIT_FLAGS has_easy2_weapon(PlayerType *player_ptr); +BIT_FLAGS has_down_saving(PlayerType *player_ptr); +BIT_FLAGS has_no_ac(PlayerType *player_ptr); +BIT_FLAGS has_invuln_arrow(PlayerType *player_ptr); +void check_no_flowed(PlayerType *player_ptr); +BIT_FLAGS has_mighty_throw(PlayerType *player_ptr); +BIT_FLAGS has_dec_mana(PlayerType *player_ptr); +BIT_FLAGS has_reflect(PlayerType *player_ptr); +BIT_FLAGS has_see_nocto(PlayerType *player_ptr); +BIT_FLAGS has_warning(PlayerType *player_ptr); +BIT_FLAGS has_anti_magic(PlayerType *player_ptr); +BIT_FLAGS has_anti_tele(PlayerType *player_ptr); +BIT_FLAGS has_sh_fire(PlayerType *player_ptr); +BIT_FLAGS has_sh_elec(PlayerType *player_ptr); +BIT_FLAGS has_sh_cold(PlayerType *player_ptr); +BIT_FLAGS has_easy_spell(PlayerType *player_ptr); +BIT_FLAGS has_heavy_spell(PlayerType *player_ptr); +BIT_FLAGS has_hold_exp(PlayerType *player_ptr); +BIT_FLAGS has_see_inv(PlayerType *player_ptr); +BIT_FLAGS has_magic_mastery(PlayerType *player_ptr); +BIT_FLAGS has_free_act(PlayerType *player_ptr); +BIT_FLAGS has_sustain_str(PlayerType *player_ptr); +BIT_FLAGS has_sustain_int(PlayerType *player_ptr); +BIT_FLAGS has_sustain_wis(PlayerType *player_ptr); +BIT_FLAGS has_sustain_dex(PlayerType *player_ptr); +BIT_FLAGS has_sustain_con(PlayerType *player_ptr); +BIT_FLAGS has_sustain_chr(PlayerType *player_ptr); +BIT_FLAGS has_levitation(PlayerType *player_ptr); +bool has_can_swim(PlayerType *player_ptr); +BIT_FLAGS has_slow_digest(PlayerType *player_ptr); +BIT_FLAGS has_regenerate(PlayerType *player_ptr); +void update_curses(PlayerType *player_ptr); +BIT_FLAGS has_impact(PlayerType *player_ptr); +BIT_FLAGS has_earthquake(PlayerType *player_ptr); +void update_extra_blows(PlayerType *player_ptr); +BIT_FLAGS has_resist_acid(PlayerType *player_ptr); +BIT_FLAGS has_vuln_acid(PlayerType *player_ptr); +BIT_FLAGS has_resist_elec(PlayerType *player_ptr); +BIT_FLAGS has_vuln_elec(PlayerType *player_ptr); +BIT_FLAGS has_resist_fire(PlayerType *player_ptr); +BIT_FLAGS has_vuln_fire(PlayerType *player_ptr); +BIT_FLAGS has_resist_cold(PlayerType *player_ptr); +BIT_FLAGS has_vuln_cold(PlayerType *player_ptr); +BIT_FLAGS has_resist_pois(PlayerType *player_ptr); +BIT_FLAGS has_resist_conf(PlayerType *player_ptr); +BIT_FLAGS has_resist_sound(PlayerType *player_ptr); +BIT_FLAGS has_resist_lite(PlayerType *player_ptr); +BIT_FLAGS has_vuln_lite(PlayerType *player_ptr); +BIT_FLAGS has_resist_dark(PlayerType *player_ptr); +BIT_FLAGS has_resist_chaos(PlayerType *player_ptr); +BIT_FLAGS has_resist_disen(PlayerType *player_ptr); +BIT_FLAGS has_resist_shard(PlayerType *player_ptr); +BIT_FLAGS has_resist_nexus(PlayerType *player_ptr); +BIT_FLAGS has_resist_blind(PlayerType *player_ptr); +BIT_FLAGS has_resist_neth(PlayerType *player_ptr); +BIT_FLAGS has_resist_time(PlayerType *player_ptr); +BIT_FLAGS has_resist_water(PlayerType *player_ptr); +BIT_FLAGS has_resist_curse(PlayerType *player_ptr); +BIT_FLAGS has_resist_fear(PlayerType *player_ptr); +BIT_FLAGS has_immune_acid(PlayerType *player_ptr); +BIT_FLAGS has_immune_elec(PlayerType *player_ptr); +BIT_FLAGS has_immune_fire(PlayerType *player_ptr); +BIT_FLAGS has_immune_cold(PlayerType *player_ptr); +BIT_FLAGS has_immune_dark(PlayerType *player_ptr); +bool can_attack_with_main_hand(PlayerType *player_ptr); +bool can_attack_with_sub_hand(PlayerType *player_ptr); +bool has_two_handed_weapons(PlayerType *player_ptr); +BIT_FLAGS has_lite(PlayerType *player_ptr); +bool has_disable_two_handed_bonus(PlayerType *player_ptr, int i); +bool has_not_ninja_weapon(PlayerType *player_ptr, int i); +bool has_not_monk_weapon(PlayerType *player_ptr, int i); +bool is_wielding_icky_weapon(PlayerType *player_ptr, int i); +bool is_wielding_icky_riding_weapon(PlayerType *player_ptr, int i); +bool has_good_luck(PlayerType *player_ptr); +BIT_FLAGS player_aggravate_state(PlayerType *player_ptr); +melee_type player_melee_type(PlayerType *player_ptr); +bool has_aggravate(PlayerType *player_ptr); diff --git a/src/player/player-status-resist.cpp b/src/player/player-status-resist.cpp index 0d1db63ae..dca12006f 100644 --- a/src/player/player-status-resist.cpp +++ b/src/player/player-status-resist.cpp @@ -59,7 +59,7 @@ PERCENTAGE randrate(int dice, int fix, rate_calc_type_mode mode) /*! * @brief 酸属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_acid_damage_rate(player_type *player_ptr) +PERCENTAGE calc_acid_damage_rate(PlayerType *player_ptr) { PERCENTAGE per = 100; @@ -90,7 +90,7 @@ PERCENTAGE calc_acid_damage_rate(player_type *player_ptr) /*! * @brief 電撃属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_elec_damage_rate(player_type *player_ptr) +PERCENTAGE calc_elec_damage_rate(PlayerType *player_ptr) { PERCENTAGE per = 100; @@ -120,7 +120,7 @@ PERCENTAGE calc_elec_damage_rate(player_type *player_ptr) /*! * @brief 火炎属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_fire_damage_rate(player_type *player_ptr) +PERCENTAGE calc_fire_damage_rate(PlayerType *player_ptr) { PERCENTAGE per = 100; BIT_FLAGS flgs = has_vuln_fire(player_ptr); @@ -146,7 +146,7 @@ PERCENTAGE calc_fire_damage_rate(player_type *player_ptr) /*! * @brief 冷気属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_cold_damage_rate(player_type *player_ptr) +PERCENTAGE calc_cold_damage_rate(PlayerType *player_ptr) { PERCENTAGE per = 100; BIT_FLAGS flgs = has_vuln_cold(player_ptr); @@ -171,7 +171,7 @@ PERCENTAGE calc_cold_damage_rate(player_type *player_ptr) /*! * @brief 毒属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_pois_damage_rate(player_type *player_ptr) +PERCENTAGE calc_pois_damage_rate(PlayerType *player_ptr) { PERCENTAGE per = 100; if (has_resist_pois(player_ptr)) @@ -185,7 +185,7 @@ PERCENTAGE calc_pois_damage_rate(player_type *player_ptr) /*! * @brief 放射性廃棄物攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_nuke_damage_rate(player_type *player_ptr) +PERCENTAGE calc_nuke_damage_rate(PlayerType *player_ptr) { PERCENTAGE per = 100; @@ -200,7 +200,7 @@ PERCENTAGE calc_nuke_damage_rate(player_type *player_ptr) /*! * @brief 死の光線に対するダメージ倍率計算 */ -PERCENTAGE calc_deathray_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_deathray_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused if (player_ptr->mimic_form) { @@ -229,7 +229,7 @@ PERCENTAGE calc_deathray_damage_rate(player_type *player_ptr, rate_calc_type_mod /*! * @brief 閃光属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_lite_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_lite_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -260,7 +260,7 @@ PERCENTAGE calc_lite_damage_rate(player_type *player_ptr, rate_calc_type_mode mo /*! * @brief 暗黒属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_dark_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_dark_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -278,7 +278,7 @@ PERCENTAGE calc_dark_damage_rate(player_type *player_ptr, rate_calc_type_mode mo /*! * @brief 破片属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_shards_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_shards_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -293,7 +293,7 @@ PERCENTAGE calc_shards_damage_rate(player_type *player_ptr, rate_calc_type_mode /*! * @brief 轟音属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_sound_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_sound_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -308,7 +308,7 @@ PERCENTAGE calc_sound_damage_rate(player_type *player_ptr, rate_calc_type_mode m /*! * @brief 混乱属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_conf_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_conf_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -323,7 +323,7 @@ PERCENTAGE calc_conf_damage_rate(player_type *player_ptr, rate_calc_type_mode mo /*! * @brief 混沌属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_chaos_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_chaos_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -338,7 +338,7 @@ PERCENTAGE calc_chaos_damage_rate(player_type *player_ptr, rate_calc_type_mode m /*! * @brief 劣化属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_disenchant_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_disenchant_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -353,7 +353,7 @@ PERCENTAGE calc_disenchant_damage_rate(player_type *player_ptr, rate_calc_type_m /*! * @brief 因果混乱属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_nexus_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_nexus_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -368,7 +368,7 @@ PERCENTAGE calc_nexus_damage_rate(player_type *player_ptr, rate_calc_type_mode m /*! * @brief ロケット属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_rocket_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_rocket_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused PERCENTAGE per = 100; @@ -383,7 +383,7 @@ PERCENTAGE calc_rocket_damage_rate(player_type *player_ptr, rate_calc_type_mode /*! * @brief 地獄属性攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_nether_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_nether_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { PERCENTAGE per = 100; @@ -400,7 +400,7 @@ PERCENTAGE calc_nether_damage_rate(player_type *player_ptr, rate_calc_type_mode /*! * @brief 時間逆転攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_time_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_time_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused PERCENTAGE per = 100; @@ -416,7 +416,7 @@ PERCENTAGE calc_time_damage_rate(player_type *player_ptr, rate_calc_type_mode mo /*! * @brief 水流攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_water_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_water_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused PERCENTAGE per = 100; @@ -432,7 +432,7 @@ PERCENTAGE calc_water_damage_rate(player_type *player_ptr, rate_calc_type_mode m /*! * @brief 聖なる火炎攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_holy_fire_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_holy_fire_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused PERCENTAGE per = 100; @@ -446,7 +446,7 @@ PERCENTAGE calc_holy_fire_damage_rate(player_type *player_ptr, rate_calc_type_mo /*! * @brief 地獄の火炎攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_hell_fire_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_hell_fire_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused PERCENTAGE per = 100; @@ -458,7 +458,7 @@ PERCENTAGE calc_hell_fire_damage_rate(player_type *player_ptr, rate_calc_type_mo /*! * @brief 重力攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_gravity_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_gravity_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused PERCENTAGE per = 100; @@ -471,7 +471,7 @@ PERCENTAGE calc_gravity_damage_rate(player_type *player_ptr, rate_calc_type_mode /*! * @brief 虚無攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_void_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_void_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused PERCENTAGE per = 100; @@ -489,7 +489,7 @@ PERCENTAGE calc_void_damage_rate(player_type *player_ptr, rate_calc_type_mode mo /*! * @brief 深淵攻撃に対するダメージ倍率計算 */ -PERCENTAGE calc_abyss_damage_rate(player_type *player_ptr, rate_calc_type_mode mode) +PERCENTAGE calc_abyss_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode) { (void)mode; // unused PERCENTAGE per = 100; diff --git a/src/player/player-status-resist.h b/src/player/player-status-resist.h index 80068d62a..6419eb002 100644 --- a/src/player/player-status-resist.h +++ b/src/player/player-status-resist.h @@ -9,28 +9,28 @@ enum rate_calc_type_mode { CALC_MAX = 3, }; -struct player_type; -PERCENTAGE calc_acid_damage_rate(player_type *player_ptr); -PERCENTAGE calc_elec_damage_rate(player_type *player_ptr); -PERCENTAGE calc_fire_damage_rate(player_type *player_ptr); -PERCENTAGE calc_cold_damage_rate(player_type *player_ptr); -PERCENTAGE calc_pois_damage_rate(player_type *player_ptr); -PERCENTAGE calc_nuke_damage_rate(player_type *player_ptr); -PERCENTAGE calc_lite_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_dark_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_shards_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_sound_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_conf_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_chaos_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_nether_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_disenchant_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_nexus_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_time_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_water_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_rocket_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_deathray_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_holy_fire_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_hell_fire_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_gravity_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_void_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); -PERCENTAGE calc_abyss_damage_rate(player_type *player_ptr, rate_calc_type_mode mode); +class PlayerType; +PERCENTAGE calc_acid_damage_rate(PlayerType *player_ptr); +PERCENTAGE calc_elec_damage_rate(PlayerType *player_ptr); +PERCENTAGE calc_fire_damage_rate(PlayerType *player_ptr); +PERCENTAGE calc_cold_damage_rate(PlayerType *player_ptr); +PERCENTAGE calc_pois_damage_rate(PlayerType *player_ptr); +PERCENTAGE calc_nuke_damage_rate(PlayerType *player_ptr); +PERCENTAGE calc_lite_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_dark_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_shards_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_sound_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_conf_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_chaos_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_nether_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_disenchant_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_nexus_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_time_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_water_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_rocket_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_deathray_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_holy_fire_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_hell_fire_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_gravity_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_void_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); +PERCENTAGE calc_abyss_damage_rate(PlayerType *player_ptr, rate_calc_type_mode mode); diff --git a/src/player/player-status.cpp b/src/player/player-status.cpp index 9345ee1a0..07b8c540d 100644 --- a/src/player/player-status.cpp +++ b/src/player/player-status.cpp @@ -115,37 +115,37 @@ static const int extra_magic_glove_reduce_mana = 1; -static bool is_martial_arts_mode(player_type *player_ptr); - -static ACTION_SKILL_POWER calc_disarming(player_type *player_ptr); -static ACTION_SKILL_POWER calc_device_ability(player_type *player_ptr); -static ACTION_SKILL_POWER calc_saving_throw(player_type *player_ptr); -static ACTION_SKILL_POWER calc_search(player_type *player_ptr); -static ACTION_SKILL_POWER calc_search_freq(player_type *player_ptr); -static ACTION_SKILL_POWER calc_to_hit_melee(player_type *player_ptr); -static ACTION_SKILL_POWER calc_to_hit_shoot(player_type *player_ptr); -static ACTION_SKILL_POWER calc_to_hit_throw(player_type *player_ptr); -static ACTION_SKILL_POWER calc_skill_dig(player_type *player_ptr); -static bool is_heavy_wield(player_type *player_ptr, int i); -static int16_t calc_num_blow(player_type *player_ptr, int i); -static int16_t calc_to_magic_chance(player_type *player_ptr); -static ARMOUR_CLASS calc_base_ac(player_type *player_ptr); -static ARMOUR_CLASS calc_to_ac(player_type *player_ptr, bool is_real_value); -static int16_t calc_double_weapon_penalty(player_type *player_ptr, INVENTORY_IDX slot); -static bool is_riding_two_hands(player_type *player_ptr); -static int16_t calc_riding_bow_penalty(player_type *player_ptr); -static void put_equipment_warning(player_type *player_ptr); - -static short calc_to_damage(player_type *player_ptr, INVENTORY_IDX slot, bool is_real_value); -static int16_t calc_to_hit(player_type *player_ptr, INVENTORY_IDX slot, bool is_real_value); - -static int16_t calc_to_hit_bow(player_type *player_ptr, bool is_real_value); - -static int16_t calc_to_damage_misc(player_type *player_ptr); -static int16_t calc_to_hit_misc(player_type *player_ptr); - -static DICE_NUMBER calc_to_weapon_dice_num(player_type *player_ptr, INVENTORY_IDX slot); -static player_hand main_attack_hand(player_type *player_ptr); +static bool is_martial_arts_mode(PlayerType *player_ptr); + +static ACTION_SKILL_POWER calc_disarming(PlayerType *player_ptr); +static ACTION_SKILL_POWER calc_device_ability(PlayerType *player_ptr); +static ACTION_SKILL_POWER calc_saving_throw(PlayerType *player_ptr); +static ACTION_SKILL_POWER calc_search(PlayerType *player_ptr); +static ACTION_SKILL_POWER calc_search_freq(PlayerType *player_ptr); +static ACTION_SKILL_POWER calc_to_hit_melee(PlayerType *player_ptr); +static ACTION_SKILL_POWER calc_to_hit_shoot(PlayerType *player_ptr); +static ACTION_SKILL_POWER calc_to_hit_throw(PlayerType *player_ptr); +static ACTION_SKILL_POWER calc_skill_dig(PlayerType *player_ptr); +static bool is_heavy_wield(PlayerType *player_ptr, int i); +static int16_t calc_num_blow(PlayerType *player_ptr, int i); +static int16_t calc_to_magic_chance(PlayerType *player_ptr); +static ARMOUR_CLASS calc_base_ac(PlayerType *player_ptr); +static ARMOUR_CLASS calc_to_ac(PlayerType *player_ptr, bool is_real_value); +static int16_t calc_double_weapon_penalty(PlayerType *player_ptr, INVENTORY_IDX slot); +static bool is_riding_two_hands(PlayerType *player_ptr); +static int16_t calc_riding_bow_penalty(PlayerType *player_ptr); +static void put_equipment_warning(PlayerType *player_ptr); + +static short calc_to_damage(PlayerType *player_ptr, INVENTORY_IDX slot, bool is_real_value); +static int16_t calc_to_hit(PlayerType *player_ptr, INVENTORY_IDX slot, bool is_real_value); + +static int16_t calc_to_hit_bow(PlayerType *player_ptr, bool is_real_value); + +static int16_t calc_to_damage_misc(PlayerType *player_ptr); +static int16_t calc_to_hit_misc(PlayerType *player_ptr); + +static DICE_NUMBER calc_to_weapon_dice_num(PlayerType *player_ptr, INVENTORY_IDX slot); +static player_hand main_attack_hand(PlayerType *player_ptr); /*** Player information ***/ @@ -155,7 +155,7 @@ static player_hand main_attack_hand(player_type *player_ptr); * @param player_ptr 主観となるプレイヤー構造体参照ポインタ * @todo 将来独自インターフェース実装にはz-term系に追い出すべきか? */ -static void delayed_visual_update(player_type *player_ptr) +static void delayed_visual_update(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (int i = 0; i < floor_ptr->redraw_n; i++) { @@ -184,7 +184,7 @@ static void delayed_visual_update(player_type *player_ptr) * @param o_ptr 判定する射撃武器のアイテム情報参照ポインタ * @return 重すぎるならばTRUE */ -static bool is_heavy_shoot(player_type *player_ptr, object_type *o_ptr) +static bool is_heavy_shoot(PlayerType *player_ptr, object_type *o_ptr) { return (calc_bow_weight_limit(player_ptr) < o_ptr->weight / 10); } @@ -194,7 +194,7 @@ static bool is_heavy_shoot(player_type *player_ptr, object_type *o_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 総重量 */ -WEIGHT calc_inventory_weight(player_type *player_ptr) +WEIGHT calc_inventory_weight(PlayerType *player_ptr) { WEIGHT weight = 0; @@ -208,7 +208,7 @@ WEIGHT calc_inventory_weight(player_type *player_ptr) return weight; } -static void update_ability_scores(player_type *player_ptr) +static void update_ability_scores(PlayerType *player_ptr) { PlayerStrength player_str(player_ptr); PlayerIntelligence player_int(player_ptr); @@ -247,7 +247,7 @@ static void update_ability_scores(player_type *player_ptr) * * @todo ここで計算していた各値は一部の状態変化メッセージ処理を除き、今後必要な時に適示計算する形に移行するためほぼすべて削られる。 */ -static void update_bonuses(player_type *player_ptr) +static void update_bonuses(PlayerType *player_ptr) { auto empty_hands_status = empty_hands(player_ptr, true); object_type *o_ptr; @@ -407,7 +407,7 @@ static void update_bonuses(player_type *player_ptr) * Adjust current hitpoints if necessary * @details */ -static void update_max_hitpoints(player_type *player_ptr) +static void update_max_hitpoints(PlayerType *player_ptr) { int bonus = ((int)(adj_con_mhp[player_ptr->stat_index[A_CON]]) - 128) * player_ptr->lev / 4; int mhp = player_ptr->player_hp[player_ptr->lev - 1]; @@ -474,7 +474,7 @@ static void update_max_hitpoints(player_type *player_ptr) * Note that this function induces various "status" messages, * which must be bypasses until the character is created. */ -static void update_num_of_spells(player_type *player_ptr) +static void update_num_of_spells(PlayerType *player_ptr) { if (mp_ptr->spell_book == ItemKindType::NONE) return; @@ -720,7 +720,7 @@ static void update_num_of_spells(player_type *player_ptr) * @details * This function induces status messages. */ -static void update_max_mana(player_type *player_ptr) +static void update_max_mana(PlayerType *player_ptr) { if ((mp_ptr->spell_book == ItemKindType::NONE) && mp_ptr->spell_first == SPELL_FIRST_NO_SPELL) return; @@ -935,7 +935,7 @@ static void update_max_mana(player_type *player_ptr) * @param o_ptr 計算する射撃武器のアイテム情報参照ポインタ * @return 射撃倍率の値(100で1.00倍) */ -int16_t calc_num_fire(player_type *player_ptr, object_type *o_ptr) +int16_t calc_num_fire(PlayerType *player_ptr, object_type *o_ptr) { int extra_shots = 0; @@ -1004,7 +1004,7 @@ int16_t calc_num_fire(player_type *player_ptr, object_type *o_ptr) * * 器用さに応じたadj_dex_disテーブルによる加算 * * 知力に応じたadj_int_disテーブルによる加算 */ -static ACTION_SKILL_POWER calc_disarming(player_type *player_ptr) +static ACTION_SKILL_POWER calc_disarming(PlayerType *player_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; @@ -1034,7 +1034,7 @@ static ACTION_SKILL_POWER calc_disarming(player_type *player_ptr) * * 知力に応じたadj_int_devテーブルによる加算 * * 狂戦士化による減算(-20) */ -static ACTION_SKILL_POWER calc_device_ability(player_type *player_ptr) +static ACTION_SKILL_POWER calc_device_ability(PlayerType *player_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; @@ -1084,7 +1084,7 @@ static ACTION_SKILL_POWER calc_device_ability(player_type *player_ptr) * * 生命の「究極の耐性」や regist_magic,magicdef持ちなら大なり上書き(95+レベル未満ならその値に上書き) * * 呪いのdown_savingがかかっているなら半減 */ -static ACTION_SKILL_POWER calc_saving_throw(player_type *player_ptr) +static ACTION_SKILL_POWER calc_saving_throw(PlayerType *player_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; @@ -1139,7 +1139,7 @@ static ACTION_SKILL_POWER calc_saving_throw(player_type *player_ptr) * * 狂戦士化による減算(-15) * * 変異(MUT3_XTRA_EYES)による加算(+15) */ -static ACTION_SKILL_POWER calc_search(player_type *player_ptr) +static ACTION_SKILL_POWER calc_search(PlayerType *player_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; @@ -1186,7 +1186,7 @@ static ACTION_SKILL_POWER calc_search(player_type *player_ptr) * * 狂戦士化による減算(-15) * * 変異(MUT3_XTRA_EYES)による加算(+15) */ -static ACTION_SKILL_POWER calc_search_freq(player_type *player_ptr) +static ACTION_SKILL_POWER calc_search_freq(PlayerType *player_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; @@ -1229,7 +1229,7 @@ static ACTION_SKILL_POWER calc_search_freq(player_type *player_ptr) * @details * * 種族/職業/性格による加算とレベルによる追加加算 */ -static ACTION_SKILL_POWER calc_to_hit_melee(player_type *player_ptr) +static ACTION_SKILL_POWER calc_to_hit_melee(PlayerType *player_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; @@ -1253,7 +1253,7 @@ static ACTION_SKILL_POWER calc_to_hit_melee(player_type *player_ptr) * @details * * 種族/職業/性格による加算とレベルによる追加加算 */ -static ACTION_SKILL_POWER calc_to_hit_shoot(player_type *player_ptr) +static ACTION_SKILL_POWER calc_to_hit_shoot(PlayerType *player_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; @@ -1278,7 +1278,7 @@ static ACTION_SKILL_POWER calc_to_hit_shoot(player_type *player_ptr) * * 種族/職業/性格による加算とレベルによる追加加算 * * 狂戦士による減算(-20) */ -static ACTION_SKILL_POWER calc_to_hit_throw(player_type *player_ptr) +static ACTION_SKILL_POWER calc_to_hit_throw(PlayerType *player_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; @@ -1313,7 +1313,7 @@ static ACTION_SKILL_POWER calc_to_hit_throw(player_type *player_ptr) * * 武器重量によるプラス修正 * * 最終算出値に1を保証 */ -static ACTION_SKILL_POWER calc_skill_dig(player_type *player_ptr) +static ACTION_SKILL_POWER calc_skill_dig(PlayerType *player_ptr) { object_type *o_ptr; @@ -1359,20 +1359,20 @@ static ACTION_SKILL_POWER calc_skill_dig(player_type *player_ptr) return pow; } -static bool is_martial_arts_mode(player_type *player_ptr) +static bool is_martial_arts_mode(PlayerType *player_ptr) { return ((player_ptr->pclass == PlayerClassType::MONK) || (player_ptr->pclass == PlayerClassType::FORCETRAINER) || (player_ptr->pclass == PlayerClassType::BERSERKER)) && (any_bits(empty_hands(player_ptr, true), EMPTY_HAND_MAIN)) && !can_attack_with_sub_hand(player_ptr); } -static bool is_heavy_wield(player_type *player_ptr, int i) +static bool is_heavy_wield(PlayerType *player_ptr, int i) { const object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + i]; return has_melee_weapon(player_ptr, INVEN_MAIN_HAND + i) && (calc_weapon_weight_limit(player_ptr) < o_ptr->weight / 10); } -static int16_t calc_num_blow(player_type *player_ptr, int i) +static int16_t calc_num_blow(PlayerType *player_ptr, int i) { object_type *o_ptr; int16_t num_blow = 1; @@ -1508,7 +1508,7 @@ static int16_t calc_num_blow(player_type *player_ptr, int i) * * 性格チャージマンなら加算(+5) * * 装備品にTRC::HARD_SPELLがあるなら加算(軽い呪いなら+3/重い呪いなら+10) */ -static int16_t calc_to_magic_chance(player_type *player_ptr) +static int16_t calc_to_magic_chance(PlayerType *player_ptr) { int16_t chance = 0; @@ -1538,7 +1538,7 @@ static int16_t calc_to_magic_chance(player_type *player_ptr) return chance; } -static ARMOUR_CLASS calc_base_ac(player_type *player_ptr) +static ARMOUR_CLASS calc_base_ac(PlayerType *player_ptr) { ARMOUR_CLASS ac = 0; if (player_ptr->yoiyami) @@ -1561,7 +1561,7 @@ static ARMOUR_CLASS calc_base_ac(player_type *player_ptr) return ac; } -static ARMOUR_CLASS calc_to_ac(player_type *player_ptr, bool is_real_value) +static ARMOUR_CLASS calc_to_ac(PlayerType *player_ptr, bool is_real_value) { ARMOUR_CLASS ac = 0; if (player_ptr->yoiyami) @@ -1733,7 +1733,7 @@ static ARMOUR_CLASS calc_to_ac(player_type *player_ptr, bool is_real_value) * * 武蔵セットによる免除 * * 竿状武器による増加 */ -int16_t calc_double_weapon_penalty(player_type *player_ptr, INVENTORY_IDX slot) +int16_t calc_double_weapon_penalty(PlayerType *player_ptr, INVENTORY_IDX slot) { int penalty = 0; @@ -1765,7 +1765,7 @@ int16_t calc_double_weapon_penalty(player_type *player_ptr, INVENTORY_IDX slot) return (int16_t)penalty; } -static bool is_riding_two_hands(player_type *player_ptr) +static bool is_riding_two_hands(PlayerType *player_ptr) { if (!player_ptr->riding) { return false; @@ -1790,7 +1790,7 @@ static bool is_riding_two_hands(player_type *player_ptr) return false; } -static int16_t calc_riding_bow_penalty(player_type *player_ptr) +static int16_t calc_riding_bow_penalty(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!player_ptr->riding) @@ -1814,7 +1814,7 @@ static int16_t calc_riding_bow_penalty(player_type *player_ptr) return penalty; } -void put_equipment_warning(player_type *player_ptr) +void put_equipment_warning(PlayerType *player_ptr) { bool heavy_shoot = is_heavy_shoot(player_ptr, &player_ptr->inventory_list[INVEN_BOW]); if (player_ptr->old_heavy_shoot != heavy_shoot) { @@ -1905,7 +1905,7 @@ void put_equipment_warning(player_type *player_ptr) } } -static short calc_to_damage(player_type *player_ptr, INVENTORY_IDX slot, bool is_real_value) +static short calc_to_damage(PlayerType *player_ptr, INVENTORY_IDX slot, bool is_real_value) { object_type *o_ptr = &player_ptr->inventory_list[slot]; auto flgs = object_flags(o_ptr); @@ -2047,7 +2047,7 @@ static short calc_to_damage(player_type *player_ptr, INVENTORY_IDX slot, bool is * @details * 'slot' MUST be INVEN_MAIN_HAND or INVEM_SUB_HAND. */ -static short calc_to_hit(player_type *player_ptr, INVENTORY_IDX slot, bool is_real_value) +static short calc_to_hit(PlayerType *player_ptr, INVENTORY_IDX slot, bool is_real_value) { auto hit = 0; @@ -2265,7 +2265,7 @@ static short calc_to_hit(player_type *player_ptr, INVENTORY_IDX slot, bool is_re return static_cast(hit); } -static int16_t calc_to_hit_bow(player_type *player_ptr, bool is_real_value) +static int16_t calc_to_hit_bow(PlayerType *player_ptr, bool is_real_value) { int16_t pow = 0; @@ -2338,7 +2338,7 @@ static int16_t calc_to_hit_bow(player_type *player_ptr, bool is_real_value) return pow; } -static int16_t calc_to_damage_misc(player_type *player_ptr) +static int16_t calc_to_damage_misc(PlayerType *player_ptr) { object_type *o_ptr; @@ -2367,7 +2367,7 @@ static int16_t calc_to_damage_misc(player_type *player_ptr) return to_dam; } -static int16_t calc_to_hit_misc(player_type *player_ptr) +static int16_t calc_to_hit_misc(PlayerType *player_ptr) { object_type *o_ptr; @@ -2406,7 +2406,7 @@ static int16_t calc_to_hit_misc(player_type *player_ptr) return to_hit; } -static DICE_NUMBER calc_to_weapon_dice_num(player_type *player_ptr, INVENTORY_IDX slot) +static DICE_NUMBER calc_to_weapon_dice_num(PlayerType *player_ptr, INVENTORY_IDX slot) { auto *o_ptr = &player_ptr->inventory_list[slot]; return (player_ptr->riding > 0) && o_ptr->is_lance() ? 2 : 0; @@ -2417,7 +2417,7 @@ static DICE_NUMBER calc_to_weapon_dice_num(player_type *player_ptr, INVENTORY_ID * Computes current weight limit. * @return 制限重量(ポンド) */ -WEIGHT calc_weight_limit(player_type *player_ptr) +WEIGHT calc_weight_limit(PlayerType *player_ptr) { WEIGHT i = (WEIGHT)adj_str_wgt[player_ptr->stat_index[A_STR]] * 50; if (player_ptr->pclass == PlayerClassType::BERSERKER) @@ -2429,7 +2429,7 @@ WEIGHT calc_weight_limit(player_type *player_ptr) * @brief update のフラグに応じた更新をまとめて行う / Handle "update" * @details 更新処理の対象はプレイヤーの能力修正/光源寿命/HP/MP/魔法の学習状態、他多数の外界の状態判定。 */ -void update_creature(player_type *player_ptr) +void update_creature(PlayerType *player_ptr) { if (!player_ptr->update) return; @@ -2531,7 +2531,7 @@ void update_creature(player_type *player_ptr) * @brief プレイヤーが魔道書を一冊も持っていないかを判定する * @return 魔道書を一冊も持っていないならTRUEを返す */ -bool player_has_no_spellbooks(player_type *player_ptr) +bool player_has_no_spellbooks(PlayerType *player_ptr) { object_type *o_ptr; for (int i = 0; i < INVEN_PACK; i++) { @@ -2556,7 +2556,7 @@ bool player_has_no_spellbooks(player_type *player_ptr) * @param y 配置先Y座標 * @return 配置に成功したらTRUE */ -bool player_place(player_type *player_ptr, POSITION y, POSITION x) +bool player_place(PlayerType *player_ptr, POSITION y, POSITION x) { if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx != 0) return false; @@ -2570,7 +2570,7 @@ bool player_place(player_type *player_ptr, POSITION y, POSITION x) /*! * @brief 種族アンバライトが出血時パターンの上に乗った際のペナルティ処理 */ -void wreck_the_pattern(player_type *player_ptr) +void wreck_the_pattern(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; int pattern_type = f_info[floor_ptr->grid_array[player_ptr->y][player_ptr->x].feat].subtype; @@ -2600,7 +2600,7 @@ void wreck_the_pattern(player_type *player_ptr) * @brief プレイヤーの経験値について整合性のためのチェックと調整を行う / * Advance experience levels and print experience */ -void check_experience(player_type *player_ptr) +void check_experience(PlayerType *player_ptr) { if (player_ptr->exp < 0) player_ptr->exp = 0; @@ -2794,7 +2794,7 @@ int16_t modify_stat_value(int value, int amount) * Hack -- Calculates the total number of points earned -JWT- * @details */ -long calc_score(player_type *player_ptr) +long calc_score(PlayerType *player_ptr) { int arena_win = std::min(player_ptr->arena_number, MAX_ARENA_MONS); @@ -2864,31 +2864,31 @@ long calc_score(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 祝福状態ならばTRUE */ -bool is_blessed(player_type *player_ptr) +bool is_blessed(PlayerType *player_ptr) { return player_ptr->blessed || music_singing(player_ptr, MUSIC_BLESS) || SpellHex(player_ptr).is_spelling_specific(HEX_BLESS); } -bool is_tim_esp(player_type *player_ptr) +bool is_tim_esp(PlayerType *player_ptr) { auto sniper_data = PlayerClass(player_ptr).get_specific_data(); auto sniper_concent = sniper_data ? sniper_data->concent : 0; return player_ptr->tim_esp || music_singing(player_ptr, MUSIC_MIND) || (sniper_concent >= CONCENT_TELE_THRESHOLD); } -bool is_tim_stealth(player_type *player_ptr) +bool is_tim_stealth(PlayerType *player_ptr) { return player_ptr->tim_stealth || music_singing(player_ptr, MUSIC_STEALTH); } -bool is_time_limit_esp(player_type *player_ptr) +bool is_time_limit_esp(PlayerType *player_ptr) { auto sniper_data = PlayerClass(player_ptr).get_specific_data(); auto sniper_concent = sniper_data ? sniper_data->concent : 0; return player_ptr->tim_esp || music_singing(player_ptr, MUSIC_MIND) || (sniper_concent >= CONCENT_TELE_THRESHOLD); } -bool is_time_limit_stealth(player_type *player_ptr) +bool is_time_limit_stealth(PlayerType *player_ptr) { return player_ptr->tim_stealth || music_singing(player_ptr, MUSIC_STEALTH); } @@ -2897,7 +2897,7 @@ bool is_time_limit_stealth(player_type *player_ptr) * @brief 口を使う継続的な処理を中断する * @param player_ptr プレイヤーへの参照ポインタ */ -void stop_mouth(player_type *player_ptr) +void stop_mouth(PlayerType *player_ptr) { if (music_singing_any(player_ptr)) stop_singing(player_ptr); @@ -2907,37 +2907,37 @@ void stop_mouth(player_type *player_ptr) } } -bool is_fast(player_type *player_ptr) +bool is_fast(PlayerType *player_ptr) { return player_ptr->fast || music_singing(player_ptr, MUSIC_SPEED) || music_singing(player_ptr, MUSIC_SHERO); } -bool is_invuln(player_type *player_ptr) +bool is_invuln(PlayerType *player_ptr) { return player_ptr->invuln || music_singing(player_ptr, MUSIC_INVULN); } -bool is_hero(player_type *player_ptr) +bool is_hero(PlayerType *player_ptr) { return player_ptr->hero || music_singing(player_ptr, MUSIC_HERO) || music_singing(player_ptr, MUSIC_SHERO); } -bool is_shero(player_type *player_ptr) +bool is_shero(PlayerType *player_ptr) { return player_ptr->shero || player_ptr->pclass == PlayerClassType::BERSERKER; } -bool is_echizen(player_type *player_ptr) +bool is_echizen(PlayerType *player_ptr) { return (player_ptr->ppersonality == PERSONALITY_COMBAT) || (player_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON); } -bool is_chargeman(player_type *player_ptr) +bool is_chargeman(PlayerType *player_ptr) { return player_ptr->ppersonality == PERSONALITY_CHARGEMAN; } -WEIGHT calc_weapon_weight_limit(player_type *player_ptr) +WEIGHT calc_weapon_weight_limit(PlayerType *player_ptr) { WEIGHT weight = adj_str_hold[player_ptr->stat_index[A_STR]]; @@ -2947,14 +2947,14 @@ WEIGHT calc_weapon_weight_limit(player_type *player_ptr) return weight; } -WEIGHT calc_bow_weight_limit(player_type *player_ptr) +WEIGHT calc_bow_weight_limit(PlayerType *player_ptr) { WEIGHT weight = adj_str_hold[player_ptr->stat_index[A_STR]]; return weight; } -static player_hand main_attack_hand(player_type *player_ptr) +static player_hand main_attack_hand(PlayerType *player_ptr) { switch (player_melee_type(player_ptr)) { case MELEE_TYPE_BAREHAND_TWO: diff --git a/src/player/player-status.h b/src/player/player-status.h index d26d32e60..cac092010 100644 --- a/src/player/player-status.h +++ b/src/player/player-status.h @@ -8,33 +8,33 @@ #include "system/angband.h" struct object_type; -struct player_type; +class PlayerType; -WEIGHT calc_weapon_weight_limit(player_type *player_ptr); -WEIGHT calc_bow_weight_limit(player_type *player_ptr); -WEIGHT calc_inventory_weight(player_type *player_ptr); +WEIGHT calc_weapon_weight_limit(PlayerType *player_ptr); +WEIGHT calc_bow_weight_limit(PlayerType *player_ptr); +WEIGHT calc_inventory_weight(PlayerType *player_ptr); -int16_t calc_num_fire(player_type *player_ptr, object_type *o_ptr); -WEIGHT calc_weight_limit(player_type *player_ptr); -void update_creature(player_type *player_ptr); -bool player_has_no_spellbooks(player_type *player_ptr); +int16_t calc_num_fire(PlayerType *player_ptr, object_type *o_ptr); +WEIGHT calc_weight_limit(PlayerType *player_ptr); +void update_creature(PlayerType *player_ptr); +bool player_has_no_spellbooks(PlayerType *player_ptr); -bool player_place(player_type *player_ptr, POSITION y, POSITION x); +bool player_place(PlayerType *player_ptr, POSITION y, POSITION x); -void check_experience(player_type *player_ptr); -void wreck_the_pattern(player_type *player_ptr); +void check_experience(PlayerType *player_ptr); +void wreck_the_pattern(PlayerType *player_ptr); void cnv_stat(int val, char *out_val); int16_t modify_stat_value(int value, int amount); -long calc_score(player_type *player_ptr); - -bool is_blessed(player_type *player_ptr); -bool is_time_limit_esp(player_type *player_ptr); -bool is_time_limit_stealth(player_type *player_ptr); -bool is_fast(player_type *player_ptr); -bool is_invuln(player_type *player_ptr); -bool is_hero(player_type *player_ptr); -bool is_shero(player_type *player_ptr); -bool is_echizen(player_type *player_ptr); -bool is_chargeman(player_type *player_ptr); - -void stop_mouth(player_type *player_ptr); +long calc_score(PlayerType *player_ptr); + +bool is_blessed(PlayerType *player_ptr); +bool is_time_limit_esp(PlayerType *player_ptr); +bool is_time_limit_stealth(PlayerType *player_ptr); +bool is_fast(PlayerType *player_ptr); +bool is_invuln(PlayerType *player_ptr); +bool is_hero(PlayerType *player_ptr); +bool is_shero(PlayerType *player_ptr); +bool is_echizen(PlayerType *player_ptr); +bool is_chargeman(PlayerType *player_ptr); + +void stop_mouth(PlayerType *player_ptr); diff --git a/src/player/player-view.cpp b/src/player/player-view.cpp index 4620f3563..31b44ae33 100644 --- a/src/player/player-view.cpp +++ b/src/player/player-view.cpp @@ -27,7 +27,7 @@ * * This function now returns "TRUE" if vision is "blocked" by grid (y,x). */ -static bool update_view_aux(player_type *player_ptr, POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2) +static bool update_view_aux(PlayerType *player_ptr, POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g1_c_ptr; @@ -96,7 +96,7 @@ static bool update_view_aux(player_type *player_ptr, POSITION y, POSITION x, POS * 4c1: Each side aborts as soon as possible * 4c2: Each side tells the next strip how far it has to check */ -void update_view(player_type *player_ptr) +void update_view(PlayerType *player_ptr) { // 前回プレイヤーから見えていた座標たちを格納する配列。 std::vector points; diff --git a/src/player/player-view.h b/src/player/player-view.h index fed518ff1..3491ed77f 100644 --- a/src/player/player-view.h +++ b/src/player/player-view.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void update_view(player_type *player_ptr); +class PlayerType; +void update_view(PlayerType *player_ptr); diff --git a/src/player/process-death.cpp b/src/player/process-death.cpp index 3b8a43a17..9c103e0ee 100644 --- a/src/player/process-death.cpp +++ b/src/player/process-death.cpp @@ -52,7 +52,7 @@ static void center_string(char *buf, concptr str) * @param player_ptr プレイヤーへの参照ポインタ * @param buf 墓テンプレ */ -static void show_basic_params(player_type *player_ptr, char *buf) +static void show_basic_params(PlayerType *player_ptr, char *buf) { char tomb_message[160]; (void)sprintf(tomb_message, _("レベル: %d", "Level: %d"), (int)player_ptr->lev); @@ -76,7 +76,7 @@ static void show_basic_params(player_type *player_ptr, char *buf) * @param tomb_message 墓碑に刻む言葉 * @return 追加の行数 */ -static int show_killing_monster(player_type *player_ptr, char *buf, char *tomb_message, size_t tomb_message_size) +static int show_killing_monster(PlayerType *player_ptr, char *buf, char *tomb_message, size_t tomb_message_size) { shape_buffer(player_ptr->died_from, GRAVE_LINE_WIDTH + 1, tomb_message, tomb_message_size); char *t; @@ -121,7 +121,7 @@ static int show_killing_monster(player_type *player_ptr, char *buf, char *tomb_m * @param tomb_message 表示する文字列 * @param extra_line 追加の行数 */ -static void show_dead_place(player_type *player_ptr, char *buf, char *tomb_message, int extra_line) +static void show_dead_place(PlayerType *player_ptr, char *buf, char *tomb_message, int extra_line) { if (streq(player_ptr->died_from, "ripe") || streq(player_ptr->died_from, "Seppuku")) return; @@ -150,7 +150,7 @@ static void show_dead_place(player_type *player_ptr, char *buf, char *tomb_messa * @param player_ptr プレイヤーへの参照ポインタ * @param buf 墓テンプレ */ -static void show_tomb_detail(player_type *player_ptr, char *buf) +static void show_tomb_detail(PlayerType *player_ptr, char *buf) { char tomb_message[160]; int extra_line = 0; @@ -177,7 +177,7 @@ static void show_tomb_detail(player_type *player_ptr, char *buf) * @param buf template of the tomb * @return nothing */ -static void show_tomb_detail(player_type *player_ptr, char *buf) +static void show_tomb_detail(PlayerType *player_ptr, char *buf) { char tomb_message[160]; (void)sprintf(tomb_message, "Killed on Level %d", player_ptr->current_floor_ptr->dun_level); @@ -210,7 +210,7 @@ static void show_tomb_detail(player_type *player_ptr, char *buf) * Display a "tomb-stone" * @param player_ptr プレイヤーへの参照ポインタ */ -void print_tomb(player_type *player_ptr) +void print_tomb(PlayerType *player_ptr) { term_clear(); char buf[1024]; @@ -248,7 +248,7 @@ void print_tomb(player_type *player_ptr) * @brief 死亡/引退/切腹時にインベントリ内のアイテムを*鑑定*する * @param player_ptr プレイヤーへの参照ポインタ */ -static void inventory_aware(player_type *player_ptr) +static void inventory_aware(PlayerType *player_ptr) { object_type *o_ptr; for (int i = 0; i < INVEN_TOTAL; i++) { @@ -265,7 +265,7 @@ static void inventory_aware(player_type *player_ptr) * @brief 死亡/引退/切腹時に我が家のアイテムを*鑑定*する * @param player_ptr プレイヤーへの参照ポインタ */ -static void home_aware(player_type *player_ptr) +static void home_aware(PlayerType *player_ptr) { object_type *o_ptr; store_type *store_ptr; @@ -287,7 +287,7 @@ static void home_aware(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return Escキーでゲームを終了する時TRUE */ -static bool show_dead_player_items(player_type *player_ptr) +static bool show_dead_player_items(PlayerType *player_ptr) { if (player_ptr->equip_cnt) { term_clear(); @@ -313,7 +313,7 @@ static bool show_dead_player_items(player_type *player_ptr) * @brief 我が家にあったアイテムを表示する * @param player_ptr プレイヤーへの参照ポインタ */ -static void show_dead_home_items(player_type *player_ptr) +static void show_dead_home_items(PlayerType *player_ptr) { for (int l = 1; l < max_towns; l++) { store_type *store_ptr; @@ -346,7 +346,7 @@ static void show_dead_home_items(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param file_character ステータスダンプへのコールバック */ -static void export_player_info(player_type *player_ptr, display_player_pf display_player) +static void export_player_info(PlayerType *player_ptr, display_player_pf display_player) { prt(_("キャラクターの記録をファイルに書き出すことができます。", "You may now dump a character record to one or more files."), 21, 0); prt(_("リターンキーでキャラクターを見ます。ESCで中断します。", "Then, hit RETURN to see the character, or ESC to abort."), 22, 0); @@ -368,7 +368,7 @@ static void export_player_info(player_type *player_ptr, display_player_pf displa /*! * @brief 自動的にプレイヤーステータスをファイルダンプ出力する */ -static void file_character_auto(player_type *player_ptr, display_player_pf display_player) +static void file_character_auto(PlayerType *player_ptr, display_player_pf display_player) { time_t now_t = time(nullptr); struct tm *now_tm = localtime(&now_t); @@ -389,7 +389,7 @@ static void file_character_auto(player_type *player_ptr, display_player_pf displ * @param player_ptr プレイヤーへの参照ポインタ * @param display_player ステータス表示へのコールバック */ -void show_death_info(player_type *player_ptr, display_player_pf display_player) +void show_death_info(PlayerType *player_ptr, display_player_pf display_player) { inventory_aware(player_ptr); home_aware(player_ptr); diff --git a/src/player/process-death.h b/src/player/process-death.h index 1d160dea9..8f96fbfdd 100644 --- a/src/player/process-death.h +++ b/src/player/process-death.h @@ -2,6 +2,6 @@ #include "io/files-util.h" -struct player_type; -void print_tomb(player_type *player_ptr); -void show_death_info(player_type *player_ptr, display_player_pf display_player); +class PlayerType; +void print_tomb(PlayerType *player_ptr); +void show_death_info(PlayerType *player_ptr, display_player_pf display_player); diff --git a/src/player/process-name.cpp b/src/player/process-name.cpp index 95789d0a2..385fd94e7 100644 --- a/src/player/process-name.cpp +++ b/src/player/process-name.cpp @@ -20,7 +20,7 @@ * Extract a clean "base name". * Build the savefile name if needed. */ -void process_player_name(player_type *player_ptr, bool is_new_savefile) +void process_player_name(PlayerType *player_ptr, bool is_new_savefile) { char old_player_base[32] = ""; if (w_ptr->character_generated) @@ -130,7 +130,7 @@ void process_player_name(player_type *player_ptr, bool is_new_savefile) * What a horrible name for a global function. * */ -void get_name(player_type *player_ptr) +void get_name(PlayerType *player_ptr) { char tmp[64]; strcpy(tmp, player_ptr->name); diff --git a/src/player/process-name.h b/src/player/process-name.h index cc7d84933..6cbbf0f07 100644 --- a/src/player/process-name.h +++ b/src/player/process-name.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void process_player_name(player_type *player_ptr, bool is_new_savefile = false); -void get_name(player_type *player_ptr); +class PlayerType; +void process_player_name(PlayerType *player_ptr, bool is_new_savefile = false); +void get_name(PlayerType *player_ptr); diff --git a/src/player/race-resistances.cpp b/src/player/race-resistances.cpp index 02ed386cb..16fdea2c7 100644 --- a/src/player/race-resistances.cpp +++ b/src/player/race-resistances.cpp @@ -20,7 +20,7 @@ * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -void player_immunity(player_type *player_ptr, TrFlags &flags) +void player_immunity(PlayerType *player_ptr, TrFlags &flags) { flags.clear(); @@ -48,7 +48,7 @@ void player_immunity(player_type *player_ptr, TrFlags &flags) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -void tim_player_immunity(player_type *player_ptr, TrFlags &flags) +void tim_player_immunity(PlayerType *player_ptr, TrFlags &flags) { flags.clear(); @@ -71,7 +71,7 @@ void tim_player_immunity(player_type *player_ptr, TrFlags &flags) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -void known_obj_immunity(player_type *player_ptr, TrFlags &flags) +void known_obj_immunity(PlayerType *player_ptr, TrFlags &flags) { flags.clear(); @@ -100,7 +100,7 @@ void known_obj_immunity(player_type *player_ptr, TrFlags &flags) * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -void player_vulnerability_flags(player_type *player_ptr, TrFlags &flags) +void player_vulnerability_flags(PlayerType *player_ptr, TrFlags &flags) { flags.clear(); diff --git a/src/player/race-resistances.h b/src/player/race-resistances.h index a30b898cb..a922310e9 100644 --- a/src/player/race-resistances.h +++ b/src/player/race-resistances.h @@ -4,8 +4,8 @@ #include "object-enchant/tr-flags.h" -struct player_type; -void player_immunity(player_type *player_ptr, TrFlags &flags); -void tim_player_immunity(player_type *player_ptr, TrFlags &flags); -void known_obj_immunity(player_type *player_ptr, TrFlags &flags); -void player_vulnerability_flags(player_type *player_ptr, TrFlags &flags); +class PlayerType; +void player_immunity(PlayerType *player_ptr, TrFlags &flags); +void tim_player_immunity(PlayerType *player_ptr, TrFlags &flags); +void known_obj_immunity(PlayerType *player_ptr, TrFlags &flags); +void player_vulnerability_flags(PlayerType *player_ptr, TrFlags &flags); diff --git a/src/player/temporary-resistances.cpp b/src/player/temporary-resistances.cpp index dcffabda8..d5a4ebda8 100644 --- a/src/player/temporary-resistances.cpp +++ b/src/player/temporary-resistances.cpp @@ -21,7 +21,7 @@ * @todo * xtra1.c周りと多重実装になっているのを何とかする */ -void tim_player_flags(player_type *player_ptr, TrFlags &flags) +void tim_player_flags(PlayerType *player_ptr, TrFlags &flags) { BIT_FLAGS tmp_effect_flag = FLAG_CAUSE_MAGIC_TIME_EFFECT; set_bits(tmp_effect_flag, FLAG_CAUSE_STANCE); diff --git a/src/player/temporary-resistances.h b/src/player/temporary-resistances.h index 154808256..93e8b290f 100644 --- a/src/player/temporary-resistances.h +++ b/src/player/temporary-resistances.h @@ -4,5 +4,5 @@ #include "object-enchant/tr-flags.h" -struct player_type; -void tim_player_flags(player_type *player_ptr, TrFlags &flags); +class PlayerType; +void tim_player_flags(PlayerType *player_ptr, TrFlags &flags); diff --git a/src/racial/class-racial-switcher.cpp b/src/racial/class-racial-switcher.cpp index 8262886e0..aa71fcc87 100644 --- a/src/racial/class-racial-switcher.cpp +++ b/src/racial/class-racial-switcher.cpp @@ -6,7 +6,7 @@ #include "realm/realm-types.h" #include "system/player-type-definition.h" -void switch_class_racial(player_type *player_ptr, rc_type *rc_ptr) +void switch_class_racial(PlayerType *player_ptr, rc_type *rc_ptr) { rpi_type rpi; switch (player_ptr->pclass) { diff --git a/src/racial/class-racial-switcher.h b/src/racial/class-racial-switcher.h index ed90c671d..c53842c3f 100644 --- a/src/racial/class-racial-switcher.h +++ b/src/racial/class-racial-switcher.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; +class PlayerType; struct rc_type; -void switch_class_racial(player_type *player_ptr, rc_type *rc_ptr); +void switch_class_racial(PlayerType *player_ptr, rc_type *rc_ptr); diff --git a/src/racial/mutation-racial-selector.cpp b/src/racial/mutation-racial-selector.cpp index a8a20c2d1..90f1b4471 100644 --- a/src/racial/mutation-racial-selector.cpp +++ b/src/racial/mutation-racial-selector.cpp @@ -6,7 +6,7 @@ #include "system/player-type-definition.h" #include "util/enum-converter.h" -void select_mutation_racial(player_type *player_ptr, rc_type *rc_ptr) +void select_mutation_racial(PlayerType *player_ptr, rc_type *rc_ptr) { rpi_type rpi; if (player_ptr->muta.has(PlayerMutationType::SPIT_ACID)) { diff --git a/src/racial/mutation-racial-selector.h b/src/racial/mutation-racial-selector.h index 711dbdf56..85dbebfa5 100644 --- a/src/racial/mutation-racial-selector.h +++ b/src/racial/mutation-racial-selector.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; +class PlayerType; struct rc_type; -void select_mutation_racial(player_type *player_ptr, rc_type *rc_ptr); +void select_mutation_racial(PlayerType *player_ptr, rc_type *rc_ptr); diff --git a/src/racial/race-racial-command-setter.cpp b/src/racial/race-racial-command-setter.cpp index 45bac3576..8b9761c0e 100644 --- a/src/racial/race-racial-command-setter.cpp +++ b/src/racial/race-racial-command-setter.cpp @@ -4,7 +4,7 @@ #include "racial/racial-util.h" #include "system/player-type-definition.h" -void set_mimic_racial_command(player_type *player_ptr, rc_type *rc_ptr) +void set_mimic_racial_command(PlayerType *player_ptr, rc_type *rc_ptr) { rpi_type rpi; switch (player_ptr->mimic_form) { @@ -33,7 +33,7 @@ void set_mimic_racial_command(player_type *player_ptr, rc_type *rc_ptr) } } -void set_race_racial_command(player_type *player_ptr, rc_type *rc_ptr) +void set_race_racial_command(PlayerType *player_ptr, rc_type *rc_ptr) { rpi_type rpi; switch (player_ptr->prace) { diff --git a/src/racial/race-racial-command-setter.h b/src/racial/race-racial-command-setter.h index 84804d3ab..5262ea0ba 100644 --- a/src/racial/race-racial-command-setter.h +++ b/src/racial/race-racial-command-setter.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; +class PlayerType; struct rc_type; -void set_mimic_racial_command(player_type *player_ptr, rc_type *rc_ptr); -void set_race_racial_command(player_type *player_ptr, rc_type *rc_ptr); +void set_mimic_racial_command(PlayerType *player_ptr, rc_type *rc_ptr); +void set_race_racial_command(PlayerType *player_ptr, rc_type *rc_ptr); diff --git a/src/racial/racial-android.cpp b/src/racial/racial-android.cpp index b083bce43..10c9c4d3f 100644 --- a/src/racial/racial-android.cpp +++ b/src/racial/racial-android.cpp @@ -19,7 +19,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool android_inside_weapon(player_type *player_ptr) +bool android_inside_weapon(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -54,7 +54,7 @@ bool android_inside_weapon(player_type *player_ptr) return true; } -void calc_android_exp(player_type *player_ptr) +void calc_android_exp(PlayerType *player_ptr) { uint32_t total_exp = 0; if (player_ptr->is_dead || (player_ptr->prace != PlayerRaceType::ANDROID)) diff --git a/src/racial/racial-android.h b/src/racial/racial-android.h index 1b68b0d82..5db1e237f 100644 --- a/src/racial/racial-android.h +++ b/src/racial/racial-android.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -bool android_inside_weapon(player_type *player_ptr); -void calc_android_exp(player_type *player_ptr); +class PlayerType; +bool android_inside_weapon(PlayerType *player_ptr); +void calc_android_exp(PlayerType *player_ptr); diff --git a/src/racial/racial-balrog.cpp b/src/racial/racial-balrog.cpp index 5080be1e5..704fb1d5b 100644 --- a/src/racial/racial-balrog.cpp +++ b/src/racial/racial-balrog.cpp @@ -6,7 +6,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool demonic_breath(player_type *player_ptr) +bool demonic_breath(PlayerType *player_ptr) { DIRECTION dir; AttributeType type = (one_in_(2) ? AttributeType::NETHER : AttributeType::FIRE); diff --git a/src/racial/racial-balrog.h b/src/racial/racial-balrog.h index 3d45a569d..7dd926b2f 100644 --- a/src/racial/racial-balrog.h +++ b/src/racial/racial-balrog.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool demonic_breath(player_type *player_ptr); +class PlayerType; +bool demonic_breath(PlayerType *player_ptr); diff --git a/src/racial/racial-draconian.cpp b/src/racial/racial-draconian.cpp index d1efcc26e..eb77c61ee 100644 --- a/src/racial/racial-draconian.cpp +++ b/src/racial/racial-draconian.cpp @@ -7,7 +7,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -static void decide_breath_kind(player_type *player_ptr, AttributeType *breath_type, concptr *breath_type_description) +static void decide_breath_kind(PlayerType *player_ptr, AttributeType *breath_type, concptr *breath_type_description) { if (randint1(100) >= player_ptr->lev) return; @@ -119,7 +119,7 @@ static void decide_breath_kind(player_type *player_ptr, AttributeType *breath_ty } } -bool draconian_breath(player_type *player_ptr) +bool draconian_breath(PlayerType *player_ptr) { AttributeType breath_type = (one_in_(3) ? AttributeType::COLD : AttributeType::FIRE); concptr breath_type_description = ((breath_type == AttributeType::COLD) ? _("冷気", "cold") : _("炎", "fire")); diff --git a/src/racial/racial-draconian.h b/src/racial/racial-draconian.h index c91a8dbfd..8fa35ea3e 100644 --- a/src/racial/racial-draconian.h +++ b/src/racial/racial-draconian.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool draconian_breath(player_type *player_ptr); +class PlayerType; +bool draconian_breath(PlayerType *player_ptr); diff --git a/src/racial/racial-kutar.cpp b/src/racial/racial-kutar.cpp index 306a4a8b8..c480e3a1d 100644 --- a/src/racial/racial-kutar.cpp +++ b/src/racial/racial-kutar.cpp @@ -13,7 +13,7 @@ * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_leveling(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_leveling(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; diff --git a/src/racial/racial-kutar.h b/src/racial/racial-kutar.h index b56156aee..18651266f 100644 --- a/src/racial/racial-kutar.h +++ b/src/racial/racial-kutar.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool set_leveling(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +bool set_leveling(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); diff --git a/src/racial/racial-switcher.cpp b/src/racial/racial-switcher.cpp index 1bf00fd4c..87bdd7eef 100644 --- a/src/racial/racial-switcher.cpp +++ b/src/racial/racial-switcher.cpp @@ -84,7 +84,7 @@ #include "util/int-char-converter.h" #include "view/display-messages.h" -bool switch_class_racial_execution(player_type *player_ptr, const int32_t command) +bool switch_class_racial_execution(PlayerType *player_ptr, const int32_t command) { DIRECTION dir = 0; switch (player_ptr->pclass) { @@ -271,7 +271,7 @@ bool switch_class_racial_execution(player_type *player_ptr, const int32_t comman } } -bool switch_mimic_racial_execution(player_type *player_ptr) +bool switch_mimic_racial_execution(PlayerType *player_ptr) { switch (player_ptr->mimic_form) { case MIMIC_DEMON: @@ -286,7 +286,7 @@ bool switch_mimic_racial_execution(player_type *player_ptr) } } -bool switch_race_racial_execution(player_type *player_ptr, const int32_t command) +bool switch_race_racial_execution(PlayerType *player_ptr, const int32_t command) { DIRECTION dir = 0; switch (player_ptr->prace) { diff --git a/src/racial/racial-switcher.h b/src/racial/racial-switcher.h index a9c7fcbfa..2a1a65f2a 100644 --- a/src/racial/racial-switcher.h +++ b/src/racial/racial-switcher.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -bool switch_class_racial_execution(player_type *player_ptr, const int32_t command); -bool switch_mimic_racial_execution(player_type *player_ptr); -bool switch_race_racial_execution(player_type *player_ptr, const int32_t command); +class PlayerType; +bool switch_class_racial_execution(PlayerType *player_ptr, const int32_t command); +bool switch_mimic_racial_execution(PlayerType *player_ptr); +bool switch_race_racial_execution(PlayerType *player_ptr, const int32_t command); diff --git a/src/racial/racial-util.cpp b/src/racial/racial-util.cpp index 3216b3c44..34bb0f75d 100644 --- a/src/racial/racial-util.cpp +++ b/src/racial/racial-util.cpp @@ -3,7 +3,7 @@ #include "system/player-type-definition.h" #include "util/enum-converter.h" -rc_type::rc_type(player_type *player_ptr) +rc_type::rc_type(PlayerType *player_ptr) { this->ask = true; this->lvl = player_ptr->lev; diff --git a/src/racial/racial-util.h b/src/racial/racial-util.h index 3e9d9d71f..00668db9c 100644 --- a/src/racial/racial-util.h +++ b/src/racial/racial-util.h @@ -41,7 +41,7 @@ struct rpi_type { /*! * レイシャル/クラスパワー管理構造体 */ -struct player_type; +class PlayerType; struct rc_type { std::vector power_desc{}; //!< パワー定義配列 COMMAND_CODE command_code{}; //!< 使用しようとしているパワー番号 @@ -62,7 +62,7 @@ struct rc_type { * @param player_ptr プレイヤー情報への参照ポインタ * @return 管理構造体 */ - rc_type(player_type *player_ptr); + rc_type(PlayerType *player_ptr); /*! * @brief レイシャル/クラスパワー定義を追加 diff --git a/src/racial/racial-vampire.cpp b/src/racial/racial-vampire.cpp index 5a01cb760..53c3df0aa 100644 --- a/src/racial/racial-vampire.cpp +++ b/src/racial/racial-vampire.cpp @@ -12,7 +12,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool vampirism(player_type *player_ptr) +bool vampirism(PlayerType *player_ptr) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE)) { msg_print(_("なぜか攻撃することができない。", "Something prevents you from attacking.")); diff --git a/src/racial/racial-vampire.h b/src/racial/racial-vampire.h index ad4a1c1fd..508363550 100644 --- a/src/racial/racial-vampire.h +++ b/src/racial/racial-vampire.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool vampirism(player_type *player_ptr); +class PlayerType; +bool vampirism(PlayerType *player_ptr); diff --git a/src/realm/realm-arcane.cpp b/src/realm/realm-arcane.cpp index 2c35a01f0..b342f3872 100644 --- a/src/realm/realm-arcane.cpp +++ b/src/realm/realm-arcane.cpp @@ -32,7 +32,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_arcane_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_arcane_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-arcane.h b/src/realm/realm-arcane.h index eeaa852a4..249048656 100644 --- a/src/realm/realm-arcane.h +++ b/src/realm/realm-arcane.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_arcane_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_arcane_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-chaos.cpp b/src/realm/realm-chaos.cpp index aba6809a4..24db66c2c 100644 --- a/src/realm/realm-chaos.cpp +++ b/src/realm/realm-chaos.cpp @@ -32,7 +32,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_chaos_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-chaos.h b/src/realm/realm-chaos.h index 495b954b6..797767633 100644 --- a/src/realm/realm-chaos.h +++ b/src/realm/realm-chaos.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_chaos_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-craft.cpp b/src/realm/realm-craft.cpp index cbf00f8e1..d73410c63 100644 --- a/src/realm/realm-craft.cpp +++ b/src/realm/realm-craft.cpp @@ -26,7 +26,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_craft_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_craft_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-craft.h b/src/realm/realm-craft.h index 3ffc8051e..e2561d9c3 100644 --- a/src/realm/realm-craft.h +++ b/src/realm/realm-craft.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_craft_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_craft_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-crusade.cpp b/src/realm/realm-crusade.cpp index 3d6524afa..0f3124ea3 100644 --- a/src/realm/realm-crusade.cpp +++ b/src/realm/realm-crusade.cpp @@ -38,7 +38,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_crusade_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-crusade.h b/src/realm/realm-crusade.h index 4b92e00b2..347542768 100644 --- a/src/realm/realm-crusade.h +++ b/src/realm/realm-crusade.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_crusade_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-death.cpp b/src/realm/realm-death.cpp index 964f0e666..33f2bc338 100644 --- a/src/realm/realm-death.cpp +++ b/src/realm/realm-death.cpp @@ -35,7 +35,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_death_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-death.h b/src/realm/realm-death.h index 0de51038d..dbdfbd08a 100644 --- a/src/realm/realm-death.h +++ b/src/realm/realm-death.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_death_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-demon.cpp b/src/realm/realm-demon.cpp index 96cf22625..d1c681e57 100644 --- a/src/realm/realm-demon.cpp +++ b/src/realm/realm-demon.cpp @@ -35,7 +35,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_daemon_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-demon.h b/src/realm/realm-demon.h index 30cfa27b3..0c502ab3e 100644 --- a/src/realm/realm-demon.h +++ b/src/realm/realm-demon.h @@ -3,6 +3,6 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_daemon_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-hex.cpp b/src/realm/realm-hex.cpp index baaac62cf..37770a744 100644 --- a/src/realm/realm-hex.cpp +++ b/src/realm/realm-hex.cpp @@ -82,7 +82,7 @@ static bool item_tester_hook_weapon_except_bow(const object_type *o_ptr) * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST / SPELL_CONT / SpellProcessType::STOP) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST / SPELL_CONT / SpellProcessType::STOP 時はnullptr文字列を返す。 */ -concptr do_hex_spell(player_type *player_ptr, spell_hex_type spell, SpellProcessType mode) +concptr do_hex_spell(PlayerType *player_ptr, spell_hex_type spell, SpellProcessType mode) { auto name = mode == SpellProcessType::NAME; auto description = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-hex.h b/src/realm/realm-hex.h index 20f5e8aca..9cb508c95 100644 --- a/src/realm/realm-hex.h +++ b/src/realm/realm-hex.h @@ -4,5 +4,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_hex_spell(player_type *player_ptr, spell_hex_type spell, SpellProcessType mode); +class PlayerType; +concptr do_hex_spell(PlayerType *player_ptr, spell_hex_type spell, SpellProcessType mode); diff --git a/src/realm/realm-hissatsu.cpp b/src/realm/realm-hissatsu.cpp index 3039b7bf1..dbcc2629a 100644 --- a/src/realm/realm-hissatsu.cpp +++ b/src/realm/realm-hissatsu.cpp @@ -65,7 +65,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_hissatsu_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-hissatsu.h b/src/realm/realm-hissatsu.h index 6e5e0a9a8..e72867cff 100644 --- a/src/realm/realm-hissatsu.h +++ b/src/realm/realm-hissatsu.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_hissatsu_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-life.cpp b/src/realm/realm-life.cpp index a56c3f45a..b05c21e82 100644 --- a/src/realm/realm-life.cpp +++ b/src/realm/realm-life.cpp @@ -30,7 +30,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_life_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_life_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-life.h b/src/realm/realm-life.h index 79963f211..5da1b94ad 100644 --- a/src/realm/realm-life.h +++ b/src/realm/realm-life.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_life_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_life_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-nature.cpp b/src/realm/realm-nature.cpp index cbf5ded22..306301c02 100644 --- a/src/realm/realm-nature.cpp +++ b/src/realm/realm-nature.cpp @@ -48,7 +48,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_nature_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-nature.h b/src/realm/realm-nature.h index 4b5d1267a..88d4b584d 100644 --- a/src/realm/realm-nature.h +++ b/src/realm/realm-nature.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_nature_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-song.cpp b/src/realm/realm-song.cpp index 5aff33486..4899087b9 100644 --- a/src/realm/realm-song.cpp +++ b/src/realm/realm-song.cpp @@ -33,7 +33,7 @@ * @param spell 領域魔法としてのID * @param song 魔法効果のID */ -static void start_singing(player_type *player_ptr, SPELL_IDX spell, int32_t song) +static void start_singing(PlayerType *player_ptr, SPELL_IDX spell, int32_t song) { /* Remember the song index */ set_singing_song_effect(player_ptr, song); @@ -55,7 +55,7 @@ static void start_singing(player_type *player_ptr, SPELL_IDX spell, int32_t song * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST / SpellProcessType::FAIL / SPELL_CONT / SpellProcessType::STOP) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST / SpellProcessType::FAIL / SPELL_CONT / SpellProcessType::STOP 時はnullptr文字列を返す。 */ -concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_music_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-song.h b/src/realm/realm-song.h index ea220f600..1e5fa485e 100644 --- a/src/realm/realm-song.h +++ b/src/realm/realm-song.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_music_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-sorcery.cpp b/src/realm/realm-sorcery.cpp index 46f533006..a440450bc 100644 --- a/src/realm/realm-sorcery.cpp +++ b/src/realm/realm-sorcery.cpp @@ -32,7 +32,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_sorcery_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_sorcery_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-sorcery.h b/src/realm/realm-sorcery.h index d12d28128..578975bd5 100644 --- a/src/realm/realm-sorcery.h +++ b/src/realm/realm-sorcery.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_sorcery_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_sorcery_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/realm/realm-trump.cpp b/src/realm/realm-trump.cpp index 6044350a9..1012861a8 100644 --- a/src/realm/realm-trump.cpp +++ b/src/realm/realm-trump.cpp @@ -35,7 +35,7 @@ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST) * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。 */ -concptr do_trump_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode) +concptr do_trump_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode) { bool name = mode == SpellProcessType::NAME; bool desc = mode == SpellProcessType::DESCRIPTION; diff --git a/src/realm/realm-trump.h b/src/realm/realm-trump.h index 953ac57f0..df0b08b0d 100644 --- a/src/realm/realm-trump.h +++ b/src/realm/realm-trump.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr do_trump_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr do_trump_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/room/cave-filler.cpp b/src/room/cave-filler.cpp index a0cd2132a..4a3cbad1e 100644 --- a/src/room/cave-filler.cpp +++ b/src/room/cave-filler.cpp @@ -177,7 +177,7 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi } } -static bool hack_isnt_wall(player_type *player_ptr, POSITION y, POSITION x, int c1, int c2, int c3, FEAT_IDX feat1, FEAT_IDX feat2, FEAT_IDX feat3, +static bool hack_isnt_wall(PlayerType *player_ptr, POSITION y, POSITION x, int c1, int c2, int c3, FEAT_IDX feat1, FEAT_IDX feat2, FEAT_IDX feat3, BIT_FLAGS info1, BIT_FLAGS info2, BIT_FLAGS info3) { floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -228,7 +228,7 @@ static bool hack_isnt_wall(player_type *player_ptr, POSITION y, POSITION x, int * Quick and nasty fill routine used to find the connected region * of floor in the middle of the grids */ -static void cave_fill(player_type *player_ptr, const POSITION y, const POSITION x) +static void cave_fill(PlayerType *player_ptr, const POSITION y, const POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -264,7 +264,7 @@ static void cave_fill(player_type *player_ptr, const POSITION y, const POSITION } } -bool generate_fracave(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room) +bool generate_fracave(PlayerType *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room) { POSITION xhsize = xsize / 2; POSITION yhsize = ysize / 2; @@ -387,7 +387,7 @@ bool generate_fracave(player_type *player_ptr, POSITION y0, POSITION x0, POSITIO return true; } -bool generate_lake(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type) +bool generate_lake(PlayerType *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type) { FEAT_IDX feat1, feat2, feat3; POSITION xhsize = xsize / 2; diff --git a/src/room/cave-filler.h b/src/room/cave-filler.h index 517b579c6..6f45bc3b4 100644 --- a/src/room/cave-filler.h +++ b/src/room/cave-filler.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct floor_type; -struct player_type; +class PlayerType; void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff); -bool generate_fracave(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room); -bool generate_lake(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type); +bool generate_fracave(PlayerType *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room); +bool generate_lake(PlayerType *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type); diff --git a/src/room/room-generator.cpp b/src/room/room-generator.cpp index 4da05d4c4..f0dd2567d 100644 --- a/src/room/room-generator.cpp +++ b/src/room/room-generator.cpp @@ -27,7 +27,7 @@ * @note that we restrict the number of "crowded" rooms to reduce the chance of overflowing the monster list during level creation. * @return 部屋の生成に成功した場合 TRUE を返す。 */ -static bool room_build(player_type *player_ptr, dun_data_type *dd_ptr, EFFECT_ID typ) +static bool room_build(PlayerType *player_ptr, dun_data_type *dd_ptr, EFFECT_ID typ) { switch (typ) { case ROOM_T_NORMAL: @@ -86,7 +86,7 @@ static void move_prob_list(room_type dst, room_type src, int *prob_list) * @param player_ptr プレイヤーへの参照ポインタ * @return 部屋生成に成功した場合 TRUE を返す。 */ -bool generate_rooms(player_type *player_ptr, dun_data_type *dd_ptr) +bool generate_rooms(PlayerType *player_ptr, dun_data_type *dd_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; int crowded = 0; diff --git a/src/room/room-generator.h b/src/room/room-generator.h index adc055bbe..f2eb21ac9 100644 --- a/src/room/room-generator.h +++ b/src/room/room-generator.h @@ -1,5 +1,5 @@ #pragma once struct dun_data_type; -struct player_type; -bool generate_rooms(player_type *player_ptr, dun_data_type *dun_data); +class PlayerType; +bool generate_rooms(PlayerType *player_ptr, dun_data_type *dun_data); diff --git a/src/room/rooms-builder.cpp b/src/room/rooms-builder.cpp index 3b6dce4a4..41f674df6 100644 --- a/src/room/rooms-builder.cpp +++ b/src/room/rooms-builder.cpp @@ -62,7 +62,7 @@ * Note - this should be used only on allocated regions * within another room. */ -void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0) +void build_small_room(PlayerType *player_ptr, POSITION x0, POSITION y0) { for (POSITION y = y0 - 1; y <= y0 + 1; y++) { place_bold(player_ptr, y, x0 - 1, GB_INNER); @@ -96,7 +96,7 @@ void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0) /* * Builds a cave system in the center of the dungeon. */ -void build_cavern(player_type *player_ptr) +void build_cavern(PlayerType *player_ptr) { bool light = false; bool done = false; @@ -123,7 +123,7 @@ void build_cavern(player_type *player_ptr) /* * makes a lake/collapsed floor in the center of the dungeon */ -void build_lake(player_type *player_ptr, int type) +void build_lake(PlayerType *player_ptr, int type) { if ((type < LAKE_T_LAVA) || (type > LAKE_T_FIRE_VAULT)) { msg_format("Invalid lake type (%d)", type); @@ -155,7 +155,7 @@ void build_lake(player_type *player_ptr, int type) * The area inside the walls is not touched: * only granite is removed- normal walls stay */ -void build_room(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2) +void build_room(PlayerType *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2) { int temp; if ((x1 == x2) || (y1 == y2)) @@ -211,7 +211,7 @@ void build_room(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, * The power variable is a measure of how well defended a region is. * This alters the possible choices. */ -void build_recursive_room(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power) +void build_recursive_room(PlayerType *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power) { POSITION xsize = x2 - x1; POSITION ysize = y2 - y1; @@ -349,7 +349,7 @@ void build_recursive_room(player_type *player_ptr, POSITION x1, POSITION y1, POS * Note: no range checking is done so must be inside dungeon * This routine also stomps on doors */ -void add_outer_wall(player_type *player_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2) +void add_outer_wall(PlayerType *player_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!in_bounds(floor_ptr, y, x)) diff --git a/src/room/rooms-builder.h b/src/room/rooms-builder.h index 1197c45ce..ed6c0174e 100644 --- a/src/room/rooms-builder.h +++ b/src/room/rooms-builder.h @@ -2,11 +2,11 @@ #include "system/angband.h" -struct player_type; -void build_lake(player_type *player_ptr, int type); -void build_cavern(player_type *player_ptr); -void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0); -void add_outer_wall(player_type *player_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2); +class PlayerType; +void build_lake(PlayerType *player_ptr, int type); +void build_cavern(PlayerType *player_ptr); +void build_small_room(PlayerType *player_ptr, POSITION x0, POSITION y0); +void add_outer_wall(PlayerType *player_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2); POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4); -void build_recursive_room(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power); -void build_room(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2); +void build_recursive_room(PlayerType *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power); +void build_room(PlayerType *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2); diff --git a/src/room/rooms-city.cpp b/src/room/rooms-city.cpp index 8b766aa59..0e3617180 100644 --- a/src/room/rooms-city.cpp +++ b/src/room/rooms-city.cpp @@ -68,7 +68,7 @@ static bool precalc_ugarcade(int town_hgt, int town_wid, int n, std::vector& ugbldg) +static void build_stores(PlayerType *player_ptr, POSITION ltcy, POSITION ltcx, StoreSaleType stores[], int n, const std::vector& ugbldg) { int i; POSITION y, x; @@ -165,7 +165,7 @@ static void build_stores(player_type *player_ptr, POSITION ltcy, POSITION ltcx, * This function does NOT do anything about the owners of the stores,\n * nor the contents thereof. It only handles the physical layout.\n */ -bool build_type16(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type16(PlayerType *player_ptr, dun_data_type *dd_ptr) { StoreSaleType stores[] = { StoreSaleType::GENERAL, diff --git a/src/room/rooms-city.h b/src/room/rooms-city.h index 524ee5eb2..5ff6e6a0d 100644 --- a/src/room/rooms-city.h +++ b/src/room/rooms-city.h @@ -15,5 +15,5 @@ typedef struct ugbldg_type { } ugbldg_type; struct dun_data_type; -struct player_type; -bool build_type16(player_type *player_ptr, dun_data_type *dd_ptr); +class PlayerType; +bool build_type16(PlayerType *player_ptr, dun_data_type *dd_ptr); diff --git a/src/room/rooms-fractal.cpp b/src/room/rooms-fractal.cpp index c67819855..063835c98 100644 --- a/src/room/rooms-fractal.cpp +++ b/src/room/rooms-fractal.cpp @@ -13,7 +13,7 @@ * @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal grid * @return なし */ -bool build_type9(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type9(PlayerType *player_ptr, dun_data_type *dd_ptr) { int grd, roug, cutoff; POSITION xsize, ysize, y0, x0; diff --git a/src/room/rooms-fractal.h b/src/room/rooms-fractal.h index cd215e0ca..5edb557d5 100644 --- a/src/room/rooms-fractal.h +++ b/src/room/rooms-fractal.h @@ -1,5 +1,5 @@ #pragma once struct dun_data_type; -struct player_type; -bool build_type9(player_type *player_ptr, dun_data_type *dd_ptr); +class PlayerType; +bool build_type9(PlayerType *player_ptr, dun_data_type *dd_ptr); diff --git a/src/room/rooms-maze-vault.cpp b/src/room/rooms-maze-vault.cpp index 71349ec66..96edb387a 100644 --- a/src/room/rooms-maze-vault.cpp +++ b/src/room/rooms-maze-vault.cpp @@ -27,7 +27,7 @@ * is the randint0(3) below; it governs the relative density of * twists and turns in the labyrinth: smaller number, more twists. */ -void r_visit(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited) +void r_visit(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited) { int adj[4]; int m = (x2 - x1) / 2 + 1; @@ -95,7 +95,7 @@ void r_visit(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POS } } -void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault) +void build_maze_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault) { msg_print_wizard(player_ptr, CHEAT_DUNGEON, _("迷路ランダムVaultを生成しました。", "Maze Vault.")); floor_type *floor_ptr = player_ptr->current_floor_ptr; diff --git a/src/room/rooms-maze-vault.h b/src/room/rooms-maze-vault.h index 1149db10a..b70ab7f45 100644 --- a/src/room/rooms-maze-vault.h +++ b/src/room/rooms-maze-vault.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void r_visit(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited); -void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault); +class PlayerType; +void r_visit(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited); +void build_maze_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault); diff --git a/src/room/rooms-normal.cpp b/src/room/rooms-normal.cpp index b10023a87..9d392aabf 100644 --- a/src/room/rooms-normal.cpp +++ b/src/room/rooms-normal.cpp @@ -19,7 +19,7 @@ * @brief タイプ1の部屋…通常可変長方形の部屋を生成する / Type 1 -- normal rectangular rooms * @param player_ptr プレイヤーへの参照ポインタ */ -bool build_type1(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type1(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION y, x, y2, x2, yval, xval; POSITION y1, x1, xsize, ysize; @@ -192,7 +192,7 @@ bool build_type1(player_type *player_ptr, dun_data_type *dd_ptr) * @brief タイプ2の部屋…二重長方形の部屋を生成する / Type 2 -- Overlapping rectangular rooms * @param player_ptr プレイヤーへの参照ポインタ */ -bool build_type2(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type2(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION y, x, xval, yval; POSITION y1a, x1a, y2a, x2a; @@ -302,7 +302,7 @@ bool build_type2(player_type *player_ptr, dun_data_type *dd_ptr) * the code below will work (with "bounds checking") for 5x5, or even\n * for unsymetric values like 4x3 or 5x3 or 3x4 or 3x5, or even larger.\n */ -bool build_type3(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type3(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION y, x, dy, dx, wy, wx; POSITION y1a, x1a, y2a, x2a; @@ -539,7 +539,7 @@ bool build_type3(player_type *player_ptr, dun_data_type *dd_ptr) * 4 - Inner room has a maze\n * 5 - A set of four inner rooms\n */ -bool build_type4(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type4(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION y, x, y1, x1; POSITION y2, x2, tmp, yval, xval; @@ -871,7 +871,7 @@ bool build_type4(player_type *player_ptr, dun_data_type *dd_ptr) *\n * When done fill from the inside to find the walls,\n */ -bool build_type11(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type11(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION rad, x, y, x0, y0; int light = false; @@ -915,7 +915,7 @@ bool build_type11(player_type *player_ptr, dun_data_type *dd_ptr) *\n * When done fill from the inside to find the walls,\n */ -bool build_type12(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type12(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION rad, x, y, x0, y0; int light = false; diff --git a/src/room/rooms-normal.h b/src/room/rooms-normal.h index 98a8bf825..7d9d8fa4d 100644 --- a/src/room/rooms-normal.h +++ b/src/room/rooms-normal.h @@ -1,10 +1,10 @@ #pragma once struct dun_data_type; -struct player_type; -bool build_type1(player_type *player_ptr, dun_data_type *dd_ptr); -bool build_type2(player_type *player_ptr, dun_data_type *dd_ptr); -bool build_type3(player_type *player_ptr, dun_data_type *dd_ptr); -bool build_type4(player_type *player_ptr, dun_data_type *dd_ptr); -bool build_type11(player_type *player_ptr, dun_data_type *dd_ptr); -bool build_type12(player_type *player_ptr, dun_data_type *dd_ptr); +class PlayerType; +bool build_type1(PlayerType *player_ptr, dun_data_type *dd_ptr); +bool build_type2(PlayerType *player_ptr, dun_data_type *dd_ptr); +bool build_type3(PlayerType *player_ptr, dun_data_type *dd_ptr); +bool build_type4(PlayerType *player_ptr, dun_data_type *dd_ptr); +bool build_type11(PlayerType *player_ptr, dun_data_type *dd_ptr); +bool build_type12(PlayerType *player_ptr, dun_data_type *dd_ptr); diff --git a/src/room/rooms-pit-nest.cpp b/src/room/rooms-pit-nest.cpp index 64a57f7a5..6ac54b6f8 100644 --- a/src/room/rooms-pit-nest.cpp +++ b/src/room/rooms-pit-nest.cpp @@ -119,7 +119,7 @@ static concptr pit_subtype_string(int type, bool nest) * @param b 比較対象参照ID2 * TODO: to sort.c */ -static bool ang_sort_comp_nest_mon_info(player_type *player_ptr, vptr u, vptr v, int a, int b) +static bool ang_sort_comp_nest_mon_info(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -160,7 +160,7 @@ static bool ang_sort_comp_nest_mon_info(player_type *player_ptr, vptr u, vptr v, * @param b スワップ対象参照ID2 * TODO: to sort.c */ -static void ang_sort_swap_nest_mon_info(player_type *player_ptr, vptr u, vptr v, int a, int b) +static void ang_sort_swap_nest_mon_info(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -216,7 +216,7 @@ static void add_cave_info(grid_type *g_ptr, int cave_mask) *\n * Note that "monster nests" will never contain "unique" monsters.\n */ -bool build_type5(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type5(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION y, x, y1, x1, y2, x2, xval, yval; int i; @@ -442,7 +442,7 @@ std::vector pit_types = { *\n * Note that "monster pits" will never contain "unique" monsters.\n */ -bool build_type6(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type6(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION y, x, y1, x1, y2, x2, xval, yval; int i, j; @@ -682,7 +682,7 @@ const int place_table_trapped_pit[TRAPPED_PIT_MONSTER_PLACE_MAX][3] = { * @detai; * 穴を掘るモンスター、壁を抜けるモンスターは却下 */ -static bool vault_aux_trapped_pit(player_type *player_ptr, MONRACE_IDX r_idx) +static bool vault_aux_trapped_pit(PlayerType *player_ptr, MONRACE_IDX r_idx) { /* Unused */ (void)player_ptr; @@ -743,7 +743,7 @@ static bool vault_aux_trapped_pit(player_type *player_ptr, MONRACE_IDX r_idx) *\n * Note that "monster pits" will never contain "unique" monsters.\n */ -bool build_type13(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type13(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION y, x, y1, x1, y2, x2, xval, yval; int i, j; diff --git a/src/room/rooms-pit-nest.h b/src/room/rooms-pit-nest.h index b72c8f6b5..689de9958 100644 --- a/src/room/rooms-pit-nest.h +++ b/src/room/rooms-pit-nest.h @@ -34,11 +34,11 @@ enum pit_type : int { }; /*! pit/nest型情報の構造体定義 */ -struct player_type; +class PlayerType; struct nest_pit_type { concptr name; // v_info; * Note: If two centers are on the same point then this algorithm will create a * blank bubble filled with walls. - This is prevented from happening. */ -static void build_bubble_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) +static void build_bubble_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) { #define BUBBLENUM 10 /* number of bubbles */ @@ -169,7 +169,7 @@ static void build_bubble_vault(player_type *player_ptr, POSITION x0, POSITION y0 } /* Create a random vault that looks like a collection of overlapping rooms */ -static void build_room_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) +static void build_room_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) { POSITION x1, x2, y1, y2, xhsize, yhsize; int i; @@ -214,7 +214,7 @@ static void build_room_vault(player_type *player_ptr, POSITION x0, POSITION y0, } /* Create a random vault out of a fractal grid */ -static void build_cave_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz) +static void build_cave_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz) { int grd, roug, cutoff; bool done, light, room; @@ -312,7 +312,7 @@ static void coord_trans(POSITION *x, POSITION *y, POSITION xoffset, POSITION yof * @param transno 変換ID */ static void build_vault( - player_type *player_ptr, POSITION yval, POSITION xval, POSITION ymax, POSITION xmax, concptr data, POSITION xoffset, POSITION yoffset, int transno) + PlayerType *player_ptr, POSITION yval, POSITION xval, POSITION ymax, POSITION xmax, concptr data, POSITION xoffset, POSITION yoffset, int transno) { POSITION dx, dy, x, y, i, j; concptr t; @@ -601,7 +601,7 @@ static void build_vault( /*! * @brief タイプ7の部屋…v_info.txtより小型vaultを生成する / Type 7 -- simple vaults (see "v_info.txt") */ -bool build_type7(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type7(PlayerType *player_ptr, dun_data_type *dd_ptr) { vault_type *v_ptr = nullptr; int dummy; @@ -669,7 +669,7 @@ bool build_type7(player_type *player_ptr, dun_data_type *dd_ptr) /*! * @brief タイプ8の部屋…v_info.txtより大型vaultを生成する / Type 8 -- greater vaults (see "v_info.txt") */ -bool build_type8(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type8(PlayerType *player_ptr, dun_data_type *dd_ptr) { vault_type *v_ptr; int dummy; @@ -745,7 +745,7 @@ bool build_type8(player_type *player_ptr, dun_data_type *dd_ptr) * This is made by two concentric "crypts" with perpendicular * walls creating the cross-hairs. */ -static void build_target_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) +static void build_target_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) { POSITION rad, x, y; @@ -849,7 +849,7 @@ static void build_target_vault(player_type *player_ptr, POSITION x0, POSITION y0 * * Miniture rooms are then scattered across the vault. */ -static void build_elemental_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz) +static void build_elemental_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz) { int grd, roug; int c1, c2, c3; @@ -928,7 +928,7 @@ static void build_elemental_vault(player_type *player_ptr, POSITION x0, POSITION * The vault has two entrances on opposite sides to guarantee * a way to get in even if the vault abuts a side of the dungeon. */ -static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) +static void build_mini_c_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) { POSITION dy, dx; POSITION y1, x1, y2, x2, y, x, total; @@ -1039,7 +1039,7 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0 * *This makes a vault that looks like a castle/ city in the dungeon. */ -static void build_castle_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) +static void build_castle_vault(PlayerType *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize) { POSITION dy, dx; POSITION y1, x1, y2, x2; @@ -1077,7 +1077,7 @@ static void build_castle_vault(player_type *player_ptr, POSITION x0, POSITION y0 * @brief タイプ10の部屋…ランダム生成vault / Type 10 -- Random vaults * @param player_ptr プレイヤーへの参照ポインタ */ -bool build_type10(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type10(PlayerType *player_ptr, dun_data_type *dd_ptr) { POSITION y0, x0, xsize, ysize, vtype; @@ -1139,7 +1139,7 @@ bool build_type10(player_type *player_ptr, dun_data_type *dd_ptr) /*! * @brief タイプ17の部屋…v_info.txtより固定特殊部屋を生成する / Type 17 -- fixed special room (see "v_info.txt") */ -bool build_type17(player_type *player_ptr, dun_data_type *dd_ptr) +bool build_type17(PlayerType *player_ptr, dun_data_type *dd_ptr) { vault_type *v_ptr = nullptr; int dummy; diff --git a/src/room/rooms-vault.h b/src/room/rooms-vault.h index 77265fb2a..c34b66b60 100644 --- a/src/room/rooms-vault.h +++ b/src/room/rooms-vault.h @@ -19,8 +19,8 @@ typedef struct vault_type { extern std::vector v_info; struct dun_data_type; -struct player_type; -bool build_type7(player_type *player_ptr, dun_data_type *dd_ptr); -bool build_type8(player_type *player_ptr, dun_data_type *dd_ptr); -bool build_type10(player_type *player_ptr, dun_data_type *dd_ptr); -bool build_type17(player_type *player_ptr, dun_data_type *dd_ptr); +class PlayerType; +bool build_type7(PlayerType *player_ptr, dun_data_type *dd_ptr); +bool build_type8(PlayerType *player_ptr, dun_data_type *dd_ptr); +bool build_type10(PlayerType *player_ptr, dun_data_type *dd_ptr); +bool build_type17(PlayerType *player_ptr, dun_data_type *dd_ptr); diff --git a/src/room/space-finder.cpp b/src/room/space-finder.cpp index e955c4e4f..75153af6b 100644 --- a/src/room/space-finder.cpp +++ b/src/room/space-finder.cpp @@ -32,7 +32,7 @@ static bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y) * @param x 地形を変えたいマスのX座標 * @param y 地形を変えたいマスのY座標 */ -static void set_floor(player_type *player_ptr, POSITION x, POSITION y) +static void set_floor(PlayerType *player_ptr, POSITION x, POSITION y) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!in_bounds(floor_ptr, y, x)) @@ -56,7 +56,7 @@ static void set_floor(player_type *player_ptr, POSITION x, POSITION y) * @param x2 範囲の右端 * @param y2 範囲の下端 */ -static void check_room_boundary(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2) +static void check_room_boundary(PlayerType *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2) { bool old_is_floor; bool new_is_floor; @@ -173,7 +173,7 @@ static bool find_space_aux(dun_data_type *dd_ptr, POSITION blocks_high, POSITION * Return TRUE and values for the center of the room if all went well.\n * Otherwise, return FALSE.\n */ -bool find_space(player_type *player_ptr, dun_data_type *dd_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width) +bool find_space(PlayerType *player_ptr, dun_data_type *dd_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width) { int pick; POSITION block_y = 0; diff --git a/src/room/space-finder.h b/src/room/space-finder.h index 475ce189d..123459075 100644 --- a/src/room/space-finder.h +++ b/src/room/space-finder.h @@ -3,5 +3,5 @@ #include "system/angband.h" struct dun_data_type; -struct player_type; -bool find_space(player_type *player_ptr, dun_data_type *dd_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width); +class PlayerType; +bool find_space(PlayerType *player_ptr, dun_data_type *dd_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width); diff --git a/src/room/treasure-deployment.cpp b/src/room/treasure-deployment.cpp index a736b0f10..e0ee5d9f7 100644 --- a/src/room/treasure-deployment.cpp +++ b/src/room/treasure-deployment.cpp @@ -20,7 +20,7 @@ /* * Routine that fills the empty areas of a room with treasure and monsters. */ -void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty) +void fill_treasure(PlayerType *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty) { POSITION cx = (x1 + x2) / 2; POSITION cy = (y1 + y2) / 2; diff --git a/src/room/treasure-deployment.h b/src/room/treasure-deployment.h index 82a58974c..7e7968d65 100644 --- a/src/room/treasure-deployment.h +++ b/src/room/treasure-deployment.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty); +class PlayerType; +void fill_treasure(PlayerType *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty); diff --git a/src/room/vault-builder.cpp b/src/room/vault-builder.cpp index eb69dbb3b..391f2e81e 100644 --- a/src/room/vault-builder.cpp +++ b/src/room/vault-builder.cpp @@ -16,12 +16,12 @@ /* * Grid based version of "creature_bold()" */ -static bool player_grid(player_type *player_ptr, grid_type *g_ptr) { return g_ptr == &player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x]; } +static bool player_grid(PlayerType *player_ptr, grid_type *g_ptr) { return g_ptr == &player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x]; } /* * Grid based version of "cave_empty_bold()" */ -static bool is_cave_empty_grid(player_type *player_ptr, grid_type *g_ptr) +static bool is_cave_empty_grid(PlayerType *player_ptr, grid_type *g_ptr) { bool is_empty_grid = g_ptr->cave_has_flag(FloorFeatureType::PLACE); is_empty_grid &= g_ptr->m_idx == 0; @@ -38,7 +38,7 @@ static bool is_cave_empty_grid(player_type *player_ptr, grid_type *g_ptr) * @details * Only really called by some of the "vault" routines. */ -void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num) +void vault_monsters(PlayerType *player_ptr, POSITION y1, POSITION x1, int num) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (int k = 0; k < num; k++) { @@ -67,7 +67,7 @@ void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num) * @details * Only really called by some of the "vault" routines. */ -void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num) +void vault_objects(PlayerType *player_ptr, POSITION y, POSITION x, int num) { floor_type *floor_ptr = player_ptr->current_floor_ptr; for (; num > 0; --num) { @@ -112,7 +112,7 @@ void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num) * @details * Only really called by some of the "vault" routines. */ -static void vault_trap_aux(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd) +static void vault_trap_aux(PlayerType *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd) { grid_type *g_ptr; floor_type *floor_ptr = player_ptr->current_floor_ptr; @@ -153,7 +153,7 @@ static void vault_trap_aux(player_type *player_ptr, POSITION y, POSITION x, POSI * Only really called by some of the "vault" routines. * @todo rooms-normal からしか呼ばれていない、要調整 */ -void vault_traps(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num) +void vault_traps(PlayerType *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num) { for (int i = 0; i < num; i++) vault_trap_aux(player_ptr, y, x, yd, xd); diff --git a/src/room/vault-builder.h b/src/room/vault-builder.h index 464bf3566..3d8ff83eb 100644 --- a/src/room/vault-builder.h +++ b/src/room/vault-builder.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num); -void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num); -void vault_traps(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num); +class PlayerType; +void vault_monsters(PlayerType *player_ptr, POSITION y1, POSITION x1, int num); +void vault_objects(PlayerType *player_ptr, POSITION y, POSITION x, int num); +void vault_traps(PlayerType *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num); diff --git a/src/save/floor-writer.cpp b/src/save/floor-writer.cpp index ad87a4f25..a9fc05f45 100644 --- a/src/save/floor-writer.cpp +++ b/src/save/floor-writer.cpp @@ -23,7 +23,7 @@ * @brief 保存フロアの書き込み / Actually write a saved floor data using effectively compressed format. * @param sf_ptr 保存したいフロアの参照ポインタ */ -void wr_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr) +void wr_saved_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!sf_ptr) { @@ -150,7 +150,7 @@ void wr_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr) * @player_ptr プレイヤーへの参照ポインタ * @return 保存に成功したらTRUE */ -bool wr_dungeon(player_type *player_ptr) +bool wr_dungeon(PlayerType *player_ptr) { forget_lite(player_ptr->current_floor_ptr); forget_view(player_ptr->current_floor_ptr); @@ -205,7 +205,7 @@ bool wr_dungeon(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param sf_ptr 保存フロア参照ポインタ */ -static bool save_floor_aux(player_type *player_ptr, saved_floor_type *sf_ptr) +static bool save_floor_aux(PlayerType *player_ptr, saved_floor_type *sf_ptr) { compact_objects(player_ptr, 0); compact_monsters(player_ptr, 0); @@ -230,7 +230,7 @@ static bool save_floor_aux(player_type *player_ptr, saved_floor_type *sf_ptr) * @param sf_ptr 保存フロア参照ポインタ * @param mode 保存オプション */ -bool save_floor(player_type *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mode) +bool save_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mode) { FILE *old_fff = nullptr; byte old_xor_byte = 0; diff --git a/src/save/floor-writer.h b/src/save/floor-writer.h index e53ce4014..b94f9868a 100644 --- a/src/save/floor-writer.h +++ b/src/save/floor-writer.h @@ -6,8 +6,8 @@ #define SLF_SECOND 0x0001 /* Called from another save/load function */ #define SLF_NO_KILL 0x0002 /* Don't kill temporary files */ -struct player_type; +class PlayerType; struct saved_floor_type; -void wr_saved_floor(player_type *player_ptr, saved_floor_type *sf_ptr); -bool wr_dungeon(player_type *player_ptr); -bool save_floor(player_type *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mode); +void wr_saved_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr); +bool wr_dungeon(PlayerType *player_ptr); +bool save_floor(PlayerType *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mode); diff --git a/src/save/player-writer.cpp b/src/save/player-writer.cpp index 03ab8fcc5..938a6191e 100644 --- a/src/save/player-writer.cpp +++ b/src/save/player-writer.cpp @@ -20,7 +20,7 @@ * @brief セーブデータに領域情報を書き込む / Write player realms * @param player_ptr プレイヤーへの参照ポインタ */ -static void wr_relams(player_type *player_ptr) +static void wr_relams(PlayerType *player_ptr) { if (player_ptr->pclass == PlayerClassType::ELEMENTALIST) wr_byte((byte)player_ptr->element); @@ -33,7 +33,7 @@ static void wr_relams(player_type *player_ptr) * @brief セーブデータにプレイヤー情報を書き込む / Write some "player" info * @param player_ptr プレイヤーへの参照ポインタ */ -void wr_player(player_type *player_ptr) +void wr_player(PlayerType *player_ptr) { wr_string(player_ptr->name); wr_string(player_ptr->died_from); diff --git a/src/save/player-writer.h b/src/save/player-writer.h index 31ebdb5cc..5722002b8 100644 --- a/src/save/player-writer.h +++ b/src/save/player-writer.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void wr_player(player_type *player_ptr); +class PlayerType; +void wr_player(PlayerType *player_ptr); diff --git a/src/save/save.cpp b/src/save/save.cpp index c5a8d8d51..ce9042eb5 100644 --- a/src/save/save.cpp +++ b/src/save/save.cpp @@ -48,7 +48,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 成功すればtrue */ -static bool wr_savefile_new(player_type *player_ptr, save_type type) +static bool wr_savefile_new(PlayerType *player_ptr, save_type type) { compact_objects(player_ptr, 0); compact_monsters(player_ptr, 0); @@ -231,7 +231,7 @@ static bool wr_savefile_new(player_type *player_ptr, save_type type) * @details * Angband 2.8.0 will use "fd" instead of "fff" if possible */ -static bool save_player_aux(player_type *player_ptr, char *name, save_type type) +static bool save_player_aux(PlayerType *player_ptr, char *name, save_type type) { safe_setuid_grab(player_ptr); int file_permission = 0644; @@ -274,7 +274,7 @@ static bool save_player_aux(player_type *player_ptr, char *name, save_type type) * @param player_ptr プレイヤーへの参照ポインタ * @return 成功すればtrue */ -bool save_player(player_type *player_ptr, save_type type) +bool save_player(PlayerType *player_ptr, save_type type) { char safe[1024]; strcpy(safe, savefile); diff --git a/src/save/save.h b/src/save/save.h index f5aba69b1..015380bd8 100644 --- a/src/save/save.h +++ b/src/save/save.h @@ -6,5 +6,5 @@ enum save_type { SAVE_TYPE_DEBUG = 2 }; -struct player_type; -bool save_player(player_type *player_ptr, save_type type); +class PlayerType; +bool save_player(PlayerType *player_ptr, save_type type); diff --git a/src/specific-object/blade-turner.cpp b/src/specific-object/blade-turner.cpp index e176f83d1..a2bef4300 100644 --- a/src/specific-object/blade-turner.cpp +++ b/src/specific-object/blade-turner.cpp @@ -9,7 +9,7 @@ #include "target/target-getter.h" #include "view/display-messages.h" -bool activate_bladeturner(player_type *player_ptr) +bool activate_bladeturner(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) diff --git a/src/specific-object/blade-turner.h b/src/specific-object/blade-turner.h index dd37cc221..eb254b679 100644 --- a/src/specific-object/blade-turner.h +++ b/src/specific-object/blade-turner.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool activate_bladeturner(player_type *player_ptr); +class PlayerType; +bool activate_bladeturner(PlayerType *player_ptr); diff --git a/src/specific-object/bloody-moon.cpp b/src/specific-object/bloody-moon.cpp index b5f59cab6..4694ad27e 100644 --- a/src/specific-object/bloody-moon.cpp +++ b/src/specific-object/bloody-moon.cpp @@ -51,7 +51,7 @@ void get_bloody_moon_flags(object_type *o_ptr) * @param o_ptr ブラッディ・ムーンへの参照ポインタ * @return オブジェクト情報に異常がない限りTRUE */ -bool activate_bloody_moon(player_type *player_ptr, object_type *o_ptr) +bool activate_bloody_moon(PlayerType *player_ptr, object_type *o_ptr) { if (o_ptr->name1 != ART_BLOOD) return false; diff --git a/src/specific-object/bloody-moon.h b/src/specific-object/bloody-moon.h index 6f18f550c..dd5007f34 100644 --- a/src/specific-object/bloody-moon.h +++ b/src/specific-object/bloody-moon.h @@ -1,6 +1,6 @@ #pragma once struct object_type; -struct player_type; +class PlayerType; void get_bloody_moon_flags(object_type *o_ptr); -bool activate_bloody_moon(player_type *player_ptr, object_type *o_ptr); +bool activate_bloody_moon(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/specific-object/chest.cpp b/src/specific-object/chest.cpp index a4e0c4678..389f63608 100644 --- a/src/specific-object/chest.cpp +++ b/src/specific-object/chest.cpp @@ -30,7 +30,7 @@ /*!< この値以降の小項目IDを持った箱は大型の箱としてドロップ数を増やす / Special "sval" limit -- first "large" chest */ #define SV_CHEST_MIN_LARGE 4 -Chest::Chest(player_type *player_ptr) +Chest::Chest(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/specific-object/chest.h b/src/specific-object/chest.h index 0b464082c..87b40d65c 100644 --- a/src/specific-object/chest.h +++ b/src/specific-object/chest.h @@ -2,14 +2,14 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class Chest { public: - Chest(player_type *player_ptr); + Chest(PlayerType *player_ptr); virtual ~Chest() = default; void chest_death(bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx); void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx); private: - player_type *player_ptr; + PlayerType *player_ptr; }; diff --git a/src/specific-object/death-crimson.cpp b/src/specific-object/death-crimson.cpp index 8f6068d4f..b037d4590 100644 --- a/src/specific-object/death-crimson.cpp +++ b/src/specific-object/death-crimson.cpp @@ -18,7 +18,7 @@ * Need to analyze size of the window. * Need more color coding. */ -static bool fire_crimson(player_type *player_ptr) +static bool fire_crimson(PlayerType *player_ptr) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -50,7 +50,7 @@ static bool fire_crimson(player_type *player_ptr) return true; } -bool activate_crimson(player_type *player_ptr, object_type *o_ptr) +bool activate_crimson(PlayerType *player_ptr, object_type *o_ptr) { if (o_ptr->name1 != ART_CRIMSON) return false; diff --git a/src/specific-object/death-crimson.h b/src/specific-object/death-crimson.h index 98c1749fe..f62bdfd5f 100644 --- a/src/specific-object/death-crimson.h +++ b/src/specific-object/death-crimson.h @@ -1,5 +1,5 @@ #pragma once struct object_type; -struct player_type; -bool activate_crimson(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool activate_crimson(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/specific-object/death-scythe.cpp b/src/specific-object/death-scythe.cpp index d9b728454..d980ad795 100644 --- a/src/specific-object/death-scythe.cpp +++ b/src/specific-object/death-scythe.cpp @@ -29,7 +29,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 倍率 (実際は1/10になる) */ -static int calc_death_scythe_reflection_magnification_mimic_none(player_type *player_ptr) +static int calc_death_scythe_reflection_magnification_mimic_none(PlayerType *player_ptr) { switch (player_ptr->prace) { case PlayerRaceType::YEEK: @@ -64,7 +64,7 @@ static int calc_death_scythe_reflection_magnification_mimic_none(player_type *pl * @param player_ptr プレイヤーへの参照ポインタ * @return 倍率 (実際は1/10になる) */ -static int calc_death_scythe_reflection_magnification(player_type *player_ptr) +static int calc_death_scythe_reflection_magnification(PlayerType *player_ptr) { switch (player_ptr->mimic_form) { case MIMIC_NONE: @@ -84,7 +84,7 @@ static int calc_death_scythe_reflection_magnification(player_type *player_ptr) * @param magnification ダメージ倍率 * @param death_scythe_flags 死の大鎌に関するオブジェクトフラグ配列 */ -static void compensate_death_scythe_reflection_magnification(player_type *player_ptr, int *magnification, const TrFlags &death_scythe_flags) +static void compensate_death_scythe_reflection_magnification(PlayerType *player_ptr, int *magnification, const TrFlags &death_scythe_flags) { if ((player_ptr->alignment < 0) && (*magnification < 20)) *magnification = 20; @@ -133,7 +133,7 @@ static void death_scythe_reflection_critial_hit(player_attack_type *pa_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pa_ptr 直接攻撃構造体への参照ポインタ */ -void process_death_scythe_reflection(player_type *player_ptr, player_attack_type *pa_ptr) +void process_death_scythe_reflection(PlayerType *player_ptr, player_attack_type *pa_ptr) { sound(SOUND_HIT); msg_format(_("ミス! %sにかわされた。", "You miss %s."), pa_ptr->m_name); diff --git a/src/specific-object/death-scythe.h b/src/specific-object/death-scythe.h index 13259d5f3..f8fda9a7b 100644 --- a/src/specific-object/death-scythe.h +++ b/src/specific-object/death-scythe.h @@ -1,5 +1,5 @@ #pragma once struct player_attack_type; -struct player_type; -void process_death_scythe_reflection(player_type *player_ptr, player_attack_type *pa_ptr); +class PlayerType; +void process_death_scythe_reflection(PlayerType *player_ptr, player_attack_type *pa_ptr); diff --git a/src/specific-object/monster-ball.cpp b/src/specific-object/monster-ball.cpp index c642514eb..9e8f97d4d 100644 --- a/src/specific-object/monster-ball.cpp +++ b/src/specific-object/monster-ball.cpp @@ -61,7 +61,7 @@ static void inscribe_nickname(ae_type *ae_ptr) ae_ptr->o_ptr->inscription = quark_add(buf); } -static bool set_activation_target(player_type *player_ptr, ae_type *ae_ptr) +static bool set_activation_target(PlayerType *player_ptr, ae_type *ae_ptr) { bool old_target_pet = target_pet; target_pet = true; @@ -82,7 +82,7 @@ static bool set_activation_target(player_type *player_ptr, ae_type *ae_ptr) return true; } -static void add_quark_to_inscription(player_type *player_ptr, ae_type *ae_ptr, concptr t, char *buf) +static void add_quark_to_inscription(PlayerType *player_ptr, ae_type *ae_ptr, concptr t, char *buf) { if (!*t) return; @@ -124,7 +124,7 @@ static void add_quark_to_inscription(player_type *player_ptr, ae_type *ae_ptr, c ae_ptr->o_ptr->inscription = quark_add(buf); } -static void check_inscription_value(player_type *player_ptr, ae_type *ae_ptr) +static void check_inscription_value(PlayerType *player_ptr, ae_type *ae_ptr) { if (ae_ptr->o_ptr->inscription == 0) return; @@ -141,7 +141,7 @@ static void check_inscription_value(player_type *player_ptr, ae_type *ae_ptr) add_quark_to_inscription(player_ptr, ae_ptr, t, buf); } -static void check_monster_ball_use(player_type *player_ptr, ae_type *ae_ptr) +static void check_monster_ball_use(PlayerType *player_ptr, ae_type *ae_ptr) { if (!monster_can_enter(player_ptr, player_ptr->y + ddy[ae_ptr->dir], player_ptr->x + ddx[ae_ptr->dir], &r_info[ae_ptr->o_ptr->pval], 0)) return; @@ -168,7 +168,7 @@ static void check_monster_ball_use(player_type *player_ptr, ae_type *ae_ptr) ae_ptr->success = true; } -bool exe_monster_capture(player_type *player_ptr, ae_type *ae_ptr) +bool exe_monster_capture(PlayerType *player_ptr, ae_type *ae_ptr) { if (ae_ptr->o_ptr->tval != ItemKindType::CAPTURE) return false; diff --git a/src/specific-object/monster-ball.h b/src/specific-object/monster-ball.h index 9f4d8edc6..b9d001a90 100644 --- a/src/specific-object/monster-ball.h +++ b/src/specific-object/monster-ball.h @@ -1,5 +1,5 @@ #pragma once typedef struct ae_type ae_type; -struct player_type; -bool exe_monster_capture(player_type *player_ptr, ae_type *ae_ptr); +class PlayerType; +bool exe_monster_capture(PlayerType *player_ptr, ae_type *ae_ptr); diff --git a/src/specific-object/muramasa.cpp b/src/specific-object/muramasa.cpp index a5b641a8f..2a1aff4a5 100644 --- a/src/specific-object/muramasa.cpp +++ b/src/specific-object/muramasa.cpp @@ -7,7 +7,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -bool activate_muramasa(player_type *player_ptr, object_type *o_ptr) +bool activate_muramasa(PlayerType *player_ptr, object_type *o_ptr) { if (o_ptr->name1 != ART_MURAMASA) return false; diff --git a/src/specific-object/muramasa.h b/src/specific-object/muramasa.h index 6ffab1f23..8f3ba5e96 100644 --- a/src/specific-object/muramasa.h +++ b/src/specific-object/muramasa.h @@ -1,5 +1,5 @@ #pragma once struct object_type; -struct player_type; -bool activate_muramasa(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool activate_muramasa(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/specific-object/ring-of-power.cpp b/src/specific-object/ring-of-power.cpp index 1db583f23..eecc05c14 100644 --- a/src/specific-object/ring-of-power.cpp +++ b/src/specific-object/ring-of-power.cpp @@ -16,7 +16,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param dir 発動の方向ID */ -static void exe_ring_of_power(player_type *player_ptr, DIRECTION dir) +static void exe_ring_of_power(PlayerType *player_ptr, DIRECTION dir) { switch (randint1(10)) { case 1: @@ -53,7 +53,7 @@ static void exe_ring_of_power(player_type *player_ptr, DIRECTION dir) } } -bool activate_ring_of_power(player_type *player_ptr, concptr name) +bool activate_ring_of_power(PlayerType *player_ptr, concptr name) { DIRECTION dir; msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name); diff --git a/src/specific-object/ring-of-power.h b/src/specific-object/ring-of-power.h index 27c7f6c33..fec840e4d 100644 --- a/src/specific-object/ring-of-power.h +++ b/src/specific-object/ring-of-power.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool activate_ring_of_power(player_type *player_ptr, concptr name); +class PlayerType; +bool activate_ring_of_power(PlayerType *player_ptr, concptr name); diff --git a/src/specific-object/stone-of-lore.cpp b/src/specific-object/stone-of-lore.cpp index d81d19d3c..d0960e1de 100644 --- a/src/specific-object/stone-of-lore.cpp +++ b/src/specific-object/stone-of-lore.cpp @@ -13,7 +13,7 @@ #include "util/bit-flags-calculator.h" #include "view/display-messages.h" -StoneOfLore::StoneOfLore(player_type *player_ptr) +StoneOfLore::StoneOfLore(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/specific-object/stone-of-lore.h b/src/specific-object/stone-of-lore.h index 92f8fbb5d..bda09c8d7 100644 --- a/src/specific-object/stone-of-lore.h +++ b/src/specific-object/stone-of-lore.h @@ -1,14 +1,14 @@ #pragma once -struct player_type; +class PlayerType; class StoneOfLore { public: - StoneOfLore(player_type *player_ptr); + StoneOfLore(PlayerType *player_ptr); virtual ~StoneOfLore() = default; bool perilous_secrets(); private: - player_type *player_ptr; + PlayerType *player_ptr; void consume_mp(); }; diff --git a/src/specific-object/toragoroshi.cpp b/src/specific-object/toragoroshi.cpp index 2fa00bf7b..000793936 100644 --- a/src/specific-object/toragoroshi.cpp +++ b/src/specific-object/toragoroshi.cpp @@ -3,7 +3,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -bool activate_toragoroshi(player_type *player_ptr) +bool activate_toragoroshi(PlayerType *player_ptr) { msg_print(_("あなたは妖刀に魅入られた…", "You are fascinated by the cursed blade...")); msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'")); diff --git a/src/specific-object/toragoroshi.h b/src/specific-object/toragoroshi.h index 3fb901682..28021ff4a 100644 --- a/src/specific-object/toragoroshi.h +++ b/src/specific-object/toragoroshi.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool activate_toragoroshi(player_type *player_ptr); +class PlayerType; +bool activate_toragoroshi(PlayerType *player_ptr); diff --git a/src/specific-object/torch.cpp b/src/specific-object/torch.cpp index 4cf6544fb..c524af30b 100644 --- a/src/specific-object/torch.cpp +++ b/src/specific-object/torch.cpp @@ -81,7 +81,7 @@ void torch_lost_fuel(object_type *o_ptr) * @details * SWD: Experimental modification: multiple light sources have additive effect. */ -void update_lite_radius(player_type *player_ptr) +void update_lite_radius(PlayerType *player_ptr) { player_ptr->cur_lite = 0; for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) { @@ -174,7 +174,7 @@ void update_lite_radius(player_type *player_ptr) * *** ***** * *** */ -void update_lite(player_type *player_ptr) +void update_lite(PlayerType *player_ptr) { // 前回照らされていた座標たちを格納する配列。 std::vector points; diff --git a/src/specific-object/torch.h b/src/specific-object/torch.h index 756add86e..f4d1b0aa0 100644 --- a/src/specific-object/torch.h +++ b/src/specific-object/torch.h @@ -5,10 +5,10 @@ #include "object-enchant/tr-flags.h" struct object_type; -struct player_type; +class PlayerType; bool is_active_torch(object_type *o_ptr); void torch_flags(object_type *o_ptr, TrFlags &flgs); void torch_dice(object_type *o_ptr, DICE_NUMBER *dd, DICE_SID *ds); void torch_lost_fuel(object_type *o_ptr); -void update_lite_radius(player_type *player_ptr); -void update_lite(player_type *player_ptr); +void update_lite_radius(PlayerType *player_ptr); +void update_lite(PlayerType *player_ptr); diff --git a/src/spell-kind/blood-curse.cpp b/src/spell-kind/blood-curse.cpp index 3070651f4..44d8bead8 100644 --- a/src/spell-kind/blood-curse.cpp +++ b/src/spell-kind/blood-curse.cpp @@ -17,7 +17,7 @@ #include "system/player-type-definition.h" #include "view/display-messages.h" -void blood_curse_to_enemy(player_type *player_ptr, MONSTER_IDX m_idx) +void blood_curse_to_enemy(PlayerType *player_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx]; diff --git a/src/spell-kind/blood-curse.h b/src/spell-kind/blood-curse.h index edd1afb73..711ecc686 100644 --- a/src/spell-kind/blood-curse.h +++ b/src/spell-kind/blood-curse.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -void blood_curse_to_enemy(player_type *player_ptr, MONSTER_IDX m_idx); +class PlayerType; +void blood_curse_to_enemy(PlayerType *player_ptr, MONSTER_IDX m_idx); diff --git a/src/spell-kind/earthquake.cpp b/src/spell-kind/earthquake.cpp index c36a5b8da..b2df1eaf2 100644 --- a/src/spell-kind/earthquake.cpp +++ b/src/spell-kind/earthquake.cpp @@ -49,7 +49,7 @@ * @param m_idx 地震を起こしたモンスターID(0ならばプレイヤー) * @return 効力があった場合TRUEを返す */ -bool earthquake(player_type *player_ptr, POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx) +bool earthquake(PlayerType *player_ptr, POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if ((floor_ptr->inside_quest && quest_type::is_fixed(floor_ptr->inside_quest)) || !floor_ptr->dun_level) { diff --git a/src/spell-kind/earthquake.h b/src/spell-kind/earthquake.h index 3edc63889..6503e02fe 100644 --- a/src/spell-kind/earthquake.h +++ b/src/spell-kind/earthquake.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool earthquake(player_type *player_ptr, POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx); +class PlayerType; +bool earthquake(PlayerType *player_ptr, POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx); diff --git a/src/spell-kind/magic-item-recharger.cpp b/src/spell-kind/magic-item-recharger.cpp index 207546df1..8dcb7b16f 100644 --- a/src/spell-kind/magic-item-recharger.cpp +++ b/src/spell-kind/magic-item-recharger.cpp @@ -47,7 +47,7 @@ * * Beware of "sliding index errors". */ -bool recharge(player_type *player_ptr, int power) +bool recharge(PlayerType *player_ptr, int power) { concptr q = _("どのアイテムに魔力を充填しますか? ", "Recharge which item? "); concptr s = _("魔力を充填すべきアイテムがない。", "You have nothing to recharge."); diff --git a/src/spell-kind/magic-item-recharger.h b/src/spell-kind/magic-item-recharger.h index cc9ceb9ea..14001e4bf 100644 --- a/src/spell-kind/magic-item-recharger.h +++ b/src/spell-kind/magic-item-recharger.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool recharge(player_type *player_ptr, int power); +class PlayerType; +bool recharge(PlayerType *player_ptr, int power); diff --git a/src/spell-kind/spells-beam.cpp b/src/spell-kind/spells-beam.cpp index 083a75c53..4acb4a8bb 100644 --- a/src/spell-kind/spells-beam.cpp +++ b/src/spell-kind/spells-beam.cpp @@ -11,7 +11,7 @@ * @param dam 威力 * @return 作用が実際にあった場合TRUEを返す */ -bool wall_to_mud(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) +bool wall_to_mud(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; return (project_hook(player_ptr, AttributeType::KILL_WALL, dir, dam, flg)); @@ -23,7 +23,7 @@ bool wall_to_mud(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする) * @return 作用が実際にあった場合TRUEを返す */ -bool wizard_lock(player_type *player_ptr, DIRECTION dir) +bool wizard_lock(PlayerType *player_ptr, DIRECTION dir) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; return (project_hook(player_ptr, AttributeType::JAM_DOOR, dir, 20 + randint1(30), flg)); @@ -35,7 +35,7 @@ bool wizard_lock(player_type *player_ptr, DIRECTION dir) * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする) * @return 作用が実際にあった場合TRUEを返す */ -bool destroy_door(player_type *player_ptr, DIRECTION dir) +bool destroy_door(PlayerType *player_ptr, DIRECTION dir) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM; return (project_hook(player_ptr, AttributeType::KILL_DOOR, dir, 0, flg)); @@ -47,7 +47,7 @@ bool destroy_door(player_type *player_ptr, DIRECTION dir) * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする) * @return 作用が実際にあった場合TRUEを返す */ -bool disarm_trap(player_type *player_ptr, DIRECTION dir) +bool disarm_trap(PlayerType *player_ptr, DIRECTION dir) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM; return (project_hook(player_ptr, AttributeType::KILL_TRAP, dir, 0, flg)); diff --git a/src/spell-kind/spells-beam.h b/src/spell-kind/spells-beam.h index 194046d84..f83f7b08b 100644 --- a/src/spell-kind/spells-beam.h +++ b/src/spell-kind/spells-beam.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -bool wall_to_mud(player_type *player_ptr, DIRECTION dir, HIT_POINT dam); -bool wizard_lock(player_type *player_ptr, DIRECTION dir); -bool destroy_door(player_type *player_ptr, DIRECTION dir); -bool disarm_trap(player_type *player_ptr, DIRECTION dir); +class PlayerType; +bool wall_to_mud(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam); +bool wizard_lock(PlayerType *player_ptr, DIRECTION dir); +bool destroy_door(PlayerType *player_ptr, DIRECTION dir); +bool disarm_trap(PlayerType *player_ptr, DIRECTION dir); diff --git a/src/spell-kind/spells-charm.cpp b/src/spell-kind/spells-charm.cpp index 0e793e231..633325ebf 100644 --- a/src/spell-kind/spells-charm.cpp +++ b/src/spell-kind/spells-charm.cpp @@ -11,7 +11,7 @@ * @param plev パワー * @return 作用が実際にあった場合TRUEを返す */ -bool charm_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) +bool charm_monster(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; return (project_hook(player_ptr, AttributeType::CHARM, dir, plev, flg)); @@ -24,7 +24,7 @@ bool charm_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) * @param plev パワー * @return 作用が実際にあった場合TRUEを返す */ -bool control_one_undead(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) +bool control_one_undead(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; return (project_hook(player_ptr, AttributeType::CONTROL_UNDEAD, dir, plev, flg)); @@ -37,7 +37,7 @@ bool control_one_undead(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL ple * @param plev パワー * @return 作用が実際にあった場合TRUEを返す */ -bool control_one_demon(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) +bool control_one_demon(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; return (project_hook(player_ptr, AttributeType::CONTROL_DEMON, dir, plev, flg)); @@ -50,7 +50,7 @@ bool control_one_demon(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev * @param plev パワー * @return 作用が実際にあった場合TRUEを返す */ -bool charm_animal(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) +bool charm_animal(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; return (project_hook(player_ptr, AttributeType::CONTROL_ANIMAL, dir, plev, flg)); diff --git a/src/spell-kind/spells-charm.h b/src/spell-kind/spells-charm.h index 31f2b6c8e..44cf12d77 100644 --- a/src/spell-kind/spells-charm.h +++ b/src/spell-kind/spells-charm.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -bool charm_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); -bool control_one_undead(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); -bool control_one_demon(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); -bool charm_animal(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); +class PlayerType; +bool charm_monster(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); +bool control_one_undead(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); +bool control_one_demon(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); +bool charm_animal(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); diff --git a/src/spell-kind/spells-curse-removal.cpp b/src/spell-kind/spells-curse-removal.cpp index 2a76820d2..1756930e7 100644 --- a/src/spell-kind/spells-curse-removal.cpp +++ b/src/spell-kind/spells-curse-removal.cpp @@ -16,7 +16,7 @@ * @return 解呪されたアイテムの数 * @details 永遠の呪いは解呪できない */ -static int exe_curse_removal(player_type *player_ptr, int all) +static int exe_curse_removal(PlayerType *player_ptr, int all) { int cnt = 0; for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) { @@ -53,11 +53,11 @@ static int exe_curse_removal(player_type *player_ptr, int all) * @param player_ptr プレイヤーへの参照ポインタ * @return 解呪に成功した装備数 */ -int remove_curse(player_type *player_ptr) { return exe_curse_removal(player_ptr, false); } +int remove_curse(PlayerType *player_ptr) { return exe_curse_removal(player_ptr, false); } /*! * @brief 装備の重い呪い解呪処理 / * Remove all curses * @return 解呪に成功した装備数 */ -int remove_all_curse(player_type *player_ptr) { return exe_curse_removal(player_ptr, true); } +int remove_all_curse(PlayerType *player_ptr) { return exe_curse_removal(player_ptr, true); } diff --git a/src/spell-kind/spells-curse-removal.h b/src/spell-kind/spells-curse-removal.h index c90c8ae2a..152bb0589 100644 --- a/src/spell-kind/spells-curse-removal.h +++ b/src/spell-kind/spells-curse-removal.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -int remove_curse(player_type *player_ptr); -int remove_all_curse(player_type *player_ptr); +class PlayerType; +int remove_curse(PlayerType *player_ptr); +int remove_all_curse(PlayerType *player_ptr); diff --git a/src/spell-kind/spells-detection.cpp b/src/spell-kind/spells-detection.cpp index dddc76d4c..13fd85b35 100644 --- a/src/spell-kind/spells-detection.cpp +++ b/src/spell-kind/spells-detection.cpp @@ -37,7 +37,7 @@ * @param known 地形から危険フラグを外すならTRUE * @return 効力があった場合TRUEを返す */ -static bool detect_feat_flag(player_type *player_ptr, POSITION range, FloorFeatureType flag, bool known) +static bool detect_feat_flag(PlayerType *player_ptr, POSITION range, FloorFeatureType flag, bool known) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -83,7 +83,7 @@ static bool detect_feat_flag(player_type *player_ptr, POSITION range, FloorFeatu * @details * 吟遊詩人による感知についてはFALSEを返す */ -bool detect_traps(player_type *player_ptr, POSITION range, bool known) +bool detect_traps(PlayerType *player_ptr, POSITION range, bool known) { bool detect = detect_feat_flag(player_ptr, range, FloorFeatureType::TRAP, known); if (!known && detect) @@ -107,7 +107,7 @@ bool detect_traps(player_type *player_ptr, POSITION range, bool known) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_doors(player_type *player_ptr, POSITION range) +bool detect_doors(PlayerType *player_ptr, POSITION range) { bool detect = detect_feat_flag(player_ptr, range, FloorFeatureType::DOOR, true); @@ -126,7 +126,7 @@ bool detect_doors(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_stairs(player_type *player_ptr, POSITION range) +bool detect_stairs(PlayerType *player_ptr, POSITION range) { bool detect = detect_feat_flag(player_ptr, range, FloorFeatureType::STAIRS, true); @@ -145,7 +145,7 @@ bool detect_stairs(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_treasure(player_type *player_ptr, POSITION range) +bool detect_treasure(PlayerType *player_ptr, POSITION range) { bool detect = detect_feat_flag(player_ptr, range, FloorFeatureType::HAS_GOLD, true); @@ -163,7 +163,7 @@ bool detect_treasure(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_objects_gold(player_type *player_ptr, POSITION range) +bool detect_objects_gold(PlayerType *player_ptr, POSITION range) { POSITION range2 = range; if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) @@ -211,7 +211,7 @@ bool detect_objects_gold(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_objects_normal(player_type *player_ptr, POSITION range) +bool detect_objects_normal(PlayerType *player_ptr, POSITION range) { POSITION range2 = range; if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) @@ -266,7 +266,7 @@ bool detect_objects_normal(player_type *player_ptr, POSITION range) * It can probably be argued that this function is now too powerful. * */ -bool detect_objects_magic(player_type *player_ptr, POSITION range) +bool detect_objects_magic(PlayerType *player_ptr, POSITION range) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -312,7 +312,7 @@ bool detect_objects_magic(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_normal(player_type *player_ptr, POSITION range) +bool detect_monsters_normal(PlayerType *player_ptr, POSITION range) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -351,7 +351,7 @@ bool detect_monsters_normal(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_invis(player_type *player_ptr, POSITION range) +bool detect_monsters_invis(PlayerType *player_ptr, POSITION range) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -396,7 +396,7 @@ bool detect_monsters_invis(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_evil(player_type *player_ptr, POSITION range) +bool detect_monsters_evil(PlayerType *player_ptr, POSITION range) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -441,7 +441,7 @@ bool detect_monsters_evil(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_nonliving(player_type *player_ptr, POSITION range) +bool detect_monsters_nonliving(PlayerType *player_ptr, POSITION range) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -481,7 +481,7 @@ bool detect_monsters_nonliving(player_type *player_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_mind(player_type *player_ptr, POSITION range) +bool detect_monsters_mind(PlayerType *player_ptr, POSITION range) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -524,7 +524,7 @@ bool detect_monsters_mind(player_type *player_ptr, POSITION range) * @param Match 対応シンボルの混じったモンスター文字列(複数指定化) * @return 効力があった場合TRUEを返す */ -bool detect_monsters_string(player_type *player_ptr, POSITION range, concptr Match) +bool detect_monsters_string(PlayerType *player_ptr, POSITION range, concptr Match) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -569,7 +569,7 @@ bool detect_monsters_string(player_type *player_ptr, POSITION range, concptr Mat * @param match_flag 感知フラグ * @return 効力があった場合TRUEを返す */ -bool detect_monsters_xxx(player_type *player_ptr, POSITION range, uint32_t match_flag) +bool detect_monsters_xxx(PlayerType *player_ptr, POSITION range, uint32_t match_flag) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -625,7 +625,7 @@ bool detect_monsters_xxx(player_type *player_ptr, POSITION range, uint32_t match * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_all(player_type *player_ptr, POSITION range) +bool detect_all(PlayerType *player_ptr, POSITION range) { bool detect = false; if (detect_traps(player_ptr, range, true)) diff --git a/src/spell-kind/spells-detection.h b/src/spell-kind/spells-detection.h index 5e2d5eb97..a0ee344bd 100644 --- a/src/spell-kind/spells-detection.h +++ b/src/spell-kind/spells-detection.h @@ -2,19 +2,19 @@ #include "system/angband.h" -struct player_type; -bool detect_traps(player_type *player_ptr, POSITION range, bool known); -bool detect_doors(player_type* player_ptr, POSITION range); -bool detect_stairs(player_type* player_ptr, POSITION range); -bool detect_treasure(player_type* player_ptr, POSITION range); -bool detect_objects_gold(player_type* player_ptr, POSITION range); -bool detect_objects_normal(player_type* player_ptr, POSITION range); -bool detect_objects_magic(player_type* player_ptr, POSITION range); -bool detect_monsters_normal(player_type* player_ptr, POSITION range); -bool detect_monsters_invis(player_type* player_ptr, POSITION range); -bool detect_monsters_evil(player_type* player_ptr, POSITION range); -bool detect_monsters_xxx(player_type* player_ptr, POSITION range, uint32_t match_flag); -bool detect_monsters_string(player_type* player_ptr, POSITION range, concptr); -bool detect_monsters_nonliving(player_type* player_ptr, POSITION range); -bool detect_monsters_mind(player_type* player_ptr, POSITION range); -bool detect_all(player_type* player_ptr, POSITION range); +class PlayerType; +bool detect_traps(PlayerType *player_ptr, POSITION range, bool known); +bool detect_doors(PlayerType* player_ptr, POSITION range); +bool detect_stairs(PlayerType* player_ptr, POSITION range); +bool detect_treasure(PlayerType* player_ptr, POSITION range); +bool detect_objects_gold(PlayerType* player_ptr, POSITION range); +bool detect_objects_normal(PlayerType* player_ptr, POSITION range); +bool detect_objects_magic(PlayerType* player_ptr, POSITION range); +bool detect_monsters_normal(PlayerType* player_ptr, POSITION range); +bool detect_monsters_invis(PlayerType* player_ptr, POSITION range); +bool detect_monsters_evil(PlayerType* player_ptr, POSITION range); +bool detect_monsters_xxx(PlayerType* player_ptr, POSITION range, uint32_t match_flag); +bool detect_monsters_string(PlayerType* player_ptr, POSITION range, concptr); +bool detect_monsters_nonliving(PlayerType* player_ptr, POSITION range); +bool detect_monsters_mind(PlayerType* player_ptr, POSITION range); +bool detect_all(PlayerType* player_ptr, POSITION range); diff --git a/src/spell-kind/spells-enchant.cpp b/src/spell-kind/spells-enchant.cpp index d2f578858..249dcf40e 100644 --- a/src/spell-kind/spells-enchant.cpp +++ b/src/spell-kind/spells-enchant.cpp @@ -25,7 +25,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 生成が実際に試みられたらTRUEを返す */ -bool artifact_scroll(player_type *player_ptr) +bool artifact_scroll(PlayerType *player_ptr) { concptr q = _("どのアイテムを強化しますか? ", "Enchant which item? "); concptr s = _("強化できるアイテムがない。", "You have nothing to enchant."); @@ -118,7 +118,7 @@ bool artifact_scroll(player_type *player_ptr) * Returns TRUE if something was mundanified, else FALSE. * */ -bool mundane_spell(player_type *player_ptr, bool only_equip) +bool mundane_spell(PlayerType *player_ptr, bool only_equip) { std::unique_ptr item_tester = std::make_unique(); if (only_equip) diff --git a/src/spell-kind/spells-enchant.h b/src/spell-kind/spells-enchant.h index 1a138be26..209eca1d7 100644 --- a/src/spell-kind/spells-enchant.h +++ b/src/spell-kind/spells-enchant.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -bool artifact_scroll(player_type *player_ptr); -bool mundane_spell(player_type *player_ptr, bool only_equip); +class PlayerType; +bool artifact_scroll(PlayerType *player_ptr); +bool mundane_spell(PlayerType *player_ptr, bool only_equip); diff --git a/src/spell-kind/spells-equipment.cpp b/src/spell-kind/spells-equipment.cpp index 0d34e88ab..370d51603 100644 --- a/src/spell-kind/spells-equipment.cpp +++ b/src/spell-kind/spells-equipment.cpp @@ -20,7 +20,7 @@ * @return 劣化処理に関するメッセージが発せられた場合はTRUEを返す / * Return "TRUE" if the player notices anything */ -bool apply_disenchant(player_type *player_ptr, BIT_FLAGS mode) +bool apply_disenchant(PlayerType *player_ptr, BIT_FLAGS mode) { int t = 0; switch (randint1(8)) { diff --git a/src/spell-kind/spells-equipment.h b/src/spell-kind/spells-equipment.h index 3e9428dc4..5595c307b 100644 --- a/src/spell-kind/spells-equipment.h +++ b/src/spell-kind/spells-equipment.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool apply_disenchant(player_type *player_ptr, BIT_FLAGS mode); +class PlayerType; +bool apply_disenchant(PlayerType *player_ptr, BIT_FLAGS mode); diff --git a/src/spell-kind/spells-fetcher.cpp b/src/spell-kind/spells-fetcher.cpp index 3d49f61b4..42c0f82b2 100644 --- a/src/spell-kind/spells-fetcher.cpp +++ b/src/spell-kind/spells-fetcher.cpp @@ -34,7 +34,7 @@ * @param wgt 許容重量 * @param require_los 射線の通りを要求するならばTRUE */ -void fetch_item(player_type *player_ptr, DIRECTION dir, WEIGHT wgt, bool require_los) +void fetch_item(PlayerType *player_ptr, DIRECTION dir, WEIGHT wgt, bool require_los) { grid_type *g_ptr; object_type *o_ptr; @@ -112,7 +112,7 @@ void fetch_item(player_type *player_ptr, DIRECTION dir, WEIGHT wgt, bool require player_ptr->redraw |= PR_MAP; } -bool fetch_monster(player_type *player_ptr) +bool fetch_monster(PlayerType *player_ptr) { monster_type *m_ptr; MONSTER_IDX m_idx; diff --git a/src/spell-kind/spells-fetcher.h b/src/spell-kind/spells-fetcher.h index 422423eda..58de75294 100644 --- a/src/spell-kind/spells-fetcher.h +++ b/src/spell-kind/spells-fetcher.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void fetch_item(player_type *player_ptr, DIRECTION dir, WEIGHT wgt, bool require_los); -bool fetch_monster(player_type *player_ptr); +class PlayerType; +void fetch_item(PlayerType *player_ptr, DIRECTION dir, WEIGHT wgt, bool require_los); +bool fetch_monster(PlayerType *player_ptr); diff --git a/src/spell-kind/spells-floor.cpp b/src/spell-kind/spells-floor.cpp index 0e889f367..911008c83 100644 --- a/src/spell-kind/spells-floor.cpp +++ b/src/spell-kind/spells-floor.cpp @@ -59,7 +59,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param ninja 忍者かどうか */ -void wiz_lite(player_type *player_ptr, bool ninja) +void wiz_lite(PlayerType *player_ptr, bool ninja) { /* Memorize objects */ for (OBJECT_IDX i = 1; i < player_ptr->current_floor_ptr->o_max; i++) { @@ -129,7 +129,7 @@ void wiz_lite(player_type *player_ptr, bool ninja) /* * Forget the dungeon map (ala "Thinking of Maud..."). */ -void wiz_dark(player_type *player_ptr) +void wiz_dark(PlayerType *player_ptr) { /* Forget every grid */ for (POSITION y = 1; y < player_ptr->current_floor_ptr->height - 1; y++) { @@ -180,7 +180,7 @@ void wiz_dark(player_type *player_ptr) /* * Hack -- map the current panel (plus some) ala "magic mapping" */ -void map_area(player_type *player_ptr, POSITION range) +void map_area(PlayerType *player_ptr, POSITION range) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) range /= 3; @@ -244,7 +244,7 @@ void map_area(player_type *player_ptr, POSITION range) * "earthquake" by using the "full" to select "destruction". * */ -bool destroy_area(player_type *player_ptr, POSITION y1, POSITION x1, POSITION r, bool in_generate) +bool destroy_area(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION r, bool in_generate) { /* Prevent destruction of quest levels and town */ floor_type *floor_ptr = player_ptr->current_floor_ptr; diff --git a/src/spell-kind/spells-floor.h b/src/spell-kind/spells-floor.h index 3ab4eb160..1a65d9ae1 100644 --- a/src/spell-kind/spells-floor.h +++ b/src/spell-kind/spells-floor.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -void wiz_lite(player_type *player_ptr, bool ninja); -void wiz_dark(player_type *player_ptr); -void map_area(player_type *player_ptr, POSITION range); -bool destroy_area(player_type *player_ptr, POSITION y1, POSITION x1, POSITION r, bool in_generate); +class PlayerType; +void wiz_lite(PlayerType *player_ptr, bool ninja); +void wiz_dark(PlayerType *player_ptr); +void map_area(PlayerType *player_ptr, POSITION range); +bool destroy_area(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION r, bool in_generate); diff --git a/src/spell-kind/spells-genocide.cpp b/src/spell-kind/spells-genocide.cpp index d5549117a..8e516c8c8 100644 --- a/src/spell-kind/spells-genocide.cpp +++ b/src/spell-kind/spells-genocide.cpp @@ -39,7 +39,7 @@ * @param spell_name 抹殺効果を起こした魔法の名前 * @return 効力があった場合TRUEを返す */ -bool genocide_aux(player_type *player_ptr, MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name) +bool genocide_aux(PlayerType *player_ptr, MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -118,7 +118,7 @@ bool genocide_aux(player_type *player_ptr, MONSTER_IDX m_idx, int power, bool pl * @param player_cast プレイヤーの魔法によるものならば TRUE * @return 効力があった場合TRUEを返す */ -bool symbol_genocide(player_type *player_ptr, int power, bool player_cast) +bool symbol_genocide(PlayerType *player_ptr, int power, bool player_cast) { floor_type *floor_ptr = player_ptr->current_floor_ptr; bool is_special_floor = floor_ptr->inside_quest && !random_quest_number(player_ptr, floor_ptr->dun_level); @@ -158,7 +158,7 @@ bool symbol_genocide(player_type *player_ptr, int power, bool player_cast) * @param player_cast プレイヤーの魔法によるものならば TRUE * @return 効力があった場合TRUEを返す */ -bool mass_genocide(player_type *player_ptr, int power, bool player_cast) +bool mass_genocide(PlayerType *player_ptr, int power, bool player_cast) { floor_type *floor_ptr = player_ptr->current_floor_ptr; bool is_special_floor = floor_ptr->inside_quest && !random_quest_number(player_ptr, floor_ptr->dun_level); @@ -193,7 +193,7 @@ bool mass_genocide(player_type *player_ptr, int power, bool player_cast) * @param player_cast プレイヤーの魔法によるものならば TRUE * @return 効力があった場合TRUEを返す */ -bool mass_genocide_undead(player_type *player_ptr, int power, bool player_cast) +bool mass_genocide_undead(PlayerType *player_ptr, int power, bool player_cast) { floor_type *floor_ptr = player_ptr->current_floor_ptr; bool is_special_floor = floor_ptr->inside_quest && !random_quest_number(player_ptr, floor_ptr->dun_level); diff --git a/src/spell-kind/spells-genocide.h b/src/spell-kind/spells-genocide.h index 7d13c31ad..744b271ea 100644 --- a/src/spell-kind/spells-genocide.h +++ b/src/spell-kind/spells-genocide.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -bool genocide_aux(player_type *player_ptr, MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name); -bool symbol_genocide(player_type *player_ptr, int power, bool player_cast); -bool mass_genocide(player_type *player_ptr, int power, bool player_cast); -bool mass_genocide_undead(player_type *player_ptr, int power, bool player_cast); +class PlayerType; +bool genocide_aux(PlayerType *player_ptr, MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name); +bool symbol_genocide(PlayerType *player_ptr, int power, bool player_cast); +bool mass_genocide(PlayerType *player_ptr, int power, bool player_cast); +bool mass_genocide_undead(PlayerType *player_ptr, int power, bool player_cast); diff --git a/src/spell-kind/spells-grid.cpp b/src/spell-kind/spells-grid.cpp index ba26c55a9..9b268c99b 100644 --- a/src/spell-kind/spells-grid.cpp +++ b/src/spell-kind/spells-grid.cpp @@ -20,7 +20,7 @@ * Leave a "rune of protection" which prevents monster movement * @return 実際に設置が行われた場合TRUEを返す */ -bool create_rune_protection_one(player_type *player_ptr) +bool create_rune_protection_one(PlayerType *player_ptr) { if (!cave_clean_bold(player_ptr->current_floor_ptr, player_ptr->y, player_ptr->x)) { msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell.")); @@ -42,7 +42,7 @@ bool create_rune_protection_one(player_type *player_ptr) * @param x 設置場所 * @return 実際に設置が行われた場合TRUEを返す */ -bool create_rune_explosion(player_type *player_ptr, POSITION y, POSITION x) +bool create_rune_explosion(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!cave_clean_bold(floor_ptr, y, x)) { @@ -61,7 +61,7 @@ bool create_rune_explosion(player_type *player_ptr, POSITION y, POSITION x) * @brief プレイヤーの手による能動的な階段生成処理 / * Create stairs at or move previously created stairs into the player location. */ -void stair_creation(player_type *player_ptr) +void stair_creation(PlayerType *player_ptr) { bool up = true; if (ironman_downward) diff --git a/src/spell-kind/spells-grid.h b/src/spell-kind/spells-grid.h index 5443b60b9..b3471a330 100644 --- a/src/spell-kind/spells-grid.h +++ b/src/spell-kind/spells-grid.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -bool create_rune_protection_one(player_type *player_ptr); -bool create_rune_explosion(player_type *player_ptr, POSITION y, POSITION x); -void stair_creation(player_type *player_ptr); +class PlayerType; +bool create_rune_protection_one(PlayerType *player_ptr); +bool create_rune_explosion(PlayerType *player_ptr, POSITION y, POSITION x); +void stair_creation(PlayerType *player_ptr); diff --git a/src/spell-kind/spells-launcher.cpp b/src/spell-kind/spells-launcher.cpp index 0da6f70ac..be71fc440 100644 --- a/src/spell-kind/spells-launcher.cpp +++ b/src/spell-kind/spells-launcher.cpp @@ -20,7 +20,7 @@ * Affect grids, objects, and monsters * */ -bool fire_ball(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; if (typ == AttributeType::CHARM_LIVING) @@ -53,7 +53,7 @@ bool fire_ball(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_PO * Affect grids, objects, and monsters * */ -bool fire_breath(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +bool fire_breath(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { return fire_ball(player_ptr, typ, dir, dam, -rad); } @@ -73,7 +73,7 @@ bool fire_breath(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_ * Affect grids, objects, and monsters * */ -bool fire_rocket(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +bool fire_rocket(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { POSITION tx = player_ptr->x + 99 * ddx[dir]; POSITION ty = player_ptr->y + 99 * ddy[dir]; @@ -101,7 +101,7 @@ bool fire_rocket(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_ * Affect grids, objects, and monsters * */ -bool fire_ball_hide(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { POSITION tx = player_ptr->x + 99 * ddx[dir]; POSITION ty = player_ptr->y + 99 * ddy[dir]; @@ -134,7 +134,7 @@ bool fire_ball_hide(player_type *player_ptr, AttributeType typ, DIRECTION dir, H * Option to hurt the player. * */ -bool fire_meteor(player_type *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad) +bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; return project(player_ptr, who, rad, y, x, dam, typ, flg).notice; @@ -151,7 +151,7 @@ bool fire_meteor(player_type *player_ptr, MONSTER_IDX who, AttributeType typ, PO * @param dev 回数分散 * @return 作用が実際にあった場合TRUEを返す */ -bool fire_blast(player_type *player_ptr, AttributeType typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev) +bool fire_blast(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev) { POSITION ty, tx, y, x; POSITION ly, lx; @@ -201,7 +201,7 @@ bool fire_blast(player_type *player_ptr, AttributeType typ, DIRECTION dir, DICE_ * Affect monsters and grids (not objects). * */ -bool fire_bolt(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam) +bool fire_bolt(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID; if (typ != AttributeType::ARROW) @@ -222,7 +222,7 @@ bool fire_bolt(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_PO * Affect monsters, grids and objects. * */ -bool fire_beam(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam) +bool fire_beam(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM; return (project_hook(player_ptr, typ, dir, dam, flg)); @@ -242,7 +242,7 @@ bool fire_beam(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_PO * Affect monsters, grids and objects. * */ -bool fire_bolt_or_beam(player_type *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, HIT_POINT dam) +bool fire_bolt_or_beam(PlayerType *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, HIT_POINT dam) { if (randint0(100) < prob) { return (fire_beam(player_ptr, typ, dir, dam)); @@ -260,7 +260,7 @@ bool fire_bolt_or_beam(player_type *player_ptr, PERCENTAGE prob, AttributeType t * @param flg フラグ * @return 作用が実際にあった場合TRUEを返す */ -bool project_hook(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg) +bool project_hook(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg) { flg |= (PROJECT_THRU); POSITION tx = player_ptr->x + ddx[dir]; diff --git a/src/spell-kind/spells-launcher.h b/src/spell-kind/spells-launcher.h index bf73d3cbb..a488cfa06 100644 --- a/src/spell-kind/spells-launcher.h +++ b/src/spell-kind/spells-launcher.h @@ -3,14 +3,14 @@ #include "system/angband.h" #include "effect/attribute-types.h" -struct player_type; -bool fire_ball(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -bool fire_breath(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -bool fire_rocket(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -bool fire_ball_hide(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -bool fire_meteor(player_type *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION x, POSITION y, HIT_POINT dam, POSITION rad); -bool fire_bolt(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam); -bool fire_blast(player_type *player_ptr, AttributeType typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev); -bool fire_beam(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam); -bool fire_bolt_or_beam(player_type *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, HIT_POINT dam); -bool project_hook(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg); +class PlayerType; +bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); +bool fire_breath(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); +bool fire_rocket(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); +bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); +bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION x, POSITION y, HIT_POINT dam, POSITION rad); +bool fire_bolt(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam); +bool fire_blast(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev); +bool fire_beam(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam); +bool fire_bolt_or_beam(PlayerType *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, HIT_POINT dam); +bool project_hook(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg); diff --git a/src/spell-kind/spells-lite.cpp b/src/spell-kind/spells-lite.cpp index 2f68bfe05..ea70543c8 100644 --- a/src/spell-kind/spells-lite.cpp +++ b/src/spell-kind/spells-lite.cpp @@ -51,7 +51,7 @@ using PassBoldFunc = bool (*)(floor_type *, POSITION, POSITION); * * @todo この辺、xとyが引数になっているが、player_ptr->xとplayer_ptr->yで全て置き換えが効くはず…… */ -static void cave_temp_room_lite(player_type *player_ptr, const std::vector &points) +static void cave_temp_room_lite(PlayerType *player_ptr, const std::vector &points) { for (const auto &point : points) { const POSITION y = point.y; @@ -100,7 +100,7 @@ static void cave_temp_room_lite(player_type *player_ptr, const std::vector * @todo この辺、xとyが引数になっているが、player_ptr->xとplayer_ptr->yで全て置き換えが効くはず…… */ -static void cave_temp_room_unlite(player_type *player_ptr, const std::vector &points) +static void cave_temp_room_unlite(PlayerType *player_ptr, const std::vector &points) { for (const auto &point : points) { const POSITION y = point.y; @@ -209,7 +209,7 @@ static int next_to_walls_adj(floor_type *floor_ptr, const POSITION cy, const POS * @param pass_bold 地形条件を返す関数ポインタ */ static void cave_temp_room_aux( - player_type *player_ptr, std::vector &points, const POSITION y, const POSITION x, const bool only_room, const PassBoldFunc pass_bold) + PlayerType *player_ptr, std::vector &points, const POSITION y, const POSITION x, const bool only_room, const PassBoldFunc pass_bold) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; @@ -252,7 +252,7 @@ static void cave_temp_room_aux( * @param y 指定Y座標 * @param x 指定X座標 */ -static void cave_temp_lite_room_aux(player_type *player_ptr, std::vector &points, const POSITION y, const POSITION x) +static void cave_temp_lite_room_aux(PlayerType *player_ptr, std::vector &points, const POSITION y, const POSITION x) { cave_temp_room_aux(player_ptr, points, y, x, false, cave_los_bold); } @@ -272,7 +272,7 @@ static bool cave_pass_dark_bold(floor_type *floor_ptr, POSITION y, POSITION x) { * @param y 指定Y座標 * @param x 指定X座標 */ -static void cave_temp_unlite_room_aux(player_type *player_ptr, std::vector &points, const POSITION y, const POSITION x) +static void cave_temp_unlite_room_aux(PlayerType *player_ptr, std::vector &points, const POSITION y, const POSITION x) { cave_temp_room_aux(player_ptr, points, y, x, true, cave_pass_dark_bold); } @@ -285,7 +285,7 @@ static void cave_temp_unlite_room_aux(player_type *player_ptr, std::vector points; @@ -329,7 +329,7 @@ void lite_room(player_type *player_ptr, const POSITION y1, const POSITION x1) * @param y1 指定Y座標 * @param x1 指定X座標 */ -void unlite_room(player_type *player_ptr, const POSITION y1, const POSITION x1) +void unlite_room(PlayerType *player_ptr, const POSITION y1, const POSITION x1) { // 暗くするマスを記録する配列。 std::vector points; @@ -368,7 +368,7 @@ void unlite_room(player_type *player_ptr, const POSITION y1, const POSITION x1) * @param magic 魔法による効果であればTRUE、スターライトの杖による効果であればFALSE * @return 常にTRUE */ -bool starlight(player_type *player_ptr, bool magic) +bool starlight(PlayerType *player_ptr, bool magic) { if (!player_ptr->blind && !magic) { msg_print(_("杖の先が明るく輝いた...", "The end of the staff glows brightly...")); @@ -402,7 +402,7 @@ bool starlight(player_type *player_ptr, bool magic) * @param rad 効果半径 * @return 作用が実際にあった場合TRUEを返す */ -bool lite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad) +bool lite_area(PlayerType *player_ptr, HIT_POINT dam, POSITION rad) { if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) { msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorbs your light.")); @@ -428,7 +428,7 @@ bool lite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad) * @param rad 効果半径 * @return 作用が実際にあった場合TRUEを返す */ -bool unlite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad) +bool unlite_area(PlayerType *player_ptr, HIT_POINT dam, POSITION rad) { if (!player_ptr->blind) { msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you.")); @@ -449,7 +449,7 @@ bool unlite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad) * @param dam 威力 * @return 作用が実際にあった場合TRUEを返す */ -bool lite_line(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) +bool lite_line(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL; return (project_hook(player_ptr, AttributeType::LITE_WEAK, dir, dam, flg)); diff --git a/src/spell-kind/spells-lite.h b/src/spell-kind/spells-lite.h index 09fdcc4c0..6748f63be 100644 --- a/src/spell-kind/spells-lite.h +++ b/src/spell-kind/spells-lite.h @@ -2,10 +2,10 @@ #include "system/angband.h" -struct player_type; -void lite_room(player_type *player_ptr, POSITION y1, POSITION x1); -bool starlight(player_type *player_ptr, bool magic); -void unlite_room(player_type *player_ptr, POSITION y1, POSITION x1); -bool lite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad); -bool unlite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad); -bool lite_line(player_type *player_ptr, DIRECTION dir, HIT_POINT dam); +class PlayerType; +void lite_room(PlayerType *player_ptr, POSITION y1, POSITION x1); +bool starlight(PlayerType *player_ptr, bool magic); +void unlite_room(PlayerType *player_ptr, POSITION y1, POSITION x1); +bool lite_area(PlayerType *player_ptr, HIT_POINT dam, POSITION rad); +bool unlite_area(PlayerType *player_ptr, HIT_POINT dam, POSITION rad); +bool lite_line(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam); diff --git a/src/spell-kind/spells-neighbor.cpp b/src/spell-kind/spells-neighbor.cpp index 424df60b7..1a812491a 100644 --- a/src/spell-kind/spells-neighbor.cpp +++ b/src/spell-kind/spells-neighbor.cpp @@ -17,7 +17,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 作用が実際にあった場合TRUEを返す */ -bool door_creation(player_type *player_ptr, POSITION y, POSITION x) +bool door_creation(PlayerType *player_ptr, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; return project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_DOOR, flg).notice; @@ -30,7 +30,7 @@ bool door_creation(player_type *player_ptr, POSITION y, POSITION x) * @param x 起点X座標 * @return 作用が実際にあった場合TRUEを返す */ -bool trap_creation(player_type *player_ptr, POSITION y, POSITION x) +bool trap_creation(PlayerType *player_ptr, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; return project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_TRAP, flg).notice; @@ -41,7 +41,7 @@ bool trap_creation(player_type *player_ptr, POSITION y, POSITION x) * @param player_ptr プレイヤーへの参照ポインタ * @return 作用が実際にあった場合TRUEを返す */ -bool tree_creation(player_type *player_ptr, POSITION y, POSITION x) +bool tree_creation(PlayerType *player_ptr, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; return project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_TREE, flg).notice; @@ -52,7 +52,7 @@ bool tree_creation(player_type *player_ptr, POSITION y, POSITION x) * @param player_ptr プレイヤーへの参照ポインタ * @return 作用が実際にあった場合TRUEを返す */ -bool create_rune_protection_area(player_type *player_ptr, POSITION y, POSITION x) +bool create_rune_protection_area(PlayerType *player_ptr, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM; return project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_RUNE_PROTECTION, flg).notice; @@ -63,7 +63,7 @@ bool create_rune_protection_area(player_type *player_ptr, POSITION y, POSITION x * @param player_ptr プレイヤーへの参照ポインタ * @return 作用が実際にあった場合TRUEを返す */ -bool wall_stone(player_type *player_ptr) +bool wall_stone(PlayerType *player_ptr) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; bool dummy = project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, AttributeType::STONE_WALL, flg).notice; @@ -77,7 +77,7 @@ bool wall_stone(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 作用が実際にあった場合TRUEを返す */ -bool destroy_doors_touch(player_type *player_ptr) +bool destroy_doors_touch(PlayerType *player_ptr) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, AttributeType::KILL_DOOR, flg).notice; @@ -88,7 +88,7 @@ bool destroy_doors_touch(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 作用が実際にあった場合TRUEを返す */ -bool disarm_traps_touch(player_type *player_ptr) +bool disarm_traps_touch(PlayerType *player_ptr) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, AttributeType::KILL_TRAP, flg).notice; @@ -99,7 +99,7 @@ bool disarm_traps_touch(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 作用が実際にあった場合TRUEを返す */ -bool sleep_monsters_touch(player_type *player_ptr) +bool sleep_monsters_touch(PlayerType *player_ptr) { BIT_FLAGS flg = PROJECT_KILL | PROJECT_HIDE; return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, player_ptr->lev, AttributeType::OLD_SLEEP, flg).notice; @@ -113,7 +113,7 @@ bool sleep_monsters_touch(player_type *player_ptr) * @param x 起点X座標 * @return 作用が実際にあった場合TRUEを返す */ -bool animate_dead(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x) +bool animate_dead(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE; return project(player_ptr, who, 5, y, x, 0, AttributeType::ANIM_DEAD, flg).notice; @@ -123,7 +123,7 @@ bool animate_dead(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION * @brief 周辺破壊効果(プレイヤー中心) * @param player_ptr プレイヤーへの参照ポインタ */ -void wall_breaker(player_type *player_ptr) +void wall_breaker(PlayerType *player_ptr) { POSITION y = 0, x = 0; int attempts = 1000; diff --git a/src/spell-kind/spells-neighbor.h b/src/spell-kind/spells-neighbor.h index 7ab5a1436..4db70ac84 100644 --- a/src/spell-kind/spells-neighbor.h +++ b/src/spell-kind/spells-neighbor.h @@ -2,14 +2,14 @@ #include "system/angband.h" -struct player_type; -bool door_creation(player_type *player_ptr, POSITION y, POSITION x); -bool trap_creation(player_type *player_ptr, POSITION y, POSITION x); -bool tree_creation(player_type *player_ptr, POSITION y, POSITION x); -bool create_rune_protection_area(player_type *player_ptr, POSITION y, POSITION x); -bool wall_stone(player_type *player_ptr); -bool destroy_doors_touch(player_type *player_ptr); -bool disarm_traps_touch(player_type *player_ptr); -bool sleep_monsters_touch(player_type *player_ptr); -bool animate_dead(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x); -void wall_breaker(player_type *player_ptr); +class PlayerType; +bool door_creation(PlayerType *player_ptr, POSITION y, POSITION x); +bool trap_creation(PlayerType *player_ptr, POSITION y, POSITION x); +bool tree_creation(PlayerType *player_ptr, POSITION y, POSITION x); +bool create_rune_protection_area(PlayerType *player_ptr, POSITION y, POSITION x); +bool wall_stone(PlayerType *player_ptr); +bool destroy_doors_touch(PlayerType *player_ptr); +bool disarm_traps_touch(PlayerType *player_ptr); +bool sleep_monsters_touch(PlayerType *player_ptr); +bool animate_dead(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x); +void wall_breaker(PlayerType *player_ptr); diff --git a/src/spell-kind/spells-perception.cpp b/src/spell-kind/spells-perception.cpp index 43f08a7bc..f15ae3398 100644 --- a/src/spell-kind/spells-perception.cpp +++ b/src/spell-kind/spells-perception.cpp @@ -36,7 +36,7 @@ * Done by a potion of "self knowledge". * @param player_ptr プレイヤーへの参照ポインタ */ -void identify_pack(player_type *player_ptr) +void identify_pack(PlayerType *player_ptr) { for (INVENTORY_IDX i = 0; i < INVEN_TOTAL; i++) { object_type *o_ptr = &player_ptr->inventory_list[i]; @@ -55,7 +55,7 @@ void identify_pack(player_type *player_ptr) * @param o_ptr 鑑定されるアイテムの情報参照ポインタ * @return 実際に鑑定できたらTRUEを返す */ -bool identify_item(player_type *player_ptr, object_type *o_ptr) +bool identify_item(PlayerType *player_ptr, object_type *o_ptr) { GAME_TEXT o_name[MAX_NLEN]; describe_flavor(player_ptr, o_name, o_ptr, 0); @@ -99,7 +99,7 @@ bool identify_item(player_type *player_ptr, object_type *o_ptr) * This routine does *not* automatically combine objects. * Returns TRUE if something was identified, else FALSE. */ -bool ident_spell(player_type *player_ptr, bool only_equip) +bool ident_spell(PlayerType *player_ptr, bool only_equip) { std::unique_ptr item_tester = std::make_unique(only_equip ? object_is_not_identified_weapon_armor : object_is_not_identified); @@ -148,7 +148,7 @@ bool ident_spell(player_type *player_ptr, bool only_equip) * Fully "identify" an object in the inventory -BEN- * This routine returns TRUE if an item was identified. */ -bool identify_fully(player_type *player_ptr, bool only_equip) +bool identify_fully(PlayerType *player_ptr, bool only_equip) { std::unique_ptr item_tester = std::make_unique(only_equip ? object_is_not_fully_identified_weapon_armour : object_is_not_fully_identified); diff --git a/src/spell-kind/spells-perception.h b/src/spell-kind/spells-perception.h index 211f67856..88c7ba9a9 100644 --- a/src/spell-kind/spells-perception.h +++ b/src/spell-kind/spells-perception.h @@ -3,8 +3,8 @@ #include "system/angband.h" struct object_type; -struct player_type; -void identify_pack(player_type *player_ptr); -bool identify_item(player_type *player_ptr, object_type *o_ptr); -bool ident_spell(player_type *player_ptr, bool only_equip); -bool identify_fully(player_type *player_ptr, bool only_equip); +class PlayerType; +void identify_pack(PlayerType *player_ptr); +bool identify_item(PlayerType *player_ptr, object_type *o_ptr); +bool ident_spell(PlayerType *player_ptr, bool only_equip); +bool identify_fully(PlayerType *player_ptr, bool only_equip); diff --git a/src/spell-kind/spells-pet.cpp b/src/spell-kind/spells-pet.cpp index ced1209f8..29d32298c 100644 --- a/src/spell-kind/spells-pet.cpp +++ b/src/spell-kind/spells-pet.cpp @@ -21,7 +21,7 @@ /*! * @brief ペット爆破処理 / */ -void discharge_minion(player_type *player_ptr) +void discharge_minion(PlayerType *player_ptr) { bool okay = true; for (MONSTER_IDX i = 1; i < player_ptr->current_floor_ptr->m_max; i++) { diff --git a/src/spell-kind/spells-pet.h b/src/spell-kind/spells-pet.h index d3be69d2d..4c3cfc66e 100644 --- a/src/spell-kind/spells-pet.h +++ b/src/spell-kind/spells-pet.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void discharge_minion(player_type *player_ptr); +class PlayerType; +void discharge_minion(PlayerType *player_ptr); diff --git a/src/spell-kind/spells-polymorph.cpp b/src/spell-kind/spells-polymorph.cpp index 9e117c4be..dd7cdd44c 100644 --- a/src/spell-kind/spells-polymorph.cpp +++ b/src/spell-kind/spells-polymorph.cpp @@ -28,7 +28,7 @@ * @details * Note that this function is one of the more "dangerous" ones... */ -static MONRACE_IDX poly_r_idx(player_type *player_ptr, MONRACE_IDX r_idx) +static MONRACE_IDX poly_r_idx(PlayerType *player_ptr, MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags1 & RF1_QUESTOR)) @@ -63,7 +63,7 @@ static MONRACE_IDX poly_r_idx(player_type *player_ptr, MONRACE_IDX r_idx) * @param x 指定のX座標 * @return 実際に変身したらTRUEを返す */ -bool polymorph_monster(player_type *player_ptr, POSITION y, POSITION x) +bool polymorph_monster(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; diff --git a/src/spell-kind/spells-polymorph.h b/src/spell-kind/spells-polymorph.h index e4e047de5..0d457bac3 100644 --- a/src/spell-kind/spells-polymorph.h +++ b/src/spell-kind/spells-polymorph.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool polymorph_monster(player_type *player_ptr, POSITION y, POSITION x); +class PlayerType; +bool polymorph_monster(PlayerType *player_ptr, POSITION y, POSITION x); diff --git a/src/spell-kind/spells-random.cpp b/src/spell-kind/spells-random.cpp index 522e34282..466681a38 100644 --- a/src/spell-kind/spells-random.cpp +++ b/src/spell-kind/spells-random.cpp @@ -40,7 +40,7 @@ * @brief 混沌招来処理 * @return 作用が実際にあった場合TRUEを返す */ -void call_chaos(player_type *player_ptr) +void call_chaos(PlayerType *player_ptr) { AttributeType hurt_types[31] = { AttributeType::ELEC, AttributeType::POIS, AttributeType::ACID, AttributeType::COLD, AttributeType::FIRE, AttributeType::MISSILE, AttributeType::ARROW, AttributeType::PLASMA, AttributeType::HOLY_FIRE, AttributeType::WATER, AttributeType::LITE, @@ -93,7 +93,7 @@ void call_chaos(player_type *player_ptr) * or the player gets paralyzed. * */ -bool activate_ty_curse(player_type *player_ptr, bool stop_ty, int *count) +bool activate_ty_curse(PlayerType *player_ptr, bool stop_ty, int *count) { BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP); bool is_first_curse = true; @@ -236,7 +236,7 @@ bool activate_ty_curse(player_type *player_ptr, bool stop_ty, int *count) * @param player_ptr プレイヤーへの参照ポインタ * @param spell ランダムな効果を選択するための基準ID */ -void wild_magic(player_type *player_ptr, int spell) +void wild_magic(PlayerType *player_ptr, int spell) { int type = SUMMON_MOLD + randint0(6); if (type < SUMMON_MOLD) @@ -347,7 +347,7 @@ void wild_magic(player_type *player_ptr, int spell) * while keeping the results quite random. It also allows some potent\n * effects only at high level. */ -void cast_wonder(player_type *player_ptr, DIRECTION dir) +void cast_wonder(PlayerType *player_ptr, DIRECTION dir) { PLAYER_LEVEL plev = player_ptr->lev; int die = randint1(100) + plev / 5; diff --git a/src/spell-kind/spells-random.h b/src/spell-kind/spells-random.h index 3df73e21d..fc23170f4 100644 --- a/src/spell-kind/spells-random.h +++ b/src/spell-kind/spells-random.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -void wild_magic(player_type *player_ptr, int spell); -void call_chaos(player_type *player_ptr); -bool activate_ty_curse(player_type *player_ptr, bool stop_ty, int *count); -void cast_wonder(player_type *player_ptr, DIRECTION dir); +class PlayerType; +void wild_magic(PlayerType *player_ptr, int spell); +void call_chaos(PlayerType *player_ptr); +bool activate_ty_curse(PlayerType *player_ptr, bool stop_ty, int *count); +void cast_wonder(PlayerType *player_ptr, DIRECTION dir); diff --git a/src/spell-kind/spells-sight.cpp b/src/spell-kind/spells-sight.cpp index 39bdd19ed..f6dc64041 100644 --- a/src/spell-kind/spells-sight.cpp +++ b/src/spell-kind/spells-sight.cpp @@ -44,7 +44,7 @@ * this is done in two passes. -- JDL * */ -bool project_all_los(player_type *player_ptr, AttributeType typ, HIT_POINT dam) +bool project_all_los(PlayerType *player_ptr, AttributeType typ, HIT_POINT dam) { for (MONSTER_IDX i = 1; i < player_ptr->current_floor_ptr->m_max; i++) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[i]; @@ -82,7 +82,7 @@ bool project_all_los(player_type *player_ptr, AttributeType typ, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool speed_monsters(player_type *player_ptr) +bool speed_monsters(PlayerType *player_ptr) { return (project_all_los(player_ptr, AttributeType::OLD_SPEED, player_ptr->lev)); } @@ -92,7 +92,7 @@ bool speed_monsters(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool slow_monsters(player_type *player_ptr, int power) +bool slow_monsters(PlayerType *player_ptr, int power) { return (project_all_los(player_ptr, AttributeType::OLD_SLOW, power)); } @@ -102,7 +102,7 @@ bool slow_monsters(player_type *player_ptr, int power) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool sleep_monsters(player_type *player_ptr, int power) +bool sleep_monsters(PlayerType *player_ptr, int power) { return (project_all_los(player_ptr, AttributeType::OLD_SLEEP, power)); } @@ -112,7 +112,7 @@ bool sleep_monsters(player_type *player_ptr, int power) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool banish_evil(player_type *player_ptr, int dist) +bool banish_evil(PlayerType *player_ptr, int dist) { return (project_all_los(player_ptr, AttributeType::AWAY_EVIL, dist)); } @@ -121,7 +121,7 @@ bool banish_evil(player_type *player_ptr, int dist) * @brief 視界内のアンデッド・モンスターを恐怖させる処理 / Turn undead * @return 効力があった場合TRUEを返す */ -bool turn_undead(player_type *player_ptr) +bool turn_undead(PlayerType *player_ptr) { bool tester = (project_all_los(player_ptr, AttributeType::TURN_UNDEAD, player_ptr->lev)); if (tester) @@ -134,7 +134,7 @@ bool turn_undead(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool dispel_undead(player_type *player_ptr, HIT_POINT dam) +bool dispel_undead(PlayerType *player_ptr, HIT_POINT dam) { bool tester = (project_all_los(player_ptr, AttributeType::DISP_UNDEAD, dam)); if (tester) @@ -147,7 +147,7 @@ bool dispel_undead(player_type *player_ptr, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool dispel_evil(player_type *player_ptr, HIT_POINT dam) +bool dispel_evil(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::DISP_EVIL, dam)); } @@ -157,7 +157,7 @@ bool dispel_evil(player_type *player_ptr, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool dispel_good(player_type *player_ptr, HIT_POINT dam) +bool dispel_good(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::DISP_GOOD, dam)); } @@ -167,7 +167,7 @@ bool dispel_good(player_type *player_ptr, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool dispel_monsters(player_type *player_ptr, HIT_POINT dam) +bool dispel_monsters(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::DISP_ALL, dam)); } @@ -177,7 +177,7 @@ bool dispel_monsters(player_type *player_ptr, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool dispel_living(player_type *player_ptr, HIT_POINT dam) +bool dispel_living(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::DISP_LIVING, dam)); } @@ -187,7 +187,7 @@ bool dispel_living(player_type *player_ptr, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool dispel_demons(player_type *player_ptr, HIT_POINT dam) +bool dispel_demons(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::DISP_DEMON, dam)); } @@ -197,7 +197,7 @@ bool dispel_demons(player_type *player_ptr, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 効力があった場合TRUEを返す */ -bool crusade(player_type *player_ptr) +bool crusade(PlayerType *player_ptr) { return (project_all_los(player_ptr, AttributeType::CRUSADE, player_ptr->lev * 4)); } @@ -207,7 +207,7 @@ bool crusade(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param who 怒らせる原因を起こしたモンスター(0ならばプレイヤー) */ -void aggravate_monsters(player_type *player_ptr, MONSTER_IDX who) +void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX who) { bool sleep = false; bool speed = false; @@ -250,7 +250,7 @@ void aggravate_monsters(player_type *player_ptr, MONSTER_IDX who) * @param dam 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool confuse_monsters(player_type *player_ptr, HIT_POINT dam) +bool confuse_monsters(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::OLD_CONF, dam)); } @@ -261,7 +261,7 @@ bool confuse_monsters(player_type *player_ptr, HIT_POINT dam) * @param dam 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool charm_monsters(player_type *player_ptr, HIT_POINT dam) +bool charm_monsters(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::CHARM, dam)); } @@ -272,7 +272,7 @@ bool charm_monsters(player_type *player_ptr, HIT_POINT dam) * @param dam 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool charm_animals(player_type *player_ptr, HIT_POINT dam) +bool charm_animals(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::CONTROL_ANIMAL, dam)); } @@ -283,7 +283,7 @@ bool charm_animals(player_type *player_ptr, HIT_POINT dam) * @param dam 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool stun_monsters(player_type *player_ptr, HIT_POINT dam) +bool stun_monsters(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::STUN, dam)); } @@ -294,7 +294,7 @@ bool stun_monsters(player_type *player_ptr, HIT_POINT dam) * @param dam 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool stasis_monsters(player_type *player_ptr, HIT_POINT dam) +bool stasis_monsters(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::STASIS, dam)); } @@ -305,7 +305,7 @@ bool stasis_monsters(player_type *player_ptr, HIT_POINT dam) * @param dam 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool mindblast_monsters(player_type *player_ptr, HIT_POINT dam) +bool mindblast_monsters(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::PSI, dam)); } @@ -316,7 +316,7 @@ bool mindblast_monsters(player_type *player_ptr, HIT_POINT dam) * @param dist 効力(距離) * @return 作用が実際にあった場合TRUEを返す */ -bool banish_monsters(player_type *player_ptr, int dist) +bool banish_monsters(PlayerType *player_ptr, int dist) { return (project_all_los(player_ptr, AttributeType::AWAY_ALL, dist)); } @@ -327,7 +327,7 @@ bool banish_monsters(player_type *player_ptr, int dist) * @param dam 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool turn_evil(player_type *player_ptr, HIT_POINT dam) +bool turn_evil(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::TURN_EVIL, dam)); } @@ -338,7 +338,7 @@ bool turn_evil(player_type *player_ptr, HIT_POINT dam) * @param dam 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool turn_monsters(player_type *player_ptr, HIT_POINT dam) +bool turn_monsters(PlayerType *player_ptr, HIT_POINT dam) { return (project_all_los(player_ptr, AttributeType::TURN_ALL, dam)); } @@ -348,7 +348,7 @@ bool turn_monsters(player_type *player_ptr, HIT_POINT dam) * @param player_ptr プレイヤーへの参照ポインタ * @return 作用が実際にあった場合TRUEを返す */ -bool deathray_monsters(player_type *player_ptr) +bool deathray_monsters(PlayerType *player_ptr) { return (project_all_los(player_ptr, AttributeType::DEATH_RAY, player_ptr->lev * 200)); } @@ -359,7 +359,7 @@ bool deathray_monsters(player_type *player_ptr) * @param m_ptr モンスター情報への参照ポインタ * @param r_ptr モンスター種族への参照ポインタ */ -void probed_monster_info(char *buf, player_type *player_ptr, monster_type *m_ptr, monster_race *r_ptr) +void probed_monster_info(char *buf, PlayerType *player_ptr, monster_type *m_ptr, monster_race *r_ptr) { if (!is_original_ap(m_ptr)) { if (m_ptr->mflag2.has(MonsterConstantFlagType::KAGE)) @@ -422,7 +422,7 @@ void probed_monster_info(char *buf, player_type *player_ptr, monster_type *m_ptr * @brief 周辺モンスターを調査する / Probe nearby monsters * @return 効力があった場合TRUEを返す */ -bool probing(player_type *player_ptr) +bool probing(PlayerType *player_ptr) { bool cu = Term->scr->cu; bool cv = Term->scr->cv; diff --git a/src/spell-kind/spells-sight.h b/src/spell-kind/spells-sight.h index 5f55e0576..2415f9528 100644 --- a/src/spell-kind/spells-sight.h +++ b/src/spell-kind/spells-sight.h @@ -5,30 +5,30 @@ struct monster_race; struct monster_type; -struct player_type; -bool project_all_los(player_type *player_ptr, AttributeType typ, HIT_POINT dam); -bool speed_monsters(player_type *player_ptr); -bool slow_monsters(player_type *player_ptr, int power); -bool sleep_monsters(player_type *player_ptr, int power); -void aggravate_monsters(player_type *player_ptr, MONSTER_IDX who); -bool banish_evil(player_type *player_ptr, int dist); -bool turn_undead(player_type *player_ptr); -bool dispel_evil(player_type *player_ptr, HIT_POINT dam); -bool dispel_good(player_type *player_ptr, HIT_POINT dam); -bool dispel_undead(player_type *player_ptr, HIT_POINT dam); -bool dispel_monsters(player_type *player_ptr, HIT_POINT dam); -bool dispel_living(player_type *player_ptr, HIT_POINT dam); -bool dispel_demons(player_type *player_ptr, HIT_POINT dam); -bool crusade(player_type *player_ptr); -bool confuse_monsters(player_type *player_ptr, HIT_POINT dam); -bool charm_monsters(player_type *player_ptr, HIT_POINT dam); -bool charm_animals(player_type *player_ptr, HIT_POINT dam); -bool stun_monsters(player_type *player_ptr, HIT_POINT dam); -bool stasis_monsters(player_type *player_ptr, HIT_POINT dam); -bool mindblast_monsters(player_type *player_ptr, HIT_POINT dam); -bool banish_monsters(player_type *player_ptr, int dist); -bool turn_evil(player_type *player_ptr, HIT_POINT dam); -bool turn_monsters(player_type *player_ptr, HIT_POINT dam); -bool deathray_monsters(player_type *player_ptr); -void probed_monster_info(char *buf, player_type *player_ptr, monster_type *m_ptr, monster_race *r_ptr); -bool probing(player_type *player_ptr); +class PlayerType; +bool project_all_los(PlayerType *player_ptr, AttributeType typ, HIT_POINT dam); +bool speed_monsters(PlayerType *player_ptr); +bool slow_monsters(PlayerType *player_ptr, int power); +bool sleep_monsters(PlayerType *player_ptr, int power); +void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX who); +bool banish_evil(PlayerType *player_ptr, int dist); +bool turn_undead(PlayerType *player_ptr); +bool dispel_evil(PlayerType *player_ptr, HIT_POINT dam); +bool dispel_good(PlayerType *player_ptr, HIT_POINT dam); +bool dispel_undead(PlayerType *player_ptr, HIT_POINT dam); +bool dispel_monsters(PlayerType *player_ptr, HIT_POINT dam); +bool dispel_living(PlayerType *player_ptr, HIT_POINT dam); +bool dispel_demons(PlayerType *player_ptr, HIT_POINT dam); +bool crusade(PlayerType *player_ptr); +bool confuse_monsters(PlayerType *player_ptr, HIT_POINT dam); +bool charm_monsters(PlayerType *player_ptr, HIT_POINT dam); +bool charm_animals(PlayerType *player_ptr, HIT_POINT dam); +bool stun_monsters(PlayerType *player_ptr, HIT_POINT dam); +bool stasis_monsters(PlayerType *player_ptr, HIT_POINT dam); +bool mindblast_monsters(PlayerType *player_ptr, HIT_POINT dam); +bool banish_monsters(PlayerType *player_ptr, int dist); +bool turn_evil(PlayerType *player_ptr, HIT_POINT dam); +bool turn_monsters(PlayerType *player_ptr, HIT_POINT dam); +bool deathray_monsters(PlayerType *player_ptr); +void probed_monster_info(char *buf, PlayerType *player_ptr, monster_type *m_ptr, monster_race *r_ptr); +bool probing(PlayerType *player_ptr); diff --git a/src/spell-kind/spells-specific-bolt.cpp b/src/spell-kind/spells-specific-bolt.cpp index 8bcc89b57..0bda0c4ba 100644 --- a/src/spell-kind/spells-specific-bolt.cpp +++ b/src/spell-kind/spells-specific-bolt.cpp @@ -11,7 +11,7 @@ * @param dam 威力 * @return 作用が実際にあった場合TRUEを返す */ -bool hypodynamic_bolt(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) +bool hypodynamic_bolt(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::HYPODYNAMIA, dir, dam, flg)); @@ -24,7 +24,7 @@ bool hypodynamic_bolt(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) * @param plev プレイヤーレベル(効力はplev*200) * @return 作用が実際にあった場合TRUEを返す */ -bool death_ray(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) +bool death_ray(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::DEATH_RAY, dir, plev * 200, flg)); diff --git a/src/spell-kind/spells-specific-bolt.h b/src/spell-kind/spells-specific-bolt.h index f55756b9c..11bcf6914 100644 --- a/src/spell-kind/spells-specific-bolt.h +++ b/src/spell-kind/spells-specific-bolt.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -bool hypodynamic_bolt(player_type *player_ptr, DIRECTION dir, HIT_POINT dam); -bool death_ray(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); +class PlayerType; +bool hypodynamic_bolt(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam); +bool death_ray(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); diff --git a/src/spell-kind/spells-teleport.cpp b/src/spell-kind/spells-teleport.cpp index 1ac6ddf76..73e925941 100644 --- a/src/spell-kind/spells-teleport.cpp +++ b/src/spell-kind/spells-teleport.cpp @@ -51,7 +51,7 @@ * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする) * @return 作用が実際にあった場合TRUEを返す */ -bool teleport_swap(player_type *player_ptr, DIRECTION dir) +bool teleport_swap(PlayerType *player_ptr, DIRECTION dir) { POSITION tx, ty; if ((dir == 5) && target_okay(player_ptr)) { @@ -105,7 +105,7 @@ bool teleport_swap(player_type *player_ptr, DIRECTION dir) * @param distance 移動距離 * @return 作用が実際にあった場合TRUEを返す */ -bool teleport_monster(player_type *player_ptr, DIRECTION dir, int distance) +bool teleport_monster(PlayerType *player_ptr, DIRECTION dir, int distance) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL; return (project_hook(player_ptr, AttributeType::AWAY_ALL, dir, distance, flg)); @@ -123,7 +123,7 @@ bool teleport_monster(player_type *player_ptr, DIRECTION dir, int distance) * Attempt to move the monster at least "dis/2" grids away. * But allow variation to prevent infinite loops. */ -bool teleport_away(player_type *player_ptr, MONSTER_IDX m_idx, POSITION dis, teleport_flags mode) +bool teleport_away(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION dis, teleport_flags mode) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; if (!monster_is_valid(m_ptr)) @@ -200,7 +200,7 @@ bool teleport_away(player_type *player_ptr, MONSTER_IDX m_idx, POSITION dis, tel * @param power テレポート成功確率 * @param mode オプション */ -void teleport_monster_to(player_type *player_ptr, MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, teleport_flags mode) +void teleport_monster_to(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, teleport_flags mode) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; if (!m_ptr->r_idx) @@ -285,7 +285,7 @@ void teleport_monster_to(player_type *player_ptr, MONSTER_IDX m_idx, POSITION ty * of candidates has equal possibility to be choosen as a destination. * */ -bool teleport_player_aux(player_type *player_ptr, POSITION dis, bool is_quantum_effect, teleport_flags mode) +bool teleport_player_aux(PlayerType *player_ptr, POSITION dis, bool is_quantum_effect, teleport_flags mode) { if (player_ptr->wild_mode) return false; @@ -373,7 +373,7 @@ bool teleport_player_aux(player_type *player_ptr, POSITION dis, bool is_quantum_ * @param dis 基本移動距離 * @param mode オプション */ -void teleport_player(player_type *player_ptr, POSITION dis, BIT_FLAGS mode) +void teleport_player(PlayerType *player_ptr, POSITION dis, BIT_FLAGS mode) { const POSITION oy = player_ptr->y; const POSITION ox = player_ptr->x; @@ -407,7 +407,7 @@ void teleport_player(player_type *player_ptr, POSITION dis, BIT_FLAGS mode) * @param dis テレポート距離 * @param is_quantum_effect 量子的効果によるテレポートアウェイならばTRUE */ -void teleport_player_away(MONSTER_IDX m_idx, player_type *player_ptr, POSITION dis, bool is_quantum_effect) +void teleport_player_away(MONSTER_IDX m_idx, PlayerType *player_ptr, POSITION dis, bool is_quantum_effect) { if (player_ptr->phase_out) return; @@ -455,7 +455,7 @@ void teleport_player_away(MONSTER_IDX m_idx, player_type *player_ptr, POSITION d * This function allows teleporting into vaults (!) * */ -void teleport_player_to(player_type *player_ptr, POSITION ny, POSITION nx, teleport_flags mode) +void teleport_player_to(PlayerType *player_ptr, POSITION ny, POSITION nx, teleport_flags mode) { if (player_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL)) { msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!")); @@ -493,7 +493,7 @@ void teleport_player_to(player_type *player_ptr, POSITION ny, POSITION nx, telep (void)move_player_effect(player_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP); } -void teleport_away_followable(player_type *player_ptr, MONSTER_IDX m_idx) +void teleport_away_followable(PlayerType *player_ptr, MONSTER_IDX m_idx) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; POSITION oldfy = m_ptr->fy; @@ -553,7 +553,7 @@ void teleport_away_followable(player_type *player_ptr, MONSTER_IDX m_idx) * @param y テレポート先のY座標 * @return 目標に指定通りテレポートできたならばTRUEを返す */ -bool exe_dimension_door(player_type *player_ptr, POSITION x, POSITION y) +bool exe_dimension_door(PlayerType *player_ptr, POSITION x, POSITION y) { PLAYER_LEVEL plev = player_ptr->lev; @@ -576,7 +576,7 @@ bool exe_dimension_door(player_type *player_ptr, POSITION x, POSITION y) * Dimension Door * @return ターンを消費した場合TRUEを返す */ -bool dimension_door(player_type *player_ptr) +bool dimension_door(PlayerType *player_ptr) { DEPTH x = 0, y = 0; if (!tgt_pt(player_ptr, &x, &y)) diff --git a/src/spell-kind/spells-teleport.h b/src/spell-kind/spells-teleport.h index c226ecf64..7cee38c6b 100644 --- a/src/spell-kind/spells-teleport.h +++ b/src/spell-kind/spells-teleport.h @@ -3,15 +3,15 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -bool teleport_monster(player_type *player_ptr, DIRECTION dir, int distance); -bool teleport_swap(player_type *player_ptr, DIRECTION dir); -bool teleport_away(player_type *player_ptr, MONSTER_IDX m_idx, POSITION dis, teleport_flags mode); -void teleport_monster_to(player_type *player_ptr, MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, teleport_flags mode); -bool teleport_player_aux(player_type *player_ptr, POSITION dis, bool is_quantum_effect, teleport_flags mode); -void teleport_player(player_type *player_ptr, POSITION dis, BIT_FLAGS mode); -void teleport_player_away(MONSTER_IDX m_idx, player_type *player_ptr, POSITION dis, bool is_quantum_effect); -void teleport_player_to(player_type *player_ptr, POSITION ny, POSITION nx, teleport_flags mode); -void teleport_away_followable(player_type *player_ptr, MONSTER_IDX m_idx); -bool dimension_door(player_type *player_ptr); -bool exe_dimension_door(player_type *player_ptr, POSITION x, POSITION y); +class PlayerType; +bool teleport_monster(PlayerType *player_ptr, DIRECTION dir, int distance); +bool teleport_swap(PlayerType *player_ptr, DIRECTION dir); +bool teleport_away(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION dis, teleport_flags mode); +void teleport_monster_to(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, teleport_flags mode); +bool teleport_player_aux(PlayerType *player_ptr, POSITION dis, bool is_quantum_effect, teleport_flags mode); +void teleport_player(PlayerType *player_ptr, POSITION dis, BIT_FLAGS mode); +void teleport_player_away(MONSTER_IDX m_idx, PlayerType *player_ptr, POSITION dis, bool is_quantum_effect); +void teleport_player_to(PlayerType *player_ptr, POSITION ny, POSITION nx, teleport_flags mode); +void teleport_away_followable(PlayerType *player_ptr, MONSTER_IDX m_idx); +bool dimension_door(PlayerType *player_ptr); +bool exe_dimension_door(PlayerType *player_ptr, POSITION x, POSITION y); diff --git a/src/spell-kind/spells-world.cpp b/src/spell-kind/spells-world.cpp index 435a57587..dc985293c 100644 --- a/src/spell-kind/spells-world.cpp +++ b/src/spell-kind/spells-world.cpp @@ -47,7 +47,7 @@ * @param idx テレポート・レベル対象のモンスター * @todo 変数名が実態と合っているかどうかは要確認 */ -bool is_teleport_level_ineffective(player_type *player_ptr, MONSTER_IDX idx) +bool is_teleport_level_ineffective(PlayerType *player_ptr, MONSTER_IDX idx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; bool is_special_floor @@ -66,7 +66,7 @@ bool is_teleport_level_ineffective(player_type *player_ptr, MONSTER_IDX idx) * @param m_idx テレポートの対象となるモンスターID(0ならばプレイヤー) / If m_idx <= 0, target is player. * @todo cmd-save.h への依存あり。コールバックで何とかしたい */ -void teleport_level(player_type *player_ptr, MONSTER_IDX m_idx) +void teleport_level(PlayerType *player_ptr, MONSTER_IDX m_idx) { GAME_TEXT m_name[160]; bool see_m = true; @@ -213,7 +213,7 @@ void teleport_level(player_type *player_ptr, MONSTER_IDX m_idx) sound(SOUND_TPLEVEL); } -bool teleport_level_other(player_type *player_ptr) +bool teleport_level_other(PlayerType *player_ptr) { if (!target_set(player_ptr, TARGET_KILL)) return false; @@ -248,7 +248,7 @@ bool teleport_level_other(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return テレポート処理を決定したか否か */ -bool tele_town(player_type *player_ptr) +bool tele_town(PlayerType *player_ptr) { if (player_ptr->current_floor_ptr->dun_level) { msg_print(_("この魔法は地上でしか使えない!", "This spell can only be used on the surface!")); @@ -320,7 +320,7 @@ bool tele_town(player_type *player_ptr) * @brief 現実変容処理 * @param player_ptr プレイヤーへの参照ポインタ */ -void reserve_alter_reality(player_type *player_ptr, TIME_EFFECT turns) +void reserve_alter_reality(PlayerType *player_ptr, TIME_EFFECT turns) { if (player_ptr->current_floor_ptr->inside_arena || ironman_downward) { msg_print(_("何も起こらなかった。", "Nothing happens.")); @@ -346,7 +346,7 @@ void reserve_alter_reality(player_type *player_ptr, TIME_EFFECT turns) * @param turns 発動までのターン数 * @return 常にTRUEを返す */ -bool recall_player(player_type *player_ptr, TIME_EFFECT turns) +bool recall_player(PlayerType *player_ptr, TIME_EFFECT turns) { /* * TODO: Recall the player to the last @@ -390,7 +390,7 @@ bool recall_player(player_type *player_ptr, TIME_EFFECT turns) return true; } -bool free_level_recall(player_type *player_ptr) +bool free_level_recall(PlayerType *player_ptr) { DUNGEON_IDX select_dungeon = choose_dungeon(_("にテレポート", "teleport"), 4, 0); if (!select_dungeon) @@ -429,7 +429,7 @@ bool free_level_recall(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @return リセット処理が実際に行われたらTRUEを返す */ -bool reset_recall(player_type *player_ptr) +bool reset_recall(PlayerType *player_ptr) { int select_dungeon, dummy = 0; char ppp[80]; diff --git a/src/spell-kind/spells-world.h b/src/spell-kind/spells-world.h index 5a7311387..588ab0182 100644 --- a/src/spell-kind/spells-world.h +++ b/src/spell-kind/spells-world.h @@ -2,12 +2,12 @@ #include "system/angband.h" -struct player_type; -void teleport_level(player_type *player_ptr, MONSTER_IDX m_idx); -bool teleport_level_other(player_type *player_ptr); -bool tele_town(player_type *player_ptr); -void reserve_alter_reality(player_type *player_ptr, TIME_EFFECT turns); -bool is_teleport_level_ineffective(player_type *player_ptr, MONSTER_IDX idx); -bool recall_player(player_type *player_ptr, TIME_EFFECT turns); -bool free_level_recall(player_type *player_ptr); -bool reset_recall(player_type *player_ptr); +class PlayerType; +void teleport_level(PlayerType *player_ptr, MONSTER_IDX m_idx); +bool teleport_level_other(PlayerType *player_ptr); +bool tele_town(PlayerType *player_ptr); +void reserve_alter_reality(PlayerType *player_ptr, TIME_EFFECT turns); +bool is_teleport_level_ineffective(PlayerType *player_ptr, MONSTER_IDX idx); +bool recall_player(PlayerType *player_ptr, TIME_EFFECT turns); +bool free_level_recall(PlayerType *player_ptr); +bool reset_recall(PlayerType *player_ptr); diff --git a/src/spell-realm/spells-arcane.cpp b/src/spell-realm/spells-arcane.cpp index 72ae782fc..9bb449a1c 100644 --- a/src/spell-realm/spells-arcane.cpp +++ b/src/spell-realm/spells-arcane.cpp @@ -10,7 +10,7 @@ * @brief 寿命つき光源の燃素追加処理 / * Charge a lite (torch or latern) */ -void phlogiston(player_type *player_ptr) +void phlogiston(PlayerType *player_ptr) { GAME_TURN max_flog = 0; object_type *o_ptr = &player_ptr->inventory_list[INVEN_LITE]; diff --git a/src/spell-realm/spells-arcane.h b/src/spell-realm/spells-arcane.h index a4a35ff8a..a4af0dda0 100644 --- a/src/spell-realm/spells-arcane.h +++ b/src/spell-realm/spells-arcane.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void phlogiston(player_type *player_ptr); +class PlayerType; +void phlogiston(PlayerType *player_ptr); diff --git a/src/spell-realm/spells-chaos.cpp b/src/spell-realm/spells-chaos.cpp index 4fdad5e43..a21f08252 100644 --- a/src/spell-realm/spells-chaos.cpp +++ b/src/spell-realm/spells-chaos.cpp @@ -31,7 +31,7 @@ * @details * Sorry, it becomes not (void)... */ -void call_the_void(player_type *player_ptr) +void call_the_void(PlayerType *player_ptr) { bool do_call = true; auto *floor_ptr = player_ptr->current_floor_ptr; @@ -101,7 +101,7 @@ void call_the_void(player_type *player_ptr) * @param player_ptr 術者の参照ポインタ * @return 実際に処理が反映された場合TRUE */ -bool vanish_dungeon(player_type *player_ptr) +bool vanish_dungeon(PlayerType *player_ptr) { auto *floor_ptr = player_ptr->current_floor_ptr; bool is_special_floor = floor_ptr->inside_quest && quest_type::is_fixed(floor_ptr->inside_quest); @@ -189,7 +189,7 @@ bool vanish_dungeon(player_type *player_ptr) * @param rad 効力の半径 * @details このファイルにいるのは、spells-trump.c と比べて行数が少なかったため。それ以上の意図はない */ -void cast_meteor(player_type *player_ptr, HIT_POINT dam, POSITION rad) +void cast_meteor(PlayerType *player_ptr, HIT_POINT dam, POSITION rad) { int b = 10 + randint1(10); for (int i = 0; i < b; i++) { diff --git a/src/spell-realm/spells-chaos.h b/src/spell-realm/spells-chaos.h index c72754f27..bf1130b74 100644 --- a/src/spell-realm/spells-chaos.h +++ b/src/spell-realm/spells-chaos.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -void call_the_void(player_type *player_ptr); -bool vanish_dungeon(player_type *player_ptr); -void cast_meteor(player_type *player_ptr, HIT_POINT dam, POSITION rad); +class PlayerType; +void call_the_void(PlayerType *player_ptr); +bool vanish_dungeon(PlayerType *player_ptr); +void cast_meteor(PlayerType *player_ptr, HIT_POINT dam, POSITION rad); diff --git a/src/spell-realm/spells-craft.cpp b/src/spell-realm/spells-craft.cpp index 34caf22c6..28d18d469 100644 --- a/src/spell-realm/spells-craft.cpp +++ b/src/spell-realm/spells-craft.cpp @@ -31,7 +31,7 @@ * @param v 継続時間 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_ele_attack(player_type *player_ptr, uint32_t attack_type, TIME_EFFECT v) +bool set_ele_attack(PlayerType *player_ptr, uint32_t attack_type, TIME_EFFECT v) { v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -99,7 +99,7 @@ bool set_ele_attack(player_type *player_ptr, uint32_t attack_type, TIME_EFFECT v * @param v 継続時間 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_ele_immune(player_type *player_ptr, uint32_t immune_type, TIME_EFFECT v) +bool set_ele_immune(PlayerType *player_ptr, uint32_t immune_type, TIME_EFFECT v) { v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -155,7 +155,7 @@ bool set_ele_immune(player_type *player_ptr, uint32_t immune_type, TIME_EFFECT v /* * Choose a warrior-mage elemental attack. -LM- */ -bool choose_ele_attack(player_type *player_ptr) +bool choose_ele_attack(PlayerType *player_ptr) { if (!has_melee_weapon(player_ptr, INVEN_MAIN_HAND) && !has_melee_weapon(player_ptr, INVEN_SUB_HAND)) { msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon.")); @@ -217,7 +217,7 @@ bool choose_ele_attack(player_type *player_ptr) /* * Choose a elemental immune. -LM- */ -bool choose_ele_immune(player_type *player_ptr, TIME_EFFECT immune_turn) +bool choose_ele_immune(PlayerType *player_ptr, TIME_EFFECT immune_turn) { screen_save(); @@ -259,7 +259,7 @@ bool choose_ele_immune(player_type *player_ptr, TIME_EFFECT immune_turn) * pulish shield * @return ターン消費を要する処理を行ったならばTRUEを返す */ -bool pulish_shield(player_type *player_ptr) +bool pulish_shield(PlayerType *player_ptr) { concptr q = _("どの盾を磨きますか?", "Polish which shield? "); concptr s = _("磨く盾がありません。", "You have no shield to polish."); diff --git a/src/spell-realm/spells-craft.h b/src/spell-realm/spells-craft.h index e6d12e3f3..cbd2d0966 100644 --- a/src/spell-realm/spells-craft.h +++ b/src/spell-realm/spells-craft.h @@ -2,9 +2,9 @@ #include "system/angband.h" -struct player_type; -bool set_ele_attack(player_type *player_ptr, uint32_t attack_type, TIME_EFFECT v); -bool set_ele_immune(player_type *player_ptr, uint32_t immune_type, TIME_EFFECT v); -bool choose_ele_attack(player_type *player_ptr); -bool choose_ele_immune(player_type *player_ptr, TIME_EFFECT turn); -bool pulish_shield(player_type *player_ptr); +class PlayerType; +bool set_ele_attack(PlayerType *player_ptr, uint32_t attack_type, TIME_EFFECT v); +bool set_ele_immune(PlayerType *player_ptr, uint32_t immune_type, TIME_EFFECT v); +bool choose_ele_attack(PlayerType *player_ptr); +bool choose_ele_immune(PlayerType *player_ptr, TIME_EFFECT turn); +bool pulish_shield(PlayerType *player_ptr); diff --git a/src/spell-realm/spells-crusade.cpp b/src/spell-realm/spells-crusade.cpp index de6b5e132..7d9b86c06 100644 --- a/src/spell-realm/spells-crusade.cpp +++ b/src/spell-realm/spells-crusade.cpp @@ -34,7 +34,7 @@ * @param rad 効力の半径 * @return ターゲットを指定し、実行したならばTRUEを返す。 */ -bool cast_wrath_of_the_god(player_type *player_ptr, HIT_POINT dam, POSITION rad) +bool cast_wrath_of_the_god(PlayerType *player_ptr, HIT_POINT dam, POSITION rad) { DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) @@ -108,7 +108,7 @@ bool cast_wrath_of_the_god(player_type *player_ptr, HIT_POINT dam, POSITION rad) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_sh_holy(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_sh_holy(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -151,7 +151,7 @@ bool set_tim_sh_holy(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @return ステータスに影響を及ぼす変化があった場合TRUEを返す * @details 呪術領域でも使えるが、汎用性と行数の兼ね合いを考えて破邪側に入れた */ -bool set_tim_eyeeye(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_eyeeye(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; diff --git a/src/spell-realm/spells-crusade.h b/src/spell-realm/spells-crusade.h index 8d608bcc0..90780022c 100644 --- a/src/spell-realm/spells-crusade.h +++ b/src/spell-realm/spells-crusade.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -bool cast_wrath_of_the_god(player_type *player_ptr, HIT_POINT dam, POSITION rad); -bool set_tim_sh_holy(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tim_eyeeye(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +bool cast_wrath_of_the_god(PlayerType *player_ptr, HIT_POINT dam, POSITION rad); +bool set_tim_sh_holy(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tim_eyeeye(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); diff --git a/src/spell-realm/spells-demon.cpp b/src/spell-realm/spells-demon.cpp index b83b483d8..0977f7762 100644 --- a/src/spell-realm/spells-demon.cpp +++ b/src/spell-realm/spells-demon.cpp @@ -13,7 +13,7 @@ * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_sh_fire(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_sh_fire(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; diff --git a/src/spell-realm/spells-demon.h b/src/spell-realm/spells-demon.h index 53ca49145..06e2bbf7a 100644 --- a/src/spell-realm/spells-demon.h +++ b/src/spell-realm/spells-demon.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool set_tim_sh_fire(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +bool set_tim_sh_fire(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); diff --git a/src/spell-realm/spells-hex.cpp b/src/spell-realm/spells-hex.cpp index 62d9d39c9..d97c72793 100644 --- a/src/spell-realm/spells-hex.cpp +++ b/src/spell-realm/spells-hex.cpp @@ -40,7 +40,7 @@ /*!< 呪術の最大詠唱数 */ constexpr int MAX_KEEP = 4; -SpellHex::SpellHex(player_type *player_ptr) +SpellHex::SpellHex(PlayerType *player_ptr) : player_ptr(player_ptr) , spell_hex_data(PlayerClass(player_ptr).get_specific_data()) { @@ -55,7 +55,7 @@ SpellHex::SpellHex(player_type *player_ptr) } } -SpellHex::SpellHex(player_type *player_ptr, monap_type *monap_ptr) +SpellHex::SpellHex(PlayerType *player_ptr, monap_type *monap_ptr) : player_ptr(player_ptr) , monap_ptr(monap_ptr) { diff --git a/src/spell-realm/spells-hex.h b/src/spell-realm/spells-hex.h index a52539840..e0c778507 100644 --- a/src/spell-realm/spells-hex.h +++ b/src/spell-realm/spells-hex.h @@ -11,12 +11,12 @@ enum class SpellHexRevengeType : byte { }; struct monap_type; -struct player_type; +class PlayerType; struct spell_hex_data_type; class SpellHex { public: - SpellHex(player_type *player_ptr); - SpellHex(player_type *player_ptr, monap_type *monap_ptr); + SpellHex(PlayerType *player_ptr); + SpellHex(PlayerType *player_ptr, monap_type *monap_ptr); virtual ~SpellHex() = default; bool stop_spells_with_selection(); @@ -42,7 +42,7 @@ public: void set_revenge_type(SpellHexRevengeType type); private: - player_type *player_ptr; + PlayerType *player_ptr; std::vector casting_spells; monap_type *monap_ptr = nullptr; std::shared_ptr spell_hex_data; diff --git a/src/spell-realm/spells-nature.cpp b/src/spell-realm/spells-nature.cpp index f791daa84..5fe900d0a 100644 --- a/src/spell-realm/spells-nature.cpp +++ b/src/spell-realm/spells-nature.cpp @@ -17,7 +17,7 @@ * @param player_ptr 錆止め実行者の参照ポインタ * @return ターン消費を要する処理を行ったならばTRUEを返す */ -bool rustproof(player_type *player_ptr) +bool rustproof(PlayerType *player_ptr) { concptr q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? "); concptr s = _("錆止めできるものがありません。", "You have nothing to rustproof."); diff --git a/src/spell-realm/spells-nature.h b/src/spell-realm/spells-nature.h index e495ea4ab..b2c88d0b8 100644 --- a/src/spell-realm/spells-nature.h +++ b/src/spell-realm/spells-nature.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool rustproof(player_type *player_ptr); +class PlayerType; +bool rustproof(PlayerType *player_ptr); diff --git a/src/spell-realm/spells-song.cpp b/src/spell-realm/spells-song.cpp index dc3181b9f..9d8f1ef89 100644 --- a/src/spell-realm/spells-song.cpp +++ b/src/spell-realm/spells-song.cpp @@ -23,7 +23,7 @@ /*! * @brief プレイヤーの歌に関する継続処理 */ -void check_music(player_type *player_ptr) +void check_music(PlayerType *player_ptr) { if (player_ptr->pclass != PlayerClassType::BARD) return; @@ -74,7 +74,7 @@ void check_music(player_type *player_ptr) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_stealth(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_stealth(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -113,7 +113,7 @@ bool set_tim_stealth(player_type *player_ptr, TIME_EFFECT v, bool do_dec) /*! * @brief 歌の停止を処理する / Stop singing if the player is a Bard */ -void stop_singing(player_type *player_ptr) +void stop_singing(PlayerType *player_ptr) { if (player_ptr->pclass != PlayerClassType::BARD) return; @@ -136,19 +136,19 @@ void stop_singing(player_type *player_ptr) set_bits(player_ptr->redraw, PR_STATUS); } -bool music_singing(player_type *player_ptr, int music_songs) +bool music_singing(PlayerType *player_ptr, int music_songs) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); return bird_data && (bird_data->singing_song == music_songs); } -bool music_singing_any(player_type *player_ptr) +bool music_singing_any(PlayerType *player_ptr) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); return bird_data && (bird_data->singing_song != MUSIC_NONE); } -int32_t get_singing_song_effect(player_type *player_ptr) +int32_t get_singing_song_effect(PlayerType *player_ptr) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); if (!bird_data) { @@ -158,7 +158,7 @@ int32_t get_singing_song_effect(player_type *player_ptr) return bird_data->singing_song; } -void set_singing_song_effect(player_type *player_ptr, const int32_t magic_num) +void set_singing_song_effect(PlayerType *player_ptr, const int32_t magic_num) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); if (!bird_data) { @@ -168,7 +168,7 @@ void set_singing_song_effect(player_type *player_ptr, const int32_t magic_num) bird_data->singing_song = i2enum(magic_num); } -int32_t get_interrupting_song_effect(player_type *player_ptr) +int32_t get_interrupting_song_effect(PlayerType *player_ptr) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); if (!bird_data) { @@ -178,7 +178,7 @@ int32_t get_interrupting_song_effect(player_type *player_ptr) return bird_data->interrputing_song; } -void set_interrupting_song_effect(player_type *player_ptr, const int32_t magic_num) +void set_interrupting_song_effect(PlayerType *player_ptr, const int32_t magic_num) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); if (!bird_data) { @@ -188,7 +188,7 @@ void set_interrupting_song_effect(player_type *player_ptr, const int32_t magic_n bird_data->interrputing_song = i2enum(magic_num); } -int32_t get_singing_count(player_type *player_ptr) +int32_t get_singing_count(PlayerType *player_ptr) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); if (!bird_data) { @@ -198,7 +198,7 @@ int32_t get_singing_count(player_type *player_ptr) return bird_data->singing_duration; } -void set_singing_count(player_type *player_ptr, const int32_t magic_num) +void set_singing_count(PlayerType *player_ptr, const int32_t magic_num) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); if (!bird_data) { @@ -208,7 +208,7 @@ void set_singing_count(player_type *player_ptr, const int32_t magic_num) bird_data->singing_duration = magic_num; } -byte get_singing_song_id(player_type *player_ptr) +byte get_singing_song_id(PlayerType *player_ptr) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); if (!bird_data) { @@ -218,7 +218,7 @@ byte get_singing_song_id(player_type *player_ptr) return bird_data->singing_song_spell_idx; } -void set_singing_song_id(player_type *player_ptr, const byte magic_num) +void set_singing_song_id(PlayerType *player_ptr, const byte magic_num) { auto bird_data = PlayerClass(player_ptr).get_specific_data(); if (!bird_data) { diff --git a/src/spell-realm/spells-song.h b/src/spell-realm/spells-song.h index d2a9dbc40..9053367e4 100644 --- a/src/spell-realm/spells-song.h +++ b/src/spell-realm/spells-song.h @@ -2,17 +2,17 @@ #include "system/angband.h" -struct player_type; -void check_music(player_type *player_ptr); -bool set_tim_stealth(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -void stop_singing(player_type *player_ptr); -bool music_singing(player_type *player_ptr, int music_songs); -bool music_singing_any(player_type *player_ptr); -int32_t get_singing_song_effect(player_type *player_ptr); -void set_singing_song_effect(player_type *player_ptr, const int32_t magic_num); -int32_t get_interrupting_song_effect(player_type *player_ptr); -void set_interrupting_song_effect(player_type *player_ptr, const int32_t magic_num); -int32_t get_singing_count(player_type *player_ptr); -void set_singing_count(player_type *player_ptr, const int32_t magic_num); -byte get_singing_song_id(player_type *player_ptr); -void set_singing_song_id(player_type *player_ptr, const byte magic_num); +class PlayerType; +void check_music(PlayerType *player_ptr); +bool set_tim_stealth(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +void stop_singing(PlayerType *player_ptr); +bool music_singing(PlayerType *player_ptr, int music_songs); +bool music_singing_any(PlayerType *player_ptr); +int32_t get_singing_song_effect(PlayerType *player_ptr); +void set_singing_song_effect(PlayerType *player_ptr, const int32_t magic_num); +int32_t get_interrupting_song_effect(PlayerType *player_ptr); +void set_interrupting_song_effect(PlayerType *player_ptr, const int32_t magic_num); +int32_t get_singing_count(PlayerType *player_ptr); +void set_singing_count(PlayerType *player_ptr, const int32_t magic_num); +byte get_singing_song_id(PlayerType *player_ptr); +void set_singing_song_id(PlayerType *player_ptr, const byte magic_num); diff --git a/src/spell-realm/spells-sorcery.cpp b/src/spell-realm/spells-sorcery.cpp index ef90ce412..8ad666d53 100644 --- a/src/spell-realm/spells-sorcery.cpp +++ b/src/spell-realm/spells-sorcery.cpp @@ -20,7 +20,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @return 処理が実際に行われたらTRUEを返す */ -bool alchemy(player_type *player_ptr) +bool alchemy(PlayerType *player_ptr) { bool force = false; if (command_arg > 0) diff --git a/src/spell-realm/spells-sorcery.h b/src/spell-realm/spells-sorcery.h index ab0dca483..f5ee7eadb 100644 --- a/src/spell-realm/spells-sorcery.h +++ b/src/spell-realm/spells-sorcery.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -bool alchemy(player_type *player_ptr); +class PlayerType; +bool alchemy(PlayerType *player_ptr); diff --git a/src/spell-realm/spells-trump.cpp b/src/spell-realm/spells-trump.cpp index c32810c21..4f280383c 100644 --- a/src/spell-realm/spells-trump.cpp +++ b/src/spell-realm/spells-trump.cpp @@ -26,7 +26,7 @@ * @brief トランプ領域の「シャッフル」の効果をランダムに決めて処理する。 * @param player_ptr プレイヤーへの参照ポインタ */ -void cast_shuffle(player_type *player_ptr) +void cast_shuffle(PlayerType *player_ptr) { PLAYER_LEVEL plev = player_ptr->lev; DIRECTION dir; @@ -220,7 +220,7 @@ void cast_shuffle(player_type *player_ptr) gain_exp(player_ptr, ee); } -void become_living_trump(player_type *player_ptr) +void become_living_trump(PlayerType *player_ptr) { /* 1/7 Teleport control and 6/7 Random teleportation (uncontrolled) */ MUTATION_IDX mutation = one_in_(7) ? 12 : 77; diff --git a/src/spell-realm/spells-trump.h b/src/spell-realm/spells-trump.h index 67f51dd07..6505f2ce8 100644 --- a/src/spell-realm/spells-trump.h +++ b/src/spell-realm/spells-trump.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -void cast_shuffle(player_type *player_ptr); -void become_living_trump(player_type *player_ptr); +class PlayerType; +void cast_shuffle(PlayerType *player_ptr); +void become_living_trump(PlayerType *player_ptr); diff --git a/src/spell/range-calc.cpp b/src/spell/range-calc.cpp index 36ba247bb..48b158f06 100644 --- a/src/spell/range-calc.cpp +++ b/src/spell/range-calc.cpp @@ -186,7 +186,7 @@ bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, PO /* * breath shape */ -void breath_shape(player_type *player_ptr, uint16_t *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, AttributeType typ) +void breath_shape(PlayerType *player_ptr, uint16_t *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, AttributeType typ) { POSITION by = y1; POSITION bx = x1; diff --git a/src/spell/range-calc.h b/src/spell/range-calc.h index 77b539400..a2e5b2c2e 100644 --- a/src/spell/range-calc.h +++ b/src/spell/range-calc.h @@ -4,7 +4,7 @@ #include "effect/attribute-types.h" struct floor_type; -struct player_type; +class PlayerType; bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2); -void breath_shape(player_type *player_ptr, uint16_t *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, AttributeType typ); +void breath_shape(PlayerType *player_ptr, uint16_t *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, AttributeType typ); POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2); diff --git a/src/spell/spell-info.cpp b/src/spell/spell-info.cpp index 4f1141517..c4a3fdc59 100644 --- a/src/spell/spell-info.cpp +++ b/src/spell/spell-info.cpp @@ -33,7 +33,7 @@ static const int extra_min_magic_fail_rate = 2; * @param realm 魔法領域 * @return 消費MP */ -MANA_POINT mod_need_mana(player_type *player_ptr, MANA_POINT need_mana, SPELL_IDX spell, int16_t realm) +MANA_POINT mod_need_mana(PlayerType *player_ptr, MANA_POINT need_mana, SPELL_IDX spell, int16_t realm) { #define MANA_CONST 2400 #define MANA_DIV 4 @@ -65,7 +65,7 @@ MANA_POINT mod_need_mana(player_type *player_ptr, MANA_POINT need_mana, SPELL_ID * @return 失敗率(%) * @todo 統合を検討 */ -PERCENTAGE mod_spell_chance_1(player_type *player_ptr, PERCENTAGE chance) +PERCENTAGE mod_spell_chance_1(PlayerType *player_ptr, PERCENTAGE chance) { chance += player_ptr->to_m_chance; @@ -94,7 +94,7 @@ PERCENTAGE mod_spell_chance_1(player_type *player_ptr, PERCENTAGE chance) * Note: variable "chance" cannot be negative. * @todo 統合を検討 */ -PERCENTAGE mod_spell_chance_2(player_type *player_ptr, PERCENTAGE chance) +PERCENTAGE mod_spell_chance_2(PlayerType *player_ptr, PERCENTAGE chance) { if (player_ptr->dec_mana) chance--; @@ -111,7 +111,7 @@ PERCENTAGE mod_spell_chance_2(player_type *player_ptr, PERCENTAGE chance) * @param use_realm 魔法領域ID * @return 失敗率(%) */ -PERCENTAGE spell_chance(player_type *player_ptr, SPELL_IDX spell, int16_t use_realm) +PERCENTAGE spell_chance(PlayerType *player_ptr, SPELL_IDX spell, int16_t use_realm) { if (mp_ptr->spell_book == ItemKindType::NONE) return 100; @@ -202,7 +202,7 @@ PERCENTAGE spell_chance(player_type *player_ptr, SPELL_IDX spell, int16_t use_re * @param x 表示メッセージ左上X座標 * @param use_realm 魔法領域ID */ -void print_spells(player_type *player_ptr, SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, int16_t use_realm) +void print_spells(PlayerType *player_ptr, SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, int16_t use_realm) { if (((use_realm <= REALM_NONE) || (use_realm > MAX_REALM)) && allow_debug_options) msg_print(_("警告! print_spell が領域なしに呼ばれた", "Warning! print_spells called with null realm")); diff --git a/src/spell/spell-info.h b/src/spell/spell-info.h index f6eea7ed6..83227995e 100644 --- a/src/spell/spell-info.h +++ b/src/spell/spell-info.h @@ -2,9 +2,9 @@ #include "system/angband.h" -struct player_type; -MANA_POINT mod_need_mana(player_type *player_ptr, MANA_POINT need_mana, SPELL_IDX spell, int16_t realm); -PERCENTAGE mod_spell_chance_1(player_type *player_ptr, PERCENTAGE chance); -PERCENTAGE mod_spell_chance_2(player_type *player_ptr, PERCENTAGE chance); -PERCENTAGE spell_chance(player_type *player_ptr, SPELL_IDX spell, int16_t realm); -void print_spells(player_type *player_ptr, SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, int16_t realm); +class PlayerType; +MANA_POINT mod_need_mana(PlayerType *player_ptr, MANA_POINT need_mana, SPELL_IDX spell, int16_t realm); +PERCENTAGE mod_spell_chance_1(PlayerType *player_ptr, PERCENTAGE chance); +PERCENTAGE mod_spell_chance_2(PlayerType *player_ptr, PERCENTAGE chance); +PERCENTAGE spell_chance(PlayerType *player_ptr, SPELL_IDX spell, int16_t realm); +void print_spells(PlayerType *player_ptr, SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, int16_t realm); diff --git a/src/spell/spells-diceroll.cpp b/src/spell/spells-diceroll.cpp index 2b5042eec..51e0aa95f 100644 --- a/src/spell/spells-diceroll.cpp +++ b/src/spell/spells-diceroll.cpp @@ -21,7 +21,7 @@ * @param m_ptr 対象モンスター * @return 魅了に抵抗したらTRUE */ -bool common_saving_throw_charm(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr) +bool common_saving_throw_charm(PlayerType *player_ptr, HIT_POINT pow, monster_type *m_ptr) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -56,7 +56,7 @@ bool common_saving_throw_charm(player_type *player_ptr, HIT_POINT pow, monster_t * @param m_ptr 対象モンスター * @return 服従に抵抗したらTRUE */ -bool common_saving_throw_control(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr) +bool common_saving_throw_control(PlayerType *player_ptr, HIT_POINT pow, monster_type *m_ptr) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -86,7 +86,7 @@ bool common_saving_throw_control(player_type *player_ptr, HIT_POINT pow, monster * ハードコーティングによる実装が行われている。 * メイジは(レベル)%、ハイメイジ、スペルマスターは(レベル)%、それ以外の職業は(レベル/2)% */ -PERCENTAGE beam_chance(player_type *player_ptr) +PERCENTAGE beam_chance(PlayerType *player_ptr) { if (player_ptr->pclass == PlayerClassType::MAGE) return (PERCENTAGE)(player_ptr->lev); diff --git a/src/spell/spells-diceroll.h b/src/spell/spells-diceroll.h index dc81389b8..7950a0586 100644 --- a/src/spell/spells-diceroll.h +++ b/src/spell/spells-diceroll.h @@ -3,7 +3,7 @@ #include "system/angband.h" struct monster_type; -struct player_type; -bool common_saving_throw_control(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr); -bool common_saving_throw_charm(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr); -PERCENTAGE beam_chance(player_type *player_ptr); +class PlayerType; +bool common_saving_throw_control(PlayerType *player_ptr, HIT_POINT pow, monster_type *m_ptr); +bool common_saving_throw_charm(PlayerType *player_ptr, HIT_POINT pow, monster_type *m_ptr); +PERCENTAGE beam_chance(PlayerType *player_ptr); diff --git a/src/spell/spells-execution.cpp b/src/spell/spells-execution.cpp index 0269ded7c..ea298eb71 100644 --- a/src/spell/spells-execution.cpp +++ b/src/spell/spells-execution.cpp @@ -22,7 +22,7 @@ * @param mode 求める処理 * @return 各領域魔法に各種テキストを求めた場合は文字列参照ポインタ、そうでない場合はnullptrを返す。 */ -concptr exe_spell(player_type *player_ptr, int16_t realm, SPELL_IDX spell, SpellProcessType mode) +concptr exe_spell(PlayerType *player_ptr, int16_t realm, SPELL_IDX spell, SpellProcessType mode) { switch (realm) { diff --git a/src/spell/spells-execution.h b/src/spell/spells-execution.h index 8dc85f545..7a02419df 100644 --- a/src/spell/spells-execution.h +++ b/src/spell/spells-execution.h @@ -3,5 +3,5 @@ #include "system/angband.h" #include "spell/spells-util.h" -struct player_type; -concptr exe_spell(player_type *player_ptr, int16_t realm, SPELL_IDX spell, SpellProcessType mode); +class PlayerType; +concptr exe_spell(PlayerType *player_ptr, int16_t realm, SPELL_IDX spell, SpellProcessType mode); diff --git a/src/spell/spells-object.cpp b/src/spell/spells-object.cpp index 419790a6b..2c5e5051c 100644 --- a/src/spell/spells-object.cpp +++ b/src/spell/spells-object.cpp @@ -85,7 +85,7 @@ static amuse_type amuse_info[] * @param num 誰得の処理回数 * @param known TRUEならばオブジェクトが必ず*鑑定*済になる */ -void amusement(player_type *player_ptr, POSITION y1, POSITION x1, int num, bool known) +void amusement(PlayerType *player_ptr, POSITION y1, POSITION x1, int num, bool known) { int t = 0; for (int n = 0; amuse_info[n].tval != ItemKindType::NONE; n++) { @@ -180,7 +180,7 @@ void amusement(player_type *player_ptr, POSITION y1, POSITION x1, int num, bool * @param special TRUEならば必ず特別品を落とす * @param known TRUEならばオブジェクトが必ず*鑑定*済になる */ -void acquirement(player_type *player_ptr, POSITION y1, POSITION x1, int num, bool great, bool special, bool known) +void acquirement(PlayerType *player_ptr, POSITION y1, POSITION x1, int num, bool great, bool special, bool known) { object_type *i_ptr; object_type object_type_body; @@ -210,7 +210,7 @@ void acquirement(player_type *player_ptr, POSITION y1, POSITION x1, int num, boo * @return 何も持っていない場合を除き、常にTRUEを返す * @todo 元のreturnは間違っているが、修正後の↓文がどれくらい正しいかは要チェック */ -bool curse_armor(player_type *player_ptr) +bool curse_armor(PlayerType *player_ptr) { /* Curse the body armor */ object_type *o_ptr; @@ -268,7 +268,7 @@ bool curse_armor(player_type *player_ptr) * @return 何も持っていない場合を除き、常にTRUEを返す * @todo 元のreturnは間違っているが、修正後の↓文がどれくらい正しいかは要チェック */ -bool curse_weapon_object(player_type *player_ptr, bool force, object_type *o_ptr) +bool curse_weapon_object(PlayerType *player_ptr, bool force, object_type *o_ptr) { if (!o_ptr->k_idx) return false; @@ -318,7 +318,7 @@ bool curse_weapon_object(player_type *player_ptr, bool force, object_type *o_ptr * Enchant some bolts * @param player_ptr プレイヤーへの参照ポインタ */ -void brand_bolts(player_type *player_ptr) +void brand_bolts(PlayerType *player_ptr) { /* Use the first acceptable bolts */ for (int i = 0; i < INVEN_PACK; i++) { @@ -396,7 +396,7 @@ static void break_curse(object_type *o_ptr) * the larger the pile, the lower the chance of success. * */ -bool enchant_equipment(player_type *player_ptr, object_type *o_ptr, int n, int eflag) +bool enchant_equipment(PlayerType *player_ptr, object_type *o_ptr, int n, int eflag) { /* Large piles resist enchantment */ int prob = o_ptr->number * 100; @@ -498,7 +498,7 @@ bool enchant_equipment(player_type *player_ptr, object_type *o_ptr, int n, int e * Note that "num_ac" requires armour, else weapon * Returns TRUE if attempted, FALSE if cancelled */ -bool enchant_spell(player_type *player_ptr, HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac) +bool enchant_spell(PlayerType *player_ptr, HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac) { /* Assume enchant weapon */ FuncItemTester item_tester(&object_type::allow_enchant_weapon); @@ -554,7 +554,7 @@ bool enchant_spell(player_type *player_ptr, HIT_PROB num_hit, HIT_POINT num_dam, * @param player_ptr プレイヤーへの参照ポインタ * @param brand_type エゴ化ID(e_info.txtとは連動していない) */ -void brand_weapon(player_type *player_ptr, int brand_type) +void brand_weapon(PlayerType *player_ptr, int brand_type) { concptr q = _("どの武器を強化しますか? ", "Enchant which weapon? "); concptr s = _("強化できる武器がない。", "You have nothing to enchant."); diff --git a/src/spell/spells-object.h b/src/spell/spells-object.h index c54fb981e..41d65b905 100644 --- a/src/spell/spells-object.h +++ b/src/spell/spells-object.h @@ -3,12 +3,12 @@ #include "system/angband.h" struct object_type; -struct player_type; -void amusement(player_type *player_ptr, POSITION y1, POSITION x1, int num, bool known); -void acquirement(player_type *player_ptr, POSITION y1, POSITION x1, int num, bool great, bool special, bool known); -bool curse_armor(player_type *player_ptr); -bool curse_weapon_object(player_type *player_ptr, bool force, object_type *o_ptr); -void brand_bolts(player_type *player_ptr); +class PlayerType; +void amusement(PlayerType *player_ptr, POSITION y1, POSITION x1, int num, bool known); +void acquirement(PlayerType *player_ptr, POSITION y1, POSITION x1, int num, bool great, bool special, bool known); +bool curse_armor(PlayerType *player_ptr); +bool curse_weapon_object(PlayerType *player_ptr, bool force, object_type *o_ptr); +void brand_bolts(PlayerType *player_ptr); /* * Bit flags for the "enchant()" function @@ -17,6 +17,6 @@ void brand_bolts(player_type *player_ptr); #define ENCH_TODAM 0x02 /*!< 装備強化処理: ダメージ強化 / Enchant to damage */ #define ENCH_TOAC 0x04 /*!< 装備強化処理: AC強化 / Enchant to AC */ #define ENCH_FORCE 0x08 /*!< 装備強化処理: 無条件に成功させる / Force enchantment */ -bool enchant_equipment(player_type *player_ptr, object_type *o_ptr, int n, int eflag); -bool enchant_spell(player_type *player_ptr, HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac); -void brand_weapon(player_type *player_ptr, int brand_type); +bool enchant_equipment(PlayerType *player_ptr, object_type *o_ptr, int n, int eflag); +bool enchant_spell(PlayerType *player_ptr, HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac); +void brand_weapon(PlayerType *player_ptr, int brand_type); diff --git a/src/spell/spells-staff-only.cpp b/src/spell/spells-staff-only.cpp index 68b7e31fb..a9b8aa5a5 100644 --- a/src/spell/spells-staff-only.cpp +++ b/src/spell/spells-staff-only.cpp @@ -16,7 +16,7 @@ * @magic 魔法の効果である場合TRUE (杖と同じ効果の呪文はあったか? 要調査) * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査) */ -bool cleansing_nova(player_type *player_ptr, bool magic, bool powerful) +bool cleansing_nova(PlayerType *player_ptr, bool magic, bool powerful) { bool ident = false; if (dispel_evil(player_ptr, powerful ? 225 : 150)) { @@ -57,7 +57,7 @@ bool cleansing_nova(player_type *player_ptr, bool magic, bool powerful) * @param player_ptr プレイヤーへの参照ポインタ * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査) */ -bool unleash_mana_storm(player_type *player_ptr, bool powerful) +bool unleash_mana_storm(PlayerType *player_ptr, bool powerful) { msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!")); project(player_ptr, 0, (powerful ? 7 : 5), player_ptr->y, player_ptr->x, (randint1(200) + (powerful ? 500 : 300)) * 2, AttributeType::MANA, diff --git a/src/spell/spells-staff-only.h b/src/spell/spells-staff-only.h index c1fc46e10..5a78f1a5a 100644 --- a/src/spell/spells-staff-only.h +++ b/src/spell/spells-staff-only.h @@ -1,5 +1,5 @@ #pragma once -struct player_type; -bool cleansing_nova(player_type *player_ptr, bool magic, bool powerful); -bool unleash_mana_storm(player_type *player_ptr, bool powerful); +class PlayerType; +bool cleansing_nova(PlayerType *player_ptr, bool magic, bool powerful); +bool unleash_mana_storm(PlayerType *player_ptr, bool powerful); diff --git a/src/spell/spells-status.cpp b/src/spell/spells-status.cpp index e1fed5f6a..3710f72f0 100644 --- a/src/spell/spells-status.cpp +++ b/src/spell/spells-status.cpp @@ -63,7 +63,7 @@ * @param dam 威力 * @return 作用が実際にあった場合TRUEを返す */ -bool heal_monster(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) +bool heal_monster(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::OLD_HEAL, dir, dam, flg)); @@ -76,7 +76,7 @@ bool heal_monster(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) * @param power 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool speed_monster(player_type *player_ptr, DIRECTION dir, int power) +bool speed_monster(PlayerType *player_ptr, DIRECTION dir, int power) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::OLD_SPEED, dir, power, flg)); @@ -89,7 +89,7 @@ bool speed_monster(player_type *player_ptr, DIRECTION dir, int power) * @param power 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool slow_monster(player_type *player_ptr, DIRECTION dir, int power) +bool slow_monster(PlayerType *player_ptr, DIRECTION dir, int power) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::OLD_SLOW, dir, power, flg)); @@ -102,7 +102,7 @@ bool slow_monster(player_type *player_ptr, DIRECTION dir, int power) * @param power 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool sleep_monster(player_type *player_ptr, DIRECTION dir, int power) +bool sleep_monster(PlayerType *player_ptr, DIRECTION dir, int power) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::OLD_SLEEP, dir, power, flg)); @@ -115,7 +115,7 @@ bool sleep_monster(player_type *player_ptr, DIRECTION dir, int power) * @return 作用が実際にあった場合TRUEを返す * @details 威力はプレイヤーレベル*2に固定 */ -bool stasis_monster(player_type *player_ptr, DIRECTION dir) +bool stasis_monster(PlayerType *player_ptr, DIRECTION dir) { return (fire_ball_hide(player_ptr, AttributeType::STASIS, dir, player_ptr->lev * 2, 0)); } @@ -127,7 +127,7 @@ bool stasis_monster(player_type *player_ptr, DIRECTION dir) * @return 作用が実際にあった場合TRUEを返す * @details 威力はプレイヤーレベル*2に固定 */ -bool stasis_evil(player_type *player_ptr, DIRECTION dir) +bool stasis_evil(PlayerType *player_ptr, DIRECTION dir) { return (fire_ball_hide(player_ptr, AttributeType::STASIS_EVIL, dir, player_ptr->lev * 2, 0)); } @@ -139,7 +139,7 @@ bool stasis_evil(player_type *player_ptr, DIRECTION dir) * @param plev プレイヤーレベル(=効力) * @return 作用が実際にあった場合TRUEを返す */ -bool confuse_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) +bool confuse_monster(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::OLD_CONF, dir, plev, flg)); @@ -152,7 +152,7 @@ bool confuse_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) * @param plev プレイヤーレベル(=効力) * @return 作用が実際にあった場合TRUEを返す */ -bool stun_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) +bool stun_monster(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::STUN, dir, plev, flg)); @@ -165,7 +165,7 @@ bool stun_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) * @param power 効力 * @return 作用が実際にあった場合TRUEを返す */ -bool poly_monster(player_type *player_ptr, DIRECTION dir, int power) +bool poly_monster(PlayerType *player_ptr, DIRECTION dir, int power) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; bool tester = (project_hook(player_ptr, AttributeType::OLD_POLY, dir, power, flg)); @@ -180,7 +180,7 @@ bool poly_monster(player_type *player_ptr, DIRECTION dir, int power) * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする) * @return 作用が実際にあった場合TRUEを返す */ -bool clone_monster(player_type *player_ptr, DIRECTION dir) +bool clone_monster(PlayerType *player_ptr, DIRECTION dir) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::OLD_CLONE, dir, 0, flg)); @@ -193,13 +193,13 @@ bool clone_monster(player_type *player_ptr, DIRECTION dir) * @param plev プレイヤーレベル(=効力) * @return 作用が実際にあった場合TRUEを返す */ -bool fear_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) +bool fear_monster(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; return (project_hook(player_ptr, AttributeType::TURN_ALL, dir, plev, flg)); } -bool time_walk(player_type *player_ptr) +bool time_walk(PlayerType *player_ptr) { if (player_ptr->timewalk) { msg_print(_("既に時は止まっている。", "Time is already stopped.")); @@ -224,7 +224,7 @@ bool time_walk(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param options スペル共通オプション */ -void roll_hitdice(player_type *player_ptr, spell_operation options) +void roll_hitdice(PlayerType *player_ptr, spell_operation options) { HIT_POINT min_value = player_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (player_ptr->hitdie + 1)) * 3 / 8; HIT_POINT max_value = player_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (player_ptr->hitdie + 1)) * 5 / 8; @@ -273,7 +273,7 @@ void roll_hitdice(player_type *player_ptr, spell_operation options) msg_print(_("体力ランクが変わった。", "Life rate has changed.")); } -bool life_stream(player_type *player_ptr, bool message, bool virtue_change) +bool life_stream(PlayerType *player_ptr, bool message, bool virtue_change) { if (virtue_change) { chg_virtue(player_ptr, V_VITALITY, 1); @@ -301,7 +301,7 @@ bool life_stream(player_type *player_ptr, bool message, bool virtue_change) return true; } -bool heroism(player_type *player_ptr, int base) +bool heroism(PlayerType *player_ptr, int base) { auto ident = false; if (BadStatusSetter(player_ptr).afraidness(0)) { @@ -319,7 +319,7 @@ bool heroism(player_type *player_ptr, int base) return ident; } -bool berserk(player_type *player_ptr, int base) +bool berserk(PlayerType *player_ptr, int base) { auto ident = false; if (BadStatusSetter(player_ptr).afraidness(0)) { @@ -337,7 +337,7 @@ bool berserk(player_type *player_ptr, int base) return ident; } -bool cure_light_wounds(player_type *player_ptr, DICE_NUMBER dice, DICE_SID sides) +bool cure_light_wounds(PlayerType *player_ptr, DICE_NUMBER dice, DICE_SID sides) { auto ident = false; if (hp_player(player_ptr, damroll(dice, sides))) { @@ -360,7 +360,7 @@ bool cure_light_wounds(player_type *player_ptr, DICE_NUMBER dice, DICE_SID sides return ident; } -bool cure_serious_wounds(player_type *player_ptr, DICE_NUMBER dice, DICE_SID sides) +bool cure_serious_wounds(PlayerType *player_ptr, DICE_NUMBER dice, DICE_SID sides) { auto ident = false; if (hp_player(player_ptr, damroll(dice, sides))) { @@ -387,7 +387,7 @@ bool cure_serious_wounds(player_type *player_ptr, DICE_NUMBER dice, DICE_SID sid return ident; } -bool cure_critical_wounds(player_type *player_ptr, HIT_POINT pow) +bool cure_critical_wounds(PlayerType *player_ptr, HIT_POINT pow) { auto ident = false; if (hp_player(player_ptr, pow)) { @@ -422,7 +422,7 @@ bool cure_critical_wounds(player_type *player_ptr, HIT_POINT pow) return ident; } -bool true_healing(player_type *player_ptr, HIT_POINT pow) +bool true_healing(PlayerType *player_ptr, HIT_POINT pow) { auto ident = false; if (hp_player(player_ptr, pow)) { @@ -457,7 +457,7 @@ bool true_healing(player_type *player_ptr, HIT_POINT pow) return ident; } -bool restore_mana(player_type *player_ptr, bool magic_eater) +bool restore_mana(PlayerType *player_ptr, bool magic_eater) { if (player_ptr->pclass == PlayerClassType::MAGIC_EATER && magic_eater) { // 魔力復活による、魔道具術師の取り込んだ魔法の回復量 @@ -496,7 +496,7 @@ bool restore_mana(player_type *player_ptr, bool magic_eater) return true; } -bool restore_all_status(player_type *player_ptr) +bool restore_all_status(PlayerType *player_ptr) { bool ident = false; if (do_res_stat(player_ptr, A_STR)) @@ -514,7 +514,7 @@ bool restore_all_status(player_type *player_ptr) return ident; } -bool fishing(player_type *player_ptr) +bool fishing(PlayerType *player_ptr) { DIRECTION dir; if (!get_direction(player_ptr, &dir, false, false)) @@ -548,7 +548,7 @@ bool fishing(player_type *player_ptr) * @details * 脱いで落とした装備にtimeoutを設定するために装備品のアドレスを返す。 */ -bool cosmic_cast_off(player_type *player_ptr, object_type **o_ptr_ptr) +bool cosmic_cast_off(PlayerType *player_ptr, object_type **o_ptr_ptr) { object_type *o_ptr = (*o_ptr_ptr); @@ -599,7 +599,7 @@ bool cosmic_cast_off(player_type *player_ptr, object_type **o_ptr_ptr) * @brief プレイヤーの因果混乱処理 / Apply Nexus * @param m_ptr 因果混乱をプレイヤーに与えたモンスターの情報参照ポインタ */ -void apply_nexus(monster_type *m_ptr, player_type *player_ptr) +void apply_nexus(monster_type *m_ptr, PlayerType *player_ptr) { switch (randint1(7)) { case 1: @@ -642,7 +642,7 @@ void apply_nexus(monster_type *m_ptr, player_type *player_ptr) * @brief プレイヤーのステータスシャッフル処理 * @param player_ptr プレイヤーへの参照ポインタ */ -void status_shuffle(player_type *player_ptr) +void status_shuffle(PlayerType *player_ptr) { /* Pick a pair of stats */ int i = randint0(A_MAX); diff --git a/src/spell/spells-status.h b/src/spell/spells-status.h index 75f162ad0..60a78466a 100644 --- a/src/spell/spells-status.h +++ b/src/spell/spells-status.h @@ -4,32 +4,32 @@ #include "spell/spells-util.h" struct object_type; -struct player_type; +class PlayerType; struct monster_type; -bool heal_monster(player_type *player_ptr, DIRECTION dir, HIT_POINT dam); -bool speed_monster(player_type *player_ptr, DIRECTION dir, int power); -bool slow_monster(player_type *player_ptr, DIRECTION dir, int power); -bool sleep_monster(player_type *player_ptr, DIRECTION dir, int power); -bool stasis_monster(player_type *player_ptr, DIRECTION dir); /* Like sleep, affects undead as well */ -bool stasis_evil(player_type *player_ptr, DIRECTION dir); /* Like sleep, affects undead as well */ -bool confuse_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); -bool stun_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); -bool fear_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); -bool poly_monster(player_type *player_ptr, DIRECTION dir, int power); -bool clone_monster(player_type *player_ptr, DIRECTION dir); -bool time_walk(player_type *player_ptr); -void roll_hitdice(player_type *player_ptr, spell_operation options); -bool life_stream(player_type *player_ptr, bool message, bool virtue_change); -bool heroism(player_type *player_ptr, int base); -bool berserk(player_type *player_ptr, int base); -bool cure_light_wounds(player_type *player_ptr, DICE_NUMBER dice, DICE_SID sides); -bool cure_serious_wounds(player_type *player_ptr, DICE_NUMBER dice, DICE_SID sides); -bool cure_critical_wounds(player_type *player_ptr, HIT_POINT pow); -bool true_healing(player_type *player_ptr, HIT_POINT pow); -bool restore_mana(player_type *player_ptr, bool magic_eater); -bool restore_all_status(player_type *player_ptr); +bool heal_monster(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam); +bool speed_monster(PlayerType *player_ptr, DIRECTION dir, int power); +bool slow_monster(PlayerType *player_ptr, DIRECTION dir, int power); +bool sleep_monster(PlayerType *player_ptr, DIRECTION dir, int power); +bool stasis_monster(PlayerType *player_ptr, DIRECTION dir); /* Like sleep, affects undead as well */ +bool stasis_evil(PlayerType *player_ptr, DIRECTION dir); /* Like sleep, affects undead as well */ +bool confuse_monster(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); +bool stun_monster(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); +bool fear_monster(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev); +bool poly_monster(PlayerType *player_ptr, DIRECTION dir, int power); +bool clone_monster(PlayerType *player_ptr, DIRECTION dir); +bool time_walk(PlayerType *player_ptr); +void roll_hitdice(PlayerType *player_ptr, spell_operation options); +bool life_stream(PlayerType *player_ptr, bool message, bool virtue_change); +bool heroism(PlayerType *player_ptr, int base); +bool berserk(PlayerType *player_ptr, int base); +bool cure_light_wounds(PlayerType *player_ptr, DICE_NUMBER dice, DICE_SID sides); +bool cure_serious_wounds(PlayerType *player_ptr, DICE_NUMBER dice, DICE_SID sides); +bool cure_critical_wounds(PlayerType *player_ptr, HIT_POINT pow); +bool true_healing(PlayerType *player_ptr, HIT_POINT pow); +bool restore_mana(PlayerType *player_ptr, bool magic_eater); +bool restore_all_status(PlayerType *player_ptr); -bool fishing(player_type *player_ptr); -bool cosmic_cast_off(player_type *player_ptr, object_type **o_ptr_ptr); -void apply_nexus(monster_type *m_ptr, player_type *player_ptr); -void status_shuffle(player_type *player_ptr); +bool fishing(PlayerType *player_ptr); +bool cosmic_cast_off(PlayerType *player_ptr, object_type **o_ptr_ptr); +void apply_nexus(monster_type *m_ptr, PlayerType *player_ptr); +void status_shuffle(PlayerType *player_ptr); diff --git a/src/spell/spells-summon.cpp b/src/spell/spells-summon.cpp index dd264209b..e73a41b2c 100644 --- a/src/spell/spells-summon.cpp +++ b/src/spell/spells-summon.cpp @@ -48,7 +48,7 @@ * @param mode モンスター生成条件フラグ * @return モンスターが(敵対も含めて)召還されたならばTRUEを返す。 */ -bool trump_summoning(player_type *player_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, summon_type type, BIT_FLAGS mode) +bool trump_summoning(PlayerType *player_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, summon_type type, BIT_FLAGS mode) { /* Default level */ PLAYER_LEVEL plev = player_ptr->lev; @@ -90,7 +90,7 @@ bool trump_summoning(player_type *player_ptr, int num, bool pet, POSITION y, POS return success; } -bool cast_summon_demon(player_type *player_ptr, int power) +bool cast_summon_demon(PlayerType *player_ptr, int power) { uint32_t flg = 0L; bool pet = !one_in_(3); @@ -114,7 +114,7 @@ bool cast_summon_demon(player_type *player_ptr, int power) return true; } -bool cast_summon_undead(player_type *player_ptr, int power) +bool cast_summon_undead(PlayerType *player_ptr, int power) { bool pet = one_in_(3); summon_type type = (player_ptr->lev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD); @@ -138,7 +138,7 @@ bool cast_summon_undead(player_type *player_ptr, int power) return true; } -bool cast_summon_hound(player_type *player_ptr, int power) +bool cast_summon_hound(PlayerType *player_ptr, int power) { BIT_FLAGS mode = PM_ALLOW_GROUP; bool pet = !one_in_(5); @@ -157,7 +157,7 @@ bool cast_summon_hound(player_type *player_ptr, int power) return true; } -bool cast_summon_elemental(player_type *player_ptr, int power) +bool cast_summon_elemental(PlayerType *player_ptr, int power) { bool pet = one_in_(3); BIT_FLAGS mode = 0L; @@ -179,7 +179,7 @@ bool cast_summon_elemental(player_type *player_ptr, int power) return true; } -bool cast_summon_octopus(player_type *player_ptr) +bool cast_summon_octopus(PlayerType *player_ptr) { BIT_FLAGS mode = PM_ALLOW_GROUP; bool pet = !one_in_(5); @@ -199,7 +199,7 @@ bool cast_summon_octopus(player_type *player_ptr) * @brief 悪魔領域のグレーターデーモン召喚を処理する / Daemon spell Summon Greater Demon * @return 処理を実行したならばTRUEを返す。 */ -bool cast_summon_greater_demon(player_type *player_ptr) +bool cast_summon_greater_demon(PlayerType *player_ptr) { concptr q = _("どの死体を捧げますか? ", "Sacrifice which corpse? "); concptr s = _("捧げられる死体を持っていない。", "You have nothing to scrifice."); @@ -232,7 +232,7 @@ bool cast_summon_greater_demon(player_type *player_ptr) * @param mode 召喚オプション * @return ターンを消費した場合TRUEを返す */ -bool summon_kin_player(player_type *player_ptr, DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode) +bool summon_kin_player(PlayerType *player_ptr, DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode) { bool pet = (bool)(mode & PM_FORCE_PET); if (!pet) @@ -248,7 +248,7 @@ bool summon_kin_player(player_type *player_ptr, DEPTH level, POSITION y, POSITIO * @param x 召喚位置X座標 * @return 作用が実際にあった場合TRUEを返す */ -int summon_cyber(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x) +int summon_cyber(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x) { /* Summoned by a monster */ BIT_FLAGS mode = PM_ALLOW_GROUP; @@ -271,7 +271,7 @@ int summon_cyber(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION return count; } -void mitokohmon(player_type *player_ptr) +void mitokohmon(PlayerType *player_ptr) { int count = 0; concptr sukekakusan = ""; @@ -329,7 +329,7 @@ void mitokohmon(player_type *player_ptr) * @return 作用が実際にあった場合TRUEを返す * @todo 引数にPOSITION x/yは必要か? 要調査 */ -int activate_hi_summon(player_type *player_ptr, POSITION y, POSITION x, bool can_pet) +int activate_hi_summon(PlayerType *player_ptr, POSITION y, POSITION x, bool can_pet) { BIT_FLAGS mode = PM_ALLOW_GROUP; bool pet = false; @@ -423,7 +423,7 @@ int activate_hi_summon(player_type *player_ptr, POSITION y, POSITION x, bool can * @param player_ptr プレイヤーへの参照ポインタ * @param dir 方向ID */ -void cast_invoke_spirits(player_type *player_ptr, DIRECTION dir) +void cast_invoke_spirits(PlayerType *player_ptr, DIRECTION dir) { PLAYER_LEVEL plev = player_ptr->lev; int die = randint1(100) + plev / 5; diff --git a/src/spell/spells-summon.h b/src/spell/spells-summon.h index 12fd33c6b..72bd842bb 100644 --- a/src/spell/spells-summon.h +++ b/src/spell/spells-summon.h @@ -5,16 +5,16 @@ enum summon_type : int; struct object_type; -struct player_type; -bool trump_summoning(player_type *player_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, summon_type type, BIT_FLAGS mode); -bool cast_summon_demon(player_type *player_ptr, int power); -bool cast_summon_undead(player_type *player_ptr, int power); -bool cast_summon_hound(player_type *player_ptr, int power); -bool cast_summon_elemental(player_type *player_ptr, int power); -bool cast_summon_octopus(player_type *player_ptr); -bool cast_summon_greater_demon(player_type *player_ptr); -bool summon_kin_player(player_type *player_ptr, DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode); -void mitokohmon(player_type *player_ptr); -int summon_cyber(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x); -int activate_hi_summon(player_type *player_ptr, POSITION y, POSITION x, bool can_pet); -void cast_invoke_spirits(player_type *player_ptr, DIRECTION dir); +class PlayerType; +bool trump_summoning(PlayerType *player_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, summon_type type, BIT_FLAGS mode); +bool cast_summon_demon(PlayerType *player_ptr, int power); +bool cast_summon_undead(PlayerType *player_ptr, int power); +bool cast_summon_hound(PlayerType *player_ptr, int power); +bool cast_summon_elemental(PlayerType *player_ptr, int power); +bool cast_summon_octopus(PlayerType *player_ptr); +bool cast_summon_greater_demon(PlayerType *player_ptr); +bool summon_kin_player(PlayerType *player_ptr, DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode); +void mitokohmon(PlayerType *player_ptr); +int summon_cyber(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x); +int activate_hi_summon(PlayerType *player_ptr, POSITION y, POSITION x, bool can_pet); +void cast_invoke_spirits(PlayerType *player_ptr, DIRECTION dir); diff --git a/src/status/action-setter.cpp b/src/status/action-setter.cpp index 4b5b89998..2023d56ca 100644 --- a/src/status/action-setter.cpp +++ b/src/status/action-setter.cpp @@ -32,7 +32,7 @@ * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_MONK_STANCE / #ACTION_SAMURAI_STANCE / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL * から選択。 */ -void set_action(player_type *player_ptr, uint8_t typ) +void set_action(PlayerType *player_ptr, uint8_t typ) { int prev_typ = player_ptr->action; if (typ == prev_typ) { diff --git a/src/status/action-setter.h b/src/status/action-setter.h index 09fe3f552..1b5ae6be9 100644 --- a/src/status/action-setter.h +++ b/src/status/action-setter.h @@ -2,5 +2,5 @@ #include -struct player_type; -void set_action(player_type *player_ptr, uint8_t typ); +class PlayerType; +void set_action(PlayerType *player_ptr, uint8_t typ); diff --git a/src/status/bad-status-setter.cpp b/src/status/bad-status-setter.cpp index 342c8da11..8bd10176f 100644 --- a/src/status/bad-status-setter.cpp +++ b/src/status/bad-status-setter.cpp @@ -25,7 +25,7 @@ #include "view/display-messages.h" #include -BadStatusSetter::BadStatusSetter(player_type *player_ptr) +BadStatusSetter::BadStatusSetter(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/status/bad-status-setter.h b/src/status/bad-status-setter.h index 80e4a89c8..2130c63f6 100644 --- a/src/status/bad-status-setter.h +++ b/src/status/bad-status-setter.h @@ -4,14 +4,14 @@ /*! * @details 仮引数がtmpなのは、全て範囲外の値を範囲内に収める処理が含まれるため - * @todo TIME_EFFECT型の引数はplayer_typeの時限ステータスをTimedEffectsクラスへ入れる時にshortへ差し替えること. + * @todo TIME_EFFECT型の引数はPlayerTypeの時限ステータスをTimedEffectsクラスへ入れる時にshortへ差し替えること. */ enum class PlayerCutRank; enum class PlayerStunRank; -struct player_type; +class PlayerType; class BadStatusSetter { public: - BadStatusSetter(player_type *player_ptr); + BadStatusSetter(PlayerType *player_ptr); virtual ~BadStatusSetter() = default; bool blindness(const TIME_EFFECT tmp_v); @@ -34,7 +34,7 @@ public: bool mod_cut(const TIME_EFFECT tmp_v); private: - player_type *player_ptr; + PlayerType *player_ptr; bool process_stun_effect(const short v); void process_stun_status(const PlayerStunRank new_rank, const short v); diff --git a/src/status/base-status.cpp b/src/status/base-status.cpp index deb7f35ec..58486106e 100644 --- a/src/status/base-status.cpp +++ b/src/status/base-status.cpp @@ -31,7 +31,7 @@ static concptr desc_stat_neg[] * Note that this function (used by stat potions) now restores\n * the stat BEFORE increasing it.\n */ -bool inc_stat(player_type *player_ptr, int stat) +bool inc_stat(PlayerType *player_ptr, int stat) { BASE_STATUS gain; BASE_STATUS value = player_ptr->stat_cur[stat]; @@ -79,7 +79,7 @@ bool inc_stat(player_type *player_ptr, int stat) * if your stat is already drained, the "max" value will not drop all\n * the way down to the "cur" value.\n */ -bool dec_stat(player_type *player_ptr, int stat, int amount, int permanent) +bool dec_stat(PlayerType *player_ptr, int stat, int amount, int permanent) { bool res = false; BASE_STATUS cur = player_ptr->stat_cur[stat]; @@ -161,7 +161,7 @@ bool dec_stat(player_type *player_ptr, int stat, int amount, int permanent) * @param stat 回復ステータスID * @return 実際に回復した場合TRUEを返す。 */ -bool res_stat(player_type *player_ptr, int stat) +bool res_stat(PlayerType *player_ptr, int stat) { if (player_ptr->stat_cur[stat] != player_ptr->stat_max[stat]) { player_ptr->stat_cur[stat] = player_ptr->stat_max[stat]; @@ -176,7 +176,7 @@ bool res_stat(player_type *player_ptr, int stat) /* * Lose a "point" */ -bool do_dec_stat(player_type *player_ptr, int stat) +bool do_dec_stat(PlayerType *player_ptr, int stat) { bool sust = false; switch (stat) { @@ -222,7 +222,7 @@ bool do_dec_stat(player_type *player_ptr, int stat) /* * Restore lost "points" in a stat */ -bool do_res_stat(player_type *player_ptr, int stat) +bool do_res_stat(PlayerType *player_ptr, int stat) { if (res_stat(player_ptr, stat)) { msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]); @@ -235,7 +235,7 @@ bool do_res_stat(player_type *player_ptr, int stat) /* * Gain a "point" in a stat */ -bool do_inc_stat(player_type *player_ptr, int stat) +bool do_inc_stat(PlayerType *player_ptr, int stat) { bool res = res_stat(player_ptr, stat); if (inc_stat(player_ptr, stat)) { @@ -263,7 +263,7 @@ bool do_inc_stat(player_type *player_ptr, int stat) /* * Forget everything */ -bool lose_all_info(player_type *player_ptr) +bool lose_all_info(PlayerType *player_ptr) { chg_virtue(player_ptr, V_KNOWLEDGE, -5); chg_virtue(player_ptr, V_ENLIGHTEN, -5); diff --git a/src/status/base-status.h b/src/status/base-status.h index 7711aba58..ea31c0651 100644 --- a/src/status/base-status.h +++ b/src/status/base-status.h @@ -1,10 +1,10 @@ #pragma once -struct player_type; -bool inc_stat(player_type *player_ptr, int stat); -bool dec_stat(player_type *player_ptr, int stat, int amount, int permanent); -bool res_stat(player_type *player_ptr, int stat); -bool do_dec_stat(player_type *player_ptr, int stat); -bool do_res_stat(player_type *player_ptr, int stat); -bool do_inc_stat(player_type *player_ptr, int stat); -bool lose_all_info(player_type *player_ptr); +class PlayerType; +bool inc_stat(PlayerType *player_ptr, int stat); +bool dec_stat(PlayerType *player_ptr, int stat, int amount, int permanent); +bool res_stat(PlayerType *player_ptr, int stat); +bool do_dec_stat(PlayerType *player_ptr, int stat); +bool do_res_stat(PlayerType *player_ptr, int stat); +bool do_inc_stat(PlayerType *player_ptr, int stat); +bool lose_all_info(PlayerType *player_ptr); diff --git a/src/status/body-improvement.cpp b/src/status/body-improvement.cpp index 618649796..4a4f3719d 100644 --- a/src/status/body-improvement.cpp +++ b/src/status/body-improvement.cpp @@ -19,7 +19,7 @@ * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_protevil(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_protevil(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -61,7 +61,7 @@ bool set_protevil(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_invuln(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_invuln(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -121,7 +121,7 @@ bool set_invuln(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_regen(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_regen(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -164,7 +164,7 @@ bool set_tim_regen(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_reflect(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_reflect(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -207,7 +207,7 @@ bool set_tim_reflect(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_pass_wall(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_pass_wall(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; diff --git a/src/status/body-improvement.h b/src/status/body-improvement.h index 8cda63c62..67114a796 100644 --- a/src/status/body-improvement.h +++ b/src/status/body-improvement.h @@ -2,9 +2,9 @@ #include "system/angband.h" -struct player_type; -bool set_protevil(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_invuln(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tim_regen(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tim_reflect(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_pass_wall(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +bool set_protevil(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_invuln(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tim_regen(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tim_reflect(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_pass_wall(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); diff --git a/src/status/buff-setter.cpp b/src/status/buff-setter.cpp index e6b569a8f..603810558 100644 --- a/src/status/buff-setter.cpp +++ b/src/status/buff-setter.cpp @@ -26,7 +26,7 @@ /*! * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags */ -void reset_tim_flags(player_type *player_ptr) +void reset_tim_flags(PlayerType *player_ptr) { auto effects = player_ptr->effects(); player_ptr->fast = 0; /* Timed -- Fast */ @@ -110,7 +110,7 @@ void reset_tim_flags(player_type *player_ptr) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_fast(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_fast(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -152,7 +152,7 @@ bool set_fast(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_shield(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_shield(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -194,7 +194,7 @@ bool set_shield(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_magicdef(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_magicdef(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -236,7 +236,7 @@ bool set_magicdef(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_blessed(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_blessed(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -278,7 +278,7 @@ bool set_blessed(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_hero(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_hero(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -322,7 +322,7 @@ bool set_hero(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_mimic(player_type *player_ptr, TIME_EFFECT v, int16_t mimic_race_idx, bool do_dec) +bool set_mimic(PlayerType *player_ptr, TIME_EFFECT v, int16_t mimic_race_idx, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -372,7 +372,7 @@ bool set_mimic(player_type *player_ptr, TIME_EFFECT v, int16_t mimic_race_idx, b * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_shero(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_shero(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -420,7 +420,7 @@ bool set_shero(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_wraith_form(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_wraith_form(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -476,7 +476,7 @@ bool set_wraith_form(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tsuyoshi(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tsuyoshi(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; diff --git a/src/status/buff-setter.h b/src/status/buff-setter.h index 71029da2b..bb3a98b8f 100644 --- a/src/status/buff-setter.h +++ b/src/status/buff-setter.h @@ -2,14 +2,14 @@ #include "system/angband.h" -struct player_type; -void reset_tim_flags(player_type *player_ptr); -bool set_fast(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_shield(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_magicdef(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_blessed(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_hero(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_mimic(player_type *player_ptr, TIME_EFFECT v, int16_t mimic_race_idx, bool do_dec); -bool set_shero(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_wraith_form(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tsuyoshi(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +void reset_tim_flags(PlayerType *player_ptr); +bool set_fast(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_shield(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_magicdef(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_blessed(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_hero(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_mimic(PlayerType *player_ptr, TIME_EFFECT v, int16_t mimic_race_idx, bool do_dec); +bool set_shero(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_wraith_form(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tsuyoshi(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); diff --git a/src/status/element-resistance.cpp b/src/status/element-resistance.cpp index f5754b6ce..ddd48912f 100644 --- a/src/status/element-resistance.cpp +++ b/src/status/element-resistance.cpp @@ -19,7 +19,7 @@ * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_oppose_acid(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_oppose_acid(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -60,7 +60,7 @@ bool set_oppose_acid(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_oppose_elec(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_oppose_elec(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -102,7 +102,7 @@ bool set_oppose_elec(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_oppose_fire(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_oppose_fire(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -145,7 +145,7 @@ bool set_oppose_fire(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_oppose_cold(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_oppose_cold(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -186,7 +186,7 @@ bool set_oppose_cold(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_oppose_pois(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_oppose_pois(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -222,29 +222,29 @@ bool set_oppose_pois(player_type *player_ptr, TIME_EFFECT v, bool do_dec) return true; } -bool is_oppose_acid(player_type *player_ptr) +bool is_oppose_acid(PlayerType *player_ptr) { return player_ptr->oppose_acid || music_singing(player_ptr, MUSIC_RESIST) || PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU); } -bool is_oppose_elec(player_type *player_ptr) +bool is_oppose_elec(PlayerType *player_ptr) { return player_ptr->oppose_elec || music_singing(player_ptr, MUSIC_RESIST) || PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU); } -bool is_oppose_fire(player_type *player_ptr) +bool is_oppose_fire(PlayerType *player_ptr) { return player_ptr->oppose_fire || music_singing(player_ptr, MUSIC_RESIST) || (PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU) || (player_ptr->mimic_form == MIMIC_DEMON) || (PlayerRace(player_ptr).equals(PlayerRaceType::BALROG) && player_ptr->lev > 44)); } -bool is_oppose_cold(player_type *player_ptr) +bool is_oppose_cold(PlayerType *player_ptr) { return player_ptr->oppose_cold || music_singing(player_ptr, MUSIC_RESIST) || PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU); } -bool is_oppose_pois(player_type *player_ptr) +bool is_oppose_pois(PlayerType *player_ptr) { return player_ptr->oppose_pois || music_singing(player_ptr, MUSIC_RESIST) || (PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU) || (player_ptr->pclass == PlayerClassType::NINJA && player_ptr->lev > 44)); diff --git a/src/status/element-resistance.h b/src/status/element-resistance.h index 286881712..af8f57d77 100644 --- a/src/status/element-resistance.h +++ b/src/status/element-resistance.h @@ -2,14 +2,14 @@ #include "system/angband.h" -struct player_type; -bool set_oppose_acid(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_oppose_elec(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_oppose_fire(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_oppose_cold(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_oppose_pois(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool is_oppose_acid(player_type *player_ptr); -bool is_oppose_elec(player_type *player_ptr); -bool is_oppose_fire(player_type *player_ptr); -bool is_oppose_cold(player_type *player_ptr); -bool is_oppose_pois(player_type *player_ptr); +class PlayerType; +bool set_oppose_acid(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_oppose_elec(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_oppose_fire(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_oppose_cold(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_oppose_pois(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool is_oppose_acid(PlayerType *player_ptr); +bool is_oppose_elec(PlayerType *player_ptr); +bool is_oppose_fire(PlayerType *player_ptr); +bool is_oppose_cold(PlayerType *player_ptr); +bool is_oppose_pois(PlayerType *player_ptr); diff --git a/src/status/experience.cpp b/src/status/experience.cpp index 7bcac15e7..e41c8d6aa 100644 --- a/src/status/experience.cpp +++ b/src/status/experience.cpp @@ -6,7 +6,7 @@ /* * Gain experience */ -void gain_exp_64(player_type *player_ptr, int32_t amount, uint32_t amount_frac) +void gain_exp_64(PlayerType *player_ptr, int32_t amount, uint32_t amount_frac) { if (player_ptr->is_dead) return; @@ -25,12 +25,12 @@ void gain_exp_64(player_type *player_ptr, int32_t amount, uint32_t amount_frac) /* * Gain experience */ -void gain_exp(player_type *player_ptr, int32_t amount) { gain_exp_64(player_ptr, amount, 0L); } +void gain_exp(PlayerType *player_ptr, int32_t amount) { gain_exp_64(player_ptr, amount, 0L); } /* * Lose experience */ -void lose_exp(player_type *player_ptr, int32_t amount) +void lose_exp(PlayerType *player_ptr, int32_t amount) { if (player_ptr->prace == PlayerRaceType::ANDROID) return; @@ -45,7 +45,7 @@ void lose_exp(player_type *player_ptr, int32_t amount) /* * Restores any drained experience */ -bool restore_level(player_type *player_ptr) +bool restore_level(PlayerType *player_ptr) { if (player_ptr->exp < player_ptr->max_exp) { msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning.")); @@ -61,7 +61,7 @@ bool restore_level(player_type *player_ptr) * Drain experience * If resisted to draining, return FALSE */ -bool drain_exp(player_type *player_ptr, int32_t drain, int32_t slip, int hold_exp_prob) +bool drain_exp(PlayerType *player_ptr, int32_t drain, int32_t slip, int hold_exp_prob) { if (player_ptr->prace == PlayerRaceType::ANDROID) return false; diff --git a/src/status/experience.h b/src/status/experience.h index 7549aae68..978a7f25c 100644 --- a/src/status/experience.h +++ b/src/status/experience.h @@ -2,9 +2,9 @@ #include "system/angband.h" -struct player_type; -void gain_exp_64(player_type *player_ptr, int32_t amount, uint32_t amount_frac); -void gain_exp(player_type *player_ptr, int32_t amount); -bool restore_level(player_type *player_ptr); -void lose_exp(player_type *player_ptr, int32_t amount); -bool drain_exp(player_type *player_ptr, int32_t drain, int32_t slip, int hold_exp_prob); +class PlayerType; +void gain_exp_64(PlayerType *player_ptr, int32_t amount, uint32_t amount_frac); +void gain_exp(PlayerType *player_ptr, int32_t amount); +bool restore_level(PlayerType *player_ptr); +void lose_exp(PlayerType *player_ptr, int32_t amount); +bool drain_exp(PlayerType *player_ptr, int32_t drain, int32_t slip, int hold_exp_prob); diff --git a/src/status/shape-changer.cpp b/src/status/shape-changer.cpp index cbcc964dd..8cd91f1f0 100644 --- a/src/status/shape-changer.cpp +++ b/src/status/shape-changer.cpp @@ -27,7 +27,7 @@ #include "util/enum-converter.h" #include "view/display-messages.h" -void do_poly_wounds(player_type *player_ptr) +void do_poly_wounds(PlayerType *player_ptr) { int16_t hit_p = (player_ptr->mhp - player_ptr->chp); int16_t change = damroll(player_ptr->lev, 5); @@ -52,7 +52,7 @@ void do_poly_wounds(player_type *player_ptr) /* * Change player race */ -void change_race(player_type *player_ptr, PlayerRaceType new_race, concptr effect_msg) +void change_race(PlayerType *player_ptr, PlayerRaceType new_race, concptr effect_msg) { concptr title = race_info[enum2i(new_race)].title; PlayerRaceType old_race = player_ptr->prace; @@ -100,7 +100,7 @@ void change_race(player_type *player_ptr, PlayerRaceType new_race, concptr effec lite_spot(player_ptr, player_ptr->y, player_ptr->x); } -void do_poly_self(player_type *player_ptr) +void do_poly_self(PlayerType *player_ptr) { int power = player_ptr->lev; diff --git a/src/status/shape-changer.h b/src/status/shape-changer.h index da3c58067..2c160776f 100644 --- a/src/status/shape-changer.h +++ b/src/status/shape-changer.h @@ -3,7 +3,7 @@ #include "player-info/race-types.h" #include "system/angband.h" -struct player_type; -void do_poly_self(player_type *player_ptr); -void do_poly_wounds(player_type *player_ptr); -void change_race(player_type *player_ptr, PlayerRaceType new_race, concptr effect_msg); +class PlayerType; +void do_poly_self(PlayerType *player_ptr); +void do_poly_wounds(PlayerType *player_ptr); +void change_race(PlayerType *player_ptr, PlayerRaceType new_race, concptr effect_msg); diff --git a/src/status/sight-setter.cpp b/src/status/sight-setter.cpp index a2ae6e468..646a5e6a9 100644 --- a/src/status/sight-setter.cpp +++ b/src/status/sight-setter.cpp @@ -16,7 +16,7 @@ * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_esp(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_esp(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -59,7 +59,7 @@ bool set_tim_esp(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_invis(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_invis(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -102,7 +102,7 @@ bool set_tim_invis(player_type *player_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_infra(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_infra(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; diff --git a/src/status/sight-setter.h b/src/status/sight-setter.h index 9159d9b8d..1bb7180a8 100644 --- a/src/status/sight-setter.h +++ b/src/status/sight-setter.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -bool set_tim_esp(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tim_invis(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tim_infra(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +bool set_tim_esp(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tim_invis(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tim_infra(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); diff --git a/src/status/temporary-resistance.cpp b/src/status/temporary-resistance.cpp index cbe598478..4cc61c9f3 100644 --- a/src/status/temporary-resistance.cpp +++ b/src/status/temporary-resistance.cpp @@ -13,7 +13,7 @@ * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_levitation(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_levitation(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -49,7 +49,7 @@ bool set_tim_levitation(player_type *player_ptr, TIME_EFFECT v, bool do_dec) return true; } -bool set_ultimate_res(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_ultimate_res(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -88,7 +88,7 @@ bool set_ultimate_res(player_type *player_ptr, TIME_EFFECT v, bool do_dec) return true; } -bool set_tim_res_nether(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_res_nether(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; @@ -126,7 +126,7 @@ bool set_tim_res_nether(player_type *player_ptr, TIME_EFFECT v, bool do_dec) return true; } -bool set_tim_res_time(player_type *player_ptr, TIME_EFFECT v, bool do_dec) +bool set_tim_res_time(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec) { bool notice = false; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; diff --git a/src/status/temporary-resistance.h b/src/status/temporary-resistance.h index c341d9b19..416f8a8e3 100644 --- a/src/status/temporary-resistance.h +++ b/src/status/temporary-resistance.h @@ -2,8 +2,8 @@ #include "system/angband.h" -struct player_type; -bool set_tim_levitation(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_ultimate_res(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tim_res_nether(player_type *player_ptr, TIME_EFFECT v, bool do_dec); -bool set_tim_res_time(player_type *player_ptr, TIME_EFFECT v, bool do_dec); +class PlayerType; +bool set_tim_levitation(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_ultimate_res(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tim_res_nether(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); +bool set_tim_res_time(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec); diff --git a/src/store/black-market.cpp b/src/store/black-market.cpp index 066b0c25e..ce3e7fcfe 100644 --- a/src/store/black-market.cpp +++ b/src/store/black-market.cpp @@ -17,7 +17,7 @@ * Based on a suggestion by "Lee Vogt" * */ -bool black_market_crap(player_type *player_ptr, object_type *o_ptr) +bool black_market_crap(PlayerType *player_ptr, object_type *o_ptr) { if (o_ptr->is_ego()) return false; diff --git a/src/store/black-market.h b/src/store/black-market.h index 772815c83..36d8673d4 100644 --- a/src/store/black-market.h +++ b/src/store/black-market.h @@ -1,5 +1,5 @@ #pragma once struct object_type; -struct player_type; -bool black_market_crap(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool black_market_crap(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/store/cmd-store.cpp b/src/store/cmd-store.cpp index 2a71e6d16..57bed12b1 100644 --- a/src/store/cmd-store.cpp +++ b/src/store/cmd-store.cpp @@ -51,7 +51,7 @@ * (cast magic) into "g" (get), and "s" (search) into "d" (drop). * */ -void do_cmd_store(player_type *player_ptr) +void do_cmd_store(PlayerType *player_ptr) { if (player_ptr->wild_mode) return; diff --git a/src/store/cmd-store.h b/src/store/cmd-store.h index 925bbf266..42d37211d 100644 --- a/src/store/cmd-store.h +++ b/src/store/cmd-store.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_store(player_type *player_ptr); +class PlayerType; +void do_cmd_store(PlayerType *player_ptr); diff --git a/src/store/home.cpp b/src/store/home.cpp index 2cdd95787..cbc3137a4 100644 --- a/src/store/home.cpp +++ b/src/store/home.cpp @@ -23,7 +23,7 @@ * known, the player may have to pick stuff up and drop it again. * */ -int home_carry(player_type *player_ptr, object_type *o_ptr) +int home_carry(PlayerType *player_ptr, object_type *o_ptr) { bool old_stack_force_notes = stack_force_notes; bool old_stack_force_costs = stack_force_costs; @@ -129,7 +129,7 @@ static void sweep_reorder_store_item(object_type *o_ptr, const int i, bool *comb } } -static void exe_reorder_store_item(player_type *player_ptr, bool *flag) +static void exe_reorder_store_item(PlayerType *player_ptr, bool *flag) { for (int i = 0; i < st_ptr->stock_num; i++) { object_type *o_ptr; @@ -164,7 +164,7 @@ static void exe_reorder_store_item(player_type *player_ptr, bool *flag) * @param store_num 店舗ID * @return 実際に整理が行われたならばTRUEを返す。 */ -bool combine_and_reorder_home(player_type *player_ptr, const StoreSaleType store_num) +bool combine_and_reorder_home(PlayerType *player_ptr, const StoreSaleType store_num) { bool old_stack_force_notes = stack_force_notes; bool old_stack_force_costs = stack_force_costs; diff --git a/src/store/home.h b/src/store/home.h index 90ab1d758..710d29234 100644 --- a/src/store/home.h +++ b/src/store/home.h @@ -1,7 +1,7 @@ #pragma once struct object_type; -struct player_type; +class PlayerType; enum class StoreSaleType; -int home_carry(player_type *player_ptr, object_type *o_ptr); -bool combine_and_reorder_home(player_type *player_ptr, const StoreSaleType store_num); +int home_carry(PlayerType *player_ptr, object_type *o_ptr); +bool combine_and_reorder_home(PlayerType *player_ptr, const StoreSaleType store_num); diff --git a/src/store/museum.cpp b/src/store/museum.cpp index 3608dbd36..4840a091e 100644 --- a/src/store/museum.cpp +++ b/src/store/museum.cpp @@ -13,7 +13,7 @@ * Remove an item from museum (Originally from TOband) * @param player_ptr プレイヤーへの参照ポインタ */ -void museum_remove_object(player_type *player_ptr) +void museum_remove_object(PlayerType *player_ptr) { if (st_ptr->stock_num <= 0) { msg_print(_("博物館には何も置いてありません。", "The Museum is empty.")); diff --git a/src/store/museum.h b/src/store/museum.h index 2e490a14d..e6a8db0a6 100644 --- a/src/store/museum.h +++ b/src/store/museum.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void museum_remove_object(player_type *player_ptr); +class PlayerType; +void museum_remove_object(PlayerType *player_ptr); diff --git a/src/store/pricing.cpp b/src/store/pricing.cpp index 8908ae6b0..f009d949d 100644 --- a/src/store/pricing.cpp +++ b/src/store/pricing.cpp @@ -31,7 +31,7 @@ * "greed" value is always something (?). * */ -PRICE price_item(player_type *player_ptr, object_type *o_ptr, int greed, bool flip) +PRICE price_item(PlayerType *player_ptr, object_type *o_ptr, int greed, bool flip) { PRICE price = object_value(o_ptr); if (price <= 0) diff --git a/src/store/pricing.h b/src/store/pricing.h index ed8372f0b..4d6725d65 100644 --- a/src/store/pricing.h +++ b/src/store/pricing.h @@ -5,5 +5,5 @@ #define LOW_PRICE_THRESHOLD 10L struct object_type; -struct player_type; -PRICE price_item(player_type *player_ptr, object_type *o_ptr, int greed, bool flip); +class PlayerType; +PRICE price_item(PlayerType *player_ptr, object_type *o_ptr, int greed, bool flip); diff --git a/src/store/purchase-order.cpp b/src/store/purchase-order.cpp index 8505f3fea..ca585aa8c 100644 --- a/src/store/purchase-order.cpp +++ b/src/store/purchase-order.cpp @@ -46,7 +46,7 @@ * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す / * Return TRUE if purchase is NOT successful */ -static std::optional prompt_to_buy(player_type *player_ptr, object_type *o_ptr) +static std::optional prompt_to_buy(PlayerType *player_ptr, object_type *o_ptr) { auto price_ask = price_item(player_ptr, o_ptr, ot_ptr->inflate, false); @@ -97,7 +97,7 @@ static bool show_store_select_item(COMMAND_CODE *item, const int i) * @param i お店のストック数(アドレス渡し) * @param 取得元インベントリ番号 */ -static void take_item_from_home(player_type *player_ptr, object_type *o_ptr, object_type *j_ptr, const COMMAND_CODE item) +static void take_item_from_home(PlayerType *player_ptr, object_type *o_ptr, object_type *j_ptr, const COMMAND_CODE item) { const int amt = j_ptr->number; distribute_charges(o_ptr, j_ptr, amt); @@ -131,7 +131,7 @@ static void take_item_from_home(player_type *player_ptr, object_type *o_ptr, obj chg_virtue(player_ptr, V_SACRIFICE, 1); } -static void shuffle_store(player_type *player_ptr) +static void shuffle_store(PlayerType *player_ptr) { if (!one_in_(STORE_SHUFFLE)) { msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock.")); @@ -148,7 +148,7 @@ static void shuffle_store(player_type *player_ptr) prt(buf, 3, 50); } -static void switch_store_stock(player_type *player_ptr, const int i, const COMMAND_CODE item) +static void switch_store_stock(PlayerType *player_ptr, const int i, const COMMAND_CODE item) { if (st_ptr->stock_num == 0) { shuffle_store(player_ptr); @@ -175,7 +175,7 @@ static void switch_store_stock(player_type *player_ptr, const int i, const COMMA * Buy an item from a store -RAK- * @param player_ptr プレイヤーへの参照ポインタ */ -void store_purchase(player_type *player_ptr) +void store_purchase(PlayerType *player_ptr) { if (cur_store_num == StoreSaleType::MUSEUM) { msg_print(_("博物館から取り出すことはできません。", "Items cannot be taken out of the Museum.")); diff --git a/src/store/purchase-order.h b/src/store/purchase-order.h index 282163a01..5681af183 100644 --- a/src/store/purchase-order.h +++ b/src/store/purchase-order.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void store_purchase(player_type *player_ptr); +class PlayerType; +void store_purchase(PlayerType *player_ptr); diff --git a/src/store/rumor.cpp b/src/store/rumor.cpp index f2bbf1e66..054ea1848 100644 --- a/src/store/rumor.cpp +++ b/src/store/rumor.cpp @@ -41,7 +41,7 @@ concptr rumor_bind_name(char *base, concptr fullname) return v; } -void display_rumor(player_type *player_ptr, bool ex) +void display_rumor(PlayerType *player_ptr, bool ex) { char rumor[1024]; int section = (ex && (randint0(3) == 0)) ? 1 : 0; diff --git a/src/store/rumor.h b/src/store/rumor.h index 5430c6bbe..1b81fc78b 100644 --- a/src/store/rumor.h +++ b/src/store/rumor.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void display_rumor(player_type *player_ptr, bool ex); +class PlayerType; +void display_rumor(PlayerType *player_ptr, bool ex); diff --git a/src/store/say-comments.cpp b/src/store/say-comments.cpp index 80d6c5d36..7a7c178e6 100644 --- a/src/store/say-comments.cpp +++ b/src/store/say-comments.cpp @@ -15,7 +15,7 @@ * Successful haggle. * @param player_ptr プレイヤーへの参照ポインタ */ -void store_owner_says_comment(player_type *player_ptr) +void store_owner_says_comment(PlayerType *player_ptr) { if (cur_store_num == StoreSaleType::BLACK) msg_print(comment_1_B[randint0(MAX_COMMENT_1)]); @@ -37,7 +37,7 @@ void store_owner_says_comment(player_type *player_ptr) * @details * We paid "price", it was worth "value", and we thought it was worth "guess" */ -void purchase_analyze(player_type *player_ptr, PRICE price, PRICE value, PRICE guess) +void purchase_analyze(PlayerType *player_ptr, PRICE price, PRICE value, PRICE guess) { /* Item was worthless, but we bought it */ if ((value <= 0) && (price > value)) { diff --git a/src/store/say-comments.h b/src/store/say-comments.h index 733ff6da8..63c0f26c8 100644 --- a/src/store/say-comments.h +++ b/src/store/say-comments.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void store_owner_says_comment(player_type *player_ptr); -void purchase_analyze(player_type *player_ptr, PRICE price, PRICE value, PRICE guess); +class PlayerType; +void store_owner_says_comment(PlayerType *player_ptr); +void purchase_analyze(PlayerType *player_ptr, PRICE price, PRICE value, PRICE guess); diff --git a/src/store/sell-order.cpp b/src/store/sell-order.cpp index d5e50c00c..d7ab5382e 100644 --- a/src/store/sell-order.cpp +++ b/src/store/sell-order.cpp @@ -48,7 +48,7 @@ * @param o_ptr オブジェクトの構造体参照ポインタ * @return 売るなら(true,売値)、売らないなら(false,0)のタプル */ -static std::optional prompt_to_sell(player_type *player_ptr, object_type *o_ptr) +static std::optional prompt_to_sell(PlayerType *player_ptr, object_type *o_ptr) { auto price_ask = price_item(player_ptr, o_ptr, ot_ptr->inflate, true); @@ -67,7 +67,7 @@ static std::optional prompt_to_sell(player_type *player_ptr, object_type * Sell an item to the store (or home) * @param player_ptr プレイヤーへの参照ポインタ */ -void store_sell(player_type *player_ptr) +void store_sell(PlayerType *player_ptr) { concptr q; //!< @note プロンプトメッセージ concptr s_none; //!< @note 売る/置くものがない場合のメッセージ diff --git a/src/store/sell-order.h b/src/store/sell-order.h index c39cb7dfc..0615dc3db 100644 --- a/src/store/sell-order.h +++ b/src/store/sell-order.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void store_sell(player_type *player_ptr); +class PlayerType; +void store_sell(PlayerType *player_ptr); diff --git a/src/store/service-checker.cpp b/src/store/service-checker.cpp index 97aa227f6..0f613b20d 100644 --- a/src/store/service-checker.cpp +++ b/src/store/service-checker.cpp @@ -210,7 +210,7 @@ static bool switch_store_check(const object_type *o_ptr) * @note * Note that a shop-keeper must refuse to buy "worthless" items */ -bool store_will_buy(player_type *, const object_type *o_ptr) +bool store_will_buy(PlayerType *, const object_type *o_ptr) { if ((cur_store_num == StoreSaleType::HOME) || (cur_store_num == StoreSaleType::MUSEUM)) return true; @@ -409,7 +409,7 @@ static byte decide_discount_rate(const PRICE cost) * Some objects can be sold at a "discount" (in small piles) * */ -void mass_produce(player_type *, object_type *o_ptr) +void mass_produce(PlayerType *, object_type *o_ptr) { const PRICE cost = object_value(o_ptr); int size = switch_mass_production(o_ptr, cost); diff --git a/src/store/service-checker.h b/src/store/service-checker.h index 577d5c93e..e0a93ca0b 100644 --- a/src/store/service-checker.h +++ b/src/store/service-checker.h @@ -1,6 +1,6 @@ #pragma once struct object_type; -struct player_type; -bool store_will_buy(player_type *player_ptr, const object_type *o_ptr); -void mass_produce(player_type *player_ptr, object_type *o_ptr); +class PlayerType; +bool store_will_buy(PlayerType *player_ptr, const object_type *o_ptr); +void mass_produce(PlayerType *player_ptr, object_type *o_ptr); diff --git a/src/store/store-key-processor.cpp b/src/store/store-key-processor.cpp index 007ad7b80..d7bf88fcc 100644 --- a/src/store/store-key-processor.cpp +++ b/src/store/store-key-processor.cpp @@ -50,7 +50,7 @@ bool leave_store = false; * but not in the stores, to prevent chaos. * */ -void store_process_command(player_type *player_ptr) +void store_process_command(PlayerType *player_ptr) { repeat_check(); if (rogue_like_commands && (command_cmd == 'l')) diff --git a/src/store/store-key-processor.h b/src/store/store-key-processor.h index abc37b061..e4c8ee494 100644 --- a/src/store/store-key-processor.h +++ b/src/store/store-key-processor.h @@ -2,5 +2,5 @@ extern bool leave_store; -struct player_type; -void store_process_command(player_type *player_ptr); +class PlayerType; +void store_process_command(PlayerType *player_ptr); diff --git a/src/store/store-util.cpp b/src/store/store-util.cpp index 0cecbbe91..be0bd41e2 100644 --- a/src/store/store-util.cpp +++ b/src/store/store-util.cpp @@ -127,7 +127,7 @@ static std::vector store_same_magic_device_pvals(object_type *j * */ void store_create( - player_type *player_ptr, KIND_OBJECT_IDX fix_k_idx, black_market_crap_pf black_market_crap, store_will_buy_pf store_will_buy, mass_produce_pf mass_produce) + PlayerType *player_ptr, KIND_OBJECT_IDX fix_k_idx, black_market_crap_pf black_market_crap, store_will_buy_pf store_will_buy, mass_produce_pf mass_produce) { if (st_ptr->stock_num >= st_ptr->stock_size) return; diff --git a/src/store/store-util.h b/src/store/store-util.h index f5dbab5d2..261ca9a1e 100644 --- a/src/store/store-util.h +++ b/src/store/store-util.h @@ -54,12 +54,12 @@ struct store_type { extern StoreSaleType cur_store_num; extern store_type *st_ptr; -struct player_type; -typedef bool (*black_market_crap_pf)(player_type *, object_type *); -typedef bool (*store_will_buy_pf)(player_type *, const object_type *); -typedef void (*mass_produce_pf)(player_type *, object_type *); +class PlayerType; +typedef bool (*black_market_crap_pf)(PlayerType *, object_type *); +typedef bool (*store_will_buy_pf)(PlayerType *, const object_type *); +typedef void (*mass_produce_pf)(PlayerType *, object_type *); void store_delete(void); -void store_create(player_type *player_ptr, KIND_OBJECT_IDX k_idx, black_market_crap_pf black_market_crap, store_will_buy_pf store_will_buy, mass_produce_pf mass_produce); +void store_create(PlayerType *player_ptr, KIND_OBJECT_IDX k_idx, black_market_crap_pf black_market_crap, store_will_buy_pf store_will_buy, mass_produce_pf mass_produce); void store_item_increase(INVENTORY_IDX item, ITEM_NUMBER num); void store_item_optimize(INVENTORY_IDX item); int store_carry(object_type *o_ptr); diff --git a/src/store/store.cpp b/src/store/store.cpp index b4d3e38d8..ce9513004 100644 --- a/src/store/store.cpp +++ b/src/store/store.cpp @@ -195,7 +195,7 @@ int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j) * @brief 店のアイテムを調べるコマンドのメインルーチン / * Examine an item in a store -JDL- */ -void store_examine(player_type *player_ptr) +void store_examine(PlayerType *player_ptr) { if (st_ptr->stock_num <= 0) { if (cur_store_num == StoreSaleType::HOME) @@ -237,7 +237,7 @@ void store_examine(player_type *player_ptr) * Shuffle one of the stores. * @param which 店舗種類のID */ -void store_shuffle(player_type *player_ptr, StoreSaleType which) +void store_shuffle(PlayerType *player_ptr, StoreSaleType which) { if ((which == StoreSaleType::HOME) || (which == StoreSaleType::MUSEUM)) return; @@ -287,7 +287,7 @@ void store_shuffle(player_type *player_ptr, StoreSaleType which) * @param store_num 店舗種類のID * @param chance 更新商品数 */ -void store_maintenance(player_type *player_ptr, int town_num, StoreSaleType store_num, int chance) +void store_maintenance(PlayerType *player_ptr, int town_num, StoreSaleType store_num, int chance) { cur_store_num = store_num; if ((store_num == StoreSaleType::HOME) || (store_num == StoreSaleType::MUSEUM)) diff --git a/src/store/store.h b/src/store/store.h index fcaf50ba1..1cbfe9bac 100644 --- a/src/store/store.h +++ b/src/store/store.h @@ -22,11 +22,11 @@ extern int16_t inner_town_num; extern int cur_store_feat; extern bool allow_inc; -struct player_type; +class PlayerType; int16_t store_get_stock_max(StoreSaleType sst, bool powerup = true); -void store_shuffle(player_type *player_ptr, StoreSaleType which); -void store_maintenance(player_type *player_ptr, int town_num, StoreSaleType store_num, int chance); +void store_shuffle(PlayerType *player_ptr, StoreSaleType which); +void store_maintenance(PlayerType *player_ptr, int town_num, StoreSaleType store_num, int chance); void store_init(int town_num, StoreSaleType store_num); -void store_examine(player_type *player_ptr); +void store_examine(PlayerType *player_ptr); int store_check_num(object_type *o_ptr); int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j); diff --git a/src/system/object-type-definition.h b/src/system/object-type-definition.h index daa7b363a..b0acd16cf 100644 --- a/src/system/object-type-definition.h +++ b/src/system/object-type-definition.h @@ -20,7 +20,7 @@ enum class ItemKindType : short; enum class SmithEffectType : int16_t; enum class RandomArtActType : short; -struct player_type; +class PlayerType; typedef struct object_type { KIND_OBJECT_IDX k_idx{}; /*!< Kind index (zero if "dead") */ POSITION iy{}; /*!< Y-position on map, or zero */ diff --git a/src/system/player-type-definition.cpp b/src/system/player-type-definition.cpp index 6c30be7ea..2d1593cce 100644 --- a/src/system/player-type-definition.cpp +++ b/src/system/player-type-definition.cpp @@ -5,19 +5,19 @@ /*! * @brief プレイヤー構造体実体 / Static player info record */ -player_type p_body; +PlayerType p_body; /*! * @brief プレイヤー構造体へのグローバル参照ポインタ / Pointer to the player info */ -player_type *p_ptr = &p_body; +PlayerType *p_ptr = &p_body; -player_type::player_type() +PlayerType::PlayerType() : timed_effects(std::make_shared()) { } -std::shared_ptr player_type::effects() const +std::shared_ptr PlayerType::effects() const { return this->timed_effects; } diff --git a/src/system/player-type-definition.h b/src/system/player-type-definition.h index 80c79fc82..31f7f384a 100644 --- a/src/system/player-type-definition.h +++ b/src/system/player-type-definition.h @@ -22,9 +22,9 @@ enum class MonsterAbilityType; struct floor_type; struct object_type; class TimedEffects; -struct player_type { +class PlayerType { public: - player_type(); + PlayerType(); int player_uid{}; int player_euid{}; int player_egid{}; @@ -418,4 +418,4 @@ private: std::shared_ptr timed_effects; }; -extern player_type *p_ptr; +extern PlayerType *p_ptr; diff --git a/src/target/grid-selector.cpp b/src/target/grid-selector.cpp index 8ceeefa8c..c988a5840 100644 --- a/src/target/grid-selector.cpp +++ b/src/target/grid-selector.cpp @@ -28,7 +28,7 @@ * XAngband: determine if a given location is "interesting" * based on target_set_accept function. */ -static bool tgt_pt_accept(player_type *player_ptr, POSITION y, POSITION x) +static bool tgt_pt_accept(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!(in_bounds(floor_ptr, y, x))) @@ -59,7 +59,7 @@ static bool tgt_pt_accept(player_type *player_ptr, POSITION y, POSITION x) * XAngband: Prepare the "temp" array for "tget_pt" * based on target_set_prepare funciton. */ -static void tgt_pt_prepare(player_type *player_ptr, std::vector &ys, std::vector &xs) +static void tgt_pt_prepare(PlayerType *player_ptr, std::vector &ys, std::vector &xs) { if (!expand_list) return; @@ -114,7 +114,7 @@ struct tgt_pt_info { char prev_ch; // callback; //ys.empty()) return; @@ -170,7 +170,7 @@ void tgt_pt_info::move_to_symbol(player_type *player_ptr) * @param y_ptr y座標への参照ポインタ * @return 指定したらTRUE、キャンセルしたらFALSE */ -bool tgt_pt(player_type *player_ptr, POSITION *x_ptr, POSITION *y_ptr) +bool tgt_pt(PlayerType *player_ptr, POSITION *x_ptr, POSITION *y_ptr) { tgt_pt_info info; get_screen_size(&info.wid, &info.hgt); diff --git a/src/target/grid-selector.h b/src/target/grid-selector.h index 4f152fa33..fe879bbad 100644 --- a/src/target/grid-selector.h +++ b/src/target/grid-selector.h @@ -2,5 +2,5 @@ #include "system/angband.h" -struct player_type; -bool tgt_pt(player_type *player_ptr, POSITION *x, POSITION *y); +class PlayerType; +bool tgt_pt(PlayerType *player_ptr, POSITION *x, POSITION *y); diff --git a/src/target/projection-path-calculator.cpp b/src/target/projection-path-calculator.cpp index c969c289b..05bd286d2 100644 --- a/src/target/projection-path-calculator.cpp +++ b/src/target/projection-path-calculator.cpp @@ -87,7 +87,7 @@ static void calc_frac(projection_path_type *pp_ptr, bool is_vertical) pp_ptr->k++; } -static void calc_projection_to_target(player_type *player_ptr, projection_path_type *pp_ptr, bool is_vertical) +static void calc_projection_to_target(PlayerType *player_ptr, projection_path_type *pp_ptr, bool is_vertical) { floor_type *floor_ptr = player_ptr->current_floor_ptr; while (true) { @@ -127,7 +127,7 @@ static void calc_projection_to_target(player_type *player_ptr, projection_path_t } } -static bool calc_vertical_projection(player_type *player_ptr, projection_path_type *pp_ptr) +static bool calc_vertical_projection(PlayerType *player_ptr, projection_path_type *pp_ptr) { if (pp_ptr->ay <= pp_ptr->ax) return false; @@ -146,7 +146,7 @@ static bool calc_vertical_projection(player_type *player_ptr, projection_path_ty return true; } -static bool calc_horizontal_projection(player_type *player_ptr, projection_path_type *pp_ptr) +static bool calc_horizontal_projection(PlayerType *player_ptr, projection_path_type *pp_ptr) { if (pp_ptr->ax <= pp_ptr->ay) return false; @@ -165,7 +165,7 @@ static bool calc_horizontal_projection(player_type *player_ptr, projection_path_ return true; } -static void calc_projection_others(player_type *player_ptr, projection_path_type *pp_ptr) +static void calc_projection_others(PlayerType *player_ptr, projection_path_type *pp_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; while (true) { @@ -212,7 +212,7 @@ static void calc_projection_others(player_type *player_ptr, projection_path_type * @param flag フラグID * @return リストの長さ */ -int projection_path(player_type *player_ptr, uint16_t *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flag) +int projection_path(PlayerType *player_ptr, uint16_t *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flag) { if ((x1 == x2) && (y1 == y2)) return 0; @@ -243,7 +243,7 @@ int projection_path(player_type *player_ptr, uint16_t *gp, POSITION range, POSIT * * This is slightly (but significantly) different from "los(y1,x1,y2,x2)". */ -bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2) +bool projectable(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2) { uint16_t grid_g[512]; int grid_n = projection_path(player_ptr, grid_g, (project_length ? project_length : get_max_range(player_ptr)), y1, x1, y2, x2, 0); @@ -263,7 +263,7 @@ bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, * @param player_ptr プレイヤーへの参照ポインタ * @return 射程 */ -int get_max_range(player_type *player_ptr) { return player_ptr->phase_out ? 36 : 18; } +int get_max_range(PlayerType *player_ptr) { return player_ptr->phase_out ? 36 : 18; } /* * Convert a "grid" (G) into a "location" (Y) diff --git a/src/target/projection-path-calculator.h b/src/target/projection-path-calculator.h index 33d3d2b59..b499baa20 100644 --- a/src/target/projection-path-calculator.h +++ b/src/target/projection-path-calculator.h @@ -2,9 +2,9 @@ #include "system/angband.h" -struct player_type; -int projection_path(player_type *player_ptr, uint16_t *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg); -bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2); -int get_max_range(player_type *player_ptr); +class PlayerType; +int projection_path(PlayerType *player_ptr, uint16_t *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg); +bool projectable(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2); +int get_max_range(PlayerType *player_ptr); POSITION get_grid_y(uint16_t grid); POSITION get_grid_x(uint16_t grid); diff --git a/src/target/target-checker.cpp b/src/target/target-checker.cpp index ef5b866fb..053465023 100644 --- a/src/target/target-checker.cpp +++ b/src/target/target-checker.cpp @@ -40,7 +40,7 @@ POSITION target_row; * The map is reprinted if necessary, and "TRUE" is returned. * @return 実際に再描画が必要だった場合TRUEを返す */ -void verify_panel(player_type *player_ptr) +void verify_panel(PlayerType *player_ptr) { POSITION y = player_ptr->y; POSITION x = player_ptr->x; @@ -117,7 +117,7 @@ void verify_panel(player_type *player_ptr) * Update (if necessary) and verify (if possible) the target. * We return TRUE if the target is "okay" and FALSE otherwise. */ -bool target_okay(player_type *player_ptr) +bool target_okay(PlayerType *player_ptr) { if (target_who < 0) return true; diff --git a/src/target/target-checker.h b/src/target/target-checker.h index cdda4018d..d0d63b4d8 100644 --- a/src/target/target-checker.h +++ b/src/target/target-checker.h @@ -6,6 +6,6 @@ extern MONSTER_IDX target_who; extern POSITION target_col; extern POSITION target_row; -struct player_type; -void verify_panel(player_type *player_ptr); -bool target_okay(player_type *player_ptr); +class PlayerType; +void verify_panel(PlayerType *player_ptr); +bool target_okay(PlayerType *player_ptr); diff --git a/src/target/target-describer.cpp b/src/target/target-describer.cpp index 4950afc91..ddd2d440b 100644 --- a/src/target/target-describer.cpp +++ b/src/target/target-describer.cpp @@ -70,7 +70,7 @@ typedef struct eg_type { concptr name; } eg_type; -static eg_type *initialize_eg_type(player_type *player_ptr, eg_type *eg_ptr, POSITION y, POSITION x, target_type mode, concptr info) +static eg_type *initialize_eg_type(PlayerType *player_ptr, eg_type *eg_ptr, POSITION y, POSITION x, target_type mode, concptr info) { eg_ptr->y = y; eg_ptr->x = x; @@ -94,7 +94,7 @@ static eg_type *initialize_eg_type(player_type *player_ptr, eg_type *eg_ptr, POS /* * Evaluate number of kill needed to gain level */ -static void evaluate_monster_exp(player_type *player_ptr, char *buf, monster_type *m_ptr) +static void evaluate_monster_exp(PlayerType *player_ptr, char *buf, monster_type *m_ptr) { monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx]; if ((player_ptr->lev >= PY_MAX_LEVEL) || (player_ptr->prace == PlayerRaceType::ANDROID)) { @@ -128,7 +128,7 @@ static void evaluate_monster_exp(player_type *player_ptr, char *buf, monster_typ sprintf(buf, "%03ld", (long int)num); } -static void describe_scan_result(player_type *player_ptr, eg_type *eg_ptr) +static void describe_scan_result(PlayerType *player_ptr, eg_type *eg_ptr) { if (!easy_floor) return; @@ -138,7 +138,7 @@ static void describe_scan_result(player_type *player_ptr, eg_type *eg_ptr) eg_ptr->x_info = _("x物 ", "x,"); } -static void describe_target(player_type *player_ptr, eg_type *eg_ptr) +static void describe_target(PlayerType *player_ptr, eg_type *eg_ptr) { if (!player_bold(player_ptr, eg_ptr->y, eg_ptr->x)) { eg_ptr->s1 = _("ターゲット:", "Target:"); @@ -155,7 +155,7 @@ static void describe_target(player_type *player_ptr, eg_type *eg_ptr) #endif } -static process_result describe_hallucinated_target(player_type *player_ptr, eg_type *eg_ptr) +static process_result describe_hallucinated_target(PlayerType *player_ptr, eg_type *eg_ptr) { if (!player_ptr->hallucinated) return PROCESS_CONTINUE; @@ -175,7 +175,7 @@ static process_result describe_hallucinated_target(player_type *player_ptr, eg_t return PROCESS_FALSE; } -static bool describe_grid_lore(player_type *player_ptr, eg_type *eg_ptr) +static bool describe_grid_lore(PlayerType *player_ptr, eg_type *eg_ptr) { screen_save(); screen_roff(player_ptr, eg_ptr->m_ptr->ap_r_idx, MONSTER_LORE_NORMAL); @@ -185,7 +185,7 @@ static bool describe_grid_lore(player_type *player_ptr, eg_type *eg_ptr) return eg_ptr->query != 'r'; } -static void describe_grid_monster(player_type *player_ptr, eg_type *eg_ptr) +static void describe_grid_monster(PlayerType *player_ptr, eg_type *eg_ptr) { bool recall = false; GAME_TEXT m_name[MAX_NLEN]; @@ -235,7 +235,7 @@ static void describe_monster_person(eg_type *eg_ptr) #endif } -static uint16_t describe_monster_item(player_type *player_ptr, eg_type *eg_ptr) +static uint16_t describe_monster_item(PlayerType *player_ptr, eg_type *eg_ptr) { for (const auto this_o_idx : eg_ptr->m_ptr->hold_o_idx_list) { GAME_TEXT o_name[MAX_NLEN]; @@ -267,7 +267,7 @@ static bool within_char_util(int16_t input) return (input > -127) && (input < 128); } -static int16_t describe_grid(player_type *player_ptr, eg_type *eg_ptr) +static int16_t describe_grid(PlayerType *player_ptr, eg_type *eg_ptr) { if ((eg_ptr->g_ptr->m_idx == 0) || !player_ptr->current_floor_ptr->m_list[eg_ptr->g_ptr->m_idx].ml) return CONTINUOUS_DESCRIPTION; @@ -297,7 +297,7 @@ static int16_t describe_grid(player_type *player_ptr, eg_type *eg_ptr) return CONTINUOUS_DESCRIPTION; } -static int16_t describe_footing(player_type *player_ptr, eg_type *eg_ptr) +static int16_t describe_footing(PlayerType *player_ptr, eg_type *eg_ptr) { if (eg_ptr->floor_num != 1) return CONTINUOUS_DESCRIPTION; @@ -336,7 +336,7 @@ static int16_t describe_footing_items(eg_type *eg_ptr) return CONTINUOUS_DESCRIPTION; } -static char describe_footing_many_items(player_type *player_ptr, eg_type *eg_ptr, int *min_width) +static char describe_footing_many_items(PlayerType *player_ptr, eg_type *eg_ptr, int *min_width) { while (true) { screen_save(); @@ -364,7 +364,7 @@ static char describe_footing_many_items(player_type *player_ptr, eg_type *eg_ptr } } -static int16_t loop_describing_grid(player_type *player_ptr, eg_type *eg_ptr) +static int16_t loop_describing_grid(PlayerType *player_ptr, eg_type *eg_ptr) { if (eg_ptr->floor_num == 0) return CONTINUOUS_DESCRIPTION; @@ -383,7 +383,7 @@ static int16_t loop_describing_grid(player_type *player_ptr, eg_type *eg_ptr) } } -static int16_t describe_footing_sight(player_type *player_ptr, eg_type *eg_ptr, object_type *o_ptr) +static int16_t describe_footing_sight(PlayerType *player_ptr, eg_type *eg_ptr, object_type *o_ptr) { if ((o_ptr->marked & OM_FOUND) == 0) return CONTINUOUS_DESCRIPTION; @@ -418,7 +418,7 @@ static int16_t describe_footing_sight(player_type *player_ptr, eg_type *eg_ptr, return CONTINUOUS_DESCRIPTION; } -static int16_t sweep_footing_items(player_type *player_ptr, eg_type *eg_ptr) +static int16_t sweep_footing_items(PlayerType *player_ptr, eg_type *eg_ptr) { for (const auto this_o_idx : eg_ptr->g_ptr->o_idx_list) { object_type *o_ptr; @@ -431,7 +431,7 @@ static int16_t sweep_footing_items(player_type *player_ptr, eg_type *eg_ptr) return CONTINUOUS_DESCRIPTION; } -static concptr decide_target_floor(player_type *player_ptr, eg_type *eg_ptr) +static concptr decide_target_floor(PlayerType *player_ptr, eg_type *eg_ptr) { if (eg_ptr->f_ptr->flags.has(FloorFeatureType::QUEST_ENTER)) { QUEST_IDX old_quest = player_ptr->current_floor_ptr->inside_quest; @@ -499,7 +499,7 @@ static void describe_grid_monster_all(eg_type *eg_ptr) * @return 入力キー * @todo xとlで処理を分ける? */ -char examine_grid(player_type *player_ptr, const POSITION y, const POSITION x, target_type mode, concptr info) +char examine_grid(PlayerType *player_ptr, const POSITION y, const POSITION x, target_type mode, concptr info) { eg_type tmp_eg; eg_type *eg_ptr = initialize_eg_type(player_ptr, &tmp_eg, y, x, mode, info); diff --git a/src/target/target-describer.h b/src/target/target-describer.h index 68d26fb7f..ceaecd485 100644 --- a/src/target/target-describer.h +++ b/src/target/target-describer.h @@ -5,5 +5,5 @@ extern bool show_gold_on_floor; enum target_type : uint32_t; -struct player_type; -char examine_grid(player_type *player_ptr, const POSITION y, const POSITION x, target_type mode, concptr info); +class PlayerType; +char examine_grid(PlayerType *player_ptr, const POSITION y, const POSITION x, target_type mode, concptr info); diff --git a/src/target/target-getter.cpp b/src/target/target-getter.cpp index 7066c5091..bae71a54d 100644 --- a/src/target/target-getter.cpp +++ b/src/target/target-getter.cpp @@ -30,7 +30,7 @@ * * Note that confusion over-rides any (explicit?) user choice. */ -bool get_aim_dir(player_type *player_ptr, DIRECTION *dp) +bool get_aim_dir(PlayerType *player_ptr, DIRECTION *dp) { DIRECTION dir = command_dir; if (use_old_target && target_okay(player_ptr)) @@ -100,7 +100,7 @@ bool get_aim_dir(player_type *player_ptr, DIRECTION *dp) return true; } -bool get_direction(player_type *player_ptr, DIRECTION *dp, bool allow_under, bool with_steed) +bool get_direction(PlayerType *player_ptr, DIRECTION *dp, bool allow_under, bool with_steed) { DIRECTION dir = command_dir; COMMAND_CODE code; @@ -186,7 +186,7 @@ bool get_direction(player_type *player_ptr, DIRECTION *dp, bool allow_under, boo * This function tracks and uses the "global direction", and uses * that as the "desired direction", to which "confusion" is applied. */ -bool get_rep_dir(player_type *player_ptr, DIRECTION *dp, bool under) +bool get_rep_dir(PlayerType *player_ptr, DIRECTION *dp, bool under) { DIRECTION dir = command_dir; COMMAND_CODE code; diff --git a/src/target/target-getter.h b/src/target/target-getter.h index ed691b9fe..0024ca85b 100644 --- a/src/target/target-getter.h +++ b/src/target/target-getter.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -bool get_aim_dir(player_type *player_ptr, DIRECTION *dp); -bool get_direction(player_type *player_ptr, DIRECTION *dp, bool allow_under, bool with_steed); -bool get_rep_dir(player_type *player_ptr, DIRECTION *dp, bool under); +class PlayerType; +bool get_aim_dir(PlayerType *player_ptr, DIRECTION *dp); +bool get_direction(PlayerType *player_ptr, DIRECTION *dp, bool allow_under, bool with_steed); +bool get_rep_dir(PlayerType *player_ptr, DIRECTION *dp, bool under); diff --git a/src/target/target-preparation.cpp b/src/target/target-preparation.cpp index 8e93aa299..f01b9c2fb 100644 --- a/src/target/target-preparation.cpp +++ b/src/target/target-preparation.cpp @@ -38,7 +38,7 @@ * Future versions may restrict the ability to target "trappers" * and "mimics", but the semantics is a little bit weird. */ -bool target_able(player_type *player_ptr, MONSTER_IDX m_idx) +bool target_able(PlayerType *player_ptr, MONSTER_IDX m_idx) { floor_type *floor_ptr = player_ptr->current_floor_ptr; monster_type *m_ptr = &floor_ptr->m_list[m_idx]; @@ -63,7 +63,7 @@ bool target_able(player_type *player_ptr, MONSTER_IDX m_idx) /* * Determine if a given location is "interesting" */ -static bool target_set_accept(player_type *player_ptr, POSITION y, POSITION x) +static bool target_set_accept(PlayerType *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!(in_bounds(floor_ptr, y, x))) @@ -110,7 +110,7 @@ static bool target_set_accept(player_type *player_ptr, POSITION y, POSITION x) * * ys, xs は処理開始時にクリアされる。 */ -void target_set_prepare(player_type *player_ptr, std::vector &ys, std::vector &xs, const BIT_FLAGS mode) +void target_set_prepare(PlayerType *player_ptr, std::vector &ys, std::vector &xs, const BIT_FLAGS mode) { POSITION min_hgt, max_hgt, min_wid, max_wid; if (mode & TARGET_KILL) { @@ -162,7 +162,7 @@ void target_set_prepare(player_type *player_ptr, std::vector &ys, std: std::swap(xs[0], xs[1]); } -void target_sensing_monsters_prepare(player_type *player_ptr, std::vector &monster_list) +void target_sensing_monsters_prepare(PlayerType *player_ptr, std::vector &monster_list) { monster_list.clear(); diff --git a/src/target/target-preparation.h b/src/target/target-preparation.h index 68757f19a..90f5a7e47 100644 --- a/src/target/target-preparation.h +++ b/src/target/target-preparation.h @@ -4,7 +4,7 @@ #include "system/angband.h" -struct player_type; -bool target_able(player_type *player_ptr, MONSTER_IDX m_idx); -void target_set_prepare(player_type *player_ptr, std::vector &ys, std::vector &xs, BIT_FLAGS mode); -void target_sensing_monsters_prepare(player_type *player_ptr, std::vector &monster_list); +class PlayerType; +bool target_able(PlayerType *player_ptr, MONSTER_IDX m_idx); +void target_set_prepare(PlayerType *player_ptr, std::vector &ys, std::vector &xs, BIT_FLAGS mode); +void target_sensing_monsters_prepare(PlayerType *player_ptr, std::vector &monster_list); diff --git a/src/target/target-setter.cpp b/src/target/target-setter.cpp index 5bd7037e6..a6a2c2de1 100644 --- a/src/target/target-setter.cpp +++ b/src/target/target-setter.cpp @@ -51,7 +51,7 @@ typedef struct ts_type { bool move_fast; // カーソル移動を粗くする(1マスずつ移動しない) } ts_type; -static ts_type *initialize_target_set_type(player_type *player_ptr, ts_type *ts_ptr, target_type mode) +static ts_type *initialize_target_set_type(PlayerType *player_ptr, ts_type *ts_ptr, target_type mode) { ts_ptr->mode = mode; ts_ptr->y = player_ptr->y; @@ -74,7 +74,7 @@ static ts_type *initialize_target_set_type(player_type *player_ptr, ts_type *ts_ * Also used in do_cmd_locate * @return 実際に再描画が必要だった場合TRUEを返す */ -static bool change_panel_xy(player_type *player_ptr, POSITION y, POSITION x) +static bool change_panel_xy(PlayerType *player_ptr, POSITION y, POSITION x) { POSITION dy = 0, dx = 0; TERM_LEN wid, hgt; @@ -154,7 +154,7 @@ static POSITION_IDX target_pick(const POSITION y1, const POSITION x1, const POSI return b_i; } -static void describe_projectablity(player_type *player_ptr, ts_type *ts_ptr) +static void describe_projectablity(PlayerType *player_ptr, ts_type *ts_ptr) { ts_ptr->y = ys_interest[ts_ptr->m]; ts_ptr->x = xs_interest[ts_ptr->m]; @@ -186,7 +186,7 @@ static void menu_target(ts_type *ts_ptr) ts_ptr->query = 't'; } -static void switch_target_input(player_type *player_ptr, ts_type *ts_ptr) +static void switch_target_input(PlayerType *player_ptr, ts_type *ts_ptr) { ts_ptr->distance = 0; switch (ts_ptr->query) { @@ -271,7 +271,7 @@ static void switch_target_input(player_type *player_ptr, ts_type *ts_ptr) * @brief カーソル移動に伴い、描画範囲、"interesting" 座標リスト、現在のターゲットを更新する。 * @return カーソル移動によって描画範囲が変化したかどうか */ -static bool check_panel_changed(player_type *player_ptr, ts_type *ts_ptr) +static bool check_panel_changed(PlayerType *player_ptr, ts_type *ts_ptr) { // カーソル移動によって描画範囲が変化しないなら何もせずその旨を返す。 if (!change_panel(player_ptr, ddy[ts_ptr->distance], ddx[ts_ptr->distance])) @@ -308,7 +308,7 @@ static bool check_panel_changed(player_type *player_ptr, ts_type *ts_ptr) * * 既に "interesting" な座標を発見している場合、この関数は何もしない。 */ -static void sweep_targets(player_type *player_ptr, ts_type *ts_ptr) +static void sweep_targets(PlayerType *player_ptr, ts_type *ts_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; while (ts_ptr->flag && (ts_ptr->target_num < 0)) { @@ -354,7 +354,7 @@ static void sweep_targets(player_type *player_ptr, ts_type *ts_ptr) } } -static bool set_target_grid(player_type *player_ptr, ts_type *ts_ptr) +static bool set_target_grid(PlayerType *player_ptr, ts_type *ts_ptr) { if (!ts_ptr->flag || ys_interest.empty()) return false; @@ -385,7 +385,7 @@ static bool set_target_grid(player_type *player_ptr, ts_type *ts_ptr) return true; } -static void describe_grid_wizard(player_type *player_ptr, ts_type *ts_ptr) +static void describe_grid_wizard(PlayerType *player_ptr, ts_type *ts_ptr) { if (!cheat_sight) return; @@ -396,7 +396,7 @@ static void describe_grid_wizard(player_type *player_ptr, ts_type *ts_ptr) strcat(ts_ptr->info, cheatinfo); } -static void switch_next_grid_command(player_type *player_ptr, ts_type *ts_ptr) +static void switch_next_grid_command(PlayerType *player_ptr, ts_type *ts_ptr) { switch (ts_ptr->query) { case ESCAPE: @@ -459,7 +459,7 @@ static void switch_next_grid_command(player_type *player_ptr, ts_type *ts_ptr) } } -static void decide_change_panel(player_type *player_ptr, ts_type *ts_ptr) +static void decide_change_panel(PlayerType *player_ptr, ts_type *ts_ptr) { if (ts_ptr->distance == 0) return; @@ -499,7 +499,7 @@ static void decide_change_panel(player_type *player_ptr, ts_type *ts_ptr) ts_ptr->y = 1; } -static void sweep_target_grids(player_type *player_ptr, ts_type *ts_ptr) +static void sweep_target_grids(PlayerType *player_ptr, ts_type *ts_ptr) { while (!ts_ptr->done) { if (set_target_grid(player_ptr, ts_ptr)) @@ -530,7 +530,7 @@ static void sweep_target_grids(player_type *player_ptr, ts_type *ts_ptr) /* * Handle "target" and "look". */ -bool target_set(player_type *player_ptr, target_type mode) +bool target_set(PlayerType *player_ptr, target_type mode) { ts_type tmp_ts; ts_type *ts_ptr = initialize_target_set_type(player_ptr, &tmp_ts, mode); diff --git a/src/target/target-setter.h b/src/target/target-setter.h index d9c11944c..aa1ed5469 100644 --- a/src/target/target-setter.h +++ b/src/target/target-setter.h @@ -3,5 +3,5 @@ #include enum target_type : uint32_t; -struct player_type; -bool target_set(player_type *player_ptr, target_type mode); +class PlayerType; +bool target_set(PlayerType *player_ptr, target_type mode); diff --git a/src/util/object-sort.cpp b/src/util/object-sort.cpp index a69c8bdaf..cc7d52e24 100644 --- a/src/util/object-sort.cpp +++ b/src/util/object-sort.cpp @@ -21,7 +21,7 @@ * @param j_ptr 比較対象オブジェクトの構造体参照ポインタ2 * @return o_ptrの方が上位ならばTRUEを返す。 */ -bool object_sort_comp(player_type *player_ptr, object_type *o_ptr, int32_t o_value, object_type *j_ptr) +bool object_sort_comp(PlayerType *player_ptr, object_type *o_ptr, int32_t o_value, object_type *j_ptr) { int o_type, j_type; if (!j_ptr->k_idx) diff --git a/src/util/object-sort.h b/src/util/object-sort.h index 75252906a..13d32cbbe 100644 --- a/src/util/object-sort.h +++ b/src/util/object-sort.h @@ -3,5 +3,5 @@ #include "system/angband.h" struct object_type; -struct player_type; -bool object_sort_comp(player_type *player_ptr, object_type *o_ptr, int32_t o_value, object_type *j_ptr); +class PlayerType; +bool object_sort_comp(PlayerType *player_ptr, object_type *o_ptr, int32_t o_value, object_type *j_ptr); diff --git a/src/util/sort.cpp b/src/util/sort.cpp index d14032518..b5cfe429d 100644 --- a/src/util/sort.cpp +++ b/src/util/sort.cpp @@ -21,8 +21,8 @@ * @param ang_sort_comp 比較用の関数ポインタ * @param ang_sort_swap スワップ用の関数ポインタ */ -static void exe_ang_sort(player_type *player_ptr, vptr u, vptr v, int p, int q, bool (*ang_sort_comp)(player_type *, vptr, vptr, int, int), - void (*ang_sort_swap)(player_type *, vptr, vptr, int, int)) +static void exe_ang_sort(PlayerType *player_ptr, vptr u, vptr v, int p, int q, bool (*ang_sort_comp)(PlayerType *, vptr, vptr, int, int), + void (*ang_sort_swap)(PlayerType *, vptr, vptr, int, int)) { if (p >= q) return; @@ -63,8 +63,8 @@ static void exe_ang_sort(player_type *player_ptr, vptr u, vptr v, int p, int q, * @param ang_sort_comp 比較用の関数ポインタ * @param ang_sort_swap スワップ用の関数ポインタ */ -void ang_sort(player_type *player_ptr, vptr u, vptr v, int n, bool (*ang_sort_comp)(player_type *, vptr, vptr, int, int), - void (*ang_sort_swap)(player_type *, vptr, vptr, int, int)) +void ang_sort(PlayerType *player_ptr, vptr u, vptr v, int n, bool (*ang_sort_comp)(PlayerType *, vptr, vptr, int, int), + void (*ang_sort_swap)(PlayerType *, vptr, vptr, int, int)) { exe_ang_sort(player_ptr, u, v, 0, n - 1, ang_sort_comp, ang_sort_swap); } @@ -75,7 +75,7 @@ void ang_sort(player_type *player_ptr, vptr u, vptr v, int n, bool (*ang_sort_co * We use "u" and "v" to point to arrays of "x" and "y" positions, * and sort the arrays by double-distance to the player. */ -bool ang_sort_comp_distance(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_comp_distance(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { POSITION *x = (POSITION *)(u); POSITION *y = (POSITION *)(v); @@ -112,7 +112,7 @@ bool ang_sort_comp_distance(player_type *player_ptr, vptr u, vptr v, int a, int * We use "u" and "v" to point to arrays of "x" and "y" positions, * and sort the arrays by level of monster */ -bool ang_sort_comp_importance(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_comp_importance(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { POSITION *x = (POSITION *)(u); POSITION *y = (POSITION *)(v); @@ -205,7 +205,7 @@ bool ang_sort_comp_importance(player_type *player_ptr, vptr u, vptr v, int a, in * We use "u" and "v" to point to arrays of "x" and "y" positions, * and sort the arrays by distance to the player. */ -void ang_sort_swap_position(player_type *player_ptr, vptr u, vptr v, int a, int b) +void ang_sort_swap_position(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -228,7 +228,7 @@ void ang_sort_swap_position(player_type *player_ptr, vptr u, vptr v, int a, int * We use "u" to point to array of monster indexes, * and "v" to select the type of sorting to perform on "u". */ -bool ang_sort_art_comp(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_art_comp(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -293,7 +293,7 @@ bool ang_sort_art_comp(player_type *player_ptr, vptr u, vptr v, int a, int b) * We use "u" to point to array of monster indexes, * and "v" to select the type of sorting to perform. */ -void ang_sort_art_swap(player_type *player_ptr, vptr u, vptr v, int a, int b) +void ang_sort_art_swap(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -305,7 +305,7 @@ void ang_sort_art_swap(player_type *player_ptr, vptr u, vptr v, int a, int b) who[b] = holder; } -bool ang_sort_comp_quest_num(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_comp_quest_num(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -317,7 +317,7 @@ bool ang_sort_comp_quest_num(player_type *player_ptr, vptr u, vptr v, int a, int return (qa->comptime != qb->comptime) ? (qa->comptime < qb->comptime) : (qa->level <= qb->level); } -void ang_sort_swap_quest_num(player_type *player_ptr, vptr u, vptr v, int a, int b) +void ang_sort_swap_quest_num(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -337,7 +337,7 @@ void ang_sort_swap_quest_num(player_type *player_ptr, vptr u, vptr v, int a, int * @param b 所持品ID2 * @return 1の方が大であればTRUE */ -bool ang_sort_comp_pet(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_comp_pet(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)v; @@ -390,7 +390,7 @@ bool ang_sort_comp_pet(player_type *player_ptr, vptr u, vptr v, int a, int b) * We use "u" to point to array of monster indexes, * and "v" to select the type of sorting to perform on "u". */ -bool ang_sort_comp_hook(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_comp_hook(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -470,7 +470,7 @@ bool ang_sort_comp_hook(player_type *player_ptr, vptr u, vptr v, int a, int b) * We use "u" to point to array of monster indexes, * and "v" to select the type of sorting to perform. */ -void ang_sort_swap_hook(player_type *player_ptr, vptr u, vptr v, int a, int b) +void ang_sort_swap_hook(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -487,7 +487,7 @@ void ang_sort_swap_hook(player_type *player_ptr, vptr u, vptr v, int a, int b) /* * hook function to sort monsters by level */ -bool ang_sort_comp_monster_level(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_comp_monster_level(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -524,7 +524,7 @@ bool ang_sort_comp_monster_level(player_type *player_ptr, vptr u, vptr v, int a, * @param b 比較対象のモンスターID2 * @return 2番目が大ならばTRUEを返す */ -bool ang_sort_comp_pet_dismiss(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_comp_pet_dismiss(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)v; @@ -586,7 +586,7 @@ bool ang_sort_comp_pet_dismiss(player_type *player_ptr, vptr u, vptr v, int a, i * @param b スワップするモンスター種族のID2 * @return aの方が大きければtrue */ -bool ang_sort_comp_cave_temp(player_type *player_ptr, vptr u, vptr v, int a, int b) +bool ang_sort_comp_cave_temp(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; @@ -607,7 +607,7 @@ bool ang_sort_comp_cave_temp(player_type *player_ptr, vptr u, vptr v, int a, int * @param a スワップするモンスター種族のID1 * @param b スワップするモンスター種族のID2 */ -void ang_sort_swap_cave_temp(player_type *player_ptr, vptr u, vptr v, int a, int b) +void ang_sort_swap_cave_temp(PlayerType *player_ptr, vptr u, vptr v, int a, int b) { /* Unused */ (void)player_ptr; diff --git a/src/util/sort.h b/src/util/sort.h index 3a5acc14f..24de67bde 100644 --- a/src/util/sort.h +++ b/src/util/sort.h @@ -3,26 +3,26 @@ #include "system/angband.h" #include "system/player-type-definition.h" -void ang_sort(player_type *player_ptr, vptr u, vptr v, int n, bool (*ang_sort_comp)(player_type *, vptr, vptr, int, int), - void (*ang_sort_swap)(player_type *, vptr, vptr, int, int)); +void ang_sort(PlayerType *player_ptr, vptr u, vptr v, int n, bool (*ang_sort_comp)(PlayerType *, vptr, vptr, int, int), + void (*ang_sort_swap)(PlayerType *, vptr, vptr, int, int)); -bool ang_sort_comp_distance(player_type *player_ptr, vptr u, vptr v, int a, int b); -bool ang_sort_comp_importance(player_type *player_ptr, vptr u, vptr v, int a, int b); -void ang_sort_swap_position(player_type *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_comp_distance(PlayerType *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_comp_importance(PlayerType *player_ptr, vptr u, vptr v, int a, int b); +void ang_sort_swap_position(PlayerType *player_ptr, vptr u, vptr v, int a, int b); -bool ang_sort_art_comp(player_type *player_ptr, vptr u, vptr v, int a, int b); -void ang_sort_art_swap(player_type *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_art_comp(PlayerType *player_ptr, vptr u, vptr v, int a, int b); +void ang_sort_art_swap(PlayerType *player_ptr, vptr u, vptr v, int a, int b); -bool ang_sort_comp_quest_num(player_type *player_ptr, vptr u, vptr v, int a, int b); -void ang_sort_swap_quest_num(player_type *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_comp_quest_num(PlayerType *player_ptr, vptr u, vptr v, int a, int b); +void ang_sort_swap_quest_num(PlayerType *player_ptr, vptr u, vptr v, int a, int b); -bool ang_sort_comp_pet(player_type *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_comp_pet(PlayerType *player_ptr, vptr u, vptr v, int a, int b); -bool ang_sort_comp_hook(player_type *player_ptr, vptr u, vptr v, int a, int b); -void ang_sort_swap_hook(player_type *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_comp_hook(PlayerType *player_ptr, vptr u, vptr v, int a, int b); +void ang_sort_swap_hook(PlayerType *player_ptr, vptr u, vptr v, int a, int b); -bool ang_sort_comp_monster_level(player_type *player_ptr, vptr u, vptr v, int a, int b); -bool ang_sort_comp_pet_dismiss(player_type *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_comp_monster_level(PlayerType *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_comp_pet_dismiss(PlayerType *player_ptr, vptr u, vptr v, int a, int b); -bool ang_sort_comp_cave_temp(player_type *player_ptr, vptr u, vptr v, int a, int b); -void ang_sort_swap_cave_temp(player_type *player_ptr, vptr u, vptr v, int a, int b); +bool ang_sort_comp_cave_temp(PlayerType *player_ptr, vptr u, vptr v, int a, int b); +void ang_sort_swap_cave_temp(PlayerType *player_ptr, vptr u, vptr v, int a, int b); diff --git a/src/view/display-birth.cpp b/src/view/display-birth.cpp index 18fd81ecc..243a5c085 100644 --- a/src/view/display-birth.cpp +++ b/src/view/display-birth.cpp @@ -14,7 +14,7 @@ * @brief オートロール中のステータスを表示する / Display stat values, subset of "put_stats()" * @details See 'display_player(p_ptr, )' for screen layout constraints. */ -void birth_put_stats(player_type *player_ptr) +void birth_put_stats(PlayerType *player_ptr) { if (!autoroller) return; diff --git a/src/view/display-birth.h b/src/view/display-birth.h index fdad54788..b038c6d4b 100644 --- a/src/view/display-birth.h +++ b/src/view/display-birth.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void birth_put_stats(player_type *player_ptr); +class PlayerType; +void birth_put_stats(PlayerType *player_ptr); diff --git a/src/view/display-characteristic.cpp b/src/view/display-characteristic.cpp index 68fb9604d..fb93a903c 100644 --- a/src/view/display-characteristic.cpp +++ b/src/view/display-characteristic.cpp @@ -102,7 +102,7 @@ static std::array lite_flags = { * @param char_stat その行の特性の状況(参照渡し) * その行の表示色用の判定も行う */ -static void process_cursed_equipment_characteristics(player_type *player_ptr, uint16_t mode, char_stat &char_stat) +static void process_cursed_equipment_characteristics(PlayerType *player_ptr, uint16_t mode, char_stat &char_stat) { int max_i = (mode & DP_WP) ? INVEN_BOW + 1 : INVEN_TOTAL; for (int i = INVEN_MAIN_HAND; i < max_i; i++) { @@ -151,7 +151,7 @@ static void process_cursed_equipment_characteristics(player_type *player_ptr, ui * @details * その行の表示色用の判定も行う */ -static void process_light_equipment_characteristics(player_type *player_ptr, all_player_flags *f, uint16_t mode, char_stat &char_stat) +static void process_light_equipment_characteristics(PlayerType *player_ptr, all_player_flags *f, uint16_t mode, char_stat &char_stat) { int max_i = (mode & DP_WP) ? INVEN_BOW + 1 : INVEN_TOTAL; for (int i = INVEN_MAIN_HAND; i < max_i; i++) { @@ -200,7 +200,7 @@ static void process_light_equipment_characteristics(player_type *player_ptr, all * @details * その行の表示色用の判定も行う */ -static void process_inventory_characteristic(player_type *player_ptr, tr_type flag, all_player_flags *f, uint16_t mode, char_stat &char_stat) +static void process_inventory_characteristic(PlayerType *player_ptr, tr_type flag, all_player_flags *f, uint16_t mode, char_stat &char_stat) { int max_i = (mode & DP_WP) ? INVEN_BOW + 1 : INVEN_TOTAL; for (int i = INVEN_MAIN_HAND; i < max_i; i++) { @@ -263,7 +263,7 @@ static void process_inventory_characteristic(player_type *player_ptr, tr_type fl * @param f プレイヤーの特性情報構造体 * @param mode 表示オプション */ -static void process_one_characteristic(player_type *player_ptr, TERM_LEN row, TERM_LEN col, std::string_view header, tr_type flag, all_player_flags *f, uint16_t mode) +static void process_one_characteristic(PlayerType *player_ptr, TERM_LEN row, TERM_LEN col, std::string_view header, tr_type flag, all_player_flags *f, uint16_t mode) { char_stat char_stat; @@ -318,7 +318,7 @@ static void process_one_characteristic(player_type *player_ptr, TERM_LEN row, TE * @param f 特性フラグへの参照ポインタ */ static void display_basic_resistance_info( - player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) + PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 12; TERM_LEN col = 1; @@ -344,7 +344,7 @@ static void display_basic_resistance_info( * @param f 特性フラグへの参照ポインタ */ static void display_advanced_resistance_info( - player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) + PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 12; TERM_LEN col = 26; @@ -369,7 +369,7 @@ static void display_advanced_resistance_info( * @param f 特性フラグへの参照ポインタ */ static void display_other_resistance_info( - player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) + PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 12; TERM_LEN col = 51; @@ -393,7 +393,7 @@ static void display_other_resistance_info( * @param player_ptr プレイヤーへの参照ポインタ * @todo 将来的には装備系とまとめたいが、乗馬による特性変化や一時能力変化等の扱いがあるので据え置き。 */ - all_player_flags get_player_state_flags(player_type *player_ptr) + all_player_flags get_player_state_flags(PlayerType *player_ptr) { all_player_flags f; player_flags(player_ptr, f.player_flags); @@ -412,7 +412,7 @@ static void display_other_resistance_info( * @param display_player_equippy 表示へのコールバック * Special display, part 1 */ -void display_player_flag_info_1(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16)) +void display_player_flag_info_1(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16)) { all_player_flags f = get_player_state_flags(player_ptr); @@ -427,7 +427,7 @@ void display_player_flag_info_1(player_type *player_ptr, void (*display_player_e * @param display_player_equippy 表示へのコールバック * @param f 特性フラグへの参照ポインタ */ -static void display_slay_info(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) +static void display_slay_info(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 3; TERM_LEN col = 1; @@ -452,7 +452,7 @@ static void display_slay_info(player_type *player_ptr, void (*display_player_equ * @param display_player_equippy 表示へのコールバック * @param f 特性フラグへの参照ポインタ */ -static void display_brand_info(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) +static void display_brand_info(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 3; TERM_LEN col = 1; @@ -481,7 +481,7 @@ static void display_brand_info(player_type *player_ptr, void (*display_player_eq * @param f 特性フラグへの参照ポインタ */ static void display_tval_misc_info( - player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) + PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 3; TERM_LEN col = 49; @@ -511,7 +511,7 @@ static void display_tval_misc_info( * @param display_player_equippy 表示へのコールバック * @param f 特性フラグへの参照ポインタ */ -static void display_esc_info(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) +static void display_esc_info(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 3; TERM_LEN col = 21; @@ -540,7 +540,7 @@ static void display_esc_info(player_type *player_ptr, void (*display_player_equi * @param f 特性フラグへの参照ポインタ */ static void display_stustain_aura_info( - player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) + PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 3; TERM_LEN col = 21; @@ -570,7 +570,7 @@ static void display_stustain_aura_info( * @param display_player_equippy 表示へのコールバック * @param f 特性フラグへの参照ポインタ */ -static void display_curse_info(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) +static void display_curse_info(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16), all_player_flags *f) { TERM_LEN row = 3; TERM_LEN col = 49; @@ -600,7 +600,7 @@ static void display_curse_info(player_type *player_ptr, void (*display_player_eq * @param player_ptr プレイヤーへの参照ポインタ * Special display, part 2 */ -void display_player_flag_info_2(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16)) +void display_player_flag_info_2(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16)) { /* Extract flags and store */ all_player_flags f = get_player_state_flags(player_ptr); @@ -615,7 +615,7 @@ void display_player_flag_info_2(player_type *player_ptr, void (*display_player_e * @param player_ptr プレイヤーへの参照ポインタ * Special display, part 3 */ -void display_player_flag_info_3(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16)) +void display_player_flag_info_3(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16)) { /* Extract flags and store */ all_player_flags f = get_player_state_flags(player_ptr); diff --git a/src/view/display-characteristic.h b/src/view/display-characteristic.h index e1704e76e..33deeabcb 100644 --- a/src/view/display-characteristic.h +++ b/src/view/display-characteristic.h @@ -7,7 +7,7 @@ #define DP_CURSE 1<<1L #define DP_LITE 1<<2L -struct player_type; -void display_player_flag_info_1(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16)); -void display_player_flag_info_2(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16)); -void display_player_flag_info_3(player_type *player_ptr, void (*display_player_equippy)(player_type *, TERM_LEN, TERM_LEN, BIT_FLAGS16)); +class PlayerType; +void display_player_flag_info_1(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16)); +void display_player_flag_info_2(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16)); +void display_player_flag_info_3(PlayerType *player_ptr, void (*display_player_equippy)(PlayerType *, TERM_LEN, TERM_LEN, BIT_FLAGS16)); diff --git a/src/view/display-inventory.cpp b/src/view/display-inventory.cpp index acf51e13b..d310751ee 100644 --- a/src/view/display-inventory.cpp +++ b/src/view/display-inventory.cpp @@ -24,7 +24,7 @@ * @details * Hack -- do not display "trailing" empty slots */ -COMMAND_CODE show_inventory(player_type *player_ptr, int target_item, BIT_FLAGS mode, const ItemTester &item_tester) +COMMAND_CODE show_inventory(PlayerType *player_ptr, int target_item, BIT_FLAGS mode, const ItemTester &item_tester) { COMMAND_CODE i; int k, l, z = 0; @@ -127,7 +127,7 @@ COMMAND_CODE show_inventory(player_type *player_ptr, int target_item, BIT_FLAGS * @brief 所持アイテム一覧を表示する / * Choice window "shadow" of the "show_inven()" function */ -void display_inventory(player_type *player_ptr, const ItemTester &item_tester) +void display_inventory(PlayerType *player_ptr, const ItemTester &item_tester) { int i, n, z = 0; TERM_COLOR attr = TERM_WHITE; diff --git a/src/view/display-inventory.h b/src/view/display-inventory.h index 831ad05d2..62596a3a4 100644 --- a/src/view/display-inventory.h +++ b/src/view/display-inventory.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; +class PlayerType; class ItemTester; -COMMAND_CODE show_inventory(player_type *player_ptr, int target_item, BIT_FLAGS mode, const ItemTester& item_tester); -COMMAND_CODE show_equipment(player_type *player_ptr, int target_item, BIT_FLAGS mode, const ItemTester& item_tester); +COMMAND_CODE show_inventory(PlayerType *player_ptr, int target_item, BIT_FLAGS mode, const ItemTester& item_tester); +COMMAND_CODE show_equipment(PlayerType *player_ptr, int target_item, BIT_FLAGS mode, const ItemTester& item_tester); diff --git a/src/view/display-lore.cpp b/src/view/display-lore.cpp index ec6958eff..424e575ea 100644 --- a/src/view/display-lore.cpp +++ b/src/view/display-lore.cpp @@ -80,7 +80,7 @@ void roff_top(MONRACE_IDX r_idx) * @param r_idx モンスターの種族ID * @param mode 表示オプション */ -void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode) +void screen_roff(PlayerType *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode) { msg_erase(); term_erase(0, 1, 255); @@ -94,7 +94,7 @@ void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, monster_lore_mode m * Hack -- describe the given monster race in the current "term" window * @param r_idx モンスターの種族ID */ -void display_roff(player_type *player_ptr) +void display_roff(PlayerType *player_ptr) { for (int y = 0; y < Term->hgt; y++) { term_erase(0, y, 255); @@ -117,7 +117,7 @@ void display_roff(player_type *player_ptr) void output_monster_spoiler(MONRACE_IDX r_idx, void (*roff_func)(TERM_COLOR attr, concptr str)) { hook_c_roff = roff_func; - player_type dummy; + PlayerType dummy; dummy.lev = 1; dummy.max_plv = 1; @@ -400,7 +400,7 @@ void display_monster_alignment(lore_type *lore_ptr) * @param player_ptr プレイヤーの情報へのポインター * @param lore_ptr モンスターの思い出の情報へのポインター */ -void display_monster_exp(player_type *player_ptr, lore_type *lore_ptr) +void display_monster_exp(PlayerType *player_ptr, lore_type *lore_ptr) { #ifdef JP hooked_roff("を倒すことは"); @@ -471,7 +471,7 @@ void display_monster_aura(lore_type *lore_ptr) hook_c_roff(TERM_L_BLUE, format(_("%^sはスパークに包まれている。", "%^s is surrounded by electricity. "), Who::who(lore_ptr->msex))); } -void display_lore_this(player_type *player_ptr, lore_type *lore_ptr) +void display_lore_this(PlayerType *player_ptr, lore_type *lore_ptr) { if ((lore_ptr->r_ptr->r_tkills == 0) && !lore_ptr->know_everything) return; @@ -554,7 +554,7 @@ void display_monster_collective(lore_type *lore_ptr) * a monster. * @todo max_blows はゲームの中核的なパラメータの1つなのでどこかのヘッダに定数宣言しておきたい */ -void display_monster_launching(player_type *player_ptr, lore_type *lore_ptr) +void display_monster_launching(PlayerType *player_ptr, lore_type *lore_ptr) { if (lore_ptr->ability_flags.has(MonsterAbilityType::ROCKET)) { set_damage(player_ptr, lore_ptr, MonsterAbilityType::ROCKET, _("ロケット%sを発射する", "shoot a rocket%s")); diff --git a/src/view/display-lore.h b/src/view/display-lore.h index 158001860..d36019a57 100644 --- a/src/view/display-lore.h +++ b/src/view/display-lore.h @@ -4,10 +4,10 @@ #include "system/angband.h" struct lore_type; -struct player_type; +class PlayerType; void roff_top(MONRACE_IDX r_idx); -void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode); -void display_roff(player_type *player_ptr); +void screen_roff(PlayerType *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode); +void display_roff(PlayerType *player_ptr); void output_monster_spoiler(MONRACE_IDX r_idx, void (*roff_func)(TERM_COLOR attr, concptr str)); void display_kill_numbers(lore_type *lore_ptr); bool display_where_to_appear(lore_type *lore_ptr); @@ -16,10 +16,10 @@ void display_monster_move(lore_type *lore_ptr); void display_monster_never_move(lore_type *lore_ptr); void display_monster_kind(lore_type *lore_ptr); void display_monster_alignment(lore_type *lore_ptr); -void display_monster_exp(player_type *player_ptr, lore_type *lore_ptr); +void display_monster_exp(PlayerType *player_ptr, lore_type *lore_ptr); void display_monster_aura(lore_type *lore_ptr); -void display_lore_this(player_type *player_ptr, lore_type *lore_ptr); +void display_lore_this(PlayerType *player_ptr, lore_type *lore_ptr); void display_monster_collective(lore_type *lore_ptr); -void display_monster_launching(player_type *player_ptr, lore_type *lore_ptr); +void display_monster_launching(PlayerType *player_ptr, lore_type *lore_ptr); void display_monster_sometimes(lore_type *lore_ptr); void display_monster_guardian(lore_type *lore_ptr); diff --git a/src/view/display-map.cpp b/src/view/display-map.cpp index 469ca8980..1af8a73e6 100644 --- a/src/view/display-map.cpp +++ b/src/view/display-map.cpp @@ -138,7 +138,7 @@ static bool is_revealed_wall(floor_type *floor_ptr, feature_type *f_ptr, POSITIO * @param tap 文字色属性(タイル) * @param tcp 文字種属性(タイル) */ -void map_info(player_type *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp) +void map_info(PlayerType *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; diff --git a/src/view/display-map.h b/src/view/display-map.h index 793533f40..be6ba8444 100644 --- a/src/view/display-map.h +++ b/src/view/display-map.h @@ -9,5 +9,5 @@ extern byte display_autopick; extern char image_object_hack[MAX_IMAGE_OBJECT_HACK]; extern char image_monster_hack[MAX_IMAGE_MONSTER_HACK]; -struct player_type; -void map_info(player_type *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp); +class PlayerType; +void map_info(PlayerType *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp); diff --git a/src/view/display-messages.cpp b/src/view/display-messages.cpp index 362224cc4..cd3275dab 100644 --- a/src/view/display-messages.cpp +++ b/src/view/display-messages.cpp @@ -197,7 +197,7 @@ bool is_msg_window_flowed(void) /* * Hack -- flush */ -static void msg_flush(player_type *player_ptr, int x) +static void msg_flush(PlayerType *player_ptr, int x) { byte a = TERM_L_BLUE; bool show_more = (num_more >= 0); diff --git a/src/view/display-player-middle.cpp b/src/view/display-player-middle.cpp index 998d9b4b4..9f80decfa 100644 --- a/src/view/display-player-middle.cpp +++ b/src/view/display-player-middle.cpp @@ -33,7 +33,7 @@ * @param hand 武器の装備部位ID * @param hand_entry 項目ID */ -static void display_player_melee_bonus(player_type *player_ptr, int hand, int hand_entry) +static void display_player_melee_bonus(PlayerType *player_ptr, int hand, int hand_entry) { HIT_PROB show_tohit = player_ptr->dis_to_h[hand]; HIT_POINT show_todam = player_ptr->dis_to_d[hand]; @@ -61,7 +61,7 @@ static void display_player_melee_bonus(player_type *player_ptr, int hand, int ha * @brief 右手に比べて左手の表示ルーチンが複雑なので分離 * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_sub_hand(player_type *player_ptr) +static void display_sub_hand(PlayerType *player_ptr) { if (can_attack_with_sub_hand(player_ptr)) { display_player_melee_bonus(player_ptr, 1, left_hander ? ENTRY_RIGHT_HAND2 : ENTRY_LEFT_HAND2); @@ -88,7 +88,7 @@ static void display_sub_hand(player_type *player_ptr) * @brief 武器による命中率とダメージの補正を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_hit_damage(player_type *player_ptr) +static void display_hit_damage(PlayerType *player_ptr) { object_type *o_ptr = &player_ptr->inventory_list[INVEN_BOW]; HIT_PROB show_tohit = player_ptr->dis_to_h_b; @@ -112,7 +112,7 @@ static void display_hit_damage(player_type *player_ptr) * @brief 射撃武器倍率を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_shoot_magnification(player_type *player_ptr) +static void display_shoot_magnification(PlayerType *player_ptr) { int tmul = 0; if (player_ptr->inventory_list[INVEN_BOW].k_idx) { @@ -131,7 +131,7 @@ static void display_shoot_magnification(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param base_speed プレイヤーの速度 */ -static TERM_COLOR decide_speed_color(player_type *player_ptr, const int base_speed) +static TERM_COLOR decide_speed_color(PlayerType *player_ptr, const int base_speed) { TERM_COLOR attr; if (base_speed > 0) { @@ -159,7 +159,7 @@ static TERM_COLOR decide_speed_color(player_type *player_ptr, const int base_spe * @param player_ptr プレイヤーへの参照ポインタ * @return プレイヤーの速度 */ -static int calc_temporary_speed(player_type *player_ptr) +static int calc_temporary_speed(PlayerType *player_ptr) { int tmp_speed = 0; if (!player_ptr->riding) { @@ -186,7 +186,7 @@ static int calc_temporary_speed(player_type *player_ptr) * @param base_speed プレイヤーの素の速度 * @param tmp_speed アイテム等で一時的に変化した速度量 */ -static void display_player_speed(player_type *player_ptr, TERM_COLOR attr, int base_speed, int tmp_speed) +static void display_player_speed(PlayerType *player_ptr, TERM_COLOR attr, int base_speed, int tmp_speed) { char buf[160]; if (tmp_speed) { @@ -218,7 +218,7 @@ static void display_player_speed(player_type *player_ptr, TERM_COLOR attr, int b * @brief プレイヤーの現在経験値・最大経験値・次のレベルまでに必要な経験値を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_player_exp(player_type *player_ptr) +static void display_player_exp(PlayerType *player_ptr) { int e = (player_ptr->prace == PlayerRaceType::ANDROID) ? ENTRY_EXP_ANDR : ENTRY_CUR_EXP; if (player_ptr->exp >= player_ptr->max_exp) @@ -243,7 +243,7 @@ static void display_player_exp(player_type *player_ptr) * @brief ゲーム内の経過時間を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_playtime_in_game(player_type *player_ptr) +static void display_playtime_in_game(PlayerType *player_ptr) { int day, hour, min; extract_day_hour_min(player_ptr, &day, &hour, &min); @@ -289,7 +289,7 @@ static void display_real_playtime(void) * @param player_ptr プレイヤーへの参照ポインタ * Prints the following information on the screen. */ -void display_player_middle(player_type *player_ptr) +void display_player_middle(PlayerType *player_ptr) { if (can_attack_with_main_hand(player_ptr)) display_player_melee_bonus(player_ptr, 0, left_hander ? ENTRY_LEFT_HAND1 : ENTRY_RIGHT_HAND1); diff --git a/src/view/display-player-middle.h b/src/view/display-player-middle.h index 80b0a2f51..d41e8d8cd 100644 --- a/src/view/display-player-middle.h +++ b/src/view/display-player-middle.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void display_player_middle(player_type *player_ptr); +class PlayerType; +void display_player_middle(PlayerType *player_ptr); diff --git a/src/view/display-player-misc-info.cpp b/src/view/display-player-misc-info.cpp index 62ca8d547..3a7f08d9e 100644 --- a/src/view/display-player-misc-info.cpp +++ b/src/view/display-player-misc-info.cpp @@ -12,7 +12,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * Special display, part 2a */ -void display_player_misc_info(player_type *player_ptr) +void display_player_misc_info(PlayerType *player_ptr) { put_str(_("名前 :", "Name :"), 1, 26); put_str(_("性別 :", "Sex :"), 3, 1); diff --git a/src/view/display-player-misc-info.h b/src/view/display-player-misc-info.h index 10fe6ba64..3014f6a42 100644 --- a/src/view/display-player-misc-info.h +++ b/src/view/display-player-misc-info.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void display_player_misc_info(player_type *player_ptr); +class PlayerType; +void display_player_misc_info(PlayerType *player_ptr); diff --git a/src/view/display-player-stat-info.cpp b/src/view/display-player-stat-info.cpp index 607e1adf8..43829da38 100644 --- a/src/view/display-player-stat-info.cpp +++ b/src/view/display-player-stat-info.cpp @@ -31,7 +31,7 @@ * @return 基礎値 * @details 最大が18になるのはD&D由来 */ -static int calc_basic_stat(player_type *player_ptr, int stat_num) +static int calc_basic_stat(PlayerType *player_ptr, int stat_num) { int e_adj = 0; if ((player_ptr->stat_max[stat_num] > 18) && (player_ptr->stat_top[stat_num] > 18)) @@ -55,7 +55,7 @@ static int calc_basic_stat(player_type *player_ptr, int stat_num) * @param stat_num 能力値番号 * @return 補正後の基礎パラメータ */ -static int compensate_special_race(player_type *player_ptr, int stat_num) +static int compensate_special_race(PlayerType *player_ptr, int stat_num) { if (!PlayerRace(player_ptr).equals(PlayerRaceType::ENT)) return 0; @@ -91,7 +91,7 @@ static int compensate_special_race(player_type *player_ptr, int stat_num) * @param row 行数 * @param stat_col 列数 */ -static void display_basic_stat_name(player_type *player_ptr, int stat_num, int row, int stat_col) +static void display_basic_stat_name(PlayerType *player_ptr, int stat_num, int row, int stat_col) { if (player_ptr->stat_cur[stat_num] < player_ptr->stat_max[stat_num]) c_put_str(TERM_WHITE, stat_names_reduced[stat_num], row + stat_num + 1, stat_col + 1); @@ -109,7 +109,7 @@ static void display_basic_stat_name(player_type *player_ptr, int stat_num, int r * @param stat_col 列数 * @param buf 能力値の数値 */ -static void display_basic_stat_value(player_type *player_ptr, int stat_num, int r_adj, int e_adj, int row, int stat_col, char *buf) +static void display_basic_stat_value(PlayerType *player_ptr, int stat_num, int r_adj, int e_adj, int row, int stat_col, char *buf) { (void)sprintf(buf, "%3d", r_adj); c_put_str(TERM_L_BLUE, buf, row + stat_num + 1, stat_col + 13); @@ -138,7 +138,7 @@ static void display_basic_stat_value(player_type *player_ptr, int stat_num, int * @param row 行数 * @param stat_col 列数 */ -static void process_stats(player_type *player_ptr, int row, int stat_col) +static void process_stats(PlayerType *player_ptr, int row, int stat_col) { char buf[80]; for (int i = 0; i < A_MAX; i++) { @@ -196,7 +196,7 @@ static void compensate_stat_by_weapon(char *c, TERM_COLOR *a, object_type *o_ptr * @param row 行数 * @param col 列数 */ -static void display_equipments_compensation(player_type *player_ptr, int row, int *col) +static void display_equipments_compensation(PlayerType *player_ptr, int row, int *col) { for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) { object_type *o_ptr; @@ -224,7 +224,7 @@ static void display_equipments_compensation(player_type *player_ptr, int row, in * @param player_ptr プレイヤーへの参照ポインタ * @param stat 能力値番号 */ -static int compensation_stat_by_mutation(player_type *player_ptr, int stat) +static int compensation_stat_by_mutation(PlayerType *player_ptr, int stat) { int compensation = 0; if (stat == A_STR) { @@ -295,7 +295,7 @@ static int compensation_stat_by_mutation(player_type *player_ptr, int stat) * @param c 補正後の表示記号 * @param a 表示色 */ -static void change_display_by_mutation(player_type *player_ptr, int stat, char *c, TERM_COLOR *a) +static void change_display_by_mutation(PlayerType *player_ptr, int stat, char *c, TERM_COLOR *a) { int compensation = compensation_stat_by_mutation(player_ptr, stat); if (compensation == 0) @@ -321,7 +321,7 @@ static void change_display_by_mutation(player_type *player_ptr, int stat, char * * @param col 列数 * @param row 行数 */ -static void display_mutation_compensation(player_type *player_ptr, int row, int col) +static void display_mutation_compensation(PlayerType *player_ptr, int row, int col) { TrFlags flags; player_flags(player_ptr, flags); @@ -355,7 +355,7 @@ static void display_mutation_compensation(player_type *player_ptr, int row, int * No mod, no sustain, will be a slate '.' * */ -void display_player_stat_info(player_type *player_ptr) +void display_player_stat_info(PlayerType *player_ptr) { int stat_col = 22; int row = 3; diff --git a/src/view/display-player-stat-info.h b/src/view/display-player-stat-info.h index ed9def155..610357823 100644 --- a/src/view/display-player-stat-info.h +++ b/src/view/display-player-stat-info.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void display_player_stat_info(player_type *player_ptr); +class PlayerType; +void display_player_stat_info(PlayerType *player_ptr); diff --git a/src/view/display-player.cpp b/src/view/display-player.cpp index e0e6af3f7..170f87581 100644 --- a/src/view/display-player.cpp +++ b/src/view/display-player.cpp @@ -48,7 +48,7 @@ * @param mode ステータス表示モード * @return どれかの処理をこなしたらTRUE、何もしなかったらFALSE */ -static bool display_player_info(player_type *player_ptr, int mode) +static bool display_player_info(PlayerType *player_ptr, int mode) { if (mode == 2) { display_player_misc_info(player_ptr); @@ -79,7 +79,7 @@ static bool display_player_info(player_type *player_ptr, int mode) * @brief 名前、性別、種族、職業を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_player_basic_info(player_type *player_ptr) +static void display_player_basic_info(PlayerType *player_ptr) { char tmp[64]; #ifdef JP @@ -98,7 +98,7 @@ static void display_player_basic_info(player_type *player_ptr) * @brief 魔法領域を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_magic_realms(player_type *player_ptr) +static void display_magic_realms(PlayerType *player_ptr) { if (player_ptr->realm1 == REALM_NONE && player_ptr->element == REALM_NONE) return; @@ -120,7 +120,7 @@ static void display_magic_realms(player_type *player_ptr) * @details * 日本語版では、身長はcmに、体重はkgに変更してある */ -static void display_phisique(player_type *player_ptr) +static void display_phisique(PlayerType *player_ptr) { #ifdef JP display_player_one_line(ENTRY_AGE, format("%d才", (int)player_ptr->age), TERM_L_BLUE); @@ -141,7 +141,7 @@ static void display_phisique(player_type *player_ptr) * @brief 能力値を (減少していたら色を変えて)表示する * @param player_ptr プレイヤーへの参照ポインタ */ -static void display_player_stats(player_type *player_ptr) +static void display_player_stats(PlayerType *player_ptr) { char buf[80]; for (int i = 0; i < A_MAX; i++) { @@ -170,7 +170,7 @@ static void display_player_stats(player_type *player_ptr) * @param statmsg メッセージバッファ * @return 生きていたらFALSE、死んでいたらTRUE */ -static bool search_death_cause(player_type *player_ptr, char *statmsg) +static bool search_death_cause(PlayerType *player_ptr, char *statmsg) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!player_ptr->is_dead) @@ -220,7 +220,7 @@ static bool search_death_cause(player_type *player_ptr, char *statmsg) * @param statmsg メッセージバッファ * @return クエスト内であればTRUE、いなければFALSE */ -static bool decide_death_in_quest(player_type *player_ptr, char *statmsg) +static bool decide_death_in_quest(PlayerType *player_ptr, char *statmsg) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (!floor_ptr->inside_quest || !quest_type::is_fixed(floor_ptr->inside_quest)) @@ -241,7 +241,7 @@ static bool decide_death_in_quest(player_type *player_ptr, char *statmsg) * @param player_ptr プレイヤーへの参照ポインタ * @param statmsg メッセージバッファ */ -static void decide_current_floor(player_type *player_ptr, char *statmsg) +static void decide_current_floor(PlayerType *player_ptr, char *statmsg) { if (search_death_cause(player_ptr, statmsg)) return; @@ -298,7 +298,7 @@ static void display_current_floor(char *statmsg) * Mode 4 = mutations * */ -void display_player(player_type *player_ptr, int mode) +void display_player(PlayerType *player_ptr, int mode) { if ((player_ptr->muta.any() || has_good_luck(player_ptr)) && display_mutations) mode = (mode % 6); @@ -346,7 +346,7 @@ void display_player(player_type *player_ptr, int mode) * @param mode オプション * @todo y = 6、x = 0、mode = 0で固定。何とかする */ -void display_player_equippy(player_type *player_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode) +void display_player_equippy(PlayerType *player_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode) { int max_i = (mode & DP_WP) ? INVEN_BOW + 1 : INVEN_TOTAL; for (int i = INVEN_MAIN_HAND; i < max_i; i++) { diff --git a/src/view/display-player.h b/src/view/display-player.h index da913c6e3..61ba0534f 100644 --- a/src/view/display-player.h +++ b/src/view/display-player.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void display_player(player_type *player_ptr, int mode); -void display_player_equippy(player_type *player_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode); +class PlayerType; +void display_player(PlayerType *player_ptr, int mode); +void display_player_equippy(PlayerType *player_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode); diff --git a/src/view/display-self-info.cpp b/src/view/display-self-info.cpp index 630eb754f..238e79ddd 100644 --- a/src/view/display-self-info.cpp +++ b/src/view/display-self-info.cpp @@ -9,7 +9,7 @@ #include "term/screen-processor.h" #include -void display_life_rating(player_type *player_ptr, self_info_type *self_ptr) +void display_life_rating(PlayerType *player_ptr, self_info_type *self_ptr) { player_ptr->knowledge |= KNOW_STAT | KNOW_HPRATE; strcpy(self_ptr->plev_buf, ""); @@ -21,7 +21,7 @@ void display_life_rating(player_type *player_ptr, self_info_type *self_ptr) self_ptr->info[self_ptr->line++] = ""; } -void display_max_base_status(player_type *player_ptr, self_info_type *self_ptr) +void display_max_base_status(PlayerType *player_ptr, self_info_type *self_ptr) { self_ptr->info[self_ptr->line++] = _("能力の最大値", "Limits of maximum stats"); for (int v_nr = 0; v_nr < A_MAX; v_nr++) { @@ -32,7 +32,7 @@ void display_max_base_status(player_type *player_ptr, self_info_type *self_ptr) } } -void display_virtue(player_type *player_ptr, self_info_type *self_ptr) +void display_virtue(PlayerType *player_ptr, self_info_type *self_ptr) { self_ptr->info[self_ptr->line++] = ""; std::string alg = PlayerAlignment(player_ptr).get_alignment_description(true); @@ -77,7 +77,7 @@ void display_virtue(player_type *player_ptr, self_info_type *self_ptr) } } -void display_mimic_race_ability(player_type *player_ptr, self_info_type *self_ptr) +void display_mimic_race_ability(PlayerType *player_ptr, self_info_type *self_ptr) { switch (player_ptr->mimic_form) { case MIMIC_DEMON: diff --git a/src/view/display-self-info.h b/src/view/display-self-info.h index 8679eeed8..c54c2dea5 100644 --- a/src/view/display-self-info.h +++ b/src/view/display-self-info.h @@ -1,9 +1,9 @@ #pragma once -struct player_type; +class PlayerType; struct self_info_type; -void display_life_rating(player_type *player_ptr, self_info_type *self_ptr); -void display_max_base_status(player_type *player_ptr, self_info_type *self_ptr); -void display_virtue(player_type *player_ptr, self_info_type *self_ptr); -void display_mimic_race_ability(player_type *player_ptr, self_info_type *self_ptr); +void display_life_rating(PlayerType *player_ptr, self_info_type *self_ptr); +void display_max_base_status(PlayerType *player_ptr, self_info_type *self_ptr); +void display_virtue(PlayerType *player_ptr, self_info_type *self_ptr); +void display_mimic_race_ability(PlayerType *player_ptr, self_info_type *self_ptr); void display_self_info(self_info_type *self_ptr); diff --git a/src/view/display-store.cpp b/src/view/display-store.cpp index 12b321deb..2ec0780d9 100644 --- a/src/view/display-store.cpp +++ b/src/view/display-store.cpp @@ -26,7 +26,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @details */ -void store_prt_gold(player_type *player_ptr) +void store_prt_gold(PlayerType *player_ptr) { prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53); char out_val[64]; @@ -40,7 +40,7 @@ void store_prt_gold(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param pos 表示行 */ -void display_entry(player_type *player_ptr, int pos) +void display_entry(PlayerType *player_ptr, int pos) { object_type *o_ptr; o_ptr = &st_ptr->stock[pos]; @@ -111,7 +111,7 @@ void display_entry(player_type *player_ptr, int pos) * @details * All prices are listed as "per individual object". -BEN- */ -void display_store_inventory(player_type *player_ptr) +void display_store_inventory(PlayerType *player_ptr) { int k; for (k = 0; k < store_bottom; k++) { @@ -145,7 +145,7 @@ void display_store_inventory(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @details */ -void display_store(player_type *player_ptr) +void display_store(PlayerType *player_ptr) { term_clear(); if (cur_store_num == StoreSaleType::HOME) { diff --git a/src/view/display-store.h b/src/view/display-store.h index cc42654b4..564abd90d 100644 --- a/src/view/display-store.h +++ b/src/view/display-store.h @@ -1,7 +1,7 @@ #pragma once -struct player_type; -void store_prt_gold(player_type *player_ptr); -void display_entry(player_type *player_ptr, int pos); -void display_store_inventory(player_type *player_ptr); -void display_store(player_type *player_ptr); +class PlayerType; +void store_prt_gold(PlayerType *player_ptr); +void display_entry(PlayerType *player_ptr, int pos); +void display_store_inventory(PlayerType *player_ptr); +void display_store(PlayerType *player_ptr); diff --git a/src/view/object-describer.cpp b/src/view/object-describer.cpp index a548deb8a..0af5708bc 100644 --- a/src/view/object-describer.cpp +++ b/src/view/object-describer.cpp @@ -17,7 +17,7 @@ * @param player_ptr プレイヤーへの参照ポインタ * @param item 残量を表示したいプレイヤーのアイテム所持スロット */ -void inven_item_charges(player_type *player_ptr, INVENTORY_IDX item) +void inven_item_charges(PlayerType *player_ptr, INVENTORY_IDX item) { object_type *o_ptr = &player_ptr->inventory_list[item]; if ((o_ptr->tval != ItemKindType::STAFF) && (o_ptr->tval != ItemKindType::WAND)) @@ -48,7 +48,7 @@ void inven_item_charges(player_type *player_ptr, INVENTORY_IDX item) * @param player_ptr プレイヤーへの参照ポインタ * @param item 残量を表示したいプレイヤーのアイテム所持スロット */ -void inven_item_describe(player_type *player_ptr, INVENTORY_IDX item) +void inven_item_describe(PlayerType *player_ptr, INVENTORY_IDX item) { object_type *o_ptr = &player_ptr->inventory_list[item]; GAME_TEXT o_name[MAX_NLEN]; @@ -72,7 +72,7 @@ void inven_item_describe(player_type *player_ptr, INVENTORY_IDX item) * @details * Include list of usable spells for readible books */ -void display_koff(player_type *player_ptr, KIND_OBJECT_IDX k_idx) +void display_koff(PlayerType *player_ptr, KIND_OBJECT_IDX k_idx) { object_type forge; object_type *q_ptr; diff --git a/src/view/object-describer.h b/src/view/object-describer.h index c8c2208ab..097b089c2 100644 --- a/src/view/object-describer.h +++ b/src/view/object-describer.h @@ -2,7 +2,7 @@ #include "system/angband.h" -struct player_type; -void inven_item_charges(player_type *player_ptr, INVENTORY_IDX item); -void inven_item_describe(player_type *player_ptr, INVENTORY_IDX item); -void display_koff(player_type *player_ptr, KIND_OBJECT_IDX k_idx); +class PlayerType; +void inven_item_charges(PlayerType *player_ptr, INVENTORY_IDX item); +void inven_item_describe(PlayerType *player_ptr, INVENTORY_IDX item); +void display_koff(PlayerType *player_ptr, KIND_OBJECT_IDX k_idx); diff --git a/src/view/status-first-page.cpp b/src/view/status-first-page.cpp index 832690fdd..2052f41e8 100644 --- a/src/view/status-first-page.cpp +++ b/src/view/status-first-page.cpp @@ -38,7 +38,7 @@ static TERM_COLOR likert_color = TERM_WHITE; * @param shots 射撃回数 * @param shot_frac 射撃速度 */ -static void calc_shot_params(player_type *player_ptr, object_type *o_ptr, int *shots, int *shot_frac) +static void calc_shot_params(PlayerType *player_ptr, object_type *o_ptr, int *shots, int *shot_frac) { if (o_ptr->k_idx == 0) return; @@ -72,7 +72,7 @@ static void calc_shot_params(player_type *player_ptr, object_type *o_ptr, int *s * @param o_ptr 装備中の武器への参照ポインタ * @return 利き手ならTRUE、反対の手ならFALSE */ -static bool calc_weapon_damage_limit(player_type *player_ptr, int hand, int *damage, int *basedam, object_type *o_ptr) +static bool calc_weapon_damage_limit(PlayerType *player_ptr, int hand, int *damage, int *basedam, object_type *o_ptr) { PLAYER_LEVEL level = player_ptr->lev; if (hand > 0) { @@ -131,7 +131,7 @@ static bool calc_weapon_one_hand(object_type *o_ptr, int hand, int *damage, int * @param flgs オブジェクトフラグ群 * @return 強化後の素手ダメージ */ -static int strengthen_basedam(player_type *player_ptr, object_type *o_ptr, int basedam, const TrFlags &flgs) +static int strengthen_basedam(PlayerType *player_ptr, object_type *o_ptr, int basedam, const TrFlags &flgs) { if (o_ptr->is_fully_known() && ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD))) { /* vorpal blade */ @@ -244,7 +244,7 @@ static concptr likert(int x, int y) * @param damage 直接攻撃のダメージ * @param to_h 命中補正 */ -static void calc_two_hands(player_type *player_ptr, int *damage, int *to_h) +static void calc_two_hands(PlayerType *player_ptr, int *damage, int *to_h) { object_type *o_ptr; o_ptr = &player_ptr->inventory_list[INVEN_BOW]; @@ -295,7 +295,7 @@ static void calc_two_hands(player_type *player_ptr, int *damage, int *to_h) * @param shot_frac 射撃速度 * @param display_player_one_line 1行表示用のコールバック関数 */ -static void display_first_page(player_type *player_ptr, int xthb, int *damage, int shots, int shot_frac) +static void display_first_page(PlayerType *player_ptr, int xthb, int *damage, int shots, int shot_frac) { int xthn = player_ptr->skill_thn + (player_ptr->to_h_m * BTH_PLUS_ADJ); @@ -375,7 +375,7 @@ static void display_first_page(player_type *player_ptr, int xthb, int *damage, i * @details * This code is "imitated" elsewhere to "dump" a character sheet. */ -void display_player_various(player_type *player_ptr) +void display_player_various(PlayerType *player_ptr) { object_type *o_ptr; o_ptr = &player_ptr->inventory_list[INVEN_BOW]; diff --git a/src/view/status-first-page.h b/src/view/status-first-page.h index ae0cd3271..89b7ebbff 100644 --- a/src/view/status-first-page.h +++ b/src/view/status-first-page.h @@ -50,5 +50,5 @@ #define ENTRY_EXP_ANDR 43 #define ENTRY_EXP_TO_ADV_ANDR 44 -struct player_type; -void display_player_various(player_type *player_ptr); +class PlayerType; +void display_player_various(PlayerType *player_ptr); diff --git a/src/window/display-sub-window-spells.cpp b/src/window/display-sub-window-spells.cpp index 886f487b2..f13266114 100644 --- a/src/window/display-sub-window-spells.cpp +++ b/src/window/display-sub-window-spells.cpp @@ -26,7 +26,7 @@ * Need to analyze size of the window. * Need more color coding. */ -static void display_spell_list(player_type *player_ptr) +static void display_spell_list(PlayerType *player_ptr) { TERM_LEN y, x; int m[9]; @@ -173,7 +173,7 @@ static void display_spell_list(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * Hack -- display spells in sub-windows */ -void fix_spell(player_type *player_ptr) +void fix_spell(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { term_type *old = Term; diff --git a/src/window/display-sub-window-spells.h b/src/window/display-sub-window-spells.h index d2279cb59..8740fb1c6 100644 --- a/src/window/display-sub-window-spells.h +++ b/src/window/display-sub-window-spells.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void fix_spell(player_type *player_ptr); +class PlayerType; +void fix_spell(PlayerType *player_ptr); diff --git a/src/window/display-sub-windows.cpp b/src/window/display-sub-windows.cpp index 36ef3ac26..493c531ae 100644 --- a/src/window/display-sub-windows.cpp +++ b/src/window/display-sub-windows.cpp @@ -66,7 +66,7 @@ FixItemTesterSetter::~FixItemTesterSetter() * @brief サブウィンドウに所持品一覧を表示する / Hack -- display inventory in sub-windows * @param player_ptr プレイヤーへの参照ポインタ */ -void fix_inventory(player_type *player_ptr) +void fix_inventory(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { term_type *old = Term; @@ -198,7 +198,7 @@ void print_monster_list(floor_type *floor_ptr, const std::vector &m * @brief 出現中モンスターのリストをサブウィンドウに表示する / Hack -- display monster list in sub-windows * @param player_ptr プレイヤーへの参照ポインタ */ -void fix_monster_list(player_type *player_ptr) +void fix_monster_list(PlayerType *player_ptr) { static std::vector monster_list; std::once_flag once; @@ -231,7 +231,7 @@ void fix_monster_list(player_type *player_ptr) * @brief 装備アイテム一覧を表示する / * Choice window "shadow" of the "show_equip()" function */ -static void display_equipment(player_type *player_ptr, const ItemTester &item_tester) +static void display_equipment(PlayerType *player_ptr, const ItemTester &item_tester) { if (!player_ptr || !player_ptr->inventory_list) return; @@ -304,7 +304,7 @@ static void display_equipment(player_type *player_ptr, const ItemTester &item_te * Hack -- display equipment in sub-windows * @param player_ptr プレイヤーへの参照ポインタ */ -void fix_equip(player_type *player_ptr) +void fix_equip(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { term_type *old = Term; @@ -325,7 +325,7 @@ void fix_equip(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * Hack -- display character in sub-windows */ -void fix_player(player_type *player_ptr) +void fix_player(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { term_type *old = Term; @@ -381,7 +381,7 @@ void fix_message(void) * @details * Note that the "player" symbol does NOT appear on the map. */ -void fix_overhead(player_type *player_ptr) +void fix_overhead(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { term_type *old = Term; @@ -408,7 +408,7 @@ void fix_overhead(player_type *player_ptr) * @brief 自分の周辺の地形をTermに表示する * @param プレイヤー情報への参照ポインタ */ -static void display_dungeon(player_type *player_ptr) +static void display_dungeon(PlayerType *player_ptr) { TERM_COLOR ta = 0; SYMBOL_CODE tc = '\0'; @@ -445,7 +445,7 @@ static void display_dungeon(player_type *player_ptr) * @brief 自分の周辺のダンジョンの地形をサブウィンドウに表示する / display dungeon view around player in a sub window * @param player_ptr プレイヤーへの参照ポインタ */ -void fix_dungeon(player_type *player_ptr) +void fix_dungeon(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { term_type *old = Term; @@ -467,7 +467,7 @@ void fix_dungeon(player_type *player_ptr) * Hack -- display dungeon view in sub-windows * @param player_ptr プレイヤーへの参照ポインタ */ -void fix_monster(player_type *player_ptr) +void fix_monster(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { term_type *old = Term; @@ -491,7 +491,7 @@ void fix_monster(player_type *player_ptr) * Hack -- display object recall in sub-windows * @param player_ptr プレイヤーへの参照ポインタ */ -void fix_object(player_type *player_ptr) +void fix_object(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { term_type *old = Term; @@ -536,7 +536,7 @@ static const monster_type *monster_on_floor_items(floor_type *floor_ptr, const g * @param y 参照する座標グリッドのy座標 * @param x 参照する座標グリッドのx座標 */ -static void display_floor_item_list(player_type *player_ptr, const int y, const int x) +static void display_floor_item_list(PlayerType *player_ptr, const int y, const int x) { // Term の行数を取得。 TERM_LEN term_h; @@ -612,7 +612,7 @@ static void display_floor_item_list(player_type *player_ptr, const int y, const /*! * @brief (y,x) のアイテム一覧をサブウィンドウに表示する / display item at (y,x) in sub-windows */ -void fix_floor_item_list(player_type *player_ptr, const int y, const int x) +void fix_floor_item_list(PlayerType *player_ptr, const int y, const int x) { for (int j = 0; j < 8; j++) { if (!angband_term[j]) @@ -636,7 +636,7 @@ void fix_floor_item_list(player_type *player_ptr, const int y, const int x) * @brief サブウィンドウに所持品、装備品リストの表示を行う / * Flip "inven" and "equip" in any sub-windows */ -void toggle_inventory_equipment(player_type *player_ptr) +void toggle_inventory_equipment(PlayerType *player_ptr) { for (int j = 0; j < 8; j++) { if (!angband_term[j]) diff --git a/src/window/display-sub-windows.h b/src/window/display-sub-windows.h index ce069909f..64068f2dd 100644 --- a/src/window/display-sub-windows.h +++ b/src/window/display-sub-windows.h @@ -5,20 +5,20 @@ #include struct floor_type; -struct player_type; +class PlayerType; class ItemTester; -void fix_inventory(player_type *player_ptr); +void fix_inventory(PlayerType *player_ptr); void print_monster_list(floor_type *floor_ptr, const std::vector &monster_list, TERM_LEN x, TERM_LEN y, TERM_LEN max_lines); -void fix_monster_list(player_type *player_ptr); -void fix_equip(player_type *player_ptr); -void fix_player(player_type *player_ptr); +void fix_monster_list(PlayerType *player_ptr); +void fix_equip(PlayerType *player_ptr); +void fix_player(PlayerType *player_ptr); void fix_message(void); -void fix_overhead(player_type *player_ptr); -void fix_dungeon(player_type *player_ptr); -void fix_monster(player_type *player_ptr); -void fix_object(player_type *player_ptr); -void fix_floor_item_list(player_type *player_ptr, const int y, const int x); -void toggle_inventory_equipment(player_type *player_ptr); +void fix_overhead(PlayerType *player_ptr); +void fix_dungeon(PlayerType *player_ptr); +void fix_monster(PlayerType *player_ptr); +void fix_object(PlayerType *player_ptr); +void fix_floor_item_list(PlayerType *player_ptr, const int y, const int x); +void toggle_inventory_equipment(PlayerType *player_ptr); /*! * @brief サブウィンドウ表示用の ItemTester オブジェクトを設定するクラス diff --git a/src/window/main-window-equipments.cpp b/src/window/main-window-equipments.cpp index 7aceedc96..ae6d0f8e4 100644 --- a/src/window/main-window-equipments.cpp +++ b/src/window/main-window-equipments.cpp @@ -24,7 +24,7 @@ * @param target_item アイテムの選択処理を行うか否か。 * @return 選択したアイテムのタグ */ -COMMAND_CODE show_equipment(player_type *player_ptr, int target_item, BIT_FLAGS mode, const ItemTester &item_tester) +COMMAND_CODE show_equipment(PlayerType *player_ptr, int target_item, BIT_FLAGS mode, const ItemTester &item_tester) { COMMAND_CODE i; int j, k, l; diff --git a/src/window/main-window-equipments.h b/src/window/main-window-equipments.h index 02f128990..f91add28b 100644 --- a/src/window/main-window-equipments.h +++ b/src/window/main-window-equipments.h @@ -2,6 +2,6 @@ #include "object/tval-types.h" -struct player_type; +class PlayerType; class ItemTester; -void display_inventory(player_type *player_ptr, const ItemTester& item_tester); +void display_inventory(PlayerType *player_ptr, const ItemTester& item_tester); diff --git a/src/window/main-window-left-frame.cpp b/src/window/main-window-left-frame.cpp index 19f62e871..bc8c4bd30 100644 --- a/src/window/main-window-left-frame.cpp +++ b/src/window/main-window-left-frame.cpp @@ -22,7 +22,7 @@ /*! * @brief プレイヤーの称号を表示する / Prints "title", including "wizard" or "winner" as needed. */ -void print_title(player_type *player_ptr) +void print_title(PlayerType *player_ptr) { GAME_TEXT str[14]; concptr p = ""; @@ -43,7 +43,7 @@ void print_title(player_type *player_ptr) /*! * @brief プレイヤーのレベルを表示する / Prints level */ -void print_level(player_type *player_ptr) +void print_level(PlayerType *player_ptr) { char tmp[32]; sprintf(tmp, "%5d", player_ptr->lev); @@ -59,7 +59,7 @@ void print_level(player_type *player_ptr) /*! * @brief プレイヤーの経験値を表示する / Display the experience */ -void print_exp(player_type *player_ptr) +void print_exp(PlayerType *player_ptr) { char out_val[32]; @@ -88,7 +88,7 @@ void print_exp(player_type *player_ptr) /*! * @brief プレイヤーのACを表示する / Prints current AC */ -void print_ac(player_type *player_ptr) +void print_ac(PlayerType *player_ptr) { char tmp[32]; @@ -107,7 +107,7 @@ void print_ac(player_type *player_ptr) /*! * @brief プレイヤーのHPを表示する / Prints Cur/Max hit points */ -void print_hp(player_type *player_ptr) +void print_hp(PlayerType *player_ptr) { char tmp[32]; put_str("HP", ROW_CURHP, COL_CURHP); @@ -131,7 +131,7 @@ void print_hp(player_type *player_ptr) /*! * @brief プレイヤーのMPを表示する / Prints players max/cur spell points */ -void print_sp(player_type *player_ptr) +void print_sp(PlayerType *player_ptr) { char tmp[32]; byte color; @@ -159,7 +159,7 @@ void print_sp(player_type *player_ptr) * @brief プレイヤーの所持金を表示する / Prints current gold * @param player_ptr プレイヤーへの参照ポインタ */ -void print_gold(player_type *player_ptr) +void print_gold(PlayerType *player_ptr) { char tmp[32]; put_str(_("$ ", "AU "), ROW_GOLD, COL_GOLD); @@ -171,7 +171,7 @@ void print_gold(player_type *player_ptr) * @brief 現在のフロアの深さを表示する / Prints depth in stat area * @param player_ptr プレイヤーへの参照ポインタ */ -void print_depth(player_type *player_ptr) +void print_depth(PlayerType *player_ptr) { char depths[32]; TERM_COLOR attr = TERM_WHITE; @@ -242,7 +242,7 @@ void print_depth(player_type *player_ptr) * @brief プレイヤーのステータスを一括表示する(左側部分) / Display basic info (mostly left of map) * @param player_ptr プレイヤーへの参照ポインタ */ -void print_frame_basic(player_type *player_ptr) +void print_frame_basic(PlayerType *player_ptr) { if (player_ptr->mimic_form) { print_field(mimic_info[player_ptr->mimic_form].title, ROW_RACE, COL_RACE); @@ -286,7 +286,7 @@ void print_frame_basic(player_type *player_ptr) * health-bar stops tracking any monster that "disappears". * */ -void health_redraw(player_type *player_ptr, bool riding) +void health_redraw(PlayerType *player_ptr, bool riding) { int16_t health_who; int row, col; diff --git a/src/window/main-window-left-frame.h b/src/window/main-window-left-frame.h index c965f7355..32c8784e5 100644 --- a/src/window/main-window-left-frame.h +++ b/src/window/main-window-left-frame.h @@ -1,13 +1,13 @@ #pragma once -struct player_type; -void print_title(player_type *player_ptr); -void print_level(player_type *player_ptr); -void print_exp(player_type *player_ptr); -void print_ac(player_type *player_ptr); -void print_hp(player_type *player_ptr); -void print_sp(player_type *player_ptr); -void print_gold(player_type *player_ptr); -void print_depth(player_type *player_ptr); -void print_frame_basic(player_type *player_ptr); -void health_redraw(player_type *player_ptr, bool riding); +class PlayerType; +void print_title(PlayerType *player_ptr); +void print_level(PlayerType *player_ptr); +void print_exp(PlayerType *player_ptr); +void print_ac(PlayerType *player_ptr); +void print_hp(PlayerType *player_ptr); +void print_sp(PlayerType *player_ptr); +void print_gold(PlayerType *player_ptr); +void print_depth(PlayerType *player_ptr); +void print_frame_basic(PlayerType *player_ptr); +void health_redraw(PlayerType *player_ptr, bool riding); diff --git a/src/window/main-window-stat-poster.cpp b/src/window/main-window-stat-poster.cpp index e5d14a630..80dab8832 100644 --- a/src/window/main-window-stat-poster.cpp +++ b/src/window/main-window-stat-poster.cpp @@ -46,7 +46,7 @@ * @brief プレイヤー能力値を描画する / Print character stat in given row, column * @param stat 描画するステータスのID */ -void print_stat(player_type *player_ptr, int stat) +void print_stat(PlayerType *player_ptr, int stat) { GAME_TEXT tmp[32]; if (player_ptr->stat_cur[stat] < player_ptr->stat_max[stat]) { @@ -73,7 +73,7 @@ void print_stat(player_type *player_ptr, int stat) /*! * @brief プレイヤーの負傷状態を表示する */ -void print_cut(player_type *player_ptr) +void print_cut(PlayerType *player_ptr) { auto player_cut = player_ptr->effects()->cut(); if (!player_cut->is_cut()) { @@ -89,7 +89,7 @@ void print_cut(player_type *player_ptr) * @brief プレイヤーの朦朧状態を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -void print_stun(player_type *player_ptr) +void print_stun(PlayerType *player_ptr) { auto player_stun = player_ptr->effects()->stun(); if (!player_stun->is_stunned()) { @@ -105,7 +105,7 @@ void print_stun(player_type *player_ptr) * @brief プレイヤーの空腹状態を表示する / Prints status of hunger * @param player_ptr プレイヤーへの参照ポインタ */ -void print_hunger(player_type *player_ptr) +void print_hunger(PlayerType *player_ptr) { if (allow_debug_options && player_ptr->current_floor_ptr->inside_arena) return; @@ -146,7 +146,7 @@ void print_hunger(player_type *player_ptr) * This function was a major bottleneck when resting, so a lot of * the text formatting code was optimized in place below. */ -void print_state(player_type *player_ptr) +void print_state(PlayerType *player_ptr) { TERM_COLOR attr = TERM_WHITE; GAME_TEXT text[16]; @@ -244,7 +244,7 @@ void print_state(player_type *player_ptr) * @brief プレイヤーの行動速度を表示する / Prints the speed_value of a character. -CJS- * @param player_ptr プレイヤーへの参照ポインタ */ -void print_speed(player_type *player_ptr) +void print_speed(PlayerType *player_ptr) { TERM_LEN wid, hgt; term_get_size(&wid, &hgt); @@ -301,7 +301,7 @@ void print_speed(player_type *player_ptr) * @brief プレイヤーの呪文学習可能状態を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -void print_study(player_type *player_ptr) +void print_study(PlayerType *player_ptr) { TERM_LEN wid, hgt; term_get_size(&wid, &hgt); @@ -319,7 +319,7 @@ void print_study(player_type *player_ptr) * @brief プレイヤーのものまね可能状態を表示する * @param player_ptr プレイヤーへの参照ポインタ */ -void print_imitation(player_type *player_ptr) +void print_imitation(PlayerType *player_ptr) { TERM_LEN wid, hgt; term_get_size(&wid, &hgt); @@ -345,7 +345,7 @@ void print_imitation(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @bar_flags 表示可否を決めるためのフラグ群 */ -static void add_hex_status_flags(player_type *player_ptr, BIT_FLAGS *bar_flags) +static void add_hex_status_flags(PlayerType *player_ptr, BIT_FLAGS *bar_flags) { if (player_ptr->realm1 != REALM_HEX) { return; @@ -433,7 +433,7 @@ static void add_hex_status_flags(player_type *player_ptr, BIT_FLAGS *bar_flags) /*! * @brief 下部に状態表示を行う / Show status bar */ -void print_status(player_type *player_ptr) +void print_status(PlayerType *player_ptr) { TERM_LEN wid, hgt; term_get_size(&wid, &hgt); @@ -652,7 +652,7 @@ void print_status(player_type *player_ptr) * @brief プレイヤーのステータスを一括表示する(下部分) / Display extra info (mostly below map) * @param player_ptr プレイヤーへの参照ポインタ */ -void print_frame_extra(player_type *player_ptr) +void print_frame_extra(PlayerType *player_ptr) { print_cut(player_ptr); print_stun(player_ptr); diff --git a/src/window/main-window-stat-poster.h b/src/window/main-window-stat-poster.h index a08f19562..13bab0f02 100644 --- a/src/window/main-window-stat-poster.h +++ b/src/window/main-window-stat-poster.h @@ -1,13 +1,13 @@ #pragma once -struct player_type; -void print_stat(player_type *player_ptr, int stat); -void print_cut(player_type *player_ptr); -void print_stun(player_type *player_ptr); -void print_hunger(player_type *player_ptr); -void print_state(player_type *player_ptr); -void print_speed(player_type *player_ptr); -void print_study(player_type *player_ptr); -void print_imitation(player_type *player_ptr); -void print_status(player_type *player_ptr); -void print_frame_extra(player_type *player_ptr); +class PlayerType; +void print_stat(PlayerType *player_ptr, int stat); +void print_cut(PlayerType *player_ptr); +void print_stun(PlayerType *player_ptr); +void print_hunger(PlayerType *player_ptr); +void print_state(PlayerType *player_ptr); +void print_speed(PlayerType *player_ptr); +void print_study(PlayerType *player_ptr); +void print_imitation(PlayerType *player_ptr); +void print_status(PlayerType *player_ptr); +void print_frame_extra(PlayerType *player_ptr); diff --git a/src/window/main-window-util.cpp b/src/window/main-window-util.cpp index 397a25f2a..dd019f0d2 100644 --- a/src/window/main-window-util.cpp +++ b/src/window/main-window-util.cpp @@ -63,7 +63,7 @@ void print_field(concptr info, TERM_LEN row, TERM_LEN col) * of both "lite_spot()" and "print_rel()", and that we use the * "lite_spot()" function to display the player grid, if needed. */ -void print_map(player_type *player_ptr) +void print_map(PlayerType *player_ptr) { TERM_LEN wid, hgt; term_get_size(&wid, &hgt); @@ -114,7 +114,7 @@ void print_map(player_type *player_ptr) (void)term_set_cursor(v); } -static void display_shortened_item_name(player_type *player_ptr, object_type *o_ptr, int y) +static void display_shortened_item_name(PlayerType *player_ptr, object_type *o_ptr, int y) { char buf[MAX_NLEN]; describe_flavor(player_ptr, buf, o_ptr, (OD_NO_FLAVOR | OD_OMIT_PREFIX | OD_NAME_ONLY)); @@ -184,7 +184,7 @@ static void display_shortened_item_name(player_type *player_ptr, object_type *o_ * メインウィンドウ('M'コマンド)、サブウィンドウ兼(縮小図)用。 * use_bigtile時に横の描画列数は1/2になる。 */ -void display_map(player_type *player_ptr, int *cy, int *cx) +void display_map(PlayerType *player_ptr, int *cy, int *cx) { int i, j, x, y; @@ -323,7 +323,7 @@ void display_map(player_type *player_ptr, int *cy, int *cx) view_granite_lite = old_view_granite_lite; } -void set_term_color(player_type *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp) +void set_term_color(PlayerType *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp) { if (!player_bold(player_ptr, y, x)) return; diff --git a/src/window/main-window-util.h b/src/window/main-window-util.h index 44f996769..c2048f433 100644 --- a/src/window/main-window-util.h +++ b/src/window/main-window-util.h @@ -16,9 +16,9 @@ extern POSITION panel_row_prt; extern int match_autopick; extern int feat_priority; -struct player_type; +class PlayerType; void print_field(concptr info, TERM_LEN row, TERM_LEN col); -void print_map(player_type *player_ptr); -void display_map(player_type *player_ptr, int *cy, int *cx); -void set_term_color(player_type *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp); +void print_map(PlayerType *player_ptr); +void display_map(PlayerType *player_ptr, int *cy, int *cx); +void set_term_color(PlayerType *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp); int panel_col_of(int col); diff --git a/src/wizard/artifact-analyzer.cpp b/src/wizard/artifact-analyzer.cpp index d5dd65044..cbabe1f58 100644 --- a/src/wizard/artifact-analyzer.cpp +++ b/src/wizard/artifact-analyzer.cpp @@ -48,7 +48,7 @@ static concptr *spoiler_flag_aux(const TrFlags &art_flags, const flag_desc *flag * @param o_ptr 記述を得たいオブジェクトの参照ポインタ * @param desc_ptr 記述内容を返すための文字列参照ポインタ */ -static void analyze_general(player_type *player_ptr, object_type *o_ptr, char *desc_ptr) +static void analyze_general(PlayerType *player_ptr, object_type *o_ptr, char *desc_ptr) { describe_flavor(player_ptr, desc_ptr, o_ptr, OD_NAME_AND_ENCHANT | OD_STORE | OD_DEBUG); } @@ -273,7 +273,7 @@ static void analyze_misc(object_type *o_ptr, char *misc_desc) * @param o_ptr オブジェクト構造体の参照ポインタ * @param desc_ptr 全アーティファクト情報を収める文字列参照ポインタ */ -void object_analyze(player_type *player_ptr, object_type *o_ptr, obj_desc_list *desc_ptr) +void object_analyze(PlayerType *player_ptr, object_type *o_ptr, obj_desc_list *desc_ptr) { analyze_general(player_ptr, o_ptr, desc_ptr->description); analyze_pval(o_ptr, &desc_ptr->pval_info); @@ -295,7 +295,7 @@ void object_analyze(player_type *player_ptr, object_type *o_ptr, obj_desc_list * * @param o_ptr ランダムアーティファクトのオブジェクト構造体参照ポインタ * @param desc_ptr 記述内容を収める構造体参照ポインタ */ -void random_artifact_analyze(player_type *player_ptr, object_type *o_ptr, obj_desc_list *desc_ptr) +void random_artifact_analyze(PlayerType *player_ptr, object_type *o_ptr, obj_desc_list *desc_ptr) { analyze_general(player_ptr, o_ptr, desc_ptr->description); analyze_pval(o_ptr, &desc_ptr->pval_info); diff --git a/src/wizard/artifact-analyzer.h b/src/wizard/artifact-analyzer.h index 1942b82ca..e6b822d68 100644 --- a/src/wizard/artifact-analyzer.h +++ b/src/wizard/artifact-analyzer.h @@ -2,6 +2,6 @@ struct object_type; typedef struct obj_desc_list obj_desc_list; -struct player_type; -void object_analyze(player_type *player_ptr, object_type *o_ptr, obj_desc_list *desc_ptr); -void random_artifact_analyze(player_type *player_ptr, object_type *o_ptr, obj_desc_list *desc_ptr); +class PlayerType; +void object_analyze(PlayerType *player_ptr, object_type *o_ptr, obj_desc_list *desc_ptr); +void random_artifact_analyze(PlayerType *player_ptr, object_type *o_ptr, obj_desc_list *desc_ptr); diff --git a/src/wizard/cmd-wizard.cpp b/src/wizard/cmd-wizard.cpp index 87b236b69..35a4d31af 100644 --- a/src/wizard/cmd-wizard.cpp +++ b/src/wizard/cmd-wizard.cpp @@ -118,7 +118,7 @@ void display_debug_menu(int page, int max_page, int page_size, int max_line) * @param cmd コマンドキー * @return コマンド終了ならTRUE、ページ送りならFALSE */ -bool exe_cmd_debug(player_type *player_ptr, char cmd) +bool exe_cmd_debug(PlayerType *player_ptr, char cmd) { switch (cmd) { case ' ': @@ -280,7 +280,7 @@ bool exe_cmd_debug(player_type *player_ptr, char cmd) * @details * 番号を指定するには、それをN及びデバッグコマンドをXとしてとして「0N^aX」とする */ -void do_cmd_debug(player_type *player_ptr) +void do_cmd_debug(PlayerType *player_ptr) { TERM_LEN hgt, wid; term_get_size(&wid, &hgt); diff --git a/src/wizard/cmd-wizard.h b/src/wizard/cmd-wizard.h index 015e525d9..b6be59a56 100644 --- a/src/wizard/cmd-wizard.h +++ b/src/wizard/cmd-wizard.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void do_cmd_debug(player_type *player_ptr); +class PlayerType; +void do_cmd_debug(PlayerType *player_ptr); diff --git a/src/wizard/fixed-artifacts-spoiler.cpp b/src/wizard/fixed-artifacts-spoiler.cpp index a58687044..7f5562a27 100644 --- a/src/wizard/fixed-artifacts-spoiler.cpp +++ b/src/wizard/fixed-artifacts-spoiler.cpp @@ -166,7 +166,7 @@ SpoilerOutputResultType spoil_fixed_artifact(concptr fname) if (!make_fake_artifact(&obj, a_ref.idx)) continue; - player_type dummy; + PlayerType dummy; obj_desc_list artifact; object_analyze(&dummy, &obj, &artifact); spoiler_print_art(&artifact); diff --git a/src/wizard/items-spoiler.cpp b/src/wizard/items-spoiler.cpp index 4f3e5dc9c..4e2d4826c 100644 --- a/src/wizard/items-spoiler.cpp +++ b/src/wizard/items-spoiler.cpp @@ -27,7 +27,7 @@ * @param val 価値を返すバッファ参照ポインタ * @param k ベースアイテムID */ -static void kind_info(player_type *player_ptr, char *buf, char *dam, char *wgt, char *chance, DEPTH *lev, PRICE *val, KIND_OBJECT_IDX k) +static void kind_info(PlayerType *player_ptr, char *buf, char *dam, char *wgt, char *chance, DEPTH *lev, PRICE *val, KIND_OBJECT_IDX k) { object_type forge; object_type *q_ptr = &forge; @@ -117,7 +117,7 @@ SpoilerOutputResultType spoil_obj_desc(concptr fname) } std::stable_sort(whats.begin(), whats.end(), [](auto k1_idx, auto k2_idx) { - player_type dummy; + PlayerType dummy; DEPTH d1, d2; PRICE p1, p2; kind_info(&dummy, nullptr, nullptr, nullptr, nullptr, &d1, &p1, k1_idx); @@ -132,7 +132,7 @@ SpoilerOutputResultType spoil_obj_desc(concptr fname) char wgt[80]; char chance[80]; char dam[80]; - player_type dummy; + PlayerType dummy; kind_info(&dummy, buf, dam, wgt, chance, &e, &v, k_idx); fprintf(spoiler_file, " %-35s%8s%7s%5d %-40s%9ld\n", buf, dam, wgt, static_cast(e), chance, static_cast(v)); } diff --git a/src/wizard/monster-info-spoiler.cpp b/src/wizard/monster-info-spoiler.cpp index 64e8a8492..6d2d324f1 100644 --- a/src/wizard/monster-info-spoiler.cpp +++ b/src/wizard/monster-info-spoiler.cpp @@ -74,7 +74,7 @@ static concptr attr_to_text(monster_race *r_ptr) SpoilerOutputResultType spoil_mon_desc(concptr fname, std::function filter_monster) { - player_type dummy; + PlayerType dummy; uint16_t why = 2; char buf[1024]; char nam[MAX_MONSTER_NAME + 10]; // ユニークには[U] が付くので少し伸ばす @@ -182,7 +182,7 @@ static void roff_func(TERM_COLOR attr, concptr str) */ SpoilerOutputResultType spoil_mon_info(concptr fname) { - player_type dummy; + PlayerType dummy; char buf[1024]; path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname); spoiler_file = angband_fopen(buf, "w"); diff --git a/src/wizard/wizard-game-modifier.cpp b/src/wizard/wizard-game-modifier.cpp index 30a2e8039..e6708c849 100644 --- a/src/wizard/wizard-game-modifier.cpp +++ b/src/wizard/wizard-game-modifier.cpp @@ -28,8 +28,8 @@ #include #include -void wiz_enter_quest(player_type *player_ptr); -void wiz_complete_quest(player_type *player_ptr); +void wiz_enter_quest(PlayerType *player_ptr); +void wiz_complete_quest(PlayerType *player_ptr); void wiz_restore_monster_max_num(); /*! @@ -64,7 +64,7 @@ void display_wizard_game_modifier_menu() * @brief ゲーム設定コマンドの入力を受け付ける * @param player_ptr プレイヤーの情報へのポインタ */ -void wizard_game_modifier(player_type *player_ptr) +void wizard_game_modifier(PlayerType *player_ptr) { screen_save(); display_wizard_game_modifier_menu(); @@ -101,7 +101,7 @@ void wizard_game_modifier(player_type *player_ptr) * @brief 指定したクエストに突入する * @param プレイヤーの情報へのポインタ */ -void wiz_enter_quest(player_type* player_ptr) +void wiz_enter_quest(PlayerType* player_ptr) { char ppp[30]; char tmp_val[5]; @@ -128,7 +128,7 @@ void wiz_enter_quest(player_type* player_ptr) * @brief 指定したクエストを完了させる * @param プレイヤーの情報へのポインタ */ -void wiz_complete_quest(player_type *player_ptr) +void wiz_complete_quest(PlayerType *player_ptr) { if (!player_ptr->current_floor_ptr->inside_quest) { msg_print("No current quest"); diff --git a/src/wizard/wizard-game-modifier.h b/src/wizard/wizard-game-modifier.h index da217edb6..4fa26f011 100644 --- a/src/wizard/wizard-game-modifier.h +++ b/src/wizard/wizard-game-modifier.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void wizard_game_modifier(player_type *player_ptr); +class PlayerType; +void wizard_game_modifier(PlayerType *player_ptr); diff --git a/src/wizard/wizard-item-modifier.cpp b/src/wizard/wizard-item-modifier.cpp index aca002073..fbb84056e 100644 --- a/src/wizard/wizard-item-modifier.cpp +++ b/src/wizard/wizard-item-modifier.cpp @@ -99,14 +99,14 @@ T clamp_cast(int val) } void wiz_restore_aware_flag_of_fixed_arfifact(ARTIFACT_IDX a_idx, bool aware = false); -void wiz_modify_item_activation(player_type *player_ptr); -void wiz_identify_full_inventory(player_type *player_ptr); +void wiz_modify_item_activation(PlayerType *player_ptr); +void wiz_identify_full_inventory(PlayerType *player_ptr); /*! * @brief ゲーム設定コマンドの入力を受け付ける * @param player_ptr プレイヤーの情報へのポインタ */ -void wizard_item_modifier(player_type *player_ptr) +void wizard_item_modifier(PlayerType *player_ptr) { screen_save(); display_wizard_sub_menu(); @@ -196,7 +196,7 @@ void wiz_restore_aware_flag_of_fixed_arfifact(ARTIFACT_IDX a_idx, bool aware) * @brief オブジェクトに発動を追加する/変更する * @param catser_ptr プレイヤー情報への参照ポインタ */ -void wiz_modify_item_activation(player_type *player_ptr) +void wiz_modify_item_activation(PlayerType *player_ptr) { auto q = _("どのアイテムの発動を変更しますか? ", "Which object? "); auto s = _("発動を変更するアイテムがない。", "Nothing to do with."); @@ -220,7 +220,7 @@ void wiz_modify_item_activation(player_type *player_ptr) * @brief インベントリ内のアイテムを全て*鑑定*済みにする * @param catser_ptr プレイヤー情報への参照ポインタ */ -void wiz_identify_full_inventory(player_type *player_ptr) +void wiz_identify_full_inventory(PlayerType *player_ptr) { for (int i = 0; i < INVEN_TOTAL; i++) { object_type *o_ptr = &player_ptr->inventory_list[i]; @@ -320,7 +320,7 @@ static void prt_binary(BIT_FLAGS flags, const int row, int col) * @param player_ptr プレイヤーへの参照ポインタ * @param o_ptr 詳細を表示するアイテム情報の参照ポインタ */ -static void wiz_display_item(player_type *player_ptr, object_type *o_ptr) +static void wiz_display_item(PlayerType *player_ptr, object_type *o_ptr) { auto flgs = object_flags(o_ptr); auto get_seq_32bits = [](const TrFlags &flgs, uint start) { @@ -391,7 +391,7 @@ static void wiz_display_item(player_type *player_ptr, object_type *o_ptr) * counter flags to prevent weirdness. We use the items to collect * statistics on item creation relative to the initial item. */ -static void wiz_statistics(player_type *player_ptr, object_type *o_ptr) +static void wiz_statistics(PlayerType *player_ptr, object_type *o_ptr) { concptr q = "Rolls: %ld Correct: %ld Matches: %ld Better: %ld Worse: %ld Other: %ld"; concptr p = "Enter number of items to roll: "; @@ -480,7 +480,7 @@ static void wiz_statistics(player_type *player_ptr, object_type *o_ptr) * Apply magic to an item or turn it into an artifact. -Bernd- * @param o_ptr 再生成の対象となるアイテム情報の参照ポインタ */ -static void wiz_reroll_item(player_type *player_ptr, object_type *o_ptr) +static void wiz_reroll_item(PlayerType *player_ptr, object_type *o_ptr) { if (o_ptr->is_artifact()) return; @@ -570,7 +570,7 @@ static void wiz_reroll_item(player_type *player_ptr, object_type *o_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param o_ptr 調整するアイテムの参照ポインタ */ -static void wiz_tweak_item(player_type *player_ptr, object_type *o_ptr) +static void wiz_tweak_item(PlayerType *player_ptr, object_type *o_ptr) { if (o_ptr->is_artifact()) return; @@ -644,7 +644,7 @@ static void wiz_quantity_item(object_type *o_ptr) * - Change properties (via wiz_tweak_item)
* - Change the number of items (via wiz_quantity_item)
*/ -void wiz_modify_item(player_type *player_ptr) +void wiz_modify_item(PlayerType *player_ptr) { concptr q = "Play with which object? "; concptr s = "You have nothing to play with."; @@ -706,7 +706,7 @@ void wiz_modify_item(player_type *player_ptr) /*! * @brief オブジェクトの装備スロットがエゴが有効なスロットかどうか判定 */ -static int is_slot_able_to_be_ego(player_type *player_ptr, object_type *o_ptr) +static int is_slot_able_to_be_ego(PlayerType *player_ptr, object_type *o_ptr) { int slot = wield_slot(player_ptr, o_ptr); @@ -737,7 +737,7 @@ static void wishing_puff_of_smoke(void) * @param confirm 願わない場合に確認するかどうか * @return 願った結果 */ -WishResultType do_cmd_wishing(player_type *player_ptr, int prob, bool allow_art, bool allow_ego, bool confirm) +WishResultType do_cmd_wishing(PlayerType *player_ptr, int prob, bool allow_art, bool allow_ego, bool confirm) { concptr fixed_str[] = { #ifdef JP diff --git a/src/wizard/wizard-item-modifier.h b/src/wizard/wizard-item-modifier.h index b67cfd735..29f7a44d9 100644 --- a/src/wizard/wizard-item-modifier.h +++ b/src/wizard/wizard-item-modifier.h @@ -4,8 +4,8 @@ enum class WishResultType { FAIL = -1, NOTHING = 0, NORMAL = 1, EGO = 2, ARTIFACT = 3, MAX }; -struct player_type; -void wizard_item_modifier(player_type *player_ptr); -void wiz_modify_item(player_type *player_ptr); -WishResultType do_cmd_wishing(player_type *player_ptr, int prob, bool art_ok, bool ego_ok, bool confirm); -void wiz_identify_full_inventory(player_type *player_ptr); +class PlayerType; +void wizard_item_modifier(PlayerType *player_ptr); +void wiz_modify_item(PlayerType *player_ptr); +WishResultType do_cmd_wishing(PlayerType *player_ptr, int prob, bool art_ok, bool ego_ok, bool confirm); +void wiz_identify_full_inventory(PlayerType *player_ptr); diff --git a/src/wizard/wizard-messages.cpp b/src/wizard/wizard-messages.cpp index ee4993cf0..56a67e038 100644 --- a/src/wizard/wizard-messages.cpp +++ b/src/wizard/wizard-messages.cpp @@ -4,7 +4,7 @@ #include "io/write-diary.h" #include "view/display-messages.h" -void msg_print_wizard(player_type *player_ptr, int cheat_type, concptr msg) +void msg_print_wizard(PlayerType *player_ptr, int cheat_type, concptr msg) { if (!cheat_room && cheat_type == CHEAT_DUNGEON) return; @@ -28,7 +28,7 @@ void msg_print_wizard(player_type *player_ptr, int cheat_type, concptr msg) /* * Display a formatted message, using "vstrnfmt()" and "msg_print()". */ -void msg_format_wizard(player_type *player_ptr, int cheat_type, concptr fmt, ...) +void msg_format_wizard(PlayerType *player_ptr, int cheat_type, concptr fmt, ...) { if (!cheat_room && cheat_type == CHEAT_DUNGEON) return; diff --git a/src/wizard/wizard-messages.h b/src/wizard/wizard-messages.h index 1d6a0fe5c..7aa54b5c2 100644 --- a/src/wizard/wizard-messages.h +++ b/src/wizard/wizard-messages.h @@ -2,6 +2,6 @@ #include "system/angband.h" -struct player_type; -void msg_print_wizard(player_type *player_ptr, int cheat_type, concptr msg); -void msg_format_wizard(player_type *player_ptr, int cheat_type, concptr fmt, ...); +class PlayerType; +void msg_print_wizard(PlayerType *player_ptr, int cheat_type, concptr msg); +void msg_format_wizard(PlayerType *player_ptr, int cheat_type, concptr fmt, ...); diff --git a/src/wizard/wizard-player-modifier.cpp b/src/wizard/wizard-player-modifier.cpp index 39cfce742..51375a7eb 100644 --- a/src/wizard/wizard-player-modifier.cpp +++ b/src/wizard/wizard-player-modifier.cpp @@ -55,7 +55,7 @@ void display_wizard_player_modifier_menu() * @brief プレイヤー設定コマンドの入力を受け付ける * @param player_ptr プレイヤーの情報へのポインタ */ -void wizard_player_modifier(player_type *player_ptr) +void wizard_player_modifier(PlayerType *player_ptr) { screen_save(); display_wizard_player_modifier_menu(); diff --git a/src/wizard/wizard-player-modifier.h b/src/wizard/wizard-player-modifier.h index fc22d625f..5f0b76417 100644 --- a/src/wizard/wizard-player-modifier.h +++ b/src/wizard/wizard-player-modifier.h @@ -1,4 +1,4 @@ #pragma once -struct player_type; -void wizard_player_modifier(player_type *player_ptr); +class PlayerType; +void wizard_player_modifier(PlayerType *player_ptr); diff --git a/src/wizard/wizard-special-process.cpp b/src/wizard/wizard-special-process.cpp index 90a9ead39..a72d32af3 100644 --- a/src/wizard/wizard-special-process.cpp +++ b/src/wizard/wizard-special-process.cpp @@ -110,7 +110,7 @@ * @brief プレイヤーを完全回復する / * Cure everything instantly */ -void wiz_cure_all(player_type *player_ptr) +void wiz_cure_all(PlayerType *player_ptr) { (void)life_stream(player_ptr, false, false); (void)restore_mana(player_ptr, true); @@ -224,7 +224,7 @@ static KIND_OBJECT_IDX wiz_create_itemtype() * Hack -- this routine always makes a "dungeon object", and applies * magic to it, and attempts to decline cursed items. */ -void wiz_create_item(player_type *player_ptr) +void wiz_create_item(PlayerType *player_ptr) { screen_save(); OBJECT_IDX k_idx = wiz_create_itemtype(); @@ -258,7 +258,7 @@ void wiz_create_item(player_type *player_ptr) * @param a_idx 固定アーティファクトのID * @return 固定アーティファクトの名称(Ex. ★ロング・ソード『リンギル』)を保持する std::string オブジェクト */ -static std::string wiz_make_named_artifact_desc(player_type *player_ptr, ARTIFACT_IDX a_idx) +static std::string wiz_make_named_artifact_desc(PlayerType *player_ptr, ARTIFACT_IDX a_idx) { const auto &a_ref = a_info[a_idx]; object_type obj; @@ -277,7 +277,7 @@ static std::string wiz_make_named_artifact_desc(player_type *player_ptr, ARTIFAC * @param a_idx_list 選択する候補となる固定アーティファクトのIDのリスト * @return 選択した固定アーティファクトのIDを返す。但しキャンセルした場合は std::nullopt を返す。 */ -static std::optional wiz_select_named_artifact(player_type *player_ptr, const std::vector &a_idx_list) +static std::optional wiz_select_named_artifact(PlayerType *player_ptr, const std::vector &a_idx_list) { constexpr auto MAX_PER_PAGE = 20UL; const auto page_max = (a_idx_list.size() - 1) / MAX_PER_PAGE + 1; @@ -351,7 +351,7 @@ static std::vector wiz_collect_group_a_idx(const grouper &group_ar /*! * @brief 固定アーティファクトを生成する / Create the artifact */ -void wiz_create_named_art(player_type *player_ptr) +void wiz_create_named_art(PlayerType *player_ptr) { screen_save(); @@ -390,7 +390,7 @@ void wiz_create_named_art(player_type *player_ptr) * @brief プレイヤーの現能力値を調整する / Change various "permanent" player variables. * @param player_ptr プレイヤーへの参照ポインタ */ -void wiz_change_status(player_type *player_ptr) +void wiz_change_status(PlayerType *player_ptr) { int tmp_int; char tmp_val[160]; @@ -469,7 +469,7 @@ void wiz_change_status(player_type *player_ptr) * Create desired feature * @param creaturer_ptr プレイヤーへの参照ポインタ */ -void wiz_create_feature(player_type *player_ptr) +void wiz_create_feature(PlayerType *player_ptr) { POSITION y, x; if (!tgt_pt(player_ptr, &x, &y)) @@ -527,7 +527,7 @@ void wiz_create_feature(player_type *player_ptr) * @details 0を指定すると地上に飛ぶが、元いた場所にしか飛ばない * @todo 可能ならダンジョンの入口 (例:ルルイエなら大洋の真ん中)へ飛べるようにしたい */ -static bool select_debugging_floor(player_type *player_ptr, int dungeon_type) +static bool select_debugging_floor(PlayerType *player_ptr, int dungeon_type) { auto max_depth = d_info[dungeon_type].maxdepth; if ((max_depth == 0) || (dungeon_type > static_cast(d_info.size()))) { @@ -570,7 +570,7 @@ static bool select_debugging_floor(player_type *player_ptr, int dungeon_type) * @param player_ptr プレイヤーへの参照ポインタ * @details 範囲外の値が選択されたら再入力を促す */ -static bool select_debugging_dungeon(player_type *player_ptr, DUNGEON_IDX *dungeon_type) +static bool select_debugging_dungeon(PlayerType *player_ptr, DUNGEON_IDX *dungeon_type) { if (command_arg > 0) { return true; @@ -599,7 +599,7 @@ static bool select_debugging_dungeon(player_type *player_ptr, DUNGEON_IDX *dunge * @brief 任意のダンジョン及び階層に飛ぶtための選択処理 * Go to any level */ -void wiz_jump_to_dungeon(player_type *player_ptr) +void wiz_jump_to_dungeon(PlayerType *player_ptr) { DUNGEON_IDX dungeon_type = 1; if (!select_debugging_dungeon(player_ptr, &dungeon_type)) { @@ -628,7 +628,7 @@ void wiz_jump_to_dungeon(player_type *player_ptr) * Become aware of a lot of objects * @param player_ptr プレイヤーへの参照ポインタ */ -void wiz_learn_items_all(player_type *player_ptr) +void wiz_learn_items_all(PlayerType *player_ptr) { object_type forge; object_type *q_ptr; @@ -644,7 +644,7 @@ void wiz_learn_items_all(player_type *player_ptr) /*! * @brief プレイヤーの種族を変更する */ -void wiz_reset_race(player_type *player_ptr) +void wiz_reset_race(PlayerType *player_ptr) { char ppp[80]; sprintf(ppp, "Race (0-%d): ", MAX_RACES - 1); @@ -672,7 +672,7 @@ void wiz_reset_race(player_type *player_ptr) * @brief プレイヤーの職業を変更する * @todo 魔法領域の再選択などがまだ不完全、要実装。 */ -void wiz_reset_class(player_type *player_ptr) +void wiz_reset_class(PlayerType *player_ptr) { char ppp[80]; sprintf(ppp, "Class (0-%d): ", PLAYER_CLASS_TYPE_MAX - 1); @@ -702,7 +702,7 @@ void wiz_reset_class(player_type *player_ptr) * @brief プレイヤーの領域を変更する * @todo 存在有無などは未判定。そのうちすべき。 */ -void wiz_reset_realms(player_type *player_ptr) +void wiz_reset_realms(PlayerType *player_ptr) { char ppp[80]; char tmp_val[160]; @@ -800,7 +800,7 @@ void set_gametime(void) /*! * @brief プレイヤー近辺の全モンスターを消去する / Delete all nearby monsters */ -void wiz_zap_surrounding_monsters(player_type *player_ptr) +void wiz_zap_surrounding_monsters(PlayerType *player_ptr) { for (MONSTER_IDX i = 1; i < player_ptr->current_floor_ptr->m_max; i++) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[i]; @@ -822,7 +822,7 @@ void wiz_zap_surrounding_monsters(player_type *player_ptr) * @brief フロアに存在する全モンスターを消去する / Delete all monsters * @param player_ptr 術者の参照ポインタ */ -void wiz_zap_floor_monsters(player_type *player_ptr) +void wiz_zap_floor_monsters(PlayerType *player_ptr) { for (MONSTER_IDX i = 1; i < player_ptr->current_floor_ptr->m_max; i++) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[i]; @@ -839,7 +839,7 @@ void wiz_zap_floor_monsters(player_type *player_ptr) } } -void cheat_death(player_type *player_ptr) +void cheat_death(PlayerType *player_ptr) { if (player_ptr->sc) player_ptr->sc = player_ptr->age = 0; diff --git a/src/wizard/wizard-special-process.h b/src/wizard/wizard-special-process.h index 89e4546e1..41d2ae392 100644 --- a/src/wizard/wizard-special-process.h +++ b/src/wizard/wizard-special-process.h @@ -2,19 +2,19 @@ #include "system/angband.h" -struct player_type; -void wiz_cure_all(player_type *player_ptr); -void wiz_create_item(player_type *player_ptr); -void wiz_create_named_art(player_type *player_ptr); -void wiz_change_status(player_type *player_ptr); -void wiz_create_feature(player_type *player_ptr); -void wiz_jump_to_dungeon(player_type *player_ptr); -void wiz_learn_items_all(player_type *player_ptr); -void wiz_reset_race(player_type *player_ptr); -void wiz_reset_class(player_type *player_ptr); -void wiz_reset_realms(player_type *player_ptr); +class PlayerType; +void wiz_cure_all(PlayerType *player_ptr); +void wiz_create_item(PlayerType *player_ptr); +void wiz_create_named_art(PlayerType *player_ptr); +void wiz_change_status(PlayerType *player_ptr); +void wiz_create_feature(PlayerType *player_ptr); +void wiz_jump_to_dungeon(PlayerType *player_ptr); +void wiz_learn_items_all(PlayerType *player_ptr); +void wiz_reset_race(PlayerType *player_ptr); +void wiz_reset_class(PlayerType *player_ptr); +void wiz_reset_realms(PlayerType *player_ptr); void wiz_dump_options(void); void set_gametime(void); -void wiz_zap_surrounding_monsters(player_type *player_ptr); -void wiz_zap_floor_monsters(player_type *player_ptr); -extern void cheat_death(player_type *player_ptr); +void wiz_zap_surrounding_monsters(PlayerType *player_ptr); +void wiz_zap_floor_monsters(PlayerType *player_ptr); +extern void cheat_death(PlayerType *player_ptr); diff --git a/src/wizard/wizard-spells.cpp b/src/wizard/wizard-spells.cpp index 6dc89bf28..70fa3ce7c 100644 --- a/src/wizard/wizard-spells.cpp +++ b/src/wizard/wizard-spells.cpp @@ -53,7 +53,7 @@ debug_spell_command debug_spell_commands_list[SPELL_MAX] = { * @brief コマンド入力により任意にスペル効果を起こす / Wizard spells * @return 実際にテレポートを行ったらTRUEを返す */ -bool wiz_debug_spell(player_type *player_ptr) +bool wiz_debug_spell(PlayerType *player_ptr) { char tmp_val[50] = "\0"; int tmp_int; @@ -99,7 +99,7 @@ bool wiz_debug_spell(player_type *player_ptr) * @brief 必ず成功するウィザードモード用次元の扉処理 / Wizard Dimension Door * @param player_ptr プレイヤーへの参照ポインタ */ -void wiz_dimension_door(player_type *player_ptr) +void wiz_dimension_door(PlayerType *player_ptr) { POSITION x = 0, y = 0; if (!tgt_pt(player_ptr, &x, &y)) @@ -112,7 +112,7 @@ void wiz_dimension_door(player_type *player_ptr) * @brief ウィザードモード用モンスターの群れ生成 / Summon a horde of monsters * @param player_ptr プレイヤーへの参照ポインタ */ -void wiz_summon_horde(player_type *player_ptr) +void wiz_summon_horde(PlayerType *player_ptr) { POSITION wy = player_ptr->y, wx = player_ptr->x; int attempts = 1000; @@ -129,7 +129,7 @@ void wiz_summon_horde(player_type *player_ptr) /*! * @brief ウィザードモード用処理としてターゲット中の相手をテレポートバックする / Hack -- Teleport to the target */ -void wiz_teleport_back(player_type *player_ptr) +void wiz_teleport_back(PlayerType *player_ptr) { if (!target_who) return; @@ -141,7 +141,7 @@ void wiz_teleport_back(player_type *player_ptr) * @brief 青魔導師の魔法を全て習得済みにする / * debug command for blue mage */ -void wiz_learn_blue_magic_all(player_type *player_ptr) +void wiz_learn_blue_magic_all(PlayerType *player_ptr) { auto bluemage_data = PlayerClass(player_ptr).get_specific_data(); if (!bluemage_data) { @@ -158,7 +158,7 @@ void wiz_learn_blue_magic_all(player_type *player_ptr) /*! * @brief 鍛冶師の全てのエッセンスを最大所持量にする */ -void wiz_fillup_all_smith_essences(player_type *player_ptr) +void wiz_fillup_all_smith_essences(PlayerType *player_ptr) { auto smith_data = PlayerClass(player_ptr).get_specific_data(); if (!smith_data) { @@ -176,7 +176,7 @@ void wiz_fillup_all_smith_essences(player_type *player_ptr) * @param player_ptr プレイヤーへの参照ポインタ * @param num 生成処理回数 */ -void wiz_summon_random_enemy(player_type *player_ptr, int num) +void wiz_summon_random_enemy(PlayerType *player_ptr, int num) { for (int i = 0; i < num; i++) (void)summon_specific(player_ptr, 0, player_ptr->y, player_ptr->x, player_ptr->current_floor_ptr->dun_level, SUMMON_NONE, PM_ALLOW_GROUP | PM_ALLOW_UNIQUE); @@ -189,7 +189,7 @@ void wiz_summon_random_enemy(player_type *player_ptr, int num) * @details * This function is rather dangerous */ -void wiz_summon_specific_enemy(player_type *player_ptr, MONRACE_IDX r_idx) +void wiz_summon_specific_enemy(PlayerType *player_ptr, MONRACE_IDX r_idx) { if (r_idx <= 0) { int val = 1; @@ -208,7 +208,7 @@ void wiz_summon_specific_enemy(player_type *player_ptr, MONRACE_IDX r_idx) * @details * This function is rather dangerous */ -void wiz_summon_pet(player_type *player_ptr, MONRACE_IDX r_idx) +void wiz_summon_pet(PlayerType *player_ptr, MONRACE_IDX r_idx) { if (r_idx <= 0) { int val = 1; @@ -226,7 +226,7 @@ void wiz_summon_pet(player_type *player_ptr, MONRACE_IDX r_idx) * @param effect_idx 属性ID * @details デフォルトは100万・GF_ARROW(射撃)。RES_ALL持ちも一撃で殺せる。 */ -void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam, AttributeType effect_idx) +void wiz_kill_enemy(PlayerType *player_ptr, HIT_POINT dam, AttributeType effect_idx) { if (dam <= 0) { char tmp[80] = ""; @@ -268,7 +268,7 @@ void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam, AttributeType effect * @param dam ダメージ量 * @param effect_idx 属性ID */ -void wiz_kill_me(player_type *player_ptr, HIT_POINT dam, AttributeType effect_idx) +void wiz_kill_me(PlayerType *player_ptr, HIT_POINT dam, AttributeType effect_idx) { if (dam <= 0) { char tmp[80] = ""; diff --git a/src/wizard/wizard-spells.h b/src/wizard/wizard-spells.h index 903e275cd..44b9e7fcb 100644 --- a/src/wizard/wizard-spells.h +++ b/src/wizard/wizard-spells.h @@ -6,26 +6,26 @@ #define SPELL_MAX 5 struct floor_type; -struct player_type; +class PlayerType; typedef union spell_functions { struct debug_spell_type1 { - bool (*spell_function)(player_type *, floor_type *); + bool (*spell_function)(PlayerType *, floor_type *); } spell1; struct debug_spell_type2 { - bool (*spell_function)(player_type *); + bool (*spell_function)(PlayerType *); } spell2; struct debug_spell_type3 { - bool (*spell_function)(player_type *, HIT_POINT); + bool (*spell_function)(PlayerType *, HIT_POINT); } spell3; struct debug_spell_type4 { // 実質 ty curse - bool (*spell_function)(player_type *, bool, int*); + bool (*spell_function)(PlayerType *, bool, int*); } spell4; struct debug_spell_type5 { - void (*spell_function)(player_type *); + void (*spell_function)(PlayerType *); } spell5; } spell_functions; @@ -38,14 +38,14 @@ typedef struct debug_spell_command { extern debug_spell_command debug_spell_commands_list[SPELL_MAX]; -bool wiz_debug_spell(player_type *player_ptr); -void wiz_dimension_door(player_type *player_ptr); -void wiz_summon_horde(player_type *player_ptr); -void wiz_teleport_back(player_type *player_ptr); -void wiz_learn_blue_magic_all(player_type *player_ptr); -void wiz_fillup_all_smith_essences(player_type *player_ptr); -void wiz_summon_random_enemy(player_type *player_ptr, int num); -void wiz_summon_specific_enemy(player_type *player_ptr, MONRACE_IDX r_idx); -void wiz_summon_pet(player_type *player_ptr, MONRACE_IDX r_idx); -void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam = 1000000, AttributeType effect_idx = AttributeType::ARROW); -void wiz_kill_me(player_type *player_ptr, HIT_POINT dam, AttributeType effect_idx); +bool wiz_debug_spell(PlayerType *player_ptr); +void wiz_dimension_door(PlayerType *player_ptr); +void wiz_summon_horde(PlayerType *player_ptr); +void wiz_teleport_back(PlayerType *player_ptr); +void wiz_learn_blue_magic_all(PlayerType *player_ptr); +void wiz_fillup_all_smith_essences(PlayerType *player_ptr); +void wiz_summon_random_enemy(PlayerType *player_ptr, int num); +void wiz_summon_specific_enemy(PlayerType *player_ptr, MONRACE_IDX r_idx); +void wiz_summon_pet(PlayerType *player_ptr, MONRACE_IDX r_idx); +void wiz_kill_enemy(PlayerType *player_ptr, HIT_POINT dam = 1000000, AttributeType effect_idx = AttributeType::ARROW); +void wiz_kill_me(PlayerType *player_ptr, HIT_POINT dam, AttributeType effect_idx); diff --git a/src/wizard/wizard-spoiler.cpp b/src/wizard/wizard-spoiler.cpp index 57d501226..1057c8d31 100644 --- a/src/wizard/wizard-spoiler.cpp +++ b/src/wizard/wizard-spoiler.cpp @@ -192,7 +192,7 @@ static SpoilerOutputResultType spoil_player_spell(concptr fname) spoil_out(buf); spoil_out("------------------------------------------\n\n"); - player_type dummy_p; + PlayerType dummy_p; dummy_p.lev = 1; for (int c = 0; c < PLAYER_CLASS_TYPE_MAX; c++) { diff --git a/src/world/world-movement-processor.cpp b/src/world/world-movement-processor.cpp index 56d33990d..dadf4c259 100644 --- a/src/world/world-movement-processor.cpp +++ b/src/world/world-movement-processor.cpp @@ -24,7 +24,7 @@ * @brief プレイヤーの現在ダンジョンIDと階層に応じて、ダンジョン内ランクエの自動放棄を行う * @param player_ptr プレイヤーへの参照ポインタ */ -void check_random_quest_auto_failure(player_type *player_ptr) +void check_random_quest_auto_failure(PlayerType *player_ptr) { if (player_ptr->dungeon_idx != DUNGEON_ANGBAND) { return; @@ -49,7 +49,7 @@ void check_random_quest_auto_failure(player_type *player_ptr) * Autosave BEFORE resetting the recall counter (rr9) * The player is yanked up/down as soon as he loads the autosaved game. */ -void execute_recall(player_type *player_ptr) +void execute_recall(PlayerType *player_ptr) { if (player_ptr->word_recall == 0) return; @@ -125,7 +125,7 @@ void execute_recall(player_type *player_ptr) * / Handle involuntary movement once every 10 game turns * @param player_ptr プレイヤーへの参照ポインタ */ -void execute_floor_reset(player_type *player_ptr) +void execute_floor_reset(PlayerType *player_ptr) { floor_type *floor_ptr = player_ptr->current_floor_ptr; if (player_ptr->alter_reality == 0) diff --git a/src/world/world-movement-processor.h b/src/world/world-movement-processor.h index 645a38f6b..9a91d4143 100644 --- a/src/world/world-movement-processor.h +++ b/src/world/world-movement-processor.h @@ -1,6 +1,6 @@ #pragma once -struct player_type; -void check_random_quest_auto_failure(player_type *player_ptr); -void execute_recall(player_type *player_ptr); -void execute_floor_reset(player_type* player_ptr); +class PlayerType; +void check_random_quest_auto_failure(PlayerType *player_ptr); +void execute_recall(PlayerType *player_ptr); +void execute_floor_reset(PlayerType* player_ptr); diff --git a/src/world/world-object.cpp b/src/world/world-object.cpp index 30c7b7eef..30f334259 100644 --- a/src/world/world-object.cpp +++ b/src/world/world-object.cpp @@ -66,7 +66,7 @@ OBJECT_IDX o_pop(floor_type *floor_ptr) * Note that if no objects are "appropriate", then this function will\n * fail, and return zero, but this should *almost* never happen.\n */ -OBJECT_IDX get_obj_num(player_type *player_ptr, DEPTH level, BIT_FLAGS mode) +OBJECT_IDX get_obj_num(PlayerType *player_ptr, DEPTH level, BIT_FLAGS mode) { if (level > MAX_DEPTH - 1) level = MAX_DEPTH - 1; diff --git a/src/world/world-object.h b/src/world/world-object.h index d20761b3e..94ee3c53a 100644 --- a/src/world/world-object.h +++ b/src/world/world-object.h @@ -3,6 +3,6 @@ #include "system/angband.h" struct floor_type; -struct player_type; +class PlayerType; OBJECT_IDX o_pop(floor_type *floor_ptr); -OBJECT_IDX get_obj_num(player_type *player_ptr, DEPTH level, BIT_FLAGS mode); +OBJECT_IDX get_obj_num(PlayerType *player_ptr, DEPTH level, BIT_FLAGS mode); diff --git a/src/world/world-turn-processor.cpp b/src/world/world-turn-processor.cpp index b8d7e1ac5..7285ffb54 100644 --- a/src/world/world-turn-processor.cpp +++ b/src/world/world-turn-processor.cpp @@ -43,7 +43,7 @@ #include "world/world-movement-processor.h" #include "world/world.h" -WorldTurnProcessor::WorldTurnProcessor(player_type *player_ptr) +WorldTurnProcessor::WorldTurnProcessor(PlayerType *player_ptr) : player_ptr(player_ptr) { } diff --git a/src/world/world-turn-processor.h b/src/world/world-turn-processor.h index c1ec18a92..9e6cda904 100644 --- a/src/world/world-turn-processor.h +++ b/src/world/world-turn-processor.h @@ -1,15 +1,15 @@ #pragma once -struct player_type; +class PlayerType; class WorldTurnProcessor { public: - WorldTurnProcessor(player_type *player_ptr); + WorldTurnProcessor(PlayerType *player_ptr); virtual ~WorldTurnProcessor() = default; void process_world(); void print_time(); private: - player_type *player_ptr; + PlayerType *player_ptr; int hour = 0; int min = 0; diff --git a/src/world/world.cpp b/src/world/world.cpp index fcce3494e..fe3fc1b82 100644 --- a/src/world/world.cpp +++ b/src/world/world.cpp @@ -28,7 +28,7 @@ bool is_daytime(void) * @param hour 時数を返すための参照ポインタ * @param min 分数を返すための参照ポインタ */ -void extract_day_hour_min(player_type *player_ptr, int *day, int *hour, int *min) +void extract_day_hour_min(PlayerType *player_ptr, int *day, int *hour, int *min) { const int32_t A_DAY = TURNS_PER_TICK * TOWN_DAWN; int32_t turn_in_today = (w_ptr->game_turn + A_DAY / 4) % A_DAY; diff --git a/src/world/world.h b/src/world/world.h index 030330c7e..391377a04 100644 --- a/src/world/world.h +++ b/src/world/world.h @@ -68,9 +68,9 @@ struct world_type { extern world_type *w_ptr; -struct player_type; +class PlayerType; bool is_daytime(void); -void extract_day_hour_min(player_type *player_ptr, int *day, int *hour, int *min); +void extract_day_hour_min(PlayerType *player_ptr, int *day, int *hour, int *min); void update_playtime(void); void add_winner_class(PlayerClassType c); void add_retired_class(PlayerClassType c);