示例#1
0
 private bool doExcuteSpecialState(Units target, ref float damage)
 {
     if (SkillUtility.DoWuDi(target, damage))
     {
         target.jumpFont(JumpFontType.WuDi, string.Empty, this.casterUnit, false);
         return(true);
     }
     return(false);
 }
示例#2
0
        private List <DataInfo> GetDataInfos()
        {
            List <DataInfo> list = new List <DataInfo>();

            for (int i = 0; i < this.data.damage_ids.Length; i++)
            {
                DamageData vo = Singleton <DamageDataManager> .Instance.GetVo(this.data.damage_ids[i]);

                if (vo == null)
                {
                    Debug.LogError("没有找到伤害包:错误id" + this.data.damage_ids[i]);
                }
                else if (SkillUtility.DoMoFaMianYi(this.targetUnit, vo))
                {
                    this.targetUnit.jumpFont(JumpFontType.MoFaMianYi, string.Empty, null, true);
                }
                else if (SkillUtility.DoWuDi(this.targetUnit, vo))
                {
                    this.targetUnit.jumpFont(JumpFontType.WuDi, string.Empty, null, true);
                }
                else
                {
                    DataInfo dataInfo = new DataInfo();
                    dataInfo.reverse  = this.isReverse;
                    dataInfo.damageID = this.data.damage_ids[i];
                    if (vo.IsPropertyValue)
                    {
                        dataInfo.key     = vo.property_key;
                        dataInfo.value   = vo.property_value;
                        dataInfo.percent = vo.property_percent;
                        dataInfo.formula = false;
                        list.Add(dataInfo);
                    }
                    else if (vo.IsPropertyFormula)
                    {
                        dataInfo.key     = vo.property_key;
                        dataInfo.value   = FormulaTool.GetFormualValue(vo.property_formula, this.targetUnit);
                        dataInfo.percent = vo.property_percent;
                        dataInfo.formula = true;
                        list.Add(dataInfo);
                    }
                    else
                    {
                        Debug.LogError("DataChange 公式配置错误:既不是IsPropertyValue也不是IsPropertyFormula:错误id" + this.data.damage_ids[i]);
                    }
                }
            }
            return(list);
        }
示例#3
0
    private void calculateDamageCut(Units target, int[] damage_ids, bool crit, bool miss, out float final_damage)
    {
        final_damage = 0f;
        if (miss)
        {
            target.jumpFont(JumpFontType.Miss, string.Empty, this.casterUnit, false);
            return;
        }
        float hp     = target.hp;
        float mp     = target.mp;
        float shield = target.shield;

        Dictionary <int, float> .Enumerator enumerator = this.damage_values.GetEnumerator();
        while (enumerator.MoveNext())
        {
            KeyValuePair <int, float> current = enumerator.Current;
            int key = current.Key;
            KeyValuePair <int, float> current2 = enumerator.Current;
            float value = current2.Value;
            if (!this.doExcuteSpecialState(target, ref value))
            {
                switch (key)
                {
                case 1:
                    if (!this.doExcuteSMHuDun(target, ref value))
                    {
                        if (!this.doExcuteMFHuDun(target, ref value))
                        {
                            final_damage += value;
                        }
                    }
                    break;

                case 2:
                    if (!this.doExcuteMoFaMianYi(target, ref value))
                    {
                        if (!this.doExcuteSMHuDun(target, ref value))
                        {
                            if (!this.doExcuteMFHuDun(target, ref value))
                            {
                                final_damage += value;
                            }
                        }
                    }
                    break;

                case 3:
                    if (!this.doExcuteSMHuDun(target, ref value))
                    {
                        if (!this.doExcuteMFHuDun(target, ref value))
                        {
                            final_damage += value;
                        }
                    }
                    break;
                }
            }
        }
        if (this.casterUnit != null)
        {
            this.doExcuteTeamModifier(target, this.casterUnit, ref final_damage);
        }
        this.doDamageModifier(ref final_damage, target);
        this.doDamageCalModifier(target, AttrType.Hp, ref final_damage);
        if (final_damage != 0f)
        {
            this.ClampMinDamage(ref final_damage);
            if (SkillUtility.DoWuDi(target, final_damage))
            {
                final_damage = 0f;
            }
            float attr = target.GetAttr(AttrType.DamageMultiple);
            final_damage *= attr;
            this.AddDamage(AttrType.Hp, final_damage);
        }
        this.doExcuteZhansha(target, this.data_change_list, final_damage);
    }