From 615189a65057157e864127a60b7c2390579624bd Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Tue, 8 Jun 2010 16:29:35 +0000 Subject: [PATCH] fix zone loading (does not recompute level) subrace is always asked heightened sense starting radisu bigger level decay works correctly git-svn-id: http://svn.net-core.org/repos/t-engine4@758 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engine/Zone.lua | 4 ++++ game/modules/tome/class/Game.lua | 2 +- game/modules/tome/data/birth/descriptors.lua | 1 + .../modules/tome/data/talents/cunning/survival.lua | 6 +++--- game/modules/tome/load.lua | 1 + src/main.c | 2 +- src/map.c | 14 ++++++++++++++ 7 files changed, 25 insertions(+), 5 deletions(-) diff --git a/game/engine/Zone.lua b/game/engine/Zone.lua index b08ec230e5..e6eb9ea9fe 100644 --- a/game/engine/Zone.lua +++ b/game/engine/Zone.lua @@ -302,6 +302,7 @@ function _M:addEntity(level, e, typ, x, y) end function _M:load(dynamic) + local ret = true -- Try to load from a savefile local save = Savefile.new(game.save_name) local data = save:loadZone(self.short_name) @@ -311,10 +312,13 @@ function _M:load(dynamic) local f, err = loadfile("/data/zones/"..self.short_name.."/zone.lua") if err then error(err) end data = f() + ret = false elseif not data and dynamic then data = dynamic + ret = false end for k, e in pairs(data) do self[k] = e end + return ret end local recurs = function(t) diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index b04b82a773..1f4435c85c 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -279,7 +279,7 @@ function _M:changeLevel(lev, zone) self.zone:getLevel(self, lev, old_lev) -- Decay level ? - if self.level.last_turn and self.level.data.decay and self.level.last_turn + self.level.data.decay[1] < game.turn * 10 then + if self.level.last_turn and self.level.data.decay and self.level.last_turn + self.level.data.decay[1] * 10 < game.turn then local nb_actor, remain_actor = self.level:decay(Map.ACTOR, function(e) return not e.unique and self.level.last_turn + rng.range(self.level.data.decay[1], self.level.data.decay[2]) < game.turn * 10 end) local nb_object, remain_object = self.level:decay(Map.OBJECT, function(e) return not e.unique and self.level.last_turn + rng.range(self.level.data.decay[1], self.level.data.decay[2]) < game.turn * 10 end) diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua index cc9b774b8f..01bfad3a60 100644 --- a/game/modules/tome/data/birth/descriptors.lua +++ b/game/modules/tome/data/birth/descriptors.lua @@ -18,6 +18,7 @@ -- darkgod@te4.org setAuto("subclass", false) +setAuto("subrace", false) newBirthDescriptor{ type = "base", diff --git a/game/modules/tome/data/talents/cunning/survival.lua b/game/modules/tome/data/talents/cunning/survival.lua index b47cedfd41..5d31c1633b 100644 --- a/game/modules/tome/data/talents/cunning/survival.lua +++ b/game/modules/tome/data/talents/cunning/survival.lua @@ -36,11 +36,11 @@ newTalent{ mode = "passive", points = 5, on_learn = function(self, t) - self.heightened_senses = 2 + math.ceil(self:getTalentLevel(t)) + self.heightened_senses = 4 + math.ceil(self:getTalentLevel(t)) end, on_unlearn = function(self, t) if self:knowTalent(t) then - self.heightened_senses = 2 + math.ceil(self:getTalentLevel(t)) + self.heightened_senses = 4 + math.ceil(self:getTalentLevel(t)) else self.heightened_senses = nil end @@ -48,7 +48,7 @@ newTalent{ info = function(self, t) return ([[You notice the small things others do not notice, allowing you to "see" creatures in a %d radius even outside of light radius. This is not telepathy though and is still limited to line of sight.]]): - format(2 + math.ceil(self:getTalentLevel(t))) + format(4 + math.ceil(self:getTalentLevel(t))) end, } diff --git a/game/modules/tome/load.lua b/game/modules/tome/load.lua index 56e18084d6..140e8c5534 100644 --- a/game/modules/tome/load.lua +++ b/game/modules/tome/load.lua @@ -31,6 +31,7 @@ local ActorLevel = require "engine.interface.ActorLevel" local Birther = require "engine.Birther" local Store = require "mod.class.Store" local WorldAchievements = require "engine.interface.WorldAchievements" +local Quest = require "engine.Quest" config.settings.tome = config.settings.tome or {} profile.mod.allow_build = profile.mod.allow_build or {} diff --git a/src/main.c b/src/main.c index 8a6bbe314b..03ab30b7fd 100644 --- a/src/main.c +++ b/src/main.c @@ -404,7 +404,7 @@ int resizeWindow(int width, int height) ratio = ( GLfloat )width / ( GLfloat )height; - glActiveTexture(GL_TEXTURE0); +// glActiveTexture(GL_TEXTURE0); glEnable(GL_TEXTURE_2D); /* Setup our viewport. */ diff --git a/src/map.c b/src/map.c index f6b865c6eb..7998ce33e8 100644 --- a/src/map.c +++ b/src/map.c @@ -460,6 +460,20 @@ static int map_to_screen(lua_State *L) { a = map->obscure_a; if (map->grids_terrain[i][j]) display_map_quad(map, dx, dy, map->grids_terrain[i][j], i, j, a, TRUE); + /* + a = map->obscure_a; + if (map->multidisplay) + { + if (map->grids_terrain[i][j]) display_map_quad(map, dx, dy, map->grids_terrain[i][j], i, j, a, TRUE); + if (map->grids_trap[i][j]) display_map_quad(map, dx, dy, map->grids_trap[i][j], i, j, a, TRUE); + if (map->grids_object[i][j]) display_map_quad(map, dx, dy, map->grids_object[i][j], i, j, a, TRUE); + } + else + { + if (map->grids_object[i][j]) display_map_quad(map, dx, dy, map->grids_object[i][j], i, j, a, TRUE); + else if (map->grids_trap[i][j]) display_map_quad(map, dx, dy, map->grids_trap[i][j], i, j, a, TRUE); + else if (map->grids_terrain[i][j]) display_map_quad(map, dx, dy, map->grids_terrain[i][j], i, j, a, TRUE); + }*/ } } } -- GitLab