public static int ComputeDamangeNumberType_s(IntPtr l)
    {
        int result;

        try
        {
            ConfigDataSkillInfo skillInfo;
            LuaObject.checkType <ConfigDataSkillInfo>(l, 1, out skillInfo);
            bool isCritical;
            LuaObject.checkType(l, 2, out isCritical);
            ArmyRelationData armyRelation;
            LuaObject.checkValueType <ArmyRelationData>(l, 3, out armyRelation);
            bool isSameTeam;
            LuaObject.checkType(l, 4, out isSameTeam);
            DamageNumberType e = BattleFormula.ComputeDamangeNumberType(skillInfo, isCritical, armyRelation, isSameTeam);
            LuaObject.pushValue(l, true);
            LuaObject.pushEnum(l, (int)e);
            result = 2;
        }
        catch (Exception e2)
        {
            result = LuaObject.error(l, e2);
        }
        return(result);
    }
예제 #2
0
        // Token: 0x060036D7 RID: 14039 RVA: 0x000F3C70 File Offset: 0x000F1E70
        public static DamageNumberType ComputeDamangeNumberType(ConfigDataSkillInfo skillInfo, bool isCritical, ArmyRelationData armyRelation, bool isSameTeam)
        {
            DamageNumberType result = DamageNumberType.Normal;

            if (skillInfo != null)
            {
                if (skillInfo.SkillType == SkillType.SkillType_BF_DamageHeal && isSameTeam)
                {
                    result = DamageNumberType.Heal;
                }
                else if (skillInfo.IsDamageSkill())
                {
                    if (isCritical)
                    {
                        result = DamageNumberType.Critical;
                    }
                    else
                    {
                        int num = 0;
                        if (skillInfo.IsPhysicalDamageSkill())
                        {
                            num = armyRelation.Attack - armyRelation.Defend;
                        }
                        else if (skillInfo.IsMagicDamageSkill())
                        {
                            num = armyRelation.Magic - armyRelation.MagicDefend;
                        }
                        if (num > 0)
                        {
                            result = DamageNumberType.Weak;
                        }
                        else if (num < 0)
                        {
                            result = DamageNumberType.Strong;
                        }
                    }
                }
                else if (skillInfo.IsHealSkill())
                {
                    result = DamageNumberType.Heal;
                }
            }
            else if (isCritical)
            {
                result = DamageNumberType.Critical;
            }
            return(result);
        }