Skip to content

Commit

Permalink
change speeds, influence and training as it was discussed
Browse files Browse the repository at this point in the history
  • Loading branch information
GuardianDll committed Sep 4, 2024
1 parent 0aa4abd commit a9143ea
Showing 1 changed file with 89 additions and 22 deletions.
111 changes: 89 additions & 22 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,18 +816,33 @@ int butcher_time_to_cut( Character &you, const item &corpse_item, const butcher_
time_to_cut /= 4;
}

if( ( corpse.harvest->has_entry_type( harvest_drop_flesh ) ||
corpse.harvest->has_entry_type( harvest_drop_offal ) ) && ( action == butcher_type::FULL ||
action == butcher_type::QUICK || action == butcher_type::FIELD_DRESS ) ) {
time_to_cut *= 1.25 - ( 0.25 * you.get_proficiency_practice( proficiency_prof_butchering_adv ) );
time_to_cut *= 1.75 - ( 0.75 * you.get_proficiency_practice( proficiency_prof_butchering_basic ) );
double butch_basic = you.get_proficiency_practice( proficiency_prof_butchering_basic );
double butch_adv = you.get_proficiency_practice( proficiency_prof_butchering_adv );
double skin_basic = you.get_proficiency_practice( proficiency_prof_skinning_basic );
double penalty_small = 0.25;
double penalty_big = 0.75;

if( action == butcher_type::FULL ) {
// 40% of butchering and gutting, 40% of skinning, 20% another activities
time_to_cut *= 1 + ( penalty_small * ( 1 - butch_adv ) * 0.4 );
time_to_cut *= 1 + ( penalty_big * ( 1 - butch_basic ) * 0.4 );
time_to_cut *= 1 + ( penalty_small * ( 1 - skin_basic ) * 0.4 );
}

// Skinning decrease the cutting speed only a little, and decreases the output mostly
if( corpse.harvest->has_entry_type( harvest_drop_skin ) && ( action == butcher_type::FULL ||
action == butcher_type::QUICK || action == butcher_type::SKIN ) ) {
time_to_cut *= 1.25 - ( 0.25 * you.get_proficiency_practice( proficiency_prof_skinning_basic ) );
if( action == butcher_type::QUICK ) {
// 70% of butchery, 15% skinning, 15% another activities
time_to_cut *= 1 + ( penalty_small * ( 1 - butch_adv ) * 0.7 );
time_to_cut *= 1 + ( penalty_big * ( 1 - butch_basic ) * 0.7 );
time_to_cut *= 1 + ( penalty_small * ( 1 - skin_basic ) * 0.15 );
}

if( action == butcher_type::FIELD_DRESS ) {
time_to_cut *= 1 + ( penalty_small * ( 1 - butch_adv ) );
time_to_cut *= 1 + ( penalty_big * ( 1 - butch_basic ) );
}

if( action == butcher_type::SKIN ) {
time_to_cut *= 1 + ( penalty_small * ( 1 - skin_basic ) );
}

time_to_cut *= ( 1.0f - ( get_player_character().get_num_crafting_helpers( 3 ) / 10.0f ) );
Expand Down Expand Up @@ -1036,6 +1051,7 @@ static bool butchery_drops_harvest( item *corpse_item, const mtype &mt, Characte
}

map &here = get_map();

for( const harvest_entry &entry : ( action == butcher_type::DISSECT &&
!mt.dissect.is_empty() ) ? *mt.dissect : *mt.harvest ) {
const int skill_level = butchery_dissect_skill_level( you, tool_quality, entry.type );
Expand Down Expand Up @@ -1076,14 +1092,20 @@ static bool butchery_drops_harvest( item *corpse_item, const mtype &mt, Characte
roll = 0;
}

if( entry.type == harvest_drop_flesh ) {
roll /= 1.13 - ( 0.13 * you.get_proficiency_practice( proficiency_prof_butchering_adv ) );
roll /= 1.6 - ( 0.6 * you.get_proficiency_practice( proficiency_prof_butchering_basic ) );
const double butch_basic = you.get_proficiency_practice( proficiency_prof_butchering_basic );
const double butch_adv = you.get_proficiency_practice( proficiency_prof_butchering_basic );

Check failure on line 1096 in src/activity_handlers.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Value stored to 'butch_adv' during its initialization is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]

Check failure on line 1096 in src/activity_handlers.cpp

View workflow job for this annotation

GitHub Actions / build (src)

unused variable 'butch_adv' [clang-diagnostic-unused-variable,-warnings-as-errors]

Check failure on line 1096 in src/activity_handlers.cpp

View workflow job for this annotation

GitHub Actions / Basic Build and Test (Clang 10, Ubuntu, Curses)

unused variable 'butch_adv' [-Werror,-Wunused-variable]
const double skin_basic = you.get_proficiency_practice( proficiency_prof_skinning_basic );
const double skin_adv = you.get_proficiency_practice( proficiency_prof_skinning_adv );
const double penalty_small = 0.15;
const double penalty_big = 2;

if( entry.type == harvest_drop_flesh || entry.type == harvest_drop_offal ) {
roll /= 1 + ( penalty_small * ( 1 - butch_basic ) );
}

if( entry.type == harvest_drop_skin ) {
roll /= 1.13 - ( 0.13 * you.get_proficiency_practice( proficiency_prof_skinning_adv ) );
roll /= 1.6 - ( 0.6 * you.get_proficiency_practice( proficiency_prof_skinning_basic ) );
roll /= 1 + ( penalty_big * ( 1 - skin_basic ) );
roll /= 1 + ( penalty_small * ( 1 - skin_adv ) );
}

// QUICK BUTCHERY
Expand Down Expand Up @@ -1297,26 +1319,71 @@ static bool butchery_drops_harvest( item *corpse_item, const mtype &mt, Characte
}

// handle our prof training
// 40% time to skin the animal, 40% to actually butcher it, 20 for mics activities
if( action == butcher_type::FULL && ( mt.harvest->has_entry_type( harvest_drop_flesh ) ||
mt.harvest->has_entry_type( harvest_drop_offal ) ) ) {
// 40% of butchering and gutting, 40% of skinning, 20% another activities
if( you.has_proficiency( proficiency_prof_butchering_basic ) ) {
you.practice_proficiency( proficiency_prof_butchering_adv,
time_duration::from_moves<int>( moves_total * 0.4 ) );
} else {
you.practice_proficiency( proficiency_prof_butchering_basic,
time_duration::from_moves<int>( moves_total * 0.4 ) );
}
}

if( action == butcher_type::FULL && mt.harvest->has_entry_type( harvest_drop_skin ) ) {
// 40% of butchering and gutting, 40% of skinning, 20% another activities
if( you.has_proficiency( proficiency_prof_skinning_basic ) ) {
you.practice_proficiency( proficiency_prof_skinning_adv,
time_duration::from_moves<int>( moves_total * 0.4 ) );
} else {
you.practice_proficiency( proficiency_prof_skinning_basic,
time_duration::from_moves<int>( moves_total * 0.4 ) );
}
}

if( action == butcher_type::QUICK && ( mt.harvest->has_entry_type( harvest_drop_flesh ) ||
mt.harvest->has_entry_type( harvest_drop_offal ) ) ) {
// 70% of butchery, 15% skinning, 15% another activities
if( you.has_proficiency( proficiency_prof_butchering_basic ) ) {
you.practice_proficiency( proficiency_prof_butchering_adv,
time_duration::from_moves<int>( moves_total * 0.7 ) );
} else {
you.practice_proficiency( proficiency_prof_butchering_basic,
time_duration::from_moves<int>( moves_total * 0.7 ) );
}
}

if( action == butcher_type::QUICK && mt.harvest->has_entry_type( harvest_drop_skin ) ) {
// 70% of butchery, 15% skinning, 15% another activities
if( you.has_proficiency( proficiency_prof_skinning_basic ) ) {
you.practice_proficiency( proficiency_prof_skinning_adv,
time_duration::from_moves<int>( moves_total * 0.15 ) );
} else {
you.practice_proficiency( proficiency_prof_skinning_basic,
time_duration::from_moves<int>( moves_total * 0.15 ) );
}
}

if( mt.harvest->has_entry_type( harvest_drop_flesh ) ||
mt.harvest->has_entry_type( harvest_drop_offal ) ) {
if( action == butcher_type::FIELD_DRESS && ( mt.harvest->has_entry_type( harvest_drop_flesh ) ||
mt.harvest->has_entry_type( harvest_drop_offal ) ) ) {
if( you.has_proficiency( proficiency_prof_butchering_basic ) ) {
you.practice_proficiency( proficiency_prof_butchering_adv,
time_duration::from_moves<int>( moves_total / 2.5 ) );
time_duration::from_moves<int>( moves_total ) );
} else {
you.practice_proficiency( proficiency_prof_butchering_basic,
time_duration::from_moves<int>( moves_total / 2.5 ) );
time_duration::from_moves<int>( moves_total ) );
}
}

if( mt.harvest->has_entry_type( harvest_drop_skin ) ) {
if( action == butcher_type::SKIN && mt.harvest->has_entry_type( harvest_drop_skin ) ) {
// 70% of butchery, 15% skinning, 15% another activities
if( you.has_proficiency( proficiency_prof_skinning_basic ) ) {
you.practice_proficiency( proficiency_prof_skinning_adv,
time_duration::from_moves<int>( moves_total / 2.5 ) );
time_duration::from_moves<int>( moves_total ) );
} else {
you.practice_proficiency( proficiency_prof_skinning_basic,
time_duration::from_moves<int>( moves_total / 2.5 ) );
time_duration::from_moves<int>( moves_total ) );
}
}

Expand Down

0 comments on commit a9143ea

Please sign in to comment.