Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        //print("----------------------------------------------------------------->     "+GlobalTools.GetRandomNum(2));


        JiShuQi();

        if (GetComponent <RoleDate>().isDie)
        {
            init();
            return;
        }

        if (GetComponent <RoleDate>().isBeHiting)
        {
            init();
            return;
        }

        if (!isFanjiing)
        {
            return;
        }

        if (isGongjiing && _gameBody.IsAtkOver())
        {
            init();
            return;
        }


        if (isQhuaing)
        {
            if (_gameBody.GetQianhuaOver())
            {
                isQhuaing = false;
            }
            return;
        }



        if (_gameBody && _gameBody.GetBackUpOver())
        {
            if (isQianHua && !isQianh)
            {
                isQianh   = true;
                isQhuaing = true;
                //qianhua
                _gameBody.Qianhua();
                return;
            }


            if (!isGongji)
            {
                isGongji = true;
                //判断是否包含该攻击动作 没有的话 返回
                //if (!_gameBody.IsHanAC(FANJI))
                //{
                //    isGongji = false;
                //    isFanjiing = false;
                //    return;
                //}

                //判断是否是技能攻击
                if (skillAtkName != "")
                {
                    string[] strArr    = skillAtkName.Split('|');
                    int      length    = strArr.Length;
                    string   _skilName = skillAtkName;
                    if (length > 1)
                    {
                        int i = GlobalTools.GetRandomNum(length);
                        print("  fanjinums  i =     " + i);
                        _skilName = strArr[i];
                    }
                    print(" ******************************************反击的 技能名字   " + _skilName);


                    if (GetComponent <AIAirBase>())
                    {
                        GetComponent <AIAirBase>().GetAtkFSByName(_skilName);
                    }
                    else
                    {
                        GetComponent <AIBase>().GetAtkFSByName(_skilName);
                    }

                    init();
                    return;
                }
                else
                {
                    _gameBody.GetAtk(FANJI);
                }

                if (atkDelayTimes != 0)
                {
                    _gameBody.GetPause(atkDelayTimes);
                }
                isGongjiing = true;
                //print("-------------------------------------------------------反击");
                //是否提高硬直
                if (isAddYZ)
                {
                    GetComponent <RoleDate>().addYZ(addYZNum);
                    isHasHFYZ = false;
                }
            }
        }
    }