Add new textures, tweak effects, add fog and freezing of river water

This commit is contained in:
Till Affeldt
2020-04-22 00:54:27 +02:00
parent e0b8d6d835
commit 32ab2c4d23
27 changed files with 223 additions and 65 deletions

View File

@ -1,5 +1,4 @@
local name = "regional_weather:ambient"
local CLOUD_SPEED = 1.8
local conditions = {}
@ -8,9 +7,9 @@ local function generate_effects(params)
local override = {}
local wind = climate_api.environment.get_wind()
local skybox = {}
local skybox = {priority = 0}
skybox.cloud_data = {
size = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98),
density = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98),
speed = vector.multiply(wind, CLOUD_SPEED),
thickness = climate_api.utility.rangelim(params.base_humidity * 0.2, 1, 18)
}
@ -18,7 +17,6 @@ local function generate_effects(params)
if params.height > -100 and params.humidity > 65 then
skybox.sky_data = {
type = "regular",
--base_color = { r = 106, g = 130, b = 142 },
clouds = true,
sky_color = {
day_sky = "#6a828e",
@ -31,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

@ -17,7 +17,8 @@ effects["climate_api:skybox"] = {
sunrise_visible = false
},
moon_data = { visible = false },
stars_data = { visible = false }
star_data = { visible = false },
priority = 100
}
climate_api.register_weather(name, conditions, effects)

34
ca_weathers/fog.lua Normal file
View File

@ -0,0 +1,34 @@
local name = "regional_weather:fog"
local conditions = {
}
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_fog.png",
z_index = -200
}
effects["climate_api:skybox"] = {
cloud_data = {
density = 1,
color = "#ffffffff",
thickness = 40,
speed = {x=0,y=0,z=0}
},
priority = 50
}
local function generate_effects(params)
local override = {}
override["climate_api:skybox"] = {
cloud_data = {
height = params.player:get_pos().y
}
}
return climate_api.utility.merge_tables(effects, override)
end
climate_api.register_weather(name, conditions, generate_effects)

View File

@ -11,7 +11,10 @@ local conditions = {
local effects = {}
effects["regional_weather:damage"] = 1
effects["regional_weather:damage"] = {
chance = 15,
value = 3
}
effects["climate_api:sound"] = {
name = "weather_hail",
@ -21,9 +24,9 @@ effects["climate_api:sound"] = {
effects["climate_api:particles"] = {
min_pos = {x=-9, y=7, z=-9},
max_pos = {x= 9, y=7, z= 9},
falling_speed=15,
amount=5,
exptime=0.8,
falling_speed=20,
amount=6,
exptime=0.7,
size=1,
textures = {}
}

View File

@ -12,14 +12,15 @@ local conditions = {
local effects = {}
effects["climate_api:sound"] = {
name = "weather_rain"
name = "weather_rain",
gain = 1.5
}
effects["climate_api:particles"] = {
min_pos = {x=-9, y=7, z=-9},
max_pos = {x= 9, y=7, z= 9},
exptime=0.8,
size=1,
size=2,
texture = "weather_raindrop.png"
}
@ -33,7 +34,7 @@ local function generate_effects(params)
}
override["climate_api:particles"] = {
amount = 20 * math.min(intensity, 1.5),
amount = 25 * math.min(intensity, 1.5),
falling_speed = 10 / math.min(intensity, 1.3)
}

View File

@ -11,18 +11,23 @@ local conditions = {
local effects = {}
effects["climate_api:sound"] = {
name = "weather_rain",
name = "weather_rain_heavy",
gain = 1
}
effects["climate_api:particles"] = {
min_pos = {x=-9, y=7, z=-9},
max_pos = {x= 9, y=7, z= 9},
falling_speed=10,
amount=20,
falling_speed=7,
amount=17,
exptime=0.8,
size=25,
texture="weather_rain.png"
min_size=25,
max_size=35,
textures={
"weather_rain.png",
"weather_rain.png",
"weather_rain_medium.png"
}
}
climate_api.register_weather(name, conditions, effects)

View File

@ -5,8 +5,7 @@ local conditions = {
max_height = regional_weather.settings.max_height,
min_heat = 50,
max_humidity = 25,
min_windspeed = 6,
daylight = 15,
min_windspeed = 4.5,
has_biome = {
"cold_desert",
"cold_desert_ocean",
@ -24,14 +23,48 @@ effects["climate_api:hud_overlay"] = {
z_index = -100
}
effects["climate_api:particles"] = {
min_pos = {x=-9, y=-5, z=-9},
max_pos = {x= 9, y= 5, z= 9},
falling_speed=1,
amount=40,
exptime=0.8,
size=15,
texture="weather_sand.png"
effects["regional_weather:damage"] = {
chance = 3,
value = 1
}
climate_api.register_weather(name, conditions, effects)
effects["climate_api:particles"] = {
min_pos = {x=-5, y=-4, z=-5},
max_pos = {x= 5, y= 4.5, z= 5},
falling_speed=1.2,
acceleration={x=0,y=0.8,z=0},
amount=40,
exptime=1.8,
size=20,
textures={
"weather_sandstorm.png",
"weather_sandstorm.png^[transformR180"
}
}
effects["climate_api:skybox"] = {
cloud_data = {
density = 1,
color = "#f7e4bfc0",
thickness = 40,
speed = {x=0,y=0,z=0}
},
priority = 60
}
local function generate_effects(params)
local override = table.copy(effects)
override["climate_api:skybox"] = {
cloud_data= {
height = params.player:get_pos().y
}
}
if params.daylight < 15 then
local result = {}
result["climate_api:skybox"] = override["climate_api:skybox"]
return result
end
return override
end
climate_api.register_weather(name, conditions, generate_effects)

View File

@ -19,7 +19,7 @@ effects["climate_api:particles"] = {
min_pos = {x=-8, y=3, z=-8},
max_pos = {x= 8, y=6, z= 8},
exptime=6,
size=12,
size=10,
texture="weather_snow.png"
}
@ -28,12 +28,8 @@ local function generate_effects(params)
local intensity = params.humidity / avg_humidity
local override = {}
override["climate_api:sound"] = {
gain = math.min(intensity, 1.2)
}
override["climate_api:particles"] = {
amount = 8 * math.min(intensity, 1.5),
amount = 16 * math.min(intensity, 1.5),
falling_speed = 1 / math.min(intensity, 1.3)
}