Skip to content

Commit

Permalink
Move weather into JSON (#41617)
Browse files Browse the repository at this point in the history
* Move weather datum to json.

* Move more weather pieces into weather datum and json

* Consolidate sun strength

* Remove more sunny

* Check in of requirements, no more enum

* Set defaults and fix test

* Typo + cleanup

* Linting plus fix requirements

* Added documentation

* Update REGION_SETTINGS.md

* Fix travis

* Change for each loops

* Fix travis some more

* Clang tidy work

* Appease build

* First batch of code review work

* Last batch of code review

* Fix style issue

* Fix vision test

* Fix weather test

* Code review

* Linting

* Clang Tidy

* Astyle

* Merge fix

* Fix clang tidy

* Apply suggestions from code review

Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>

* Generic factory

* Compile fixes

* Fix tag mismatch

* Use size_t

* Fix build

* Travis fix

* astyle

* Clang tidy

* Use string id instead of string

* Test fix

* Astyle

* Clang

Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
  • Loading branch information
kevingranade and anothersimulacrum authored Jul 8, 2020
2 parents 4bed345 + 7192cc4 commit 98edfcd
Show file tree
Hide file tree
Showing 37 changed files with 1,120 additions and 614 deletions.
17 changes: 16 additions & 1 deletion data/json/regional_map_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,22 @@
"base_acid": 0.0,
"base_wind": 3.4,
"base_wind_distrib_peaks": 80,
"base_wind_season_variation": 50
"base_wind_season_variation": 50,
"weather_types": [
"clear",
"sunny",
"cloudy",
"light_drizzle",
"drizzle",
"rain",
"thunder",
"lightning",
"acid_drizzle",
"acid_rain",
"flurries",
"snowing",
"snowstorm"
]
},
"overmap_feature_flag_settings": { "clear_blacklist": false, "blacklist": [ ], "clear_whitelist": false, "whitelist": [ ] }
}
Expand Down
22 changes: 21 additions & 1 deletion data/json/test_regions.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,27 @@
"s_lot": 6
}
},
"weather": { "base_temperature": 8.0, "base_humidity": 40.0, "base_pressure": 1015.0, "base_acid": 0.0 },
"weather": {
"base_temperature": 8.0,
"base_humidity": 40.0,
"base_pressure": 1015.0,
"base_acid": 0.0,
"weather_types": [
"clear",
"sunny",
"cloudy",
"light_drizzle",
"drizzle",
"rain",
"thunder",
"lightning",
"acid_drizzle",
"acid_rain",
"flurries",
"snowing",
"snowstorm"
]
},
"overmap_feature_flag_settings": { "clear_blacklist": false, "blacklist": [ ], "clear_whitelist": false, "whitelist": [ ] }
},
{
Expand Down
293 changes: 293 additions & 0 deletions data/json/weather_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,293 @@
[
{
"id": "null",
"type": "weather_type",
"name": "NULL Weather - BUG",
"color": "c_magenta",
"map_color": "c_magenta_red",
"glyph": "0",
"ranged_penalty": 0,
"sight_penalty": 0.0,
"light_modifier": 0,
"sound_attn": 0,
"dangerous": false,
"precip": "none",
"rains": false,
"acidic": false,
"sun_intensity": "normal"
},
{
"id": "clear",
"type": "weather_type",
"name": "Clear",
"color": "c_cyan",
"map_color": "c_yellow_white",
"glyph": " ",
"ranged_penalty": 0,
"sight_penalty": 1.0,
"light_modifier": 0,
"sound_attn": 0,
"dangerous": false,
"precip": "none",
"rains": false,
"acidic": false,
"sun_intensity": "normal"
},
{
"id": "sunny",
"type": "weather_type",
"name": "Sunny",
"color": "c_light_cyan",
"map_color": "c_yellow_white",
"glyph": "*",
"ranged_penalty": 0,
"sight_penalty": 1.0,
"light_modifier": 2,
"sound_attn": 0,
"dangerous": false,
"precip": "none",
"rains": false,
"acidic": false,
"sun_intensity": "high",
"requirements": { "pressure_min": 1020, "humidity_max": 70, "time": "day" }
},
{
"id": "cloudy",
"type": "weather_type",
"name": "Cloudy",
"color": "c_light_gray",
"map_color": "c_dark_gray_white",
"glyph": "~",
"ranged_penalty": 0,
"sight_penalty": 1.0,
"light_modifier": -20,
"sound_attn": 0,
"dangerous": false,
"precip": "none",
"rains": false,
"acidic": false,
"sun_intensity": "light",
"requirements": { "pressure_max": 1010, "humidity_min": 40 }
},
{
"id": "light_drizzle",
"type": "weather_type",
"name": "Light Drizzle",
"color": "c_light_blue",
"map_color": "h_light_blue",
"glyph": ".",
"ranged_penalty": 0,
"sight_penalty": 1.01,
"light_modifier": -10,
"sound_attn": 0,
"dangerous": false,
"precip": "very_light",
"rains": true,
"acidic": false,
"tiles_animation": "weather_rain_drop",
"weather_animation": { "factor": 0.01, "color": "c_light_blue", "glyph": "," },
"sound_category": "drizzle",
"sun_intensity": "light",
"requirements": { "pressure_max": 1003, "humidity_min": 96, "humidity_and_pressure": false, "required_weathers": [ "cloudy" ] }
},
{
"id": "drizzle",
"type": "weather_type",
"name": "Drizzle",
"color": "c_light_blue",
"map_color": "h_light_blue",
"glyph": ".",
"ranged_penalty": 1,
"sight_penalty": 1.03,
"light_modifier": -20,
"sound_attn": 1,
"dangerous": false,
"precip": "light",
"rains": true,
"acidic": false,
"tiles_animation": "weather_rain_drop",
"weather_animation": { "factor": 0.01, "color": "c_light_blue", "glyph": "." },
"sound_category": "drizzle",
"sun_intensity": "light",
"requirements": { "pressure_max": 1000, "humidity_min": 97, "humidity_and_pressure": false, "required_weathers": [ "light_drizzle" ] }
},
{
"id": "rain",
"type": "weather_type",
"name": "Rain",
"color": "c_blue",
"map_color": "h_blue",
"glyph": "o",
"ranged_penalty": 3,
"sight_penalty": 1.1,
"light_modifier": -30,
"sound_attn": 4,
"dangerous": false,
"precip": "heavy",
"rains": true,
"acidic": false,
"tiles_animation": "weather_rain_drop",
"weather_animation": { "factor": 0.02, "color": "c_light_blue", "glyph": "," },
"sound_category": "rainy",
"sun_intensity": "light",
"requirements": {
"pressure_max": 993,
"humidity_min": 98,
"humidity_and_pressure": false,
"required_weathers": [ "light_drizzle", "drizzle" ]
}
},
{
"id": "thunder",
"type": "weather_type",
"name": "Thunder Storm",
"color": "c_dark_gray",
"map_color": "i_blue",
"glyph": "%",
"ranged_penalty": 4,
"sight_penalty": 1.2,
"light_modifier": -40,
"sound_attn": 8,
"dangerous": false,
"precip": "heavy",
"rains": true,
"acidic": false,
"effects": [ { "name": "thunder", "intensity": 50 } ],
"tiles_animation": "weather_rain_drop",
"weather_animation": { "factor": 0.02, "color": "c_light_blue", "glyph": "." },
"sound_category": "thunder",
"sun_intensity": "none",
"requirements": { "pressure_max": 996, "required_weathers": [ "rain" ] }
},
{
"id": "lightning",
"type": "weather_type",
"name": "Lightning Storm",
"color": "c_yellow",
"map_color": "h_yellow",
"glyph": "%",
"ranged_penalty": 4,
"sight_penalty": 1.25,
"light_modifier": -45,
"sound_attn": 8,
"dangerous": false,
"precip": "heavy",
"rains": true,
"acidic": false,
"effects": [ { "name": "thunder", "intensity": 50 }, { "name": "lightning", "intensity": 600 } ],
"tiles_animation": "weather_rain_drop",
"weather_animation": { "factor": 0.04, "color": "c_light_blue", "glyph": "," },
"sound_category": "thunder",
"sun_intensity": "none",
"requirements": { "pressure_max": 990, "required_weathers": [ "thunder" ] }
},
{
"id": "acid_drizzle",
"type": "weather_type",
"name": "Acidic Drizzle",
"color": "c_light_green",
"map_color": "c_yellow_green",
"glyph": ".",
"ranged_penalty": 2,
"sight_penalty": 1.03,
"light_modifier": -20,
"sound_attn": 1,
"dangerous": true,
"precip": "light",
"rains": true,
"acidic": true,
"effects": [ { "name": "light_acid", "intensity": 180 } ],
"tiles_animation": "weather_acid_drop",
"weather_animation": { "factor": 0.01, "color": "c_light_green", "glyph": "." },
"sound_category": "drizzle",
"sun_intensity": "normal",
"requirements": { "acidic": true, "required_weathers": [ "drizzle" ] }
},
{
"id": "acid_rain",
"type": "weather_type",
"name": "Acid Rain",
"color": "c_green",
"map_color": "c_yellow_green",
"glyph": "o",
"ranged_penalty": 4,
"sight_penalty": 1.1,
"light_modifier": -30,
"sound_attn": 4,
"dangerous": true,
"precip": "heavy",
"rains": true,
"acidic": true,
"effects": [ { "name": "acid", "intensity": 2 } ],
"tiles_animation": "weather_acid_drop",
"weather_animation": { "factor": 0.02, "color": "c_light_green", "glyph": "," },
"sound_category": "rainy",
"sun_intensity": "none",
"requirements": { "acidic": true, "required_weathers": [ "rain" ] }
},
{
"id": "flurries",
"type": "weather_type",
"name": "Flurries",
"color": "c_white",
"map_color": "c_dark_gray_cyan",
"glyph": ".",
"ranged_penalty": 2,
"sight_penalty": 1.12,
"light_modifier": -15,
"sound_attn": 2,
"dangerous": false,
"precip": "light",
"rains": false,
"acidic": false,
"tiles_animation": "weather_snowflake",
"weather_animation": { "factor": 0.01, "color": "c_white", "glyph": "." },
"sound_category": "flurries",
"sun_intensity": "light",
"requirements": { "temperature_max": 33, "required_weathers": [ "drizzle" ] }
},
{
"id": "snowing",
"type": "weather_type",
"name": "Snowing",
"color": "c_white",
"map_color": "c_dark_gray_cyan",
"glyph": "*",
"ranged_penalty": 4,
"sight_penalty": 1.3,
"light_modifier": -20,
"sound_attn": 4,
"dangerous": false,
"precip": "heavy",
"rains": false,
"acidic": false,
"effects": [ { "name": "wet", "intensity": 10 } ],
"tiles_animation": "weather_snowflake",
"weather_animation": { "factor": 0.02, "color": "c_white", "glyph": "," },
"sound_category": "snow",
"sun_intensity": "light",
"requirements": { "temperature_max": 33, "required_weathers": [ "rain", "thunder", "lightning" ] }
},
{
"id": "snowstorm",
"type": "weather_type",
"name": "Snowstorm",
"color": "c_white",
"map_color": "c_white_cyan",
"glyph": "%",
"ranged_penalty": 6,
"sight_penalty": 1.2,
"light_modifier": -30,
"sound_attn": 6,
"dangerous": false,
"precip": "heavy",
"rains": false,
"acidic": false,
"effects": [ { "name": "wet", "intensity": 40 } ],
"tiles_animation": "weather_snowflake",
"weather_animation": { "factor": 0.04, "color": "c_white", "glyph": "*" },
"sound_category": "snowstorm",
"sun_intensity": "none",
"requirements": { "temperature_max": 33, "windpower_min": 15, "required_weathers": [ "thunder", "lightning" ] }
}
]
17 changes: 16 additions & 1 deletion data/mods/desert_region/desert_regional_map_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,22 @@
"spring_humidity_manual_mod": 10,
"summer_humidity_manual_mod": 0,
"autumn_humidity_manual_mod": 10,
"winter_humidity_manual_mod": 15
"winter_humidity_manual_mod": 15,
"weather_types": [
"clear",
"sunny",
"cloudy",
"light_drizzle",
"drizzle",
"rain",
"thunder",
"lightning",
"acid_drizzle",
"acid_rain",
"flurries",
"snowing",
"snowstorm"
]
},
"overmap_feature_flag_settings": { "clear_blacklist": false, "blacklist": [ ], "clear_whitelist": false, "whitelist": [ ] }
}
Expand Down
17 changes: 16 additions & 1 deletion data/mods/rural_biome/rural_regional_map_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,22 @@
"base_acid": 0.0,
"base_wind": 3.4,
"base_wind_distrib_peaks": 80,
"base_wind_season_variation": 50
"base_wind_season_variation": 50,
"weather_types": [
"clear",
"sunny",
"cloudy",
"light_drizzle",
"drizzle",
"rain",
"thunder",
"lightning",
"acid_drizzle",
"acid_rain",
"flurries",
"snowing",
"snowstorm"
]
},
"overmap_feature_flag_settings": {
"clear_blacklist": false,
Expand Down
Loading

0 comments on commit 98edfcd

Please sign in to comment.