예제 #1
0
        private void doAtt(lHurt lHurtD)
        {
            bool flag = lHurtD.Count == 0;

            if (!flag)
            {
                float time = Time.time;
                this.curTick = 0;
                List <HurtData> l = lHurtD.l;
                for (int i = 0; i < l.Count; i++)
                {
                    HurtData hurtData = l[i];
                    bool     flag2    = time - hurtData.timer > 2f;
                    if (flag2)
                    {
                        bool flag3 = hurtData.play(lHurtD.maxComboNum);
                        bool flag4 = flag3;
                        if (flag4)
                        {
                            lHurtD.l.Remove(hurtData);
                            i--;
                        }
                    }
                }
            }
        }
예제 #2
0
        public void onAttackHanle(BaseRole go, int skillid)
        {
            bool flag = !this.dHurt.ContainsKey(go);

            if (!flag)
            {
                lHurt lHurt = this.dHurt[go];
                bool  flag2 = lHurt.Count == 0;
                if (!flag2)
                {
                    List <HurtData> l = lHurt.l;
                    for (int i = 0; i < l.Count; i++)
                    {
                        HurtData hurtData = l[i];
                        bool     flag3    = hurtData.play(lHurt.maxComboNum);
                        bool     flag4    = flag3;
                        if (flag4)
                        {
                            i--;
                            l.Remove(hurtData);
                        }
                    }
                }
            }
        }
예제 #3
0
        private void onUpdate(float s)
        {
            this.curTick++;
            bool flag = this.curTick < 40;

            if (!flag)
            {
                float    time     = Time.time;
                BaseRole baseRole = null;
                foreach (BaseRole current in this.dHurt.Keys)
                {
                    lHurt lHurt = this.dHurt[current];
                    this.doAtt(lHurt);
                    bool flag2 = baseRole == null && lHurt.Count == 0 && time - lHurt.lastTimer > 5f;
                    if (flag2)
                    {
                        baseRole = current;
                    }
                }
                bool flag3 = baseRole != null;
                if (flag3)
                {
                    this.dHurt.Remove(baseRole);
                }
            }
        }
        private void doAtt(lHurt lHurtD)
        {
            if (lHurtD.Count == 0)
            {
                return;
            }
            float t = Time.time;

            curTick = 0;
            List <HurtData> list = lHurtD.l;

            for (int i = 0; i < list.Count; i++)
            {
                HurtData d = list[i];
                if (t - d.timer > 2.0f)
                {
                    bool needdel = d.play(lHurtD.maxComboNum);
                    if (needdel)
                    {
                        lHurtD.l.Remove(d);
                        i--;
                    }
                }
            }
        }
        void onUpdate(float s)
        {
            curTick++;
            if (curTick < 40)
            {
                return;
            }

            float    t             = Time.time;
            BaseRole needRemoveKey = null;

            foreach (BaseRole go in dHurt.Keys)
            {
                lHurt lHurtD = dHurt[go];
                doAtt(lHurtD);

                if (needRemoveKey == null && lHurtD.Count == 0 && t - lHurtD.lastTimer > 5f)
                {
                    needRemoveKey = go;
                }
            }

            if (needRemoveKey != null)
            {
                dHurt.Remove(needRemoveKey);
            }
        }
        public void onAttackHanle(BaseRole go, int skillid)
        {
            BaseRole temp = go;

            if (!dHurt.ContainsKey(temp))
            {
                return;
            }
            lHurt lHurtD = dHurt[temp];

            if (lHurtD.Count == 0)
            {
                return;
            }
            List <HurtData> list = lHurtD.l;

            for (int i = 0; i < list.Count; i++)
            {
                HurtData d       = list[i];
                bool     needdel = d.play(lHurtD.maxComboNum);
                if (needdel)
                {
                    i--;
                    list.Remove(d);
                }
            }
            //if (lHurtD.Count == 0)
            //    lHurtD.maxComboNum = 0;

            //if (lHurtD.maxComboNum > 0)
            //    lHurtD.maxComboNum--;
        }
        public void setHurt(BaseRole from, BaseRole to, hurtInfo hurtD, bool useCombo = false)
        {
            //  debug.Log("setHurt!!! " + hurtD["dmg"] + "" + hurtD["frm_iid"] + " " + hurtD["to_iid"]);

            if (!dHurt.ContainsKey(from))
            {
                dHurt[from] = new lHurt();
            }
            HurtData d = new HurtData(to, hurtD, useCombo);

            dHurt[from].add(d);
        }
        public void onAttackBeginHanle(BaseRole go, int num)
        {
            // debug.Log("onAttackBeginHanle!!!" + num);
            BaseRole temp = go;

            if (!dHurt.ContainsKey(temp))
            {
                dHurt[temp] = new lHurt();
            }
            //  List<HurtData> list = dHurt[temp].l;
            //if (list.Count > 0)
            //{
            //    for (int i = 0; i < list.Count; i++)
            //    {
            //        HurtData d = list[i];
            //        d.playRest();
            //    }
            //    list.Clear();
            //}


            dHurt[temp].maxComboNum = num;
        }