Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boats' "engines" will start at first attempt #31305

Merged
merged 1 commit into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2050,6 +2050,7 @@ void activity_handlers::start_engines_finish( player_activity *act, player *p )
int non_muscle_attempted = 0;
int started = 0;
int non_muscle_started = 0;
int non_combustion_started = 0;
const bool take_control = act->values[0];

for( size_t e = 0; e < veh->engines.size(); ++e ) {
Expand All @@ -2062,6 +2063,8 @@ void activity_handlers::start_engines_finish( player_activity *act, player *p )
started++;
if( !veh->is_engine_type( e, "muscle" ) && !veh->is_engine_type( e, "animal" ) ) {
non_muscle_started++;
} else {
non_combustion_started++;
}
}
}
Expand All @@ -2084,6 +2087,9 @@ void activity_handlers::start_engines_finish( player_activity *act, player *p )
//Only some of the non-muscle engines started
add_msg( ngettext( "One of the %s's engines start up.",
"Some of the %s's engines start up.", non_muscle_started ), veh->name );
} else if( non_combustion_started > 0 ) {
//Non-combustions "engines" started
add_msg( "The %s is ready for movement.", veh->name );
} else {
//All of the non-muscle engines failed
add_msg( m_bad, ngettext( "The %s's engine fails to start.",
Expand Down
6 changes: 3 additions & 3 deletions src/vehicle_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,17 +823,17 @@ bool vehicle::start_engine( const int e )
if( einfo.has_flag( "MUSCLE_ARMS" ) && ( g->u.hp_cur[hp_arm_l] == 0 ||
g->u.hp_cur[hp_arm_r] == 0 ) ) {
add_msg( _( "You cannot use %s with a broken arm." ), eng.name() );
return false;
} else if( einfo.has_flag( "MUSCLE_LEGS" ) && ( g->u.hp_cur[hp_leg_l] == 0 ||
g->u.hp_cur[hp_leg_r] == 0 ) ) {
add_msg( _( "You cannot use %s with a broken leg." ), eng.name() );
} else {
add_msg( _( "The %s's mechanism is out of reach!" ), name );
return false;
}
} else {
add_msg( _( "Looks like the %1$s is out of %2$s." ), eng.name(),
item::nname( einfo.fuel_type ) );
return false;
}
return false;
}

const double dmg = parts[engines[e]].damage_percent();
Expand Down