//Additional changes done in enemyhp when the enemy is frozen
    IEnumerator FreezeEnemy()
    {
        Icecycle.SetActive(true);
        if (emc != null)
        {
            emc.StopMovement();
        }
        if (ai != null)
        {
            ai.ChangeStatus(EnemyBehaviorStatus.Frozen);
            ai.anim.Play("Death");
            ai.anim.speed = 0;
        }
        yield return(new WaitForSeconds(PlayerDamageValues.Instance.FrostTimeToMelt));

        Icecycle.SetActive(false);
        if (emc != null)
        {
            emc.ResumeMovement();
        }
        if (ai != null)
        {
            ai.ChangeStatus(EnemyBehaviorStatus.Waiting);
            ai.anim.speed = 1;
            ai.anim.Play("Idle");
        }
        ChangeCondition(EnemyConditions.Normal);
    }
Exemplo n.º 2
0
    //in this future this will probably need to be a coroutine, becuase it might take a few seconds to change status and update animation
    //and once that is complete, start up whatever the next status is.
    public void UpdateEnemyBehaviorStatus()
    {
        anim.SetBool("TempSurround", false);
        switch (CurrentStatus)
        {
        case EnemyBehaviorStatus.PrimaryAttacker:
            GetEnemyMovementCtrl.ResumeMovement();
            break;

        case EnemyBehaviorStatus.ArcRunner:
            GetEnemyMovementCtrl.ResumeMovement();
            TravelAlongArc();
            break;

        case EnemyBehaviorStatus.SurroundPlayer:
            KeepDistance();
            break;

        case EnemyBehaviorStatus.Waiting:
            GetEnemyMovementCtrl.StopMovement();
            break;

        case EnemyBehaviorStatus.Attacking:
            break;

        case EnemyBehaviorStatus.Busy:
            break;

        case EnemyBehaviorStatus.Sleeping:
            GetEnemyMovementCtrl.StopMovement();
            break;

        case EnemyBehaviorStatus.Staggered:
            GetEnemyMovementCtrl.StopMovement();
            break;

        case EnemyBehaviorStatus.BeingFinished:
            GetEnemyMovementCtrl.StopMovement();
            break;

        default:
            GetEnemyMovementCtrl.StopMovement();
            break;
        }
    }