OSDN Git Service

[Refactor] #37353 メッセージ整理。 / Refactor messages.
[hengband/hengband.git] / src / monster-process.c
index 33ef7aa..d676071 100644 (file)
@@ -197,7 +197,7 @@ void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear,
 {
        monster_type *m_ptr = &m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
-       char m_name[160];
+       GAME_TEXT m_name[160];
        bool seen = is_seen(m_ptr);
 
        /* Can the player be aware of this attack? */
@@ -771,89 +771,89 @@ static bool get_fear_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
  */
 
 
-static sint d_off_y_0[] = { 0 };
-static sint d_off_x_0[] = { 0 };
+static POSITION d_off_y_0[] = { 0 };
+static POSITION d_off_x_0[] = { 0 };
 
-static sint d_off_y_1[] = { -1, -1, -1, 0, 0, 1, 1, 1, 0 };
-static sint d_off_x_1[] = { -1, 0, 1, -1, 1, -1, 0, 1, 0 };
+static POSITION d_off_y_1[] = { -1, -1, -1, 0, 0, 1, 1, 1, 0 };
+static POSITION d_off_x_1[] = { -1, 0, 1, -1, 1, -1, 0, 1, 0 };
 
-static sint d_off_y_2[] = { -1, -1, -2, -2, -2, 0, 0, 1, 1, 2, 2, 2, 0 };
-static sint d_off_x_2[] = { -2, 2, -1, 0, 1, -2, 2, -2, 2, -1, 0, 1, 0 };
+static POSITION d_off_y_2[] = { -1, -1, -2, -2, -2, 0, 0, 1, 1, 2, 2, 2, 0 };
+static POSITION d_off_x_2[] = { -2, 2, -1, 0, 1, -2, 2, -2, 2, -1, 0, 1, 0 };
 
-static sint d_off_y_3[] = { -1, -1, -2, -2, -3, -3, -3, 0, 0, 1, 1, 2, 2, 3, 3, 3, 0 };
-static sint d_off_x_3[] = { -3, 3, -2, 2, -1, 0, 1, -3, 3, -3, 3, -2, 2, -1, 0, 1, 0 };
+static POSITION d_off_y_3[] = { -1, -1, -2, -2, -3, -3, -3, 0, 0, 1, 1, 2, 2, 3, 3, 3, 0 };
+static POSITION d_off_x_3[] = { -3, 3, -2, 2, -1, 0, 1, -3, 3, -3, 3, -2, 2, -1, 0, 1, 0 };
 
-static sint d_off_y_4[] = { -1, -1, -2, -2, -3, -3, -3, -3, -4, -4, -4, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 0 };
-static sint d_off_x_4[] = { -4, 4, -3, 3, -2, -3, 2, 3, -1, 0, 1, -4, 4, -4, 4, -3, 3, -2, -3, 2, 3, -1, 0, 1, 0 };
+static POSITION d_off_y_4[] = { -1, -1, -2, -2, -3, -3, -3, -3, -4, -4, -4, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 0 };
+static POSITION d_off_x_4[] = { -4, 4, -3, 3, -2, -3, 2, 3, -1, 0, 1, -4, 4, -4, 4, -3, 3, -2, -3, 2, 3, -1, 0, 1, 0 };
 
 
-static sint d_off_y_5[] =
+static POSITION d_off_y_5[] =
 { -1, -1, -2, -2, -3, -3, -4, -4, -4, -4, -5, -5,
   -5, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5,
   5, 0 };
 
-static sint d_off_x_5[] =
+static POSITION d_off_x_5[] =
 { -5, 5, -4, 4, -4, 4, -2, -3, 2, 3, -1, 0, 1,
   -5, 5, -5, 5, -4, 4, -4, 4, -2, -3, 2, 3, -1,
   0, 1, 0 };
 
 
-static sint d_off_y_6[] =
+static POSITION d_off_y_6[] =
 { -1, -1, -2, -2, -3, -3, -4, -4, -5, -5, -5, -5,
   -6, -6, -6, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5,
   5, 5, 6, 6, 6, 0 };
 
-static sint d_off_x_6[] =
+static POSITION d_off_x_6[] =
 { -6, 6, -5, 5, -5, 5, -4, 4, -2, -3, 2, 3, -1,
   0, 1, -6, 6, -6, 6, -5, 5, -5, 5, -4, 4, -2,
   -3, 2, 3, -1, 0, 1, 0 };
 
 
-static sint d_off_y_7[] =
+static POSITION d_off_y_7[] =
 { -1, -1, -2, -2, -3, -3, -4, -4, -5, -5, -5, -5,
   -6, -6, -6, -6, -7, -7, -7, 0, 0, 1, 1, 2, 2, 3,
   3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 0 };
 
-static sint d_off_x_7[] =
+static POSITION d_off_x_7[] =
 { -7, 7, -6, 6, -6, 6, -5, 5, -4, -5, 4, 5, -2,
   -3, 2, 3, -1, 0, 1, -7, 7, -7, 7, -6, 6, -6,
   6, -5, 5, -4, -5, 4, 5, -2, -3, 2, 3, -1, 0,
   1, 0 };
 
 
-static sint d_off_y_8[] =
+static POSITION d_off_y_8[] =
 { -1, -1, -2, -2, -3, -3, -4, -4, -5, -5, -6, -6,
   -6, -6, -7, -7, -7, -7, -8, -8, -8, 0, 0, 1, 1,
   2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
   8, 8, 8, 0 };
 
-static sint d_off_x_8[] =
+static POSITION d_off_x_8[] =
 { -8, 8, -7, 7, -7, 7, -6, 6, -6, 6, -4, -5, 4,
   5, -2, -3, 2, 3, -1, 0, 1, -8, 8, -8, 8, -7,
   7, -7, 7, -6, 6, -6, 6, -4, -5, 4, 5, -2, -3,
   2, 3, -1, 0, 1, 0 };
 
 
-static sint d_off_y_9[] =
+static POSITION d_off_y_9[] =
 { -1, -1, -2, -2, -3, -3, -4, -4, -5, -5, -6, -6,
   -7, -7, -7, -7, -8, -8, -8, -8, -9, -9, -9, 0,
   0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7,
   7, 8, 8, 8, 8, 9, 9, 9, 0 };
 
-static sint d_off_x_9[] =
+static POSITION d_off_x_9[] =
 { -9, 9, -8, 8, -8, 8, -7, 7, -7, 7, -6, 6, -4,
   -5, 4, 5, -2, -3, 2, 3, -1, 0, 1, -9, 9, -9,
   9, -8, 8, -8, 8, -7, 7, -7, 7, -6, 6, -4, -5,
   4, 5, -2, -3, 2, 3, -1, 0, 1, 0 };
 
 
-static sint *dist_offsets_y[10] =
+static POSITION *dist_offsets_y[10] =
 {
        d_off_y_0, d_off_y_1, d_off_y_2, d_off_y_3, d_off_y_4,
        d_off_y_5, d_off_y_6, d_off_y_7, d_off_y_8, d_off_y_9
 };
 
-static sint *dist_offsets_x[10] =
+static POSITION *dist_offsets_x[10] =
 {
        d_off_x_0, d_off_x_1, d_off_x_2, d_off_x_3, d_off_x_4,
        d_off_x_5, d_off_x_6, d_off_x_7, d_off_x_8, d_off_x_9
@@ -887,8 +887,8 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
        POSITION y, x, dy, dx, d, dis, i;
        POSITION gy = 0, gx = 0, gdis = 0;
 
-       sint *y_offsets;
-       sint *x_offsets;
+       POSITION *y_offsets;
+       POSITION *x_offsets;
 
        cave_type *c_ptr;
 
@@ -982,7 +982,7 @@ static bool find_hiding(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
        POSITION y, x, dy, dx, d, dis, i;
        POSITION gy = 0, gx = 0, gdis = 999;
 
-       sint *y_offsets, *x_offsets;
+       POSITION *y_offsets, *x_offsets;
 
        /* Start with adjacent locations, spread further */
        for (d = 1; d < 10; d++)
@@ -1426,12 +1426,12 @@ static bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
        ARMOUR_CLASS ac;
        DEPTH rlev;
        int pt;
-       char            m_name[80], t_name[80];
+       GAME_TEXT m_name[MAX_NLEN], t_name[MAX_NLEN];
        char            temp[MAX_NLEN];
        bool            blinked;
        bool            explode = FALSE, touched = FALSE, fear = FALSE, dead = FALSE;
-       int             y_saver = t_ptr->fy;
-       int             x_saver = t_ptr->fx;
+       POSITION y_saver = t_ptr->fy;
+       POSITION x_saver = t_ptr->fx;
        int             effect_type;
 
        bool see_m = is_seen(m_ptr);
@@ -2111,7 +2111,7 @@ void process_monster(MONSTER_IDX m_idx)
 #ifdef JP
                        msg_print("地面に落とされた。");
 #else
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        monster_desc(m_name, &m_list[p_ptr->riding], 0);
                        msg_format("You have fallen from %s.", m_name);
 #endif
@@ -2142,14 +2142,14 @@ void process_monster(MONSTER_IDX m_idx)
 
                if (see_m)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        monster_desc(m_name, m_ptr, 0);
                        msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
                }
 
                if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
                        do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_LOSE_PARENT, m_name);
                }
