override public BT_Status StartAction() { GameObject temp = Instantiate(part_sys); temp.transform.position = transform.position; temp.transform.rotation = Quaternion.Euler(-180, 0, 0); temp.GetComponent <ParticleSystem>().Play(); gameObject.SetActive(false); GameObject go = Instantiate(enemySpawn); if (myBT.enemy_type == Enemy_type.DAGDA_ENEMY) { go.transform.position = ((BT_Dagda)myBT).StarterPos; Dullahan_Blackboard bb = go.GetComponentInChildren <Dullahan_Blackboard>(); bb.playerIsInsideRoom.SetValue(true); } if (myBT.enemy_type == Enemy_type.DULLAHAN_ENEMY) { go.transform.position = ((BT_Dullahan)myBT).StarterPos; Morrigan_Blackboard bb = go.GetComponentInChildren <Morrigan_Blackboard>(); bb.playerIsInsideRoom.SetValue(true); } return(BT_Status.RUNNING); }
private void React_To_Slash() { //Debug.Log("Enemies detected: " + enemies_found.Length); cam_manager.Cam_Shake(); foreach (Collider2D col in enemies_found) { Transform parent = col.transform.parent; if (parent != null) { //Detect enemy type BT_Soldier soldier = parent.GetComponent <BT_Soldier>(); if (soldier != null) { if (soldier.currentAction != null) { soldier.currentAction.isFinish = true; } soldier.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); Soldier_Blackboard bb_soldier = parent.GetComponent <Soldier_Blackboard>(); bb_soldier.is_enemy_hit.SetValue(true); } BT_Caorthannach Caorth = parent.GetComponent <BT_Caorthannach>(); if (Caorth != null) { if (Caorth.currentAction != null) { Caorth.currentAction.isFinish = true; } Caorth.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); Caorthannach_Blackboard bb_caorth = parent.GetComponent <Caorthannach_Blackboard>(); bb_caorth.is_enemy_hit.SetValue(true); } BT_Kelpi Kelpi = parent.GetComponent <BT_Kelpi>(); if (Kelpi != null) { /*if (Kelpi.currentAction != null) * { * Kelpi.currentAction.isFinish = true; * }*/ Kelpi.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); Kelpi_Blackboard bb_kelpi = parent.GetComponent <Kelpi_Blackboard>(); bb_kelpi.is_enemy_hit.SetValue(true); } BT_MacLir Maclir = parent.GetComponent <BT_MacLir>(); if (Maclir != null) { if (Maclir.currentAction != null) { Maclir.currentAction.isFinish = true; } Maclir.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); MacLir_Blackboard bb_maclir = parent.GetComponent <MacLir_Blackboard>(); bb_maclir.is_enemy_hit.SetValue(true); } BT_DearDug DearDug = parent.GetComponent <BT_DearDug>(); if (DearDug != null) { if (DearDug.currentAction != null) { DearDug.currentAction.isFinish = true; } DearDug.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); DearDug_Blackboard dearDugBB = parent.GetComponent <DearDug_Blackboard>(); dearDugBB.is_enemy_hit.SetValue(true); } BT_Banshee Banshee = parent.GetComponent <BT_Banshee>(); if (Banshee != null) { if (Banshee.currentAction != null) { Banshee.currentAction.isFinish = true; } Banshee_Blackboard bansheeBB = parent.GetComponent <Banshee_Blackboard>(); if (Banshee.myState == BT_Banshee.BansheeState.STUNNED_BANSHEE) { Banshee.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); bansheeBB.is_enemy_hit.SetValue(true); } else { bansheeBB.want_to_hit.SetValue(true); } } BT_Dagda Dagda = parent.GetComponent <BT_Dagda>(); if (Dagda != null) { if (Dagda.currentAction != null) { Dagda.currentAction.isFinish = true; } Dagda_Blackboard dagdaBB = parent.GetComponent <Dagda_Blackboard>(); Dagda.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); dagdaBB.is_enemy_hit.SetValue(true); } BT_Dullahan Dullahan = parent.GetComponent <BT_Dullahan>(); if (Dullahan != null) { if (Dullahan.currentAction != null) { Dullahan.currentAction.isFinish = true; } Dullahan_Blackboard dullahanBB = parent.GetComponent <Dullahan_Blackboard>(); Dullahan.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); dullahanBB.is_enemy_hit.SetValue(true); } BT_Morrigan Morrigan = parent.GetComponent <BT_Morrigan>(); if (Morrigan != null) { if (Morrigan.currentAction != null) { Morrigan.currentAction.isFinish = true; } Morrigan_Blackboard morriganBB = parent.GetComponent <Morrigan_Blackboard>(); Morrigan.Enemy_Live_Modification(-player_stats.Right_Hand_Object.damage); morriganBB.is_enemy_hit.SetValue(true); } } else { Debug.Log("Parent null _Slash_Attack"); } } System.Array.Clear(enemies_found, 0, enemies_found.Length); //Call enemy damage function }