ToME: the Tales of Maj'Eyal

Pass 'repelled' in callbackOMeleeAttackBonuses table
Page 1 of 1

Author:  Lokean [ Mon Jan 01, 2018 3:19 pm ]
Post subject:  Pass 'repelled' in callbackOMeleeAttackBonuses table

In combat.lua, the attackTargetWith function has the local variable repelled initialized just prior to the hook/callback 'combat:attackTargetWith:attackerBonuses', but not included in the passed table. This means the only way to add a new per-weapon evasion mechanic appears to be to superload the whole function.

The variables repelled, crit, evaded and deflect should be declared prior to the callback and passed. This would allow for easy insertion of new per-weapon defensive effects, and a nice refactoring of the function code as well.

EDIT: And I realize this is module code, so should really go in the ToME 4 Development subforum.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group