Skip to content

Commit

Permalink
Merge branch 'cataclysmbnteam:upload' into upload
Browse files Browse the repository at this point in the history
  • Loading branch information
hirohito1 authored Sep 17, 2023
2 parents 328ef0c + 41d6039 commit e508e37
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
17 changes: 10 additions & 7 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,11 @@ void dig_activity_actor::finish( player_activity &act, Character &who )
calendar::turn ) );
}

const int helpersize = character_funcs::get_crafting_helpers( who, 3 ).size();
who.mod_stored_nutr( 5 - helpersize );
who.mod_thirst( 5 - helpersize );
who.mod_fatigue( 10 - ( helpersize * 2 ) );
const int act_exertion = act.moves_total;

who.mod_stored_kcal( std::min( -1, -act_exertion / to_moves<int>( 80_seconds ) ) );
who.mod_thirst( std::max( 1, act_exertion / to_moves<int>( 12_minutes ) ) );
who.mod_fatigue( std::max( 1, act_exertion / to_moves<int>( 6_minutes ) ) );
if( grave ) {
who.add_msg_if_player( m_good, _( "You finish exhuming a grave." ) );
} else {
Expand Down Expand Up @@ -526,9 +527,11 @@ void dig_channel_activity_actor::finish( player_activity &act, Character &who )
calendar::turn ) );
}

who.mod_stored_kcal( -40 );
who.mod_thirst( 5 );
who.mod_fatigue( 10 );
const int act_exertion = act.moves_total;

who.mod_stored_kcal( std::min( -1, -act_exertion / to_moves<int>( 80_seconds ) ) );
who.mod_thirst( std::max( 1, act_exertion / to_moves<int>( 12_minutes ) ) );
who.mod_fatigue( std::max( 1, act_exertion / to_moves<int>( 6_minutes ) ) );
who.add_msg_if_player( m_good, _( "You finish digging up %s." ),
here.ter( location ).obj().name() );

Expand Down
14 changes: 10 additions & 4 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4421,12 +4421,18 @@ void activity_handlers::fill_pit_finish( player_activity *act, player *p )
} else {
here.ter_set( pos, t_dirt );
}
int act_exertion = to_moves<int>( time_duration::from_minutes( 15 ) );
if( old_ter == t_pit_shallow ) {
act_exertion = to_moves<int>( time_duration::from_minutes( 10 ) );
} else if( old_ter == t_dirtmound ) {
act_exertion = to_moves<int>( time_duration::from_minutes( 5 ) );
}
const int helpersize = character_funcs::get_crafting_helpers( *p, 3 ).size();
p->mod_stored_nutr( 5 - helpersize );
p->mod_thirst( 5 - helpersize );
p->mod_fatigue( 10 - ( helpersize * 2 ) );
act_exertion = act_exertion * ( 10 - helpersize ) / 10;
p->mod_stored_kcal( std::min( -1, -act_exertion / to_moves<int>( 20_seconds ) ) );
p->mod_thirst( std::max( 1, act_exertion / to_moves<int>( 3_minutes ) ) );
p->mod_fatigue( std::max( 1, act_exertion / to_moves<int>( 90_seconds ) ) );
p->add_msg_if_player( m_good, _( "You finish filling up %s." ), old_ter.obj().name() );

act->set_to_null();
}

Expand Down

0 comments on commit e508e37

Please sign in to comment.