Module:Card: Difference between revisions

From DominionStrategy Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(42 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {} --p stands for package
function escape(str)
    local esc = mw.ustring.gsub(str, '([%^%$%(%)%%%.%[%]%*%+%-%?])', '%%%1')
    return esc
end
-- usage: {{#invoke:card|cost|Wedding}}
-- returns the cost of the card with a specific format (e.g. $0008D $06P $0403D)
function p.cost(frame)
    if not frame.args[1] then
        return ""
    end
    local card = mw.loadJsonData(frame.args[1] .. "/json")
    local coin = "$" .. string.format("%02d", card["cost"]["coin"])
    local debt = ""
    local potion = ""
    if card["cost"]["debt"] ~= 0 then
        debt = string.format("%02d", card["cost"]["debt"]) .. "D"
    end
    if card["cost"]["potion"] ~= 0 then
        potion = "P"
    end
    return coin .. card["cost"]["extra"] .. debt .. potion
end


-- usage: {{#invoke:card|amount|Province}} / {{#invoke:card|amount|Province|3}}
-- has an optional second variable for the number of players (default is 2)
-- returns the number of cards to play with
-- needs to be fixed: Copper, Silver, Gold, Curse, Ruins, Province
function p.amount(frame)
    if not frame.args[1] then
        return ""
    end
    local card = mw.loadJsonData(frame.args[1] .. "/json")
    local players = 2
    if frame.args[2] then
        players = frame.args[2]
    end
    local amounts = card["amount"]
    local amount = 0
    local victory = false
    for _, cardtype in ipairs(card["types"]) do
        if cardtype == "Victory" then
            victory = true
        end
    end
    if victory then
        if players == 2 then
            amount = amounts[1]
        else
            amount = amounts[2]
        end
    else
        for _, num in ipairs(amounts) do
            amount = amount + num
        end
    end
    return amount
end


-- usage: {{#invoke:card|query|Wedding|set}} / {{#invoke:card|query|Wedding|illustrator}}
-- generic card data query
function p.query(frame)
    if not frame.args[1] or not frame.args[2] then
        return ""
    end
    local card = mw.loadJsonData(frame.args[1] .. "/json")
    local result = card[frame.args[2]]
    if type(result) == "table" then
        if result["en"] then
            return result["en"]
        else
            for _, item in ipairs(result) do
                -- return first item
                return item
            end
        end
    end
    return result
end


local p = {} --p stands for package
-- usage: {{#invoke:card|text|Wedding}} / {{#invoke:card|text|Wedding|jp}} / {{#invoke:card|text|Wedding|en|vertical}}
function p.text(frame)
    local card = mw.loadJsonData(frame.args[1] .. "/json")
    local lang = "en"
    if frame.args[2] then
        lang = frame.args[2]
    end
    local result = card["text"][lang]
    local horizontal = true
    if frame.args[3] and frame.args[3] == "vertical" then
        horizontal = false
    end
 
    -- result = result .. "Above line.//---//Below line."
    result = mw.ustring.gsub(result, escape("//---//"), "ReplaceThisWithLine")
 
    -- local result = "A line////break"
    -- Note: had to put this first to get it to work
    if horizontal then
        result = mw.ustring.gsub(result, "////", " ")
    else
        result = mw.ustring.gsub(result, "////", "<br>")
    end
 
    -- result = result .. "Not bold or italics.%|Bold and italics.|%Not.|%%(Also bold and italics.)%%|"
    -- Note: for some reason the double escaped percent (%%%%) must be replaced before the others
    for capture in mw.ustring.gmatch(result, "%%%%([^%%]+)%%%%") do
        local heirloom = "<span style='background-color:#F0DE88'>" .. capture .. "</span>"
        result = mw.ustring.gsub(result, "%%%%" .. escape(capture) .. "%%%%", "''" .. heirloom .. "''")
    end
    for capture in mw.ustring.gmatch(result, "%%([^%%]+)%%") do
        result = mw.ustring.gsub(result, "%%" .. escape(capture) .. "%%", "''" .. capture .. "''")
    end
    for capture in mw.ustring.gmatch(result, "|([^|]+)|") do
        result = mw.ustring.gsub(result, "|" .. escape(capture) .. "|", "'''" .. capture .. "'''")
    end
 
    -- Must go after the bold code.
    -- result = result .. "Above line.//---//Below line."
    if horizontal then
        result = mw.ustring.gsub(result, "ReplaceThisWithLine", " | ")
    else
        result = mw.ustring.gsub(result, "ReplaceThisWithLine", "<hr/>")
    end
 
    -- Must go after the above line / below line code.
    -- result = result .. "Before line break//After line break. Before//After."
    if horizontal then
        result = mw.ustring.gsub(result, "//", " ")
    else
        result = mw.ustring.gsub(result, "//", "<br>")
    end
 
    -- result = result .. "{}.{-2}.{!2}"
    for capture in mw.ustring.gmatch(result, "{(![^}]+)}") do
        local vppx = "32px"
        local fontpx = "43px"
        local extraclass = 'class=coin-icon'
        if horizontal then
            fontpx = "1em"
            extraclass = extraclass .. ' imageintext'
        end
        local noexclamation = "<span style='font-size:" ..
        fontpx .. "'>" .. mw.ustring.gsub(capture, "!", "") .. "</span>"
        result = mw.ustring.gsub(result, "{" .. escape(capture) .. "}",
            noexclamation .. "[[File:VP.png|" .. vppx .. "|" .. extraclass .. "]]")
    end
    for capture in mw.ustring.gmatch(result, "{([^}]+)}") do
        result = mw.ustring.gsub(result, "{" .. escape(capture) .. "}", capture .. "[[File:VP.png|class=coin-icon imageintext]]")
    end
    for capture in mw.ustring.gmatch(result, "{}") do
        result = mw.ustring.gsub(result, "{}", "[[File:VP.png|32px|class=coin-icon imageintext]]")
    end
 
    -- result = result .. "[].[2].[!2].[P].[D].[6D]"
    for capture in mw.ustring.gmatch(result, "%[(![0-9]+)%]") do
        local coinsize = mw.ustring.gsub(capture, "!", "")
        local coinpx = "32px"
        local extraclass = 'class=coin-icon'
        if horizontal then
            extraclass = extraclass .. ' imageintext'
        end
        result = mw.ustring.gsub(result, "%[" .. escape(capture) .. "%]",
            "[[File:Coin" .. coinsize .. ".png|" .. coinpx .. "|" .. extraclass .. "]]")
    end
    for capture in mw.ustring.gmatch(result, "%[([0-9]+)%]") do
        result = mw.ustring.gsub(result, "%[" .. escape(capture) .. "%]", "[[File:Coin" .. capture .. ".png|32px|class=coin-icon imageintext]]")
    end
    for capture in mw.ustring.gmatch(result, "%[([0-9]?D+)%]") do
        local debtnum = mw.ustring.gsub(capture, "D", "")
        result = mw.ustring.gsub(result, "%[" .. escape(capture) .. "%]", "[[File:Debt" .. debtnum .. ".png|32px|class=debt-icon imageintext]]")
    end
    for capture in mw.ustring.gmatch(result, "%[(P+)%]") do
        result = mw.ustring.gsub(result, "%[" .. escape(capture) .. "%]", "[[File:Potion.png|32px|class=coin-icon imageintext]]</span>")
    end
    for capture in mw.ustring.gmatch(result, "%[%]") do
        result = mw.ustring.gsub(result, "%[%]", "[[File:Coin.png|32px|class=coin-icon imageintext]]")
    end


function p.cost(frame)
    -- result = result .. "<>.<>"
local cardcost = {
    for capture in mw.ustring.gmatch(result, "<>") do
["Abandoned Mine"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
        result = mw.ustring.gsub(result, "<>", "[[File:Sun.png|32px|class=coin-icon imageintext]]")
["Abundance"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
    end
["Academy"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
    return result
["Acolyte"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Acting Troupe"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Advance"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Adventurer"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Advisor"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Alchemist"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=1},
["Alley"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Alliance"]={["coin"]=10,["extra"]="",["debt"]=0,["potion"]=0},
["Alms"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Altar"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Amass"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Ambassador"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Amphora"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Amulet"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Animal Fair"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Annex"]={["coin"]=0,["extra"]="",["debt"]=8,["potion"]=0},
["Anvil"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Apothecary"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=1},
["Apprentice"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Approaching Army"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Aqueduct"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Archer"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Architects' Guild"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Archive"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Arena"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Aristocrat"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Armory"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Artificer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Artisan"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Artist"]={["coin"]=0,["extra"]="",["debt"]=8,["potion"]=0},
["Asceticism"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Astrolabe"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Augurs"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Avanto"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Avoid"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Bad Omens"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Bag of Gold"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Baker"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Ball"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Band of Misfits"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Band of Nomads"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Bandit"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Bandit Camp"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Bandit Fort"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Banish"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Bank"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Banquet"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Barbarian"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Bard"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Bargain"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Barge"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Baron"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Barracks"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Basilica"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Bat"]={["coin"]=2,["extra"]="*",["debt"]=0,["potion"]=0},
["Baths"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Battle Plan"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Battlefield"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Bauble"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Bazaar"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Beggar"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Berserker"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Biding Time"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Bishop"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Black Cat"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Black Market"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Blacksmith"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Blessed Village"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Blockade"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Bonfire"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Border Guard"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Border Village"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Borrow"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Bounty Hunter"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Bridge"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Bridge Troll"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Broker"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Bureaucracy"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Bureaucrat"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Buried Treasure"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Bury"]={["coin"]=1,["extra"]="",["debt"]=0,["potion"]=0},
["Bustling Village"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Butcher"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Cabin Boy"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Cache"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Cage"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Camel Train"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Canal"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Candlestick Maker"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Capital"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Capital City"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Capitalism"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Captain"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Caravan"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Caravan Guard"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Cardinal"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Cargo Ship"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Carnival"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Carpenter"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Cartographer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Castles"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Catacombs"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Catapult"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Catapult/Rocks"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Cathedral"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Cauldron"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Cavalry"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Cave Dwellers"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Cellar"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Cemetery"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Champion"]={["coin"]=6,["extra"]="*",["debt"]=0,["potion"]=0},
["Chancellor"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Change"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Changeling"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Chapel"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Chariot Race"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Charlatan"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Charm"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Cheap"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Church"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Circle of Witches"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Citadel"]={["coin"]=8,["extra"]="",["debt"]=0,["potion"]=0},
["City"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["City Gate"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["City Quarter"]={["coin"]=0,["extra"]="",["debt"]=8,["potion"]=0},
["City-state"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Clashes"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Clerk"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Coastal Haven"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Cobbler"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Coin of the Realm"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Collection"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Colonnade"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Colony"]={["coin"]=11,["extra"]="",["debt"]=0,["potion"]=0},
["Commerce"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Conclave"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Conjurer"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Conquest"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Conspirator"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Continue"]={["coin"]=0,["extra"]="",["debt"]=8,["potion"]=0},
["Contraband"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Contract"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Copper"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Coppersmith"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Coronet"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Corsair"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Council Room"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Count"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Counterfeit"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Counting House"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Courier"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Courser"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Courtier"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Courtyard"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Coven"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Crafters' Guild"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Craftsman"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Credit"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Crew"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Crop Rotation"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Crossroads"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Crown"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Crucible"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Crumbling Castle"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Crypt"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Crystal Ball"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Cultist"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Curse"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Cursed"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Cursed Gold"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Cursed Village"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Cutpurse"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Cutthroat"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Daimyo"]={["coin"]=0,["extra"]="",["debt"]=6,["potion"]=0},
["Dame Anna"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Dame Josephine"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Dame Molly"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Dame Natalie"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Dame Sylvia"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Death Cart"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Defiled Shrine"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Delay"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Deliver"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Deluded"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Delusion"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Delve"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Demand"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Demesne"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Den of Sin"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Desert Guides"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Desperation"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Destrier"]={["coin"]=6,["extra"]="*",["debt"]=0,["potion"]=0},
["Develop"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Devil's Workshop"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Diadem"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Diplomat"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Disciple"]={["coin"]=5,["extra"]="*",["debt"]=0,["potion"]=0},
["Dismantle"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Displace"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Distant Lands"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Distant Shore"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Divine Wind"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Doctor"]={["coin"]=3,["extra"]="+",["debt"]=0,["potion"]=0},
["Dominate"]={["coin"]=14,["extra"]="",["debt"]=0,["potion"]=0},
["Donate"]={["coin"]=0,["extra"]="",["debt"]=8,["potion"]=0},
["Doubloons"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Druid"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Ducat"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Duchess"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Duchy"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Duke"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Dungeon"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Duplicate"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Elder"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Embargo"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Embassy"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Emissary"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Emporium"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Encampment"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Encampment/Plunder"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Enchantress"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Enclave"]={["coin"]=8,["extra"]="",["debt"]=0,["potion"]=0},
["Endless Chalice"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Engineer"]={["coin"]=0,["extra"]="",["debt"]=4,["potion"]=0},
["Enhance"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Enlarge"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Enlightenment"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Envious"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Envoy"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Envy"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Estate"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Exorcist"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Expand"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Expedition"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Experiment"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Exploration"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Explorer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Fair"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Fairgrounds"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Faithful Hound"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Falconer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Familiar"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=1},
["Family of Inventors"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Famine"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Farm"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Farmers' Market"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Farmhands"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Farming Village"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Farmland"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Farrier"]={["coin"]=2,["extra"]="+",["debt"]=0,["potion"]=0},
["Fated"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Fawning"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Fear"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Feast"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Fellowship of Scribes"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Feodum"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Ferry"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Ferryman"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Festival"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Figurehead"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Figurine"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["First Mate"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Fisherman"]={["coin"]=5,["extra"]="*",["debt"]=0,["potion"]=0},
["Fishing Village"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Fishmonger"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Flag"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Flag Bearer"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Flagship"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Fleet"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Flourishing Trade"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Followers"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Fool"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Fool's Gold"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Footpad"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Forager"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Foray"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Foresight"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Forest Dwellers"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Forge"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Fortress"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Forts"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Fortune"]={["coin"]=8,["extra"]="",["debt"]=8,["potion"]=0},
["Fortune Hunter"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Fortune Teller"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Forum"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Fountain"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Friendly"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Frigate"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Fugitive"]={["coin"]=4,["extra"]="*",["debt"]=0,["potion"]=0},
["Galleria"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Gamble"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Gang of Pickpockets"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Gardens"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Garrison"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Gatekeeper"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Gather"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Gear"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Ghost"]={["coin"]=4,["extra"]="*",["debt"]=0,["potion"]=0},
["Ghost Ship"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Ghost Town"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Giant"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Gladiator"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Gladiator/Fortune"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Goat"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Goatherd"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Gold"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Gold Mine"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Golem"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=1},
["Gondola"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Good Harvest"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Goons"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Governor"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Grand Castle"]={["coin"]=9,["extra"]="",["debt"]=0,["potion"]=0},
["Grand Market"]={["coin"]=6,["extra"]="*",["debt"]=0,["potion"]=0},
["Graverobber"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Great Hall"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Great Leader"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Greed"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Groom"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Grotto"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Groundskeeper"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Growth"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Guard Dog"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Guardian"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Guide"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Guildhall"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Guildmaster"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Haggler"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Hamlet"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Hammer"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Harbinger"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Harbor Village"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Harem"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Harsh Winter"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Harvest"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Hasty"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Haunted Castle"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Haunted Mirror"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Haunted Woods"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Haunting"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Haven"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Herald"]={["coin"]=4,["extra"]="+",["debt"]=0,["potion"]=0},
["Herb Gatherer"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Herbalist"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Hermit"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Hero"]={["coin"]=5,["extra"]="*",["debt"]=0,["potion"]=0},
["Hideout"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Highway"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Highwayman"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Hill Fort"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Hireling"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Hoard"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Horn"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Horn of Plenty"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Horse"]={["coin"]=3,["extra"]="*",["debt"]=0,["potion"]=0},
["Horse Traders"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Hostelry"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Housecarl"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Hovel"]={["coin"]=1,["extra"]="",["debt"]=0,["potion"]=0},
["Huge Turnip"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Humble Castle"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Hunter"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Hunting Grounds"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Hunting Lodge"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Hunting Party"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Idol"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Ill-Gotten Gains"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Imp"]={["coin"]=2,["extra"]="*",["debt"]=0,["potion"]=0},
["Imperial Envoy"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Importer"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Improve"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Infirmary"]={["coin"]=3,["extra"]="+",["debt"]=0,["potion"]=0},
["Inheritance"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Inherited"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Inn"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Innkeeper"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Innovation"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Insignia"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Inspiring"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Invasion"]={["coin"]=10,["extra"]="",["debt"]=0,["potion"]=0},
["Inventor"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Invest"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Investment"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Ironmonger"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Ironworks"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Island"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Island Folk"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Jack of All Trades"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Jester"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Jewelled Egg"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Jewels"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Journey"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Journeyman"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Joust"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Junk Dealer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Keep"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Key"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Kiln"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Kind Emperor"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["King's Cache"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["King's Castle"]={["coin"]=10,["extra"]="",["debt"]=0,["potion"]=0},
["King's Court"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Kintsugi"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Kitsune"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Knights"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Laboratory"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Labyrinth"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Lackeys"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Landing Party"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Lantern"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Launch"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["League of Bankers"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["League of Shopkeepers"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Legionary"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Leprechaun"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Library"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Lich"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Lighthouse"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Litter"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Livery"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Loan"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Locusts"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Longship"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Lookout"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Looting"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Lost Arts"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Lost City"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Lost in the Woods"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Lucky Coin"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Lurker"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Madman"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Maelstrom"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Magic Lamp"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Magnate"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Magpie"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Mandarin"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Mapmaker"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Marauder"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["March"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Marchland"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Margrave"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Market"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Market Square"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Market Towns"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Maroon"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Marquis"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Masquerade"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Mastermind"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Masterpiece"]={["coin"]=3,["extra"]="+",["debt"]=0,["potion"]=0},
["Menagerie"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Mercenary"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Merchant"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Merchant Camp"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Merchant Guild"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Merchant Ship"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Messenger"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Militia"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Mill"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Miller"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Mine"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Mining Road"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Mining Village"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Minion"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Mint"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Mirror"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Miser"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Miserable"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Misery"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Mission"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Moat"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Modify"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Monastery"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Moneylender"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Monkey"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Monument"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Mountain Folk"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Mountain Pass"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Mountain Shrine"]={["coin"]=0,["extra"]="",["debt"]=5,["potion"]=0},
["Mountain Village"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Mountebank"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Museum"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Mystic"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Native Village"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Navigator"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Nearby"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Necromancer"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Necropolis"]={["coin"]=1,["extra"]="",["debt"]=0,["potion"]=0},
["Night Watchman"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Ninja"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Noble Brigand"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Nobles"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Nomad Camp"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Nomads"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Oasis"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Obelisk"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Odysseys"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Old Map"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Old Witch"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Opulent Castle"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Oracle"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Orb"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Orchard"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Order of Astrologers"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Order of Masons"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Outpost"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Overgrown Estate"]={["coin"]=1,["extra"]="",["debt"]=0,["potion"]=0},
["Overlord"]={["coin"]=0,["extra"]="",["debt"]=8,["potion"]=0},
["Paddock"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Page"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Pageant"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Palace"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Panic"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Pasture"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Pathfinding"]={["coin"]=8,["extra"]="",["debt"]=0,["potion"]=0},
["Patient"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Patrician"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Patrician/Emporium"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Patrol"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Patron"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Pawn"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Peaceful Cult"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Pearl Diver"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Peasant"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Peddler"]={["coin"]=8,["extra"]="*",["debt"]=0,["potion"]=0},
["Pendant"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Peril"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Philosopher's Stone"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=1},
["Piazza"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Pickaxe"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Pilgrim"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Pilgrimage"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Pillage"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Pious"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Pirate"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Pirate Ship"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Pixie"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Plague"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Plan"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Plateau Shepherds"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Platinum"]={["coin"]=9,["extra"]="",["debt"]=0,["potion"]=0},
["Plaza"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Plunder"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Poacher"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Poet"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Pooka"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Poor House"]={["coin"]=1,["extra"]="",["debt"]=0,["potion"]=0},
["Populate"]={["coin"]=10,["extra"]="",["debt"]=0,["potion"]=0},
["Port"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Possession"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=1},
["Potion"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Pouch"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Poverty"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Practice"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Prepare"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Priest"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Prince"]={["coin"]=8,["extra"]="",["debt"]=0,["potion"]=0},
["Princess"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Prize Goat"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Procession"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Progress"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Prosper"]={["coin"]=10,["extra"]="",["debt"]=0,["potion"]=0},
["Province"]={["coin"]=8,["extra"]="",["debt"]=0,["potion"]=0},
["Pursue"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Puzzle Box"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Quarry"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Quartermaster"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Quest"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Rabble"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Raid"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Raider"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Ranger"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Rapid Expansion"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Ratcatcher"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Rats"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Raze"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Reap"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Rebuild"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Receive Tribute"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Reckless"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Recruiter"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Relic"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Remake"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Remodel"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Renown"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Replace"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Research"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Rice"]={["coin"]=7,["extra"]="",["debt"]=0,["potion"]=0},
["Rice Broker"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Rich"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Ride"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Ritual"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["River Shrine"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Riverboat"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Road Network"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Rocks"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Rogue"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Ronin"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Root Cellar"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Rope"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Royal Blacksmith"]={["coin"]=0,["extra"]="",["debt"]=8,["potion"]=0},
["Royal Carriage"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Royal Galley"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Royal Seal"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Ruined Library"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Ruined Market"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Ruined Village"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Rush"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Rustic Village"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Saboteur"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sack of Loot"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Sacred Grove"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sacrifice"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Sage"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Sailor"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Salt the Earth"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Salvager"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Samurai"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Sanctuary"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sauna"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Sauna/Avanto"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Save"]={["coin"]=1,["extra"]="",["debt"]=0,["potion"]=0},
["Scavenger"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Scepter"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Scheme"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Scholar"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Scout"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Scouting Party"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Scrap"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Scrounge"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Scrying Pool"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=1},
["Sculptor"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sea Chart"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Sea Hag"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Sea Trade"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Sea Witch"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Search"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Seaway"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Secluded Shrine"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Secret Cave"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Secret Chamber"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Secret Passage"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Seer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Seize the Day"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Sentinel"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Sentry"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Settlers"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Settlers/Bustling Village"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Sewers"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Sextant"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Shaman"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Shanty Town"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Sheepdog"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Shepherd"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Shield"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Shop"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Shy"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Sibyl"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Sickness"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Silk Merchant"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Silk Road"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Silos"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Silver"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Silver Mine"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sinister Plot"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Sir Bailey"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sir Destry"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sir Martin"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Sir Michael"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sir Vander"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Siren"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Skirmisher"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Skulk"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Sleigh"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Small Castle"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Smithy"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Smugglers"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Snake Witch"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Snowy Village"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Soldier"]={["coin"]=3,["extra"]="*",["debt"]=0,["potion"]=0},
["Soothsayer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sorcerer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sorceress"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Souk"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Specialist"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Spell Scroll"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Spice Merchant"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Spices"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Spoils"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Sprawling Castle"]={["coin"]=8,["extra"]="",["debt"]=0,["potion"]=0},
["Spy"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Squire"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Stables"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Staff"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Stampede"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Star Chart"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Stash"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Steward"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Stockpile"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Stonemason"]={["coin"]=2,["extra"]="+",["debt"]=0,["potion"]=0},
["Storeroom"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Storyteller"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Stowaway"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Stronghold"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Student"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Summon"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Sunken Treasure"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Supplies"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Survivors"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Swamp Hag"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Swamp Shacks"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Swap"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Swashbuckler"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Swindler"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Sword"]={["coin"]=7,["extra"]="*",["debt"]=0,["potion"]=0},
["Sycophant"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Tactician"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Talisman"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Tanuki"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Taskmaster"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Tax"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Taxman"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Tea House"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Teacher"]={["coin"]=6,["extra"]="*",["debt"]=0,["potion"]=0},
["Temple"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Tent"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Territory"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["The Earth's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Field's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Flame's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Forest's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Moon's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Mountain's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The River's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Sea's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Sky's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Sun's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Swamp's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["The Wind's Gift"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Thief"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Throne Room"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Tiara"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Tide Pools"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Tireless"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Toil"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Tomb"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Tools"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Tormentor"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Torturer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Tournament"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Tower"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Town"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Town Crier"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Townsfolk"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Tracker"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Trade"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Trade Route"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Trader"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Trading Post"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Tragic Hero"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Trail"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Training"]={["coin"]=6,["extra"]="",["debt"]=0,["potion"]=0},
["Transmogrify"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Transmute"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=1},
["Transport"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Trappers' Lodge"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Travelling Fair"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Treasure Chest"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Treasure Hunter"]={["coin"]=3,["extra"]="*",["debt"]=0,["potion"]=0},
["Treasure Map"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Treasure Trove"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Treasurer"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Treasury"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Tribute"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Trickster"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Triumph"]={["coin"]=0,["extra"]="",["debt"]=5,["potion"]=0},
["Triumphal Arch"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Trusty Steed"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Tunnel"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Twice Miserable"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Underling"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["University"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=1},
["Upgrade"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Urchin"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Vagrant"]={["coin"]=2,["extra"]="",["debt"]=0,["potion"]=0},
["Vampire"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Vassal"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Vault"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Venture"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Villa"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Village"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Village Green"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Villain"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Vineyard"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=1},
["Voyage"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Wall"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Walled Village"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Wandering Minstrel"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["War"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["War Chest"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Warehouse"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Warlord"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Warrior"]={["coin"]=4,["extra"]="*",["debt"]=0,["potion"]=0},
["Watchtower"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Butterfly"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Camel"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Chameleon"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Frog"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Goat"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Horse"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Mole"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Monkey"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Mouse"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Mule"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Otter"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Owl"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Ox"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Pig"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Rat"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Seal"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Sheep"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Squirrel"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Turtle"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Way of the Worm"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Wayfarer"]={["coin"]=6,["extra"]="*",["debt"]=0,["potion"]=0},
["Wealthy Village"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Weaver"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Wedding"]={["coin"]=4,["extra"]="",["debt"]=3,["potion"]=0},
["Werewolf"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Wharf"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Wheelwright"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Wild Hunt"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Will-o'-Wisp"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Windfall"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Wine Merchant"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Wish"]={["coin"]=0,["extra"]="*",["debt"]=0,["potion"]=0},
["Wishing Well"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Witch"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Witch's Hut"]={["coin"]=5,["extra"]="",["debt"]=0,["potion"]=0},
["Wizards"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Wolf Den"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Woodcutter"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Woodworkers' Guild"]={["coin"]=0,["extra"]="",["debt"]=0,["potion"]=0},
["Worker's Village"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Workshop"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Young Witch"]={["coin"]=4,["extra"]="",["debt"]=0,["potion"]=0},
["Zombie Apprentice"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Zombie Mason"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
["Zombie Spy"]={["coin"]=3,["extra"]="",["debt"]=0,["potion"]=0},
}
if not cardcost[frame.args[1]] then
    return ""
end
cardcost[frame.args[1]]["coin"] = "$" .. string.format("%02d", cardcost[frame.args[1]]["coin"])
if cardcost[frame.args[1]]["debt"] == 0 then
cardcost[frame.args[1]]["debt"] = ""
else
cardcost[frame.args[1]]["debt"] = string.format("%02d", cardcost[frame.args[1]]["debt"]) .. "D"
end
if cardcost[frame.args[1]]["potion"] == 0 then
cardcost[frame.args[1]]["potion"] = ""
else
cardcost[frame.args[1]]["potion"] = "P"
end
return cardcost[frame.args[1]]["coin"]..cardcost[frame.args[1]]["extra"]..cardcost[frame.args[1]]["debt"]..cardcost[frame.args[1]]["potion"]
end
end


return p
return p

Latest revision as of 22:44, 27 September 2024

Usage

{{#invoke:card|cost|Donate}}
{{#invoke:card|cost|Possession}}
{{#invoke:card|cost|Wedding}}

$0008D $06P $0403D

{{#invoke:card|amount|Province}}
{{#invoke:card|amount|Province|3}}
{{#invoke:card|amount|Castles}}
{{#invoke:card|amount|Castles|3}}
{{#invoke:card|amount|Augurs}}
{{#invoke:card|amount|Smithy}}

8 12 8 12 16 10

{{#invoke:card|query|Wedding|set}}
{{#invoke:card|query|Wedding|illustrator}}

Empires Joshua Stewart

{{#invoke:card|text|Wedding}}

+1 Gain a Gold.

{{#invoke:card|text|Abundance}}

The next time you gain an Action card, +1 Buy and +.

{{#invoke:card|text|Wedding|de}}

+1 Nimm dir ein Gold.

{{#invoke:card|text|Abundance|de}}

Das nächste Mal, wenn du eine Aktionskarte nimmst: +1 Kauf und +.

{{#invoke:card|text|Capital}}

+1 Buy | When you discard this from play, take , and then you may pay off .

<span style='text-align:center; display:block; float:left;'>{{#invoke:card|text|Capital|en|vertical}}</span>{{clear|left}}

+1 Buy
When you discard this from
play, take , and then you
may pay off .
{{#invoke:card|text|Cemetery}}

2 | When you gain this, trash up to 4 cards from your hand. (Heirloom: Haunted Mirror)

<span style='text-align:center; display:block; float:left;'>{{#invoke:card|text|Cemetery|en|vertical}}</span>{{clear|left}}
2
When you gain this, trash up
to 4 cards from your hand.
(Heirloom: Haunted Mirror)
{{#invoke:card|text|Pooka}}

You may trash a Treasure other than Cursed Gold from your hand, for +4 Cards. (Heirloom: Cursed Gold)

{{#invoke:card|text|Miserable}}

-2

<span style='text-align:center; display:block; float:left;'>{{#invoke:card|text|Miserable|en|vertical}}</span>{{clear|left}}

-2

{{#invoke:card|text|Province}}

6

<span style='text-align:center; display:block; float:left;'>{{#invoke:card|text|Province|en|vertical}}</span>{{clear|left}}

6

{{#invoke:card|text|Gold}}

<span style='text-align:center; display:block; float:left;'>{{#invoke:card|text|Gold|en|vertical}}</span>{{clear|left}}

{{#invoke:card|text|Hunting Grounds|jp}}

+4 カードを引く | これを廃棄したとき、 公領1枚か屋敷3枚を 獲得する。

{{#invoke:card|text|Tea House}}

+1 +1 Card +1 Action +

{{#invoke:card|text|Tea House|jp}}

+1 +1 カードを引く +1 アクション

{{#invoke:card|text|Apprentice}}

+1 Action Trash a card from your hand. +1 Card per it costs. +2 Cards if it has in its cost.


local p = {} --p stands for package

function escape(str)
    local esc = mw.ustring.gsub(str, '([%^%$%(%)%%%.%[%]%*%+%-%?])', '%%%1')
    return esc
end

-- usage: {{#invoke:card|cost|Wedding}}
-- returns the cost of the card with a specific format (e.g. $0008D $06P $0403D)
function p.cost(frame)
    if not frame.args[1] then
        return ""
    end
    local card = mw.loadJsonData(frame.args[1] .. "/json")
    local coin = "$" .. string.format("%02d", card["cost"]["coin"])
    local debt = ""
    local potion = ""
    if card["cost"]["debt"] ~= 0 then
        debt = string.format("%02d", card["cost"]["debt"]) .. "D"
    end
    if card["cost"]["potion"] ~= 0 then
        potion = "P"
    end
    return coin .. card["cost"]["extra"] .. debt .. potion
end

-- usage: {{#invoke:card|amount|Province}} / {{#invoke:card|amount|Province|3}}
-- has an optional second variable for the number of players (default is 2)
-- returns the number of cards to play with
-- needs to be fixed: Copper, Silver, Gold, Curse, Ruins, Province
function p.amount(frame)
    if not frame.args[1] then
        return ""
    end
    local card = mw.loadJsonData(frame.args[1] .. "/json")
    local players = 2
    if frame.args[2] then
        players = frame.args[2]
    end
    local amounts = card["amount"]
    local amount = 0
    local victory = false
    for _, cardtype in ipairs(card["types"]) do
        if cardtype == "Victory" then
            victory = true
        end
    end
    if victory then
        if players == 2 then
            amount = amounts[1]
        else
            amount = amounts[2]
        end
    else
        for _, num in ipairs(amounts) do
            amount = amount + num
        end
    end
    return amount
end

-- usage: {{#invoke:card|query|Wedding|set}} / {{#invoke:card|query|Wedding|illustrator}}
-- generic card data query
function p.query(frame)
    if not frame.args[1] or not frame.args[2] then
        return ""
    end
    local card = mw.loadJsonData(frame.args[1] .. "/json")
    local result = card[frame.args[2]]
    if type(result) == "table" then
        if result["en"] then
            return result["en"]
        else
            for _, item in ipairs(result) do
                -- return first item
                return item
            end
        end
    end
    return result
end

-- usage: {{#invoke:card|text|Wedding}} / {{#invoke:card|text|Wedding|jp}} / {{#invoke:card|text|Wedding|en|vertical}}
function p.text(frame)
    local card = mw.loadJsonData(frame.args[1] .. "/json")
    local lang = "en"
    if frame.args[2] then
        lang = frame.args[2]
    end
    local result = card["text"][lang]
    local horizontal = true
    if frame.args[3] and frame.args[3] == "vertical" then
        horizontal = false
    end

    -- result = result .. "Above line.//---//Below line."
    result = mw.ustring.gsub(result, escape("//---//"), "ReplaceThisWithLine")

    -- local result = "A line////break"
    -- Note: had to put this first to get it to work
    if horizontal then
        result = mw.ustring.gsub(result, "////", " ")
    else
        result = mw.ustring.gsub(result, "////", "<br>")
    end

    -- result = result .. "Not bold or italics.%|Bold and italics.|%Not.|%%(Also bold and italics.)%%|"
    -- Note: for some reason the double escaped percent (%%%%) must be replaced before the others
    for capture in mw.ustring.gmatch(result, "%%%%([^%%]+)%%%%") do
        local heirloom = "<span style='background-color:#F0DE88'>" .. capture .. "</span>"
        result = mw.ustring.gsub(result, "%%%%" .. escape(capture) .. "%%%%", "''" .. heirloom .. "''")
    end
    for capture in mw.ustring.gmatch(result, "%%([^%%]+)%%") do
        result = mw.ustring.gsub(result, "%%" .. escape(capture) .. "%%", "''" .. capture .. "''")
    end
    for capture in mw.ustring.gmatch(result, "|([^|]+)|") do
        result = mw.ustring.gsub(result, "|" .. escape(capture) .. "|", "'''" .. capture .. "'''")
    end

    -- Must go after the bold code.
    -- result = result .. "Above line.//---//Below line."
    if horizontal then
        result = mw.ustring.gsub(result, "ReplaceThisWithLine", " | ")
    else
        result = mw.ustring.gsub(result, "ReplaceThisWithLine", "<hr/>")
    end

    -- Must go after the above line / below line code.
    -- result = result .. "Before line break//After line break. Before//After."
    if horizontal then
        result = mw.ustring.gsub(result, "//", " ")
    else
        result = mw.ustring.gsub(result, "//", "<br>")
    end

    -- result = result .. "{}.{-2}.{!2}"
    for capture in mw.ustring.gmatch(result, "{(![^}]+)}") do
        local vppx = "32px"
        local fontpx = "43px"
        local extraclass = 'class=coin-icon'
        if horizontal then
            fontpx = "1em"
            extraclass = extraclass .. ' imageintext'
        end
        local noexclamation = "<span style='font-size:" ..
        fontpx .. "'>" .. mw.ustring.gsub(capture, "!", "") .. "</span>"
        result = mw.ustring.gsub(result, "{" .. escape(capture) .. "}",
            noexclamation .. "[[File:VP.png|" .. vppx .. "|" .. extraclass .. "]]")
    end
    for capture in mw.ustring.gmatch(result, "{([^}]+)}") do
        result = mw.ustring.gsub(result, "{" .. escape(capture) .. "}", capture .. "[[File:VP.png|class=coin-icon imageintext]]")
    end
    for capture in mw.ustring.gmatch(result, "{}") do
        result = mw.ustring.gsub(result, "{}", "[[File:VP.png|32px|class=coin-icon imageintext]]")
    end

    -- result = result .. "[].[2].[!2].[P].[D].[6D]"
    for capture in mw.ustring.gmatch(result, "%[(![0-9]+)%]") do
        local coinsize = mw.ustring.gsub(capture, "!", "")
        local coinpx = "32px"
        local extraclass = 'class=coin-icon'
        if horizontal then
            extraclass = extraclass .. ' imageintext'
        end
        result = mw.ustring.gsub(result, "%[" .. escape(capture) .. "%]",
            "[[File:Coin" .. coinsize .. ".png|" .. coinpx .. "|" .. extraclass .. "]]")
    end
    for capture in mw.ustring.gmatch(result, "%[([0-9]+)%]") do
        result = mw.ustring.gsub(result, "%[" .. escape(capture) .. "%]", "[[File:Coin" .. capture .. ".png|32px|class=coin-icon imageintext]]")
    end
    for capture in mw.ustring.gmatch(result, "%[([0-9]?D+)%]") do
        local debtnum = mw.ustring.gsub(capture, "D", "")
        result = mw.ustring.gsub(result, "%[" .. escape(capture) .. "%]", "[[File:Debt" .. debtnum .. ".png|32px|class=debt-icon imageintext]]")
    end
    for capture in mw.ustring.gmatch(result, "%[(P+)%]") do
        result = mw.ustring.gsub(result, "%[" .. escape(capture) .. "%]", "[[File:Potion.png|32px|class=coin-icon imageintext]]</span>")
    end
    for capture in mw.ustring.gmatch(result, "%[%]") do
        result = mw.ustring.gsub(result, "%[%]", "[[File:Coin.png|32px|class=coin-icon imageintext]]")
    end

    -- result = result .. "<>.<>"
    for capture in mw.ustring.gmatch(result, "<>") do
        result = mw.ustring.gsub(result, "<>", "[[File:Sun.png|32px|class=coin-icon imageintext]]")
    end
    return result
end

return p