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

Added option to randomize INITIAL_DAY #38110

Merged
merged 12 commits into from
Apr 2, 2020
6 changes: 5 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11456,7 +11456,11 @@ void game::start_calendar()
}
} else {
// No scenario, so use the starting date+time configured in world options
const int initial_days = get_option<int>( "INITIAL_DAY" );
int initial_days = get_option<int>( "INITIAL_DAY" );
if( initial_days == -1 ) {
// 0 - 363 for a 91 day season
initial_days = rng( 0, ( get_option<int>( "SEASON_LENGTH" ) * 4 ) - 1 );
ashGlaw marked this conversation as resolved.
Show resolved Hide resolved
}
calendar::start_of_cataclysm = calendar::turn_zero + 1_days * initial_days;

// Determine the season based off how long the seasons are set to be
Expand Down
4 changes: 2 additions & 2 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2057,8 +2057,8 @@ void options_manager::add_options_world_default()
);

add( "INITIAL_DAY", "world_default", translate_marker( "Initial day" ),
translate_marker( "How many days into the year the cataclysm occurred. Day 0 is Spring 1. Can be overridden by scenarios. This does not advance food rot or monster evolution." ),
0, 999, 60
translate_marker( "How many days into the year the cataclysm occurred. Day 0 is Spring 1. Day -1 randomizes the start date. Can be overridden by scenarios. This does not advance food rot or monster evolution." ),
ashGlaw marked this conversation as resolved.
Show resolved Hide resolved
-1, 999, 60
);

add( "SPAWN_DELAY", "world_default", translate_marker( "Spawn delay" ),
Expand Down