require "Foraging/forageSystem"
require "Foraging/forageDefinitions"

function pebbleForagingAdd()

local pebbleItems = {
	normal = {
		chance = 25,
		xp = 1,
		items = {
			Granite                    = "Base.DirtyPebble35",
			Diorite                    = "Base.DirtyPebble26",
			Gabbro                     = "Base.DirtyPebble29",
			Sandstone                  = "Base.DirtyPebble68",
			Siltstone                  = "Base.DirtyPebble72",
			Schist                     = "Base.DirtyPebble69",
			Brick                      = "Base.DirtyPebble16",
			SeaGlass                   = "Base.DirtyPebble32",
			SeaPottery                 = "Base.DirtyPebble61",
		},
	},
	common = {
		chance = 20,
		xp = 2,
		items = {
			Quartzite                   = "Base.DirtyPebble64",
			Amphibolite                 = "Base.DirtyPebble5",
			Slate                       = "Base.DirtyPebble73",
			Hornfels                    = "Base.DirtyPebble43",
			Granofels                   = "Base.DirtyPebble36",
			Gneiss                      = "Base.DirtyPebble3",	
			Phyllite                    = "Base.DirtyPebble60",
			Calcite                     = "Base.DirtyPebble17",
			Gypsum                      = "Base.DirtyPebble37",
		},
	},
	uncommon = {
		chance = 15,
		xp = 5,
		items = {
			Pyrite                     = "Base.DirtyPebble63",
			Chert                      = "Base.DirtyPebble23",
			Feldspar                   = "Base.DirtyPebble27",
			Agate                      = "Base.DirtyPebble1",
			Chalcedony                 = "Base.DirtyPebble21",
			Chabazite                  = "Base.DirtyPebble20",
			Heulandite                 = "Base.DirtyPebble41",
			Apophyllite                = "Base.DirtyPebble8",
			Mordenite                  = "Base.DirtyPebble54",
			Natrolite                  = "Base.DirtyPebble56",
			Halite                     = "Base.DirtyPebble38",
			Spodumene                  = "Base.DirtyPebble76",
			Anhydrite                  = "Base.DirtyPebble7",
			Muscovite                  = "Base.DirtyPebble55",
			Selenite                   = "Base.DirtyPebble70",
			Magnetite                  = "Base.DirtyPebble49",
		},
	},
	unlikely = {
		chance = 10,
		xp = 10,
		items = {
			Analcime                   = "Base.DirtyPebble6",
			BiotiteMica                = "Base.DirtyPebble13",
			Siderite                   = "Base.DirtyPebble71",
			Flourite                   = "Base.DirtyPebble28",
			Hornblende                 = "Base.DirtyPebble42",
			Garnet                     = "Base.DirtyPebble31",
			Tourmaline                 = "Base.DirtyPebble78",
			Hematite                   = "Base.DirtyPebble40",
			Goethite                   = "Base.DirtyPebble34",
			Galena                     = "Base.DirtyPebble30",
			Chalcopyrite               = "Base.DirtyPebble22",
			Manganite                  = "Base.DirtyPebble51",
			Arsenopyrite               = "Base.DirtyPebble10",
			Lepidolite                 = "Base.DirtyPebble48",
			OrangeCalcite              = "Base.DirtyPebble58",
			Unakite                    = "Base.DirtyPebble79",
			SmokeyQuartz               = "Base.DirtyPebble74",
			Howlite                    = "Base.DirtyPebble44",
			Probertite                 = "Base.DirtyPebble62",
			Barite                     = "Base.DirtyPebble12",
			Orthoclase                 = "Base.DirtyPebble59",
		},
	},
	rare = {
		chance = 7,
		xp = 20,
		items = {
			TigersIron                = "Base.DirtyPebble77",
			RoseQuartz                = "Base.DirtyPebble66",
			Mica                      = "Base.DirtyPebble52",
			Labradorite               = "Base.DirtyPebble46",
			Aventurine                = "Base.DirtyPebble11",
			RutilatedQuartz           = "Base.DirtyPebble67",
			Malachite                 = "Base.DirtyPebble50",
			DesertRose                = "Base.DirtyPebble25",
			RedTigersEye              = "Base.DirtyPebble65",
			Obsidian                  = "Base.DirtyPebble57",
			Jasper                    = "Base.DirtyPebble45",
			HawksEye                  = "Base.DirtyPebble39",
			Citrine                   = "Base.DirtyPebble24",
			Aragonite                 = "Base.DirtyPebble9",
			Celestite                 = "Base.DirtyPebble19",
			Amazonite                 = "Base.DirtyPebble2",
		},
	},
	legendary = {
		chance = 3,
		xp = 30,
		items = {
			Moonstone                 = "Base.DirtyPebble53",
			LapisLazuli               = "Base.DirtyPebble47",
			Amethyst                  = "Base.DirtyPebble4",
			Sodalite                  = "Base.DirtyPebble75",
			YellowCalcite             = "Base.DirtyPebble80",
			BlueLaceAgate             = "Base.DirtyPebble15",
			Amber                     = "Base.DirtyPebble3",
			Carnelian                 = "Base.DirtyPebble18",
			Bloodstone                = "Base.DirtyPebble14",
		},
	},
};
for _, spawnTable in pairs(pebbleItems) do
	for itemName, itemFullName in pairs(spawnTable.items) do
		forageSystem.addItemDef({
			type = itemFullName,
			skill = 2,
			xp = spawnTable.xp,
			categories = { "Junk" },
			zones = {
				Forest      = spawnTable.chance,
				DeepForest  = spawnTable.chance,
				Vegitation  = spawnTable.chance,
				FarmLand    = spawnTable.chance,
				Farm        = spawnTable.chance,
				TrailerPark = 6,
				TownZone    = 3,
				Nav         = 6,
			},
			spawnFuncs = { doGenericItemSpawn },
			forceOutside = false,
			canBeAboveFloor = true,
			itemSizeModifier = 0.5,
			isItemOverrideSize = true,
		});
	end;
end;

end

Events.onAddForageDefs.Add(pebbleForagingAdd);


