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

clean up player::read_speed #31463

Merged
merged 1 commit into from
Jun 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2955,7 +2955,7 @@ int player::read_speed( bool return_stat_effect ) const
// Stat window shows stat effects on based on current stat
const int intel = get_int();
/** @EFFECT_INT increases reading speed */
int ret = 1000 - 50 * ( intel - 8 );
int ret = to_moves<int>( 1_minutes ) - to_moves<int>( 30_seconds ) * ( intel - 8 );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is wrong. There should be a factor of 20 difference between them like there was before, also, based on your change farther down, 100 is actually 1 second. I think that one is right (100 moves per turn, one turn per second), so the other two should be .5 seconds, and 10 seconds. Unless you meant to change them, but the PR description didn't imply you were.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did mean to change them. The numbers needed updating to account for the new turn times without the *6 constant further down. The only one wrong here is the 30_seconds which should be 3_seconds to preserve that factor of 20.


if( has_bionic( afs_bio_linguistic_coprocessor ) ) { // Aftershock
ret *= .85;
Expand All @@ -2973,11 +2973,11 @@ int player::read_speed( bool return_stat_effect ) const
ret *= 1.3;
}

if( ret < 100 ) {
ret = 100;
if( ret < to_moves<int>( 1_seconds ) ) {
ret = to_moves<int>( 1_seconds );
}
// return_stat_effect actually matters here
return 6 * ( return_stat_effect ? ret : ret / 10 );
return return_stat_effect ? ret : ret / 10;
}

int player::rust_rate( bool return_stat_effect ) const
Expand Down