diff --git a/game/engines/default/engine/ui/VariableList.lua b/game/engines/default/engine/ui/VariableList.lua index 5d1b6795a97f262b980a8ef2b5da29a7c52343e8..3368be89b033cd0242b216f14651b23681e863bb 100644 --- a/game/engines/default/engine/ui/VariableList.lua +++ b/game/engines/default/engine/ui/VariableList.lua @@ -82,14 +82,16 @@ function _M:generate() item.fh = fh item._tex, item._tex_w, item._tex_h = s:glTexture() item._stex = ss:glTexture() + + self.mouse:registerZone(0, self.h, self.w, fh, function(button, x, y, xrel, yrel, bx, by, event) + self.sel = i + if button == "left" and event == "button" then self:onUse() end + end) + self.h = self.h + fh end -- Add UI controls - self.mouse:registerZone(0, 0, self.w, self.h, function(button, x, y, xrel, yrel, bx, by, event) --- self.sel = util.bound(self.scroll + math.floor(by / self.fh), 1, self.max) - if button == "left" and event == "button" then self:onUse() end - end) self.key:addBinds{ ACCEPT = function() self:onUse() end, MOVE_UP = function() self.sel = util.boundWrap(self.sel - 1, 1, self.max) end, diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index a3ecb3fd211c3359b8cbdd4d413a27f260a186bc..11d3b753836188e6feba507c704d23796696a4fc 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -546,16 +546,16 @@ function _M:setupCommands() if config.settings.tome.cheat then self.player:incStat("str", 100) self.player:incStat("dex", 100) self.player:incStat("mag", 100) self.player:incStat("wil", 100) self.player:incStat("cun", 100) self.player:incStat("con", 100) self.player:learnTalent(self.player.T_HEAVY_ARMOUR_TRAINING, true) self.player:learnTalent(self.player.T_MASSIVE_ARMOUR_TRAINING, true) ---[[ +-- [[ for i, e in ipairs(self.zone.object_list) do - if e.unique and e.define_as ~= "VOICE_SARUMAN" then and e.rarity then + if e.unique and e.define_as ~= "VOICE_SARUMAN" then local a = self.zone:finishEntity(self.level, "object", e) a:identify(true) self.zone:addEntity(self.level, a, "object", self.player.x, self.player.y) end end --]] --- [[ +--[[ for i = 1, 50 do local a = self.zone:makeEntity(self.level, "object", {type="wand"}, nil, true) if a then diff --git a/game/modules/tome/data/general/traps/annoy.lua b/game/modules/tome/data/general/traps/annoy.lua index 0bd1cc81e80849c4e2c152a33e18ada9432ae5ee..422d8b0dc53b5c4fbc9f951e8571185b1af3b7d8 100644 --- a/game/modules/tome/data/general/traps/annoy.lua +++ b/game/modules/tome/data/general/traps/annoy.lua @@ -52,7 +52,7 @@ newEntity{ base = "TRAP_ANNOY", message = "@Target@ triggers a burning curse!", dam = resolvers.mbonus(80, 5), triggered = function(self, x, y, who) - who:setEffect(who.EFF_BURNING_HEX, 7, {dam=self.dam}) + who:setEffect(who.EFF_BURNING_HEX, 7, {src=self, dam=self.dam}) return true, true end } diff --git a/game/modules/tome/data/gfx/particles/farportal_lightning.lua b/game/modules/tome/data/gfx/particles/farportal_lightning.lua index 25843ec26787616ef5c39f8ae09f4a2f0ff07520..dfaa255172a2242a05b18e9f2844e6343b1553f9 100644 --- a/game/modules/tome/data/gfx/particles/farportal_lightning.lua +++ b/game/modules/tome/data/gfx/particles/farportal_lightning.lua @@ -105,15 +105,10 @@ return { generator = function() end end, }, function(self) - self.nb = (self.nb or 0) + 1 - -- Create a lightning - if self.nb == 1 then pause = false make_forks(rng.range(-2,2), rng.range(-2,2)) end - - if self.nb < 4 then - self.ps:emit(200*tiles) - elseif self.nb == 6 then pause = true self.ps:emit(1) - elseif self.nb == 32 then pause = false self.nb = 0 + if rng.percent(1) then + make_forks(rng.range(-2,2), rng.range(-2,2)) + self.ps:emit(400) end end, 4*(230)*tiles, nil, true