OSDN Git Service

hengbandforosx/hengbandosx.git
17 months agoMerge pull request #2962 from habu1010/feature/refactor-format-retval-to-string
Habu [Wed, 21 Dec 2022 12:59:34 +0000 (21:59 +0900)]
Merge pull request #2962 from habu1010/feature/refactor-format-retval-to-string

[Refactor] format 関数の戻り値を std::string にする

17 months ago[Refactor] format 関数の戻り値を std::string にする
Habu [Wed, 21 Dec 2022 10:17:04 +0000 (19:17 +0900)]
[Refactor] format 関数の戻り値を std::string にする

既存の format 関数は、結果文字列を関数内部で保持している静的バッファ領域に格納しそれ
に対するポインタを返すという仕様のため、非常に注意深く使用する必要がある。
使いにくくて仕方がないので std::string オブジェクトを返すようにし、format 関数を
呼んだ側が確実に自由に結果文字列を扱えるようにする。

17 months agoMerge pull request #2940 from backwardsEric/sprintf-string-format
Habu [Wed, 21 Dec 2022 10:08:34 +0000 (19:08 +0900)]
Merge pull request #2940 from backwardsEric/sprintf-string-format

Replace sprintf() with std::string and/or format().  Does part of the…

17 months agoReplace sprintf() with std::string and/or format(). Does part of the work of resolvi...
Eric Branlund [Tue, 20 Dec 2022 18:48:50 +0000 (11:48 -0700)]
Replace sprintf() with std::string and/or format().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoMerge pull request #2946 from backwardsEric/sprintf-refactor-tombstone-generation
Habu [Tue, 20 Dec 2022 14:15:11 +0000 (23:15 +0900)]
Merge pull request #2946 from backwardsEric/sprintf-refactor-tombstone-generation

Refactor tombstone generation to avoid sprintf().  Does part of the …

17 months agoMerge pull request #2943 from backwardsEric/sprintf-refactor-birth-selections
Habu [Tue, 20 Dec 2022 14:01:40 +0000 (23:01 +0900)]
Merge pull request #2943 from backwardsEric/sprintf-refactor-birth-selections

Refactor birth class/personality/race/sex selection to avoid sprintf()…

17 months agoRefactor tombstone generation to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Tue, 20 Dec 2022 13:45:38 +0000 (06:45 -0700)]
Refactor tombstone generation to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor birth class/personality/race/sex selection to avoid sprintf(). Does part...
Eric Branlund [Tue, 20 Dec 2022 13:40:04 +0000 (06:40 -0700)]
Refactor birth class/personality/race/sex selection to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoMerge pull request #2948 from backwardsEric/sprintf-refactor-item_activation_aux
Habu [Tue, 20 Dec 2022 13:17:15 +0000 (22:17 +0900)]
Merge pull request #2948 from backwardsEric/sprintf-refactor-item_activation_aux

Refactor item_activation_aux() to avoid sprintf().  Does part of the …

17 months agoMerge pull request #2964 from backwardsEric/view-display-util-no-pch
Hourier [Mon, 19 Dec 2022 23:24:18 +0000 (08:24 +0900)]
Merge pull request #2964 from backwardsEric/view-display-util-no-pch

Include <string> to avoid compiler error on MacOS/clang when not …

17 months agoInclude <string> to avoid compiler error on MacOS/clang when not using precompiled...
Eric Branlund [Mon, 19 Dec 2022 19:35:48 +0000 (12:35 -0700)]
Include <string> to avoid compiler error on MacOS/clang when not using precompiled headers.  Resolves https://github.com/hengband/hengband/issues/2963 .

17 months agoMerge pull request #2961 from habu1010/feature/refactor-get_quantity-signature
Habu [Mon, 19 Dec 2022 13:11:56 +0000 (22:11 +0900)]
Merge pull request #2961 from habu1010/feature/refactor-get_quantity-signature

[Refactor] get_quantity 関数のシグネチャ変更

17 months ago[Refactor] get_quantity 関数のシグネチャ変更
Habu [Mon, 19 Dec 2022 12:22:41 +0000 (21:22 +0900)]
[Refactor] get_quantity 関数のシグネチャ変更

