Exemple #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));
            }
        }
Exemple #2
0
 public void loadProgresses(int id)
 {
     EnemyMasterManager.getInstance().addProgress(id);
     AttackSkillMasterManager.getInstance().addProgress(id);
     HealSkillMasterManager.getInstance().addProgress(id);
     BufSkillMasterManager.getInstance().addProgress(id);
     DebufSkillMasterManager.getInstance().addProgress(id);
     HealItemMasterManager.getInstance().addProgress(id);
     ItemMaterialMasterManager.getInstance().addProgress(id);
 }
    public override void report(int worldId)
    {
        material = ItemMaterialMasterManager.getInstance().getMaterialBuilderFromId(OBSERVE_ITEM_ID);
        ItemMaterialProgress progress = ItemMaterialMasterManager.getInstance().getProgress(OBSERVE_ITEM_ID);

        progress.Quality += progressQuality();
        progress.Level    = progressLevel(progress.Quality);

        ObserverHelper.saveToFile <ItemMaterialProgress>(progress, "ItemMaterialProgress", OBSERVE_ITEM_ID, worldId);
    }
Exemple #4
0
        public static List <ItemMaterial> creatRandomLevelItemMaterial(int level, int orderNumber)
        {
            var materials = new List <ItemMaterial>();
            var registeredMaterialsList = ItemMaterialMasterManager.getInstance().getMaterialFromLevel(level);

            for (int i = 0; i < orderNumber && registeredMaterialsList.Count > 0; i++)
            {
                int rand = Random.Range(0, registeredMaterialsList.Count);
                materials.Add(registeredMaterialsList[rand]);
                registeredMaterialsList.Remove(registeredMaterialsList[rand]);
            }
            return(materials);
        }