Skip to content

Commit

Permalink
Vegan profession item substitutions (CleverRaven#74649)
Browse files Browse the repository at this point in the history
* Remove Pocket from wool kilt, add utilikilt

Update legs_clothes.json

* Vegan item substitutions

* Add material to espadrilles

* Fix duplicate definitions

* Update duplicate definition error message

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update data/json/items/armor/legs_clothes.json

* Update data/json/items/armor/legs_clothes.json

Co-authored-by: DSeyka <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: DSeyka <[email protected]>
  • Loading branch information
3 people authored Jun 26, 2024
1 parent 8ed7912 commit ed0dba4
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 14 deletions.
1 change: 1 addition & 0 deletions data/json/items/armor/boots.json
Original file line number Diff line number Diff line change
Expand Up @@ -3395,6 +3395,7 @@
"price": "20 USD",
"price_postapoc": "10 USD",
"symbol": "[",
"material": "cotton",
"volume": "600 ml",
"weight": "500 g",
"flags": [ "VARSIZE" ],
Expand Down
23 changes: 22 additions & 1 deletion data/json/items/armor/legs_clothes.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@
"id": "kilt",
"type": "ARMOR",
"name": { "str": "kilt" },
"description": "No true Scotsman would leave home without his kilt.",
"description": "No true Scotsman would leave home without his kilt. Kilts lack pockets and thus a belt and sporran are necessary accessories.",
"weight": "500 g",
"volume": "1500 ml",
"price": "65 USD",
Expand All @@ -540,6 +540,27 @@
"symbol": "[",
"looks_like": "skirt",
"color": "dark_gray",
"warmth": 20,
"material_thickness": 0.3,
"flags": [ "VARSIZE" ],
"armor": [
{ "coverage": 100, "covers": [ "leg_l", "leg_r" ], "specifically_covers": [ "leg_hip_l", "leg_hip_r" ] },
{ "coverage": 95, "covers": [ "leg_l", "leg_r" ], "specifically_covers": [ "leg_upper_l", "leg_upper_r" ] }
]
},
{
"id": "kilt_utility",
"type": "ARMOR",
"name": { "str": "utility kilt" },
"description": "Common in America, the utility kilt takes the traditional woolen kilt and constructs it out of cotton canvas and then adds a pocket that would never be on a traditional kilt.",
"weight": "500 g",
"volume": "1500 ml",
"price": "35 USD",
"price_postapoc": "50 cent",
"material": [ "cotton" ],
"symbol": "[",
"looks_like": "kilt",
"color": "brown_yellow",
"pocket_data": [
{
"pocket_type": "CONTAINER",
Expand Down
74 changes: 62 additions & 12 deletions data/json/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -450,21 +450,67 @@
},
{
"type": "profession_item_substitutions",
"trait": "WOOLALLERGY",
"item": "blazer",
"sub": [
{ "item": "blazer", "new": [ "jacket_leather_red" ] },
{ "item": "hat_hunting", "new": [ "hat_cotton" ] },
{ "item": "hat_newsboy", "new": [ "hat_cotton" ] },
{ "item": "peacoat", "new": [ "jacket_flannel" ] },
{ "item": "sweater", "new": [ "sweatshirt" ] },
{ "item": "boots_winter", "new": [ "boots_fur" ] },
{ "item": "cloak_wool", "new": [ "cloak_leather" ] },
{ "item": "gloves_wool", "new": [ "gloves_leather" ] },
{ "item": "socks_wool", "new": [ "socks" ] },
{ "item": "kilt", "new": [ "kilt_leather" ] },
{ "item": "mask_ski", "new": [ "balclava" ] }
{ "present": [ "WOOLALLERGY" ], "new": [ "jacket_leather_red" ] },
{ "present": [ "VEGAN" ], "new": [ "jacket_light" ] }
]
},
{
"type": "profession_item_substitutions",
"item": "hat_hunting",
"sub": [ { "present": [ "WOOLALLERGY", "VEGAN" ], "new": [ "hat_cotton" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "hat_newsboy",
"sub": [ { "present": [ "WOOLALLERGY", "VEGAN" ], "new": [ "hat_cotton" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "peacoat",
"sub": [ { "present": [ "WOOLALLERGY", "VEGAN" ], "new": [ "jacket_flannel" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "sweater",
"sub": [ { "present": [ "WOOLALLERGY", "VEGAN" ], "new": [ "sweatshirt" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "boots_winter",
"sub": [ { "present": [ "WOOLALLERGY" ], "new": [ "boots_fur" ] }, { "present": [ "VEGAN" ], "new": [ "boots_faux_fur" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "cloak_wool",
"sub": [ { "present": [ "WOOLALLERGY" ], "new": [ "cloak_leather" ] }, { "present": [ "VEGAN" ], "new": [ "cloak" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "gloves_wool",
"sub": [ { "present": [ "WOOLALLERGY" ], "new": [ "gloves_leather" ] }, { "present": [ "VEGAN" ], "new": [ "gloves_light" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "socks_wool",
"sub": [ { "present": [ "WOOLALLERGY", "VEGAN" ], "new": [ "socks" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "mask_ski",
"sub": [ { "present": [ "WOOLALLERGY", "VEGAN" ], "new": [ "balclava" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "kilt",
"sub": [ { "present": [ "WOOLALLERGY" ], "new": [ "kilt_leather" ] }, { "present": [ "VEGAN" ], "new": [ "kilt_utility" ] } ]
},
{
"type": "profession_item_substitutions",
"trait": "VEGAN",
"sub": [ { "item": "dress_shoes", "new": [ "espadrilles" ] } ]
},
{
"type": "profession_item_substitutions",
"item": "sunglasses",
Expand Down Expand Up @@ -529,6 +575,7 @@
{ "present": [ "ANTIWHEAT", "ANTIJUNK", "MEATARIAN" ], "new": [ "fried_spam", "fork" ] },
{ "present": [ "LACTOSE" ], "absent": [ "ANTIWHEAT", "VEGETARIAN" ], "new": [ "hamburger" ] },
{ "present": [ "LACTOSE", "VEGETARIAN" ], "absent": [ "ANTIWHEAT" ], "new": [ "sandwich_veggy" ] },
{ "present": [ "VEGAN" ], "absent": [ "ANTIWHEAT" ], "new": [ "sandwich_veggy" ] },
{
"present": [ "VEGETARIAN" ],
"absent": [ "ANTIWHEAT", "LACTOSE" ],
Expand All @@ -541,7 +588,9 @@
"item": "pizza_meat",
"sub": [
{ "present": [ "VEGETARIAN" ], "absent": [ "ANTIWHEAT" ], "new": [ "pizza_veggy" ] },
{ "present": [ "VEGAN" ], "absent": [ "ANTIWHEAT" ], "new": [ "pizza_veggy" ] },
{ "present": [ "VEGETARIAN", "ANTIWHEAT" ], "new": [ "veggy_salad", "fork" ] },
{ "present": [ "VEGAN", "ANTIWHEAT" ], "new": [ "veggy_salad", "fork" ] },
{
"present": [ "ANTIWHEAT" ],
"absent": [ "VEGETARIAN", "ANTIJUNK" ],
Expand All @@ -559,6 +608,7 @@
"item": "pizza_veggy",
"sub": [
{ "present": [ "ANTIWHEAT", "VEGETARIAN" ], "new": [ "veggy_salad", "fork" ] },
{ "present": [ "ANTIWHEAT", "VEGAN" ], "new": [ "veggy_salad", "fork" ] },
{
"present": [ "ANTIWHEAT" ],
"absent": [ "VEGETARIAN", "ANTIJUNK" ],
Expand Down
2 changes: 1 addition & 1 deletion src/profession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ void json_item_substitution::load( const JsonObject &jo )
itype_id old_it;
sub.read( "item", old_it, true );
if( check_duplicate_item( old_it ) ) {
sub.throw_error( "Duplicate definition of item" );
sub.throw_error( "Item substitutions can only be defined once. Items with multiple substition traits should use arrays." );
}
s.trait_reqs.present.emplace_back( jo.get_string( "trait" ) );
for( const JsonValue info : sub.get_array( "new" ) ) {
Expand Down

0 comments on commit ed0dba4

Please sign in to comment.