Ejemplo n.º 1
0
    public void Fenemy_re(enemy_base enemy)
    {
        Destroy(Instantiate(att3, testplayer.Instance.transform.position + pianyi * (Vector3.up + testplayer.Instance.face_to * Vector3.right), Quaternion.Euler(Vector3.zero)).gameObject, 3f);
        Destroy(Instantiate(att4, testplayer.Instance.transform.position + pianyi * (Vector3.up + testplayer.Instance.face_to * Vector3.right), Quaternion.Euler(Vector3.zero)).gameObject, 3f);
        Destroy(Instantiate(att5, testplayer.Instance.transform.position + pianyi * (Vector3.up + testplayer.Instance.face_to * Vector3.right), Quaternion.Euler(Vector3.zero)).gameObject, 3f);

        if (enemy.type == "lizarrd")
        {
            enemy_lizarrd_new a = (enemy_lizarrd_new)enemy;
            a.anim.CrossFade("lizarrd_stand1", 0.2f);
        }
        if (enemy.type == "lancer")
        {
            enemy_lancer a = (enemy_lancer)enemy;
            a.enemy.SetStage(a.lancer_stand_stage);
        }
        if (enemy.type == "boss")
        {
            enemy_boss a = (enemy_boss)enemy;
            a.yingzhi = 1.2f;
            a.enemy.SetStage(a.boss_stand_stage);
        }
        //if (enemy.GetComponent<enemy_fire>())
        //{
        //    enemy.GetComponentInParent<Animator>().CrossFade("stand", 0.1f);
        //}
        //if (enemy.GetComponent<enemy_lancer>())
        //{
        //    enemy.GetComponentInParent<Animator>().CrossFade("stand", 0.1f);
        //}
    }
Ejemplo n.º 2
0
    //public GameObject fire;
    //public GameObject fire1;
    //public Transform huoba;
    private void Awake()
    {
        base.FRegister();
        type = "boss";
        if (self != this)
        {
            self = this;
        }
        boss_stand_stage    = new Boss_Stand(self);
        boss_dead_stage     = new Boss_Dead(self);
        boss_att1_stage     = new Boss_Att1(self);
        boss_att2_stage     = new Boss_Att2(self);
        boss_att3_stage     = new Boss_Att3(self);
        boss_backjump_stage = new Boss_Backjump(self);
        boss_gun_stage      = new Boss_Gun(self);
        boss_hurt_stage     = new Boss_Hurt(self);
        boss_jatt_stage     = new Boss_Jatt(self);

        Hp         = maxhp;
        hurt_count = hurt_yuzhi;
        enemy      = new Enemy(boss_stand_stage);
        // attfield = attfield - Random.Range(0, 0.25f);
    }
Ejemplo n.º 3
0
 public Boss_Hurt(enemy_boss ee)
 {
     enemy = ee;
 }
Ejemplo n.º 4
0
 public Boss_Att1(enemy_boss ee)
 {
     enemy = ee;
 }
Ejemplo n.º 5
0
 public Boss_Dead(enemy_boss ee)
 {
     enemy = ee;
 }
Ejemplo n.º 6
0
 private void OnTriggerStay(Collider other)
 {
     if ((other.tag == "enemy" && canhurt))
     {
         enemy_base b = other.gameObject.GetComponent <enemy_base>();
         bool       c = b;
         if (c)
         {
             hurtforce = 5;
             if (b.type == "lizarrd")
             {
                 enemy_lizarrd_new a = (enemy_lizarrd_new)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     FLoseHp(a.ATK);
                     _player.SetStage(hurt_stage);
                 }
             }
             if (b.type == "shield")
             {
                 enemy_shield a = (enemy_shield)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     _player.SetStage(hurt_stage);
                     FLoseHp(a.ATK);
                 }
             }
             if (b.type == "assassin")
             {
                 enemy_assassin a = (enemy_assassin)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     FLoseHp(a.ATK);
                     _player.SetStage(hurt_stage);
                 }
             }
             if (b.type == "bird")
             {
                 enemy_bird a = (enemy_bird)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     FLoseHp(a.ATK);
                     _player.SetStage(hurt_stage);
                 }
             }
             if (b.type == "lancer")
             {
                 enemy_lancer a = (enemy_lancer)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     FLoseHp(a.ATK);
                     _player.SetStage(hurt_stage);
                 }
             }
             if (b.type == "boss")
             {
                 enemy_boss a = (enemy_boss)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     FLoseHp(a.ATK);
                     _player.SetStage(hurt_stage);
                 }
             }
             if (b.type == "fire")
             {
                 enemy_fire a = (enemy_fire)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     FLoseHp(a.ATK);
                     _player.SetStage(hurt_stage);
                 }
             }
             if (b.type == "bullet")
             {
                 bullet a = (bullet)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     FLoseHp(a.ATK);
                     _player.SetStage(hurt_stage);
                 }
             }
             if (b.type == "lance")
             {
                 lancetest a = (lancetest)b;
                 if (a.candamage)
                 {
                     CameraEffectSystem.Instance.FHitEffect();
                     enemypos = other.transform.position;
                     atting   = false;
                     _player.SetStage(hurt_stage);
                     FLoseHp(a.ATK);
                 }
             }
         }
         else
         {
             CameraEffectSystem.Instance.FHitEffect();
             enemypos  = other.transform.position;
             atting    = false;
             hurtforce = 0;
             _player.SetStage(hurt_stage);
             FLoseHp(20);
         }
     }
 }
