Skip to content

Commit

Permalink
Make vehicle folding/unfolding an activity. (CleverRaven#60266)
Browse files Browse the repository at this point in the history
* Fix duplication of folding vehicles and tents

* Move iuse up to date comment on top of namespace

* Add vehicle folding activities

* Add tools for folding/unfolding activities

* Add time to parts for folding/unfolding activities

* Add folding/unfolding + degradation tests

* Adjust tests for multiple folding vehicles and multiple tools

* Apply review comments
  • Loading branch information
irwiss authored Aug 30, 2022
1 parent db12161 commit 1da002c
Show file tree
Hide file tree
Showing 16 changed files with 619 additions and 164 deletions.
4 changes: 2 additions & 2 deletions data/json/items/tool/unfoldable.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"copy-from": "generic_folded_vehicle",
"name": { "str": "folded Bicycle" },
"description": "A folded Bicycle.",
"weight": "20790 g",
"weight": "20786 g",
"volume": "18500 ml",
"symbol": "0",
"color": "light_gray",
Expand Down Expand Up @@ -47,7 +47,7 @@
"type": "TOOL",
"copy-from": "generic_folded_vehicle",
"name": { "str": "inflatable boat" },
"description": "This rubber rowboat in original packaging (oars and pump included) is deflated for storage. Activate it to inflate and launch.",
"description": "This rubber rowboat (oars included) is deflated for storage. Activate it, having an air pump in inventory, to inflate and launch.",
"weight": "32420 g",
"volume": "9000 ml",
"symbol": "0",
Expand Down
20 changes: 20 additions & 0 deletions data/json/player_activities.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@
"no_resume": true,
"multi_activity": true
},
{
"id": "ACT_VEHICLE_FOLD",
"type": "activity_type",
"activity_level": "LIGHT_EXERCISE",
"verb": "folding a vehicle",
"based_on": "speed",
"suspendable": false,
"no_resume": true,
"multi_activity": false
},
{
"id": "ACT_VEHICLE_UNFOLD",
"type": "activity_type",
"activity_level": "LIGHT_EXERCISE",
"verb": "unfolding a vehicle",
"based_on": "speed",
"suspendable": false,
"no_resume": true,
"multi_activity": false
},
{
"id": "ACT_VEHICLE_REPAIR",
"type": "activity_type",
Expand Down
4 changes: 4 additions & 0 deletions data/json/vehicleparts/frames.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"durability": 50,
"description": "A light metal framework, designed to fold. Other vehicle components can be mounted on it. If all the frames and components of a vehicle are foldable, the vehicle can be folding into a small package and picked up as a normal item.",
"folded_volume": "2500 ml",
"folding_time": "1 minute",
"unfolding_time": "1 minute",
"breaks_into": [ { "item": "steel_chunk", "count": [ 0, 2 ] }, { "item": "scrap", "count": [ 1, 2 ] } ],
"requirements": {
"install": { "skills": [ [ "mechanics", 2 ] ], "time": "60 m", "using": [ [ "welding_standard", 5 ] ] },
Expand All @@ -32,6 +34,8 @@
"durability": 15,
"description": "A light wooden framework, designed to fold. Other vehicle components can be mounted on it. If all the frames and components of a vehicle are foldable, the vehicle can be folding into a small package and picked up as a normal item.",
"folded_volume": "3750 ml",
"folding_time": "1 minute",
"unfolding_time": "1 minute",
"breaks_into": [ { "item": "splinter", "count": [ 0, 6 ] }, { "item": "nail", "charges": [ 1, 15 ] } ],
"requirements": {
"install": { "skills": [ [ "fabrication", 1 ] ], "time": "30 m", "using": [ [ "vehicle_nail_install", 1 ] ] },
Expand Down
6 changes: 6 additions & 0 deletions data/json/vehicleparts/vehicle_parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@
"item": "inflatable_section",
"location": "structure",
"folded_volume": "750 ml",
"folding_time": "60 seconds",
"unfolding_tools": [ "hand_pump" ],
"unfolding_time": "150 seconds",
"requirements": {
"install": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "vehicle_screw", 1 ], [ "drilling_standard", 1 ] ] },
"removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_screw", 1 ] ] },
Expand All @@ -1201,6 +1204,9 @@
"item": "inflatable_airbag",
"location": "under",
"folded_volume": "750 ml",
"folding_time": "60 seconds",
"unfolding_tools": [ "hand_pump" ],
"unfolding_time": "150 seconds",
"requirements": {
"install": { "skills": [ [ "mechanics", 2 ] ], "time": "60 m", "using": [ [ "vehicle_screw", 1 ], [ "drilling_standard", 1 ] ] },
"removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_screw", 1 ] ] },
Expand Down
2 changes: 2 additions & 0 deletions data/mods/Aftershock/vehicles/vehicle_parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@
"durability": 75,
"symbol": "H",
"folded_volume": "10 L",
"folding_time": "1 minute",
"unfolding_time": "1 minute",
"description": "An ultralight titanium foldable framework. Other vehicle components can be mounted on it, and it can be attached to other frames to increase the vehicle's size.",
"breaks_into": [ { "item": "afs_scrap_titanium", "count": [ 1, 3 ] } ],
"requirements": {
Expand Down
2 changes: 2 additions & 0 deletions data/mods/BlazeIndustries/vehicleparts/vehicle_parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
"durability": 75,
"symbol": "H",
"folded_volume": "10 L",
"folding_time": "1 minute",
"unfolding_time": "1 minute",
"description": "An ultralight titanium foldable framework. Other vehicle components can be mounted on it, and it can be attached to other frames to increase the vehicle's size.",
"breaks_into": [ { "item": "afs_scrap_titanium", "count": [ 1, 3 ] } ],
"requirements": {
Expand Down
11 changes: 5 additions & 6 deletions doc/JSON_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2816,6 +2816,11 @@ Vehicle components when installed on a vehicle.
{ "id": "hotplate", "hotkey": "h" },
{ "id": "pot" }
],
"folded_volume": "750 ml", // volume this vpart takes in folded form
"folding_tools": [ "needle_curved" ], // tool itype_ids required for folding
"folding_time": "100 seconds", // time to fold this part
"unfolding_tools": [ "hand_pump" ], // tool itype_ids required for unfolding
"unfolding_time": "150 seconds", // time to unfold this part
"damage_reduction" : { // Flat reduction of damage, as described below. If not specified, set to zero
"all" : 10,
"physical" : 5
Expand Down Expand Up @@ -3970,12 +3975,6 @@ The contents of use_action fields can either be a string indicating a built-in f
"waterproof": true, // Is the effect waterproof. (Default: false)
"moves": 500 // Number of moves required in the process.
},
"use_action": {
"type": "unfold_vehicle", // Transforms the item into a vehicle.
"vehicle_name": "bicycle", // Vehicle name to create.
"unfold_msg": "You painstakingly unfold the bicycle and make it ready to ride.", // Message to display when transforming.
"moves": 500 // Number of moves required in the process.
},
"use_action" : {
"type" : "consume_drug", // A drug the player can consume.
"activation_message" : "You smoke your crack rocks. Mother would be proud.", // Message, ayup.
Expand Down
Loading

0 comments on commit 1da002c

Please sign in to comment.