/// <summary> /// Assigns the initial player location value in the hivemind. /// </summary> private void Start() { // TODO: This should really be in Hivemind's start, but we ended up not using Hivemind GameObject dungeoneer = GameObject.Find("DungeonSummoner"); if (dungeoneer != null) { Hivemind hivemind = dungeoneer.GetComponent <Hivemind>(); hivemind.lastPlayerLocation = originalSpawn; } // Debug.Log(hivemind.lastPlayerLocation.vector); }
/// <summary> /// Initializes the necessary fields for the debt collector and /// initializes the AStar script. /// </summary> private void Start() { if (player == null) { player = GameObject.FindGameObjectWithTag("Player"); } controller = GetComponentInParent <CharacterController>(); GameObject dungeonMaster = GameObject.Find("DungeonSummoner"); hivemind = dungeonMaster.GetComponent <Hivemind>(); pathfinder = hivemind.pathfinder; lastVisitedNode = spawnPoint; teleportationHeight = dungeonMaster.GetComponent <Dungeoneer>().currentDungeonType.wallHeight * 0.8f; // LayerMask.NameToLayer can only be used at runtime. jumpable = ((1 << LayerMask.NameToLayer("Obstacle")) | (1 << LayerMask.NameToLayer("Explosive") | (1 << LayerMask.NameToLayer("Decoration")))); avoidance = (1 << LayerMask.NameToLayer("Wall")); // Set stun thresholds. stunThresholdModifier = (float)Mathf.Log10(Mathf.Pow(StateManager.totalFloorsVisited, 0.3f)) + StateManager.totalFloorsVisited / 4.0f + 1.0f; stunThreshold = ((float)Mathf.Pow(StateManager.totalDebt, 1.7f) / 3333.0f + 15) * stunThresholdModifier; // Set speed. if (float.IsNaN(debtSpeedMod) || float.IsInfinity(debtSpeedMod)) { debtSpeedMod = 1; } float playerSpeed = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().speed; debtSpeedMod = Mathf.Clamp(debtSpeedMod, 1, Mathf.Ceil(playerSpeed / movementSpeed + 0.5f)); movementSpeed *= debtSpeedMod; // Determine extents of the box check for climbing/jumping footSize = controller.bounds.extents.y * 1.1f; // DEBUG #if UNITY_EDITOR //Debug.Log("LAST VISITED NODE: " + lastVisitedNode.vector); Debug.Log($"DC speed is {movementSpeed} and x{debtSpeedMod}; player speed is {playerSpeed}"); #endif }
public static void Postfix(Hivemind __instance) { LootTables.DropLoot("entity:" + __instance.transform.GetHighestParent().name.Split(' ', '(')[0], __instance.transform.position); }
public static void Postfix(Hivemind __instance) { AggroOnHit.SetPlayerTarget(__instance); }