Module:ShotsToKill

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

function p.main(frame) local args = getArgs(frame, {   wrappers = {      'Template:ShotsToKill'    }  }) return p._main(args) end

function p._main(args) assert(args[1], 'No input given') local mode --		Mode 1: Normal		Mode 2: Modifiers		Mode 3: Hammerpoint	-- local dmg = tonumber(args[1]) local hp = {100, 150, 175, 200, 225} local shotsToKill = {1, 1, 1, 1, 1} if args[2] == nil then mode = 1 else mode = args[2] mdfr = args[3] end for i = 1, 5, 1 do		local dmgA = dmg local transitioned = false while dmgA < hp[i] do			if mode == 2 then if i == 1 then dmgA = dmgA + (dmg * mdfr) else if hp[i] - dmgA < 100 and transitioned == false then local fleshDmg = (100 - (hp[i] - dmgA)) * mdfr local shieldDmg = (dmgA - dmg) - (100 - (hp[i] - dmgA)) dmgA = (dmgA - dmg) + shieldDmg + fleshDmg transitioned = true elseif hp[i] - dmgA < 100 and transitioned then dmgA = dmgA + (dmg * mdfr) else dmgA = dmgA + dmg end end else dmgA = dmgA + dmg end shotsToKill[i] = shotsToKill[i] + 1 end end local result

for i = 0, 5, 1 do		if i == 0 then result = dmg else result = result .. "||" .. shotsToKill[i] end end return result end

return p