Exemplo n.º 1
0
 //攻撃時の性能を取得
 private void CreateArtsSatet(ArtsStateScript arts, int type)
 {
     hitColSta.damage    = arts.Damage(type);
     hitColSta.attri     = arts.Attri(type);
     hitColSta.startCorr = arts.StartCorr(type);
     hitColSta.comboCorr = arts.CombCorr(type);
     hitColSta.atkLev    = arts.AtkLev(type);
     hitColSta.blockStun = arts.BlockStun(type);
     hitColSta.hitStun   = arts.HitStun(type);
 }
Exemplo n.º 2
0
    //攻撃ヒット判定
    private void hitJudg()
    {
        //くらい判定の数
        for (int i = 0; i < CEvent.HClid.Count; i++)
        {
            //攻撃が当たっているなら
            if (react[i].hiting /* && react[i].CObj != null*/)
            {
                hitatk          = true;
                react[i].hiting = false;
                //ガードしているなら
                if (guardatk)
                {
                    bool successedGuard = true;
                    if (Pcont.AnimatorPlayer.GetBool("Guard"))
                    {
                        if (Pcont.AnimatorPlayer.GetBool("StandGuard"))
                        {
                            string hitArt = ASScriptEne.Attri((int)CEventEne.GetType);
                            if (hitArt == "Low")
                            {
                                successedGuard = false;
                                //エフェクト発生
                                SEScript.appearEffe(ASScriptEne.AtkLev((int)CEventEne.GetType), react[i].point);
                                //ダメージ分HPゲージを減らす
                                HPDir.hitDmage(ASScriptEne.Damage((int)CEventEne.GetType));
                                Pcont.HitDamage(ASScriptEne.Damage((int)CEventEne.GetType), ASScriptEne.AtkLev((int)CEventEne.GetType), ASScriptEne.HitStun((int)CEventEne.GetType));
                                if (Pcont.ControllerName == "AI")
                                {
                                    AI.JudgResult("Damage", Pcont.fightEnemy.GetComponent <PlayerController>().State);
                                }
                                else if (Pcont.fightEnemy.GetComponent <PlayerController>().ControllerName == "AI")
                                {
                                    Pcont.fightEnemy.GetComponent <EnemyAI>().JudgResult("Damaged", "");
                                }
                            }
                        }
                        else
                        {
                            string hitArt = ASScriptEne.Attri((int)CEventEne.GetType);
                            if (hitArt == "High")
                            {
                                successedGuard = false;
                                //エフェクト発生
                                SEScript.appearEffe(ASScriptEne.AtkLev((int)CEventEne.GetType), react[i].point);
                                //ダメージ分HPゲージを減らす
                                HPDir.hitDmage(ASScriptEne.Damage((int)CEventEne.GetType));
                                Pcont.HitDamage(ASScriptEne.Damage((int)CEventEne.GetType), ASScriptEne.AtkLev((int)CEventEne.GetType), ASScriptEne.HitStun((int)CEventEne.GetType));
                                if (Pcont.ControllerName == "AI")
                                {
                                    AI.JudgResult("Damage", Pcont.fightEnemy.GetComponent <PlayerController>().State);
                                }
                                else if (Pcont.fightEnemy.GetComponent <PlayerController>().ControllerName == "AI")
                                {
                                    Pcont.fightEnemy.GetComponent <EnemyAI>().JudgResult("Damaged", "");
                                }
                            }
                        }
                    }

                    if (successedGuard)
                    {
                        //ダメージ分ガードゲージを減らす
                        //GScript.hitGuard(ASScriptEne.Damage((int)CEventEne.GetType));
                        GScript.hitGuard(ASScriptEne.GuardDanage((int)CEventEne.GetType));
                        Vector3 effectPos = transform.position;
                        effectPos.y += 1.0f;
                        Instantiate(guardEffect, effectPos, Quaternion.identity);
                        if (Pcont.ControllerName == "AI")
                        {
                            AI.JudgResult("Guard", "");
                        }
                        else if (Pcont.fightEnemy.GetComponent <PlayerController>().ControllerName == "AI")
                        {
                            Pcont.fightEnemy.GetComponent <EnemyAI>().JudgResult("WasGuarded", Pcont.State);
                        }
                    }
                }
                else
                {
                    bool   successedGuardBullet = false;
                    string art = ASScriptEne.Attri((int)CEventEne.GetType);
                    if (art == "Bullet")
                    {
                        if (Pcont.InputDKey == 4 && (Pcont.State == "Stand" || Pcont.State == "Sit"))
                        {
                            successedGuardBullet = true;
                            Pcont.AnimatorPlayer.SetBool("Guard", true);
                            Pcont.State = "StandGuard";
                            //ダメージ分ガードゲージを減らす
                            //GScript.hitGuard(ASScriptEne.Damage((int)CEventEne.GetType));
                            GScript.hitGuard(ASScriptEne.GuardDanage((int)CEventEne.GetType));
                            Vector3 effectPos = transform.position;
                            effectPos.y += 1.0f;
                            Instantiate(guardEffect, effectPos, Quaternion.identity);
                            if (Pcont.ControllerName == "AI")
                            {
                                AI.JudgResult("Guard", "");
                            }
                            else if (Pcont.fightEnemy.GetComponent <PlayerController>().ControllerName == "AI")
                            {
                                Pcont.fightEnemy.GetComponent <EnemyAI>().JudgResult("WasGuarded", Pcont.State);
                            }
                        }
                        else if (Pcont.InputDKey == 1 && (Pcont.State == "Stand" || Pcont.State == "Sit"))
                        {
                            successedGuardBullet = true;
                            Pcont.AnimatorPlayer.SetBool("Guard", true);
                            Pcont.State = "SitGuard";
                            //ダメージ分ガードゲージを減らす
                            //GScript.hitGuard(ASScriptEne.Damage((int)CEventEne.GetType));
                            GScript.hitGuard(ASScriptEne.GuardDanage((int)CEventEne.GetType));
                            Pcont.GuardDamage(ASScriptEne.BlockStun((int)CEventEne.GetType));
                            Vector3 effectPos = transform.position;
                            effectPos.y += 1.0f;
                            Instantiate(guardEffect, effectPos, Quaternion.identity);
                            if (Pcont.ControllerName == "AI")
                            {
                                AI.JudgResult("Guard", "");
                            }
                            else if (Pcont.fightEnemy.GetComponent <PlayerController>().ControllerName == "AI")
                            {
                                Pcont.fightEnemy.GetComponent <EnemyAI>().JudgResult("WasGuarded", Pcont.State);
                            }
                        }
                    }
                    if (!successedGuardBullet)
                    {
                        //エフェクト発生
                        SEScript.appearEffe(ASScriptEne.AtkLev((int)CEventEne.GetType), react[i].point);
                        //ダメージ分HPゲージを減らす
                        HPDir.hitDmage(ASScriptEne.Damage((int)CEventEne.GetType));
                        Pcont.HitDamage(ASScriptEne.Damage((int)CEventEne.GetType), ASScriptEne.AtkLev((int)CEventEne.GetType), ASScriptEne.HitStun((int)CEventEne.GetType));
                        if (Pcont.ControllerName == "AI")
                        {
                            AI.JudgResult("Damage", Pcont.fightEnemy.GetComponent <PlayerController>().State);
                        }
                        else if (Pcont.fightEnemy.GetComponent <PlayerController>().ControllerName == "AI")
                        {
                            Pcont.fightEnemy.GetComponent <EnemyAI>().JudgResult("Damaged", "");
                        }
                    }
                }


                //攻撃を食らったあたり判定のIDを取得
                collID = i;
                //飛び道具消失
                toolVoid();

                //受けた攻撃のステータス
                CreateArtsSatet(ASScriptEne, (int)CEventEne.GetType);
            }

            //攻撃を食らっているなら
            if (react[i].CObj != null)
            {
                //react[i].CObj.SetActive(false);

                //のけぞり時間中ならあたり判定しない
                if (time >= timecCnt)
                {
                    timecCnt++;
                }
                else if (time < timecCnt)
                {
                    //のけぞり時間外になったらあたり判定する
                    timecCnt      = 0;
                    collID        = CEvent.HClid.Count;
                    react[i].CObj = null;
                }
            }
        }
        //エフェクトを止める
        SEScript.disappearEffe();
    }