diff --git a/GUIDE_COMESTIBLES.md b/GUIDE_COMESTIBLES.md index 5f6a82740b89d..d15115892ead1 100644 --- a/GUIDE_COMESTIBLES.md +++ b/GUIDE_COMESTIBLES.md @@ -17,7 +17,7 @@ When you have a comestible you want to add to the files, just go down this list, `alcohol.json` -- "Drink" comestible with alcohol addiction `soup.json` -- "Drink" comestible which is a soup. This is more of a "food" than a drink - you primarily want the calories from this -`drinks.json` -- "Drink" comestible. This is your drink of choice when you're thirsty! examples: tea, juice, water +`drink.json` -- "Drink" comestible. This is your drink of choice when you're thirsty! examples: tea, juice, water `drink_other.json` -- "Drink" comestible that does not fit any other criteria. example: vinegar, mustard `junkfood.json` -- comestible with the "junk" material. examples: cake, sugary cereal, nachos @@ -36,5 +36,5 @@ When you have a comestible you want to add to the files, just go down this list, `egg.json` -- either an egg, or made of egg `dairy.json` -- made of milk `mushroom.json` -- a mushroom or made of mushrooms -`nut.json` -- a nut or made of nuts +`nuts.json` -- a nut or made of nuts `other.json` -- if you made it here, your comestible doesn't fit any other category! \ No newline at end of file diff --git a/data/json/furniture.json b/data/json/furniture.json index 8f14c3577214d..1ab8f2bba1a1d 100644 --- a/data/json/furniture.json +++ b/data/json/furniture.json @@ -2264,7 +2264,7 @@ "type": "furniture", "id": "f_lily", "name": "lily", - "looks_like": "f_tulip", + "looks_like": "f_flower_tulip", "symbol": "f", "color": "magenta", "move_cost_mod": 0, diff --git a/data/json/items/comestibles/drink.json b/data/json/items/comestibles/drink.json index 28cd22b85d8e0..23f7628a4aa81 100644 --- a/data/json/items/comestibles/drink.json +++ b/data/json/items/comestibles/drink.json @@ -210,19 +210,21 @@ "id": "con_milk", "name": "condensed milk", "name_plural": "condensed milk", - "weight": 258, + "weight": 32, "color": "white", "spoils_in": "1 day", "container": "can_food", "comestible_type": "DRINK", "symbol": "~", - "quench": 20, - "calories": 95, - "description": "Baby cow food, appropriated for adult humans. Having been canned, this milk should last for a very long time.", - "price": 700, + "quench": 12, + "calories": 103, + "description": "Baby cow food, appropriated for adult humans. This milk has been sweetened and thickened, making it a sweet addition to any food.", + "price": 70, "material": [ "milk", "junk" ], "volume": 1, "phase": "liquid", + "charges": 10, + "vitamins": [ [ "calcium", 2 ] ], "fun": 3 }, { diff --git a/data/json/items/comestibles/mutagen.json b/data/json/items/comestibles/mutagen.json index 153fa416c897c..64ed9f09c4845 100644 --- a/data/json/items/comestibles/mutagen.json +++ b/data/json/items/comestibles/mutagen.json @@ -35,7 +35,7 @@ "stim": -5, "addiction_potential": 6, "container": "test_tube", - "tool": "syringe" + "tools_needed": "syringe" }, { "id": "iv_mutagen", diff --git a/data/json/monsters.json b/data/json/monsters.json index ce42f6a2ea744..0a737ce26f140 100644 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -862,7 +862,7 @@ "vision_night": 3, "harvest": "mr_bones", "special_attacks": [ { "type": "bite", "cooldown": 5 } ], - "death_function": [ "NORMAL", "SPLATTER" ], + "death_function": [ "NORMAL" ], "flags": [ "SEES", "HEARS", "NO_BREATHE", "HARDTOSHOOT", "REVIVES", "POISON", "FILTHY" ] }, { @@ -2361,7 +2361,7 @@ "special_attacks": [ [ "scratch", 10 ], { "type": "bite", "cooldown": 5 } ], "upgrades": { "half_life": 15, "into": "mon_skeleton_hulk" }, "death_drops": "default_zombie_clothes", - "death_function": [ "NORMAL", "SPLATTER" ], + "death_function": [ "NORMAL" ], "flags": [ "SEES", "HEARS", "BLEED", "HARDTOSHOOT", "REVIVES", "NO_BREATHE", "POISON", "FILTHY" ] }, { @@ -4961,7 +4961,7 @@ "special_attacks": [ [ "SMASH", 20 ], [ "STRETCH_ATTACK", 20 ], [ "LONGSWIPE", 20 ], { "id": "scratch", "damage_max_instance": [ { "damage_type": "cut", "amount": 23, "armor_multiplier": 0.8 } ] } ], "death_drops": "mon_zombie_hulk_death_drops", - "death_function": [ "NORMAL", "SPLATTER" ], + "death_function": [ "NORMAL" ], "burn_into": "mon_zombie_fiend", "flags": [ "SEES", diff --git a/src/crafting.cpp b/src/crafting.cpp index ee5fa3258660a..a4d17a244e38a 100644 --- a/src/crafting.cpp +++ b/src/crafting.cpp @@ -775,35 +775,44 @@ comp_selection player::select_item_component( const std::vector 0 ) ? component.count * batch : abs( component.count ); - bool pl = false; - bool mp = false; + bool found = false; if( item::count_by_charges( type ) && count > 0 ) { - if( has_charges( type, count ) ) { + long map_charges = map_inv.charges_of( type ); + + // If map has infinite charges, just use them + if( map_charges == item::INFINITE_CHARGES ) { + selected.use_from = use_from_map; + selected.comp = component; + return selected; + } + + long player_charges = charges_of( type ); + + if( player_charges >= count ) { player_has.push_back( component ); - pl = true; + found = true; } - if( map_inv.has_charges( type, count ) ) { + if( map_charges >= count ) { map_has.push_back( component ); - mp = true; + found = true; } - if( !pl && !mp && charges_of( type ) + map_inv.charges_of( type ) >= count ) { + if( !found && player_charges + map_charges >= count ) { mixed.push_back( component ); } } else { // Counting by units, not charges if( has_amount( type, count ) ) { player_has.push_back( component ); - pl = true; + found = true; } if( map_inv.has_components( type, count ) ) { map_has.push_back( component ); - mp = true; + found = true; } - if( !pl && !mp && amount_of( type ) + map_inv.amount_of( type ) >= count ) { + if( !found && amount_of( type ) + map_inv.amount_of( type ) >= count ) { mixed.push_back( component ); } - } } diff --git a/src/game.cpp b/src/game.cpp index 166d0e64ca8b0..9f362e465647c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3371,7 +3371,8 @@ void game::disp_kills() for( const auto &entry : kill_counts ) { std::ostringstream buffer; buffer << "( entry.first ) << ">"; - buffer << std::get<1>( entry.first ) << "" << " " << std::get<0>( entry.first ); + buffer << std::get<1>( entry.first ) << "" << " "; + buffer << "" << std::get<0>( entry.first ) << ""; const int w = colum_width - utf8_width( std::get<0>( entry.first ) ); buffer.width( w - 3 ); // gap between cols, monster sym, space buffer.fill( ' ' ); diff --git a/src/map.cpp b/src/map.cpp index 2dca210b2b2bc..04bcd02f37eb7 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -4758,6 +4758,9 @@ std::list map::use_charges( const tripoint &origin, const int range, const itype_id type, long &quantity ) { std::list ret; + + // We prefer infinite map sources where available, so search for those + // first for( const tripoint &p : closest_tripoints_first( range, origin ) ) { // can not reach this -> can not access its contents if( origin != p && !clear_path( origin, p, range, 1, 100 ) ) { @@ -4771,6 +4774,13 @@ std::list map::use_charges( const tripoint &origin, const int range, quantity = 0; return ret; } + } + + for( const tripoint &p : closest_tripoints_first( range, origin ) ) { + // can not reach this -> can not access its contents + if( origin != p && !clear_path( origin, p, range, 1, 100 ) ) { + continue; + } if( has_furn( p ) ) { use_charges_from_furn( furn( p ).obj(), type, quantity, this, p, ret ); diff --git a/src/mondeath.cpp b/src/mondeath.cpp index 2d7fb8560906e..04715c5b019e5 100644 --- a/src/mondeath.cpp +++ b/src/mondeath.cpp @@ -102,6 +102,8 @@ void scatter_chunks( std::string chunk_name, int chunk_amt, monster &z, int dist { // can't have less than one item in a pile or it would cause an infinite loop pile_size = std::max( pile_size, 1 ); + // can't have more items in a pile than total items + pile_size = std::min( chunk_amt, pile_size ); distance = abs( distance ); const item chunk( chunk_name, calendar::turn, pile_size ); for( int i = 0; i < chunk_amt; i += pile_size ) { @@ -182,9 +184,9 @@ void mdeath::splatter( monster &z ) // only flesh and bones survive. if( entry.type == "flesh" || entry.type == "bone" ) { // the larger the overflow damage, the less you get - scatter_chunks( entry.drop, ( entry.mass_ratio / overflow_ratio / 10 * to_gram( - z.get_weight() ) ) / to_gram( ( item::find_type( entry.drop ) )->weight ), z, gib_distance, - to_gram( ( item::find_type( entry.drop ) )->weight ) / ( gib_distance - 1 ) ); + const int chunk_amt = entry.mass_ratio / overflow_ratio / 10 * to_gram( + z.get_weight() ) / to_gram( ( item::find_type( entry.drop ) )->weight ); + scatter_chunks( entry.drop, chunk_amt, z, gib_distance, chunk_amt / ( gib_distance - 1 ) ); gibbed_weight -= entry.mass_ratio / overflow_ratio / 20 * to_gram( z.get_weight() ); } }