Ejemplo n.º 7
0
    public void FPlayerWeapon_Enemy(Collider playeratt, enemy_base Enemy)
    {
        if (playeratt.tag == "player_weapon" && !Physics.Raycast(testplayer.Instance.transform.position, Enemy.transform.position - testplayer.Instance.transform.position, Vector3.Distance(Enemy.transform.position, testplayer.Instance.transform.position), 1 << 9))
        {
            AudioManager.Instance.TryPlayAudio(AudioManager.AudioType.AttackEnemy);
            Att_Stage b = (Att_Stage)testplayer.Instance.att_stage;

            StartCoroutine(CameraEffectSystem.Instance.FCameraShake(0.1f, 0.5f));
            StartCoroutine(CameraEffectSystem.Instance.FTimeScaleControl(0.1f, 0.00001f));

            if (b.jattack)
            {
                Player_Function.FJump(testplayer.Instance.gameObject, 8);
            }

            Destroy(Instantiate(enemy_hurt1, Enemy.transform.position + Vector3.up * 0.5f, Quaternion.Euler(Vector3.zero)).gameObject, 3f);
            Destroy(Instantiate(enemy_hurt2, Enemy.transform.position + Vector3.up * 0.5f, Quaternion.Euler(Vector3.zero)).gameObject, 3f);
            Destroy(Instantiate(enemy_hurt3, Enemy.transform.position + Vector3.up * 0.5f, Quaternion.Euler(Vector3.zero)).gameObject, 3f);
            Enemy.GetComponent <Rigidbody>().velocity = Enemy.beattforce * Vector3.Normalize(new Vector3((testplayer.Instance.transform.position.x - Enemy.transform.position.x) / -Mathf.Abs(testplayer.Instance.transform.position.x - Enemy.transform.position.x), 1, 0));
            if (Enemy.type == "lizarrd")
            {
                testplayer.Instance.FGetMana(testplayer.Instance.GotMana);
                enemy_lizarrd_new a = (enemy_lizarrd_new)Enemy;
                a.hurt_count -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                a.Hp         -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                if (!a.wudi11)
                {
                    UIManager.Instance.DisplayDamageNumber((int)testplayer.Instance.player_attack * (int)testplayer.Instance.attlevel, Enemy.transform.position);
                }


                if (a.hurt_count < 0 && !a.dead)
                {
                    a.enemy.SetStage(a.lizarrd_hurt_stage);
                }
                RuneManager.Instance.UseRune(RuneEvent.OnAttack);
            }
            if (Enemy.type == "fire")
            {
                testplayer.Instance.FGetMana(testplayer.Instance.GotMana);
                enemy_fire a = (enemy_fire)Enemy;
                a.hurt_count -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                a.Hp         -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                if (!a.wudi11)
                {
                    UIManager.Instance.DisplayDamageNumber((int)testplayer.Instance.player_attack * (int)testplayer.Instance.attlevel, Enemy.transform.position);
                }
                if (a.hurt_count < 0 && !a.dead)
                {
                    a.enemy.SetStage(a.fire_hurt_stage);
                }
                RuneManager.Instance.UseRune(RuneEvent.OnAttack);
            }
            if (Enemy.type == "lancer")
            {
                testplayer.Instance.FGetMana(testplayer.Instance.GotMana);
                enemy_lancer a = (enemy_lancer)Enemy;
                a.hurt_count -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                a.Hp         -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                if (!a.wudi11)
                {
                    UIManager.Instance.DisplayDamageNumber((int)testplayer.Instance.player_attack * (int)testplayer.Instance.attlevel, Enemy.transform.position);
                }
                if (a.hurt_count < 0 && !a.dead)
                {
                    a.enemy.SetStage(a.lancer_hurt_stage);
                }
                RuneManager.Instance.UseRune(RuneEvent.OnAttack);
            }
            if (Enemy.type == "boss")
            {
                testplayer.Instance.FGetMana(testplayer.Instance.GotMana);
                enemy_boss a = (enemy_boss)Enemy;
                a.hurt_count -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                a.Hp         -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                if (!a.wudi11)
                {
                    UIManager.Instance.DisplayDamageNumber((int)testplayer.Instance.player_attack * (int)testplayer.Instance.attlevel, Enemy.transform.position);
                }
                if (a.hurt_count < 0 && !a.dead)
                {
                    a.enemy.SetStage(a.boss_hurt_stage);
                }
                RuneManager.Instance.UseRune(RuneEvent.OnAttack);
            }
            if (Enemy.type == "shield")
            {
                testplayer.Instance.FGetMana(testplayer.Instance.GotMana);
                enemy_shield a = (enemy_shield)Enemy;
                if (testplayer.Instance.attlevel == testplayer.Instance.Exatt && (a.transform.position.x - testplayer.Instance.transform.position.x) * a.faceto < 0)
                {
                    if (!a.dead)
                    {
                        a.enemy.SetStage(a.shield_hurt_stage);
                    }
                }
                else
                {
                    a.hurt_count -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                    a.Hp         -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                    if (!a.wudi11)
                    {
                        UIManager.Instance.DisplayDamageNumber((int)testplayer.Instance.player_attack * (int)testplayer.Instance.attlevel, Enemy.transform.position);
                    }
                    RuneManager.Instance.UseRune(RuneEvent.OnAttack);
                }
            }
            if (Enemy.type == "assassin")
            {
                testplayer.Instance.FGetMana(testplayer.Instance.GotMana);
                enemy_assassin a = (enemy_assassin)Enemy;
                a.hurt_count -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                a.Hp         -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                if (!a.wudi11)
                {
                    UIManager.Instance.DisplayDamageNumber((int)testplayer.Instance.player_attack * (int)testplayer.Instance.attlevel, Enemy.transform.position);
                }
                if (a.hurt_count < 0 && !a.dead)
                {
                    a.enemy.SetStage(a.assassin_hurt_stage);
                }
                RuneManager.Instance.UseRune(RuneEvent.OnAttack);
            }
            if (Enemy.type == "bird")
            {
                testplayer.Instance.FGetMana(testplayer.Instance.GotMana);
                enemy_bird a = (enemy_bird)Enemy;
                a.hurt_count -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                a.Hp         -= testplayer.Instance.player_attack * testplayer.Instance.attlevel;
                if (!a.wudi11)
                {
                    UIManager.Instance.DisplayDamageNumber((int)testplayer.Instance.player_attack * (int)testplayer.Instance.attlevel, Enemy.transform.position);
                }
                if (a.hurt_count < 0 && !a.dead)
                {
                    a.enemy.SetStage(a.bird_hurt_stage);
                }
                RuneManager.Instance.UseRune(RuneEvent.OnAttack);
            }
            if (Enemy.type == "bullet")
            {
                bullet a = (bullet)Enemy;

                a.Hp -= testplayer.Instance.player_attack;
                RuneManager.Instance.UseRune(RuneEvent.OnAttackFlyItem);
            }
            if (Enemy.type == "paodan")
            {
                paodan a = (paodan)Enemy;

                a.Hp -= testplayer.Instance.player_attack;
                RuneManager.Instance.UseRune(RuneEvent.OnAttackFlyItem);
            }
            StartCoroutine(CameraEffectSystem.Instance.FTimeScaleControl());
            StartCoroutine(CameraEffectSystem.Instance.FCameraShake());
        }
    }
