From bbe8e993900dcced0458112e99e86e1c75a6aca7 Mon Sep 17 00:00:00 2001 From: s7eamy Date: Sun, 14 Feb 2021 22:38:07 +0200 Subject: [PATCH 1/4] remove mod_fatigue() calls from activities removed mod_fatigue(), mod_stored_nutr(), mod_thirst() calls from various activities --- src/activity_handlers.cpp | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 92f4a5c89fc48..c380d04a05192 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -1821,23 +1821,11 @@ void activity_handlers::pickaxe_finish( player_activity *act, player *p ) const int helpersize = get_player_character().get_num_crafting_helpers( 3 ); if( here.is_bashable( pos ) && here.has_flag( flag_SUPPORTS_ROOF, pos ) && here.ter( pos ) != t_tree ) { - // Tunneling through solid rock is hungry, sweaty, tiring, backbreaking work - // Betcha wish you'd opted for the J-Hammer ;P - p->mod_stored_nutr( 15 - ( helpersize * 3 ) ); - p->mod_thirst( 15 - ( helpersize * 3 ) ); - if( p->has_trait( trait_STOCKY_TROGLO ) ) { - // Yep, dwarves can dig longer before tiring - p->mod_fatigue( 20 - ( helpersize * 3 ) ); - } else { - p->mod_fatigue( 30 - ( helpersize * 3 ) ); - } + // Tunneling through solid rock is sweaty, backbreaking work + // Betcha wish you'd opted for the J-Hammer p->mod_pain( std::max( 0, ( 2 * static_cast( rng( 1, 3 ) ) ) - helpersize ) ); } else if( here.move_cost( pos ) == 2 && here.get_abs_sub().z == 0 && here.ter( pos ) != t_dirt && here.ter( pos ) != t_grass ) { - //Breaking up concrete on the surface? not nearly as bad - p->mod_stored_nutr( 5 - ( helpersize ) ); - p->mod_thirst( 5 - ( helpersize ) ); - p->mod_fatigue( 10 - ( helpersize * 2 ) ); } } p->add_msg_player_or_npc( m_good, @@ -2145,7 +2133,6 @@ void activity_handlers::hand_crank_do_turn( player_activity *act, player *p ) // Modify for weariness time_to_crank /= p->exertion_adjusted_move_multiplier( act->exertion_level() ); if( calendar::once_every( time_duration::from_seconds( time_to_crank ) ) ) { - p->mod_fatigue( 1 ); if( hand_crank_item.ammo_capacity( ammotype( "battery" ) ) > hand_crank_item.ammo_remaining() ) { hand_crank_item.ammo_set( itype_id( "battery" ), hand_crank_item.ammo_remaining() + 1 ); } else { @@ -2173,7 +2160,6 @@ void activity_handlers::vibe_do_turn( player_activity *act, player *p ) } if( calendar::once_every( 1_minutes ) ) { - p->mod_fatigue( 1 ); if( vibrator_item.ammo_remaining() > 0 ) { vibrator_item.ammo_consume( 1, p->pos() ); p->add_morale( MORALE_FEELING_GOOD, 3, 40 ); @@ -3605,9 +3591,6 @@ void activity_handlers::hacksaw_finish( player_activity *act, player *p ) here.spawn_item( p->pos(), itype_pipe, 12 ); } - p->mod_stored_nutr( 5 ); - p->mod_thirst( 5 ); - p->mod_fatigue( 10 ); p->add_msg_if_player( m_good, _( "You finish cutting the metal." ) ); act->set_to_null(); @@ -3723,9 +3706,6 @@ void activity_handlers::chop_tree_finish( player_activity *act, player *p ) here.ter_set( pos, t_stump ); const int helpersize = p->get_num_crafting_helpers( 3 ); - p->mod_stored_nutr( 5 - helpersize ); - p->mod_thirst( 5 - helpersize ); - p->mod_fatigue( 10 - ( helpersize * 2 ) ); p->add_msg_if_player( m_good, _( "You finish chopping down a tree." ) ); // sound of falling tree sfx::play_variant_sound( "misc", "timber", @@ -3772,9 +3752,6 @@ void activity_handlers::chop_logs_finish( player_activity *act, player *p ) } here.ter_set( pos, t_dirt ); const int helpersize = p->get_num_crafting_helpers( 3 ); - p->mod_stored_nutr( 5 - helpersize ); - p->mod_thirst( 5 - helpersize ); - p->mod_fatigue( 10 - ( helpersize * 2 ) ); p->add_msg_if_player( m_good, _( "You finish chopping wood." ) ); act->set_to_null(); @@ -3825,12 +3802,6 @@ void activity_handlers::jackhammer_finish( player_activity *act, player *p ) here.destroy( pos, true ); - if( p->is_avatar() ) { - const int helpersize = get_player_character().get_num_crafting_helpers( 3 ); - p->mod_stored_nutr( 5 - helpersize ); - p->mod_thirst( 5 - helpersize ); - p->mod_fatigue( 10 - ( helpersize * 2 ) ); - } p->add_msg_player_or_npc( m_good, _( "You finish drilling." ), _( " finishes drilling." ) ); @@ -3871,9 +3842,6 @@ void activity_handlers::fill_pit_finish( player_activity *act, player *p ) here.ter_set( pos, t_dirt ); } const int helpersize = get_player_character().get_num_crafting_helpers( 3 ); - p->mod_stored_nutr( 5 - helpersize ); - p->mod_thirst( 5 - helpersize ); - p->mod_fatigue( 10 - ( helpersize * 2 ) ); p->add_msg_if_player( m_good, _( "You finish filling up %s." ), old_ter.obj().name() ); act->set_to_null(); From f1b64430ebdd39f7821b1b2a6f2fecba98d2c5da Mon Sep 17 00:00:00 2001 From: s7eamy Date: Sun, 14 Feb 2021 22:57:26 +0200 Subject: [PATCH 2/4] Update activity_handlers.cpp --- src/activity_handlers.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index c380d04a05192..48b3cfabbd220 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -3705,7 +3705,6 @@ void activity_handlers::chop_tree_finish( player_activity *act, player *p ) } here.ter_set( pos, t_stump ); - const int helpersize = p->get_num_crafting_helpers( 3 ); p->add_msg_if_player( m_good, _( "You finish chopping down a tree." ) ); // sound of falling tree sfx::play_variant_sound( "misc", "timber", @@ -3751,7 +3750,6 @@ void activity_handlers::chop_logs_finish( player_activity *act, player *p ) here.add_item_or_charges( pos, obj ); } here.ter_set( pos, t_dirt ); - const int helpersize = p->get_num_crafting_helpers( 3 ); p->add_msg_if_player( m_good, _( "You finish chopping wood." ) ); act->set_to_null(); @@ -3841,7 +3839,6 @@ void activity_handlers::fill_pit_finish( player_activity *act, player *p ) } else { here.ter_set( pos, t_dirt ); } - const int helpersize = get_player_character().get_num_crafting_helpers( 3 ); p->add_msg_if_player( m_good, _( "You finish filling up %s." ), old_ter.obj().name() ); act->set_to_null(); From a2c4225ffeb5b7b96fecd0b229b96d66c2426598 Mon Sep 17 00:00:00 2001 From: s7eampunk <52354209+s7eamy@users.noreply.github.com> Date: Mon, 15 Feb 2021 10:56:04 +0200 Subject: [PATCH 3/4] Update src/activity_handlers.cpp Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com> --- src/activity_handlers.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 48b3cfabbd220..b28c53521ee9a 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -1824,8 +1824,6 @@ void activity_handlers::pickaxe_finish( player_activity *act, player *p ) // Tunneling through solid rock is sweaty, backbreaking work // Betcha wish you'd opted for the J-Hammer p->mod_pain( std::max( 0, ( 2 * static_cast( rng( 1, 3 ) ) ) - helpersize ) ); - } else if( here.move_cost( pos ) == 2 && here.get_abs_sub().z == 0 && - here.ter( pos ) != t_dirt && here.ter( pos ) != t_grass ) { } } p->add_msg_player_or_npc( m_good, From d0f490e0968d28432f745c28616bdfe1c520d12d Mon Sep 17 00:00:00 2001 From: s7eampunk <52354209+s7eamy@users.noreply.github.com> Date: Wed, 17 Feb 2021 22:30:42 +0200 Subject: [PATCH 4/4] troglobite buff decreases the pain a troglobite takes when mining with a pickaxe Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com> --- src/activity_handlers.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index b28c53521ee9a..90e41203304bf 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -1823,7 +1823,11 @@ void activity_handlers::pickaxe_finish( player_activity *act, player *p ) here.ter( pos ) != t_tree ) { // Tunneling through solid rock is sweaty, backbreaking work // Betcha wish you'd opted for the J-Hammer - p->mod_pain( std::max( 0, ( 2 * static_cast( rng( 1, 3 ) ) ) - helpersize ) ); + if( p->has_trait( trait_STOCKY_TROGLO ) ) { + p->mod_pain( std::max( 0, ( 1 * static_cast( rng( 0, 3 ) ) ) - helpersize ) ); + } else { + p->mod_pain( std::max( 0, ( 2 * static_cast( rng( 1, 3 ) ) ) - helpersize ) ); + } } } p->add_msg_player_or_npc( m_good,