[*]
insert_final_newline = true
charset = utf-8
-
-[*.{c,cpp,h}]
-charset = utf-8-bom
for file in $SRC_FILES; do
file $file | grep "BOM" >/dev/null
- if [ $? != 0 ]; then
- echo "$file: BOM does not exists."
+ if [ $? == 0 ]; then
+ echo "$file: BOM exists."
STATUS=1
fi
done
-name: Build test with MSVC
+name: Build test with MSVC
on:
workflow_call:
-name: Create Release
+name: Create Release
on:
push:
run: ./bootstrap
- name: Configuration for Japanese version
- run: ./configure --disable-worldscore
+ run: ./configure --disable-net
env:
CFLAGS: "-pipe"
<ExceptionHandling>SyncCThrow</ExceptionHandling>\r
<PrecompiledHeader>Use</PrecompiledHeader>\r
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>\r
- <AdditionalOptions>/execution-charset:shift-jis %(AdditionalOptions)</AdditionalOptions>\r
+ <AdditionalOptions>/source-charset:utf-8 /execution-charset:shift-jis %(AdditionalOptions)</AdditionalOptions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<LanguageStandard>stdcpp20</LanguageStandard>\r
<PrecompiledHeader>Use</PrecompiledHeader>\r
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>\r
+ <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>\r
</ClCompile>\r
<Link>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
<LanguageStandard>stdcpp20</LanguageStandard>\r
<PrecompiledHeader>Use</PrecompiledHeader>\r
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>\r
- <AdditionalOptions>/execution-charset:shift-jis %(AdditionalOptions)</AdditionalOptions>\r
+ <AdditionalOptions>/source-charset:utf-8 /execution-charset:shift-jis %(AdditionalOptions)</AdditionalOptions>\r
</ClCompile>\r
<Link>\r
<TargetMachine>MachineX86</TargetMachine>\r
<CompileAs>CompileAsCpp</CompileAs>\r
<PrecompiledHeader>Use</PrecompiledHeader>\r
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>\r
+ <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>\r
</ClCompile>\r
<Link>\r
<AdditionalDependencies>winmm.lib;gdiplus.lib;Ws2_32.lib;Wldap32.lib;Crypt32.lib;Normaliz.lib;curl\lib\libcurl_a.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
<ClCompile Include="..\..\src\timed-effect\player-poison.cpp" />\r
<ClCompile Include="..\..\src\timed-effect\player-stun.cpp" />\r
<ClCompile Include="..\..\src\timed-effect\timed-effects.cpp" />\r
+ <ClCompile Include="..\..\src\util\candidate-selector.cpp" />\r
<ClCompile Include="..\..\src\util\rng-xoshiro.cpp" />\r
<ClCompile Include="..\..\src\util\sha256.cpp" />\r
<ClCompile Include="..\..\src\view\display-inventory.cpp" />\r
<ClInclude Include="..\..\src\timed-effect\timed-effects.h" />\r
<ClInclude Include="..\..\src\util\bit-flags-calculator.h" />\r
<ClInclude Include="..\..\src\util\buffer-shaper.h" />\r
+ <ClInclude Include="..\..\src\util\candidate-selector.h" />\r
<ClInclude Include="..\..\src\util\enum-converter.h" />\r
<ClInclude Include="..\..\src\util\enum-range.h" />\r
<ClInclude Include="..\..\src\util\finalizer.h" />\r
<ClCompile Include="..\..\src\main-win\main-win-exception.cpp">\r
<Filter>main-win</Filter>\r
</ClCompile>\r
+ <ClCompile Include="..\..\src\util\candidate-selector.cpp">\r
+ <Filter>util</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="..\..\src\combat\shoot.h">\r
<ClInclude Include="..\..\src\main-win\main-win-exception.h">\r
<Filter>main-win</Filter>\r
</ClInclude>\r
+ <ClInclude Include="..\..\src\util\candidate-selector.h">\r
+ <Filter>util</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="..\..\src\wall.bmp" />\r
-THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
+THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize
hengband incorporates third party material from the projects listed below.
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 3.0.0Alpha87
+PROJECT_NUMBER = 3.0.0Alpha88
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
-%define version 3.0.0.86
+%define version 3.0.0.88
%define release 1
%global debug_package %{nil}
%changelog
+* Sun Jul 23 2023 Shiro Hara <white@vx-xv.com>
+- hengband RPM 3.0.0.88(Alpha)
+
+* Sun Jul 09 2023 Shiro Hara <white@vx-xv.com>
+- hengband RPM 3.0.0.87(Alpha)
+
* Mon Jun 26 2023 Shiro Hara <white@vx-xv.com>
- hengband RPM 3.0.0.86(Alpha)
S:HEAL | INVULNER | BLINK | TPORT | WORLD | TELE_TO | TELE_AWAY | TELE_LEVEL |
S:PSY_SPEAR | DARKNESS | TRAPS | FORGET | ANIM_DEAD | S_KIN | S_CYBER | S_MONSTER |
S:S_MONSTERS | S_ANT | S_SPIDER | S_HOUND | S_HYDRA | S_DEMON | S_UNDEAD |
-S:S_DRAGON | S_HI_UNDEAD | S_AMBERITES | S_UNIQUE | BA_LITE
+S:S_DRAGON | S_HI_UNDEAD | S_AMBERITES | S_UNIQUE | BA_LITE | S_DEAD_UNIQUE
V:133
D:$You don't know what it is.
D:それは何が何だか分からない。
V:150
D:$It's a abyssal whirlpool.
D:深淵の渦巻きだ。
+
+N:1353:破壊と憎悪の化身『サルーイン』
+E:Saruin, The avatar of destruction and hatred
+G:P:w
+I:125:90d100:100:175:0
+W:79:3:0:66666:0:0
+B:HIT:HURT:11d13
+B:HIT:HURT:11d13
+B:HIT:HURT:11d13
+B:HIT:HURT:11d13
+F:UNIQUE | MALE | DROP_CORPSE | NONLIVING |
+F:ONLY_ITEM | DROP_2D2 | DROP_4D2 | DROP_GREAT |
+F:PREVENT_SUDDEN_MAGIC | FORCE_MAXHP | SMART |
+F:OPEN_DOOR | BASH_DOOR |
+F:EVIL | IM_ACID | IM_FIRE | IM_COLD | IM_ELEC | IM_POIS |
+F:RES_WATE | RES_SHAR | RES_LITE | RES_DARK |
+F:NO_CONF | NO_SLEEP | NO_FEAR | NO_STUN | RES_TELE
+S:1_IN_3 | S_DEAD_UNIQUE |
+S:BA_FIRE | BA_WATE | BA_ACID | ROCKET | DISPEL | BLIND | BO_MANA |
+S:HOLD | HEAL | HASTE | CONF | BRAIN_SMASH
+D:$He was born from the heart of Sayva, the goddess of destruction.
+D:$ Apparently, some foolish adventurer had given away all the Destiny Stones.
+D:破壊の女神サイヴァの心臓から生まれた存在だ。
+D:どうやら愚かなる冒険者がすべてのデステニィストーンを捧げてしまったらしい。
# Cloaker
-F:(:FLOOR:8:243
+F:(:FLOOR:10:243
# Death sword
F:|:FLOOR:8:107
# Killer bee
util/angband-files.cpp util/angband-files.h \
util/buffer-shaper.cpp util/buffer-shaper.h \
util/bit-flags-calculator.h \
+ util/candidate-selector.cpp util/candidate-selector.h \
util/enum-converter.h \
util/enum-range.h \
util/finalizer.h \
-/*!
+/*!
* @file action-limited.cpp
* @brief プレイヤーの行動制約判定定義
*/
-#pragma once
+#pragma once
/*!
* @file action-limited.h
* @brief プレイヤーの行動制約判定ヘッダ
-/*!
+/*!
* @file activation-execution.cpp
* @brief アイテムの発動実行定義
*/
-#pragma once
+#pragma once
/*!
* @file activation-execution.h
* @brief アイテムの発動実行ヘッダ
-/*!
+/*!
* @file movement-execution.cpp
* @brief プレイヤーの歩行勝利実行定義
*/
-#pragma once
+#pragma once
/*!
* @file movement-execution.h
* @brief プレイヤーの歩行処理実行ヘッダ
-/*!
+/*!
* @file mutation-execution.cpp
* @brief プレイヤーの変異能力実行定義
*/
-#pragma once
+#pragma once
/*!
* @file mutation-execution.h
* @brief プレイヤーの変異能力実行ヘッダ
-/*!
+/*!
* @file open-close-execution.cpp
* @brief 扉や箱を開ける処理
* @date 2020/07/11
-#pragma once
+#pragma once
/*!
* @file open-close-execution.h
* @brief 扉や箱を開ける処理のヘッダ
-/*!
+/*!
* @file open-util.cpp
* @brief 開閉処理関連関数
*/
-#pragma once
+#pragma once
/*!
* @file open-util.h
* @brief 開閉処理関連関数ヘッダ
-/*!
+/*!
* @file racial-execution.cpp
* @brief レイシャルパワー実行処理実装
*/
-#pragma once
+#pragma once
/*!
* @file racial-execution.h
* @brief レイシャルパワー実行処理ヘッダ
-/*!
+/*!
* @file run-execution.cpp
* @brief プレイヤーの走行処理実装
*/
-#pragma once
+#pragma once
/*!
* @file run-execution.h
* @brief プレイヤーの走行処理ヘッダ
-/*!
+/*!
* @file travel-execution.cpp
* @brief トラベル移動処理実装
*/
-#pragma once
+#pragma once
/*!
* @file travel-execution.h
* @brief トラベル移動処理ヘッダ
-/*!
+/*!
* @file tunnel-execution.cpp
* @brief 掘削処理実装
*/
-#pragma once
+#pragma once
/*!
* @file tunnel-execution.h
* @brief 掘削処理ヘッダ
-/*!
+/*!
* @file weapon-shield.cpp
* @brief 手装備持ち替え処理実装
*/
-#pragma once
+#pragma once
/*!
* @file weapon-shield.h
* @brief 手装備持ち替え処理ヘッダ
-/*!
+/*!
* @file artifact-info.cpp
* @brief アーティファクトの発動効果取得関数定義
*/
-/*!
+/*!
* @file artifact-info.h
* @brief アーティファクトの発動効果取得関数ヘッダ
*/
-/*!
+/*!
* @file fixed-art-generator.cpp
* @brief 固定アーティファクトの生成 / Artifact code
* @date 2020/07/14
-#pragma once
+#pragma once
/*!
* @file fixed-art-generator.h
* @brief 固定アーティファクトの生成処理ヘッダ
-#pragma once
+#pragma once
/*!
* @file fixed-art-types.h
* @brief 固定アーティファクトのハードコード処理用ID定義
-/*!
+/*!
* @file random-art-activation.cpp
* @brief ランダムアーティファクトの発動実装定義
*/
-#pragma once
+#pragma once
/*!
* @file random-art-activation.h
* @brief ランダムアーティファクトの発動実装ヘッダ
-#pragma once
+#pragma once
/*!
* @file random-art-bias-types.h
* @brief ランダムアーティファクトのバイアス定義
-/*!
+/*!
* @file random-art-characteristics.cpp
* @brief ランダムアーティファクトのバイアス付加処理実装
*/
-#pragma once
+#pragma once
/*!
* @file random-art-characteristics.h
* @brief ランダムアーティファクトのバイアス付加処理ヘッダ
-#pragma once
+#pragma once
/*!
* @file random-art-effects.h
-/*!
+/*!
* @file random-art-generator.cpp
* @brief ランダムアーティファクトの生成メイン定義 / Artifact code
* @date 2020/07/14
-#pragma once
+#pragma once
/*!
* @file random-art-generator.h
* @brief ランダムアーティファクトの生成メインヘッダ / Artifact code
-/*!
+/*!
* @file random-art-misc.cpp
* @brief ランダムアーティファクト生成のその他特性バイアス付け実装 / Artifact code
*/
-#pragma once
+#pragma once
/*!
* @file random-art-misc.h
* @brief ランダムアーティファクト生成のその他特性バイアス付けヘッダ / Artifact code
-/*!
+/*!
* @file random-art-pval-investor.cpp
* @brief ランダムアーティファクトにpvalを追加する処理
* @date 2020/07/14
-#pragma once
+#pragma once
/*!
* @file random-art-pval-investor.h
* @brief ランダムアーティファクトのpval付加処理ヘッダ
-/*!
+/*!
* @file random-art-resistance.cpp
* @brief ランダムアーティファクトの耐性付加処理実装
*/
-#pragma once
+#pragma once
/*!
* @file random-art-resistance.h
* @brief ランダムアーティファクトの耐性付加処理ヘッダ
-/*!
+/*!
* @file random-art-slay.cpp
* @brief ランダムアーティファクトのスレイ付加処理実装
*/
-#pragma once
+#pragma once
/*!
* @file random-art-slay.h
* @brief ランダムアーティファクトのスレイ付加処理ヘッダ
-/*!
+/*!
* @brief 自動拾いエディタのコマンドを受け付ける
* @date 2020/04/26
* @author Hourier
-#pragma once
+#pragma once
int do_command_menu(int level, int start);
-#pragma once
+#pragma once
/*
* Editor command id's
-/*!
+/*!
* @brief 自動拾いの記述
* @date 2020/04/25
* @author Hourier
-#pragma once
+#pragma once
struct autopick_type;
void describe_autopick(char *buff, const autopick_type &entry);
-/*!
+/*!
* @brief 自動破壊の実行
* @date 2020/04/25
* @author Hourier
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#pragma once
+#pragma once
/*
* Dirty flag for text editor
-/*!
+/*!
* @brief 自動拾いエディタを表示させる
* @date 2020/04/26
* @author Hourier
#include "term/screen-processor.h"
#include "term/term-color-types.h"
#include "view/display-util.h"
+#include <tuple>
#define DESCRIPT_HGT 3
{
int by1 = 0, by2 = 0;
- term_get_size(&tb->wid, &tb->hgt);
+ std::tie(tb->wid, tb->hgt) = term_get_size();
/*
* Top line (-1), description line (-3), separator (-1)
-#pragma once
+#pragma once
struct text_body_type;
class PlayerType;
-/*!
+/*!
* @brief 自動拾いエディタ画面でキーを押した時の挙動一式
* @date 2020/04/26
* @author Hourier
-#pragma once
+#pragma once
/*! APE means AutoPickEditor*/
enum ape_quittance {
-#include <cstdlib>
+#include <cstdlib>
#include "autopick/autopick-dirty-flags.h"
#include "autopick/autopick-editor-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "autopick/autopick-entry.h"
+#include "autopick/autopick-entry.h"
#include "autopick/autopick-flags-table.h"
#include "autopick/autopick-key-flag-process.h"
#include "autopick/autopick-keys-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 自動拾いの検索
* @date 2020/04/26
* @author Hourier
int pos = 0;
while (true) {
bool back = false;
- term_erase(col, 0, 255);
+ term_erase(col, 0);
term_putstr(col, 0, -1, color, buf);
term_gotoxy(col + pos, 0);
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/*
* Macros for Keywords
-#include "autopick/autopick-initializer.h"
+#include "autopick/autopick-initializer.h"
#include "autopick/autopick-entry.h"
#include "autopick/autopick-util.h"
#include "system/angband.h"
-#pragma once
+#pragma once
void init_autopick(void);
-#include "autopick/autopick-inserter-killer.h"
+#include "autopick/autopick-inserter-killer.h"
#include "autopick/autopick-dirty-flags.h"
#include "autopick/autopick-util.h"
#include "cmd-io/macro-util.h"
-#pragma once
+#pragma once
struct text_body_type;
void check_expression_line(text_body_type *tb, int y);
-#pragma once
+#pragma once
#define MATCH_KEY(KEY) (!strncmp(ptr, KEY, strlen(KEY)) \
? (ptr += strlen(KEY), (' ' == *ptr) ? ptr++ : 0, true) \
-#pragma once
+#pragma once
#include "system/h-basic.h"
-/*!
+/*!
* @brief 床のアイテムが自動拾いに一致するかどうかを調べる関数だけを格納したファイル
* @date 2020/04/25
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-/*!
+/*!
* @brief 自動拾いのユーティリティ
* @date 2020/04/25
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#define DO_AUTOPICK 0x01
#define DO_AUTODESTROY 0x02
-#include "autopick/autopick-pref-processor.h"
+#include "autopick/autopick-pref-processor.h"
#include "autopick/autopick-entry.h"
#include "autopick/autopick-util.h"
#include "system/angband.h"
-#pragma once
+#pragma once
void process_autopick_file_command(char *buf);
-#include "autopick/autopick-reader-writer.h"
+#include "autopick/autopick-reader-writer.h"
#include "autopick/autopick-initializer.h"
#include "autopick/autopick-pref-processor.h"
#include "autopick/autopick-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-/*!
+/*!
* @brief 自動拾いにアイテムを登録する
* @date 2020/04/26
* @author Hourier
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "autopick/autopick-util.h"
+#include "autopick/autopick-util.h"
#include "autopick/autopick-menu-data-table.h"
#include "core/window-redrawer.h"
#include "game-option/input-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @file autopick.c
* @brief 自動拾い機能の実装 / Object Auto-picker/Destroyer
* @date 2014/01/02
-#pragma once
+#pragma once
#include "system/angband.h"
-/*
+/*
* @brief 敵への攻撃によって徳を変化させる処理
* @date 2021/08/05
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief ウルティマ4を参考にした徳のシステムの実装 / Enable an Ultima IV style "avatar" game where you try to achieve perfection in various virtues.
* @date 2013/12/23
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
#include <map>
-#include "birth/auto-roller.h"
+#include "birth/auto-roller.h"
#include "birth/birth-stat.h"
#include "birth/birth-util.h"
#include "cmd-io/cmd-gameoption.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "birth/birth-body-spec.h"
+#include "birth/birth-body-spec.h"
#include "player-base/player-class.h"
#include "player-base/player-race.h"
#include "player-info/race-info.h"
-#pragma once
+#pragma once
class PlayerType;
void get_height_weight(PlayerType *player_ptr);
-#include "birth/birth-explanations-table.h"
+#include "birth/birth-explanations-table.h"
#include "system/angband.h"
/*! 種族の解説メッセージテーブル */
-#pragma once
+#pragma once
#include <string>
#include <vector>
-#include "birth/birth-select-class.h"
+#include "birth/birth-select-class.h"
#include "birth/birth-util.h"
#include "io/input-key-acceptor.h"
#include "player-info/class-info.h"
-#pragma once
+#pragma once
class PlayerType;
bool get_player_class(PlayerType *player_ptr);
-#include "birth/birth-select-personality.h"
+#include "birth/birth-select-personality.h"
#include "birth/birth-util.h"
#include "io/input-key-acceptor.h"
#include "player/player-personality.h"
-#pragma once
+#pragma once
class PlayerType;
bool get_player_personality(PlayerType *player_ptr);
-#include "birth/birth-select-race.h"
+#include "birth/birth-select-race.h"
#include "birth/birth-util.h"
#include "io/input-key-acceptor.h"
#include "player-info/race-info.h"
-#pragma once
+#pragma once
class PlayerType;
bool get_player_race(PlayerType *player_ptr);
-#include "birth/birth-select-realm.h"
+#include "birth/birth-select-realm.h"
#include "birth/birth-explanations-table.h"
#include "birth/birth-util.h"
#include "core/asking-player.h"
-#pragma once
+#pragma once
class PlayerType;
bool get_player_realms(PlayerType *player_ptr);
-#include "birth/birth-stat.h"
+#include "birth/birth-stat.h"
#include "birth/auto-roller.h"
#include "player-base/player-class.h"
#include "player-base/player-race.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "birth/birth-util.h"
+#include "birth/birth-util.h"
#include "cmd-io/cmd-gameoption.h"
#include "core/show-file.h"
#include "main/sound-of-music.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "birth/birth-wizard.h"
+#include "birth/birth-wizard.h"
#include "avatar/avatar.h"
#include "birth/auto-roller.h"
#include "birth/birth-body-spec.h"
-#pragma once
+#pragma once
class PlayerType;
bool player_birth_wizard(PlayerType *player_ptr);
-/*!
+/*!
* @file birth.c
* @brief プレイヤーの作成を行う / Create a player character
* @date 2013/12/28
-#pragma once
+#pragma once
class PlayerType;
void player_birth(PlayerType *player_ptr);
-#include "birth/game-play-initializer.h"
+#include "birth/game-play-initializer.h"
#include "dungeon/quest.h"
#include "floor/floor-util.h"
#include "game-option/birth-options.h"
-#pragma once
+#pragma once
class PlayerType;
void player_wipe_without_name(PlayerType *player_ptr);
-#include "birth/history-editor.h"
+#include "birth/history-editor.h"
#include "io/input-key-acceptor.h"
#include "io/read-pref-file.h"
#include "locale/japanese.h"
}
#endif
} else if (c == '\r' || c == '\n') {
- term_erase(0, 11, 255);
- term_erase(0, 17, 255);
+ term_erase(0, 11);
+ term_erase(0, 17);
put_str(_("(キャラクターの生い立ち - 編集済み)", "(Character Background - Edited)"), 11, 20);
break;
} else if (c == ESCAPE) {
-#pragma once
+#pragma once
class PlayerType;
void edit_history(PlayerType *player_ptr);
-#include "birth/history-generator.h"
+#include "birth/history-generator.h"
#include "birth/history.h"
#include "player-info/race-types.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
class PlayerType;
void get_history(PlayerType *player_ptr);
-/*!
+/*!
* @brief 生い立ちメッセージテーブル / Forward declare
* @date 2002/01/12
* @author mogami
-#include "system/angband.h"
+#include "system/angband.h"
#include <vector>
/*!
-#include "birth/initial-equipments-table.h"
+#include "birth/initial-equipments-table.h"
#include "object/tval-types.h"
#include "sv-definition/sv-armor-types.h"
#include "sv-definition/sv-bow-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <tuple>
-#include "birth/inventory-initializer.h"
+#include "birth/inventory-initializer.h"
#include "autopick/autopick.h"
#include "birth/initial-equipments-table.h"
#include "floor/floor-object.h"
#include "inventory/inventory-object.h"
#include "inventory/inventory-slot-types.h"
+#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race-hook.h"
#include "monster/monster-list.h"
#include "monster/monster-util.h"
get_mon_num_prep(player_ptr, monster_hook_human, nullptr);
for (int i = rand_range(3, 4); i > 0; i--) {
q_ptr->prep(lookup_baseitem_id({ ItemKindType::CORPSE, SV_CORPSE }));
- q_ptr->pval = enum2i(get_mon_num(player_ptr, 0, 2, 0));
+ q_ptr->pval = enum2i(get_mon_num(player_ptr, 0, 2, PM_NONE));
if (q_ptr->pval) {
q_ptr->number = 1;
add_outfit(player_ptr, q_ptr);
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "birth/quick-start.h"
+#include "birth/quick-start.h"
#include "birth/birth-stat.h"
#include "birth/birth-util.h"
#include "birth/game-play-initializer.h"
-#pragma once
+#pragma once
#include "player-info/class-types.h"
#include "player-info/race-types.h"
-/*!
+/*!
* @file blue-magic-ball-bolt.cpp
* @brief 青魔法のボール/ボルト系呪文定義
*/
-#pragma once
+#pragma once
/*!
* @file blue-magic-ball-bolt.h
* @brief 青魔法のボール/ボルト系呪文ヘッダ
-/*!
+/*!
* @file blue-magic-breath.cpp
* @brief 青魔法のブレス系呪文定義
*/
-#pragma once
+#pragma once
/*!
* @file blue-magic-breath.h
* @brief 青魔法のブレス系呪文ヘッダ
-/*!
+/*!
* @file blue-magic-caster.cpp
* @brief 青魔法のその他系統の呪文定義と詠唱時分岐処理
*/
return cast_blue_summon_amberite(player_ptr, bmc_ptr);
case MonsterAbilityType::S_UNIQUE:
return cast_blue_summon_unique(player_ptr, bmc_ptr);
+ case MonsterAbilityType::S_DEAD_UNIQUE:
+ return cast_blue_summon_dead_unique(player_ptr, bmc_ptr);
default:
msg_print("hoge?");
return true;
-#pragma once
+#pragma once
/*!
* @file blue-magic-caster.h
* @brief 青魔法のその他系統の呪文定義と詠唱時分岐処理ヘッダ
-/*!
+/*!
* @file blue-magic-checker.cpp
* @brief 青魔法の処理実装 / Blue magic
* @date 2014/01/15
-#pragma once
+#pragma once
/*!
* @file blue-magic-checker.h
* @brief 青魔法の処理ヘッダ / Blue magic
-/*!
+/*!
* @file blue-magic-spirit-curse.cpp
* @brief 青魔法の呪い系処理定義
*/
-#pragma once
+#pragma once
/*!
* @file blue-magic-spirit-curse.h
* @brief 青魔法の呪い系処理ヘッダ
-/*!
+/*!
* @file blue-magic-status.cpp
* @brief 青魔法の状態異常系スペル定義
*/
-#pragma once
+#pragma once
/*!
* @file blue-magic-status.h
* @brief 青魔法の状態異常系スペルヘッダ
-/*!
+/*!
* @file blue-magic-summon.cpp
* @brief 青魔法の召喚系スペル定義
*/
return true;
}
+
+bool cast_blue_summon_dead_unique(PlayerType *player_ptr, bmc_type *bmc_ptr)
+{
+ BIT_FLAGS mode = bmc_ptr->g_mode | bmc_ptr->p_mode | PM_ALLOW_UNIQUE | PM_CLONE;
+
+ msg_print(_("特別な強敵を蘇らせた!", "You summon a special dead opponent!"));
+ if (summon_specific(player_ptr, (bmc_ptr->pet ? -1 : 0), player_ptr->y, player_ptr->x, bmc_ptr->summon_lev, SUMMON_DEAD_UNIQUE, mode)) {
+ if (!bmc_ptr->pet) {
+ msg_print(_("蘇生されたユニーク・モンスターは怒っている!", "The summoned special dead opponent is angry!"));
+ }
+ } else {
+ bmc_ptr->no_trump = true;
+ }
+
+ return true;
+}
-#pragma once
+#pragma once
/*!
* @file blue-magic-summon.h
* @brief 青魔法の召喚系スペルヘッダ
bool cast_blue_summon_high_dragon(PlayerType *player_ptr, bmc_type *bmc_ptr);
bool cast_blue_summon_amberite(PlayerType *player_ptr, bmc_type *bmc_ptr);
bool cast_blue_summon_unique(PlayerType *player_ptr, bmc_type *bmc_ptr);
+bool cast_blue_summon_dead_unique(PlayerType *player_ptr, bmc_type *bmc_ptr);
-/*!
+/*!
* @file blue-magic-util.cpp
* @brief 青魔法の構造体、初期化処理定義
*/
-#pragma once
+#pragma once
/*!
* @file blue-magic-util.h
* @brief 青魔法の構造体、初期化処理ヘッダ
-/*!
+/*!
* @file learnt-info.cpp
* @brief 青魔法の情報表示処理定義
*/
-#pragma once
+#pragma once
/*!
* @file learnt-info.h
* @brief 青魔法の情報表示処理ヘッダ
-/*!
+/*!
* @file learnt-power-getter.cpp
* @brief 青魔法の処理実行定義
*/
-#pragma once
+#pragma once
/*!
* @file learnt-power-getter.h
* @brief 青魔法の処理実行ヘッダ
-/*!
+/*!
* @brief 攻撃コマンド処理
* @date 2020/05/23
* @author Hourier
-#pragma once
+#pragma once
#include "combat/combat-options-type.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 剣術の実装 / Blade arts
* @date 2014/01/17
* @author
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_hissatsu(PlayerType *player_ptr);
-/*!
+/*!
* @brief ものまねの処理実装 / Imitation code
* @date 2014/01/14
* @author
}
break;
}
+ case MonsterAbilityType::S_DEAD_UNIQUE: {
+ auto count = 0;
+ if (!target_set(player_ptr, TARGET_KILL)) {
+ return false;
+ }
+ msg_print(_("特別な強敵を蘇生した!", "You summon special dead opponents!"));
+ for (auto k = 0; k < 4; k++) {
+ if (summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_DEAD_UNIQUE, (mode | PM_ALLOW_UNIQUE | PM_CLONE))) {
+ count++;
+ }
+ }
+ break;
+ }
default:
msg_print("hoge?");
}
-#pragma once
+#pragma once
class PlayerType;
bool do_cmd_mane(PlayerType *player_ptr, bool baigaesi);
-/*!
+/*!
* @brief 各職業の特殊技能実装 / Special magics
* @date 2014/01/15
* @author
return;
}
- term_erase(12, 21, 255);
- term_erase(12, 20, 255);
- term_erase(12, 19, 255);
- term_erase(12, 18, 255);
- term_erase(12, 17, 255);
- term_erase(12, 16, 255);
+ term_erase(12, 21);
+ term_erase(12, 20);
+ term_erase(12, 19);
+ term_erase(12, 18);
+ term_erase(12, 17);
+ term_erase(12, 16);
display_wrap_around(mind_tips[enum2i(use_mind)][n], 62, 17, 15);
switch (use_mind) {
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_mind(PlayerType *player_ptr);
-#include "cmd-action/cmd-move.h"
+#include "cmd-action/cmd-move.h"
#include "action/action-limited.h"
#include "action/movement-execution.h"
#include "action/run-execution.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_go_up(PlayerType *player_ptr);
-#include "cmd-action/cmd-open-close.h"
+#include "cmd-action/cmd-open-close.h"
#include "action/open-close-execution.h"
#include "action/open-util.h"
#include "cmd-action/cmd-attack.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_open(PlayerType *player_ptr);
-/*!
+/*!
* @brief その他の小さなコマンド処理群 (探索、汎用グリッド処理、自殺/引退/切腹)
* @date 2014/01/02
* @author
continue;
}
- if (!input_check_strict(player_ptr, _("よろしいですか?", "Are you sure? "), UserCheck::NO_HISTORY)) {
+ if (input_check_strict(player_ptr, _("よろしいですか?", "Are you sure? "), UserCheck::NO_HISTORY)) {
break;
}
}
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_search(PlayerType *player_ptr);
-#include "cmd-action/cmd-pet.h"
+#include "cmd-action/cmd-pet.h"
#include "action/action-limited.h"
#include "cmd-action/cmd-attack.h"
#include "cmd-io/cmd-dump.h"
-#pragma once
+#pragma once
class PlayerType;
bool do_cmd_riding(PlayerType *player_ptr, bool force);
-/*
+/*
* @brief クラス、種族、突然変異に関するコマンド処理
* @author Hourier
* @date 2022/02/24
{
auto &rpi = rc_ptr->power_desc[rc_ptr->command_code];
- term_erase(12, 21, 255);
- term_erase(12, 20, 255);
- term_erase(12, 19, 255);
- term_erase(12, 18, 255);
- term_erase(12, 17, 255);
- term_erase(12, 16, 255);
+ term_erase(12, 21);
+ term_erase(12, 20);
+ term_erase(12, 19);
+ term_erase(12, 18);
+ term_erase(12, 17);
+ term_erase(12, 16);
display_wrap_around(rpi.text, 62, 17, 15);
prt(_("何かキーを押して下さい。", "Hit any key."), 0, 0);
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_racial_power(PlayerType *player_ptr);
-#include "cmd-action/cmd-shoot.h"
+#include "cmd-action/cmd-shoot.h"
#include "combat/shoot.h"
#include "floor/floor-object.h"
#include "inventory/inventory-slot-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 魔法のインターフェイスと発動 / Purpose: Do everything for each spell
* @date 2013/12/31
* @author
}
/* Clear lines, position cursor (really should use strlen here) */
- term_erase(14, 14, 255);
- term_erase(14, 13, 255);
- term_erase(14, 12, 255);
- term_erase(14, 11, 255);
+ term_erase(14, 14);
+ term_erase(14, 13);
+ term_erase(14, 12);
+ term_erase(14, 11);
const auto spell_desc = exe_spell(player_ptr, use_realm, spell, SpellProcessType::DESCRIPTION);
display_wrap_around(spell_desc.value(), 62, 11, 15);
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-#include "cmd-action/cmd-travel.h"
+#include "cmd-action/cmd-travel.h"
#include "action/travel-execution.h"
#include "core/asking-player.h"
#include "floor/cave.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_travel(PlayerType *player_ptr);
-#include "cmd-action/cmd-tunnel.h"
+#include "cmd-action/cmd-tunnel.h"
#include "action/tunnel-execution.h"
#include "cmd-action/cmd-attack.h"
#include "core/disturbance.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_tunnel(PlayerType *player_ptr);
-/*!
+/*!
* @brief 町の施設処理 / Building commands
* @date 2013/12/23
* @author
-#pragma once
+#pragma once
#include "object/tval-types.h"
#include "system/angband.h"
-#include "cmd-building/cmd-inn.h"
+#include "cmd-building/cmd-inn.h"
#include "cmd-item/cmd-magiceat.h"
#include "core/turn-compensator.h"
#include "game-option/birth-options.h"
-#pragma once
+#pragma once
class PlayerType;
bool inn_comm(PlayerType *player_ptr, int cmd);
-#include "cmd-io/cmd-autopick.h"
+#include "cmd-io/cmd-autopick.h"
#include "autopick/autopick-command-menu.h"
#include "autopick/autopick-commands-table.h"
#include "autopick/autopick-dirty-flags.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_edit_autopick(PlayerType *player_ptr);
-#include "cmd-io/cmd-diary.h"
+#include "cmd-io/cmd-diary.h"
#include "core/asking-player.h"
#include "core/show-file.h"
#include "game-option/play-record-options.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_diary(PlayerType *player_ptr);
-/*!
+/*!
* @brief プレイヤーのインターフェイスに関するコマンドの実装 / Interface commands
* @date 2014/01/02
* @author
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_pref(PlayerType *player_ptr);
-#include "cmd-io/cmd-floor.h"
+#include "cmd-io/cmd-floor.h"
#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
{ { _("南西", " southwest of"), _("南", " south of"), _("南東", " southeast of") } },
} };
POSITION y1, x1;
- TERM_LEN wid, hgt;
- get_screen_size(&wid, &hgt);
+ const auto [wid, hgt] = get_screen_size();
POSITION y2 = y1 = panel_row_min;
POSITION x2 = x1 = panel_col_min;
constexpr auto fmt = _("マップ位置 [%d(%02d),%d(%02d)] (プレイヤーの%s) 方向?", "Map sector [%d(%02d),%d(%02d)], which is%s your sector. Direction?");
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_target(PlayerType *player_ptr);
-#include "cmd-io/cmd-gameoption.h"
+#include "cmd-io/cmd-gameoption.h"
#include "autopick/autopick.h"
#include "cmd-io/cmd-autopick.h"
#include "cmd-io/cmd-dump.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include "system/game-option-types.h"
-#include "cmd-io/cmd-help.h"
+#include "cmd-io/cmd-help.h"
#include "core/show-file.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_help(PlayerType *player_ptr);
-#include "cmd-io/cmd-knowledge.h"
+#include "cmd-io/cmd-knowledge.h"
#include "cmd-visual/cmd-draw.h"
#include "game-option/birth-options.h"
#include "grid/feature.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_knowledge(PlayerType *player_ptr);
-#include "cmd-io/cmd-lore.h"
+#include "cmd-io/cmd-lore.h"
#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "game-option/cheat-options.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_query_symbol(PlayerType *player_ptr);
-#include "cmd-io/cmd-macro.h"
+#include "cmd-io/cmd-macro.h"
#include "cmd-io/cmd-gameoption.h"
#include "cmd-io/macro-util.h"
#include "core/asking-player.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_macros(PlayerType *player_ptr);
-#include "cmd-io/cmd-menu-content-table.h"
+#include "cmd-io/cmd-menu-content-table.h"
#include "player-info/class-types.h"
#include "util/enum-converter.h"
#include "util/int-char-converter.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <optional>
-/*!
+/*!
* @brief 記念撮影のセーブとロード
* @date 2020/04/22
* @Author Hourier
void exe_cmd_save_screen_html(const std::filesystem::path &path, bool need_message)
{
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
auto *fff = angband_fopen(path, FileOpenMode::WRITE);
if (!check_screen_html_can_open(fff, path, need_message)) {
return;
return;
}
- int wid, hgt;
- term_get_size(&wid, &hgt);
-
- bool old_use_graphics = update_use_graphics(player_ptr);
+ const auto [wid, hgt] = term_get_size();
+ const auto old_use_graphics = update_use_graphics(player_ptr);
if (html_dump) {
exe_cmd_save_screen_html_with_naming();
*/
void do_cmd_load_screen(void)
{
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
const auto path = path_build(ANGBAND_DIR_USER, "dump.txt");
auto *fff = angband_fopen(path, FileOpenMode::READ);
if (!fff) {
-#pragma once
+#pragma once
#include <filesystem>
-#include "cmd-io/cmd-save.h"
+#include "cmd-io/cmd-save.h"
#include "cmd-io/cmd-dump.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_save_game(PlayerType *player_ptr, int is_autosave);
-/*
+/*
* @brief 日記のサブタイトルを表すテキストの配列群
* @date 2023/04/22
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-/*
+/*
* @brief 雰囲気を表すテキストの配列群
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "cmd-io/macro-util.h"
+#include "cmd-io/macro-util.h"
/* Current macro action [1024] */
std::vector<char> macro_buffers;
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "cmd-item/cmd-destroy.h"
+#include "cmd-item/cmd-destroy.h"
#include "autopick/autopick-registry.h"
#include "autopick/autopick.h"
#include "avatar/avatar.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_destroy(PlayerType *player_ptr);
-/*!
+/*!
* @brief プレイヤーの食べるコマンド実装
* @date 2018/09/07
@ @author deskull
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "cmd-item/cmd-equipment.h"
+#include "cmd-item/cmd-equipment.h"
#include "action/weapon-shield.h"
#include "artifact/fixed-art-types.h"
#include "autopick/autopick.h"
return;
}
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
command_new = 0;
command_gap = wid - 30;
}
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_equip(PlayerType *player_ptr);
-/*!
+/*!
* @brief プレイヤーのアイテムに関するコマンドの実装1 / Inventory and equipment commands
* @date 2014/01/02
* @author
return;
}
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
command_new = 0;
command_gap = wid - 30;
}
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_inven(PlayerType *player_ptr);
-/*!
+/*!
* @brief プレイヤーのアイテムに関するコマンドの実装2 / Spell/Prayer commands
* @date 2014/01/27
* @author
/* Browse */
else {
/* Clear lines, position cursor (really should use strlen here) */
- term_erase(7, 23, 255);
- term_erase(7, 22, 255);
- term_erase(7, 21, 255);
- term_erase(7, 20, 255);
+ term_erase(7, 23);
+ term_erase(7, 22);
+ term_erase(7, 21);
+ term_erase(7, 20);
display_wrap_around(baseitems_info[lookup_baseitem_id({ tval, sval })].text, 62, 21, 10);
continue;
-#pragma once
+#pragma once
class PlayerType;
bool do_cmd_magic_eater(PlayerType *player_ptr, bool only_browse, bool powerful);
-/*!
+/*!
* @brief プレイヤーの飲むコマンド実装
* @date 2018/09/07
* @author deskull
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_quaff_potion(PlayerType *player_ptr);
-/*!
+/*!
* @todo いずれcmd-item.c/h に統合したい
* @brief プレイヤーの読むコマンド実装
* @date 2018/09/07
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_read_scroll(PlayerType *player_ptr);
-#include "cmd-item/cmd-refill.h"
+#include "cmd-item/cmd-refill.h"
#include "floor/floor-object.h"
#include "inventory/inventory-object.h"
#include "inventory/inventory-slot-types.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_refill(PlayerType *player_ptr);
-/*
+/*
* @brief アイテム投擲コマンドの実装
* @date 2021/08/20
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "cmd-item/cmd-usestaff.h"
+#include "cmd-item/cmd-usestaff.h"
#include "action/action-limited.h"
#include "floor/floor-object.h"
#include "monster-floor/monster-summon.h"
-#pragma once
+#pragma once
class PlayerType;
int staff_effect(PlayerType *player_ptr, int sval, bool *use_charge, bool powerful, bool magic, bool known);
-#include "cmd-item/cmd-zaprod.h"
+#include "cmd-item/cmd-zaprod.h"
#include "action/action-limited.h"
#include "effect/attribute-types.h"
#include "floor/floor-object.h"
-#pragma once
+#pragma once
class PlayerType;
int rod_effect(PlayerType *player_ptr, int sval, int dir, bool *use_charge, bool powerful);
-#include "cmd-item/cmd-zapwand.h"
+#include "cmd-item/cmd-zapwand.h"
#include "action/action-limited.h"
#include "avatar/avatar.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
class PlayerType;
bool wand_effect(PlayerType *player_ptr, int sval, int dir, bool powerful, bool magic);
-#include "cmd-visual/cmd-draw.h"
+#include "cmd-visual/cmd-draw.h"
#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
std::string shower_str("");
std::string finder_str("");
std::string shower("");
- int wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
auto num_lines = hgt - 4;
auto n = message_num();
auto i = 0;
}
for (; j < num_lines; j++) {
- term_erase(0, num_lines + 1 - j, 255);
+ term_erase(0, num_lines + 1 - j);
}
prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"), i, i + j - 1, n), 0, 0);
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_redraw(PlayerType *player_ptr);
-#include "cmd-visual/cmd-map.h"
+#include "cmd-visual/cmd-map.h"
#include "autopick/autopick-methods-table.h"
#include "autopick/autopick-util.h"
#include "io/input-key-acceptor.h"
int cy, cx;
display_map(player_ptr, &cy, &cx);
if (autopick_list.empty() || player_ptr->wild_mode) {
- int wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
constexpr auto msg = _("何かキーを押すとゲームに戻ります", "Hit any key to continue");
const auto center_x = (wid - std::string_view(msg).length()) / 2;
put_str(msg, hgt - 1, center_x);
display_autopick = ITEM_DISPLAY;
while (true) {
- int wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
int row_message = hgt - 1;
put_str(_("何かキーを押してください('M':拾う 'N':放置 'D':M+N 'K':壊すアイテムを表示)",
" Hit M, N(for ~), K(for !), or D(same as M+N) to display auto-picker items."),
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_view_map(PlayerType *player_ptr);
-#include "cmd-visual/cmd-visuals.h"
+#include "cmd-visual/cmd-visuals.h"
#include "cmd-visual/cmd-draw.h"
#include "core/asking-player.h"
#include "core/visuals-reseter.h"
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_visuals(PlayerType *player_ptr);
-#include "combat/attack-accuracy.h"
+#include "combat/attack-accuracy.h"
#include "combat/combat-options-type.h"
#include "inventory/inventory-slot-types.h"
#include "main/sound-definitions-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "combat/attack-criticality.h"
+#include "combat/attack-criticality.h"
#include "combat/combat-options-type.h"
#include "inventory/inventory-slot-types.h"
#include "main/sound-of-music.h"
-#pragma once
+#pragma once
#include "combat/combat-options-type.h"
#include "main/sound-definitions-table.h"
-#include "combat/attack-power-table.h"
+#include "combat/attack-power-table.h"
/*!
* @brief 修行僧のターンダメージ算出テーブル
-#pragma once
+#pragma once
#include "system/angband.h"
#include "system/system-variables.h"
-/*!
+/*!
* @brief モンスターから直接攻撃を受けた時に、プレイヤーのオーラダメージで反撃する処理
* @date 2020/05/31
* @author Hourier
-#pragma once
+#pragma once
class MonsterAttackPlayer;
class PlayerType;
-#pragma once
+#pragma once
enum combat_options {
HISSATSU_NONE = 0,
-#include "combat/hallucination-attacks-table.h"
+#include "combat/hallucination-attacks-table.h"
/*!
* @brief 幻覚時の打撃記述テーブル / Weird melee attack types when hallucinating
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "combat/martial-arts-table.h"
+#include "combat/martial-arts-table.h"
/*!
* @brief マーシャルアーツ打撃テーブル
*/
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "combat/shoot.h"
+#include "combat/shoot.h"
#include "artifact/fixed-art-types.h"
#include "avatar/avatar.h"
#include "combat/attack-criticality.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#include "combat/slaying.h"
+#include "combat/slaying.h"
#include "artifact/fixed-art-types.h"
#include "effect/attribute-types.h"
#include "mind/mind-samurai.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "core/asking-player.h"
+#include "core/asking-player.h"
#include "cmd-io/macro-util.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
#include "util/flag-group.h"
#include <optional>
-#include "core/disturbance.h"
+#include "core/disturbance.h"
#include "action/travel-execution.h"
#include "game-option/disturbance-options.h"
#include "game-option/map-screen-options.h"
-#pragma once
+#pragma once
class PlayerType;
void disturb(PlayerType *player_ptr, bool stop_search, bool flush_output);
-/*
+/*
* @file game-closer.cpp
* @brief ゲーム終了処理
* @author Hourier
-#pragma once
+#pragma once
/*
* @file game-closer.h
-/*!
+/*!
* @brief ゲームプレイのメインルーチン
* @date 2020/05/10
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void play_game(PlayerType *player_ptr, bool new_game, bool browsing_movie);
-#include "core/magic-effects-timeout-reducer.h"
+#include "core/magic-effects-timeout-reducer.h"
#include "game-option/birth-options.h"
#include "mind/mind-force-trainer.h"
#include "mind/mind-magic-resistance.h"
-#pragma once
+#pragma once
class PlayerType;
void reduce_magic_effects_timeout(PlayerType *player_ptr);
-#include "core/object-compressor.h"
+#include "core/object-compressor.h"
#include "core/window-redrawer.h"
#include "floor/floor-object.h"
#include "floor/geometry.h"
-#pragma once
+#pragma once
class PlayerType;
void compact_objects(PlayerType *player_ptr, int size);
-#include "core/player-processor.h"
+#include "core/player-processor.h"
#include "action/run-execution.h"
#include "action/travel-execution.h"
#include "core/disturbance.h"
auto *floor_ptr = player_ptr->current_floor_ptr;
const auto wild_level = wilderness[player_ptr->wilderness_y][player_ptr->wilderness_x].level;
const auto level = floor_ptr->is_in_dungeon() ? floor_ptr->dun_level : wild_level;
- const auto r_idx = get_mon_num(player_ptr, 0, level, 0);
+ const auto r_idx = get_mon_num(player_ptr, 0, level, PM_NONE);
msg_print(nullptr);
if (MonsterRace(r_idx).is_valid() && one_in_(2)) {
POSITION y, x;
-#pragma once
+#pragma once
extern bool load; /*!<ロード処理中の分岐フラグ*/
extern bool can_save;
-#include "core/score-util.h"
+#include "core/score-util.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @file scores.c
* @brief ハイスコア処理 / Highscores handling
* @date 2014/07/14
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "core/show-file.h"
+#include "core/show-file.h"
#include "core/asking-player.h"
#include "io/files-util.h"
#include "io/input-key-acceptor.h"
i++;
}
- term_erase(cx, cy, 255);
+ term_erase(cx, cy);
}
/*!
{
TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, std::nullopt);
- int wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
char hook[68][32]{};
auto stripped_names = str_split(name_with_tag, '#');
}
while (row_count < rows) {
- term_erase(0, row_count + 2, 255);
+ term_erase(0, row_count + 2);
row_count++;
}
-#pragma once
+#pragma once
#include <stdint.h>
#include <string_view>
-#pragma once
+#pragma once
/*
* Special internal key
-#include "core/speed-table.h"
+#include "core/speed-table.h"
#include <vector>
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "core/stuff-handler.h"
+#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
#include "player/player-status.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "core/turn-compensator.h"
+#include "core/turn-compensator.h"
#include "floor/floor-town.h"
#include "player-info/race-types.h"
#include "store/store-owners.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "core/visuals-reseter.h"
+#include "core/visuals-reseter.h"
#include "game-option/special-options.h"
#include "io/read-pref-file.h"
#include "monster-race/monster-race.h"
-#pragma once
+#pragma once
class PlayerType;
void reset_visuals(PlayerType *player_ptr);
-/*!
+/*!
* @brief ウィンドウの再描画処理
* @date 2020/06/27
* @author Hourier
*/
static void print_dungeon(PlayerType *player_ptr)
{
- TERM_LEN width, height;
- term_get_size(&width, &height);
+ const auto [wid, hgt] = term_get_size();
- c_put_str(TERM_WHITE, " ", height + ROW_DUNGEON, COL_DUNGEON);
+ c_put_str(TERM_WHITE, " ", hgt + ROW_DUNGEON, COL_DUNGEON);
const auto dungeon_name = map_name(player_ptr);
TERM_LEN col = COL_DUNGEON + 6 - dungeon_name.length() / 2;
if (col < 0) {
col = 0;
}
- c_put_str(TERM_L_UMBER, dungeon_name, height + ROW_DUNGEON, col);
+ c_put_str(TERM_L_UMBER, dungeon_name, hgt + ROW_DUNGEON, col);
}
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#include "dungeon/dungeon-flag-types.h"
#include "util/flag-group.h"
-#pragma once
+#pragma once
enum class DungeonFeatureType {
WINNER,
-#include "dungeon/dungeon-processor.h"
+#include "dungeon/dungeon-processor.h"
#include "cmd-building/cmd-building.h"
#include "cmd-io/cmd-dump.h"
#include "core/disturbance.h"
-#pragma once
+#pragma once
class PlayerType;
void process_dungeon(PlayerType *player_ptr, bool load_game);
-#include "dungeon/quest-completion-checker.h"
+#include "dungeon/quest-completion-checker.h"
#include "dungeon/quest.h"
#include "effect/effect-characteristics.h"
#include "floor/cave.h"
-#pragma once
+#pragma once
#include "dungeon/quest.h"
#include "system/angband.h"
-#include "dungeon/quest-monster-placer.h"
+#include "dungeon/quest-monster-placer.h"
#include "dungeon/quest.h"
#include "floor/floor-generator-util.h"
#include "floor/geometry.h"
-#pragma once
+#pragma once
class PlayerType;
bool place_quest_monsters(PlayerType *player_ptr);
-#include "dungeon/quest.h"
+#include "dungeon/quest.h"
#include "artifact/fixed-art-types.h"
#include "cmd-io/cmd-dump.h"
#include "core/asking-player.h"
#include "locale/english.h"
#include "main/music-definitions-table.h"
#include "main/sound-of-music.h"
+#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags1.h"
get_mon_num_prep(player_ptr, mon_hook_quest, nullptr);
MonsterRaceId r_idx;
while (true) {
- r_idx = get_mon_num(player_ptr, 0, q_ptr->level + 5 + randint1(q_ptr->level / 10), GMN_ARENA);
+ r_idx = get_mon_num(player_ptr, 0, q_ptr->level + 5 + randint1(q_ptr->level / 10), PM_ARENA);
const auto &monrace = monraces_info[r_idx];
if (monrace.kind_flags.has_not(MonsterKindType::UNIQUE)) {
continue;
-#pragma once
+#pragma once
#include "system/angband.h"
#include "util/enum-converter.h"
-#pragma once
+#pragma once
#include "util/flag-group.h"
enum class AttributeType : int {
-#pragma once
+#pragma once
/*
* project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function
-#include "effect/effect-feature.h"
+#include "effect/effect-feature.h"
#include "dungeon/dungeon-flag-types.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h" // 暫定、後で消す.
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "effect/effect-item.h"
+#include "effect/effect-item.h"
#include "autopick/autopick.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "effect/effect-monster-charm.h"
+#include "effect/effect-monster-charm.h"
#include "avatar/avatar.h"
#include "dungeon/quest.h"
#include "effect/effect-monster-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <optional>
-#include "effect/effect-monster-curse.h"
+#include "effect/effect-monster-curse.h"
#include "effect/effect-monster-util.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-indice-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "effect/effect-monster-evil.h"
+#include "effect/effect-monster-evil.h"
#include "effect/effect-monster-util.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "effect/effect-monster-lite-dark.h"
+#include "effect/effect-monster-lite-dark.h"
#include "effect/effect-monster-util.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags-resistance.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "effect/effect-monster-oldies.h"
+#include "effect/effect-monster-oldies.h"
#include "avatar/avatar.h"
#include "effect/effect-monster-util.h"
#include "monster-floor/monster-generator.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "effect/effect-monster-psi.h"
+#include "effect/effect-monster-psi.h"
#include "core/window-redrawer.h"
#include "effect/effect-monster-util.h"
#include "floor/line-of-sight.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "effect/effect-monster-resist-hurt.h"
+#include "effect/effect-monster-resist-hurt.h"
#include "effect/effect-monster-util.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-brightness-flags.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "effect/effect-monster-spirit.h"
+#include "effect/effect-monster-spirit.h"
#include "effect/effect-monster-util.h"
#include "hpmp/hp-mp-processor.h"
#include "monster-race/monster-race.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* 本ファイル内の行数はまともなレベルに落ち着いているので、一旦ここに留め置くこととする
* @brief 魔法種別による各種処理切り替え
* @date 2020/04/29
-#pragma once
+#pragma once
#include "system/angband.h"
#include <optional>
-/*!
+/*!
* @brief effect_monster_type構造体の初期化処理
* @date 2020/04/29
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-/*!
+/*!
* @brief 魔法によるモンスターへの効果まとめ
* @date 2020/04/29
* @author Hourier
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "effect/effect-player-curse.h"
+#include "effect/effect-player-curse.h"
#include "blue-magic/blue-magic-checker.h"
#include "effect/effect-player.h"
#include "mind/mind-mirror-master.h"
-#pragma once
+#pragma once
class EffectPlayerType;
class PlayerType;
-#include "effect/effect-player-oldies.h"
+#include "effect/effect-player-oldies.h"
#include "effect/effect-player.h"
#include "game-option/birth-options.h"
#include "hpmp/hp-mp-processor.h"
-#pragma once
+#pragma once
class EffectPlayerType;
class PlayerType;
-#include "effect/effect-player-resist-hurt.h"
+#include "effect/effect-player-resist-hurt.h"
#include "artifact/fixed-art-types.h"
#include "blue-magic/blue-magic-checker.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
#include <string_view>
-#include "effect/effect-player-spirit.h"
+#include "effect/effect-player-spirit.h"
#include "blue-magic/blue-magic-checker.h"
#include "core/window-redrawer.h"
#include "effect/effect-player.h"
-#pragma once
+#pragma once
class EffectPlayerType;
class PlayerType;
-#include "effect/effect-player-switcher.h"
+#include "effect/effect-player-switcher.h"
#include "effect/attribute-types.h"
#include "effect/effect-player-curse.h"
#include "effect/effect-player-oldies.h"
-#pragma once
+#pragma once
class EffectPlayerType;
class PlayerType;
-/*!
+/*!
* @brief 魔法によるプレイヤーへの効果まとめ
* @date 2020/04/29
* @author Hourier
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "effect/effect-processor.h"
+#include "effect/effect-processor.h"
#include "core/stuff-handler.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "effect/spells-effect-util.h"
+#include "effect/spells-effect-util.h"
#include "monster-race/race-indice-types.h"
int rakubadam_m;
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-#pragma once
+#pragma once
// MSVCの警告レベルを最大に設定してあるためjson.hppが大量の警告を
// 出力してしまうのでヘッダのインクルード時のみ警告を抑制しておく
-// __ _____ _____ _____
+// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
// | | |__ | | | | | | version 3.11.2
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
-#include "flavor/flag-inscriptions-table.h"
+#include "flavor/flag-inscriptions-table.h"
#include "object-enchant/tr-types.h"
#ifdef JP
-#pragma once
+#pragma once
#include <optional>
#include <vector>
-/*!
+/*!
* @brief 武器/防具/アクセサリアイテムにおける、耐性やスレイ等の表記
* @date 2020/07/06
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#include "flavor/flavor-util.h"
+#include "flavor/flavor-util.h"
#include "flavor/flag-inscriptions-table.h"
#include "object-enchant/tr-flags.h"
#include "object-enchant/tr-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "flavor/named-item-describer.h"
+#include "flavor/named-item-describer.h"
#include "artifact/fixed-art-types.h"
#include "flavor/flavor-util.h"
#include "flavor/object-flavor-types.h"
-#pragma once
+#pragma once
#include <string>
-#pragma once
+#pragma once
enum object_description_type {
OD_NAME_ONLY = 0x00000001, /* Omit values, pval, inscription */
-/*!
+/*!
* @brief オブジェクトの記述処理 / Mbject flavor code
* @date 2014/01/03
* @author
-#pragma once
+#pragma once
#include <string>
-/*!
+/*!
* @brief 個々のアイテム種別について、未鑑定名/鑑定後の正式な名前を取得する処理
* @date 2020/07/07
* @author Hourier
-#pragma once
+#pragma once
#include <string>
#include <utility>
-#include "floor/cave-generator.h"
+#include "floor/cave-generator.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/quest-monster-placer.h"
#include "floor/dungeon-tunnel-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief ダンジョンの壁等に関する判定関数の集合
* @date 2020/07/18
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "floor/dungeon-tunnel-util.h"
+#include "floor/dungeon-tunnel-util.h"
#include "system/angband.h"
/*
-#pragma once
+#pragma once
struct dt_type {
int dun_tun_rnd; /*!< ダンジョンの通路方向を掻き回す頻度(一回の試行ごとに%で判定している) */
-#include "floor/fixed-map-generator.h"
+#include "floor/fixed-map-generator.h"
#include "artifact/fixed-art-generator.h"
#include "artifact/fixed-art-types.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/* Dungeon allocation "places" */
enum dap_type : int {
-#pragma once
+#pragma once
/*!
* @brief ダンジョンの最深層 / Maximum dungeon level.
-#include "floor/floor-changer.h"
+#include "floor/floor-changer.h"
#include "action/travel-execution.h"
#include "dungeon/quest-monster-placer.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
class PlayerType;
void change_floor(PlayerType *player_ptr);
-#include "floor/floor-events.h"
+#include "floor/floor-events.h"
#include "cmd-io/cmd-dump.h"
#include "core/disturbance.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
class PlayerType;
class FloorType;
-#pragma once
+#pragma once
#define SAFE_MAX_ATTEMPTS 5000 /*!< 生成処理基本試行回数 */
-/*!
+/*!
* @brief ダンジョンの生成 / Dungeon generation
* @date 2014/01/04
* @author
-#pragma once
+#pragma once
class FloorType;
class PlayerType;
-#include "floor/floor-leaver.h"
+#include "floor/floor-leaver.h"
#include "cmd-building/cmd-building.h"
#include "floor/cave.h"
#include "floor/floor-events.h"
-#pragma once
+#pragma once
class PlayerType;
void leave_floor(PlayerType *player_ptr);
-#include "floor/floor-mode-changer.h"
+#include "floor/floor-mode-changer.h"
#include "system/player-type-definition.h"
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief フロア生成時にアイテムを配置する
* @date 2020/06/01
* @author Hourier
-#pragma once
+#pragma once
#include "object/item-tester-hooker.h"
#include "system/angband.h"
-#include "floor/floor-save-util.h"
+#include "floor/floor-save-util.h"
/*
* Sign for current process used in temporary files.
-#pragma once
+#pragma once
#include "system/angband.h"
#include "system/monster-entity.h"
-/*!
+/*!
* @brief 保存された階の管理 / management of the saved floor
* @date 2014/01/04
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief ダンジョン生成に利用する関数群 / Used by dungeon generation.
* @date 2014/07/15
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "floor/floor-town.h"
+#include "floor/floor-town.h"
#include "system/item-entity.h"
/* The towns [towns_info.size()] */
-#pragma once
+#pragma once
#include "store/store-util.h"
#include "system/angband.h"
-/*!
+/*!
* @brief フロア全体の処理に関するユーティリティ
* @date 2019/04/24
* @author deskull
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-#include "floor/geometry.h"
+#include "floor/geometry.h"
#include "floor/cave.h"
#include "game-option/text-display-options.h"
#include "grid/feature.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "floor/line-of-sight.h"
+#include "floor/line-of-sight.h"
#include "floor/cave.h"
#include "system/floor-type-definition.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "floor/object-allocator.h"
+#include "floor/object-allocator.h"
#include "dungeon/quest.h"
#include "floor/cave.h"
#include "floor/dungeon-tunnel-util.h"
-#pragma once
+#pragma once
#include "floor/floor-allocation-types.h"
#include "system/angband.h"
-#include "floor/object-scanner.h"
+#include "floor/object-scanner.h"
#include "flavor/flavor-describer.h"
#include "floor/cave.h"
#include "game-option/text-display-options.h"
COMMAND_CODE i, m;
int j, k, l;
ItemEntity *o_ptr;
- char tmp_val[80];
- COMMAND_CODE out_index[23];
- TERM_COLOR out_color[23];
+ char tmp_val[80]{};
+ COMMAND_CODE out_index[23]{};
+ TERM_COLOR out_color[23]{};
std::array<std::string, 23> descriptions{};
COMMAND_CODE target_item_label = 0;
- OBJECT_IDX floor_list[23];
+ OBJECT_IDX floor_list[23]{};
ITEM_NUMBER floor_num;
- TERM_LEN wid, hgt;
- char floor_label[52 + 1];
- bool dont_need_to_show_weights = true;
- term_get_size(&wid, &hgt);
- int len = std::max((*min_width), 20);
+ char floor_label[52 + 1]{};
+ auto dont_need_to_show_weights = true;
+ const auto [wid, hgt] = term_get_size();
+ auto len = std::max((*min_width), 20);
floor_num = scan_floor_items(player_ptr, floor_list, y, x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, item_tester);
auto *floor_ptr = player_ptr->current_floor_ptr;
for (k = 0, i = 0; i < floor_num && i < 23; i++) {
-#pragma once
+#pragma once
#include "object/tval-types.h"
#include "system/angband.h"
-#include "floor/pattern-walk.h"
+#include "floor/pattern-walk.h"
#include "cmd-io/cmd-save.h"
#include "core/asking-player.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "floor/tunnel-generator.h"
+#include "floor/tunnel-generator.h"
#include "floor/cave.h"
#include "floor/dungeon-tunnel-util.h"
#include "floor/geometry.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 荒野マップの生成とルール管理 / Wilderness generation
* @date 2014/02/13
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
#include <vector>
-#include "game-option/auto-destruction-options.h"
+#include "game-option/auto-destruction-options.h"
bool destroy_items; /* Use easy auto-destroyer */
bool destroy_feeling; /* Apply auto-destroy as sense feeling */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/birth-options.h"
+#include "game-option/birth-options.h"
bool smart_learn; /* Monsters learn from their mistakes (*) */
bool smart_cheat; /* Monsters exploit players weaknesses (*) */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/cheat-options.h"
+#include "game-option/cheat-options.h"
bool cheat_peek; /* Peek into object creation */
bool cheat_hear; /* Peek into monster creation */
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
enum cheat_type {
CHEAT_OBJECT = 0,
-#include "game-option/disturbance-options.h"
+#include "game-option/disturbance-options.h"
bool find_ignore_stairs; /* Run past stairs */
bool find_ignore_doors; /* Run through open doors */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/game-play-options.h"
+#include "game-option/game-play-options.h"
bool stack_force_notes; /* Merge inscriptions when stacking */
bool stack_force_costs; /* Merge discounts when stacking */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/input-options.h"
+#include "game-option/input-options.h"
bool rogue_like_commands; /* Rogue-like commands */
bool always_pickup; /* Pick things up by default */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/keymap-directory-getter.h"
+#include "game-option/keymap-directory-getter.h"
#include "game-option/input-options.h"
#include "io/input-key-requester.h"
#include "system/angband.h"
-#pragma once
+#pragma once
enum keymap_mode {
KEYMAP_MODE_ORIG = 0, /*!< オリジナルキー配置 / Mode for original keyset commands */
-#include "game-option/map-screen-options.h"
+#include "game-option/map-screen-options.h"
bool center_player; /* Center map while walking (*slow*) */
bool center_running; /* Centering even while running */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/option-flags.h"
+#include "game-option/option-flags.h"
#include "system/redrawing-flags-updater.h"
std::array<uint32_t, MAX_WINDOW_ENTITIES> g_option_flags = {};
-#pragma once
+#pragma once
#include "system/redrawing-flags-updater.h"
#include "util/flag-group.h"
-#include "game-option/option-types-table.h"
+#include "game-option/option-types-table.h"
#include "game-option/auto-destruction-options.h"
#include "game-option/birth-options.h"
#include "game-option/cheat-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <vector>
-#include "game-option/play-record-options.h"
+#include "game-option/play-record-options.h"
bool record_fix_art; /* Record fixed artifacts */
bool record_rand_art; /* Record random artifacts */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/runtime-arguments.h"
+#include "game-option/runtime-arguments.h"
bool arg_sound; /* Command arg -- Request special sounds */
int arg_sound_volume_table_index;
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/special-options.h"
+#include "game-option/special-options.h"
byte hitpoint_warn; /* Hitpoint warning (0 to 9) */
byte mana_warn; /* Mana color (0 to 9) */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "game-option/text-display-options.h"
+#include "game-option/text-display-options.h"
bool plain_descriptions; /* Plain object descriptions */
bool plain_pickup; /* Plain pickup messages(japanese only) */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "grid/door.h"
+#include "grid/door.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/cave.h"
#include "grid/feature.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "grid/feature-action-flags.h"
+#include "grid/feature-action-flags.h"
/*!
* @brief 地形状態フラグテーブル /
-#pragma once
+#pragma once
#include "grid/feature-flag-types.h"
#include "system/angband.h"
-#pragma once
+#pragma once
#include "util/enum-converter.h"
-#include "grid/feature-generator.h"
+#include "grid/feature-generator.h"
#include "dungeon/dungeon-flag-mask.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "grid/feature.h"
+#include "grid/feature.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/cave.h"
#include "floor/geometry.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-/*!
+/*!
* @brief グリッドの実装 / low level dungeon routines -BEN-
* @date 2013/12/30
* @author
-#pragma once
+#pragma once
/*!
* @file grid.h
-#include "grid/lighting-colors-table.h"
+#include "grid/lighting-colors-table.h"
#include "term/term-color-types.h"
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "grid/object-placer.h"
+#include "grid/object-placer.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
#include "grid/grid.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "grid/stair.h"
+#include "grid/stair.h"
#include "dungeon/quest.h"
#include "floor/cave.h"
#include "game-option/birth-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "grid/trap.h"
+#include "grid/trap.h"
#include "cmd-io/cmd-dump.h"
#include "cmd-io/cmd-save.h"
#include "core/disturbance.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include "util/flag-group.h"
-#include "hpmp/hp-mp-processor.h"
+#include "hpmp/hp-mp-processor.h"
#include "avatar/avatar.h"
#include "cmd-action/cmd-pet.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
class PlayerType;
void process_player_hp_mp(PlayerType *player_ptr);
-#include "hpmp/hp-mp-regenerator.h"
+#include "hpmp/hp-mp-regenerator.h"
#include "cmd-item/cmd-magiceat.h"
#include "core/window-redrawer.h"
#include "inventory/inventory-slot-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "info-reader/artifact-reader.h"
+#include "info-reader/artifact-reader.h"
#include "artifact/fixed-art-types.h"
#include "artifact/random-art-effects.h"
#include "info-reader/baseitem-tokens-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-/*
+/*
* @brief ベースアイテム定義の読み込み処理
* @author Hourier
* @date 2022/10/10
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#include "info-reader/baseitem-tokens-table.h"
+#include "info-reader/baseitem-tokens-table.h"
// clang-format off
/*!
-#pragma once
+#pragma once
#include "object-enchant/tr-types.h"
#include "object-enchant/trg-types.h"
-#include "info-reader/dungeon-info-tokens-table.h"
+#include "info-reader/dungeon-info-tokens-table.h"
#include "dungeon/dungeon-flag-types.h"
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "info-reader/dungeon-reader.h"
+#include "info-reader/dungeon-reader.h"
#include "grid/feature.h"
#include "info-reader/dungeon-info-tokens-table.h"
#include "info-reader/feature-reader.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#include "info-reader/ego-reader.h"
+#include "info-reader/ego-reader.h"
#include "artifact/random-art-effects.h"
#include "info-reader/baseitem-tokens-table.h"
#include "info-reader/info-reader-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#include "info-reader/feature-info-tokens-table.h"
+#include "info-reader/feature-info-tokens-table.h"
/*!
* @brief 地形属性トークンの定義 / Feature info flags
-#pragma once
+#pragma once
#include "grid/feature-flag-types.h"
#include "system/angband.h"
-#include "info-reader/feature-reader.h"
+#include "info-reader/feature-reader.h"
#include "floor/wild.h"
#include "grid/feature.h"
#include "grid/grid.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-/*!
+/*!
* @brief ゲームデータ初期化1 / Initialization (part 1) -BEN-
* @date 2014/01/28
* @author
-#pragma once
+#pragma once
#include <set>
#include <string_view>
-#include "info-reader/general-parser.h"
+#include "info-reader/general-parser.h"
#include "artifact/fixed-art-types.h"
#include "dungeon/quest.h"
#include "grid/feature.h"
-#pragma once
+#pragma once
#include "object-enchant/object-ego.h"
#include "system/angband.h"
-#include "info-reader/info-reader-util.h"
+#include "info-reader/info-reader-util.h"
#include "artifact/random-art-effects.h"
#include "main/angband-headers.h"
#include "object-enchant/activation-info-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include "util/bit-flags-calculator.h"
-#include "info-reader/magic-reader.h"
+#include "info-reader/magic-reader.h"
#include "info-reader/info-reader-util.h"
#include "info-reader/parse-error-types.h"
#include "main/angband-headers.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#pragma once
+#pragma once
enum parse_error_type : int {
PARSE_ERROR_NONE = 0,
-#include "info-reader/race-info-tokens-table.h"
+#include "info-reader/race-info-tokens-table.h"
#include "monster-attack/monster-attack-effect.h"
#include "monster-attack/monster-attack-table.h"
#include "monster-race/race-ability-flags.h"
{"S_HI_DRAGON", MonsterAbilityType::S_HI_DRAGON },
{"S_AMBERITES", MonsterAbilityType::S_AMBERITES },
{"S_UNIQUE", MonsterAbilityType::S_UNIQUE },
+ {"S_DEAD_UNIQUE", MonsterAbilityType::S_DEAD_UNIQUE },
};
/* clang-format on */
-#pragma once
+#pragma once
#include "monster-attack/monster-attack-effect.h"
#include "monster-attack/monster-attack-table.h"
-#include "info-reader/race-reader.h"
+#include "info-reader/race-reader.h"
#include "info-reader/info-reader-util.h"
#include "info-reader/parse-error-types.h"
#include "info-reader/race-info-tokens-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#pragma once
+#pragma once
/* Random dungeon grid effects */
enum rdge_type {
-#include "info-reader/skill-reader.h"
+#include "info-reader/skill-reader.h"
#include "info-reader/info-reader-util.h"
#include "info-reader/parse-error-types.h"
#include "main/angband-headers.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#include "info-reader/vault-reader.h"
+#include "info-reader/vault-reader.h"
#include "info-reader/info-reader-util.h"
#include "info-reader/parse-error-types.h"
#include "main/angband-headers.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-/*!
+/*!
* @brief オブジェクト選択処理
* @date 2020/07/02
* @author Hourier
-#pragma once
+#pragma once
#include "object/tval-types.h"
#include "system/angband.h"
-#include "inventory/inventory-curse.h"
+#include "inventory/inventory-curse.h"
#include "artifact/fixed-art-types.h"
#include "core/asking-player.h"
#include "core/disturbance.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "inventory/inventory-damage.h"
+#include "inventory/inventory-damage.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "inventory/inventory-object.h"
-#pragma once
+#pragma once
#include "object/object-broken.h"
-#include "inventory/inventory-describer.h"
+#include "inventory/inventory-describer.h"
#include "game-option/birth-options.h"
#include "inventory/inventory-slot-types.h"
#include "player/player-status-flags.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "inventory/inventory-object.h"
+#include "inventory/inventory-object.h"
#include "core/window-redrawer.h"
#include "flavor/flavor-describer.h"
#include "floor/floor-object.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
enum inventory_slot_type {
INVEN_PACK = 23, /*!< アイテムスロット…所持品(0~) */
-/*!
+/*!
* @brief インベントリ関係のユーティリティ
* @date 2020/07/02
* @author Hourier
-#pragma once
+#pragma once
#include "object/tval-types.h"
#include "system/angband.h"
-#include "inventory/item-getter.h"
+#include "inventory/item-getter.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
#include "game-option/input-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "inventory/item-selection-util.h"
+#include "inventory/item-selection-util.h"
#include "io/input-key-requester.h"
#include "object/item-use-flags.h"
-#pragma once
+#pragma once
#include "object/tval-types.h"
#include "system/angband.h"
-#include "inventory/pack-overflow.h"
+#include "inventory/pack-overflow.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
#include "flavor/flavor-describer.h"
-#pragma once
+#pragma once
class PlayerType;
void pack_overflow(PlayerType *player_ptr);
-#include "inventory/player-inventory.h"
+#include "inventory/player-inventory.h"
#include "autopick/autopick.h"
#include "core/asking-player.h"
#include "core/disturbance.h"
-#pragma once
+#pragma once
#include "object/tval-types.h"
#include "system/angband.h"
-#include "inventory/recharge-processor.h"
+#include "inventory/recharge-processor.h"
#include "core/disturbance.h"
#include "core/window-redrawer.h"
#include "flavor/flavor-describer.h"
-#pragma once
+#pragma once
class PlayerType;
void recharge_magic_items(PlayerType *player_ptr);
-#include "io-dump/character-dump.h"
+#include "io-dump/character-dump.h"
#include "artifact/fixed-art-types.h"
#include "avatar/avatar.h"
#include "cmd-building/cmd-building.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "io-dump/dump-remover.h"
+#include "io-dump/dump-remover.h"
#include "io-dump/dump-util.h"
#include "io/read-pref-file.h"
#include "term/z-form.h"
-#pragma once
+#pragma once
#include <filesystem>
#include <string_view>
-#include "io-dump/dump-util.h"
+#include "io-dump/dump-util.h"
#include "floor/geometry.h"
#include "game-option/keymap-directory-getter.h"
#include "game-option/special-options.h"
if ((ddx[d] > 0) && ddy[d]) {
int browser_rows;
- int wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
browser_rows = hgt - 8;
if (!col) {
int old_grp = grp;
-#pragma once
+#pragma once
#include "system/angband.h"
#include "system/terrain-type-definition.h"
-#include "io-dump/player-status-dump.h"
+#include "io-dump/player-status-dump.h"
#include "view/display-player.h"
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "io-dump/random-art-info-dumper.h"
+#include "io-dump/random-art-info-dumper.h"
#include "floor/floor-town.h"
#include "inventory/inventory-slot-types.h"
#include "io/files-util.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "util/angband-files.h"
+#include "util/finalizer.h"
#include "view/display-messages.h"
#include "wizard/artifact-analyzer.h"
#include "wizard/fixed-artifacts-spoiler.h"
#include "wizard/spoiler-util.h"
+#include <sstream>
/*!
* @brief ランダムアーティファクト1件をスポイラー出力する /
* @param art_ptr 記述内容を収めた構造体参照ポインタ
* Fill in an object description structure for a given object
*/
-static void spoiler_print_randart(ItemEntity *o_ptr, obj_desc_list *art_ptr)
+static void spoiler_print_randart(ItemEntity *o_ptr, obj_desc_list *art_ptr, std::ofstream &ofs)
{
- pval_info_type *pval_ptr = &art_ptr->pval_info;
- fprintf(spoiler_file, "%s\n", art_ptr->description);
+ const auto finalizer = util::make_finalizer([art_ptr, &ofs]() {
+ ofs << spoiler_indent << art_ptr->misc_desc << "\n\n";
+ });
+ const auto *pval_ptr = &art_ptr->pval_info;
+ ofs << art_ptr->description << '\n';
if (!o_ptr->is_fully_known()) {
- fprintf(spoiler_file, _("%s不明\n", "%sUnknown\n"), spoiler_indent);
- } else {
- if (pval_ptr->pval_desc[0]) {
- spoiler_outlist(std::string(pval_ptr->pval_desc).append(_("の修正:", " to")).data(), pval_ptr->pval_affects, item_separator);
- }
+ ofs << format(_("%s不明\n", "%sUnknown\n"), spoiler_indent.data());
+ return;
+ }
- spoiler_outlist(_("対:", "Slay"), art_ptr->slays, item_separator);
- spoiler_outlist(_("武器属性:", ""), art_ptr->brands, list_separator);
- spoiler_outlist(_("免疫:", "Immunity to"), art_ptr->immunities, item_separator);
- spoiler_outlist(_("耐性:", "Resist"), art_ptr->resistances, item_separator);
- spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustains, item_separator);
- spoiler_outlist("", art_ptr->misc_magic, list_separator);
- if (art_ptr->activation) {
- fprintf(spoiler_file, _("%s発動: %s\n", "%sActivates for %s\n"), spoiler_indent, art_ptr->activation);
- }
+ if (!pval_ptr->pval_desc.empty()) {
+ std::stringstream ss;
+ ss << pval_ptr->pval_desc << _("の修正:", " to");
+ spoiler_outlist(ss.str(), pval_ptr->pval_affects, item_separator, ofs);
}
- fprintf(spoiler_file, "%s%s\n\n", spoiler_indent, art_ptr->misc_desc);
+ spoiler_outlist(_("対:", "Slay"), art_ptr->slays, item_separator, ofs);
+ spoiler_outlist(_("武器属性:", ""), art_ptr->brands, list_separator, ofs);
+ spoiler_outlist(_("免疫:", "Immunity to"), art_ptr->immunities, item_separator, ofs);
+ spoiler_outlist(_("耐性:", "Resist"), art_ptr->resistances, item_separator, ofs);
+ spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustenances, item_separator, ofs);
+ spoiler_outlist("", art_ptr->misc_magic, list_separator, ofs);
+ if (!art_ptr->activation.empty()) {
+ ofs << format(_("%s発動: %s\n", "%sActivates for %s\n"), spoiler_indent.data(), art_ptr->activation.data());
+ }
}
/*!
* @param o_ptr ランダムアーティファクトのオブジェクト構造体参照ポインタ
* @param tval 出力したいランダムアーティファクトの種類
*/
-static void spoil_random_artifact_aux(PlayerType *player_ptr, ItemEntity *o_ptr, ItemKindType tval)
+static void spoil_random_artifact_aux(PlayerType *player_ptr, ItemEntity *o_ptr, ItemKindType tval, std::ofstream &ofs)
{
obj_desc_list artifact;
if (!o_ptr->is_known() || !o_ptr->is_random_artifact() || (o_ptr->bi_key.tval() != tval)) {
}
random_artifact_analyze(player_ptr, o_ptr, &artifact);
- spoiler_print_randart(o_ptr, &artifact);
+ spoiler_print_randart(o_ptr, &artifact, ofs);
}
/*!
- * @brief ランダムアーティファクト内容をスポイラー出力するメインルーチン /
- * Create a list file for random artifacts
- * @param fname 出力ファイル名
+ * @brief ランダムアーティファクト内容をスポイラー出力するメインルーチン
+ * @param player_ptr プレイヤーへの参照ポインタ
*/
-void spoil_random_artifact(PlayerType *player_ptr, concptr fname)
+void spoil_random_artifact(PlayerType *player_ptr)
{
- const auto &path = path_build(ANGBAND_DIR_USER, fname);
- spoiler_file = angband_fopen(path, FileOpenMode::WRITE);
- if (!spoiler_file) {
+ const auto &path = path_build(ANGBAND_DIR_USER, "randifact.txt");
+ std::ofstream ofs(path);
+ if (!ofs) {
msg_print("Cannot create list file.");
return;
}
- spoiler_underline("Random artifacts list.\r");
+ spoiler_underline("Random artifacts list.\r", ofs);
for (const auto &[tval_list, name] : group_artifact_list) {
for (auto tval : tval_list) {
for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
auto *q_ptr = &player_ptr->inventory_list[i];
- spoil_random_artifact_aux(player_ptr, q_ptr, tval);
+ spoil_random_artifact_aux(player_ptr, q_ptr, tval, ofs);
}
for (int i = 0; i < INVEN_PACK; i++) {
auto *q_ptr = &player_ptr->inventory_list[i];
- spoil_random_artifact_aux(player_ptr, q_ptr, tval);
+ spoil_random_artifact_aux(player_ptr, q_ptr, tval, ofs);
}
const auto *store_ptr = &towns_info[1].stores[StoreSaleType::HOME];
for (int i = 0; i < store_ptr->stock_num; i++) {
auto *q_ptr = &store_ptr->stock[i];
- spoil_random_artifact_aux(player_ptr, q_ptr, tval);
+ spoil_random_artifact_aux(player_ptr, q_ptr, tval, ofs);
}
store_ptr = &towns_info[1].stores[StoreSaleType::MUSEUM];
for (int i = 0; i < store_ptr->stock_num; i++) {
auto *q_ptr = &store_ptr->stock[i];
- spoil_random_artifact_aux(player_ptr, q_ptr, tval);
+ spoil_random_artifact_aux(player_ptr, q_ptr, tval, ofs);
}
}
}
- if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
- msg_print("Cannot close list file.");
- return;
- }
-
- msg_print("Successfully created a list file.");
+ const auto mes = ofs.good() ? "Successfully created a list file." : "Failed to create a list file.";
+ msg_print(mes);
}
-#pragma once
-
-#include "system/angband.h"
+#pragma once
class PlayerType;
-void spoil_random_artifact(PlayerType *player_ptr, concptr fname);
+void spoil_random_artifact(PlayerType *player_ptr);
-/*!
+/*!
* @brief 一部職業でのみダンプする能力の出力処理
* @date 2020/03/07
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "io/command-repeater.h"
+#include "io/command-repeater.h"
#include "io/input-key-requester.h"
#include "util/int-char-converter.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "io/cursor.h"
+#include "io/cursor.h"
#include "core/stuff-handler.h"
#include "effect/effect-characteristics.h"
#include "effect/spells-effect-util.h"
*/
bool change_panel(PlayerType *player_ptr, POSITION dy, POSITION dx)
{
- TERM_LEN wid, hgt;
- get_screen_size(&wid, &hgt);
-
+ const auto [wid, hgt] = get_screen_size();
POSITION y = panel_row_min + dy * hgt / 2;
POSITION x = panel_col_min + dx * wid / 2;
*/
void panel_bounds_center(void)
{
- TERM_LEN wid, hgt;
- get_screen_size(&wid, &hgt);
+ const auto [wid, hgt] = get_screen_size();
panel_row_max = panel_row_min + hgt - 1;
panel_row_prt = panel_row_min - 1;
panel_col_max = panel_col_min + wid - 1;
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 異常発生時のゲーム緊急終了処理
* @date 2020/03/01
* @author Hourier
-#pragma once
+#pragma once
/*
* Windowsのコードからは呼ばれない。よってVSからは見えない
*/
-/*!
+/*!
* @brief ファイル入出力管理 / Purpose: code dealing with files (and death)
* @date 2014/01/28
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
#include <filesystem>
-/*!
+/*!
* @brief Index of spell type names
*/
-#pragma once
+#pragma once
#include <string>
#include <vector>
-#include "io/input-key-acceptor.h"
+#include "io/input-key-acceptor.h"
#include "cmd-io/macro-util.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief キー入力に応じてゲーム内コマンドを実行する
* @date 2022/02/20
* @author Hourier
break;
}
case KTRL('V'): {
- spoil_random_artifact(player_ptr, "randifact.txt");
+ spoil_random_artifact(player_ptr);
break;
}
case '`': {
-#pragma once
+#pragma once
class PlayerType;
bool enter_wizard_mode(PlayerType *player_ptr);
-#include "io/input-key-requester.h"
+#include "io/input-key-requester.h"
#include "cmd-io/cmd-menu-content-table.h"
#include "cmd-io/macro-util.h"
#include "core/asking-player.h" //!< @todo 相互依存している、後で何とかする.
-#pragma once
+#pragma once
#include "game-option/keymap-directory-getter.h"
#include "system/angband.h"
-/*!
+/*!
* @brief prefファイルの内容を解釈しメモリに展開する
* @date 2020/03/01
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 突然変異の一覧を出力する
* @date 2020/04/24
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "io/pref-file-expressor.h"
+#include "io/pref-file-expressor.h"
#include "game-option/runtime-arguments.h"
#include "player-info/class-info.h"
#include "player-info/race-info.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*
+/*
* @brief プレイヤーのインターフェイスに関するコマンドの実装 / Interface commands
* @date 2023/04/30
* @author Mogami & Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include <filesystem>
-/*!
+/*!
* @brief 録画・再生機能
* @date 2014/01/02
* @author 2014 Deskull rearranged comment for Doxygen.
/* プレイホストのマップが大きいときクライアントのマップもリサイズする */
static void update_term_size(int x, int y, int len)
{
- int ox, oy;
int nx, ny;
- term_get_size(&ox, &oy);
+ const auto [ox, oy] = term_get_size();
nx = ox;
ny = oy;
-#pragma once
+#pragma once
#include <filesystem>
#include <string_view>
-/*!
+/*!
* @file report.c
* @brief スコアサーバ転送機能の実装
* @date 2014/07/14
"</pre>\n"
"</body>\n</html>\n";
- int wid, hgt;
- term_get_size(&wid, &hgt);
-
+ const auto [wid, hgt] = term_get_size();
std::stringstream screen_ss;
auto &rfu = RedrawingFlagsUpdater::get_instance();
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 画面描画のユーティリティ
* @date 2018/09/25
* @author
}
/*!
- * @brief 現在のコンソール表示の縦横を返す。 /
- * Get term size and calculate screen size
- * @param wid_p コンソールの表示幅文字数を返す
- * @param hgt_p コンソールの表示行数を返す
+ * @brief 現在のコンソール表示の縦横を返す
*/
-void get_screen_size(TERM_LEN *wid_p, TERM_LEN *hgt_p)
+std::pair<int, int> get_screen_size()
{
- term_get_size(wid_p, hgt_p);
- *hgt_p -= ROW_MAP + 2;
- *wid_p -= COL_MAP + 2;
+ auto [width, height] = term_get_size();
+ height -= ROW_MAP + 2;
+ width -= COL_MAP + 2;
if (use_bigtile) {
- *wid_p /= 2;
+ width /= 2;
}
+
+ return { width, height };
}
/*
* Determines if a map location is currently "on screen" -RAK-
* Note that "panel_contains(Y,X)" always implies "in_bounds2(Y,X)".
*/
-bool panel_contains(POSITION y, POSITION x)
+bool panel_contains(int y, int x)
{
return (y >= panel_row_min) && (y <= panel_row_max) && (x >= panel_col_min) && (x <= panel_col_max);
}
-#pragma once
+#pragma once
-#include "system/angband.h"
+#include <utility>
-void get_screen_size(TERM_LEN *wid_p, TERM_LEN *hgt_p);
+std::pair<int, int> get_screen_size();
void resize_map(void);
-bool panel_contains(POSITION y, POSITION x);
+bool panel_contains(int y, int x);
-/*!
+/*!
* @file signal-handlers.c
* @brief シグナルハンドラの管理 / Controlling signal handlers
* @date 2020/02/23
quit(_("強制終了", "interrupt"));
} else if (signal_count >= 4) {
term_xtra(TERM_XTRA_NOISE, 0);
- term_erase(0, 0, 255);
+ term_erase(0, 0);
term_putstr(0, 0, -1, TERM_WHITE, _("熟慮の上の自殺!", "Contemplating suicide!"));
term_fresh();
} else if (signal_count >= 2) {
*/
static void handle_signal_abort(int sig)
{
- int wid, hgt;
- term_get_size(&wid, &hgt);
-
+ const auto [wid, hgt] = term_get_size();
(void)signal(sig, SIG_IGN);
if (!w_ptr->character_generated || w_ptr->character_saved) {
quit(nullptr);
forget_view(p_ptr->current_floor_ptr);
clear_mon_lite(p_ptr->current_floor_ptr);
- term_erase(0, hgt - 1, 255);
+ term_erase(0, hgt - 1);
term_putstr(0, hgt - 1, -1, TERM_RED, _("恐ろしいソフトのバグが飛びかかってきた!", "A gruesome software bug LEAPS out at you!"));
term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ...", "Panic save..."));
-#pragma once
+#pragma once
#include "system/angband.h"
extern int16_t signal_count;
-#include "io/tokenizer.h"
+#include "io/tokenizer.h"
/*!
* @brief 各種データテキストをトークン単位に分解する / Extract the first few "tokens" from a buffer
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "io/uid-checker.h"
+#include "io/uid-checker.h"
#include "system/angband.h"
#if defined(SET_UID) && defined(SAFE_SETUID) && defined(SAFE_SETUID_POSIX)
#include "main-unix/unix-user-ids.h"
-#pragma once
+#pragma once
void safe_setuid_drop();
void safe_setuid_grab();
-/*!
+/*!
* @brief 日記へのメッセージ追加処理
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include <string_view>
#ifdef JP
-/*!
+/*!
* @brief アイテムのフレーバー初期化 (未鑑定名のシャッフル処理)
* @author Hourier
* @date 2022/12/28
-#pragma once
+#pragma once
void initialize_items_flavor();
-/*!
+/*!
* @brief 自動拾いの登録状況を表示する
* @date 2020/04/23
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_reload_autopick(PlayerType *player_ptr);
-/*!
+/*!
* @brief 技能の経験を表示する
* @date 2020/04/23
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_knowledge_weapon_exp(PlayerType *player_ptr);
-/*!
+/*!
* @brief 地形に関する情報を表示する
* @date 2020/04/24
* @author Hourier
}
for (; i < per_page; i++) {
- term_erase(col, row + i, 255);
+ term_erase(col, row + i);
}
}
TERM_COLOR attr_old[F_LIT_MAX] = {};
char char_old[F_LIT_MAX] = {};
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
-
+ const auto [wid, hgt] = term_get_size();
std::vector<FEAT_IDX> feat_idx(terrains_info.size());
concptr feature_group_text[] = { "terrains", nullptr };
-#pragma once
+#pragma once
#include "system/angband.h"
-/*
+/*
* @brief 装備の耐性を表示する
* @date 2020/04/20
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_knowledge_inventory(PlayerType *player_ptr);
-/*!
+/*!
* @brief 既知のアイテムとアーティファクトを表示する
* @date 2020/04/23
* @author Hourier
}
for (; i < per_page; i++) {
- term_erase(col, row + i, 255);
+ term_erase(col, row + i);
}
}
TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, std::nullopt);
short object_old, object_top;
- short grp_idx[100];
+ short grp_idx[100]{};
int object_cnt;
bool visual_list = false;
byte char_left = 0;
byte mode;
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
-
- int browser_rows = hgt - 8;
+ const auto [wid, hgt] = term_get_size();
+ auto browser_rows = hgt - 8;
std::vector<short> object_idx(baseitems_info.size());
int len;
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_knowledge_artifacts(PlayerType *player_ptr);
-/*!
+/*!
* @file knowledge-monsters.cpp
* @brief 既知のモンスターに関する情報を表示する
* @date 2020/04/24
c_prt(attr, format("%d", enum2i(r_idx)), row + i, 62);
}
- term_erase(69, row + i, 255);
+ term_erase(69, row + i);
term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
if (!visual_only) {
if (r_ptr->kind_flags.has_not(MonsterKindType::UNIQUE)) {
}
for (; i < per_page; i++) {
- term_erase(col, row + i, 255);
+ term_erase(col, row + i);
}
}
{
TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, std::nullopt);
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
std::vector<MonsterRaceId> r_idx_list;
std::vector<IDX> grp_idx;
-#pragma once
+#pragma once
#include "system/angband.h"
#include <optional>
-/*!
+/*!
* @brief 突然変異の一覧を出力する
* @date 2020/04/24
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_knowledge_mutations(PlayerType *player_ptr);
-/*!
+/*!
* @brief 既知のクエストを表示する
* @date 2020/04/23
* @author Hourier
-#pragma once
+#pragma once
#include "dungeon/quest.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 自己に関する情報を表示する
* @date 2020/04/24
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_knowledge_virtues(PlayerType *player_ptr);
-/*!
+/*!
* @brief 既知/存命のユニークを表示する
* @date 2020/04/23
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_knowledge_uniques(PlayerType *player_ptr, bool is_alive);
-#include "knowledge/lighting-level-table.h"
+#include "knowledge/lighting-level-table.h"
/*!
* @brief キャラクタ色の明暗表現
-#pragma once
+#pragma once
#include "system/angband.h"
#include "system/terrain-type-definition.h"
-/*
+/*
* @brief シンボルテキストの配列群
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*
+/*
* @brief オブジェクト種別を表すテキストの配列群
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include <vector>
-#include "load/angband-version-comparer.h"
+#include "load/angband-version-comparer.h"
#include "system/angband-version.h"
#include "world/world.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "load/birth-loader.h"
+#include "load/birth-loader.h"
#include "birth/quick-start.h"
#include "load/angband-version-comparer.h"
#include "load/load-util.h"
-#pragma once
+#pragma once
void load_quick_start(void);
-#include "load/dummy-loader.h"
+#include "load/dummy-loader.h"
#include "load/angband-version-comparer.h"
#include "load/load-util.h"
#include "load/monster/monster-loader-factory.h"
-#pragma once
+#pragma once
class PlayerType;
void rd_dummy1(void);
-#include "load/dungeon-loader.h"
+#include "load/dungeon-loader.h"
#include "dungeon/quest.h"
#include "floor/floor-save-util.h"
#include "floor/floor-save.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief その他の情報を読み込む処理
* @date 2020/07/05
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void rd_extra(PlayerType *player_ptr);
-#include "load/floor-loader.h"
+#include "load/floor-loader.h"
#include "floor/floor-generator.h"
#include "floor/floor-object.h"
#include "floor/floor-save-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "load/info-loader.h"
+#include "load/info-loader.h"
#include "game-option/runtime-arguments.h"
#include "load/angband-version-comparer.h"
#include "load/load-util.h"
-#pragma once
+#pragma once
void rd_version_info(void);
void rd_randomizer(void);
-#include "load/inventory-loader.h"
+#include "load/inventory-loader.h"
#include "inventory/inventory-slot-types.h"
#include "load/item/item-loader-factory.h"
#include "load/load-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "load/item/item-loader-base.h"
+#include "load/item/item-loader-base.h"
#include "artifact/fixed-art-types.h"
#include "load/angband-version-comparer.h"
#include "load/load-util.h"
-#pragma once
+#pragma once
class ItemEntity;
class ItemLoaderBase {
-/*!
+/*!
* @brief アイテム情報をセーブデータから読み込むクラスを選択するファクトリクラス
* @date 2021/10/16
* @author Hourier
-#pragma once
+#pragma once
#include <memory>
-#pragma once
+#pragma once
enum class ItemLoaderVersionType {
LOAD50,
-#include "load/load-util.h"
+#include "load/load-util.h"
#include "locale/japanese.h"
#include "term/gameterm.h"
#include "term/screen-processor.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "load/load-zangband.h"
+#include "load/load-zangband.h"
#include "avatar/avatar.h"
#include "cmd-building/cmd-building.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
#include "dungeon/quest.h"
#include "system/angband.h"
-/*!
+/*!
* @brief セーブファイル読み込み処理 / Purpose: support for loading savefiles -BEN-
* @date 2014/07/07
* @author
-#pragma once
+#pragma once
class PlayerType;
bool load_savedata(PlayerType *player_ptr, bool *new_game);
-#include "load/lore-loader.h"
+#include "load/lore-loader.h"
#include "game-option/runtime-arguments.h"
#include "load/angband-version-comparer.h"
#include "load/load-util.h"
-#pragma once
+#pragma once
void load_lore(void);
-#pragma once
+#pragma once
class MonsterEntity;
class PlayerType;
-/*!
+/*!
* @brief モンスター情報をセーブデータから読み込むクラスを選択するファクトリクラス
* @date 2021/10/16
* @author Hourier
-#pragma once
+#pragma once
#include <memory>
-#pragma once
+#pragma once
enum class MonsterLoaderVersionType {
LOAD50,
-#pragma once
+#pragma once
/*** Terrain Feature Index (see "lib/edit/TerrainDefinitions.txt") ***/
enum old_feature_type {
-#pragma once
+#pragma once
enum class SaveDataItemFlagType : unsigned int {
PVAL = 0x00000001,
-#include "load/old/item-loader-savefile50.h"
+#include "load/old/item-loader-savefile50.h"
#include "artifact/fixed-art-types.h"
#include "game-option/runtime-arguments.h"
#include "load/angband-version-comparer.h"
-#pragma once
+#pragma once
#include "load/item/item-loader-base.h"
-/*!
+/*!
* @brief 変愚蛮怒 v1.5.0以前の旧いセーブデータを読み込む処理
* @date 2020/07/04
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include "system/monster-entity.h"
-#include "load/old/load-v1-7-0.h"
+#include "load/old/load-v1-7-0.h"
#include "game-option/birth-options.h"
#include "load/load-util.h"
#include "load/old/load-v1-5-0.h"
-#pragma once
+#pragma once
class PlayerType;
void set_hp_old(PlayerType *player_ptr);
-#pragma once
+#pragma once
enum class SaveDataMonsterFlagType {
AP_R_IDX = 0x00000001,
-#include "load/old/monster-loader-savefile50.h"
+#include "load/old/monster-loader-savefile50.h"
#include "load/angband-version-comparer.h"
#include "load/load-util.h"
#include "load/old/load-v1-5-0.h"
-#pragma once
+#pragma once
#include "load/monster/monster-loader-base.h"
-#include "load/option-loader.h"
+#include "load/option-loader.h"
#include "cmd-io/cmd-gameoption.h"
#include "game-option/cheat-options.h"
#include "game-option/option-flags.h"
-#pragma once
+#pragma once
void rd_options();
-#include "load/player-attack-loader.h"
+#include "load/player-attack-loader.h"
#include "load/angband-version-comparer.h"
#include "load/load-util.h"
#include "load/load-zangband.h"
-#pragma once
+#pragma once
class PlayerType;
void rd_special_attack(PlayerType *player_ptr);
-#include "load/player-class-specific-data-loader.h"
+#include "load/player-class-specific-data-loader.h"
#include "load/load-util.h"
#include "player-info/bard-data-type.h"
#include "player-info/bluemage-data-type.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include "system/system-variables.h"
-#include "load/player-info-loader.h"
+#include "load/player-info-loader.h"
#include "cmd-building/cmd-building.h"
#include "load/angband-version-comparer.h"
#include "load/birth-loader.h"
-#pragma once
+#pragma once
class PlayerType;
void rd_base_info(PlayerType *player_ptr);
-#include "load/quest-loader.h"
+#include "load/quest-loader.h"
#include "artifact/fixed-art-types.h"
#include "dungeon/quest.h"
#include "floor/floor-town.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <tuple>
-/*!
+/*!
* @file savedata-old-flag-types.h
* @brief 過去に存在したセーブデータ有無フラグを定義する。古いセーブデータからのマイグレーション用。
*/
-#include "load/store-loader.h"
+#include "load/store-loader.h"
#include "avatar/avatar.h"
#include "floor/floor-town.h"
#include "load/angband-version-comparer.h"
-#pragma once
+#pragma once
class PlayerType;
void load_store(PlayerType *player_ptr);
-#include "load/world-loader.h"
+#include "load/world-loader.h"
#include "cmd-building/cmd-building.h"
#include "floor/wild.h"
#include "load/angband-version-comparer.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "locale/english.h"
+#include "locale/english.h"
#include "system/angband.h"
#include "util/string-processor.h"
-#pragma once
+#pragma once
#ifndef JP
void plural_aux(char *Name);
-/*!
+/*!
* @file japanese.cpp
* @brief 日本語処理関数
* @date 2014/07/07
-#pragma once
+#pragma once
#include "system/angband.h"
#include <optional>
-#pragma once
+#pragma once
#include "system/h-basic.h"
-#include "locale/utf-8.h"
+#include "locale/utf-8.h"
/*!
* @brief 文字列の最初の文字のUTF-8エンコーディングにおけるバイト長を返す
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "lore/combat-types-setter.h"
+#include "lore/combat-types-setter.h"
#include "lore/lore-util.h"
#include "monster-attack/monster-attack-effect.h"
#include "monster-attack/monster-attack-table.h"
-#pragma once
+#pragma once
struct lore_type;
void set_monster_blow_method(lore_type *lore_ptr, int m);
-#include "lore/lore-calculator.h"
+#include "lore/lore-calculator.h"
#include "game-option/cheat-options.h"
#include "lore/lore-util.h"
#include "monster-race/monster-race.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-/*!
+/*!
* @brief モンスターの思い出を記憶する処理
* @date 2020/06/09
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "lore/lore-util.h"
+#include "lore/lore-util.h"
#include "game-option/birth-options.h"
#include "monster-attack/monster-attack-table.h"
#include "monster-race/monster-race.h"
-#pragma once
+#pragma once
#include "monster-attack/monster-attack-table.h"
#include "monster-race/monster-aura-types.h"
-#include "lore/magic-types-setter.h"
+#include "lore/magic-types-setter.h"
#include "lore/lore-calculator.h"
#include "lore/lore-util.h"
#include "monster-race/race-brightness-mask.h"
lore_ptr->vp[lore_ptr->vn] = _("ユニーク・モンスター召喚", "summon Unique Monsters");
lore_ptr->color[lore_ptr->vn++] = TERM_VIOLET;
}
+
+ if (lore_ptr->ability_flags.has(MonsterAbilityType::S_DEAD_UNIQUE)) {
+ lore_ptr->vp[lore_ptr->vn] = _("ユニーク・モンスター口寄せ", "animate Unique Monsters");
+ lore_ptr->color[lore_ptr->vn++] = TERM_VIOLET;
+ }
}
-#pragma once
+#pragma once
struct lore_type;
class PlayerType;
-/*!
+/*!
* @brief モンスターの思い出表示に必要なフラグ類の処理
* @date 2020/06/09
* @author Hourier
-#pragma once
+#pragma once
#include "lore/lore-util.h"
#include "system/angband.h"
-/* File: maid-x11.c */
+/* File: maid-x11.c */
/*
* Copyright (c) 1997 Ben Harrison, and others
-/* File: main-cap.c */
+/* File: main-cap.c */
/* Purpose: Support for "term.c" using "termcap" calls */
-/* File: main-gcu.c */
+/* File: main-gcu.c */
/*
* Copyright (c) 1997 Ben Harrison, and others
-/*!
+/*!
* @brief UNIX用ユーザID定義
* @author Hourier
* @date 2023/05/27
-#pragma once
+#pragma once
class UnixUserIds {
public:
-/*!
+/*!
* @file x11-gamma-builder.cpp
* @brief X11環境 (の中でもmaid-x11を必要とする特殊な環境)でガンマ値を調整する
* @date 2020/05/16
-#pragma once
+#pragma once
/*!
* @file x11-gamma-builder.h
* @brief X11環境ガンマ値の調整処理ヘッダ
-/*!
+/*!
* @file x11-type-string.cpp
* @brief X11用の文字列処理
* @date 2020/06/14
-#pragma once
+#pragma once
/*!
* @file x11-type-string.h
* @brief X11用の文字列処理ヘッダ
-/*!
+/*!
* @file main-win.cpp
* @brief Windows版固有実装(メインエントリポイント含む)
* @date 2018/03/16
-/*!
+/*!
* @file commandline-win.cpp
* @brief Windows版固有実装(コマンドライン)
*/
-#pragma once
+#pragma once
/*!
* @file commandline-win.h
* @brief Windows版固有実装(コマンドライン)ヘッダ
-/*!
+/*!
* @file graphics-win.cpp
* @brief Windows版固有実装(タイル、イメージファイルの読み込み)
*/
-#pragma once
+#pragma once
/*!
* @file graphics-win.h
* @brief Windows版固有実装(タイル、イメージファイルの読み込み)ヘッダ
-/*!
+/*!
* @file main-win-bg.cpp
* @brief Windows版固有実装(壁紙)
*/
-#pragma once
+#pragma once
#include "main-win/main-win-define.h"
#include <filesystem>
-/*!
+/*!
* @file main-win-cfg-reader.cpp
* @brief Windows版固有実装(.cfgファイル処理)
*/
-#pragma once
+#pragma once
#include "system/angband.h"
#include <cstddef>
-#pragma once
+#pragma once
// max. length of full pathname
#define MAIN_WIN_MAX_PATH 1024
-#include "main-win/main-win-exception.h"
+#include "main-win/main-win-exception.h"
#include "main-win/main-win-utils.h"
#include "net/report-error.h"
#include <sstream>
-#pragma once
+#pragma once
#include <stdexcept>
-/*!
+/*!
* @file main-win-file-utils.cpp
* @brief Windows版固有実装(ファイル関連処理)
*/
-#pragma once
+#pragma once
#include "system/h-type.h"
#include <filesystem>
-/*!
+/*!
* @file main-win-mci.cpp
* @brief Windows版固有実装(BGM再生用のMCI)
*/
-#pragma once
+#pragma once
#include <windows.h>
-#pragma once
+#pragma once
/*
* Menu constants -- see "ang_jp.rc", "ang_eng.rc"
-#pragma once
+#pragma once
#include <windows.h>
-/*!
+/*!
* @file main-win-music.cpp
* @brief Windows版固有実装(BGM)
*/
-#pragma once
+#pragma once
#include "main-win/main-win-cfg-reader.h"
#include "main/music-definitions-table.h"
-/*!
+/*!
* @file main-win-sound.cpp
* @brief Windows版固有実装(効果音)
*/
-#pragma once
+#pragma once
#include "main-win/main-win-cfg-reader.h"
#include <array>
-/*!
+/*!
* @file main-win-term.cpp
* @brief Windows版固有実装(ターミナル)
*/
-#pragma once
+#pragma once
/*!
* @file main-win-term.h
* @brief Windows版固有実装(ターミナル)ヘッダ
-/*!
+/*!
* @file main-win-tokenizer.cpp
* @brief Windows版固有実装(トークン分割)
*/
-#pragma once
+#pragma once
#include "system/h-type.h"
-/*!
+/*!
* @file main-win-utils.cpp
* @brief Windows版固有実装(ユーティリティー)
*/
-#pragma once
+#pragma once
/*!
* @file main-win-utils.h
* @brief Windows版固有実装(ユーティリティー)ヘッダ
-/*!
+/*!
* @file wav-reader.cpp
* @brief Windows版固有実装(WAVファイル読込)
*/
-#pragma once
+#pragma once
/*!
* @file wav-reader.h
* @brief Windows版固有実装(WAVファイル読込)ヘッダ
-/* File: main-x11.c */
+/* File: main-x11.c */
/*
* Copyright (c) 1997 Ben Harrison, and others
-/*
+/*
* Copyright (c) 1997 Ben Harrison, and others
*
* This software may be copied and distributed for educational, research,
-/*!
+/*!
* @file angband-headers.cpp
* @brief ゲームデータのグローバルヘッダ情報定義
*/
-#pragma once
+#pragma once
/*!
* @file angband-headers.h
* @brief ゲームデータのグローバルヘッダ情報ヘッダ
-/*!
+/*!
* @file angband-initializer.cpp
* @brief 変愚蛮怒のシステム初期化
* @date 2014/01/28
*/
static void init_note_term(concptr str)
{
- term_erase(0, 23, 255);
+ term_erase(0, 23);
term_putstr(20, 23, -1, TERM_WHITE, str);
term_fresh();
}
-#pragma once
+#pragma once
/*!
* @file angband-initializer.h
* @brief 変愚蛮怒のシステム初期化処理ヘッダファイル
-/*!
+/*!
* @file game-data-initializer.cpp
* @brief 変愚蛮怒のゲームデータ初期化定義
*/
-#pragma once
+#pragma once
/*!
* @file game-data-initializer.h
* @brief 変愚蛮怒のゲームデータ初期化ヘッダファイル
-/*!
+/*!
* @file info-initializer.cpp
* @brief 変愚蛮怒のゲームデータ解析処理定義
*/
-#pragma once
+#pragma once
/*!
* @file info-initializer.h
* @brief 変愚蛮怒のゲームデータ解析処理ヘッダ
-/*!
+/*!
* @file init-error-messages-table.cpp
* @brief 変愚蛮怒のゲームデータ解析エラー名定義
*/
-#pragma once
+#pragma once
/*!
* @file init-error-messages-table.h
* @brief 変愚蛮怒のゲームデータ解析エラー名ヘッダ
-/*!
+/*!
* @file music-definitions-table.cpp
* @brief 設定ファイル用のBGM名定義
*/
-#pragma once
+#pragma once
/*!
* @file music-definitions-table.h
* @brief 設定ファイル用のBGM名定義ヘッダ
-/*!
+/*!
* @file scene-table-floor.cpp
* @brief フロアの状況に応じたBGM設定処理実装
*/
-#pragma once
+#pragma once
/*!
* @file scene-table-floor.h
* @brief フロアの状況に応じたBGM設定処理ヘッダ
-/*!
+/*!
* @file scene-table-monster.cpp
* @brief モンスターの遭遇状況に応じたBGM設定処理実装
*/
-#pragma once
+#pragma once
/*!
* @file scene-table-monster.h
* @brief モンスターの遭遇状況に応じたBGM設定処理ヘッダ
-/*!
+/*!
* @file scene-table.cpp
* @brief BGM選曲の基本処理部分実装
*/
-#pragma once
+#pragma once
/*!
* @file scene-table.h
* @brief BGM選曲の基本処理部分ヘッダ
-/*!
+/*!
* @file sound-definitions-table.cpp
* @brief 設定ファイル用の効果音名定義
*/
-#pragma once
+#pragma once
/*!
* @file sound-definitions-table.h
* @brief 設定ファイル用の効果音名定義ヘッダ
-/*!
+/*!
* @file sound-of-music.cpp
* @brief BGM及び効果音のterm出力処理実装
*/
-#pragma once
+#pragma once
/*!
* @file sound-of-music.h
* @brief BGM及び効果音のterm出力処理ヘッダ
-#include "market/arena-info-table.h"
+#include "market/arena-info-table.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-indice-types.h"
#include "object/tval-types.h"
-#pragma once
+#pragma once
#include "system/baseitem-info.h"
#include <vector>
-#include "market/arena.h"
+#include "market/arena.h"
#include "cmd-building/cmd-building.h"
#include "core/asking-player.h"
#include "core/show-file.h"
#include "market/arena-info-table.h"
#include "market/building-actions-table.h"
#include "market/building-util.h"
+#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags-resistance.h"
int j;
while (true) {
get_mon_num_prep(player_ptr, monster_can_entry_arena, nullptr);
- r_idx = get_mon_num(player_ptr, 0, mon_level, GMN_ARENA);
+ r_idx = get_mon_num(player_ptr, 0, mon_level, PM_ARENA);
if (!MonsterRace(r_idx).is_valid()) {
continue;
}
-#pragma once
+#pragma once
class PlayerType;
void arena_comm(PlayerType *player_ptr, int cmd);
-#include "market/bounty-prize-table.h"
+#include "market/bounty-prize-table.h"
#include "object/tval-types.h"
#include "sv-definition/sv-potion-types.h"
#include "sv-definition/sv-scroll-types.h"
-/*!
+/*!
* @brief 賞金首の報酬テーブル
* @author Hourier
* @date 2022/11/04
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "market/bounty.h"
+#include "market/bounty.h"
#include "autopick/autopick.h"
#include "avatar/avatar.h"
#include "cmd-building/cmd-building.h"
#include "io/input-key-acceptor.h"
#include "market/bounty-prize-table.h"
#include "market/building-util.h"
+#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags1.h"
get_mon_num_prep_bounty(player_ptr);
while (true) {
- w_ptr->today_mon = get_mon_num(player_ptr, std::min(max_dl / 2, 40), max_dl, GMN_ARENA);
+ w_ptr->today_mon = get_mon_num(player_ptr, std::min(max_dl / 2, 40), max_dl, PM_ARENA);
MonsterRaceInfo *r_ptr;
r_ptr = &monraces_info[w_ptr->today_mon];
// 賞金首とするモンスターの種族IDのリストを生成
std::vector<MonsterRaceId> bounty_r_idx_list;
while (bounty_r_idx_list.size() < std::size(w_ptr->bounties)) {
- auto r_idx = get_mon_num(player_ptr, 0, MAX_DEPTH - 1, GMN_ARENA);
+ auto r_idx = get_mon_num(player_ptr, 0, MAX_DEPTH - 1, PM_ARENA);
if (!is_suitable_for_bounty(r_idx)) {
continue;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/*
* Buildings actions
-#include "market/building-craft-armor.h"
+#include "market/building-craft-armor.h"
#include "io/input-key-acceptor.h"
#include "market/building-util.h"
#include "term/screen-processor.h"
-#pragma once
+#pragma once
bool eval_ac(short ac);
-#include "market/building-craft-fix.h"
+#include "market/building-craft-fix.h"
#include "artifact/artifact-info.h"
#include "artifact/fixed-art-types.h"
#include "artifact/random-art-effects.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "market/building-craft-weapon.h"
+#include "market/building-craft-weapon.h"
#include "artifact/fixed-art-types.h"
#include "combat/attack-accuracy.h"
#include "combat/shoot.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "market/building-enchanter.h"
+#include "market/building-enchanter.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "floor/floor-object.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "market/building-initializer.h"
+#include "market/building-initializer.h"
#include "floor/floor-town.h"
#include "io/files-util.h"
#include "object/object-kind-hook.h"
-#pragma once
+#pragma once
void init_towns(void);
void init_buildings(void);
-#include "market/building-monster.h"
+#include "market/building-monster.h"
#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "game-option/game-play-options.h"
-#pragma once
+#pragma once
class PlayerType;
bool research_mon(PlayerType *player_ptr);
-#include "market/building-quest.h"
+#include "market/building-quest.h"
#include "cmd-building/cmd-building.h"
#include "core/asking-player.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
class PlayerType;
void castle_quest(PlayerType *player_ptr);
-#include "market/building-recharger.h"
+#include "market/building-recharger.h"
#include "autopick/autopick.h"
#include "core/asking-player.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
class PlayerType;
void building_recharge(PlayerType *player_ptr);
-#include "market/building-service.h"
+#include "market/building-service.h"
#include "cmd-building/cmd-building.h"
#include "player-base/player-class.h"
#include "realm/realm-names-table.h"
-#pragma once
+#pragma once
struct building_type;
class PlayerType;
-#include "market/building-util.h"
+#include "market/building-util.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "term/z-form.h"
-#pragma once
+#pragma once
class PlayerType;
void clear_bldg(int min_row, int max_row);
-#include "market/play-gamble.h"
+#include "market/play-gamble.h"
#include "avatar/avatar.h"
#include "core/asking-player.h"
#include "core/show-file.h"
-#pragma once
+#pragma once
class PlayerType;
void gamble_comm(PlayerType *player_ptr, int cmd);
-#include "market/poker.h"
+#include "market/poker.h"
#include "io/input-key-acceptor.h"
#include "system/angband.h"
#include "term/screen-processor.h"
-#pragma once
+#pragma once
int do_poker(void);
-/*!
+/*!
* @brief モンスター同士の打撃後処理 / Melee post-process.
* @date 2014/01/17
* @author
-#pragma once
+#pragma once
#include "combat/combat-options-type.h"
#include "system/angband.h"
-#include "melee/melee-spell-flags-checker.h"
+#include "melee/melee-spell-flags-checker.h"
#include "dungeon/dungeon-flag-types.h"
#include "effect/effect-characteristics.h"
#include "floor/geometry.h"
-#pragma once
+#pragma once
struct melee_spell_type;
class PlayerType;
-#include "melee/melee-spell-util.h"
+#include "melee/melee-spell-util.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/quest.h"
#include "floor/cave.h"
-#pragma once
+#pragma once
#include "monster-race/race-ability-flags.h"
#include "system/angband.h"
-#include "melee/melee-spell.h"
+#include "melee/melee-spell.h"
#include "core/disturbance.h"
#include "melee/melee-spell-flags-checker.h"
#include "melee/melee-spell-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスター同士が乱闘を起こした時の攻撃種別をスイッチングする
* @date 2020/05/30
* @author Hourier
-#pragma once
+#pragma once
enum class BlowEffectType {
NONE = 0,
-#include "melee/melee-util.h"
+#include "melee/melee-util.h"
#include "floor/geometry.h"
#include "grid/grid.h"
#include "melee/melee-switcher.h"
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "monster-attack/monster-attack-effect.h"
-/*!
+/*!
* @brief モンスター同士が乱闘する処理
* @date 2020/05/23
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/*
* Some things which induce learning
-#include "mind/mind-archer.h"
+#include "mind/mind-archer.h"
#include "action/action-limited.h"
#include "autopick/autopick.h"
#include "core/asking-player.h"
-#pragma once
+#pragma once
class PlayerType;
bool create_ammo(PlayerType *player_ptr);
-#include "mind/mind-berserker.h"
+#include "mind/mind-berserker.h"
#include "action/movement-execution.h"
#include "cmd-action/cmd-attack.h"
#include "floor/geometry.h"
-#pragma once
+#pragma once
enum class MindBerserkerType : int;
class PlayerType;
-#include "mind/mind-blue-mage.h"
+#include "mind/mind-blue-mage.h"
#include "action/action-limited.h"
#include "avatar/avatar.h"
#include "blue-magic/blue-magic-caster.h"
-#pragma once
+#pragma once
#include <array>
-/*!
+/*!
* @brief 騎兵のレイシャルパワー処理
* @date 2020/05/16
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
bool rodeo(PlayerType *player_ptr);
-#include "mind/mind-chaos-warrior.h"
+#include "mind/mind-chaos-warrior.h"
#include "floor/floor-object.h"
#include "object-enchant/object-boost.h"
#include "object-enchant/object-ego.h"
-#pragma once
+#pragma once
class PlayerType;
void acquire_chaos_weapon(PlayerType *player_ptr);
-/*!
+/*!
* @brief 元素使いの魔法系統
*/
return;
}
- term_erase(12, 21, 255);
- term_erase(12, 20, 255);
- term_erase(12, 19, 255);
- term_erase(12, 18, 255);
- term_erase(12, 17, 255);
- term_erase(12, 16, 255);
+ term_erase(12, 21);
+ term_erase(12, 20);
+ term_erase(12, 19);
+ term_erase(12, 18);
+ term_erase(12, 17);
+ term_erase(12, 16);
display_wrap_around(get_element_tip(player_ptr, n), 62, 17, 15);
prt(_("何かキーを押して下さい。", "Hit any key."), 0, 0);
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "mind/mind-explanations-table.h"
+#include "mind/mind-explanations-table.h"
/*! 特殊技能の一覧テーブル */
mind_power const mind_powers[MAX_MINDKINDS] = {
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mind/mind-force-trainer.h"
+#include "mind/mind-force-trainer.h"
#include "avatar/avatar.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mind/mind-hobbit.h"
+#include "mind/mind-hobbit.h"
#include "floor/floor-object.h"
#include "object/object-kind-hook.h"
#include "sv-definition/sv-food-types.h"
-#pragma once
+#pragma once
class PlayerType;
bool create_ration(PlayerType *player_ptr);
-#include "mind/mind-info.h"
+#include "mind/mind-info.h"
#include "cmd-action/cmd-spell.h"
#include "locale/japanese.h"
#include "mind/mind-force-trainer.h"
-#pragma once
+#pragma once
#include <string>
-/*!
+/*!
* @brief 魔力喰い処理
* @date 2020/06/27
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
bool eat_magic(PlayerType *player_ptr, int power);
-#include "mind/mind-magic-eater.h"
+#include "mind/mind-magic-eater.h"
#include "flavor/flavor-describer.h"
#include "floor/floor-object.h"
#include "inventory/inventory-object.h"
-#pragma once
+#pragma once
class PlayerType;
bool import_magic_device(PlayerType *player_ptr);
-#include "mind/mind-magic-resistance.h"
+#include "mind/mind-magic-resistance.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
#include "game-option/disturbance-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mind/mind-mindcrafter.h"
+#include "mind/mind-mindcrafter.h"
#include "autopick/autopick.h"
#include "avatar/avatar.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
class PlayerType;
bool psychometry(PlayerType *player_ptr);
-/*!
+/*!
* @brief 鏡使いの鏡魔法コマンド処理
* @date 2022/03/07
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mind/mind-monk.h"
+#include "mind/mind-monk.h"
#include "action/action-limited.h"
#include "io/input-key-acceptor.h"
#include "mind/stances-table.h"
-#pragma once
+#pragma once
class PlayerType;
bool choose_monk_stance(PlayerType *player_ptr);
-#include "mind/mind-ninja.h"
+#include "mind/mind-ninja.h"
#include "cmd-action/cmd-attack.h"
#include "cmd-item/cmd-throw.h"
#include "combat/combat-options-type.h"
-#pragma once
+#pragma once
struct player_attack_type;
class PlayerType;
-#pragma once
+#pragma once
enum class MindBerserkerType : int {
DETECT_MANACE = 0,
-#include "mind/mind-power-getter.h"
+#include "mind/mind-power-getter.h"
#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
#include "mind/mind-types.h"
#include "system/angband.h"
-#include "mind/mind-priest.h"
+#include "mind/mind-priest.h"
#include "core/window-redrawer.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
-#pragma once
+#pragma once
class PlayerType;
bool bless_weapon(PlayerType *player_ptr);
-/*!
+/*!
* @brief 剣術家のレイシャルパワー処理
* @date 2020/05/16
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief スナイパー技能の実装 / Sniping
* @date 2014/01/18
* @author
/* Dump the spells */
for (i = 0; i < MAX_SNIPE_POWERS; i++) {
term_color_type tcol = TERM_WHITE;
- term_erase(x, y + i + 1, 255);
+ term_erase(x, y + i + 1);
/* Access the spell */
spell = snipe_powers[i];
}
/* Clear lines, position cursor (really should use strlen here) */
- term_erase(12, 22, 255);
- term_erase(12, 21, 255);
- term_erase(12, 20, 255);
- term_erase(12, 19, 255);
- term_erase(12, 18, 255);
+ term_erase(12, 22);
+ term_erase(12, 21);
+ term_erase(12, 20);
+ term_erase(12, 19);
+ term_erase(12, 18);
display_wrap_around(snipe_tips[n], 62, 19, 15);
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
enum class MindKindType {
MINDCRAFTER = 0, /*!< 特殊能力: 超能力 */
-#include "mind/mind-warrior-mage.h"
+#include "mind/mind-warrior-mage.h"
#include "hpmp/hp-mp-processor.h"
#include "player/player-damage.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
class PlayerType;
bool comvert_hp_to_mp(PlayerType *player_ptr);
-#include "mind/mind-warrior.h"
+#include "mind/mind-warrior.h"
#include "cmd-action/cmd-attack.h"
#include "floor/geometry.h"
#include "spell-kind/spells-teleport.h"
-#pragma once
+#pragma once
class PlayerType;
bool hit_and_away(PlayerType *player_ptr);
-#include "mind/mind-weaponsmith.h"
+#include "mind/mind-weaponsmith.h"
#include "action/action-limited.h"
#include "autopick/autopick.h"
#include "core/asking-player.h"
}
if (only_browse) {
- term_erase(14, 21, 255);
- term_erase(14, 20, 255);
- term_erase(14, 19, 255);
- term_erase(14, 18, 255);
- term_erase(14, 17, 255);
- term_erase(14, 16, 255);
+ term_erase(14, 21);
+ term_erase(14, 20);
+ term_erase(14, 19);
+ term_erase(14, 18);
+ term_erase(14, 17);
+ term_erase(14, 16);
if (mode > 0) {
display_wrap_around(kaji_tips[mode - 1], 62, 17, 15);
}
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_kaji(PlayerType *player_ptr, bool only_browse);
-/*!
+/*!
* @brief 素手で攻撃することに補正のある職業 (修行僧、狂戦士、練気術師)の打撃処理
* @date 2020/05/23
* @author Hourier
-#pragma once
+#pragma once
struct player_attack_type;
class PlayerType;
-#pragma once
+#pragma once
enum snipe_type {
SP_NONE = 0,
-#include "mind/stances-table.h"
+#include "mind/stances-table.h"
/*!
* @brief 修行僧の構え能力テーブル
-#pragma once
+#pragma once
#include "player/special-defense-types.h"
#include "system/angband.h"
-#include "monster-attack/insults-moans.h"
+#include "monster-attack/insults-moans.h"
/*! モンスターの侮辱行為メッセージテーブル / Hack -- possible "insult" messages */
concptr desc_insult[MAX_INSULTS] = {
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターの打撃種別を記述すると共に、切り傷/朦朧値を追加する
* @date 2020/05/31
* @author Hourier
-#pragma once
+#pragma once
class MonsterAttackPlayer;
void describe_monster_attack_method(MonsterAttackPlayer *monap_ptr);
-#pragma once
+#pragma once
/*!
* @note モンスターの攻撃効果 / New monster blow effects
-#include "monster-attack/monster-attack-lose.h"
+#include "monster-attack/monster-attack-lose.h"
#include "mind/mind-mirror-master.h"
#include "monster-attack/monster-attack-player.h"
#include "monster-attack/monster-attack-status.h"
-#pragma once
+#pragma once
class MonsterAttackPlayer;
class PlayerType;
-/*!
+/*!
* @brief モンスターからプレイヤーへの直接攻撃処理
* @date 2020/05/23
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターの攻撃に関する処理
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief プレイヤーのステータス (麻痺等)に影響を与えるモンスターの打撃処理
* @date 2020/05/31
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターからプレイヤーへの直接攻撃をその種別において振り分ける
* @date 2020/05/31
* @author Hourier
-#pragma once
+#pragma once
class MonsterAttackPlayer;
class PlayerType;
-#include "monster-attack/monster-attack-table.h"
+#include "monster-attack/monster-attack-table.h"
#include "effect/attribute-types.h"
#include "monster-attack/monster-attack-effect.h"
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "monster-attack/monster-attack-effect.h"
-/*!
+/*!
* @brief プレイヤーのHP/MP、アイテム、お金・明かりの残りターン、充填魔力を盗んだり減少させたりする処理
* @date 2020/05/31
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster-floor/monster-death-util.h"
+#include "monster-floor/monster-death-util.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-indice-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster-floor/monster-death.h"
+#include "monster-floor/monster-death.h"
#include "artifact/fixed-art-generator.h"
#include "artifact/fixed-art-types.h"
#include "cmd-building/cmd-building.h"
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターの移動方向を決定する処理
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster-floor/monster-dist-offsets.h"
+#include "monster-floor/monster-dist-offsets.h"
/*
* Hack -- Precompute a bunch of calls to distance() in find_safety() and
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* todo 後で再分割する
* @brief モンスター生成処理
* @date 2020/06/10
get_mon_num_prep(player_ptr, get_monster_hook(player_ptr), get_monster_hook2(player_ptr, y, x));
MonsterRaceId r_idx;
do {
- r_idx = get_mon_num(player_ptr, 0, player_ptr->current_floor_ptr->monster_level, 0);
+ r_idx = get_mon_num(player_ptr, 0, player_ptr->current_floor_ptr->monster_level, PM_NONE);
} while ((mode & PM_NO_QUEST) && (monraces_info[r_idx].flags8 & RF8_NO_QUEST));
if (!MonsterRace(r_idx).is_valid()) {
const auto *floor_ptr = player_ptr->current_floor_ptr;
for (auto attempts = 1000; attempts > 0; --attempts) {
- auto r_idx = get_mon_num(player_ptr, 0, floor_ptr->monster_level, 0);
+ auto r_idx = get_mon_num(player_ptr, 0, floor_ptr->monster_level, PM_NONE);
if (!MonsterRace(r_idx).is_valid()) {
return std::nullopt;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster-floor/monster-lite-util.h"
+#include "monster-floor/monster-lite-util.h"
#include "system/grid-type-definition.h"
#include "system/monster-entity.h"
#include "util/bit-flags-calculator.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster-floor/monster-lite.h"
+#include "monster-floor/monster-lite.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/cave.h"
#include "grid/feature-flag-types.h"
-#pragma once
+#pragma once
class FloorType;
class PlayerType;
-/*!
+/*!
* @brief モンスターの移動に関する処理
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターが移動した結果、床のアイテムに重なった時の処理と、モンスターがアイテムを落とす処理
* @date 2020/03/07
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster-floor/monster-remover.h"
+#include "monster-floor/monster-remover.h"
#include "core/stuff-handler.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターの逃走に関する処理
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターの逃走・隠匿に関する処理
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster-floor/monster-summon.h"
+#include "monster-floor/monster-summon.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/geometry.h"
#include "floor/wild.h"
get_mon_num_prep(player_ptr, summon_specific_okay, get_monster_hook2(player_ptr, y, x));
DEPTH dlev = get_dungeon_or_wilderness_level(player_ptr);
- MonsterRaceId r_idx = get_mon_num(player_ptr, 0, (dlev + lev) / 2 + 5, 0);
+ MonsterRaceId r_idx = get_mon_num(player_ptr, 0, (dlev + lev) / 2 + 5, mode);
if (!MonsterRace(r_idx).is_valid()) {
summon_specific_type = SUMMON_NONE;
return false;
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターの移動方向を走査する処理
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターをフロアに1体配置する処理
* @date 2020/06/13
* @author Hourier
int attempts = 1000;
DEPTH min = std::min(floor_ptr->base_level - 5, 50);
while (--attempts) {
- auto ap_r_idx = get_mon_num(player_ptr, 0, floor_ptr->base_level + 10, 0);
+ auto ap_r_idx = get_mon_num(player_ptr, 0, floor_ptr->base_level + 10, PM_NONE);
if (monraces_info[ap_r_idx].level >= min) {
return ap_r_idx;
}
* @param r_idx 生成モンスター種族
* @return ユニークの生成が不可能な条件ならFALSE、それ以外はTRUE
*/
-static bool check_unique_placeable(PlayerType *player_ptr, MonsterRaceId r_idx)
+static bool check_unique_placeable(PlayerType *player_ptr, MonsterRaceId r_idx, BIT_FLAGS mode)
{
if (player_ptr->phase_out) {
return true;
}
+ if (any_bits(mode, PM_CLONE)) {
+ return true;
+ }
+
auto *r_ptr = &monraces_info[r_idx];
if ((r_ptr->kind_flags.has(MonsterKindType::UNIQUE) || r_ptr->population_flags.has(MonsterPopulationType::NAZGUL)) && (r_ptr->cur_num >= r_ptr->max_num)) {
return false;
return false;
}
- if (!check_unique_placeable(player_ptr, r_idx) || !check_quest_placeable(floor, r_idx) || !check_procection_rune(player_ptr, r_idx, y, x)) {
+ if (!check_unique_placeable(player_ptr, r_idx, mode) || !check_quest_placeable(floor, r_idx) || !check_procection_rune(player_ptr, r_idx, y, x)) {
return false;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/*
* Bit flags for the place_monster_???() (etc)
PM_JURAL = 0x00000800, /*!< モンスター生成フラグ: ジュラル星人として誤認生成する */
PM_NO_QUEST = 0x00001000, /*!< モンスター生成フラグ: クエスト除外モンスターを生成しない */
PM_CLONE = 0x00002000, /*!< モンスター生成フラグ: クローンとして生成する */
+ PM_ARENA = 0x00004000, /*!< モンスター生成フラグ: アリーナ用の生成 */
+
};
-#include "monster-floor/quantum-effect.h"
+#include "monster-floor/quantum-effect.h"
#include "effect/attribute-types.h"
#include "floor/line-of-sight.h"
#include "monster-floor/monster-death.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスター死亡時の特殊処理switch (一般的な処理もdefaultで実施)
* @date 2020/08/21
* @author Hourier
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#pragma once
+#pragma once
/*!
* @brief モンスターがまとっているオーラ定義.
-#include "monster-race/monster-kind-mask.h"
+#include "monster-race/monster-kind-mask.h"
const EnumClassFlagGroup<MonsterKindType> alignment_mask = {
MonsterKindType::GOOD, MonsterKindType::EVIL
-#pragma once
+#pragma once
#include "monster-race/race-kind-flags.h"
#include "system/angband.h"
-#include "monster-race/monster-race-hook.h"
+#include "monster-race/monster-race-hook.h"
#include "monster-attack/monster-attack-effect.h"
#include "monster-attack/monster-attack-table.h"
+#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-ability-mask.h"
#include "monster-race/race-flags-resistance.h"
void vault_prep_clone(PlayerType *player_ptr)
{
get_mon_num_prep(player_ptr, vault_aux_simple, nullptr);
- vault_aux_race = get_mon_num(player_ptr, 0, player_ptr->current_floor_ptr->dun_level + 10, 0);
+ vault_aux_race = get_mon_num(player_ptr, 0, player_ptr->current_floor_ptr->dun_level + 10, PM_NONE);
get_mon_num_prep(player_ptr, nullptr, nullptr);
}
void vault_prep_symbol(PlayerType *player_ptr)
{
get_mon_num_prep(player_ptr, vault_aux_simple, nullptr);
- MonsterRaceId r_idx = get_mon_num(player_ptr, 0, player_ptr->current_floor_ptr->dun_level + 10, 0);
+ MonsterRaceId r_idx = get_mon_num(player_ptr, 0, player_ptr->current_floor_ptr->dun_level + 10, PM_NONE);
get_mon_num_prep(player_ptr, nullptr, nullptr);
vault_aux_char = monraces_info[r_idx].d_char;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster-race/monster-race.h"
+#include "monster-race/monster-race.h"
#include "monster-race/race-flags-resistance.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-indice-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
enum class MonsterAbilityType {
SHRIEK = 0, /*!< モンスター能力: 叫ぶ / Shriek for help */
S_HI_DRAGON = 93, /* Summon Ancient Dragon */
S_AMBERITES = 94, /* Summon Amberites */
S_UNIQUE = 95, /* Summon Unique Monster */
+ S_DEAD_UNIQUE = 96, /* Summon Dead Unique Monster */
BO_VOID = 97, /*!< モンスター能力: ヴォイド・ボルト / Void Bolt */
BO_ABYSS = 98, /*!< モンスター能力: アビス・ボルト / Abyss Bolt */
BR_VOID = 99, /*!< モンスター能力: 虚無のブレス / Breathe Void */
-#include "monster-race/race-ability-mask.h"
+#include "monster-race/race-ability-mask.h"
// clang-format off
/* "summon" spells currently "summon" spells are included in "intelligent" and "indirect" */
MonsterAbilityType::S_ANT, MonsterAbilityType::S_SPIDER, MonsterAbilityType::S_HOUND, MonsterAbilityType::S_HYDRA,
MonsterAbilityType::S_ANGEL, MonsterAbilityType::S_DEMON, MonsterAbilityType::S_UNDEAD, MonsterAbilityType::S_DRAGON,
MonsterAbilityType::S_HI_UNDEAD, MonsterAbilityType::S_HI_DRAGON, MonsterAbilityType::S_AMBERITES, MonsterAbilityType::S_UNIQUE,
+ MonsterAbilityType::S_DEAD_UNIQUE,
};
/* Choose "intelligent" spells when desperate Including "summon" spells */
-#pragma once
+#pragma once
#include "monster-race/race-ability-flags.h"
#include "util/flag-group.h"
-#pragma once
+#pragma once
enum class MonsterBehaviorType {
NEVER_BLOW = 0,
-#pragma once
+#pragma once
enum class MonsterBrightnessType {
HAS_LITE_1 = 0, /* Monster carries light */
-#include "monster-race/race-brightness-mask.h"
+#include "monster-race/race-brightness-mask.h"
const EnumClassFlagGroup<MonsterBrightnessType> lite_mask = {
MonsterBrightnessType::HAS_LITE_1,
-#pragma once
+#pragma once
#include "monster-race/race-brightness-flags.h"
#include "util/flag-group.h"
-#pragma once
+#pragma once
enum class MonsterDropType {
ONLY_GOLD = 0,
-#pragma once
+#pragma once
enum class MonsterFeatureType {
AQUATIC = 0,
-#include "monster-race/race-feature-mask.h"
+#include "monster-race/race-feature-mask.h"
const EnumClassFlagGroup<MonsterFeatureType> feature_lore_flags2 = {
MonsterFeatureType::PASS_WALL,
-#pragma once
+#pragma once
#include "monster-race/race-feature-flags.h"
#include "util/flag-group.h"
-#pragma once
+#pragma once
enum class MonsterResistanceType {
RESIST_ALL = 0, /* Resist all */
-#pragma once
+#pragma once
enum race_flags1 {
RF1_UNIQUE = 0x00000001, /*!< モンスター特性: ユニーク / Unique Monster */
-#pragma once
+#pragma once
enum race_flags2 {
RF2_STUPID = 0x00000001, /*!< モンスター特性: 愚かな行動を取る / Monster is stupid */
-#pragma once
+#pragma once
enum race_flags3 {
RF3_ORC = 0x00000001, /*!< モンスター特性: オーク / Orc */
-#pragma once
+#pragma once
enum race_flags7 {
RF7_AQUATIC = 0x00000001, /* Aquatic monster */
-#pragma once
+#pragma once
enum race_flags8 : uint32_t {
RF8_WILD_ONLY = 0x00000001,
-#pragma once
+#pragma once
enum class MonsterRaceId : int16_t {
PLAYER = 0,
-#pragma once
+#pragma once
enum class MonsterKindType {
UNIQUE = 0,
-#pragma once
+#pragma once
enum class MonsterPopulationType {
NAZGUL = 0,
-#include "monster-race/race-resistance-mask.h"
+#include "monster-race/race-resistance-mask.h"
const EnumClassFlagGroup<MonsterResistanceType> RFR_EFF_IM_ACID_MASK = {
MonsterResistanceType::IMMUNE_ACID,
-#pragma once
+#pragma once
#include "monster-race/race-flags-resistance.h"
#include "util/flag-group.h"
-#pragma once
+#pragma once
enum class MonsterSpeakType {
SPEAK_ALL = 0, /* SPEAK_BATTLE, SPEAK_FEAR, SPEAK_FRIEND, SPEAK_DEATH */
-#pragma once
+#pragma once
enum class MonsterVisualType {
CLEAR = 0,
-#pragma once
+#pragma once
enum class MonsterWildernessType {
WILD_ONLY = 0,
-/*!
+/*!
* @file horror-descriptions.cpp
* @brief エルドリッチホラーの形容詞テーブル定義
* @date 2023/04/29
-#pragma once
+#pragma once
#include <string>
#include <vector>
-#include "monster/monster-compaction.h"
+#include "monster/monster-compaction.h"
#include "core/stuff-handler.h"
#include "game-option/play-record-options.h"
#include "io/write-diary.h"
-#pragma once
+#pragma once
class PlayerType;
void compact_monsters(PlayerType *player_ptr, int size);
-/*
+/*
* @brief モンスターがダメージを受けた時の処理と経験値の加算処理
* @date 2021/08/04
* @author Hourier
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "monster-race/race-indice-types.h"
-#include "monster/monster-describer.h"
+#include "monster/monster-describer.h"
#include "io/files-util.h"
#include "locale/english.h"
#include "monster-race/monster-race.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-#pragma once
+#pragma once
enum monsetr_description_type {
MD_NONE = 0x00000000,
-#pragma once
+#pragma once
enum class MonsterTemporaryFlagType {
VIEW = 0, /* Monster is in line of sight */
-/*!
+/*!
* @brief モンスター情報の記述 / describe monsters (using monster memory)
* @date 2013/12/11
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-/*!
+/*!
* @brief モンスター処理 / misc code for monsters
* @date 2014/07/08
* @author
#include "game-option/cheat-options.h"
#include "grid/grid.h"
#include "monster-floor/monster-summon.h"
+#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-kind-mask.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-brightness-mask.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
+#include "util/bit-flags-calculator.h"
#include "util/probability-table.h"
#include "view/display-messages.h"
#include "world/world.h"
* @return 選択されたモンスター生成種族
* @details nasty生成 (ゲーム内経過日数に応じて、現在フロアより深いフロアのモンスターを出現させる仕様)は
*/
-MonsterRaceId get_mon_num(PlayerType *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS option)
+MonsterRaceId get_mon_num(PlayerType *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS mode)
{
/* town max_level : same delay as 10F, no nasty mons till day18 */
auto delay = static_cast<int>(std::sqrt(max_level * 10000)) + (max_level * 5);
}
/* Boost the max_level */
- if ((option & GMN_ARENA) || dungeon.flags.has_not(DungeonFeatureType::BEGINNER)) {
+ if (any_bits(mode, PM_ARENA) || dungeon.flags.has_not(DungeonFeatureType::BEGINNER)) {
/* Nightmare mode allows more out-of depth monsters */
if (ironman_nightmare && !randint0(chance_nasty)) {
/* What a bizarre calculation */
} // sorted by depth array,
auto r_idx = i2enum<MonsterRaceId>(entry.index);
auto r_ptr = &monraces_info[r_idx];
- if (!(option & GMN_ARENA) && !chameleon_change_m_idx) {
- if ((r_ptr->kind_flags.has(MonsterKindType::UNIQUE) || r_ptr->population_flags.has(MonsterPopulationType::NAZGUL)) && (r_ptr->cur_num >= r_ptr->max_num)) {
+ if (none_bits(mode, PM_ARENA) && !chameleon_change_m_idx) {
+ if ((r_ptr->kind_flags.has(MonsterKindType::UNIQUE) || r_ptr->population_flags.has(MonsterPopulationType::NAZGUL)) && (r_ptr->cur_num >= r_ptr->max_num) && none_bits(mode, PM_CLONE)) {
continue;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#define GMN_ARENA 0x00000001 //!< 賭け闘技場向け生成
-
enum class MonsterRaceId : int16_t;
class FloorType;
class MonsterRaceInfo;
class PlayerType;
MONSTER_IDX m_pop(FloorType *floor_ptr);
-MonsterRaceId get_mon_num(PlayerType *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS option);
+MonsterRaceId get_mon_num(PlayerType *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS mode);
void choose_new_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool born, MonsterRaceId r_idx);
byte get_mspeed(FloorType *player_ptr, MonsterRaceInfo *r_ptr);
int get_monster_crowd_number(FloorType *floor_ptr, MONSTER_IDX m_idx);
-#include "monster/monster-pain-describer.h"
+#include "monster/monster-pain-describer.h"
#include "monster-race/monster-race.h"
#include "monster/monster-describer.h"
#include "system/floor-type-definition.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief monster-processのための構造体群初期化処理と共通性の極めて高い処理
* @date 2020/03/07
* @author Hourier
-/*!
+/*!
* @brief monster-processのための構造体群
* @date 2020/03/07
* @author Hourier
-/*!
+/*!
* @brief モンスターの特殊技能とターン経過処理 (移動等)/ Monster spells and movement for passaging a turn
* @date 2014/01/17
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster/monster-status-setter.h"
+#include "monster/monster-status-setter.h"
#include "avatar/avatar.h"
#include "cmd-visual/cmd-draw.h"
#include "core/speed-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster/monster-status.h"
+#include "monster/monster-status.h"
#include "autopick/autopick-pref-processor.h"
#include "core/speed-table.h"
#include "floor/cave.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
enum monster_timed_effect_type {
MTIMED_CSLEEP = 0, /* Monster is sleeping */
-/*!
+/*!
* @brief モンスター情報のアップデート処理
* @date 2020/03/08
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "monster/monster-util.h"
+#include "monster/monster-util.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/quest.h"
#include "floor/wild.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
enum class MonsterSmartLearnType {
RES_ACID = 0, /*!< モンスターの学習フラグ: プレイヤーに酸耐性あり */
-/*!
+/*!
* @brief モンスターのスペル振り分け処理 / Spell launch by a monster
* @date 2014/07/14
* @author Habu
case MonsterAbilityType::S_HI_DRAGON: return spell_RF6_S_HI_DRAGON(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF6_S_HI_DRAGON */
case MonsterAbilityType::S_AMBERITES: return spell_RF6_S_AMBERITES(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF6_S_AMBERITES */
case MonsterAbilityType::S_UNIQUE: return spell_RF6_S_UNIQUE(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF6_S_UNIQUE */
+ case MonsterAbilityType::S_DEAD_UNIQUE: return spell_RF6_S_DEAD_UNIQUE(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF6_S_DEAD_UNIQUE */
default: break;
}
// clang-format on
case MonsterAbilityType::S_HI_DRAGON: return spell_RF6_S_HI_DRAGON(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF6_S_HI_DRAGON */
case MonsterAbilityType::S_AMBERITES: return spell_RF6_S_AMBERITES(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF6_S_AMBERITES */
case MonsterAbilityType::S_UNIQUE: return spell_RF6_S_UNIQUE(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF6_S_UNIQUE */
+ case MonsterAbilityType::S_DEAD_UNIQUE: return spell_RF6_S_DEAD_UNIQUE(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF6_S_DEAD_UNIQUE */
default: break;
}
// clang-format on
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/element-resistance-checker.h"
+#include "mspell/element-resistance-checker.h"
#include "game-option/birth-options.h"
#include "monster-race/race-ability-flags.h"
#include "monster/smart-learn-types.h"
-#pragma once
+#pragma once
struct msr_type;
class PlayerType;
-#include "mspell/high-resistance-checker.h"
+#include "mspell/high-resistance-checker.h"
#include "monster-race/race-ability-flags.h"
#include "monster/smart-learn-types.h"
#include "mspell/smart-mspell-util.h"
-#pragma once
+#pragma once
struct msr_type;
class PlayerType;
-#include "mspell/improper-mspell-remover.h"
+#include "mspell/improper-mspell-remover.h"
#include "game-option/birth-options.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags2.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/monster-power-table.h"
+#include "mspell/monster-power-table.h"
#include "monster-race/race-ability-flags.h"
#include "player-ability/player-ability-types.h"
{ MonsterAbilityType::S_HI_DRAGON, { 46, 90, 85, 0, 45, A_INT, _("古代ドラゴンの召喚", "summon Ancient Dragon") } },
{ MonsterAbilityType::S_AMBERITES, { 48, 120, 90, 0, 50, A_INT, _("アンバーの王族の召喚", "summon Lords of Amber") } },
{ MonsterAbilityType::S_UNIQUE, { 50, 150, 95, 0, 50, A_INT, _("ユニークモンスターの召喚", "summon Unique Monsters") } },
+ { MonsterAbilityType::S_DEAD_UNIQUE, { 50, 150, 95, 0, 50, A_INT, _("ユニークモンスターの口寄せ", "summon Dead Unique Monsters") } },
};
/*!
{ MonsterAbilityType::S_HI_DRAGON, _("古代ドラゴン", "Ancient Dragon") },
{ MonsterAbilityType::S_AMBERITES, _("アンバーの王族", "Lords of Amber") },
{ MonsterAbilityType::S_UNIQUE, _("ユニーク", "Unique monsters") },
+ { MonsterAbilityType::S_DEAD_UNIQUE, _("黄泉のユニーク", "Dead unique monsters") },
};
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/mspell-attack-util.h"
+#include "mspell/mspell-attack-util.h"
#include "monster-race/monster-race.h"
#include "system/floor-type-definition.h"
#include "system/monster-entity.h"
-#pragma once
+#pragma once
#include "monster-race/race-ability-flags.h"
#include "system/angband.h"
-#include "mspell/mspell-attack.h"
+#include "mspell/mspell-attack.h"
#include "blue-magic/blue-magic-checker.h"
#include "core/disturbance.h"
#include "dungeon/dungeon-flag-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/mspell-attack/abstract-mspell.h"
+#include "mspell/mspell-attack/abstract-mspell.h"
#include "monster/monster-update.h"
#include "mspell/mspell-damage-calculator.h"
#include "mspell/mspell-util.h"
-#pragma once
+#pragma once
#include "effect/effect-processor.h"
#include "monster-race/race-ability-flags.h"
-#include "mspell/mspell-attack/mspell-ball.h"
+#include "mspell/mspell-attack/mspell-ball.h"
#include "effect/attribute-types.h"
#include "effect/effect-processor.h"
#include "main/sound-of-music.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/mspell-attack/mspell-bolt.h"
+#include "mspell/mspell-attack/mspell-bolt.h"
#include "effect/attribute-types.h"
#include "effect/effect-processor.h"
#include "main/sound-definitions-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/mspell-attack/mspell-breath.h"
+#include "mspell/mspell-attack/mspell-breath.h"
#include "core/disturbance.h"
#include "effect/attribute-types.h"
#include "effect/effect-processor.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/mspell-attack/mspell-curse.h"
+#include "mspell/mspell-attack/mspell-curse.h"
#include "core/disturbance.h"
#include "effect/attribute-types.h"
#include "effect/effect-processor.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief ボルトでもボールでもブレスでもなく、ダメージを与える特殊なスペルの実行 /
* Performing special spells that take damage, not bolts, balls or breaths
* @date 2020/05/16
-#pragma once
+#pragma once
#include "mspell/mspell-attack/abstract-mspell.h"
#include "system/angband.h"
-/*!
+/*!
* @brief モンスター魔法の実装 / Monster spells (attack player)
* @date 2014/01/17
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/mspell-damage-calculator.h"
+#include "mspell/mspell-damage-calculator.h"
#include "game-option/birth-options.h"
#include "inventory/inventory-slot-types.h"
#include "monster-race/monster-race.h"
return -1;
case MonsterAbilityType::S_UNIQUE:
return -1;
+ case MonsterAbilityType::S_DEAD_UNIQUE:
+ return -1;
case MonsterAbilityType::MAX:
return -1;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/mspell-data.h"
+#include "mspell/mspell-data.h"
#include "effect/attribute-types.h"
#include "monster/monster-update.h"
#include "mspell/mspell-util.h"
-#pragma once
+#pragma once
#include "mind/drs-types.h"
#include "system/angband.h"
-#include "mspell/mspell-dispel.h"
+#include "mspell/mspell-dispel.h"
#include "blue-magic/blue-magic-checker.h"
#include "core/speed-table.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief フロアの一定範囲に効果を及ぼす (悲鳴、テレポート等)スペルの効果
* @date 2020/05/16
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスター魔法の実装(対モンスター処理) / Monster spells (attack monster)
* @date 2014/01/17
* @author
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "mspell/mspell-learn-checker.h"
+#include "mspell/mspell-learn-checker.h"
#include "floor/cave.h"
#include "grid/grid.h"
#include "system/floor-type-definition.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief モンスターの魔法によってフロアを明るくする処理及びその判定
* @date 2020/07/23
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#include "system/angband.h"
//! モンスターが魔法を使った際の結果。
-/*!
+/*!
* @brief モンスターが詠唱する魔法を選択する処理
* @date 2020/07/23
* @author Hourier
*/
static bool spell_summon(MonsterAbilityType spell)
{
- return spell_in_between(spell, MonsterAbilityType::S_KIN, MonsterAbilityType::S_UNIQUE);
+ return spell_in_between(spell, MonsterAbilityType::S_KIN, MonsterAbilityType::S_DEAD_UNIQUE);
}
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 特殊な行動を取るモンスターの具体的な行動定義 (MonsterRaceDefinitionsのSPECIALフラグ)
* @date 2020/05/16
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief プレイヤーのステータスを下げるか、モンスター自身のステータスを上げるスペル類の処理
* @date 2020/05/16
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/mspell-summon.h"
+#include "mspell/mspell-summon.h"
#include "core/disturbance.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
return res;
}
+
+/*!
+ * @brief RF6_S_DEAD_UNIQUEの処理。撃破済みユニーク・モンスターをクローンとして召喚。 /
+ * @param player_ptr プレイヤーへの参照ポインタ
+ * @param y 対象の地点のy座標
+ * @param x 対象の地点のx座標
+ * @param m_idx 呪文を唱えるモンスターID
+ * @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。
+ * @param target_type プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER
+ *
+ * プレイヤーが対象ならラーニング可。
+ */
+MonsterSpellResult spell_RF6_S_DEAD_UNIQUE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type)
+{
+ auto *floor_ptr = player_ptr->current_floor_ptr;
+ auto rlev = monster_level_idx(floor_ptr, m_idx);
+ auto mon_to_mon = (target_type == MONSTER_TO_MONSTER);
+ auto mon_to_player = (target_type == MONSTER_TO_PLAYER);
+ auto see_either = see_monster(player_ptr, m_idx) || see_monster(player_ptr, t_idx);
+ auto known = monster_near_player(floor_ptr, m_idx, t_idx);
+
+ mspell_cast_msg_blind msg(_("%^sが何かをつぶやいた。", "%^s mumbles."),
+ _("%s^が魔法で特別な強敵を蘇らせた!", "%^s magically animates special opponents!"),
+ _("%s^が魔法で特別な強敵を蘇らせた!", "%^s magically animates special opponents!"));
+
+ monspell_message(player_ptr, m_idx, t_idx, msg, target_type);
+ summon_disturb(player_ptr, target_type, known, see_either);
+
+ auto count = 0;
+ for (auto k = 0; k < S_NUM_4; k++) {
+ count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_DEAD_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_CLONE));
+ }
+
+ if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+ msg_format(_("多くの力強いものが間近に蘇った音が聞こえる。", "You hear many powerful things animate nearby."));
+ }
+
+ if (monster_near_player(floor_ptr, m_idx, t_idx) && !see_monster(player_ptr, t_idx) && count && mon_to_mon) {
+ floor_ptr->monster_noise = true;
+ }
+
+ auto res = MonsterSpellResult::make_valid();
+ res.learnable = target_type == MONSTER_TO_PLAYER;
+
+ return res;
+}
-#pragma once
+#pragma once
#include "system/angband.h"
MonsterSpellResult spell_RF6_S_HI_DRAGON(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type);
MonsterSpellResult spell_RF6_S_AMBERITES(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type);
MonsterSpellResult spell_RF6_S_UNIQUE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type);
+MonsterSpellResult spell_RF6_S_DEAD_UNIQUE(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type);
-#include "mspell/mspell-util.h"
+#include "mspell/mspell-util.h"
#include "core/disturbance.h"
#include "floor/geometry.h"
#include "grid/grid.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/smart-mspell-util.h"
+#include "mspell/smart-mspell-util.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-ability-flags.h"
#include "monster-race/race-flags2.h"
-#pragma once
+#pragma once
#include "monster-race/race-ability-flags.h"
#include "monster/smart-learn-types.h"
-#include "mspell/specified-summon.h"
+#include "mspell/specified-summon.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/cave.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mspell/summon-checker.h"
+#include "mspell/summon-checker.h"
#include "monster-attack/monster-attack-table.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
is_match |= (r_idx == MonsterRaceId::SHALLOW_PUDDLE) || (r_idx == MonsterRaceId::DEEP_PUDDLE) || (r_idx == MonsterRaceId::SKY_WHALE);
return is_match;
}
+ case SUMMON_DEAD_UNIQUE: {
+ return monrace.kind_flags.has(MonsterKindType::UNIQUE) && monrace.max_num == 0;
+ }
default:
return false;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mutation/gain-mutation-switcher.h"
+#include "mutation/gain-mutation-switcher.h"
#include "mutation/mutation-flag-types.h"
#include "mutation/mutation-util.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
struct glm_type;
class PlayerType;
-#include "mutation/lose-mutation-switcher.h"
+#include "mutation/lose-mutation-switcher.h"
#include "mutation/mutation-flag-types.h"
#include "mutation/mutation-util.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
struct glm_type;
class PlayerType;
-/*!
+/*!
* @brief 突然変異の各種計算 / Calculations for mutation
* @date 2014/01/11
* @author
-#pragma once
+#pragma once
class PlayerType;
int calc_mutant_regenerate_mod(PlayerType *player_ptr);
-#pragma once
+#pragma once
enum class PlayerMutationType {
SPIT_ACID = 0, /*!< 突然変異: 酸の唾 */
-#include "mutation/mutation-investor-remover.h"
+#include "mutation/mutation-investor-remover.h"
#include "avatar/avatar.h"
#include "core/stuff-handler.h"
#include "mutation/gain-mutation-switcher.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "mutation/mutation-processor.h"
+#include "mutation/mutation-processor.h"
#include "core/asking-player.h"
#include "core/disturbance.h"
#include "effect/attribute-types.h"
-#pragma once
+#pragma once
class PlayerType;
void process_world_aux_mutation(PlayerType *player_ptr);
-/*!
+/*!
* @brief 突然変異でのみ得ることができる特殊能力処理
* @date 2020/07/04
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
bool eat_rock(PlayerType *player_ptr);
-#include "mutation/mutation-util.h"
+#include "mutation/mutation-util.h"
#include "mutation/mutation-flag-types.h"
glm_type *initialize_glm_type(glm_type *gm_ptr, MUTATION_IDX choose_mut)
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "net/curl-easy-session.h"
+#include "net/curl-easy-session.h"
#if !defined(DISABLE_NET)
-#pragma once
+#pragma once
#include "system/angband.h"
#include <functional>
-#include "net/curl-slist.h"
+#include "net/curl-slist.h"
#if !defined(DISABLE_NET)
-#pragma once
+#pragma once
#include "system/angband.h"
#include <memory>
-#include "net/http-client.h"
+#include "net/http-client.h"
#include "net/curl-easy-session.h"
#include "net/curl-slist.h"
#include <fstream>
-#pragma once
+#pragma once
#include "system/angband.h"
#include <filesystem>
-#include "external-lib/include-json.h"
+#include "external-lib/include-json.h"
#include "locale/japanese.h"
#include "net/http-client.h"
#include "system/angband-version.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "object-activation/activation-bolt-ball.h"
+#include "object-activation/activation-bolt-ball.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "object-activation/activation-breath.h"
+#include "object-activation/activation-breath.h"
#include "effect/attribute-types.h"
#include "object-enchant/dragon-breaths-table.h"
#include "object/object-flags.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "object-activation/activation-charm.h"
+#include "object-activation/activation-charm.h"
#include "spell-kind/spells-charm.h"
#include "spell-kind/spells-sight.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
class PlayerType;
bool activate_charm_animal(PlayerType *player_ptr);
-#include "object-activation/activation-genocide.h"
+#include "object-activation/activation-genocide.h"
#include "spell-kind/spells-genocide.h"
#include "system/player-type-definition.h"
#include "view/display-messages.h"
-#pragma once
+#pragma once
class PlayerType;
bool activate_genocide(PlayerType *player_ptr);
-/*!
+/*!
* @brief 発動処理その他 (肥大化しがちなので適宜まとまりを別ファイルへ分割すること)
* @date 2020/08/19
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "object-activation/activation-resistance.h"
+#include "object-activation/activation-resistance.h"
#include "effect/attribute-types.h"
#include "hpmp/hp-mp-processor.h"
#include "spell-kind/spells-launcher.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief プレイヤーの発動コマンド実装
* @date 2018/09/07
* @author deskull
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "object-activation/activation-teleport.h"
+#include "object-activation/activation-teleport.h"
#include "cmd-io/cmd-save.h"
#include "core/asking-player.h"
#include "effect/attribute-types.h"
-#pragma once
+#pragma once
class PlayerType;
bool activate_teleport_away(PlayerType *player_ptr);
-#include "object-activation/activation-util.h"
+#include "object-activation/activation-util.h"
#include "object/object-info.h"
#include "system/baseitem-info.h"
#include "system/item-entity.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "object-enchant/activation-info-table.h"
+#include "object-enchant/activation-info-table.h"
#include "artifact/random-art-effects.h"
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
#include <vector>
-#include "object-enchant/dragon-breaths-table.h"
+#include "object-enchant/dragon-breaths-table.h"
#include "effect/attribute-types.h"
/*!
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "object-enchant/tr-types.h"
-#pragma once
+#pragma once
/*
* @file enchanter-base.h
-/*!
+/*!
* @brief アイテムの強化/弱化処理クラスを選択するファクトリクラス
* @date 2022/03/22
* @author Hourier
-#pragma once
+#pragma once
#include <memory>
-#pragma once
+#pragma once
/*
* Bit flags for apply_magic()
-#pragma once
+#pragma once
/*
* アイテムの簡易鑑定定義 / Game generated inscription indices. These are stored in the object,
-/*!
+/*!
* @brief ベースアイテムを強化する処理
* @date 2022/03/22
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include <tuple>
-#include "object-enchant/object-boost.h"
+#include "object-enchant/object-boost.h"
#include "artifact/random-art-effects.h"
#include "object-enchant/tr-types.h"
#include "player-ability/player-ability-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "object-enchant/object-curse.h"
+#include "object-enchant/object-curse.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "inventory/inventory-slot-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief エゴアイテムに関する処理
* @date 2019/05/02
* @author deskull
-#pragma once
+#pragma once
#include <map>
#include <string>
-/*
+/*
* @brief 変愚ver1.5.0以前に使われていたアイテムの追加特性フラグ / Hack -- special "xtra" object powers
* @date 2020/05/28
* @author Hourier
-/*!
+/*!
* @brief アミュレットを強化生成する処理
* @date 2021/04/30
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/enchanter-base.h"
#include "system/angband.h"
-#include "object-enchant/others/apply-magic-lite.h"
+#include "object-enchant/others/apply-magic-lite.h"
#include "artifact/random-art-generator.h"
#include "inventory/inventory-slot-types.h"
#include "object-enchant/object-ego.h"
-#pragma once
+#pragma once
#include "object-enchant/enchanter-base.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 武器でも防具でもアクセサリでもない、その他のアイテム群を生成・強化する処理
* @date 2022/02/23
* @author Hourier
#include "artifact/random-art-generator.h"
#include "game-option/cheat-options.h"
#include "inventory/inventory-slot-types.h"
+#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-indice-types.h"
auto *floor_ptr = this->player_ptr->current_floor_ptr;
MonsterRaceId r_idx;
while (true) {
- r_idx = get_mon_num(this->player_ptr, 0, floor_ptr->dun_level, 0);
+ r_idx = get_mon_num(this->player_ptr, 0, floor_ptr->dun_level, PM_NONE);
auto &r_ref = monraces_info[r_idx];
auto check = (floor_ptr->dun_level < r_ref.level) ? (r_ref.level - floor_ptr->dun_level) : 0;
const auto sval = this->o_ptr->bi_key.sval();
-#pragma once
+#pragma once
#include "object-enchant/enchanter-base.h"
-/*!
+/*!
* @brief 指輪を強化生成する処理
* @date 2021/04/30
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/enchanter-base.h"
#include "system/angband.h"
-/*
+/*
* @brief 防具類に耐性等を付与する処理の共通部分
* @date 2021/08/01
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/enchanter-base.h"
#include "system/angband.h"
-/*
+/*
* @brief 鎧類に耐性等の追加効果を付与する基底処理
* @date 2022/03/12
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/abstract-protector-enchanter.h"
#include "system/angband.h"
-/*
+/*
* @brief 靴に耐性等の追加効果を付与する処理
* @date 2021/08/01
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/abstract-protector-enchanter.h"
#include "system/angband.h"
-/*
+/*
* @brief クロークに耐性等の追加効果を付与する処理
* @date 2021/08/01
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/abstract-protector-enchanter.h"
#include "system/angband.h"
-/*
+/*
* @brief 冠に耐性等の追加効果を付与する処理
* @date 2021/08/01
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/abstract-protector-enchanter.h"
#include "system/angband.h"
-/*
+/*
* @brief ドラゴン・スケイルメイルに耐性等の追加効果を付与する処理
* @date 2022/03/12
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/abstract-protector-enchanter.h"
#include "system/angband.h"
-/*
+/*
* @brief 籠手に耐性等の追加効果を付与する処理
* @date 2021/08/01
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/abstract-protector-enchanter.h"
#include "system/angband.h"
-/*
+/*
* @brief 重鎧に耐性等の追加効果を付与する処理
* @date 2022/03/12
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/apply-magic-armor.h"
#include "system/angband.h"
-/*
+/*
* @brief 兜に耐性等の追加効果を付与する処理
* @date 2021/08/01
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/abstract-protector-enchanter.h"
#include "system/angband.h"
-/*
+/*
* @brief 盾に耐性等の追加効果を付与する処理
* @date 2021/08/01
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/abstract-protector-enchanter.h"
#include "system/angband.h"
-/*
+/*
* @brief 軽鎧に耐性等の追加効果を付与する処理
* @date 2022/03/12
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/protector/apply-magic-armor.h"
#include "system/angband.h"
-#pragma once
+#pragma once
/*
* Special Object Flags
-#pragma once
+#pragma once
#include "object-enchant/tr-types.h"
#include "util/flag-group.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/* 旧TRC. 実態に即した名称に変更 */
enum class CurseTraitType {
-#pragma once
+#pragma once
// clang-format off
/*!
-#include "object-enchant/vorpal-weapon.h"
+#include "object-enchant/vorpal-weapon.h"
#include "artifact/fixed-art-types.h"
#include "inventory/inventory-slot-types.h"
#include "io/files-util.h"
-#pragma once
+#pragma once
struct player_attack_type;
class PlayerType;
-#include "object-enchant/weapon/abstract-weapon-enchanter.h"
+#include "object-enchant/weapon/abstract-weapon-enchanter.h"
#include "object-enchant/object-boost.h"
#include "object/tval-types.h"
#include "sv-definition/sv-weapon-types.h"
-#pragma once
+#pragma once
#include "object-enchant/enchanter-base.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 矢類のアイテムを強化する処理
* @date 2022/03/11
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/weapon/abstract-weapon-enchanter.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 弓系のアイテムを強化する処理
* @date 2022/03/11
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/weapon/abstract-weapon-enchanter.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 掘削武器に耐性等の追加効果を付与する処理
* @date 2022/03/11
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/weapon/abstract-weapon-enchanter.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 鈍器に耐性等の追加効果を付与する処理
* @date 2022/03/22
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/weapon/melee-weapon-enchanter.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 長柄/斧に耐性等の追加効果を付与する処理
* @date 2022/03/22
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/weapon/melee-weapon-enchanter.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 剣に耐性等の追加効果を付与する処理
* @date 2022/03/22
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/weapon/melee-weapon-enchanter.h"
#include "system/angband.h"
-/*!
+/*!
* @brief 剣・鈍器・長柄/斧武器に耐性等の追加効果を付与する処理
* @date 2022/03/22
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/weapon/abstract-weapon-enchanter.h"
#include "system/angband.h"
-#include "object-hook/hook-armor.h"
+#include "object-hook/hook-armor.h"
#include "inventory/inventory-slot-types.h"
#include "object/object-info.h"
#include "player/player-sex.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "object-hook/hook-expendable.h"
+#include "object-hook/hook-expendable.h"
#include "artifact/fixed-art-types.h"
#include "core/window-redrawer.h"
#include "monster-race/monster-race.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "object-hook/hook-magic.h"
+#include "object-hook/hook-magic.h"
#include "inventory/inventory-slot-types.h"
#include "object-enchant/tr-types.h"
#include "object/object-flags.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "object-hook/hook-perception.h"
+#include "object-hook/hook-perception.h"
#include "object-hook/hook-weapon.h"
#include "perception/object-perception.h"
#include "system/item-entity.h"
-#pragma once
+#pragma once
class ItemEntity;
bool object_is_nameless_weapon_armour(const ItemEntity *o_ptr);
-#include "object-hook/hook-quest.h"
+#include "object-hook/hook-quest.h"
#include "artifact/fixed-art-types.h"
#include "cmd-building/cmd-building.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
#include "dungeon/quest.h"
#include "system/angband.h"
-#include "object-hook/hook-weapon.h"
+#include "object-hook/hook-weapon.h"
#include "object-enchant/tr-types.h"
#include "object-hook/hook-armor.h"
#include "object/object-flags.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "object-use/item-use-checker.h"
+#include "object-use/item-use-checker.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
-#pragma once
+#pragma once
#include <string>
-/*
+/*
* @brief 薬を飲んだ時の効果処理
* @date 2022/03/10
* @author Hourier
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-/*!
+/*!
* @brief 薬を飲んだ時の各種効果処理
* @date 2022/03/10
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*
+/*
* @brief 読むことができるアイテム群の内、Tシャツ『★GHB』を読んだ時の効果や処理を記述する.
* @date 2022/02/26
* @author Hourier
-#pragma once
+#pragma once
#include "object-use/read/read-executor-base.h"
-/*
+/*
* @brief 読むことができるアイテム群の内、中つ国ガイドを読んだ時の効果や処理を記述する.
* @date 2022/02/26
* @author Hourier
-#pragma once
+#pragma once
#include "object-use/read/read-executor-base.h"
-/*!
+/*!
* @brief 巻物を読んだ際の効果処理
* @date 2022/02/26
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
class ReadExecutorBase {
public:
-#include "object-use/read/read-executor-factory.h"
+#include "object-use/read/read-executor-factory.h"
#include "artifact/fixed-art-types.h"
#include "object-use/read/gbh-shirt-read-executor.h"
#include "object-use/read/parchment-read-executor.h"
-#pragma once
+#pragma once
#include "object-use/read/read-executor-base.h"
#include <memory>
-/*
+/*
* @brief 読むことができるアイテム群の内、一つの指輪に刻印された文字を読んだ時の効果や処理を記述する.
* @date 2022/02/26
* @author Hourier
-#pragma once
+#pragma once
#include "object-use/read/read-executor-base.h"
-/*
+/*
* @brief 読むことができるアイテム群の内、巻物を読んだ時の効果や処理を記述する.
* @date 2022/02/26
* @author Hourier
-#pragma once
+#pragma once
#include "object-use/read/read-executor-base.h"
-/*!
+/*!
* @file throw-util.cpp
* @brief 投擲処理関連クラス
* @date 2021/08/20
-#pragma once
+#pragma once
/*!
* @file throw-util.h
* @brief 投擲処理関連ヘッダ
-/*!
+/*!
* @brief 杖を振る処理
* @date 2021/09/25
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief ロッドを振る処理
* @date 2021/09/25
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "object-use/zapwand-execution.h"
+#include "object-use/zapwand-execution.h"
#include "action/action-limited.h"
#include "avatar/avatar.h"
#include "cmd-item/cmd-zapwand.h" // 相互依存。暫定的措置、後で何とかする.
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief オブジェクトに関する汎用判定処理
* @date 2018/09/24
* @author deskull
-#pragma once
+#pragma once
#include "object/tval-types.h"
-#pragma once
+#pragma once
/*
* get_item()関数でアイテムの選択を行うフラグ / Bit flags for the "get_item" function
-#include "object/lite-processor.h"
+#include "object/lite-processor.h"
#include "core/disturbance.h"
#include "core/window-redrawer.h"
#include "game-option/disturbance-options.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-/*!
+/*!
* @brief アイテム破壊処理
* @date 2019/03/06
* @author deskull
-#pragma once
+#pragma once
#include "object-enchant/tr-types.h"
#include "system/angband.h"
-#include "object/object-flags.h"
+#include "object/object-flags.h"
#include "mind/mind-weaponsmith.h"
#include "object-enchant/object-ego.h"
#include "object-enchant/tr-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include "system/system-variables.h"
-#include "object/object-index-list.h"
+#include "object/object-index-list.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief オブジェクトの実装 / Object code, part 1
* @date 2014/01/10
* @author
* @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
* @return std::string 発動名称を返す文字列ポインタ
*/
-static std::string item_activation_dragon_breath(ItemEntity *o_ptr)
+static std::string item_activation_dragon_breath(const ItemEntity *o_ptr)
{
std::string desc = _("", "breathe ");
int n = 0;
* @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
* @return concptr 発動名称を返す文字列ポインタ
*/
-static concptr item_activation_aux(ItemEntity *o_ptr)
+static concptr item_activation_aux(const ItemEntity *o_ptr)
{
static std::string activation_detail;
auto tmp_act_ptr = find_activation_info(o_ptr);
* @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
* @return concptr 発動名称を返す文字列ポインタ
*/
-concptr activation_explanation(ItemEntity *o_ptr)
+std::string activation_explanation(const ItemEntity *o_ptr)
{
auto flags = object_flags(o_ptr);
if (flags.has_not(TR_ACTIVATE)) {
-#pragma once
+#pragma once
#include "object/tval-types.h"
#include "system/angband.h"
+#include <string>
#define OBJ_GOLD_LIST 480 /* First "gold" entry */
class BaseitemKey;
class ItemEntity;
class PlayerType;
-concptr activation_explanation(ItemEntity *o_ptr);
+std::string activation_explanation(const ItemEntity *o_ptr);
char index_to_label(int i);
int16_t wield_slot(PlayerType *player_ptr, const ItemEntity *o_ptr);
bool check_book_realm(PlayerType *player_ptr, const BaseitemKey &bi_key);
-/*!
+/*!
* @brief アイテムが特定種別のものであるかどうかの判定関数群
* @date 2018/12/15
* @author deskull
-#pragma once
+#pragma once
bool kind_is_cloak(short bi_id);
bool kind_is_polearm(short bi_id);
-/*
+/*
* @brief How an entity of an item is marked (flags in ItemEntity::marked)
* @date 2020/05/28
* @author Hourier
-/*!
+/*!
* @brief 同種のアイテムをインベントリや床に重ね合わせたり、その判断を行う処理
* @date 2020/06/03
* @author Hourier
-#pragma once
+#pragma once
class ItemEntity;
void distribute_charges(ItemEntity *o_ptr, ItemEntity *q_ptr, int amt);
-#include "object/object-value-calc.h"
+#include "object/object-value-calc.h"
#include "artifact/artifact-info.h"
#include "object-enchant/activation-info-table.h"
#include "object-enchant/object-ego.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "object/object-value.h"
+#include "object/object-value.h"
#include "monster-race/monster-race.h"
#include "object/object-flags.h"
#include "object/object-value-calc.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*
+/*
* The values for the "tval" field of various objects.
*
* This value is the primary means by which items are sorted in the
-#include "object/warning.h"
+#include "object/warning.h"
#include "artifact/fixed-art-types.h"
#include "core/asking-player.h"
#include "core/disturbance.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "perception/identification.h"
+#include "perception/identification.h"
#include "artifact/fixed-art-types.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "util/buffer-shaper.h"
#include "util/enum-converter.h"
#include <algorithm>
+#include <array>
+#include <string>
/*!
* @brief オブジェクトの*鑑定*内容を詳述して表示する /
*/
bool screen_object(PlayerType *player_ptr, ItemEntity *o_ptr, BIT_FLAGS mode)
{
- concptr info[128];
+ std::array<std::string, 128> info{};
int trivial_info = 0;
auto flags = object_flags(o_ptr);
}
screen_save();
- int wid, hgt;
- term_get_size(&wid, &hgt);
-
+ const auto [wid, hgt] = term_get_size();
std::string item_name;
if (!(mode & SCROBJ_FAKE_OBJECT)) {
item_name = describe_flavor(player_ptr, o_ptr, 0);
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "perception/object-perception.h"
+#include "perception/object-perception.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "game-option/play-record-options.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-/*!
+/*!
* @brief 疑似鑑定処理
* @date 2020/05/15
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/item-feeling.h"
-/*!
+/*!
* @brief 落馬処理
* @date 2020/05/31
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "pet/pet-util.h"
+#include "pet/pet-util.h"
#include "core/stuff-handler.h"
#include "grid/grid.h"
#include "monster-race/monster-race.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/*
* @file player-ability-types.h
-#include "player-ability/player-charisma.h"
+#include "player-ability/player-charisma.h"
#include "mutation/mutation-flag-types.h"
#include "object/object-flags.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
#include "player-status/player-basic-statistics.h"
-#include "player-ability/player-constitution.h"
+#include "player-ability/player-constitution.h"
#include "mutation/mutation-flag-types.h"
#include "object/object-flags.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
#include "player-status/player-basic-statistics.h"
-#include "player-ability/player-dexterity.h"
+#include "player-ability/player-dexterity.h"
#include "mutation/mutation-flag-types.h"
#include "object/object-flags.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
#include "player-status/player-basic-statistics.h"
-#include "player-ability/player-intelligence.h"
+#include "player-ability/player-intelligence.h"
#include "mutation/mutation-flag-types.h"
#include "object/object-flags.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
#include "player-status/player-basic-statistics.h"
-#include "player-ability/player-strength.h"
+#include "player-ability/player-strength.h"
#include "mutation/mutation-flag-types.h"
#include "object/object-flags.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
#include "player-status/player-basic-statistics.h"
-#include "player-ability/player-wisdom.h"
+#include "player-ability/player-wisdom.h"
#include "mutation/mutation-flag-types.h"
#include "object/object-flags.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
#include "player-status/player-basic-statistics.h"
-/*!
+/*!
* @brief 特殊属性武器で攻撃した際の追加効果処理
* @date 2020/05/23
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 吸血処理
* @date 2020/05/23
* @author Hourier
-#pragma once
+#pragma once
struct player_attack_type;
class PlayerType;
-/*!
+/*!
* @brief プレイヤーからモンスターへの打撃処理
* @date 2020/05/22
* @author Hourier
-#pragma once
+#pragma once
#include "combat/combat-options-type.h"
#include "combat/martial-arts-table.h"
-/*!
+/*!
* @brief プレイヤーの職業クラスに基づく耐性・能力の判定処理等を行うクラス
* @date 2021/09/08
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/tr-flags.h"
#include "system/player-type-definition.h"
-/*!
+/*!
* @brief プレイヤーの種族に基づく耐性・能力の判定処理等を行うクラス
* @date 2021/09/08
* @author Hourier
-#pragma once
+#pragma once
#include "object-enchant/tr-flags.h"
-#include "player-info/alignment.h"
+#include "player-info/alignment.h"
#include "artifact/fixed-art-types.h"
#include "avatar/avatar.h"
#include "game-option/text-display-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player-info/base-status-info.h"
+#include "player-info/base-status-info.h"
#include "inventory/inventory-slot-types.h"
#include "object-enchant/tr-types.h"
#include "object/object-flags.h"
-#pragma once
+#pragma once
class PlayerType;
struct self_info_type;
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player-info/body-improvement-info.h"
+#include "player-info/body-improvement-info.h"
#include "player-info/self-info-util.h"
#include "player/player-status-flags.h"
#include "player/player-status.h"
-#pragma once
+#pragma once
class PlayerType;
struct self_info_type;
-#include "player-info/class-ability-info.h"
+#include "player-info/class-ability-info.h"
#include "player-info/self-info-util.h"
#include "realm/realm-names-table.h"
#include "realm/realm-types.h"
-#pragma once
+#pragma once
class PlayerType;
struct self_info_type;
-/*!
+/*!
* @brief プレイヤーの職業に関する諸テーブル定義
* @date 2019/04/30
* @author deskull
-#pragma once
+#pragma once
/* 人畜無害なenumヘッダを先に読み込む */
#include "system/angband.h"
-#pragma once
+#pragma once
#include <memory>
#include <variant>
-#pragma once
+#pragma once
enum class PlayerClassType : short {
WARRIOR = 0,
-#include "player-info/equipment-info.h"
+#include "player-info/equipment-info.h"
#include "inventory/inventory-slot-types.h"
#include "object-hook/hook-weapon.h"
#include "object/tval-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player-info/magic-eater-data-type.h"
+#include "player-info/magic-eater-data-type.h"
#include "sv-definition/sv-rod-types.h"
#include "sv-definition/sv-staff-types.h"
#include "sv-definition/sv-wand-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player-info/mimic-info-table.h"
+#include "player-info/mimic-info-table.h"
#include "player-info/race-info.h"
#ifdef JP
-#pragma once
+#pragma once
#include "player-info/race-info.h"
#include <map>
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player-info/mutation-info.h"
+#include "player-info/mutation-info.h"
#include "mutation/mutation-flag-types.h"
#include "player-info/self-info-util.h"
#include "player/player-status-flags.h"
-#pragma once
+#pragma once
class PlayerType;
struct self_info_type;
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player-info/race-ability-info.h"
+#include "player-info/race-ability-info.h"
#include "player-info/self-info-util.h"
#include "system/player-type-definition.h"
#include "term/z-form.h"
-#pragma once
+#pragma once
class PlayerType;
struct self_info_type;
-#include "player-info/race-info.h"
+#include "player-info/race-info.h"
const player_race_info *rp_ptr;
-#pragma once
+#pragma once
#include <optional>
#include <unordered_map>
-#pragma once
+#pragma once
#include "util/enum-converter.h"
-#include "player-info/resistance-info.h"
+#include "player-info/resistance-info.h"
#include "player-base/player-race.h"
#include "player-info/race-info.h"
#include "player-info/self-info-util.h"
-#pragma once
+#pragma once
class PlayerType;
struct self_info_type;
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 自己分析における各種情報格納処理 (予定地)
* @author Hourier
* @date 2023/06/10
-#pragma once
+#pragma once
#include "system/item-entity.h"
-/*!
+/*!
* @brief 自己分析処理/ Self knowledge
* @date 2018/09/07
* @author deskull
-#pragma once
+#pragma once
class PlayerType;
void self_knowledge(PlayerType *player_ptr);
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player-info/weapon-effect-info.h"
+#include "player-info/weapon-effect-info.h"
#include "inventory/inventory-slot-types.h"
#include "object-enchant/tr-types.h"
#include "player-info/self-info-util.h"
-#pragma once
+#pragma once
class PlayerType;
struct self_info_type;
-#include "player-status/player-basic-statistics.h"
+#include "player-status/player-basic-statistics.h"
#include "core/window-redrawer.h"
#include "mutation/mutation-flag-types.h"
#include "object/object-flags.h"
-#pragma once
+#pragma once
#include "player-ability/player-ability-types.h"
#include "player-status/player-status-base.h"
-/*
+/*
* @file player-energy.cpp
* @brief ゲームターン当たりの行動エネルギー増減処理
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/*!< Empty hand status */
enum empty_hand_status {
-#include "player-status/player-infravision.h"
+#include "player-status/player-infravision.h"
#include "mutation/mutation-flag-types.h"
#include "player-base/player-race.h"
#include "player-info/mimic-info-table.h"
-#pragma once
+#pragma once
#include "player-status/player-status-base.h"
class PlayerInfravision : public PlayerStatusBase {
-#include "player-status/player-speed.h"
+#include "player-status/player-speed.h"
#include "artifact/fixed-art-types.h"
#include "grid/feature-flag-types.h"
#include "grid/feature.h"
-#pragma once
+#pragma once
#include "player-status/player-status-base.h"
class PlayerSpeed : public PlayerStatusBase {
-#include "player-status/player-status-base.h"
+#include "player-status/player-status-base.h"
#include "inventory/inventory-slot-types.h"
#include "object/object-flags.h"
#include "player/player-status.h"
-#pragma once
+#pragma once
#include "player/player-status-flags.h"
#include "system/angband.h"
-#include "player-status/player-stealth.h"
+#include "player-status/player-stealth.h"
#include "mind/mind-ninja.h"
#include "mutation/mutation-flag-types.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
#include "player-status/player-status-base.h"
class PlayerStealth : public PlayerStatusBase {
-#pragma once
+#pragma once
enum special_attack_type {
ATTACK_CONFUSE = 0x00000001, /*!< プレイヤーのステータス:混乱打撃 */
-#include "player/digestion-processor.h"
+#include "player/digestion-processor.h"
#include "avatar/avatar.h"
#include "core/disturbance.h"
#include "core/speed-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief エルドリッチホラー処理
* @date 2020/06/07
* @author Hourier
#include "player/eldritch-horror.h"
#include "core/stuff-handler.h"
#include "locale/english.h"
+#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags1.h"
}
} else if (!necro) {
get_mon_num_prep(player_ptr, get_nightmare, nullptr);
- auto *r_ptr = &monraces_info[get_mon_num(player_ptr, 0, MAX_DEPTH, 0)];
+ auto *r_ptr = &monraces_info[get_mon_num(player_ptr, 0, MAX_DEPTH, PM_NONE)];
power = r_ptr->level + 10;
const auto &desc = r_ptr->name;
get_mon_num_prep(player_ptr, nullptr, nullptr);
-#pragma once
+#pragma once
class MonsterEntity;
class PlayerType;
-#include "player/patron.h"
+#include "player/patron.h"
#include "cmd-action/cmd-pet.h"
#include "cmd-io/cmd-dump.h"
#include "flavor/flavor-describer.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-#include "player/permanent-resistances.h"
+#include "player/permanent-resistances.h"
#include "inventory/inventory-slot-types.h"
#include "mind/mind-elementalist.h"
#include "mutation/mutation-flag-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player/player-damage.h"
+#include "player/player-damage.h"
#include "autopick/autopick-pref-processor.h"
#include "avatar/avatar.h"
#include "blue-magic/blue-magic-checker.h"
-#pragma once
+#pragma once
#include <string_view>
-/*!
+/*!
* @brief プレイヤーの移動処理 / Movement commands
* @date 2014/01/02
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
enum player_personality_type {
PERSONALITY_ORDINARY = 0,
-#include "player/player-personality.h"
+#include "player/player-personality.h"
#include "mutation/mutation-flag-types.h"
#include "object-enchant/trc-types.h"
-#pragma once
+#pragma once
#include "player/player-personality-types.h"
#include "system/angband.h"
-#include "player/player-realm.h"
+#include "player/player-realm.h"
#include "object/tval-types.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <vector>
-#include "player/player-sex.h"
+#include "player/player-sex.h"
/*
* Pointer to the player tables
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player/player-skill.h"
+#include "player/player-skill.h"
#include "monster-race/monster-race.h"
#include "player-base/player-class.h"
#include "player-base/player-race.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player/player-status-flags.h"
+#include "player/player-status-flags.h"
#include "artifact/fixed-art-types.h"
#include "inventory/inventory-slot-types.h"
#include "mind/mind-elementalist.h"
-#pragma once
+#pragma once
#include "inventory/inventory-slot-types.h"
#include "object-enchant/tr-types.h"
-#include "player/player-status-resist.h"
+#include "player/player-status-resist.h"
#include "artifact/fixed-art-types.h"
#include "grid/grid.h"
#include "inventory/inventory-slot-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "player/player-status-table.h"
+#include "player/player-status-table.h"
/*!
* @brief 能力値テーブル / Abbreviations of healthy stats
-#pragma once
+#pragma once
#include "player-ability/player-ability-types.h"
#include "system/angband.h"
-#include "player/player-status.h"
+#include "player/player-status.h"
#include "artifact/fixed-art-types.h"
#include "autopick/autopick-reader-writer.h"
#include "autopick/autopick.h"
-#pragma once
+#pragma once
/*
* @file player-status.h
-#include "player/player-view.h"
+#include "player/player-view.h"
#include "floor/cave.h"
#include "floor/line-of-sight.h"
#include "game-option/map-screen-options.h"
-#pragma once
+#pragma once
class PlayerType;
void update_view(PlayerType *player_ptr);
-/*!
+/*!
* @brief 死亡・引退・切腹時の画面表示
* @date 2020/02/24
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void print_tomb(PlayerType *player_ptr);
-#include "player/process-name.h"
+#include "player/process-name.h"
#include "autopick/autopick-reader-writer.h"
#include "core/asking-player.h"
#include "game-option/birth-options.h"
-#pragma once
+#pragma once
class PlayerType;
void process_player_name(PlayerType *player_ptr, bool is_new_savefile = false);
-#include "player/race-info-table.h"
+#include "player/race-info-table.h"
#ifdef JP
#define N(JAPANESE, ENGLISH) JAPANESE, ENGLISH
-#pragma once
+#pragma once
#include "player-info/race-info.h"
#include "player-info/race-types.h"
-#include "player/race-resistances.h"
+#include "player/race-resistances.h"
#include "inventory/inventory-slot-types.h"
#include "mind/mind-elementalist.h"
#include "mutation/mutation-flag-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
enum special_defence {
DEFENSE_ACID = 0x00000001, /*!< プレイヤーのステータス:酸免疫 */
-#include "player/temporary-resistances.h"
+#include "player/temporary-resistances.h"
#include "object-enchant/tr-types.h"
#include "player-info/race-info.h"
#include "player-info/race-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "racial/class-racial-switcher.h"
+#include "racial/class-racial-switcher.h"
#include "cmd-action/cmd-spell.h"
#include "mind/mind-elementalist.h"
#include "racial/racial-util.h"
-#pragma once
+#pragma once
class PlayerType;
struct rc_type;
-#include "racial/mutation-racial-selector.h"
+#include "racial/mutation-racial-selector.h"
#include "cmd-action/cmd-spell.h"
#include "locale/japanese.h"
#include "mutation/mutation-flag-types.h"
-#pragma once
+#pragma once
class PlayerType;
struct rc_type;
-#include "racial/race-racial-command-setter.h"
+#include "racial/race-racial-command-setter.h"
#include "cmd-action/cmd-spell.h"
#include "player-info/race-info.h"
#include "racial/racial-util.h"
-#pragma once
+#pragma once
class PlayerType;
struct rc_type;
-#include "racial/racial-android.h"
+#include "racial/racial-android.h"
#include "effect/attribute-types.h"
#include "inventory/inventory-slot-types.h"
#include "object-enchant/object-ego.h"
-#pragma once
+#pragma once
class PlayerType;
bool android_inside_weapon(PlayerType *player_ptr);
-#include "racial/racial-balrog.h"
+#include "racial/racial-balrog.h"
#include "effect/attribute-types.h"
#include "player/player-status.h"
#include "spell-kind/spells-launcher.h"
-#pragma once
+#pragma once
class PlayerType;
bool demonic_breath(PlayerType *player_ptr);
-#include "racial/racial-draconian.h"
+#include "racial/racial-draconian.h"
#include "effect/attribute-types.h"
#include "mind/mind-elementalist.h"
#include "player/player-status.h"
-#pragma once
+#pragma once
class PlayerType;
bool draconian_breath(PlayerType *player_ptr);
-#include "racial/racial-kutar.h"
+#include "racial/racial-kutar.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
#include "game-option/disturbance-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief レイシャルと突然変異の技能処理 / Racial powers (and mutations)
* @date 2014/01/08
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "racial/racial-util.h"
+#include "racial/racial-util.h"
#include "io/input-key-requester.h"
#include "player-base/player-class.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
#include <string>
#include <vector>
-#include "racial/racial-vampire.h"
+#include "racial/racial-vampire.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/geometry.h"
#include "hpmp/hp-mp-processor.h"
-#pragma once
+#pragma once
class PlayerType;
bool vampirism(PlayerType *player_ptr);
-#include "realm/realm-arcane.h"
+#include "realm/realm-arcane.h"
#include "avatar/avatar.h"
#include "cmd-action/cmd-spell.h"
#include "core/asking-player.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-chaos.h"
+#include "realm/realm-chaos.h"
#include "cmd-action/cmd-spell.h"
#include "core/asking-player.h"
#include "effect/attribute-types.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-craft.h"
+#include "realm/realm-craft.h"
#include "cmd-action/cmd-spell.h"
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-crusade.h"
+#include "realm/realm-crusade.h"
#include "cmd-action/cmd-spell.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-death.h"
+#include "realm/realm-death.h"
#include "avatar/avatar.h"
#include "cmd-action/cmd-spell.h"
#include "effect/effect-characteristics.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-demon.h"
+#include "realm/realm-demon.h"
#include "cmd-action/cmd-spell.h"
#include "effect/attribute-types.h"
#include "monster-floor/monster-summon.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#pragma once
+#pragma once
enum spell_hex_type {
/* 1st book */
-/*!
+/*!
* @brief 呪術の処理実装 / Hex code
* @date 2014/01/14
* @author
-#pragma once
+#pragma once
#include "realm/realm-hex-numbers.h"
#include "spell/spells-util.h"
-#include "realm/realm-hissatsu.h"
+#include "realm/realm-hissatsu.h"
#include "artifact/fixed-art-types.h"
#include "cmd-action/cmd-attack.h"
#include "cmd-action/cmd-spell.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-life.h"
+#include "realm/realm-life.h"
#include "cmd-action/cmd-spell.h"
#include "effect/attribute-types.h"
#include "player/digestion-processor.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-names-table.h"
+#include "realm/realm-names-table.h"
#ifdef JP
/*!
-/*!
+/*!
* @brief 魔法領域に関する関数マクロ群
* @date 2021/10/11
* @author Hourier
-#include "realm/realm-nature.h"
+#include "realm/realm-nature.h"
#include "avatar/avatar.h"
#include "cmd-action/cmd-spell.h"
#include "effect/attribute-types.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#pragma once
+#pragma once
enum realm_song_type : int {
MUSIC_NONE = 0,
-#include "cmd-action/cmd-spell.h"
+#include "cmd-action/cmd-spell.h"
#include "core/window-redrawer.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-sorcery.h"
+#include "realm/realm-sorcery.h"
#include "avatar/avatar.h"
#include "cmd-action/cmd-spell.h"
#include "core/asking-player.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "realm/realm-trump.h"
+#include "realm/realm-trump.h"
#include "cmd-action/cmd-spell.h"
#include "core/asking-player.h"
#include "effect/attribute-types.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#pragma once
+#pragma once
enum magic_realm_type {
REALM_NONE = 0,
-/*!
+/*!
* @brief fill_data_type構造体を使ってダンジョンを生成/構成する処理
* @date 2020/07/24
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "room/door-definition.h"
+#include "room/door-definition.h"
door_type feat_door[MAX_DOOR_TYPES];
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
/* 池型地形の生成ID / Room types for generate_lake() */
enum lake_type {
-#include "room/room-generator.h"
+#include "room/room-generator.h"
#include "dungeon/dungeon-flag-types.h"
#include "game-option/birth-options.h"
#include "game-option/cheat-types.h"
-#pragma once
+#pragma once
struct dun_data_type;
class PlayerType;
-#include "room/room-info-table.h"
+#include "room/room-info-table.h"
/*!
* 各部屋タイプの生成比定義
-#pragma once
+#pragma once
#include "room/room-types.h"
#include "system/angband.h"
-#pragma once
+#pragma once
#include "util/enum-converter.h"
#include "util/enum-range.h"
-/*!
+/*!
* @brief ダンジョンフロアの部屋生成処理 / make rooms. Used by generate.c when creating dungeons.
* @date 2014/01/06
* @author
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "room/rooms-city.h"
+#include "room/rooms-city.h"
#include "floor/floor-generator.h"
#include "floor/floor-town.h"
#include "game-option/cheat-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "room/rooms-fractal.h"
+#include "room/rooms-fractal.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/floor-generator.h"
#include "room/cave-filler.h"
-#pragma once
+#pragma once
struct dun_data_type;
class PlayerType;
-#include "room/rooms-maze-vault.h"
+#include "room/rooms-maze-vault.h"
#include "dungeon/dungeon-flag-types.h"
#include "game-option/cheat-types.h"
#include "grid/grid.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "room/rooms-normal.h"
+#include "room/rooms-normal.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/geometry.h"
#include "grid/door.h"
-#pragma once
+#pragma once
struct dun_data_type;
class PlayerType;
-#include "room/rooms-pit-nest.h"
+#include "room/rooms-pit-nest.h"
#include "floor/floor-generator.h"
#include "game-option/cheat-options.h"
#include "game-option/cheat-types.h"
auto select_r_idx = [player_ptr, floor_ptr, &align]() -> std::optional<MonsterRaceId> {
for (auto attempts = 100; attempts > 0; attempts--) {
/* Get a (hard) monster type */
- auto r_idx = get_mon_num(player_ptr, 0, floor_ptr->dun_level + 11, 0);
+ auto r_idx = get_mon_num(player_ptr, 0, floor_ptr->dun_level + 11, PM_NONE);
auto *r_ptr = &monraces_info[r_idx];
/* Decline incorrect alignment */
while (attempts--) {
/* Get a (hard) monster type */
- r_idx = get_mon_num(player_ptr, 0, floor_ptr->dun_level + 11, 0);
+ r_idx = get_mon_num(player_ptr, 0, floor_ptr->dun_level + 11, PM_NONE);
r_ptr = &monraces_info[r_idx];
/* Decline incorrect alignment */
while (attempts--) {
/* Get a (hard) monster type */
- r_idx = get_mon_num(player_ptr, 0, floor_ptr->dun_level + 0, 0);
+ r_idx = get_mon_num(player_ptr, 0, floor_ptr->dun_level + 0, PM_NONE);
r_ptr = &monraces_info[r_idx];
/* Decline incorrect alignment */
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "room/rooms-special.h"
+#include "room/rooms-special.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor//geometry.h"
#include "floor/floor-generator.h"
-#pragma once
+#pragma once
struct dun_data_type;
class PlayerType;
-#include "room/rooms-trap.h"
+#include "room/rooms-trap.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/floor-generator.h"
#include "game-option/cheat-types.h"
-#pragma once
+#pragma once
struct dun_data_type;
class PlayerType;
-/*!
+/*!
* @brief Vaultの生成処理
* @date 2018/09/11
* @author deskull
-#pragma once
+#pragma once
#include <stdint.h>
#include <string>
-#include "room/space-finder.h"
+#include "room/space-finder.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/cave.h"
#include "grid/grid.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 部屋にアイテム・モンスター・罠を配置する処理
* @date 2020/07/24
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "room/vault-builder.h"
+#include "room/vault-builder.h"
#include "floor/cave.h"
#include "floor/floor-generator-util.h"
#include "floor/floor-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "save/floor-writer.h"
+#include "save/floor-writer.h"
#include "core/object-compressor.h"
#include "floor/floor-events.h"
#include "floor/floor-save-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "save/info-writer.h"
+#include "save/info-writer.h"
#include "birth/quick-start.h"
#include "game-option/cheat-options.h"
#include "game-option/option-flags.h"
-#pragma once
+#pragma once
enum class SaveType;
struct store_type;
-#include "save/item-writer.h"
+#include "save/item-writer.h"
#include "artifact/random-art-effects.h"
#include "load/old/item-flag-types-savefile50.h"
#include "save/save-util.h"
-#pragma once
+#pragma once
class ItemEntity;
void wr_item(ItemEntity *o_ptr);
-#include "save/monster-writer.h"
+#include "save/monster-writer.h"
#include "load/old/monster-flag-types-savefile50.h"
#include "monster-race/monster-race.h"
#include "monster/monster-info.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "save/player-class-specific-data-writer.h"
+#include "save/player-class-specific-data-writer.h"
#include "player-info/bard-data-type.h"
#include "player-info/bluemage-data-type.h"
#include "player-info/force-trainer-data-type.h"
-#pragma once
+#pragma once
#include <memory>
-#include "save/player-writer.h"
+#include "save/player-writer.h"
#include "cmd-building/cmd-building.h"
#include "game-option/birth-options.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
class PlayerType;
void wr_player(PlayerType *player_ptr);
-#include "save/save-util.h"
+#include "save/save-util.h"
FILE *saving_savefile; /* Current save "file" */
byte save_xor_byte; /* Simple encryption */
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-/*!
+/*!
* @file save.c
* @brief セーブファイル書き込み処理 / Purpose: interact with savefiles
* @date 2014/07/12
-#pragma once
+#pragma once
enum class SaveType {
CLOSE_GAME,
-#include "smith/object-smith.h"
+#include "smith/object-smith.h"
#include "object-enchant/special-object-flags.h"
#include "object-enchant/tr-flags.h"
#include "object-enchant/tr-types.h"
-#pragma once
+#pragma once
#include "system/system-variables.h"
-#include "smith/smith-info.h"
+#include "smith/smith-info.h"
#include "object-enchant/tr-types.h"
#include "object/object-flags.h"
#include "object/tval-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "smith/smith-tables.h"
+#include "smith/smith-tables.h"
#include "artifact/random-art-effects.h"
#include "object-enchant/tr-flags.h"
#include "object-enchant/tr-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#include "system/system-variables.h"
-#include "specific-object/blade-turner.h"
+#include "specific-object/blade-turner.h"
#include "effect/attribute-types.h"
#include "hpmp/hp-mp-processor.h"
#include "spell-kind/spells-launcher.h"
-#pragma once
+#pragma once
class PlayerType;
bool activate_bladeturner(PlayerType *player_ptr);
-#include "specific-object/bloody-moon.h"
+#include "specific-object/bloody-moon.h"
#include "artifact/fixed-art-types.h"
#include "object-enchant/object-boost.h"
#include "object-enchant/tr-types.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "specific-object/chest.h"
+#include "specific-object/chest.h"
#include "effect/attribute-types.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "specific-object/death-crimson.h"
+#include "specific-object/death-crimson.h"
#include "artifact/fixed-art-types.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-/*!
+/*!
* @brief 死の大鎌に特有の処理
* @date 2020/05/23
* @author Hourier
-#pragma once
+#pragma once
struct player_attack_type;
class PlayerType;
-#include "specific-object/monster-ball.h"
+#include "specific-object/monster-ball.h"
#include "effect/spells-effect-util.h"
#include "floor/geometry.h"
#include "game-option/input-options.h"
-#pragma once
+#pragma once
class PlayerType;
class ItemEntity;
-#include "specific-object/muramasa.h"
+#include "specific-object/muramasa.h"
#include "artifact/fixed-art-types.h"
#include "core/asking-player.h"
#include "spell/spells-object.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "specific-object/ring-of-power.h"
+#include "specific-object/ring-of-power.h"
#include "effect/attribute-types.h"
#include "main/sound-definitions-table.h"
#include "main/sound-of-music.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 知識の石を発動させる処理
* @date 2021/09/24
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
class StoneOfLore {
-#include "specific-object/toragoroshi.h"
+#include "specific-object/toragoroshi.h"
#include "player-attack/player-attack.h"
#include "system/player-type-definition.h"
#include "view/display-messages.h"
-#pragma once
+#pragma once
class PlayerType;
bool activate_toragoroshi(PlayerType *player_ptr);
-#include "specific-object/torch.h"
+#include "specific-object/torch.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/cave.h"
#include "grid/grid.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 鏡使いの鏡魔法効果処理
* @date 2022/03/07
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
struct ProjectResult;
-#include "spell-kind/blood-curse.h"
+#include "spell-kind/blood-curse.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/earthquake.h"
+#include "spell-kind/earthquake.h"
#include "core/window-redrawer.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 魔法効果の実装/ Spell code (part 3)
* @date 2014/07/26
* @author
-#pragma once
+#pragma once
class PlayerType;
bool recharge(PlayerType *player_ptr, int power);
-#include "spell-kind/spells-beam.h"
+#include "spell-kind/spells-beam.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
#include "spell-kind/spells-launcher.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-charm.h"
+#include "spell-kind/spells-charm.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
#include "spell-kind/spells-launcher.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-curse-removal.h"
+#include "spell-kind/spells-curse-removal.h"
#include "core/window-redrawer.h"
#include "inventory/inventory-slot-types.h"
#include "object-enchant/item-feeling.h"
-#pragma once
+#pragma once
class PlayerType;
int remove_curse(PlayerType *player_ptr);
-#include "spell-kind/spells-detection.h"
+#include "spell-kind/spells-detection.h"
#include "core/window-redrawer.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/cave.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-enchant.h"
+#include "spell-kind/spells-enchant.h"
#include "artifact/random-art-generator.h"
#include "avatar/avatar.h"
#include "flavor/flavor-describer.h"
-#pragma once
+#pragma once
class PlayerType;
bool artifact_scroll(PlayerType *player_ptr);
-#include "spell-kind/spells-equipment.h"
+#include "spell-kind/spells-equipment.h"
#include "avatar/avatar.h"
#include "core/window-redrawer.h"
#include "flavor/flavor-describer.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-fetcher.h"
+#include "spell-kind/spells-fetcher.h"
#include "core/stuff-handler.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief フロアに影響のある魔法の処理
* @date 2019/02/21
* @author deskull
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-genocide.h"
+#include "spell-kind/spells-genocide.h"
#include "avatar/avatar.h"
#include "core/asking-player.h"
#include "core/stuff-handler.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-grid.h"
+#include "spell-kind/spells-grid.h"
#include "dungeon/quest.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-launcher.h"
+#include "spell-kind/spells-launcher.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/geometry.h"
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "spell-kind/spells-lite.h"
+#include "spell-kind/spells-lite.h"
#include "dungeon/dungeon-flag-types.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-neighbor.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-perception.h"
+#include "spell-kind/spells-perception.h"
#include "autopick/autopick.h"
#include "avatar/avatar.h"
#include "core/stuff-handler.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-pet.h"
+#include "spell-kind/spells-pet.h"
#include "core/asking-player.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
-#pragma once
+#pragma once
class PlayerType;
void discharge_minion(PlayerType *player_ptr);
-#include "spell-kind/spells-polymorph.h"
+#include "spell-kind/spells-polymorph.h"
#include "core/stuff-handler.h"
#include "floor/floor-object.h"
#include "monster-floor/monster-generator.h"
DEPTH lev2 = r_ptr->level + ((randint1(20) / randint1(9)) + 1);
MonsterRaceId r;
for (int i = 0; i < 1000; i++) {
- r = get_mon_num(player_ptr, 0, (player_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2 + 5, 0);
+ r = get_mon_num(player_ptr, 0, (player_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2 + 5, PM_NONE);
if (!MonsterRace(r).is_valid()) {
break;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief ダイス目により様々な効果を及ぼす魔法の処理
* @date 2020/06/05
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-kind/spells-sight.h"
+#include "spell-kind/spells-sight.h"
#include "avatar/avatar.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
handle_stuff(player_ptr);
move_cursor_relative(m_ptr->fy, m_ptr->fx);
inkey();
- term_erase(0, 0, 255);
+ term_erase(0, 0);
if (lore_do_probe(player_ptr, m_ptr->r_idx)) {
#ifdef JP
msg_format("%sについてさらに詳しくなった気がする。", r_ptr->name.data());
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "spell-kind/spells-specific-bolt.h"
+#include "spell-kind/spells-specific-bolt.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
#include "spell-kind/spells-launcher.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief テレポート魔法全般
* @date 2020/06/04
* @author Hourier
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-/*
+/*
* @brief 帰還やテレポート・レベル等、フロアを跨ぐ魔法効果の処理
* @author Hourier
* @date 2022/10/10
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-realm/spells-arcane.h"
+#include "spell-realm/spells-arcane.h"
#include "inventory/inventory-slot-types.h"
#include "object/tval-types.h"
#include "sv-definition/sv-lite-types.h"
-#pragma once
+#pragma once
class PlayerType;
void phlogiston(PlayerType *player_ptr);
-#include "spell-realm/spells-chaos.h"
+#include "spell-realm/spells-chaos.h"
#include "core/window-redrawer.h"
#include "dungeon/quest.h"
#include "effect/attribute-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-realm/spells-craft.h"
+#include "spell-realm/spells-craft.h"
#include "avatar/avatar.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 破邪魔法処理
* @date 2020/06/05
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-realm/spells-demon.h"
+#include "spell-realm/spells-demon.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
#include "game-option/disturbance-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-realm/spells-hex.h"
+#include "spell-realm/spells-hex.h"
#include "core/asking-player.h"
#include "core/window-redrawer.h"
#include "effect/effect-characteristics.h"
constexpr auto y = 1;
constexpr auto x = 20;
auto n = 0;
- term_erase(x, y, 255);
+ term_erase(x, y);
prt(_(" 名前", " Name"), y, x + 5);
for (auto spell : this->casting_spells) {
- term_erase(x, y + n + 1, 255);
+ term_erase(x, y + n + 1);
const auto spell_name = exe_spell(this->player_ptr, REALM_HEX, spell, SpellProcessType::NAME);
put_str(format("%c) %s", I2A(n), spell_name->data()), y + n + 1, x + 2);
n++;
-#pragma once
+#pragma once
#include "realm/realm-hex-numbers.h"
#include "system/angband.h"
-#include "spell-realm/spells-nature.h"
+#include "spell-realm/spells-nature.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "floor/floor-object.h"
-#pragma once
+#pragma once
class PlayerType;
bool rustproof(PlayerType *player_ptr);
-#include "spell-realm/spells-song.h"
+#include "spell-realm/spells-song.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell-realm/spells-sorcery.h"
+#include "spell-realm/spells-sorcery.h"
#include "core/asking-player.h"
#include "core/window-redrawer.h"
#include "flavor/flavor-describer.h"
-#pragma once
+#pragma once
class PlayerType;
bool alchemy(PlayerType *player_ptr);
-#include "spell-realm/spells-trump.h"
+#include "spell-realm/spells-trump.h"
#include "avatar/avatar.h"
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
-#pragma once
+#pragma once
class PlayerType;
void cast_shuffle(PlayerType *player_ptr);
-/*!
+/*!
* @brief 魔法による距離やエリアの計算
* @date 2014/07/10
* @author Ben Harrison, James E. Wilson, Robert A. Koeneke, deskull and Hourier
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-#include "spell/spell-info.h"
+#include "spell/spell-info.h"
#include "io/input-key-requester.h"
#include "monster-race/monster-race.h"
#include "player-base/player-class.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell/spells-describer.h"
+#include "spell/spells-describer.h"
#include "locale/language-switcher.h"
#include "object/tval-types.h"
-#pragma once
+#pragma once
#include <string>
-#include "spell/spells-diceroll.h"
+#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"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell/spells-execution.h"
+#include "spell/spells-execution.h"
#include "realm/realm-arcane.h"
#include "realm/realm-chaos.h"
#include "realm/realm-craft.h"
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-/*!
+/*!
* @brief アイテムに影響のある魔法の処理
* @date 2019/01/22
* @author deskull
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "spell/spells-staff-only.h"
+#include "spell/spells-staff-only.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
-#pragma once
+#pragma once
class PlayerType;
bool cleansing_nova(PlayerType *player_ptr, bool magic, bool powerful);
-/*!
+/*!
* @brief スピード等のステータスに影響のある魔法の処理
* @date 2019/01/22
* @author deskull
-#pragma once
+#pragma once
#include "spell/spells-util.h"
#include "system/angband.h"
-#include "spell/spells-summon.h"
+#include "spell/spells-summon.h"
#include "avatar/avatar.h"
#include "effect/spells-effect-util.h"
#include "floor/floor-object.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#define DETECT_RAD_DEFAULT 30
#define DETECT_RAD_MAP 30
-#pragma once
+#pragma once
/* summon_specificで取り扱われる、召喚の種別定義 / Legal restrictions for "summon_specific()" */
enum summon_type : int {
SUMMON_APOCRYPHA_DRAGONS = 69, /*!< 召喚タイプ: 強力な古代ドラゴン */
SUMMON_VESPOID = 70, /*!< 召喚タイプ: ランゴスタ */
SUMMON_ANTI_TIGERS = 71, /*!< 召喚タイプ: トラ以外 */
+ SUMMON_DEAD_UNIQUE = 72, /*!< 召喚タイプ: 撃破済みユニーク */
};
-#include "spell/technic-info-table.h"
+#include "spell/technic-info-table.h"
/*!
* @brief 歌、剣術、呪術領域情報テーブル
-#pragma once
+#pragma once
#include "realm/realm-types.h"
#include "system/angband.h"
-/*!
+/*!
* @brief プレイヤーの継続行動処理
* @date 2014/01/01
* @author
-#pragma once
+#pragma once
#include <stdint.h>
-#include "status/bad-status-setter.h"
+#include "status/bad-status-setter.h"
#include "avatar/avatar.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <memory>
-#include "status/base-status.h"
+#include "status/base-status.h"
#include "avatar/avatar.h"
#include "core/window-redrawer.h"
#include "game-option/birth-options.h"
-#pragma once
+#pragma once
class PlayerType;
bool inc_stat(PlayerType *player_ptr, int stat);
-#include "status/body-improvement.h"
+#include "status/body-improvement.h"
#include "avatar/avatar.h"
#include "core/disturbance.h"
#include "core/speed-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "status/buff-setter.h"
+#include "status/buff-setter.h"
#include "avatar/avatar.h"
#include "core/disturbance.h"
#include "core/speed-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "status/element-resistance.h"
+#include "status/element-resistance.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
#include "game-option/disturbance-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "status/experience.h"
+#include "status/experience.h"
#include "player-base/player-race.h"
#include "player/player-status.h"
#include "system/player-type-definition.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "status/shape-changer.h"
+#include "status/shape-changer.h"
#include "autopick/autopick-reader-writer.h"
#include "avatar/avatar.h"
#include "birth/birth-body-spec.h"
-#pragma once
+#pragma once
#include "player-info/race-types.h"
#include "system/angband.h"
-#include "status/sight-setter.h"
+#include "status/sight-setter.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
#include "game-option/disturbance-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "status/temporary-resistance.h"
+#include "status/temporary-resistance.h"
#include "core/disturbance.h"
#include "core/stuff-handler.h"
#include "game-option/disturbance-options.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "stdafx.h"
+#include "stdafx.h"
-#pragma once
+#pragma once
#include <algorithm>
#include <array>
#include <bitset>
-#include "store/articles-on-sale.h"
+#include "store/articles-on-sale.h"
#include "object/tval-types.h"
#include "store/store-owners.h"
#include "sv-definition/sv-amulet-types.h"
-#pragma once
+#pragma once
#include <map>
#include <vector>
-#include "store/black-market.h"
+#include "store/black-market.h"
#include "floor/floor-town.h"
#include "store/store-owners.h"
#include "store/store-util.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "store/cmd-store.h"
+#include "store/cmd-store.h"
#include "cmd-io/macro-util.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
return;
}
TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, std::nullopt);
- TERM_LEN w, h;
- term_get_size(&w, &h);
-
- xtra_stock = std::min(14 + 26, ((h > MAIN_TERM_MIN_ROWS) ? (h - MAIN_TERM_MIN_ROWS) : 0));
+ const auto [wid, hgt] = term_get_size();
+ xtra_stock = std::min(14 + 26, ((hgt > MAIN_TERM_MIN_ROWS) ? (hgt - MAIN_TERM_MIN_ROWS) : 0));
store_bottom = MIN_STOCK + xtra_stock;
auto *floor_ptr = player_ptr->current_floor_ptr;
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_store(PlayerType *player_ptr);
-#include "store/gold-magnification-table.h"
+#include "store/gold-magnification-table.h"
/*
* Buying and selling adjustments for race combinations.
-#pragma once
+#pragma once
#include "player-info/race-types.h"
#include "system/angband.h"
-#include "store/home.h"
+#include "store/home.h"
#include "avatar/avatar.h"
#include "floor/floor-town.h"
#include "game-option/birth-options.h"
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "store/museum.h"
+#include "store/museum.h"
#include "core/asking-player.h"
#include "flavor/flavor-describer.h"
#include "store/home.h"
i = store_bottom;
}
- COMMAND_CODE item;
- if (!get_stock(&item, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "), 0, i - 1, StoreSaleType::MUSEUM)) {
+ constexpr auto mes = _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? ");
+ auto item_num_opt = input_stock(mes, 0, i - 1, StoreSaleType::MUSEUM);
+ if (!item_num_opt) {
return;
}
- item = item + store_top;
- auto *o_ptr = &st_ptr->stock[item];
+ const short item_num = *item_num_opt + store_top;
+ auto *o_ptr = &st_ptr->stock[item_num];
const auto item_name = describe_flavor(player_ptr, o_ptr, 0);
msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "Once removed from the Museum, an item will be gone forever!"));
if (!input_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), item_name.data()))) {
}
msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), item_name.data());
- store_item_increase(item, -o_ptr->number);
- store_item_optimize(item);
+ store_item_increase(item_num, -o_ptr->number);
+ store_item_optimize(item_num);
(void)combine_and_reorder_home(player_ptr, StoreSaleType::MUSEUM);
if (st_ptr->stock_num == 0) {
store_top = 0;
-#pragma once
+#pragma once
class PlayerType;
void museum_remove_object(PlayerType *player_ptr);
-#include "store/pricing.h"
+#include "store/pricing.h"
#include "object/object-value.h"
#include "player/player-status-table.h"
#include "store/gold-magnification-table.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "store/purchase-order.h"
+#include "store/purchase-order.h"
#include "autopick/autopick-finder.h"
#include "autopick/autopick-util.h"
#include "autopick/autopick.h"
#include "view/display-store.h"
#include "world/world.h"
#include <optional>
+#include <string>
/*!
* @brief プレイヤーが購入する時の値切り処理メインルーチン /
/*!
* @brief 店舗から購入する際のアイテム選択プロンプト
- * @param item 店舗インベントリ番号(アドレス渡し)
* @param i 店舗インベントリストック数
* @return 選択したらtrue、しなかったらfalse
- * @details
- * 選択したインベントリ番号はitemに返る。
- * ブラックマーケットの時は別のメッセージ。
*/
-static bool show_store_select_item(COMMAND_CODE *item, const int i, StoreSaleType store_num)
+static std::optional<short> show_store_select_item(const int i, StoreSaleType store_num)
{
- concptr prompt;
-
+ std::string prompt;
switch (store_num) {
case StoreSaleType::HOME:
prompt = _("どのアイテムを取りますか? ", "Which item do you want to take? ");
break;
}
- return get_stock(item, prompt, 0, i - 1, store_num) != 0;
+ return input_stock(prompt, 0, i - 1, store_num);
}
/*!
i = store_bottom;
}
- COMMAND_CODE item;
- if (!show_store_select_item(&item, i, store_num)) {
+ auto item_num_opt = show_store_select_item(i, store_num);
+ if (!item_num_opt) {
return;
}
- item = item + store_top;
- ItemEntity *o_ptr;
- o_ptr = &st_ptr->stock[item];
+ const short item_num = *item_num_opt + store_top;
+ auto *o_ptr = &st_ptr->stock[item_num];
ITEM_NUMBER amt = 1;
ItemEntity forge;
}
if (store_num == StoreSaleType::HOME) {
- take_item_from_home(player_ptr, o_ptr, j_ptr, item);
+ take_item_from_home(player_ptr, o_ptr, j_ptr, item_num);
return;
}
COMMAND_CODE item_new;
PRICE price;
const auto purchased_item_name = describe_flavor(player_ptr, j_ptr, 0);
- msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), purchased_item_name.data(), I2A(item));
+ msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), purchased_item_name.data(), I2A(item_num));
msg_print(nullptr);
auto res = prompt_to_buy(player_ptr, j_ptr, store_num);
}
i = st_ptr->stock_num;
- store_item_increase(item, -amt);
- store_item_optimize(item);
- switch_store_stock(player_ptr, i, item, store_num);
+ store_item_increase(item_num, -amt);
+ store_item_optimize(item_num);
+ switch_store_stock(player_ptr, i, item_num, store_num);
}
-#pragma once
+#pragma once
enum class StoreSaleType;
class PlayerType;
-#include "store/rumor.h"
+#include "store/rumor.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "floor/floor-town.h"
-#pragma once
+#pragma once
class PlayerType;
void display_rumor(PlayerType *player_ptr, bool ex);
-#include "store/say-comments.h"
+#include "store/say-comments.h"
#include "avatar/avatar.h"
#include "main/sound-definitions-table.h"
#include "main/sound-of-music.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "store/sell-order.h"
+#include "store/sell-order.h"
#include "action/weapon-shield.h"
#include "autopick/autopick.h"
#include "avatar/avatar.h"
-#pragma once
+#pragma once
enum class StoreSaleType;
class PlayerType;
-#include "store/service-checker.h"
+#include "store/service-checker.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags3.h"
#include "object-enchant/tr-types.h"
-#pragma once
+#pragma once
enum class StoreSaleType;
class ItemEntity;
-#include "store/store-key-processor.h"
+#include "store/store-key-processor.h"
#include "autopick/autopick-pref-processor.h"
#include "cmd-action/cmd-mind.h"
#include "cmd-action/cmd-spell.h"
* 隠しオプション(powerup_home)がセットされていないときは
* 我が家では 2 ページまでしか表示しない
*/
- auto inven_max = store_get_stock_max(StoreSaleType::HOME, powerup_home);
+ auto inven_max = store_get_stock_max(store_num, powerup_home);
if (store_top >= st_ptr->stock_num || store_top >= inven_max) {
store_top = 0;
}
-#pragma once
+#pragma once
extern bool leave_store;
-#include "store/store-owner-comments.h"
+#include "store/store-owner-comments.h"
concptr comment_1[MAX_COMMENT_1] = {
_("オーケーだ。", "Okay."),
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "store/store-owners.h"
+#include "store/store-owners.h"
#include "player-info/race-types.h"
#include "store/store-util.h"
-#pragma once
+#pragma once
#include "player-info/race-types.h"
#include "store/store-util.h"
-/*!
+/*!
* @brief 店舗処理関係のユーティリティ
* @date 2020/03/20
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief 店の処理 / Store commands
* @date 2022/03/26
* @author Hourier
}
/*!
- * @brief 店舗からアイテムを選択する /
- * Get the ID of a store item and return its value -RAK-
- * @param com_val 選択IDを返す参照ポインタ
+ * @brief 店舗からアイテムを選択する
* @param pmt メッセージキャプション
- * @param i 選択範囲の最小値
- * @param j 選択範囲の最大値
- * @return 実際に選択したらTRUE、キャンセルしたらFALSE
+ * @param min 選択範囲の最小値
+ * @param max 選択範囲の最大値
+ * @return アイテムを選択したらそのインデックス ('a'等)、キャンセルしたらnullopt
+ * 繰り返しコマンドの時は前回の前回のインデックス
*/
-int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j, [[maybe_unused]] StoreSaleType store_num)
+std::optional<short> input_stock(std::string_view fmt, int min, int max, [[maybe_unused]] StoreSaleType store_num)
{
- if (repeat_pull(com_val) && (*com_val >= i) && (*com_val <= j)) {
- return true;
+ short repeat_command;
+ if (repeat_pull(&repeat_command) && (repeat_command >= min) && (repeat_command <= max)) {
+ return repeat_command;
}
msg_print(nullptr);
- *com_val = (-1);
- const auto lo = I2A(i);
- const auto hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
+ const auto lo = I2A(min);
+ const auto hi = (max > 25) ? toupper(I2A(max - 26)) : I2A(max);
#ifdef JP
const auto title = (store_num == StoreSaleType::HOME) || (store_num == StoreSaleType::MUSEUM) ? "アイテム" : "商品";
- const auto prompt = format("(%s:%c-%c, ESCで中断) %s", title, lo, hi, pmt);
+ const auto prompt = format("(%s:%c-%c, ESCで中断) %s", title, lo, hi, fmt.data());
#else
- const auto prompt = format("(Items %c-%c, ESC to exit) %s", lo, hi, pmt);
+ const auto prompt = format("(Items %c-%c, ESC to exit) %s", lo, hi, fmt.data());
#endif
- char command;
+ std::optional<char> command;
while (true) {
const auto command_opt = input_command(prompt);
if (!command_opt.has_value()) {
- continue;
+ break;
}
- command = command_opt.value();
- short k;
- if (islower(command)) {
- k = A2I(command);
- } else if (isupper(command)) {
- k = A2I(tolower(command)) + 26;
- } else {
- k = -1;
+ const auto command_alpha = command_opt.value();
+ std::optional<int> command_num;
+ if (islower(command_alpha)) {
+ command_num = A2I(command_alpha);
+ } else if (isupper(command_alpha)) {
+ command_num = A2I(tolower(command_alpha)) + 26;
}
- if ((k >= i) && (k <= j)) {
- *com_val = k;
+ if (command_num && (*command_num >= min) && (*command_num <= max)) {
+ command = static_cast<short>(*command_num);
break;
}
}
prt("", 0, 0);
- if (command == ESCAPE) {
- return false;
+ if (!command) {
+ return std::nullopt;
}
- repeat_push(*com_val);
- return true;
+ repeat_push(*command);
+ return command;
}
/*!
i = store_bottom;
}
- COMMAND_CODE item;
- if (!get_stock(&item, _("どれを調べますか?", "Which item do you want to examine? "), 0, i - 1, store_num)) {
+ constexpr auto mes = _("どれを調べますか?", "Which item do you want to examine? ");
+ auto item_num_opt = input_stock(mes, 0, i - 1, store_num);
+ if (!item_num_opt) {
return;
}
- item = item + store_top;
- ItemEntity *o_ptr;
- o_ptr = &st_ptr->stock[item];
+
+ const auto item_num = *item_num_opt + store_top;
+ auto *o_ptr = &st_ptr->stock[item_num];
if (!o_ptr->is_fully_known()) {
msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
return;
-#pragma once
+#pragma once
#include "store/store-util.h"
#include "system/angband.h"
+#include <optional>
+#include <string_view>
/* Store constants */
#define STORE_INVEN_MAX 24 /* Max number of discrete objs in inven */
void store_init(int town_num, StoreSaleType store_num);
void store_examine(PlayerType *player_ptr, StoreSaleType store_num);
int store_check_num(ItemEntity *o_ptr, StoreSaleType store_num);
-int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j, StoreSaleType store_num);
+std::optional<short> input_stock(std::string_view fmt, int min, int max, StoreSaleType store_num);
-#pragma once
+#pragma once
/* The "sval" codes for TV_AMULET */
enum sv_amulet_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_SOFT_ARMOR */
enum sv_soft_armor_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_BOW (note information in "sval") */
enum sv_bow_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_DIGGING */
enum sv_digging_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_FOOD */
enum sv_food_type {
-#pragma once
+#pragma once
/* The sval codes for TV_LITE */
enum sv_lite_type {
-/*!
+/*!
* @brief enumで表現することが却って高コストになりそうなSV (ベースアイテムのサブタイプ)定義をここに格納する
* @date 2020/05/28
* @author Hourier
-#pragma once
+#pragma once
/* The "sval" codes for TV_POTION */
enum sv_potion_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_SHIELD */
enum sv_shield_type {
-#pragma once
+#pragma once
/* The sval codes for TV_RING */
enum sv_ring_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_ROD */
enum sv_rod_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_SCROLL */
enum sv_scroll_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_STAFF */
enum sv_staff_type {
-#pragma once
+#pragma once
/* The "sval" codes for TV_WAND */
enum sv_wand_type {
-#pragma once
+#pragma once
/* The "sval" values for TV_HAFTED */
enum sv_hafted_type {
-#include "system/alloc-entries.h"
+#include "system/alloc-entries.h"
#include "system/baseitem-info.h"
/* The entries in the "race allocator table" */
-/*
+/*
* @brief
* @author
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
-#pragma once
+#pragma once
#include <concepts>
#include <filesystem>
-#include "system/angband-version.h"
+#include "system/angband-version.h"
#include "system/angband-exceptions.h"
#include "system/angband.h"
-#pragma once
+#pragma once
#include <stdint.h>
#include <string>
#define H_VER_MAJOR 3 //!< ゲームのバージョン定義(メジャー番号)
#define H_VER_MINOR 0 //!< ゲームのバージョン定義(マイナー番号)
#define H_VER_PATCH 0 //!< ゲームのバージョン定義(パッチ番号)
-#define H_VER_EXTRA 87 //!< ゲームのバージョン定義(エクストラ番号)
+#define H_VER_EXTRA 88 //!< ゲームのバージョン定義(エクストラ番号)
/*!
* @brief セーブファイルのバージョン(3.0.0から導入)
-#pragma once
+#pragma once
/*!
* @file angband.h
-#include "system/artifact-type-definition.h"
+#include "system/artifact-type-definition.h"
#include "artifact/fixed-art-types.h"
#include "object/tval-types.h"
-#pragma once
+#pragma once
#include "object-enchant/tr-flags.h"
#include "object-enchant/trg-types.h"
-/*!
+/*!
* @brief ベースアイテム情報の構造体 / Information about object "kinds", including player knowledge.
* @date 2019/05/01
* @author deskull
-#pragma once
+#pragma once
#include "object-enchant/tr-flags.h"
#include "object-enchant/trg-types.h"
-#include "system/building-type-definition.h"
+#include "system/building-type-definition.h"
std::array<building_type, MAX_BUILDINGS> buildings;
MonsterRaceId battle_mon_list[4];
-#pragma once
+#pragma once
#include "player-info/class-types.h"
#include "player-info/race-types.h"
-#pragma once
+#pragma once
#include "floor/floor-base-definitions.h"
#include "system/angband.h"
-#include "system/dungeon-info.h"
+#include "system/dungeon-info.h"
#include "dungeon/dungeon-flag-mask.h"
/*
-#pragma once
+#pragma once
#include "dungeon/dungeon-flag-types.h"
#include "monster-race/race-ability-flags.h"
-#include "system/floor-type-definition.h"
+#include "system/floor-type-definition.h"
#include "system/dungeon-info.h"
bool FloorType::is_in_dungeon() const
-#pragma once
+#pragma once
#include "dungeon/quest.h"
#include "floor/floor-base-definitions.h"
-#pragma once
+#pragma once
enum game_option_types {
OPT_PAGE_INPUT,
-/*
+/*
* @brief ゲーム内で広範に使われる定数群の定義
* @author Hourier
* @date 2022/11/02
-#include "system/grid-type-definition.h"
+#include "system/grid-type-definition.h"
#include "monster-race/race-flags7.h"
#include "system/monster-race-info.h"
#include "system/terrain-type-definition.h"
-#pragma once
+#pragma once
#include "object/object-index-list.h"
#include "system/angband.h"
-#pragma once
+#pragma once
/*!
* @file h-basic.h
-/*!
+/*!
* @file h-config.h
* @brief OSごとの差異を吸収してコンパイルするためのプリプロ群
* The most basic "include" file.
-/*!
+/*!
* @file h-system.h
* @brief 変愚蛮怒用システムヘッダーファイル /
* The most basic "include" file.
-#pragma once
+#pragma once
/*!
* @file h-type.h
-/*
+/*
* @file item-entity.cpp
* @brief アイテム実体とそれにまつわる判定処理群
* @author Hourier
-#pragma once
+#pragma once
/*
* @file item-entity.h
-#include "system/monster-entity.h"
+#include "system/monster-entity.h"
#include "game-option/birth-options.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-indice-types.h"
-#pragma once
+#pragma once
#include "monster/monster-flag-types.h"
#include "monster/monster-timed-effect-types.h"
-#include "system/monster-race-info.h"
+#include "system/monster-race-info.h"
#include "monster-race/race-indice-types.h"
#include "monster/horror-descriptions.h"
#include <algorithm>
-#pragma once
+#pragma once
#include "monster-attack/monster-attack-effect.h"
#include "monster-attack/monster-attack-table.h"
-#include "system/player-type-definition.h"
+#include "system/player-type-definition.h"
#include "market/arena-info-table.h"
#include "system/redrawing-flags-updater.h"
#include "timed-effect/player-blindness.h"
-#pragma once
+#pragma once
#include "mutation/mutation-flag-types.h"
#include "object-enchant/trc-types.h"
-#include "system/redrawing-flags-updater.h"
+#include "system/redrawing-flags-updater.h"
#include "util/enum-range.h"
RedrawingFlagsUpdater RedrawingFlagsUpdater::instance{};
-#pragma once
+#pragma once
#include "util/flag-group.h"
-/*!
+/*!
* @brief グローバル変数の残骸
* @date 2013/12/31
* @todo 呼び出し関係を良く読んで消す方針で進めたい.
-#pragma once
+#pragma once
#include "system/angband.h"
-/*
+/*
* @brief 地形特性定義
* @author Hourier
* @date 2022/10/15
-#pragma once
+#pragma once
#include "grid/feature-flag-types.h"
#include "system/angband.h"
-#include "target/grid-selector.h"
+#include "target/grid-selector.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
#include "floor/cave.h"
struct tgt_pt_info {
tgt_pt_info()
{
- get_screen_size(&this->wid, &this->hgt);
+ std::tie(this->width, this->height) = get_screen_size();
};
- TERM_LEN wid; //!< 画面サイズ(幅)
- TERM_LEN hgt; //!< 画面サイズ(高さ)
+ int width; //!< 画面サイズ(幅)
+ int height; //!< 画面サイズ(高さ)
POSITION y = 0; //!< 現在の指定位置(Y)
POSITION x = 0; //!< 現在の指定位置(X)
std::vector<POSITION> ys{}; //!< "interesting" な座標たちを記録する配列(Y)
} else {
this->y = this->ys[this->n];
this->x = this->xs[this->n];
- dy = 2 * (this->y - cy) / this->hgt;
- dx = 2 * (this->x - cx) / this->wid;
+ dy = 2 * (this->y - cy) / this->height;
+ dx = 2 * (this->x - cx) / this->width;
if (dy || dx) {
change_panel(player_ptr, dy, dx);
}
int dx = ddx[d];
int dy = ddy[d];
if (move_fast) {
- int mag = std::min(info.wid / 2, info.hgt / 2);
+ int mag = std::min(info.width / 2, info.height / 2);
info.x += dx * mag;
info.y += dy * mag;
} else {
info.y += dy;
}
- if (((info.x < panel_col_min + info.wid / 2) && (dx > 0)) || ((info.x > panel_col_min + info.wid / 2) && (dx < 0))) {
+ if (((info.x < panel_col_min + info.width / 2) && (dx > 0)) || ((info.x > panel_col_min + info.width / 2) && (dx < 0))) {
dx = 0;
}
- if (((info.y < panel_row_min + info.hgt / 2) && (dy > 0)) || ((info.y > panel_row_min + info.hgt / 2) && (dy < 0))) {
+ if (((info.y < panel_row_min + info.height / 2) && (dy > 0)) || ((info.y > panel_row_min + info.height / 2) && (dy < 0))) {
dy = 0;
}
- if ((info.y >= panel_row_min + info.hgt) || (info.y < panel_row_min) || (info.x >= panel_col_min + info.wid) || (info.x < panel_col_min)) {
+ if ((info.y >= panel_row_min + info.height) || (info.y < panel_row_min) || (info.x >= panel_col_min + info.width) || (info.x < panel_col_min)) {
change_panel(player_ptr, dy, dx);
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "target/projection-path-calculator.h"
+#include "target/projection-path-calculator.h"
#include "effect/effect-characteristics.h"
#include "effect/spells-effect-util.h"
#include "floor/cave.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <utility>
-/*!
+/*!
* @brief 雑多なその他の処理2 / effects of various "objects"
* @date 2014/02/06
* @author
{
POSITION y = player_ptr->y;
POSITION x = player_ptr->x;
- TERM_LEN wid, hgt;
- get_screen_size(&wid, &hgt);
+ const auto [wid, hgt] = get_screen_size();
int max_prow_min = player_ptr->current_floor_ptr->height - hgt;
int max_pcol_min = player_ptr->current_floor_ptr->width - wid;
if (max_prow_min < 0) {
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "target/target-describer.h"
+#include "target/target-describer.h"
#include "action/travel-execution.h"
#include "core/stuff-handler.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "target/target-getter.h"
+#include "target/target-getter.h"
#include "core/asking-player.h"
#include "effect/spells-effect-util.h"
#include "floor/geometry.h"
-#pragma once
+#pragma once
class PlayerType;
bool get_aim_dir(PlayerType *player_ptr, int *dp);
-#include "target/target-preparation.h"
+#include "target/target-preparation.h"
#include "floor/cave.h"
#include "game-option/input-options.h"
#include "grid/grid.h"
-#pragma once
+#pragma once
#include <vector>
-#include "target/target-setter.h"
+#include "target/target-setter.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
#include "floor/geometry.h"
#include "util/string-processor.h"
#include "window/display-sub-windows.h"
#include "window/main-window-util.h"
+#include <tuple>
#include <vector>
// "interesting" な座標たちを記録する配列。
ts_ptr->x = player_ptr->x;
ts_ptr->done = false;
ts_ptr->flag = true;
- get_screen_size(&ts_ptr->wid, &ts_ptr->hgt);
+ std::tie(ts_ptr->wid, ts_ptr->hgt) = get_screen_size();
ts_ptr->m = 0;
return ts_ptr;
}
*/
static bool change_panel_xy(PlayerType *player_ptr, POSITION y, POSITION x)
{
- POSITION dy = 0, dx = 0;
- TERM_LEN wid, hgt;
- get_screen_size(&wid, &hgt);
+ auto dy = 0;
+ auto dx = 0;
+ [[maybe_unused]] const auto [wid, hgt] = get_screen_size();
if (y < panel_row_min) {
dy = -1;
}
-#pragma once
+#pragma once
#include <stdint.h>
-#pragma once
+#pragma once
#include <stdint.h>
/* target_set用関数の利用用途フラグ / Bit flags for the "target_set" function */
-#include "term/gameterm.h"
+#include "term/gameterm.h"
#include "effect/attribute-types.h"
#include "system/system-variables.h"
#include "term/term-color-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <array>
-#include "term/screen-processor.h"
+#include "term/screen-processor.h"
#include "io/input-key-acceptor.h"
#include "locale/japanese.h"
#include "term/term-color-types.h"
*/
void c_prt(TERM_COLOR attr, std::string_view sv, TERM_LEN row, TERM_LEN col)
{
- term_erase(col, row, 255);
+ term_erase(col, row);
term_addstr(-1, attr, sv);
}
}
}
- term_erase(wrap_col, y, 255);
+ term_erase(wrap_col, y);
return wrap_chars;
}
*/
void c_roff(TERM_COLOR a, std::string_view str)
{
- int w, h;
- (void)term_get_size(&w, &h);
-
+ const auto [wid, hgt] = term_get_size();
int x, y;
(void)term_locate(&x, &y);
- if (y == h - 1 && x > w - 3) {
+ if (y == hgt - 1 && x > wid - 3) {
return;
}
const auto is_kanji = _(iskanji(*s), false);
if (*s == '\n') {
- if (y + 1 < h) {
- term_erase(0, y + 1, 255);
+ if (y + 1 < hgt) {
+ term_erase(0, y + 1);
}
return;
const auto ch = (is_kanji || isprint(*s)) ? *s : ' ';
- if ((x >= ((is_kanji) ? w - 2 : w - 1)) && (ch != ' ')) {
- const auto wrap_chars = c_roff_wrap(x, y, w, &*s);
+ if ((x >= ((is_kanji) ? wid - 2 : wid - 1)) && (ch != ' ')) {
+ const auto wrap_chars = c_roff_wrap(x, y, wid, &*s);
y++;
- if (y == h) {
+ if (y == hgt) {
return;
}
- term_erase(0, y, 255);
+ term_erase(0, y);
for (const auto &[ca, cv] : wrap_chars) {
term_addch(ca, cv);
}
term_addch((a | 0x20), *s);
}
- if (++x > w) {
- x = w;
+ if (++x > wid) {
+ x = wid;
}
}
}
{
for (int y = row; y < game_term->hgt; y++) {
TermOffsetSetter tos(0, std::nullopt);
- term_erase(0, y, 255);
+ term_erase(0, y);
}
}
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#pragma once
+#pragma once
/*
* Angband "attributes" (with symbols, and base (R,G,B) codes)
-/*!
+/*!
* @file z-form.cpp
* @brief Low level text formatting
* @date 2023/04/30
-#pragma once
+#pragma once
/*!
* @file z-form.h
-/* File: z-rand.c */
+/* File: z-rand.c */
/*
* Copyright (c) 1997 Ben Harrison, and others
-/* File: z-rand.h */
+/* File: z-rand.h */
/*
* Copyright (c) 1997 Ben Harrison, and others
-/*
+/*
* @brief Purpose: a generic, efficient, terminal window package -BEN-
* Copyright (c) 1997 Ben Harrison
*
/*
* Place cursor at (x,y), and clear the next "n" chars
*/
-errr term_erase(TERM_LEN x, TERM_LEN y, int n)
+errr term_erase(TERM_LEN x, TERM_LEN y, std::optional<int> n_opt)
{
TERM_LEN w = game_term->wid;
/* int h = Term->hgt; */
x = game_term->scr->cx;
y = game_term->scr->cy;
+ auto n = n_opt.value_or(w);
+
/* Force legal size */
if (x + n > w) {
n = w - x;
/*
* Extract the current window size
*/
-errr term_get_size(TERM_LEN *w, TERM_LEN *h)
+std::pair<int, int> term_get_size()
{
- (*w) = game_term->centered_wid.value_or(game_term->wid);
- (*h) = game_term->centered_hgt.value_or(game_term->hgt);
- return 0;
+ return { game_term->centered_wid.value_or(game_term->wid), game_term->centered_hgt.value_or(game_term->hgt) };
}
/*
-#pragma once
+#pragma once
/*
* Copyright (c) 1997 Ben Harrison
#include <optional>
#include <stack>
#include <string_view>
+#include <utility>
#include <vector>
/*!
/**** Available Variables ****/
extern term_type *game_term;
-errr term_win_nuke(term_win *s, TERM_LEN w, TERM_LEN h);
errr term_user(int n);
errr term_xtra(int n, int v);
errr term_addstr(int n, TERM_COLOR a, std::string_view sv);
errr term_putch(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c);
errr term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, std::string_view sv);
-errr term_erase(TERM_LEN x, TERM_LEN y, int n);
+errr term_erase(TERM_LEN x, TERM_LEN y, std::optional<int> n_opt = std::nullopt);
errr term_clear(void);
errr term_redraw(void);
errr term_redraw_section(TERM_LEN x1, TERM_LEN y1, TERM_LEN x2, TERM_LEN y2);
errr term_get_cursor(int *v);
-errr term_get_size(TERM_LEN *w, TERM_LEN *h);
+std::pair<int, int> term_get_size();
errr term_locate(TERM_LEN *x, TERM_LEN *y);
errr term_what(TERM_LEN x, TERM_LEN y, TERM_COLOR *a, char *c);
-/* File: z-util.c */
+/* File: z-util.c */
/*
* Copyright (c) 1997 Ben Harrison
-#pragma once
+#pragma once
/*
* Copyright (c) 1997 Ben Harrison
-/* File: z-virt.c */
+/* File: z-virt.c */
/*
* Copyright (c) 1997 Ben Harrison
-#pragma once
+#pragma once
/*
* Copyright (c) 1997 Ben Harrison
-/*!
+/*!
* @brief sha256ハッシュ値計算クラスのテストプログラム
*
* srcディレクトリで以下のコマンドでコンパイルして実行する
-/*!
+/*!
* @brief プレイヤーの一時加速ステータス変更と判定
* @date 2022/08/15
* @author Hourier
-#pragma once
+#pragma once
class PlayerAcceleration {
public:
-/*!
+/*!
* @brief プレイヤーの盲目ステータス変更と判定
* @date 2022/08/30
* @author Hourier
-#pragma once
+#pragma once
class PlayerBlindness {
public:
-#include "timed-effect/player-confusion.h"
+#include "timed-effect/player-confusion.h"
short PlayerConfusion::current() const
{
-#pragma once
+#pragma once
class PlayerConfusion {
public:
-#include "timed-effect/player-cut.h"
+#include "timed-effect/player-cut.h"
#include "system/angband-exceptions.h"
#include "system/angband.h"
-#pragma once
+#pragma once
#include "term/term-color-types.h"
#include <string>
-/*!
+/*!
* @brief プレイヤーの一時減速ステータス変更と判定
* @date 2022/08/05
* @author Hourier
-#pragma once
+#pragma once
class PlayerDeceleration {
public:
-#include "timed-effect/player-fear.h"
+#include "timed-effect/player-fear.h"
short PlayerFear::current() const
{
-#pragma once
+#pragma once
class PlayerFear {
public:
-#include "timed-effect/player-hallucination.h"
+#include "timed-effect/player-hallucination.h"
short PlayerHallucination::current() const
{
-#pragma once
+#pragma once
class PlayerHallucination {
public:
-#include "timed-effect/player-paralysis.h"
+#include "timed-effect/player-paralysis.h"
short PlayerParalysis::current() const
{
-#pragma once
+#pragma once
class PlayerParalysis {
public:
-/*!
+/*!
* @brief プレイヤーの一時減速ステータス変更と判定
* @date 2022/08/16
* @author Hourier
-#pragma once
+#pragma once
class PlayerPoison {
public:
-#include "timed-effect/player-stun.h"
+#include "timed-effect/player-stun.h"
#include "system/angband-exceptions.h"
#include "system/angband.h"
-#pragma once
+#pragma once
#include "term/term-color-types.h"
#include <string>
-/*!
+/*!
* @brief プレイヤーの時限効果を表すオブジェクト群を保持する
* @date 2022/08/05
* @author Hourier
-#pragma once
+#pragma once
#include <memory>
-#include "util/angband-files.h"
+#include "util/angband-files.h"
#include "locale/japanese.h"
#include "system/angband-exceptions.h"
#include "util/string-processor.h"
return file;
}
- const auto path_ret = std::filesystem::path(path).append(file);
+ auto parsed_path = path_parse(path);
+ const auto &path_ret = parsed_path.append(file);
constexpr auto max_path_length = 1024;
const auto path_str = path_ret.string();
if (path_str.length() > max_path_length) {
-#pragma once
+#pragma once
#include "system/angband.h"
#include <filesystem>
-#pragma once
+#pragma once
#include <cassert>
#include <type_traits>
-#include "util/buffer-shaper.h"
+#include "util/buffer-shaper.h"
#include "locale/japanese.h"
#include <algorithm>
#include <array>
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
--- /dev/null
+#include "util/candidate-selector.h"
+#include <algorithm>
+#include <iterator>
+
+/*!
+ * @brief 候補の選択に使用するシンボルのリスト
+ */
+const std::array<char, 62> CandidateSelector::i2sym = {
+ // clang-format off
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ // clang-format on
+};
+
+/*!
+ * @brief CandidateSelectorクラスのコンストラクタ
+ *
+ * @param prompt 画面最上部に表示する文字列
+ * @param start_col 候補の表示を開始する列
+ */
+CandidateSelector::CandidateSelector(const std::string &prompt, int start_col)
+ : prompt(prompt)
+ , start_col(start_col)
+{
+ this->set_max_per_page();
+}
+
+std::pair<size_t, std::optional<size_t>> CandidateSelector::process_input(char cmd, size_t current_page, size_t page_max)
+{
+ switch (cmd) {
+ case ' ':
+ current_page++;
+ break;
+ case '-':
+ current_page += (page_max - 1);
+ break;
+ default:
+ if (auto select_sym_it = std::find(i2sym.begin(), i2sym.end(), cmd);
+ select_sym_it != i2sym.end()) {
+ const auto idx = static_cast<size_t>(std::distance(i2sym.begin(), select_sym_it));
+ return { current_page, idx };
+ }
+ break;
+ }
+
+ if (current_page >= page_max) {
+ current_page %= page_max;
+ }
+
+ return { current_page, std::nullopt };
+}
+
+/*!
+ * @brief 1ページに表示する候補の最大数を設定する
+ *
+ * 引数を省略した場合もしくは設定数が端末の高さより大きい場合は、端末の高さに合わせる
+ *
+ * @param max 1ページに表示する候補の最大数
+ */
+void CandidateSelector::set_max_per_page(size_t max)
+{
+ const auto [wid, hgt] = term_get_size();
+ this->max_per_page = std::min<size_t>(max, hgt - 2);
+}
--- /dev/null
+#pragma once
+
+#include "core/asking-player.h"
+#include "term/screen-processor.h"
+#include "util/finalizer.h"
+#include <array>
+#include <concepts>
+#include <limits>
+#include <optional>
+#include <sstream>
+#include <string>
+
+/// @note clang-formatによるconceptの整形が安定していないので抑制しておく
+// clang-format off
+/*!
+ * @brief 型Argのオブジェクトの説明を生成する関数の型Funcを表すコンセプト
+ */
+template <typename Func, typename Arg>
+concept Describer = requires(Func f, Arg a) {
+ { std::invoke(f, a) } -> std::convertible_to<std::string>;
+};
+
+/*!
+ * @brief サイズが既知のコンテナの型を表すコンセプト
+ */
+template <typename T>
+concept SizedContainer = requires(T t) {
+ { std::begin(t) } -> std::convertible_to<typename T::iterator>;
+ { std::end(t) } -> std::convertible_to<typename T::iterator>;
+ std::size(t);
+ typename T::value_type;
+};
+// clang-format on
+
+/*!
+ * @brief 候補を選択するためのクラス
+ */
+class CandidateSelector {
+public:
+ CandidateSelector(const std::string &prompt, int start_col = 0);
+
+ void set_max_per_page(size_t max_per_page = std::numeric_limits<size_t>::max());
+
+ /*!
+ * @brief 引数で与えられた候補リストを画面に表示し選択する
+ *
+ * 最上行に prompt を表示し、次の行から候補を
+ *
+ * <pre>
+ * a) 候補1
+ * b) 候補2
+ * ︙
+ * </pre>
+ *
+ * のように表示する。
+ * 候補名は関数 describe_candidate によって生成する。
+ *
+ * 先頭の記号をキーボードで入力することによって選択する。
+ * 与えられた要素の数が max_per_page を超える場合はページ分けを行い、
+ * ' ' によって次ページ、'-' によって前ページへの切り替えを行う。
+ * ESCキーを押すと選択をキャンセルする。
+ *
+ * @param candidates 選択する候補
+ * @param describe_candidates 候補名を生成する関数
+ * @return 選択した要素を指すイテレータ
+ * キャンセルした場合はstd::end(candidates)
+ */
+ template <SizedContainer Candidates, Describer<typename Candidates::value_type> F>
+ typename Candidates::const_iterator select(const Candidates &candidates, F &&describe_candidate)
+ {
+ const auto candidates_count = std::size(candidates);
+ const auto page_max = (candidates_count - 1) / this->max_per_page + 1;
+ auto current_page = 0U;
+
+ screen_save();
+ const auto finalizer = util::make_finalizer([] { screen_load(); });
+
+ while (true) {
+ this->display_page(current_page, candidates, describe_candidate);
+
+ const auto cmd = input_command(this->prompt);
+ if (!cmd) {
+ return std::end(candidates);
+ }
+
+ const auto page_base_idx = current_page * this->max_per_page;
+ const auto page_item_count = std::min(this->max_per_page, candidates_count - page_base_idx);
+
+ const auto [new_page, idx] = process_input(*cmd, current_page, page_max);
+ if (idx && *idx < page_item_count) {
+ return std::next(std::begin(candidates), page_base_idx + *idx);
+ }
+
+ current_page = new_page;
+ }
+ }
+
+private:
+ static std::pair<size_t, std::optional<size_t>> process_input(char cmd, size_t current_page, size_t page_max);
+
+ template <SizedContainer Candidates, Describer<typename Candidates::value_type> F>
+ void display_page(size_t page, const Candidates &candidates, F &&describe_candidate)
+ {
+ const auto candidates_count = std::size(candidates);
+ const auto page_max = (candidates_count - 1) / this->max_per_page + 1;
+ const auto page_base_idx = page * this->max_per_page;
+ const auto page_item_count = std::min(this->max_per_page, candidates_count - page_base_idx);
+
+ for (auto i = 0U; i < this->max_per_page + 1; ++i) {
+ term_erase(this->start_col, i + 1, 255);
+ }
+
+ auto it = std::next(std::begin(candidates), page_base_idx);
+ for (auto i = 0U; i < page_item_count; ++i, ++it) {
+ std::stringstream ss;
+ ss << i2sym[i] << ") " << std::invoke(describe_candidate, *it);
+ put_str(ss.str(), i + 1, this->start_col);
+ }
+ if (page_max > 1) {
+ const auto page_info = format("-- more (%lu/%lu) --", page + 1, page_max);
+ put_str(page_info, page_item_count + 1, this->start_col);
+ }
+ }
+
+ static const std::array<char, 62> i2sym;
+
+ std::string prompt;
+ int start_col;
+ size_t max_per_page;
+};
-#pragma once
+#pragma once
#include <type_traits>
-#pragma once
+#pragma once
#include <iterator>
#include <type_traits>
-#pragma once
+#pragma once
#include <concepts>
#include <functional>
-#pragma once
+#pragma once
#include <bitset>
#include <concepts>
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief オブジェクトのソート処理
* @date 2020/06/03
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#pragma once
+#pragma once
#include "system/h-type.h"
-#pragma once
+#pragma once
#include "system/angband-exceptions.h"
#include "term/z-rand.h"
-#include "util/rng-xoshiro.h"
+#include "util/rng-xoshiro.h"
namespace {
-#pragma once
+#pragma once
#include <array>
#include <cstdint>
-/*!
+/*!
* @brief SHA-256ハッシュ値計算クラスの定義
*
* RFC 6234のリファレンス実装を参考にC++20で実装
-/*!
+/*!
* @brief SHA-256ハッシュ値計算クラスの宣言
*/
-#include "util/sort.h"
+#include "util/sort.h"
#include "artifact/fixed-art-types.h"
#include "dungeon/quest.h"
#include "grid/grid.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "util/string-processor.h"
+#include "util/string-processor.h"
#include "util/int-char-converter.h"
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-#include "view/display-birth.h"
+#include "view/display-birth.h"
#include "birth/auto-roller.h"
#include "birth/birth-stat.h"
#include "game-option/birth-options.h"
-#pragma once
+#pragma once
class PlayerType;
void birth_put_stats(PlayerType *player_ptr);
-/*!
+/*!
* @brief キャラクタの特性を表示する
* @date 2020/02/25
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "view/display-fruit.h"
+#include "view/display-fruit.h"
#include "system/angband.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
-#pragma once
+#pragma once
void display_fruit(int row, int col, int fruit);
-#include "view/display-inventory.h"
+#include "view/display-inventory.h"
#include "flavor/flavor-describer.h"
#include "game-option/special-options.h"
#include "game-option/text-display-options.h"
int k, l, z = 0;
ItemEntity *o_ptr;
char tmp_val[80];
- COMMAND_CODE out_index[23];
- TERM_COLOR out_color[23];
+ COMMAND_CODE out_index[23]{};
+ TERM_COLOR out_color[23]{};
std::array<std::string, 23> out_desc{};
COMMAND_CODE target_item_label = 0;
char inven_label[52 + 1];
- int col = command_gap;
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
- int len = wid - col - 1;
+ auto col = command_gap;
+ const auto [wid, hgt] = term_get_size();
+ auto len = wid - col - 1;
for (i = 0; i < INVEN_PACK; i++) {
o_ptr = &player_ptr->inventory_list[i];
if (!o_ptr->is_valid()) {
int i, z = 0;
TERM_COLOR attr = TERM_WHITE;
char tmp_val[80];
- TERM_LEN wid, hgt;
-
if (!player_ptr || !player_ptr->inventory_list) {
return;
}
- term_get_size(&wid, &hgt);
-
+ const auto [wid, hgt] = term_get_size();
for (i = 0; i < INVEN_PACK; i++) {
auto o_ptr = &player_ptr->inventory_list[i];
if (!o_ptr->is_valid()) {
}
int cur_col = 3;
- term_erase(cur_col, i, 255);
+ term_erase(cur_col, i);
term_putstr(0, i, cur_col, TERM_WHITE, tmp_val);
const auto item_name = describe_flavor(player_ptr, o_ptr, 0);
attr = tval_to_attr[enum2i(o_ptr->bi_key.tval()) % 128];
}
for (i = z; i < hgt; i++) {
- term_erase(0, i, 255);
+ term_erase(0, i);
}
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "view/display-lore-attacks.h"
+#include "view/display-lore-attacks.h"
#include "locale/japanese.h"
#include "lore/combat-types-setter.h"
#include "lore/lore-calculator.h"
-#pragma once
+#pragma once
struct lore_type;
void display_monster_blows(lore_type *lore_ptr);
-#include "view/display-lore-drops.h"
+#include "view/display-lore-drops.h"
#include "lore/lore-util.h"
#include "monster-race/race-flags1.h"
#include "util/bit-flags-calculator.h"
-#pragma once
+#pragma once
struct lore_type;
void display_monster_drop_quantity(lore_type *lore_ptr);
-#include "view/display-lore-magics.h"
+#include "view/display-lore-magics.h"
#include "lore/lore-util.h"
#include "monster-race/race-flags2.h"
#include "system/monster-race-info.h"
-#pragma once
+#pragma once
struct lore_type;
void display_monster_breath(lore_type *lore_ptr);
-#include "view/display-lore-status.h"
+#include "view/display-lore-status.h"
#include "locale/japanese.h"
#include "lore/lore-calculator.h"
#include "lore/lore-util.h"
-#pragma once
+#pragma once
struct lore_type;
void display_monster_hp_ac(lore_type *lore_ptr);
-/*!
+/*!
* @brief モンスターの思い出を表示する処理
* @date 2020/06/09
* @author Hourier
TERM_COLOR a1 = r_ptr->d_attr;
TERM_COLOR a2 = r_ptr->x_attr;
- term_erase(0, 0, 255);
+ term_erase(0, 0);
term_gotoxy(0, 0);
#ifdef JP
void screen_roff(PlayerType *player_ptr, MonsterRaceId r_idx, monster_lore_mode mode)
{
msg_erase();
- term_erase(0, 1, 255);
+ term_erase(0, 1);
hook_c_roff = c_roff;
process_monster_lore(player_ptr, r_idx, mode);
roff_top(r_idx);
void display_roff(PlayerType *player_ptr)
{
for (int y = 0; y < game_term->hgt; y++) {
- term_erase(0, y, 255);
+ term_erase(0, y);
}
term_gotoxy(0, 1);
-#pragma once
+#pragma once
#include "lore/lore-util.h"
#include "system/angband.h"
-#include "view/display-map.h"
+#include "view/display-map.h"
#include "autopick/autopick-finder.h"
#include "autopick/autopick-methods-table.h"
#include "autopick/autopick-util.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "view/display-messages.h"
+#include "view/display-messages.h"
#include "core/window-redrawer.h"
#include "game-option/cheat-options.h"
#include "game-option/input-options.h"
}
}
- term_erase(0, 0, 255);
+ term_erase(0, 0);
}
void msg_erase(void)
}
if (!msg_flag) {
- term_erase(0, 0, 255);
+ term_erase(0, 0);
msg_head_pos = 0;
}
}
if (!msg_flag) {
- term_erase(0, 0, 255);
+ term_erase(0, 0);
msg_head_pos = 0;
}
-#pragma once
+#pragma once
#include "system/angband.h"
#include <concepts>
-#include "view/display-monster-status.h"
+#include "view/display-monster-status.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
#include "monster/monster-flag-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string>
-#include "view/display-player-middle.h"
+#include "view/display-player-middle.h"
#include "combat/shoot.h"
#include "game-option/birth-options.h"
#include "game-option/special-options.h"
-#pragma once
+#pragma once
class PlayerType;
void display_player_middle(PlayerType *player_ptr);
-#include "view/display-player-misc-info.h"
+#include "view/display-player-misc-info.h"
#include "player-info/class-info.h"
#include "player-info/mimic-info-table.h"
#include "player/player-personality.h"
constexpr std::string_view header = _("名前 : ", "Name : ");
const auto length = header.length() + display_name.length();
- int w, h;
- term_get_size(&w, &h);
- const auto center_col = (w - length) / 2 - 4; // ヘッダがあるぶん少し左に寄せたほうが見やすい
+ const auto [wid, hgt] = term_get_size();
+ const auto center_col = (wid - length) / 2 - 4; // ヘッダがあるぶん少し左に寄せたほうが見やすい
constexpr auto row = 1;
- term_erase(0, row, 255);
+ term_erase(0, row);
term_putstr(center_col, row, -1, TERM_WHITE, header);
term_putstr(center_col + header.length(), row, -1, TERM_L_BLUE, display_name);
}
-#pragma once
+#pragma once
class PlayerType;
void display_player_name(PlayerType *player_ptr, bool name_only = false);
-/*!
+/*!
* @brief プレイヤーの耐性と能力値を表示する
* @date 2020/02/27
* @author Hourier
-#pragma once
+#pragma once
class PlayerType;
void display_player_stat_info(PlayerType *player_ptr);
-/*!
+/*!
* @brief プレイヤーのステータス表示メインルーチン群
* @date 2020/02/25
* @author Hourier
-#pragma once
+#pragma once
#include "system/angband.h"
#include <optional>
-#include "view/display-scores.h"
+#include "view/display-scores.h"
#include "core/score-util.h"
#include "io/files-util.h"
#include "io/input-key-acceptor.h"
-#pragma once
+#pragma once
struct high_score;
void display_scores(int from, int to, int note, high_score *score);
-#include "view/display-self-info.h"
+#include "view/display-self-info.h"
#include "avatar/avatar.h"
#include "io/input-key-acceptor.h"
#include "player-info/alignment.h"
-#pragma once
+#pragma once
class PlayerType;
struct self_info_type;
-#include "view/display-store.h"
+#include "view/display-store.h"
#include "flavor/flavor-describer.h"
#include "game-option/birth-options.h"
#include "game-option/special-options.h"
-#pragma once
+#pragma once
enum class StoreSaleType;
class PlayerType;
-#include "view/display-util.h"
+#include "view/display-util.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
#include "util/buffer-shaper.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-#include "view/object-describer.h"
+#include "view/object-describer.h"
#include "cmd-action/cmd-spell.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
}
for (auto y = 0; y < game_term->hgt; y++) {
- term_erase(0, y, 255);
+ term_erase(0, y);
}
ItemEntity item;
-#pragma once
+#pragma once
class ItemEntity;
class PlayerType;
-#include "view/status-bars-table.h"
+#include "view/status-bars-table.h"
#include "term/term-color-types.h"
stat_bar stat_bars[MAX_STAT_BARS] = { { TERM_YELLOW, _("つ", "Ts"), _("つよし", "Tsuyoshi") }, { TERM_VIOLET, _("幻", "Ha"), _("幻覚", "Halluc") },
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @file status-first-page.c
* @brief キャラ基本情報及び技能値の表示
* @date 2020/02/23
-#pragma once
+#pragma once
#define ENTRY_BARE_HAND 0
#define ENTRY_TWO_HANDS 1
-#include "window/display-sub-windows.h"
-#include "core/window-redrawer.h"
+#include "window/display-sub-windows.h"
#include "flavor/flavor-describer.h"
#include "floor/cave.h"
#include "game-option/option-flags.h"
#include "game-option/text-display-options.h"
#include "grid/feature.h"
#include "inventory/inventory-describer.h"
-#include "inventory/inventory-slot-types.h"
#include "inventory/inventory-util.h"
#include "locale/japanese.h"
#include "main/sound-of-music.h"
#include "mind/mind-sniper.h"
#include "mind/mind-types.h"
#include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
#include "monster/monster-describer.h"
#include "monster/monster-description-types.h"
-#include "monster/monster-flag-types.h"
-#include "monster/monster-info.h"
-#include "monster/monster-status.h"
#include "object/item-tester-hooker.h"
#include "object/object-info.h"
-#include "object/object-mark-types.h"
#include "player-base/player-class.h"
#include "player-info/class-info.h"
#include "player/player-status-flags.h"
#include "player/player-status-table.h"
#include "player/player-status.h"
#include "realm/realm-names-table.h"
-#include "spell-kind/magic-item-recharger.h"
#include "spell/spells-execution.h"
-#include "spell/technic-info-table.h"
-#include "system/baseitem-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
#include "system/item-entity.h"
#include "system/monster-entity.h"
#include "system/monster-race-info.h"
-#include "system/player-type-definition.h"
-#include "system/redrawing-flags-updater.h"
#include "system/terrain-type-definition.h"
-#include "target/target-describer.h"
#include "target/target-preparation.h"
-#include "target/target-setter.h"
-#include "target/target-types.h"
#include "term/gameterm.h"
#include "term/screen-processor.h"
-#include "term/term-color-types.h"
-#include "term/z-form.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
-#include "util/bit-flags-calculator.h"
#include "util/int-char-converter.h"
#include "view/display-lore.h"
#include "view/display-map.h"
MonsterRaceId r_idx = m_ptr->ap_r_idx;
auto *r_ptr = &monraces_info[r_idx];
- term_erase(0, y, 255);
+ term_erase(0, y);
term_gotoxy(x, y);
if (!r_ptr) {
return;
}
for (; line < max_lines; line++) {
- term_erase(0, line, 255);
+ term_erase(0, line);
}
}
const auto [bar_color, bar_len] = monster.get_hp_bar_data();
const auto is_visible = monster.ml && !player_ptr->effects()->hallucination()->is_hallucinated();
- term_erase(0, y, 255);
+ term_erase(0, y);
if (is_visible) {
term_putstr(x, y, -1, TERM_WHITE, "[----------]");
term_putstr(x + 1, y, bar_len, bar_color, "**********");
print_pet_list_oneline(player_ptr, monster, x, line, width);
if ((line == height - 2) && (n < pets.size() - 2)) {
- term_erase(0, line + 1, 255);
+ term_erase(0, line + 1);
term_putstr(x, line + 1, -1, TERM_WHITE, "-- and more --");
break;
}
}
for (int n = pets.size(); n < height; ++n) {
- term_erase(0, y + n, 255);
+ term_erase(0, y + n);
}
}
display_sub_windows(SubWindowRedrawingFlag::SIGHT_MONSTERS,
[player_ptr, &once] {
- int w, h;
- term_get_size(&w, &h);
+ const auto [wid, hgt] = term_get_size();
std::call_once(once, target_sensing_monsters_prepare, player_ptr, monster_list);
- print_monster_list(player_ptr->current_floor_ptr, monster_list, 0, 0, h);
+ print_monster_list(player_ptr->current_floor_ptr, monster_list, 0, 0, hgt);
});
if (use_music && has_monster_music) {
{
display_sub_windows(SubWindowRedrawingFlag::PETS,
[player_ptr] {
- int w, h;
- term_get_size(&w, &h);
+ const auto [wid, hgt] = term_get_size();
const auto pets = target_pets_prepare(player_ptr);
- print_pet_list(player_ptr, pets, 0, 0, w, h);
+ print_pet_list(player_ptr, pets, 0, 0, wid, hgt);
});
}
return;
}
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
byte attr = TERM_WHITE;
for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
int cur_row = i - INVEN_MAIN_HAND;
}
int cur_col = 3;
- term_erase(cur_col, cur_row, 255);
+ term_erase(cur_col, cur_row);
term_putstr(0, cur_row, cur_col, TERM_WHITE, tmp_val);
std::string item_name;
}
for (int i = INVEN_TOTAL - INVEN_MAIN_HAND; i < hgt; i++) {
- term_erase(0, i, 255);
+ term_erase(0, i);
}
}
{
display_sub_windows(SubWindowRedrawingFlag::MESSAGE,
[] {
- TERM_LEN w, h;
- term_get_size(&w, &h);
- for (short i = 0; i < h; i++) {
- term_putstr(0, (h - 1) - i, -1, (byte)((i < now_message) ? TERM_WHITE : TERM_SLATE), *message_str(i));
+ const auto [wid, hgt] = term_get_size();
+ for (short i = 0; i < hgt; i++) {
+ term_putstr(0, (hgt - 1) - i, -1, (byte)((i < now_message) ? TERM_WHITE : TERM_SLATE), *message_str(i));
TERM_LEN x, y;
term_locate(&x, &y);
- term_erase(x, y, 255);
+ term_erase(x, y);
}
});
}
{
display_sub_windows(SubWindowRedrawingFlag::OVERHEAD,
[player_ptr] {
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
if (wid > COL_MAP + 2 && hgt > ROW_MAP + 2) {
int cy, cx;
display_map(player_ptr, &cy, &cx);
*/
static void display_floor_item_list(PlayerType *player_ptr, const int y, const int x)
{
- // Term の行数を取得。
- TERM_LEN term_h;
- {
- TERM_LEN term_w;
- term_get_size(&term_w, &term_h);
- }
- if (term_h <= 0) {
+ const auto [wid, hgt] = term_get_size();
+ if (hgt <= 0) {
return;
}
}
// 途中で行数が足りなくなったら最終行にその旨追記して終了。
- if (term_y >= term_h) {
+ if (term_y >= hgt) {
term_addstr(-1, TERM_WHITE, "-- more --");
break;
}
*/
static void display_found_item_list(PlayerType *player_ptr)
{
- // Term の行数を取得。
- TERM_LEN term_h;
- TERM_LEN term_w;
- term_get_size(&term_w, &term_h);
-
- if (term_h <= 0) {
+ const auto [wid, hgt] = term_get_size();
+ if (hgt <= 0) {
return;
}
TERM_LEN term_y = 1;
for (auto item : found_item_list) {
// 途中で行数が足りなくなったら終了。
- if (term_y >= term_h) {
+ if (term_y >= hgt) {
break;
}
// アイテム座標表示
const auto item_location = format("(X:%3d Y:%3d)", item->ix, item->iy);
- prt(item_location, term_y, term_w - item_location.length() - 1);
+ prt(item_location, term_y, wid - item_location.length() - 1);
++term_y;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "window/main-window-equipments.h"
+#include "window/main-window-equipments.h"
#include "flavor/flavor-describer.h"
#include "game-option/special-options.h"
#include "game-option/text-display-options.h"
int j, k, l;
ItemEntity *o_ptr;
char tmp_val[80];
- COMMAND_CODE out_index[23];
- TERM_COLOR out_color[23];
+ COMMAND_CODE out_index[23]{};
+ TERM_COLOR out_color[23]{};
std::array<std::string, 23> out_desc{};
COMMAND_CODE target_item_label = 0;
- TERM_LEN wid, hgt;
char equip_label[52 + 1];
- int col = command_gap;
- term_get_size(&wid, &hgt);
- int len = wid - col - 1;
+ auto col = command_gap;
+ const auto [wid, hgt] = term_get_size();
+ auto len = wid - col - 1;
for (k = 0, i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &player_ptr->inventory_list[i];
auto only_slot = !(player_ptr->select_ring_slot ? is_ring_slot(i) : (item_tester.okay(o_ptr) || any_bits(mode, USE_FULL)));
-#pragma once
+#pragma once
#include "object/tval-types.h"
-#include "window/main-window-left-frame.h"
+#include "window/main-window-left-frame.h"
#include "game-option/special-options.h"
#include "game-option/text-display-options.h"
#include "market/arena-info-table.h"
void print_depth(PlayerType *player_ptr)
{
TERM_COLOR attr = TERM_WHITE;
-
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
+ const auto [wid, hgt] = term_get_size();
TERM_LEN col_depth = wid + COL_DEPTH;
TERM_LEN row_depth = hgt + ROW_DEPTH;
col = COL_INFO;
}
- const int max_width = 12; // 表示幅
-
- TERM_LEN width, height;
- term_get_size(&width, &height);
- const auto extra_line_count = riding ? 0 : height - MAIN_TERM_MIN_ROWS;
+ const auto max_width = 12; // 表示幅
+ const auto [wid, hgt] = term_get_size();
+ const auto extra_line_count = riding ? 0 : hgt - MAIN_TERM_MIN_ROWS;
for (auto y = row; y < row + extra_line_count + 1; ++y) {
term_erase(col, y, max_width);
}
-#pragma once
+#pragma once
class PlayerType;
void print_title(PlayerType *player_ptr);
-#include "window/main-window-row-column.h"
+#include "window/main-window-row-column.h"
#include "locale/language-switcher.h"
const std::map<monster_timed_effect_type, std::string> effect_type_to_label = {
-#pragma once
+#pragma once
#include "monster/monster-timed-effect-types.h"
#include <map>
-#include "window/main-window-stat-poster.h"
+#include "window/main-window-stat-poster.h"
#include "io/input-key-requester.h"
#include "mind/stances-table.h"
#include "monster/monster-status.h"
*/
void print_speed(PlayerType *player_ptr)
{
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
- TERM_LEN col_speed = wid + COL_SPEED;
- TERM_LEN row_speed = hgt + ROW_SPEED;
+ const auto [wid, hgt] = term_get_size();
+ auto col_speed = wid + COL_SPEED;
+ auto row_speed = hgt + ROW_SPEED;
const auto speed = player_ptr->pspeed - STANDARD_SPEED;
auto *floor_ptr = player_ptr->current_floor_ptr;
*/
void print_study(PlayerType *player_ptr)
{
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
- TERM_LEN col_study = wid + COL_STUDY;
- TERM_LEN row_study = hgt + ROW_STUDY;
-
+ const auto [wid, hgt] = term_get_size();
+ const auto col_study = wid + COL_STUDY;
+ const auto row_study = hgt + ROW_STUDY;
if (player_ptr->new_spells) {
put_str(_("学習", "Stud"), row_study, col_study);
} else {
*/
void print_imitation(PlayerType *player_ptr)
{
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
- TERM_LEN col_study = wid + COL_STUDY;
- TERM_LEN row_study = hgt + ROW_STUDY;
-
+ const auto [wid, hgt] = term_get_size();
+ const auto col_study = wid + COL_STUDY;
+ const auto row_study = hgt + ROW_STUDY;
PlayerClass pc(player_ptr);
if (!pc.equals(PlayerClassType::IMITATOR)) {
return;
*/
void print_status(PlayerType *player_ptr)
{
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
- TERM_LEN row_statbar = hgt + ROW_STATBAR;
- TERM_LEN max_col_statbar = wid + MAX_COL_STATBAR;
-
+ const auto [wid, hgt] = term_get_size();
+ const auto row_statbar = hgt + ROW_STATBAR;
+ const auto max_col_statbar = wid + MAX_COL_STATBAR;
term_erase(0, row_statbar, max_col_statbar);
-
- BIT_FLAGS bar_flags[3];
- bar_flags[0] = bar_flags[1] = bar_flags[2] = 0L;
-
+ BIT_FLAGS bar_flags[3]{};
auto effects = player_ptr->effects();
if (player_ptr->tsuyoshi) {
ADD_BAR_FLAG(BAR_TSUYOSHI);
-#pragma once
+#pragma once
class PlayerType;
void print_stat(PlayerType *player_ptr, int stat);
-#include "window/main-window-util.h"
+#include "window/main-window-util.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "floor/cave.h"
*/
void print_map(PlayerType *player_ptr)
{
- TERM_LEN wid, hgt;
- term_get_size(&wid, &hgt);
-
+ auto [wid, hgt] = term_get_size();
wid -= COL_MAP + 2;
hgt -= ROW_MAP + 2;
bool old_view_special_lite = view_special_lite;
bool old_view_granite_lite = view_granite_lite;
- TERM_LEN border_width = use_bigtile ? 2 : 1; //!< @note 枠線幅
- TERM_LEN hgt, wid, yrat, xrat;
- term_get_size(&wid, &hgt);
+ auto border_width = use_bigtile ? 2 : 1; //!< @note 枠線幅
+ auto [wid, hgt] = term_get_size();
hgt -= 2;
wid -= 12 + border_width * 2; //!< @note 描画桁数(枠線抜)
if (use_bigtile) {
}
auto *floor_ptr = player_ptr->current_floor_ptr;
- yrat = (floor_ptr->height + hgt - 1) / hgt;
- xrat = (floor_ptr->width + wid - 1) / wid;
+ const auto yrat = (floor_ptr->height + hgt - 1) / hgt;
+ const auto xrat = (floor_ptr->width + wid - 1) / wid;
view_special_lite = false;
view_granite_lite = false;
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "wizard/artifact-analyzer.h"
+#include "wizard/artifact-analyzer.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "locale/japanese.h"
#include "util/enum-range.h"
#include "util/string-processor.h"
#include "wizard/spoiler-util.h"
-
-/*!
- * @brief
- * @param art_flags 出力するアーティファクトの特性一覧
- * @param definitions 表記対象の特性一覧
- * @return 表記すべき特性一覧
- */
-static std::vector<std::string> extract_spoiler_flags(const TrFlags &art_flags, const std::vector<flag_desc> definitions)
-{
- std::vector<std::string> descriptions{};
- for (const auto &definition : definitions) {
- if (art_flags.has(definition.flag)) {
- descriptions.push_back(definition.desc);
- }
- }
-
- return descriptions;
-}
-
-/*!
- * @brief アーティファクトの特性一覧を出力する /
- * Write a line to the spoiler file and then "underline" it with hypens
- * @param art_flags アーティファクトのフラグ群
- * @param flag_ptr フラグ記述情報の参照ポインタ
- * @param desc_ptr 記述内容を返すための文字列参照ポインタ
- * @param n_elmnts フラグの要素数
- * @return desc_ptrと同じアドレス
- * @details
- * <pre>
- * This function does most of the actual "analysis". Given a set of bit flags
- * (which will be from one of the flags fields from the object in question),
- * a "flag description structure", a "description list", and the number of
- * elements in the "flag description structure", this function sets the
- * "description list" members to the appropriate descriptions contained in
- * the "flag description structure".
- * The possibly updated description pointer is returned.
- * </pre>
- */
-static concptr *spoiler_flag_aux(const TrFlags &art_flags, const flag_desc *flag_ptr, concptr *desc_ptr, const int n_elmnts)
-{
- for (int i = 0; i < n_elmnts; ++i) {
- if (art_flags.has(flag_ptr[i].flag)) {
- *desc_ptr++ = flag_ptr[i].desc;
- }
- }
-
- return desc_ptr;
-}
+#include <sstream>
/*!
* @brief アイテムの特定記述内容を返す /
* @param o_ptr 記述を得たいオブジェクトの参照ポインタ
* @param desc_ptr 記述内容を返すための文字列参照ポインタ
*/
-static std::string analyze_general(PlayerType *player_ptr, ItemEntity *o_ptr)
+static std::string analyze_general(PlayerType *player_ptr, const ItemEntity *o_ptr)
{
return describe_flavor(player_ptr, o_ptr, OD_NAME_AND_ENCHANT | OD_STORE | OD_DEBUG);
}
/*!
- * @brief アーティファクトがプレイヤーに与えるpval修正を構造体に収める /
- * List "player traits" altered by an artifact's pval. These include stats,
- * speed, infravision, tunneling, stealth, searching, and extra attacks.
- * @param o_ptr オブジェクト構造体の参照ポインタ
- * @param pi_ptr pval修正構造体の参照ポインタ
- */
-static void analyze_pval(ItemEntity *o_ptr, pval_info_type *pi_ptr)
-{
- concptr *affects_list;
- if (!o_ptr->pval) {
- pi_ptr->pval_desc[0] = '\0';
- return;
- }
-
- auto flags = object_flags(o_ptr);
- affects_list = pi_ptr->pval_affects;
- strnfmt(pi_ptr->pval_desc, sizeof(pi_ptr->pval_desc), "%s%d", o_ptr->pval >= 0 ? "+" : "", o_ptr->pval);
- if (flags.has_all_of(EnumRange(TR_STR, TR_CHR))) {
- *affects_list++ = _("全能力", "All stats");
- } else if (flags.has_any_of(EnumRange(TR_STR, TR_CHR))) {
- affects_list = spoiler_flag_aux(flags, stat_flags_desc, affects_list, N_ELEMENTS(stat_flags_desc));
- }
-
- affects_list = spoiler_flag_aux(flags, pval_flags1_desc, affects_list, N_ELEMENTS(pval_flags1_desc));
- *affects_list = nullptr;
-}
-
-/*!
* @brief アーティファクトの種族スレイ特性を構造体に収める /
* Note the slaying specialties of a weapon
* @param o_ptr オブジェクト構造体の参照ポインタ
* @param slay_list 種族スレイ構造体の参照ポインタ
*/
-static void analyze_slay(ItemEntity *o_ptr, concptr *slay_list)
+static std::vector<std::string> analyze_slay(const ItemEntity *o_ptr)
{
auto flags = object_flags(o_ptr);
- slay_list = spoiler_flag_aux(flags, slay_flags_desc, slay_list, N_ELEMENTS(slay_flags_desc));
- *slay_list = nullptr;
+ return extract_spoiler_flags(flags, slay_flags_desc);
}
/*!
* @param o_ptr オブジェクト構造体の参照ポインタ
* @param brand_list 属性ブランド構造体の参照ポインタ
*/
-static void analyze_brand(ItemEntity *o_ptr, concptr *brand_list)
+static std::vector<std::string> analyze_brand(const ItemEntity *o_ptr)
{
auto flags = object_flags(o_ptr);
- brand_list = spoiler_flag_aux(flags, brand_flags_desc, brand_list, N_ELEMENTS(brand_flags_desc));
- *brand_list = nullptr;
+ return extract_spoiler_flags(flags, brand_flags_desc);
}
/*!
* @param o_ptr オブジェクト構造体の参照ポインタ
* @param resist_list 通常耐性構造体の参照ポインタ
*/
-static void analyze_resist(ItemEntity *o_ptr, concptr *resist_list)
+static std::vector<std::string> analyze_resist(const ItemEntity *o_ptr)
{
auto flags = object_flags(o_ptr);
- resist_list = spoiler_flag_aux(flags, resist_flags_desc, resist_list, N_ELEMENTS(resist_flags_desc));
- *resist_list = nullptr;
+ return extract_spoiler_flags(flags, resist_flags_desc);
}
/*!
* @param o_ptr オブジェクト構造体の参照ポインタ
* @param immune_list 免疫構造体の参照ポインタ
*/
-static void analyze_immune(ItemEntity *o_ptr, concptr *immune_list)
+static std::vector<std::string> analyze_immune(const ItemEntity *o_ptr)
{
auto flags = object_flags(o_ptr);
- immune_list = spoiler_flag_aux(flags, immune_flags_desc, immune_list, N_ELEMENTS(immune_flags_desc));
- *immune_list = nullptr;
+ return extract_spoiler_flags(flags, immune_flags_desc);
}
/*!
* @param o_ptr オブジェクト構造体の参照ポインタ
* @param immune_list 弱点構造体の参照ポインタ
*/
-static void analyze_vulnerable(ItemEntity *o_ptr, concptr *vulnerable_list)
+static std::vector<std::string> analyze_vulnerable(const ItemEntity *o_ptr)
{
auto flags = object_flags(o_ptr);
- vulnerable_list = spoiler_flag_aux(flags, vulnerable_flags_desc, vulnerable_list, N_ELEMENTS(vulnerable_flags_desc));
- *vulnerable_list = nullptr;
+ return extract_spoiler_flags(flags, vulnerable_flags_desc);
}
/*!
* @param o_ptr オブジェクト構造体の参照ポインタ
* @param sustain_list 維持特性構造体の参照ポインタ
*/
-static void analyze_sustains(ItemEntity *o_ptr, concptr *sustain_list)
+static std::vector<std::string> analyze_sustains(const ItemEntity *o_ptr)
{
auto flags = object_flags(o_ptr);
if (flags.has_all_of(EnumRange(TR_SUST_STR, TR_SUST_CHR))) {
- *sustain_list++ = _("全能力", "All stats");
- } else if (flags.has_any_of(EnumRange(TR_SUST_STR, TR_SUST_CHR))) {
- sustain_list = spoiler_flag_aux(flags, sustain_flags_desc, sustain_list, N_ELEMENTS(sustain_flags_desc));
+ return { _("全能力", "All stats") };
+ }
+
+ if (flags.has_any_of(EnumRange(TR_SUST_STR, TR_SUST_CHR))) {
+ return extract_spoiler_flags(flags, sustain_flags_desc);
}
- *sustain_list = nullptr;
+ return {};
}
/*!
* @param o_ptr オブジェクト構造体の参照ポインタ
* @param misc_list その他の特性構造体の参照ポインタ
*/
-static std::vector<std::string> analyze_misc_magic(ItemEntity *o_ptr)
+static std::vector<std::string> analyze_misc_magic(const ItemEntity *o_ptr)
{
std::vector<std::string> descriptions{};
auto flags = object_flags(o_ptr);
* @param addition 追加ランダム耐性構造体の参照ポインタ
* @param addition_sz addition に書き込めるバイト数
*/
-static void analyze_addition(ItemEntity *o_ptr, char *addition, size_t addition_sz)
+static std::string analyze_addition(const ItemEntity *o_ptr)
{
const auto &artifact = o_ptr->get_fixed_artifact();
- strcpy(addition, "");
-
+ std::stringstream ss;
if (artifact.gen_flags.has_all_of({ ItemGenerationTraitType::XTRA_POWER, ItemGenerationTraitType::XTRA_H_RES })) {
- angband_strcat(addition, _("能力and耐性", "Ability and Resistance"), addition_sz);
+ ss << _("能力and耐性", "Ability and Resistance");
} else if (artifact.gen_flags.has(ItemGenerationTraitType::XTRA_POWER)) {
- angband_strcat(addition, _("能力", "Ability"), addition_sz);
+ ss << _("能力", "Ability");
if (artifact.gen_flags.has(ItemGenerationTraitType::XTRA_RES_OR_POWER)) {
- angband_strcat(addition, _("(1/2でand耐性)", "(plus Resistance about 1/2)"), addition_sz);
+ ss << _("(1/2でand耐性)", "(plus Resistance about 1/2)");
}
} else if (artifact.gen_flags.has(ItemGenerationTraitType::XTRA_H_RES)) {
- angband_strcat(addition, _("耐性", "Resistance"), addition_sz);
+ ss << _("耐性", "Resistance");
if (artifact.gen_flags.has(ItemGenerationTraitType::XTRA_RES_OR_POWER)) {
- angband_strcat(addition, _("(1/2でand能力)", "(plus Ability about 1/2)"), addition_sz);
+ ss << _("(1/2でand能力)", "(plus Ability about 1/2)");
}
} else if (artifact.gen_flags.has(ItemGenerationTraitType::XTRA_RES_OR_POWER)) {
- angband_strcat(addition, _("能力or耐性", "Ability or Resistance"), addition_sz);
+ ss << _("能力or耐性", "Ability or Resistance");
}
- if (artifact.gen_flags.has(ItemGenerationTraitType::XTRA_DICE)) {
- if (strlen(addition) > 0) {
- angband_strcat(addition, _("、", ", "), addition_sz);
- }
- angband_strcat(addition, _("ダイス数", "Dice number"), addition_sz);
+ if (artifact.gen_flags.has_not(ItemGenerationTraitType::XTRA_DICE)) {
+ return ss.str();
}
+
+ if (ss.tellp() > 0) {
+ ss << _("、", ", ");
+ }
+
+ ss << _("ダイス数", "Dice number");
+ return ss.str();
}
/*!
* @param misc_desc 基本情報を収める文字列参照ポインタ
* @param misc_desc_sz misc_desc に書き込めるバイト数
*/
-static void analyze_misc(ItemEntity *o_ptr, char *misc_desc, size_t misc_desc_sz)
+static std::string analyze_misc(const ItemEntity *o_ptr)
{
const auto &artifact = o_ptr->get_fixed_artifact();
- const auto *mes = _("レベル %d, 希少度 %u, %d.%d kg, $%ld", "Level %d, Rarity %u, %d.%d lbs, %ld Gold");
- strnfmt(misc_desc, misc_desc_sz, mes, (int)artifact.level, artifact.rarity,
- _(lb_to_kg_integer(artifact.weight), artifact.weight / 10), _(lb_to_kg_fraction(artifact.weight), artifact.weight % 10), (long int)artifact.cost);
+ constexpr auto fmt = _("レベル %d, 希少度 %u, %d.%d kg, $%d", "Level %d, Rarity %u, %d.%d lbs, %d Gold");
+ const auto weight_integer = _(lb_to_kg_integer(artifact.weight), artifact.weight / 10);
+ const auto weight_fraction = _(lb_to_kg_fraction(artifact.weight), artifact.weight % 10);
+ return format(fmt, artifact.level, artifact.rarity, weight_integer, weight_fraction, artifact.cost);
}
/*!
- * @brief アーティファクトの情報全体を構造体に収める /
- * Fill in an object description structure for a given object
- * and its value in gold pieces
+ * @brief アーティファクトの情報全体を構造体に収める
* @param player_ptr プレイヤーへの参照ポインタ
* @param o_ptr オブジェクト構造体の参照ポインタ
* @param desc_ptr 全アーティファクト情報を収める文字列参照ポインタ
*/
-void object_analyze(PlayerType *player_ptr, ItemEntity *o_ptr, obj_desc_list *desc_ptr)
+void object_analyze(PlayerType *player_ptr, const ItemEntity *o_ptr, obj_desc_list *desc_ptr)
{
- angband_strcpy(desc_ptr->description, analyze_general(player_ptr, o_ptr), MAX_NLEN);
- analyze_pval(o_ptr, &desc_ptr->pval_info);
- analyze_brand(o_ptr, desc_ptr->brands);
- analyze_slay(o_ptr, desc_ptr->slays);
- analyze_immune(o_ptr, desc_ptr->immunities);
- analyze_resist(o_ptr, desc_ptr->resistances);
- analyze_vulnerable(o_ptr, desc_ptr->vulnerables);
- analyze_sustains(o_ptr, desc_ptr->sustains);
+ desc_ptr->description = analyze_general(player_ptr, o_ptr);
+ desc_ptr->pval_info.analyze(*o_ptr);
+ desc_ptr->brands = analyze_brand(o_ptr);
+ desc_ptr->slays = analyze_slay(o_ptr);
+ desc_ptr->immunities = analyze_immune(o_ptr);
+ desc_ptr->resistances = analyze_resist(o_ptr);
+ desc_ptr->vulnerabilities = analyze_vulnerable(o_ptr);
+ desc_ptr->sustenances = analyze_sustains(o_ptr);
desc_ptr->misc_magic = analyze_misc_magic(o_ptr);
- analyze_addition(o_ptr, desc_ptr->addition, sizeof(desc_ptr->addition));
- analyze_misc(o_ptr, desc_ptr->misc_desc, sizeof(desc_ptr->misc_desc));
+ desc_ptr->addition = analyze_addition(o_ptr);
+ desc_ptr->misc_desc = analyze_misc(o_ptr);
desc_ptr->activation = activation_explanation(o_ptr);
}
/*!
- * @brief ランダムアーティファクト1件を解析する /
- * Fill in an object description structure for a given object
+ * @brief ランダムアーティファクト1件を解析する
* @param player_ptr プレイヤーへの参照ポインタ
* @param o_ptr ランダムアーティファクトのオブジェクト構造体参照ポインタ
* @param desc_ptr 記述内容を収める構造体参照ポインタ
*/
-void random_artifact_analyze(PlayerType *player_ptr, ItemEntity *o_ptr, obj_desc_list *desc_ptr)
+void random_artifact_analyze(PlayerType *player_ptr, const ItemEntity *o_ptr, obj_desc_list *desc_ptr)
{
- angband_strcpy(desc_ptr->description, analyze_general(player_ptr, o_ptr), MAX_NLEN);
- analyze_pval(o_ptr, &desc_ptr->pval_info);
- analyze_brand(o_ptr, desc_ptr->brands);
- analyze_slay(o_ptr, desc_ptr->slays);
- analyze_immune(o_ptr, desc_ptr->immunities);
- analyze_resist(o_ptr, desc_ptr->resistances);
- analyze_vulnerable(o_ptr, desc_ptr->vulnerables);
- analyze_sustains(o_ptr, desc_ptr->sustains);
+ desc_ptr->description = analyze_general(player_ptr, o_ptr);
+ desc_ptr->pval_info.analyze(*o_ptr);
+ desc_ptr->brands = analyze_brand(o_ptr);
+ desc_ptr->slays = analyze_slay(o_ptr);
+ desc_ptr->immunities = analyze_immune(o_ptr);
+ desc_ptr->resistances = analyze_resist(o_ptr);
+ desc_ptr->vulnerabilities = analyze_vulnerable(o_ptr);
+ desc_ptr->sustenances = analyze_sustains(o_ptr);
desc_ptr->misc_magic = analyze_misc_magic(o_ptr);
desc_ptr->activation = activation_explanation(o_ptr);
- strnfmt(desc_ptr->misc_desc, sizeof(desc_ptr->misc_desc), _("重さ %d.%d kg", "Weight %d.%d lbs"), _(lb_to_kg_integer(o_ptr->weight), o_ptr->weight / 10),
- _(lb_to_kg_fraction(o_ptr->weight), o_ptr->weight % 10));
+ constexpr auto weight_mes = _("重さ %d.%d kg", "Weight %d.%d lbs");
+ const auto weight_integer = _(lb_to_kg_integer(o_ptr->weight), o_ptr->weight / 10);
+ const auto weight_fraction = _(lb_to_kg_fraction(o_ptr->weight), o_ptr->weight % 10);
+ desc_ptr->misc_desc = format(weight_mes, weight_integer, weight_fraction);
}
-#pragma once
+#pragma once
class ItemEntity;
struct obj_desc_list;
class PlayerType;
-void object_analyze(PlayerType *player_ptr, ItemEntity *o_ptr, obj_desc_list *desc_ptr);
-void random_artifact_analyze(PlayerType *player_ptr, ItemEntity *o_ptr, obj_desc_list *desc_ptr);
+void object_analyze(PlayerType *player_ptr, const ItemEntity *o_ptr, obj_desc_list *desc_ptr);
+void random_artifact_analyze(PlayerType *player_ptr, const ItemEntity *o_ptr, obj_desc_list *desc_ptr);
-#include "wizard/artifact-bias-table.h"
+#include "wizard/artifact-bias-table.h"
/*!
* @brief ランダムアーティファクトのバイアス名称テーブル
-#pragma once
+#pragma once
#include "artifact/random-art-bias-types.h"
#include "system/angband.h"
-/*!
+/*!
* @brief デバッグコマンドの分岐実装
* @date 2020/08/01
* @author Hourier
*/
void do_cmd_debug(PlayerType *player_ptr)
{
- TERM_LEN hgt, wid;
- term_get_size(&wid, &hgt);
-
- size_t max_line = debug_menu_table.size();
- int page_size = hgt - 5;
- int max_page = max_line / page_size + 1;
- int page = 0;
+ const auto [wid, hgt] = term_get_size();
+ const auto max_line = debug_menu_table.size();
+ const auto page_size = hgt - 5;
+ const auto max_page = max_line / page_size + 1;
+ auto page = 0;
while (true) {
screen_save();
display_debug_menu(page, max_page, page_size, max_line);
-#pragma once
+#pragma once
class PlayerType;
void do_cmd_debug(PlayerType *player_ptr);
-#include "wizard/fixed-artifacts-spoiler.h"
+#include "wizard/fixed-artifacts-spoiler.h"
#include "io/files-util.h"
#include "object/object-kind-hook.h"
#include "system/angband-version.h"
#include "view/display-messages.h"
#include "wizard/artifact-analyzer.h"
#include "wizard/spoiler-util.h"
+#include <sstream>
/*!
* @brief フラグ名称を出力する汎用関数
* @param descriptions フラグ名リスト
* @param separator フラグ表示の区切り記号
*/
-void spoiler_outlist(std::string_view header, std::vector<std::string> &descriptions, char separator)
+void spoiler_outlist(std::string_view header, const std::vector<std::string> &descriptions, char separator, std::ofstream &ofs)
{
if (descriptions.empty()) {
return;
line.append(header).append(" ");
}
+ std::stringstream ss;
+ ss << list_separator << ' ';
+ const auto last_separator = ss.str();
for (size_t i = 0; i < descriptions.size(); i++) {
auto elem = descriptions[i];
if (i < descriptions.size() - 1) {
continue;
}
- if (line.length() > 1 && line[line.length() - 1] == ' ' && line[line.length() - 2] == list_separator) {
- line[line.length() - 2] = '\0';
- fprintf(spoiler_file, "%s\n", line.data());
+ if (line.length() > 1 && line.ends_with(last_separator)) {
+ ofs << std::string_view(line).substr(0, line.length() - 2) << '\n';
line = spoiler_indent;
line.append(elem);
} else {
- fprintf(spoiler_file, "%s\n", line.data());
+ ofs << line << '\n';
line = " ";
line.append(elem);
}
}
- fprintf(spoiler_file, "%s\n", line.data());
+ ofs << line << '\n';
}
/*!
- * @brief フラグ名称を出力する汎用関数
- * @param header ヘッダに出力するフラグ群の名前
- * @param list フラグ名リスト
- * @param separator フラグ表示の区切り記号
- * @todo 固定アーティファクトとランダムアーティファクトで共用、ここに置くべきかは要調整.
- * @todo いずれ上で定義したオーバーロードに吸収合併させてこれは消滅させる予定
- */
-void spoiler_outlist(concptr header, concptr *list, char separator)
-{
- if (*list == nullptr) {
- return;
- }
-
- std::string line = spoiler_indent;
- if (header && (header[0])) {
- line.append(header).append(" ");
- }
-
- while (true) {
- std::string elem = *list;
- if (list[1]) {
- elem.push_back(separator);
- elem.push_back(' ');
- }
-
- if (line.length() + elem.length() <= MAX_LINE_LEN) {
- line.append(elem);
- } else {
- if (line.length() > 1 && line[line.length() - 1] == ' ' && line[line.length() - 2] == list_separator) {
- line[line.length() - 2] = '\0';
- fprintf(spoiler_file, "%s\n", line.data());
- line = spoiler_indent;
- line.append(elem);
- } else {
- fprintf(spoiler_file, "%s\n", line.data());
- line = " ";
- line.append(elem);
- }
- }
-
- if (!*++list) {
- break;
- }
- }
-
- fprintf(spoiler_file, "%s\n", line.data());
-}
-
-/*!
- * @brief アーティファクト情報を出力するためにダミー生成を行う /
- * Hack -- Create a "forged" artifact
- * @param o_ptr 一時生成先を保管するオブジェクト構造体
+ * @brief アーティファクト情報を出力するためにダミー生成を行う
* @param fixed_artifact_idx 生成するアーティファクトID
- * @return ç\94\9fæ\88\90ã\81\8cæ\88\90å\8a\9fã\81\97ã\81\9få ´å\90\88TRUEã\82\92è¿\94ã\81\99
+ * @return ç\94\9fæ\88\90ã\81\97ã\81\9fã\82¢ã\83¼ã\83\86ã\82£ã\83\95ã\82¡ã\82¯ã\83\88 (é\80£ç\95ªã\81§å\9f\8bã\81¾ã\81£ã\81¦ã\81\84ã\82\8bã\81®ã\81§ä¸\8då\98å\9c¨ä¾\8bå¤\96ã\81¯å\90\90ã\81\8bã\81ªã\81\84)
*/
-static bool make_fake_artifact(ItemEntity *o_ptr, FixedArtifactId fixed_artifact_idx)
+static ItemEntity make_fake_artifact(FixedArtifactId fixed_artifact_idx)
{
const auto &artifact = ArtifactsInfo::get_instance().get_artifact(fixed_artifact_idx);
- if (artifact.name.empty()) {
- return false;
- }
-
const auto bi_id = lookup_baseitem_id(artifact.bi_key);
- if (bi_id == 0) {
- return false;
- }
-
- o_ptr->prep(bi_id);
- o_ptr->fixed_artifact_idx = fixed_artifact_idx;
- o_ptr->pval = artifact.pval;
- o_ptr->ac = artifact.ac;
- o_ptr->dd = artifact.dd;
- o_ptr->ds = artifact.ds;
- o_ptr->to_a = artifact.to_a;
- o_ptr->to_h = artifact.to_h;
- o_ptr->to_d = artifact.to_d;
- o_ptr->weight = artifact.weight;
- return true;
+ ItemEntity item;
+ item.prep(bi_id);
+ item.fixed_artifact_idx = fixed_artifact_idx;
+ item.pval = artifact.pval;
+ item.ac = artifact.ac;
+ item.dd = artifact.dd;
+ item.ds = artifact.ds;
+ item.to_a = artifact.to_a;
+ item.to_h = artifact.to_h;
+ item.to_d = artifact.to_d;
+ item.weight = artifact.weight;
+ return item;
}
/*!
* Create a spoiler file entry for an artifact
* @param art_ptr アーティファクト情報をまとめた構造体の参照ポインタ
*/
-static void spoiler_print_art(obj_desc_list *art_ptr)
+static void spoiler_print_art(obj_desc_list *art_ptr, std::ofstream &ofs)
{
- pval_info_type *pval_ptr = &art_ptr->pval_info;
- fprintf(spoiler_file, "%s\n", art_ptr->description);
- if (pval_ptr->pval_desc[0]) {
- spoiler_outlist(std::string(pval_ptr->pval_desc).append(_("の修正:", " to")).data(), pval_ptr->pval_affects, item_separator);
+ const auto *pval_ptr = &art_ptr->pval_info;
+ ofs << art_ptr->description << '\n';
+ if (!pval_ptr->pval_desc.empty()) {
+ std::stringstream ss;
+ ss << pval_ptr->pval_desc << _("の修正:", " to");
+ spoiler_outlist(ss.str(), pval_ptr->pval_affects, item_separator, ofs);
}
- spoiler_outlist(_("対:", "Slay"), art_ptr->slays, item_separator);
- spoiler_outlist(_("武器属性:", ""), art_ptr->brands, list_separator);
- spoiler_outlist(_("免疫:", "Immunity to"), art_ptr->immunities, item_separator);
- spoiler_outlist(_("耐性:", "Resist"), art_ptr->resistances, item_separator);
- spoiler_outlist(_("弱点:", "Vulnerable"), art_ptr->vulnerables, item_separator);
- spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustains, item_separator);
- spoiler_outlist("", art_ptr->misc_magic, list_separator);
+ spoiler_outlist(_("対:", "Slay"), art_ptr->slays, item_separator, ofs);
+ spoiler_outlist(_("武器属性:", ""), art_ptr->brands, list_separator, ofs);
+ spoiler_outlist(_("免疫:", "Immunity to"), art_ptr->immunities, item_separator, ofs);
+ spoiler_outlist(_("耐性:", "Resist"), art_ptr->resistances, item_separator, ofs);
+ spoiler_outlist(_("弱点:", "Vulnerable"), art_ptr->vulnerabilities, item_separator, ofs);
+ spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustenances, item_separator, ofs);
+ spoiler_outlist("", art_ptr->misc_magic, list_separator, ofs);
- if (art_ptr->addition[0]) {
- fprintf(spoiler_file, _("%s追加: %s\n", "%sAdditional %s\n"), spoiler_indent, art_ptr->addition);
+ if (!art_ptr->addition.empty()) {
+ ofs << format(_("%s追加: %s\n", "%sAdditional %s\n"), spoiler_indent.data(), art_ptr->addition.data());
}
- if (art_ptr->activation) {
- fprintf(spoiler_file, _("%s発動: %s\n", "%sActivates for %s\n"), spoiler_indent, art_ptr->activation);
+ if (!art_ptr->activation.empty()) {
+ ofs << format(_("%s発動: %s\n", "%sActivates for %s\n"), spoiler_indent.data(), art_ptr->activation.data());
}
- fprintf(spoiler_file, "%s%s\n\n", spoiler_indent, art_ptr->misc_desc);
+ ofs << format("%s%s\n\n", spoiler_indent.data(), art_ptr->misc_desc.data());
}
/*!
- * @brief アーティファクト情報のスポイラー出力を行うメインルーチン /
- * Create a spoiler file for artifacts
- * @param fname 生成ファイル名
+ * @brief アーティファクト情報のスポイラー出力を行うメインルーチン
+ * @details エラーコードと実際のエラー処理が不一致だが、後でまとめて修正する.
*/
-SpoilerOutputResultType spoil_fixed_artifact(concptr fname)
+SpoilerOutputResultType spoil_fixed_artifact()
{
- const auto &path = path_build(ANGBAND_DIR_USER, fname);
- spoiler_file = angband_fopen(path, FileOpenMode::WRITE);
- if (!spoiler_file) {
+ const auto &path = path_build(ANGBAND_DIR_USER, "artifact.txt");
+ std::ofstream ofs(path);
+ if (!ofs) {
return SpoilerOutputResultType::FILE_OPEN_FAILED;
}
- spoiler_underline(std::string("Artifact Spoilers for Hengband Version ").append(get_version()).data());
+ std::stringstream ss;
+ ss << "Artifact Spoilers for Hengband Version " << get_version();
+ spoiler_underline(ss.str(), ofs);
for (const auto &[tval_list, name] : group_artifact_list) {
- spoiler_blanklines(2);
- spoiler_underline(name);
- spoiler_blanklines(1);
+ spoiler_blanklines(2, ofs);
+ spoiler_underline(name, ofs);
+ spoiler_blanklines(1, ofs);
for (auto tval : tval_list) {
for (const auto &[a_idx, artifact] : artifacts_info) {
continue;
}
- ItemEntity item;
- if (!make_fake_artifact(&item, a_idx)) {
- continue;
- }
-
+ const auto item = make_fake_artifact(a_idx);
PlayerType dummy;
obj_desc_list artifact_descriptions;
object_analyze(&dummy, &item, &artifact_descriptions);
- spoiler_print_art(&artifact_descriptions);
+ spoiler_print_art(&artifact_descriptions, ofs);
}
}
}
- return ferror(spoiler_file) || angband_fclose(spoiler_file) ? SpoilerOutputResultType::FILE_CLOSE_FAILED
- : SpoilerOutputResultType::SUCCESSFUL;
+ return ofs.good() ? SpoilerOutputResultType::SUCCESSFUL : SpoilerOutputResultType::FILE_CLOSE_FAILED;
}
-#pragma once
+#pragma once
-#include "system/angband.h"
-#include "wizard/spoiler-util.h"
+#include <fstream>
+#include <string>
+#include <string_view>
+#include <vector>
-void spoiler_outlist(std::string_view header, std::vector<std::string> &descriptions, char seperator);
-void spoiler_outlist(concptr header, concptr *list, char separator);
-SpoilerOutputResultType spoil_fixed_artifact(concptr fname);
+enum class SpoilerOutputResultType;
+void spoiler_outlist(std::string_view header, const std::vector<std::string> &descriptions, char seperator, std::ofstream &ofs);
+SpoilerOutputResultType spoil_fixed_artifact();
-#include "wizard/items-spoiler.h"
+#include "wizard/items-spoiler.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "io/files-util.h"
}
/*!
- * @brief 各ベースアイテムの情報を一行毎に記述する /
- * Create a spoiler file for items
- * @param fname ファイル名
+ * @brief 各ベースアイテムの情報を一行毎に記述する
*/
-SpoilerOutputResultType spoil_obj_desc(concptr fname)
+SpoilerOutputResultType spoil_obj_desc()
{
- const auto &path = path_build(ANGBAND_DIR_USER, fname);
- spoiler_file = angband_fopen(path, FileOpenMode::WRITE);
- if (!spoiler_file) {
+ const auto &path = path_build(ANGBAND_DIR_USER, "obj-desc.txt");
+ std::ofstream ofs(path);
+ if (!ofs) {
return SpoilerOutputResultType::FILE_OPEN_FAILED;
}
- fprintf(spoiler_file, "Spoiler File -- Basic Items (%s)\n\n\n", get_version().data());
- fprintf(spoiler_file, "%-37s%8s%7s%5s %40s%9s\n", "Description", "Dam/AC", "Wgt", "Lev", "Chance", "Cost");
- fprintf(spoiler_file, "%-37s%8s%7s%5s %40s%9s\n", "-------------------------------------", "------", "---", "---", "----------------", "----");
+ ofs << format("Spoiler File -- Basic Items (%s)\n\n\n", get_version().data());
+ ofs << format("%-37s%8s%7s%5s %40s%9s\n", "Description", "Dam/AC", "Wgt", "Lev", "Chance", "Cost");
+ ofs << format("%-37s%8s%7s%5s %40s%9s\n", "-------------------------------------", "------", "---", "---", "----------------", "----");
for (const auto &[tval_list, name] : group_item_list) {
std::vector<short> whats;
return (price1 != price2) ? price1 < price2 : depth1 < depth2;
});
- fprintf(spoiler_file, "\n\n%s\n\n", name);
+ ofs << "\n\n"
+ << name << "\n\n";
for (const auto &bi_id : whats) {
PlayerType dummy;
const auto item = prepare_item_for_obj_desc(bi_id);
const auto dam_or_ac = describe_dam_or_ac(item);
const auto weight = describe_weight(item);
const auto chance = describe_chance(item);
- fprintf(spoiler_file, " %-35s%8s%7s%5d %-40s%9ld\n", item_name.data(),
- dam_or_ac.data(), weight.data(), static_cast<int>(depth), chance.data(),
- static_cast<long>(price));
+ ofs << format(" %-35s%8s%7s%5d %-40s%9d\n", item_name.data(), dam_or_ac.data(), weight.data(), depth, chance.data(), price);
}
}
- return ferror(spoiler_file) || angband_fclose(spoiler_file) ? SpoilerOutputResultType::FILE_CLOSE_FAILED
- : SpoilerOutputResultType::SUCCESSFUL;
+ return ofs.good() ? SpoilerOutputResultType::SUCCESSFUL : SpoilerOutputResultType::FILE_CLOSE_FAILED;
}
-#pragma once
+#pragma once
-#include "system/angband.h"
-#include "wizard/spoiler-util.h"
-
-SpoilerOutputResultType spoil_obj_desc(concptr fname);
+enum class SpoilerOutputResultType;
+SpoilerOutputResultType spoil_obj_desc();
-#include "wizard/monster-info-spoiler.h"
+#include "wizard/monster-info-spoiler.h"
#include "io/files-util.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-flags1.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include "wizard/spoiler-util.h"
-#include "wizard/spoiler-table.h"
+#include "wizard/spoiler-table.h"
/* The basic items categorized by type */
const std::vector<grouper> group_item_list = {
{ { ItemKindType::RING }, _("指輪", "Rings") },
};
-flag_desc stat_flags_desc[MAX_STAT_FLAGS_DESCRIPTION] = { { TR_STR, _("腕力", "STR") }, { TR_INT, _("知能", "INT") }, { TR_WIS, _("賢さ", "WIS") },
+const std::vector<flag_desc> stat_flags_desc = { { TR_STR, _("腕力", "STR") }, { TR_INT, _("知能", "INT") }, { TR_WIS, _("賢さ", "WIS") },
{ TR_DEX, _("器用さ", "DEX") },
{ TR_CON, _("耐久力", "CON") }, { TR_CHR, _("魅力", "CHR") } };
-flag_desc pval_flags1_desc[MAX_PVAL_FLAGS_DESCRIPTION] = { { TR_MAGIC_MASTERY, _("魔法道具使用能力", "Magic Mastery") }, { TR_STEALTH, _("隠密", "Stealth") },
+const std::vector<flag_desc> pval_flags1_desc = { { TR_MAGIC_MASTERY, _("魔法道具使用能力", "Magic Mastery") }, { TR_STEALTH, _("隠密", "Stealth") },
{ TR_SEARCH, _("探索", "Searching") }, { TR_INFRA, _("赤外線視力", "Infravision") }, { TR_TUNNEL, _("採掘", "Tunneling") },
{ TR_BLOWS, _("攻撃回数", "Attacks") }, { TR_SPEED, _("スピード", "Speed") } };
-flag_desc slay_flags_desc[MAX_SLAY_FLAGS_DESCRIPTION] = {
+const std::vector<flag_desc> slay_flags_desc = {
{ TR_SLAY_ANIMAL, _("動物", "Animal") },
{ TR_KILL_ANIMAL, _("*動物*", "XAnimal") },
{ TR_SLAY_EVIL, _("邪悪", "Evil") },
};
/* Elemental brands for weapons */
-flag_desc brand_flags_desc[MAX_BRAND_FLAGS_DESCRIPTION] = {
+const std::vector<flag_desc> brand_flags_desc = {
{ TR_BRAND_ACID, _("溶解", "Acid Brand") },
{ TR_BRAND_ELEC, _("電撃", "Lightning Brand") },
{ TR_BRAND_FIRE, _("焼棄", "Flame Tongue") },
{ TR_IMPACT, _("強撃", "Smash hit") },
};
-const flag_desc resist_flags_desc[MAX_RESISTANCE_FLAGS_DESCRIPTION] = {
+const std::vector<flag_desc> resist_flags_desc = {
{ TR_RES_ACID, _("酸", "Acid") },
{ TR_RES_ELEC, _("電撃", "Lightning") },
{ TR_RES_FIRE, _("火炎", "Fire") },
{ TR_RES_CURSE, _("呪力", "Curse") },
};
-const flag_desc vulnerable_flags_desc[MAX_VULNERABLE_FLAGS_DESCRIPTION] = {
+const std::vector<flag_desc> vulnerable_flags_desc = {
{ TR_VUL_ACID, _("酸", "Acid") },
{ TR_VUL_ELEC, _("電撃", "Lightning") },
{ TR_VUL_FIRE, _("火炎", "Fire") },
};
/* Elemental immunities (along with poison) */
-const flag_desc immune_flags_desc[MAX_IMMUNITY_FLAGS_DESCRIPTION] = {
+const std::vector<flag_desc> immune_flags_desc = {
{ TR_IM_ACID, _("酸", "Acid") },
{ TR_IM_ELEC, _("電撃", "Lightning") },
{ TR_IM_FIRE, _("火炎", "Fire") },
};
/* Sustain stats - these are given their "own" line in the spoiler file, mainly for simplicity */
-const flag_desc sustain_flags_desc[MAX_SUSTAINER_FLAGS_DESCRIPTION] = {
+const std::vector<flag_desc> sustain_flags_desc = {
{ TR_SUST_STR, _("腕力", "STR") },
{ TR_SUST_INT, _("知能", "INT") },
{ TR_SUST_WIS, _("賢さ", "WIS") },
-#pragma once
+#pragma once
#include "object-enchant/tr-types.h"
#include "object/tval-types.h"
#include "system/angband.h"
-
#include <vector>
-#define MAX_STAT_FLAGS_DESCRIPTION 6
-#define MAX_PVAL_FLAGS_DESCRIPTION 7
-#define MAX_SLAY_FLAGS_DESCRIPTION 20
-#define MAX_BRAND_FLAGS_DESCRIPTION 12
-#define MAX_RESISTANCE_FLAGS_DESCRIPTION 19
-#define MAX_VULNERABLE_FLAGS_DESCRIPTION 6
-#define MAX_IMMUNITY_FLAGS_DESCRIPTION 4
-#define MAX_SUSTAINER_FLAGS_DESCRIPTION 6
-
/* A tval grouper */
struct grouper {
std::vector<ItemKindType> tval_set;
extern const std::vector<grouper> group_item_list;
extern const std::vector<grouper> group_artifact_list;
-extern flag_desc stat_flags_desc[MAX_STAT_FLAGS_DESCRIPTION];
-extern flag_desc pval_flags1_desc[MAX_PVAL_FLAGS_DESCRIPTION];
-extern flag_desc slay_flags_desc[MAX_SLAY_FLAGS_DESCRIPTION];
-extern flag_desc brand_flags_desc[MAX_BRAND_FLAGS_DESCRIPTION];
-extern const flag_desc resist_flags_desc[MAX_RESISTANCE_FLAGS_DESCRIPTION];
-extern const flag_desc vulnerable_flags_desc[MAX_VULNERABLE_FLAGS_DESCRIPTION];
-extern const flag_desc immune_flags_desc[MAX_IMMUNITY_FLAGS_DESCRIPTION];
-extern const flag_desc sustain_flags_desc[MAX_SUSTAINER_FLAGS_DESCRIPTION];
+extern const std::vector<flag_desc> stat_flags_desc;
+extern const std::vector<flag_desc> pval_flags1_desc;
+extern const std::vector<flag_desc> slay_flags_desc;
+extern const std::vector<flag_desc> brand_flags_desc;
+extern const std::vector<flag_desc> resist_flags_desc;
+extern const std::vector<flag_desc> vulnerable_flags_desc;
+extern const std::vector<flag_desc> immune_flags_desc;
+extern const std::vector<flag_desc> sustain_flags_desc;
extern const std::vector<flag_desc> misc_flags2_desc;
extern const std::vector<flag_desc> misc_flags3_desc;
-#include "wizard/spoiler-util.h"
+#include "wizard/spoiler-util.h"
+#include "object/object-flags.h"
+#include "system/item-entity.h"
+#include <fstream>
const char item_separator = ',';
const char list_separator = _(',', ';');
const int max_evolution_depth = 64;
-concptr spoiler_indent = " ";
+const std::string spoiler_indent = " ";
/* The spoiler file being created */
FILE *spoiler_file = nullptr;
/*!
+ * @brief 特性フラグ定義から表記すべき特性を抽出する
+ * @param art_flags 出力するアーティファクトの特性一覧
+ * @param definitions 表記対象の特性一覧
+ * @return 表記すべき特性一覧
+ */
+std::vector<std::string> extract_spoiler_flags(const TrFlags &art_flags, const std::vector<flag_desc> &definitions)
+{
+ std::vector<std::string> descriptions{};
+ for (const auto &definition : definitions) {
+ if (art_flags.has(definition.flag)) {
+ descriptions.push_back(definition.desc);
+ }
+ }
+
+ return descriptions;
+}
+
+/*!
* @brief ファイルポインタ先に同じ文字を複数出力する /
* Write out `n' of the character `c' to the spoiler file
* @param n 出力する数
* @param c 出力するキャラクタ
*/
-static void spoiler_out_n_chars(int n, char c)
+static void spoiler_out_n_chars(int n, char c, std::ofstream &ofs)
{
- while (--n >= 0) {
- fputc(c, spoiler_file);
+ for (auto i = 0; i < n; i++) {
+ ofs << c;
}
}
* Write out `n' blank lines to the spoiler file
* @param n 改行を出力する数
*/
-void spoiler_blanklines(int n)
+void spoiler_blanklines(int n, std::ofstream &ofs)
{
- spoiler_out_n_chars(n, '\n');
+ spoiler_out_n_chars(n, '\n', ofs);
}
/*!
* Write a line to the spoiler file and then "underline" it with hypens
* @param str 出力したい文字列
*/
-void spoiler_underline(concptr str)
+void spoiler_underline(std::string_view str, std::ofstream &ofs)
{
- fprintf(spoiler_file, "%s\n", str);
- spoiler_out_n_chars(strlen(str), '-');
- fprintf(spoiler_file, "\n");
+ ofs << str.data() << '\n';
+ spoiler_out_n_chars(str.length(), '-', ofs);
+ ofs << '\n';
}
/*!
*roff_p++ = ch;
}
}
+
+void ParameterValueInfo::analyze(const ItemEntity &item)
+{
+ if (item.pval == 0) {
+ return;
+ }
+
+ auto flags = object_flags(&item);
+ this->pval_desc = format("%+d", item.pval);
+ if (flags.has_all_of(EnumRange(TR_STR, TR_CHR))) {
+ this->pval_affects.push_back(_("全能力", "All stats"));
+ } else if (flags.has_any_of(EnumRange(TR_STR, TR_CHR))) {
+ const auto descriptions_stat = extract_spoiler_flags(flags, stat_flags_desc);
+ this->pval_affects.insert(this->pval_affects.end(), descriptions_stat.begin(), descriptions_stat.end());
+ }
+
+ const auto descriptions_pval1 = extract_spoiler_flags(flags, pval_flags1_desc);
+ this->pval_affects.insert(this->pval_affects.end(), descriptions_pval1.begin(), descriptions_pval1.end());
+}
-#pragma once
+#pragma once
+#include "object-enchant/tr-flags.h"
#include "system/angband.h"
#include "wizard/spoiler-table.h"
+#include <fstream>
#include <string>
#include <string_view>
#include <vector>
/* MAX_LINE_LEN specifies when a line should wrap. */
#define MAX_LINE_LEN 75
-/* Given an array, determine how many elements are in the array */
-#define N_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
-
enum class SpoilerOutputResultType {
CANCELED,
SUCCESSFUL,
FILE_CLOSE_FAILED,
};
-/* A special type used just for deailing with pvals */
-struct pval_info_type {
- char pval_desc[12]; /* This will contain a string such as "+2", "-10", etc. */
+class ItemEntity;
+class ParameterValueInfo {
+public:
+ ParameterValueInfo() = default;
+
+ std::string pval_desc = ""; /* This will contain a string such as "+2", "-10", etc. */
/* A list of various player traits affected by an object's pval such as stats, speed, stealth, etc. */
- concptr pval_affects[N_ELEMENTS(stat_flags_desc) - 1 + N_ELEMENTS(pval_flags1_desc) + 1];
+ std::vector<std::string> pval_affects{};
+
+ void analyze(const ItemEntity &item);
};
struct obj_desc_list {
- char description[MAX_NLEN]{}; /* "The Longsword Dragonsmiter (6d4) (+20, +25)" */
- pval_info_type pval_info{}; /* Description of what is affected by an object's pval */
- concptr slays[N_ELEMENTS(slay_flags_desc) + 1]{}; /* A list of an object's slaying preferences */
- concptr brands[N_ELEMENTS(brand_flags_desc) + 1]{}; /* A list if an object's elemental brands */
- concptr immunities[N_ELEMENTS(immune_flags_desc) + 1]{}; /* A list of immunities granted by an object */
- concptr resistances[N_ELEMENTS(resist_flags_desc) + 1]{}; /* A list of resistances granted by an object */
- concptr vulnerables[N_ELEMENTS(vulnerable_flags_desc) + 1]{}; /* A list of resistances granted by an object */
- concptr sustains[N_ELEMENTS(sustain_flags_desc) - 1 + 1]{}; /* A list of stats sustained by an object */
+ std::string description = ""; /* "The Longsword Dragonsmiter (6d4) (+20, +25)" */
+ ParameterValueInfo pval_info{}; /* Description of what is affected by an object's pval */
+ std::vector<std::string> slays{}; /* A list of an object's slaying preferences */
+ std::vector<std::string> brands{}; /* A list if an object's elemental brands */
+ std::vector<std::string> immunities{}; /* A list of immunities granted by an object */
+ std::vector<std::string> resistances{}; /* A list of resistances granted by an object */
+ std::vector<std::string> vulnerabilities{}; /* A list of resistances granted by an object */
+ std::vector<std::string> sustenances{}; /* A list of stats sustained by an object */
std::vector<std::string> misc_magic{}; // その他の特性 (呪い、光源範囲等)
- char addition[80] = ""; /* Additional ability or resistance */
- concptr activation = ""; /* A string describing an artifact's activation */
- char misc_desc[80] = ""; /* "Level 20, Rarity 30, 3.0 lbs, 20000 Gold" */
+ std::string addition = ""; /* Additional ability or resistance */
+ std::string activation = ""; /* A string describing an artifact's activation */
+ std::string misc_desc = ""; /* "Level 20, Rarity 30, 3.0 lbs, 20000 Gold" */
};
extern const char item_separator;
extern const char list_separator;
extern const int max_evolution_depth;
-extern concptr spoiler_indent;
+extern const std::string spoiler_indent;
extern FILE *spoiler_file;
-void spoiler_blanklines(int n);
-void spoiler_underline(concptr str);
+struct flag_desc;
+std::vector<std::string> extract_spoiler_flags(const TrFlags &art_flags, const std::vector<flag_desc> &definitions);
+void spoiler_blanklines(int n, std::ofstream &ofs);
+void spoiler_underline(std::string_view str, std::ofstream &ofs);
void spoil_out(std::string_view sv, bool flush_buffer = false);
-#include "wizard/tval-descriptions-table.h"
+#include "wizard/tval-descriptions-table.h"
#include "object/tval-types.h"
/*!
-#pragma once
+#pragma once
#include "system/angband.h"
#include <vector>
-/*!
+/*!
* @brief ゲーム属性を変更するデバッグコマンド
* @date 2021/03/07
*/
-#pragma once
+#pragma once
class PlayerType;
void wizard_game_modifier(PlayerType *player_ptr);
-#include "wizard/wizard-item-modifier.h"
+#include "wizard/wizard-item-modifier.h"
#include "artifact/fixed-art-generator.h"
#include "artifact/fixed-art-types.h"
#include "artifact/random-art-effects.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "wizard/wizard-messages.h"
+#include "wizard/wizard-messages.h"
#include "game-option/cheat-options.h"
#include "game-option/cheat-types.h"
#include "io/write-diary.h"
-#pragma once
+#pragma once
#include "system/angband.h"
#include <string_view>
-/*!
+/*!
* @brief プレイヤー属性を変更するデバッグコマンド
* @date 2021/03/07
*/
-#pragma once
+#pragma once
class PlayerType;
void wizard_player_modifier(PlayerType *player_ptr);
-/*!
+/*!
* @brief ウィザードモードの処理(特別処理中心) / Wizard commands
* @date 2014/09/07
* @author
#include "term/z-form.h"
#include "util/angband-files.h"
#include "util/bit-flags-calculator.h"
+#include "util/candidate-selector.h"
#include "util/enum-converter.h"
#include "util/finalizer.h"
#include "util/int-char-converter.h"
*/
static std::optional<FixedArtifactId> wiz_select_named_artifact(PlayerType *player_ptr, const std::vector<FixedArtifactId> &a_idx_list)
{
- constexpr auto MAX_PER_PAGE = 20UL;
- const auto page_max = (a_idx_list.size() - 1) / MAX_PER_PAGE + 1;
- auto current_page = 0UL;
-
- screen_save();
-
- std::optional<FixedArtifactId> selected_a_idx;
-
- while (!selected_a_idx.has_value()) {
- const auto page_base_idx = current_page * MAX_PER_PAGE;
- for (auto i = 0U; i < MAX_PER_PAGE + 1; ++i) {
- term_erase(14, i + 1, 255);
- }
- const auto page_item_count = std::min(MAX_PER_PAGE, a_idx_list.size() - page_base_idx);
- for (auto i = 0U; i < page_item_count; ++i) {
- std::stringstream ss;
- ss << I2A(i) << ") " << wiz_make_named_artifact_desc(player_ptr, a_idx_list[page_base_idx + i]);
- put_str(ss.str(), i + 1, 15);
- }
- if (page_max > 1) {
- put_str(format("-- more (%lu/%lu) --", current_page + 1, page_max), page_item_count + 1, 15);
- }
+ CandidateSelector cs("Which artifact: ", 15);
- const auto command = input_command("Which artifact: ");
- const auto cmd = command.value_or(ESCAPE);
- switch (cmd) {
- case ESCAPE:
- screen_load();
- return selected_a_idx;
- case ' ':
- current_page++;
- if (current_page >= page_max) {
- current_page = 0;
- }
- break;
- default:
- const auto select_idx = A2I(cmd) + page_base_idx;
- if (select_idx < a_idx_list.size()) {
- selected_a_idx = a_idx_list[select_idx];
- }
- break;
- }
- }
-
- screen_load();
-
- return selected_a_idx;
+ auto describe_artifact = [player_ptr](FixedArtifactId a_idx) { return wiz_make_named_artifact_desc(player_ptr, a_idx); };
+ const auto it = cs.select(a_idx_list, describe_artifact);
+ return (it != a_idx_list.end()) ? std::make_optional(*it) : std::nullopt;
}
/**
const auto &[tval_lit, name] = group_artifact_list[i];
std::stringstream ss;
ss << I2A(i) << ") " << name;
- term_erase(14, i + 1, 255);
+ term_erase(14, i + 1);
put_str(ss.str(), i + 1, 15);
}
std::optional<FixedArtifactId> create_a_idx;
- while (!create_a_idx.has_value()) {
+ while (!create_a_idx) {
const auto command = input_command("Kind of artifact: ");
- const auto cmd = command.value_or(ESCAPE);
- switch (cmd) {
- case ESCAPE:
+ if (!command) {
screen_load();
return;
- default:
- if (auto idx = A2I(cmd); idx < group_artifact_list.size()) {
- const auto &a_idx_list = wiz_collect_group_a_idx(group_artifact_list[idx]);
- create_a_idx = wiz_select_named_artifact(player_ptr, a_idx_list);
- }
+ }
- break;
+ const auto idx = A2I(*command);
+ if (idx >= group_artifact_list.size()) {
+ continue;
}
+
+ const auto a_idx_list = wiz_collect_group_a_idx(group_artifact_list[idx]);
+ create_a_idx = wiz_select_named_artifact(player_ptr, a_idx_list);
}
screen_load();
-#pragma once
+#pragma once
#include "system/angband.h"
-/*!
+/*!
* @brief ウィザードモード専用のスペル処理
* @date 2020/06/27
* @author Hourier
-#pragma once
+#pragma once
#include "effect/attribute-types.h"
#include "system/angband.h"
-/*!
+/*!
* @brief スポイラー出力処理 (行数の都合でモンスター進化ツリーもここに入っている)
* @date 2014/02/17
* @author
#include <set>
#include <sstream>
#include <string>
+#include <string_view>
static constexpr std::array<std::string_view, 6> wiz_spell_stat = { {
_("腕力", "STR"),
*
* @return 進化ツリーの一番根元となるモンスターのIDのリスト(std::setで、evol_root_sortによりソートされている)
*/
-static auto get_mon_evol_roots(void)
+static auto get_mon_evol_roots()
{
std::set<MonsterRaceId> evol_parents;
std::set<MonsterRaceId> evol_children;
}
/*!
- * @brief 進化ツリーをスポイラー出力するメインルーチン /
- * Print monsters' evolution information to file
- * @param fname 出力ファイル名
+ * @brief 進化ツリーをスポイラー出力するメインルーチン
+ * @param filename 出力ファイル名
*/
-static SpoilerOutputResultType spoil_mon_evol(concptr fname)
+static SpoilerOutputResultType spoil_mon_evol(std::string_view filename)
{
- const auto &path = path_build(ANGBAND_DIR_USER, fname);
+ const auto &path = path_build(ANGBAND_DIR_USER, filename);
spoiler_file = angband_fopen(path, FileOpenMode::WRITE);
if (!spoiler_file) {
return SpoilerOutputResultType::FILE_OPEN_FAILED;
screen_load();
return;
case '1':
- status = spoil_obj_desc("obj-desc.txt");
+ status = spoil_obj_desc();
break;
case '2':
- status = spoil_fixed_artifact("artifact.txt");
+ status = spoil_fixed_artifact();
break;
case '3':
status = spoil_mon_desc("mon-desc.txt");
* Create Spoiler files -BEN-
* @return 成功時SPOILER_OUTPUT_SUCCESS / 失敗時エラー状態
*/
-SpoilerOutputResultType output_all_spoilers(void)
+SpoilerOutputResultType output_all_spoilers()
{
- auto status = spoil_obj_desc("obj-desc.txt");
+ auto status = spoil_obj_desc();
if (status != SpoilerOutputResultType::SUCCESSFUL) {
return status;
}
- status = spoil_fixed_artifact("artifact.txt");
+ status = spoil_fixed_artifact();
if (status != SpoilerOutputResultType::SUCCESSFUL) {
return status;
}
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "world/world-movement-processor.h"
+#include "world/world-movement-processor.h"
#include "cmd-io/cmd-save.h"
#include "core/disturbance.h"
#include "dungeon/quest.h"
-#pragma once
+#pragma once
class PlayerType;
void check_random_quest_auto_failure(PlayerType *player_ptr);
-#include "world/world-object.h"
+#include "world/world-object.h"
#include "dungeon/dungeon-flag-types.h"
#include "object-enchant/item-apply-magic.h"
#include "object/tval-types.h"
-#pragma once
+#pragma once
#include "system/angband.h"
-#include "world/world-turn-processor.h"
+#include "world/world-turn-processor.h"
#include "cmd-building/cmd-building.h"
#include "cmd-io/cmd-save.h"
#include "core/disturbance.h"
*/
void WorldTurnProcessor::print_time()
{
- TERM_LEN width, height;
- term_get_size(&width, &height);
- const auto row = height + ROW_DAY;
+ const auto [wid, hgt] = term_get_size();
+ const auto row = hgt + ROW_DAY;
int day;
c_put_str(TERM_WHITE, " ", row, COL_DAY);
-#pragma once
+#pragma once
class PlayerType;
class WorldTurnProcessor {
-#include "world/world.h"
+#include "world/world.h"
#include "player-info/race-types.h"
#include "system/player-type-definition.h"
#include "util/bit-flags-calculator.h"
-#pragma once
+#pragma once
#include "market/bounty-type-definition.h"
#include "player-info/class-types.h"