OSDN Git Service

#37287 #37353 (2.2.0.89) KIND_OBJECT_IDX型とMONSTER_NUMBER型を定義し、型の置換を継続中。 / KIND_OBJECT...
authorDeskull <desull@users.sourceforge.jp>
Thu, 26 Oct 2017 00:18:57 +0000 (09:18 +0900)
committerDeskull <desull@users.sourceforge.jp>
Thu, 26 Oct 2017 00:18:57 +0000 (09:18 +0900)
src/artifact.c
src/externs.h
src/h-type.h
src/mane.c
src/snipe.c
src/spells1.c
src/spells3.c
src/types.h
src/wizard2.c
src/xtra2.c

index 0ee43bb..29f999d 100644 (file)
@@ -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);
 
index 9874da6..7337d0b 100644 (file)
@@ -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);
index 9bb1f60..3aa85e3 100644 (file)
@@ -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;   /*!< ゲーム中の時限期間の型を定義 */
index eef66ca..f6bd451 100644 (file)
@@ -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;
 
index cc35c9a..b671f53 100644 (file)
@@ -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;
 
 
index c1d1b49..083cb0d 100644 (file)
@@ -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".
  * </pre>
  */
-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);
index 92af9b7..f6f4b88 100644 (file)
@@ -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;
index aef5e97..8f5aaa0 100644 (file)
@@ -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 */
index 887e4fa..1c94028 100644 (file)
@@ -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);
index 72e68e4..a223a79 100644 (file)
@@ -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 */