Difference between revisions of "Module:Sprite Damage"
From ALttP Speedrunning Wiki
Line 18: | Line 18: | ||
local d = args.weapon | local d = args.weapon | ||
− | + | m = sprite_table[m] | |
− | + | d = m[d] | |
− | return | + | return damage_table[d] |
end | end | ||
return p | return p |
Revision as of 14:31, 14 December 2018
Documentation for this module may be created at Damage/doc&action=edit&redlink=1 Module:Sprite Damage/doc
local p = {} local damage_table = mw.loadData('Module:Sprite Damage/weapon table') local sprite_table = mw.loadData('Module:Sprite Damage/sprites table') function p.main(frame) local args = frame:getParent().args args[1] = args[1] or 'A' return p._main(args) end function p.getDamageForId(frame) local args = frame:getParent().args local m = args.id local d = args.weapon m = sprite_table[m] d = m[d] return damage_table[d] end return p