Module:ResourceData: Difference between revisions

From Against the Storm Official Wiki
No edit summary
(moving requires to global variables)
Line 1: Line 1:
-- comment was breaking it
local ResourceData = {}
Utility = Utility or require("Module:Utility") -- need to reuse the normalize methods
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Lua storage table for looking up wiki pages, names, and resources
-- Constants
-- based on in-game names. All data is in English.
--
-- The table contains some deconfliction, but only for spaces, apostrophes, and
-- some singular/plural.
-- Use in-game names for things, and help keep this table updated as the game
-- is updated.
--
-- Using the table requires a locally defined lookup function that performs
-- a string.lower on the argument so that the lookup table can accept any case
-- and still function properly. Otherwise, we would need the table to define
-- both Berries = "Berries" and berries = "Berries" which would multiply our
-- work.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
 
local CAT_FOODS = "Food"
 
local CAT_BUILD = "Building Materials"
-- for returning when REQUIRE'd by other Lua modules.
local CAT_CONSU = "Consumable Items"
local ResourceData = {}
local CAT_CRAFT = "Crafting Resources"
local CAT_TRADE = "Trade Goods"
local CAT_FUEXP = "Fuel & Exploration"
local CAT_RAINS = "Rainwater"
local CAT_BLIGH = "Blight Fuel"
-- Foods
local C2_RAWFOOD = "Raw Food"
local C2_COMPLEX = "Complex Food"
-- Building Mats
local C2_CONSTRU = "Construction Material"
local C2_RAREMAT = "Rare Material"
-- Consumable Items
local C2_CLOTHIN = "Clothing"
local C2_SERVICE = "Service"
-- Crafting Resources
local C2_RAWMATS = "Raw Material"
local C2_PROCESS = "Processed Material"
local C2_METALOR = "Metal"
local C2_VESSELS = "Vessel"
-- Trade Goods
local C2_VALUABL = "Valuable"
local C2_PACKSGO = "Pack of Good"
local C2_METARES = "Metaresource"
-- Fuel & Exploration
local C2_FUELSAC = "Fuel"
local C2_EXPTOOL = "Tool"
-- Rainwater and Blight Fuel
local C2_RAINWAT = "Rainwater"
local C2_PURGING = "Purging Fire"




