Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fog and mist weather #64954

Merged
merged 14 commits into from
Apr 21, 2023
72 changes: 71 additions & 1 deletion data/json/weather_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,76 @@
]
}
},
{
"id": "mist",
"type": "weather_type",
"name": "Mist",
"color": "light_gray",
"map_color": "dark_gray_white",
"sym": "~",
"ranged_penalty": 3,
"sight_penalty": 1.2,
"light_modifier": -20,
"sun_multiplier": 0.3,
"sound_attn": 0,
"dangerous": false,
"precip": "light",
"rains": false,
"sound_category": "silent",
"priority": 1000,
"condition": {
"and": [
{ "math": [ "u_val( 'weather:windpower' )", ">", "12" ] },
{ "math": [ "u_val( 'weather:windpower' )", "<", "0" ] },
GuardianDll marked this conversation as resolved.
Show resolved Hide resolved
{ "math": [ "dew_point_factor", "<", "35" ] }
]
}
},
{
"id": "fog",
"type": "weather_type",
"name": "Fog",
"color": "light_gray",
"map_color": "dark_gray_white",
"sym": "~",
"ranged_penalty": 7,
"sight_penalty": 1.5,
"light_modifier": -40,
"sun_multiplier": 0.3,
"sound_attn": 0,
"dangerous": false,
"precip": "heavy",
"rains": false,
"sound_category": "silent",
"priority": 1000,
"required_weathers": [ "mist" ],
"condition": {
"and": [
{ "math": [ "u_val( 'weather:windpower' )", ">", "12" ] },
{ "math": [ "u_val( 'weather:windpower' )", "<", "0" ] },
{ "math": [ "dew_point_factor", "<=", "2.5" ] }
]
}
},
{
"type": "effect_on_condition",
"id": "EOC_DEW_POINT_FACTOR",
"recurrence": [ "15 minutes", "30 minutes" ],
"//": "First and second math calculate the dew point, the third calculate how close the weather to the point it can form a fog",
"//2": "dew_point_factor is a difference between actual temperature and the dew point. the closer it gets to zero, the bigger probability to cause a mist or dew, starting somewhere from 2,5 centigrade or 5 fahrenheit, to zero",
"effect": [
{
"math": [
"dprhx",
"=",
"log ( u_val( 'weather:humidity' ) / 100 ) + 17.625 * u_val( 'weather:temperature' ) / ( 469.5 + u_val( 'weather:temperature' ) )"
]
},
{ "math": [ "dew_point", "=", "469.5 * dprhx / ( 17.625 - dprhx )" ] },
{ "math": [ "dew_point_factor", "=", "u_val('weather: temperature') - ( dew_point )" ] },
{ "u_message": "dew_point_factor: <global_val:dew_point_factor>,\n", "type": "debug" }
]
},
{
"id": "early_portal_storm",
"type": "weather_type",
Expand All @@ -289,7 +359,7 @@
"tiles_animation": "weather_portal_storm",
"weather_animation": { "factor": 0.01, "color": "red", "sym": "*" },
"sound_category": "portal_storm",
"priority": 120,
"priority": 1,
"condition": { "compare_num": [ { "global_val": "var", "var_name": "cause_early_portal_storm" }, "=", { "const": 1 } ] }
},
{
Expand Down
1 change: 0 additions & 1 deletion data/mods/Xedra_Evolved/enchantments/armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"id": "DECREASE_BERSERKER",
"recurrence": "25 s",
"effect": [
{ "u_message": "BERSERK -1.", "type": "debug" },
{ "arithmetic": [ { "global_val": "var", "var_name": "BERSERKER" }, "--" ], "min": 0 }
]
GuardianDll marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down