From 649c000d613d6f2d95d49acff85c0fd0297a8ab1 Mon Sep 17 00:00:00 2001 From: Hourier Date: Wed, 3 Jun 2020 23:04:13 +0900 Subject: [PATCH] [Refactor] #40414 Separated realm-song-numbers.h from realm-song.h --- Hengband/Hengband/Hengband.vcxproj | 1 + Hengband/Hengband/Hengband.vcxproj.filters | 3 + src/cmd-action/cmd-spell.c | 43 ++++++------ src/cmd-action/cmd-spell.h | 35 +++++----- src/combat/melee-postprocess.c | 12 ++-- src/core/hp-mp-processor.c | 69 ++++++++++++------- src/core/hp-mp-processor.h | 2 + src/dungeon/dungeon-processor.c | 47 +++++++------ src/dungeon/dungeon-processor.h | 2 + src/floor/pattern-walk.c | 37 +++++----- src/floor/pattern-walk.h | 2 + src/grid/grid.c | 33 +++++---- src/io/targeting.c | 45 ++++++------ src/io/targeting.h | 25 +++---- src/mind/mind.c | 3 +- src/mind/mind.h | 2 + src/mspell/mspells1.c | 2 +- src/player/digestion-processor.c | 13 ++-- src/player/digestion-processor.h | 2 + src/player/player-damage.c | 50 +++++++------- src/player/player-damage.h | 2 + src/player/player-effects.c | 2 +- src/player/player-move.c | 2 +- src/player/player-status.c | 2 +- src/player/selfinfo.c | 17 +++-- src/player/selfinfo.h | 10 +-- src/player/temporary-resistances.c | 6 +- src/realm/realm-hex-numbers.h | 4 +- src/realm/realm-hex.c | 1 - src/realm/realm-song-numbers.h | 30 ++++++++ src/realm/realm-song.c | 22 +++--- src/realm/realm-song.h | 31 +-------- src/spell/music-checker.c | 14 ++-- src/spell/music-checker.h | 4 +- src/spell/spells-detection.c | 107 ++++++++++++++--------------- src/spell/spells-detection.h | 2 + src/spell/spells-status.c | 1 - src/view/display-main-window.c | 2 +- src/view/display-player-middle.c | 8 +-- 39 files changed, 356 insertions(+), 339 deletions(-) create mode 100644 src/realm/realm-song-numbers.h diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index d5d2eccec..bac3c6647 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -558,6 +558,7 @@ + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 41ceac633..b44eec5e5 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -2395,6 +2395,9 @@ realm + + realm + diff --git a/src/cmd-action/cmd-spell.c b/src/cmd-action/cmd-spell.c index daf2c6e96..30d7b1259 100644 --- a/src/cmd-action/cmd-spell.c +++ b/src/cmd-action/cmd-spell.c @@ -5,38 +5,37 @@ * 2013 Deskull rearranged comment for Doxygen. */ -#include "system/angband.h" -#include "core/stuff-handler.h" -#include "util/util.h" -#include "main/sound-definitions-table.h" #include "cmd-action/cmd-spell.h" -#include "io/write-diary.h" +#include "autopick/autopick-reader-writer.h" #include "cmd-io/cmd-dump.h" -#include "player/selfinfo.h" -#include "spell/technic-info-table.h" -#include "spell/range-calc.h" -#include "spell/spells2.h" -#include "spell/spells3.h" -#include "spell/spells-summon.h" +#include "cmd/cmd-basic.h" +#include "core/stuff-handler.h" +#include "floor/floor.h" +#include "inventory/player-inventory.h" +#include "io/write-diary.h" +#include "locale/japanese.h" +#include "main/sound-definitions-table.h" #include "mind/mind.h" +#include "object/item-use-flags.h" +#include "object/object-hook.h" #include "player/avatar.h" +#include "player/player-class.h" #include "player/player-damage.h" -#include "player/player-status.h" #include "player/player-effects.h" #include "player/player-skill.h" -#include "player/player-class.h" -#include "inventory/player-inventory.h" -#include "object/object-hook.h" -#include "cmd/cmd-basic.h" -#include "view/display-main-window.h" -#include "floor/floor.h" -#include "autopick/autopick-reader-writer.h" -#include "locale/japanese.h" +#include "player/player-status.h" +#include "player/selfinfo.h" +#include "spell/range-calc.h" #include "spell/spells-describer.h" +#include "spell/spells-execution.h" #include "spell/spells-hex.h" +#include "spell/spells-summon.h" #include "spell/spells-util.h" -#include "spell/spells-execution.h" -#include "object/item-use-flags.h" +#include "spell/spells2.h" +#include "spell/spells3.h" +#include "spell/technic-info-table.h" +#include "util/util.h" +#include "view/display-main-window.h" /*! * 魔法領域フラグ管理テーブル / diff --git a/src/cmd-action/cmd-spell.h b/src/cmd-action/cmd-spell.h index de991fd8a..a962b6573 100644 --- a/src/cmd-action/cmd-spell.h +++ b/src/cmd-action/cmd-spell.h @@ -1,6 +1,8 @@ #pragma once -#define KWD_DAM _("損傷:", "dam ") +#include "system/angband.h" + +#define KWD_DAM _("損傷:", "dam ") #define KWD_RANGE _("射程:", "rng ") #define KWD_DURATION _("期間:", "dur ") #define KWD_SPHERE _("範囲:", "range ") @@ -9,20 +11,19 @@ extern const u32b fake_spell_flags[4]; -extern concptr info_string_dice(concptr str, DICE_NUMBER dice, DICE_SID sides, int base); -extern concptr info_damage(DICE_NUMBER dice, DICE_SID sides, int base); -extern concptr info_duration(int base, DICE_SID sides); -extern concptr info_range(POSITION range); -extern concptr info_heal(DICE_NUMBER dice, DICE_SID sides, int base); -extern concptr info_delay(int base, DICE_SID sides); -extern concptr info_multi_damage(HIT_POINT dam); -extern concptr info_multi_damage_dice(DICE_NUMBER dice, DICE_SID sides); -extern concptr info_power(int power); -extern concptr info_power_dice(DICE_NUMBER dice, DICE_SID sides); -extern concptr info_radius(POSITION rad); -extern concptr info_weight(WEIGHT weight); +concptr info_string_dice(concptr str, DICE_NUMBER dice, DICE_SID sides, int base); +concptr info_damage(DICE_NUMBER dice, DICE_SID sides, int base); +concptr info_duration(int base, DICE_SID sides); +concptr info_range(POSITION range); +concptr info_heal(DICE_NUMBER dice, DICE_SID sides, int base); +concptr info_delay(int base, DICE_SID sides); +concptr info_multi_damage(HIT_POINT dam); +concptr info_multi_damage_dice(DICE_NUMBER dice, DICE_SID sides); +concptr info_power(int power); +concptr info_power_dice(DICE_NUMBER dice, DICE_SID sides); +concptr info_radius(POSITION rad); +concptr info_weight(WEIGHT weight); -/* cmd5.c */ -extern void do_cmd_browse(player_type *caster_ptr); -extern void do_cmd_study(player_type *caster_ptr); -extern void do_cmd_cast(player_type *caster_ptr); +void do_cmd_browse(player_type *caster_ptr); +void do_cmd_study(player_type *caster_ptr); +void do_cmd_cast(player_type *caster_ptr); diff --git a/src/combat/melee-postprocess.c b/src/combat/melee-postprocess.c index 3ab87496c..a3e528a6b 100644 --- a/src/combat/melee-postprocess.c +++ b/src/combat/melee-postprocess.c @@ -17,13 +17,12 @@ #include "monster/monster-race-hook.h" #include "monster/monster-status.h" #include "monster/monster.h" -#include "pet/pet-fall-off.h" #include "mspell/monster-spell.h" +#include "pet/pet-fall-off.h" #include "player/player-class.h" #include "player/player-move.h" #include "player/player-personalities-table.h" #include "player/player-races-table.h" -#include "realm/realm-song.h" #include "util/util.h" // Melee-post-process-type @@ -40,7 +39,8 @@ typedef struct mam_pp_type { MONSTER_IDX who; } 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) +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) { mam_pp_ptr->m_idx = m_idx; mam_pp_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; @@ -127,17 +127,17 @@ static void print_monster_dead_by_monster(player_type *player_ptr, mam_pp_type * player_ptr->current_floor_ptr->monster_noise = TRUE; return; } - + if (mam_pp_ptr->note) { msg_format(_("%^s%s", "%^s%s"), mam_pp_ptr->m_name, mam_pp_ptr->note); return; } - + if (!monster_living(mam_pp_ptr->m_ptr->r_idx)) { msg_format(_("%^sは破壊された。", "%^s is destroyed."), mam_pp_ptr->m_name); return; } - + msg_format(_("%^sは殺された。", "%^s is killed."), mam_pp_ptr->m_name); } diff --git a/src/core/hp-mp-processor.c b/src/core/hp-mp-processor.c index f190812cc..63949876b 100644 --- a/src/core/hp-mp-processor.c +++ b/src/core/hp-mp-processor.c @@ -1,27 +1,26 @@ -#include "system/angband.h" -#include "core/hp-mp-processor.h" +#include "core/hp-mp-processor.h" +#include "cmd-action/cmd-pet.h" +#include "core/hp-mp-regenerator.h" #include "floor/floor.h" +#include "floor/pattern-walk.h" #include "grid/feature.h" -#include "realm/realm-song.h" -#include "player/player-damage.h" -#include "object/object-flavor.h" #include "object-enchant/object-ego.h" -#include "world/world.h" +#include "object-enchant/trc-types.h" +#include "object/object-flavor.h" +#include "player/player-damage.h" #include "player/player-effects.h" -#include "floor/pattern-walk.h" -#include "core/hp-mp-regenerator.h" -#include "cmd-action/cmd-pet.h" #include "player/player-races-table.h" -#include "object-enchant/trc-types.h" +#include "realm/realm-song-numbers.h" +#include "world/world.h" /*! * @brief 10ゲームターンが進行するごとにプレイヤーのHPとMPの増減処理を行う。 * / Handle timed damage and regeneration every 10 game turns * @return なし */ -void process_player_hp_mp(player_type* creature_ptr) +void process_player_hp_mp(player_type *creature_ptr) { - feature_type* f_ptr = &f_info[creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat]; + feature_type *f_ptr = &f_info[creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat]; bool cave_no_regen = FALSE; int upkeep_factor = 0; int regen_amount = PY_REGEN_NORMAL; @@ -59,8 +58,9 @@ void process_player_hp_mp(player_type* creature_ptr) } } - if (creature_ptr->inventory_list[INVEN_LITE].tval && (creature_ptr->inventory_list[INVEN_LITE].name2 != EGO_LITE_DARKNESS) && !creature_ptr->resist_lite) { - object_type* o_ptr = &creature_ptr->inventory_list[INVEN_LITE]; + if (creature_ptr->inventory_list[INVEN_LITE].tval && (creature_ptr->inventory_list[INVEN_LITE].name2 != EGO_LITE_DARKNESS) + && !creature_ptr->resist_lite) { + object_type *o_ptr = &creature_ptr->inventory_list[INVEN_LITE]; GAME_TEXT o_name[MAX_NLEN]; char ouch[MAX_NLEN + 40]; object_desc(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); @@ -98,7 +98,10 @@ void process_player_hp_mp(player_type* creature_ptr) if (creature_ptr->levitation) { msg_print(_("熱で火傷した!", "The heat burns you!")); - take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1); + take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, + format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), + -1); } else { concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name; msg_format(_("%sで火傷した!", "The %s burns you!"), name); @@ -130,7 +133,10 @@ void process_player_hp_mp(player_type* creature_ptr) if (creature_ptr->levitation) { msg_print(_("冷気に覆われた!", "The cold engulfs you!")); - take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1); + take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, + format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), + -1); } else { concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name; msg_format(_("%sに凍えた!", "The %s frostbites you!"), name); @@ -162,7 +168,10 @@ void process_player_hp_mp(player_type* creature_ptr) if (creature_ptr->levitation) { msg_print(_("電撃を受けた!", "The electricity shocks you!")); - take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1); + take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, + format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), + -1); } else { concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name; msg_format(_("%sに感電した!", "The %s shocks you!"), name); @@ -194,7 +203,10 @@ void process_player_hp_mp(player_type* creature_ptr) if (creature_ptr->levitation) { msg_print(_("酸が飛び散った!", "The acid melts you!")); - take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1); + take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, + format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), + -1); } else { concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name; msg_format(_("%sに溶かされた!", "The %s melts you!"), name); @@ -226,7 +238,10 @@ void process_player_hp_mp(player_type* creature_ptr) if (creature_ptr->levitation) { msg_print(_("毒気を吸い込んだ!", "The gas poisons you!")); - take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1); + take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, + format(_("%sの上に浮遊したダメージ", "flying over %s"), + f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), + -1); if (creature_ptr->resist_pois) (void)set_poisoned(creature_ptr, creature_ptr->poisoned + 1); } else { @@ -241,7 +256,8 @@ void process_player_hp_mp(player_type* creature_ptr) } } - if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) && !creature_ptr->levitation && !creature_ptr->can_swim && !creature_ptr->resist_water) { + if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) && !creature_ptr->levitation && !creature_ptr->can_swim + && !creature_ptr->resist_water) { if (creature_ptr->total_weight > weight_limit(creature_ptr)) { msg_print(_("溺れている!", "You are drowning!")); take_hit(creature_ptr, DAMAGE_NOESCAPE, randint1(creature_ptr->lev), _("溺れ", "drowning"), -1); @@ -286,13 +302,14 @@ void process_player_hp_mp(player_type* creature_ptr) /* Spectres -- take damage when moving through walls */ /* - * Added: ANYBODY takes damage if inside through walls - * without wraith form -- NOTE: Spectres will never be - * reduced below 0 hp by being inside a stone wall; others - * WILL BE! - */ + * Added: ANYBODY takes damage if inside through walls + * without wraith form -- NOTE: Spectres will never be + * reduced below 0 hp by being inside a stone wall; others + * WILL BE! + */ if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) { - if (!IS_INVULN(creature_ptr) && !creature_ptr->wraith_form && !creature_ptr->kabenuke && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !creature_ptr->pass_wall)) { + if (!IS_INVULN(creature_ptr) && !creature_ptr->wraith_form && !creature_ptr->kabenuke + && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !creature_ptr->pass_wall)) { concptr dam_desc; cave_no_regen = TRUE; diff --git a/src/core/hp-mp-processor.h b/src/core/hp-mp-processor.h index d829956a7..297901bd1 100644 --- a/src/core/hp-mp-processor.h +++ b/src/core/hp-mp-processor.h @@ -1,3 +1,5 @@ #pragma once +#include "system/angband.h" + void process_player_hp_mp(player_type* creature_ptr); diff --git a/src/dungeon/dungeon-processor.c b/src/dungeon/dungeon-processor.c index 497dbd215..1031ccfaa 100644 --- a/src/dungeon/dungeon-processor.c +++ b/src/dungeon/dungeon-processor.c @@ -1,23 +1,23 @@ -#include "system/angband.h" -#include "dungeon/dungeon-processor.h" -#include "world/world.h" -#include "io/targeting.h" +#include "dungeon/dungeon-processor.h" +#include "cmd-io/cmd-dump.h" +#include "core/hp-mp-regenerator.h" #include "core/player-processor.h" -#include "dungeon/quest.h" +#include "core/stuff-handler.h" +#include "core/turn-compensator.h" #include "dungeon/dungeon.h" +#include "dungeon/quest.h" +#include "io/targeting.h" #include "io/write-diary.h" -#include "realm/realm-song.h" -#include "core/hp-mp-regenerator.h" -#include "player/player-move.h" -#include "view/display-main-window.h" -#include "core/stuff-handler.h" -#include "cmd-io/cmd-dump.h" -#include "player/player-effects.h" +#include "market/arena.h" #include "monster/monster-process.h" #include "monster/monster-status.h" +#include "player/player-effects.h" +#include "player/player-move.h" +#include "realm/realm-song-numbers.h" +#include "realm/realm-song.h" +#include "view/display-main-window.h" #include "world/world-turn-processor.h" -#include "core/turn-compensator.h" -#include "market/arena.h" +#include "world/world.h" /*! * process_player()、process_world() をcore.c から移設するのが先. @@ -34,9 +34,9 @@ * the user dies, or the game is terminated.\n *

