GLOBAL.require("map/terrain")
local toughstone_rate = (GetModConfigData("toughstone_rate"))
local toughstone_regions = (GetModConfigData("toughstone_regions"))
GLOBAL.terrain.rooms.BGNoise.contents.distributeprefabs.rock_tough = toughstone_rate
GLOBAL.terrain.rooms.NoisyCave.contents.distributeprefabs.rock_tough = toughstone_rate
GLOBAL.terrain.rooms.CaveRoom.contents.distributeprefabs.rock_tough = toughstone_rate
--GLOBAL.terrain.rooms.RockLobsterPlains.contents.distributeprefabs.rock_tough = toughstone_rate
--GLOBAL.terrain.rooms.BatCaveRoom.contents.distributeprefabs.rock_tough = (toughstone_rate/2)
--GLOBAL.terrain.rooms.BatCaveRoomAntichamber.contents.distributeprefabs.rock_tough = (toughstone_rate/2)
--Will be activated as soon as more caves are in multiplayer
GLOBAL.terrain.rooms.BGDirt.contents.distributeprefabs.rock_tough = toughstone_rate
GLOBAL.terrain.rooms.BGBadlands.contents.distributeprefabs.rock_tough = toughstone_rate
GLOBAL.terrain.rooms.BGChessRocky.contents.distributeprefabs.rock_tough = (toughstone_rate/2)
GLOBAL.terrain.rooms.BGRocky.contents.distributeprefabs.rock_tough = toughstone_rate*2
GLOBAL.terrain.rooms.Rocky.contents.distributeprefabs.rock_tough = toughstone_rate*2
if toughstone_regions~=nil then
	if toughstone_regions>1 then
		GLOBAL.terrain.rooms.Marsh.contents.distributeprefabs.rock_tough = (toughstone_rate/25)
		GLOBAL.terrain.rooms.BGMarsh.contents.distributeprefabs.rock_tough = (toughstone_rate/25)
		GLOBAL.terrain.rooms.SlightlyMermySwamp.contents.distributeprefabs.rock_tough = (toughstone_rate/25)
	end
	if toughstone_regions>2 then
		GLOBAL.terrain.rooms.CrappyForest.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		GLOBAL.terrain.rooms.Forest.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		GLOBAL.terrain.rooms.DeepForest.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		GLOBAL.terrain.rooms.CrappyDeepForest.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		GLOBAL.terrain.rooms.BGForest.contents.distributeprefabs.rock_tough = (toughstone_rate/20)
		--GLOBAL.terrain.rooms.Graveyard.contents.distributeprefabs.rock_tough = (toughstone_rate/4) --glitched? Did I mispell it?
	end
	if toughstone_regions>3 then
		GLOBAL.terrain.rooms.BGNoise.contents.distributeprefabs.rock_tough = (toughstone_rate/60)	-- not quite sure if this does what i think it does
		GLOBAL.terrain.rooms.Plain.contents.distributeprefabs.rock_tough = (toughstone_rate/80)
		GLOBAL.terrain.rooms.BarePlain.contents.distributeprefabs.rock_tough = (toughstone_rate/50)
		GLOBAL.terrain.rooms.BGSavanna.contents.distributeprefabs.rock_tough = (toughstone_rate/70)
		GLOBAL.terrain.rooms.BGGrass.contents.distributeprefabs.rock_tough = (toughstone_rate/50)
		GLOBAL.terrain.rooms.EvilFlowerPatch.contents.distributeprefabs.rock_tough = (toughstone_rate/50)
	end
else
	print("toughstone_regions is nil/null")
end



GLOBAL.terrain.filter.rock_tough = {GLOBAL.GROUND.ROAD, GLOBAL.GROUND.WOODFLOOR, GLOBAL.GROUND.CARPET, GLOBAL.GROUND.CHECKER}




