Module:Damage: Difference between revisions
From Exiled Kingdoms Wiki
mNo edit summary |
mNo edit summary |
||
Line 59: | Line 59: | ||
end | end | ||
function p.FullDisp( | function p.FullDisp() | ||
RawDmgs = mw.text.split(RawDmg,',',true) | RawDmgs = mw.text.split(RawDmg,',',true) | ||
txtout = string.format('%s %s', getimg(RawDmgs[3]), RawDmgs[1]) | txtout = string.format('%s %s', getimg(RawDmgs[3]), RawDmgs[1]) |
Revision as of 02:55, 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 (tonumber(RawDmgs[2]) > 0) then txtout = string.format('%s-%s', txtout, RawDmgs[2]) end if (tonumber(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 (tonumber(elemn) == 0) then txtrtn = '' else txtrtn = string.format('File:%s.png', resnm[tonumber(elemn)], resnm[tonumber(elemn)]) end return txtrtn
end
function DPS(RawDmg)
RawDmgs = mw.text.split(RawDmg,',',true)
end
return p