コード例 #1
0
    //calculation for the Dropchance of itemtype
    void RandomItemDropChance(int enemyLevel)
    {
        int Percentage;

        Percentage = Random.Range(1, 11);
        if (Percentage > 5)
        {
            randomArmor.CreateRandomArmor(enemyLevel);
            inventorySpace.AddArmorToInventory(randomArmor);
        }
        else
        {
            randomWeapon.CreateRandomWeapon(enemyLevel);
            inventorySpace.AddWeaponToInventory(randomWeapon);
        }
    }