Exemplo n.º 1
0
    // Launching slime logic
    private IEnumerator Attack_Action()
    {
        // Wait for the good animation frame;
        yield return(new WaitForSeconds(4f / 6f));    // Fourth frame of the animation

        Debug.Log("Attack Launched at " + Time.time); // TODO: Launch Logic
        if (State != Boss_States.Dead)
        {
            // Play sound
            Audio_Prefab_Sp.Play_A_Sound(0);
            // Spawn Mini_Slime
            Instantiate(Mini_Slime_Prefab, Mini_Slime_Spawn_Point);
        }
    }
Exemplo n.º 2
0
 public void Attack_Action(float Hold_Time)
 {
     // If player can play
     if (Global_Variable.Current_State == Game_State.Player_Control)
     {
         // If the attack isn't enought charged
         if (Hold_Time < Powered_Attack_Min_Time)
         {
             print(Hold_Time);
             print("Failed Attack");
         }
         else
         {
             // Play Spit Sound
             Audio_Prefab_Sp.Play_A_Sound(0);
             if (Hold_Time > Heavy_Attack_Min_Time)
             {
                 print("Heavy Attack");
                 // Spawn 2 spits in the intended direction
                 if (!Glucose_An.Is_Facing_Right)
                 {
                     Instantiate(Spit, transform.position, Quaternion.Euler(0, 0, 0));
                     Instantiate(Spit, transform.position, Quaternion.Euler(0, 0, -15));
                 }
                 else
                 {
                     Instantiate(Spit, transform.position, Quaternion.Euler(0, 180, 0));
                     Instantiate(Spit, transform.position, Quaternion.Euler(0, 180, -15));
                 }
             }
             else
             {
                 print("Powered Attack");
                 // Spawn 1 spit in the intended direction
                 if (!Glucose_An.Is_Facing_Right)
                 {
                     Instantiate(Spit, transform.position, Quaternion.Euler(0, 0, -5));
                 }
                 else
                 {
                     Instantiate(Spit, transform.position, Quaternion.Euler(0, 180, -5));
                 }
             }
         }
     }
     Glucose_An.Launch_Attack_Release_Animation();
 }
    public void Update_State(Boss_States state)
    {
        if (!Has_Died)
        {
            State = state;
            switch (state)
            {
            case Boss_States.Cinematic:
                break;

            case Boss_States.Attack:
                // Make Boss Health bar visible
                HUD.Start_Battle();
                break;

            case Boss_States.Wait:
                break;

            case Boss_States.Dead:
                // Update HUD
                HUD.End_Battle();
                // Fade out Boss Music slowly
                Audio_Mixer_Control.current.Fade_Boss(-80, 0.4f);
                // Disable hurt Box and hitbox
                Electricity_Manager_Hit_Box.enabled = false;
                Attack_Box.SetActive(false);
                // Block any other state pdates
                Has_Died = true;
                // Play death sound
                Audio_Prefab_Sp.Play_A_Sound(0);

                // Load next Level
                Boss_Load_Next_Le.Load_Next_Level();
                break;

            default:
                break;
            }
            // Update States for all script in need
            Electricity_Manager_Mo.Update_State(state);
            Electricicy_Manager_At.Update_State(state);
            Electricity_Manager_An.Update_State(state);
            //Doom_Shroom_Att.Update_State(state);
            Debug.Log("Updated Boss states to " + Get_States());
        }
    }
Exemplo n.º 4
0
    public void Be_Attacked()
    {
        if (Next_Attack < Time.time)
        {
            Current_Health--;
            Next_Attack = Time.time + Attack_Delay;
            if (Current_Health > 0)
            {
                Glucose_An.Launch_Stunt_Animation();
                Glucose_Mo.Stunt();
                Audio_Prefab_Sp.Play_A_Sound(1);
            }
            else
            {
                print("Health Dead");
                Glucose_St.Change_Glucose_Controls(Glucose_States.Player_Control.Dead);
            }
        }

        HUD.Update_Glucose_Health_Bar(Current_Health, Max_Health);
    }
Exemplo n.º 5
0
    public void Be_Attacked()
    {
        WatcherRobot_Mo.Set_Agro(true);
        Current_Health--;
        print("Watcher Agro");
        if (Current_Health > 0)
        {
            // If bot is alive
            // Make mob angry

            Blue_Slime_An.Launch_Stunt_Animation();
        }
        else
        {
            // If bot is Dead
            // Disable Attack Box

            // Launch Animation
            Audio_Prefab_Sp.Play_A_Sound(0);
            StartCoroutine(Destruction());
            Blue_Slime_An.Launch_Death_Animation();
        }
    }
Exemplo n.º 6
0
 public void Launch_Death_Animation()
 {
     Store_Janitore_An.SetTrigger("Death");
     Audio_Prefab_Sp.Play_A_Sound(0);
 }
Exemplo n.º 7
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     Audio_Prefab_Sp.Play_A_Sound(2);
 }
Exemplo n.º 8
0
 public void Launch_Death_Animation()
 {
     Debug.Log("Doom Shroom Death animation");
     Doom_Shroom_An.SetBool("Dead", true);
     Audio_Prefab_Sp.Play_A_Sound(0);
 }
Exemplo n.º 9
0
 public void Launch_Death_Animation()
 {
     RGB_Slime_An.SetBool("Is_Dead", true);
     Audio_Prefab_Sp.Play_A_Sound(1);
     Audio_Prefab_Sp.Play_A_Sound(2);
 }