public override Node SetUp_Tree() { Node fall = new Fall_Action(); Node attack = new Attack_Action(); Node skill = new Skill_Action(); Node swap = new Swap_Action(); Node ws1 = new WS_1_Action(); Node ws2 = new WS_2_Action(); Node idle = new Idle_Action(); return(Node_Selector.Create(attack, skill, swap, ws1, ws2, fall, idle)); }
public override Node SetUp_Tree() { Node fall = new Fall_Action(); Node jump = new Jump_Action(); Node run = new Run_Action(); Node attack = new Attack_Action(); Node crouch = new Crouch_Action(); Node skill = new Skill_Action(); Node swap = new Swap_Action(); Node ws1 = new WS_1_Action(); Node ws2 = new WS_2_Action(); Node idle = new Idle_Action(); return(Node_Selector.Create(fall, jump, run, attack, skill, swap, ws1, ws2, crouch, idle)); }
protected override void InCombatDecesion() { //Attack action if (InRange()) { if (!GetComponent <Movement_Action>().LookingAtPlayer()) { current_action.Interupt(); next_action = GetComponent <FacePlayer_Action>(); return; } bool attack_ready = attack_timer >= attack_cooldown; if (attack_ready) { attack_timer = 0.0f; state = AI_STATE.AI_ATTACKING; Attack_Action action = GetComponent <Attack_Action>(); action.SetDamage(attack_damage); current_action = action; current_action.ActionStart(); return; } else { state = AI_STATE.AI_IDLE; current_action = GetComponent <IdleAttack_Action>(); current_action.ActionStart(); return; } } else if (player_detected == true && Disable_Movement_Gameplay_Debbuger == false) { GetComponent <ChasePlayer_Action>().ActionStart(); current_action = GetComponent <ChasePlayer_Action>(); return; } }
protected override void InCombatDecesion() { //Attack action if (InRange()) { bool attack_ready = attack_timer >= attack_cooldown; if (!GetComponent <Movement_Action>().LookingAtPlayer()) { current_action.Interupt(); next_action = GetComponent <FacePlayer_Action>(); return; } else if (shield_block_timer >= shield_block_cd && player.GetComponent <CharactersManager>().GetCurrentCharacterName() == "Jaime") { MovementController.Direction player_dir = GetLinkedObject("player_obj").GetComponent <MovementController>().GetPlayerDirection(); Movement_Action.Direction enemy_dir = GetComponent <Movement_Action>().SetDirection(); if (player_dir == MovementController.Direction.NORTH && enemy_dir == Movement_Action.Direction.DIR_SOUTH || player_dir == MovementController.Direction.SOUTH && enemy_dir == Movement_Action.Direction.DIR_NORTH || player_dir == MovementController.Direction.EAST && enemy_dir == Movement_Action.Direction.DIR_WEST || player_dir == MovementController.Direction.WEST && enemy_dir == Movement_Action.Direction.DIR_EAST) { next_action = GetComponent <ShieldBlock_Action>(); } return; } else if (attack_ready) { attack_timer = 0.0f; state = AI_STATE.AI_ATTACKING; Attack_Action action = GetComponent <Attack_Action>(); action.SetDamage(attack_damage); current_action = action; current_action.ActionStart(); return; } else { state = AI_STATE.AI_IDLE; current_action = GetComponent <IdleAttack_Action>(); current_action.ActionStart(); return; } } else if (player_detected == true && Disable_Movement_Gameplay_Debbuger == false) { if (player.GetComponent <CharactersManager>().GetCurrentCharacterName() == "Jaime") { GetComponent <ChasePlayer_Action>().SetBlocking(false); GetComponent <ChasePlayer_Action>().ActionStart(); current_action = GetComponent <ChasePlayer_Action>(); } else { GetComponent <ChasePlayer_Action>().SetBlocking(true); GetComponent <ChasePlayer_Action>().ActionStart(); current_action = GetComponent <ChasePlayer_Action>(); } return; } }