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

Test that professions have space for inhalers #40172

Merged
merged 1 commit into from
May 5, 2020
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
7 changes: 5 additions & 2 deletions data/json/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1061,8 +1061,8 @@
"points": -1,
"items": {
"both": [ "crackpipe", "crack", "crack", "ref_lighter", "tank_top" ],
"male": [ "pants", "flip_flops" ],
"female": [ "skirt", "heels" ]
"male": [ "jeans", "flip_flops" ],
"female": [ "jeans", "heels" ]
},
"addictions": [ { "intensity": 20, "type": "crack" } ]
},
Expand Down Expand Up @@ -1628,6 +1628,7 @@
"name": "Shower Victim",
"description": "You were in the middle of a nice, hot shower when the Cataclysm struck! You barely managed to escape with some soap and the most massively useful thing ever… a towel.",
"points": -1,
"flags": [ "NO_BONUS_ITEMS" ],
"items": { "both": { "items": [ "towel_wet" ], "entries": [ { "item": "soap", "custom-flags": [ "auto_wield" ] } ] } }
},
{
Expand Down Expand Up @@ -2253,6 +2254,7 @@
"name": "Lost Submissive",
"description": "Early in the rush to safety, you were separated from your master by cruel fate. Now you are on your own with nothing to your name but a suit of really kinky black leather. Unfortunately, there's no safewords in the apocalypse.",
"points": -1,
"flags": [ "NO_BONUS_ITEMS" ],
"items": { "both": [ "bondage_suit", "bondage_mask", "boots", "leather_belt", "matches" ] }
},
{
Expand Down Expand Up @@ -2956,6 +2958,7 @@
"both": {
"items": [
"under_armor_shorts",
"purse",
"under_armor",
"socks",
"elbow_pads",
Expand Down
2 changes: 2 additions & 0 deletions doc/JSON_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,8 @@ player will start with this as a nearby vehicle.

A list of flags. TODO: document those flags here.

- ```NO_BONUS_ITEMS``` Prevent bonus items (such as inhalers with the ASTHMA trait) from being given to this profession

Mods can modify this via `add:flags` and `remove:flags`.

#### `cbms`
Expand Down
10 changes: 6 additions & 4 deletions src/profession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,12 @@ std::list<item> profession::items( bool male, const std::vector<trait_id> &trait
result.insert( result.begin(), group_both.begin(), group_both.end() );
result.insert( result.begin(), group_gender.begin(), group_gender.end() );

std::vector<itype_id> bonus = item_substitutions.get_bonus_items( traits );
for( const itype_id &elem : bonus ) {
if( elem != no_bonus ) {
result.push_back( item( elem, advanced_spawn_time(), item::default_charges_tag {} ) );
if( !has_flag( "NO_BONUS_ITEMS" ) ) {
std::vector<itype_id> bonus = item_substitutions.get_bonus_items( traits );
for( const itype_id &elem : bonus ) {
if( elem != no_bonus ) {
result.push_back( item( elem, advanced_spawn_time(), item::default_charges_tag {} ) );
}
}
}
for( auto iter = result.begin(); iter != result.end(); ) {
Expand Down
1 change: 1 addition & 0 deletions tests/new_character_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ TEST_CASE( "starting_items", "[slow]" )
trait_id( "LACTOSE" ),
//trait_id( "LEG_TENTACLES" ),
trait_id( "MEATARIAN" ),
trait_id( "ASTHMA" ),
//trait_id( "RAP_TALONS" ),
//trait_id( "TAIL_FLUFFY" ),
//trait_id( "TAIL_LONG" ),
Expand Down