OSDN Git Service

#37287 #37353 (2.2.0.89) MULTIPLY 型を定義し、型の置換を継続中。 / Define MULTIPLY, ongoing type...
authorDeskull <desull@users.sourceforge.jp>
Fri, 27 Oct 2017 08:22:13 +0000 (17:22 +0900)
committerDeskull <desull@users.sourceforge.jp>
Fri, 27 Oct 2017 08:22:13 +0000 (17:22 +0900)
src/cmd3.c
src/cmd4.c
src/cmd5.c
src/externs.h
src/h-type.h
src/hissatsu.c
src/init1.c
src/monster2.c
src/mutation.c
src/object2.c
src/types.h

index a2646c4..a80147b 100644 (file)
@@ -840,18 +840,18 @@ static bool high_level_book(object_type *o_ptr)
  */
 void do_cmd_destroy(void)
 {
-       OBJECT_IDX item, amt = 1;
-       int                     old_number;
-
-       bool            force = FALSE;
+       OBJECT_IDX item;
+       QUANTITY amt = 1;
+       QUANTITY old_number;
 
-       object_type             *o_ptr;
-       object_type             forge;
-       object_type             *q_ptr = &forge;
+       bool force = FALSE;
 
-       char            o_name[MAX_NLEN];
+       object_type *o_ptr;
+       object_type forge;
+       object_type *q_ptr = &forge;
 
-       char            out_val[MAX_NLEN+40];
+       char o_name[MAX_NLEN];
+       char out_val[MAX_NLEN+40];
 
        cptr q, s;
 
index 5975865..23942e1 100644 (file)
@@ -8143,13 +8143,13 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
 #ifdef JP
                                                sprintf(rand_tmp_str,"  %s (%d 階) - %d 体の%sを倒す。(あと %d 体)\n",
                                                        quest[i].name, (int)quest[i].level,
-                                                       quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
+                                                       (MONSTER_NUMBER)quest[i].max_num, name, (MONSTER_NUMBER)(quest[i].max_num - quest[i].cur_num));
 #else
                                                plural_aux(name);
 
                                                sprintf(rand_tmp_str,"  %s (Dungeon level: %d)\n  Kill %d %s, have killed %d.\n",
                                                        quest[i].name, (idx)quest[i].level,
-                                                       quest[i].max_num, name, quest[i].cur_num);
+                                                       (MONSTER_NUMBER)quest[i].max_num, name, (MONSTER_NUMBER)quest[i].cur_num);
 #endif
                                        }
                                        else
index 1264072..60a538e 100644 (file)
@@ -2210,7 +2210,7 @@ static void do_name_pet(void)
  */
 void do_cmd_pet(void)
 {
-       SPELL_IDX i = 0;
+       COMMAND_CODE i = 0;
        int                     num;
        int                     powers[36];
        cptr                    power_desc[36];
index 524b881..1aabba8 100644 (file)
@@ -1041,7 +1041,7 @@ extern bool object_similar(object_type *o_ptr, object_type *j_ptr);
 extern void object_absorb(object_type *o_ptr, object_type *j_ptr);
 extern IDX lookup_kind(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval);
 extern void object_wipe(object_type *o_ptr);
-extern void object_prep(object_type *o_ptr, OBJECT_IDX k_idx);
+extern void object_prep(object_type *o_ptr, KIND_OBJECT_IDX k_idx);
 extern void object_copy(object_type *o_ptr, object_type *j_ptr);
 extern void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode);
 extern bool make_object(object_type *j_ptr, BIT_FLAGS mode);
@@ -1592,10 +1592,10 @@ extern void hissatsu_info(char *p, int power);
 extern void do_cmd_hissatsu(void);
 extern void do_cmd_hissatsu_browse(void);
 extern void do_cmd_gain_hissatsu(void);
-extern s16b mult_hissatsu(int mult, u32b *flgs, monster_type *m_ptr, int mode);
+extern MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_ptr, int mode);
 
 /* mutation.c */
-extern int count_bits(u32b x);
+extern int count_bits(BIT_FLAGS x);
 extern bool gain_random_mutation(int choose_mut);
 extern bool lose_mutation(int choose_mut);
 extern void dump_mutations(FILE *OutFile);
index 8bc4dff..b68dfee 100644 (file)
@@ -158,7 +158,8 @@ typedef byte RARITY;    /*!< ゲーム中の希少度の型定義 */
 
 typedef s32b GAME_TURN;     /*!< ゲーム中のターンの型定義 */
 
-typedef s16b PERCENTAGE;     /*!< ゲーム中のパーセント表記の型定義 */
+typedef s16b PERCENTAGE;    /*!< ゲーム中のパーセント表記の型定義 */
+typedef s16b MULTIPLY;      /*!< ゲーム中の倍率の型定義(/10倍) */
 
 typedef u32b BIT_FLAGS;     /*!< 32ビットのフラグ配列の型定義 */
 typedef u16b BIT_FLAGS16;   /*!< 16ビットのフラグ配列の型定義 */
index 3421e76..6626efd 100644 (file)
@@ -496,7 +496,7 @@ void do_cmd_gain_hissatsu(void)
  * @param mode 剣術のスレイ型ID
  * @return スレイの倍率(/10倍)
  */
-s16b mult_hissatsu(int mult, u32b *flgs, monster_type *m_ptr, int mode)
+MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_ptr, int mode)
 {
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
index 6f7f527..ce14046 100644 (file)
@@ -3451,7 +3451,7 @@ errr parse_d_info(char *buf, header *head)
                        if (1 == sscanf(s, "FINAL_ARTIFACT_%d", &artif))
                        {
                                /* Extract a "Final Artifact" */
-                               d_ptr->final_artifact = artif;
+                               d_ptr->final_artifact = (ARTIFACT_IDX)artif;
 
                                /* Start at next entry */
                                s = t;
@@ -3464,7 +3464,7 @@ errr parse_d_info(char *buf, header *head)
                        if (1 == sscanf(s, "FINAL_OBJECT_%d", &artif))
                        {
                                /* Extract a "Final Artifact" */
-                               d_ptr->final_object = artif;
+                               d_ptr->final_object = (KIND_OBJECT_IDX)artif;
 
                                /* Start at next entry */
                                s = t;
@@ -3477,7 +3477,7 @@ errr parse_d_info(char *buf, header *head)
                        if (1 == sscanf(s, "FINAL_GUARDIAN_%d", &monst))
                        {
                                /* Extract a "Artifact Guardian" */
-                               d_ptr->final_guardian = monst;
+                               d_ptr->final_guardian = (MONRACE_IDX)monst;
 
                                /* Start at next entry */
                                s = t;
index 65d7f2f..484b994 100644 (file)
@@ -3861,7 +3861,7 @@ bool alloc_horde(POSITION y, POSITION x)
  */
 bool alloc_guardian(bool def_val)
 {
-       int guardian = d_info[dungeon_type].final_guardian;
+       MONRACE_IDX guardian = d_info[dungeon_type].final_guardian;
 
        if (guardian && (d_info[dungeon_type].maxdepth == dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
        {
index 42e1c83..54694ea 100644 (file)
@@ -2010,7 +2010,7 @@ void do_cmd_knowledge_mutations(void)
  * @param x ビット数を調べたい変数
  * @return ビット数
  */
-int count_bits(u32b x)
+int count_bits(BIT_FLAGS x)
 {
        int n = 0;
 
index 5e6fa91..2bb56d1 100644 (file)
@@ -1933,7 +1933,7 @@ void object_copy(object_type *o_ptr, object_type *j_ptr)
  * @param k_idx 新たに作成したいベースアイテム情報のID
  * @return なし
  */
-void object_prep(object_type *o_ptr, OBJECT_IDX k_idx)
+void object_prep(object_type *o_ptr, KIND_OBJECT_IDX k_idx)
 {
        object_kind *k_ptr = &k_info[k_idx];
 
index 8f8042f..c32b0d3 100644 (file)
@@ -1634,9 +1634,9 @@ struct dungeon_info_type {
        BIT_FLAGS m_a_ability_flags4;
 
        char r_char[5];         /* Monster race allowed */
-       int final_object;       /* The object you'll find at the bottom */
-       int final_artifact;     /* The artifact you'll find at the bottom */
-       int final_guardian;     /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
+       KIND_OBJECT_IDX final_object;   /* The object you'll find at the bottom */
+       ARTIFACT_IDX final_artifact;    /* The artifact you'll find at the bottom */
+       MONRACE_IDX final_guardian;     /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
 
        byte special_div;       /* % of monsters affected by the flags/races allowed, to add some variety */
        int tunnel_percent;