Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

// Token: 0x06000090 RID: 144 RVA: 0x00004C91 File Offset: 0x00003091 private void UpdateItemSelection() { this.itemSelect.anchoredPosition = new Vector3((float)this.itemSelectOffset[this.itemSelected], -10f, 10f); //Moves the item selector background(the red rectangle) this.UpdateItemName(); }

// Token: 0x06000091 RID: 145 RVA: 0x00004CC8 File Offset: 0x000030C8 public void CollectItem(int item_ID) { if (this.item[0] == 0) { this.item[0] = item_ID; //Set the item slot to the Item_ID provided this.itemSlot[0].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID } else if (this.item[1] == 0) { this.item[1] = item_ID; //Set the item slot to the Item_ID provided this.itemSlot[1].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID } else if (this.item[2] == 0) { this.item[2] = item_ID; //Set the item slot to the Item_ID provided this.itemSlot[2].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID } else if (this.item[3] == 0) { this.item[3] = item_ID; //Set the item slot to the Item_ID provided this.itemSlot[3].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID } else if (this.item[4] == 0) { this.item[4] = item_ID; //Set the item slot to the Item_ID provided this.itemSlot[4].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID } else //This one overwrites the currently selected slot when your inventory is full { this.item[this.itemSelected] = item_ID; this.itemSlot[this.itemSelected].texture = this.itemTextures[item_ID]; } this.UpdateItemName(); }

