Skip to content

Commit

Permalink
Use or Apply Wielded, default key capital A.
Browse files Browse the repository at this point in the history
  • Loading branch information
wito committed Jan 15, 2013
1 parent 14edde3 commit 3d86c51
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ std::string action_ident(action_id act)
return "organize";
case ACTION_USE:
return "apply";
case ACTION_USE_WIELDED:
return "apply_wielded";
case ACTION_WEAR:
return "wear";
case ACTION_TAKE_OFF:
Expand Down Expand Up @@ -172,7 +174,7 @@ std::string action_ident(action_id act)
case ACTION_CONSTRUCT:
return "construct";
case ACTION_DISASSEMBLE:
return "disassemble";
return "disassemble";
case ACTION_SLEEP:
return "sleep";
case ACTION_TOGGLE_SAFEMODE:
Expand Down Expand Up @@ -269,6 +271,8 @@ std::string action_name(action_id act)
return "Swap Inventory Letters";
case ACTION_USE:
return "Apply or Use Item";
case ACTION_USE_WIELDED:
return "Apply or Use Wielded Item";
case ACTION_WEAR:
return "Wear Item";
case ACTION_TAKE_OFF:
Expand Down
1 change: 1 addition & 0 deletions action.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ACTION_PEEK,
ACTION_INVENTORY,
ACTION_ORGANIZE,
ACTION_USE,
ACTION_USE_WIELDED,
ACTION_WEAR,
ACTION_TAKE_OFF,
ACTION_EAT,
Expand Down
9 changes: 9 additions & 0 deletions game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,10 @@ input_ret game::get_input(int timeout_ms)
use_item();
break;

case ACTION_USE_WIELDED:
use_wielded_item();
break;

case ACTION_WEAR:
wear();
break;
Expand Down Expand Up @@ -4112,6 +4116,11 @@ void game::use_item()
u.use(this, ch);
}

void game::use_wielded_item()
{
u.use_wielded(this);
}

bool game::pl_choose_vehicle (int &x, int &y)
{
refresh_all();
Expand Down
1 change: 1 addition & 0 deletions game.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ class game
void complete_butcher(int index); // Finish the butchering process
void eat(); // Eat food or fuel 'E' (or 'a')
void use_item();// Use item; also tries E,R,W 'a'
void use_wielded_item();
void wear(); // Wear armor 'W' (or 'a')
void takeoff(); // Remove armor 'T'
void reload(); // Reload a wielded gun/tool 'r'
Expand Down
1 change: 1 addition & 0 deletions keypress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ peek L X\n\
inventory i\n\
organize =\n\
apply a\n\
apply_wielded A\n\
wear W\n\
take_off T\n\
eat E\n\
Expand Down
4 changes: 4 additions & 0 deletions player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4239,6 +4239,10 @@ bool player::takeoff(game *g, char let)
return false;
}

void player::use_wielded(game *g) {
use(g, weapon.invlet);
}

void player::use(game *g, char let)
{
item* used = &i_at(let);
Expand Down
1 change: 1 addition & 0 deletions player.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class player {
bool wear_item(game *g, item *to_wear);
bool takeoff(game *g, char let);// Take off item; returns false on fail
void use(game *g, char let); // Use a tool
void use_wielded(game *g);
bool install_bionics(game *g, it_bionic* type); // Install bionics
void read(game *g, char let); // Read a book
void try_to_sleep(game *g); // '$' command; adds DIS_LYING_DOWN
Expand Down

0 comments on commit 3d86c51

Please sign in to comment.