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

Change message for consuming liquid fuel to "Fuel bionic with it" #38653

Merged
merged 1 commit into from
Mar 9, 2020
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
1 change: 1 addition & 0 deletions src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,7 @@ class Character : public Creature, public visitable<Character>
bool can_estimate_rot() const;
/** Check whether character can consume this very item */
bool can_consume_as_is( const item &it ) const;
bool can_consume_for_bionic( const item &it ) const;
/**
* Returns a reference to the item itself (if it's consumable),
* the first of its contents (if it's consumable) or null item otherwise.
Expand Down
7 changes: 6 additions & 1 deletion src/consumption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,12 @@ bool Character::can_estimate_rot() const

bool Character::can_consume_as_is( const item &it ) const
{
return it.is_comestible() || get_cbm_rechargeable_with( it ) != rechargeable_cbm::none;
return it.is_comestible() || can_consume_for_bionic( it );
}

bool Character::can_consume_for_bionic( const item &it ) const
{
return get_cbm_rechargeable_with( it ) != rechargeable_cbm::none;
}

bool Character::can_consume( const item &it ) const
Expand Down
7 changes: 6 additions & 1 deletion src/handle_liquid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ static bool get_liquid_target( item &liquid, item *const source, const int radiu
std::vector<std::function<void()>> actions;

if( g->u.can_consume( liquid ) && !source_mon ) {
menu.addentry( -1, true, 'e', _( "Consume it" ) );
if( g->u.can_consume_for_bionic( liquid ) ) {
menu.addentry( -1, true, 'e', _( "Fuel bionic with it" ) );
} else {
menu.addentry( -1, true, 'e', _( "Consume it" ) );
}

actions.emplace_back( [&]() {
target.dest_opt = LD_CONSUME;
} );
Expand Down