Module:Test2: Difference between revisions

From Elwiki
No edit summary
(Bot: Automated import of articles *** existing text overwritten ***)
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
require('Module:CommonFunctions');
require('Module:CommonFunctions')
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local p = {}
local p = {}


function p.Patch(frame)
function p.main(frame)
     local args = getArgs(frame)
     local args = getArgs(frame);
    local headers = {}
    local cells = {}


     local input_args = split(mw.text.unstrip(args.orig), '|')
     function getBuffData()
    local old_args = {}
        local output = {}
    for k, v in ipairs(input_args) do
        for key, value in pairs(args) do
        local old_arg = split(v, '=')
            if string.starts(key, 'buff') then
        if not old_arg[2] then
               
            old_args[k] = v
             end
        else
             old_args[old_arg[1]] = old_arg[2]
         end
         end
       
     end
     end


     --return inspect_dump(frame, old_args)
     local TRAITS = {
    return frame:expandTemplate{
        {
         title = 'Damage',
            name = 'Light',
         args = old_args
            details = {
                mp = 80
            }
        },
        {
            name = 'Critical',
            details = {
                mp = 120
            },
            extra_data = (function()
                if inArrayStarts('def_ignore', args) then
                    return {
                        def_ignore = 150
                    }
                else return nil end
            end)
        },
        {
            name = 'Reversed',
            details = {
                mp = 60,
                cd = 150
            }
         },
        {
            name = 'Heavy',
            details = {
                cd = 120
            }
        },
         {
            name = 'Haste',
            details = {
                cd = 80
            }
        },
        {
            name = 'Regenerating (1)',
            details = {
                mp = 50
            },
            extra_data = {
                chance = 50
            }
        },
        {
            name = 'Regenerating (2)',
            details = {
                cd = 50
            },
            extra_data = {
                chance = 50
            }
        },
        {
            name = 'Killing Blow (1)',
            details = {
               
            }
        }
     }
     }
 
 
    return inspect_dump(frame, headers)
end
end


return p
return p

Latest revision as of 11:36, 7 May 2023

Documentation for this module may be created at Module:Test2/doc

require('Module:CommonFunctions')
local getArgs = require('Module:Arguments').getArgs
local p = {}

function p.main(frame)
    local args = getArgs(frame);
    local headers = {}
    local cells = {}

    function getBuffData()
        local output = {}
        for key, value in pairs(args) do
            if string.starts(key, 'buff') then
                
            end
        end
    end

    local TRAITS = {
        {
            name = 'Light',
            details = {
                mp = 80
            }
        },
        {
            name = 'Critical',
            details = {
                mp = 120
            },
            extra_data = (function()
                if inArrayStarts('def_ignore', args) then
                    return {
                        def_ignore = 150
                    }
                else return nil end
            end)
        },
        {
            name = 'Reversed',
            details = {
                mp = 60,
                cd = 150
            }
        },
        {
            name = 'Heavy',
            details = {
                cd = 120
            }
        },
        {
            name = 'Haste',
            details = {
                cd = 80
            }
        },
        {
            name = 'Regenerating (1)',
            details = {
                mp = 50
            },
            extra_data = {
                chance = 50
            }
        },
        {
            name = 'Regenerating (2)',
            details = {
                cd = 50
            },
            extra_data = {
                chance = 50
            }
        },
        {
            name = 'Killing Blow (1)',
            details = {
                
            }
        }
    }

    return inspect_dump(frame, headers)
end

return p