他の get_* シリーズと違い、既存の仕様で nullptr が渡された時にデフォルトメッセージを
表示するという仕様があるので単純に std::string_view にできない。
したがって std::optional<std::string_view> にし、std::nullopt で対応する。

17 months agoMerge pull request #2957 from habu1010/feature/refactor-exe_spell-return-value
Habu [Mon, 19 Dec 2022 12:16:02 +0000 (21:16 +0900)]
Merge pull request #2957 from habu1010/feature/refactor-exe_spell-return-value

[Refactor] exe_spell 関数の戻り値の型を変更

17 months agoMerge pull request #2960 from Hourier/Fix-Compilation-Warning-LevelDesc
Hourier [Mon, 19 Dec 2022 12:07:34 +0000 (21:07 +0900)]
Merge pull request #2960 from Hourier/Fix-Compilation-Warning-LevelDesc

引数とローカル変数名の重複を解消した

17 months ago[Fix] 引数とローカル変数名の重複を解消した
Hourier [Mon, 19 Dec 2022 12:01:43 +0000 (21:01 +0900)]
[Fix] 引数とローカル変数名の重複を解消した

17 months agoMerge pull request #2936 from habu1010/feature/refactor-asking-player-function-signature
Habu [Mon, 19 Dec 2022 11:54:10 +0000 (20:54 +0900)]
Merge pull request #2936 from habu1010/feature/refactor-asking-player-function-signature

[Refactor] asking-player.cpp の関数群のシグネチャを変更

17 months agoMerge pull request #2937 from habu1010/feature/refactor-get_ability_abbreviation
Habu [Mon, 19 Dec 2022 11:53:11 +0000 (20:53 +0900)]
Merge pull request #2937 from habu1010/feature/refactor-get_ability_abbreviation

[Refactor] get_inscription 関数のシグネチャを変更

17 months agoMerge pull request #2954 from backwardsEric/sprintf-refactor-dice_to_string
Habu [Mon, 19 Dec 2022 11:48:16 +0000 (20:48 +0900)]
Merge pull request #2954 from backwardsEric/sprintf-refactor-dice_to_string

Refactor dice_to_string() to avoid sprintf().  Does part of the work …

17 months agoMerge pull request #2958 from habu1010/feature/refactor-display_player_one_line-signature
Habu [Mon, 19 Dec 2022 11:42:22 +0000 (20:42 +0900)]
Merge pull request #2958 from habu1010/feature/refactor-display_player_one_line-signature

[Refactor] display_player_one_line 関数のシグネチャ変更

17 months agoMerge pull request #2959 from habu1010/feature/refactor-concptr-to-string_view
Habu [Mon, 19 Dec 2022 11:41:49 +0000 (20:41 +0900)]
Merge pull request #2959 from habu1010/feature/refactor-concptr-to-string_view

[Refactor] いくつかの関数の文字列引数の型を std::string_view に変更

17 months ago[Refactor] get_inscription 関数のシグネチャを変更
Habu [Mon, 19 Dec 2022 11:39:28 +0000 (20:39 +0900)]
[Refactor] get_inscription 関数のシグネチャを変更

get_inscription 関数のシグネチャを、文字列を格納するバッファを指すポインタ引数を受け
取る方式から std::string 型の戻り値で文字列を返す方式に変更する。

17 months ago[Refactor] いくつかの関数の文字列引数の型を std::string_view に変更
Habu [Mon, 19 Dec 2022 11:16:36 +0000 (20:16 +0900)]
[Refactor] いくつかの関数の文字列引数の型を std::string_view に変更

format 関数の戻り値を std::string にするにあたり、事前のリサーチで format の戻り
値を直接渡している関数のうち使用箇所が多く std::string_view に変更しておいたほうが
良いと思われる以下のものを先に変更しておく。

- load_note
- roff 系関数

17 months ago[Refactor] exe_spell 関数の戻り値の型を変更
Habu [Mon, 19 Dec 2022 10:07:56 +0000 (19:07 +0900)]
[Refactor] exe_spell 関数の戻り値の型を変更

