From dd8473fdcfb902952757543bac38803ff7a18ac3 Mon Sep 17 00:00:00 2001 From: Alexey Kim Date: Fri, 2 Dec 2022 07:39:09 +0200 Subject: [PATCH 1/3] Use bonus field for funnels instead of size field --- data/json/vehicleparts/vehicle_parts.json | 10 +++++----- data/json/vehicleparts/vp_flags.json | 3 ++- doc/JSON_INFO.md | 7 +++++++ src/veh_type.h | 7 ++++++- src/vehicle.cpp | 4 ++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/data/json/vehicleparts/vehicle_parts.json b/data/json/vehicleparts/vehicle_parts.json index 0c87d4634d9fd..b5758ae6cc069 100644 --- a/data/json/vehicleparts/vehicle_parts.json +++ b/data/json/vehicleparts/vehicle_parts.json @@ -2869,7 +2869,7 @@ "damage_modifier": 5, "durability": 80, "description": "A funnel that will collect rainwater into the tank beneath it.", - "size": 200, + "bonus": 200, "item": "leather_funnel", "location": "on_roof", "folded_volume": "250 ml", @@ -2894,7 +2894,7 @@ "damage_modifier": 5, "durability": 60, "description": "A funnel that will collect rainwater into the tank beneath it.", - "size": 240, + "bonus": 240, "item": "birchbark_funnel", "location": "on_roof", "folded_volume": "250 ml", @@ -2919,7 +2919,7 @@ "damage_modifier": 5, "durability": 80, "description": "A funnel that will collect rainwater into the tank beneath it.", - "size": 200, + "bonus": 200, "item": "makeshift_funnel", "location": "on_roof", "folded_volume": "250 ml", @@ -2943,7 +2943,7 @@ "damage_modifier": 5, "durability": 200, "description": "A funnel that will collect rainwater into the tank beneath it.", - "size": 300, + "bonus": 300, "item": "funnel", "location": "on_roof", "requirements": { @@ -2967,7 +2967,7 @@ "damage_modifier": 30, "durability": 300, "description": "A funnel that will collect rainwater into the tank beneath it.", - "size": 400, + "bonus": 400, "item": "metal_funnel", "location": "on_roof", "requirements": { diff --git a/data/json/vehicleparts/vp_flags.json b/data/json/vehicleparts/vp_flags.json index 70fe7127b7de6..24619f6e9cf82 100644 --- a/data/json/vehicleparts/vp_flags.json +++ b/data/json/vehicleparts/vp_flags.json @@ -368,7 +368,8 @@ }, { "id": "FUNNEL", - "type": "json_flag" + "type": "json_flag", + "//": "When set on vehicle part the, bonus field defines the funnel radius in mm^2 and part collects rain" }, { "id": "HALF_BOARD", diff --git a/doc/JSON_INFO.md b/doc/JSON_INFO.md index c30a3ce98cda9..7511af3ed4516 100644 --- a/doc/JSON_INFO.md +++ b/doc/JSON_INFO.md @@ -2591,6 +2591,13 @@ Vehicle components when installed on a vehicle. // must have one of symbol, symbols, or standard_symbols "looks_like": "small_wheel", // (Optional) hint to tilesets if this part has no tile, // use the looks_like tile. +"bonus": 100, // Function depends on part type: + // seatbelt part is in "str" (non-functional #30239) + // muffler part is % noise reduction + // horn part volume + // light part intensity + // recharger part charging speed in watts + // funnel part water collection area in mm^2 "color": "dark_gray", // Color used when part is working "broken_symbol": "x", // ASCII character displayed when part is broken "broken_color": "light_gray", // Color used when part is broken diff --git a/src/veh_type.h b/src/veh_type.h index fcbb3178133b5..ad0db23054d07 100644 --- a/src/veh_type.h +++ b/src/veh_type.h @@ -473,7 +473,12 @@ class vpart_info * default is half @ref install_moves */ int removal_moves = -1; - /** seatbelt (str), muffler (%), horn (vol), light (intensity), recharging (power) */ + // seatbelt (str, currently non-functional #30239) + // muffler (% noise reduction) + // horn (sound volume) + // light (intensity) + // recharging (charging speed in watts) + // funnel (water collection area in mm^2) int bonus = 0; /** cargo weight modifier (percentage) */ diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 3e576181a1001..cf3297e0cc056 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -7469,8 +7469,8 @@ void vehicle::update_time( const time_point &update_to ) continue; } - double area = std::pow( pt.info().size / units::legacy_volume_factor, 2 ) * M_PI; - int qty = roll_remainder( funnel_charges_per_turn( area, accum_weather.rain_amount ) ); + const double area_in_mm2 = std::pow( pt.info().bonus, 2 ) * M_PI; + const int qty = roll_remainder( funnel_charges_per_turn( area_in_mm2, accum_weather.rain_amount ) ); int c_qty = qty + ( tank->can_reload( water_clean ) ? tank->ammo_remaining() : 0 ); int cost_to_purify = c_qty * item::find_type( itype_pseudo_water_purifier )->charges_to_use(); From 1e665fda40eb6734cb30c765813495ba7849d161 Mon Sep 17 00:00:00 2001 From: Alexey Kim Date: Fri, 2 Dec 2022 07:39:39 +0200 Subject: [PATCH 2/3] Remove "size" from non-CARGO part types --- .../furniture_and_terrain/appliances.json | 4 ---- data/json/vehicleparts/cargo.json | 1 - data/json/vehicleparts/seats.json | 1 - data/json/vehicleparts/tanks.json | 20 ++----------------- data/json/vehicleparts/vehicle_parts.json | 4 ---- .../Aftershock/vehicles/vehicle_parts.json | 3 +-- data/mods/TEST_DATA/vehicle.json | 1 - src/veh_type.cpp | 12 +++++++++-- 8 files changed, 13 insertions(+), 33 deletions(-) diff --git a/data/json/furniture_and_terrain/appliances.json b/data/json/furniture_and_terrain/appliances.json index a14c66666255e..f5f155a12832d 100644 --- a/data/json/furniture_and_terrain/appliances.json +++ b/data/json/furniture_and_terrain/appliances.json @@ -164,7 +164,6 @@ { "item": "power_supply", "prob": 50 }, { "item": "RAM", "count": [ 0, 2 ] } ], - "size": 200, "type": "vehicle_part" }, { @@ -809,7 +808,6 @@ "color": "light_blue", "flags": [ "OBSTACLE", "APPLIANCE", "WASHING_MACHINE", "CARGO", "COVERED", "FLUIDTANK", "ENABLED_DRAINS_EPOWER" ], "description": "An appliance used to do laundry, plugged into a power supply and using internal tanks.", - "size": 540, "copy-from": "washing_machine", "item": "household_washing_machine", "requirements": { "removal": { "time": "6 m" } } @@ -823,7 +821,6 @@ "color": "light_blue", "flags": [ "OBSTACLE", "APPLIANCE", "DISHWASHER", "CARGO", "COVERED", "FLUIDTANK", "ENABLED_DRAINS_EPOWER" ], "description": "An appliance used to clean dishes, plugged into a power supply and using internal tanks.", - "size": 480, "copy-from": "dishwasher", "item": "household_dishwasher", "requirements": { "removal": { "time": "6 m" } } @@ -837,7 +834,6 @@ "color": "light_blue", "flags": [ "OBSTACLE", "APPLIANCE", "AUTOCLAVE", "CARGO", "COVERED", "FLUIDTANK", "ENABLED_DRAINS_EPOWER" ], "description": "An autoclave that can steam its contents at high enough temperatures to completely sterilize them, killing any possible contaminants. This one is plugged into a power grid and running off internal water tanks", - "size": 200, "copy-from": "autoclave", "item": "autoclave", "requirements": { "removal": { "time": "6 m" } } diff --git a/data/json/vehicleparts/cargo.json b/data/json/vehicleparts/cargo.json index d000c8558be2a..fdb262a753295 100644 --- a/data/json/vehicleparts/cargo.json +++ b/data/json/vehicleparts/cargo.json @@ -285,7 +285,6 @@ "broken_color": "dark_gray", "durability": 75, "description": "Spare tire stored on an external carrier rig.", - "size": 60, "damage_modifier": 60, "requirements": { "install": { "skills": [ [ "mechanics", 1 ] ], "time": "60 m", "using": [ [ "vehicle_wrench_2", 1 ] ] }, diff --git a/data/json/vehicleparts/seats.json b/data/json/vehicleparts/seats.json index 643b0cdccdda7..0a27bd6a2d5ea 100644 --- a/data/json/vehicleparts/seats.json +++ b/data/json/vehicleparts/seats.json @@ -225,7 +225,6 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": "vehicle_weld_removal" }, "repair": { "skills": [ [ "mechanics", 2 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 3 ] ] } }, - "size": 25, "symbol": "#", "type": "vehicle_part" }, diff --git a/data/json/vehicleparts/tanks.json b/data/json/vehicleparts/tanks.json index 63464fc52c389..87c0a55835013 100644 --- a/data/json/vehicleparts/tanks.json +++ b/data/json/vehicleparts/tanks.json @@ -9,7 +9,6 @@ "broken_color": "red", "durability": 75, "description": "A storage space for holding liquids. If filled with the appropriate fuel for the vehicle's engine, the engine will automatically draw fuel from the tank when the engine is on. If filled with water, you can access the water from a water faucet, if one is installed in the vehicle. You can also use a rubber hose to siphon liquids out of a tank.", - "size": 2000, "categories": [ "movement" ], "damage_modifier": 80, "folded_volume": "2 L", @@ -36,7 +35,6 @@ "broken_color": "red", "durability": 100, "description": "A storage space for holding liquids. If filled with the appropriate fuel for the vehicle's engine, the engine will automatically draw fuel from the tank when the engine is on. If filled with water, you can access the water from a water faucet, if one is installed in the vehicle. You can also use a rubber hose to siphon liquids out of a tank.", - "size": 10000, "categories": [ "movement" ], "damage_modifier": 80, "breaks_into": [ { "item": "plastic_chunk", "count": [ 10, 40 ] } ], @@ -62,7 +60,6 @@ "broken_color": "red", "durability": 120, "description": "A storage space for holding liquids. If filled with the appropriate fuel for the vehicle's engine, the engine will automatically draw fuel from the tank when the engine is on. If filled with water, you can access the water from a water faucet, if one is installed in the vehicle. You can also use a rubber hose to siphon liquids out of a tank.", - "size": 20000, "categories": [ "movement" ], "damage_modifier": 80, "breaks_into": [ @@ -92,7 +89,6 @@ "broken_color": "red", "durability": 150, "description": "A storage space for holding liquids. If filled with the appropriate fuel for the vehicle's engine, the engine will automatically draw fuel from the tank when the engine is on. If filled with water, you can access the water from a water faucet, if one is installed in the vehicle. You can also use a rubber hose to siphon liquids out of a tank.", - "size": 60000, "categories": [ "movement" ], "damage_modifier": 80, "breaks_into": [ @@ -122,7 +118,6 @@ "broken_color": "red", "durability": 150, "description": "A 60L refrigerated tank. When turned on, it will cool the liquid inside, extending the time until the food spoils.", - "size": 600500, "categories": [ "cargo" ], "damage_modifier": 80, "epower": -40, @@ -164,7 +159,6 @@ "broken_color": "red", "durability": 160, "description": "A storage space for holding liquids, mounted outside the vehicle's walls and armor. If filled with the appropriate fuel for the vehicle's engine, the engine will automatically draw fuel from the tank when the engine is on. If filled with water, you can access the water from a water faucet, if one is installed in the vehicle. You can also use a rubber hose to siphon liquids out of a tank.", - "size": 100000, "categories": [ "movement" ], "damage_modifier": 80, "requirements": { @@ -183,8 +177,7 @@ "looks_like": "afs_roof_external_tank", "item": "30gal_drum", "location": "on_roof", - "extend": { "flags": [ "ON_ROOF" ] }, - "size": 100000 + "extend": { "flags": [ "ON_ROOF" ] } }, { "id": "external_tank", @@ -192,7 +185,6 @@ "type": "vehicle_part", "name": { "str": "external tank (200L)" }, "item": "55gal_drum", - "size": 200000, "damage_reduction": { "all": 30, "stab": 12 } }, { @@ -202,8 +194,7 @@ "name": { "str": "roof-mounted external tank (200L)" }, "item": "55gal_drum", "location": "on_roof", - "extend": { "flags": [ "ON_ROOF" ] }, - "size": 200000 + "extend": { "flags": [ "ON_ROOF" ] } }, { "id": "tank_barrel", @@ -217,7 +208,6 @@ "broken_color": "brown", "durability": 120, "description": "A storage space for holding liquids, mounted inside the cargo or passenger space. If filled with the appropriate fuel for the vehicle's engine, the engine will automatically draw fuel from the tank when the engine is on. If filled with water, you can access the water from a water faucet, if one is installed in the vehicle. You can also use a rubber hose to siphon liquids out of a tank.", - "size": 400, "damage_modifier": 80, "breaks_into": [ { "item": "splinter", "count": [ 3, 8 ] }, @@ -244,7 +234,6 @@ "broken_color": "red", "durability": 160, "description": "A storage space for holding liquids, mounted inside the cargo or passenger space. If filled with the appropriate fuel for the vehicle's engine, the engine will automatically draw fuel from the tank when the engine is on. If filled with water, you can access the water from a water faucet, if one is installed in the vehicle. You can also use a rubber hose to siphon liquids out of a tank.", - "size": 100000, "breaks_into": [ { "item": "steel_lump", "count": [ 2, 2 ] }, { "item": "steel_chunk", "count": [ 1, 2 ] }, @@ -264,7 +253,6 @@ "type": "vehicle_part", "name": { "str": "steel drum (200L)" }, "item": "55gal_drum", - "size": 200000, "breaks_into": [ { "item": "steel_lump", "count": [ 4, 4 ] }, { "item": "steel_chunk", "count": [ 2, 4 ] }, @@ -286,7 +274,6 @@ "looks_like": "tank", "durability": 150, "description": "A small tank for pressurized gasses.", - "size": 60000, "damage_modifier": 80, "breaks_into": [ { "item": "steel_lump", "count": [ 2, 2 ] }, @@ -311,7 +298,6 @@ "broken_color": "red", "durability": 150, "description": "A tank for pressurized gasses.", - "size": 6, "folded_volume": "2 L", "categories": [ "movement" ], "damage_modifier": 80, @@ -343,7 +329,6 @@ "broken_color": "red", "durability": 150, "description": "A large tank for pressurized gasses.", - "size": 60000, "categories": [ "movement" ], "damage_modifier": 80, "breaks_into": [ @@ -374,7 +359,6 @@ "broken_color": "red", "durability": 150, "description": "A large tank for pressurized gasses.", - "size": 241000, "categories": [ "movement" ], "damage_modifier": 80, "breaks_into": [ diff --git a/data/json/vehicleparts/vehicle_parts.json b/data/json/vehicleparts/vehicle_parts.json index b5758ae6cc069..443553d08820a 100644 --- a/data/json/vehicleparts/vehicle_parts.json +++ b/data/json/vehicleparts/vehicle_parts.json @@ -107,7 +107,6 @@ "rolling_resistance": 1.5, "wheel_type": "off-road", "description": "Attach this part to a beast of burden to allow it to pull your vehicle.", - "size": 25, "power": 0, "location": "structure", "requirements": { @@ -682,7 +681,6 @@ "durability": 100, "description": "A small washing machine. With detergent, water, and some electrical power, you could clean a lot of clothes. 'e'xamine the tile with the washing machine to use it.", "epower": -400, - "size": 160, "item": "washing_machine", "location": "center", "requirements": { @@ -716,7 +714,6 @@ "durability": 100, "description": "A small dishwasher. With detergent, water, and some electrical power, you could clean your dishes… or something more useful like a CBM dripping with zombie gore. 'e'xamine the tile with the dishwasher to use it.", "epower": -400, - "size": 160, "item": "dishwasher", "location": "center", "looks_like": "washing_machine", @@ -751,7 +748,6 @@ "durability": 100, "description": "This is an autoclave. It's useful for sterilizing things like CBMs. 'e'xamine the tile with the autoclave to use it.", "epower": -1500, - "size": 11, "item": "vh_autoclave", "location": "center", "requirements": { diff --git a/data/mods/Aftershock/vehicles/vehicle_parts.json b/data/mods/Aftershock/vehicles/vehicle_parts.json index 7d8bd7b7e3ecf..4681a018e99cd 100644 --- a/data/mods/Aftershock/vehicles/vehicle_parts.json +++ b/data/mods/Aftershock/vehicles/vehicle_parts.json @@ -85,8 +85,7 @@ "type": "vehicle_part", "name": { "str": "mounted external tank (200L)" }, "item": "55gal_drum", - "location": "center", - "size": 200000 + "location": "center" }, { "abstract": "afs_lightweight_frame", diff --git a/data/mods/TEST_DATA/vehicle.json b/data/mods/TEST_DATA/vehicle.json index 882ac5b3182fc..df0323aced0a5 100644 --- a/data/mods/TEST_DATA/vehicle.json +++ b/data/mods/TEST_DATA/vehicle.json @@ -328,7 +328,6 @@ "broken_color": "red", "durability": 150, "description": "A storage space for holding liquids. If filled with the appropriate fuel for the vehicle's engine, the engine will automatically draw fuel from the tank when the engine is on. If filled with water, you can access the water from a water faucet, if one is installed in the vehicle. You can also use a rubber hose to siphon liquids out of a tank.", - "size": 60000, "categories": [ "movement" ], "damage_modifier": 80, "breaks_into": [ diff --git a/src/veh_type.cpp b/src/veh_type.cpp index aefaaa9c88750..d43fe4ba6053e 100644 --- a/src/veh_type.cpp +++ b/src/veh_type.cpp @@ -893,8 +893,16 @@ void vpart_info::check() debugmsg( "vehicle part %s has undefined default ammo %s", part.id.c_str(), part.base_item.c_str() ); } - if( part.size < 0_ml ) { - debugmsg( "vehicle part %s has negative size", part.id.c_str() ); + if( part.size != 0_ml ) { + if( part.size < 0_ml ) { + debugmsg( "vehicle part %s has negative size", part.id.c_str() ); + } + if( !part.has_flag( "CARGO" ) ) { + debugmsg( "vehicle part %s is not CARGO and cannot define size", part.id.c_str() ); + } else if( part.has_flag( "FLUIDTANK" ) ) { + debugmsg( "vehicle part %s is FLUIDTANK and cannot define size; it's defined on part's base item", + part.id.c_str() ); + } } if( !item::type_is_defined( part.base_item ) ) { debugmsg( "vehicle part %s uses undefined item %s", part.id.c_str(), part.base_item.c_str() ); From 86f65616801e9f9ca9e2e5bb02d7a322db26dabf Mon Sep 17 00:00:00 2001 From: Alexey Kim Date: Fri, 2 Dec 2022 07:39:54 +0200 Subject: [PATCH 3/3] Use liters/ml for vehicle part "size" definitions --- .../furniture_and_terrain/appliances.json | 12 +++--- data/json/vehicleparts/boards.json | 2 +- data/json/vehicleparts/cargo.json | 16 +++---- data/json/vehicleparts/doors.json | 16 +++---- data/json/vehicleparts/engineering.json | 2 +- data/json/vehicleparts/seats.json | 6 +-- data/json/vehicleparts/utilities.json | 14 +++---- data/json/vehicleparts/vehicle_parts.json | 42 +++++++++---------- data/mods/Aftershock/items/obsolete.json | 10 ++--- .../Aftershock/vehicles/vehicle_parts.json | 4 +- .../blaze_appliances.json | 2 +- .../vehicleparts/blaze_other_parts.json | 12 +++--- .../Magiclysm/vehicles/summoned_vehicles.json | 2 +- data/mods/TEST_DATA/vehicle.json | 2 +- doc/JSON_INFO.md | 5 +-- 15 files changed, 73 insertions(+), 74 deletions(-) diff --git a/data/json/furniture_and_terrain/appliances.json b/data/json/furniture_and_terrain/appliances.json index f5f155a12832d..881594c487cca 100644 --- a/data/json/furniture_and_terrain/appliances.json +++ b/data/json/furniture_and_terrain/appliances.json @@ -14,7 +14,7 @@ "description": "A fridge. When turned on, it will cool the food inside, extending the time until the food spoils.", "//": "Use average consumption, not the max on the appliance rating plate. 30W ~ 260kWh per annum", "epower": -30, - "size": 2000, + "size": "500 L", "item": "fridge", "requirements": { "removal": { "time": "2 m" }, @@ -53,7 +53,7 @@ "durability": 100, "description": "A chest freezer. When turned on, it will freeze and preserve the food inside.", "epower": -35, - "size": 1800, + "size": "450 L", "item": "freezer", "requirements": { "repair": { @@ -108,7 +108,7 @@ { "item": "element", "count": [ 1, 3 ] }, { "item": "cable", "charges": [ 1, 3 ] } ], - "size": 200, + "size": "50 L", "type": "vehicle_part" }, { @@ -851,7 +851,7 @@ "durability": 40, "description": "An appliance for recharging batteries. When turned on, it steadily charges any rechargeable batteries (battery cells, lead-acid batteries, etc) placed directly in the attached storage space.", "bonus": 600, - "size": 800, + "size": "200 L", "item": "foot_locker_recharge_station", "flags": [ "CARGO", "OBSTACLE", "RECHARGE", "COVERED", "APPLIANCE", "CTRL_ELECTRONIC" ], "breaks_into": [ @@ -876,7 +876,7 @@ "durability": 20, "description": "An appliance for recharging batteries. When turned on, it slowly charges any rechargeable batteries (battery cells, lead-acid batteries, etc) placed directly in the attached storage space.", "bonus": 15, - "size": 200, + "size": "50 L", "item": "box_battery_charger", "flags": [ "CARGO", "OBSTACLE", "RECHARGE", "COVERED", "APPLIANCE", "CTRL_ELECTRONIC" ], "breaks_into": [ @@ -905,7 +905,7 @@ "durability": 500, "description": "A military-grade ASRG covered in heavy plating. Provides constant power when plugged in to your power grid.", "epower": 130, - "size": 1800, + "size": "450 L", "item": "compact_ASRG_containment", "requirements": { "repair": { diff --git a/data/json/vehicleparts/boards.json b/data/json/vehicleparts/boards.json index bb5cb98690d3f..45e3bd015fb96 100644 --- a/data/json/vehicleparts/boards.json +++ b/data/json/vehicleparts/boards.json @@ -102,7 +102,7 @@ "broken_color": "light_gray", "durability": 80, "description": "A metal wall with a storage locker. Keeps zombies outside the vehicle and prevents people from seeing through it.", - "size": 250, + "size": "62500 ml", "requirements": { "install": { "skills": [ [ "mechanics", 2 ] ], "time": "60 m", "using": [ [ "welding_standard", 5 ] ] }, "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_weld_removal", 1 ] ] }, diff --git a/data/json/vehicleparts/cargo.json b/data/json/vehicleparts/cargo.json index fdb262a753295..ef8e6cbb1479b 100644 --- a/data/json/vehicleparts/cargo.json +++ b/data/json/vehicleparts/cargo.json @@ -11,7 +11,7 @@ "damage_modifier": 60, "durability": 15, "folded_volume": "1 L", - "size": 60, + "size": "15 L", "item": "bag_canvas", "location": "center", "requirements": { @@ -34,7 +34,7 @@ "broken_color": "brown", "damage_modifier": 60, "durability": 75, - "size": 600, + "size": "150 L", "item": "basket", "location": "center", "requirements": { @@ -75,7 +75,7 @@ "broken_color": "brown", "durability": 75, "description": "Storage space, mounted outside your vehicle's armor and vulnerable to damage.", - "size": 200, + "size": "50 L", "damage_modifier": 60, "requirements": { "install": { "skills": [ [ "mechanics", 1 ] ], "time": "60 m", "using": [ [ "welding_standard", 5 ] ] }, @@ -97,7 +97,7 @@ "broken_color": "brown", "damage_modifier": 60, "durability": 75, - "size": 600, + "size": "150 L", "folded_volume": "6 L", "item": "folding_basket", "location": "center", @@ -126,7 +126,7 @@ "damage_modifier": 60, "durability": 75, "folded_volume": "1500 ml", - "size": 80, + "size": "20 L", "item": "bike_basket", "location": "center", "requirements": { @@ -176,7 +176,7 @@ "broken_color": "brown", "durability": 75, "description": "Storage space, mounted outside your vehicle's armor and vulnerable to damage.", - "size": 60, + "size": "15 L", "damage_modifier": 60, "requirements": { "install": { "skills": [ [ "mechanics", 1 ] ], "time": "60 m", "using": [ [ "welding_standard", 5 ] ] }, @@ -198,7 +198,7 @@ "broken_color": "brown", "damage_modifier": 60, "durability": 100, - "size": 275, + "size": "68750 ml", "item": "frame", "location": "center", "requirements": { @@ -236,7 +236,7 @@ "broken_color": "dark_gray", "durability": 250, "description": "Storage space, mounted outside your vehicle's armor and vulnerable to damage.", - "size": 1000, + "size": "250 L", "breaks_into": [ ], "requirements": { "install": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "welding_standard", 5 ] ] }, diff --git a/data/json/vehicleparts/doors.json b/data/json/vehicleparts/doors.json index ed06a92f622b3..b323ca7009324 100644 --- a/data/json/vehicleparts/doors.json +++ b/data/json/vehicleparts/doors.json @@ -20,7 +20,7 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_wrench_2", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 1 ] ] } }, - "size": 10, + "size": "2500 ml", "symbol": "+", "symbols": { "ne": "+", @@ -101,7 +101,7 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_wrench_2", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 1 ] ] } }, - "size": 10, + "size": "2500 ml", "symbol": "+", "symbols": { "left": "+", "right": "+", "front": "+", "rear": "+" }, "type": "vehicle_part" @@ -138,7 +138,7 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_wrench_2", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 3 ] ] } }, - "size": 10, + "size": "2500 ml", "symbol": "+", "symbols": { "left": "+", "right": "+", "front": "+", "rear": "+" }, "type": "vehicle_part" @@ -175,7 +175,7 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_wrench_2", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 3 ] ] } }, - "size": 10, + "size": "2500 ml", "symbol": "+", "symbols": { "left": "+", "right": "+", "front": "+", "rear": "+" }, "type": "vehicle_part" @@ -237,7 +237,7 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_weld_removal", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 1 ] ] } }, - "size": 150, + "size": "37500 ml", "symbol": "+", "symbols": { "left": "+", "right": "+", "front": "+", "rear": "+" }, "type": "vehicle_part" @@ -263,7 +263,7 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_weld_removal", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 1 ] ] } }, - "size": 150, + "size": "37500 ml", "symbol": "+", "symbols": { "left": "+", "right": "+", "front": "+", "rear": "+" }, "type": "vehicle_part" @@ -289,7 +289,7 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_weld_removal", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 4 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 3 ] ] } }, - "size": 150, + "size": "37500 ml", "symbol": "+", "symbols": { "left": "+", "right": "+", "front": "+", "rear": "+" }, "type": "vehicle_part" @@ -315,7 +315,7 @@ "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_weld_removal", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 4 ] ], "time": "60 m", "using": [ [ "repair_welding_standard", 3 ] ] } }, - "size": 150, + "size": "37500 ml", "symbol": "+", "symbols": { "left": "+", "right": "+", "front": "+", "rear": "+" }, "type": "vehicle_part" diff --git a/data/json/vehicleparts/engineering.json b/data/json/vehicleparts/engineering.json index a37ca6fb16497..746e996de8d0e 100644 --- a/data/json/vehicleparts/engineering.json +++ b/data/json/vehicleparts/engineering.json @@ -103,7 +103,7 @@ "damage_modifier": 200, "durability": 300, "description": "A pair of forklift arms. If it is in your line of sight and within two tiles of another vehicle, you will automatically use it when you want to jack up the other vehicle to change its wheels. To use it to lift a heavy component like an engine that you are installing or removing, the crane must have line of sight to where it is going and it must be within four tiles of it.", - "size": 50, + "size": "12500 ml", "breaks_into": [ { "item": "steel_lump", "count": [ 4, 6 ] }, { "item": "steel_chunk", "count": [ 4, 6 ] }, diff --git a/data/json/vehicleparts/seats.json b/data/json/vehicleparts/seats.json index 0a27bd6a2d5ea..16f778490216c 100644 --- a/data/json/vehicleparts/seats.json +++ b/data/json/vehicleparts/seats.json @@ -49,7 +49,7 @@ "using": [ [ "repair_welding_standard", 1 ], [ "sewing_standard", 8 ] ] } }, - "size": 100, + "size": "25 L", "symbol": "#", "type": "vehicle_part" }, @@ -89,7 +89,7 @@ "using": [ [ "repair_welding_standard", 1 ], [ "sewing_standard", 8 ] ] } }, - "size": 25, + "size": "6250 ml", "symbol": "#", "type": "vehicle_part" }, @@ -129,7 +129,7 @@ "using": [ [ "repair_welding_standard", 1 ], [ "sewing_standard", 8 ] ] } }, - "size": 120, + "size": "30 L", "standard_symbols": false, "symbols": { "vertical": "#", "vertical_left": "#", "vertical_right": "#", "left": "#", "right": "#" }, "type": "vehicle_part" diff --git a/data/json/vehicleparts/utilities.json b/data/json/vehicleparts/utilities.json index 20303626f38a7..ddcafdda5fbb7 100644 --- a/data/json/vehicleparts/utilities.json +++ b/data/json/vehicleparts/utilities.json @@ -31,7 +31,7 @@ "using": [ [ "repair_welding_standard", 1 ], [ "soldering_standard", 10 ] ] } }, - "size": 200, + "size": "50 L", "symbol": "&", "type": "vehicle_part" }, @@ -65,7 +65,7 @@ "using": [ [ "repair_welding_standard", 1 ], [ "soldering_standard", 15 ] ] } }, - "size": 200, + "size": "50 L", "symbol": "&", "type": "vehicle_part" }, @@ -113,7 +113,7 @@ "using": [ [ "repair_welding_standard", 2 ], [ "soldering_standard", 15 ] ] } }, - "size": 200, + "size": "50 L", "symbol": "&", "type": "vehicle_part" }, @@ -154,7 +154,7 @@ "using": [ [ "repair_welding_standard", 1 ], [ "soldering_standard", 5 ] ] } }, - "size": 200, + "size": "50 L", "symbol": "&", "type": "vehicle_part" }, @@ -188,7 +188,7 @@ "using": [ [ "repair_welding_standard", 2 ], [ "soldering_standard", 15 ] ] } }, - "size": 200, + "size": "50 L", "symbol": "&", "type": "vehicle_part" }, @@ -222,7 +222,7 @@ "using": [ [ "repair_welding_standard", 2 ], [ "soldering_standard", 10 ] ] } }, - "size": 200, + "size": "50 L", "symbol": "&", "type": "vehicle_part" }, @@ -288,7 +288,7 @@ } }, "pseudo_tools": [ { "id": "pseudo_veh_oil_press" } ], - "size": 20, + "size": "5 L", "breaks_into": [ { "item": "steel_lump", "count": [ 4, 7 ] }, { "item": "steel_chunk", "count": [ 3, 6 ] }, diff --git a/data/json/vehicleparts/vehicle_parts.json b/data/json/vehicleparts/vehicle_parts.json index 443553d08820a..4ef93083a68c4 100644 --- a/data/json/vehicleparts/vehicle_parts.json +++ b/data/json/vehicleparts/vehicle_parts.json @@ -169,7 +169,7 @@ "damage_modifier": 60, "durability": 95, "description": "A small but comfortable bed.", - "size": 200, + "size": "50 L", "item": "mattress", "comfort": 4, "floor_bedding_warmth": 700, @@ -328,7 +328,7 @@ "broken_color": "light_gray", "durability": 400, "description": "An aisle. A hatch lets you access a cargo space beneath it.", - "size": 350, + "size": "87500 ml", "item": "cargo_aisle", "location": "center", "requirements": { @@ -610,7 +610,7 @@ "description": "A small fridge. When turned on, it will cool the food inside, extending the time until the food spoils.", "//": "Use average consumption, not the max on the appliance rating plate. 30W ~ 260kWh per annum", "epower": -30, - "size": 300, + "size": "75 L", "item": "minifridge", "location": "center", "requirements": { @@ -645,7 +645,7 @@ "damage_modifier": 80, "durability": 100, "epower": -45, - "size": 300, + "size": "75 L", "item": "minifreezer", "location": "center", "requirements": { @@ -775,7 +775,7 @@ "broken_color": "brown", "damage_modifier": 80, "durability": 350, - "size": 800, + "size": "200 L", "//": "200 L storage based on an average sedan trunk being around 400 L, and our cars having two tiles. We should get a taller trunk for SUVs and similar.", "item": "frame", "location": "center", @@ -800,7 +800,7 @@ "broken_color": "brown", "damage_modifier": 60, "durability": 50, - "size": 300, + "size": "75 L", "item": "frame_wood_light", "location": "center", "flags": [ "CARGO", "BOARDABLE", "COVERED" ], @@ -823,7 +823,7 @@ "broken_color": "brown", "damage_modifier": 60, "durability": 70, - "size": 150, + "size": "37500 ml", "item": "frame_wood", "location": "center", "requirements": { @@ -848,7 +848,7 @@ "damage_modifier": 60, "durability": 65, "folded_volume": "1500 ml", - "size": 120, + "size": "30 L", "item": "foldwoodframe", "location": "center", "requirements": { @@ -872,7 +872,7 @@ "broken_color": "light_gray", "damage_modifier": 60, "durability": 145, - "size": 80, + "size": "20 L", "item": "v_table", "location": "center", "requirements": { @@ -901,7 +901,7 @@ "broken_color": "light_gray", "damage_modifier": 60, "durability": 145, - "size": 80, + "size": "20 L", "item": "w_table", "location": "center", "requirements": { @@ -930,7 +930,7 @@ "broken_color": "light_gray", "damage_modifier": 30, "durability": 70, - "size": 80, + "size": "20 L", "item": "foldwoodframe", "folded_volume": "12500 ml", "location": "center", @@ -959,7 +959,7 @@ "broken_color": "light_gray", "damage_modifier": 60, "durability": 300, - "size": 120, + "size": "30 L", "item": "workbench", "location": "center", "requirements": { @@ -1005,7 +1005,7 @@ { "item": "e_scrap", "count": [ 0, 2 ] }, { "item": "scrap", "count": [ 1, 3 ] } ], - "size": 118, + "size": "29500 ml", "workbench": { "multiplier": 1.2, "mass": 300000, "volume": "29L" }, "damage_reduction": { "all": 29 } }, @@ -1137,7 +1137,7 @@ "looks_like": "inflatable_airbag", "categories": [ "hull" ], "color": "green", - "size": 60, + "size": "15 L", "broken_symbol": "#", "broken_color": "light_gray", "durability": 50, @@ -2249,7 +2249,7 @@ "broken_symbol": "#", "broken_color": "dark_gray", "durability": 250, - "size": 2000, + "size": "500 L", "//": "Based roughly on a quarter of a 2m x 1.2m pickup truck bed, assuming a reasonable amount of piling up (about 80cm, ie. sticking up around 20cm over the sides if really stacked). Could definitely use more subtypes.", "item": "cargo_rack", "location": "center", @@ -2278,7 +2278,7 @@ "broken_color": "dark_gray", "durability": 250, "description": "A cargo space for carrying livestock. 'e'xamine it to capture an animal next to you, or to release the animal currently contained. When selecting an animal to capture, choose its tile relative to you, not the part.", - "size": 800, + "size": "200 L", "item": "livestock_carrier", "location": "center", "requirements": { @@ -2302,7 +2302,7 @@ "name": { "str": "animal compartment" }, "durability": 125, "description": "A large locker for transporting smaller animals. 'e'xamine it to capture an animal next to you, or to release the animal currently contained. When selecting an animal to capture, choose its tile relative to you, not the part.", - "size": 200, + "size": "50 L", "item": "animal_locker", "flags": [ "CARGO", "COVERED", "CAPTURE_MONSTER_VEH", "OBSTACLE" ], "breaks_into": [ { "item": "steel_chunk", "count": [ 1, 2 ] }, { "item": "scrap", "count": [ 3, 4 ] } ] @@ -2987,7 +2987,7 @@ "durability": 100, "description": "A scoop. Use the vehicle controls to turn it on or off. When turned on, it will scoop up loose items that it travels over until it's full.", "epower": -10, - "size": 400, + "size": "100 L", "damage_modifier": 10, "item": "v_scoop_item", "requirements": { @@ -3063,7 +3063,7 @@ "description": "A seed drill. Use the vehicle controls to turn it on or off. You can load it with seeds by examining it. When turned on, it will drop seeds as the vehicle moves, or plant them in furrowed dirt. It should be placed behind any plows on the vehicle, and any wheels should be placed so they won't run over the plants.", "item": "v_planter_item", "location": "structure", - "size": 50, + "size": "12500 ml", "power": -700, "requirements": { "install": { "skills": [ [ "mechanics", 4 ] ], "time": "60 m", "using": [ [ "welding_standard", 5 ] ] }, @@ -3089,7 +3089,7 @@ "item": "v_planter_item_advanced", "location": "structure", "power": -700, - "size": 70, + "size": "17500 ml", "requirements": { "install": { "skills": [ [ "mechanics", 4 ] ], "time": "60 m", "using": [ [ "welding_standard", 5 ] ] }, "removal": { "skills": [ [ "mechanics", 2 ] ], "time": "30 m", "using": [ [ "vehicle_weld_removal", 1 ] ] }, @@ -3146,7 +3146,7 @@ "description": "An automatic reaper. Use the vehicle controls to turn it on or off. When on, it will cut down plants and store them in the vehicle's cargo. It should be placed in front of any plows in the vehicle for efficient operation. It has internal cargo space for collecting the harvest.", "item": "v_reaper_item_advanced", "location": "under", - "size": 350, + "size": "87500 ml", "requirements": { "install": { "skills": [ [ "mechanics", 5 ] ], "time": "60 m", "using": [ [ "welding_standard", 5 ] ] }, "removal": { "skills": [ [ "mechanics", 3 ] ], "time": "30 m", "using": [ [ "vehicle_weld_removal", 1 ] ] }, diff --git a/data/mods/Aftershock/items/obsolete.json b/data/mods/Aftershock/items/obsolete.json index d1e3b5a999f1d..85951e3d54dfe 100644 --- a/data/mods/Aftershock/items/obsolete.json +++ b/data/mods/Aftershock/items/obsolete.json @@ -58,7 +58,7 @@ "durability": 400, "description": "A medium-sized household refrigerator, converted to utilize vehicle power. When turned on, food inside will be cooled, extending the time it has before spoiling.", "epower": -100, - "size": 1200, + "size": "300 L", "item": "afs_fridge" }, { @@ -74,7 +74,7 @@ "durability": 400, "description": "A household fridge, converted to run at a much lower temperature and on vehicle power. When turned on, food inside will be frozen, completely stopping it from spoiling.", "epower": -120, - "size": 1200, + "size": "300 L", "item": "afs_freezer" }, { @@ -90,7 +90,7 @@ "damage_modifier": 10, "durability": 200, "description": "A welding and metalworking station, powered by the vehicle's battery. 'e'xamine the forge rig to utilize its welder or soldering iron; you'll still need glare protection.", - "size": 200, + "size": "50 L", "item": "afs_metal_rig", "location": "center", "requirements": { @@ -122,7 +122,7 @@ "damage_modifier": 10, "durability": 125, "description": "An all-in-one kitchen unit and chemistry lab. 'e'xamine it to use its hotplate to heat up food or drinks.", - "size": 200, + "size": "50 L", "item": "afs_cooking_rig", "location": "center", "requirements": { @@ -161,7 +161,7 @@ "damage_modifier": 10, "durability": 200, "description": "An all-in-one kitchen unit, chemistry lab, and food preparation area. 'e'xamine it to use its hotplate to heat up food or drinks.", - "size": 200, + "size": "50 L", "item": "afs_kitchen_rig", "location": "center", "requirements": { diff --git a/data/mods/Aftershock/vehicles/vehicle_parts.json b/data/mods/Aftershock/vehicles/vehicle_parts.json index 4681a018e99cd..0ba5551e12046 100644 --- a/data/mods/Aftershock/vehicles/vehicle_parts.json +++ b/data/mods/Aftershock/vehicles/vehicle_parts.json @@ -295,7 +295,7 @@ "broken_color": "dark_gray", "durability": 250, "description": "A cargo space for carrying robots. 'e'xamine it to capture a robot next to you, or to release the robot currently contained. When selecting a robot to capture, choose its tile relative to you, not the part.", - "size": 800, + "size": "200 L", "item": "robot_carrier", "location": "center", "requirements": { @@ -323,7 +323,7 @@ "damage_modifier": 10, "durability": 200, "description": "A gantry for supporting an exosuit upright during maintenance and repair. Includes the specialized tools needed for complex repairs and will also charge the suit's power when active.", - "size": 800, + "size": "200 L", "bonus": 600, "item": "afs_metal_rig", "location": "center", diff --git a/data/mods/BlazeIndustries/furniture_and_terrain/blaze_appliances.json b/data/mods/BlazeIndustries/furniture_and_terrain/blaze_appliances.json index d903f01c9fe21..ac3bae0a70d66 100644 --- a/data/mods/BlazeIndustries/furniture_and_terrain/blaze_appliances.json +++ b/data/mods/BlazeIndustries/furniture_and_terrain/blaze_appliances.json @@ -38,7 +38,7 @@ "durability": 200, "description": "A medium-sized household washing machine, converted to utilize vehicle power. When turned on, filthy items will be laundered.", "epower": -400, - "size": 540, + "size": "135 L", "item": "household_washing_machine" } ] diff --git a/data/mods/BlazeIndustries/vehicleparts/blaze_other_parts.json b/data/mods/BlazeIndustries/vehicleparts/blaze_other_parts.json index 59179316d23fb..84099bd691ed5 100644 --- a/data/mods/BlazeIndustries/vehicleparts/blaze_other_parts.json +++ b/data/mods/BlazeIndustries/vehicleparts/blaze_other_parts.json @@ -10,7 +10,7 @@ "broken_symbol": "#", "broken_color": "dark_gray", "durability": 250, - "size": 8000, + "size": "2000 L", "item": "vehicle_shelving", "location": "center", "requirements": { @@ -39,7 +39,7 @@ "durability": 400, "description": "A medium-sized household refrigerator, converted to utilize vehicle power. When turned on, food inside will be cooled, extending the time it has before spoiling.", "epower": -100, - "size": 1200, + "size": "300 L", "item": "afs_fridge" }, { @@ -55,7 +55,7 @@ "durability": 400, "description": "A household fridge, converted to run at a much lower temperature and on vehicle power. When turned on, food inside will be frozen, completely stopping it from spoiling.", "epower": -120, - "size": 1200, + "size": "300 L", "item": "afs_freezer" }, { @@ -71,7 +71,7 @@ "damage_modifier": 10, "durability": 200, "description": "A welding and metalworking station, powered by the vehicle's battery. 'e'xamine the forge rig to utilize its welder or soldering iron; you'll still need glare protection.", - "size": 200, + "size": "50 L", "item": "afs_metal_rig", "location": "center", "requirements": { @@ -103,7 +103,7 @@ "damage_modifier": 10, "durability": 125, "description": "An all-in-one kitchen unit and chemistry lab. 'e'xamine it to use its hotplate to heat up food or drinks.", - "size": 200, + "size": "50 L", "item": "afs_cooking_rig", "location": "center", "requirements": { @@ -143,7 +143,7 @@ "damage_modifier": 10, "durability": 200, "description": "An all-in-one kitchen unit, chemistry lab, and food preparation area. 'e'xamine it to use its hotplate to heat up food or drinks.", - "size": 200, + "size": "50 L", "item": "afs_kitchen_rig", "location": "center", "requirements": { diff --git a/data/mods/Magiclysm/vehicles/summoned_vehicles.json b/data/mods/Magiclysm/vehicles/summoned_vehicles.json index b57193dc51332..9ce4b83492225 100644 --- a/data/mods/Magiclysm/vehicles/summoned_vehicles.json +++ b/data/mods/Magiclysm/vehicles/summoned_vehicles.json @@ -58,7 +58,7 @@ "wheel_type": "standard", "contact_area": 20, "description": "A shape of pure mana that can float and carry items.", - "size": 150, + "size": "37500 ml", "power": 200, "location": "structure", "//": "Flagged OBSOLETE to hide from install UI. This should not be interactable nor visible as a vehicle part, its part of a summoned magic 'vehicle'", diff --git a/data/mods/TEST_DATA/vehicle.json b/data/mods/TEST_DATA/vehicle.json index df0323aced0a5..16095b29bfc4a 100644 --- a/data/mods/TEST_DATA/vehicle.json +++ b/data/mods/TEST_DATA/vehicle.json @@ -362,7 +362,7 @@ "description": "A fridge. When turned on, it will cool the food inside, extending the time until the food spoils.", "//": "Use average consumption, not the max on the appliance rating plate. 30W ~ 260kWh per annum", "epower": -30, - "size": 2000, + "size": "500 L", "item": "fridge_test", "requirements": { "install": { "skills": [ [ "mechanics", 3 ] ], "time": "60 m", "using": [ [ "vehicle_wrench_2", 1 ] ] }, diff --git a/doc/JSON_INFO.md b/doc/JSON_INFO.md index 7511af3ed4516..4ccd5880bca4e 100644 --- a/doc/JSON_INFO.md +++ b/doc/JSON_INFO.md @@ -2688,10 +2688,9 @@ Otherwise, variants can use any of the following suffices: ``` Unless specified as optional, the following fields are mandatory for parts with appropriate flag and are ignored otherwise. -#### The following optional fields are specific to CARGO or FLUIDTANK parts. +#### The following optional fields are specific to CARGO parts. ```c++ -"size": 2000, // with flag "FLUIDTANK" this is capacity in mLs, - // else with "CARGO" flag the capacity in 250mL volume units. +"size": "400 L", // for parts with "CARGO" flag the capacity in liters "cargo_weight_modifier": 33, // (Optional, default = 100) Multiplies cargo weight by this percentage. ```