Commit 0e82ff634afd8e9fa06b767b6bafca8b2bc1ac38

Authored by DarkGod
2 parents 34a914fd 330d1da9

Merge branch '174-miscs' into 'master'

Miscs

1. Bring back the fix: The duration of an existing effect will not be reduced by setting a new effect with a shorter duration (controlled by on_merge for some  effects).
2. Living lightning correctly works with Range Amplification Device
3. Stormshield rune's block number and threshold should be an integer
4. Randart bows & slings should not have base damage

See merge request !771
@@ -7630,6 +7630,7 @@ function _M:on_set_temporary_effect(eff_id, e, p) @@ -7630,6 +7630,7 @@ function _M:on_set_temporary_effect(eff_id, e, p)
7630 p.getName = e.getName 7630 p.getName = e.getName
7631 p.resolveSource = e.resolveSource 7631 p.resolveSource = e.resolveSource
7632 7632
  7633 + local old = self.tmp[eff_id]
7633 local olddur = old and not e.on_merge and old.dur or 0 -- let mergable effects handle their own duration 7634 local olddur = old and not e.on_merge and old.dur or 0 -- let mergable effects handle their own duration
7634 -- Adjust duration based on saves 7635 -- Adjust duration based on saves
7635 if p.apply_power and (save_for_effects[e.type] or p.apply_save) then 7636 if p.apply_power and (save_for_effects[e.type] or p.apply_save) then
@@ -30,6 +30,9 @@ load("/data/general/objects/random-artifacts/melee.lua", function(e) @@ -30,6 +30,9 @@ load("/data/general/objects/random-artifacts/melee.lua", function(e)
30 e.wielder.ranged_project = table.clone(e.wielder.melee_project) 30 e.wielder.ranged_project = table.clone(e.wielder.melee_project)
31 e.wielder.melee_project = nil 31 e.wielder.melee_project = nil
32 end 32 end
  33 + if e.combat and e.combat.dam then -- bows & slings should not have base damage
  34 + e.rarity = nil
  35 + end
33 end) 36 end)
34 37
35 ---------------------------------------------------------------- 38 ----------------------------------------------------------------
@@ -751,11 +751,11 @@ newInscription{ @@ -751,11 +751,11 @@ newInscription{
751 end, 751 end,
752 getThreshold = function(self, t) 752 getThreshold = function(self, t)
753 local data = self:getInscriptionData(t.short_name) 753 local data = self:getInscriptionData(t.short_name)
754 - return data.threshold 754 + return math.ceil(data.threshold)
755 end, 755 end,
756 getBlocks = function(self, t) 756 getBlocks = function(self, t)
757 local data = self:getInscriptionData(t.short_name) 757 local data = self:getInscriptionData(t.short_name)
758 - return data.blocks + data.inc_stat 758 + return math.ceil(data.blocks + data.inc_stat)
759 end, 759 end,
760 action = function(self, t) 760 action = function(self, t)
761 local data = self:getInscriptionData(t.short_name) 761 local data = self:getInscriptionData(t.short_name)
@@ -152,7 +152,7 @@ newTalent{ @@ -152,7 +152,7 @@ newTalent{
152 target = function(self, t) return{type="hit", range=self:getTalentRange(t), talent=t, friendlyblock=false, friendlyfire=false} end, 152 target = function(self, t) return{type="hit", range=self:getTalentRange(t), talent=t, friendlyblock=false, friendlyfire=false} end,
153 callbackOnActBase = function(self, t) 153 callbackOnActBase = function(self, t)
154 local tgts = {} 154 local tgts = {}
155 - local grids = core.fov.circle_grids(self.x, self.y, 6, true) 155 + local grids = core.fov.circle_grids(self.x, self.y, self:getTalentRange(t), true)
156 for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do 156 for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do
157 local a = game.level.map(x, y, Map.ACTOR) 157 local a = game.level.map(x, y, Map.ACTOR)
158 if a and self:reactionToward(a) < 0 then 158 if a and self:reactionToward(a) < 0 then