Edit : so the issue that I had here is actually corrected ("bio_battery" is now called "bio_power_storage" and drops from shocker zombies use the proper one), but I figured I might leave this to posterity, considering the amount of time I spent writing it :p
I think there's an issue with the shocker zombies giving you "CBM : Battery System" instead of "CBM : Internal Battery" as a common drop.
I checked the source code (my version is from 31/04), and I found this in game.cpp :
//Add a chance of CBM recovery. For shocker and cyborg corpses.
if (corpse->has_flag(MF_CBM)) {
//As long as the factor is above -4 (the sinew cutoff), you will be able to extract cbms
if(skill_shift >= 0){
add_msg("You discover a CBM in the %s!", corpse->name.c_str());
//To see if it spawns a battery
if(rng(0,1) == 1){ //The battery works
m.spawn_item(u.posx, u.posy, itypes["bio_batteries"], age);
}else{//There is a burnt out CBM
m.spawn_item(u.posx, u.posy, itypes["burnt_out_bionic"], age);
}
}
if(skill_shift >= 0){
//To see if it spawns a random additional CBM
if(rng(0,1) == 1){ //The CBM works
int index = rng(0, mapitems[mi_bionics].size()-1);
m.spawn_item(u.posx, u.posy, itypes[ mapitems[mi_bionics][index] ], age);
}else{//There is a burnt out CBM
m.spawn_item(u.posx, u.posy, itypes["burnt_out_bionic"], age);
}
}
}
Here as you can see, it gives you a chance at a "Battery System" bionic (called "bio_batteries"), and then a chance at a random bionic, meaning you'll find lots of battery systems.
According to the code comments, it's supposed to be "a battery", but instead it's the bionic allowing you to eat batteries. Having multiple "Internal battery" is useful, it increases your max power, but multiple "Battery system" is useless, you can only install it once.
A further look into "bionics.cpp" reveals the source of the mistake : Battery System is called "bio_batteries", while Internal Battery is called "bio_battery", which is confusing.
I suggest replacing m.spawn_item(u.posx, u.posy, itypes["bio_batteries"], age);
by m.spawn_item(u.posx, u.posy, itypes["bio_battery"], age);
in the snippet of code above from game.cpp.
Sorry for not posting this in the C:DDA forums, but didnt want to bother creating an account. Maybe i'll create one later on if I keep involving myself.
While I'm at it, here's a suggestion ; Right now you never have a 100% chance to install a CBM, no matter how good your skills are or how easy it is to install. I understand that the game is supposed to be hard, but it seemed a bit unfair to me. So I modded my version, replacing (in bionics.cpp) this :
int chance_of_success = int((100 * pl_skill) /
(pl_skill + 4 * type->difficulty));
by that :
int chance_of_success = int((100 + pl_skill) -
(10 * type->difficulty));
And it actually works pretty well, there is still a fair margin for failure at low skill level, but once I got my skills up with books, I was able to attain 100% chance.
Here's a more complete version, to avoid going above 100% chance and coloring 100% in blue:
int chance_of_success = int((100 + pl_skill) -
(10 * type->difficulty));
mvwprintz(w, 9, 39, c_white, "Chance of success:");
nc_color col_suc;
if (chance_of_success >=100)
{
chance_of_success = 100;
col_suc = c_ltblue;
}
else if (chance_of_success >= 95)
col_suc = c_green;
else if (chance_of_success >= 80)
col_suc = c_ltgreen;
else if (chance_of_success >= 60)
col_suc = c_yellow;
else if (chance_of_success >= 35)
col_suc = c_ltred;
else
col_suc = c_red;
And I also noticed that the calculation for success was a bit inaccurate :
here
int success = chance_of_success - rng(1, 100);
if (success > 0) {
g->add_msg("Successfully installed batteries.");
max_power_level += BATTERY_AMOUNT;
}
and there
int success = chance_of_success - rng(1, 100);
if (success > 0) {
g->add_msg("Successfully installed %s.", bionics[id]->name.c_str());
add_bionic(id);
}
"if (success > 0)" should be "if (success >= 0)", otherwise, say that you have a 100% chance of success and the RNG give you 100, 100-100 = 0 and it's a failure, so it really was 99% chance of success. The same idea applies to other % of success, they are really 1% lower than they let you think.