OSDN Git Service

地形の名前を表示する部分でmimicを無視した表示をしてしまい, 本当の地形
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 26 Nov 2003 17:30:41 +0000 (17:30 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 26 Nov 2003 17:30:41 +0000 (17:30 +0000)
が分かっていたバグを修正. なお, 以下の修正を含む.
* do_cmd_tunnel_aux()でmimic_featが0になることはないので削除.

src/cmd1.c
src/cmd2.c
src/cmd5.c
src/dungeon.c
src/spells1.c

index cf89987..ba24817 100644 (file)
@@ -3677,7 +3677,7 @@ void move_player(int dir, int do_pickup, bool break_trap)
                        (have_flag(f_ptr->flags, FF_DEEP) || (riding_r_ptr->flags2 & RF2_AURA_FIRE)))
                {
 #ifdef JP
-                       msg_format("%s¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£", f_name + f_ptr->name);
+                       msg_format("%s¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #else
                        msg_print("Can't swim.");
 #endif
@@ -3688,7 +3688,7 @@ void move_player(int dir, int do_pickup, bool break_trap)
                else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
                {
 #ifdef JP
-                       msg_format("%s¤«¤é¾å¤¬¤ì¤Ê¤¤¡£", f_name + f_info[cave[py][px].feat].name);
+                       msg_format("%s¤«¤é¾å¤¬¤ì¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(&cave[py][px])].name);
 #else
                        msg_print("Can't land.");
 #endif
@@ -3699,7 +3699,7 @@ void move_player(int dir, int do_pickup, bool break_trap)
                else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
                {
 #ifdef JP
-                       msg_format("%s¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£", f_name + f_ptr->name);
+                       msg_format("%s¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #else
                        msg_print("Too hot to go through.");
 #endif
@@ -3729,9 +3729,9 @@ void move_player(int dir, int do_pickup, bool break_trap)
        else if (!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->ffall)
        {
 #ifdef JP
-               msg_format("¶õ¤òÈô¤Ð¤Ê¤¤¤È%s¤Î¾å¤Ë¤Ï¹Ô¤±¤Ê¤¤¡£", f_name + f_ptr->name);
+               msg_format("¶õ¤òÈô¤Ð¤Ê¤¤¤È%s¤Î¾å¤Ë¤Ï¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #else
-               msg_format("You need to fly to go through the %s.", f_name + f_ptr->name);
+               msg_format("You need to fly to go through the %s.", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #endif
 
                energy_use = 0;
index 9b876bc..d668a95 100644 (file)
@@ -1085,9 +1085,9 @@ static bool do_cmd_open_aux(int y, int x)
        {
                /* Stuck */
 #ifdef JP
-               msg_print("¥É¥¢¤Ï¤¬¤Ã¤Á¤ê¤ÈÊĤ¸¤é¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
+               msg_format("%s¤Ï¤¬¤Ã¤Á¤ê¤ÈÊĤ¸¤é¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #else
-               msg_print("The door appears to be stuck.");
+               msg_format("The %s appears to be stuck.", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #endif
 
        }
@@ -1512,7 +1512,6 @@ static bool do_cmd_tunnel_test(int y, int x)
 static bool do_cmd_tunnel_aux(int y, int x)
 {
        cave_type *c_ptr;
-       s16b mimic_feat;
        feature_type *f_ptr, *mimic_f_ptr;
        int power;
        cptr name;
@@ -1530,8 +1529,7 @@ static bool do_cmd_tunnel_aux(int y, int x)
        power = f_ptr->power;
 
        /* Feature code (applying "mimic" field) */
-       mimic_feat = get_feat_mimic(c_ptr);
-       mimic_f_ptr = &f_info[mimic_feat];
+       mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
 
        name = f_name + mimic_f_ptr->name;
 
@@ -1541,7 +1539,7 @@ static bool do_cmd_tunnel_aux(int y, int x)
        if (have_flag(f_ptr->flags, FF_PERMANENT))
        {
                /* Titanium */
-               if (!mimic_feat || have_flag(mimic_f_ptr->flags, FF_PERMANENT))
+               if (have_flag(mimic_f_ptr->flags, FF_PERMANENT))
                {
 #ifdef JP
                        msg_print("¤³¤Î´ä¤Ï¹Å¤¹¤®¤Æ·¡¤ì¤Ê¤¤¤è¤¦¤À¡£");
@@ -1789,9 +1787,9 @@ bool easy_open_door(int y, int x)
        {
                /* Stuck */
 #ifdef JP
-               msg_print("¥É¥¢¤Ï¤¬¤Ã¤Á¤ê¤ÈÊĤ¸¤é¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£");
+               msg_format("%s¤Ï¤¬¤Ã¤Á¤ê¤ÈÊĤ¸¤é¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #else
-               msg_print("The door appears to be stuck.");
+               msg_format("The %s appears to be stuck.", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #endif
 
        }
@@ -2244,25 +2242,26 @@ static bool do_cmd_bash_aux(int y, int x, int dir)
 {
        /* Get grid */
        cave_type       *c_ptr = &cave[y][x];
-       feature_type *f_ptr = &f_info[c_ptr->feat];
 
        /* Hack -- Bash power based on strength */
        /* (Ranges from 3 to 20 to 100 to 200) */
        int bash = adj_str_blow[p_ptr->stat_ind[A_STR]];
 
        /* Extract door power */
-       int temp = f_ptr->power;
+       int temp = f_info[c_ptr->feat].power;
 
        bool            more = FALSE;
 
+       cptr name = f_name + f_info[get_feat_mimic(c_ptr)].name;
+
        /* Take a turn */
        energy_use = 100;
 
        /* Message */
 #ifdef JP
-       msg_print("¥É¥¢¤ËÂÎÅö¤¿¤ê¤ò¤·¤¿¡ª");
+       msg_format("%s¤ËÂÎÅö¤¿¤ê¤ò¤·¤¿¡ª", name);
 #else
-       msg_print("You smash into the door!");
+       msg_format("You smash into the %s!", name);
 #endif
 
        /* Compare bash power to door power XXX XXX XXX */
@@ -2278,9 +2277,9 @@ static bool do_cmd_bash_aux(int y, int x, int dir)
        {
                /* Message */
 #ifdef JP
-               msg_format("%s¤ò²õ¤·¤¿¡ª", f_name + f_ptr->name);
+               msg_format("%s¤ò²õ¤·¤¿¡ª", name);
 #else
-               msg_format("The %s crashes open!", f_name + f_ptr->name);
+               msg_format("The %s crashes open!", name);
 #endif
 
 
@@ -2313,9 +2312,9 @@ static bool do_cmd_bash_aux(int y, int x, int dir)
        {
                /* Message */
 #ifdef JP
-               msg_print("¤³¤Î¥É¥¢¤Ï´è¾æ¤À¡£");
+               msg_format("¤³¤Î%s¤Ï´è¾æ¤À¡£", name);
 #else
-               msg_print("The door holds firm.");
+               msg_format("The %s holds firm.", name);
 #endif
 
 
@@ -2666,9 +2665,9 @@ void do_cmd_spike(void)
 
                        /* Successful jamming */
 #ifdef JP
-                       msg_print("¥É¥¢¤Ë¤¯¤µ¤Ó¤òÂǤÁ¹þ¤ó¤À¡£");
+                       msg_format("%s¤Ë¤¯¤µ¤Ó¤òÂǤÁ¹þ¤ó¤À¡£", f_name + f_info[feat].name);
 #else
-                       msg_print("You jam the door with a spike.");
+                       msg_format("You jam the %s with a spike.", f_name + f_info[feat].name);
 #endif
 
                        cave_alter_feat(y, x, FF_SPIKE);
index 33fbe20..3a0e1cb 100644 (file)
@@ -5704,7 +5704,8 @@ bool do_riding(bool force)
 
                if (!player_can_ride_aux(c_ptr, TRUE))
                {
-                       feature_type *f_ptr = &f_info[c_ptr->feat];
+                       /* Feature code (applying "mimic" field) */
+                       feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
 #ifdef JP
                        msg_format("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï%s¤Î%s¤Ë¤¤¤ë¡£", f_name + f_ptr->name,
                                   (!have_flag(f_ptr->flags, FF_MOVE) ||
index e92586d..d5f7c10 100644 (file)
@@ -2339,20 +2339,21 @@ sprintf(ouch, "%s
                        {
 #ifdef JP
                                msg_print("Ç®¤Ç²Ð½ý¤·¤¿¡ª");
-                               take_hit(DAMAGE_NOESCAPE, damage, format("%s¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸", f_name + f_ptr->name), -1);
+                               take_hit(DAMAGE_NOESCAPE, damage, format("%s¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸", f_name + f_info[get_feat_mimic(&cave[py][px])].name), -1);
 #else
                                msg_print("The heat burns you!");
-                               take_hit(DAMAGE_NOESCAPE, damage, format("flying over %s", f_name + f_ptr->name), -1);
+                               take_hit(DAMAGE_NOESCAPE, damage, format("flying over %s", f_name + f_info[get_feat_mimic(&cave[py][px])].name), -1);
 #endif
                        }
                        else
                        {
+                               cptr name = f_name + f_info[get_feat_mimic(&cave[py][px])].name;
 #ifdef JP
-                               msg_format("%s¤Ç²Ð½ý¤·¤¿¡ª", f_name + f_ptr->name);
+                               msg_format("%s¤Ç²Ð½ý¤·¤¿¡ª", name);
 #else
-                               msg_format("The %s burns you!", f_name + f_ptr->name);
+                               msg_format("The %s burns you!", name);
 #endif
-                               take_hit(DAMAGE_NOESCAPE, damage, f_name + f_ptr->name, -1);
+                               take_hit(DAMAGE_NOESCAPE, damage, name, -1);
                        }
 
                        cave_no_regen = TRUE;
index 80c51dd..dd96ed1 100644 (file)
@@ -827,6 +827,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                        if (have_flag(f_ptr->flags, FF_SPIKE))
                        {
                                s16b old_mimic = c_ptr->mimic;
+                               feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
 
                                cave_alter_feat(y, x, FF_SPIKE);
 
@@ -839,13 +840,13 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                                lite_spot(y, x);
 
                                /* Check line of sight */
-                               if (known && !c_ptr->mimic)
+                               if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
                                {
                                        /* Message */
 #ifdef JP
-                                       msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + f_ptr->name);
+                                       msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
 #else
-                                       msg_format("The %s seems stuck.", f_name + f_ptr->name);
+                                       msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
 #endif
 
                                        obvious = TRUE;
@@ -859,15 +860,13 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                {
                        if (have_flag(f_ptr->flags, FF_HURT_ROCK))
                        {
-                               cptr name = f_name + f_ptr->name;
-
                                /* Message */
                                if (known && (c_ptr->info & (CAVE_MARK)))
                                {
 #ifdef JP
-                                       msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", name);
+                                       msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #else
-                                       msg_format("The %s turns into mud!", name);
+                                       msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
 #endif
 
                                        obvious = TRUE;