Skip to content

Commit

Permalink
Scale skill train() and _exercise values by 100x
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade committed Jan 15, 2021
1 parent d04aa16 commit 126fc30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2336,7 +2336,7 @@ void Character::practice( const skill_id &id, int amount, int cap, bool suppress
}
if( amount > 0 && level.isTraining() ) {
int oldLevel = get_skill_level( id );
get_skill_level_object( id ).train( amount );
get_skill_level_object( id ).train( amount * 100 );
int newLevel = get_skill_level( id );
std::string skill_name = skill.name();
if( newLevel > oldLevel ) {
Expand Down
6 changes: 3 additions & 3 deletions src/skill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void SkillLevel::train( int amount, bool skip_scaling )
}
}

if( _exercise >= 100 * ( _level + 1 ) * ( _level + 1 ) ) {
if( _exercise >= 100 * 100 * ( _level + 1 ) * ( _level + 1 ) ) {
_exercise = 0;
++_level;
if( _level > _highestLevel ) {
Expand Down Expand Up @@ -265,11 +265,11 @@ bool SkillLevel::rust( bool charged_bio_mem, int character_rate )
return one_in( 5 );
}

_exercise -= _level;
_exercise -= _level * 100;
const std::string &rust_type = get_option<std::string>( "SKILL_RUST" );
if( _exercise < 0 ) {
if( rust_type == "vanilla" || rust_type == "int" ) {
_exercise = ( 100 * _level * _level ) - 1;
_exercise = ( 100 * 100 * _level * _level ) - 1;
--_level;
} else {
_exercise = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/skill.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class SkillLevel
}

int exercise( bool raw = false ) const {
return raw ? _exercise : _exercise / ( ( _level + 1 ) * ( _level + 1 ) );
return raw ? _exercise / 100 :
_exercise / ( 100 * ( _level + 1 ) * ( _level + 1 ) );
}

int exercised_level() const {
Expand Down
2 changes: 1 addition & 1 deletion src/talker_npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ std::string talker_npc::skill_training_text( const talker &student,
SkillLevel skill_level_obj = pupil->get_skill_level_object( skill );
const int cur_level = skill_level_obj.level();
const int cur_level_exercise = skill_level_obj.exercise();
skill_level_obj.train( 100 );
skill_level_obj.train( 10000 );
const int next_level = skill_level_obj.level();
const int next_level_exercise = skill_level_obj.exercise();

Expand Down

0 comments on commit 126fc30

Please sign in to comment.