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

feat: Add secured lockers and computer action to open them #4703

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
611aa42
Update computer_session.h
Ali-Anomma May 27, 2024
f6f0290
Update computer_session.cpp
Ali-Anomma May 27, 2024
ae0e4e5
Merge pull request #3 from Ali-Anomma/patch-5
Ali-Anomma May 27, 2024
0ce5c03
Update computer_session.cpp
Ali-Anomma May 27, 2024
d818824
Merge pull request #4 from Ali-Anomma/main
Ali-Anomma May 27, 2024
b81a024
Update computer_session.cpp
Ali-Anomma May 27, 2024
4456e62
Update mapdata.cpp
Ali-Anomma May 27, 2024
76b0ad9
Update mapdata.h
Ali-Anomma May 27, 2024
f79c2b1
Update mapdata.h
Ali-Anomma May 27, 2024
7c4de0b
Update computer.cpp
Ali-Anomma May 27, 2024
03b9f62
Update computer_session.h
Ali-Anomma May 27, 2024
3489aeb
Update computer.h
Ali-Anomma May 27, 2024
9d4feda
Update mapdata.h
Ali-Anomma May 27, 2024
dbdf3c4
Update terrain-manufactured.json
Ali-Anomma May 27, 2024
de9877d
style(autofix.ci): automated formatting
autofix-ci[bot] May 27, 2024
2f42728
Merge branch 'cataclysmbnteam:main' into upload
Ali-Anomma Jul 3, 2024
23f54e0
Update seed.json
Ali-Anomma Jul 3, 2024
3413ae6
Update mushroom.json
Ali-Anomma Jul 3, 2024
f78957e
style(autofix.ci): automated formatting
autofix-ci[bot] Jul 3, 2024
529b228
Update seeds.json
Ali-Anomma Jul 3, 2024
ea639a6
style(autofix.ci): automated formatting
autofix-ci[bot] Jul 3, 2024
5960a09
revert seeds.json
Ali-Anomma Jul 3, 2024
72b4ad5
Update seed.json
Ali-Anomma Jul 3, 2024
ebf973a
Double spaces go nyoooom
chaosvolt Jul 3, 2024
c1ae4bf
Merge branch 'cataclysmbnteam:main' into upload
Ali-Anomma Jul 13, 2024
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
87 changes: 87 additions & 0 deletions data/json/furniture_and_terrain/terrain-manufactured.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,93 @@
"items": [ { "item": "steel_chunk", "count": [ 1, 3 ] }, { "item": "scrap", "count": [ 4, 8 ] } ]
}
},
{
"type": "terrain",
"id": "t_secure_locker_l",
"name": "locked secure locker",
"description": "A reinforced locker most commonly used for storing cargo or military equipment. This one is locked.",
"symbol": "X",
"color": "light_gray",
"looks_like": "f_locker",
"move_cost": 0,
"coverage": 75,
"max_volume": "500 L",
"flags": [ "TRANSPARENT", "CONTAINER", "SEALED", "PLACE_ITEM", "MOUNTABLE", "MINEABLE", "BLOCKSDOOR" ],
"lockpick_result": "t_secure_locker_c",
"lockpick_message": "With a satisfying click, the lock on the secure locker opens.",
"examine_action": "locked_object_pickable",
"oxytorch": { "result": "t_secure_locker_o", "duration": "10 seconds" },
"bash": {
"ter_set": "t_floor",
"str_min": 40,
"str_max": 100,
"sound": "screeching metal!",
"sound_fail": "clang!",
"items": [
{ "item": "sheet_metal", "count": 3 },
{ "item": "scrap", "count": [ 7, 15 ] },
{ "item": "sheet_metal_small", "count": [ 9, 16 ] },
{ "item": "pipe", "count": [ 2, 5 ] }
],
"ranged": { "reduction": [ 20, 40 ], "destroy_threshold": 100, "block_unaimed_chance": "75%" }
}
},
{
"type": "terrain",
"id": "t_secure_locker_c",
"name": "closed secure locker",
"description": "A reinforced locker most commonly used for storing cargo or military equipment. This one is closed but not locked.",
"symbol": "X",
"color": "light_gray",
"looks_like": "f_locker",
"move_cost": 0,
"coverage": 75,
"max_volume": "500 L",
"open": "t_secure_locker_o",
"flags": [ "TRANSPARENT", "CONTAINER", "SEALED", "PLACE_ITEM", "MOUNTABLE", "MINEABLE", "BLOCKSDOOR" ],
"bash": {
"ter_set": "t_floor",
"str_min": 40,
"str_max": 100,
"sound": "screeching metal!",
"sound_fail": "clang!",
"items": [
{ "item": "sheet_metal", "count": 3 },
{ "item": "scrap", "count": [ 7, 15 ] },
{ "item": "sheet_metal_small", "count": [ 9, 16 ] },
{ "item": "pipe", "count": [ 2, 5 ] }
],
"ranged": { "reduction": [ 20, 40 ], "destroy_threshold": 100, "block_unaimed_chance": "75%" }
}
},
{
"type": "terrain",
"id": "t_secure_locker_o",
"name": "open secure locker",
"description": "A reinforced locker most commonly used for storing cargo or military equipment. This one is open.",
"symbol": "X",
"looks_like": "f_locker",
"color": "light_gray",
"move_cost": 0,
"coverage": 75,
"max_volume": "500 L",
"close": "t_secure_locker_c",
"flags": [ "TRANSPARENT", "CONTAINER", "PLACE_ITEM", "MOUNTABLE", "MINEABLE", "BLOCKSDOOR" ],
"bash": {
"ter_set": "t_floor",
"str_min": 40,
"str_max": 100,
"sound": "screeching metal!",
"sound_fail": "clang!",
"items": [
{ "item": "sheet_metal", "count": 3 },
{ "item": "scrap", "count": [ 7, 15 ] },
{ "item": "sheet_metal_small", "count": [ 9, 16 ] },
{ "item": "pipe", "count": [ 2, 5 ] }
],
"ranged": { "reduction": [ 20, 40 ], "destroy_threshold": 100, "block_unaimed_chance": "75%" }
}
},
{
"type": "terrain",
"id": "t_metal_ventilation_shutter",
Expand Down
2 changes: 2 additions & 0 deletions data/json/items/comestibles/mushroom.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"comestible_type": "FOOD",
"symbol": "%",
"healthy": 1,
"charges": 10,
"calories": 15,
"description": "Mushrooms are tasty, but be careful. Some can poison you, while others are hallucinogenic.",
"price": "140 cent",
Expand All @@ -104,6 +105,7 @@
"charges": 10,
"flags": [ "SMOKABLE", "FORAGE_POISON", "FORAGE_HALLU", "RAW" ],
"smoking_result": "dry_mushroom",
"//": "if we ever implement macro nutritients, mushrooms should be a good protein source.",
"vitamins": [ [ "vitC", 2 ], [ "iron", 2 ] ]
}
]
1 change: 1 addition & 0 deletions src/computer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ std::string enum_to_string<computer_action>( const computer_action act )
case COMPACT_MISS_DISARM: return "miss_disarm";
case COMPACT_OPEN: return "open";
case COMPACT_OPEN_DISARM: return "open_disarm";
case COMPACT_OPEN_LOCKER: return "open_locker";
case COMPACT_PORTAL: return "portal";
case COMPACT_RADIO_ARCHIVE: return "radio_archive";
case COMPACT_RELEASE: return "release";
Expand Down
1 change: 1 addition & 0 deletions src/computer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ enum computer_action {
COMPACT_MISS_DISARM,
COMPACT_OPEN,
COMPACT_OPEN_DISARM,
COMPACT_OPEN_LOCKER,
COMPACT_PORTAL,
COMPACT_RADIO_ARCHIVE,
COMPACT_RELEASE,
Expand Down
6 changes: 6 additions & 0 deletions src/computer_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ computer_session::computer_action_functions = {
{ COMPACT_MAPS, &computer_session::action_maps },
{ COMPACT_MISS_DISARM, &computer_session::action_miss_disarm },
{ COMPACT_OPEN, &computer_session::action_open },
{ COMPACT_OPEN_LOCKER, &computer_session::action_open_locker },
{ COMPACT_OPEN_DISARM, &computer_session::action_open_disarm },
{ COMPACT_PORTAL, &computer_session::action_portal },
{ COMPACT_RADIO_ARCHIVE, &computer_session::action_radio_archive },
Expand Down Expand Up @@ -322,6 +323,11 @@ void computer_session::action_open()
get_map().translate_radius( t_door_metal_locked, t_floor, 25.0, g->u.pos(), true );
query_any( _( "Doors opened. Press any key…" ) );
}
void computer_session::action_open_locker()
{
get_map().translate_radius( t_secure_locker_l, t_secure_locker_o, 8.0, g->u.pos(), true );
query_any( _( "Lockers opened. Press any key…" ) );
}

//LOCK AND UNLOCK are used to build more complex buildings
// that can have multiple doors that can be locked and be
Expand Down
1 change: 1 addition & 0 deletions src/computer_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class computer_session
void action_miss_disarm();
void action_open();
void action_open_disarm();
void action_open_locker();
void action_portal();
void action_radio_archive();
void action_release();
Expand Down
3 changes: 3 additions & 0 deletions src/mapdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ ter_id t_null,
t_sewage_pipe, t_sewage_pump,
t_centrifuge,
t_column,
t_secure_locker_l, t_secure_locker_o,
t_vat,
t_rootcellar,
t_cvdbody, t_cvdmachine,
Expand Down Expand Up @@ -888,6 +889,8 @@ void set_ter_ids()
t_paper = ter_id( "t_paper" );
t_rock_wall = ter_id( "t_rock_wall" );
t_rock_wall_half = ter_id( "t_rock_wall_half" );
t_secure_locker_l = ter_id( "t_secure_locker_l" );
t_secure_locker_o = ter_id( "t_secure_locker_o" );
t_tree = ter_id( "t_tree" );
t_tree_young = ter_id( "t_tree_young" );
t_tree_apple = ter_id( "t_tree_apple" );
Expand Down
7 changes: 5 additions & 2 deletions src/mapdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ extern ter_id t_null,
// Ground
t_dirt, t_sand, t_clay, t_dirtmound, t_pit_shallow, t_pit, t_grave, t_grave_new,
t_pit_corpsed, t_pit_covered, t_pit_spiked, t_pit_spiked_covered, t_pit_glass, t_pit_glass_covered,
t_rock_floor,
_floor,
t_grass, t_grass_long, t_grass_tall, t_grass_golf, t_grass_dead, t_grass_white, t_moss,
t_metal_floor,
t_pavement, t_pavement_y, t_sidewalk, t_concrete,
Expand All @@ -660,6 +660,7 @@ extern ter_id t_null,
t_slime,
t_bridge,
t_covered_well,
t_rock_floor,
// Lighting related
t_utility_light,
// Walls
Expand Down Expand Up @@ -690,9 +691,11 @@ extern ter_id t_null,
t_window_boarded_noglass, t_window_bars_alarm, t_window_bars,
t_window_stained_green, t_window_stained_red, t_window_stained_blue,
t_window_no_curtains, t_window_no_curtains_open, t_window_no_curtains_taped,
t_rock, t_fault,
t_fault,
t_rock,
t_paper,
t_rock_wall, t_rock_wall_half,
t_secure_locker_l, t_secure_locker_o,
// Tree
t_tree, t_tree_young, t_tree_apple, t_tree_apple_harvested, t_tree_coffee, t_tree_coffee_harvested,
t_tree_pear, t_tree_pear_harvested,
Expand Down
Loading