|
|
| Line 1: |
Line 1: |
| return {
| | local p = {} |
| ["Woodcutter"] = {
| | |
| ["name"] = "Woodcutter",
| | local buildingData = require("Module:BuildingData") |
| ["building_icon_filename"] = "T ICO resource Hardwood.png",
| | local resourceData = require("Module:ResourceData") |
| ["category"] = "Materials",
| | |
| ["theme"] = "",
| | local function getResourceIcon(resourceName) |
| ["description"] = "",
| | local data = resourceData[resourceName] |
| ["unlocked_by_1"] = "",
| | if not data then |
| ["unlocked_by_2"] = "",
| | error("Unknown resource: " .. tostring(resourceName)) |
| ["unlocked_by_3"] = "",
| | end |
| ["housing"] = 0,
| | return data.iconFile |
| ["hands_builders"] = 2,
| | end |
| ["hands_fetchers"] = 0,
| | |
| ["hands_greenhands"] = 2,
| | local function stackFormat(inputs) |
| ["hands_masterhands"] = 0,
| | if not inputs then |
| ["hands_upkeep_1"] = "Stew",
| | return "''None''" |
| ["hands_upkeep_1_qty"] = 2,
| | end |
| ["hands_upkeep_2"] = "",
| | |
| ["hands_upkeep_2_qty"] = 0,
| | local parts = {} |
| ["hands_upkeep_3"] = "",
| | |
| ["hands_upkeep_3_qty"] = 0,
| | for _, item in ipairs(inputs) do |
| ["construction"] = {
| | if item.resource ~= "" and (item.qty or 0) > 0 then |
| {
| | table.insert(parts, item.qty .. " [[File:" .. getResourceIcon(item.resource) .. "|16px]] " .. item.resource) |
| ["resource"] = "",
| | end |
| ["qty"] = 0
| | end |
| },
| | |
| {
| | if #parts == 0 then |
| ["resource"] = "",
| | return "'' |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Hardwood",
| |
| ["production_output_qty"] = 8,
| |
| ["production_base_per_min"] = 8,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Sawmill"] = {
| |
| ["name"] = "Sawmill",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Materials",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 3,
| |
| ["hands_fetchers"] = 1,
| |
| ["hands_greenhands"] = 2,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 2,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Hardwood",
| |
| ["qty"] = 10
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "Hardwood",
| |
| ["qty"] = 4
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Planks",
| |
| ["production_output_qty"] = 10,
| |
| ["production_base_per_min"] = 10,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Quarry"] = {
| |
| ["name"] = "Quarry",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Materials",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 2,
| |
| ["hands_fetchers"] = 0,
| |
| ["hands_greenhands"] = 2,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 2,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 25
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Stone",
| |
| ["production_output_qty"] = 6,
| |
| ["production_base_per_min"] = 6,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Stonecutter"] = {
| |
| ["name"] = "Stonecutter",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Materials",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 3,
| |
| ["hands_fetchers"] = 1,
| |
| ["hands_greenhands"] = 2,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 2,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 12
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "Stone",
| |
| ["qty"] = 2
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Stone Blocks",
| |
| ["production_output_qty"] = 5,
| |
| ["production_base_per_min"] = 5,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Charburner"] = {
| |
| ["name"] = "Charburner",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Materials",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 4,
| |
| ["hands_fetchers"] = 2,
| |
| ["hands_greenhands"] = 2,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 2,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 30
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "Hardwood",
| |
| ["qty"] = 6
| |
| },
| |
| {
| |
| ["resource"] = "Stone",
| |
| ["qty"] = 2
| |
| }
| |
| },
| |
| ["production_output"] = "Charcoal",
| |
| ["production_output_qty"] = 16,
| |
| ["production_base_per_min"] = 16,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Guano Gatherer"] = {
| |
| ["name"] = "Guano Gatherer",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Weapons",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 2,
| |
| ["hands_fetchers"] = 0,
| |
| ["hands_greenhands"] = 2,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 2,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 30
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Guano",
| |
| ["production_output_qty"] = 12,
| |
| ["production_base_per_min"] = 12,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Powdermill"] = {
| |
| ["name"] = "Powdermill",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Weapons",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 4,
| |
| ["hands_fetchers"] = 2,
| |
| ["hands_greenhands"] = 2,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 2,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 25
| |
| },
| |
| {
| |
| ["resource"] = "Stone Blocks",
| |
| ["qty"] = 25
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "Guano",
| |
| ["qty"] = 6
| |
| },
| |
| {
| |
| ["resource"] = "Charcoal",
| |
| ["qty"] = 2
| |
| }
| |
| },
| |
| ["production_output"] = "Black Powder",
| |
| ["production_output_qty"] = 10,
| |
| ["production_base_per_min"] = 10,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Leafcutter"] = {
| |
| ["name"] = "Leafcutter",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Materials",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 2,
| |
| ["hands_fetchers"] = 0,
| |
| ["hands_greenhands"] = 2,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 2,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 25
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Fibre",
| |
| ["production_output_qty"] = 12,
| |
| ["production_base_per_min"] = 12,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Rope Maker"] = {
| |
| ["name"] = "Rope Maker",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Ships",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 3,
| |
| ["hands_fetchers"] = 1,
| |
| ["hands_greenhands"] = 2,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 2,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 25
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "Fibre",
| |
| ["qty"] = 4
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Rope",
| |
| ["production_output_qty"] = 6,
| |
| ["production_base_per_min"] = 6,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Hardwood Workshop"] = {
| |
| ["name"] = "Hardwood Workshop",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Equipment",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 2,
| |
| ["hands_fetchers"] = 1,
| |
| ["hands_greenhands"] = 1,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 1,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 25
| |
| },
| |
| {
| |
| ["resource"] = "Stone Blocks",
| |
| ["qty"] = 15
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "Hardwood",
| |
| ["qty"] = 2
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Wooden Awl",
| |
| ["production_output_qty"] = 6,
| |
| ["production_base_per_min"] = 6,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Weaver"] = {
| |
| ["name"] = "Weaver",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Materials",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 5,
| |
| ["hands_fetchers"] = 2,
| |
| ["hands_greenhands"] = 3,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 3,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 25
| |
| },
| |
| {
| |
| ["resource"] = "Stone Blocks",
| |
| ["qty"] = 15
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "Wooden Awl",
| |
| ["qty"] = 6
| |
| },
| |
| {
| |
| ["resource"] = "Fibre",
| |
| ["qty"] = 4
| |
| }
| |
| },
| |
| ["production_output"] = "Fabric",
| |
| ["production_output_qty"] = 8,
| |
| ["production_base_per_min"] = 8,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
| ["Sail Maker"] = {
| |
| ["name"] = "Sail Maker",
| |
| ["building_icon_filename"] = "",
| |
| ["category"] = "Ships",
| |
| ["theme"] = "",
| |
| ["description"] = "",
| |
| ["unlocked_by_1"] = "",
| |
| ["unlocked_by_2"] = "",
| |
| ["unlocked_by_3"] = "",
| |
| ["housing"] = 0,
| |
| ["hands_builders"] = 6,
| |
| ["hands_fetchers"] = 1,
| |
| ["hands_greenhands"] = 5,
| |
| ["hands_masterhands"] = 0,
| |
| ["hands_upkeep_1"] = "Stew",
| |
| ["hands_upkeep_1_qty"] = 5,
| |
| ["hands_upkeep_2"] = "",
| |
| ["hands_upkeep_2_qty"] = 0,
| |
| ["hands_upkeep_3"] = "",
| |
| ["hands_upkeep_3_qty"] = 0,
| |
| ["construction"] = {
| |
| {
| |
| ["resource"] = "Planks",
| |
| ["qty"] = 30
| |
| },
| |
| {
| |
| ["resource"] = "Stone Blocks",
| |
| ["qty"] = 20
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["construction_requires_fertile_area"] = false,
| |
| ["production_input"] = {
| |
| {
| |
| ["resource"] = "Fabric",
| |
| ["qty"] = 8
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| },
| |
| ["production_output"] = "Sails",
| |
| ["production_output_qty"] = 4,
| |
| ["production_base_per_min"] = 4,
| |
| ["production_booster_1"] = "",
| |
| ["production_booster_2"] = "",
| |
| ["production_output_storage"] = 0,
| |
| ["community_upkeep"] = {
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| },
| |
| {
| |
| ["resource"] = "",
| |
| ["qty"] = 0
| |
| }
| |
| }
| |
| },
| |
This module can display buildings from the 4 separate major categories.
- Housing
- Production
- Community
- Principle
Each category table displays relevant stats for that respective category.
local p = {}
local buildingData = require("Module:BuildingData")
local resourceData = require("Module:ResourceData")
local function getResourceIcon(resourceName)
local data = resourceData[resourceName]
if not data then
error("Unknown resource: " .. tostring(resourceName))
end
return data.iconFile
end
local function stackFormat(inputs)
if not inputs then
return "''None''"
end
local parts = {}
for _, item in ipairs(inputs) do
if item.resource ~= "" and (item.qty or 0) > 0 then
table.insert(parts, item.qty .. " [[File:" .. getResourceIcon(item.resource) .. "|16px]] " .. item.resource)
end
end
if #parts == 0 then
return "''None''"
end
return table.concat(parts, "<br/>")
end
function p.producers(frame)
local out = {}
table.insert(out, '{| class="wikitable sortable"')
table.insert(out, '!class="unsortable"| Icon !! Name !! Category !! Dedicated Workers !! Product !! Input !! Building Cost')
for _, building in pairs(buildingData) do
local icon = building.building_icon_filename
if icon == nil or icon == "" then
icon = "T ICO resource Hardwood.png"
end
local workers = (building.hands_greenhands or 0) + (building.hands_masterhands or 0)
if workers > 0 then
local cost = "''None''"
-- Build construction cost string
local parts = {}
for _, item in ipairs(building.construction or {}) do
if item.qty > 0 and item.resource ~= "" then
table.insert(parts,
string.format("%d [[%s]]", item.qty, item.resource))
end
end
table.insert(out, "|-")
table.insert(out,
string.format(
"| {{Producer icon|T ICO resource Hardwood.png |size=lg}} || [[%s]] || %s || %d [[Pirates|Greenhands]] || [[%s]] || %s || %s",
-- icon,
building.name,
building.category,
workers,
building.production_output or "",
stackFormat(building.production_input) or "''None''",
stackFormat(building.construction) or "''None''"
)
)
end
end
table.insert(out, "|}")
return table.concat(out, "\n")
end
function p.housing(frame)
local out = {}
table.insert(out, '{| class="wikitable sortable"')
table.insert(out, '!class="unsortable"| Icon !! Name !! Capacity !! Unlock Requirement !! Building Cost')
for _, building in pairs(buildingData) do
local icon = building.building_icon_filename
if icon == nil or icon == "" then
icon = "T ICO resource Hardwood.png"
end
if building.housing > 0 then
local cost = "''None''"
-- Build construction cost string
local parts = {}
for _, item in ipairs(building.construction or {}) do
if item.qty > 0 and item.resource ~= "" then
table.insert(parts,
string.format("%d [[%s]]", item.qty, item.resource))
end
end
table.insert(out, "|-")
table.insert(out,
string.format(
"| {{Producer icon|T ICO resource Hardwood.png |size=lg}} || [[%s]] || %d || %s || %s",
-- icon,
building.name,
building.housing,
building.unlocked_by_1 or "",
stackFormat(building.construction) or "''None''"
)
)
end
end
table.insert(out, "|}")
return table.concat(out, "\n")
end
function p.principle(frame)
local out = {}
table.insert(out, '{| class="wikitable sortable"')
table.insert(out, '!class="unsortable"| Icon !! Name !! Effect !! Unlock Requirement !! Building Cost')
for _, building in pairs(buildingData) do
local icon = building.building_icon_filename
if icon == nil or icon == "" then
icon = "T ICO resource Hardwood.png"
end
if building.category == "Principle" then
local cost = "''None''"
-- Build construction cost string
local parts = {}
for _, item in ipairs(building.construction or {}) do
if item.qty > 0 and item.resource ~= "" then
table.insert(parts,
string.format("%d [[%s]]", item.qty, item.resource))
end
end
table.insert(out, "|-")
table.insert(out,
string.format(
"| {{Producer icon|T ICO resource Hardwood.png |size=lg}} || [[%s]] || %s || %s || %s",
-- icon,
building.name,
building.description,
building.unlocked_by_1 or "",
stackFormat(building.construction) or "''None''"
)
)
end
end
table.insert(out, "|}")
return table.concat(out, "\n")
end
function p.community(frame)
local out = {}
table.insert(out, '{| class="wikitable sortable"')
table.insert(out, "!class='unsortable'| Icon !! Name !! Dedicated Workers<br/>''Without [[Pirates|Drifters]]'' !! Function !! Resource Input !! Building Cost")
for _, building in pairs(buildingData) do
local icon = building.building_icon_filename
if icon == nil or icon == "" then
icon = "T ICO resource Hardwood.png"
end
if building.category == "Community" then
local cost = "''None''"
-- Build construction cost string
local parts = {}
for _, item in ipairs(building.construction or {}) do
if item.qty > 0 and item.resource ~= "" then
table.insert(parts,
string.format("%d [[%s]]", item.qty, item.resource))
end
end
table.insert(out, "|-")
table.insert(out,
string.format(
"| {{Producer icon|T ICO resource Hardwood.png |size=lg}} || [[%s]] || %d [[Pirates|Builders]] || %s || %s || %s",
-- icon,
building.name,
building.hands_builders,
building.description,
stackFormat(building.community_upkeep) or "''None''",
stackFormat(building.construction) or "''None''"
)
)
end
end
table.insert(out, "|}")
return table.concat(out, "\n")
end
return p