Skip to content
Snippets Groups Projects

Infinite lua chain

Merged Alex Ksandra requested to merge 0player/t-engine4:infinite_lua_chain into master
+ 16
1
Compare changes
  • Side-by-side
  • Inline
Files
@@ -174,7 +174,11 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent, no_
-- cancel checked in coroutine
success, err = coroutine.resume(co)
end
if not success and err then print(debug.traceback(co)) error(err) end
if not success and err then
print(debug.traceback(co))
self:onTalentLuaError(err)
error(err)
end
elseif ab.mode == "sustained" and ab.activate and ab.deactivate then
if self:isTalentCoolingDown(ab) and not ignore_cd then
game.logPlayer(who, "%s is still on cooldown for %d turns.", ab.name:capitalize(), self.talents_cd[ab.id])
@@ -280,6 +284,13 @@ function _M:postUseTalent(talent, ret, silent)
return true
end
--- Called if a talent errors out
-- @param ab the talent
-- @param err the error
function _M:onTalentLuaError(ab, err)
return
end
--- Force a talent to activate without using energy or such
-- "def" can have a field "ignore_energy" to not consume energy; other parameters can be passed and handled by an overload of this method.
-- Object activation interface calls this method with an "ignore_ressources" parameter
Loading