OSDN Git Service

ダンジョンの外周の永久岩の見た目がダンジョン依存になるように変更.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 24 May 2003 14:35:25 +0000 (14:35 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 24 May 2003 14:35:25 +0000 (14:35 +0000)
ToME と TOband を参考に実装した.
* 判定マクロ, 及び進めない場合のメッセージは TOband のものを使った.
* カオス魔法 "虚無招来" で, 床に見える外壁は壁に数えない.

src/cmd1.c
src/cmd2.c
src/defines.h
src/generate.c
src/mutation.c
src/spells3.c
src/streams.c

index 58cbb74..1465c3d 100644 (file)
@@ -3980,13 +3980,23 @@ msg_format("%s
                                lite_spot(y, x);
                        }
 
+                       /* Boundary floor mimic */
+                       else if (boundary_floor_grid(c_ptr))
+                       {
+#ifdef JP
+                               msg_print("¤½¤ì°Ê¾åÀè¤Ë¤Ï¿Ê¤á¤Ê¤¤¤è¤¦¤À¡£");
+#else
+                               msg_print("You feel you cannot go any more.");
+#endif
+                       }
+
                        /* Wall (or secret door) */
                        else
                        {
 #ifdef JP
-                               msg_print("Êɤ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
+                               msg_format("%s¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£", (feat == FEAT_TREES) ? "ÌÚ" : "ÊÉ");
 #else
-                               msg_print("You feel a wall blocking your way.");
+                               msg_format("You feel a %s blocking your way.", (feat == FEAT_TREES) ? "tree" : "wall");
 #endif
 
                                c_ptr->info |= (CAVE_MARK);
@@ -4006,7 +4016,6 @@ msg_format("%s
                                msg_print("There is rubble blocking your way.");
 #endif
 
-
                                if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
                                        energy_use = 0;
 
@@ -4031,6 +4040,18 @@ msg_format("%s
                                msg_print("There is a closed door blocking your way.");
 #endif
 
+                               if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
+                                       energy_use = 0;
+                       }
+
+                       /* Boundary floor mimic */
+                       else if (boundary_floor_grid(c_ptr))
+                       {
+#ifdef JP
+                               msg_print("¤½¤ì°Ê¾åÀè¤Ë¤Ï¿Ê¤á¤Ê¤¤¡£");
+#else
+                               msg_print("You cannot go any more.");
+#endif
 
                                if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
                                        energy_use = 0;
@@ -4040,19 +4061,18 @@ msg_format("%s
                        else
                        {
 #ifdef JP
-                               msg_print("Êɤ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
+                               msg_format("%s¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£", (feat == FEAT_TREES) ? "ÌÚ" : "ÊÉ");
 #else
-                               msg_print("There is a wall blocking your way.");
+                               msg_format("There is a %s blocking your way.", (feat == FEAT_TREES) ? "tree" : "wall");
 #endif
 
-
                                if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
                                        energy_use = 0;
                        }
                }
 
                /* Sound */
-               sound(SOUND_HITWALL);
+               if (!boundary_floor_grid(c_ptr)) sound(SOUND_HITWALL);
        }
 
        /* Normal movement */
index 2e6f317..875d08a 100644 (file)
@@ -1545,17 +1545,6 @@ static bool do_cmd_tunnel_aux(int y, int x)
 
        }
 
-       /* No tunnelling through mountains */
-       else if (feat == FEAT_MOUNTAIN)
-       {
-#ifdef JP
-               msg_print("¤½¤³¤Ï·¡¤ì¤Ê¤¤!");
-#else
-               msg_print("You can't tunnel through that!");
-#endif
-
-       }
-
        /* Map border (mimiccing Permanent wall) */
        else if ((c_ptr->feat >= FEAT_PERM_EXTRA &&
                  c_ptr->feat <= FEAT_PERM_SOLID) ||
index fc0f832..353c0db 100644 (file)
 #define player_has_los_bold(Y,X) \
     (((cave[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
 
+/*
+ * Determine if a "boundary" grid is "floor mimic"
+ */
+#define boundary_floor_bold(Y,X) \
+    ((cave[(Y)][(X)].feat == FEAT_PERM_SOLID) && \
+      cave[(Y)][(X)].mimic && \
+    !(cave[(Y)][(X)].mimic & 0x20))
+
+#define boundary_floor_grid(C) \
+    (((C)->feat == FEAT_PERM_SOLID) && \
+      (C)->mimic && \
+    !((C)->mimic & 0x20))
 
 #define update_playtime() \
 {\
index 86e4c46..90b4cad 100644 (file)
@@ -547,6 +547,10 @@ msg_print("
                }
        }
 
+       /* Hack -- boundary walls and mimics are set later */
+       for (y = 0; y < cur_hgt; y++) cave[y][0].feat = cave[y][cur_wid - 1].feat = FEAT_NONE;
+       for (x = 0; x < cur_wid; x++) cave[0][x].feat = cave[cur_hgt - 1][x].feat = FEAT_NONE;
+
 #ifdef ALLOW_CAVERNS_AND_LAKES
        /* Possible "destroyed" level */
        if ((dun_level > 30) && one_in_(DUN_DEST*2) && (small_levels) && (d_info[dungeon_type].flags1 & DF1_DESTROY))
@@ -833,43 +837,35 @@ if (cheat_room) msg_print("
        }
        }
 
-       /* Special boundary walls -- Top */
+       /* Special boundary walls -- Top and bottom */
        for (x = 0; x < cur_wid; x++)
        {
-               cave_type *c_ptr = &cave[0][x];
+               cave_type *c_ptr = &cave[0][x]; /* Top */
 
-               /* Clear previous contents, add "solid" perma-wall */
-               c_ptr->feat = FEAT_PERM_SOLID;
+               /* Clear previous contents */
+               if (c_ptr->feat == FEAT_NONE) c_ptr->feat = fill_type[randint0(100)];
                c_ptr->info &= ~(CAVE_MASK);
-       }
 
-       /* Special boundary walls -- Bottom */
-       for (x = 0; x < cur_wid; x++)
-       {
-               cave_type *c_ptr = &cave[cur_hgt-1][x];
+               c_ptr = &cave[cur_hgt - 1][x]; /* Bottom */
 
-               /* Clear previous contents, add "solid" perma-wall */
-               c_ptr->feat = FEAT_PERM_SOLID;
+               /* Clear previous contents */
+               if (c_ptr->feat == FEAT_NONE) c_ptr->feat = fill_type[randint0(100)];
                c_ptr->info &= ~(CAVE_MASK);
        }
 
-       /* Special boundary walls -- Left */
-       for (y = 0; y < cur_hgt; y++)
+       /* Special boundary walls -- Left and right */
+       for (y = 1; y < (cur_hgt - 1); y++)
        {
-               cave_type *c_ptr = &cave[y][0];
+               cave_type *c_ptr = &cave[y][0]; /* Left */
 
-               /* Clear previous contents, add "solid" perma-wall */
-               c_ptr->feat = FEAT_PERM_SOLID;
+               /* Clear previous contents */
+               if (c_ptr->feat == FEAT_NONE) c_ptr->feat = fill_type[randint0(100)];
                c_ptr->info &= ~(CAVE_MASK);
-       }
 
-       /* Special boundary walls -- Right */
-       for (y = 0; y < cur_hgt; y++)
-       {
-               cave_type *c_ptr = &cave[y][cur_wid-1];
+               c_ptr = &cave[y][cur_wid - 1]; /* Right */
 
-               /* Clear previous contents, add "solid" perma-wall */
-               c_ptr->feat = FEAT_PERM_SOLID;
+               /* Clear previous contents */
+               if (c_ptr->feat == FEAT_NONE) c_ptr->feat = fill_type[randint0(100)];
                c_ptr->info &= ~(CAVE_MASK);
        }
 
@@ -1019,6 +1015,38 @@ if (cheat_room) msg_print("
                }
        }
 
+       /* Special boundary walls -- Top and bottom */
+       for (x = 0; x < cur_wid; x++)
+       {
+               cave_type *c_ptr = &cave[0][x];
+
+               /* Set boundary mimic and add "solid" perma-wall */
+               c_ptr->mimic = f_info[c_ptr->feat].mimic;
+               c_ptr->feat = FEAT_PERM_SOLID;
+
+               c_ptr = &cave[cur_hgt - 1][x];
+
+               /* Set boundary mimic and add "solid" perma-wall */
+               c_ptr->mimic = f_info[c_ptr->feat].mimic;
+               c_ptr->feat = FEAT_PERM_SOLID;
+       }
+
+       /* Special boundary walls -- Left and right */
+       for (y = 1; y < (cur_hgt - 1); y++)
+       {
+               cave_type *c_ptr = &cave[y][0];
+
+               /* Set boundary mimic and add "solid" perma-wall */
+               c_ptr->mimic = f_info[c_ptr->feat].mimic;
+               c_ptr->feat = FEAT_PERM_SOLID;
+
+               c_ptr = &cave[y][cur_wid - 1];
+
+               /* Set boundary mimic and add "solid" perma-wall */
+               c_ptr->mimic = f_info[c_ptr->feat].mimic;
+               c_ptr->feat = FEAT_PERM_SOLID;
+       }
+
        /* Determine the character location */
        if (!new_player_spot()) return FALSE;
 
index d54e820..1426f61 100644 (file)
@@ -3464,7 +3464,7 @@ bool mutation_power_aux(u32b power)
                                y = py + ddy[dir];
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
-                               if (cave_floor_bold(y, x))
+                               if (cave_floor_bold(y, x) || boundary_floor_grid(c_ptr))
                                {
 #ifdef JP
                                        msg_print("²¿¤â¤Ê¤¤¾ì½ê¤Ë³ú¤ß¤Ä¤¤¤¿¡ª");
@@ -3479,9 +3479,9 @@ bool mutation_power_aux(u32b power)
                                        (c_ptr->feat == FEAT_MOUNTAIN))
                                {
 #ifdef JP
-                                       msg_print("¤¤¤Æ¤Ã¡ª¤³¤ÎÊɤϤ¢¤Ê¤¿¤Î»õ¤è¤ê¹Å¤¤¡ª");
+                                       msg_format("¤¤¤Æ¤Ã¡ª¤³¤Î%s¤Ï¤¢¤Ê¤¿¤Î»õ¤è¤ê¹Å¤¤¡ª", (c_ptr->mimic == FEAT_TREES) ? "ÌÚ" : "ÊÉ");
 #else
-                                       msg_print("Ouch!  This wall is harder than your teeth!");
+                                       msg_format("Ouch!  This %s is harder than your teeth!", (c_ptr->mimic == FEAT_TREES) ? "tree" : "wall");
 #endif
 
                                        break;
index 344f759..a4e5884 100644 (file)
@@ -1421,37 +1421,44 @@ msg_print("°
 void call_the_(void)
 {
        int i;
+       int y, x;
+       bool do_call = TRUE;
 
-       if (cave_floor_bold(py - 1, px - 1) &&
-           cave_floor_bold(py - 1, px    ) &&
-           cave_floor_bold(py - 1, px + 1) &&
-           cave_floor_bold(py    , px - 1) &&
-           cave_floor_bold(py    , px + 1) &&
-           cave_floor_bold(py + 1, px - 1) &&
-           cave_floor_bold(py + 1, px    ) &&
-           cave_floor_bold(py + 1, px + 1))
+       for (i = 0; i < 9; i++)
+       {
+               y = py + ddy_ddd[i];
+               x = px + ddx_ddd[i];
+
+               if (!cave_floor_bold(y, x) && !boundary_floor_bold(y, x))
+               {
+                       do_call = FALSE;
+                       break;
+               }
+       }
+
+       if (do_call)
        {
                for (i = 1; i < 10; i++)
                {
-                       if (i-5) fire_ball(GF_ROCKET, i, 175, 2);
+                       if (i - 5) fire_ball(GF_ROCKET, i, 175, 2);
                }
 
                for (i = 1; i < 10; i++)
                {
-                       if (i-5) fire_ball(GF_MANA, i, 175, 3);
+                       if (i - 5) fire_ball(GF_MANA, i, 175, 3);
                }
 
                for (i = 1; i < 10; i++)
                {
-                       if (i-5) fire_ball(GF_NUKE, i, 175, 4);
+                       if (i - 5) fire_ball(GF_NUKE, i, 175, 4);
                }
        }
        else
        {
 #ifdef JP
-msg_format("¤¢¤Ê¤¿¤Ï%s¤òÊɤ˶᤹¤®¤ë¾ì½ê¤Ç¾§¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª",
-((mp_ptr->spell_book == TV_LIFE_BOOK) ? "µ§¤ê" : "¼öʸ"));
-msg_print("Â礭¤ÊÇúȯ²»¤¬¤¢¤Ã¤¿¡ª");
+               msg_format("¤¢¤Ê¤¿¤Ï%s¤òÊɤ˶᤹¤®¤ë¾ì½ê¤Ç¾§¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª",
+                       ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "µ§¤ê" : "¼öʸ"));
+               msg_print("Â礭¤ÊÇúȯ²»¤¬¤¢¤Ã¤¿¡ª");
 #else
                msg_format("You %s the %s too close to a wall!",
                        ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "recite" : "cast"),
@@ -1462,21 +1469,21 @@ msg_print("
 
                if (destroy_area(py, px, 15 + p_ptr->lev + randint0(11)))
 #ifdef JP
-msg_print("¥À¥ó¥¸¥ç¥ó¤¬Êø²õ¤·¤¿...");
+                       msg_print("¥À¥ó¥¸¥ç¥ó¤¬Êø²õ¤·¤¿...");
 #else
                        msg_print("The dungeon collapses...");
 #endif
 
                else
 #ifdef JP
-msg_print("¥À¥ó¥¸¥ç¥ó¤ÏÂ礭¤¯Íɤ줿¡£");
+                       msg_print("¥À¥ó¥¸¥ç¥ó¤ÏÂ礭¤¯Íɤ줿¡£");
 #else
                        msg_print("The dungeon trembles.");
 #endif
 
 
 #ifdef JP
-take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), "¼«»¦Åª¤Êµõ̵¾·Íè", -1);
+               take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), "¼«»¦Åª¤Êµõ̵¾·Íè", -1);
 #else
                take_hit(DAMAGE_NOESCAPE, 100 + randint1(150), "a suicidal Call the Void", -1);
 #endif
index 2915353..58fd95e 100644 (file)
@@ -95,7 +95,7 @@ static void recursive_river(int x1, int y1, int x2, int y2, int feat1, int feat2
                                {
                                        for (tx = x - width - 1; tx <= x + width + 1; tx++)
                                        {
-                                               if (!in_bounds(ty, tx)) continue;
+                                               if (!in_bounds2(ty, tx)) continue;
 
                                                c_ptr = &cave[ty][tx];
 
@@ -236,7 +236,7 @@ void build_streamer(int feat, int chance)
                        {
                                ty = rand_spread(y, d);
                                tx = rand_spread(x, d);
-                               if (!in_bounds(ty, tx)) continue;
+                               if (!in_bounds2(ty, tx)) continue;
                                break;
                        }