現在 exe_spell 関数の戻り値の型は concptr であり、SpellProcessType 型の引数の値
により関数の処理内容が切り替わるとともに戻り値の意味も変化する。
大雑把には魔法の名称や情報を得る時はその文字列(静的リテラルや format 関数の静的バッ
ファ)を指すポインタが返り、魔法を実行するときは実行したなら空文字列リテラルへのポイン
タ、キャンセルしたなら nullptr が返る。
format 関数の戻り値を std::string にすると exe_spell の戻り値も std::string に
する必要があるが、std::string に nullptr を入れることはできない。そこで戻り値を
std::optional<std::string> に変更してキャンセル時には std::nullopt を返すように
変更する。

17 months ago[Refactor] display_player_one_line 関数のシグネチャ変更
Habu [Mon, 19 Dec 2022 09:07:24 +0000 (18:07 +0900)]
[Refactor] display_player_one_line 関数のシグネチャ変更

display_player_one_line 関数は format 関数の戻り値をダイレクトに渡している箇所が
多いので、format 関数の戻り値が std::string になっても変更しなくてすむように引数を
concptr から std::string_view に変更する。
また、現在 std::string::data() メソッドを呼び出して渡している箇所は、data() の呼
び出しが不要になるので std::string オブジェクトをそのまま渡すようにする。

17 months ago[Refactor] asking-player.cpp の関数群のシグネチャを変更
Habu [Mon, 19 Dec 2022 06:58:21 +0000 (15:58 +0900)]
[Refactor] asking-player.cpp の関数群のシグネチャを変更

asking-player.cpp で定義されている、ユーザに入力を促す get_* の関数群に与えるの
メッセージの引数の型を concptr から std::string_view に変更する。
但し、get_quantity は nullptr の時にデフォルトメッセージを表示するという例外がある
ので別途対応する。

17 months agoRefactor dice_to_string() to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Mon, 19 Dec 2022 05:45:14 +0000 (22:45 -0700)]
Refactor dice_to_string() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor item_activation_aux() to avoid sprintf(). Does part of the work of resolvin...
Eric Branlund [Mon, 19 Dec 2022 03:45:06 +0000 (20:45 -0700)]
Refactor item_activation_aux() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoMerge pull request #2951 from backwardsEric/sprintf-refactor-write-diary
Habu [Mon, 19 Dec 2022 03:24:26 +0000 (12:24 +0900)]
Merge pull request #2951 from backwardsEric/sprintf-refactor-write-diary

Refactor write-diary.cpp to avoid sprintf().  Does part of the work of…

17 months agoMerge pull request #2947 from backwardsEric/sprintf-refactor-likert
Habu [Mon, 19 Dec 2022 03:16:10 +0000 (12:16 +0900)]
Merge pull request #2947 from backwardsEric/sprintf-refactor-likert

Refactor likert() to avoid sprintf().  Does part of the work of …

17 months agoRefactor likert() to avoid sprintf(). Does part of the work of resolving https:...
Eric Branlund [Sun, 18 Dec 2022 15:12:40 +0000 (08:12 -0700)]
Refactor likert() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor write-diary.cpp to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Sun, 18 Dec 2022 14:39:58 +0000 (07:39 -0700)]
Refactor write-diary.cpp to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoMerge pull request #2941 from backwardsEric/sprintf-refactor-name_unnatural_random_ar...
Habu [Sun, 18 Dec 2022 06:58:57 +0000 (15:58 +0900)]
Merge pull request #2941 from backwardsEric/sprintf-refactor-name_unnatural_random_artifact

Refactor name_unnatural_random_artifact() to avoid sprintf().  Does …

17 months agoMerge pull request #2942 from backwardsEric/sprintf-refactor-floor-save
Habu [Sun, 18 Dec 2022 06:54:21 +0000 (15:54 +0900)]
Merge pull request #2942 from backwardsEric/sprintf-refactor-floor-save

Refactor floor/floor-save.cpp to avoid sprintf().  Does part of the …

17 months agoMerge pull request #2944 from backwardsEric/sprintf-refactor-init_angband
Habu [Sun, 18 Dec 2022 06:49:15 +0000 (15:49 +0900)]
Merge pull request #2944 from backwardsEric/sprintf-refactor-init_angband

Refactor init_angband() to avoid sprintf().  Does part of the work of…

17 months agoMerge pull request #2945 from backwardsEric/sprintf-refactor-pit_subtype_string
Habu [Sun, 18 Dec 2022 06:43:17 +0000 (15:43 +0900)]
Merge pull request #2945 from backwardsEric/sprintf-refactor-pit_subtype_string