Ejemplo n.º 8
0
    public void FPlayerSkill_Enemy(enemy_base enemy, float xishu)
    {
        if (!enemy.wudi11)
        {
            AudioManager.Instance.TryPlayAudio(AudioManager.AudioType.AttackEnemy);


            StartCoroutine(CameraEffectSystem.Instance.FCameraShake(0.1f, 0.5f));
            StartCoroutine(CameraEffectSystem.Instance.FTimeScaleControl(0.1f, 0.00001f));
            Destroy(Instantiate(enemy_hurt1, enemy.transform.position + Vector3.up * 0.5f, Quaternion.Euler(Vector3.zero)).gameObject, 3f);
            Destroy(Instantiate(enemy_hurt2, enemy.transform.position + Vector3.up * 0.5f, Quaternion.Euler(Vector3.zero)).gameObject, 3f);
            Destroy(Instantiate(enemy_hurt3, enemy.transform.position + Vector3.up * 0.5f, Quaternion.Euler(Vector3.zero)).gameObject, 3f);
            if (enemy.type == "lizarrd")
            {
                enemy_lizarrd_new a = (enemy_lizarrd_new)enemy;
                a.hurt_count -= testplayer.Instance.player_attack * xishu;
                a.Hp         -= testplayer.Instance.player_attack * xishu;
                UIManager.Instance.DisplayDamageNumber((int)(testplayer.Instance.player_attack * testplayer.Instance.attlevel * xishu), enemy.transform.position);
                if (a.hurt_count < 0)
                {
                    a.enemy.SetStage(a.lizarrd_hurt_stage);
                }
            }
            if (enemy.type == "fire")
            {
                enemy_fire a = (enemy_fire)enemy;
                a.hurt_count -= testplayer.Instance.player_attack * xishu;
                a.Hp         -= testplayer.Instance.player_attack * xishu;
                UIManager.Instance.DisplayDamageNumber((int)(testplayer.Instance.player_attack * testplayer.Instance.attlevel * xishu), enemy.transform.position);
                if (a.hurt_count < 0)
                {
                    a.enemy.SetStage(a.fire_hurt_stage);
                }
            }
            if (enemy.type == "bird")
            {
                enemy_bird a = (enemy_bird)enemy;
                a.hurt_count -= testplayer.Instance.player_attack * xishu;
                a.Hp         -= testplayer.Instance.player_attack * xishu;
                UIManager.Instance.DisplayDamageNumber((int)(testplayer.Instance.player_attack * testplayer.Instance.attlevel * xishu), enemy.transform.position);
                if (a.hurt_count < 0)
                {
                    a.enemy.SetStage(a.bird_hurt_stage);
                }
            }
            if (enemy.type == "assassin")
            {
                enemy_assassin a = (enemy_assassin)enemy;
                a.hurt_count -= testplayer.Instance.player_attack * xishu;
                a.Hp         -= testplayer.Instance.player_attack * xishu;
                UIManager.Instance.DisplayDamageNumber((int)(testplayer.Instance.player_attack * testplayer.Instance.attlevel * xishu), enemy.transform.position);
                if (a.hurt_count < 0)
                {
                    a.enemy.SetStage(a.assassin_hurt_stage);
                }
            }
            if (enemy.type == "lancer")
            {
                enemy_lancer a = (enemy_lancer)enemy;
                a.hurt_count -= testplayer.Instance.player_attack * xishu;
                a.Hp         -= testplayer.Instance.player_attack * xishu;
                UIManager.Instance.DisplayDamageNumber((int)(testplayer.Instance.player_attack * testplayer.Instance.attlevel * xishu), enemy.transform.position);
                if (a.hurt_count < 0)
                {
                    a.enemy.SetStage(a.lancer_hurt_stage);
                }
            }
            if (enemy.type == "boss")
            {
                enemy_boss a = (enemy_boss)enemy;
                a.hurt_count -= testplayer.Instance.player_attack * xishu;
                a.Hp         -= testplayer.Instance.player_attack * xishu;
                UIManager.Instance.DisplayDamageNumber((int)(testplayer.Instance.player_attack * testplayer.Instance.attlevel * xishu), enemy.transform.position);
                if (a.hurt_count < 0)
                {
                    a.enemy.SetStage(a.boss_hurt_stage);
                }
            }
            if (enemy.type == "shield")
            {
                enemy_shield a = (enemy_shield)enemy;
                a.hurt_count -= testplayer.Instance.player_attack * xishu;
                a.Hp         -= testplayer.Instance.player_attack * xishu;
                UIManager.Instance.DisplayDamageNumber((int)(testplayer.Instance.player_attack * testplayer.Instance.attlevel * xishu), enemy.transform.position);
                if (a.hurt_count < 0)
                {
                    a.enemy.SetStage(a.shield_hurt_stage);
                }
            }
            StartCoroutine(CameraEffectSystem.Instance.FTimeScaleControl());
            StartCoroutine(CameraEffectSystem.Instance.FCameraShake());
        }
    }
Ejemplo n.º 9
0
 public Boss_Jatt(enemy_boss ee)
 {
     enemy = ee;
 }
Ejemplo n.º 10
0
 public Boss_Backjump(enemy_boss ee)
 {
     enemy = ee;
 }
Ejemplo n.º 11
0
 public Boss_Stand(enemy_boss ee)
 {
     enemy = ee;
 }
Ejemplo n.º 12
0
 public Boss_Gun(enemy_boss ee)
 {
     enemy = ee;
 }