From 924ccf7dec90442b9f1dc29743203792b11fdd3d Mon Sep 17 00:00:00 2001 From: Deskull Date: Thu, 26 Oct 2017 09:18:57 +0900 Subject: [PATCH] =?utf8?q?#37287=20#37353=20(2.2.0.89)=20KIND=5FOBJECT=5FI?= =?utf8?q?DX=E5=9E=8B=E3=81=A8MONSTER=5FNUMBER=E5=9E=8B=E3=82=92=E5=AE=9A?= =?utf8?q?=E7=BE=A9=E3=81=97=E3=80=81=E5=9E=8B=E3=81=AE=E7=BD=AE=E6=8F=9B?= =?utf8?q?=E3=82=92=E7=B6=99=E7=B6=9A=E4=B8=AD=E3=80=82=20/=20KIND=5FOBJEC?= =?utf8?q?T=5FIDX=20and=20MONSTER=5FNUMBER=20type,=20ongoing=20type=20repl?= =?utf8?q?acement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/artifact.c | 5 +++-- src/externs.h | 2 +- src/h-type.h | 8 +++++++- src/mane.c | 8 ++++---- src/snipe.c | 2 +- src/spells1.c | 4 ++-- src/spells3.c | 2 +- src/types.h | 16 ++++++++-------- src/wizard2.c | 5 +++-- src/xtra2.c | 6 ++---- 10 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index 0ee43bb70..29f999d1d 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -2232,8 +2232,9 @@ static bool activate_dragon_breath(object_type *o_ptr) */ bool activate_random_artifact(object_type *o_ptr) { - int plev = p_ptr->lev; - int k, dir, dummy = 0; + PLAYER_LEVEL plev = p_ptr->lev; + int k, dummy = 0; + DIRECTION dir; cptr name = k_name + k_info[o_ptr->k_idx].name; const activation_type* const act_ptr = find_activation_info(o_ptr); diff --git a/src/externs.h b/src/externs.h index 9874da6e2..7337d0ba0 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1503,7 +1503,7 @@ extern bool target_able(MONSTER_IDX m_idx); extern bool target_okay(void); extern bool target_set(int mode); extern void target_set_prepare_look(void); -extern bool get_aim_dir(int *dp); +extern bool get_aim_dir(DIRECTION *dp); extern bool get_hack_dir(int *dp); extern bool get_rep_dir(int *dp, bool under); extern bool get_rep_dir2(int *dp); diff --git a/src/h-type.h b/src/h-type.h index 9bb1f604c..3aa85e3de 100644 --- a/src/h-type.h +++ b/src/h-type.h @@ -113,15 +113,21 @@ typedef s16b REALM_IDX; /*!< ゲーム中の魔法領域ID型を定義 */ typedef s16b ARTIFACT_IDX; /*!< ゲーム中のアーティファクトID型を定義 */ typedef s16b VIRTUES_IDX; /*!< ゲーム中の徳ID型を定義 */ typedef s16b QUEST_IDX; /*!< ゲーム中のクエストID型を定義 */ + typedef s16b INVENTORY_IDX; /*!< ゲーム中の所持品ID型を定義 */ typedef s16b OBJECT_IDX; /*!< ゲーム中のアイテムID型を定義 */ +typedef s16b KIND_OBJECT_IDX; /*!< ゲーム中のベースアイテムID型を定義 */ + typedef s32b POSITION; /*!< ゲーム中の座標型を定義 */ typedef s32b HIT_POINT; /*!< ゲーム中のHP/ダメージ型を定義 */ typedef s32b MANA_POINT; /*!< ゲーム中のMP型を定義 */ typedef s16b HIT_PROB; /*!< ゲーム中の命中修正値を定義 */ typedef s16b BASE_STATUS; /*!< ゲーム中の基礎能力値型を定義 */ -typedef s32b ITEM_NUMBER; /*!< ゲーム中のアイテム数型を定義 */ + +typedef s32b MONSTER_NUMBER; /*!< ゲーム中のモンスター数型を定義 */ +typedef s32b ITEM_NUMBER; /*!< ゲーム中のアイテム数型を定義 */ + typedef s16b ACTION_ENERGY; /*!< ゲーム中の行動エネルギー型を定義 */ typedef s16b ARMOUR_CLASS; /*!< ゲーム中の行動アーマークラス型を定義 */ typedef s16b TIME_EFFECT; /*!< ゲーム中の時限期間の型を定義 */ diff --git a/src/mane.c b/src/mane.c index eef66ca69..f6bd451fd 100644 --- a/src/mane.c +++ b/src/mane.c @@ -276,10 +276,10 @@ static int get_mane_power(int *sn, bool baigaesi) */ static bool use_mane(int spell) { - int dir; - int plev = p_ptr->lev; - u32b mode = (PM_ALLOW_GROUP | PM_FORCE_PET); - u32b u_mode = 0L; + DIRECTION dir; + PLAYER_LEVEL plev = p_ptr->lev; + BIT_FLAGS mode = (PM_ALLOW_GROUP | PM_FORCE_PET); + BIT_FLAGS u_mode = 0L; if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE; diff --git a/src/snipe.c b/src/snipe.c index cc35c9add..b671f5327 100644 --- a/src/snipe.c +++ b/src/snipe.c @@ -567,7 +567,7 @@ static bool cast_sniper_spell(int spell) */ void do_cmd_snipe(void) { - int n = 0; + COMMAND_CODE n = 0; bool cast; diff --git a/src/spells1.c b/src/spells1.c index c1d1b49a7..083cb0d35 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -1198,11 +1198,11 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ) * We return "TRUE" if the effect of the projection is "obvious". * */ -static bool project_o(int who, int r, int y, int x, int dam, int typ) +static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, int typ) { cave_type *c_ptr = &cave[y][x]; - s16b this_o_idx, next_o_idx = 0; + OBJECT_IDX this_o_idx, next_o_idx = 0; bool obvious = FALSE; bool known = player_has_los_bold(y, x); diff --git a/src/spells3.c b/src/spells3.c index 92af9b71e..f6f4b88b5 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -947,7 +947,7 @@ bool recall_player(TIME_EFFECT turns) { if (!dun_level) { - int select_dungeon; + DUNGEON_IDX select_dungeon; select_dungeon = choose_dungeon(_("に帰還", "recall"), 2, 14); if (!select_dungeon) return FALSE; p_ptr->recall_dungeon = select_dungeon; diff --git a/src/types.h b/src/types.h index aef5e97e2..8f5aaa049 100644 --- a/src/types.h +++ b/src/types.h @@ -695,14 +695,14 @@ struct quest_type s16b type; /*!< クエストの種別 / The quest type */ char name[60]; /*!< クエスト名 / Quest name */ - DEPTH level; /*!< 処理階層 / Dungeon level */ - MONRACE_IDX r_idx; /*!< クエスト対象のモンスターID / Monster race */ - - s16b cur_num; /*!< 撃破したモンスターの数 / Number killed */ - s16b max_num; /*!< 求められるモンスターの撃破数 / Number required */ - - IDX k_idx; /*!< クエスト対象のアイテムID / object index */ - s16b num_mon; /*!< QUEST_TYPE_KILL_NUMBER時の目標撃破数 number of monsters on level */ + DEPTH level; /*!< 処理階層 / Dungeon level */ + MONRACE_IDX r_idx; /*!< クエスト対象のモンスターID / Monster race */ + + MONSTER_NUMBER cur_num; /*!< 撃破したモンスターの数 / Number killed */ + MONSTER_NUMBER max_num; /*!< 求められるモンスターの撃破数 / Number required */ + + IDX k_idx; /*!< クエスト対象のアイテムID / object index */ + MONSTER_NUMBER num_mon; /*!< QUEST_TYPE_KILL_NUMBER時の目標撃破数 number of monsters on level */ byte flags; /*!< クエストに関するフラグビット / quest flags */ byte dungeon; /*!< クエスト対象のダンジョンID / quest dungeon */ diff --git a/src/wizard2.c b/src/wizard2.c index 887e4fa30..1c94028aa 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -1272,7 +1272,7 @@ static void do_cmd_wiz_blue_mage(void) */ static void do_cmd_wiz_play(void) { - int item; + OBJECT_IDX item; object_type forge; object_type *q_ptr; @@ -1555,7 +1555,8 @@ static void do_cmd_wiz_jump(void) if (!d_info[tmp_dungeon_type].maxdepth || (tmp_dungeon_type > max_d_idx)) tmp_dungeon_type = DUNGEON_ANGBAND; /* Prompt */ - sprintf(ppp, "Jump to level (0, %d-%d): ", d_info[tmp_dungeon_type].mindepth, d_info[tmp_dungeon_type].maxdepth); + sprintf(ppp, "Jump to level (0, %d-%d): ", + (int)d_info[tmp_dungeon_type].mindepth, (int)d_info[tmp_dungeon_type].maxdepth); /* Default */ sprintf(tmp_val, "%d", (int)dun_level); diff --git a/src/xtra2.c b/src/xtra2.c index 72e68e489..a223a79ce 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -4091,12 +4091,10 @@ bool target_set(int mode) * * Note that confusion over-rides any (explicit?) user choice. */ -bool get_aim_dir(int *dp) +bool get_aim_dir(DIRECTION *dp) { - int dir; - + DIRECTION dir; char command; - cptr p; /* Initialize */ -- 2.11.0