1
0
mirror of https://github.com/t-affeldt/regional_weather.git synced 2025-09-14 12:25:19 +02:00

Tweak fog effect, add puddle variants, imrove frost HUD

This commit is contained in:
Till Affeldt
2020-04-24 01:36:58 +02:00
parent 32ab2c4d23
commit 677382c142
50 changed files with 174 additions and 69 deletions

View File

@@ -7,9 +7,9 @@ local function generate_effects(params)
local override = {}
local wind = climate_api.environment.get_wind()
local skybox = {priority = 0}
local skybox = {priority = 10}
skybox.cloud_data = {
density = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98),
density = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.75),
speed = vector.multiply(wind, CLOUD_SPEED),
thickness = climate_api.utility.rangelim(params.base_humidity * 0.2, 1, 18)
}
@@ -29,7 +29,7 @@ local function generate_effects(params)
}
end
--override["climate_api:skybox"] = skybox
override["climate_api:skybox"] = skybox
local movement = params.player:get_player_velocity()
local movement_direction

View File

@@ -1,20 +1,24 @@
local name = "regional_weather:fog"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_humidity = 40,
max_humidity = 50,
max_windspeed = 2,
min_heat = 40,
max_heat = 50
}
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_fog.png",
z_index = -200
}
effects["climate_api:skybox"] = {
sky_data = {
clouds = true
},
cloud_data = {
density = 1,
color = "#ffffffff",
color = "#ffffff00",
thickness = 40,
speed = {x=0,y=0,z=0}
},
@@ -25,7 +29,7 @@ local function generate_effects(params)
local override = {}
override["climate_api:skybox"] = {
cloud_data = {
height = params.player:get_pos().y
height = params.player:get_pos().y - 20
}
}
return climate_api.utility.merge_tables(effects, override)

31
ca_weathers/fog_heavy.lua Normal file
View File

@@ -0,0 +1,31 @@
local name = "regional_weather:fog_heavy"
local conditions = {
min_height = regional_weather.settings.min_height * 0.9,
max_height = regional_weather.settings.max_height * 0.9,
min_humidity = 43,
max_humidity = 47,
max_windspeed = 1.5,
min_heat = 43,
max_heat = 47
}
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_fog.png^[opacity:100",
z_index = -200
}
effects["climate_api:skybox"] = {
sky_data = {
type = "plain",
base_color = "#c0c0c08f"
},
cloud_data = {
color = "#ffffffc0",
},
priority = 51
}
climate_api.register_weather(name, conditions, effects)

View File

@@ -36,11 +36,12 @@ local effects = {}
effects["climate_api:particles"] = {
min_pos = {x=-12, y=-4, z=-12},
max_pos = {x= 12, y= 1, z= 12},
falling_speed=-0.1,
amount=1,
exptime=5,
size=0.8,
texture="weather_pollen.png"
falling_speed = -0.1,
acceleration = {x=0,y=-0.03,z=0},
amount = 1,
exptime = 5,
size = 0.8,
texture = "weather_pollen.png"
}
climate_api.register_weather(name, conditions, effects)

View File

@@ -43,6 +43,11 @@ effects["climate_api:particles"] = {
}
effects["climate_api:skybox"] = {
sky_data = {
type = "plain",
base_color = "#f7e4bfff",
clouds = true,
},
cloud_data = {
density = 1,
color = "#f7e4bfc0",
@@ -53,12 +58,13 @@ effects["climate_api:skybox"] = {
}
local function generate_effects(params)
local override = table.copy(effects)
local override = {}
override["climate_api:skybox"] = {
cloud_data= {
height = params.player:get_pos().y
height = params.player:get_pos().y - 20
}
}
override = climate_api.utility.merge_tables(effects, override)
if params.daylight < 15 then
local result = {}
result["climate_api:skybox"] = override["climate_api:skybox"]

View File

@@ -11,7 +11,7 @@ local conditions = {
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_ice.png",
file = "weather_hud_frost.png",
z_index = -100
}