From: Hourier Date: Wed, 8 Sep 2021 13:14:02 +0000 (+0900) Subject: [Refactor] #1489 Moved player-class.* and player-class-types.h to player-info/ X-Git-Tag: vmacos3.0.0-alpha52~107^2~4^2~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6917d4e11106dd2ab7138d5dfb4dcec997c13145;p=hengbandforosx%2Fhengbandosx.git [Refactor] #1489 Moved player-class.* and player-class-types.h to player-info/ --- diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index be1ba7ef7..3efe821ed 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -860,7 +860,7 @@ - + @@ -1503,7 +1503,7 @@ - + @@ -1829,7 +1829,7 @@ - + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 8108495ec..0b7a1d55d 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -389,8 +389,8 @@ room - - player + + player-info player @@ -2738,8 +2738,8 @@ room - - player + + player-info player @@ -3749,8 +3749,8 @@ player - - player + + player-info spell diff --git a/src/Makefile.am b/src/Makefile.am index cd988e0ad..76ac68aaa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -625,8 +625,6 @@ hengband_SOURCES = \ player/permanent-resistances.cpp player/permanent-resistances.h \ player/temporary-resistances.cpp player/temporary-resistances.h \ player/digestion-processor.cpp player/digestion-processor.h \ - player/player-class-types.h \ - player/player-class.cpp player/player-class.h \ player/player-damage.cpp player/player-damage.h \ player/player-move.cpp player/player-move.h \ player/player-personality.cpp player/player-personality.h \ @@ -660,6 +658,8 @@ hengband_SOURCES = \ player-info/base-status-info.cpp player-info/base-status-info.h \ player-info/body-improvement-info.cpp player-info/body-improvement-info.h \ player-info/class-ability-info.cpp player-info/class-ability-info.h \ + player-info/class-types.h \ + player-info/class-info.cpp player-info/class-info.h \ player-info/equipment-info.cpp player-info/equipment-info.h \ player-info/mimic-info-table.cpp player-info/mimic-info-table.h \ player-info/mutation-info.cpp player-info/mutation-info.h \ diff --git a/src/autopick/autopick-editor-command.cpp b/src/autopick/autopick-editor-command.cpp index 2c963b2d3..1825f9fe4 100644 --- a/src/autopick/autopick-editor-command.cpp +++ b/src/autopick/autopick-editor-command.cpp @@ -21,8 +21,8 @@ #include "core/show-file.h" #include "game-option/input-options.h" #include "game-option/keymap-directory-getter.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "system/player-type-definition.h" #include "term/term-color-types.h" diff --git a/src/avatar/avatar.cpp b/src/avatar/avatar.cpp index a88dd57e8..bdb208b30 100644 --- a/src/avatar/avatar.cpp +++ b/src/avatar/avatar.cpp @@ -15,8 +15,8 @@ #include "avatar/avatar.h" #include "core/player-update-types.h" #include "game-option/text-display-options.h" +#include "player-info/class-info.h" #include "player-info/race-types.h" -#include "player/player-class.h" #include "realm/realm-names-table.h" #include "system/player-type-definition.h" diff --git a/src/birth/auto-roller.cpp b/src/birth/auto-roller.cpp index 240b52bb8..b3299de06 100644 --- a/src/birth/auto-roller.cpp +++ b/src/birth/auto-roller.cpp @@ -4,8 +4,8 @@ #include "cmd-io/cmd-gameoption.h" #include "io/input-key-acceptor.h" #include "main/sound-of-music.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-sex.h" #include "player/player-status-table.h" diff --git a/src/birth/birth-explanations-table.h b/src/birth/birth-explanations-table.h index 17133e52e..bd7c20b29 100644 --- a/src/birth/birth-explanations-table.h +++ b/src/birth/birth-explanations-table.h @@ -1,7 +1,7 @@ #pragma once #include "player-info/race-types.h" -#include "player/player-class-types.h" +#include "player-info/class-types.h" #include "player/player-personality.h" #include "realm/realm-names-table.h" #include "system/angband.h" diff --git a/src/birth/birth-select-class.cpp b/src/birth/birth-select-class.cpp index c19164f9f..73f591db3 100644 --- a/src/birth/birth-select-class.cpp +++ b/src/birth/birth-select-class.cpp @@ -1,8 +1,8 @@ #include "birth/birth-select-class.h" #include "birth/birth-util.h" #include "io/input-key-acceptor.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "system/player-type-definition.h" #include "term/screen-processor.h" #include "term/term-color-types.h" diff --git a/src/birth/birth-stat.cpp b/src/birth/birth-stat.cpp index 7899c9045..7cddc0d2e 100644 --- a/src/birth/birth-stat.cpp +++ b/src/birth/birth-stat.cpp @@ -1,9 +1,9 @@ #include "birth/birth-stat.h" #include "birth/auto-roller.h" #include "core/player-redraw-types.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" #include "player-info/race-types.h" -#include "player/player-class.h" #include "player/player-personality-types.h" #include "player/player-personality.h" #include "player/player-skill.h" diff --git a/src/birth/birth-wizard.cpp b/src/birth/birth-wizard.cpp index e6afbf856..46c943730 100644 --- a/src/birth/birth-wizard.cpp +++ b/src/birth/birth-wizard.cpp @@ -21,9 +21,9 @@ #include "io/input-key-acceptor.h" #include "main/sound-definitions-table.h" #include "main/sound-of-music.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" #include "player/patron.h" -#include "player/player-class.h" #include "player/player-sex.h" #include "player/player-status-table.h" #include "player/player-status.h" diff --git a/src/birth/character-builder.cpp b/src/birth/character-builder.cpp index d0b6280ef..1fc64f959 100644 --- a/src/birth/character-builder.cpp +++ b/src/birth/character-builder.cpp @@ -25,9 +25,9 @@ #include "main/sound-of-music.h" #include "mind/mind-elementalist.h" #include "monster-floor/monster-remover.h" +#include "player-info/class-info.h" #include "player-info/race-types.h" #include "player/patron.h" -#include "player/player-class.h" #include "player/player-sex.h" #include "player/race-info-table.h" #include "store/store-owners.h" diff --git a/src/birth/initial-equipments-table.h b/src/birth/initial-equipments-table.h index 1bc0f8505..1b92c588b 100644 --- a/src/birth/initial-equipments-table.h +++ b/src/birth/initial-equipments-table.h @@ -1,6 +1,6 @@ #pragma once -#include "player/player-class-types.h" +#include "player-info/class-types.h" #include "system/angband.h" extern byte player_init[MAX_CLASS][3][2]; diff --git a/src/birth/quick-start.cpp b/src/birth/quick-start.cpp index fafbe2b44..95c3a8cf2 100644 --- a/src/birth/quick-start.cpp +++ b/src/birth/quick-start.cpp @@ -4,8 +4,8 @@ #include "birth/game-play-initializer.h" #include "core/player-update-types.h" #include "io/input-key-acceptor.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-sex.h" #include "player/player-status.h" diff --git a/src/birth/quick-start.h b/src/birth/quick-start.h index bd4455568..77a0d4c9c 100644 --- a/src/birth/quick-start.h +++ b/src/birth/quick-start.h @@ -1,7 +1,7 @@ #pragma once +#include "player-info/class-types.h" #include "player-info/race-types.h" -#include "player/player-class-types.h" #include "player/player-personality-types.h" #include "player/player-sex.h" #include "system/angband.h" diff --git a/src/cmd-action/cmd-mind.cpp b/src/cmd-action/cmd-mind.cpp index 3ef4459a4..572e50f38 100644 --- a/src/cmd-action/cmd-mind.cpp +++ b/src/cmd-action/cmd-mind.cpp @@ -33,9 +33,9 @@ #include "mind/mind-numbers.h" #include "mind/mind-power-getter.h" #include "mind/mind-types.h" +#include "player-info/class-info.h" #include "player-info/equipment-info.h" #include "player-status/player-energy.h" -#include "player/player-class.h" #include "player/player-damage.h" #include "player/player-status-table.h" #include "player/player-status.h" diff --git a/src/cmd-action/cmd-pet.cpp b/src/cmd-action/cmd-pet.cpp index 02cd0599d..bf8624532 100644 --- a/src/cmd-action/cmd-pet.cpp +++ b/src/cmd-action/cmd-pet.cpp @@ -36,11 +36,11 @@ #include "monster/smart-learn-types.h" #include "object-hook/hook-weapon.h" #include "pet/pet-util.h" +#include "player-info/class-info.h" #include "player-info/equipment-info.h" #include "player-status/player-energy.h" #include "player-status/player-hand-types.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "player/player-damage.h" #include "player/player-move.h" #include "player/player-skill.h" @@ -261,17 +261,10 @@ bool do_cmd_riding(player_type *creature_ptr, bool force) feature_type *f_ptr = &f_info[g_ptr->get_feat_mimic()]; #ifdef JP msg_format("そのモンスターは%sの%sにいる。", f_ptr->name.c_str(), - (f_ptr->flags.has_none_of({FF::MOVE, FF::CAN_FLY}) - || f_ptr->flags.has_none_of({FF::LOS, FF::TREE})) - ? "中" - : "上"); + (f_ptr->flags.has_none_of({ FF::MOVE, FF::CAN_FLY }) || f_ptr->flags.has_none_of({ FF::LOS, FF::TREE })) ? "中" : "上"); #else msg_format("This monster is %s the %s.", - (f_ptr->flags.has_none_of({FF::MOVE, FF::CAN_FLY}) - || f_ptr->flags.has_none_of({FF::LOS, FF::TREE})) - ? "in" - : "on", - f_ptr->name.c_str()); + (f_ptr->flags.has_none_of({ FF::MOVE, FF::CAN_FLY }) || f_ptr->flags.has_none_of({ FF::LOS, FF::TREE })) ? "in" : "on", f_ptr->name.c_str()); #endif return false; diff --git a/src/cmd-action/cmd-spell.cpp b/src/cmd-action/cmd-spell.cpp index 3316a152a..29688da04 100644 --- a/src/cmd-action/cmd-spell.cpp +++ b/src/cmd-action/cmd-spell.cpp @@ -32,11 +32,11 @@ #include "object/item-tester-hooker.h" #include "object/item-use-flags.h" #include "object/object-info.h" +#include "player-info/class-info.h" #include "player-info/self-info.h" #include "player-status/player-energy.h" #include "player/attack-defense-types.h" #include "player/eldritch-horror.h" -#include "player/player-class.h" #include "player/player-damage.h" #include "player/player-realm.h" #include "player/player-skill.h" @@ -1043,8 +1043,7 @@ bool do_cmd_cast(player_type *caster_ptr) auto item_tester = get_castable_spellbook_tester(caster_ptr); - o_ptr = choose_object( - caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | (caster_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester); + o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | (caster_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester); if (!o_ptr) { if (item == INVEN_FORCE) /* the_force */ { diff --git a/src/cmd-io/cmd-menu-content-table.cpp b/src/cmd-io/cmd-menu-content-table.cpp index c92fada45..5f1d151c8 100644 --- a/src/cmd-io/cmd-menu-content-table.cpp +++ b/src/cmd-io/cmd-menu-content-table.cpp @@ -1,5 +1,5 @@ #include "cmd-io/cmd-menu-content-table.h" -#include "player/player-class-types.h" +#include "player-info/class-types.h" #include "util/int-char-converter.h" special_menu_content special_menu_info[MAX_SPECIAL_MENU_NUM] = { @@ -31,102 +31,46 @@ menu_content menu_info[MAX_COMMAND_MENU_NUM][MAX_COMMAND_PER_SCREEN] = { { "", 0, false }, }, - { { _("使う(m)", "Use(m)"), 'm', true }, - { _("調べる(b/P)", "See tips(b/P)"), 'b', true }, - { _("覚える(G)", "Study(G)"), 'G', true }, - { _("特殊能力を使う(U/O)", "Special abilities(U/O)"), 'U', true }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false } }, + { { _("使う(m)", "Use(m)"), 'm', true }, { _("調べる(b/P)", "See tips(b/P)"), 'b', true }, { _("覚える(G)", "Study(G)"), 'G', true }, + { _("特殊能力を使う(U/O)", "Special abilities(U/O)"), 'U', true }, { "", 0, false }, { "", 0, false }, { "", 0, false }, { "", 0, false }, + { "", 0, false }, { "", 0, false } }, - { { _("休息する(R)", "Rest(R)"), 'R', true }, - { _("トラップ解除(D)", "Disarm a trap(D)"), 'D', true }, - { _("探す(s)", "Search(s)"), 's', true }, - { _("周りを調べる(l/x)", "Look(l/x)"), 'l', true }, - { _("ターゲット指定(*)", "Target(*)"), '*', true }, - { _("穴を掘る(T/^t)", "Dig(T/^t)"), 'T', true }, - { _("階段を上る(<)", "Go up stairs(<)"), '<', true }, - { _("階段を下りる(>)", "Go down stairs(>)"), '>', true }, - { _("ペットに命令する(p)", "Command pets(p)"), 'p', true }, - { _("探索モードのON/OFF(S/#)", "Search mode ON/OFF(S/#)"), 'S', true } }, + { { _("休息する(R)", "Rest(R)"), 'R', true }, { _("トラップ解除(D)", "Disarm a trap(D)"), 'D', true }, { _("探す(s)", "Search(s)"), 's', true }, + { _("周りを調べる(l/x)", "Look(l/x)"), 'l', true }, { _("ターゲット指定(*)", "Target(*)"), '*', true }, { _("穴を掘る(T/^t)", "Dig(T/^t)"), 'T', true }, + { _("階段を上る(<)", "Go up stairs(<)"), '<', true }, { _("階段を下りる(>)", "Go down stairs(>)"), '>', true }, + { _("ペットに命令する(p)", "Command pets(p)"), 'p', true }, { _("探索モードのON/OFF(S/#)", "Search mode ON/OFF(S/#)"), 'S', true } }, - { { _("読む(r)", "Read a scroll(r)"), 'r', true }, - { _("飲む(q)", "Drink a potion(q)"), 'q', true }, - { _("杖を使う(u/Z)", "Use a staff(u/Z)"), 'u', true }, - { _("魔法棒で狙う(a/z)", "Aim a wand(a/z)"), 'a', true }, - { _("ロッドを振る(z/a)", "Zap a rod(z/a)"), 'z', true }, - { _("始動する(A)", "Activate equipped item(A)"), 'A', true }, - { _("食べる(E)", "Eat(E)"), 'E', true }, - { _("飛び道具で撃つ(f/t)", "Fire missile weapon(f/t)"), 'f', true }, - { _("投げる(v)", "Throw an item(v)"), 'v', true }, - { "", 0, false } }, + { { _("読む(r)", "Read a scroll(r)"), 'r', true }, { _("飲む(q)", "Drink a potion(q)"), 'q', true }, { _("杖を使う(u/Z)", "Use a staff(u/Z)"), 'u', true }, + { _("魔法棒で狙う(a/z)", "Aim a wand(a/z)"), 'a', true }, { _("ロッドを振る(z/a)", "Zap a rod(z/a)"), 'z', true }, + { _("始動する(A)", "Activate equipped item(A)"), 'A', true }, { _("食べる(E)", "Eat(E)"), 'E', true }, + { _("飛び道具で撃つ(f/t)", "Fire missile weapon(f/t)"), 'f', true }, { _("投げる(v)", "Throw an item(v)"), 'v', true }, { "", 0, false } }, - { { _("拾う(g)", "Get items(g)"), 'g', true }, - { _("落とす(d)", "Drop an item(d)"), 'd', true }, - { _("壊す(k/^d)", "Destroy an item(k/^d)"), 'k', true }, - { _("銘を刻む({)", "Inscribe an item({)"), '{', true }, - { _("銘を消す(})", "Uninscribe an item(})"), '}', true }, - { _("調査(I)", "Uninscribe an item(})"), 'I', true }, - { _("アイテム一覧(i)", "Inventory list(i)"), 'i', true }, - { "", 0, false }, - { "", 0, false }, + { { _("拾う(g)", "Get items(g)"), 'g', true }, { _("落とす(d)", "Drop an item(d)"), 'd', true }, { _("壊す(k/^d)", "Destroy an item(k/^d)"), 'k', true }, + { _("銘を刻む({)", "Inscribe an item({)"), '{', true }, { _("銘を消す(})", "Uninscribe an item(})"), '}', true }, + { _("調査(I)", "Uninscribe an item(})"), 'I', true }, { _("アイテム一覧(i)", "Inventory list(i)"), 'i', true }, { "", 0, false }, { "", 0, false }, { "", 0, false } }, - { { _("装備する(w)", "Wear(w)"), 'w', true }, - { _("装備を外す(t/T)", "Take off(t/T)"), 't', true }, - { _("燃料を補給(F)", "Refuel(F)"), 'F', true }, - { _("装備一覧(e)", "Equipment list(e)"), 'e', true }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, + { { _("装備する(w)", "Wear(w)"), 'w', true }, { _("装備を外す(t/T)", "Take off(t/T)"), 't', true }, { _("燃料を補給(F)", "Refuel(F)"), 'F', true }, + { _("装備一覧(e)", "Equipment list(e)"), 'e', true }, { "", 0, false }, { "", 0, false }, { "", 0, false }, { "", 0, false }, { "", 0, false }, { "", 0, false } }, - { { _("開ける(o)", "Open(o)"), 'o', true }, - { _("閉じる(c)", "Close(c)"), 'c', true }, - { _("体当たりする(B/f)", "Bash a door(B/f)"), 'B', true }, - { _("くさびを打つ(j/S)", "Jam a door(j/S)"), 'j', true }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false }, + { { _("開ける(o)", "Open(o)"), 'o', true }, { _("閉じる(c)", "Close(c)"), 'c', true }, { _("体当たりする(B/f)", "Bash a door(B/f)"), 'B', true }, + { _("くさびを打つ(j/S)", "Jam a door(j/S)"), 'j', true }, { "", 0, false }, { "", 0, false }, { "", 0, false }, { "", 0, false }, { "", 0, false }, { "", 0, false } }, - { { _("ダンジョンの全体図(M)", "Full map(M)"), 'M', true }, - { _("位置を確認(L/W)", "Map(L/W)"), 'L', true }, - { _("階の雰囲気(^f)", "Level feeling(^f)"), KTRL('F'), true }, - { _("ステータス(C)", "Character status(C)"), 'C', true }, - { _("文字の説明(/)", "Identify symbol(/)"), '/', true }, - { _("メッセージ履歴(^p)", "Show prev messages(^p)"), KTRL('P'), true }, - { _("現在の時刻(^t/')", "Current time(^t/')"), KTRL('T'), true }, - { _("現在の知識(~)", "Various information(~)"), '~', true }, - { _("プレイ記録(|)", "Play record menu(|)"), '|', true }, - { "", 0, false } }, + { { _("ダンジョンの全体図(M)", "Full map(M)"), 'M', true }, { _("位置を確認(L/W)", "Map(L/W)"), 'L', true }, + { _("階の雰囲気(^f)", "Level feeling(^f)"), KTRL('F'), true }, { _("ステータス(C)", "Character status(C)"), 'C', true }, + { _("文字の説明(/)", "Identify symbol(/)"), '/', true }, { _("メッセージ履歴(^p)", "Show prev messages(^p)"), KTRL('P'), true }, + { _("現在の時刻(^t/')", "Current time(^t/')"), KTRL('T'), true }, { _("現在の知識(~)", "Various information(~)"), '~', true }, + { _("プレイ記録(|)", "Play record menu(|)"), '|', true }, { "", 0, false } }, - { { _("オプション(=)", "Set options(=)"), '=', true }, - { _("マクロ(@)", "Interact with macros(@)"), '@', true }, - { _("画面表示(%)", "Interact w/ visuals(%)"), '%', true }, - { _("カラー(&)", "Interact with colors(&)"), '&', true }, - { _("設定変更コマンド(\")", "Enter a user pref(\")"), '\"', true }, - { _("自動拾いをロード($)", "Reload auto-pick pref($)"), '$', true }, - { _("システム(!)", "System(!)"), '!', true }, - { "", 0, false }, - { "", 0, false }, - { "", 0, false } }, + { { _("オプション(=)", "Set options(=)"), '=', true }, { _("マクロ(@)", "Interact with macros(@)"), '@', true }, + { _("画面表示(%)", "Interact w/ visuals(%)"), '%', true }, { _("カラー(&)", "Interact with colors(&)"), '&', true }, + { _("設定変更コマンド(\")", "Enter a user pref(\")"), '\"', true }, { _("自動拾いをロード($)", "Reload auto-pick pref($)"), '$', true }, + { _("システム(!)", "System(!)"), '!', true }, { "", 0, false }, { "", 0, false }, { "", 0, false } }, - { { _("セーブ&中断(^x)", "Save and quit(^x)"), KTRL('X'), true }, - { _("セーブ(^s)", "Save(^s)"), KTRL('S'), true }, - { _("ヘルプ(?)", "Help(out-of-date)(?)"), '?', true }, - { _("再描画(^r)", "Redraw(^r)"), KTRL('R'), true }, - { _("メモ(:)", "Take note(:)"), ':', true }, - { _("記念撮影())", "Dump screen dump(()"), ')', true }, - { _("記念撮影の表示(()", "Load screen dump())"), '(', true }, - { _("バージョン情報(V)", "Version info(V)"), 'V', true }, - { _("引退する(Q)", "Quit(Q)"), 'Q', true }, - { "", 0, false } }, + { { _("セーブ&中断(^x)", "Save and quit(^x)"), KTRL('X'), true }, { _("セーブ(^s)", "Save(^s)"), KTRL('S'), true }, + { _("ヘルプ(?)", "Help(out-of-date)(?)"), '?', true }, { _("再描画(^r)", "Redraw(^r)"), KTRL('R'), true }, { _("メモ(:)", "Take note(:)"), ':', true }, + { _("記念撮影())", "Dump screen dump(()"), ')', true }, { _("記念撮影の表示(()", "Load screen dump())"), '(', true }, + { _("バージョン情報(V)", "Version info(V)"), 'V', true }, { _("引退する(Q)", "Quit(Q)"), 'Q', true }, { "", 0, false } }, }; diff --git a/src/cmd-item/cmd-eat.cpp b/src/cmd-item/cmd-eat.cpp index eb3ae689c..300927186 100644 --- a/src/cmd-item/cmd-eat.cpp +++ b/src/cmd-item/cmd-eat.cpp @@ -25,11 +25,11 @@ #include "object/object-kind.h" #include "perception/object-perception.h" #include "player-base/player-race.h" +#include "player-info/class-info.h" #include "player-info/mimic-info-table.h" #include "player-status/player-energy.h" #include "player/attack-defense-types.h" #include "player/digestion-processor.h" -#include "player/player-class.h" #include "player/player-damage.h" #include "player/player-status-flags.h" #include "player/special-defense-types.h" diff --git a/src/cmd-item/cmd-item.cpp b/src/cmd-item/cmd-item.cpp index 2e7eb3e10..2602cb9e9 100644 --- a/src/cmd-item/cmd-item.cpp +++ b/src/cmd-item/cmd-item.cpp @@ -43,11 +43,11 @@ #include "object/item-use-flags.h" #include "perception/identification.h" #include "perception/object-perception.h" +#include "player-info/class-info.h" #include "player-info/race-types.h" #include "player-info/self-info.h" #include "player-status/player-energy.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "player/player-personality-types.h" #include "player/player-status.h" #include "player/special-defense-types.h" diff --git a/src/cmd-item/cmd-magiceat.cpp b/src/cmd-item/cmd-magiceat.cpp index d182322f1..5021fc36c 100644 --- a/src/cmd-item/cmd-magiceat.cpp +++ b/src/cmd-item/cmd-magiceat.cpp @@ -67,8 +67,8 @@ #include "main/sound-of-music.h" #include "object/object-kind-hook.h" #include "object/object-kind.h" +#include "player-info/class-info.h" #include "player-status/player-energy.h" -#include "player/player-class.h" #include "player/player-status-table.h" #include "spell/spell-info.h" #include "sv-definition/sv-other-types.h" diff --git a/src/cmd-item/cmd-usestaff.cpp b/src/cmd-item/cmd-usestaff.cpp index 7a0e21a54..544a79245 100644 --- a/src/cmd-item/cmd-usestaff.cpp +++ b/src/cmd-item/cmd-usestaff.cpp @@ -17,11 +17,11 @@ #include "object/object-info.h" #include "object/object-kind.h" #include "perception/object-perception.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" #include "player-info/race-types.h" #include "player-status/player-energy.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "player/player-status-flags.h" #include "player/special-defense-types.h" #include "spell-kind/earthquake.h" diff --git a/src/cmd-item/cmd-zaprod.cpp b/src/cmd-item/cmd-zaprod.cpp index 9f7a40657..10ba0b61a 100644 --- a/src/cmd-item/cmd-zaprod.cpp +++ b/src/cmd-item/cmd-zaprod.cpp @@ -13,9 +13,9 @@ #include "object/object-info.h" #include "object/object-kind.h" #include "perception/object-perception.h" +#include "player-info/class-info.h" #include "player-status/player-energy.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "player/special-defense-types.h" #include "spell-kind/spells-beam.h" #include "spell-kind/spells-detection.h" diff --git a/src/cmd-item/cmd-zapwand.cpp b/src/cmd-item/cmd-zapwand.cpp index 6ec94e6ce..a9a5df27e 100644 --- a/src/cmd-item/cmd-zapwand.cpp +++ b/src/cmd-item/cmd-zapwand.cpp @@ -15,9 +15,9 @@ #include "object/object-info.h" #include "object/object-kind.h" #include "perception/object-perception.h" +#include "player-info/class-info.h" #include "player-status/player-energy.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "player/special-defense-types.h" #include "spell-kind/spells-beam.h" #include "spell-kind/spells-charm.h" diff --git a/src/combat/shoot.cpp b/src/combat/shoot.cpp index 9a7693491..a45584011 100644 --- a/src/combat/shoot.cpp +++ b/src/combat/shoot.cpp @@ -46,8 +46,8 @@ #include "object/object-info.h" #include "object/object-kind.h" #include "object/object-mark-types.h" +#include "player-info/class-info.h" #include "player-status/player-energy.h" -#include "player/player-class.h" #include "player/player-personality-types.h" #include "player/player-skill.h" #include "player/player-status-table.h" diff --git a/src/core/game-play.cpp b/src/core/game-play.cpp index 2763aaea1..ea985bea6 100644 --- a/src/core/game-play.cpp +++ b/src/core/game-play.cpp @@ -62,8 +62,8 @@ #include "monster-race/monster-race.h" #include "monster-race/race-indice-types.h" #include "monster/monster-util.h" +#include "player-info/class-info.h" #include "player-info/race-types.h" -#include "player/player-class.h" #include "player/player-personality-types.h" #include "player/player-skill.h" #include "player/player-status.h" diff --git a/src/core/scores.cpp b/src/core/scores.cpp index d1568ad87..b06a24620 100644 --- a/src/core/scores.cpp +++ b/src/core/scores.cpp @@ -22,7 +22,7 @@ #include "io/report.h" #include "io/signal-handlers.h" #include "io/uid-checker.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-personality.h" #include "player/player-status.h" #include "player/race-info-table.h" diff --git a/src/flavor/object-flavor.cpp b/src/flavor/object-flavor.cpp index 1e0d153d4..9d1716a01 100644 --- a/src/flavor/object-flavor.cpp +++ b/src/flavor/object-flavor.cpp @@ -32,7 +32,7 @@ #include "object/object-info.h" #include "object/object-kind.h" #include "perception/object-perception.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-status.h" #include "sv-definition/sv-food-types.h" #include "sv-definition/sv-lite-types.h" diff --git a/src/flavor/tval-description-switcher.cpp b/src/flavor/tval-description-switcher.cpp index 4b82fb9dd..534e4afbf 100644 --- a/src/flavor/tval-description-switcher.cpp +++ b/src/flavor/tval-description-switcher.cpp @@ -15,7 +15,7 @@ #else #include "locale/english.h" #include "monster-race/race-flags1.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #endif static void describe_monster_ball(flavor_type *flavor_ptr) diff --git a/src/grid/grid.cpp b/src/grid/grid.cpp index 7f88e61c1..f39d238f8 100644 --- a/src/grid/grid.cpp +++ b/src/grid/grid.cpp @@ -41,7 +41,7 @@ #include "monster/monster-update.h" #include "object/item-tester-hooker.h" #include "object/object-mark-types.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-status-flags.h" #include "player/player-status.h" #include "room/rooms-builder.h" @@ -159,12 +159,9 @@ bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x) /* Check for "complex" illumination */ auto *floor_ptr = creature_ptr->current_floor_ptr; - if ((feat_supports_los(floor_ptr->grid_array[yy][xx].get_feat_mimic()) - && (floor_ptr->grid_array[yy][xx].info & CAVE_GLOW)) - || (feat_supports_los(floor_ptr->grid_array[y][xx].get_feat_mimic()) - && (floor_ptr->grid_array[y][xx].info & CAVE_GLOW)) - || (feat_supports_los(floor_ptr->grid_array[yy][x].get_feat_mimic()) - && (floor_ptr->grid_array[yy][x].info & CAVE_GLOW))) { + if ((feat_supports_los(floor_ptr->grid_array[yy][xx].get_feat_mimic()) && (floor_ptr->grid_array[yy][xx].info & CAVE_GLOW)) + || (feat_supports_los(floor_ptr->grid_array[y][xx].get_feat_mimic()) && (floor_ptr->grid_array[y][xx].info & CAVE_GLOW)) + || (feat_supports_los(floor_ptr->grid_array[yy][x].get_feat_mimic()) && (floor_ptr->grid_array[yy][x].info & CAVE_GLOW))) { return true; } else return false; @@ -900,7 +897,7 @@ bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION if (!player_can_enter(player_ptr, g_ptr->feat, 0)) return false; - if (f_ptr->flags.has_all_of({FF::WATER, FF::DEEP})) { + if (f_ptr->flags.has_all_of({ FF::WATER, FF::DEEP })) { if (!player_ptr->levitation && !player_ptr->can_swim) return false; } diff --git a/src/grid/trap.cpp b/src/grid/trap.cpp index 39ca07ff0..8de89a8a3 100644 --- a/src/grid/trap.cpp +++ b/src/grid/trap.cpp @@ -21,8 +21,8 @@ #include "monster-floor/monster-summon.h" #include "monster-floor/place-monster-types.h" #include "monster/monster-util.h" +#include "player-info/class-info.h" #include "player/eldritch-horror.h" -#include "player/player-class.h" #include "player/player-damage.h" #include "player/player-personality-types.h" #include "player/player-status-flags.h" diff --git a/src/info-reader/fixed-map-parser.cpp b/src/info-reader/fixed-map-parser.cpp index 2a871021e..fde7bbcab 100644 --- a/src/info-reader/fixed-map-parser.cpp +++ b/src/info-reader/fixed-map-parser.cpp @@ -13,8 +13,8 @@ #include "game-option/runtime-arguments.h" #include "io/files-util.h" #include "main/init-error-messages-table.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "realm/realm-names-table.h" #include "system/floor-type-definition.h" #include "system/player-type-definition.h" diff --git a/src/info-reader/magic-reader.cpp b/src/info-reader/magic-reader.cpp index 6fbb0df7c..dde6d1d4c 100644 --- a/src/info-reader/magic-reader.cpp +++ b/src/info-reader/magic-reader.cpp @@ -3,7 +3,7 @@ #include "info-reader/parse-error-types.h" #include "main/angband-headers.h" #include "player-ability/player-ability-types.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "util/string-processor.h" namespace { diff --git a/src/io/input-key-processor.cpp b/src/io/input-key-processor.cpp index f36dc3909..8afad0ee6 100644 --- a/src/io/input-key-processor.cpp +++ b/src/io/input-key-processor.cpp @@ -61,10 +61,10 @@ #include "game-option/input-options.h" #include "game-option/runtime-arguments.h" #include "io-dump/random-art-info-dumper.h" -#include "io/record-play-movie.h" #include "io/command-repeater.h" #include "io/files-util.h" #include "io/input-key-requester.h" //!< @todo 相互依存している、後で何とかする. +#include "io/record-play-movie.h" #include "io/write-diary.h" #include "knowledge/knowledge-autopick.h" #include "knowledge/knowledge-quests.h" @@ -75,15 +75,15 @@ #include "mind/mind-magic-eater.h" #include "mind/mind-sniper.h" #include "mind/snipe-types.h" +#include "player-info/class-info.h" #include "player-status/player-energy.h" #include "player/attack-defense-types.h" #include "player/digestion-processor.h" -#include "player/player-class.h" #include "player/player-status.h" #include "player/special-defense-types.h" #include "status/action-setter.h" -#include "store/home.h" #include "store/cmd-store.h" +#include "store/home.h" #include "store/store-util.h" #include "system/floor-type-definition.h" #include "system/player-type-definition.h" @@ -382,14 +382,14 @@ void process_command(player_type *creature_ptr) msg_print(_("呪文を唱えられない!", "You cannot cast spells!")); break; } - + if (floor_ptr->dun_level && d_info[creature_ptr->dungeon_idx].flags.has(DF::NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH)) { msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!")); msg_print(nullptr); break; } - + if (creature_ptr->anti_magic && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH)) { concptr which_power = _("魔法", "magic"); switch (creature_ptr->pclass) { @@ -421,7 +421,7 @@ void process_command(player_type *creature_ptr) PlayerEnergy(creature_ptr).reset_player_turn(); break; } - + if (is_shero(creature_ptr) && (creature_ptr->pclass != CLASS_BERSERKER)) { msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!")); PlayerEnergy(creature_ptr).reset_player_turn(); diff --git a/src/io/pref-file-expressor.cpp b/src/io/pref-file-expressor.cpp index 5b820bfc7..d543ec72f 100644 --- a/src/io/pref-file-expressor.cpp +++ b/src/io/pref-file-expressor.cpp @@ -1,7 +1,7 @@ #include "io/pref-file-expressor.h" #include "game-option/runtime-arguments.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "realm/realm-names-table.h" #include "system/player-type-definition.h" #include "system/system-variables.h" diff --git a/src/io/read-pref-file.cpp b/src/io/read-pref-file.cpp index fe3a455fc..4e6a2d835 100644 --- a/src/io/read-pref-file.cpp +++ b/src/io/read-pref-file.cpp @@ -21,8 +21,8 @@ #include "io/files-util.h" #include "io/interpret-pref-file.h" #include "io/pref-file-expressor.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "realm/realm-names-table.h" #include "system/player-type-definition.h" #include "util/angband-files.h" diff --git a/src/io/report.cpp b/src/io/report.cpp index 9974f0b1b..a8ca752fe 100644 --- a/src/io/report.cpp +++ b/src/io/report.cpp @@ -17,8 +17,8 @@ #include "io/inet.h" #include "io/input-key-acceptor.h" #include "mind/mind-elementalist.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-status.h" #include "realm/realm-names-table.h" diff --git a/src/knowledge/knowledge-experiences.cpp b/src/knowledge/knowledge-experiences.cpp index 5e8a94138..f11301be6 100644 --- a/src/knowledge/knowledge-experiences.cpp +++ b/src/knowledge/knowledge-experiences.cpp @@ -11,7 +11,7 @@ #include "game-option/text-display-options.h" #include "io-dump/dump-util.h" #include "object/object-kind.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-skill.h" #include "player/player-status.h" #include "realm/realm-names-table.h" @@ -96,8 +96,7 @@ void do_cmd_knowledge_spell_exp(player_type *creature_ptr) if (show_actual_value) fprintf(fff, "----/---- "); fprintf(fff, "[--]"); - } - else { + } else { if (show_actual_value) fprintf(fff, "%4d/%4d ", MIN(spell_exp, SPELL_EXP_MASTER), SPELL_EXP_MASTER); if (exp_level >= EXP_LEVEL_MASTER) diff --git a/src/knowledge/knowledge-self.cpp b/src/knowledge/knowledge-self.cpp index 5be11342b..32599a87f 100644 --- a/src/knowledge/knowledge-self.cpp +++ b/src/knowledge/knowledge-self.cpp @@ -13,7 +13,7 @@ #include "info-reader/fixed-map-parser.h" #include "io-dump/dump-util.h" #include "player-info/alignment.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-status-table.h" #include "player/race-info-table.h" #include "store/store-util.h" diff --git a/src/load/load-zangband.cpp b/src/load/load-zangband.cpp index 1cca4b7c0..36a3bf18e 100644 --- a/src/load/load-zangband.cpp +++ b/src/load/load-zangband.cpp @@ -10,10 +10,10 @@ #include "market/bounty.h" #include "monster-race/monster-race.h" #include "pet/pet-util.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" #include "player/attack-defense-types.h" #include "player/patron.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-skill.h" #include "realm/realm-types.h" diff --git a/src/load/load.cpp b/src/load/load.cpp index f2db0005f..6c95541c5 100644 --- a/src/load/load.cpp +++ b/src/load/load.cpp @@ -33,8 +33,8 @@ #include "load/quest-loader.h" #include "load/store-loader.h" #include "load/world-loader.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-sex.h" #include "player/race-info-table.h" diff --git a/src/main/info-initializer.cpp b/src/main/info-initializer.cpp index 8569f1749..4d45da7ba 100644 --- a/src/main/info-initializer.cpp +++ b/src/main/info-initializer.cpp @@ -25,7 +25,7 @@ #include "monster-race/monster-race.h" #include "object-enchant/object-ego.h" #include "object/object-kind.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-skill.h" #include "room/rooms-vault.h" #include "system/angband-version.h" @@ -47,7 +47,10 @@ * @param player_ptr プレーヤーへの参照ポインタ * @return エラーコード */ -errr init_misc(player_type *player_ptr) { return parse_fixed_map(player_ptr, "misc.txt", 0, 0, 0, 0); } +errr init_misc(player_type *player_ptr) +{ + return parse_fixed_map(player_ptr, "misc.txt", 0, 0, 0, 0); +} /*! * @brief ヘッダ構造体の更新 diff --git a/src/melee/melee-postprocess.cpp b/src/melee/melee-postprocess.cpp index 192635b86..ad2f7d1bd 100644 --- a/src/melee/melee-postprocess.cpp +++ b/src/melee/melee-postprocess.cpp @@ -34,8 +34,8 @@ #include "monster/monster-status-setter.h" #include "monster/monster-status.h" #include "pet/pet-fall-off.h" +#include "player-info/class-info.h" #include "player-info/race-types.h" -#include "player/player-class.h" #include "player/player-personality-types.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" diff --git a/src/mind/mind-power-getter.cpp b/src/mind/mind-power-getter.cpp index 8d5d3bd37..f1518beb7 100644 --- a/src/mind/mind-power-getter.cpp +++ b/src/mind/mind-power-getter.cpp @@ -11,8 +11,8 @@ #include "mind/mind-force-trainer.h" #include "mind/mind-info.h" #include "mind/mind-types.h" +#include "player-info/class-info.h" #include "player-info/equipment-info.h" -#include "player/player-class.h" #include "player/player-status-table.h" #include "system/player-type-definition.h" #include "term/screen-processor.h" @@ -230,9 +230,9 @@ bool MindPowerGetter::display_minds_chance(const bool only_browse) prt("", y, x); put_str(_("名前", "Name"), y, x + 5); - put_str( - format(_("Lv %s 失率 効果", "Lv %s Fail Info"), ((this->use_mind == mind_kind_type::BERSERKER) || (this->use_mind == mind_kind_type::NINJUTSU)) ? "HP" : "MP"), y, - x + 35); + put_str(format(_("Lv %s 失率 効果", "Lv %s Fail Info"), + ((this->use_mind == mind_kind_type::BERSERKER) || (this->use_mind == mind_kind_type::NINJUTSU)) ? "HP" : "MP"), + y, x + 35); display_each_mind_chance(); prt("", y + this->index + 1, x); return true; diff --git a/src/mspell/mspell-checker.cpp b/src/mspell/mspell-checker.cpp index 8742978ab..01b0b22fd 100644 --- a/src/mspell/mspell-checker.cpp +++ b/src/mspell/mspell-checker.cpp @@ -40,9 +40,9 @@ #include "mspell/mspell-selector.h" #include "mspell/mspell-util.h" #include "object-enchant/object-curse.h" +#include "player-info/class-info.h" #include "player-info/race-types.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "spell-kind/spells-world.h" #include "spell-realm/spells-hex.h" #include "spell/range-calc.h" diff --git a/src/object-hook/hook-magic.cpp b/src/object-hook/hook-magic.cpp index aeef39604..3395e427e 100644 --- a/src/object-hook/hook-magic.cpp +++ b/src/object-hook/hook-magic.cpp @@ -3,7 +3,7 @@ #include "object-enchant/tr-types.h" #include "object/object-flags.h" #include "perception/object-perception.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-realm.h" #include "realm/realm-names-table.h" #include "system/object-type-definition.h" @@ -75,7 +75,8 @@ bool item_tester_learn_spell(player_type *player_ptr, const object_type *o_ptr) else if (!is_magic(tval2realm(o_ptr->tval))) return false; - return (get_realm1_book(player_ptr) == o_ptr->tval) || (get_realm2_book(player_ptr) == o_ptr->tval) || (choices & (0x0001U << (tval2realm(o_ptr->tval) - 1))); + return (get_realm1_book(player_ptr) == o_ptr->tval) || (get_realm2_book(player_ptr) == o_ptr->tval) + || (choices & (0x0001U << (tval2realm(o_ptr->tval) - 1))); } /*! diff --git a/src/object/warning.cpp b/src/object/warning.cpp index 2f5d19f55..d168d5a78 100644 --- a/src/object/warning.cpp +++ b/src/object/warning.cpp @@ -24,7 +24,6 @@ #include "object-enchant/tr-types.h" #include "object/object-flags.h" #include "player-base/player-race.h" -#include "player/player-class.h" #include "player/player-status-flags.h" #include "player/player-status-resist.h" #include "player/special-defense-types.h" diff --git a/src/pet/pet-util.cpp b/src/pet/pet-util.cpp index 362f777f7..68fd17b53 100644 --- a/src/pet/pet-util.cpp +++ b/src/pet/pet-util.cpp @@ -7,7 +7,7 @@ #include "monster-race/race-flags7.h" #include "monster/monster-info.h" #include "monster/monster-status.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" diff --git a/src/player-ability/player-charisma.cpp b/src/player-ability/player-charisma.cpp index 4024e38b7..ee347292a 100644 --- a/src/player-ability/player-charisma.cpp +++ b/src/player-ability/player-charisma.cpp @@ -1,8 +1,8 @@ #include "player-ability/player-charisma.h" #include "mutation/mutation-flag-types.h" #include "object/object-flags.h" +#include "player-info/class-info.h" #include "player-info/mimic-info-table.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/race-info-table.h" #include "player/special-defense-types.h" diff --git a/src/player-ability/player-constitution.cpp b/src/player-ability/player-constitution.cpp index 4448900d4..801a4910b 100644 --- a/src/player-ability/player-constitution.cpp +++ b/src/player-ability/player-constitution.cpp @@ -2,7 +2,7 @@ #include "mutation/mutation-flag-types.h" #include "object/object-flags.h" #include "player-base/player-race.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-personality.h" #include "player/race-info-table.h" #include "player/special-defense-types.h" diff --git a/src/player-ability/player-dexterity.cpp b/src/player-ability/player-dexterity.cpp index 96db53711..c8c22a5a6 100644 --- a/src/player-ability/player-dexterity.cpp +++ b/src/player-ability/player-dexterity.cpp @@ -2,7 +2,7 @@ #include "mutation/mutation-flag-types.h" #include "object/object-flags.h" #include "player-base/player-race.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-personality.h" #include "player/race-info-table.h" #include "player/special-defense-types.h" diff --git a/src/player-ability/player-intelligence.cpp b/src/player-ability/player-intelligence.cpp index b57f5a3a7..e8e538675 100644 --- a/src/player-ability/player-intelligence.cpp +++ b/src/player-ability/player-intelligence.cpp @@ -1,8 +1,8 @@ #include "player-ability/player-intelligence.h" #include "mutation/mutation-flag-types.h" #include "object/object-flags.h" +#include "player-info/class-info.h" #include "player-info/mimic-info-table.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/race-info-table.h" #include "player/special-defense-types.h" diff --git a/src/player-ability/player-strength.cpp b/src/player-ability/player-strength.cpp index 54ae02543..191c2f19f 100644 --- a/src/player-ability/player-strength.cpp +++ b/src/player-ability/player-strength.cpp @@ -2,7 +2,7 @@ #include "mutation/mutation-flag-types.h" #include "object/object-flags.h" #include "player-base/player-race.h" -#include "player/player-class.h" +#include "realm/realm-types.h" #include "player/player-personality.h" #include "player/race-info-table.h" #include "player/special-defense-types.h" diff --git a/src/player-ability/player-wisdom.cpp b/src/player-ability/player-wisdom.cpp index dd979c5a8..b05a04446 100644 --- a/src/player-ability/player-wisdom.cpp +++ b/src/player-ability/player-wisdom.cpp @@ -1,8 +1,8 @@ #include "player-ability/player-wisdom.h" #include "mutation/mutation-flag-types.h" #include "object/object-flags.h" +#include "player-info/class-info.h" #include "player-info/mimic-info-table.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/race-info-table.h" #include "player/special-defense-types.h" diff --git a/src/player/player-class.cpp b/src/player-info/class-info.cpp similarity index 99% rename from src/player/player-class.cpp rename to src/player-info/class-info.cpp index 9945887f2..6a450069f 100644 --- a/src/player/player-class.cpp +++ b/src/player-info/class-info.cpp @@ -4,7 +4,7 @@ * @author deskull */ -#include "player/player-class.h" +#include "player-info/class-info.h" #include "core/player-redraw-types.h" #include "inventory/inventory-slot-types.h" #include "player-info/race-info.h" @@ -16,7 +16,7 @@ const player_magic *mp_ptr; std::vector m_info; -const player_class *cp_ptr; +const player_class_info *cp_ptr; /*! * @brief 職業情報 / @@ -30,7 +30,7 @@ const player_class *cp_ptr; * HD, Exp, pet_upkeep_div * */ -const player_class class_info[MAX_CLASS] = { +const player_class_info class_info[MAX_CLASS] = { { #ifdef JP "戦士", diff --git a/src/player-info/class-info.h b/src/player-info/class-info.h new file mode 100644 index 000000000..39678c820 --- /dev/null +++ b/src/player-info/class-info.h @@ -0,0 +1,78 @@ +#pragma once + +/* 人畜無害なenumヘッダを先に読み込む */ +#include "system/angband.h" + +#include "object/tval-types.h" +#include "player-info/class-types.h" +#include "realm/realm-types.h" +#include "spell/technic-info-table.h" + +#include +#include + +/** m_info.txtでMPの無い職業に設定される */ +#define SPELL_FIRST_NO_SPELL 99 + +/* + * Information about the player's "magic" + * + * Note that a player with a "spell_book" of "zero" is illiterate. + */ + +struct player_magic { + tval_type spell_book{}; /* Tval of spell books (if any) */ + BIT_FLAGS8 spell_xtra{}; /* Something for later */ + + int spell_stat{}; /* Stat for spells (if any) */ + int spell_type{}; /* Spell type (mage/priest) */ + + int spell_first{}; /* Level of first spell */ + int spell_weight{}; /* Weight that hurts spells */ + + magic_type info[MAX_MAGIC][32]{}; /* The available spells */ +}; + +extern std::vector m_info; +extern const player_magic *mp_ptr; + +struct player_class_info { + concptr title; /* Type of class */ + +#ifdef JP + concptr E_title; /* 英語職業 */ +#endif + int16_t c_adj[6]; /* Class stat modifier */ + + int16_t c_dis; /* class disarming */ + int16_t c_dev; /* class magic devices */ + int16_t c_sav; /* class saving throws */ + int16_t c_stl; /* class stealth */ + int16_t c_srh; /* class searching ability */ + int16_t c_fos; /* class searching frequency */ + int16_t c_thn; /* class to hit (normal) */ + int16_t c_thb; /* class to hit (bows) */ + + int16_t x_dis; /* extra disarming */ + int16_t x_dev; /* extra magic devices */ + int16_t x_sav; /* extra saving throws */ + int16_t x_stl; /* extra stealth */ + int16_t x_srh; /* extra searching ability */ + int16_t x_fos; /* extra searching frequency */ + int16_t x_thn; /* extra to hit (normal) */ + int16_t x_thb; /* extra to hit (bows) */ + + int16_t c_mhp; /* Class hit-dice adjustment */ + int16_t c_exp; /* Class experience factor */ + + byte pet_upkeep_div; /* Pet upkeep divider */ + + int num; + int wgt; + int mul; +}; + +extern const player_class_info *cp_ptr; +extern const player_class_info class_info[MAX_CLASS]; + +extern const concptr player_title[MAX_CLASS][10]; diff --git a/src/player/player-class-types.h b/src/player-info/class-types.h similarity index 100% rename from src/player/player-class-types.h rename to src/player-info/class-types.h diff --git a/src/player-info/race-info.h b/src/player-info/race-info.h index 8c9b74489..13c21102b 100644 --- a/src/player-info/race-info.h +++ b/src/player-info/race-info.h @@ -7,8 +7,8 @@ #include "object-enchant/tr-flags.h" #include "object-enchant/tr-types.h" #include "player-ability/player-ability-types.h" +#include "player-info/class-types.h" #include "player-info/race-types.h" -#include "player/player-class-types.h" #include "system/angband.h" /* diff --git a/src/player-status/player-basic-statistics.cpp b/src/player-status/player-basic-statistics.cpp index 2283f4954..9001f6fd1 100644 --- a/src/player-status/player-basic-statistics.cpp +++ b/src/player-status/player-basic-statistics.cpp @@ -4,8 +4,8 @@ #include "core/window-redrawer.h" #include "mutation/mutation-flag-types.h" #include "object/object-flags.h" +#include "player-info/class-info.h" #include "player-info/mimic-info-table.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-status.h" #include "player/race-info-table.h" @@ -64,7 +64,7 @@ int16_t PlayerBasicStatistics::race_value() */ int16_t PlayerBasicStatistics::class_value() { - const player_class *c_ptr = &class_info[this->owner_ptr->pclass]; + const player_class_info *c_ptr = &class_info[this->owner_ptr->pclass]; return c_ptr->c_adj[this->ability_type]; } diff --git a/src/player-status/player-stealth.cpp b/src/player-status/player-stealth.cpp index 303f60af7..1b60f395b 100644 --- a/src/player-status/player-stealth.cpp +++ b/src/player-status/player-stealth.cpp @@ -1,10 +1,10 @@ #include "player-status/player-stealth.h" #include "mind/mind-ninja.h" #include "mutation/mutation-flag-types.h" +#include "player-info/class-info.h" #include "player-info/equipment-info.h" #include "player-info/mimic-info-table.h" #include "player-info/race-types.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-skill.h" #include "player/player-status-flags.h" @@ -54,7 +54,7 @@ int16_t PlayerStealth::personality_value() */ int16_t PlayerStealth::class_base_value() { - const player_class *c_ptr = &class_info[this->owner_ptr->pclass]; + const player_class_info *c_ptr = &class_info[this->owner_ptr->pclass]; return c_ptr->c_stl + (c_ptr->x_stl * this->owner_ptr->lev / 10); } diff --git a/src/player/patron.cpp b/src/player/patron.cpp index ad6ed16e9..1e1262fb6 100644 --- a/src/player/patron.cpp +++ b/src/player/patron.cpp @@ -13,9 +13,9 @@ #include "mutation/mutation-investor-remover.h" #include "object-enchant/object-curse.h" #include "object/object-kind-hook.h" +#include "player-info/class-info.h" #include "player-info/equipment-info.h" #include "player-info/race-types.h" -#include "player/player-class.h" #include "player/player-damage.h" #include "spell-kind/spells-floor.h" #include "spell-kind/spells-genocide.h" diff --git a/src/player/player-class.h b/src/player/player-class.h deleted file mode 100644 index 0afd2566f..000000000 --- a/src/player/player-class.h +++ /dev/null @@ -1,85 +0,0 @@ -#pragma once - -/* 人畜無害なenumヘッダを先に読み込む */ -#include "system/angband.h" - -#include "object/tval-types.h" -#include "player/player-class-types.h" -#include "realm/realm-types.h" -#include "spell/technic-info-table.h" - -#include -#include - -/** m_info.txtでMPの無い職業に設定される */ -#define SPELL_FIRST_NO_SPELL 99 - -/* - * Information about the player's "magic" - * - * Note that a player with a "spell_book" of "zero" is illiterate. - */ - -typedef struct player_magic { - tval_type spell_book{}; /* Tval of spell books (if any) */ - BIT_FLAGS8 spell_xtra{}; /* Something for later */ - - int spell_stat{}; /* Stat for spells (if any) */ - int spell_type{}; /* Spell type (mage/priest) */ - - int spell_first{}; /* Level of first spell */ - int spell_weight{}; /* Weight that hurts spells */ - - magic_type info[MAX_MAGIC][32]{}; /* The available spells */ -} player_magic; - -extern std::vector m_info; -extern const player_magic *mp_ptr; - -/* - * Player class info - */ - -typedef struct player_class player_class; - -struct player_class -{ - concptr title; /* Type of class */ - -#ifdef JP - concptr E_title; /* 英語職業 */ -#endif - int16_t c_adj[6]; /* Class stat modifier */ - - int16_t c_dis; /* class disarming */ - int16_t c_dev; /* class magic devices */ - int16_t c_sav; /* class saving throws */ - int16_t c_stl; /* class stealth */ - int16_t c_srh; /* class searching ability */ - int16_t c_fos; /* class searching frequency */ - int16_t c_thn; /* class to hit (normal) */ - int16_t c_thb; /* class to hit (bows) */ - - int16_t x_dis; /* extra disarming */ - int16_t x_dev; /* extra magic devices */ - int16_t x_sav; /* extra saving throws */ - int16_t x_stl; /* extra stealth */ - int16_t x_srh; /* extra searching ability */ - int16_t x_fos; /* extra searching frequency */ - int16_t x_thn; /* extra to hit (normal) */ - int16_t x_thb; /* extra to hit (bows) */ - - int16_t c_mhp; /* Class hit-dice adjustment */ - int16_t c_exp; /* Class experience factor */ - - byte pet_upkeep_div; /* Pet upkeep divider */ - - int num; - int wgt; - int mul; -}; - -extern const player_class *cp_ptr; -extern const player_class class_info[MAX_CLASS]; - -extern const concptr player_title[MAX_CLASS][10]; diff --git a/src/player/player-damage.cpp b/src/player/player-damage.cpp index 90ad0c95c..8c1c504d5 100644 --- a/src/player/player-damage.cpp +++ b/src/player/player-damage.cpp @@ -43,8 +43,8 @@ #include "object/item-tester-hooker.h" #include "object/object-broken.h" #include "object/object-flags.h" +#include "player-info/class-info.h" #include "player-info/race-types.h" -#include "player/player-class.h" #include "player/player-personality-types.h" #include "player/player-status-flags.h" #include "player/player-status-resist.h" diff --git a/src/player/player-status-flags.cpp b/src/player/player-status-flags.cpp index 22136e36d..fd74c5562 100644 --- a/src/player/player-status-flags.cpp +++ b/src/player/player-status-flags.cpp @@ -12,6 +12,7 @@ #include "object-hook/hook-weapon.h" #include "object/object-flags.h" #include "player-base/player-race.h" +#include "player-info/class-info.h" #include "player-info/equipment-info.h" #include "player-info/mimic-info-table.h" #include "player-status/player-basic-statistics.h" @@ -21,7 +22,6 @@ #include "player-status/player-stealth.h" #include "player/attack-defense-types.h" #include "player/digestion-processor.h" -#include "player/player-class.h" #include "player/player-skill.h" #include "player/player-status.h" #include "player/race-info-table.h" diff --git a/src/player/player-status-resist.cpp b/src/player/player-status-resist.cpp index e66fe1e32..25d579b73 100644 --- a/src/player/player-status-resist.cpp +++ b/src/player/player-status-resist.cpp @@ -12,8 +12,8 @@ #include "object-hook/hook-weapon.h" #include "object/object-flags.h" #include "player-base/player-race.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "player/player-skill.h" #include "player/player-status-flags.h" #include "player/player-status.h" diff --git a/src/player/player-status.cpp b/src/player/player-status.cpp index 9a8d6de2c..895f8535d 100644 --- a/src/player/player-status.cpp +++ b/src/player/player-status.cpp @@ -56,6 +56,7 @@ #include "pet/pet-util.h" #include "player-base/player-race.h" #include "player-info/alignment.h" +#include "player-info/class-info.h" #include "player-info/equipment-info.h" #include "player-info/mimic-info-table.h" #include "player-status/player-basic-statistics.h" @@ -66,7 +67,6 @@ #include "player/attack-defense-types.h" #include "player/digestion-processor.h" #include "player/patron.h" -#include "player/player-class.h" #include "player/player-damage.h" #include "player/player-move.h" #include "player/player-personality-types.h" @@ -1061,7 +1061,7 @@ static ACTION_SKILL_POWER calc_disarming(player_type *creature_ptr) tmp_rp_ptr = &mimic_info[creature_ptr->mimic_form]; else tmp_rp_ptr = &race_info[enum2i(creature_ptr->prace)]; - const player_class *c_ptr = &class_info[creature_ptr->pclass]; + const player_class_info *c_ptr = &class_info[creature_ptr->pclass]; const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku]; pow = tmp_rp_ptr->r_dis + c_ptr->c_dis + a_ptr->a_dis; @@ -1091,7 +1091,7 @@ static ACTION_SKILL_POWER calc_device_ability(player_type *creature_ptr) tmp_rp_ptr = &mimic_info[creature_ptr->mimic_form]; else tmp_rp_ptr = &race_info[enum2i(creature_ptr->prace)]; - const player_class *c_ptr = &class_info[creature_ptr->pclass]; + const player_class_info *c_ptr = &class_info[creature_ptr->pclass]; const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku]; pow = tmp_rp_ptr->r_dev + c_ptr->c_dev + a_ptr->a_dev; @@ -1141,7 +1141,7 @@ static ACTION_SKILL_POWER calc_saving_throw(player_type *creature_ptr) tmp_rp_ptr = &mimic_info[creature_ptr->mimic_form]; else tmp_rp_ptr = &race_info[enum2i(creature_ptr->prace)]; - const player_class *c_ptr = &class_info[creature_ptr->pclass]; + const player_class_info *c_ptr = &class_info[creature_ptr->pclass]; const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku]; pow = tmp_rp_ptr->r_sav + c_ptr->c_sav + a_ptr->a_sav; @@ -1196,7 +1196,7 @@ static ACTION_SKILL_POWER calc_search(player_type *creature_ptr) tmp_rp_ptr = &mimic_info[creature_ptr->mimic_form]; else tmp_rp_ptr = &race_info[enum2i(creature_ptr->prace)]; - const player_class *c_ptr = &class_info[creature_ptr->pclass]; + const player_class_info *c_ptr = &class_info[creature_ptr->pclass]; const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku]; pow = tmp_rp_ptr->r_srh + c_ptr->c_srh + a_ptr->a_srh; @@ -1243,7 +1243,7 @@ static ACTION_SKILL_POWER calc_search_freq(player_type *creature_ptr) tmp_rp_ptr = &mimic_info[creature_ptr->mimic_form]; else tmp_rp_ptr = &race_info[enum2i(creature_ptr->prace)]; - const player_class *c_ptr = &class_info[creature_ptr->pclass]; + const player_class_info *c_ptr = &class_info[creature_ptr->pclass]; const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku]; pow = tmp_rp_ptr->r_fos + c_ptr->c_fos + a_ptr->a_fos; @@ -1281,7 +1281,7 @@ static ACTION_SKILL_POWER calc_to_hit_melee(player_type *creature_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; - const player_class *c_ptr = &class_info[creature_ptr->pclass]; + const player_class_info *c_ptr = &class_info[creature_ptr->pclass]; const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku]; if (creature_ptr->mimic_form) @@ -1305,7 +1305,7 @@ static ACTION_SKILL_POWER calc_to_hit_shoot(player_type *creature_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; - const player_class *c_ptr = &class_info[creature_ptr->pclass]; + const player_class_info *c_ptr = &class_info[creature_ptr->pclass]; const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku]; if (creature_ptr->mimic_form) @@ -1330,7 +1330,7 @@ static ACTION_SKILL_POWER calc_to_hit_throw(player_type *creature_ptr) { ACTION_SKILL_POWER pow; const player_race_info *tmp_rp_ptr; - const player_class *c_ptr = &class_info[creature_ptr->pclass]; + const player_class_info *c_ptr = &class_info[creature_ptr->pclass]; const player_personality *a_ptr = &personality_info[creature_ptr->pseikaku]; if (creature_ptr->mimic_form) diff --git a/src/player/process-death.cpp b/src/player/process-death.cpp index 2e01d7674..bfc3b7b3f 100644 --- a/src/player/process-death.cpp +++ b/src/player/process-death.cpp @@ -18,7 +18,7 @@ #include "object/item-tester-hooker.h" #include "object/item-use-flags.h" #include "perception/object-perception.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "store/store-util.h" #include "store/store.h" #include "system/floor-type-definition.h" diff --git a/src/racial/racial-switcher.cpp b/src/racial/racial-switcher.cpp index 3572e4bf7..2e558f7b4 100644 --- a/src/racial/racial-switcher.cpp +++ b/src/racial/racial-switcher.cpp @@ -46,13 +46,13 @@ #include "mind/stances-table.h" #include "mutation/mutation-flag-types.h" #include "object/item-tester-hooker.h" +#include "player-info/class-info.h" #include "player-info/equipment-info.h" #include "player-info/race-info.h" #include "player-info/race-types.h" #include "player-status/player-energy.h" #include "player-status/player-hand-types.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "player/player-damage.h" #include "player/player-status.h" #include "racial/racial-android.h" diff --git a/src/realm/realm-crusade.cpp b/src/realm/realm-crusade.cpp index 9f52f1604..098cacc48 100644 --- a/src/realm/realm-crusade.cpp +++ b/src/realm/realm-crusade.cpp @@ -7,7 +7,7 @@ #include "hpmp/hp-mp-processor.h" #include "monster-floor/monster-summon.h" #include "monster-floor/place-monster-types.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "spell-kind/spells-beam.h" #include "spell-kind/spells-curse-removal.h" #include "spell-kind/spells-detection.h" diff --git a/src/realm/realm-song.cpp b/src/realm/realm-song.cpp index 8b6c43a27..3ff4c6f45 100644 --- a/src/realm/realm-song.cpp +++ b/src/realm/realm-song.cpp @@ -5,8 +5,8 @@ #include "effect/effect-characteristics.h" #include "effect/effect-processor.h" #include "hpmp/hp-mp-processor.h" +#include "player-info/class-info.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "player/player-status.h" #include "realm/realm-song-numbers.h" #include "spell-kind/earthquake.h" diff --git a/src/realm/realm-trump.cpp b/src/realm/realm-trump.cpp index fb340c01f..23117a7ff 100644 --- a/src/realm/realm-trump.cpp +++ b/src/realm/realm-trump.cpp @@ -5,7 +5,7 @@ #include "game-option/input-options.h" #include "monster-floor/place-monster-types.h" #include "mutation/mutation-calculator.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "spell-kind/spells-detection.h" #include "spell-kind/spells-fetcher.h" #include "spell-kind/spells-launcher.h" diff --git a/src/specific-object/chest.cpp b/src/specific-object/chest.cpp index ac5857a4f..c6a481983 100644 --- a/src/specific-object/chest.cpp +++ b/src/specific-object/chest.cpp @@ -9,15 +9,15 @@ #include "monster-floor/place-monster-types.h" #include "object-enchant/item-apply-magic.h" #include "perception/object-perception.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-damage.h" #include "player/player-status-flags.h" #include "spell-kind/spells-equipment.h" #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-sight.h" +#include "spell/spell-types.h" #include "spell/spells-summon.h" #include "spell/summon-types.h" -#include "spell/spell-types.h" #include "status/bad-status-setter.h" #include "status/base-status.h" #include "status/element-resistance.h" @@ -31,321 +31,288 @@ #define SV_CHEST_MIN_LARGE 4 /*! -* @brief 箱からアイテムを引き出す / -* Allocates objects upon opening a chest -BEN- -* @param scatter TRUEならばトラップによるアイテムの拡散処理 -* @param y 箱の存在するマスのY座標 -* @param x 箱の存在するマスのX座標 -* @param o_idx 箱のオブジェクトID -* @return なし -* @details -*
-* Disperse treasures from the given chest, centered at (x,y).
-*
-* Small chests often contain "gold", while Large chests always contain
-* items.  Wooden chests contain 2 items, Iron chests contain 4 items,
-* and Steel chests contain 6 items.  The "value" of the items in a
-* chest is based on the "power" of the chest, which is in turn based
-* on the level on which the chest is generated.
-* 
-*/ + * @brief 箱からアイテムを引き出す / + * Allocates objects upon opening a chest -BEN- + * @param scatter TRUEならばトラップによるアイテムの拡散処理 + * @param y 箱の存在するマスのY座標 + * @param x 箱の存在するマスのX座標 + * @param o_idx 箱のオブジェクトID + * @return なし + * @details + *
+ * Disperse treasures from the given chest, centered at (x,y).
+ *
+ * Small chests often contain "gold", while Large chests always contain
+ * items.  Wooden chests contain 2 items, Iron chests contain 4 items,
+ * and Steel chests contain 6 items.  The "value" of the items in a
+ * chest is based on the "power" of the chest, which is in turn based
+ * on the level on which the chest is generated.
+ * 
+ */ void chest_death(player_type *owner_ptr, bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx) { - int number; + int number; - bool small; - BIT_FLAGS mode = AM_GOOD | AM_FORBID_CHEST; + bool small; + BIT_FLAGS mode = AM_GOOD | AM_FORBID_CHEST; - object_type forge; - object_type *q_ptr; + object_type forge; + object_type *q_ptr; - floor_type *floor_ptr = owner_ptr->current_floor_ptr; - object_type *o_ptr = &floor_ptr->o_list[o_idx]; + floor_type *floor_ptr = owner_ptr->current_floor_ptr; + object_type *o_ptr = &floor_ptr->o_list[o_idx]; - /* Small chests often hold "gold" */ - small = (o_ptr->sval < SV_CHEST_MIN_LARGE); + /* Small chests often hold "gold" */ + small = (o_ptr->sval < SV_CHEST_MIN_LARGE); - /* Determine how much to drop (see above) */ - number = (o_ptr->sval % SV_CHEST_MIN_LARGE) * 2; + /* Determine how much to drop (see above) */ + number = (o_ptr->sval % SV_CHEST_MIN_LARGE) * 2; - if (o_ptr->sval == SV_CHEST_KANDUME) - { - number = 5; - small = false; - mode |= AM_GREAT; - floor_ptr->object_level = o_ptr->xtra3; - } - else - { - /* Determine the "value" of the items */ - floor_ptr->object_level = ABS(o_ptr->pval) + 10; - } + if (o_ptr->sval == SV_CHEST_KANDUME) { + number = 5; + small = false; + mode |= AM_GREAT; + floor_ptr->object_level = o_ptr->xtra3; + } else { + /* Determine the "value" of the items */ + floor_ptr->object_level = ABS(o_ptr->pval) + 10; + } - /* Zero pval means empty chest */ - if (!o_ptr->pval) number = 0; + /* Zero pval means empty chest */ + if (!o_ptr->pval) + number = 0; - - /* Drop some objects (non-chests) */ - for (; number > 0; --number) - { - q_ptr = &forge; + /* Drop some objects (non-chests) */ + for (; number > 0; --number) { + q_ptr = &forge; q_ptr->wipe(); - /* Small chests often drop gold */ - if (small && (randint0(100) < 25)) - { - /* Make some gold */ - if (!make_gold(owner_ptr, q_ptr)) continue; - } - - /* Otherwise drop an item */ - else - { - /* Make a good object */ - if (!make_object(owner_ptr, q_ptr, mode)) continue; - } - - /* If chest scatters its contents, pick any floor square. */ - if (scatter) - { - int i; - for (i = 0; i < 200; i++) - { - /* Pick a totally random spot. */ - y = randint0(MAX_HGT); - x = randint0(MAX_WID); - - /* Must be an empty floor. */ - if (!is_cave_empty_bold(owner_ptr, y, x)) continue; - - /* Place the object there. */ - (void)drop_near(owner_ptr, q_ptr, -1, y, x); - - /* Done. */ - break; - } - } - /* Normally, drop object near the chest. */ - else (void)drop_near(owner_ptr, q_ptr, -1, y, x); - } - - /* Reset the object level */ - floor_ptr->object_level = floor_ptr->base_level; - - /* Empty */ - o_ptr->pval = 0; - - /* Known */ - object_known(o_ptr); + /* Small chests often drop gold */ + if (small && (randint0(100) < 25)) { + /* Make some gold */ + if (!make_gold(owner_ptr, q_ptr)) + continue; + } + + /* Otherwise drop an item */ + else { + /* Make a good object */ + if (!make_object(owner_ptr, q_ptr, mode)) + continue; + } + + /* If chest scatters its contents, pick any floor square. */ + if (scatter) { + int i; + for (i = 0; i < 200; i++) { + /* Pick a totally random spot. */ + y = randint0(MAX_HGT); + x = randint0(MAX_WID); + + /* Must be an empty floor. */ + if (!is_cave_empty_bold(owner_ptr, y, x)) + continue; + + /* Place the object there. */ + (void)drop_near(owner_ptr, q_ptr, -1, y, x); + + /* Done. */ + break; + } + } + /* Normally, drop object near the chest. */ + else + (void)drop_near(owner_ptr, q_ptr, -1, y, x); + } + + /* Reset the object level */ + floor_ptr->object_level = floor_ptr->base_level; + + /* Empty */ + o_ptr->pval = 0; + + /* Known */ + object_known(o_ptr); } - /*! -* @brief 箱のトラップ処理 / -* Chests have traps too. -* @param y 箱の存在するマスのY座標 -* @param x 箱の存在するマスのX座標 -* @param o_idx 箱のオブジェクトID -* @return なし -* @details -*
-* Exploding chest destroys contents (and traps).
-* Note that the chest itself is never destroyed.
-* 
-*/ + * @brief 箱のトラップ処理 / + * Chests have traps too. + * @param y 箱の存在するマスのY座標 + * @param x 箱の存在するマスのX座標 + * @param o_idx 箱のオブジェクトID + * @return なし + * @details + *
+ * Exploding chest destroys contents (and traps).
+ * Note that the chest itself is never destroyed.
+ * 
+ */ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx) { - int i, trap; - - object_type *o_ptr = &target_ptr->current_floor_ptr->o_list[o_idx]; - - int mon_level = o_ptr->xtra3; - - /* Ignore disarmed chests */ - if (o_ptr->pval <= 0) return; - - /* Obtain the traps */ - trap = chest_traps[o_ptr->pval]; - - /* Lose strength */ - if (trap & (CHEST_LOSE_STR)) - { - msg_print(_("仕掛けられていた小さな針に刺されてしまった!", "A small needle has pricked you!")); - take_hit(target_ptr, DAMAGE_NOESCAPE, damroll(1, 4), _("毒針", "a poison needle")); - (void)do_dec_stat(target_ptr, A_STR); - } - - /* Lose constitution */ - if (trap & (CHEST_LOSE_CON)) - { - msg_print(_("仕掛けられていた小さな針に刺されてしまった!", "A small needle has pricked you!")); - take_hit(target_ptr, DAMAGE_NOESCAPE, damroll(1, 4), _("毒針", "a poison needle")); - (void)do_dec_stat(target_ptr, A_CON); - } - - /* Poison */ - if (trap & (CHEST_POISON)) - { - msg_print(_("突如吹き出した緑色のガスに包み込まれた!", "A puff of green gas surrounds you!")); - if (!(has_resist_pois(target_ptr) || is_oppose_pois(target_ptr))) - { - (void)set_poisoned(target_ptr, target_ptr->poisoned + 10 + randint1(20)); - } - } - - /* Paralyze */ - if (trap & (CHEST_PARALYZE)) - { - msg_print(_("突如吹き出した黄色いガスに包み込まれた!", "A puff of yellow gas surrounds you!")); - if (!target_ptr->free_act) - { - (void)set_paralyzed(target_ptr, target_ptr->paralyzed + 10 + randint1(20)); - } - } - - /* Summon monsters */ - if (trap & (CHEST_SUMMON)) - { - int num = 2 + randint1(3); - msg_print(_("突如吹き出した煙に包み込まれた!", "You are enveloped in a cloud of smoke!")); - for (i = 0; i < num; i++) - { - if (randint1(100)current_floor_ptr->dun_level) - activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, false); - else - (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_NONE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); - } - } - - /* Elemental summon. */ - if (trap & (CHEST_E_SUMMON)) - { - msg_print(_("宝を守るためにエレメンタルが現れた!", "Elemental beings appear to protect their treasures!")); - for (i = 0; i < randint1(3) + 5; i++) - { - (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); - } - } - - /* Force clouds, then summon birds. */ - if (trap & (CHEST_BIRD_STORM)) - { - msg_print(_("鳥の群れがあなたを取り巻いた!", "A storm of birds swirls around you!")); - - for (i = 0; i < randint1(3) + 3; i++) - (void)fire_meteor(target_ptr, -1, GF_FORCE, y, x, o_ptr->pval / 5, 7); - - for (i = 0; i < randint1(5) + o_ptr->pval / 5; i++) - { - (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_BIRD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); - } - } - - /* Various colorful summonings. */ - if (trap & (CHEST_H_SUMMON)) - { - /* Summon demons. */ - if (one_in_(4)) - { - msg_print(_("炎と硫黄の雲の中に悪魔が姿を現した!", "Demons materialize in clouds of fire and brimstone!")); - for (i = 0; i < randint1(3) + 2; i++) - { - (void)fire_meteor(target_ptr, -1, GF_FIRE, y, x, 10, 5); - (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); - } - } - - /* Summon dragons. */ - else if (one_in_(3)) - { - msg_print(_("暗闇にドラゴンの影がぼんやりと現れた!", "Draconic forms loom out of the darkness!")); - for (i = 0; i < randint1(3) + 2; i++) - { - (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); - } - } - - /* Summon hybrids. */ - else if (one_in_(2)) - { - msg_print(_("奇妙な姿の怪物が襲って来た!", "Creatures strange and twisted assault you!")); - for (i = 0; i < randint1(5) + 3; i++) - { - (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_HYBRID, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); - } - } - - /* Summon vortices (scattered) */ - else - { - msg_print(_("渦巻が合体し、破裂した!", "Vortices coalesce and wreak destruction!")); - for (i = 0; i < randint1(3) + 2; i++) - { - (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_VORTEX, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); - } - } - } - - /* Dispel player. */ - if ((trap & (CHEST_RUNES_OF_EVIL)) && o_ptr->k_idx) - { - /* Determine how many nasty tricks can be played. */ - int nasty_tricks_count = 4 + randint0(3); - - msg_print(_("恐ろしい声が響いた: 「暗闇が汝をつつまん!」", "Hideous voices bid: 'Let the darkness have thee!'")); - /* This is gonna hurt... */ - for (; nasty_tricks_count > 0; nasty_tricks_count--) - { - /* ...but a high saving throw does help a little. */ - if (randint1(100 + o_ptr->pval * 2) > target_ptr->skill_sav) - { - if (one_in_(6)) take_hit(target_ptr, DAMAGE_NOESCAPE, damroll(5, 20), _("破滅のトラップの宝箱", "a chest dispel-player trap")); - else if (one_in_(5)) (void)set_cut(target_ptr,target_ptr->cut + 200); - else if (one_in_(4)) - { - if (!target_ptr->free_act) - (void)set_paralyzed(target_ptr, target_ptr->paralyzed + 2 + - randint0(6)); - else - (void)set_stun(target_ptr, target_ptr->stun + 10 + - randint0(100)); - } - else if (one_in_(3)) apply_disenchant(target_ptr, 0); - else if (one_in_(2)) - { - (void)do_dec_stat(target_ptr, A_STR); - (void)do_dec_stat(target_ptr, A_DEX); - (void)do_dec_stat(target_ptr, A_CON); - (void)do_dec_stat(target_ptr, A_INT); - (void)do_dec_stat(target_ptr, A_WIS); - (void)do_dec_stat(target_ptr, A_CHR); - } - else (void)fire_meteor(target_ptr, -1, GF_NETHER, y, x, 150, 1); - } - } - } - - /* Aggravate monsters. */ - if (trap & (CHEST_ALARM)) - { - msg_print(_("けたたましい音が鳴り響いた!", "An alarm sounds!")); - aggravate_monsters(target_ptr, 0); - } - - /* Explode */ - if ((trap & (CHEST_EXPLODE)) && o_ptr->k_idx) - { - msg_print(_("突然、箱が爆発した!", "There is a sudden explosion!")); - msg_print(_("箱の中の物はすべて粉々に砕け散った!", "Everything inside the chest is destroyed!")); - o_ptr->pval = 0; - sound(SOUND_EXPLODE); - take_hit(target_ptr, DAMAGE_ATTACK, damroll(5, 8), _("爆発する箱", "an exploding chest")); - } - /* Scatter contents. */ - if ((trap & (CHEST_SCATTER)) && o_ptr->k_idx) - { - msg_print(_("宝箱の中身はダンジョンじゅうに散乱した!", "The contents of the chest scatter all over the dungeon!")); - chest_death(target_ptr, true, y, x, o_idx); - o_ptr->pval = 0; - } + int i, trap; + + object_type *o_ptr = &target_ptr->current_floor_ptr->o_list[o_idx]; + + int mon_level = o_ptr->xtra3; + + /* Ignore disarmed chests */ + if (o_ptr->pval <= 0) + return; + + /* Obtain the traps */ + trap = chest_traps[o_ptr->pval]; + + /* Lose strength */ + if (trap & (CHEST_LOSE_STR)) { + msg_print(_("仕掛けられていた小さな針に刺されてしまった!", "A small needle has pricked you!")); + take_hit(target_ptr, DAMAGE_NOESCAPE, damroll(1, 4), _("毒針", "a poison needle")); + (void)do_dec_stat(target_ptr, A_STR); + } + + /* Lose constitution */ + if (trap & (CHEST_LOSE_CON)) { + msg_print(_("仕掛けられていた小さな針に刺されてしまった!", "A small needle has pricked you!")); + take_hit(target_ptr, DAMAGE_NOESCAPE, damroll(1, 4), _("毒針", "a poison needle")); + (void)do_dec_stat(target_ptr, A_CON); + } + + /* Poison */ + if (trap & (CHEST_POISON)) { + msg_print(_("突如吹き出した緑色のガスに包み込まれた!", "A puff of green gas surrounds you!")); + if (!(has_resist_pois(target_ptr) || is_oppose_pois(target_ptr))) { + (void)set_poisoned(target_ptr, target_ptr->poisoned + 10 + randint1(20)); + } + } + + /* Paralyze */ + if (trap & (CHEST_PARALYZE)) { + msg_print(_("突如吹き出した黄色いガスに包み込まれた!", "A puff of yellow gas surrounds you!")); + if (!target_ptr->free_act) { + (void)set_paralyzed(target_ptr, target_ptr->paralyzed + 10 + randint1(20)); + } + } + + /* Summon monsters */ + if (trap & (CHEST_SUMMON)) { + int num = 2 + randint1(3); + msg_print(_("突如吹き出した煙に包み込まれた!", "You are enveloped in a cloud of smoke!")); + for (i = 0; i < num; i++) { + if (randint1(100) < target_ptr->current_floor_ptr->dun_level) + activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, false); + else + (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_NONE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + } + } + + /* Elemental summon. */ + if (trap & (CHEST_E_SUMMON)) { + msg_print(_("宝を守るためにエレメンタルが現れた!", "Elemental beings appear to protect their treasures!")); + for (i = 0; i < randint1(3) + 5; i++) { + (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + } + } + + /* Force clouds, then summon birds. */ + if (trap & (CHEST_BIRD_STORM)) { + msg_print(_("鳥の群れがあなたを取り巻いた!", "A storm of birds swirls around you!")); + + for (i = 0; i < randint1(3) + 3; i++) + (void)fire_meteor(target_ptr, -1, GF_FORCE, y, x, o_ptr->pval / 5, 7); + + for (i = 0; i < randint1(5) + o_ptr->pval / 5; i++) { + (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_BIRD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + } + } + + /* Various colorful summonings. */ + if (trap & (CHEST_H_SUMMON)) { + /* Summon demons. */ + if (one_in_(4)) { + msg_print(_("炎と硫黄の雲の中に悪魔が姿を現した!", "Demons materialize in clouds of fire and brimstone!")); + for (i = 0; i < randint1(3) + 2; i++) { + (void)fire_meteor(target_ptr, -1, GF_FIRE, y, x, 10, 5); + (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + } + } + + /* Summon dragons. */ + else if (one_in_(3)) { + msg_print(_("暗闇にドラゴンの影がぼんやりと現れた!", "Draconic forms loom out of the darkness!")); + for (i = 0; i < randint1(3) + 2; i++) { + (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + } + } + + /* Summon hybrids. */ + else if (one_in_(2)) { + msg_print(_("奇妙な姿の怪物が襲って来た!", "Creatures strange and twisted assault you!")); + for (i = 0; i < randint1(5) + 3; i++) { + (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_HYBRID, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + } + } + + /* Summon vortices (scattered) */ + else { + msg_print(_("渦巻が合体し、破裂した!", "Vortices coalesce and wreak destruction!")); + for (i = 0; i < randint1(3) + 2; i++) { + (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_VORTEX, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + } + } + } + + /* Dispel player. */ + if ((trap & (CHEST_RUNES_OF_EVIL)) && o_ptr->k_idx) { + /* Determine how many nasty tricks can be played. */ + int nasty_tricks_count = 4 + randint0(3); + + msg_print(_("恐ろしい声が響いた: 「暗闇が汝をつつまん!」", "Hideous voices bid: 'Let the darkness have thee!'")); + /* This is gonna hurt... */ + for (; nasty_tricks_count > 0; nasty_tricks_count--) { + /* ...but a high saving throw does help a little. */ + if (randint1(100 + o_ptr->pval * 2) > target_ptr->skill_sav) { + if (one_in_(6)) + take_hit(target_ptr, DAMAGE_NOESCAPE, damroll(5, 20), _("破滅のトラップの宝箱", "a chest dispel-player trap")); + else if (one_in_(5)) + (void)set_cut(target_ptr, target_ptr->cut + 200); + else if (one_in_(4)) { + if (!target_ptr->free_act) + (void)set_paralyzed(target_ptr, target_ptr->paralyzed + 2 + randint0(6)); + else + (void)set_stun(target_ptr, target_ptr->stun + 10 + randint0(100)); + } else if (one_in_(3)) + apply_disenchant(target_ptr, 0); + else if (one_in_(2)) { + (void)do_dec_stat(target_ptr, A_STR); + (void)do_dec_stat(target_ptr, A_DEX); + (void)do_dec_stat(target_ptr, A_CON); + (void)do_dec_stat(target_ptr, A_INT); + (void)do_dec_stat(target_ptr, A_WIS); + (void)do_dec_stat(target_ptr, A_CHR); + } else + (void)fire_meteor(target_ptr, -1, GF_NETHER, y, x, 150, 1); + } + } + } + + /* Aggravate monsters. */ + if (trap & (CHEST_ALARM)) { + msg_print(_("けたたましい音が鳴り響いた!", "An alarm sounds!")); + aggravate_monsters(target_ptr, 0); + } + + /* Explode */ + if ((trap & (CHEST_EXPLODE)) && o_ptr->k_idx) { + msg_print(_("突然、箱が爆発した!", "There is a sudden explosion!")); + msg_print(_("箱の中の物はすべて粉々に砕け散った!", "Everything inside the chest is destroyed!")); + o_ptr->pval = 0; + sound(SOUND_EXPLODE); + take_hit(target_ptr, DAMAGE_ATTACK, damroll(5, 8), _("爆発する箱", "an exploding chest")); + } + /* Scatter contents. */ + if ((trap & (CHEST_SCATTER)) && o_ptr->k_idx) { + msg_print(_("宝箱の中身はダンジョンじゅうに散乱した!", "The contents of the chest scatter all over the dungeon!")); + chest_death(target_ptr, true, y, x, o_idx); + o_ptr->pval = 0; + } } diff --git a/src/spell-realm/spells-chaos.cpp b/src/spell-realm/spells-chaos.cpp index 3d24cbafc..87dc9f2d7 100644 --- a/src/spell-realm/spells-chaos.cpp +++ b/src/spell-realm/spells-chaos.cpp @@ -12,7 +12,7 @@ #include "monster/monster-describer.h" #include "monster/monster-status-setter.h" #include "monster/monster-status.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-damage.h" #include "spell-kind/spells-floor.h" #include "spell-kind/spells-launcher.h" diff --git a/src/spell/spell-info.cpp b/src/spell/spell-info.cpp index ed541cb54..9ba60e9de 100644 --- a/src/spell/spell-info.cpp +++ b/src/spell/spell-info.cpp @@ -1,7 +1,7 @@ #include "spell/spell-info.h" #include "io/input-key-requester.h" #include "monster-race/monster-race.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-skill.h" #include "player/player-status-table.h" #include "player/player-status.h" diff --git a/src/spell/spells-diceroll.cpp b/src/spell/spells-diceroll.cpp index f0758f2ff..cfa39b1a8 100644 --- a/src/spell/spells-diceroll.cpp +++ b/src/spell/spells-diceroll.cpp @@ -1,13 +1,13 @@ #include "spell/spells-diceroll.h" +#include "monster-race/monster-race-hook.h" #include "monster-race/monster-race.h" #include "monster-race/race-flags-resistance.h" #include "monster-race/race-flags1.h" #include "monster-race/race-flags3.h" #include "monster-race/race-flags7.h" -#include "monster-race/monster-race-hook.h" #include "monster/monster-flag-types.h" #include "monster/monster-info.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-status-table.h" #include "room/rooms-builder.h" #include "system/floor-type-definition.h" @@ -23,28 +23,31 @@ */ bool common_saving_throw_charm(player_type *operator_ptr, HIT_POINT pow, monster_type *m_ptr) { - monster_race *r_ptr = &r_info[m_ptr->r_idx]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; - if (operator_ptr->current_floor_ptr->inside_arena) return true; + if (operator_ptr->current_floor_ptr->inside_arena) + return true; - /* Memorize a flag */ - if (r_ptr->flagsr & RFR_RES_ALL) - { - if (is_original_ap_and_seen(operator_ptr, m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL); - return true; - } + /* Memorize a flag */ + if (r_ptr->flagsr & RFR_RES_ALL) { + if (is_original_ap_and_seen(operator_ptr, m_ptr)) + r_ptr->r_flagsr |= (RFR_RES_ALL); + return true; + } - if (r_ptr->flags3 & RF3_NO_CONF) - { - if (is_original_ap_and_seen(operator_ptr, m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF); - return true; - } + if (r_ptr->flags3 & RF3_NO_CONF) { + if (is_original_ap_and_seen(operator_ptr, m_ptr)) + r_ptr->r_flags3 |= (RF3_NO_CONF); + return true; + } - if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2.has(MFLAG2::NOPET)) return true; + if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2.has(MFLAG2::NOPET)) + return true; - pow += (adj_chr_chm[operator_ptr->stat_index[A_CHR]] - 1); - if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3; - return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5); + pow += (adj_chr_chm[operator_ptr->stat_index[A_CHR]] - 1); + if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) + pow = pow * 2 / 3; + return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5); } /*! @@ -55,37 +58,40 @@ bool common_saving_throw_charm(player_type *operator_ptr, HIT_POINT pow, monster */ bool common_saving_throw_control(player_type *operator_ptr, HIT_POINT pow, monster_type *m_ptr) { - monster_race *r_ptr = &r_info[m_ptr->r_idx]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; - if (operator_ptr->current_floor_ptr->inside_arena) return true; + if (operator_ptr->current_floor_ptr->inside_arena) + return true; - /* Memorize a flag */ - if (r_ptr->flagsr & RFR_RES_ALL) - { - if (is_original_ap_and_seen(operator_ptr, m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL); - return true; - } + /* Memorize a flag */ + if (r_ptr->flagsr & RFR_RES_ALL) { + if (is_original_ap_and_seen(operator_ptr, m_ptr)) + r_ptr->r_flagsr |= (RFR_RES_ALL); + return true; + } - if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2.has(MFLAG2::NOPET)) return true; + if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2.has(MFLAG2::NOPET)) + return true; - pow += adj_chr_chm[operator_ptr->stat_index[A_CHR]] - 1; - if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3; - return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5); + pow += adj_chr_chm[operator_ptr->stat_index[A_CHR]] - 1; + if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) + pow = pow * 2 / 3; + return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5); } /*! -* @brief 一部ボルト魔法のビーム化確率を算出する / Prepare standard probability to become beam for fire_bolt_or_beam() -* @return ビーム化確率(%) -* @details -* ハードコーティングによる実装が行われている。 -* メイジは(レベル)%、ハイメイジ、スペルマスターは(レベル)%、それ以外の職業は(レベル/2)% -*/ + * @brief 一部ボルト魔法のビーム化確率を算出する / Prepare standard probability to become beam for fire_bolt_or_beam() + * @return ビーム化確率(%) + * @details + * ハードコーティングによる実装が行われている。 + * メイジは(レベル)%、ハイメイジ、スペルマスターは(レベル)%、それ以外の職業は(レベル/2)% + */ PERCENTAGE beam_chance(player_type *caster_ptr) { - if (caster_ptr->pclass == CLASS_MAGE) - return (PERCENTAGE)(caster_ptr->lev); - if (caster_ptr->pclass == CLASS_HIGH_MAGE || caster_ptr->pclass == CLASS_SORCERER) - return (PERCENTAGE)(caster_ptr->lev + 10); + if (caster_ptr->pclass == CLASS_MAGE) + return (PERCENTAGE)(caster_ptr->lev); + if (caster_ptr->pclass == CLASS_HIGH_MAGE || caster_ptr->pclass == CLASS_SORCERER) + return (PERCENTAGE)(caster_ptr->lev + 10); - return (PERCENTAGE)(caster_ptr->lev / 2); + return (PERCENTAGE)(caster_ptr->lev / 2); } diff --git a/src/spell/spells-object.cpp b/src/spell/spells-object.cpp index f3ac25fab..790034087 100644 --- a/src/spell/spells-object.cpp +++ b/src/spell/spells-object.cpp @@ -31,7 +31,7 @@ #include "object/object-kind-hook.h" #include "object/object-kind.h" #include "perception/object-perception.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-damage.h" #include "racial/racial-android.h" #include "spell-kind/spells-perception.h" diff --git a/src/spell/spells-status.cpp b/src/spell/spells-status.cpp index cfd971336..3ceef5a2d 100644 --- a/src/spell/spells-status.cpp +++ b/src/spell/spells-status.cpp @@ -28,9 +28,9 @@ #include "monster/monster-describer.h" #include "object/object-kind-hook.h" #include "object/object-kind.h" +#include "player-info/class-info.h" #include "player-status/player-energy.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" diff --git a/src/status/buff-setter.cpp b/src/status/buff-setter.cpp index c605d982e..a1567b8b7 100644 --- a/src/status/buff-setter.cpp +++ b/src/status/buff-setter.cpp @@ -8,9 +8,9 @@ #include "core/window-redrawer.h" #include "game-option/disturbance-options.h" #include "monster/monster-status-setter.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" #include "player/attack-defense-types.h" -#include "player/player-class.h" #include "player/player-status.h" #include "realm/realm-song-numbers.h" #include "spell-realm/spells-song.h" diff --git a/src/status/shape-changer.cpp b/src/status/shape-changer.cpp index f48a772c0..b2a36e90f 100644 --- a/src/status/shape-changer.cpp +++ b/src/status/shape-changer.cpp @@ -11,7 +11,7 @@ #include "grid/grid.h" #include "hpmp/hp-mp-processor.h" #include "mutation/mutation-investor-remover.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-damage.h" #include "player/player-personality.h" #include "player/player-sex.h" diff --git a/src/system/building-type-definition.h b/src/system/building-type-definition.h index 30447bc6f..a014b587e 100644 --- a/src/system/building-type-definition.h +++ b/src/system/building-type-definition.h @@ -2,8 +2,8 @@ /* 人畜無害なenumヘッダを先に読み込む */ #include "object/tval-types.h" +#include "player-info/class-types.h" #include "player-info/race-types.h" -#include "player/player-class-types.h" #include "realm/realm-types.h" #include "system/angband.h" diff --git a/src/system/player-type-definition.h b/src/system/player-type-definition.h index 2b29ee8ab..8bd54f46a 100644 --- a/src/system/player-type-definition.h +++ b/src/system/player-type-definition.h @@ -4,8 +4,8 @@ #include "object-enchant/trc-types.h" #include "object/tval-types.h" #include "player-ability/player-ability-types.h" +#include "player-info/class-types.h" #include "player-info/race-types.h" -#include "player/player-class-types.h" #include "player/player-personality-types.h" #include "player/player-sex.h" #include "system/angband.h" diff --git a/src/view/display-birth.cpp b/src/view/display-birth.cpp index 7649308ea..dc99c79bc 100644 --- a/src/view/display-birth.cpp +++ b/src/view/display-birth.cpp @@ -2,8 +2,8 @@ #include "birth/auto-roller.h" #include "birth/birth-stat.h" #include "game-option/birth-options.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-status.h" #include "system/player-type-definition.h" diff --git a/src/view/display-player-misc-info.cpp b/src/view/display-player-misc-info.cpp index 973f62ea0..5064fa3cc 100644 --- a/src/view/display-player-misc-info.cpp +++ b/src/view/display-player-misc-info.cpp @@ -1,5 +1,5 @@ -#include "player-info/mimic-info-table.h" -#include "player/player-class.h" +#include "player-info/class-info.h" +#include "player-info/mimic-info-table.h" #include "player/player-personality.h" #include "player/player-sex.h" #include "system/player-type-definition.h" diff --git a/src/view/display-player-stat-info.cpp b/src/view/display-player-stat-info.cpp index 2b623f3bc..03aa4659a 100644 --- a/src/view/display-player-stat-info.cpp +++ b/src/view/display-player-stat-info.cpp @@ -12,9 +12,9 @@ #include "object-enchant/tr-types.h" #include "object/object-flags.h" #include "player-base/player-race.h" +#include "player-info/class-info.h" #include "player-info/mimic-info-table.h" #include "player/permanent-resistances.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-status-table.h" #include "player/player-status.h" diff --git a/src/view/display-player.cpp b/src/view/display-player.cpp index d89cd2289..587f3cb2b 100644 --- a/src/view/display-player.cpp +++ b/src/view/display-player.cpp @@ -18,9 +18,9 @@ #include "object/object-info.h" #include "object/object-kind.h" #include "player-info/alignment.h" +#include "player-info/class-info.h" #include "player-info/mimic-info-table.h" #include "player/patron.h" -#include "player/player-class.h" #include "player/player-personality.h" #include "player/player-sex.h" #include "player/player-status-flags.h" diff --git a/src/view/display-scores.cpp b/src/view/display-scores.cpp index 665c0bc47..5d07bc875 100644 --- a/src/view/display-scores.cpp +++ b/src/view/display-scores.cpp @@ -2,7 +2,7 @@ #include "core/score-util.h" #include "io/files-util.h" #include "io/input-key-acceptor.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-personality.h" #include "player/race-info-table.h" #include "system/angband.h" @@ -37,15 +37,15 @@ void display_scores(int from, int to, int note, high_score *score) if (highscore_fd < 0) { return; } - + if (from < 0) { from = 0; } - + if (to < 0) { to = 10; } - + if (to > MAX_HISCORES) { to = MAX_HISCORES; } @@ -53,7 +53,7 @@ void display_scores(int from, int to, int note, high_score *score) if (highscore_seek(0)) { return; } - + auto num_scores = 0; high_score the_score; for (; num_scores < MAX_HISCORES; num_scores++) { @@ -104,7 +104,7 @@ void display_scores(int from, int to, int note, high_score *score) for (user = the_score.uid; iswspace(*user); user++) /* loop */ ; - concptr when; + concptr when; for (when = the_score.day; iswspace(*when); when++) /* loop */ ; @@ -142,7 +142,7 @@ void display_scores(int from, int to, int note, high_score *score) } else { sprintf(out_val, " "); } - + /* 死亡原因をオリジナルより細かく表示 */ if (streq(the_score.how, "yet")) { sprintf(out_val + 13, " まだ生きている (%d%s)", cdun, "階"); @@ -214,7 +214,7 @@ void display_scores(int from, int to) if (highscore_fd < 0) { quit(_("スコア・ファイルが使用できません。", "Score file unavailable.")); } - + term_clear(); display_scores(from, to, -1, nullptr); (void)fd_close(highscore_fd); diff --git a/src/window/display-sub-window-spells.cpp b/src/window/display-sub-window-spells.cpp index e3f0c6f1e..8db57e5af 100644 --- a/src/window/display-sub-window-spells.cpp +++ b/src/window/display-sub-window-spells.cpp @@ -5,7 +5,7 @@ #include "mind/mind-info.h" #include "mind/mind-sniper.h" #include "mind/mind-types.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "player/player-status-table.h" #include "realm/realm-names-table.h" #include "spell/spells-execution.h" diff --git a/src/window/main-window-left-frame.cpp b/src/window/main-window-left-frame.cpp index 352417b3f..4770ac113 100644 --- a/src/window/main-window-left-frame.cpp +++ b/src/window/main-window-left-frame.cpp @@ -4,8 +4,8 @@ #include "market/arena-info-table.h" #include "monster-race/monster-race.h" #include "monster/monster-status.h" +#include "player-info/class-info.h" #include "player-info/mimic-info-table.h" -#include "player/player-class.h" #include "player/player-status-table.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" diff --git a/src/wizard/wizard-special-process.cpp b/src/wizard/wizard-special-process.cpp index 9a07f29d1..21438ffb0 100644 --- a/src/wizard/wizard-special-process.cpp +++ b/src/wizard/wizard-special-process.cpp @@ -54,13 +54,13 @@ #include "object-enchant/trg-types.h" #include "object/object-kind.h" #include "perception/object-perception.h" +#include "player-info/class-info.h" #include "player-info/race-info.h" #include "player-info/race-types.h" #include "player-info/self-info.h" #include "player-status/player-energy.h" #include "player/digestion-processor.h" #include "player/patron.h" -#include "player/player-class.h" #include "player/player-skill.h" #include "player/player-status-table.h" #include "player/player-status.h" diff --git a/src/wizard/wizard-spoiler.cpp b/src/wizard/wizard-spoiler.cpp index cf98e31ae..0b5c122b5 100644 --- a/src/wizard/wizard-spoiler.cpp +++ b/src/wizard/wizard-spoiler.cpp @@ -20,7 +20,7 @@ #include "monster-race/race-flags7.h" #include "monster-race/race-flags8.h" #include "object/object-kind-hook.h" -#include "player/player-class.h" +#include "player-info/class-info.h" #include "realm/realm-names-table.h" #include "spell/spells-execution.h" #include "spell/spells-util.h" diff --git a/src/world/world.h b/src/world/world.h index 8fe1295e1..5f1fede22 100644 --- a/src/world/world.h +++ b/src/world/world.h @@ -1,6 +1,6 @@ #pragma once -#include "player/player-class-types.h" +#include "player-info/class-types.h" #include "system/angband.h" #include "util/flag-group.h"