Skip to content

Commit

Permalink
Update calc.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rowandwhelan authored Aug 9, 2024
1 parent c875dd0 commit 6eaefb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function calculateTotalShieldCapacity() {
function calculateShieldRegen() {
var regenRate = Math.max(0, Math.round((1 / (-0.9 * totalGens + 0.9 + totalGens)) * totalGens * 100 - totalTanks * 1000 * 0.01) + 100);
if (document.getElementById("batterySwap").checked && (batteryNumber > 1) && (totalGens > 0)){
regenRate = Math.max(0, Math.round((1 / (-0.9 * totalGens + 0.9 + totalGens)) * totalGens * (100+100*((totalGens/batteryNumber)/totalGens)) - totalTanks * 1000 * (0.01-0.01*((totalGens/batteryNumber)/totalGens))) + 100);
regenRate = Math.max(0, Math.round((1 / (-0.9 * totalGens + 0.9 + totalGens)) * totalGens * (200-100*((totalGens/batteryNumber)/totalGens)) - totalTanks * 1000 * (0.01-0.01*((totalGens/batteryNumber)/totalGens))) + 100);
}
if (regenRate === 0) {
document.getElementById("labelForShieldRegen").innerText = "Shield regen (HP/second): [Warning: Shield regen too low! Add more generators]";
Expand Down

0 comments on commit 6eaefb2

Please sign in to comment.