Line 31: Line 55:
-- that way, whenever .page is referenced, it can be used again to retrieve  
-- that way, whenever .page is referenced, it can be used again to retrieve  
-- the rest of the data.
-- the rest of the data.
local tableStrStrData = {
local RESOURCE_DATA = {


---------------------------------------
---------------------------------------
-- Resources
--[[ RESOURCE_DATA
*defaults are stored here; these value will be modified during the game by
perks and city upgrades
-- iconfile: string: the filename, ending in .png, on the wiki. do not include
the File: prefix. Align with dev data dumps (from Google Drive) or
from extracted assets from the Unity Asset Studio.
-- page: string: the name of the page on the wiki, case sensitive. this should match
the spelling, spacing, and punctuation in the game
-- category: string/constant: the category the good belongs to, in the upper UI on
the game screen, for example "Food" or "Consumable Items." useful for building
tables of similar items. use the constants above.
-- cat2: string/constant: a more specific category, often referenced by perks,
needs, or buildings, for example, "Complex Food" and "Packs of goods"
and "Metal or Ore"
-- eatable: boolean: true if the good can be eaten, can omit if false
-- burnable: boolean: true if the good can be burned or sacrified in a Hearth, can omit if false
-- burnTime: int: default* seconds the item burns for in a Hearth, can omit if burnable is false
-- sacrificedRate: int: default* number of items sacrified per minute in a Hearth, can omit if burnable is false
-- sellValue: float: default* value when selling, in Amber (the spreadsheet shows value as 10x, so 2.4 = 0.24 in-game)
-- buyValue: float: default* value when buying, in Amber
-- description: string: the in-game description.
--]]
---------------------------------------
---------------------------------------
     -- Raw Food
     -- Food/Raw Food
["berries"] = {iconfile="Berries.png", page="Berries"},
["berries"] = {iconfile="Icon_Resource_Berries.png", page="Berries", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Plantation, Hallowed Herb Garden, Herbalists' Camp, Small Herbalists' Camp."},
["eggs"] = {iconfile="Eggs.png", page="Eggs"},
["eggs"] = {iconfile="Eggs.png", page="Eggs", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyVale=0.40, description="Common food source. Obtained by: Ranch, Trappers' Camp, Small Trappers' Camp."},
["insects"] = {iconfile="Insects.png", page="Insects"},
["insects"] = {iconfile="Insects.png", page="Insects", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Trappers' Camp, Small Trappers' Camp."},
["meat"] = {iconfile="Meat.png", page="Meat"},
["meat"] = {iconfile="Meat.png", page="Meat", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Ranch, Trappers' Camp, Small Trappers' Camp."},
["mushrooms"] = {iconfile="Mushrooms.png", page="Mushrooms"},
["mushrooms"] = {iconfile="Mushrooms.png", page="Mushrooms", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Herbalists' Camp, Small Herbalists' Camp, Greenhouse, Homestead."},
["roots"] = {iconfile="Roots.png", page="Roots"},
["roots"] = {iconfile="Roots.png", page="Roots", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Hallowed Herb Garden, Herb Garden, Foragers' Camp, Small Foragers' Camp."},
["vegetables"] = {iconfile="Vegetables.png", page="Vegetables"},
["vegetables"] = {iconfile="Vegetables.png", page="Vegetables", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Hallowed Small Farm, Small Farm, Foragers' Camp, Small Foragers' Camp, Homestead."},
-- Complex Food
-- Food/Complex Food
["biscuits"] = {iconfile="Biscuits.png", page="Biscuits"},
["biscuits"] = {iconfile="Icon_Resource_Biscuits.png", page="Biscuits", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.30, buyValue=0.50, description="Tasty and crunchy. Produced by: Field Kitchen, Bakery, Cookhouse, Smelter, Apothecary."},
["jerky"] = {iconfile="Jerky.png", page="Jerky"},
["jerky"] = {iconfile="Jerky.png", page="Jerky", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.18, buyValue=0.30, description="Preserved, dried meat. Produced by: Field Kitchen, Smokehouse, Kiln, Butcher, Cellar."},
["pickled goods"] = {iconfile="PickledGoods.png", page="Pickled Goods"},
["pickled goods"] = {iconfile="PickledGoods.png", page="Pickled Goods", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.24, buyValue=0.40, description="A Beaver specialty. Produced by: Field Kitchen, Granary, Cellar, Brewery, Flawless Brewery."},
["pie"] = {iconfile="Pie.png", page="Pie"},
["pie"] = {iconfile="Pie.png", page="Pie", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.30, buyValue=0.50, description="A Human specialty. Produced by: Bakery, Brick Oven, Furnace."},
["skewers"] = {iconfile="Skewers.png", page="Skewers"},
["skewers"] = {iconfile="Skewers.png", page="Skewers", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.24, buyValue=0.40, description="A Lizard specialty. Produced by: Cookhouse, Grill, Butcher."},
-- Building Materials
-- Building Materials
["bricks"] = {iconfile="Bricks.png", page="Bricks"},
["bricks"] = {iconfile="Icon_Resource_Bricks.png", page="Bricks", category=CAT_BUILD, cat2=C2_CONSTRU, sellValue=0.375, buyValue=0.625, description="Mostly used for construction. Produced by: Crude Workstation, Workshop, Brickyard, Kiln, Furnace."},
["fabric"] = {iconfile="Fabric.png", page="Fabric"},
["fabric"] = {iconfile="Fabric.png", page="Fabric", category=CAT_BUILD, cat2=C2_CONSTRU, sellValue=0.375, buyValue=0.625, description="Used for construction or production of clothes. Produced by: Crude Workstation, Workshop, Weaver, Granary, Leatherworker."},
["planks"] = {iconfile="Planks.png", page="Planks"},
["pipes"] = {iconfile="En_craft_23.png", page="Pipes", category=CAT_BUILD, cat2=C2_CONSTRU, sellValue=0.58, buyValue=1.00, description="Used to install Rainpunk Engines in production buildings and build Geyser Pumps. Produced by: Crude Workstation, Workshop, Smelter, Toolshop."},
["parts"] = {iconfile="Parts.png", page="Parts"},
["planks"] = {iconfile="Planks.png", page="Planks", category=CAT_BUILD, cat2=C2_CONSTRU, sellValue=0.225, buyValue=0.375, description="Mostly used for construction. Produced by: Crude Workstation, Workshop, Lumber Mill, Carpenter, Supplier."},
["wildfire essence"] = {iconfile="Wildfire Essence.png", page="Wildfire Essence"},
-- Building Materials/Rare
-- Consumable Items
["parts"] = {iconfile="Parts.png", page="Parts", category=CAT_BUILD, cat2=C2_RAREMAT, sellValue=2.28, buyValue=4.80, description="Rare elements used in camp construction. Difficult to produce in this harsh environment."},
["coats"] = {iconfile="Coats.png", page="Coats"},
["wildfire essence"] = {iconfile="Wildfire Essence.png", page="Wildfire Essence", category=CAT_BUILD, cat2=C2_RAREMAT, sellValue=6.00, buyValue=10.0, description="A sentient flame trapped in a bottle. This rare material is used to light the Holy Flame in Hearths. Can be acquired from orders, Glade Events, or traders."},
["ale"] = {iconfile="Ale.png", page="Ale"},
-- Consumable Items/Clothing
["cosmetics"] = {iconfile="Cosmetics.png", page="Cosmetics"},
["coats"] = {iconfile="Coats.png", page="Coats", category=CAT_CONSU, cat2=C2_CLOTHIN, sellValue=0.12, buyValue=0.20, description="Used as clothing by some villagers. Produced by: Clothier, Smithy, Artisan, Druid's Hut."},
["incense"] = {iconfile="Incense.png", page="Incense"},
-- Consumable Items/Service Items
["scrolls"] = {iconfile="Scrolls.png", page="Scrolls"},
["ale"] = {iconfile="Icon_Resource_Ale.png", page="Ale", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.21, buyValue=0.35, description="Used for Leisure at: Tavern, Monastery, Forum. Produced by: Grill, Brewery, Flawless Brewery, Tinctury, Scribe."},
["training gear"] = {iconfile="TrainingGear.png", page="Training Gear"},
["cosmetics"] = {iconfile="Cosmetics.png", page="Cosmetics", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.18, buyValue=0.3, description="Used for Cleanliness at: Bath House, Holy Market, Market. Produced by: Cooperage, Alchemist's Hut, Apothecary."},
["wine"] = {iconfile="Wine.png", page="Wine"},
["incense"] = {iconfile="Incense.png", page="Incense", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.225, buyValue=0.375, description="Used for Religion at: Holy Temple, Temple, Monastery, Clan Hall. Produced by: Smokehouse, Brick Oven, Apothecary, Druid's Hut."},
-- Crafting Materials
["scrolls"] = {iconfile="Scrolls.png", page="Scrolls", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.18, buyValue=0.30, description="Used for Education at: Holy Temple, Temple, Explorers' Lodge, Forum. Produced by: Lumber Mill, Clothier, Flawless Rain Mill, Rain Mill, Scribe."},
["clay"] = {iconfile="Clay.png", page="Clay"},
["training gear"] = {iconfile="TrainingGear.png", page="Training Gear", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.255, buyValue=0.425, description="Used for Brawling at: Tavern, Clan Hall, Explorers' Lodge. Produced by: Cooperage, Weaver, Tinkerer, Manufactory."},
["copper ore"] = {iconfile="CopperOre.png", page="Copper Ore"},
["wine"] = {iconfile="Wine.png", page="Wine", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.18, buyValue=0.30, description="Used for Luxury at: Guild House, Holy Market, Market. Produced by: Cellar, Alchemist's Hut, Tinctury."},
["crystalized dew"] = {iconfile="CrystalizedDew.png", page="Crystalized Dew"},
-- Crafting Materials/Raw Materials
["grain"] = {iconfile="Grain.png", page="Grain"},
["clay"] = {iconfile="Icon_Resource_Clay.png", page="Clay", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Flesh of the earth. Used mostly for crafting. Obtained by: Stonecutters' Camp, Clay Pit."},
["herbs"] = {iconfile="Herbs.png", page="Herbs"},
["grain"] = {iconfile="Grain.png", page="Grain", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.24, buyValue=0.40, description="Isn't eaten raw, but can be processed. Obtained by: Hallowed Small Farm, Small Farm, Foragers' Camp, Small Foragers' Camp, Homestead."},
["leather"] = {iconfile="Leather.png", page="Leather"},
["herbs"] = {iconfile="Herbs.png", page="Herbs", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.24, buyValue=0.40, description="Isn't eaten raw, but can be processed. Obtained by: Hallowed Herb Garden, Herb Garden, Herbalists' Camp, Small Herbalists' Camp, Greenhouse."},
["plant fiber"] = {iconfile="PlantFiber.png", page="Plant Fiber"},
["leather"] = {iconfile="Leather.png", page="Leather", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Used for crafting. Obtained by: Ranch."},
["reeds"] = {iconfile="Reeds.png", page="Reeds"},
["pigment"] = {iconfile="Pigment.png", page="Pigment", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.15, buyValue=0.25, description="Used for crafting. Produced by: Cookhouse, Artisan, Tinctury, Manufactory."},
["resin"] = {iconfile="Resin.png", page="Resin"},
["plant fiber"] = {iconfile="PlantFiber.png", page="Plant Fiber", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Used for crafting. Obtained by: Hallowed Small Farm, Plantation, Harvesters' Camp, Homestead."},
["sparkdew"] = {iconfile="Sparkdew.png", page="Sparkdew"},
["reeds"] = {iconfile="Reeds.png", page="Reeds", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Used for crafting. Obtained by: Harvesters' Camp, Clay Pit."},
["stone"] = {iconfile="Stone.png", page="Stone"},
["resin"] = {iconfile="Resin.png", page="Resin", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Used for crafting. Obtained by: Forester's Hut."},
-- Refined Crafting Materials
["stone"] = {iconfile="Stone.png", page="Stone", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Bones of the earth. Used mostly for crafting. Obtained by: Stonecutters' Camp."},
["barrels"] = {iconfile="Barrels.png", page="Barrels"},
-- Crafting Materials/Processed Materials
["copper bars"] = {iconfile="CopperBar.png", page="Copper Bars"},
["flour"] = {iconfile="Flour.png", page="Flour", category=CAT_CRAFT, cat2=C2_PROCESS, sellValue=0.22, buyValue=0.38, description="Used for cooking. Produced by: Flawless Rain Mill, Rain Mill, Press, Provisioner, Stamping Mill, Supplier."},
["flour"] = {iconfile="Flour.png", page="Flour"},
-- Crafting Materials/Metal & Ore
["pigment"] = {iconfile="Pigment.png", page="Pigment"},
["copper bars"] = {iconfile="CopperBar.png", page="Copper Bars", category=CAT_CRAFT, cat2=C2_METALOR, sellValue=0.72, buyValue=1.2, description="Refined copper ore, used for crafting. Produced by: Grill, Furnace, Stamping Mill, Smelter."},
["pottery"] = {iconfile="Pottery.png", page="Pottery"},
["copper ore"] = {iconfile="CopperOre.png", page="Copper Ore", category=CAT_CRAFT, cat2=C2_METALOR, sellValue=0.18, buyValue=0.30, description="A soft and malleable metal. Obtained by: Mine."},
["waterskins"] = {iconfile="Waterskins.png", page="Waterskins"},
["crystalized dew"] = {iconfile="CrystalizedDew.png", page="Crystalized Dew", category=CAT_CRAFT, cat2=C2_METALOR, sellValue=0.72, buyValue=1.20, description="Crystalized rain essence. Produced by: Forester's Hut, Brickyard, Smelter, Alchemist's Hut."},
-- Trade Goods
-- Crafting Materials/Vessels
["amber"] = {iconfile="Amber.png", page="Amber"},
["barrels"] = {iconfile="Icon_Resource_Barrels.png", page="Barrels", category=CAT_CRAFT, cat2=C2_VESSELS, sellValue=0.24, buyValue=0.40, description="Used for crafting. Produced by: Cooperage, Provisioner, Toolshop, Artisan."},
["ancient tablet"] = {iconfile="AncientTablet.png", page="Ancient Tablet"},
["pottery"] = {iconfile="Pottery.png", page="Pottery", category=CAT_CRAFT, cat2=C2_VESSELS, sellValue=0.225, buyValue=0.375, description="Used for crafting. Produced by: Bakery, Smokehouse, Brickyard, Stamping Mill."},
["pack of building materials"] = {iconfile="BuildingMaterials.png", page="Pack of Building Materials"},
["waterskins"] = {iconfile="Waterskins.png", page="Waterskins", category=CAT_CRAFT, cat2=C2_VESSELS, sellValue=0.225, buyValue=0.375, description="Used for crafting. Produced by: Clothier, Leatherworker, Toolshop, Supplier."},
["pack of crops"] = {iconfile="Crops.png", page="Pack of Crops"},
-- Trade Goods/Valuable Items
["pack of luxury goods"] = {iconfile="Luxury.png", page="Pack of Luxury Goods"},
["amber"] = {iconfile="Icon_Resource_Amber.png", page="Amber", category=CAT_TRADE, cat2=C2_VALUABL, sellValue=1.20, buyValue=1.50, description="A widely accepted currency in the kingdom. Crystalized tree blood... fitting."},
["pack of provisions"] = {iconfile="Provisions.png", page="Pack of Provisions"},
["ancient tablet"] = {iconfile="Icon_Resource_AncientTablet.png", page="Ancient Tablet", category=CAT_TRADE, cat2=C2_VALUABL, sellValue=9.60, buyValue=16.0, description="Valuable sources of knowledge, highly sought after by traders and the Queen herself. They can be found in Dangerous  or Forbidden Glades."},
["pack of trade goods"] = {iconfile="TradeGoods.png", page="Pack of Trade Goods"},
-- Trade Goods/Packs of Goods
["pack of building materials"] = {iconfile="Icon_Resource_BuildingMaterials.png", page="Pack of Building Materials", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=1.05, buyValue=1.60, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Flawless Rain Mill, Rain Mill, Tinkerer."},
["pack of crops"] = {iconfile="Crops.png", page="Pack of Crops", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=0.71, buyValue=1.10, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Granary, Brewery, Flawless Brewery."},
["pack of luxury goods"] = {iconfile="Luxury.png", page="Pack of Luxury Goods", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=0.78, buyValue=1.20, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Carpenter, Leatherworker, Press."},
["pack of provisions"] = {iconfile="Provisions.png", page="Pack of Provisions", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=0.48, buyValue=0.80, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Provisioner, Manufactory."},
["pack of trade goods"] = {iconfile="TradeGoods.png", page="Pack of Trade Goods", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=0.96, buyValue=1.60, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Lumber Mill, Weaver, Smithy."},
-- Meta resources
-- Meta resources
["artifacts"] = {iconfile="Icon MetaResource Artifact.png", page="Artifacts"},
["artifacts"] = {iconfile="Icon MetaResource Artifact.png", page="Artifacts", category=CAT_TRADE, cat2=C2_METARES, sellValue=0.60, buyValue=0.90, description="Curiosities of a varied nature. Fascinating, sinister, and all in between. Can be used to buy more advanced upgrades in the Smoldering City."},
["food stockpiles"] = {iconfile="Icon MetaResource FoodStockpiles.png", page="Food Stockpiles"},
["food stockpiles"] = {iconfile="Icon MetaResource FoodStockpiles.png", page="Food Stockpiles", category=CAT_TRADE, cat2=C2_METARES, sellValue=0.30, buyValue=0.45, description="A basic currency in the realm. Workers are eager to exchange their labor for food for their families. Can be used to buy upgrades in the Smoldering City."},
["machinery"] = {iconfile="Icon MetaResource Machinery.png", page="Machinery"},
["machinery"] = {iconfile="Icon MetaResource Machinery.png", page="Machinery", category=CAT_TRADE, cat2=C2_METARES, sellValue=0.60, buyValue=0.90, description="Rainpunk technology ripped from the past. Repurposed using skill and labor. Can be used to buy upgrades in the Smoldering City."},
-- Fuel & Exploration
-- Fuel & Exploration/Fuel
["coal"] = {iconfile="Coal.png", page="Coal"},
["coal"] = {iconfile="Icon_Resource_Coal.png", page="Coal", category=CAT_FUEXP, cat2=C2_FUELSAC, burnable=true, burnTime=60, sacrificedRate=18, sellValue=0.375, buyValue=0.625, description="Efficient fuel. Obtained by: Mine, Brick Oven, Kiln."},
["oil"] = {iconfile="Oil.png", page="Oil"},
["oil"] = {iconfile="Oil.png", page="Oil", category=CAT_FUEXP, cat2=C2_FUELSAC, burnable=true, burnTime=30, sacrifiedRate=15, sellValue=0.195, buyValue=0.325, description="Efficient fuel. Obtained by: Butcher, Press, Druid's Hut."},
["sea marrow"] = {iconfile="SeaMarrow.png", page="Sea Marrow"},
["sea marrow"] = {iconfile="SeaMarrow.png", page="Sea Marrow", category=CAT_FUEXP, cat2=C2_FUELSAC, burnable=true, burnTime=60, sacrifiedRate=18, sellValue=0.375, buyValue=0.625, description="Efficient fuel. Obtained by: Stonecutters' Camp."},
["wood"] = {iconfile="Wood.png", page="Wood"},
["wood"] = {iconfile="Wood.png", page="Wood", category=CAT_FUEXP, cat2=C2_FUELSAC, burnable=true, burnTime=15, sacrifiedRate=30, sellValue=0.075, buyValue=0.125, description="An abundant, yet crucial resource. Obtained by: Woodcutters' Camp."},
["simple tools"] = {iconfile="SimpleTools.png", page="Simple Tools"},
-- Fuel & Exploration/Tools
["infused tools"] = {iconfile="InfusedTools.png", page="Infused Tools"},
["simple tools"] = {iconfile="SimpleTools.png", page="Simple Tools", category=CAT_FUEXP, cat2=C2_EXPTOOL, sellValue=1.665, buyValue=2.775, description="Used in exploration, for opening caches and completing difficult events. Produced by: Carpenter, Smithy, Toolshop, Tinkerer, Scribe."},
["purging fire"] = {iconfile="PurgingFire.png", page="Purging Fire"},
["infused tools"] = {iconfile="InfusedTools.png", page="Infused Tools", category=CAT_FUEXP, cat2=C2_EXPTOOL, sellValue=2.115, buyValue=3.525, description="Used in exploration, for opening caches and completing difficult events. Produced by: Finesmith, Rainpunk Foundry."},
-- Rain
-- Rainwater
["clearance water"] = {iconfile="Yellow_30.png", page="Clearance Water"},
["clearance water"] = {iconfile="Yellow_30.png", page="Clearance Water", category=CAT_RAINS, cat2=C2_RAINWAT, description="Highly concentrated yellow clearance rainwater. Used to power Rain Engines in crafting-oriented buildings."},
["drizzle water"] = {iconfile="Green_11.png", page="Drizzle Water"},
["drizzle water"] = {iconfile="Green_11.png", page="Drizzle Water", category=CAT_RAINS, cat2=C2_RAINWAT, description="Highly concentrated green drizzle rainwater. Used to power Rain Engines in food-oriented buildings."},
["storm water"] = {iconfile="Blue_14.png", page="Storm Water"}
["storm water"] = {iconfile="Blue_14.png", page="Storm Water", category=CAT_RAINS, cat2=C2_RAINWAT, description="Highly concentrated blue storm rainwater. Used to power Rain Engines in industry-oriented buildings."},
-- Blight Fuel
["purging fire"] = {iconfile="PurgingFire.png", page="Purging Fire", category=CAT_BLIGH, cat2=C2_PURGING, sellValue=0.375, buyValue=0.625, description="A unique resource used by Blight Fighters to burn down Blightrot Cysts. Produced by: Blight Post."}
}
}


Line 131: Line 183:
-- Get it from the big table below and return it.
-- Get it from the big table below and return it.
     return tableStrStrData[strArg]
     return RESOURCE_DATA[strArg]
end
end


Line 147: Line 199:
end
end
-- and if the table is provided instead of the name to lookup
-- and if the table is provided instead of the name to lookup
function ResourceData.getIconFilenameFromData(tableStrStrData)
function ResourceData.getIconFilenameFromData(RESOURCE_DATA)


-- if this particular data block doesn't have a iconfile, this will return nil
-- if this particular data block doesn't have a iconfile, this will return nil
-- therefore, error handling will be necessary
-- therefore, error handling will be necessary
return tableStrStrData.iconfile or nil
return RESOURCE_DATA.iconfile or nil
end
end


Line 167: Line 219:
end
end
-- and if the table is provided instead of the name to lookup
-- and if the table is provided instead of the name to lookup
function ResourceData.getPagenameFromData(tableStrStrData)
function ResourceData.getPagenameFromData(RESOURCE_DATA)


-- if this particular data block doesn't have a page name, this will return nil
-- if this particular data block doesn't have a page name, this will return nil
-- therefore, error handling will be necessary
-- therefore, error handling will be necessary
return tableStrStrData.page or nil
return RESOURCE_DATA.page or nil
end
end


Line 187: Line 239:
end
end
-- and if the table is provided instead of the name to lookup
-- and if the table is provided instead of the name to lookup
function ResourceData.getDescriptionFromData(tableStrStrData)
function ResourceData.getDescriptionFromData(RESOURCE_DATA)


-- if this particular data block doesn't have a description, this will return nil
-- if this particular data block doesn't have a description, this will return nil
-- therefore, error handling will be necessary
-- therefore, error handling will be necessary
return tableStrStrData.description or nil
return RESOURCE_DATA.description or nil
end
 
 
 
-------------------------------------------------------------------------------
-- Helper functions
-------------------------------------------------------------------------------
 
 
 
-- Normalize the argument to the standard in-game name, and the one that
-- is used as the key in the big lookup table.
--
-- This function will also make the argument lowercase to reduce the need
-- to specify more possible alternatives to normalize.
function ResourceData.normalizeName(strArg)
strArg = string.lower(strArg)
-- no other functions need this lookup table, so it's defined locally
-- to this function
local tableStrStrAlternatives = {
---------------------------------------
-- Resources
---------------------------------------
-- Raw Food
["berry"] = "berries",
["egg"] = "eggs",
["insect"] = "insects",
["meats"] = "meat",
["mushroom"] = "mushrooms",
["root"] = "roots",
["vegetable"] = "vegetables",
--Complex Food
["biscuit"] = "biscuits",
["pickledgoods"] = "pickled goods",
["pickledgood"] =  "pickled goods",
["pickled good"] = "pickled goods",
["pies"] = "pie",
["skewer"] = "skewers",
-- Building Materials
["brick"] = "bricks",
["fabrics"] = "fabric",
["plank"] = "planks",
["part"] = "parts",
["wildfireessence"] =    "wildfire essence",
["wild fire essence"] =  "wildfire essence",
["wildfireessences"] =  "wildfire essence",
["wild fire essences"] = "wildfire essence",
-- Consumable items
["coat"] = "coats",
["ales"] = "ale",
["cosmetic"] = "cosmetics",
["incenses"] = "incense",
["insense"] = "incense",
["scroll"] = "scrolls",
["traininggear"] =  "training gear",
["traininggears"] =  "training gear",
["training gears"] = "training gear",
["wines"] = "wine",
-- Crafting materials
["clays"] = "clay",
["copperore"] =  "copper ore",
["copperores"] =  "copper ore",
["copper ores"] = "copper ore",
["crystalizeddew"] =    "crystalized dew",
["crystalizeddews"] =  "crystalized dew",
["crystallizeddew"] =  "crystalized dew",
["crystallizeddews"] =  "crystalized dew",
["crystalized dews"] =  "crystalized dew",
["crystallized dew"] =  "crystalized dew",
["crystallized dews"] = "crystalized dew",
["grains"] = "grain",
["herb"] = "herbs",
["leathers"] = "leather",
["flax"] =        "plant fiber",
["plantfiber"] =  "plant fiber",
["plantfibers"] =  "plant fiber",
["plant fibers"] = "plant fiber",
["reed"] = "reeds",
["spark dew"] = "sparkdew",
["stones"] = "stone",
-- Refined crafting materials
["barrel"] =  "barrels",
["barrell"] =  "barrels",
["barrells"] = "barrels",
["copperbar"] =  "copper bars",
["copperbars"] =  "copper bars",
["copper bar"] = "copper bars",
["flours"] = "flour",
["pigments"] = "pigment",
["waterskin"] =  "waterskins",
["water skin"] =  "waterskins",
["water skins"] = "waterskins",
-- Trade goods
["ambers"] = "amber",
["coin"] =  "amber",
["tablet"] =          "ancient tablet",
["tablets"] =        "ancient tablet",
["ancienttablet"] =  "ancient tablet",
["ancienttablets"] =  "ancient tablet",
["ancient tablets"] = "ancient tablet",
["buildingmaterial"] =            "pack of building materials",
["buildingmaterials"] =          "pack of building materials",
["building material"] =          "pack of building materials",
["building materials"] =          "pack of building materials",
["packofbuildingmaterial"] =      "pack of building materials",
["packofbuildingmaterials"] =    "pack of building materials",
["pack of building materials"] =  "pack of building materials",
["packsofbuildingmaterial"] =    "pack of building materials",
["packsofbuildingmaterials"] =    "pack of building materials",
["packs of building materials"] = "pack of building materials",
["crop"] =          "pack of crops",
["crops"] =        "pack of crops",
["packofcrop"] =    "pack of crops",
["packofcrops"] =  "pack of crops",
["pack of crop"] =  "pack of crops",
["packsofcrop"] =  "pack of crops",
["packsofcrops"] =  "pack of crops",
["packs of crop"] = "pack of crops",
["luxury"] =              "pack of luxury goods",
["luxuries"] =            "pack of luxury goods",
["luxurygood"] =          "pack of luxury goods",
["luxurygoods"] =          "pack of luxury goods",
["luxury good"] =          "pack of luxury goods",
["luxury goods"] =        "pack of luxury goods",
["packofluxuries"] =      "pack of luxury goods",
["packofluxurygood"] =    "pack of luxury goods",
["packofluxurygoods"] =    "pack of luxury goods",
["pack of luxury good"] =  "pack of luxury goods",
["packsofluxuries"] =      "pack of luxury goods",
["packsofluxurygood"] =    "pack of luxury goods",
["packsofluxurygoods"] =  "pack of luxury goods",
["packs of luxury good"] = "pack of luxury goods",
["provision"] =          "pack of provisions",
["provisions"] =        "pack of provisions",
["packofprovision"] =    "pack of provisions",
["packofprovisions"] =  "pack of provisions",
["pack of provision"] =  "pack of provisions",
["packsofprovision"] =  "pack of provisions",
["packsofprovisions"] =  "pack of provisions",
["packs of provision"] = "pack of provisions",
["tradegood"] =          "pack of trade goods",
["tradegoods"] =          "pack of trade goods",
["trade good"] =          "pack of trade goods",
["trade goods"] =        "pack of trade goods",
["packoftradegood"] =    "pack of trade goods",
["packoftradegoods"] =    "pack of trade goods",
["pack of trade good"] =  "pack of trade goods",
["packsoftradegood"] =    "pack of trade goods",
["packsoftradegoods"] =  "pack of trade goods",
["packs of trade good"] = "pack of trade goods",
-- Meta resources
["artifact"] =      "artifacts",
["metaartifact"] =  "artifacts",
["metaartifacts"] = "artifacts",
["meta artifact"] =  "artifacts",
["meta artifacts"] = "artifacts",
["food"] =          "food stockpiles",
["foods"] =          "food stockpiles",
["metafood"] =      "food stockpiles",
["metafoods"] =      "food stockpiles",
["meta food"] =      "food stockpiles",
["meta foods"] =      "food stockpiles",
["foodstockpile"] =  "food stockpiles",
["foodstockpiles"] = "food stockpiles",
["food stockpile"] = "food stockpiles",
["meta foodstockpile"] =  "food stockpiles",
["meta foodstockpiles"] = "food stockpiles",
["meta food stockpile"] = "food stockpiles",
["meta food stockpiles"] = "food stockpiles",
["machinary"] =    "machinery",
["metamachinery"] = "machinery",
["meta machinery"] = "machinery",
-- Fuel & Exploration
["coals"] = "coal",
["oils"] = "oil",
["seamarrow"] =  "sea marrow",
["seamarrows"] =  "sea marrow",
["sea marrows"] = "sea marrow",
["woods"] = "wood",
["simpletool"] =  "simple tools",
["simpletools"] = "simple tools",
["simple tool"] = "simple tools",
["infusedtool"] =  "infused tools",
["infusedtools"] = "infused tools",
["infused tool"] = "infused tools",
["purgingfire"] = "purging fire",
["purgingfires"] = "purging fire",
-- Rain
["clearancewater"] = "clearance water",
["clearencewater"] = "clearance water",
["clearence water"] = "clearance water",
["drizzlewater"] = "drizzle water",
["stormwater"] = "storm water"
} -- the end of the huge tableStrStrAlternatives
-- if nothing is found, the result of the lookup will be nil, so
-- just return whatever was passed in as the argument (lowercase)
-- we can assume that the input argument is fine or does not exist
return tableStrStrAlternatives[strArg] or strArg
end
end



Revision as of 19:03, 12 February 2023

Documentation for this module may be created at Module:ResourceData/doc

-- comment was breaking it
local ResourceData = {}


Utility = Utility or require("Module:Utility") -- need to reuse the normalize methods



-------------------------------------------------------------------------------
-- Constants
-------------------------------------------------------------------------------
local CAT_FOODS = "Food"
local CAT_BUILD = "Building Materials"
local CAT_CONSU = "Consumable Items"
local CAT_CRAFT = "Crafting Resources"
local CAT_TRADE = "Trade Goods"
local CAT_FUEXP = "Fuel & Exploration"
local CAT_RAINS = "Rainwater"
local CAT_BLIGH = "Blight Fuel"
-- Foods
local C2_RAWFOOD = "Raw Food"
local C2_COMPLEX = "Complex Food"
-- Building Mats
local C2_CONSTRU = "Construction Material"
local C2_RAREMAT = "Rare Material"
-- Consumable Items
local C2_CLOTHIN = "Clothing"
local C2_SERVICE = "Service"
-- Crafting Resources
local C2_RAWMATS = "Raw Material"
local C2_PROCESS = "Processed Material"
local C2_METALOR = "Metal"
local C2_VESSELS = "Vessel"
-- Trade Goods
local C2_VALUABL = "Valuable"
local C2_PACKSGO = "Pack of Good"
local C2_METARES = "Metaresource"
-- Fuel & Exploration
local C2_FUELSAC = "Fuel"
local C2_EXPTOOL = "Tool"
-- Rainwater and Blight Fuel
local C2_RAINWAT = "Rainwater"
local C2_PURGING = "Purging Fire"



-------------------------------------------------------------------------------
-- Main data table, with string keys and string values.
-- Some of these are defined inline with string.lower to make the key easier
-- to spell and read correctly.
-------------------------------------------------------------------------------

-- a design decision of this table is to make the key the same as the page name.
-- (the lookup methods will automatically make it lowercase.)
-- that way, whenever .page is referenced, it can be used again to retrieve 
-- the rest of the data.
local RESOURCE_DATA = {

	---------------------------------------
	--[[ RESOURCE_DATA
		*defaults are stored here; these value will be modified during the game by
		perks and city upgrades
	-- iconfile: string: the filename, ending in .png, on the wiki. do not include 
			the File: prefix. Align with dev data dumps (from Google Drive) or 
			from extracted assets from the Unity Asset Studio.
	-- page: string: the name of the page on the wiki, case sensitive. this should match
			the spelling, spacing, and punctuation in the game
	-- category: string/constant: the category the good belongs to, in the upper UI on
			the game screen, for example "Food" or "Consumable Items." useful for building
			tables of similar items. use the constants above.
	-- cat2: string/constant: a more specific category, often referenced by perks,
			needs, or buildings, for example, "Complex Food" and "Packs of goods" 
			and "Metal or Ore"
	-- eatable: boolean: true if the good can be eaten, can omit if false
	-- burnable: boolean: true if the good can be burned or sacrified in a Hearth, can omit if false
	-- burnTime: int: default* seconds the item burns for in a Hearth, can omit if burnable is false
	-- sacrificedRate: int: default* number of items sacrified per minute in a Hearth, can omit if burnable is false
	-- sellValue: float: default* value when selling, in Amber (the spreadsheet shows value as 10x, so 2.4 = 0.24 in-game)
	-- buyValue: float: default* value when buying, in Amber
	-- description: string: the in-game description.
	--]]
	---------------------------------------
    -- Food/Raw Food
	["berries"] = {iconfile="Icon_Resource_Berries.png", page="Berries", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Plantation, Hallowed Herb Garden, Herbalists' Camp, Small Herbalists' Camp."},
	["eggs"] = {iconfile="Eggs.png", page="Eggs", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyVale=0.40, description="Common food source. Obtained by: Ranch, Trappers' Camp, Small Trappers' Camp."},
	["insects"] = {iconfile="Insects.png", page="Insects", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Trappers' Camp, Small Trappers' Camp."},
	["meat"] = {iconfile="Meat.png", page="Meat", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Ranch, Trappers' Camp, Small Trappers' Camp."},
	["mushrooms"] = {iconfile="Mushrooms.png", page="Mushrooms", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Herbalists' Camp, Small Herbalists' Camp, Greenhouse, Homestead."},
	["roots"] = {iconfile="Roots.png", page="Roots", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Hallowed Herb Garden, Herb Garden, Foragers' Camp, Small Foragers' Camp."},
	["vegetables"] = {iconfile="Vegetables.png", page="Vegetables", category=CAT_FOODS, cat2=C2_RAWFOOD, eatable=true, sellValue=0.24, buyValue=0.40, description="Common food source. Obtained by: Hallowed Small Farm, Small Farm, Foragers' Camp, Small Foragers' Camp, Homestead."},
	-- Food/Complex Food
	["biscuits"] = {iconfile="Icon_Resource_Biscuits.png", page="Biscuits", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.30, buyValue=0.50, description="Tasty and crunchy. Produced by: Field Kitchen, Bakery, Cookhouse, Smelter, Apothecary."},
	["jerky"] = {iconfile="Jerky.png", page="Jerky", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.18, buyValue=0.30, description="Preserved, dried meat. Produced by: Field Kitchen, Smokehouse, Kiln, Butcher, Cellar."},
	["pickled goods"] = {iconfile="PickledGoods.png", page="Pickled Goods", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.24, buyValue=0.40, description="A Beaver specialty. Produced by: Field Kitchen, Granary, Cellar, Brewery, Flawless Brewery."},
	["pie"] = {iconfile="Pie.png", page="Pie", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.30, buyValue=0.50, description="A Human specialty. Produced by: Bakery, Brick Oven, Furnace."},
	["skewers"] = {iconfile="Skewers.png", page="Skewers", category=CAT_FOODS, cat2=C2_COMPLEX, eatable=true, sellValue=0.24, buyValue=0.40, description="A Lizard specialty. Produced by: Cookhouse, Grill, Butcher."},
	-- Building Materials
	["bricks"] = {iconfile="Icon_Resource_Bricks.png", page="Bricks", category=CAT_BUILD, cat2=C2_CONSTRU, sellValue=0.375, buyValue=0.625, description="Mostly used for construction. Produced by: Crude Workstation, Workshop, Brickyard, Kiln, Furnace."},
	["fabric"] = {iconfile="Fabric.png", page="Fabric", category=CAT_BUILD, cat2=C2_CONSTRU, sellValue=0.375, buyValue=0.625, description="Used for construction or production of clothes. Produced by: Crude Workstation, Workshop, Weaver, Granary, Leatherworker."},
	["pipes"] = {iconfile="En_craft_23.png", page="Pipes", category=CAT_BUILD, cat2=C2_CONSTRU, sellValue=0.58, buyValue=1.00, description="Used to install Rainpunk Engines in production buildings and build Geyser Pumps. Produced by: Crude Workstation, Workshop, Smelter, Toolshop."},
	["planks"] = {iconfile="Planks.png", page="Planks", category=CAT_BUILD, cat2=C2_CONSTRU, sellValue=0.225, buyValue=0.375, description="Mostly used for construction. Produced by: Crude Workstation, Workshop, Lumber Mill, Carpenter, Supplier."},
	-- Building Materials/Rare
	["parts"] = {iconfile="Parts.png", page="Parts", category=CAT_BUILD, cat2=C2_RAREMAT, sellValue=2.28, buyValue=4.80, description="Rare elements used in camp construction. Difficult to produce in this harsh environment."},
	["wildfire essence"] = {iconfile="Wildfire Essence.png", page="Wildfire Essence", category=CAT_BUILD, cat2=C2_RAREMAT, sellValue=6.00, buyValue=10.0, description="A sentient flame trapped in a bottle. This rare material is used to light the Holy Flame in Hearths. Can be acquired from orders, Glade Events, or traders."},
	-- Consumable Items/Clothing
	["coats"] = {iconfile="Coats.png", page="Coats", category=CAT_CONSU, cat2=C2_CLOTHIN, sellValue=0.12, buyValue=0.20, description="Used as clothing by some villagers. Produced by: Clothier, Smithy, Artisan, Druid's Hut."},
	-- Consumable Items/Service Items
	["ale"] = {iconfile="Icon_Resource_Ale.png", page="Ale", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.21, buyValue=0.35, description="Used for Leisure at: Tavern, Monastery, Forum. Produced by: Grill, Brewery, Flawless Brewery, Tinctury, Scribe."},
	["cosmetics"] = {iconfile="Cosmetics.png", page="Cosmetics", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.18, buyValue=0.3, description="Used for Cleanliness at: Bath House, Holy Market, Market. Produced by: Cooperage, Alchemist's Hut, Apothecary."},
	["incense"] = {iconfile="Incense.png", page="Incense", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.225, buyValue=0.375, description="Used for Religion at: Holy Temple, Temple, Monastery, Clan Hall. Produced by: Smokehouse, Brick Oven, Apothecary, Druid's Hut."},
	["scrolls"] = {iconfile="Scrolls.png", page="Scrolls", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.18, buyValue=0.30, description="Used for Education at: Holy Temple, Temple, Explorers' Lodge, Forum. Produced by: Lumber Mill, Clothier, Flawless Rain Mill, Rain Mill, Scribe."},
	["training gear"] = {iconfile="TrainingGear.png", page="Training Gear", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.255, buyValue=0.425, description="Used for Brawling at: Tavern, Clan Hall, Explorers' Lodge. Produced by: Cooperage, Weaver, Tinkerer, Manufactory."},
	["wine"] = {iconfile="Wine.png", page="Wine", category=CAT_CONSU, cat2=C2_SERVICE, sellValue=0.18, buyValue=0.30, description="Used for Luxury at: Guild House, Holy Market, Market. Produced by: Cellar, Alchemist's Hut, Tinctury."},
	-- Crafting Materials/Raw Materials
	["clay"] = {iconfile="Icon_Resource_Clay.png", page="Clay", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Flesh of the earth. Used mostly for crafting. Obtained by: Stonecutters' Camp, Clay Pit."},
	["grain"] = {iconfile="Grain.png", page="Grain", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.24, buyValue=0.40, description="Isn't eaten raw, but can be processed. Obtained by: Hallowed Small Farm, Small Farm, Foragers' Camp, Small Foragers' Camp, Homestead."},
	["herbs"] = {iconfile="Herbs.png", page="Herbs", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.24, buyValue=0.40, description="Isn't eaten raw, but can be processed. Obtained by: Hallowed Herb Garden, Herb Garden, Herbalists' Camp, Small Herbalists' Camp, Greenhouse."},
	["leather"] = {iconfile="Leather.png", page="Leather", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Used for crafting. Obtained by: Ranch."},
	["pigment"] = {iconfile="Pigment.png", page="Pigment", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.15, buyValue=0.25, description="Used for crafting. Produced by: Cookhouse, Artisan, Tinctury, Manufactory."},
	["plant fiber"] = {iconfile="PlantFiber.png", page="Plant Fiber", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Used for crafting. Obtained by: Hallowed Small Farm, Plantation, Harvesters' Camp, Homestead."},
	["reeds"] = {iconfile="Reeds.png", page="Reeds", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Used for crafting. Obtained by: Harvesters' Camp, Clay Pit."},
	["resin"] = {iconfile="Resin.png", page="Resin", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Used for crafting. Obtained by: Forester's Hut."},
	["stone"] = {iconfile="Stone.png", page="Stone", category=CAT_CRAFT, cat2=C2_RAWMATS, sellValue=0.18, buyValue=0.30, description="Bones of the earth. Used mostly for crafting. Obtained by: Stonecutters' Camp."},
	-- Crafting Materials/Processed Materials
	["flour"] = {iconfile="Flour.png", page="Flour", category=CAT_CRAFT, cat2=C2_PROCESS, sellValue=0.22, buyValue=0.38, description="Used for cooking. Produced by: Flawless Rain Mill, Rain Mill, Press, Provisioner, Stamping Mill, Supplier."},
	-- Crafting Materials/Metal & Ore
	["copper bars"] = {iconfile="CopperBar.png", page="Copper Bars", category=CAT_CRAFT, cat2=C2_METALOR, sellValue=0.72, buyValue=1.2, description="Refined copper ore, used for crafting. Produced by: Grill, Furnace, Stamping Mill, Smelter."},
	["copper ore"] = {iconfile="CopperOre.png", page="Copper Ore", category=CAT_CRAFT, cat2=C2_METALOR, sellValue=0.18, buyValue=0.30, description="A soft and malleable metal. Obtained by: Mine."},
	["crystalized dew"] = {iconfile="CrystalizedDew.png", page="Crystalized Dew", category=CAT_CRAFT, cat2=C2_METALOR, sellValue=0.72, buyValue=1.20, description="Crystalized rain essence. Produced by: Forester's Hut, Brickyard, Smelter, Alchemist's Hut."},
	-- Crafting Materials/Vessels
	["barrels"] = {iconfile="Icon_Resource_Barrels.png", page="Barrels", category=CAT_CRAFT, cat2=C2_VESSELS, sellValue=0.24, buyValue=0.40, description="Used for crafting. Produced by: Cooperage, Provisioner, Toolshop, Artisan."},
	["pottery"] = {iconfile="Pottery.png", page="Pottery", category=CAT_CRAFT, cat2=C2_VESSELS, sellValue=0.225, buyValue=0.375, description="Used for crafting. Produced by: Bakery, Smokehouse, Brickyard, Stamping Mill."},
	["waterskins"] = {iconfile="Waterskins.png", page="Waterskins", category=CAT_CRAFT, cat2=C2_VESSELS, sellValue=0.225, buyValue=0.375, description="Used for crafting. Produced by: Clothier, Leatherworker, Toolshop, Supplier."},
	-- Trade Goods/Valuable Items
	["amber"] = {iconfile="Icon_Resource_Amber.png", page="Amber", category=CAT_TRADE, cat2=C2_VALUABL, sellValue=1.20, buyValue=1.50, description="A widely accepted currency in the kingdom. Crystalized tree blood... fitting."},
	["ancient tablet"] = {iconfile="Icon_Resource_AncientTablet.png", page="Ancient Tablet", category=CAT_TRADE, cat2=C2_VALUABL, sellValue=9.60, buyValue=16.0, description="Valuable sources of knowledge, highly sought after by traders and the Queen herself. They can be found in Dangerous  or Forbidden Glades."},
	-- Trade Goods/Packs of Goods
	["pack of building materials"] = {iconfile="Icon_Resource_BuildingMaterials.png", page="Pack of Building Materials", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=1.05, buyValue=1.60, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Flawless Rain Mill, Rain Mill, Tinkerer."},
	["pack of crops"] = {iconfile="Crops.png", page="Pack of Crops", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=0.71, buyValue=1.10, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Granary, Brewery, Flawless Brewery."},
	["pack of luxury goods"] = {iconfile="Luxury.png", page="Pack of Luxury Goods", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=0.78, buyValue=1.20, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Carpenter, Leatherworker, Press."},
	["pack of provisions"] = {iconfile="Provisions.png", page="Pack of Provisions", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=0.48, buyValue=0.80, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Provisioner, Manufactory."},
	["pack of trade goods"] = {iconfile="TradeGoods.png", page="Pack of Trade Goods", category=CAT_TRADE, cat2=C2_PACKSGO, sellValue=0.96, buyValue=1.60, description="Goods packed for delivery, used for fulfilling orders or trading. Produced by: Lumber Mill, Weaver, Smithy."},
	-- Meta resources
	["artifacts"] = {iconfile="Icon MetaResource Artifact.png", page="Artifacts", category=CAT_TRADE, cat2=C2_METARES, sellValue=0.60, buyValue=0.90, description="Curiosities of a varied nature. Fascinating, sinister, and all in between. Can be used to buy more advanced upgrades in the Smoldering City."},
	["food stockpiles"] = {iconfile="Icon MetaResource FoodStockpiles.png", page="Food Stockpiles", category=CAT_TRADE, cat2=C2_METARES, sellValue=0.30, buyValue=0.45, description="A basic currency in the realm. Workers are eager to exchange their labor for food for their families. Can be used to buy upgrades in the Smoldering City."},
	["machinery"] = {iconfile="Icon MetaResource Machinery.png", page="Machinery", category=CAT_TRADE, cat2=C2_METARES, sellValue=0.60, buyValue=0.90, description="Rainpunk technology ripped from the past. Repurposed using skill and labor. Can be used to buy upgrades in the Smoldering City."},
	-- Fuel & Exploration/Fuel
	["coal"] = {iconfile="Icon_Resource_Coal.png", page="Coal", category=CAT_FUEXP, cat2=C2_FUELSAC, burnable=true, burnTime=60, sacrificedRate=18, sellValue=0.375, buyValue=0.625, description="Efficient fuel. Obtained by: Mine, Brick Oven, Kiln."},
	["oil"] = {iconfile="Oil.png", page="Oil", category=CAT_FUEXP, cat2=C2_FUELSAC, burnable=true, burnTime=30, sacrifiedRate=15, sellValue=0.195, buyValue=0.325, description="Efficient fuel. Obtained by: Butcher, Press, Druid's Hut."},
	["sea marrow"] = {iconfile="SeaMarrow.png", page="Sea Marrow", category=CAT_FUEXP, cat2=C2_FUELSAC, burnable=true, burnTime=60, sacrifiedRate=18, sellValue=0.375, buyValue=0.625, description="Efficient fuel. Obtained by: Stonecutters' Camp."},
	["wood"] = {iconfile="Wood.png", page="Wood", category=CAT_FUEXP, cat2=C2_FUELSAC, burnable=true, burnTime=15, sacrifiedRate=30, sellValue=0.075, buyValue=0.125, description="An abundant, yet crucial resource. Obtained by: Woodcutters' Camp."},
	-- Fuel & Exploration/Tools
	["simple tools"] = {iconfile="SimpleTools.png", page="Simple Tools", category=CAT_FUEXP, cat2=C2_EXPTOOL, sellValue=1.665, buyValue=2.775, description="Used in exploration, for opening caches and completing difficult events. Produced by: Carpenter, Smithy, Toolshop, Tinkerer, Scribe."},
	["infused tools"] = {iconfile="InfusedTools.png", page="Infused Tools", category=CAT_FUEXP, cat2=C2_EXPTOOL, sellValue=2.115, buyValue=3.525, description="Used in exploration, for opening caches and completing difficult events. Produced by: Finesmith, Rainpunk Foundry."},
	-- Rainwater
	["clearance water"] = {iconfile="Yellow_30.png", page="Clearance Water", category=CAT_RAINS, cat2=C2_RAINWAT, description="Highly concentrated yellow clearance rainwater. Used to power Rain Engines in crafting-oriented buildings."},
	["drizzle water"] = {iconfile="Green_11.png", page="Drizzle Water", category=CAT_RAINS, cat2=C2_RAINWAT, description="Highly concentrated green drizzle rainwater. Used to power Rain Engines in food-oriented buildings."},
	["storm water"] = {iconfile="Blue_14.png", page="Storm Water", category=CAT_RAINS, cat2=C2_RAINWAT, description="Highly concentrated blue storm rainwater. Used to power Rain Engines in industry-oriented buildings."},
	-- Blight Fuel
	["purging fire"] = {iconfile="PurgingFire.png", page="Purging Fire", category=CAT_BLIGH, cat2=C2_PURGING, sellValue=0.375, buyValue=0.625, description="A unique resource used by Blight Fighters to burn down Blightrot Cysts. Produced by: Blight Post."}
}



-------------------------------------------------------------------------------
-- Main lookup functions
-- Accepts the in-game name and returns the name of the page on the wiki
-- associated with that in-game item, resource, building, etc.
--
-- Some associated lookup functions are necessary to hide the inner table
-- names from outside functions. For example, getIconFilename so that we can
-- change the name of .iconfile without breaking other modules.
-------------------------------------------------------------------------------



-- returns the whole data table for the specified key
-- need to run normalize function first
function ResourceData.getData(strArg)

	-- normalize input
    local strArg = ResourceData.normalizeName(strArg)
	
	-- Get it from the big table below and return it.
    return RESOURCE_DATA[strArg]
end



-- simpler version if all that's needed is the iconfile.
-- error handling by the calling module is required.
function ResourceData.getIconFilename(strArg)

	local data = getData(strArg)
	
	-- if this particular data block doesn't have a iconfile, this will return nil
	-- therefore, error handling will be necessary
	return data.iconfile or nil
end
-- and if the table is provided instead of the name to lookup
function ResourceData.getIconFilenameFromData(RESOURCE_DATA)

	-- if this particular data block doesn't have a iconfile, this will return nil
	-- therefore, error handling will be necessary
	return RESOURCE_DATA.iconfile or nil
end



-- simpler version if all that's needed is the page name.
-- error handling by the calling module is required.
function ResourceData.getPagename(strArg)

	local data = getData(strArg)
	
	-- if this particular data block doesn't have a page name, this will return nil
	-- therefore, error handling will be necessary
	return data.page or nil
end
-- and if the table is provided instead of the name to lookup
function ResourceData.getPagenameFromData(RESOURCE_DATA)

	-- if this particular data block doesn't have a page name, this will return nil
	-- therefore, error handling will be necessary
	return RESOURCE_DATA.page or nil
end



-- simpler version if all that's needed is the description.
-- error handling by the calling module is required.
function ResourceData.getDescription(strArg)

	local data = getData(strArg)
	
	-- if this particular data block doesn't have a description, this will return nil
	-- therefore, error handling will be necessary
	return data.description or nil
end
-- and if the table is provided instead of the name to lookup
function ResourceData.getDescriptionFromData(RESOURCE_DATA)

	-- if this particular data block doesn't have a description, this will return nil
	-- therefore, error handling will be necessary
	return RESOURCE_DATA.description or nil
end



-------------------------------------------------------------------------------
-- Return when required into another Module.
-------------------------------------------------------------------------------
return ResourceData