From 89c4f5376f6b0f7a3d8ae588269d17dc22a270d2 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 20 Sep 2010 20:02:05 +0000
Subject: [PATCH] New vault

git-svn-id: http://svn.net-core.org/repos/t-engine4@1259 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/version.lua       |  2 +-
 game/modules/tome/class/Game.lua              |  2 +-
 game/modules/tome/data/general/grids/lava.lua | 50 +++++++++++++++++++
 .../tome/data/maps/vaults/dragon-loot.lua     | 50 +++++++++++++++++++
 .../tome/data/zones/grushnak-pride/grids.lua  |  1 +
 .../tome/data/zones/grushnak-pride/zone.lua   |  6 ++-
 .../data/zones/paths-of-the-dead/zone.lua     |  1 +
 src/core_lua.c                                |  2 +-
 8 files changed, 109 insertions(+), 5 deletions(-)
 create mode 100644 game/modules/tome/data/general/grids/lava.lua
 create mode 100644 game/modules/tome/data/maps/vaults/dragon-loot.lua

diff --git a/game/engines/default/engine/version.lua b/game/engines/default/engine/version.lua
index b5f47e85c2..6af8a9cbaa 100644
--- a/game/engines/default/engine/version.lua
+++ b/game/engines/default/engine/version.lua
@@ -18,7 +18,7 @@
 -- darkgod@te4.org
 
 -- Engine Version
-engine.version = {0,9,11,"te4",2}
+engine.version = {0,9,12,"te4",3}
 engine.require_c_core = engine.version[5]
 engine.version_id = ("%s-%d_%d.%d.%d"):format(engine.version[4], engine.require_c_core, engine.version[1], engine.version[2], engine.version[3])
 
diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index ecf7c5d0b4..a80449cdbc 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -550,7 +550,7 @@ function _M:setupCommands()
 		end,
 		[{"_g","ctrl"}] = function()
 			if config.settings.tome.cheat then
-				self:changeLevel(1, "test")
+				self:changeLevel(1, "grushnak-pride")
 --				self.player:grantQuest("master-jeweler")
 			end
 		end
