Skip to content
Snippets Groups Projects
Commit 615189a6 authored by dg's avatar dg
Browse files

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
parent 780eb987
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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)
......
......@@ -18,6 +18,7 @@
-- darkgod@te4.org
setAuto("subclass", false)
setAuto("subrace", false)
newBirthDescriptor{
type = "base",
......
......@@ -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,
}
......
......@@ -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 {}
......
......@@ -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. */
......
......@@ -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);
}*/
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment