public void Initialize() { precipitationNoise = SimplexNoise.FromDefaultOctaves(4, 0.02 / 3, 0.95, api.World.Seed - 18971121); precipitationNoiseSub = SimplexNoise.FromDefaultOctaves(3, 0.004 / 3, 0.95, api.World.Seed - 1717121); simLightning = new WeatherSimulationLightning(api, this); }
public override void Start(ICoreAPI api) { this.api = api; api.Event.OnGetClimate += Event_OnGetClimate; coreSys = api.ModLoader.GetModSystem <SurvivalCoreSystem>(); YearlyTemperatureNoise = SimplexNoise.FromDefaultOctaves(3, 0.001, 0.95, api.World.Seed + 12109); DailyTemperatureNoise = SimplexNoise.FromDefaultOctaves(3, 1, 0.95, api.World.Seed + 128109); }
private void LoadNoise() { if (api.Side == EnumAppSide.Server) { updateOldWorlds(); } temporalStabilityEnabled = api.World.Config.GetBool("temporalStability", true); if (!temporalStabilityEnabled) { return; } stabilityNoise = SimplexNoise.FromDefaultOctaves(4, 0.1, 0.9, api.World.Seed); if (api.Side == EnumAppSide.Server) { worldConfigStorminess = api.World.Config.GetString("temporalStorms"); stormsEnabled = worldConfigStorminess != "off"; if (worldConfigStorminess != null && configs.ContainsKey(worldConfigStorminess)) { config = configs[worldConfigStorminess]; } else { string playstyle = sapi.WorldManager.SaveGame.PlayStyle; if (playstyle == "surviveandbuild" || playstyle == "wildernesssurvival") { config = configs["rare"]; } else { config = null; } } sapi.Event.OnEntityDeath += Event_OnEntityDeath; doubleHeadedDrifterType = sapi.World.GetEntityType(new AssetLocation("drifter-double-headed")); drifterTypes = new EntityProperties[] { sapi.World.GetEntityType(new AssetLocation("drifter-normal")), sapi.World.GetEntityType(new AssetLocation("drifter-deep")), sapi.World.GetEntityType(new AssetLocation("drifter-tainted")), sapi.World.GetEntityType(new AssetLocation("drifter-corrupt")), sapi.World.GetEntityType(new AssetLocation("drifter-nightmare")) }; } }
public void Initialize() { precipitationNoise = SimplexNoise.FromDefaultOctaves(4, 0.02 / 3, 0.95, api.World.Seed - 18971121); precipitationNoiseSub = SimplexNoise.FromDefaultOctaves(3, 0.004 / 3, 0.95, api.World.Seed - 1717121); }