// Token: 0x06000092 RID: 146 RVA: 0x00004D94 File Offset: 0x00003194 private void UseItem() { if (this.item[this.itemSelected] != 0) //If the item slot isn't empty { if (this.item[this.itemSelected] == 1)  //Zesty Bar Code { this.player.stamina = this.player.maxStamina * 2f; this.ResetItem(); //Remove the item this.audioDevice.PlayOneShot(this.aud_Crunch); // Plays the Crunch Sound this.baldiScrpt.Hear(base.transform.position, 10f); // Makes Baldi go to the location where the Player was eating the ESFB if (!this.player.Outside) this.player.ResetGuilt("eat", 1f); // Makes the player guilty for eating } else if (this.item[this.itemSelected] == 2) //Yellow Door Lock Code { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit; if (Physics.Raycast(ray, out raycastHit) && (raycastHit.collider.tag == "SwingingDoor" & Vector3.Distance(this.playerTransform.position, raycastHit.transform.position) <= 10f)) { raycastHit.collider.gameObject.GetComponent<SwingingDoorScript>().LockDoor(15f); //Lock the door for 15 seconds this.ResetItem(); //Remove the item } } else if (this.item[this.itemSelected] == 3) //Principal's Keys Code { Ray ray2 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit2; if (Physics.Raycast(ray2, out raycastHit2) && (raycastHit2.collider.tag == "Door" & Vector3.Distance(this.playerTransform.position, raycastHit2.transform.position) <= 10f)) { raycastHit2.collider.gameObject.GetComponent<DoorScript>().UnlockDoor(); //Unlock the door raycastHit2.collider.gameObject.GetComponent<DoorScript>().OpenDoor(); //Open the door this.ResetItem(); //Remove the item } } else if (this.item[this.itemSelected] == 4) //Bsoda Code { UnityEngine.Object.Instantiate<GameObject>(this.bsodaSpray, this.playerTransform.position, this.cameraTransform.rotation); //Clone the BSODA Spray object this.ResetItem(); //Remove the item this.player.ResetGuilt("drink", 1f); // Makes the player guilty for drinking this.audioDevice.PlayOneShot(this.aud_Soda); // Play the spray sound this.baldiScrpt.Hear(base.transform.position, 10f); // Makes Baldi go to the location where the Player was drinking the BSODA if (!this.player.Outside) this.player.ResetGuilt("drink", 1f); // Makes the player guilty for drinking } else if (this.item[this.itemSelected] == 5) //Quarter Code { Ray ray3 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit3; if (Physics.Raycast(ray3, out raycastHit3)) { if (raycastHit3.collider.name == "BSODAMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) { this.ResetItem(); //Remove the item  this.CollectItem(4); //Give BSODA } else if (raycastHit3.collider.name == "ZestyMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) { this.ResetItem(); //Remove the item this.CollectItem(1); //Give Zesty Bar } else if (raycastHit3.collider.name == "PayPhone" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) { raycastHit3.collider.gameObject.GetComponent<TapePlayerScript>().Play(); //Tell the phone to start making the noise this.ResetItem(); //Remove the item } else if (raycastHit3.collider.name == "RandomMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) { int num3 = Mathf.RoundToInt(UnityEngine.Random.Range(1, 10)); this.ResetItem(); //Remove the item this.CollectItem(num3); //Give a random item } } } else if (this.item[this.itemSelected] == 6) // Baldi Anti-hearing Code { Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit4; if (Physics.Raycast(ray4, out raycastHit4) && (raycastHit4.collider.name == "TapePlayer" & Vector3.Distance(this.playerTransform.position, raycastHit4.transform.position) <= 10f)) { raycastHit4.collider.gameObject.GetComponent<TapePlayerScript>().Play(); //Tell the tape player to start making the noise this.ResetItem(); } } else if (this.item[this.itemSelected] == 7) // Alarm Clock Code { GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.alarmClock, this.playerTransform.position, this.cameraTransform.rotation); //Create a clone of the Alarm Clock gameObject.GetComponent<AlarmClockScript>().baldi = this.baldiScrpt; //Set the Alarm Clock's Baldi to the BaldiScript this.ResetItem(); //Remove the item } else if (this.item[this.itemSelected] == 8) // WD No Squee Code { Ray ray5 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit5; if (Physics.Raycast(ray5, out raycastHit5) && (raycastHit5.collider.tag == "Door" & Vector3.Distance(this.playerTransform.position, raycastHit5.transform.position) <= 10f)) { raycastHit5.collider.gameObject.GetComponent<DoorScript>().SilenceDoor(); // Silences the door this.ResetItem(); //Remove the item this.audioDevice.PlayOneShot(this.aud_Spray); //Plays the spray sound } } else if (this.item[this.itemSelected] == 9) // Safety Scissors Code { Ray ray6 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit6; if (this.player.jumpRope) { this.ResetItem(); this.player.ResetGuiltBrokenRulesOutside("bully", 1f); this.player.DeactivateJumpRope(); this.playtimeScript.Disappoint(); } else if (Physics.Raycast(ray6, out raycastHit6) && raycastHit6.collider.name == "1st Prize") { this.firstPrizeScript.GoCrazy(); this.ResetItem(); } } else if (this.item[this.itemSelected] == 10) // Portable Alarm Clock Code { GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.portTape, this.playerTransform.position, this.cameraTransform.rotation); //Create a clone of the Portable Tape gameObject.GetComponent<TapeDropScript>().baldi = this.baldiScrpt; //Set the Portable Tape's Baldi to the BaldiScript this.ResetItem(); //Remove the item } else if (this.item[this.itemSelected] == 11) // Stab Pencil Code { RaycastHit raycastHit; if (Physics.Raycast(Camera.main.ScreenPointToRay(new Vector3((float)(Screen.width / 2), (float)(Screen.height / 2), 0f)), out raycastHit) && raycastHit.collider.tag == "NPC" && raycastHit.collider.name != "Baldi" && Vector3.Distance(this.playerTransform.position, raycastHit.transform.position) <= 10f) { StartCoroutine(PencilStun(raycastHit.transform.gameObject)); this.ResetItem(); this.player.ResetGuiltBrokenRulesOutside("stabbing", 1f); } return; } else if (this.item[this.itemSelected] == 12) // Dollar Code { Ray ray3 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit3; if (Physics.Raycast(ray3, out raycastHit3)) { if (raycastHit3.collider.name == "BSODAMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) //If the dollar is inserted in the bsoda machine { this.ResetItem(); //Remove the dollar from that slot this.item[0] = 4; //Put a bsoda in item slot 1 this.item[1] = 4; //Put a bsoda in item slot 2 this.item[2] = 4; //Put a bsoda in item slot 3 this.item[3] = 4; //Put a bsoda in item slot 4 this.itemSlot[0].texture = this.itemTextures[4]; //Put the bsoda texture in slot 1 this.itemSlot[1].texture = this.itemTextures[4]; //Put the bsoda texture in slot 2 this.itemSlot[2].texture = this.itemTextures[4]; //Put the bsoda texture in slot 3 this.itemSlot[3].texture = this.itemTextures[4]; //Put the bsoda texture in slot 4 this.UpdateItemName(); //Update the item names for the slots } //Basically, if you put a dollar in the bsoda machine, it gives you 4 bsodas in your first 4 slots

else if (raycastHit3.collider.name == "DollarMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) //If the dollar is inserted in the dollar machine { this.ResetItem(); //Remove the dollar from that slot this.item[0] = 5; //Put a quarter in item slot 1 this.item[1] = 5; //Put a quarter in item slot 2 this.item[2] = 5; //Put a quarter in item slot 3 this.item[3] = 5; //Put a quarter in item slot 4 this.itemSlot[0].texture = this.itemTextures[5]; //Put the quarter texture in slot 1 this.itemSlot[1].texture = this.itemTextures[5]; //Put the quarter texture in slot 2 this.itemSlot[2].texture = this.itemTextures[5]; //Put the quarter texture in slot 3 this.itemSlot[3].texture = this.itemTextures[5]; //Put the quarter texture in slot 4 this.UpdateItemName(); //Update the item names for the slots } //Basically, if you put a dollar in the dollar machine, it gives you 4 quarters in your first 4 slots

else if (raycastHit3.collider.name == "RareMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) //If player uses quarter on the rare machine { this.ResetItem(); //Remove the item this.CollectItem(15); //Give the player a Teleporter Item this.raremachine.SetActive(false); //Despawn the rare machine }

} } }

else if (this.item[this.itemSelected] == 13) // Principal Banner Code { StartCoroutine(PrincipalBanner()); this.ResetItem(); }

