Skip to content
Snippets Groups Projects
Commit b96c7e6c authored by DarkGod's avatar DarkGod
Browse files

Scaling Bug fix in Darkness talent radius

Scaling fix to hate generation
Fixed typos in NPC definitions to prevent unintended agro
Fixed bug in BattleTrance
Fixed Grim Resolve not curing poison/disease
Fixed Vimsense power when used with items
Fixed tactical ai info for Mindlash talent
Fixed character sheet to correctly show archery damage based on ammo
parent 4b38a306
No related branches found
No related tags found
No related merge requests found
Showing with 47 additions and 19 deletions
...@@ -2802,8 +2802,20 @@ function _M:updateModdableTile() ...@@ -2802,8 +2802,20 @@ function _M:updateModdableTile()
local add = self.add_mos local add = self.add_mos
local i local i
self:triggerHook{"Actor:updateModdableTile:back", base=base, add=add}
i = self.inven[self.INVEN_CLOAK]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile):format("behind")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end i = self.inven[self.INVEN_CLOAK]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile):format("behind")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
add[#add+1] = {image = base..(self.moddable_tile_base or "base_01.png")} add[#add+1] = {image = base..(self.moddable_tile_base or "base_01.png")}
if not self:attr("disarmed") then
i = self.inven[self.INVEN_MAINHAND]; if i and i[1] and i[1].moddable_tile_back then
add[#add+1] = {image = base..(i[1].moddable_tile_back):format("right")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1}
end
i = self.inven[self.INVEN_OFFHAND]; if i and i[1] and i[1].moddable_tile_back then
add[#add+1] = {image = base..(i[1].moddable_tile_back):format("left")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1}
end
end
i = self.inven[self.INVEN_CLOAK]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile):format("shoulder")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end i = self.inven[self.INVEN_CLOAK]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile):format("shoulder")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_FEET]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile)..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end i = self.inven[self.INVEN_FEET]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile)..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_BODY]; if i and i[1] and i[1].moddable_tile2 then add[#add+1] = {image = base..(i[1].moddable_tile2)..".png"} i = self.inven[self.INVEN_BODY]; if i and i[1] and i[1].moddable_tile2 then add[#add+1] = {image = base..(i[1].moddable_tile2)..".png"}
...@@ -2828,6 +2840,8 @@ function _M:updateModdableTile() ...@@ -2828,6 +2840,8 @@ function _M:updateModdableTile()
end end
end end
self:triggerHook{"Actor:updateModdableTile:front", base=base, add=add}
if self.moddable_tile_ornament and self.moddable_tile_ornament[self.female and "female" or "male"] then add[#add+1] = {image = base..self.moddable_tile_ornament[self.female and "female" or "male"]..".png"} end if self.moddable_tile_ornament and self.moddable_tile_ornament[self.female and "female" or "male"] then add[#add+1] = {image = base..self.moddable_tile_ornament[self.female and "female" or "male"]..".png"} end
if self.x and game.level then game.level.map:updateMap(self.x, self.y) end if self.x and game.level then game.level.map:updateMap(self.x, self.y) end
......
...@@ -97,7 +97,7 @@ In return let me offer you this powerful trident.]], ...@@ -97,7 +97,7 @@ In return let me offer you this powerful trident.]],
game.level.map:particleEmitter(npc.x, npc.y, 1, "demon_teleport") game.level.map:particleEmitter(npc.x, npc.y, 1, "demon_teleport")
game.level.map:particleEmitter(player.x, player.y, 1, "demon_teleport") game.level.map:particleEmitter(player.x, player.y, 1, "demon_teleport")
npc.invulnerable = 1 npc.invulnerable = 1
npc.never_angry = 1 npc.never_anger = 1
player:setQuestStatus("temple-of-creation", engine.Quest.COMPLETED, "legacy-naloren") player:setQuestStatus("temple-of-creation", engine.Quest.COMPLETED, "legacy-naloren")
end end
end}, end},
......
...@@ -126,7 +126,7 @@ myssil_dies = function(self) ...@@ -126,7 +126,7 @@ myssil_dies = function(self)
if not corr then return end if not corr then return end
corr:doEmote("Victory is mine!", 60) corr:doEmote("Victory is mine!", 60)
corr.never_angry = nil corr.never_anger = nil
game.player:setQuestStatus(self.id, self.COMPLETED) game.player:setQuestStatus(self.id, self.COMPLETED)
end end
......
...@@ -61,11 +61,12 @@ newTalent{ ...@@ -61,11 +61,12 @@ newTalent{
self:setEffect(self.EFF_SENSE, t.getDuration(self,t), { self:setEffect(self.EFF_SENSE, t.getDuration(self,t), {
range = rad, range = rad,
actor = 1, actor = 1,
VimsensePenalty = t.getResistPenalty(self,t), -- Compute resist penalty at time of activation
on_detect = function(self, x, y) on_detect = function(self, x, y)
local a = game.level.map(x, y, engine.Map.ACTOR) local a = game.level.map(x, y, engine.Map.ACTOR)
if not a or self:reactionToward(a) >= 0 then return end if not a or self:reactionToward(a) >= 0 then return end
a:setTarget(game.player) a:setTarget(game.player)
a:setEffect(a.EFF_VIMSENSE, 2, {power=t.getResistPenalty(self,t)}) a:setEffect(a.EFF_VIMSENSE, 2, {power=self:hasEffect(self.EFF_SENSE).VimsensePenalty or 0})
end, end,
}) })
game:playSoundNear(self, "talents/spell_generic") game:playSoundNear(self, "talents/spell_generic")
......
...@@ -195,7 +195,7 @@ newTalent{ ...@@ -195,7 +195,7 @@ newTalent{
if target.level - 2 > self.level then if target.level - 2 > self.level then
-- level bonus -- level bonus
hateGain = hateGain + (target.level - 2 - self.level) * 2 hateGain = hateGain + math.ceil(self:combatTalentScale(target.level - 2 - self.level, 2, 10, "log", 0, 1))
hateMessage = "#F53CBE#You have taken the life of an experienced foe!" hateMessage = "#F53CBE#You have taken the life of an experienced foe!"
end end
......
...@@ -925,7 +925,7 @@ newTalent{ ...@@ -925,7 +925,7 @@ newTalent{
equilibrium = 4, equilibrium = 4,
cooldown = 6, cooldown = 6,
range = 0, range = 0,
radius = function(self, t) return math.floor(self:combatTalentScale(t, 2.7, 5,3)) end, radius = function(self, t) return math.floor(self:combatTalentScale(t, 2.7, 5.3)) end,
direct_hit = true, direct_hit = true,
tactical = { DISABLE = 3 }, tactical = { DISABLE = 3 },
requires_target = true, requires_target = true,
......
...@@ -362,22 +362,22 @@ newTalent{ ...@@ -362,22 +362,22 @@ newTalent{
cooldown = 15, cooldown = 15,
no_energy = true, no_energy = true,
activate = function(self, t) activate = function(self, t)
t.trance_counter = 0
local ret = {} local ret = {}
self:talentTemporaryValue(ret, "resists", {all=15}) self:talentTemporaryValue(ret, "resists", {all=15})
self:talentTemporaryValue(ret, "combat_mindpower", -15) self:talentTemporaryValue(ret, "combat_mindpower", -15)
self:talentTemporaryValue(ret, "combat_mentalresist", 20) self:talentTemporaryValue(ret, "combat_mentalresist", 20)
ret.trance_counter = 0
return ret return ret
end, end,
deactivate = function(self, t, p) deactivate = function(self, t, p)
t.trance_counter = nil
return true return true
end, end,
callbackOnAct = function(self, t) callbackOnAct = function(self, t)
t.trance_counter = t.trance_counter + 1 local tt = self:isTalentActive(t.id)
if t.trance_counter <= 6 then return end if not tt then return end
tt.trance_counter = tt.trance_counter + 1
if rng.percent((t.trance_counter - 5) * 2) then if tt.trance_counter <= 5 then return end
if rng.percent((tt.trance_counter - 5) * 2) then
self:forceUseTalent(self.T_BATTLE_TRANCE, {ignore_energy=true}) self:forceUseTalent(self.T_BATTLE_TRANCE, {ignore_energy=true})
self:setEffect(self.EFF_CONFUSED, 4, {power=40}) self:setEffect(self.EFF_CONFUSED, 4, {power=40})
game.logPlayer(self, "You overdose on the honeyroot sap!") game.logPlayer(self, "You overdose on the honeyroot sap!")
......
...@@ -49,9 +49,8 @@ newTalent{ ...@@ -49,9 +49,8 @@ newTalent{
if auras.c_aura_on then if auras.c_aura_on then
val.LIGHTNING = 1 val.LIGHTNING = 1
end end
return val
end end
return 0 return val
end }, end },
range = function(self, t) range = function(self, t)
local r = 5 local r = 5
......
...@@ -1493,6 +1493,15 @@ newEffect{ ...@@ -1493,6 +1493,15 @@ newEffect{
self.tempeffect_def[self.EFF_CURSED_FORM].updateEffect(self, eff) self.tempeffect_def[self.EFF_CURSED_FORM].updateEffect(self, eff)
end end
end end
if (eff.statChange or 0)>0 and eff.neutralizeChance then -- Remove poisons/disease (w/Grim Resolve)
local efdef
for efid, ef in pairs(self.tmp) do
efdef = self.tempeffect_def[efid]
if efdef.subtype and (efdef.subtype.poison or efdef.subtype.disease) and rng.percent(eff.neutralizeChance) then
self:removeEffect(efid)
end
end
end
end, end,
} }
......
...@@ -31,7 +31,7 @@ newEntity{ base = "BASE_NPC_ELVEN_CASTER", define_as = "GRAND_CORRUPTOR", ...@@ -31,7 +31,7 @@ newEntity{ base = "BASE_NPC_ELVEN_CASTER", define_as = "GRAND_CORRUPTOR",
level_range = {30, nil}, exp_worth = 1, level_range = {30, nil}, exp_worth = 1,
rank = 3.5, rank = 3.5,
max_vim = 800, max_vim = 800,
never_angry = 1, never_anger = 1,
max_life = resolvers.rngavg(300, 310), life_rating = 18, max_life = resolvers.rngavg(300, 310), life_rating = 18,
resolvers.equip{ resolvers.equip{
{type="weapon", subtype="staff", forbid_power_source={antimagic=true}, autoreq=true}, {type="weapon", subtype="staff", forbid_power_source={antimagic=true}, autoreq=true},
......
...@@ -45,7 +45,7 @@ newEntity{ define_as = "FILLAREL", ...@@ -45,7 +45,7 @@ newEntity{ define_as = "FILLAREL",
instakill_immune = 1, instakill_immune = 1,
teleport_immune = 1, teleport_immune = 1,
move_others=true, move_others=true,
never_angry=true, never_anger=true,
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ equipment = resolvers.equip{
......
...@@ -564,12 +564,17 @@ function _M:drawDialog(kind, actor_to_compare) ...@@ -564,12 +564,17 @@ function _M:drawDialog(kind, actor_to_compare)
for i, o in ipairs(player:getInven(player.INVEN_MAINHAND)) do for i, o in ipairs(player:getInven(player.INVEN_MAINHAND)) do
local mean, dam = player:getObjectCombat(o, "mainhand"), player:getObjectCombat(o, "mainhand") local mean, dam = player:getObjectCombat(o, "mainhand"), player:getObjectCombat(o, "mainhand")
local range
if o.archery and mean then if o.archery and mean then
dam = (player:getInven("QUIVER") and player:getInven("QUIVER")[1] and player:getInven("QUIVER")[1].combat) local ammo = player:getInven("QUIVER") and player:getInven("QUIVER")[1]
if ammo and ammo.archery_ammo == o.archery then -- make sure ammo matches launcher
dam = player:getObjectCombat(ammo, "mainhand")
range = mean.range
end
end end
if mean and dam then if mean and dam then
s:drawColorStringBlended(self.font, WeaponTxt, w, h, 255, 255, 255, true) h = h + self.font_h s:drawColorStringBlended(self.font, WeaponTxt, w, h, 255, 255, 255, true) h = h + self.font_h
text = compare_fields(player, actor_to_compare, function(actor, ...) return math.floor(actor:combatAttack(...)) end, "%3d", "%+.0f", 1, false, false, mean) text = compare_fields(player, actor_to_compare, function(actor, ...) return math.floor(actor:combatAttack(...)) end, "%3d", "%+.0f", 1, false, false, mean, dam)
dur_text = ("%d"):format(math.floor(player:combatAttack(o.combat)/5)) dur_text = ("%d"):format(math.floor(player:combatAttack(o.combat)/5))
self:mouseTooltip(self.TOOLTIP_COMBAT_ATTACK, s:drawColorStringBlended(self.font, ("Accuracy : #00ff00#%s"):format(text), w, h, 255, 255, 255, true)) h = h + self.font_h self:mouseTooltip(self.TOOLTIP_COMBAT_ATTACK, s:drawColorStringBlended(self.font, ("Accuracy : #00ff00#%s"):format(text), w, h, 255, 255, 255, true)) h = h + self.font_h
text = compare_fields(player, actor_to_compare, function(actor, ...) return actor:combatDamage(...) end, "%3d", "%+.0f", 1, false, false, dam) text = compare_fields(player, actor_to_compare, function(actor, ...) return actor:combatDamage(...) end, "%3d", "%+.0f", 1, false, false, dam)
...@@ -581,8 +586,8 @@ function _M:drawDialog(kind, actor_to_compare) ...@@ -581,8 +586,8 @@ function _M:drawDialog(kind, actor_to_compare)
text = compare_fields(player, actor_to_compare, function(actor, ...) return actor:combatSpeed(...) end, "%.2f%%", "%+.2f%%", 100, true, false, mean) text = compare_fields(player, actor_to_compare, function(actor, ...) return actor:combatSpeed(...) end, "%.2f%%", "%+.2f%%", 100, true, false, mean)
self:mouseTooltip(self.TOOLTIP_COMBAT_SPEED, s:drawColorStringBlended(self.font, ("Speed : #00ff00#%s"):format(text), w, h, 255, 255, 255, true)) h = h + self.font_h self:mouseTooltip(self.TOOLTIP_COMBAT_SPEED, s:drawColorStringBlended(self.font, ("Speed : #00ff00#%s"):format(text), w, h, 255, 255, 255, true)) h = h + self.font_h
end end
if mean and mean.range then if range then
self:mouseTooltip(self.TOOLTIP_COMBAT_RANGE, s:drawColorStringBlended(self.font, ("Range (Main Hand): #00ff00#%3d"):format(mean.range), w, h, 255, 255, 255, true)) h = h + self.font_h self:mouseTooltip(self.TOOLTIP_COMBAT_RANGE, s:drawColorStringBlended(self.font, ("Range (Main Hand): #00ff00#%3d"):format(range), w, h, 255, 255, 255, true)) h = h + self.font_h
end end
end end
-- Handle bare-handed combat -- Handle bare-handed combat
......
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