Refactor pit_subtype_string() to avoid sprintf().  Does part of the …

17 months agoMerge pull request #2949 from backwardsEric:sprintf-refactor-describe_baseitem_info
Habu [Sun, 18 Dec 2022 04:58:06 +0000 (13:58 +0900)]
Merge pull request #2949 from backwardsEric:sprintf-refactor-describe_baseitem_info

Refactor describe_baseitem_info() to avoid sprintf().  Does part of …

17 months agoMerge pull request #2950 from backwardsEric/sprintf-refactor-target-describer
Habu [Sun, 18 Dec 2022 04:50:59 +0000 (13:50 +0900)]
Merge pull request #2950 from backwardsEric/sprintf-refactor-target-describer

Refactor target-describer.cpp to avoid sprintf().  Does part of the …

17 months agoMerge pull request #2952 from backwardsEric/sprintf-refactor-auto-roller
Habu [Sun, 18 Dec 2022 04:36:27 +0000 (13:36 +0900)]
Merge pull request #2952 from backwardsEric/sprintf-refactor-auto-roller

Refactor auto-roller.cpp to avoid sprintf().  Does part of the work …

17 months agoRefactor auto-roller.cpp to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Sat, 17 Dec 2022 21:33:39 +0000 (14:33 -0700)]
Refactor auto-roller.cpp to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor target-describer.cpp to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Sat, 17 Dec 2022 21:17:01 +0000 (14:17 -0700)]
Refactor target-describer.cpp to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor describe_baseitem_info() to avoid sprintf(). Does part of the work of resol...
Eric Branlund [Sat, 17 Dec 2022 21:08:59 +0000 (14:08 -0700)]
Refactor describe_baseitem_info() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor pit_subtype_string() to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Sat, 17 Dec 2022 19:45:46 +0000 (12:45 -0700)]
Refactor pit_subtype_string() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor init_angband() to avoid sprintf(). Does part of the work of resolving https...
Eric Branlund [Sat, 17 Dec 2022 19:41:46 +0000 (12:41 -0700)]
Refactor init_angband() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor floor/floor-save.cpp to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Sat, 17 Dec 2022 19:06:19 +0000 (12:06 -0700)]
Refactor floor/floor-save.cpp to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoRefactor name_unnatural_random_artifact() to avoid sprintf(). Does part of the work...
Eric Branlund [Sat, 17 Dec 2022 18:58:53 +0000 (11:58 -0700)]
Refactor name_unnatural_random_artifact() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoMerge pull request #2939 from backwardsEric/sprintf-simple-replacements
Habu [Sat, 17 Dec 2022 15:06:19 +0000 (00:06 +0900)]
Merge pull request #2939 from backwardsEric/sprintf-simple-replacements

Replace sprintf() simply.  Does part of the work to resolve …

17 months agoReplace sprintf() simply. Does part of the work to resolve https://github.com/hengba...
Eric Branlund [Sat, 17 Dec 2022 14:33:07 +0000 (07:33 -0700)]
Replace sprintf() simply.  Does part of the work to resolve https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

17 months agoMerge pull request #2852 from arumons/feature/add-info-to-monster-health
Habu [Sat, 17 Dec 2022 13:37:08 +0000 (22:37 +0900)]
Merge pull request #2852 from arumons/feature/add-info-to-monster-health

[Feature] モンスターのHP表示部に出す情報追加

17 months ago[Refactor] #2852 システムファイルではないインクルードファイルは<>でなく””で囲むようにした
arumons [Sat, 17 Dec 2022 13:29:27 +0000 (22:29 +0900)]
[Refactor] #2852 システムファイルではないインクルードファイルは<>でなく””で囲むようにした

17 months ago[Refactor] hengband#2852 コード規約に合わせてローカル変数、定数を小文字スネークケースにした
arumons [Sun, 11 Dec 2022 08:51:12 +0000 (17:51 +0900)]
[Refactor] hengband#2852 コード規約に合わせてローカル変数、定数を小文字スネークケースにした

17 months ago [Fix] hengband#2852 追加したmain-window-row-column.cppをvcxprroj.filtersに追加した
arumons [Sun, 11 Dec 2022 08:40:10 +0000 (17:40 +0900)]
 [Fix] hengband#2852 追加したmain-window-row-column.cppをvcxprroj.filtersに追加した

