diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 5257860..3e16cde 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -58,7 +58,8 @@ const std::map< activity_id, std::function > { activity_id( "ACT_ATM" ), atm_do_turn }, { activity_id( "ACT_CRACKING" ), cracking_do_turn }, { activity_id( "ACT_REPAIR_ITEM" ), repair_item_do_turn }, - { activity_id( "ACT_BUTCHER" ), butcher_do_turn } + { activity_id( "ACT_BUTCHER" ), butcher_do_turn }, + { activity_id( "ACT_CLEAR_RUBBLE" ), clear_rubble_do_turn } }; const std::map< activity_id, std::function > activity_handlers::finish_functions = @@ -1750,10 +1751,6 @@ void activity_handlers::clear_rubble_finish( player_activity *act, player *p ) } g->m.furn_set( target, f_null ); - const int bonus = act->index * act->index; - p->mod_hunger ( 10 / bonus ); - p->mod_thirst ( 10 / bonus ); - act->set_to_null(); } @@ -1832,6 +1829,11 @@ void activity_handlers::butcher_do_turn( player_activity *, player *p ) p->mod_stat( "stamina", -20.0f * p->stamina / p->get_stamina_max() ); } +void activity_handlers::clear_rubble_do_turn( player_activity *, player *p ) +{ + p->mod_stat( "stamina", -25.0f * p->stamina / p->get_stamina_max() ); +} + void activity_handlers::read_finish( player_activity *act, player *p ) { p->do_read( act->targets[0].get_item() ); diff --git a/src/activity_handlers.h b/src/activity_handlers.h index 3dd5f7c..9f0e8cf 100644 --- a/src/activity_handlers.h +++ b/src/activity_handlers.h @@ -40,6 +40,7 @@ void atm_do_turn( player_activity *act, player *p ); void cracking_do_turn( player_activity *act, player *p ); void repair_item_do_turn( player_activity *act, player *p ); void butcher_do_turn( player_activity *act, player *p ); +void clear_rubble_do_turn( player_activity *act, player *p ); // defined in activity_handlers.cpp extern const std::map< activity_id, std::function > diff --git a/src/iuse.cpp b/src/iuse.cpp index ac4c255..5cec081 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -2903,7 +2903,6 @@ int iuse::makemound(player *p, item *it, bool, const tripoint& ) * Explanation of ACT_CLEAR_RUBBLE activity values: * * coords[0]: Where the rubble is. - * index: The bonus, for calculating hunger and thirst penalties. */ int iuse::dig(player *p, item *it, bool, const tripoint &pos ) @@ -2911,13 +2910,13 @@ int iuse::dig(player *p, item *it, bool, const tripoint &pos ) for( const tripoint &pt : closest_tripoints_first( 1, pos ) ) { if( g->m.furn( pt ).obj().examine == iexamine::rubble ) { // costs per tile: - // DIG 2 = 300 seconds, 10 hunger and thirst - // DIG 3 = 75 seconds, 2 hunger and thirst - // DIG 4 = 33 seconds, 1 hunger and thirst - // DIG 5 = 18 seconds, 0 hunger and thirst + // DIG 2 = 300 seconds + // DIG 3 = 75 seconds + // DIG 4 = 33 seconds + // DIG 5 = 18 seconds int bonus = std::max( it->get_quality( quality_id( "DIG" ) ) - 1, 1 ); bonus *= bonus; - player_activity act( activity_id( "ACT_CLEAR_RUBBLE" ), 5000 / ( bonus * bonus ), bonus ); + player_activity act( activity_id( "ACT_CLEAR_RUBBLE" ), 5000 / ( bonus * bonus ) ); act.coords.push_back( pt ); p->assign_activity( act );