internal CapCalc GetNGUMagicCapCalc(int offset) { var ret = new CapCalc { Num = 0, PPT = 1 }; var num1 = 0.0f; if (Character.settings.nguLevelTrack == difficulty.normal) { num1 = Character.NGU.magicSkills[Index].level + 1L + offset; } else if (Character.settings.nguLevelTrack == difficulty.evil) { num1 = Character.NGU.magicSkills[Index].evilLevel + 1L + offset; } else if (Character.settings.nguLevelTrack == difficulty.sadistic) { num1 = Character.NGU.magicSkills[Index].sadisticLevel + 1L + offset; } var num2 = Character.totalMagicPower() * (double)Character.totalNGUSpeedBonus() * Character.adventureController.itopod.totalMagicNGUBonus() * Character.inventory.macguffinBonuses[5] * Character.NGUController.magicNGUBonus() * Character.allDiggers.totalMagicNGUBonus() * Character.hacksController.totalMagicNGUBonus() * Character.beastQuestPerkController.totalMagicNGUSpeed() * Character.wishesController.totalMagicNGUSpeed() * Character.cardsController.getBonus(cardBonus.magicNGUSpeed); if (Character.allChallenges.trollChallenge.completions() >= 1) { num2 *= 3.0; } if (Character.settings.nguLevelTrack >= difficulty.sadistic) { num2 /= Character.NGUController.NGUMagic[0].sadisticDivider(); } var num3 = Character.NGUController.magicSpeedDivider(Index) * (double)num1 / num2; if (num3 >= Character.hardCap()) { num3 = Character.hardCap(); } var num4 = num3 <= 1.0 ? 1L : (long)num3; var num = (long)(num4 / (long)Math.Ceiling(num4 / (double)MaxAllocation) * 1.00000202655792); if (num + 1L <= long.MaxValue) { ++num; } if (num > Character.magic.idleMagic) { num = Character.magic.idleMagic; } if (num < 0L) { num = 0L; } var ppt = (double)num / num4; ret.Num = num; ret.PPT = ppt; return(ret); }
private CapCalc CalculateATCap(int offset) { var ret = new CapCalc { Num = 0, PPT = 1 }; var divisor = GetDivisor(Index, offset); if (divisor == 0.0) { return(ret); } if (Character.wishes.wishes[190].level >= 1) { return(ret); } var formula = 50f * divisor / (Mathf.Sqrt(Character.totalEnergyPower()) * Character.totalAdvancedTrainingSpeedBonus()); if (formula >= Character.hardCap()) { formula = Character.hardCap(); } var num = (long)(formula / (long)Math.Ceiling(formula / (double)MaxAllocation) * 1.00000202655792); if (num + 1L <= long.MaxValue) { ++num; } if (num > Character.idleEnergy) { num = Character.idleEnergy; } if (num < 0L) { num = 0L; } ret.Num = num; ret.PPT = (double)num / formula; return(ret); }
private CapCalc CalculateMagicTM(int offset) { var ret = new CapCalc { Num = 0, PPT = 1 }; var formula = 50000 * Character.timeMachineController.baseGoldMultiDivider() * (1f + Character.machine.levelGoldMulti + offset) / ( Character.totalMagicPower() * Character.hacksController.totalTMSpeedBonus() * Character.allChallenges.timeMachineChallenge.TMSpeedBonus() * Character.cardsController.getBonus(cardBonus.TMSpeed)); if (Character.settings.rebirthDifficulty >= difficulty.sadistic) { formula *= Character.timeMachineController.sadisticDivider(); } if (formula >= Character.hardCap()) { formula = Character.hardCap(); } var num4 = formula <= 1.0 ? 1L : (long)formula; var num = (long)(num4 / (long)Math.Ceiling(num4 / (double)MaxAllocation) * 1.00000202655792); if (num + 1L <= long.MaxValue) { ++num; } if (num > Character.magic.idleMagic) { num = Character.magic.idleMagic; } if (num < 0L) { num = 0L; } ret.Num = num; ret.PPT = (double)num / num4; return(ret); }
internal CapCalc CalculateAugCapCalc(int offset, int index, float allocation) { int augIndex; var ret = new CapCalc { Num = 0, PPT = 1 }; double formula = 0; double num1 = 1D; if (index % 2 == 0) { augIndex = index / 2; if (Character.settings.rebirthDifficulty == difficulty.normal) { num1 = (Character.totalEnergyPower() / 50000D / Character.augmentsController.normalAugSpeedDividers[augIndex] / (Character.augments.augs[augIndex].augLevel + 1D + offset)); } else if (Character.settings.rebirthDifficulty == difficulty.evil) { num1 = (Character.totalEnergyPower() / 50000D / Character.augmentsController.evilAugSpeedDividers[augIndex] / (Character.augments.augs[augIndex].augLevel + 1D + offset)); } else if (Character.settings.rebirthDifficulty == difficulty.sadistic) { num1 = (Character.totalEnergyPower() / Character.augmentsController.sadisticAugSpeedDividers[augIndex] / (Character.augments.augs[augIndex].augLevel + 1D + offset)); } } else { augIndex = (index - 1) / 2; if (Character.settings.rebirthDifficulty == difficulty.normal) { num1 = (Character.totalEnergyPower() / 50000D / Character.augmentsController.normalUpgradeSpeedDividers[augIndex] / (Character.augments.augs[augIndex].upgradeLevel + 1D + offset)); } else if (Character.settings.rebirthDifficulty == difficulty.evil) { num1 = (Character.totalEnergyPower() / 50000f / Character.augmentsController.evilUpgradeSpeedDividers[augIndex] / (Character.augments.augs[augIndex].upgradeLevel + 1D + offset)); } else if (Character.settings.rebirthDifficulty == difficulty.sadistic) { num1 = (Character.totalEnergyPower() / Character.augmentsController.sadisticUpgradeSpeedDividers[augIndex] / (Character.augments.augs[augIndex].upgradeLevel + 1D + offset)); } } num1 *= (1D + Character.inventoryController.bonuses[specType.Augs]); num1 *= Character.inventory.macguffinBonuses[12]; num1 *= Character.hacksController.totalAugSpeedBonus(); num1 *= Character.adventureController.itopod.totalAugSpeedBonus(); num1 *= Character.cardsController.getBonus(cardBonus.augSpeed); num1 *= (1D + Character.allChallenges.noAugsChallenge.evilCompletions() * 0.05D); if (Character.allChallenges.noAugsChallenge.completions() >= 1) { num1 *= 1.1000000238418579; } if (Character.allChallenges.noAugsChallenge.evilCompletions() >= Character.allChallenges.noAugsChallenge.maxCompletions) { num1 *= 1.25; } if (Character.settings.rebirthDifficulty >= difficulty.sadistic) { num1 /= Character.augmentsController.augments[augIndex].sadisticDivider(); } formula = 1 / num1; if (formula >= Character.hardCap()) { formula = Character.hardCap(); } var num4 = formula <= 1.0 ? 1L : (long)formula; var num = (long)(num4 / (long)Math.Ceiling(num4 / (double)allocation) * 1.00000202655792); if (num + 1L <= long.MaxValue) { ++num; } if (num > Character.idleEnergy) { num = Character.idleEnergy; } if (num < 0L) { num = 0L; } var ppt = (double)num / num4; ret.Num = num; ret.PPT = ppt; Main.LogAllocation($"Returning from Index : {index} : {ret.Num} of {allocation} vs {ret.PPT} BB"); return(ret); }
internal CapCalc CalculateAugCapCalc(int offset, int index, float allocation) { int augIndex; var ret = new CapCalc { Num = 0, PPT = 1 }; double formula = 0; if (Index % 2 == 0) { augIndex = index / 2; formula = 50000 * (1f + Character.augments.augs[augIndex].augLevel + offset) / (Character.totalEnergyPower() * (1 + Character.inventoryController.bonuses[specType.Augs]) * Character.inventory.macguffinBonuses[12] * Character.hacksController.totalAugSpeedBonus() * Character.cardsController.getBonus(cardBonus.augSpeed) * Character.adventureController.itopod.totalAugSpeedBonus() * (1.0 + Character.allChallenges.noAugsChallenge.evilCompletions() * 0.0500000007450581)); if (Character.allChallenges.noAugsChallenge.completions() >= 1) { formula /= 1.10000002384186; } if (Character.allChallenges.noAugsChallenge.evilCompletions() >= Character.allChallenges.noAugsChallenge.maxCompletions) { formula /= 1.25; } if (Character.settings.rebirthDifficulty >= difficulty.sadistic) { formula *= Character.augmentsController.augments[augIndex].sadisticDivider(); } if (Character.settings.rebirthDifficulty == difficulty.normal) { formula *= Character.augmentsController.normalAugSpeedDividers[augIndex]; } else if (Character.settings.rebirthDifficulty == difficulty.evil) { formula *= Character.augmentsController.evilAugSpeedDividers[augIndex]; } else if (Character.settings.rebirthDifficulty == difficulty.sadistic) { formula *= Character.augmentsController.sadisticAugSpeedDividers[augIndex]; } } else { augIndex = (index - 1) / 2; formula = 50000 * (1f + Character.augments.augs[augIndex].upgradeLevel + offset) / (Character.totalEnergyPower() * (1 + Character.inventoryController.bonuses[specType.Augs]) * Character.inventory.macguffinBonuses[12] * Character.hacksController.totalAugSpeedBonus() * Character.cardsController.getBonus(cardBonus.augSpeed) * Character.adventureController.itopod.totalAugSpeedBonus() * (1.0 + Character.allChallenges.noAugsChallenge.evilCompletions() * 0.0500000007450581)); if (Character.allChallenges.noAugsChallenge.completions() >= 1) { formula /= 1.10000002384186; } if (Character.allChallenges.noAugsChallenge.evilCompletions() >= Character.allChallenges.noAugsChallenge.maxCompletions) { formula /= 1.25; } if (Character.settings.rebirthDifficulty >= difficulty.sadistic) { formula *= Character.augmentsController.augments[augIndex].sadisticDivider(); } if (Character.settings.rebirthDifficulty == difficulty.normal) { formula *= Character.augmentsController.normalUpgradeSpeedDividers[augIndex]; } else if (Character.settings.rebirthDifficulty == difficulty.evil) { formula *= Character.augmentsController.evilUpgradeSpeedDividers[augIndex]; } else if (Character.settings.rebirthDifficulty == difficulty.sadistic) { formula *= Character.augmentsController.sadisticUpgradeSpeedDividers[augIndex]; } } if (formula >= Character.hardCap()) { formula = Character.hardCap(); } var num4 = formula <= 1.0 ? 1L : (long)formula; var num = (long)(num4 / (long)Math.Ceiling(num4 / (double)allocation) * 1.00000202655792); if (num + 1L <= long.MaxValue) { ++num; } if (num > Character.idleEnergy) { num = Character.idleEnergy; } if (num < 0L) { num = 0L; } var ppt = (double)num / num4; ret.Num = num; ret.PPT = ppt; return(ret); }