17 months ago[Refactor] hengband#2852 レビュー指摘に合わせてコメントの追加やコードの細かい修正をした
arumons [Sat, 10 Dec 2022 17:40:16 +0000 (02:40 +0900)]
[Refactor] hengband#2852 レビュー指摘に合わせてコメントの追加やコードの細かい修正をした

17 months ago[Refactor] hengband#2852 MonsterEntityに生存状態を返すis_deadメソッドを追加
arumons [Sat, 10 Dec 2022 16:28:55 +0000 (01:28 +0900)]
[Refactor] hengband#2852 MonsterEntityに生存状態を返すis_deadメソッドを追加

17 months ago[Refactor] hengband#2852 HPバーの色を決定する処理を別関数に切り出した
arumons [Sat, 10 Dec 2022 15:43:57 +0000 (00:43 +0900)]
[Refactor] hengband#2852 HPバーの色を決定する処理を別関数に切り出した

17 months ago[Feature] モンスターのHP表示部に出す情報追加
arumons [Sat, 26 Nov 2022 14:38:02 +0000 (23:38 +0900)]
[Feature] モンスターのHP表示部に出す情報追加

17 months agoMerge pull request #2930 from habu1010/feature/refactor-get_ability_abbreviation
Habu [Fri, 16 Dec 2022 13:14:35 +0000 (22:14 +0900)]
Merge pull request #2930 from habu1010/feature/refactor-get_ability_abbreviation

[Refactor] get_ability_abbreviation 関数のインターフェース

17 months agoMerge pull request #2935 from habu1010/feature/change-term_addstr_putstr-signature
Habu [Fri, 16 Dec 2022 13:03:47 +0000 (22:03 +0900)]
Merge pull request #2935 from habu1010/feature/change-term_addstr_putstr-signature

[Refactor] 画面に文字列を出力する関数のシグネチャ変更

17 months ago[Refactor] 画面に文字列を出力する関数のシグネチャ変更
Habu [Fri, 16 Dec 2022 09:46:04 +0000 (18:46 +0900)]
[Refactor] 画面に文字列を出力する関数のシグネチャ変更

Cスタイルの文字列(concptr)、std::string、std::string_view のいずれもシームレスに
受け取れるように、以下の関数の文字列を指定する引数を concptr から std::string_view
に変更する:

- term_addstr
- term_putstr
- c_put_str/put_str
- c_prt/prt

17 months ago[Refactor] 特性フラグ表記の日英切り替えの真偽値フラグを kanji から is_kanji に改名
Habu [Wed, 14 Dec 2022 10:21:53 +0000 (19:21 +0900)]
[Refactor] 特性フラグ表記の日英切り替えの真偽値フラグを kanji から is_kanji に改名

kanji だと曖昧なので明白に真偽値を表す is_kanji とする。

17 months ago[Refactor] get_ability_abbreviation 関数のインターフェース
Habu [Tue, 13 Dec 2022 13:33:28 +0000 (22:33 +0900)]
[Refactor] get_ability_abbreviation 関数のインターフェース

get_ability_abbreviation 関数のインターフェースを、引数が指すバッファ領域に文字列
を書き込む方式から std::string 型文字列を返す方式に変更する。

17 months agoMerge pull request #2921 from Hourier/Change-BaseitemInfo-RawArray-To-StdArray
Hourier [Tue, 13 Dec 2022 13:27:10 +0000 (22:27 +0900)]
Merge pull request #2921 from Hourier/Change-BaseitemInfo-RawArray-To-StdArray

BasitemInfo::locale/chance の取り扱いを改善した

17 months agoMerge pull request #2927 from habu1010/feature/fix-out-of-array-reference-angband...
Habu [Tue, 13 Dec 2022 13:26:55 +0000 (22:26 +0900)]
Merge pull request #2927 from habu1010/feature/fix-out-of-array-reference-angband-terms

[Fix] angband_terms の配列外参照

17 months ago[Fix] angband_terms の配列外参照
Habu [Tue, 13 Dec 2022 12:10:31 +0000 (21:10 +0900)]
[Fix] angband_terms の配列外参照

