kts.HOOK_WEAPON_PARRY

Name

kts.HOOK_WEAPON_PARRY - function called when a knight parries a blow

Synopsis

kts.HOOK_WEAPON_PARRY = function() ... end

Description

If kts.HOOK_WEAPON_PARRY is non-nil, then it is called as a Lua function (with no parameters) whenever a knight parries a blow.

During the function call, the cxt table will be available; for example, cxt.pos will give the position of the knight.

Examples

In the standard Knights data files, this hook is used to play the "clanging" sound that is heard when a knight parries a blow. The code for this can be found in sounds.lua.

Other modules could replace kts.HOOK_WEAPON_PARRY (or any of the other "hook" functions) with their own code if desired.

See Also

kts.HOOK_WEAPON_DOWNSWING