Skip to content

Commit

Permalink
Lock picking overhaul (#39409)
Browse files Browse the repository at this point in the history
* Added lock picking skill
* Use lock picking skill in calculation of success when picking the lock of doors and gun safes
* Gave several professions lockpicking as a starting skill
* Added a booklet about lockpicking
* Added lockpicking booklet to several books item groups
* Added doxygen documentation for the new skill
* Added lockpicking quality to several items
* Updated hardcoded lockpicking qualities for gun safe lockpicking
* Made lockpicking long activity
* Added gun safe to the list of furniture in mapdata
* Made lockpicking activity recognize furniture (gun safe in particular)
* Removed mentions of now-unused `gunsafe_ml` examine function
  • Loading branch information
Anton Burmistrov authored Apr 18, 2020
1 parent a664636 commit 1870fbb
Show file tree
Hide file tree
Showing 19 changed files with 208 additions and 132 deletions.
2 changes: 1 addition & 1 deletion data/json/furniture_and_terrain/furniture-storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
"required_str": 14,
"max_volume": "250 L",
"flags": [ "TRANSPARENT", "CONTAINER", "SEALED", "PLACE_ITEM", "MOUNTABLE", "MINEABLE" ],
"examine_action": "gunsafe_ml",
"examine_action": "locked_object_pickable",
"bash": {
"str_min": 40,
"str_max": 200,
Expand Down
5 changes: 4 additions & 1 deletion data/json/itemgroups/books.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@
{ "item": "textbook_weapeast", "prob": 3 },
{ "item": "textbook_armwest", "prob": 3 },
{ "item": "textbook_armeast", "prob": 3 },
{ "item": "survnote", "prob": 2 }
{ "item": "survnote", "prob": 2 },
{ "item": "book_lockpick", "prob": 2 }
]
},
{
Expand Down Expand Up @@ -465,6 +466,7 @@
{ "item": "collector_book", "prob": 30 },
{ "item": "carpentry_book", "prob": 5 },
{ "item": "jewelry_book", "prob": 5 },
{ "item": "book_lockpick", "prob": 2 },
{ "group": "religious_books", "prob": 40 }
]
},
Expand Down Expand Up @@ -512,6 +514,7 @@
{ "item": "manual_wingchun", "prob": 3 },
{ "item": "manual_medievalpole", "prob": 3 },
{ "item": "manual_swordsmanship", "prob": 3 },
{ "item": "book_lockpick", "prob": 1 },
{ "group": "rare_martial_arts_books", "prob": 6 }
]
},
Expand Down
16 changes: 12 additions & 4 deletions data/json/items/armor/jewelry.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@
"material": [ "copper" ],
"symbol": "[",
"looks_like": "tieclip",
"color": "brown"
"color": "brown",
"use_action": { "type": "picklock", "pick_quality": 3 },
"qualities": [ [ "LOCKPICK", 3 ] ]
},
{
"id": "copper_locket",
Expand Down Expand Up @@ -793,7 +795,9 @@
"material": [ "gold" ],
"symbol": "[",
"color": "yellow",
"flags": [ "FANCY" ]
"flags": [ "FANCY" ],
"use_action": { "type": "picklock", "pick_quality": 3 },
"qualities": [ [ "LOCKPICK", 3 ] ]
},
{
"id": "gold_locket",
Expand Down Expand Up @@ -1090,7 +1094,9 @@
"material": [ "platinum" ],
"symbol": "[",
"color": "white",
"flags": [ "FANCY" ]
"flags": [ "FANCY" ],
"use_action": { "type": "picklock", "pick_quality": 3 },
"qualities": [ [ "LOCKPICK", 3 ] ]
},
{
"id": "platinum_locket",
Expand Down Expand Up @@ -1216,7 +1222,9 @@
"material": [ "silver" ],
"symbol": "[",
"color": "light_gray",
"flags": [ "FANCY" ]
"flags": [ "FANCY" ],
"use_action": { "type": "picklock", "pick_quality": 3 },
"qualities": [ [ "LOCKPICK", 3 ] ]
},
{
"id": "silver_locket",
Expand Down
19 changes: 19 additions & 0 deletions data/json/items/book/lockpick.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"id": "book_lockpick",
"type": "BOOK",
"name": { "str": "MIT Guide to Lock Picking", "str_pl": "copies of MIT Guide to Lock Picking" },
"description": "A home-made booklet with large black-and-white pictures of several types of modern locks and general information on how to crack them open.",
"weight": "400 g",
"volume": "500 ml",
"price": 100,
"price_postapoc": 5000,
"material": [ "paper" ],
"symbol": "?",
"color": "green",
"skill": "lockpick",
"max_level": 2,
"intelligence": 8,
"time": "20 m"
}
]
3 changes: 3 additions & 0 deletions data/json/items/tool/entry_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"material": "steel",
"symbol": ";",
"color": "light_gray",
"qualities": [ [ "LOCKPICK", 3 ] ],
"use_action": { "type": "picklock", "pick_quality": 3 }
},
{
Expand Down Expand Up @@ -85,6 +86,7 @@
"material": "steel",
"symbol": ";",
"color": "light_gray",
"qualities": [ [ "LOCKPICK", 5 ] ],
"use_action": { "type": "picklock", "pick_quality": 5 }
},
{
Expand All @@ -100,6 +102,7 @@
"initial_charges": 1,
"max_charges": 1,
"charges_per_use": 1,
"qualities": [ [ "LOCKPICK", 40 ] ],
"use_action": { "type": "picklock", "pick_quality": 40 }
}
]
4 changes: 3 additions & 1 deletion data/json/items/tool_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,8 @@
"price_postapoc": 25,
"material": [ "iron" ],
"weight": "2 g",
"use_action": { "type": "picklock", "pick_quality": 3 }
"use_action": { "type": "picklock", "pick_quality": 3 },
"qualities": [ [ "LOCKPICK", 3 ] ]
},
{
"id": "fc_hairpin",
Expand All @@ -1854,6 +1855,7 @@
"material": [ "plastic" ],
"weight": "4 g",
"use_action": { "type": "picklock", "pick_quality": 1 },
"qualities": [ [ "LOCKPICK", 1 ] ],
"flags": [ "FANCY" ]
},
{
Expand Down
8 changes: 8 additions & 0 deletions data/json/player_activities.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@
"rooted": true,
"based_on": "speed"
},
{
"id": "ACT_LOCKPICK",
"type": "activity_type",
"activity_level": "NO_EXERCISE",
"verb": "picking lock",
"rooted": true,
"based_on": "speed"
},
{
"id": "ACT_REPAIR_ITEM",
"type": "activity_type",
Expand Down
22 changes: 16 additions & 6 deletions data/json/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@
{ "level": 2, "name": "gun" },
{ "level": 2, "name": "rifle" },
{ "level": 2, "name": "melee" },
{ "level": 2, "name": "lockpick" },
{ "level": 2, "name": "cutting" },
{ "level": 1, "name": "bashing" }
],
Expand Down Expand Up @@ -607,7 +608,8 @@
{ "level": 1, "name": "stabbing" },
{ "level": 1, "name": "unarmed" },
{ "level": 1, "name": "dodge" },
{ "level": 1, "name": "barter" }
{ "level": 1, "name": "barter" },
{ "level": 1, "name": "lockpick" }
],
"items": {
"both": {
Expand Down Expand Up @@ -784,6 +786,7 @@
{ "level": 2, "name": "cutting" },
{ "level": 2, "name": "melee" },
{ "level": 2, "name": "dodge" },
{ "level": 2, "name": "lockpick" },
{ "level": 1, "name": "firstaid" },
{ "level": 1, "name": "swimming" },
{ "level": 1, "name": "survival" }
Expand Down Expand Up @@ -1006,7 +1009,8 @@
{ "level": 2, "name": "fabrication" },
{ "level": 2, "name": "cooking" },
{ "level": 2, "name": "firstaid" },
{ "level": 2, "name": "swimming" }
{ "level": 2, "name": "swimming" },
{ "level": 1, "name": "lockpick" }
],
"items": {
"both": {
Expand Down Expand Up @@ -1485,7 +1489,7 @@
"name": { "male": "Handy Man", "female": "Handy Woman" },
"description": "You used to work at a local hardware store, and you did a lot of home renovations yourself. Now you look out at the horizon of a ruined world, and wonder - are your meager skills, and the few supplies you grabbed on the way out, sufficient to help it rebuild?",
"points": 1,
"skills": [ { "level": 2, "name": "fabrication" } ],
"skills": [ { "level": 2, "name": "fabrication" }, { "level": 1, "name": "lockpick" } ],
"items": {
"both": {
"items": [ "tank_top", "socks", "boots_steel", "pants", "multitool", "wristwatch" ],
Expand Down Expand Up @@ -1663,7 +1667,7 @@
"description": "You have done many high profile heists, but your gains mean nothing in this world. All you have left are the tools of your trade and your impeccable style.",
"points": 4,
"CBMs": [ "bio_batteries", "bio_lockpick", "bio_fingerhack", "bio_power_storage_mkII" ],
"skills": [ { "level": 1, "name": "gun" }, { "level": 1, "name": "smg" } ],
"skills": [ { "level": 1, "name": "gun" }, { "level": 1, "name": "smg" }, { "level": 3, "name": "lockpick" } ],
"items": {
"both": {
"items": [ "waistcoat", "pants", "dress_shirt", "socks", "dress_shoes", "knit_scarf", "gold_watch", "smart_phone" ],
Expand Down Expand Up @@ -2420,7 +2424,7 @@
"name": "Convict",
"description": "The Cataclysm gave you a chance to escape, but freedom comes with a steep price.",
"points": 0,
"skills": [ { "level": 1, "name": "melee" } ],
"skills": [ { "level": 1, "name": "melee" }, { "level": 1, "name": "lockpick" } ],
"items": {
"both": [ "striped_shirt", "striped_pants", "sneakers", "socks", "glass_shiv" ],
"male": [ "briefs" ],
Expand Down Expand Up @@ -2511,6 +2515,7 @@
"name": "Burglar",
"description": "You thought this would be your lucky break. Does it count as breaking and entering if everyone in town is undead?",
"points": 3,
"skills": [ { "level": 4, "name": "lockpick" } ],
"//": "A ski mask would fit the stereotype better, but wool allergy breaks this.",
"items": {
"both": [
Expand Down Expand Up @@ -3393,7 +3398,12 @@
"name": "Survivalist Jr.",
"description": "Your parents were crazy preppers who thought some \"Cataclysm\" was coming, and insisted on preparing you for it. Turns out they were right. You didn't get a chance to thank them. The only thing you can do for them now is what they always hoped you would do in the dark days ahead: survive.",
"points": 3,
"skills": [ { "level": 1, "name": "survival" }, { "level": 1, "name": "fabrication" }, { "level": 1, "name": "firstaid" } ],
"skills": [
{ "level": 1, "name": "survival" },
{ "level": 1, "name": "fabrication" },
{ "level": 1, "name": "firstaid" },
{ "level": 1, "name": "lockpick" }
],
"items": {
"both": {
"items": [
Expand Down
8 changes: 8 additions & 0 deletions data/json/skills.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@
"display_category": "display_melee",
"companion_skill_practice": [ { "skill": "hunting", "weight": 10 }, { "skill": "combat", "weight": 10 } ]
},
{
"type": "skill",
"ident": "lockpick",
"name": { "str": "lock picking" },
"description": "Your skill in picking all sorts of locks which require physical keys - from simple pin tumbler locks to intricate disc tumbler locks. Skill increases chance and decreases time required to successfully pick the lock.",
"companion_survival_rank_factor": 1,
"display_category": "display_interaction"
},
{
"type": "skill",
"ident": "weapon",
Expand Down
5 changes: 5 additions & 0 deletions data/json/tool_qualities.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,5 +261,10 @@
"type": "tool_quality",
"id": "PRESSURIZATION",
"name": { "str": "pressurizing" }
},
{
"type": "tool_quality",
"id": "LOCKPICK",
"name": { "str": "lockpicking" }
}
]
2 changes: 2 additions & 0 deletions doxygen_doc/doxygen_conf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ ALIASES += "EFFECT_PISTOL=\xrefitem Effects_Skill_Pistol \"\" \"\" Pistol"
ALIASES += "EFFECT_RIFLE=\xrefitem Effects_Skill_Rifle \"\" \"\" Rifle"
ALIASES += "EFFECT_SHOTGUN=\xrefitem Effects_Skill_Shotgun \"\" \"\" Shotgun"
ALIASES += "EFFECT_SMG=\xrefitem Effects_Skill_Smg \"\" \"\" Smg"
ALIASES += "EFFECT_LOCKPICK=\xrefitem Effects_Skill_Lockpick \"\" \"\" Lock Picking"

ALIASES += "EFFECT_BARTER_NPC=\xrefitem Effects_Skill_Barter \"\" \"\" NPC Barter"
ALIASES += "EFFECT_COMPUTER_NPC=\xrefitem Effects_Skill_Computer \"\" \"\" NPC Computer"
Expand Down Expand Up @@ -271,6 +272,7 @@ ALIASES += "EFFECT_PISTOL_NPC=\xrefitem Effects_Skill_Pistol \"\" \"\" NPC Pisto
ALIASES += "EFFECT_RIFLE_NPC=\xrefitem Effects_Skill_Rifle \"\" \"\" NPC Rifle"
ALIASES += "EFFECT_SHOTGUN_NPC=\xrefitem Effects_Skill_Shotgun \"\" \"\" NPC Shotgun"
ALIASES += "EFFECT_SMG_NPC=\xrefitem Effects_Skill_Smg \"\" \"\" NPC Smg"
ALIASES += "EFFECT_LOCKPICK_NPC=\xrefitem Effects_Skill_Lockpick \"\" \"\" NPC Lock Picking"

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding
Expand Down
4 changes: 4 additions & 0 deletions doxygen_doc/pages.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,7 @@
* @brief Cross referenced effects of the Smg skill.
* @par
*/
*! @page Effects_Skill_Lockpick
* @brief Cross referenced effects of the Lock picking skill.
* @par
*/
Loading

0 comments on commit 1870fbb

Please sign in to comment.