ゲーム終了時に angband_terms 配列が指している term_type 構造体を破棄する時逆順で
破棄しているが、最初の要素のインデクスが angband_terms.size() となっているため配列
外参照となっている。
単純に size() - 1 から始めるように修正してもいいが、逆順という意図を込めるため
リバースイテレータで処理するように変更する。

17 months agoMerge pull request #2922 from Slimebreath6078/feature/refactor_mflag_brightness
火炎の飛竜 [Mon, 12 Dec 2022 15:54:04 +0000 (00:54 +0900)]
Merge pull request #2922 from Slimebreath6078/feature/refactor_mflag_brightness

モンスターのフラグをまとめる(明かり・闇)

17 months ago[Refactor] ダンジョンのモンスター出現フィルターに明かり・闇フラグ適用
Slimebreath6078 [Sun, 11 Dec 2022 08:29:59 +0000 (17:29 +0900)]
[Refactor] ダンジョンのモンスター出現フィルターに明かり・闇フラグ適用

17 months ago[Refactor] トークン定義を明かり・闇フラグに合わせる
Slimebreath6078 [Sun, 11 Dec 2022 08:29:24 +0000 (17:29 +0900)]
[Refactor] トークン定義を明かり・闇フラグに合わせる

17 months ago[Refactor] 明かり・闇フラグの定義に合わせる
Slimebreath6078 [Sun, 11 Dec 2022 08:09:44 +0000 (17:09 +0900)]
[Refactor] 明かり・闇フラグの定義に合わせる

17 months ago[Refactor] モンスターの明かり・闇フラグをFlagGroup化
Slimebreath6078 [Sun, 11 Dec 2022 06:53:33 +0000 (15:53 +0900)]
[Refactor] モンスターの明かり・闇フラグをFlagGroup化

17 months ago[Refactor] #2925 kind_info() をdescribe_baseitem_info() に改名し、引数名を分かりやすくした
Hourier [Mon, 12 Dec 2022 13:29:40 +0000 (22:29 +0900)]
[Refactor] #2925 kind_info() をdescribe_baseitem_info() に改名し、引数名を分かりやすくした

17 months ago[Refactor] #2921 kind_info() において、level とchance をタプルに分解した
Hourier [Mon, 12 Dec 2022 13:22:41 +0000 (22:22 +0900)]
[Refactor] #2921 kind_info() において、level とchance をタプルに分解した

17 months ago[Refactor] #2925 横に長過ぎる関数呼び出しを短くし、不必要にvectorから生配列を取り出していた処理をvectorのまま扱うように整形した
Hourier [Sun, 11 Dec 2022 12:22:42 +0000 (21:22 +0900)]
[Refactor] #2925 横に長過ぎる関数呼び出しを短くし、不必要にvectorから生配列を取り出していた処理をvectorのまま扱うように整形した

17 months ago[Refactor] #2925 Separated check_baseitem_chance() from collect_objects()
Hourier [Sun, 11 Dec 2022 12:15:06 +0000 (21:15 +0900)]
[Refactor] #2925 Separated check_baseitem_chance() from collect_objects()

17 months ago[Refactor] #2925 alloc_table を作成し、そこにchance とlevel を移した
Hourier [Sun, 11 Dec 2022 10:27:09 +0000 (19:27 +0900)]
[Refactor] #2925 alloc_table を作成し、そこにchance とlevel を移した

17 months ago[Refactor] #2925 BaseitemInfo::chance をalloc_chances に、locale をalloc_levels に変えた
Hourier [Sat, 10 Dec 2022 14:37:58 +0000 (23:37 +0900)]
[Refactor] #2925 BaseitemInfo::chance をalloc_chances に、locale をalloc_levels に変えた

17 months ago[Refcator] #2925 BaseitenInfo::chance/locale を生配列からstd::array に変えた
Hourier [Sat, 10 Dec 2022 14:35:04 +0000 (23:35 +0900)]
[Refcator] #2925 BaseitenInfo::chance/locale を生配列からstd::array に変えた

17 months agoMerge pull request #2901 from arumons/refactor/use_const_to_gameterm_num
Habu [Sun, 11 Dec 2022 10:52:52 +0000 (19:52 +0900)]
Merge pull request #2901 from arumons/refactor/use_const_to_gameterm_num

