Module:Damage: Difference between revisions

    From Gallowpedia, the MediEvil Wiki. You'll be dying to read!
    (Created page with "local p = {} --p stands for package function p.calc( frame ) return "Hello, world!" end return p")
     
    No edit summary
     
    (4 intermediate revisions by the same user not shown)
    Line 1: Line 1:
    local p = {} --p stands for package
    local p = {} --p stands for package
    local bit32 = require( 'bit32' )
    function p.calcRD( frame )
        local sharpness = frame.args[1] * frame.args[5]
        local weight = frame.args[2] * frame.args[6]
        local fire = frame.args[3] * frame.args[7]
        local magic = frame.args[4] * frame.args[8]
        local all = sharpness + weight + fire + magic
        local result = bit32.rshift(all, 2) * 25
        return result
    end


    function p.calc( frame )
    function p.calc( frame )
         return "Hello, world!"
        local sharpness = frame.args[1] * frame.args[5]
        local weight = frame.args[2] * frame.args[6]
        local fire = frame.args[3] * frame.args[7]
        local magic = frame.args[4] * frame.args[8]
        local all = sharpness + weight + fire + magic
        local result = bit32.rshift(all, 4)
         return result
    end
    end


    return p
    return p

    Latest revision as of 06:42, 21 November 2023

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

    local p = {} --p stands for package
    
    local bit32 = require( 'bit32' )
    
    function p.calcRD( frame )
        local sharpness = frame.args[1] * frame.args[5]
        local weight = frame.args[2] * frame.args[6]
        local fire = frame.args[3] * frame.args[7]
        local magic = frame.args[4] * frame.args[8]
        local all = sharpness + weight + fire + magic
        local result = bit32.rshift(all, 2) * 25
        return result
    end
    
    function p.calc( frame )
        local sharpness = frame.args[1] * frame.args[5]
        local weight = frame.args[2] * frame.args[6]
        local fire = frame.args[3] * frame.args[7]
        local magic = frame.args[4] * frame.args[8]
        local all = sharpness + weight + fire + magic
        local result = bit32.rshift(all, 4)
        return result
    end
    
    return p