Module:Change

--[==[-- -- LUA script to get Reward Changes -- getRC: get Reward Changes data based on input parameters --]==]

local p = {}

local EC = require("Module:EC").getEC local UpdateNo = require("Module:UpdateNumber").getVersion local util = require("Module:Utility")

function p.getRC(frame) local tArgs = util.getArgs(frame)

local tRC = { "* ", "", "The ", "", " rewards", " changed from ", "", tArgs[3], " to ", "", tArgs[4], "", "", "", "", "", "", "", "", "", "",		"", "", "", "", "", "", "", "", "", "",		"", "", "", "", "", "", "", "", "", "",		"", "", "", "", "", "", "", "", "", "",		" with ", UpdateNo({tArgs[1], "D"}), "." }

if tArgs[5] then tRC[12] = " and" if tArgs[8] then tRC[12] = "," tRC[22] = " and" if tArgs[11] then tRC[12] = "," tRC[22] = "," tRC[32] = " and" if tArgs[11] then tRC[12] = "," tRC[22] = "," tRC[32] = "," tRC[42] = " and" end end end end

if tArgs[2] == "Elixirs" then tRC[5] = "purchase cost" tRC[7] = EC({tArgs[2]}) tRC[10] = EC({tArgs[2]}) elseif tArgs[2] == "Cost" then tRC[5] = "purchase cost" if tArgs[3] ~= "FREE" then tRC[8] = EC({tArgs[3]}) end if tArgs[4] ~= "FREE" then tRC[11] = EC({tArgs[4]}) end elseif tArgs[2] == "Build" then tRC[5] = "building time" elseif tArgs[2] == "Time" then tRC[5] = "collection time" elseif tArgs[2] == "Rarity" then tRC[5] = "rarity" elseif tArgs[2] == "Size" then tRC[5] = "size" else tRC[4] = tArgs[2] .. " (" .. EC({tArgs[2]}) .. ")" end if tArgs[5] then tRC[13] = " the " tRC[14] = tArgs[5] .. " (" .. EC({tArgs[5]}) .. ")" tRC[15] = " reward" tRC[16] = " changed from " tRC[18] = tArgs[6] tRC[19] = " to " tRC[21] = tArgs[7] if tArgs[5] == "Build" then tRC[14] = "" tRC[15] = "building time" elseif tArgs[5] == "Cost" then tRC[14] = "" tRC[15] = "purchase cost" if tArgs[6] ~= "FREE" then tRC[18] = EC({tArgs[6]}) end if tArgs[7] ~= "FREE" then tRC[21] = EC({tArgs[7]}) end elseif tArgs[5] == "Time" then tRC[14] = "" tRC[15] = "collection time" elseif tArgs[5] == "Rarity" then tRC[14] = "" tRC[15] = "rarity" elseif tArgs[5] == "Size" then tRC[14] = "" tRC[15] = "size" end end

if tArgs[8] then tRC[23] = " the " tRC[24] = tArgs[8] .. " (" .. EC({tArgs[8]}) .. ")" tRC[25] = " reward" tRC[26] = " changed from " tRC[28] = tArgs[9] tRC[29] = " to " tRC[31] = tArgs[10] if tArgs[8] == "Build" then tRC[24] = "" tRC[25] = "building time" elseif tArgs[8] == "Cost" then tRC[24] = "" tRC[25] = "purchase cost" if tArgs[9] ~= "FREE" then tRC[28] = EC({tArgs[9]}) end if tArgs[10] ~= "FREE" then tRC[31] = EC({tArgs[10]}) end elseif tArgs[8] == "Time" then tRC[24] = "" tRC[25] = "collection time" elseif tArgs[8] == "Rarity" then tRC[24] = "" tRC[25] = "rarity" elseif tArgs[8] == "Size" then tRC[24] = "" tRC[25] = "size" end end if tArgs[11] then tRC[33] = " the " tRC[34] = tArgs[11] .. " (" .. EC({tArgs[11]}) .. ")" tRC[35] = " reward" tRC[36] = " changed from " tRC[38] = tArgs[12] tRC[39] = " to " tRC[41] = tArgs[13] if tArgs[11] == "Build" then tRC[34] = "" tRC[35] = "building time" elseif tArgs[11] == "Cost" then tRC[34] = "" tRC[35] = "purchase cost" if tArgs[12] ~= "FREE" then tRC[38] = EC({tArgs[12]}) end if tArgs[13] ~= "FREE" then tRC[41] = EC({tArgs[13]}) end elseif tArgs[11] == "Time" then tRC[34] = "" tRC[35] = "collection time" elseif tArgs[11] == "Rarity" then tRC[34] = "" tRC[35] = "rarity" elseif tArgs[11] == "Size" then tRC[34] = "" tRC[35] = "size" end end if tArgs[14] then tRC[43] = " the " tRC[44] = tArgs[14] .. " (" .. EC({tArgs[14]}) .. ")" tRC[45] = " reward" tRC[46] = " changed from " tRC[48] = tArgs[15] tRC[49] = " to " tRC[51] = tArgs[16] if tArgs[14] == "Build" then tRC[44] = "" tRC[45] = "building time" elseif tArgs[14] == "Cost" then tRC[44] = "" tRC[45] = "purchase cost" if tArgs[15] ~= "FREE" then tRC[48] = EC({tArgs[15]}) end if tArgs[16] ~= "FREE" then tRC[51] = EC({tArgs[16]}) end elseif tArgs[14] == "Time" then tRC[44] = "" tRC[45] = "collection time" elseif tArgs[14] == "Rarity" then tRC[44] = "" tRC[45] = "rarity" elseif tArgs[14] == "Size" then tRC[44] = "" tRC[45] = "size" end end return table.concat(tRC) end

return p