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

tone down randomness of NPC inscriptions a bit

git-svn-id: http://svn.net-core.org/repos/t-engine4@2498 51575b47-30f0-44d4-a5cc-537603b46e54
parent 74bb7129
No related branches found
No related tags found
No related merge requests found
...@@ -683,7 +683,9 @@ function _M:onHeal(value, src) ...@@ -683,7 +683,9 @@ function _M:onHeal(value, src)
if self:hasEffect(self.EFF_UNSTOPPABLE) then if self:hasEffect(self.EFF_UNSTOPPABLE) then
return 0 return 0
end end
return value * (self.healing_factor or 1) value = value * (self.healing_factor or 1)
print("[HEALING]", self.uid, self.name, "for", value)
return value
end end
--- Called before taking a hit, it's the chance to check for shields --- Called before taking a hit, it's the chance to check for shields
......
...@@ -111,7 +111,17 @@ function _M:getInscriptionData(name) ...@@ -111,7 +111,17 @@ function _M:getInscriptionData(name)
assert(fake or self.inscriptions_data[name], "unknown inscription "..name) assert(fake or self.inscriptions_data[name], "unknown inscription "..name)
local d = table.clone(fake or self.inscriptions_data[name]) local d = table.clone(fake or self.inscriptions_data[name])
d.inc_stat = 0 d.inc_stat = 0
if d.use_stat and d.use_stat_mod then d.inc_stat = self:getStat(d.use_stat) * d.use_stat_mod end if d.use_any_stat and d.use_stat_mod then
local max = math.max(
self:getStr(),
self:getDex(),
self:getCon(),
self:getMag(),
self:getWil(),
self:getCun()
) * d.use_any_stat
d.inc_stat = max * d.use_stat_mod
elseif d.use_stat and d.use_stat_mod then d.inc_stat = self:getStat(d.use_stat) * d.use_stat_mod end
return d return d
end end
......
...@@ -243,12 +243,18 @@ end ...@@ -243,12 +243,18 @@ end
--- Random bonus based on level, more strict --- Random bonus based on level, more strict
resolvers.current_level = 1 resolvers.current_level = 1
function resolvers.mbonus_level(max, add, pricefct, step) function resolvers.mbonus_level(max, add, pricefct, step)
return {__resolver="mbonus", max, add, pricefct} -- mbonus_level does not work really well, skip it for now return {__resolver="mbonus_level", max, add, step or 10, pricefct} -- mbonus_level does not work really well, skip it for now
end end
function resolvers.calc.mbonus_level(t, e) function resolvers.calc.mbonus_level(t, e)
local max = resolvers.mbonus_max_level
local ml = 1 + math.floor((resolvers.current_level - 1) / t[3]) local ml = 1 + math.floor((resolvers.current_level - 1) / t[3])
local maxl = 1 + math.floor((resolvers.mbonus_max_level - 1) / t[3]) ml = util.bound(rng.float(ml, ml * 1.6), 1, 6)
local v = math.ceil(rng.mbonus(t[1], resolvers.current_level, resolvers.mbonus_max_level) * ml / maxl) + (t[2] or 0)
local maxl = 1 + math.floor((max - 1) / t[3])
local power = 1 + math.log10(ml / maxl)
local v = math.ceil(rng.mbonus(t[1], resolvers.current_level, max) * power) + (t[2] or 0)
if e.cost and t[4] then if e.cost and t[4] then
local ap, nv = t[4](e, v) local ap, nv = t[4](e, v)
...@@ -382,6 +388,7 @@ function resolvers.calc.inscriptions(t, e) ...@@ -382,6 +388,7 @@ function resolvers.calc.inscriptions(t, e)
o = game.zone:makeEntity(game.level, "object", {type="scroll", subtype=t[2]}, nil, true) o = game.zone:makeEntity(game.level, "object", {type="scroll", subtype=t[2]}, nil, true)
end end
if o and o.inscription_talent and o.inscription_data then if o and o.inscription_talent and o.inscription_data then
o.inscription_data.use_any_stat = 0.7 -- Cheat a beat to scale inscriptions nicely
e:setInscription(nil, o.inscription_talent, o.inscription_data, false, false, nil, true, true) e:setInscription(nil, o.inscription_talent, o.inscription_data, false, false, nil, true, true)
end end
end end
......
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