From 66a1b2913d61d517c9fc93dc0b60fce58f220f61 Mon Sep 17 00:00:00 2001 From: DarkGod <darkgod@net-core.org> Date: Mon, 7 Sep 2020 12:44:24 +0200 Subject: [PATCH] look great! --- .../modules/tome/data/general/objects/jewelry.lua | 4 ++-- game/modules/tome/resolvers.lua | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/game/modules/tome/data/general/objects/jewelry.lua b/game/modules/tome/data/general/objects/jewelry.lua index 9468383226..4c908539f3 100644 --- a/game/modules/tome/data/general/objects/jewelry.lua +++ b/game/modules/tome/data/general/objects/jewelry.lua @@ -24,7 +24,7 @@ newEntity{ display = "=", encumber = 0.1, rarity = 6, - desc = _t[[Rings can have magical properties.]], + desc = _t[[Rings make your fingers look great!]], randart_able = "/data/general/objects/random-artifacts/generic.lua", -- Most rings are ego items egos = "/data/general/objects/egos/rings.lua", egos_chance = { prefix=resolvers.mbonus(50, 40), suffix=resolvers.mbonus(50, 40) }, egos_chance_decay = 0.5, @@ -36,7 +36,7 @@ newEntity{ display = '"', encumber = 0.1, rarity = 8, - desc = _t[[Amulets can have magical properties.]], + desc = _t[[Amulets make your neck look great!]], randart_able = "/data/general/objects/random-artifacts/generic.lua", egos = "/data/general/objects/egos/amulets.lua", egos_chance = { prefix=resolvers.mbonus(50, 40), suffix=resolvers.mbonus(50, 40) }, egos_chance_decay = 0.5, } diff --git a/game/modules/tome/resolvers.lua b/game/modules/tome/resolvers.lua index d7ebf76a72..cfba8886b9 100644 --- a/game/modules/tome/resolvers.lua +++ b/game/modules/tome/resolvers.lua @@ -1450,3 +1450,18 @@ function resolvers.calc.easy_combat_table(t, e) end return def end + +--- Levelup resolver +function resolvers.levelup_range(min1, max50, stop_at) + return {__resolver="levelup_range", min1, max50, stop_at} +end +function resolvers.calc.levelup_range(t, e, _, _, k, kchain) + if not e._levelup_info then e._levelup_info = {} end + + local base_level = 1 + if e.level_range and e.level_range[1] then base_level = e.level_range[1] end + + local per_level = (t[2] - t[1]) / 50 + e._levelup_info[#e._levelup_info+1] = {every=1, inc=per_level, max=t[3], kchain=table.clone(kchain), k=k} + return base_level * per_level + t[1] +end -- GitLab