OSDN Git Service

[Refactor] #2680 Moved Dungeon treausre allocation values from gamevalue.h to cave...
authorHourier <66951241+Hourier@users.noreply.github.com>
Fri, 28 Oct 2022 13:21:48 +0000 (22:21 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Wed, 2 Nov 2022 15:26:13 +0000 (00:26 +0900)
src/floor/cave-generator.cpp
src/system/gamevalue.h

index 81d1b19..3c67211 100644 (file)
@@ -373,9 +373,12 @@ static bool allocate_dungeon_data(PlayerType *player_ptr, dun_data_type *dd_ptr,
         floor_ptr->object_level = 1;
     }
 
-    alloc_object(player_ptr, ALLOC_SET_ROOM, ALLOC_TYP_OBJECT, randnor(DUN_AMT_ROOM, 3));
-    alloc_object(player_ptr, ALLOC_SET_BOTH, ALLOC_TYP_OBJECT, randnor(DUN_AMT_ITEM, 3));
-    alloc_object(player_ptr, ALLOC_SET_BOTH, ALLOC_TYP_GOLD, randnor(DUN_AMT_GOLD, 3));
+    constexpr auto alloc_room = 9;
+    alloc_object(player_ptr, ALLOC_SET_ROOM, ALLOC_TYP_OBJECT, randnor(alloc_room, 3));
+    constexpr auto alloc_item = 3;
+    alloc_object(player_ptr, ALLOC_SET_BOTH, ALLOC_TYP_OBJECT, randnor(alloc_item, 3));
+    constexpr auto alloc_gold = 3;
+    alloc_object(player_ptr, ALLOC_SET_BOTH, ALLOC_TYP_GOLD, randnor(alloc_gold, 3));
     floor_ptr->object_level = floor_ptr->base_level;
     if (alloc_guardian(player_ptr, true)) {
         return true;
index 352bcb0..9b1a6e9 100644 (file)
 #define DUN_STR_WAT 3 /* Max number of rivers */
 #define DUN_WAT_CHG 50 /* 1 in 50 chance of junction in river */
 
-/*
- * Dungeon treausre allocation values
- */
-#define DUN_AMT_ROOM 9 /* Amount of objects for rooms */
-#define DUN_AMT_ITEM 3 /* Amount of objects for rooms/corridors */
-#define DUN_AMT_GOLD 3 /* Amount of treasure for rooms/corridors */
-#define DUN_AMT_INVIS 3 /* Amount of invisible walls for rooms/corridors */
-
 /* 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 %)となる */