diff --git a/src/character.cpp b/src/character.cpp index 0d3a360342c25..99aac8aa1329f 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -2470,6 +2470,26 @@ int Character::rust_rate( bool return_stat_effect ) const return ( return_stat_effect ? ret : ret / 10 ); } +int Character::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 by 3s per level above 8*/ + int ret = to_moves( 1_minutes ) - to_moves( 3_seconds ) * ( intel - 8 ); + + if( has_bionic( afs_bio_linguistic_coprocessor ) ) { // Aftershock + ret *= .85; + } + + ret *= mutation_value( "reading_speed_multiplier" ); + + if( ret < to_moves( 1_seconds ) ) { + ret = to_moves( 1_seconds ); + } + // return_stat_effect actually matters here + return return_stat_effect ? ret : ret * 100 / to_moves( 1_minutes ); +} + bool Character::meets_skill_requirements( const std::map &req, const item &context ) const { diff --git a/src/character.h b/src/character.h index 7a5d3953ff265..c0ef21257dfef 100644 --- a/src/character.h +++ b/src/character.h @@ -1298,6 +1298,10 @@ class Character : public Creature, public visitable /** Returns the player's skill rust rate */ int rust_rate( bool return_stat_effect = true ) const; + // Mental skills and stats + /** Returns the player's reading speed */ + int read_speed( bool return_stat_effect = true ) const; + // --------------- Other Stuff --------------- /** return the calendar::turn the character expired */ diff --git a/src/player.cpp b/src/player.cpp index b70dd6907b0b6..c68b4c4100195 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -1178,26 +1178,6 @@ void player::search_surroundings() } } -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 = to_moves( 1_minutes ) - to_moves( 3_seconds ) * ( intel - 8 ); - - if( has_bionic( afs_bio_linguistic_coprocessor ) ) { // Aftershock - ret *= .85; - } - - ret *= mutation_value( "reading_speed_multiplier" ); - - if( ret < to_moves( 1_seconds ) ) { - ret = to_moves( 1_seconds ); - } - // return_stat_effect actually matters here - return return_stat_effect ? ret : ret / 10; -} - int player::talk_skill() const { /** @EFFECT_INT slightly increases talking skill */ diff --git a/src/player.h b/src/player.h index 6e0869214b666..d3c2e13f3b96f 100644 --- a/src/player.h +++ b/src/player.h @@ -442,8 +442,6 @@ class player : public Character const cata::optional &blind_throw_from_pos = cata::nullopt ); // Mental skills and stats - /** Returns the player's reading speed */ - int read_speed( bool return_stat_effect = true ) const; /** Returns a value used when attempting to convince NPC's of something */ int talk_skill() const; /** Returns a value used when attempting to intimidate NPC's */