local toughstone_rate = (GetModConfigData("toughstone_rate")/4)
local toughstone_regions = (GetModConfigData("toughstone_regions"))

--[[AddRoomPreInit("BGNoise", function(room)
	room.contents.distributeprefabs.rock_tough = toughstone_rate
end)

AddRoomPreInit("NoisyCave", function(room)
	room.contents.distributeprefabs.rock_tough = toughstone_rate
end)

AddRoomPreInit("CaveRoom", function(room)
	room.contents.distributeprefabs.rock_tough = toughstone_rate
end)

AddRoomPreInit("RockLobsterPlains", function(room)
	room.contents.distributeprefabs.rock_tough = toughstone_rate
end)

AddRoomPreInit("BatCaveRoom", function(room)
	room.contents.distributeprefabs.rock_tough = (toughstone_rate/2)
end)

AddRoomPreInit("BatCaveRoomAntichamber", function(room)
	room.contents.distributeprefabs.rock_tough = (toughstone_rate/2)
end)
Will be activated as soon as more caves are in multiplayer]]

AddRoomPreInit("BGDirt", function(room)
	room.contents.distributeprefabs.rock_tough = toughstone_rate/3
end)

AddRoomPreInit("BGBadlands", function(room)
	room.contents.distributeprefabs.rock_tough = toughstone_rate/3
end)

AddRoomPreInit("BGChessRocky", function(room)
	room.contents.distributeprefabs.rock_tough = (toughstone_rate/2)
end)

AddRoomPreInit("BGRocky", function(room)
	room.contents.distributeprefabs.rock_tough = toughstone_rate
end)

AddRoomPreInit("Rocky", function(room)
	room.contents.distributeprefabs.rock_tough = toughstone_rate
end)

print("Spawned Tough Stone in Rocky Biomes")

if toughstone_regions~=nil then
	if toughstone_regions>1 then
		AddRoomPreInit("Marsh", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/16)
		end)

		AddRoomPreInit("BGMarsh", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/16)
		end)

		AddRoomPreInit("SlightlyMermySwamp", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/16)
		end)
		print("Spawned Tough Stone in Marsh Biomes")
	end

	if toughstone_regions>2 then
		AddRoomPreInit("CrappyForest", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		end)

		AddRoomPreInit("Forest", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		end)

		AddRoomPreInit("DeepForest", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		end)

		AddRoomPreInit("CrappyDeepForest", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		end)

		AddRoomPreInit("BGForest", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		end)

		print("Spawned Tough Stone in Forrest Biomes")
		--[[AddRoomPreInit("Graveyard", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/4) --glitched? Did I mispell it?
		end)]]

	end
	
	if toughstone_regions>3 then
		AddRoomPreInit("BGNoise", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/60)	-- not quite sure if this does what i think it does
		end)

		AddRoomPreInit("Plain", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/80)
		end)

		AddRoomPreInit("BarePlain", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/50)
		end)

		AddRoomPreInit("BGSavanna", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/70)
		end)

		AddRoomPreInit("BGGrass", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/50)
		end)

		AddRoomPreInit("EvilFlowerPatch", function(room)
			room.contents.distributeprefabs.rock_tough = (toughstone_rate/50)
		end)

		print("Spawned Tough Stone almost fucking everywhere!")
	end
else
	print("toughstone_regions is nil")
end