public override void UpdateItem() { ResetCooldown(); //TODO: Remove this once Shadow Demons are added to the room count. AI.AI[] ShadowDemons = GameObject.FindObjectsOfType <AI.ShadowDemonAI>(); for (int i = 0; i < ShadowDemons.Length; i++) { AI.AI enemy = ShadowDemons[i]; int damage = Mathf.RoundToInt(1); Status[] statuses = { Status.Burn }; enemy.TakeDamage(m_Player.PlayerNumber, damage, statuses, 1); } //Do damage to every enemy in the room by their max HP and apply burn for (int i = 0; i < m_Player.MyIslandRoom.EnemiesInRoomCount; i++) { AI.AI enemy = m_Player.MyIslandRoom.EnemiesInRoom[i]; int damage = Mathf.RoundToInt(enemy.Health.MaxHp / 2); if (m_Player.MyIslandRoom.TypeOfRoom == RoomType.Boss) { damage = 30; } Status[] statuses = { Status.Burn }; enemy.TakeDamage(m_Player.PlayerNumber, damage, statuses, 1); } }
private void ShockNearbyEnemies(Collider[] CollidersInRange) { //Loop though all the colliders and find all the AI in Range foreach (Collider collider in CollidersInRange) { //If the collider has an AI attached to it Apply damage to the AI AI.AI colliderAI = collider.GetComponent <AI.AI>(); if (collider != null) { colliderAI.TakeDamage(DamageCountManager.instance.PlayerWhoLastDealtDamage, ShockDamage, null, 1); } } }