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

Allows survivors to cook tea using lotus and spurge flowers #39727

Merged
merged 5 commits into from
Apr 23, 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
6 changes: 6 additions & 0 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,12 @@
"desc": [ "You have been vaccinated for the flu recently." ],
"blocks_effects": [ "flu" ]
},
{
"type": "effect_type",
"id": "took_antiasthmatic",
"name": [ "Took antiasthmatic drugs" ],
"desc": [ "You have taken an antiasthmatic drug recently." ]
},
{
"type": "effect_type",
"id": "cureall",
Expand Down
12 changes: 10 additions & 2 deletions data/json/furniture_and_terrain/furniture-flora.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@
"harvest_by_season": [
{
"seasons": [ "spring", "summer", "autumn" ],
"entries": [ { "drop": "withered", "base_num": [ 1, 2 ] }, { "drop": "seed_flower", "base_num": [ 1, 2 ] } ]
"entries": [
{ "drop": "withered", "base_num": [ 1, 2 ] },
{ "drop": "seed_flower", "base_num": [ 1, 2 ] },
{ "drop": "spurge", "base_num": [ 1, 4 ] }
]
}
],
"bash": { "str_min": 2, "str_max": 6, "sound": "crunch.", "sound_fail": "whish." }
Expand Down Expand Up @@ -174,7 +178,11 @@
"harvest_by_season": [
{
"seasons": [ "spring", "summer", "autumn" ],
"entries": [ { "drop": "withered", "base_num": [ 1, 2 ] }, { "drop": "seed_flower", "base_num": [ 1, 2 ] } ]
"entries": [
{ "drop": "withered", "base_num": [ 1, 2 ] },
{ "drop": "seed_flower", "base_num": [ 1, 2 ] },
{ "drop": "lotus", "base_num": [ 1, 2 ] }
]
}
],
"//": "Add flower and bud spawns once useful.",
Expand Down
5 changes: 5 additions & 0 deletions data/json/item_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@
"id": "ALCOHOL_WEAK",
"name": { "str": "Drink" }
},
{
"type": "item_action",
"id": "ANTIASTHMATIC",
"name": { "str": "Take" }
},
{
"type": "item_action",
"id": "ANTIBIOTIC",
Expand Down
29 changes: 29 additions & 0 deletions data/json/items/comestibles/drink.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,20 @@
"flags": [ "EATEN_COLD" ],
"fun": 5
},
{
"type": "COMESTIBLE",
"id": "lotus_tea",
"name": { "str_sp": "lotus tea" },
"copy-from": "tea",
"color": "green",
"spoils_in": "10 days",
"quench": 34,
"healthy": 1,
"description": "A healthy beverage made from lotus flowers steeped in boiling water.",
"price": 100,
"price_postapoc": 25,
"fun": 1
},
{
"id": "mex_chocolate",
"type": "COMESTIBLE",
Expand Down Expand Up @@ -887,6 +901,21 @@
"fun": -1,
"vitamins": [ [ "vitC", 1 ] ]
},
{
"type": "COMESTIBLE",
"id": "spurge_tea",
"name": { "str_sp": "spurge tea" },
"copy-from": "tea",
"color": "green",
"use_action": "ANTIASTHMATIC",
"spoils_in": "10 days",
"quench": 34,
"healthy": 1,
"description": "A healthy beverage made from spurge flowers steeped in boiling water. Can be used to prevent asthma attacks.",
"price": 100,
"price_postapoc": 25,
"fun": 1
},
{
"type": "COMESTIBLE",
"id": "rehydration_drink",
Expand Down
26 changes: 26 additions & 0 deletions data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,32 @@
"price": 0,
"price_postapoc": 0
},
{
"type": "GENERIC",
"id": "lotus",
"name": { "str": "lotus flower" },
"description": "A lovely flower that grows on the surface of bodies of freshwater. Traditionally connected with many Eastern cultures.",
"weight": "50 g",
"color": "white",
"symbol": ",",
"material": [ "veggy" ],
"volume": "250 ml",
"price": 0,
"price_postapoc": 0
},
{
"type": "GENERIC",
"id": "spurge",
"name": { "str_sp": "spurge flowers" },
"description": "A handful of yellow-green flowers. Can be brewed into a tea that prevents asthma attacks.",
"weight": "50 g",
"color": "white",
"symbol": ",",
"material": [ "veggy" ],
"volume": "250 ml",
"price": 0,
"price_postapoc": 0
},
{
"type": "GENERIC",
"id": "clay_lump",
Expand Down
44 changes: 44 additions & 0 deletions data/json/recipes/recipe_food.json
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,50 @@
"tools": [ [ [ "water_boiling_heat", 2, "LIST" ] ] ],
"components": [ [ [ "chamomile", 1 ] ], [ [ "water", 1 ], [ "water_clean", 1 ] ] ]
},
{
"type": "recipe",
"result": "lotus_tea",
"category": "CC_FOOD",
"subcategory": "CSC_FOOD_DRINKS",
"skill_used": "cooking",
"difficulty": 1,
"skills_required": [ "survival", 1 ],
"time": "10 m",
"batch_time_factors": [ 80, 4 ],
"book_learn": [
[ "pocket_survival", 1 ],
[ "survival_book", 1 ],
[ "textbook_survival", 1 ],
[ "manual_survival", 1 ],
[ "mag_survival", 1 ],
[ "family_cookbook", 1 ]
],
"qualities": [ { "id": "BOIL", "level": 1 } ],
"tools": [ [ [ "water_boiling_heat", 2, "LIST" ] ] ],
"components": [ [ [ "lotus", 1 ] ], [ [ "water", 1 ], [ "water_clean", 1 ] ] ]
},
{
"type": "recipe",
"result": "spurge_tea",
"category": "CC_FOOD",
"subcategory": "CSC_FOOD_DRINKS",
"skill_used": "cooking",
"difficulty": 1,
"skills_required": [ "survival", 1 ],
"time": "10 m",
"batch_time_factors": [ 80, 4 ],
"book_learn": [
[ "pocket_survival", 1 ],
[ "survival_book", 1 ],
[ "textbook_survival", 1 ],
[ "manual_survival", 1 ],
[ "mag_survival", 1 ],
[ "family_cookbook", 1 ]
],
"qualities": [ { "id": "BOIL", "level": 1 } ],
"tools": [ [ [ "water_boiling_heat", 2, "LIST" ] ] ],
"components": [ [ [ "spurge", 1 ] ], [ [ "water", 1 ], [ "water_clean", 1 ] ] ]
},
{
"type": "recipe",
"result": "kompot",
Expand Down
1 change: 1 addition & 0 deletions src/item_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ void Item_factory::init()
add_iuse( "ALCOHOL", &iuse::alcohol_medium );
add_iuse( "ALCOHOL_STRONG", &iuse::alcohol_strong );
add_iuse( "ALCOHOL_WEAK", &iuse::alcohol_weak );
add_iuse( "ANTIASTHMATIC", &iuse::antiasthmatic );
add_iuse( "ANTIBIOTIC", &iuse::antibiotic );
add_iuse( "ANTICONVULSANT", &iuse::anticonvulsant );
add_iuse( "ANTIFUNGAL", &iuse::antifungal );
Expand Down
8 changes: 8 additions & 0 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ static const efftype_id effect_teargas( "teargas" );
static const efftype_id effect_teleglow( "teleglow" );
static const efftype_id effect_tetanus( "tetanus" );
static const efftype_id effect_tied( "tied" );
static const efftype_id effect_took_antiasthmatic( "took_antiasthmatic" );
static const efftype_id effect_took_anticonvulsant_visible( "took_anticonvulsant_visible" );
static const efftype_id effect_took_flumed( "took_flumed" );
static const efftype_id effect_took_prozac( "took_prozac" );
Expand Down Expand Up @@ -850,6 +851,13 @@ int iuse::flu_vaccine( player *p, item *it, bool, const tripoint & )
return it->type->charges_to_use();
}

