package ru.dbotthepony.mc.otm.config

object ServerConfig : AbstractConfig("misc") {
	val LABORATORY_LAMP_LIGHT_LENGTH: Int by builder.comment("In blocks").defineInRange("LABORATORY_LAMP_LIGHT_LENGTH", 6, 1, 128)
	val INFINITE_EXOSUIT_UPGRADES: Boolean by builder.comment("Allows to apply the same upgrade over and over again.", "Obviously completely breaks balance.").define("INFINITE_EXOSUIT_UPGRADES", false)

	init {
		builder.push("EXPERIENCE_CAPSULES")
	}

	val DROP_EXPERIENCE_CAPSULES: Boolean by builder
		.comment("Whenever to replace regular player experience drops with experience capsules")
		.comment("These capsules can be collected by gravestone mods, and are not limited in experience they can contain")
		.define("ENABLED", true)

	val MIN_EXPERIENCE_DROPPED: Double by builder
		.comment("Minimal percent of experience dropped on death into capsules")
		.defineInRange("MINIMAL_PERCENT", 0.4, 0.0, 1.0)

	val MAX_EXPERIENCE_DROPPED: Double by builder
		.comment("Maximal percent of experience dropped on death into capsules")
		.defineInRange("MAXIMAL_PERCENT", 0.8, 0.0, 1.0)

	init {
		builder.pop()
		builder.push("BLACKHOLES")
		Blackhole
	}

	object Blackhole {
		val PLAYER_DAMAGE_SCALE: Double by builder
			.comment("Percentage of damage received by players from Event Horizon of Singularities")
			.defineInRange("PLAYER_DAMAGE_SCALE", 0.25, 0.0, Float.MAX_VALUE.toDouble())

		val MOB_DAMAGE_SCALE: Double by builder
			.comment("Percentage of damage received by non players from Event Horizon of Singularities")
			.defineInRange("MOB_DAMAGE_SCALE", 1.0, 0.0, Float.MAX_VALUE.toDouble())

		val BOSS_DAMAGE_SCALE: Double by builder
			.comment("Percentage of damage received by bosses (forge:bosses tag) from Event Horizon of Singularities")
			.defineInRange("BOSS_DAMAGE_SCALE", 0.25, 0.0, Float.MAX_VALUE.toDouble())

		val PLAYER_FORCE_MULTIPLIER: Double by builder
			.comment("Percentage of gravity force experienced by players from Singularities")
			.defineInRange("PLAYER_FORCE_MULTIPLIER", 0.4, 0.0, Float.MAX_VALUE.toDouble())

		val MOB_FORCE_MULTIPLIER: Double by builder
			.comment("Percentage of gravity force experienced by non players from Singularities")
			.defineInRange("MOB_FORCE_MULTIPLIER", 1.0, 0.0, Float.MAX_VALUE.toDouble())

		val BOSS_FORCE_MULTIPLIER: Double by builder
			.comment("Percentage of gravity force experienced by bosses (forge:bosses tag) from Singularities")
			.defineInRange("BOSS_FORCE_MULTIPLIER", 0.4, 0.0, Float.MAX_VALUE.toDouble())

		val DESTROY_BLOCKS: Boolean by builder
			.comment("Whenever singularities should destroy blocks")
			.comment("Keep in mind that mobs behind blocks can cause serious server lag")
			.comment("when trying to reach singularity")
			.define("DESTROY_BLOCKS", true)
	}

	init {
		builder.pop()
	}
}
