diff --git a/src/construction.cpp b/src/construction.cpp index 84f211643b29..acfc92aba31d 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -1109,7 +1109,7 @@ void complete_construction( Character &ch ) const auto award_xp = [&]( player & c ) { for( const auto &pr : built.required_skills ) { const float built_time = to_moves( built.time ); - const float built_base = to_moves( 30_minutes ); + const float built_base = to_moves( 10_minutes ); c.practice( pr.first, static_cast( ( 10 + 15 * pr.second ) * ( 1.0f + built_time / built_base ) ), static_cast( pr.second * 1.25 ) ); @@ -1415,6 +1415,9 @@ void construct::done_deconstruct( const tripoint &p ) add_msg( m_info, _( "That %s can not be disassembled!" ), f.name() ); return; } + if( f.active ) { + g->u.practice( skill_electronics, 20, 4 ); + } if( f.deconstruct.furn_set.str().empty() ) { here.furn_set( p, f_null ); } else { @@ -1444,16 +1447,6 @@ void construct::done_deconstruct( const tripoint &p ) } done_deconstruct( top ); } - if( t.id == ter_str_id( "t_console_broken" ) ) { - if( g->u.get_skill_level( skill_electronics ) >= 1 ) { - g->u.practice( skill_electronics, 20, 4 ); - } - } - if( t.id == ter_str_id( "t_console" ) ) { - if( g->u.get_skill_level( skill_electronics ) >= 1 ) { - g->u.practice( skill_electronics, 40, 8 ); - } - } here.ter_set( p, t.deconstruct.ter_set ); add_msg( _( "The %s is disassembled." ), t.name() ); std::vector> items_list = item_group::items_from( t.deconstruct.drop_group, diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 3471ea34c23e..1af5b15dcf67 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -6417,8 +6417,7 @@ void iexamine::practice_survival_while_foraging( player *p ) { ///\EFFECT_INT Intelligence caps survival skill gains from foraging const int max_forage_skill = p->int_cur / 2 + 1; - ///\EFFECT_SURVIVAL decreases survival skill gain from foraging (NEGATIVE) - const int max_exp = 2 * ( max_forage_skill - p->get_skill_level( skill_survival ) ); + const int max_exp = 2 * max_forage_skill; // Award experience for foraging attempt regardless of success p->practice( skill_survival, rng( 1, max_exp ), max_forage_skill ); } diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index a68e58e67261..3cebfd5cd9d2 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -3440,7 +3440,7 @@ repair_item_actor::attempt_hint repair_item_actor::repair( player &pl, item &too const int current_skill_level = pl.get_skill_level( used_skill ); const auto action = default_action( fix, current_skill_level ); const auto chance = repair_chance( pl, fix, action ); - int practice_amount = repair_recipe_difficulty( pl, fix, true ) / 2 + 1; + int practice_amount = std::max( repair_recipe_difficulty( pl, fix, true ), 1 ); float roll_value = rng_float( 0.0, 1.0 ); enum roll_result { SUCCESS, @@ -3834,7 +3834,7 @@ int heal_actor::finish_using( player &healer, player &patient, item &it, e.set_duration( e.get_int_dur_factor() * bandages_intensity ); patient.get_part( healed ).set_damage_bandaged( patient.get_part_hp_max( bp ) - patient.get_part_hp_cur( bp ) ); - practice_amount += 2 * bandages_intensity; + practice_amount += 3 * bandages_intensity; } if( disinfectant_power > 0 ) { int disinfectant_intensity = get_disinfected_level( healer ); @@ -3843,7 +3843,7 @@ int heal_actor::finish_using( player &healer, player &patient, item &it, e.set_duration( e.get_int_dur_factor() * disinfectant_intensity ); patient.get_part( healed ).set_damage_disinfected( patient.get_part_hp_max( bp ) - patient.get_part_hp_cur( bp ) ); - practice_amount += 2 * disinfectant_intensity; + practice_amount += 3 * disinfectant_intensity; } practice_amount = std::max( 9.0f, practice_amount ); diff --git a/src/veh_utils.cpp b/src/veh_utils.cpp index cae9cf843827..473815b3ba54 100644 --- a/src/veh_utils.cpp +++ b/src/veh_utils.cpp @@ -41,17 +41,13 @@ int calc_xp_gain( const vpart_info &vp, const skill_id &sk, const Character &who // how many levels are we above the requirement? const int lvl = std::max( who.get_skill_level( sk ) - iter->second, 1 ); + // also track the objective difficulty of requirement + const int diff = std::max( iter->second, 1 ); - // scale xp gain per hour according to relative level - // 0-1: 60 xp /h - // 2: 15 xp /h - // 3: 6 xp /h - // 4: 4 xp /h - // 5: 3 xp /h - // 6: 2 xp /h - // 7+: 1 xp /h + // xp gain per hour starts at 60 times difficulty of installation + // as your level exceeds this, divide exp gain by the level difference squared return std::ceil( static_cast( vp.install_moves ) / - to_moves( 1_minutes * std::pow( lvl, 2 ) ) ); + to_moves( 1_minutes * std::pow( lvl, 2 ) ) * diff ); } vehicle_part &most_repairable_part( vehicle &veh, Character &who, bool only_repairable )