Show buildings left till achievement in tooltip #4

This commit is contained in:
Daniël van Noord
2021-04-09 15:53:33 +02:00
parent d99837df61
commit 3e3945461d
9 changed files with 77 additions and 12 deletions

View File

@@ -0,0 +1,13 @@
import BuyBuildingsBonusIncome from '../../Sim/SimulationEvents/BuyBuildingBonusIncome';
import { SimAchievementsOwned } from '../../Sim/VariablesAndData';
export default function IndividualAmountTillNextAchievement(building) {
const AchievementsAtStart = Game.AchievementsOwned;
for (let index = 0; index < 101; index++) {
BuyBuildingsBonusIncome(building, index);
if (SimAchievementsOwned > AchievementsAtStart) {
return index;
}
}
return 101;
}