コード例 #1
0
ファイル: enemy_bird.cs プロジェクト: lhm980913/Project_Fire
    private void Awake()
    {
        base.FRegister();
        type = "bird";
        if (self != this)
        {
            self = this;
        }
        bird_att_stage   = new Bird_Att(self);
        bird_dead_stage  = new Bird_Dead(self);
        bird_hurt_stage  = new Bird_Hurt(self);
        bird_move_stage  = new Bird_Move(self);
        bird_stand_stage = new Bird_Stand(self);


        hurt_count = hurt_yuzhi;
        Hp         = maxhp;

        enemy = new Enemy(bird_stand_stage);
    }
コード例 #2
0
 public Bird_Stand(enemy_bird ee)
 {
     enemy = ee;
 }
コード例 #3
0
 public Bird_Move(enemy_bird ee)
 {
     enemy = ee;
 }
コード例 #4
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);
         }
     }
 }
コード例 #5
0
 public Bird_Dead(enemy_bird ee)
 {
     enemy = ee;
 }
コード例 #6
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());
        }
    }
コード例 #7
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());
        }
    }
コード例 #8
0
ファイル: Bird_Hurt.cs プロジェクト: lhm980913/Project_Fire
 public Bird_Hurt(enemy_bird ee)
 {
     enemy = ee;
 }
コード例 #9
0
 public Bird_Att(enemy_bird ee)
 {
     enemy = ee;
 }