[Refactor] termの配列に対してループ処理をする際にマジックナンバーを使っているのをやめる

17 months agoMerge pull request #2924 from habu1010/feature/refactor-describe-flavor-5
Habu [Sun, 11 Dec 2022 10:50:56 +0000 (19:50 +0900)]
Merge pull request #2924 from habu1010/feature/refactor-describe-flavor-5

[Refactor] describe_flavor (5/5)

17 months ago[Refactor] has_lite_flag/has_dark_flag 関数をファイルスコープにする
Habu [Sun, 11 Dec 2022 10:44:31 +0000 (19:44 +0900)]
[Refactor] has_lite_flag/has_dark_flag 関数をファイルスコープにする

これらの関数は flavor-util.cpp 内からしか呼ばれていない。
static を付けて関数をファイルスコープにし、ヘッダファイルからプロトタイプ宣言を削除する。

17 months ago[Refactor] describe_flavor のリファクタリングにより不要となった型と関数を削除
Habu [Sun, 11 Dec 2022 10:11:02 +0000 (19:11 +0900)]
[Refactor] describe_flavor のリファクタリングにより不要となった型と関数を削除

describe_flavor をリファクタリングしたことにより不要となった flavor_type 構造体
およびバッファ非安全な object_desc_* の関数群を削除する。

17 months ago[Refactor] 個数表現を記述する関数のインターフェース
Habu [Sun, 11 Dec 2022 10:11:02 +0000 (19:11 +0900)]
[Refactor] 個数表現を記述する関数のインターフェース

日本語による助数詞を付けた個数表現(ex. 1本、2着)を記述する関数
object_desc_count_japanese のインターフェースを文字列を書き込むバッファへのポインタ
を受け取る形式から std::string オブジェクトを返す形式に変更する。
また、関数名を処理内容を端的に示す describe_count_with_counter_suffix とする。

17 months agoMerge pull request #2917 from habu1010/feature/refactor-describe-flavor-4
Habu [Sun, 11 Dec 2022 08:10:27 +0000 (17:10 +0900)]
Merge pull request #2917 from habu1010/feature/refactor-describe-flavor-4

[Refactor] describe_flavor (4/n)

17 months ago[Refactor] hengband#2860 キャストに合わせての左辺の型をautoにした
arumons [Sun, 11 Dec 2022 08:07:16 +0000 (17:07 +0900)]
[Refactor] hengband#2860 キャストに合わせての左辺の型をautoにした

17 months ago[Refactor] describe_flavor から flavor_type 型のオブジェクトを削除
Habu [Sun, 11 Dec 2022 06:00:44 +0000 (15:00 +0900)]
[Refactor] describe_flavor から flavor_type 型のオブジェクトを削除

describe_flavor から flavor_type 型のオブジェクトを削除し、まだそれに依存していた
コードを flavor_ptr を経由しないコードに変更する。

17 months ago[Refactor] describe_flavor (4/n)
Habu [Sun, 11 Dec 2022 05:59:14 +0000 (14:59 +0900)]
[Refactor] describe_flavor (4/n)

アイテムの銘(簡易鑑定、割引、特性簡略表記、プレイヤーの刻んだ銘)の表記をリファクタリング。

17 months ago[Refactor] 参照先を変更しないポインタ引数に const を付与する
Habu [Sun, 11 Dec 2022 05:59:14 +0000 (14:59 +0900)]
[Refactor] 参照先を変更しないポインタ引数に const を付与する

get_ability_abbrev、get_inscription 関数の ItemEntity* を取る引数に const が
付いていないため、非 const オブジェクトしか渡せない状態になっている。
const オブジェクトを渡せるようにするため引数に const を付与する。

17 months ago[Refactor] describe_flavor からしか呼ばれていない関数を同ファイルに移動
Habu [Sun, 11 Dec 2022 05:59:14 +0000 (14:59 +0900)]
[Refactor] describe_flavor からしか呼ばれていない関数を同ファイルに移動

describe_flavor からしか呼ばれていない以下の関数を describe_flavor と同ファイルに
移動し、これらの関数しか定義されていない display-sub-window-items.cpp/h を削除する。

- display_short_flavors
- display_item_discount
- display_item_fake_inscription

