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

Eternal weather #59707

Merged
merged 13 commits into from
Nov 24, 2022
7 changes: 7 additions & 0 deletions data/core/game_balance.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,5 +334,12 @@
"info": "Determines frequency (in minutes) of displaying music description in sidebar when listening to MP3-players and the like.",
"stype": "int",
"value": 5
},
{
"type": "EXTERNAL_OPTION",
"name": "ETERNAL_WEATHER",
"info": "Sets eternal weather. Possible values are 'normal', 'clear', 'cloudy', 'light_drizzle', 'drizzle', 'rain', 'rainstorm', 'thunder', 'lightning', 'flurries', 'snowing', 'snowstorm', 'early_portal_storm', 'portal_storm'. 'normal' clears all eternal weather overrides and sets normal weather pattern. Requires restart of the game after changing value to take effect.",
"stype": "string_input",
"value": "normal"
}
]
11 changes: 10 additions & 1 deletion src/do_turn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ bool do_turn()
return turn_handler::cleanup_at_end();
}
// Actual stuff
if( g-> new_game ) {
if( g->new_game ) {
g->new_game = false;
} else {
g->gamemode->per_turn();
Expand All @@ -604,6 +604,15 @@ bool do_turn()
play_music( music::get_music_id_string() );

weather_manager &weather = get_weather();
if( get_option<std::string>( "ETERNAL_WEATHER" ) != "normal" ) {
weather.weather_override = static_cast<weather_type_id>
( get_option<std::string>( "ETERNAL_WEATHER" ) );
weather.set_nextweather( calendar::turn );
} else {
weather.weather_override = WEATHER_NULL;
weather.set_nextweather( calendar::turn );
}

// starting a new turn, clear out temperature cache
weather.temperature_cache.clear();

Expand Down
7 changes: 7 additions & 0 deletions src/main_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,13 @@ bool main_menu::opening_screen()
}
if( start && !load_game && get_scenario() ) {
add_msg( get_scenario()->description( player_character.male ) );

if( get_option<std::string>( "ETERNAL_WEATHER" ) != "normal" ) {
if( player_character.posz() >= 0 ) {
add_msg( _( "You feel as if this %1$s will last forever…" ),
get_options().get_option( "ETERNAL_WEATHER" ).getValueName() );
}
}
}
return true;
}
Expand Down