Exemplo n.º 1
0
    IEnumerator PowerAttack()
    {
        Attacked = true;
        anim.SetTrigger("StrongAttack");
        audioSrc.volume = 2.0f;
        audioSrc.pitch  = Random.Range(0.8f, 1.0f);
        audioSrc.PlayOneShot(ice);
        powCount.RemoveIceCounter(1);
        Rigidbody  Temporary_RigidBody;
        GameObject Temporary_Bullet_Handler;

        Temporary_Bullet_Handler = Instantiate(Bullet, Bullet_Emitter.transform.position, Bullet_Emitter.transform.rotation) as GameObject;
        Temporary_Bullet_Handler.transform.Rotate(Vector3.left);
        Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>();
        Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Bullet_Forward_Force);
        yield return(new WaitForSeconds(3));
    }
Exemplo n.º 2
0
    public void SwordPowers(SwordType type)
    {
        switch (type)
        {
        case SwordType.Broad:
        {
            if (BroadSwordEnabled && BroadCount > 0)
            {
                audioSrc.PlayOneShot(BroadSwipe);
                BroadpowCount.RemoveBroadCounter(1);
                Rigidbody  Temporary_RigidBody;
                GameObject Temporary_Bullet_Handler;
                Temporary_Bullet_Handler = Instantiate(Blade, Magic_Thunder_Emitter.transform.position, Magic_Thunder_Emitter.transform.rotation) as GameObject;
                Temporary_Bullet_Handler.transform.Rotate(30, 180, 0);
                Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>();
                Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Flame_Forward_Force * 2);
                Destroy(Temporary_Bullet_Handler, 0.2f);
            }
            break;
        }

        case SwordType.Flame:
        {
            if (MagicSwordEnabled && MagicCount > 0)
            {
                audioSrc.PlayOneShot(MagicFlame);
                MagicpowCount.RemoveMagicCounter(1);
                Rigidbody  Temporary_RigidBody;
                GameObject Temporary_Bullet_Handler;
                Temporary_Bullet_Handler = Instantiate(Flame, Magic_Thunder_Emitter.transform.position, Magic_Thunder_Emitter.transform.rotation) as GameObject;
                Temporary_Bullet_Handler.transform.Rotate(0, 180, 0);
                Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>();
                Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Flame_Forward_Force);
            }
            break;
        }

        case SwordType.Thunder:
        {
            if (ThunderSwordEnabled && ThunderCount > 0)
            {
                audioSrc.PlayOneShot(ThunderBall);
                ThunderpowCount.RemoveThunderCounter(1);
                Rigidbody  Temporary_RigidBody;
                GameObject Temporary_Bullet_Handler;
                Temporary_Bullet_Handler = Instantiate(ElectroBall, Magic_Thunder_Emitter.transform.position, Magic_Thunder_Emitter.transform.rotation) as GameObject;
                Temporary_Bullet_Handler.transform.Rotate(Vector3.left);
                Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>();
                Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Electroball_Forward_Force);
            }
            break;
        }

        case SwordType.Glace:
        {
            if (IceSwordEnabled && IceCount > 0)
            {
                audioSrc.volume = 1.0f;
                audioSrc.pitch  = Random.Range(0.8f, 1.0f);
                audioSrc.PlayOneShot(IceShield);
                IcepowCount.RemoveIceCounter(1);
                Rigidbody  Temporary_RigidBody;
                GameObject Temporary_Bullet_Handler;
                Temporary_Bullet_Handler = Instantiate(Shield, Ice_Emitter.transform.position, Ice_Emitter.transform.rotation) as GameObject;
                Temporary_Bullet_Handler.transform.Rotate(Vector3.left);
                Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>();
                Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Flame_Forward_Force);
            }
            break;
        }
        }
    }