OSDN Git Service

*FLOOR*等の特殊タグの参照にFEATすら使わなくていいように, 変換が必要な
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 27 Nov 2003 16:58:02 +0000 (16:58 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 27 Nov 2003 16:58:02 +0000 (16:58 +0000)
フラグCONVERTとpower値を与えた. f_info中の番号がずれても, 処理内容は
powerで分岐する.

lib/edit/f_info.txt
src/cave.c
src/defines.h
src/init1.c

index b5dfbf9..3e3c449 100644 (file)
@@ -1392,24 +1392,31 @@ F:GLOW | BLDG
 
 N:160:*FLOOR*
 M:FLOOR
+F:POWER_0 | CONVERT
 
 N:161:*WALL*
 M:GRANITE
+F:POWER_1 | CONVERT
 
 N:162:*INNER*
 M:GRANITE
+F:POWER_2 | CONVERT
 
 N:163:*OUTER*
 M:GRANITE
+F:POWER_3 | CONVERT
 
 N:164:*SOLID*
 M:GRANITE
+F:POWER_4 | CONVERT
 
 N:165:*STREAM1*
 M:MAGMA_VEIN
+F:POWER_5 | CONVERT
 
 N:166:*STREAM2*
 M:QUARTZ_VEIN
+F:POWER_6 | CONVERT
 
 N:192:TOWN
 J:³¹
index 640752c..bef0f8a 100644 (file)
@@ -4466,25 +4466,31 @@ void cave_set_feat(int y, int x, int feat)
 
 int conv_dungeon_feat(int newfeat)
 {
-       switch (newfeat)
+       feature_type *f_ptr = &f_info[newfeat];
+
+       if (have_flag(f_ptr->flags, FF_CONVERT))
        {
-       case FEAT_CONVERT_FLOOR:
-               return floor_type[randint0(100)];
-       case FEAT_CONVERT_WALL:
-               return fill_type[randint0(100)];
-       case FEAT_CONVERT_INNER:
-               return feat_wall_inner;
-       case FEAT_CONVERT_OUTER:
-               return feat_wall_outer;
-       case FEAT_CONVERT_SOLID:
-               return feat_wall_solid;
-       case FEAT_CONVERT_STREAM1:
-               return d_info[dungeon_type].stream1;
-       case FEAT_CONVERT_STREAM2:
-               return d_info[dungeon_type].stream2;
-       default:
-               return newfeat;
+               switch (f_ptr->power)
+               {
+               case CONVERT_TYPE_FLOOR:
+                       return floor_type[randint0(100)];
+               case CONVERT_TYPE_WALL:
+                       return fill_type[randint0(100)];
+               case CONVERT_TYPE_INNER:
+                       return feat_wall_inner;
+               case CONVERT_TYPE_OUTER:
+                       return feat_wall_outer;
+               case CONVERT_TYPE_SOLID:
+                       return feat_wall_solid;
+               case CONVERT_TYPE_STREAM1:
+                       return d_info[dungeon_type].stream1;
+               case CONVERT_TYPE_STREAM2:
+                       return d_info[dungeon_type].stream2;
+               default:
+                       return newfeat;
+               }
        }
+       else return newfeat;
 }
 
 
index 61ccc59..2ddac84 100644 (file)
 #define FF_MIRROR        108
 #define FF_UNPERM        109
 #define FF_TELEPORTABLE  110
+#define FF_CONVERT       111
 
-#define FF_FLAG_MAX      111
+#define FF_FLAG_MAX      112
 #define FF_FLAG_SIZE     (1 + ((FF_FLAG_MAX - 1) / 32))
 
 /* Which features are dynamic */
 #define PATTERN_TILE_WRECKED  8
 
 
+/* Type of conversions */
+#define CONVERT_TYPE_FLOOR   0
+#define CONVERT_TYPE_WALL    1
+#define CONVERT_TYPE_INNER   2
+#define CONVERT_TYPE_OUTER   3
+#define CONVERT_TYPE_SOLID   4
+#define CONVERT_TYPE_STREAM1 5
+#define CONVERT_TYPE_STREAM2 6
+
+
 /*
  * Bit flags for the *_can_enter() and monster_can_cross_terrain()
  */
index bb31139..e0540b8 100644 (file)
@@ -246,6 +246,7 @@ static cptr f_info_flags[] =
        "MIRROR",
        "UNPERM",
        "TELEPORTABLE",
+       "CONVERT",
 };