예제 #1
0
        public void CalcLevelCurveStatus(int rank, ref BaseStatus result, BaseStatus ini_status, BaseStatus max_status)
        {
            int num1 = this.GetLevelCap() - 1;
            int num2 = rank - 1;

            ini_status.CopyTo(result);
            if (num2 < 1 || num1 < 1)
            {
                return;
            }
            if (num2 >= num1)
            {
                max_status.CopyTo(result);
            }
            else
            {
                BaseStatus baseStatus1 = new BaseStatus();
                BaseStatus baseStatus2 = new BaseStatus();
                for (int index1 = 0; index1 < this.curve.Count; ++index1)
                {
                    long num3 = (long)((int)this.curve[index1].lv - 1);
                    for (int index2 = index1; index2 > 0; --index2)
                    {
                        num3 -= (long)(int)this.curve[index2 - 1].lv;
                    }
                    long        num4         = (long)num2 >= num3 ? num3 : (long)num2;
                    StatusParam statusParam1 = ini_status.param;
                    StatusParam statusParam2 = max_status.param;
                    StatusParam src          = this.curve[index1].status.param;
                    src.CopyTo(baseStatus1.param);
                    baseStatus1.param.Sub(baseStatus2.param);
                    baseStatus2.param.Add(src);
                    for (int index2 = 0; index2 < baseStatus1.param.Length; ++index2)
                    {
                        long num5 = (long)(((int)statusParam2[(StatusTypes)index2] - (int)statusParam1[(StatusTypes)index2]) * (int)baseStatus1.param[(StatusTypes)index2] / 100);
                        if (num5 != 0L)
                        {
                            StatusParam statusParam3;
                            StatusTypes index3;
                            (statusParam3 = result.param)[index3 = (StatusTypes)index2] = (OInt)((int)statusParam3[index3] + (int)(100000L * num5 / num3 * num4 / 100000L));
                        }
                    }
                    ElementParam elementAssist1 = ini_status.element_assist;
                    ElementParam elementAssist2 = max_status.element_assist;
                    ElementParam elementAssist3 = this.curve[index1].status.element_assist;
                    elementAssist3.CopyTo(baseStatus1.element_assist);
                    baseStatus1.element_assist.Sub(baseStatus2.element_assist);
                    baseStatus2.element_assist.Add(elementAssist3);
                    for (int index2 = 0; index2 < baseStatus1.element_assist.values.Length; ++index2)
                    {
                        long num5 = (long)(((int)elementAssist2.values[index2] - (int)elementAssist1.values[index2]) * (int)baseStatus1.element_assist.values[index2] / 100);
                        if (num5 != 0L)
                        {
                            // ISSUE: explicit reference operation
                            // ISSUE: variable of a reference type
                            OShort& local = @result.element_assist.values[index2];
예제 #2
0
 public void Add(StatusParam src)
 {
     if (src == null)
     {
         return;
     }
     for (int index = 0; index < this.values.Length; ++index)
     {
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         OShort& local = @this.values[index];
예제 #3
0
 public void CopyTo(StatusParam dsc)
 {
     if (dsc == null)
     {
         return;
     }
     for (int index = 0; index < this.values.Length; ++index)
     {
         dsc.values[index] = this.values[index];
     }
     dsc.values_hp = this.values_hp;
 }
예제 #4
0
 public void AddRate(StatusParam src)
 {
     this.param.AddRate(src);
 }
예제 #5
0
        public static int GetSortStatus(UnitListWindow.Data data, UnitListSortWindow.SelectType type)
        {
            if (data.param == null)
            {
                return(0);
            }
            UnitParam   unitParam   = data.param;
            UnitData    unit        = data.unit;
            StatusParam statusParam = unitParam.ini_status.param;

            if (unit != null)
            {
                statusParam = unit.Status.param;
            }
            UnitListSortWindow.SelectType selectType = type;
            switch (selectType)
            {
            case UnitListSortWindow.SelectType.TIME:
                return(0);

            case UnitListSortWindow.SelectType.RARITY:
                if (unit != null)
                {
                    return(unit.Rarity);
                }
                return(1);

            case UnitListSortWindow.SelectType.LEVEL:
                if (unit != null)
                {
                    return(unit.Lv);
                }
                return(1);

            case UnitListSortWindow.SelectType.TOTAL:
                return((int)statusParam.atk + (int)statusParam.def + (int)statusParam.mag + (int)statusParam.mnd + (int)statusParam.spd + (int)statusParam.dex + (int)statusParam.cri + (int)statusParam.luk);

            default:
                if (selectType == UnitListSortWindow.SelectType.ATK)
                {
                    return((int)statusParam.atk);
                }
                if (selectType == UnitListSortWindow.SelectType.DEF)
                {
                    return((int)statusParam.def);
                }
                if (selectType == UnitListSortWindow.SelectType.MAG)
                {
                    return((int)statusParam.mag);
                }
                if (selectType == UnitListSortWindow.SelectType.MND)
                {
                    return((int)statusParam.mnd);
                }
                if (selectType == UnitListSortWindow.SelectType.HP)
                {
                    return((int)statusParam.hp);
                }
                if (selectType == UnitListSortWindow.SelectType.SPD)
                {
                    return((int)statusParam.spd);
                }
                if (selectType != UnitListSortWindow.SelectType.COMBINATION)
                {
                    if (selectType != UnitListSortWindow.SelectType.JOBRANK)
                    {
                        if (selectType == UnitListSortWindow.SelectType.AWAKE)
                        {
                            if (unit != null)
                            {
                                return(unit.AwakeLv);
                            }
                            return(1);
                        }
                        goto case UnitListSortWindow.SelectType.TIME;
                    }
                    else
                    {
                        if (unit != null)
                        {
                            return(unit.CurrentJob.Rank);
                        }
                        return(1);
                    }
                }
                else
                {
                    if (unit != null)
                    {
                        return(unit.GetCombination());
                    }
                    return(1);
                }
            }
        }