Beispiel #1
0
        public static Armor creatRandomLevelArmor(int level, IFriendly creator = null, float qualityBonus = 0)
        {
            int        numberOfWeponShape = ArmorShapeMasterManager.getInstance().getNumberOfShapes();
            int        shpeRand           = Random.Range(0, numberOfWeponShape);
            ArmorShape shape = ArmorShapeMasterManager.getInstance().getShapeFromId(shpeRand);

            var          armorMaterials = ItemMaterialMasterManager.getInstance().getMaterialFromLevel(level);
            int          materialRand   = Random.Range(0, armorMaterials.Count);
            ItemMaterial material       = armorMaterials[materialRand];

            if (creator == null)
            {
                float dex         = material.getQuality() / 20;
                float diffculty   = shape.getCreatDifficulty();
                float baseQuality = material.getQuality();
                qualityBonus = dex / 2;

                float quality = weaponQualityCaliculate(dex, diffculty, baseQuality, qualityBonus);
                return(new Armor(shape, material, quality));
            }
            else
            {
                return(creatArmor(shape, material, creator, qualityBonus));
            }
        }
Beispiel #2
0
        public static Armor creatArmor(ArmorShape shape, ItemMaterial material, IFriendly creator, float qualityBonus)
        {
            float dex         = creator.getFriendlyAbility(FriendlyAbility.DEX);
            float diffculty   = shape.getCreatDifficulty();
            float baseQuality = material.getQuality();

            float quality = weaponQualityCaliculate(dex, diffculty, baseQuality, qualityBonus);

            return(new Armor(shape, material, quality));
        }