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[2] == "Elixirs" then tRC[5] = "purchase cost" tRC[7] = EC({tArgs[2]}) tRC[10] = EC({tArgs[2]}) 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] = "raity" elseif tArgs[2] == "Size" then tRC[5] = "size" else tRC[4] = tArgs[2] .. " (" .. EC({tArgs[2]}) .. ")" end

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" end end 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] == "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] == "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] == "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 return table.concat(tRC) end

return p