diff --git a/game/engines/default/engine/Zone.lua b/game/engines/default/engine/Zone.lua index 01365a2147e2257fb67ec59955268e36867ba77b..2ea02015cfa1484fc010451a3d9179328e64a319 100644 --- a/game/engines/default/engine/Zone.lua +++ b/game/engines/default/engine/Zone.lua @@ -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 diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 6d5f6362bf1db3285d24fb7b1bb55663c2cf07bc..937bea16379cd32d71f7c4b8b4f9dd0294a60c9b 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -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 diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 7e84605d53b8fa31bb107424745cb3dfcbc69b5c..fea76cb4bdde037a1be4a6fe689a19b50db45509 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -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 diff --git a/game/modules/tome/data/talents/spells/conveyance.lua b/game/modules/tome/data/talents/spells/conveyance.lua index 9b9a8252dbdbc8ad69f0ac414c7d22a88a6097f1..e9cf6fbe384429c57ad30b177b0698bc6010c607 100644 --- a/game/modules/tome/data/talents/spells/conveyance.lua +++ b/game/modules/tome/data/talents/spells/conveyance.lua @@ -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, diff --git a/game/modules/tome/dialogs/GraphicMode.lua b/game/modules/tome/dialogs/GraphicMode.lua index 49110dce801605c3e15f9a27a5cc9b6442f8d5c6..bd2cfd47ac4a3440c7a50b7ebe2e415a05e66c10 100644 --- a/game/modules/tome/dialogs/GraphicMode.lua +++ b/game/modules/tome/dialogs/GraphicMode.lua @@ -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"}, }