Module:Boss

From IdleOn MMO Wiki

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

local p = {}
local NumberFormater = require("Module:NumberFormater")
local DefenseCalc = require("Module:DefenseCalc")
local Utility = require("Module:Utility")

function p.bossAttacksInfoBox(frame)
	local frameArgs = frame.args
	local attackList = Utility.explode(frameArgs.attackList,",")
	local damageList = Utility.explode(frameArgs.damageList,",")
	
	local ret = ""
	for i = 1, #attackList do
		ret = ret .. "<div class='pi-item pi-data pi-item-spacing pi-border-color' data-source=''><h3 class='pi-data-label pi-secondary-font' style='width: 80px;'>" .. attackList[i] .. "</h3><div class='pi-data-value pi-font'>"
		if(damageList[i]) 
        then 
        	local atkDamage = damageList[i]
			local defZero = DefenseCalc.calc({ args = { Attack = atkDamage } })
            ret = ret ..  NumberFormater.formatnumberwithtootip(damageList[i])  .. " <span class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='&lt;span class=&apos;text-only&apos;&gt;Required defense for zero damage&lt;/span&gt;'>(" .. NumberFormater.formatwithseperator(defZero) .. ")</span></div></div>"
        else 
            ret = ret .. "N/A</div></div>"
        end
	end

	return ret
end

return p