@@ -2174,7 +2174,7 @@ void process_monster(MONSTER_IDX m_idx)
 
                        if (see_m)
                        {
-                               char m_name[80];
+                               GAME_TEXT m_name[MAX_NLEN];
                                monster_desc(m_name, m_ptr, 0);
 
                                msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
@@ -2205,7 +2205,7 @@ void process_monster(MONSTER_IDX m_idx)
 
                if (m_ptr->hp < m_ptr->maxhp/3)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        monster_desc(m_name, m_ptr, 0);
 
                        if (is_riding_mon && riding_pinch < 2)
@@ -2269,7 +2269,7 @@ void process_monster(MONSTER_IDX m_idx)
                /* Notice the "waking up" */
                if (m_ptr->ml)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        monster_desc(m_name, m_ptr, 0);
                        msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
                }
@@ -2311,7 +2311,7 @@ void process_monster(MONSTER_IDX m_idx)
        {
                if (is_pet(m_ptr) || see_m)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        monster_desc(m_name, m_ptr, is_pet(m_ptr) ? MD_ASSUME_VISIBLE : 0);
                        msg_format(_("%^sは突然敵にまわった!", "%^s suddenly becomes hostile!"), m_name);
                }
@@ -2376,7 +2376,7 @@ void process_monster(MONSTER_IDX m_idx)
 
                                        for (k = 0; k < 6; k++)
                                        {
-                                               if (summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode)))
+                                               if (summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode), '\0'))
                                                {
                                                        if (m_list[hack_m_idx_ii].ml) count++;
                                                }
