From ac4d3a30ed76a7e139eac02de9edcb9fdbbf7957 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 26 Aug 2014 15:16:33 +0300 Subject: Added initial dungeon rooms finisher. --- src/Generating/DungeonRoomsFinisher.h | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/Generating/DungeonRoomsFinisher.h (limited to 'src/Generating/DungeonRoomsFinisher.h') diff --git a/src/Generating/DungeonRoomsFinisher.h b/src/Generating/DungeonRoomsFinisher.h new file mode 100644 index 000000000..542a39682 --- /dev/null +++ b/src/Generating/DungeonRoomsFinisher.h @@ -0,0 +1,47 @@ + +// DungeonRoomsFinisher.h + +// Declares the cDungeonRoomsFinisher class representing the finisher that generates dungeon rooms + + + + + +#pragma once + +#include "GridStructGen.h" + + + + + +class cDungeonRoomsFinisher : + public cGridStructGen +{ + typedef cGridStructGen super; + +public: + /** Creates a new dungeon room finisher. + a_HeightGen is the underlying height generator, so that the rooms can always be placed under the terrain. + a_MaxSize and a_MinSize are the maximum and minimum sizes of the room's internal (air) area, in blocks across. */ + cDungeonRoomsFinisher(cTerrainHeightGen & a_HeightGen, int a_Seed, int a_GridSize, int a_MaxSize, int a_MinSize); + +protected: + + /** The height gen that is used for limiting the rooms' Y coords */ + cTerrainHeightGen & m_HeightGen; + + /** Maximum half-size (from center to wall) of the dungeon room's inner (air) area. Default is 3 (vanilla). */ + int m_MaxHalfSize; + + /** Minimum half-size (from center to wall) of the dungeon room's inner (air) area. Default is 2 (vanilla). */ + int m_MinHalfSize; + + + // cGridStructGen overrides: + virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override; +} ; + + + + -- cgit v1.2.3 From 62e1c45ca5352205679a60e963853e8511799657 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 27 Aug 2014 13:25:27 +0300 Subject: DungeonRooms: Added a height probability distribution function. --- src/Generating/DungeonRoomsFinisher.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Generating/DungeonRoomsFinisher.h') diff --git a/src/Generating/DungeonRoomsFinisher.h b/src/Generating/DungeonRoomsFinisher.h index 542a39682..2b52c9de6 100644 --- a/src/Generating/DungeonRoomsFinisher.h +++ b/src/Generating/DungeonRoomsFinisher.h @@ -10,6 +10,7 @@ #pragma once #include "GridStructGen.h" +#include "../ProbabDistrib.h" @@ -23,8 +24,9 @@ class cDungeonRoomsFinisher : public: /** Creates a new dungeon room finisher. a_HeightGen is the underlying height generator, so that the rooms can always be placed under the terrain. - a_MaxSize and a_MinSize are the maximum and minimum sizes of the room's internal (air) area, in blocks across. */ - cDungeonRoomsFinisher(cTerrainHeightGen & a_HeightGen, int a_Seed, int a_GridSize, int a_MaxSize, int a_MinSize); + a_MaxSize and a_MinSize are the maximum and minimum sizes of the room's internal (air) area, in blocks across. + a_HeightDistrib is the string defining the height distribution for the rooms (cProbabDistrib format). */ + cDungeonRoomsFinisher(cTerrainHeightGen & a_HeightGen, int a_Seed, int a_GridSize, int a_MaxSize, int a_MinSize, const AString & a_HeightDistrib); protected: @@ -37,6 +39,9 @@ protected: /** Minimum half-size (from center to wall) of the dungeon room's inner (air) area. Default is 2 (vanilla). */ int m_MinHalfSize; + /** The height probability distribution to make the spawners more common in layers 10 - 40, less common outside this range. */ + cProbabDistrib m_HeightProbability; + // cGridStructGen overrides: virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override; -- cgit v1.2.3