Skip to content
Snippets Groups Projects
Commit 4370b3af authored by dg's avatar dg
Browse files

bleh

git-svn-id: http://svn.net-core.org/repos/t-engine4@3475 51575b47-30f0-44d4-a5cc-537603b46e54
parent bf1b63a7
No related branches found
No related tags found
No related merge requests found
......@@ -63,23 +63,22 @@ function _M:init(short_name, dynamic)
if self.on_setup then self:on_setup() end
self:updateBaseLevel(true)
self:updateBaseLevel()
forceprint("Initiated zone", self.name, "with base_level", self.base_level)
else
if self.update_base_level_on_enter then self:updateBaseLevel(false) end
if self.update_base_level_on_enter then self:updateBaseLevel() end
forceprint("Loaded zone", self.name, "with base_level", self.base_level)
end
end
--- Computes the current base level based on the zone infos
function _M:updateBaseLevel(first)
function _M:updateBaseLevel()
-- Determine a zone base level
self.base_level = self.level_range[1]
if self.level_scheme == "player" then
local plev = game:getPlayer().level
self.base_level = util.bound(plev, self.level_range[1], self.level_range[2])
end
if self.on_setup_level then self:on_setup_level(first) end
end
--- Loads basic entities lists
......
......@@ -329,7 +329,7 @@ function _M:loaded()
Actor.projectile_class = "mod.class.Projectile"
Zone:setup{
npc_class="mod.class.NPC", grid_class="mod.class.Grid", object_class="mod.class.Object", trap_class="mod.class.Trap",
on_setup_level = function(zone)
on_setup = function(zone)
-- Increases zone level for higher difficulties
if not zone.__applied_difficulty then
zone.__applied_difficulty = 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