@@ -2405,7 +2405,7 @@ void process_monster(MONSTER_IDX m_idx)
                    player_has_los_bold(oy, ox) &&
                    projectable(oy, ox, p_ptr->y, p_ptr->x))
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        char monmessage[1024];
                        cptr filename;
 
@@ -3066,7 +3066,7 @@ void process_monster(MONSTER_IDX m_idx)
                                for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
                                {
                                        BIT_FLAGS flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
-                                       char m_name[80], o_name[MAX_NLEN];
+                                       GAME_TEXT m_name[MAX_NLEN], o_name[MAX_NLEN];
                                        object_type *o_ptr = &o_list[this_o_idx];
 
                                        /* Acquire next object */
@@ -3125,7 +3125,6 @@ void process_monster(MONSTER_IDX m_idx)
                                                /* Only give a message for "take_item" */
                                                if (do_take && (r_ptr->flags2 & RF2_STUPID))
                                                {
-                                                       /* Take note */
                                                        did_take_item = TRUE;
 
                                                        /* Describe observable situations */
@@ -3139,7 +3138,6 @@ void process_monster(MONSTER_IDX m_idx)
                                        /* Pick up the item */
                                        else if (do_take)
                                        {
-                                               /* Take note */
                                                did_take_item = TRUE;
 
                                                /* Describe observable situations */
@@ -3170,7 +3168,6 @@ void process_monster(MONSTER_IDX m_idx)
                                        /* Destroy the item if not a pet */
                                        else if (!is_pet(m_ptr))
                                        {
-                                               /* Take note */
                                                did_kill_item = TRUE;
 
                                                /* Describe observable situations */
@@ -3257,7 +3254,7 @@ void process_monster(MONSTER_IDX m_idx)
                /* Message if seen */
                if (see_m)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        monster_desc(m_name, m_ptr, 0);
                        msg_format(_("%^sは戦いを決意した!", "%^s turns to fight!"), m_name);
                }