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

Max_volume for terrain and furniture can be defined with strings #35823

Merged
merged 5 commits into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions data/json/furniture_and_terrain/furniture-appliances.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"move_cost_mod": -1,
"coverage": 55,
"required_str": -1,
"max_volume": 4000,
"deconstruct": {
"items": [
{ "item": "pipe", "count": 1 },
Expand Down Expand Up @@ -267,7 +266,6 @@
"move_cost_mod": -1,
"coverage": 60,
"required_str": -1,
"max_volume": 4000,
"flags": [ "CONTAINER", "PLACE_ITEM", "FIRE_CONTAINER", "SUPPRESS_SMOKE", "BLOCKSDOOR" ],
"examine_action": "fireplace",
"deconstruct": {
Expand Down
3 changes: 0 additions & 3 deletions data/json/furniture_and_terrain/furniture-fireplaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"flags": [ "PLACE_ITEM", "TRANSPARENT", "FIRE_CONTAINER", "EASY_DECONSTRUCT" ],
"deployed_item": "brazier",
"examine_action": "fireplace",
"max_volume": 4000,
"bash": {
"str_min": 8,
"str_max": 30,
Expand All @@ -81,7 +80,6 @@
"flags": [ "PLACE_ITEM", "TRANSPARENT", "FIRE_CONTAINER", "EASY_DECONSTRUCT" ],
"deployed_item": "55gal_firebarrel",
"examine_action": "fireplace",
"max_volume": 4000,
"bash": {
"str_min": 8,
"str_max": 30,
Expand All @@ -108,7 +106,6 @@
"flags": [ "PLACE_ITEM", "TRANSPARENT", "FIRE_CONTAINER", "EASY_DECONSTRUCT" ],
"deployed_item": "30gal_firebarrel",
"examine_action": "fireplace",
"max_volume": 4000,
"bash": {
"str_min": 8,
"str_max": 30,
Expand Down
1 change: 0 additions & 1 deletion data/json/furniture_and_terrain/furniture-flora.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@
"floor_bedding_warmth": 50,
"required_str": -1,
"deconstruct": { "items": [ { "item": "withered", "count": 50 } ] },
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "SHORT", "EASY_DECONSTRUCT" ],
"bash": {
"str_min": 2,
Expand Down
6 changes: 0 additions & 6 deletions data/json/furniture_and_terrain/furniture-medical.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
{ "item": "cable", "charges": [ 1, 2 ], "prob": 50 }
]
},
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "BLOCKSDOOR", "MOUNTABLE" ],
"bash": {
"str_min": 10,
Expand All @@ -91,7 +90,6 @@
"move_cost_mod": 3,
"coverage": 60,
"required_str": 16,
"max_volume": 4000,
"looks_like": "f_washer",
"flags": [ "CONTAINER", "PLACE_ITEM", "BLOCKSDOOR", "FLAT_SURF" ],
"deconstruct": {
Expand Down Expand Up @@ -136,7 +134,6 @@
"move_cost_mod": 3,
"coverage": 60,
"required_str": 16,
"max_volume": 4000,
"looks_like": "f_washer",
"flags": [ "CONTAINER", "PLACE_ITEM", "BLOCKSDOOR", "FLAT_SURF", "SEALED" ],
"deconstruct": {
Expand Down Expand Up @@ -313,7 +310,6 @@
"move_cost_mod": 3,
"coverage": 45,
"required_str": 10,
"max_volume": 4000,
"looks_like": "f_glass_fridge",
"flags": [ "CONTAINER", "PLACE_ITEM", "BLOCKSDOOR", "FLAT_SURF" ],
"deconstruct": {
Expand Down Expand Up @@ -501,7 +497,6 @@
"move_cost_mod": -1,
"coverage": 45,
"required_str": -1,
"max_volume": 4000,
"looks_like": "t_machinery_heavy",
"flags": [ "TRANSPARENT" ],
"deconstruct": {
Expand Down Expand Up @@ -543,7 +538,6 @@
"move_cost_mod": -1,
"coverage": 65,
"required_str": -1,
"max_volume": 4000,
"looks_like": "t_machinery_heavy",
"deconstruct": {
"items": [
Expand Down
1 change: 0 additions & 1 deletion data/json/furniture_and_terrain/furniture-plumbing.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
"move_cost_mod": -1,
"coverage": 55,
"required_str": -1,
"max_volume": 4000,
"flags": [ "CONTAINER", "PLACE_ITEM", "LIQUIDCONT", "NOITEM", "SEALED" ],
"examine_action": "keg",
"keg_capacity": 240,
Expand Down
1 change: 0 additions & 1 deletion data/json/furniture_and_terrain/furniture-recreation.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"move_cost_mod": 2,
"coverage": 50,
"required_str": -1,
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE", "ORGANIC", "MOUNTABLE", "SHORT", "FLAT_SURF" ],
"deconstruct": {
"items": [
Expand Down
6 changes: 0 additions & 6 deletions data/json/furniture_and_terrain/furniture-seats.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"bonus_fire_warmth_feet": 1000,
"required_str": 8,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "SHORT", "CAN_SIT" ],
"max_volume": 4000,
"deconstruct": { "items": [ { "item": "2x4", "count": 4 }, { "item": "nail", "charges": [ 6, 10 ] } ] },
"bash": {
"str_min": 12,
Expand All @@ -39,7 +38,6 @@
"deconstruct": {
"items": [ { "item": "2x4", "count": 10 }, { "item": "rag", "count": [ 30, 33 ] }, { "item": "nail", "charges": [ 6, 8 ] } ]
},
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "CAN_SIT" ],
"bash": {
"str_min": 12,
Expand Down Expand Up @@ -70,7 +68,6 @@
"bonus_fire_warmth_feet": 1000,
"required_str": 7,
"deconstruct": { "items": [ { "item": "pipe", "count": 10 }, { "item": "rag", "count": [ 30, 33 ] }, { "item": "rope_6" } ] },
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "CAN_SIT" ],
"bash": {
"str_min": 12,
Expand Down Expand Up @@ -100,7 +97,6 @@
"required_str": 4,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "CAN_SIT" ],
"deconstruct": { "items": [ { "item": "2x4", "count": 4 }, { "item": "nail", "charges": [ 6, 8 ] } ] },
"max_volume": 4000,
"bash": {
"str_min": 6,
"str_max": 20,
Expand All @@ -124,7 +120,6 @@
"deconstruct": {
"items": [ { "item": "2x4", "count": 12 }, { "item": "rag", "count": [ 30, 33 ] }, { "item": "nail", "charges": [ 8, 10 ] } ]
},
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "BLOCKSDOOR", "MOUNTABLE", "CAN_SIT" ],
"bash": {
"str_min": 12,
Expand Down Expand Up @@ -195,7 +190,6 @@
"bonus_fire_warmth_feet": 1000,
"required_str": 5,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "SHORT", "CAN_SIT" ],
"max_volume": 4000,
"deconstruct": { "items": [ { "item": "2x4", "count": 4 }, { "item": "nail", "charges": [ 6, 10 ] } ] },
"bash": {
"str_min": 12,
Expand Down
4 changes: 0 additions & 4 deletions data/json/furniture_and_terrain/furniture-sleep.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"floor_bedding_warmth": 1000,
"required_str": -1,
"deconstruct": { "items": [ { "item": "mattress", "count": 1 } ], "furn_set": "f_bed_frame" },
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "PLACE_ITEM", "ORGANIC", "MOUNTABLE", "CAN_SIT", "EASY_DECONSTRUCT" ],
"bash": {
"str_min": 12,
Expand All @@ -39,7 +38,6 @@
"coverage": 40,
"required_str": 5,
"deconstruct": { "items": [ { "item": "2x4", "count": 12 }, { "item": "nail", "charges": [ 8, 10 ] } ] },
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "PLACE_ITEM", "ORGANIC", "MOUNTABLE", "CAN_SIT" ],
"bash": {
"str_min": 10,
Expand Down Expand Up @@ -116,7 +114,6 @@
"deconstruct": {
"items": [ { "item": "2x4", "count": 4 }, { "item": "rag", "count": [ 30, 35 ] }, { "item": "nail", "charges": [ 4, 6 ] } ]
},
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "SHORT" ],
"bash": {
"str_min": 8,
Expand Down Expand Up @@ -144,7 +141,6 @@
"floor_bedding_warmth": 200,
"required_str": -1,
"deconstruct": { "items": [ { "item": "stick", "count": 4 }, { "item": "straw_pile", "count": [ 7, 8 ] } ] },
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "SHORT", "EASY_DECONSTRUCT" ],
"bash": {
"str_min": 6,
Expand Down
3 changes: 0 additions & 3 deletions data/json/furniture_and_terrain/furniture-storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
"deconstruct": {
"items": [ { "item": "2x4", "count": 4 }, { "item": "wood_panel", "count": [ 1, 2 ] }, { "item": "nail", "charges": [ 6, 10 ] } ]
},
"max_volume": 4000,
"bash": {
"str_min": 12,
"str_max": 40,
Expand All @@ -180,7 +179,6 @@
"deconstruct": {
"items": [ { "item": "2x4", "count": 4 }, { "item": "wood_panel", "count": [ 0, 1 ] }, { "item": "nail", "charges": [ 6, 10 ] } ]
},
"max_volume": 4000,
"bash": {
"str_min": 12,
"str_max": 40,
Expand Down Expand Up @@ -228,7 +226,6 @@
"deconstruct": {
"items": [ { "item": "2x4", "count": 3 }, { "item": "wood_panel", "count": 1 }, { "item": "nail", "charges": [ 6, 8 ] } ]
},
"max_volume": 4000,
"bash": {
"str_min": 8,
"str_max": 30,
Expand Down
5 changes: 0 additions & 5 deletions data/json/furniture_and_terrain/furniture-surfaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"deconstruct": {
"items": [ { "item": "2x4", "count": 4 }, { "item": "wood_panel", "count": 1 }, { "item": "nail", "charges": [ 6, 10 ] } ]
},
"max_volume": 4000,
"bash": {
"str_min": 12,
"str_max": 40,
Expand Down Expand Up @@ -81,7 +80,6 @@
"deconstruct": {
"items": [ { "item": "2x4", "count": 8 }, { "item": "wood_panel", "count": 1 }, { "item": "nail", "charges": [ 16, 24 ] } ]
},
"max_volume": 4000,
"bash": {
"str_min": 12,
"str_max": 40,
Expand Down Expand Up @@ -115,7 +113,6 @@
{ "item": "sheet_metal_small", "count": [ 2, 4 ] }
]
},
"max_volume": 4000,
"bash": {
"str_min": 35,
"str_max": 80,
Expand Down Expand Up @@ -236,7 +233,6 @@
"move_cost_mod": 2,
"coverage": 50,
"required_str": 5,
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE", "ORGANIC", "MOUNTABLE", "SHORT", "FLAT_SURF" ],
"deconstruct": {
"items": [ { "item": "2x4", "count": 4 }, { "item": "wood_panel", "count": 1 }, { "item": "nail", "charges": [ 6, 8 ] } ]
Expand Down Expand Up @@ -267,7 +263,6 @@
"move_cost_mod": 2,
"coverage": 50,
"required_str": 5,
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE", "ORGANIC", "MOUNTABLE", "SHORT", "FLAT_SURF" ],
"deconstruct": {
"items": [ { "item": "2x4", "count": 2 }, { "item": "wood_panel", "count": 1 }, { "item": "nail", "charges": [ 6, 8 ] } ]
Expand Down
3 changes: 0 additions & 3 deletions data/json/furniture_and_terrain/furniture-terrains.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"move_cost_mod": 0,
"comfort": 2,
"floor_bedding_warmth": -1500,
"max_volume": 4000,
"required_str": 7,
"bash": {
"str_min": 8,
Expand Down Expand Up @@ -37,7 +36,6 @@
"floor_bedding_warmth": 1000,
"required_str": -1,
"deconstruct": { "items": [ { "item": "pillow", "count": 19 }, { "item": "blanket", "count": 3 } ] },
"max_volume": 4000,
"flags": [
"TRANSPARENT",
"FLAMMABLE_ASH",
Expand Down Expand Up @@ -77,7 +75,6 @@
{ "item": "pillow", "count": 4 }
]
},
"max_volume": 4000,
"flags": [
"TRANSPARENT",
"FLAMMABLE_ASH",
Expand Down
6 changes: 2 additions & 4 deletions src/mapdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,7 @@ void ter_t::load( JsonObject &jo, const std::string &src )
mandatory( jo, was_loaded, "name", name_ );
mandatory( jo, was_loaded, "move_cost", movecost );
optional( jo, was_loaded, "coverage", coverage );
optional( jo, was_loaded, "max_volume", max_volume, legacy_volume_reader,
DEFAULT_MAX_VOLUME_IN_SQUARE );
assign( jo, "max_volume", max_volume, src == "dda" );
optional( jo, was_loaded, "trap", trap_id_str );

optional( jo, was_loaded, "light_emitted", light_emitted );
Expand Down Expand Up @@ -1254,8 +1253,7 @@ void furn_t::load( JsonObject &jo, const std::string &src )
optional( jo, was_loaded, "bonus_fire_warmth_feet", bonus_fire_warmth_feet, 300 );
optional( jo, was_loaded, "keg_capacity", keg_capacity, legacy_volume_reader, 0_ml );
mandatory( jo, was_loaded, "required_str", move_str_req );
optional( jo, was_loaded, "max_volume", max_volume, legacy_volume_reader,
DEFAULT_MAX_VOLUME_IN_SQUARE );
assign( jo, "max_volume", max_volume, src == "dda" );
optional( jo, was_loaded, "crafting_pseudo_item", crafting_pseudo_item, "" );
optional( jo, was_loaded, "deployed_item", deployed_item );
load_symbol( jo );
Expand Down
3 changes: 2 additions & 1 deletion src/mapdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ struct map_data_common_t {
int light_emitted;
int movecost; // The amount of movement points required to pass this terrain by default.
int coverage; // The coverage percentage of a furniture piece of terrain. <30 won't cover from sight.
units::volume max_volume; // Maximal volume of items that can be stored in/on this furniture
// Maximal volume of items that can be stored in/on this furniture
units::volume max_volume = 1000_liter;

translation description;

Expand Down