int iuse::antiasthmatic( player *p, item *it, bool, const tripoint & )
{
p->add_msg_if_player( m_good, _( "You no longer need to worry about asthma attacks, at least for a while." ) );
p->add_effect( effect_took_antiasthmatic, 1_days, num_bp, true );
return it->type->charges_to_use();
}

int iuse::poison( player *p, item *it, bool, const tripoint & )
{
if( ( p->has_trait( trait_EATDEAD ) ) ) {
Expand Down
1 change: 1 addition & 0 deletions src/iuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class iuse
int catfood( player *, item *, bool, const tripoint & );
int feedcattle( player *, item *, bool, const tripoint & );
int feedbird( player *, item *, bool, const tripoint & );
int antiasthmatic( player *, item *, bool, const tripoint & );
// TOOLS
int extinguisher( player *, item *, bool, const tripoint & );
int hammer( player *, item *, bool, const tripoint & );
Expand Down
3 changes: 2 additions & 1 deletion src/suffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ static const efftype_id effect_onfire( "onfire" );
static const efftype_id effect_shakes( "shakes" );
static const efftype_id effect_sleep( "sleep" );
static const efftype_id effect_stunned( "stunned" );
static const efftype_id effect_took_antiasthmatic( "took_antiasthmatic" );
static const efftype_id effect_took_thorazine( "took_thorazine" );
static const efftype_id effect_valium( "valium" );
static const efftype_id effect_visuals( "visuals" );
Expand Down Expand Up @@ -603,7 +604,7 @@ void Character::suffer_from_schizophrenia()

void Character::suffer_from_asthma( const int current_stim )
{
if( has_effect( effect_adrenaline ) || has_effect( effect_datura ) ) {
if( has_effect( effect_adrenaline ) || has_effect( effect_datura ) || has_effect( effect_took_antiasthmatic) ) {
return;
}
if( !one_in( ( to_turns<int>( 6_hours ) - current_stim * 300 ) *
Expand Down