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

fix melee

parent 477bd36c
No related branches found
No related tags found
No related merge requests found
......@@ -138,15 +138,15 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
end
if not self:preUseTalent(ab, silent) then return end
local old_level
local old_target
local old_target, old_target_set = nil, false
if force_level then old_level = who.talents[id]; who.talents[id] = force_level end
if ab.onAIGetTarget and not self.player then old_target = rawget(who, "getTarget"); who.getTarget = function() return ab.onAIGetTarget(self, ab) end end
if force_target and not old_target then old_target = rawget(who, "getTarget"); who.getTarget = function(a) return force_target.x, force_target.y, not force_target.__no_self and force_target end end
if ab.onAIGetTarget and not who.player then old_target_set = true; old_target = rawget(who, "getTarget"); who.getTarget = function() return ab.onAIGetTarget(self, ab) end end
if force_target and not old_target then old_target_set = true; old_target = rawget(who, "getTarget"); who.getTarget = function(a) return force_target.x, force_target.y, not force_target.__no_self and force_target end end
self.__talent_running = ab
local ok, ret, special = xpcall(function() return ab.action(who, ab) end, debug.traceback)
self.__talent_running = nil
if old_target then who.getTarget = old_target end
if old_target_set then who.getTarget = old_target end
if force_level then who.talents[id] = old_level end
if not ok then error(ret) end
......
......@@ -27,7 +27,7 @@ newEntity{
encumber = 3,
rarity = 5,
metallic = true,
combat = { talented = "whip", accuracy_effect = "whip", damrange = 1.1, physspeed = 0.8, sound = "actions/whip_hit", sound_miss = "actions/whip_miss",},
combat = { talented = "whip", accuracy_effect = "sword", damrange = 1.1, physspeed = 0.8, sound = "actions/whip_hit", sound_miss = "actions/whip_miss",},
desc = [[Sharp, long and deadly.]],
randart_able = "/data/general/objects/random-artifacts/generic.lua",
egos = "/data/general/objects/egos/weapon.lua", egos_chance = { prefix=resolvers.mbonus(40, 5), suffix=resolvers.mbonus(40, 5) },
......
......@@ -117,7 +117,7 @@ newTalent{
getDam = function(self, t) return self:combatTalentMindDamage(t, 15, 200) end,
getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 4, 8)) end,
on_pre_use = function(self, t)
if not game.level then return false end
if not game.level or not self.x or not self.y then return false end
for _, coor in pairs(util.adjacentCoords(self.x, self.y)) do
local act = game.level.map(coor[1], coor[2], Map.ACTOR)
if act and act.summoner == self and act.bloated_ooze then
......
......@@ -167,7 +167,7 @@ newTalent{
requires_target = true,
getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 1.0, 1.7) + getStrikingStyle(self, dam) end,
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
local tg = {type="bolt", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
if core.fov.distance(self.x, self.y, x, y) > self:getTalentRange(t) then return nil 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