Ejemplo n.º 1
0
        public Equipment(double bonusdamage, string name, EquipType type, EquipQuality quality)
        {
            Name          = name;
            BonusDamage   = bonusdamage;
            EquipTypeE    = type;
            EquipQualityE = quality;
            switch (EquipQualityE)
            {
            case EquipQuality.Common:
                BonusDamage *= 1;
                Resist       = DamageType.NULL;
                damagetype   = DamageType.NULL;
                break;

            case EquipQuality.Rare:
                BonusDamage *= 1.2;
                AddResistAndDamage();
                break;

            case EquipQuality.Mystic:
                BonusDamage *= 1.4;
                AddResistAndDamage();
                break;

            case EquipQuality.Legendary:
                BonusDamage *= 1.5;
                AddResistAndDamage();
                break;
            }
        }
Ejemplo n.º 2
0
    public EquipData RandEquipProperty(InGameBaseEquip equip)
    {
        EquipConf     equipConf    = ConfigManager.equipConfManager.dic[equip.confid];
        EquipConfData propertyData = ConfigManager.equipConfManager.datadic[equip.confid];

        List <PropertyConf>  propertys    = ConfigManager.propertyConfManager.datas;
        List <EquipProperty> propertyList = new List <EquipProperty>();

        EquipQuality quality = equip.quality;

        for (int i = 0; i < propertyData.propertyList.Count; i++)
        {
            PropertyConf propertyConf = ConfigManager.propertyConfManager.dataMap[propertyData.propertyList[i].id];

            EquipProperty e = new EquipProperty();
            e.id = propertyConf.id;
            float val = propertyConf.baseval + propertyConf.GetLevelupVal(equip.level);
            e.val = Mathf.Ceil(val + Random.Range(-val * propertyConf.randomrange, val * propertyConf.randomrange));
            e.val = e.val * (propertyData.propertyList[i].rate / 100f);
            propertyList.Add(e);
        }

        for (int i = propertyData.propertyList.Count; i < quality.propertycount; i++)
        {
            PropertyConf  propertyConf = propertys[Random.Range(0, propertys.Count)];
            EquipProperty e            = new EquipProperty();
            e.id = propertyConf.id;
            float val = propertyConf.baseval + propertyConf.GetLevelupVal(equip.level);
            e.val = Mathf.Ceil(val + Random.Range(-val * propertyConf.randomrange, val * propertyConf.randomrange));
            propertyList.Add(e);
        }

        EquipData equipData = new EquipData(
            UserDataManager.instance.GetInstanceID(),
            ConfigManager.equipQualityManager.GetByPropertyCount(propertyList.Count).id,
            equipConf.id,
            -1,
            propertyList);

        return(equipData);
        //UserDataManager.instance.AddEquip(equipData);
    }
Ejemplo n.º 3
0
    public void Load()
    {
        if (datas != null)
        {
            datas.Clear();
        }

        datas = ConfigManager.Load <EquipQuality>();
        dic.Clear();

        for (int i = 0; i < datas.Count; i++)
        {
            EquipQuality obj = datas[i];

            colordic.Add(obj.id, GameCommon.HexToColor(obj.color));
            dic.Add(obj.id, obj);

            allOdds += obj.odds;
        }
    }