Exemple #1
0
    public void EnemyDrops()
    {
        // Debug.Log("checking for enemy drops");
        WeaponGenerator weaponGenerator = gameObject.GetComponent <WeaponGenerator>();
        ArmorGenerator  armorGenerator  = gameObject.GetComponent <ArmorGenerator>();
        ItemGenerator   itemGenerator   = gameObject.GetComponent <ItemGenerator>();

        CheckItemDrop();

        if (isWeaponDrop)
        {
            // check for preset weapon chance
            CheckPresetWeapon();

            weaponGenerator.GenerateWeapon(presetWeapon);
            isWeaponDrop = false;
        }

        if (isArmorDrop)
        {
            // check for preset armor chance
            CheckPresetArmor();

            armorGenerator.GenerateArmor();
            isArmorDrop = false;
        }

        if (isItemDrop)
        {
            itemGenerator.GenerateItem();
            isItemDrop = false;
        }
    }
Exemple #2
0
        public ArmorItem GenerateArmor(ItemRareness rareness, ArmorClass armorClass)
        {
            if (GetIfRarenessExceedMax(rareness))
            {
                throw new ArgumentException("Item generator cannot generate epic items.");
            }

            return(armorGenerator.GenerateArmor(rareness, armorClass));
        }