OSDN Git Service

[Refactor] #2680 ダンジョンのストリーム (川や溶岩の流れ) に関する定数が各1箇所からしか参照されていなかったので、floor-streams...
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 29 Oct 2022 16:04:08 +0000 (01:04 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Wed, 2 Nov 2022 15:26:14 +0000 (00:26 +0900)
src/floor/cave-generator.cpp
src/floor/floor-streams.cpp
src/system/gamevalue.h

index 92be74b..41ace4f 100644 (file)
@@ -83,7 +83,8 @@ static void place_cave_contents(PlayerType *player_ptr, dun_data_type *dd_ptr, d
 {
     auto *floor_ptr = player_ptr->current_floor_ptr;
     if (floor_ptr->dun_level == 1) {
-        while (one_in_(DUN_MOS_DEN)) {
+        constexpr auto density_moss = 2;
+        while (one_in_(density_moss)) {
             place_trees(player_ptr, randint1(floor_ptr->width - 2), randint1(floor_ptr->height - 2));
         }
     }
index f90fc22..9a2485a 100644 (file)
@@ -96,7 +96,8 @@ static void recursive_river(FloorType *floor_ptr, POSITION x1, POSITION y1, POSI
         recursive_river(floor_ptr, x1 + dx + changex, y1 + dy + changey, x2, y2, feat1, feat2, width);
 
         /* Split the river some of the time - junctions look cool */
-        if (one_in_(DUN_WAT_CHG) && (width > 0)) {
+        constexpr auto chance_river_junction = 50;
+        if (one_in_(chance_river_junction) && (width > 0)) {
             recursive_river(floor_ptr, x1 + dx + changex, y1 + dy + changey, x1 + 8 * (dx + changex), y1 + 8 * (dy + changey), feat1, feat2, width - 1);
         }
     } else {
@@ -255,7 +256,8 @@ void add_river(FloorType *floor_ptr, dun_data_type *dd_ptr)
     }
     }
 
-    wid = randint1(DUN_WAT_RNG);
+    constexpr auto width_rivers = 2;
+    wid = randint1(width_rivers);
     recursive_river(floor_ptr, x1, y1, x2, y2, feat1, feat2, wid);
 
     /* Hack - Save the location as a "room" */
index cf4e13e..bfbf071 100644 (file)
 
 #define MAX_VAMPIRIC_DRAIN 50 /*!< 吸血処理の最大回復HP */
 
-#define DUN_MOS_DEN 2 /* Density of moss streamers */
-#define DUN_MOS_RNG 10 /* Width of moss streamers */
-#define DUN_STR_MOS 2 /* Number of moss streamers */
-#define DUN_WAT_DEN 15 /* Density of rivers */
-#define DUN_WAT_RNG 2 /* Width of rivers */
-#define DUN_STR_WAT 3 /* Max number of rivers */
-#define DUN_WAT_CHG 50 /* 1 in 50 chance of junction in river */
-
 /* Chance of using syllables to form the name instead of the "template" files */
 #define SINDARIN_NAME 10 /*!< ランダムアーティファクトにシンダリン銘をつける確率 */
 #define TABLE_NAME 20 /*!< ランダムアーティファクトに漢字銘をつける確率(正確には TABLE_NAME - SINDARIN_NAME %)となる */