|
|
(228 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| local p = {}; | | local p = require("Module:Move") |
| local cargo = mw.ext.cargo
| | p.game = require("Module:Game").Tekken7 |
| local tables = 'MoveDataCargoTest'
| |
| | |
| p.fields = 'id,input,target,damage,startup'
| |
| | |
| p.queryOverride = function(frame)
| |
| local args = frame:getParent().args
| |
| local id = args['id']
| |
| if id == nil then
| |
| return "Error: no id"
| |
| end
| |
|
| |
| local result = cargo.query(tables, p.fields, { where = "id = '" .. id .. "'" })[0]
| |
| for k, v in pairs(result) do
| |
| local override
| |
| if k == 'id' then
| |
| override = args['overrideId']
| |
| else
| |
| override = args[k]
| |
| end
| |
|
| |
| if override ~= nil then
| |
| result[k] = override
| |
| end
| |
| end
| |
|
| |
| local templateParams = ''
| |
| for k, v in pairs(result) do
| |
| templateParams = templateParams .. '|' .. k .. '=' .. v
| |
| end
| |
| return templateParams
| |
| end
| |
| | |
| return p | | return p |