public void OnEnter() { player = GameObject.Instantiate(PlayerPrototype); player.transform.position = PlayerSpawnLocation; Juicer.CreateFx(0, PlayerSpawnLocation); Juicer.ShakeCamera(0.5f); MusicBox.ChangeMusic((int)Song.Boss); DataDump.Set("HP", maxHP); DataDump.Set("ScaledHP", 1.0f); var cam = GameObject.Find("CinemachineStateCamera/GameCam").GetComponent <CinemachineVirtualCamera>(); cam.Follow = player.transform; cam.LookAt = player.transform; GameConductor.SetShowHud(true); }
public IEnumerator OnUpdate() { do { int currentHP = DataDump.Get <int>("HP") - 1; DataDump.Set("HP", currentHP); DataDump.Set("ScaledHP", (float)currentHP / maxHP); yield return(new WaitForSeconds(1)); } while (DataDump.Get <int>("HP") > 0); Juicer.CreateFx(0, player.transform.position); GameObject.Destroy(player); Juicer.ShakeCamera(1.5f); bool readyToMoveOn = false; MessageController.AddMessage("butterboi is dead now.", postAction: () => readyToMoveOn = true); while (!readyToMoveOn) { yield return(null); } }
public void OnGrowthStageChanged(int newStage) { Juicer.CreateFx(0, transform.position); switch ((GrowthStage)newStage) { case GrowthStage.Egg: ImpulseMover.GoHomeHack(); PhoenixStage.SetActive(false); EggStage.SetActive(true); MessageController.AddMessage("ah, an egg.."); MessageController.AddMessage("i wonder how it likes being poked"); break; case GrowthStage.Hatching: StartCoroutine(Hatch()); break; case GrowthStage.Baby: EggStage.SetActive(false); BabyStage.SetActive(true); break; case GrowthStage.Juvi: MusicBox.ChangeMusic(Song.Boss.ToInt()); BabyStage.SetActive(false); JuviStage.SetActive(true); var petType = CalculatePetType(); switch (petType) { case PetType.Cute: JuviCuteStage.SetActive(true); MessageController.AddMessage("aw, it grew into a cute one!"); break; case PetType.Chubby: JuviChubbyStage.SetActive(true); MessageController.AddMessage("heh, it grew into a chubby one!"); break; case PetType.Tough: JuviToughStage.SetActive(true); MessageController.AddMessage("oo, it grew into a tough one!"); break; } break; case GrowthStage.Dead: EggStage.SetActive(false); BabyStage.SetActive(false); JuviStage.SetActive(false); JuviCuteStage.SetActive(false); JuviChubbyStage.SetActive(false); JuviToughStage.SetActive(false); DeadStage.SetActive(true); break; case GrowthStage.Pheonix: DeadStage.SetActive(false); PhoenixStage.SetActive(true); break; } }