*/ -void process_dungeon(player_type* player_ptr, bool load_game) +void process_dungeon(player_type *player_ptr, bool load_game) { - floor_type* floor_ptr = player_ptr->current_floor_ptr; + floor_type *floor_ptr = player_ptr->current_floor_ptr; floor_ptr->base_level = floor_ptr->dun_level; current_world_ptr->is_loading_now = FALSE; player_ptr->leaving = FALSE; @@ -86,7 +86,8 @@ void process_dungeon(player_type* player_ptr, bool load_game) handle_stuff(player_ptr); Term_fresh(); - if (quest_num && (is_fixed_quest_idx(quest_num) && !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) || !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) + if (quest_num + && (is_fixed_quest_idx(quest_num) && !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) || !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling(player_ptr); if (player_ptr->phase_out) { @@ -112,12 +113,10 @@ void process_dungeon(player_type* player_ptr, bool load_game) if ((floor_ptr->dun_level == d_info[player_ptr->dungeon_idx].maxdepth) && d_info[player_ptr->dungeon_idx].final_guardian) { if (r_info[d_info[player_ptr->dungeon_idx].final_guardian].max_num) #ifdef JP - msg_format("この階には%sの主である%sが棲んでいる。", - d_name + d_info[player_ptr->dungeon_idx].name, + msg_format("この階には%sの主である%sが棲んでいる。", d_name + d_info[player_ptr->dungeon_idx].name, r_name + r_info[d_info[player_ptr->dungeon_idx].final_guardian].name); #else - msg_format("%^s lives in this level as the keeper of %s.", - r_name + r_info[d_info[player_ptr->dungeon_idx].final_guardian].name, + msg_format("%^s lives in this level as the keeper of %s.", r_name + r_info[d_info[player_ptr->dungeon_idx].final_guardian].name, d_name + d_info[player_ptr->dungeon_idx].name); #endif } @@ -201,9 +200,9 @@ void process_dungeon(player_type* player_ptr, bool load_game) if (player_ptr->playing && !player_ptr->is_dead) { /* - * Maintain Unique monsters and artifact, save current - * floor, then prepare next floor - */ + * Maintain Unique monsters and artifact, save current + * floor, then prepare next floor + */ leave_floor(player_ptr); reinit_wilderness = FALSE; } diff --git a/src/dungeon/dungeon-processor.h b/src/dungeon/dungeon-processor.h index 9fe9cef65..1239471e6 100644 --- a/src/dungeon/dungeon-processor.h +++ b/src/dungeon/dungeon-processor.h @@ -1,3 +1,5 @@ #pragma once +#include "system/angband.h" + void process_dungeon(player_type* player_ptr, bool load_game); diff --git a/src/floor/pattern-walk.c b/src/floor/pattern-walk.c index 7165c428d..235114400 100644 --- a/src/floor/pattern-walk.c +++ b/src/floor/pattern-walk.c @@ -1,23 +1,22 @@ -#include "system/angband.h" -#include "floor/pattern-walk.h" +#include "floor/pattern-walk.h" +#include "cmd-io/cmd-save.h" #include "dungeon/dungeon.h" +#include "dungeon/quest.h" #include "io/write-diary.h" -#include "player/player-move.h" +#include "player/player-damage.h" #include "player/player-effects.h" +#include "player/player-move.h" +#include "player/player-races-table.h" +#include "realm/realm-song-numbers.h" #include "spell/spells-status.h" -#include "player/player-damage.h" -#include "realm/realm-song.h" #include "spell/spells3.h" -#include "cmd-io/cmd-save.h" -#include "dungeon/quest.h" -#include "player/player-races-table.h" /*! * @brief パターン終点到達時のテレポート処理を行う * @param creature_ptr プレーヤーへの参照ポインタ * @return なし */ -static void pattern_teleport(player_type* creature_ptr) +static void pattern_teleport(player_type *creature_ptr) { DEPTH min_level = 0; DEPTH max_level = 99; @@ -70,9 +69,9 @@ static void pattern_teleport(player_type* creature_ptr) free_turn(creature_ptr); /* - * Clear all saved floors - * and create a first saved floor - */ + * Clear all saved floors + * and create a first saved floor + */ prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR); creature_ptr->leaving = TRUE; } @@ -81,9 +80,9 @@ static void pattern_teleport(player_type* creature_ptr) * @brief 各種パターン地形上の特別な処理 / Returns TRUE if we are on the Pattern... * @return 実際にパターン地形上にプレイヤーが居た場合はTRUEを返す。 */ -bool pattern_effect(player_type* creature_ptr) +bool pattern_effect(player_type *creature_ptr) { - floor_type* floor_ptr = creature_ptr->current_floor_ptr; + floor_type *floor_ptr = creature_ptr->current_floor_ptr; if (!pattern_tile(floor_ptr, creature_ptr->y, creature_ptr->x)) return FALSE; @@ -103,11 +102,11 @@ bool pattern_effect(player_type* creature_ptr) msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful.")); /* - * We could make the healing effect of the - * Pattern center one-time only to avoid various kinds - * of abuse, like luring the win monster into fighting you - * in the middle of the pattern... - */ + * We could make the healing effect of the + * Pattern center one-time only to avoid various kinds + * of abuse, like luring the win monster into fighting you + * in the middle of the pattern... + */ break; case PATTERN_TILE_OLD: diff --git a/src/floor/pattern-walk.h b/src/floor/pattern-walk.h index 2bcb45825..170a6994c 100644 --- a/src/floor/pattern-walk.h +++ b/src/floor/pattern-walk.h @@ -1,3 +1,5 @@ #pragma once +#include "system/angband.h" + bool pattern_effect(player_type* creature_ptr); diff --git a/src/grid/grid.c b/src/grid/grid.c index df1135ea7..d004ca8af 100644 --- a/src/grid/grid.c +++ b/src/grid/grid.c @@ -16,29 +16,28 @@ */ #include "system/angband.h" -#include "util/util.h" -#include "term/gameterm.h" - -#include "world/world.h" -#include "object/object-flavor.h" -#include "object/object-hook.h" -#include "object/object-mark-types.h" -#include "dungeon/dungeon.h" -#include "floor/floor-generate.h" #include "grid/grid.h" -#include "grid/trap.h" -#include "room/rooms.h" -#include "monster/monster.h" +#include "dungeon/dungeon.h" #include "dungeon/quest.h" +#include "effect/effect-characteristics.h" +#include "floor/floor-generate.h" #include "grid/feature.h" +#include "grid/trap.h" #include "monster/monster-status.h" -#include "player/player-status.h" -#include "player/player-effects.h" +#include "monster/monster.h" +#include "object/object-flavor.h" +#include "object/object-hook.h" +#include "object/object-mark-types.h" #include "player/player-class.h" -#include "view/display-main-window.h" -#include "realm/realm-song.h" +#include "player/player-effects.h" +#include "player/player-status.h" +#include "realm/realm-song-numbers.h" +#include "room/rooms.h" #include "spell/process-effect.h" -#include "effect/effect-characteristics.h" +#include "term/gameterm.h" +#include "util/util.h" +#include "view/display-main-window.h" +#include "world/world.h" #define MONSTER_FLOW_DEPTH 32 /*!< 敵のプレイヤーに対する移動道のりの最大値(この値以上は処理を打ち切る) / OPTION: Maximum flow depth when using "MONSTER_FLOW" */ diff --git a/src/io/targeting.c b/src/io/targeting.c index 058c617b4..70ea12d19 100644 --- a/src/io/targeting.c +++ b/src/io/targeting.c @@ -1,5 +1,4 @@ /*! - * @file xtra2.c * @brief 雑多なその他の処理2 / effects of various "objects" * @date 2014/02/06 * @author @@ -10,40 +9,38 @@ * 2014 Deskull rearranged comment for Doxygen. */ -#include "system/angband.h" -#include "util/util.h" -#include "system/system-variables.h" -#include "core/stuff-handler.h" -#include "term/gameterm.h" #include "io/targeting.h" - -#include "cmd-building/cmd-building.h" #include "cmd-action/cmd-pet.h" +#include "cmd-building/cmd-building.h" +#include "core/sort.h" +#include "core/stuff-handler.h" #include "dungeon/dungeon-file.h" +#include "dungeon/dungeon.h" +#include "dungeon/quest.h" +#include "effect/spells-effect-util.h" +#include "floor/floor-events.h" #include "floor/floor-object.h" +#include "floor/floor-town.h" +#include "floor/floor.h" +#include "grid/feature.h" +#include "grid/grid.h" +#include "inventory/player-inventory.h" +#include "monster/monster-race-hook.h" +#include "monster/monster-status.h" +#include "monster/monster.h" #include "object-enchant/object-curse.h" #include "object/object-flavor.h" -#include "object/object-mark-types.h" -#include "monster/monster.h" -#include "monster/monster-race-hook.h" #include "object/object-kind-hook.h" -#include "core/sort.h" -#include "spell/spells-summon.h" -#include "grid/grid.h" -#include "floor/floor.h" -#include "floor/floor-events.h" -#include "floor/floor-town.h" -#include "inventory/player-inventory.h" +#include "object/object-mark-types.h" #include "player/player-move.h" +#include "player/player-races-table.h" #include "player/player-status.h" -#include "monster/monster-status.h" +#include "spell/spells-summon.h" +#include "system/system-variables.h" +#include "term/gameterm.h" +#include "util/util.h" #include "view/display-main-window.h" -#include "grid/feature.h" -#include "dungeon/quest.h" -#include "dungeon/dungeon.h" #include "world/world.h" -#include "effect/spells-effect-util.h" -#include "player/player-races-table.h" /*! * @brief コンソール上におけるマップ表示の左上位置を返す / diff --git a/src/io/targeting.h b/src/io/targeting.h index 322cf9bc7..f8396a416 100644 --- a/src/io/targeting.h +++ b/src/io/targeting.h @@ -1,14 +1,15 @@ #pragma once +#include "system/angband.h" + extern MONSTER_IDX target_who; extern POSITION target_col; extern POSITION target_row; -/* xtra2.c */ -extern void panel_bounds_center(void); -extern void verify_panel(player_type *creature_ptr); -extern bool target_able(player_type *creature_ptr, MONSTER_IDX m_idx); -extern bool target_okay(player_type *creature_ptr); +void panel_bounds_center(void); +void verify_panel(player_type *creature_ptr); +bool target_able(player_type *creature_ptr, MONSTER_IDX m_idx); +bool target_okay(player_type *creature_ptr); /* * target_set用関数の利用用途フラグ / Bit flags for the "target_set" function @@ -17,10 +18,10 @@ extern bool target_okay(player_type *creature_ptr); #define TARGET_LOOK 0x02 /*!< "L"ookコマンド向けの既存情報確認向け(全ての有為な情報をクエリ対象) / Describe grid fully */ #define TARGET_XTRA 0x04 /*!< 現在未使用 / Currently unused flag */ #define TARGET_GRID 0x08 /*!< 全てのマス対象にする(現在未使用) / Select from all grids */ -extern bool target_set(player_type *creature_ptr, BIT_FLAGS mode); -extern void target_set_prepare_look(player_type *creature_ptr); -extern bool get_aim_dir(player_type *creature_ptr, DIRECTION *dp); -extern bool get_hack_dir(player_type *creature_ptr, DIRECTION *dp); -extern bool get_direction(player_type *creature_ptr, DIRECTION *dp, bool allow_under, bool with_steed); -extern bool get_rep_dir(player_type *creature_ptr, DIRECTION *dp, bool under); -extern bool tgt_pt(player_type *creature_ptr, POSITION *x, POSITION *y); +bool target_set(player_type *creature_ptr, BIT_FLAGS mode); +void target_set_prepare_look(player_type *creature_ptr); +bool get_aim_dir(player_type *creature_ptr, DIRECTION *dp); +bool get_hack_dir(player_type *creature_ptr, DIRECTION *dp); +bool get_direction(player_type *creature_ptr, DIRECTION *dp, bool allow_under, bool with_steed); +bool get_rep_dir(player_type *creature_ptr, DIRECTION *dp, bool under); +bool tgt_pt(player_type *creature_ptr, POSITION *x, POSITION *y); diff --git a/src/mind/mind.c b/src/mind/mind.c index eca773635..ca8bf0b12 100644 --- a/src/mind/mind.c +++ b/src/mind/mind.c @@ -14,7 +14,6 @@ * 特殊技能を揃えて実装している。 */ -#include "system/angband.h" #include "mind/mind.h" #include "cmd-action/cmd-attack.h" #include "cmd-action/cmd-spell.h" @@ -34,7 +33,7 @@ #include "player/player-effects.h" #include "player/player-move.h" #include "player/player-status.h" -#include "realm/realm-song.h" +#include "realm/realm-song-numbers.h" #include "spell/process-effect.h" #include "spell/spells-detection.h" #include "spell/spells-floor.h" diff --git a/src/mind/mind.h b/src/mind/mind.h index 0a73ba438..4c6468e8d 100644 --- a/src/mind/mind.h +++ b/src/mind/mind.h @@ -1,5 +1,7 @@ #pragma once +#include "system/angband.h" + #define MIND_MINDCRAFTER 0 /*!< 特殊能力: 超能力 */ #define MIND_KI 1 /*!< 特殊能力: 練気 */ #define MIND_BERSERKER 2 /*!< 特殊能力: 怒り */ diff --git a/src/mspell/mspells1.c b/src/mspell/mspells1.c index 353816fe9..3286f1a3a 100644 --- a/src/mspell/mspells1.c +++ b/src/mspell/mspells1.c @@ -51,7 +51,7 @@ #include "mspell/monster-spell.h" #include "spell/spells-type.h" #include "world/world.h" -#include "realm/realm-song.h" +#include "realm/realm-song-numbers.h" #include "view/display-main-window.h" #include "player/player-races-table.h" #include "player/player-class.h" diff --git a/src/player/digestion-processor.c b/src/player/digestion-processor.c index 445fab352..7b82547a6 100644 --- a/src/player/digestion-processor.c +++ b/src/player/digestion-processor.c @@ -1,19 +1,18 @@ -#include "system/angband.h" -#include "player/digestion-processor.h" -#include "world/world.h" -#include "realm/realm-song.h" +#include "player/digestion-processor.h" +#include "monster/creature.h" +#include "object-enchant/trc-types.h" #include "player/player-damage.h" #include "player/player-effects.h" -#include "monster/creature.h" #include "player/player-move.h" -#include "object-enchant/trc-types.h" +#include "realm/realm-song-numbers.h" +#include "world/world.h" /*! * @brief 10ゲームターンが進行するごとにプレイヤーの腹を減らす * @param creature_ptr プレーヤーへの参照ポインタ * @return なし */ -void starve_player(player_type* creature_ptr) +void starve_player(player_type *creature_ptr) { if (creature_ptr->phase_out) return; diff --git a/src/player/digestion-processor.h b/src/player/digestion-processor.h index bf0b90e94..8f25e3b04 100644 --- a/src/player/digestion-processor.h +++ b/src/player/digestion-processor.h @@ -1,3 +1,5 @@ #pragma once +#include "system/angband.h" + void starve_player(player_type* creature_ptr); diff --git a/src/player/player-damage.c b/src/player/player-damage.c index b77afc12e..13d9d54f1 100644 --- a/src/player/player-damage.c +++ b/src/player/player-damage.c @@ -1,40 +1,38 @@ -#include "system/angband.h" +#include "player/player-damage.h" +#include "autopick/autopick-pref-processor.h" +#include "cmd-building/cmd-building.h" +#include "cmd-io/cmd-process-screen.h" #include "core/stuff-handler.h" -#include "util/util.h" +#include "dungeon/quest.h" +#include "floor/floor.h" +#include "floor/wild.h" +#include "inventory/inventory-damage.h" +#include "io/files-util.h" +#include "io/report.h" +#include "io/save.h" +#include "io/write-diary.h" #include "main/music-definitions-table.h" #include "main/sound-definitions-table.h" -#include "term/gameterm.h" - -#include "player/avatar.h" -#include "cmd-building/cmd-building.h" -#include "io/write-diary.h" -#include "autopick/autopick-pref-processor.h" -#include "cmd-io/cmd-process-screen.h" #include "market/arena-info-table.h" -#include "realm/realm-song.h" -#include "floor/floor.h" +#include "mind/racial-mirror-master.h" +#include "mspell/monster-spell.h" #include "object-enchant/artifact.h" +#include "object-enchant/tr-types.h" +#include "object/object-broken.h" #include "object/object-flavor.h" #include "object/object-hook.h" -#include "object/object-broken.h" +#include "player/avatar.h" +#include "player/player-class.h" +#include "player/player-effects.h" #include "player/player-move.h" -#include "player/player-damage.h" #include "player/player-personalities-table.h" -#include "player/player-status.h" -#include "player/player-effects.h" -#include "player/player-class.h" #include "player/player-races-table.h" -#include "mspell/monster-spell.h" -#include "world/world.h" +#include "player/player-status.h" +#include "realm/realm-song-numbers.h" +#include "term/gameterm.h" +#include "util/util.h" #include "view/display-main-window.h" -#include "dungeon/quest.h" -#include "io/report.h" -#include "floor/wild.h" -#include "io/save.h" -#include "io/files-util.h" -#include "inventory/inventory-damage.h" -#include "mind/racial-mirror-master.h" -#include "object-enchant/tr-types.h" +#include "world/world.h" /*! * @brief 酸攻撃による装備のAC劣化処理 / diff --git a/src/player/player-damage.h b/src/player/player-damage.h index 122189ff5..84e889953 100644 --- a/src/player/player-damage.h +++ b/src/player/player-damage.h @@ -1,5 +1,7 @@ #pragma once +#include "system/angband.h" + #define DAMAGE_FORCE 1 #define DAMAGE_GENO 2 #define DAMAGE_LOSELIFE 3 diff --git a/src/player/player-effects.c b/src/player/player-effects.c index 0ffcae6cc..2e91159c4 100644 --- a/src/player/player-effects.c +++ b/src/player/player-effects.c @@ -56,7 +56,7 @@ #include "player/player-sex.h" #include "player/player-status.h" #include "player/race-info-table.h" -#include "realm/realm-song.h" +#include "realm/realm-song-numbers.h" #include "spell/spells-floor.h" #include "spell/spells-hex.h" #include "spell/spells-status.h" diff --git a/src/player/player-move.c b/src/player/player-move.c index 2c67dbb20..8013a10bd 100644 --- a/src/player/player-move.c +++ b/src/player/player-move.c @@ -170,7 +170,7 @@ #include "player/player-personalities-table.h" #include "player/player-races-table.h" #include "player/player-status.h" -#include "realm/realm-song.h" +#include "realm/realm-song-numbers.h" #include "spell/process-effect.h" #include "spell/spells-floor.h" #include "spell/spells-type.h" diff --git a/src/player/player-status.c b/src/player/player-status.c index 04512201a..4d408443d 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -52,7 +52,7 @@ #include "player/player-skill.h" #include "player/race-info-table.h" #include "realm/realm-hex-numbers.h" -#include "realm/realm-song.h" +#include "realm/realm-song-numbers.h" #include "spell/spells-describer.h" #include "spell/spells-execution.h" #include "spell/spells-hex.h" diff --git a/src/player/selfinfo.c b/src/player/selfinfo.c index b92624785..9f44bf2c6 100644 --- a/src/player/selfinfo.c +++ b/src/player/selfinfo.c @@ -14,18 +14,17 @@ * spell2s.cから分離 */ -#include "system/angband.h" #include "player/selfinfo.h" -#include "util/util.h" -#include "player/player-status.h" -#include "player/player-races-table.h" -#include "player/player-class.h" -#include "player/avatar.h" -#include "realm/realm-names-table.h" -#include "realm/realm-song.h" -#include "object/object1.h" #include "object-enchant/tr-types.h" #include "object-enchant/trc-types.h" +#include "object/object1.h" +#include "player/avatar.h" +#include "player/player-class.h" +#include "player/player-races-table.h" +#include "player/player-status.h" +#include "realm/realm-names-table.h" +#include "realm/realm-song-numbers.h" +#include "util/util.h" /*! * @brief 自己分析処理(Nethackからのアイデア) / self-knowledge... idea from nethack. diff --git a/src/player/selfinfo.h b/src/player/selfinfo.h index e210e9447..5b66d0476 100644 --- a/src/player/selfinfo.h +++ b/src/player/selfinfo.h @@ -1,8 +1,4 @@ -/*! - * @file selfinfo.h - * @brief 自己分析機能用ヘッダファイル / - * @author 2018 Deskull - */ +#include "system/angband.h" -extern void self_knowledge(player_type *creature_ptr); -extern void report_magics(player_type *creature_ptr); +void self_knowledge(player_type *creature_ptr); +void report_magics(player_type *creature_ptr); diff --git a/src/player/temporary-resistances.c b/src/player/temporary-resistances.c index b00e8aef3..7a79b5d38 100644 --- a/src/player/temporary-resistances.c +++ b/src/player/temporary-resistances.c @@ -1,8 +1,8 @@ #include "temporary-resistances.h" -#include "realm/realm-hex-numbers.h" -#include "realm/realm-song.h" -#include "player/player-races-table.h" #include "object-enchant/tr-types.h" +#include "player/player-races-table.h" +#include "realm/realm-hex-numbers.h" +#include "realm/realm-song-numbers.h" #include "spell/spells-hex.h" /*! diff --git a/src/realm/realm-hex-numbers.h b/src/realm/realm-hex-numbers.h index b984d1369..4fac5e5ad 100644 --- a/src/realm/realm-hex-numbers.h +++ b/src/realm/realm-hex-numbers.h @@ -1,6 +1,6 @@ #pragma once -typedef enum realm_hex_number_type { +typedef enum realm_hex_type { /* 1st book */ HEX_BLESS = 0, HEX_CURE_LIGHT = 1, @@ -37,4 +37,4 @@ typedef enum realm_hex_number_type { HEX_SHADOW_MOVE = 29, HEX_ANTI_MAGIC = 30, HEX_REVENGE = 31, -} realm_hex_number_type; +} realm_hex_type; diff --git a/src/realm/realm-hex.c b/src/realm/realm-hex.c index b85e22186..3703fc73b 100644 --- a/src/realm/realm-hex.c +++ b/src/realm/realm-hex.c @@ -34,7 +34,6 @@ #include "player/player-skill.h" #include "player/player-status.h" #include "realm/realm-hex-numbers.h" -#include "realm/realm-song.h" #include "spell/process-effect.h" #include "spell/spells-execution.h" #include "spell/spells-status.h" diff --git a/src/realm/realm-song-numbers.h b/src/realm/realm-song-numbers.h new file mode 100644 index 000000000..76b77d19e --- /dev/null +++ b/src/realm/realm-song-numbers.h @@ -0,0 +1,30 @@ +#pragma once + +typedef enum realm_song_type { + MUSIC_NONE = 0, + MUSIC_SLOW = 1, + MUSIC_BLESS = 2, + MUSIC_STUN = 3, + MUSIC_L_LIFE = 4, + MUSIC_FEAR = 5, + MUSIC_HERO = 6, + MUSIC_MIND = 7, + MUSIC_STEALTH = 8, + MUSIC_ID = 9, + MUSIC_CONF = 10, + MUSIC_SOUND = 11, + MUSIC_CHARM = 12, + MUSIC_WALL = 13, + MUSIC_RESIST = 14, + MUSIC_SPEED = 15, + MUSIC_DISPEL = 16, + MUSIC_SARUMAN = 17, + MUSIC_QUAKE = 18, + MUSIC_STASIS = 19, + MUSIC_SHERO = 20, + MUSIC_H_LIFE = 21, + MUSIC_INVULN = 22, + MUSIC_PSI = 23, +} realm_song_type; + +#define MUSIC_DETECT 101 diff --git a/src/realm/realm-song.c b/src/realm/realm-song.c index 138024bcb..ca1fa83c0 100644 --- a/src/realm/realm-song.c +++ b/src/realm/realm-song.c @@ -1,20 +1,18 @@ -#include "system/angband.h" -#include "util/util.h" - -#include "cmd-action/cmd-spell.h" -#include "spell/spells-type.h" -#include "spell/spells-status.h" -#include "spell/spells-floor.h" +#include "cmd-action/cmd-spell.h" +#include "effect/effect-characteristics.h" +#include "io/targeting.h" #include "player/player-class.h" #include "player/player-effects.h" -#include "io/targeting.h" -#include "view/display-main-window.h" -#include "realm/realm-song.h" +#include "realm/realm-song-numbers.h" #include "spell/process-effect.h" -#include "effect/effect-characteristics.h" +#include "spell/spells-detection.h" +#include "spell/spells-floor.h" +#include "spell/spells-status.h" +#include "spell/spells-type.h" #include "spell/spells2.h" #include "spell/spells3.h" -#include "spell/spells-detection.h" +#include "util/util.h" +#include "view/display-main-window.h" /*! * @brief 歌の開始を処理する / Start singing if the player is a Bard diff --git a/src/realm/realm-song.h b/src/realm/realm-song.h index 163140b48..e59c8db32 100644 --- a/src/realm/realm-song.h +++ b/src/realm/realm-song.h @@ -1,35 +1,6 @@ #pragma once -/* - * Music songs - */ -#define MUSIC_NONE 0 -#define MUSIC_SLOW 1 -#define MUSIC_BLESS 2 -#define MUSIC_STUN 3 -#define MUSIC_L_LIFE 4 -#define MUSIC_FEAR 5 -#define MUSIC_HERO 6 -#define MUSIC_MIND 7 -#define MUSIC_STEALTH 8 -#define MUSIC_ID 9 -#define MUSIC_CONF 10 -#define MUSIC_SOUND 11 -#define MUSIC_CHARM 12 -#define MUSIC_WALL 13 -#define MUSIC_RESIST 14 -#define MUSIC_SPEED 15 -#define MUSIC_DISPEL 16 -#define MUSIC_SARUMAN 17 -#define MUSIC_QUAKE 18 -#define MUSIC_STASIS 19 -#define MUSIC_SHERO 20 -#define MUSIC_H_LIFE 21 -#define MUSIC_INVULN 22 -#define MUSIC_PSI 23 - -#define MUSIC_DETECT 101 - +#include "system/angband.h" #include "spell/spells-util.h" concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode); diff --git a/src/spell/music-checker.c b/src/spell/music-checker.c index a89ef264b..85eaf287d 100644 --- a/src/spell/music-checker.c +++ b/src/spell/music-checker.c @@ -1,16 +1,15 @@ -#include "system/angband.h" +#include "spell/music-checker.h" #include "floor/floor.h" -#include "spell/music-checker.h" -#include "realm/realm-song.h" -#include "spell/spells3.h" #include "player/player-skill.h" +#include "realm/realm-song-numbers.h" #include "spell/spells-execution.h" +#include "spell/spells3.h" /*! * @brief プレイヤーの歌に関する継続処理 * @return なし */ -void check_music(player_type* caster_ptr) +void check_music(player_type *caster_ptr) { if (caster_ptr->pclass != CLASS_BARD) return; @@ -23,7 +22,7 @@ void check_music(player_type* caster_ptr) } int spell = SINGING_SONG_ID(caster_ptr); - const magic_type* s_ptr; + const magic_type *s_ptr; s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell]; MANA_POINT need_mana = mod_need_mana(caster_ptr, s_ptr->smana, spell, REALM_MUSIC); @@ -54,7 +53,8 @@ void check_music(player_type* caster_ptr) if (one_in_(2) && (caster_ptr->current_floor_ptr->dun_level > 4) && ((caster_ptr->current_floor_ptr->dun_level + 10) > caster_ptr->lev)) caster_ptr->spell_exp[spell] += 1; } else if (caster_ptr->spell_exp[spell] < SPELL_EXP_EXPERT) { - if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && ((caster_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) + if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) + && ((caster_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; } else if (caster_ptr->spell_exp[spell] < SPELL_EXP_MASTER) { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && (caster_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) diff --git a/src/spell/music-checker.h b/src/spell/music-checker.h index bd1b9e991..739df916c 100644 --- a/src/spell/music-checker.h +++ b/src/spell/music-checker.h @@ -1,3 +1,5 @@ #pragma once -void check_music(player_type* caster_ptr); +#include "system/angband.h" + +void check_music(player_type *caster_ptr); diff --git a/src/spell/spells-detection.c b/src/spell/spells-detection.c index 86e585e56..9abffc8f5 100644 --- a/src/spell/spells-detection.c +++ b/src/spell/spells-detection.c @@ -1,30 +1,30 @@ -#include "system/angband.h" +#include "spell/spells-detection.h" +#include "core/player-processor.h" +#include "dungeon/dungeon.h" #include "floor/floor.h" #include "grid/grid.h" -#include "spell/spells-detection.h" -#include "dungeon/dungeon.h" -#include "realm/realm-song.h" -#include "core/player-processor.h" #include "grid/trap.h" +#include "monster/monster-race-hook.h" +#include "monster/monster-status.h" #include "object/object-hook.h" #include "object/object-mark-types.h" -#include "monster/monster-status.h" -#include "monster/monster-race-hook.h" +#include "realm/realm-song-numbers.h" +#include "realm/realm-song.h" /*! - * @brief プレイヤー周辺の地形を感知する - * @param caster_ptr プレーヤーへの参照ポインタ - * @param range 効果範囲 - * @param flag 特定地形ID - * @param known 地形から危険フラグを外すならTRUE - * @return 効力があった場合TRUEを返す - */ -static bool detect_feat_flag(player_type* caster_ptr, POSITION range, int flag, bool known) + * @brief プレイヤー周辺の地形を感知する + * @param caster_ptr プレーヤーへの参照ポインタ + * @param range 効果範囲 + * @param flag 特定地形ID + * @param known 地形から危険フラグを外すならTRUE + * @return 効力があった場合TRUEを返す + */ +static bool detect_feat_flag(player_type *caster_ptr, POSITION range, int flag, bool known) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; - grid_type* g_ptr; + grid_type *g_ptr; bool detect = FALSE; for (POSITION y = 1; y < caster_ptr->current_floor_ptr->height - 1; y++) { for (POSITION x = 1; x <= caster_ptr->current_floor_ptr->width - 1; x++) { @@ -63,7 +63,7 @@ static bool detect_feat_flag(player_type* caster_ptr, POSITION range, int flag, * @param known 感知外範囲を超える警告フラグを立てる場合TRUEを返す * @return 効力があった場合TRUEを返す */ -bool detect_traps(player_type* caster_ptr, POSITION range, bool known) +bool detect_traps(player_type *caster_ptr, POSITION range, bool known) { bool detect = detect_feat_flag(caster_ptr, range, FF_TRAP, known); @@ -85,7 +85,7 @@ bool detect_traps(player_type* caster_ptr, POSITION range, bool known) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_doors(player_type* caster_ptr, POSITION range) +bool detect_doors(player_type *caster_ptr, POSITION range) { bool detect = detect_feat_flag(caster_ptr, range, FF_DOOR, TRUE); @@ -104,7 +104,7 @@ bool detect_doors(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_stairs(player_type* caster_ptr, POSITION range) +bool detect_stairs(player_type *caster_ptr, POSITION range) { bool detect = detect_feat_flag(caster_ptr, range, FF_STAIRS, TRUE); @@ -123,7 +123,7 @@ bool detect_stairs(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_treasure(player_type* caster_ptr, POSITION range) +bool detect_treasure(player_type *caster_ptr, POSITION range) { bool detect = detect_feat_flag(caster_ptr, range, FF_HAS_GOLD, TRUE); @@ -141,7 +141,7 @@ bool detect_treasure(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_objects_gold(player_type* caster_ptr, POSITION range) +bool detect_objects_gold(player_type *caster_ptr, POSITION range) { POSITION range2 = range; if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) @@ -151,7 +151,7 @@ bool detect_objects_gold(player_type* caster_ptr, POSITION range) bool detect = FALSE; POSITION y, x; for (OBJECT_IDX i = 1; i < caster_ptr->current_floor_ptr->o_max; i++) { - object_type* o_ptr = &caster_ptr->current_floor_ptr->o_list[i]; + object_type *o_ptr = &caster_ptr->current_floor_ptr->o_list[i]; if (!OBJECT_IS_VALID(o_ptr)) continue; @@ -189,7 +189,7 @@ bool detect_objects_gold(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_objects_normal(player_type* caster_ptr, POSITION range) +bool detect_objects_normal(player_type *caster_ptr, POSITION range) { POSITION range2 = range; if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) @@ -197,7 +197,7 @@ bool detect_objects_normal(player_type* caster_ptr, POSITION range) bool detect = FALSE; for (OBJECT_IDX i = 1; i < caster_ptr->current_floor_ptr->o_max; i++) { - object_type* o_ptr = &caster_ptr->current_floor_ptr->o_list[i]; + object_type *o_ptr = &caster_ptr->current_floor_ptr->o_list[i]; if (!OBJECT_IS_VALID(o_ptr)) continue; @@ -244,7 +244,7 @@ bool detect_objects_normal(player_type* caster_ptr, POSITION range) * It can probably be argued that this function is now too powerful. * */ -bool detect_objects_magic(player_type* caster_ptr, POSITION range) +bool detect_objects_magic(player_type *caster_ptr, POSITION range) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; @@ -252,7 +252,7 @@ bool detect_objects_magic(player_type* caster_ptr, POSITION range) tval_type tv; bool detect = FALSE; for (OBJECT_IDX i = 1; i < caster_ptr->current_floor_ptr->o_max; i++) { - object_type* o_ptr = &caster_ptr->current_floor_ptr->o_list[i]; + object_type *o_ptr = &caster_ptr->current_floor_ptr->o_list[i]; if (!OBJECT_IS_VALID(o_ptr)) continue; @@ -266,14 +266,11 @@ bool detect_objects_magic(player_type* caster_ptr, POSITION range) continue; tv = o_ptr->tval; - if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) || - (tv == TV_WHISTLE) || (tv == TV_AMULET) || (tv == TV_RING) || (tv == TV_STAFF) || - (tv == TV_WAND) || (tv == TV_ROD) || (tv == TV_SCROLL) || (tv == TV_POTION) || - (tv == TV_LIFE_BOOK) || (tv == TV_SORCERY_BOOK) || (tv == TV_NATURE_BOOK) || - (tv == TV_CHAOS_BOOK) || (tv == TV_DEATH_BOOK) || (tv == TV_TRUMP_BOOK) || - (tv == TV_ARCANE_BOOK) || (tv == TV_CRAFT_BOOK) || (tv == TV_DAEMON_BOOK) || - (tv == TV_CRUSADE_BOOK) || (tv == TV_MUSIC_BOOK) || (tv == TV_HISSATSU_BOOK) || - (tv == TV_HEX_BOOK) || ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0))) { + if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) || (tv == TV_WHISTLE) || (tv == TV_AMULET) || (tv == TV_RING) || (tv == TV_STAFF) + || (tv == TV_WAND) || (tv == TV_ROD) || (tv == TV_SCROLL) || (tv == TV_POTION) || (tv == TV_LIFE_BOOK) || (tv == TV_SORCERY_BOOK) + || (tv == TV_NATURE_BOOK) || (tv == TV_CHAOS_BOOK) || (tv == TV_DEATH_BOOK) || (tv == TV_TRUMP_BOOK) || (tv == TV_ARCANE_BOOK) + || (tv == TV_CRAFT_BOOK) || (tv == TV_DAEMON_BOOK) || (tv == TV_CRUSADE_BOOK) || (tv == TV_MUSIC_BOOK) || (tv == TV_HISSATSU_BOOK) + || (tv == TV_HEX_BOOK) || ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0))) { o_ptr->marked |= OM_FOUND; lite_spot(caster_ptr, y, x); detect = TRUE; @@ -293,15 +290,15 @@ bool detect_objects_magic(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_normal(player_type* caster_ptr, POSITION range) +bool detect_monsters_normal(player_type *caster_ptr, POSITION range) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; bool flag = FALSE; for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) { - monster_type* m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; - monster_race* r_ptr = &r_info[m_ptr->r_idx]; + monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!monster_is_valid(m_ptr)) continue; @@ -333,15 +330,15 @@ bool detect_monsters_normal(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_invis(player_type* caster_ptr, POSITION range) +bool detect_monsters_invis(player_type *caster_ptr, POSITION range) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; bool flag = FALSE; for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) { - monster_type* m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; - monster_race* r_ptr = &r_info[m_ptr->r_idx]; + monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!monster_is_valid(m_ptr)) continue; @@ -379,15 +376,15 @@ bool detect_monsters_invis(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_evil(player_type* caster_ptr, POSITION range) +bool detect_monsters_evil(player_type *caster_ptr, POSITION range) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; bool flag = FALSE; for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) { - monster_type* m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; - monster_race* r_ptr = &r_info[m_ptr->r_idx]; + monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!monster_is_valid(m_ptr)) continue; @@ -425,14 +422,14 @@ bool detect_monsters_evil(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_nonliving(player_type* caster_ptr, POSITION range) +bool detect_monsters_nonliving(player_type *caster_ptr, POSITION range) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; bool flag = FALSE; for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) { - monster_type* m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; + monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; if (!monster_is_valid(m_ptr)) continue; @@ -466,15 +463,15 @@ bool detect_monsters_nonliving(player_type* caster_ptr, POSITION range) * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_monsters_mind(player_type* caster_ptr, POSITION range) +bool detect_monsters_mind(player_type *caster_ptr, POSITION range) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; bool flag = FALSE; for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) { - monster_type* m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; - monster_race* r_ptr = &r_info[m_ptr->r_idx]; + monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!monster_is_valid(m_ptr)) continue; @@ -510,15 +507,15 @@ bool detect_monsters_mind(player_type* caster_ptr, POSITION range) * @param Match 対応シンボルの混じったモンスター文字列(複数指定化) * @return 効力があった場合TRUEを返す */ -bool detect_monsters_string(player_type* caster_ptr, POSITION range, concptr Match) +bool detect_monsters_string(player_type *caster_ptr, POSITION range, concptr Match) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; bool flag = FALSE; for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) { - monster_type* m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; - monster_race* r_ptr = &r_info[m_ptr->r_idx]; + monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!monster_is_valid(m_ptr)) continue; @@ -556,15 +553,15 @@ bool detect_monsters_string(player_type* caster_ptr, POSITION range, concptr Mat * @param match_flag 感知フラグ * @return 効力があった場合TRUEを返す */ -bool detect_monsters_xxx(player_type* caster_ptr, POSITION range, u32b match_flag) +bool detect_monsters_xxx(player_type *caster_ptr, POSITION range, u32b match_flag) { if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3; bool flag = FALSE; for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) { - monster_type* m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; - monster_race* r_ptr = &r_info[m_ptr->r_idx]; + monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!monster_is_valid(m_ptr)) continue; @@ -613,7 +610,7 @@ bool detect_monsters_xxx(player_type* caster_ptr, POSITION range, u32b match_fla * @param range 効果範囲 * @return 効力があった場合TRUEを返す */ -bool detect_all(player_type* caster_ptr, POSITION range) +bool detect_all(player_type *caster_ptr, POSITION range) { bool detect = FALSE; if (detect_traps(caster_ptr, range, TRUE)) diff --git a/src/spell/spells-detection.h b/src/spell/spells-detection.h index ae467bd3c..d8944bcf4 100644 --- a/src/spell/spells-detection.h +++ b/src/spell/spells-detection.h @@ -1,5 +1,7 @@ #pragma once +#include "system/angband.h" + bool detect_traps(player_type* caster_ptr, POSITION range, bool known); bool detect_doors(player_type* caster_ptr, POSITION range); bool detect_stairs(player_type* caster_ptr, POSITION range); diff --git a/src/spell/spells-status.c b/src/spell/spells-status.c index 5e6be5b2b..8c7c81936 100644 --- a/src/spell/spells-status.c +++ b/src/spell/spells-status.c @@ -22,7 +22,6 @@ #include "player/player-class.h" #include "player/player-effects.h" #include "player/player-status.h" -#include "realm/realm-song.h" #include "spell/spells-type.h" #include "spell/spells2.h" #include "spell/spells3.h" diff --git a/src/view/display-main-window.c b/src/view/display-main-window.c index 6a70e4671..3ed601848 100644 --- a/src/view/display-main-window.c +++ b/src/view/display-main-window.c @@ -42,7 +42,7 @@ #include "player/player-races-table.h" #include "player/player-status.h" #include "realm/realm-hex-numbers.h" -#include "realm/realm-song.h" +#include "realm/realm-song-numbers.h" #include "spell/spells-hex.h" #include "spell/spells3.h" #include "system/system-variables.h" diff --git a/src/view/display-player-middle.c b/src/view/display-player-middle.c index f94437117..3399fb3f9 100644 --- a/src/view/display-player-middle.c +++ b/src/view/display-player-middle.c @@ -1,13 +1,13 @@ #include "view/display-player-middle.h" +#include "combat/shoot.h" #include "floor/floor.h" -#include "perception/object-perception.h" #include "object-enchant/special-object-flags.h" -#include "sv-definition/sv-bow-types.h" +#include "perception/object-perception.h" #include "player/player-effects.h" #include "player/player-races-table.h" #include "player/player-skill.h" -#include "realm/realm-song.h" -#include "shoot.h" +#include "realm/realm-song-numbers.h" +#include "sv-definition/sv-bow-types.h" #include "term/gameterm.h" #include "view/display-util.h" #include "view/status-first-page.h" -- 2.11.0