Exemplo n.º 1
0
    public int GetDiscountRatio(TWeapon.CATEGORY category, int xp)
    {
        int weaponLevel = GetWeaponLevel(category, xp);

        if (weaponLevel > maxWeaponLevel)
        {
            return(15);
        }
        if (weaponLevel > 2)
        {
            return(8);
        }
        if (weaponLevel > 1)
        {
            return(5);
        }
        if (weaponLevel > 0)
        {
            return(3);
        }
        return(0);
    }
Exemplo n.º 2
0
    public int GetWeaponLevel(TWeapon.CATEGORY category, int xp)
    {
        switch (category)
        {
        case TWeapon.CATEGORY.HEAVY:
            for (int n = 0; n < heavyTable.Length; n++)
            {
                if (xp < heavyTable[n])
                {
                    return(n);
                }
            }
            break;

        case TWeapon.CATEGORY.ASSAULT:
            for (int j = 0; j < assaultTable.Length; j++)
            {
                if (xp < assaultTable[j])
                {
                    return(j);
                }
            }
            break;

        case TWeapon.CATEGORY.SNIPER:
            for (int l = 0; l < sniperTable.Length; l++)
            {
                if (xp < sniperTable[l])
                {
                    return(l);
                }
            }
            break;

        case TWeapon.CATEGORY.SUB_MACHINE:
            for (int num = 0; num < subMachineTable.Length; num++)
            {
                if (xp < subMachineTable[num])
                {
                    return(num);
                }
            }
            break;

        case TWeapon.CATEGORY.HAND_GUN:
            for (int m = 0; m < handGunTable.Length; m++)
            {
                if (xp < handGunTable[m])
                {
                    return(m);
                }
            }
            break;

        case TWeapon.CATEGORY.MELEE:
            for (int k = 0; k < meleeTable.Length; k++)
            {
                if (xp < meleeTable[k])
                {
                    return(k);
                }
            }
            break;

        case TWeapon.CATEGORY.SPECIAL:
            for (int i = 0; i < specialTable.Length; i++)
            {
                if (xp < specialTable[i])
                {
                    return(i);
                }
            }
            break;
        }
        return(maxWeaponLevel + 1);
    }
Exemplo n.º 3
0
 public int GetWeaponLevel4Player(TWeapon.CATEGORY category, int xp)
 {
     return(GetWeaponLevel(category, xp) + 1);
 }
Exemplo n.º 4
0
    public float GetWeaponLevelRatio(TWeapon.CATEGORY category, int xp)
    {
        int weaponLevel = GetWeaponLevel(category, xp);

        if (weaponLevel > maxWeaponLevel)
        {
            return(1f);
        }
        int num  = 0;
        int num2 = 0;

        switch (category)
        {
        case TWeapon.CATEGORY.HEAVY:
            num = heavyTable[weaponLevel];
            if (weaponLevel > 0)
            {
                num2 = heavyTable[weaponLevel - 1];
            }
            break;

        case TWeapon.CATEGORY.ASSAULT:
            num = assaultTable[weaponLevel];
            if (weaponLevel > 0)
            {
                num2 = assaultTable[weaponLevel - 1];
            }
            break;

        case TWeapon.CATEGORY.SNIPER:
            num = sniperTable[weaponLevel];
            if (weaponLevel > 0)
            {
                num2 = sniperTable[weaponLevel - 1];
            }
            break;

        case TWeapon.CATEGORY.SUB_MACHINE:
            num = subMachineTable[weaponLevel];
            if (weaponLevel > 0)
            {
                num2 = subMachineTable[weaponLevel - 1];
            }
            break;

        case TWeapon.CATEGORY.HAND_GUN:
            num = handGunTable[weaponLevel];
            if (weaponLevel > 0)
            {
                num2 = handGunTable[weaponLevel - 1];
            }
            break;

        case TWeapon.CATEGORY.MELEE:
            num = meleeTable[weaponLevel];
            if (weaponLevel > 0)
            {
                num2 = meleeTable[weaponLevel - 1];
            }
            break;

        case TWeapon.CATEGORY.SPECIAL:
            num = specialTable[weaponLevel];
            if (weaponLevel > 0)
            {
                num2 = specialTable[weaponLevel - 1];
            }
            break;
        }
        int num3 = num - num2;

        xp -= num2;
        if (num3 == 0)
        {
            return(0f);
        }
        return((float)xp / (float)num3);
    }