Ejemplo n.º 1
0
    public override ACTION_RESULT ActionUpdate()
    {
        if (GetComponent <Movement_Action>().NextToPlayer() == true || interupt == true)
        {
            move.Interupt();
        }

        timer += Time.deltaTime;

        if (timer >= check_player_timer && move.CenteredInTile())
        {
            timer = 0.0f;
            move.GoToPlayer(chase_range);
        }

        ///Make Move update
        ACTION_RESULT move_return = move.ActionUpdate();

        if (move_return != ACTION_RESULT.AR_IN_PROGRESS)
        {
            move.ActionEnd();
        }

        return(move_return);
    }
Ejemplo n.º 2
0
    public override ACTION_RESULT ActionUpdate()
    {
        if (forgot_event == true || move.NextToPlayer() == true || interupt == true)
        {
            move.Interupt();
        }

        if (forgot_event == false)
        {
            timer += Time.deltaTime;

            if (timer >= check_player_timer && move.CenteredInTile())
            {
                if (player.GetComponent <CharactersManager>().GetCurrentCharacterName() == "Jaime")
                {
                    comp_anim.PlayAnimationNode("Chase");
                    SetBlocking(false);
                    move.SetBlocking(false);
                }
                else
                {
                    SetBlocking(true);
                    move.SetBlocking(true);
                }

                timer = 0.0f;

                if (bt == GetComponent <EnemySpear_BT>())
                {
                    move.GoToPlayer(1);
                }
                else
                {
                    move.GoToPlayer((uint)bt.range);
                }
            }

            if (percep_sight.player_seen == false)
            {
                event_to_react.start_counting = true;
            }
            else
            {
                event_to_react.start_counting = false;
            }
        }
        ///Make Move update
        move_return = move.ActionUpdate();

        if (move_return != ACTION_RESULT.AR_IN_PROGRESS)
        {
            move.ActionEnd();
        }

        return(move_return);
    }