Module:Damage: Difference between revisions
From Exiled Kingdoms Wiki
(Created page with "p = {} resnm = { [1] = 'Fire', [2] = 'Cold', [3] = 'Shock', [4] = 'Death', [5] = 'Toxic', [6] = 'Spirit' } RawDmg = mw.getCurrentFrame().args[...") |
mNo edit summary |
||
Line 39: | Line 39: | ||
return '' | return '' | ||
end | end | ||
txtout = string format("%s %s", getimg(RawDmgs[5]), RawDmgs[4]) | txtout = string.format("%s %s", getimg(RawDmgs[5]), RawDmgs[4]) | ||
return txtout | return txtout | ||
end | end |
Revision as of 02:45, 7 June 2017
p = {} resnm = {
[1] = 'Fire', [2] = 'Cold', [3] = 'Shock', [4] = 'Death', [5] = 'Toxic', [6] = 'Spirit' }
RawDmg = mw.getCurrentFrame().args[1] function p.Min()
RawDmgs = mw.text.split(RawDmg,',',true) return RawDmgs[1]
end
function p.Max()
RawDmgs = mw.text.split(RawDmg,',',true) return RawDmgs[2]
end
function p.Speed()
RawDmgs = mw.text.split(RawDmg,',',true) return RawDmgs[6]
end
function p.Crit()
RawDmgs = mw.text.split(RawDmg,',',true) return RawDmgs[7]
end
function p.Elen()
RawDmgs = mw.text.split(RawDmg,',',true) return RawDmgs[4]
end
function p.EleDisp()
RawDmgs = mw.text.split(RawDmg,',',true) if (RawDmgs[4] == 0) then return end txtout = string.format("%s %s", getimg(RawDmgs[5]), RawDmgs[4]) return txtout
end
function p.EleChk()
vto = mw.getCurrentFrame().args[2] vval = mw.getCurrentFrame().args[3] gtles = mw.getCurrentFrame().args[4] RawDmgs = mw.text.split(RawDmg,',',true) if (vval == nil) then vval = 0 end isele = 0 vnum = RawDmgs[resnm[vto]] if (tonumber(vnum) > tonumber(vval)) then isele = 1 end return isele
end
function p.FullDisp()
RawDmgs = mw.text.split(RawDmg,',',true) txtout = string.format('%s %s', getimg(RawDmgs[3]), RawDmgs[1]) if (RawDmgs[2] > 0) then txtout = string.format('%s-%s', txtout, RawDmgs[2]) end if (RawDmgs[4] > 0) then txtout = string.format('%s +%s%s', txtout, getimg(RawDmgs[5]), RawDmgs[4]) end return txtout
end
function getimg(elemn)
txtrtn = if (elemn == 0) then txtrtn = '' else txtrtn = string.format('File:%s.png', resnm[elemn], resnm[elemn]) end return txtrtn
end
function DPS(RawDmg)
RawDmgs = mw.text.split(RawDmg,',',true)
end
return p