Skip to content

Commit

Permalink
refactor(port): hacksaw migrated to activity actor and jsonified (#3880)
Browse files Browse the repository at this point in the history
* Jsonize hacksaw activity (#50155)

Co-authored-by: Saicchi <[email protected]>
Co-authored-by: Kevin Granade <[email protected]>

* Make it work

* style(autofix.ci): automated formatting

---------

Co-authored-by: Saicchi <[email protected]>
Co-authored-by: Saicchi <[email protected]>
Co-authored-by: Kevin Granade <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Dec 13, 2023
1 parent 8b28e40 commit b097d0f
Show file tree
Hide file tree
Showing 18 changed files with 829 additions and 134 deletions.
5 changes: 5 additions & 0 deletions data/json/furniture_and_terrain/furniture-storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,11 @@
"move_cost_mod": -1,
"coverage": 70,
"required_str": 8,
"hacksaw": {
"duration": "2 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": [ 1, 3 ] }, { "item": "steel_chunk", "count": 1 } ]
},
"flags": [ "TRANSPARENT", "FLAMMABLE_HARD", "PLACE_ITEM", "BLOCKSDOOR", "MOUNTABLE" ],
"oxytorch": { "duration": "1 seconds", "byproducts": [ { "item": "steel_chunk", "count": [ 2, 6 ] } ] },
"deconstruct": { "items": [ { "item": "pipe", "count": 12 }, { "item": "sheet_metal", "count": 2 } ] },
Expand Down
12 changes: 12 additions & 0 deletions data/json/furniture_and_terrain/terrain-doors.json
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,12 @@
"move_cost": 0,
"roof": "t_flat_roof",
"flags": [ "TRANSPARENT", "NOITEM", "PERMEABLE", "CONNECT_TO_WALL", "THIN_OBSTACLE" ],
"hacksaw": {
"result": "t_mdoor_frame",
"duration": "15 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": 12 } ]
},
"open": "t_door_bar_o",
"close": "t_door_bar_locked",
"oxytorch": {
Expand Down Expand Up @@ -2358,6 +2364,12 @@
"roof": "t_flat_roof",
"lockpick_result": "t_door_bar_o",
"lockpick_message": "The door swings open…",
"hacksaw": {
"result": "t_mdoor_frame",
"duration": "15 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": 12 } ]
},
"flags": [ "TRANSPARENT", "NOITEM", "PERMEABLE", "CONNECT_TO_WALL", "LOCKED", "THIN_OBSTACLE" ],
"examine_action": "locked_object_pickable",
"oxytorch": {
Expand Down
24 changes: 24 additions & 0 deletions data/json/furniture_and_terrain/terrain-fences-gates.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
"duration": "9 seconds",
"byproducts": [ { "item": "pipe", "count": [ 1, 4 ] }, { "item": "wire", "count": [ 4, 16 ] } ]
},
"hacksaw": {
"result": "t_dirt",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": 6 }, { "item": "steel_chunk", "count": 20 } ]
},
"bash": {
"str_min": 10,
"str_max": 150,
Expand Down Expand Up @@ -107,6 +113,12 @@
"byproducts": [ { "item": "pipe", "count": [ 1, 4 ] }, { "item": "wire", "count": [ 4, 16 ] } ]
},
"open": "t_chaingate_o",
"hacksaw": {
"result": "t_dirt",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": 6 }, { "item": "steel_chunk", "count": 20 } ]
},
"bash": {
"str_min": 10,
"str_max": 150,
Expand Down Expand Up @@ -404,6 +416,12 @@
"duration": "9 seconds",
"byproducts": [ { "item": "pipe", "count": [ 1, 4 ] }, { "item": "wire", "count": [ 4, 16 ] } ]
},
"hacksaw": {
"result": "t_dirt",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": 6 }, { "item": "steel_chunk", "count": 20 } ]
},
"bash": {
"str_min": 10,
"str_max": 150,
Expand All @@ -421,6 +439,12 @@
"symbol": "#",
"color": "cyan",
"move_cost": 2,
"hacksaw": {
"result": "t_dirt",
"duration": "2 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": 6 } ]
},
"flags": [ "TRANSPARENT", "THIN_OBSTACLE" ],
"oxytorch": { "result": "t_dirt", "duration": "1 seconds", "byproducts": [ { "item": "pipe", "count": [ 1, 4 ] } ] },
"bash": {
Expand Down
12 changes: 12 additions & 0 deletions data/json/furniture_and_terrain/terrain-walls.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,12 @@
"symbol": "#",
"color": "dark_gray",
"move_cost": 0,
"hacksaw": {
"result": "t_pit",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "spike", "count": 19 }, { "item": "scrap", "count": 8 } ]
},
"flags": [ "TRANSPARENT", "NOITEM", "PERMEABLE", "THIN_OBSTACLE" ],
"connects_to": "WALL",
"oxytorch": {
Expand Down Expand Up @@ -1084,6 +1090,12 @@
"symbol": "\"",
"color": "light_gray",
"move_cost": 0,
"hacksaw": {
"result": "t_floor",
"duration": "15 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": 3 } ]
},
"flags": [ "TRANSPARENT", "NOITEM", "PERMEABLE", "CONNECT_TO_WALL", "THIN_OBSTACLE" ],
"oxytorch": { "result": "t_floor", "duration": "9 seconds", "byproducts": [ { "item": "pipe", "count": [ 1, 2 ] } ] },
"bash": {
Expand Down
66 changes: 66 additions & 0 deletions data/json/furniture_and_terrain/terrain-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@
"move_cost": 0,
"coverage": 95,
"roof": "t_flat_roof",
"hacksaw": {
"result": "t_window_reinforced",
"duration": "5 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "rebar", "count": [ 1, 4 ] } ]
},
"flags": [ "NOITEM", "REDUCE_SCENT", "CONNECT_TO_WALL", "BLOCK_WIND" ],
"oxytorch": {
"result": "t_window_empty",
Expand Down Expand Up @@ -458,6 +464,12 @@
"duration": "4 seconds",
"byproducts": [ { "item": "steel_plate", "count": [ 0, 1 ] }, { "item": "sheet_metal", "count": [ 1, 3 ] } ]
},
"hacksaw": {
"result": "t_window_reinforced_noglass",
"duration": "5 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "rebar", "count": [ 1, 4 ] } ]
},
"bash": {
"str_min": 18,
"str_max": 40,
Expand Down Expand Up @@ -502,6 +514,12 @@
"symbol": "#",
"color": "light_gray",
"move_cost": 0,
"hacksaw": {
"result": "t_window_alarm",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "rebar", "count": [ 1, 8 ] } ]
},
"delete": { "flags": [ "FLAMMABLE", "BARRICADABLE_WINDOW" ] },
"extend": { "flags": [ "ALARMED" ] },
"oxytorch": { "result": "t_window_alarm", "duration": "9 seconds", "byproducts": [ { "item": "rebar", "count": [ 1, 2 ] } ] },
Expand All @@ -517,6 +535,12 @@
"color": "light_gray",
"move_cost": 0,
"coverage": 95,
"hacksaw": {
"result": "t_window_domestic",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "rebar", "count": [ 1, 8 ] } ]
},
"roof": "t_flat_roof",
"oxytorch": { "result": "t_window_domestic", "duration": "9 seconds", "byproducts": [ { "item": "rebar", "count": [ 1, 2 ] } ] },
"flags": [
Expand Down Expand Up @@ -556,6 +580,12 @@
"looks_like": "t_window_bars",
"color": "light_gray",
"move_cost": 0,
"hacksaw": {
"result": "t_window_domestic",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "rebar", "count": [ 1, 8 ] } ]
},
"roof": "t_flat_roof",
"oxytorch": { "result": "t_window_domestic", "duration": "9 seconds", "byproducts": [ { "item": "rebar", "count": [ 1, 2 ] } ] },
"flags": [
Expand Down Expand Up @@ -658,6 +688,12 @@
"duration": "9 seconds",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"hacksaw": {
"result": "t_window_reinforced",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"flags": [
"TRANSPARENT",
"NOITEM",
Expand Down Expand Up @@ -701,6 +737,12 @@
"duration": "9 seconds",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"hacksaw": {
"result": "t_window_reinforced",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"flags": [ "NOITEM", "CONNECT_TO_WALL", "THIN_OBSTACLE", "BARRICADABLE_WINDOW_CURTAINS", "BLOCK_WIND", "REDUCE_SCENT", "WINDOW" ],
"curtain_transform": "t_window_bars",
"examine_action": "curtains",
Expand Down Expand Up @@ -748,6 +790,12 @@
"duration": "9 seconds",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"hacksaw": {
"result": "t_window_reinforced",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"curtain_transform": "t_window_bars",
"examine_action": "curtains",
"close": "t_metal_grate_window_with_curtain",
Expand Down Expand Up @@ -779,6 +827,12 @@
"color": "light_gray",
"move_cost": 0,
"roof": "t_flat_roof",
"hacksaw": {
"result": "t_window_reinforced_noglass",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"flags": [ "TRANSPARENT", "NOITEM", "CONNECT_TO_WALL", "BARRICADABLE_WINDOW", "THIN_OBSTACLE", "WINDOW" ],
"oxytorch": {
"result": "t_window_reinforced_noglass",
Expand Down Expand Up @@ -813,6 +867,12 @@
"color": "light_gray",
"move_cost": 0,
"roof": "t_flat_roof",
"hacksaw": {
"result": "t_window_reinforced_noglass",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"flags": [ "NOITEM", "CONNECT_TO_WALL", "THIN_OBSTACLE", "BARRICADABLE_WINDOW_CURTAINS", "BLOCK_WIND", "REDUCE_SCENT", "WINDOW" ],
"curtain_transform": "t_metal_grate_window_noglass",
"examine_action": "curtains",
Expand Down Expand Up @@ -865,6 +925,12 @@
"duration": "9 seconds",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"hacksaw": {
"result": "t_window_reinforced_noglass",
"duration": "10 minutes",
"message": "You finish cutting the metal.",
"byproducts": [ { "item": "pipe", "count": [ 1, 12 ] }, { "item": "sheet_metal", "count": 4 } ]
},
"curtain_transform": "t_metal_grate_window_noglass",
"examine_action": "curtains",
"close": "t_metal_grate_window_with_curtain",
Expand Down
33 changes: 33 additions & 0 deletions data/mods/TEST_DATA/furniture.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,39 @@
"required_str": 8,
"boltcut": { "duration": "80 seconds" }
},
{
"type": "furniture",
"id": "test_f_hacksaw1",
"name": "Hacksaw Test Furniture 1",
"description": "Hacksaw furniture with valid data.",
"symbol": "f",
"color": "blue",
"move_cost_mod": 1,
"required_str": 8,
"hacksaw": { "duration": "5 minutes" }
},
{
"type": "furniture",
"id": "test_f_hacksaw2",
"name": "Hacksaw Test Furniture 2",
"description": "Hacksaw furniture with valid data.",
"symbol": "f",
"color": "blue",
"move_cost_mod": 1,
"required_str": 8,
"hacksaw": { "result": "test_f_hacksaw1", "duration": "5 minutes" }
},
{
"type": "furniture",
"id": "test_f_hacksaw3",
"name": "Hacksaw Test Furniture 1",
"description": "Hacksaw furniture with valid data.",
"symbol": "f",
"color": "blue",
"move_cost_mod": 1,
"required_str": 8,
"hacksaw": { "duration": "80 minutes" }
},
{
"type": "furniture",
"id": "test_f_oxytorch1",
Expand Down
35 changes: 34 additions & 1 deletion data/mods/TEST_DATA/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
"qualities": [ [ "WELD", 10 ] ],
"charges_per_use": 4,
"use_action": [ "OXYTORCH" ],
"magazines": [ [ "weldgas", [ "weldtank", "tinyweldtank" ] ] ]
"magazines": [ [ "weldgas", [ "weldtank", "test_weldtank" ] ] ]
},
{
"type": "TOOL",
Expand Down Expand Up @@ -624,6 +624,39 @@
]
]
},
{
"type": "TOOL",
"id": "test_hacksaw",
"name": { "str": "test hacksaw" },
"description": "Test hacksaw.",
"weight": "1 kg",
"volume": "1 L",
"symbol": ";",
"qualities": [ [ "SAW_M", 10 ] ]
},
{
"type": "TOOL",
"id": "test_hacksaw_elec",
"copy-from": "test_hacksaw",
"name": { "str": "test electric hacksaw" },
"description": "Test hacksaw which uses batteries.",
"charges_per_use": 1,
"ammo": "battery",
"magazines": [
[
"battery",
[
"light_minus_battery_cell",
"light_battery_cell",
"light_plus_battery_cell",
"light_atomic_battery_cell",
"light_minus_atomic_battery_cell",
"light_minus_disposable_cell",
"light_disposable_cell"
]
]
]
},
{
"id": "test_swat_armor",
"repairs_like": "survivor_suit",
Expand Down
26 changes: 26 additions & 0 deletions data/mods/TEST_DATA/terrain.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,32 @@
"byproducts": [ { "item": "test_rock", "count": 3 }, { "item": "test_2x4", "count": [ 7, 9 ] } ]
}
},
{
"type": "terrain",
"id": "test_t_hacksaw1",
"name": "Hacksaw Test Terrain 1",
"description": "Hacksaw terrain with valid data.",
"symbol": "t",
"color": "blue",
"move_cost": 2,
"bash": { "sound": "thump", "ter_set": "t_null", "str_min": 50, "str_max": 100, "str_min_supported": 100, "bash_below": true },
"hacksaw": { "result": "t_dirt", "duration": "10 minutes" }
},
{
"type": "terrain",
"id": "test_t_hacksaw2",
"name": "Hacksaw Test Terrain 2",
"description": "Hacksaw terrain with valid data.",
"symbol": "t",
"color": "blue",
"move_cost": 2,
"bash": { "sound": "thump", "ter_set": "t_null", "str_min": 50, "str_max": 100, "str_min_supported": 100, "bash_below": true },
"hacksaw": {
"result": "t_dirt",
"duration": "5 minutes",
"byproducts": [ { "item": "test_rock", "count": 3 }, { "item": "test_2x4", "count": [ 7, 9 ] } ]
}
},
{
"type": "terrain",
"id": "test_t_oxytorch1",
Expand Down
Loading

0 comments on commit b097d0f

Please sign in to comment.