Module:Test2: Difference between revisions

From Elwiki
No edit summary
(Bot: Automated import of articles *** existing text overwritten ***)
 
(3 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 = {}


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


    args.orig = nil
     local TRAITS = {
     local new_args = table.deep_copy(old_args)
        {
 
            name = 'Light',
    local exclude_args = {'date', 'remove'}
            details = {
    -- Apply the new values to the new table.
                mp = 80
    for k, v in pairs(args) do
            }
         if args[k] and not indexOf(k, exclude_args) then
        },
             new_args[k] = args[k]
         {
        end
            name = 'Critical',
    end
             details = {
 
                mp = 120
    -- Remove the values requested in the new table.
            },
    for k, v in pairs(old_args) do
            extra_data = (function()
        if indexOf(k, split(args.remove)) then
                if inArrayStarts('def_ignore', args) then
            new_args[k] = nil
                    return {
         end
                        def_ignore = 150
    end
                    }
 
                else return nil end
    if args.dump then
            end)
        return inspect_dump(frame, new_args)
         },
    end
        {
 
            name = 'Reversed',
    -- Finally, display the tabs.
            details = {
    local old_table = frame:expandTemplate{
                mp = 60,
        title = 'Damage',
                cd = 150
        args = old_args
            }
    }
        },
 
        {
    local new_table = frame:expandTemplate{
            name = 'Heavy',
        title = 'Damage',
            details = {
        args = new_args
                cd = 120
    }
            }
 
        },
    local kr_date = 'KR (' .. args.date .. ')'
        {
 
            name = 'Haste',
    local tabber = frame:expandTemplate{
            details = {
         title = 'Tabber',
                cd = 80
        args = {
            }
             NA = old_table,
        },
             ['$divclass'] = 'tabber-border',
        {
             ['$divstyle'] = 'display: inline-flex',
            name = 'Regenerating (1)',
             [kr_date] = new_table
            details = {
                mp = 50
            },
            extra_data = {
                chance = 50
            }
        },
         {
            name = 'Regenerating (2)',
            details = {
                cd = 50
             },
             extra_data = {
                chance = 50
            }
        },
        {
             name = 'Killing Blow (1)',
             details = {
               
            }
         }
         }
     }
     }


     return tabber
     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