public void HardReset() { reset(); GuildManager.resetAllUpgrades(); StatisticsTracker.HardReset(); FieldInfo[] fields = typeof(Industries).GetFields(); foreach (FieldInfo field in fields) { Industry ind = (Industry)field.GetValue(null); ind.startingVendors = 0; ind.apprentices = 0; ind.SetRawVendors(0); } maxVendors = 3; renown = totalRenown = 0; money = 20; maxApprentices = 0; currentApprentices = 0; journeymen = 0; totalQuestsCompletedRenown = 0; questsCompletedRenown = 0; skillPoints = 0; totalSkillPoints = 0; researchTime = 0; StatisticsTracker.lifetimeMoney.setValue(money); builtItems = new List <Industry>(); resetLevel = 1; upgrades.Clear(); SetDefaultUpgrades(); currentGuildmaster = new Master(); miscInventory.Clear(); unidentifiedRelics.Clear(); AchievementsManager.setupUI(); }
public void reset() { foreach (Industry ind in builtItems) { ind.quantityStored = 0; ind.SetRawVendors(0); ind.setTimeRemaining(0); ind.level = 0; ind.consumeAmount = 0; foreach (IndustryInput input in ind.inputs) { Main.Destroy(input.arrow); } Main.Destroy(ind.craftingGridGO); ind.craftingGridGO = null; ind.apprentices = 0; ind.resetCache(); } currentApprentices = 0; currentVendors = 0; builtItems = new List <Industry>(); //Debug.Log("digits: " + digits); //double digitsCur = BigInteger.Log10(money / moneyFloor); //Debug.Log(renown + "," + totalRenown); BigInteger spentRenown = totalRenown - renown; //Debug.Log("before: " + lifetimeMoney); //TODO: Lifetime money -> renown calc is WRONG //Immediate reset after reseting will generate renown for doing NOTHING BigInteger newRenown = BigInteger.CubeRoot(StatisticsTracker.lifetimeMoney.value); BigInteger totRen = newRenown; newRenown -= StatisticsTracker.lastResetRenownGain.value; StatisticsTracker.lastResetRenownGain.setValue(totRen); //Debug.Log("totalRenown1: " + totalRenown); newRenown /= 10000; //Debug.Log("totalRenown2: " + totalRenown); //Debug.Log("end: " + totalRenown + " - " + spentRenown + " + " + questsCompleted + " + " + newRenown + " = " + (totalRenown - spentRenown + questsCompleted)); totalRenown += questsCompletedRenown + newRenown; renown = totalRenown - spentRenown; StatisticsTracker.lifetimeRenown.addValue(questsCompletedRenown + newRenown); //skillPoints += (int)digitsCur; //moneyFloor *= 2; money = GetStartingCash(); totalQuestsCompletedRenown = 0; questsCompletedRenown = 0; /*StatisticsTracker.questsCompleted.resetValue(); * StatisticsTracker.minQuestDifficulty.resetValue(); * StatisticsTracker.maxQuestDifficulty.resetValue();*/ StatisticsTracker.newLevelReset(); _questTypeCompletion.Clear(); if (StatisticsTracker.firstEnchantment.isAchieved()) { StatisticsTracker.maxQuestDifficulty.addValue(2); StatisticsTracker.minQuestDifficulty.addValue(1); } if (StatisticsTracker.firstGuildmaster.isAchieved()) { StatisticsTracker.maxQuestDifficulty.addValue(2); StatisticsTracker.minQuestDifficulty.addValue(1); } if (StatisticsTracker.relicsMade.value >= 1) { StatisticsTracker.maxQuestDifficulty.addValue(1); } if (StatisticsTracker.twentiethQuestCompleted.isAchieved()) { StatisticsTracker.maxQuestDifficulty.addValue(2); } GuildManager.resetAllUpgrades(); }