else if (this.item[this.itemSelected] == 14) // Chewsi Speedy Bar Code { StartCoroutine(ChewsiBar()); this.ResetItem(); this.audioDevice.PlayOneShot(this.aud_Crunch); // Plays the Crunch Sound this.baldiScrpt.Hear(base.transform.position, 10f); // Makes Baldi go to the location where the Player was eating the CSB if (!this.player.Outside) this.player.ResetGuilt("eat", 1f); // Makes the player guilty for eating }

else if (this.item[this.itemSelected] == 15) // Teleporter Code { base.StartCoroutine(this.Teleporter()); this.ResetItem(); }

else if (this.item[this.itemSelected] == 16) // Water Bottle Code

{ this.player.stamina += 75f; this.ResetItem(); //Remove the item this.audioDevice.PlayOneShot(this.aud_DrinkWater); // Plays the Drink Water Sound this.baldiScrpt.Hear(base.transform.position, 10f); // Makes Baldi go to the location where the Player was drinking water if (!this.player.Outside) this.player.ResetGuilt("drink", 1f); // Makes the player guilty for drinking } else if (this.item[this.itemSelected] == 17) // Ice Cream Code { this.player.stamina += 150f; this.ResetItem(); //Remove the item this.audioDevice.PlayOneShot(this.aud_EatIceCream); // Makes the Eat Ice Cream sound this.baldiScrpt.Hear(base.transform.position, 10f); // Makes Baldi go to the location where the Player was eating the Ice Cream if (!this.player.Outside) this.player.ResetGuilt("eat", 1f); } else if (this.item[this.itemSelected] == 18) // Pancake Code { this.player.maxStamina += 12.5f; this.player.stamina += 25f; this.ResetItem(); //Remove the item this.audioDevice.PlayOneShot(this.aud_EatPancake); this.baldiScrpt.Hear(base.transform.position, 10f); // Makes Baldi go to the location where the Player was eating the Pancake if (!this.player.Outside) this.player.ResetGuilt("eat", 1f); } else if (this.item[this.itemSelected] == 19) //A Piece of Gum Code { UnityEngine.Object.Instantiate<GameObject>(this.PlayerGum, this.playerTransform.position, this.cameraTransform.rotation); //Clone the Player's Gum object this.ResetItem(); //Remove the item this.player.ResetGuiltBrokenRulesOutside("spitgum", 1f); // Makes the player guilty for spitting gum this.audioDevice.PlayOneShot(this.aud_SpitGum); // Play the spray sound this.baldiScrpt.Hear(base.transform.position, 10f); // Makes Baldi go to the location where the Player was Spitting a gum this.PlayerGum.name = "Player's Gum"; } else if (this.item[this.itemSelected] == 20) // Principal's Dollar Code { Ray ray3 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit3; if (Physics.Raycast(ray3, out raycastHit3)) { if (raycastHit3.collider.name == "BSODAMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) //If the dollar is inserted in the bsoda machine { this.ResetItem(); //Remove the dollar from that slot this.item[0] = 4; //Put a bsoda in item slot 1 this.item[1] = 4; //Put a bsoda in item slot 2 this.item[2] = 4; //Put a bsoda in item slot 3 this.item[3] = 4; //Put a bsoda in item slot 4 this.itemSlot[0].texture = this.itemTextures[4]; //Put the bsoda texture in slot 1 this.itemSlot[1].texture = this.itemTextures[4]; //Put the bsoda texture in slot 2 this.itemSlot[2].texture = this.itemTextures[4]; //Put the bsoda texture in slot 3 this.itemSlot[3].texture = this.itemTextures[4]; //Put the bsoda texture in slot 4 this.UpdateItemName(); //Update the item names for the slots this.player.ResetGuiltBrokenRulesOutside("usepridollar", 1f); }

else if (raycastHit3.collider.name == "DollarMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) //If the dollar is inserted in the dollar machine { this.ResetItem(); //Remove the dollar from that slot this.item[0] = 5; //Put a quarter in item slot 1 this.item[1] = 5; //Put a quarter in item slot 2 this.item[2] = 5; //Put a quarter in item slot 3 this.item[3] = 5; //Put a quarter in item slot 4 this.itemSlot[0].texture = this.itemTextures[5]; //Put the quarter texture in slot 1 this.itemSlot[1].texture = this.itemTextures[5]; //Put the quarter texture in slot 2 this.itemSlot[2].texture = this.itemTextures[5]; //Put the quarter texture in slot 3 this.itemSlot[3].texture = this.itemTextures[5]; //Put the quarter texture in slot 4 this.UpdateItemName(); //Update the item names for the slots this.player.ResetGuiltBrokenRulesOutside("usepridollar", 1f); }

else if (raycastHit3.collider.name == "RareMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f) //If player uses quarter on the rare machine { this.ResetItem(); //Remove the item this.CollectItem(15); //Give the player a Teleporter Item this.raremachine.SetActive(false); //Despawn the rare machine this.player.ResetGuiltBrokenRulesOutside("usepridollar", 1f); } } } }