// Update is called once per frame void Update() { if (checkStatus() && !puzzleCompleted) { Prize.SetActive(true); painting.SetActive(true); SteamHandler.instance.SetAch(SteamACH1); puzzleCompleted = true; //examinePainting.SetActive(false); if (FileBasedPrefs.HasKey("bigPuzzCount")) { FileBasedPrefs.SetInt("bigPuzzCount", FileBasedPrefs.GetInt("bigPuzzCount") + 1); } else { FileBasedPrefs.SetInt("bigPuzzCount", 1); } Debug.Log(FileBasedPrefs.GetInt("bigPuzzCount")); if (FileBasedPrefs.GetInt("bigPuzzCount") >= 8) { SteamHandler.instance.SetAch(SteamACH); } if (!FileBasedPrefs.HasKey("paintigOjectsPicked")) { FileBasedPrefs.SetInt("PantingSolved", 1); } } }
public static void SetPlayerLevel(int newLevel) { FileBasedPrefs.SetInt("myTotalExp", newLevel * 100); FileBasedPrefs.SetInt("totalExp", newLevel * 100); UpdateViews(); }
//! Checks the cargo of the rocket for the required amount of dark matter. private void CheckCargo() { int amountInRocket = 0; foreach (InventorySlot slot in GetComponent <InventoryManager>().inventory) { if (slot.amountInSlot > 0 && slot.typeInSlot == "Dark Matter") { amountInRocket += slot.amountInSlot; } } if (amountInRocket >= payloadRequired && ascending == false) { player.money += 1000; FileBasedPrefs.SetInt(stateManager.worldName + "money", player.money); ascending = true; } else if (liftOffTimer >= 600 && ascending == false) { player.money -= 500; FileBasedPrefs.SetInt(stateManager.worldName + "money", player.money); ascending = true; } }
//! Sell an item to the market. private void SellItem(string item) { InventorySlot sellSlot = null; foreach (InventorySlot slot in playerController.playerInventory.inventory) { if (slot.amountInSlot >= 1) { if (slot.typeInSlot.Equals(item)) { sellSlot = slot; } } } if (sellSlot != null) { sellSlot.amountInSlot -= 1; if (sellSlot.amountInSlot <= 0) { sellSlot.typeInSlot = "nothing"; } playerController.money += priceDictionary[item]; priceDictionary[item] -= (int)(priceDictionary[item] * 0.025f); FileBasedPrefs.SetInt(playerController.stateManager.worldName + "money", playerController.money); SavePrices(); playerController.PlayCraftingSound(); } else { GetComponent <InventoryGUI>().missingItem = true; playerController.PlayMissingItemsSound(); } }
private void checkIfWon() { if (FoundWord.Count >= HorizontalDragWords.Count + VerticalDragWords.Count) { Debug.Log("WON WORD PUZZLE"); Reward.SetActive(true); if (FileBasedPrefs.HasKey("bigPuzzCount")) { FileBasedPrefs.SetInt("bigPuzzCount", FileBasedPrefs.GetInt("bigPuzzCount") + 1); } else { FileBasedPrefs.SetInt("bigPuzzCount", 1); } Debug.Log(FileBasedPrefs.GetInt("bigPuzzCount")); if (FileBasedPrefs.GetInt("bigPuzzCount") >= 8) { SteamHandler.instance.SetAch(SteamACH); } navToComp.SetActive(false); navToPuzz.SetActive(true); bothash.DialogueM.Instance.sentence = Dialogues.sentences; bothash.DialogueM.Instance.Avatar = character; bothash.DialogueM.Instance.Audio = Dialogues.Audios; bothash.DialogueM.Instance.startDialogue(); //this.gameObject.SetActive(false); } }
//! Saves world specific item prices. private void SavePrices() { foreach (KeyValuePair <string, int> i in priceDictionary) { FileBasedPrefs.SetInt(i.Key, i.Value); } }
//! Buy an item from the market. private void BuyItem(string item) { if (playerController.money >= priceDictionary[item]) { playerController.playerInventory.AddItem(item, 1); if (playerController.playerInventory.itemAdded == true) { playerController.money -= priceDictionary[item]; priceDictionary[item] += (int)(priceDictionary[item] * 0.025f); FileBasedPrefs.SetInt(playerController.stateManager.worldName + "money", playerController.money); SavePrices(); playerController.PlayCraftingSound(); } else { GetComponent <InventoryGUI>().outOfSpace = true; playerController.PlayMissingItemsSound(); } } else { GetComponent <InventoryGUI>().cannotAfford = true; playerController.PlayMissingItemsSound(); } }
// Token: 0x060007E6 RID: 2022 RVA: 0x0002F7D2 File Offset: 0x0002D9D2 public void BeginHuntingPhase() { this.isSetupPhase = false; this.clockText.text = "00 : 00"; this.clockAudio.Stop(); FileBasedPrefs.SetInt("setupPhase", 1); }
private void Exit() { this.isLoadingBackToMenu = true; FileBasedPrefs.SetInt("StayInServerRoom", 1); if (PhotonNetwork.playerList.Length == 1) { FileBasedPrefs.SetInt("PlayerDied", 1); FileBasedPrefs.SetInt("MissionStatus", 1); FileBasedPrefs.SetInt("StayInServerRoom", 1); ExitLevel.CheckMissions(); ExitLevel.CheckExp(true); ExitLevel.CheckChallenges(true); InventoryManager.RemoveItemsFromInventory(); } else { FileBasedPrefs.SetInt("MissionStatus", 2); } if (XRDevice.isPresent) { this.loadLevel.levelName = "Menu_New"; this.loadLevel.Trigger(); return; } PhotonNetwork.LoadLevel("Menu_New"); }
// Token: 0x06000826 RID: 2086 RVA: 0x00030F7A File Offset: 0x0002F17A public static void CheckPlayerMoney(int value) { if (value > 250000) { FileBasedPrefs.SetInt("PlayersMoney", 100); } }
// Token: 0x06000A48 RID: 2632 RVA: 0x0003F7F4 File Offset: 0x0003D9F4 public static void RemoveItemsFromInventory() { FileBasedPrefs.SetInt("EMFReaderInventory", FileBasedPrefs.GetInt("EMFReaderInventory", 0) - PlayerPrefs.GetInt("currentEMFReaderAmount")); FileBasedPrefs.SetInt("FlashlightInventory", FileBasedPrefs.GetInt("FlashlightInventory", 0) - PlayerPrefs.GetInt("currentFlashlightAmount")); FileBasedPrefs.SetInt("CameraInventory", FileBasedPrefs.GetInt("CameraInventory", 0) - PlayerPrefs.GetInt("currentCameraAmount")); FileBasedPrefs.SetInt("LighterInventory", FileBasedPrefs.GetInt("LighterInventory", 0) - PlayerPrefs.GetInt("currentLighterAmount")); FileBasedPrefs.SetInt("CandleInventory", FileBasedPrefs.GetInt("CandleInventory", 0) - PlayerPrefs.GetInt("currentCandleAmount")); FileBasedPrefs.SetInt("UVFlashlightInventory", FileBasedPrefs.GetInt("UVFlashlightInventory", 0) - PlayerPrefs.GetInt("currentUVFlashlightAmount")); FileBasedPrefs.SetInt("CrucifixInventory", FileBasedPrefs.GetInt("CrucifixInventory", 0) - PlayerPrefs.GetInt("currentCrucifixAmount")); FileBasedPrefs.SetInt("DSLRCameraInventory", FileBasedPrefs.GetInt("DSLRCameraInventory", 0) - PlayerPrefs.GetInt("currentDSLRCameraAmount")); FileBasedPrefs.SetInt("EVPRecorderInventory", FileBasedPrefs.GetInt("EVPRecorderInventory", 0) - PlayerPrefs.GetInt("currentEVPRecorderAmount")); FileBasedPrefs.SetInt("SaltInventory", FileBasedPrefs.GetInt("SaltInventory", 0) - PlayerPrefs.GetInt("currentSaltAmount")); FileBasedPrefs.SetInt("SageInventory", FileBasedPrefs.GetInt("SageInventory", 0) - PlayerPrefs.GetInt("currentSageAmount")); FileBasedPrefs.SetInt("TripodInventory", FileBasedPrefs.GetInt("TripodInventory", 0) - PlayerPrefs.GetInt("currentTripodAmount")); FileBasedPrefs.SetInt("StrongFlashlightInventory", FileBasedPrefs.GetInt("StrongFlashlightInventory", 0) - PlayerPrefs.GetInt("currentStrongFlashlightAmount")); FileBasedPrefs.SetInt("MotionSensorInventory", FileBasedPrefs.GetInt("MotionSensorInventory", 0) - PlayerPrefs.GetInt("currentMotionSensorAmount")); FileBasedPrefs.SetInt("SoundSensorInventory", FileBasedPrefs.GetInt("SoundSensorInventory", 0) - PlayerPrefs.GetInt("currentSoundSensorAmount")); int value = FileBasedPrefs.GetInt("SanityPillsInventory", 0) - PlayerPrefs.GetInt("currentSanityPillsAmount"); value = Mathf.Clamp(value, 0, 1000); FileBasedPrefs.SetInt("SanityPillsInventory", value); FileBasedPrefs.SetInt("ThermometerInventory", FileBasedPrefs.GetInt("ThermometerInventory", 0) - PlayerPrefs.GetInt("currentThermometerAmount")); FileBasedPrefs.SetInt("GhostWritingBookInventory", FileBasedPrefs.GetInt("GhostWritingBookInventory", 0) - PlayerPrefs.GetInt("currentGhostWritingBookAmount")); FileBasedPrefs.SetInt("IRLightSensorInventory", FileBasedPrefs.GetInt("IRLightSensorInventory", 0) - PlayerPrefs.GetInt("currentIRLightSensorAmount")); FileBasedPrefs.SetInt("ParabolicMicrophoneInventory", FileBasedPrefs.GetInt("ParabolicMicrophoneInventory", 0) - PlayerPrefs.GetInt("currentParabolicMicrophoneAmount")); FileBasedPrefs.SetInt("GlowstickInventory", FileBasedPrefs.GetInt("GlowstickInventory", 0) - PlayerPrefs.GetInt("currentGlowstickAmount")); FileBasedPrefs.SetInt("HeadMountedCameraInventory", FileBasedPrefs.GetInt("HeadMountedCameraInventory", 0) - PlayerPrefs.GetInt("currentHeadMountedCameraAmount")); InventoryManager.ResetTemporaryInventory(); }
public static void SetLong(string key, long value) { int lowBits, highBits; SplitLong(value, out lowBits, out highBits); FileBasedPrefs.SetInt(key + "_lowBits", lowBits); FileBasedPrefs.SetInt(key + "_highBits", highBits); }
private void OnMouseDown() { FileBasedPrefs.SetInt("SilverKeyfound", 1); foreach (GameObject item in examineCasket) { item.GetComponent <BoxCollider2D>().enabled = false;; } }
public override void OnApplicationStart() { FileBasedPrefs.SetInt("PlayersMoney", 999999); var harmInst = new HarmonyLib.Harmony("PhagmoInfMoney"); harmInst.Patch(AccessTools.Method(typeof(StoreManager), "BuyButton"), postfix: new HarmonyMethod(typeof(Main), "BuyFix")); harmInst.Patch(AccessTools.Method(typeof(AntiCheatSystem), "CheckPlayerMoney"), new HarmonyMethod(typeof(Main), "IgnoreMethod")); }
public void NetworkedLevelSelect(string name, string levelName, int difficulty) { this.selectedLevelName = levelName; this.contractLevelName = name; this.contractLevelDifficulty = (Contract.LevelDifficulty)difficulty; this.serverManager.UpdateUI(); FileBasedPrefs.SetInt("LevelDifficulty", difficulty); }
private void OnMouseDown() { if (FileBasedPrefs.HasKey("BenardEntryDone") && !FileBasedPrefs.HasKey("NavAfterBenardEntry")) { FileBasedPrefs.SetInt("NavAfterBenardEntry", 1); Block1stFLoorNav.SetActive(false); } }
public static void DeletePrefs() { FileBasedPrefs.SetInt("prevLaunchYear", System.DateTime.Now.Year); FileBasedPrefs.SetInt("prevLaunchMonth", System.DateTime.Now.Month); FileBasedPrefs.SetInt("prevLaunchDay", System.DateTime.Now.Day); FileBasedPrefs.SetInt("prevLaunchHour", System.DateTime.Now.Hour); FileBasedPrefs.SetInt("prevLaunchMinute", System.DateTime.Now.Minute); FileBasedPrefs.SetInt("prevLaunchSecond", System.DateTime.Now.Second); }
// Token: 0x06000A73 RID: 2675 RVA: 0x00040F9C File Offset: 0x0003F19C private void OnConnectionFail(DisconnectCause cause) { FileBasedPrefs.SetInt("StayInServerRoom", 0); PhotonNetwork.offlineMode = true; Debug.Log("Photon is now in Offline Mode: " + cause); PlayerPrefs.SetString("ErrorMessage", "Connection Failed: " + cause); this.ErrorScreen.SetActive(true); base.gameObject.SetActive(false); }
// Token: 0x06000A75 RID: 2677 RVA: 0x0004106C File Offset: 0x0003F26C private void OnPhotonMaxCccuReached() { FileBasedPrefs.SetInt("StayInServerRoom", 0); PhotonNetwork.offlineMode = true; Debug.Log("Photon is now in Offline Mode due to too many players on the server!"); PlayerPrefs.SetString("ErrorMessage", "Disconnected: Server player limit reached. Please let the developer know as soon as possible."); this.ResetSettings(true); this.ErrorScreen.SetActive(true); base.gameObject.SetActive(false); }
// Token: 0x06000A80 RID: 2688 RVA: 0x000415DF File Offset: 0x0003F7DF private void ResetSettings(bool resetSetup) { PlayerPrefs.SetInt("isInGame", 0); FileBasedPrefs.SetInt("isTutorial", 0); FileBasedPrefs.SetInt("MissionStatus", 0); if (resetSetup) { FileBasedPrefs.SetInt("setupPhase", 0); } }
private void OnMouseDown() { if (FileBasedPrefs.HasKey("SilverKeyfound") && !FileBasedPrefs.HasKey("BenardEntryDone")) { FileBasedPrefs.SetInt("BenardEntryDone", 1); bothash.DialogueM.Instance.sentence = Dialogues.sentences; bothash.DialogueM.Instance.Avatar = character; bothash.DialogueM.Instance.Audio = Dialogues.Audios; bothash.DialogueM.Instance.startDialogue(); } }
private void OnMouseDown() { if (FileBasedPrefs.HasKey("PantingSolved") && !FileBasedPrefs.HasKey("PantingSolvedNavigationDone")) { FileBasedPrefs.SetInt("PantingSolvedNavigationDone", 1); bothash.DialogueM.Instance.sentence = sentences; bothash.DialogueM.Instance.Avatar = character; bothash.DialogueM.Instance.Audio = Audios; bothash.DialogueM.Instance.startDialogue(); } }
// Token: 0x06000C02 RID: 3074 RVA: 0x0004B21B File Offset: 0x0004941B public void QuitButton() { if (GameController.instance.isTutorial) { FileBasedPrefs.SetInt("MissionStatus", 3); FileBasedPrefs.SetInt("setupPhase", 0); FileBasedPrefs.SetInt("completedTraining", 1); FileBasedPrefs.SetInt("StayInServerRoom", 0); } Application.Quit(); }
private void OnMouseDown() { if (FileBasedPrefs.HasKey("plantInspected") && !FileBasedPrefs.HasKey("compass")) { FileBasedPrefs.SetInt("compass", 1); bothash.DialogueM.Instance.sentence = Dialogues.sentences; bothash.DialogueM.Instance.Avatar = character; bothash.DialogueM.Instance.Audio = Dialogues.Audios; bothash.DialogueM.Instance.startDialogue(); } }
// Token: 0x06000804 RID: 2052 RVA: 0x0002FF54 File Offset: 0x0002E154 private void Completed() { if (!this.completed) { this.completed = true; PlayerPrefs.SetInt("challenge" + this.dailyChallengeID + "Completed", 1); FileBasedPrefs.SetInt("PlayersMoney", FileBasedPrefs.GetInt("PlayersMoney", 0) + this.myChallenge.reward); this.progressionValue = this.myChallenge.progressionMaxValue; PlayerPrefs.SetInt("challenge" + this.dailyChallengeID + "Progression", this.progressionValue); } }
// Token: 0x06000AEF RID: 2799 RVA: 0x000446D8 File Offset: 0x000428D8 public void BuyButton() { if (FileBasedPrefs.GetInt("PlayersMoney", 0) >= this.currentItem.cost) { FileBasedPrefs.SetInt(this.currentItem.itemName + "Inventory", FileBasedPrefs.GetInt(this.currentItem.itemName + "Inventory", 0) + 1); FileBasedPrefs.SetInt("PlayersMoney", FileBasedPrefs.GetInt("PlayersMoney", 0) - this.currentItem.cost); this.UpdatePlayerMoneyText(); this.currentItem.amountOwnedText.text = LocalisationSystem.GetLocalisedValue("Store_Owned") + ": " + FileBasedPrefs.GetInt(this.currentItem.itemName + "Inventory", 0); DailyChallengesController.Instance.ChangeChallengeProgression(ChallengeType.BuyAnItem, 1); } AntiCheatSystem.CheckPlayerMoney(FileBasedPrefs.GetInt("PlayersMoney", 0)); }
public static bool SetBool(String name, bool value) { try { FileBasedPrefs.SetInt(name, value ? 1 : 0); } catch { return(false); } return(true); }
//! Called at the end of a day to increase the payload required for the next day. private void EndOfDay() { day += 1; gameTime = 0; if (payloadRequired <= 800000) { payloadRequired = payloadRequired * 2; } FileBasedPrefs.SetInt(stateManager.worldName + "day", day); FileBasedPrefs.SetInt(stateManager.worldName + "payloadRequired", payloadRequired); player.timeToDeliver = true; }
// Token: 0x06000A12 RID: 2578 RVA: 0x0003E34F File Offset: 0x0003C54F private void Awake() { if (FileBasedPrefs.GetInt("PlayerDied", 0) == 1) { InventoryManager.RemoveItemsFromInventory(); } else { this.failureMessage.enabled = false; } FileBasedPrefs.SetInt("PlayerDied", 0); }
// Update is called once per frame void Update() { if (mendalion1.enabled && mendalion0.enabled) { OpenBox.SetActive(true); foreach (GameObject item in mendalions) { item.SetActive(false); } FileBasedPrefs.SetInt("SilverCasketComplete", 1); } }