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

test

git-svn-id: http://svn.net-core.org/repos/t-engine4@3474 51575b47-30f0-44d4-a5cc-537603b46e54
parent 18920e75
No related branches found
No related tags found
No related merge requests found
......@@ -63,22 +63,23 @@ function _M:init(short_name, dynamic)
if self.on_setup then self:on_setup() end
self:updateBaseLevel()
self:updateBaseLevel(true)
forceprint("Initiated zone", self.name, "with base_level", self.base_level)
else
if self.update_base_level_on_enter then self:updateBaseLevel() end
if self.update_base_level_on_enter then self:updateBaseLevel(false) 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()
function _M:updateBaseLevel(first)
-- 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
......
......@@ -1907,7 +1907,7 @@ function _M:preUseTalent(ab, silent, fake)
return false
end
else
if ab.mana and self:getMana() < ab.mana * (100 + 2 * self:combatFatigue()) / 100 then
if ab.mana and self:getMana() < util.getval(ab.mana, self, ab) * (100 + 2 * self:combatFatigue()) / 100 then
if not silent then game.logPlayer(self, "You do not have enough mana to cast %s.", ab.name) end
return false
end
......@@ -2113,7 +2113,7 @@ function _M:postUseTalent(ab, ret)
end
else
if ab.mana then
trigger = true; self:incMana(-ab.mana * (100 + 2 * self:combatFatigue()) / 100)
trigger = true; self:incMana(-util.getval(ab.mana, self, ab) * (100 + 2 * self:combatFatigue()) / 100)
end
if ab.stamina then
trigger = true; self:incStamina(-ab.stamina * (100 + self:combatFatigue()) / 100)
......@@ -2224,7 +2224,7 @@ function _M:getTalentFullDescription(t, addlevel)
else d:add({"color",0x6f,0xff,0x83}, "Use mode: ", {"color",0x00,0xFF,0x00}, "Activated", true)
end
if t.mana or t.sustain_mana then d:add({"color",0x6f,0xff,0x83}, "Mana cost: ", {"color",0x7f,0xff,0xd4}, ""..(t.sustain_mana or t.mana * (100 + 2 * self:combatFatigue()) / 100), true) end
if t.mana or t.sustain_mana then d:add({"color",0x6f,0xff,0x83}, "Mana cost: ", {"color",0x7f,0xff,0xd4}, ""..(util.getval(t.sustain_mana or t.mana, self, t) * (100 + 2 * self:combatFatigue()) / 100), true) end
if t.stamina or t.sustain_stamina then d:add({"color",0x6f,0xff,0x83}, "Stamina cost: ", {"color",0xff,0xcc,0x80}, ""..(t.sustain_stamina or t.stamina * (100 + self:combatFatigue()) / 100), true) end
if t.equilibrium or t.sustain_equilibrium then d:add({"color",0x6f,0xff,0x83}, "Equilibrium cost: ", {"color",0x00,0xff,0x74}, ""..(t.equilibrium or t.sustain_equilibrium), true) end
if t.vim or t.sustain_vim then d:add({"color",0x6f,0xff,0x83}, "Vim cost: ", {"color",0x88,0x88,0x88}, ""..(t.sustain_vim or t.vim), true) end
......@@ -2440,7 +2440,7 @@ function _M:canBe(what)
if what == "knockback" and (rng.percent(100 * (self:attr("knockback_immune") or 0)) or self:attr("never_move")) then return false end
if what == "stone" and rng.percent(100 * (self:attr("stone_immune") or 0)) then return false end
if what == "instakill" and rng.percent(100 * (self:attr("instakill_immune") or 0)) then return false end
if what == "teleport" and rng.percent(100 * (self:attr("teleport_immune") or 0)) then return false end
if what == "teleport" and (rng.percent(100 * (self:attr("teleport_immune") or 0)) or self:attr("encased_in_ice")) then return false end
if what == "worldport" and game.level.data and game.level.data.no_worldport then return false end
if what == "summon" and self:attr("suppress_summon") then return false end
return true
......
......@@ -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 = function(zone)
on_setup_level = function(zone)
-- Increases zone level for higher difficulties
if not zone.__applied_difficulty then
zone.__applied_difficulty = true
......
......@@ -23,8 +23,8 @@ newTalent{
require = spells_req1,
points = 5,
random_ego = "utility",
mana = 10,
cooldown = 8,
mana = function(self, t) if game.zone.force_controlled_teleport then return 2 else return 10 end end,
cooldown = function(self, t) if game.zone.force_controlled_teleport then return 4 else return 8 end end,
tactical = { ESCAPE = 2 },
requires_target = function(self, t) return self:getTalentLevel(t) >= 4 end,
getRange = function(self, t) return 4 + self:combatTalentSpellDamage(t, 10, 15) end,
......
......@@ -91,7 +91,7 @@ function _M:generateList()
elseif self.cur_sel == "size" then
list = {
{name="64x64", sub="size", val="64x64"},
{name="48x48", sub="size", val="48x48"},
-- {name="48x48", sub="size", val="48x48"},
{name="32x32", sub="size", val="32x32"},
{name="16x16", sub="size", val="16x16"},
}
......
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