private void StartBossDeathSequence() { Debug.Log("starting death sequence"); // explosions for (int i = 0; i < 32; i++) { StartCoroutine(ExecuteAfterTime(UnityEngine.Random.Range(0, 2.4f), () => { Vector3 randomPos = explodePosition.position + new Vector3( UnityEngine.Random.Range(0, 2f), UnityEngine.Random.Range(0, 6f), UnityEngine.Random.Range(0, 2f)) - new Vector3(0, 3f, 0); explosionHandler.PortalExplosion(randomPos); })); } // cheering animation game.celebrating = true; // dwarf convo StartCoroutine(ExecuteAfterTime(2f, () => { cameraController.focusTransform = null; convoHandler.StartConvo(conversation); startedConvo = true; })); // fade out to pub }
internal void TeleportPlayerRandomly() { explosionHandler.PortalExplosion(player.transform.position); explosionHandler.PortalExplosion(player.transform.position + new Vector3(0.8f, 0, 0)); explosionHandler.PortalExplosion(player.transform.position + new Vector3(0, 0, -0.8f)); actionedNode = null; selectedNode = null; finalDiceRoll = -100; hasRolled = false; List <Transform> children = new List <Transform>(); foreach (Transform child in map.transform) { if (child.gameObject.GetComponent <Node>() != null) { children.Add(child); } } int choiceIndex = UnityEngine.Random.Range(0, children.Count); player.Teleport(children[choiceIndex].position); explosionHandler.PortalExplosion(player.transform.position); StartCoroutine(ExecuteAfterTime(0.2f, () => { explosionHandler.PortalExplosion(player.transform.position + new Vector3(0, 0, -0.8f)); explosionHandler.PortalExplosion(player.transform.position + new Vector3(0.8f, 0, 0)); })); }