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

Allow player to pick up frozen liquids #32763

Merged
merged 19 commits into from Aug 16, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 28 additions & 2 deletions src/pickup.cpp
Expand Up @@ -26,6 +26,7 @@
#include "output.h"
#include "panels.h"
#include "player.h"
#include "popup.h"
#include "string_formatter.h"
#include "string_input_popup.h"
#include "translations.h"
Expand Down Expand Up @@ -214,7 +215,32 @@ bool pick_one_up( item_location &loc, int quantity, bool &got_water, bool &offer
picked_up = true;
option = NUM_ANSWERS; //Skip the options part
} else if( newit.made_of_from_type( LIQUID ) ) {
got_water = true;
if( newit.has_flag( "FROZEN" ) ) {
if( u.has_quality( quality_id( "HAMMER" ), 1, 1 ) ) {
EddiTheBambi marked this conversation as resolved.
Show resolved Hide resolved
int units = newit.charges;
std::string action = query_popup()
.context( "YESNO" )
.message( _( "Do you want to gather %d %s?" ), units, newit.display_name() )
.option( "YES" )
.option( "NO" )
.cursor( 1 )
.query()
.action;
if( action == "YES" ) {
option = STASH;
}
} else {
query_popup()
.context( "YES" )
.message( "%s", "You don't have a Hammering 1 tool." )
EddiTheBambi marked this conversation as resolved.
Show resolved Hide resolved
.option( "CANCEL" )
.cursor( 0 )
.query();
got_water = true;
}
} else {
got_water = true;
}
} else if( !u.can_pickWeight( newit, false ) ) {
if( !autopickup ) {
const std::string &explain = string_format( _( "The %s is too heavy!" ),
Expand Down Expand Up @@ -336,7 +362,7 @@ bool Pickup::do_pickup( std::vector<item_location> &targets, std::vector<int> &q
}

if( got_water ) {
add_msg( m_info, _( "You can't pick up a liquid!" ) );
add_msg( m_info, _( "You can't pick up this liquid!" ) );
}
if( weight_is_okay && g->u.weight_carried() > g->u.weight_capacity() ) {
add_msg( m_bad, _( "You're overburdened!" ) );
Expand Down