X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fmapgen%2Fdungeongen.h;h=d2e733f717bbc26430c9a59e201888c4b49c97d1;hb=37923920a07f06d201662d8f1f4e5821efcc7b09;hp=6799db79ee9834ed536f26e04d826dff7d989598;hpb=20a85d76d94c9c5c7fbe198c3d0e1fbee97a485f;p=oweals%2Fminetest.git diff --git a/src/mapgen/dungeongen.h b/src/mapgen/dungeongen.h index 6799db79e..d2e733f71 100644 --- a/src/mapgen/dungeongen.h +++ b/src/mapgen/dungeongen.h @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2013 celeron55, Perttu Ahola +Copyright (C) 2010-2018 celeron55, Perttu Ahola +Copyright (C) 2015-2018 paramat This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -29,46 +30,59 @@ with this program; if not, write to the Free Software Foundation, Inc., VMANIP_FLAG_DUNGEON_INSIDE|VMANIP_FLAG_DUNGEON_PRESERVE) class MMVManip; -class INodeDefManager; +class NodeDefManager; v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs); v3s16 turn_xz(v3s16 olddir, int t); -v3s16 random_turn(PseudoRandom &random, v3s16 olddir); +void random_turn(PseudoRandom &random, v3s16 &dir); int dir_to_facedir(v3s16 d); struct DungeonParams { s32 seed; - content_t c_water; - content_t c_river_water; content_t c_wall; + // Randomly scattered alternative wall nodes content_t c_alt_wall; content_t c_stair; - bool diagonal_dirs; + // 3D noise that determines which c_wall nodes are converted to c_alt_wall + NoiseParams np_alt_wall; + + // Number of dungeons generated in mapchunk + u16 num_dungeons; + // Dungeons only generate in ground bool only_in_ground; - v3s16 holesize; - u16 corridor_len_min; - u16 corridor_len_max; + // Number of rooms + u16 num_rooms; + // Room size random range. Includes walls / floor / ceilng v3s16 room_size_min; v3s16 room_size_max; + // Large room size random range. Includes walls / floor / ceilng v3s16 room_size_large_min; v3s16 room_size_large_max; - u16 rooms_min; - u16 rooms_max; - s16 y_min; - s16 y_max; + // Value 0 disables large rooms. + // Value 1 results in 1 large room, the first generated room. + // Value > 1 makes the first generated room large, all other rooms have a + // '1 in value' chance of being large. + u16 large_room_chance; + // Dimensions of 3D 'brush' that creates corridors. + // Dimensions are of the empty space, not including walls / floor / ceilng. + v3s16 holesize; + // Corridor length random range + u16 corridor_len_min; + u16 corridor_len_max; + // Diagonal corridors are possible + bool diagonal_dirs; + // Usually 'GENNOTIFY_DUNGEON', but mapgen v6 uses 'GENNOTIFY_TEMPLE' for + // desert dungeons. GenNotifyType notifytype; - - NoiseParams np_density; - NoiseParams np_alt_wall; }; class DungeonGen { public: - MMVManip *vm; - INodeDefManager *ndef; + MMVManip *vm = nullptr; + const NodeDefManager *ndef; GenerateNotifier *gennotify; u32 blockseed; @@ -82,11 +96,10 @@ public: v3s16 m_pos; v3s16 m_dir; - DungeonGen(INodeDefManager *ndef, + DungeonGen(const NodeDefManager *ndef, GenerateNotifier *gennotify, DungeonParams *dparams); - void generate(MMVManip *vm, u32 bseed, - v3s16 full_node_min, v3s16 full_node_max); + void generate(MMVManip *vm, u32 bseed, v3s16 full_node_min, v3s16 full_node_max); void makeDungeon(v3s16 start_padding); void makeRoom(v3s16 roomsize, v3s16 roomplace);