private static ThingDef ResolveSpawner(IncidentParms parms) { Map iwMap = (Map)parms.target; var abberation = (GenCelestial.IsDaytime(GenCelestial.CelestialSunGlow(iwMap, Find.TickManager.TicksAbs))) ? MonsterDefOf.ROM_StarVampireSpawnerAbberation : MonsterDefOf.ROM_StarVampireSpawnerNight; var chance = Rand.Value; if (chance > 0.3) { return(MonsterDefOf.ROM_StarVampireSpawner); } else if (chance > 0.05) { return(abberation); } else { return(MonsterDefOf.ROM_StarVampireSpawnerAlbino); } }
public int[] CalcPotentialHoursToFire(Map map, int flareTicks, ref int hourCount) { int currentTick = Find.TickManager.TicksAbs; int numHoursFromNow = (flareTicks / 2500); if (numHoursFromNow == 0) { return(null); } hourCount += numHoursFromNow; var result = new int[numHoursFromNow]; for (int hoursFromNow = 1; hoursFromNow <= numHoursFromNow; hoursFromNow++) { if (GenCelestial.CelestialSunGlow(map, currentTick + (2500 * hoursFromNow)) < MaxSunGlowForRaid) { result[hoursFromNow - 1] = hoursFromNow; } } return(result); }
private bool AuroraWillEndSoon(Map map) { return(GenCelestial.CurCelestialSunGlow(map) > 0.5f || GenCelestial.CelestialSunGlow(map, Find.TickManager.TicksAbs + 5000) > 0.5f); }