Skip to content

Commit

Permalink
Improve makeshift crowbar action description (#54195)
Browse files Browse the repository at this point in the history
* Add new crowbar item action

* Make makeshift crowbar use new action

* Create iuse function for makeshift crowbar
  • Loading branch information
matshou authored Jan 9, 2022
1 parent 35721ed commit e40f1ae
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions data/json/item_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
"id": "deploy_furn",
"name": { "str": "Deploy item" }
},
{
"type": "item_action",
"id": "CROWBAR_WEAK",
"name": { "str": "Pry crate or nails" }
},
{
"type": "item_action",
"id": "CROWBAR",
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/tool/entry_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"symbol": ";",
"color": "dark_gray",
"qualities": [ [ "PRY", 1 ], [ "HAMMER", 1 ] ],
"use_action": [ "CROWBAR" ],
"use_action": [ "CROWBAR_WEAK" ],
"techniques": [ "WBLOCK_1" ],
"flags": [ "BELT_CLIP" ]
},
Expand Down
1 change: 1 addition & 0 deletions src/item_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ void Item_factory::init()
add_iuse( "E_COMBATSAW_ON", &iuse::e_combatsaw_on );
add_iuse( "CONTACTS", &iuse::contacts );
add_iuse( "CROWBAR", &iuse::crowbar );
add_iuse( "CROWBAR_WEAK", &iuse::crowbar_weak );
add_iuse( "DATURA", &iuse::datura );
add_iuse( "DIG", &iuse::dig );
add_iuse( "DIVE_TANK", &iuse::dive_tank );
Expand Down
5 changes: 5 additions & 0 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2641,6 +2641,11 @@ cata::optional<int> iuse::hammer( Character *p, item *it, bool, const tripoint &
return iuse::crowbar( p, it, false, pos );
}

cata::optional<int> iuse::crowbar_weak( Character *p, item *it, bool, const tripoint &pos )
{
return iuse::crowbar( p, it, false, pos );
}

cata::optional<int> iuse::crowbar( Character *p, item *it, bool, const tripoint &pos )
{
if( p->is_mounted() ) {
Expand Down
1 change: 1 addition & 0 deletions src/iuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ cata::optional<int> combatsaw_off( Character *, item *, bool, const tripoint & )
cata::optional<int> combatsaw_on( Character *, item *, bool, const tripoint & );
cata::optional<int> contacts( Character *, item *, bool, const tripoint & );
cata::optional<int> crowbar( Character *, item *, bool, const tripoint & );
cata::optional<int> crowbar_weak( Character *, item *, bool, const tripoint & );
cata::optional<int> dig( Character *, item *, bool, const tripoint & );
cata::optional<int> dig_channel( Character *, item *, bool, const tripoint & );
cata::optional<int> directional_antenna( Character *, item *, bool, const tripoint & );
Expand Down

0 comments on commit e40f1ae

Please sign in to comment.