diff --git a/game/modules/tome/data/general/grids/lava.lua b/game/modules/tome/data/general/grids/lava.lua
new file mode 100644
index 0000000000..25e0e95c61
--- /dev/null
+++ b/game/modules/tome/data/general/grids/lava.lua
@@ -0,0 +1,50 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 Nicolas Casalini
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
+--
+-- Nicolas Casalini "DarkGod"
+-- darkgod@te4.org
+
+newEntity{
+	define_as = "LAVA_FLOOR",
+	name = "lava floor", image = "terrain/lava_floor.png",
+	display = '.', color=colors.RED, back_color=colors.DARK_GREY,
+	shader = "lava",
+	mindam = resolvers.mbonus(5, 15),
+	maxdam = resolvers.mbonus(10, 30),
+	on_move = function(self, x, y, who)
+		local DT = engine.DamageType
+		local dam = DT:get(DT.FIRE).projector(self, x, y, DT.FIRE, rng.range(self.mindam, self.maxdam))
+		if dam > 0 then game.logPlayer(who, "The laval burns you!") end
+	end,
+}
+
+newEntity{
+	define_as = "LAVA_WALL",
+	name = "lava wall", image = "terrain/granite_wall1.png",
+	display = '#', color=colors.RED, back_color=colors.DARK_GREY, tint=colors.LIGHT_RED,
+	always_remember = true,
+	does_block_move = true,
+	block_sight = true,
+	air_level = -20,
+}
+
+newEntity{
+	define_as = "LAVA",
+	name = "molten lava", image = "terrain/lava.png",
+	display = '%', color=colors.LIGHT_RED, back_color=colors.RED,
+	does_block_move = true,
+	shader = "lava",
+}
diff --git a/game/modules/tome/data/maps/vaults/dragon-loot.lua b/game/modules/tome/data/maps/vaults/dragon-loot.lua
new file mode 100644
index 0000000000..4e4e6f14ae
--- /dev/null
+++ b/game/modules/tome/data/maps/vaults/dragon-loot.lua
@@ -0,0 +1,50 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 Nicolas Casalini
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
+--
+-- Nicolas Casalini "DarkGod"
+-- darkgod@te4.org
+
+setStatusAll{no_teleport=true}
+
+rotates = {"default", "90", "180", "270", "flipx", "flipy"}
+
+startx = 7
+starty = 0
+
+defineTile('.', "FLOOR")
+defineTile('~', "LAVA_FLOOR")
+defineTile('#', "HARDWALL")
+defineTile('+', "DOOR")
+defineTile('X', "DOOR_VAULT")
+defineTile('I', "FLOOR", nil, {random_filter={add_levels=10,name="fire imp"}})
+defineTile('D', "FLOOR", {random_filter={add_levels=15}}, {random_filter={add_levels=15,name="fire wyrm"}})
+
+return {
+[[#######X#######]],
+[[###D+D+.#...###]],
+[[#######.##..D##]],
+[[###~~~...###+##]],
+[[#.##~..#..~#..#]],
+[[#.D#~.###.~#D.#]],
+[[#..+...#..~#+##]],
+[[##+#~~...~~~.~#]],
+[[#..###I~~###+##]],
+[[#....#####...~#]],
+[[#~##.+..+...~~#]],
+[[#~~~~#..####~~#]],
+[[##~I~##D#~~~I##]],
+[[###############]],
+}
diff --git a/game/modules/tome/data/zones/grushnak-pride/grids.lua b/game/modules/tome/data/zones/grushnak-pride/grids.lua
index 4d01b7a969..10d0573c28 100644
--- a/game/modules/tome/data/zones/grushnak-pride/grids.lua
+++ b/game/modules/tome/data/zones/grushnak-pride/grids.lua
@@ -19,6 +19,7 @@
 
 load("/data/general/grids/basic.lua")
 load("/data/general/grids/underground.lua")
+load("/data/general/grids/lava.lua")
 load("/data/general/grids/water.lua")
 
 newEntity{
diff --git a/game/modules/tome/data/zones/grushnak-pride/zone.lua b/game/modules/tome/data/zones/grushnak-pride/zone.lua
index 9ef60269b7..c863ce45d8 100644
--- a/game/modules/tome/data/zones/grushnak-pride/zone.lua
+++ b/game/modules/tome/data/zones/grushnak-pride/zone.lua
@@ -34,13 +34,15 @@ return {
 			class = "engine.generator.map.Roomer",
 			nb_rooms = 10,
 			lite_room_chance = 20,
---			edge_entrances = {6,4},
-			rooms = {"forest_clearing"},
+			rooms = {"forest_clearing", {"money_vault",5}, {"pit",7}, {"greater_vault",8}},
+			rooms_config = {pit={filters={{subtype="orc"},{subtype="troll"}}}},
+			greater_vaults_list = {"dragon-loot"},
 			['.'] = "UNDERGROUND_FLOOR",
 			['#'] = {"UNDERGROUND_TREE","UNDERGROUND_TREE2","UNDERGROUND_TREE3","UNDERGROUND_TREE4","UNDERGROUND_TREE5","UNDERGROUND_TREE6","UNDERGROUND_TREE7","UNDERGROUND_TREE8","UNDERGROUND_TREE9","UNDERGROUND_TREE10","UNDERGROUND_TREE11","UNDERGROUND_TREE12","UNDERGROUND_TREE13","UNDERGROUND_TREE14","UNDERGROUND_TREE15","UNDERGROUND_TREE16","UNDERGROUND_TREE17","UNDERGROUND_TREE18","UNDERGROUND_TREE19","UNDERGROUND_TREE20",},
 			up = "UP",
 			down = "DOWN",
 			door = "UNDERGROUND_FLOOR",
+			['+'] = "UNDERGROUND_FLOOR",
 		},
 		actor = {
 			class = "engine.generator.actor.Random",
diff --git a/game/modules/tome/data/zones/paths-of-the-dead/zone.lua b/game/modules/tome/data/zones/paths-of-the-dead/zone.lua
index 12e5bc5115..6d8331ba3b 100644
--- a/game/modules/tome/data/zones/paths-of-the-dead/zone.lua
+++ b/game/modules/tome/data/zones/paths-of-the-dead/zone.lua
@@ -29,6 +29,7 @@ return {
 --	all_lited = true,
 	persistant = "zone",
 	ambiant_music = "Dark Secrets.ogg",
+	no_worldport = true,
 	no_level_connectivity = true,
 	generator =  {
 		map = {
diff --git a/src/core_lua.c b/src/core_lua.c
index b8da63ada6..9590d8efc8 100644
--- a/src/core_lua.c
+++ b/src/core_lua.c
@@ -2175,7 +2175,7 @@ int luaopen_core(lua_State *L)
 
 	luaL_openlib(L, "core.game", gamelib, 0);
 	lua_pushstring(L, "VERSION");
-	lua_pushnumber(L, 2);
+	lua_pushnumber(L, 3);
 	lua_settable(L, -3);
 
 	luaL_openlib(L, "rng", rnglib, 0);
-- 
GitLab