diff --git a/data/json/harvest_dissect.json b/data/json/harvest_dissect.json index 1d3b280842e16..dc8afa7241c28 100644 --- a/data/json/harvest_dissect.json +++ b/data/json/harvest_dissect.json @@ -665,13 +665,19 @@ "drop": "bio_power_storage", "type": "bionic", "flags": [ "FILTHY", "NO_STERILE", "NO_PACKED" ], - "faults": [ "fault_bionic_salvaged" ] + "faults": [ "fault_bionic_salvaged" ], + "base_num": [ 0, 2 ], + "scale_num": [ 0.1, 0.6 ], + "max": 5 }, { "drop": "cyborg_harvest", "type": "bionic_group", "flags": [ "FILTHY", "NO_STERILE", "NO_PACKED" ], - "faults": [ "fault_bionic_salvaged" ] + "faults": [ "fault_bionic_salvaged" ], + "base_num": [ 0, 2 ], + "scale_num": [ 0.1, 0.6 ], + "max": 5 } ] }, @@ -684,13 +690,19 @@ "drop": "Zomborg_CBM_harvest", "type": "bionic_group", "flags": [ "NO_STERILE", "NO_PACKED", "FILTHY" ], - "faults": [ "fault_bionic_salvaged" ] + "faults": [ "fault_bionic_salvaged" ], + "base_num": [ 0, 2 ], + "scale_num": [ 0.1, 0.6 ], + "max": 5 }, { "drop": "Zomborg_CBM_harvest_power", "type": "bionic_group", "flags": [ "NO_STERILE", "NO_PACKED", "FILTHY" ], - "faults": [ "fault_bionic_salvaged" ] + "faults": [ "fault_bionic_salvaged" ], + "base_num": [ 0, 2 ], + "scale_num": [ 0.1, 0.6 ], + "max": 5 } ] } diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index e2704e6917b2e..9207988b0b812 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -359,7 +359,7 @@ static bool check_butcher_dissect( const int roll ) // Roll is reduced by corpse damage level, but to no less then 0 add_msg_debug( debugmode::DF_ACT_BUTCHER, "Roll = %i", roll ); add_msg_debug( debugmode::DF_ACT_BUTCHER, "Failure chance = %f%%", - ( 19.0f / ( 10.0f + roll * 5.0f ) ) * 100.0f ); + ( 10.0f / ( 10.0f + roll * 5.0f ) ) * 100.0f ); const bool failed = x_in_y( 10, ( 10 + roll * 5 ) ); return !failed; } @@ -816,17 +816,19 @@ static bool butchery_drops_harvest( item *corpse_item, const mtype &mt, Characte practice += ( 4 + butchery ) / entry_count; const float min_num = entry.base_num.first + butchery * entry.scale_num.first; const float max_num = entry.base_num.second + butchery * entry.scale_num.second; + int roll = 0; // mass_ratio will override the use of base_num, scale_num, and max if( entry.mass_ratio != 0.00f ) { roll = static_cast( std::round( entry.mass_ratio * monster_weight ) ); roll = corpse_damage_effect( roll, entry.type, corpse_item->damage_level() ); - } else if( action != butcher_type::DISSECT ) { + } else { roll = std::min( entry.max, std::round( rng_float( min_num, max_num ) ) ); // will not give less than min_num defined in the JSON roll = std::max( corpse_damage_effect( roll, entry.type, corpse_item->damage_level() ), entry.base_num.first ); } + itype_id drop_id = itype_id::NULL_ID(); const itype *drop = nullptr; if( entry.type->is_itype() ) {