diff --git a/1.3/Assemblies/ZombieLand.dll b/1.3/Assemblies/ZombieLand.dll index e64f7925..cf904949 100644 Binary files a/1.3/Assemblies/ZombieLand.dll and b/1.3/Assemblies/ZombieLand.dll differ diff --git a/About/Manifest.xml b/About/Manifest.xml index 0dffadaf..861d0ee9 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@  net.pardeike.rimworld.mod.zombieland - 2.9.2.0 + 2.9.3.0
  • 1.0.0
  • 1.1.0
  • diff --git a/Source/SoSTools.cs b/Source/SoSTools.cs index c1ff03e2..6a24aa05 100644 --- a/Source/SoSTools.cs +++ b/Source/SoSTools.cs @@ -14,7 +14,9 @@ public class SoSTools { public class Floater { - public static readonly int totalCount = 50; + public const int totalCount = 50; + const float minSize = 0.25f; + const float maxSize = 3f; public IntVec3 mapSize; public Material material; @@ -40,11 +42,11 @@ public void Update(int i, int count) if (scale == 0 || position.x < -4 || position.z < -4 || position.x > mapSize.x + 4 || position.z > mapSize.z + 4) { var f = GenMath.LerpDoubleClamped(0, count - 1, 0, 1, i); - scale = (1 + Mathf.Pow(f, Mathf.Pow(f + 1.4f, 4)) * 3) / 4; - speed = GenMath.LerpDoubleClamped(0.25f, 1, 0.1f, 1, scale); - var yAltitute = (f >= 0.985f ? 20f : -0.5f) + i / 1000f; + scale = minSize + Mathf.Pow(f, Mathf.Pow(f + 1.4f, 4)) * (maxSize - minSize); + speed = 2 * Mathf.Pow(GenMath.LerpDoubleClamped(minSize, maxSize, 0.2f, 1, scale), 2); + var yAltitute = (f >= 0.8f ? 20f : -0.5f) + i / 1000f; angle = Rand.Range(0f, 359f); - rotation = Rand.Range(-0.4f, 0.4f); + rotation = (Rand.Chance(0.2f) ? 3f : 1f) * Rand.Range(-0.4f, 0.4f); switch (Rand.Int % 4) { case 0: // bottom diff --git a/Source/Tools.cs b/Source/Tools.cs index 98b65f93..911a9e25 100644 --- a/Source/Tools.cs +++ b/Source/Tools.cs @@ -598,6 +598,13 @@ public static bool IsValidSpawnLocation(IntVec3 cell, Map map) { if (cell.Standable(map) == false || cell.Fogged(map)) return false; + if (map.IsSpace()) + { + var room = cell.GetRoom(map); + if (room == null || room.OpenRoofCount > 0 || room.TouchesMapEdge) + return false; + } + var edifice = cell.GetEdifice(map); if (edifice != null && edifice is Building_Door door) if (door.Open == false) diff --git a/Source/ZombieIncidents.cs b/Source/ZombieIncidents.cs index 407efa13..2ad3f07c 100644 --- a/Source/ZombieIncidents.cs +++ b/Source/ZombieIncidents.cs @@ -82,6 +82,12 @@ public static bool ZombiesForNewIncident(TickManager tickManager) tickManager.incidentInfo.parameters = new IncidentParameters(); var parameters = tickManager.incidentInfo.parameters; + if (tickManager.map.IsSpace()) + { + parameters.skipReason = "no zombie events in space"; + return false; + } + var currentMax = Mathf.FloorToInt(tickManager.GetMaxZombieCount() * ZombieWeather.GetThreatLevel(tickManager.map)); parameters.capableColonists = Tools.CapableColonists(tickManager.map); @@ -250,14 +256,14 @@ static IEnumerator SpawnEventProcess(Map map, int incidentSize, IntVec3 spot, Pr public static IntVec3 GetValidSpot(Map map, IntVec3 spot, Predicate cellValidator) { + if (ZombieSettings.Values.spawnHowType == SpawnHowType.FromTheEdges && map.IsSpace()) + return IntVec3.Invalid; + var allOverTheMap = ZombieSettings.Values.spawnHowType == SpawnHowType.AllOverTheMap; var spotValidator = SpotValidator(cellValidator); - for (var counter = 1; counter <= 10; counter++) { if (spot.IsValid) break; - - var allOverTheMap = ZombieSettings.Values.spawnHowType == SpawnHowType.AllOverTheMap; spot = Tools.RandomSpawnCell(map, allOverTheMap == false, spotValidator); } return spot; diff --git a/Source/ZombieLand.csproj b/Source/ZombieLand.csproj index faf77fdc..69706ea7 100644 --- a/Source/ZombieLand.csproj +++ b/Source/ZombieLand.csproj @@ -10,7 +10,7 @@ ..\1.3\Assemblies\ true false - 2.9.2.0 + 2.9.3.0 Copyright © 2017