From: TheSaminator Date: Wed, 6 Jul 2022 14:40:57 +0000 (-0400) Subject: Make high-degree nodes less likely to spread faction control per edge X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=6be121f70d3b6d77aa51f673fbffd27590ba5c1c;p=starship-fights Make high-degree nodes less likely to spread faction control per edge --- diff --git a/src/jvmMain/kotlin/net/starshipfights/campaign/cluster_gen.kt b/src/jvmMain/kotlin/net/starshipfights/campaign/cluster_gen.kt index e7fd3a3..6d63579 100644 --- a/src/jvmMain/kotlin/net/starshipfights/campaign/cluster_gen.kt +++ b/src/jvmMain/kotlin/net/starshipfights/campaign/cluster_gen.kt @@ -367,6 +367,7 @@ class ClusterGenerator(val settings: ClusterGenerationSettings) { borderingSystems += lane.systemA } + val degree = borderingSystems.size borderingSystems.retainAll(uncontrolledSystems) for (borderId in borderingSystems) { @@ -374,7 +375,7 @@ class ClusterGenerator(val settings: ClusterGenerationSettings) { uncontrolledSystems -= borderId - if (Random.nextDouble() < settings.contention.controlSpreadChance) + if (Random.nextDouble() < settings.contention.controlSpreadChance / degree) systemControllers[borderId] = systemControllers.getValue(systemId).let { faction -> if (Random.nextBoolean()) faction