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

things to enable other things

git-svn-id: http://svn.net-core.org/repos/t-engine4@6685 51575b47-30f0-44d4-a5cc-537603b46e54
parent 14aade66
No related branches found
No related tags found
No related merge requests found
......@@ -208,7 +208,7 @@ function _M:move(x, y, force)
end
--- Moves into the given direction (calls actor:move() internally)
function _M:moveDir(dir)
function _M:moveDir(dir, force)
local dx, dy = util.dirToCoord(dir, self.x, self.y)
if dir ~= 5 then self.doPlayerSlide = config.settings.player_slide end
......@@ -229,7 +229,7 @@ function _M:moveDir(dir)
local x, y = self.x + dx, self.y + dy
self.move_dir = dir
return self:move(x, y)
return self:move(x, y, force)
end
--- Can the actor go there
......
......@@ -143,7 +143,7 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
if force_level then old_level = who.talents[id]; who.talents[id] = force_level end
if force_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
self.__talent_running = ab
local ok, ret = xpcall(function() return ab.action(who, ab) end, debug.traceback)
local ok, ret, special = xpcall(function() return ab.action(who, ab) end, debug.traceback)
self.__talent_running = nil
if force_target then who.getTarget = old_target end
if force_level then who.talents[id] = old_level end
......@@ -153,7 +153,7 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
if not self:postUseTalent(ab, ret, silent) then return end
-- Everything went ok? then start cooldown if any
if not ignore_cd then self:startTalentCooldown(ab) end
if not ignore_cd and (not special or not special.ignore_cd) then self:startTalentCooldown(ab) end
end)
local success, err
if not no_confirm and self:isTalentConfirmable(ab) then
......
......@@ -215,6 +215,12 @@ local function archery_projectile(tx, ty, tg, self, tmp)
dam = dam * mult
print("[ATTACK ARCHERY] after mult", dam)
local hd = {"Combat:archeryDamage", hitted=hitted, target=target, weapon=weapon, ammo=ammo, damtype=damtype, mult=1, dam=dam}
if self:triggerHook(hd) then
dam = dam * hd.mult
end
print("[ATTACK ARCHERY] after hook", dam)
if crit then game.logSeen(self, "#{bold}#%s performs a critical strike!#{normal}#", self.name:capitalize()) end
-- Damage conversion?
......@@ -256,6 +262,8 @@ local function archery_projectile(tx, ty, tg, self, tmp)
else
local srcname = game.level.map.seens(self.x, self.y) and self.name:capitalize() or "Something"
game.logSeen(target, "%s misses %s.", srcname, target.name)
if talent.archery_onmiss then talent.archery_onmiss(self, talent, target, target.x, target.y) end
end
-- cross-tier effect for accuracy vs. defense
......@@ -536,8 +544,8 @@ function _M:hasArcheryWeapon(type)
return nil, "bad ammo"
end
end
if type and weapon.archery ~= type then return nil, "bad type" end
if type and offweapon and offweapon.archery ~= type then return nil, "bad type" end
if type and weapon.subtype ~= type then return nil, "bad type" end
if type and offweapon and offweapon.subtype ~= type then return nil, "bad type" end
return weapon, ammo, offweapon
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