Example #1
0
    public void LootRoll()
    {
        //TODO Create an array instead of if statements
        int roll = Random.Range(0, 13);

        if (roll == 0)
        {
            ak_drop.Drop(rarity_chance);
        }
        else if (roll == 1)
        {
            pump_drop.Drop(rarity_chance);
        }
        else if (roll == 2)
        {
            vector_drop.Drop(rarity_chance);
        }
        else if (roll == 3)
        {
            aug_drop.Drop(rarity_chance);
        }
        else if (roll == 4)
        {
            m1_drop.Drop(rarity_chance);
        }
        else if (roll == 5)
        {
            scar_drop.Drop(rarity_chance);
        }
        else if (roll == 6)
        {
            aa12_drop.Drop(rarity_chance);
        }
        else if (roll == 7)
        {
            g36_drop.Drop(rarity_chance);
        }
        else if (roll == 8)
        {
            mp5_drop.Drop(rarity_chance);
        }
        else if (roll == 9)
        {
            barrett_drop.Drop(rarity_chance);
        }
        else if (roll == 10)
        {
            deagle_drop.Drop(rarity_chance);
        }
        else if (roll == 11)
        {
            p90_drop.Drop(rarity_chance);
        }
        else if (roll == 12)
        {
            xm8_drop.Drop(rarity_chance);
        }
    }
Example #2
0
    public override void Open()
    {
        int roll = Random.Range(15, 16);

        if (roll == 0)
        {
            ak_drop.Drop(rarity_chance);
        }
        else if (roll == 1)
        {
            pump_drop.Drop(rarity_chance);
        }
        else if (roll == 2)
        {
            vector_drop.Drop(rarity_chance);
        }
        else if (roll == 3)
        {
            aug_drop.Drop(rarity_chance);
        }
        else if (roll == 4)
        {
            m1_drop.Drop(rarity_chance);
        }
        else if (roll == 5)
        {
            scar_drop.Drop(rarity_chance);
        }
        else if (roll == 6)
        {
            aa12_drop.Drop(rarity_chance);
        }
        else if (roll == 7)
        {
            SCARlette_drop.Drop(rarity_chance);
        }
        else if (roll == 8)
        {
            g36_drop.Drop(rarity_chance);
        }
        else if (roll == 9)
        {
            mp5_drop.Drop(rarity_chance);
        }
        else if (roll == 10)
        {
            barrett_drop.Drop(rarity_chance);
        }
        else if (roll == 11)
        {
            deagle_drop.Drop(rarity_chance);
        }
        else if (roll == 12)
        {
            p90_drop.Drop(rarity_chance);
        }
        else if (roll == 13)
        {
            xm8_drop.Drop(rarity_chance);
        }
        else if (roll == 14)
        {
            m16_drop.Drop(rarity_chance);
        }
        else if (roll == 15)
        {
            demonic_mp5_drop.Drop(rarity_chance);
        }
    }