また、関数名として display ではなく descirbe が適切なので変更する。

17 months agoMerge pull request #2905 from Hourier/Rename-BaseitemInfo-Reference
Hourier [Sun, 11 Dec 2022 05:51:30 +0000 (14:51 +0900)]
Merge pull request #2905 from Hourier/Rename-BaseitemInfo-Reference

ベースアイテムへのポインタ/参照 をbii_ptr/baseitem に差し替えた

17 months ago[Refactor] #2844 k_ref をbaseitem に改名した
Hourier [Sat, 10 Dec 2022 14:28:45 +0000 (23:28 +0900)]
[Refactor] #2844 k_ref をbaseitem に改名した

17 months ago[Refactor] #2844 使われていないspoilerフラグを削除した
Hourier [Sat, 10 Dec 2022 13:39:16 +0000 (22:39 +0900)]
[Refactor] #2844 使われていないspoilerフラグを削除した

17 months ago[Refactor] #2844 k_ptr をbii_ptr に改名し、flavor-describer.cpp からベースアイテム情報の直接書き換えコードをなくし...
Hourier [Sat, 10 Dec 2022 13:35:25 +0000 (22:35 +0900)]
[Refactor] #2844 k_ptr をbii_ptr に改名し、flavor-describer.cpp からベースアイテム情報の直接書き換えコードをなくし、baseitem-reader.cpp で読み込み時に判定させるようにした

17 months ago[Refactor] #2844 *k_ptr/&k_ref を&baseitem に差し替えた (一部flavor周りで残りアリ)
Hourier [Fri, 9 Dec 2022 14:34:41 +0000 (23:34 +0900)]
[Refactor] #2844 *k_ptr/&k_ref を&baseitem に差し替えた (一部flavor周りで残りアリ)

17 months agoMerge pull request #2909 from habu1010/feature/refactor-describe-flavor-3
Habu [Sat, 10 Dec 2022 23:25:39 +0000 (08:25 +0900)]
Merge pull request #2909 from habu1010/feature/refactor-describe-flavor-3

[Refactor] describe_flavor (3/n)

17 months ago[Refactor] hengband#2860 angband_termsに対するループ処理を一部range-based forに書き換えた
arumons [Sat, 10 Dec 2022 16:38:18 +0000 (01:38 +0900)]
[Refactor] hengband#2860 angband_termsに対するループ処理を一部range-based forに書き換えた

17 months ago[Refactor] describe_flavor (3/n)
Habu [Sat, 10 Dec 2022 14:37:10 +0000 (23:37 +0900)]
[Refactor] describe_flavor (3/n)

杖/魔法棒/ロッドの充填状態、pval、光源の残りターン数、発動アイテムの充填中表示をリファ
クタリング。

17 months agoMerge pull request #2902 from habu1010/feature/refactor-describe-flavor-2
Habu [Sat, 10 Dec 2022 14:03:58 +0000 (23:03 +0900)]
Merge pull request #2902 from habu1010/feature/refactor-describe-flavor-2

[Refactor] describe_flavor (2/n)

17 months agoMerge pull request #2903 from Hourier/Fix-Throw-Crash
Hourier [Sat, 10 Dec 2022 13:15:15 +0000 (22:15 +0900)]
Merge pull request #2903 from Hourier/Fix-Throw-Crash

弓を装備していない状態でアイテムを投げるとクラッシュする不具合を修正した

17 months ago[Refactor] describe_flavor (2/n)
Habu [Sat, 10 Dec 2022 10:41:29 +0000 (19:41 +0900)]
[Refactor] describe_flavor (2/n)

矢弾および鉄くさびのダメージ詳細表示、アーマークラスの表示までリファクタリング。

17 months ago[Refactor] #2900 変更範囲の整形
Hourier [Sat, 10 Dec 2022 11:28:42 +0000 (20:28 +0900)]
[Refactor] #2900 変更範囲の整形

17 months ago[Refactor] #2900 display_bow_hit_damage() のクロスボウ判定処理をis_cross_bow() に差し替えた
Hourier [Sat, 10 Dec 2022 11:08:30 +0000 (20:08 +0900)]
[Refactor] #2900 display_bow_hit_damage() のクロスボウ判定処理をis_cross_bow() に差し替えた