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 setting duration for all types of prying, not only for prying nails #77252

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions doc/JSON_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -5196,11 +5196,11 @@ oxytorch: {
```

#### `prying`
(Optional) Data for using with pyring tools
(Optional) Data for using with prying tools
```cpp
"prying": {
"result": "furniture_id", // (optional) furniture it will become when done, defaults to f_null
"duration": "1 seconds", // (optional) time required for prying nails, default is 1 second
"duration": "1 seconds", // (optional) time required for prying, default is 1 second
"message": "You finish prying the door.", // (optional) message that will be displayed when finished prying successfully
"byproducts": [ // (optional) list of items that will be spawned when finished successfully
{
Expand Down
2 changes: 1 addition & 1 deletion src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5838,7 +5838,7 @@ time_duration prying_activity_actor::prying_time( const activity_data_common &da
const item_location &tool, const Character &who )
{
const pry_data &pdata = data.prying_data();
if( pdata.prying_nails ) {
if( data.duration() > 1_seconds ) {
return data.duration();
}

Expand Down
4 changes: 2 additions & 2 deletions tests/player_activities_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,8 +1405,8 @@ TEST_CASE( "prying", "[activity][prying]" )
const time_duration prying_time = prying_activity_actor::prying_time(
*ter_test_t_prying3->prying, prying_tool, dummy );

THEN( "prying time is 32 seconds" ) {
CHECK( prying_time == 32_seconds );
THEN( "prying time is 30 seconds" ) {
CHECK( prying_time == 30_seconds );
}
}
}
Expand Down
Loading