Пример #1
0
 void CaculateIndexAfterReinforce()
 {
     if (isSpecialUpgrade)
     {
         if (_mainEquip.typeItem == TypeEquipmentCharacter.Avatar)
         {
             int _newLevel = _mainEquip.levelUpgraded + 1;
             _newEquipAfterUpgrade.setValue("39", _newLevel * 0.02f);
             _newEquipAfterUpgrade.setValue("98", _newLevel * 0.01f);
             _newEquipAfterUpgrade.setValue("99", _newLevel * 0.01f);
             _newEquipAfterUpgrade.setValue("100", _newLevel * 0.005f);
             _newEquipAfterUpgrade.setValue("101", _newLevel * 0.005f);
             _newEquipAfterUpgrade.setValue("999", (_newLevel - 1) / 2 + 1);
         }
         else
         {
             int _idAttribute = MappingData.ConvertIdBuffToAttribute(_mainEquip.idItemInit);
             _tempValueIndex = float.Parse(_mainEquip.getValue(_idAttribute.ToString()).ToString());
             _newEquipAfterUpgrade.setValue(_idAttribute.ToString(), _tempValueIndex + (_mainEquip.idItemInit <= 8 ? 0.05f : 0.1f));
         }
     }
     for (int i = 1; i <= 28; i++)
     {
         _tempValueIndex = float.Parse(_mainEquip.getValue(i.ToString()).ToString());
         if (_tempValueIndex != 0)
         {
             _newEquipAfterUpgrade.setValue(i.ToString(), _tempValueIndex * 1.1f);
         }
     }
     _newEquipAfterUpgrade.levelUpgraded += 1;
 }
Пример #2
0
 void CaculateIndexAfterReinforce()
 {
     for (int i = 1; i <= 28; i++)
     {
         _tempValueIndex = float.Parse(_mainEquip.getValue(i.ToString()).ToString());
         if (_tempValueIndex != 0)
         {
             _newEquipAfterUpgrade.setValue(i.ToString(), _tempValueIndex * 1.1f);
         }
     }
     _newEquipAfterUpgrade.levelUpgraded += 1;
 }
Пример #3
0
    void GetListPropertiesDisplay(EquipmentItem _item)
    {
        propertyString.Clear();
        switch (_item.typeItem)
        {
        case TypeEquipmentCharacter.Weapon:
        case TypeEquipmentCharacter.OffhandWeapon:
            if (!float.Parse(_myEquipment.getValue("2").ToString()).Equals(0))
            {
                propertyString.Add(string.Format("Physical Damage: {0} - {1}", _fixValue(1), _fixValue(2)));
            }
            if (!float.Parse(_myEquipment.getValue("4").ToString()).Equals(0))
            {
                propertyString.Add(string.Format("Magical Damage: {0} - {1}", _fixValue(3), _fixValue(4)));
            }
            if (!float.Parse(_myEquipment.getValue("5").ToString()).Equals(0))
            {
                propertyString.Add(string.Format("Critical Chance: {0}%", _fixValue(5, true)));
            }
            if (!float.Parse(_myEquipment.getValue("6").ToString()).Equals(0))
            {
                propertyString.Add(string.Format("Multicast Chance: {0}%", _fixValue(6, true)));
            }
            if (!float.Parse(_myEquipment.getValue("12").ToString()).Equals(0))
            {
                propertyString.Add(string.Format("Attack Rate: {0} - {1}", _fixValue(11), _fixValue(12)));
            }
            if (!float.Parse(_myEquipment.getValue("8").ToString()).Equals(0))
            {
                propertyString.Add(string.Format("Physical damage Reinforce: {0}% - {1}%", _fixValue(7, true), _fixValue(8, true)));
            }
            if (!float.Parse(_myEquipment.getValue("10").ToString()).Equals(0))
            {
                propertyString.Add(string.Format("Magical damage Reinforce: {0}% - {1}%", _fixValue(9, true), _fixValue(10, true)));
            }
            break;

        case TypeEquipmentCharacter.Shield:
            propertyString.Add(string.Format("Physical Defense: {0} - {1} ", _fixValue(17), _fixValue(18)));
            propertyString.Add(string.Format("Magical Defense: {0} - {1}", _fixValue(19), _fixValue(20)));
            propertyString.Add(string.Format("Block Chance: {0}%", _fixValue(16, true)));
            propertyString.Add(string.Format("Physical Reduction: {0}% - {1}%", _fixValue(21, true), _fixValue(22, true)));
            propertyString.Add(string.Format("Magical Reduction: {0}% - {1}%", _fixValue(23, true), _fixValue(24, true)));
            break;

        case TypeEquipmentCharacter.Head:
        case TypeEquipmentCharacter.Torso:
        case TypeEquipmentCharacter.Leg:
        case TypeEquipmentCharacter.Belt:
        case TypeEquipmentCharacter.Boots:
        case TypeEquipmentCharacter.Gloves:
            propertyString.Add(string.Format("Physical Defense: {0} - {1}", _fixValue(17), _fixValue(18)));
            propertyString.Add(string.Format("Magical Defense: {0} - {1}", _fixValue(19), _fixValue(20)));
            propertyString.Add(string.Format("Parry Chance: {0} - {1}", _fixValue(13), _fixValue(14)));
            propertyString.Add(string.Format("Physical Reduction: {0}% - {1}%", _fixValue(21, true), _fixValue(22, true)));
            propertyString.Add(string.Format("Magical Reduction: {0}% - {1}%", _fixValue(23, true), _fixValue(24, true)));
            break;

        case TypeEquipmentCharacter.Ring:
        case TypeEquipmentCharacter.Amulet:
            propertyString.Add(string.Format("Physical Absorption: {0}% - {1}%", _fixValue(25, true), _fixValue(26, true)));
            propertyString.Add(string.Format("Magical Absorption: {0}% - {1}%", _fixValue(27, true), _fixValue(28, true)));
            break;

        case TypeEquipmentCharacter.Avatar:
            propertyString.Add(string.Format("Health: {0}%", _fixValue(39, true)));
            propertyString.Add(string.Format("Physical damage: {0}%", _fixValue(98, true)));
            propertyString.Add(string.Format("Magical damamge: {0}%", _fixValue(99, true)));
            propertyString.Add(string.Format("Physical absoption: {0}%", _fixValue(100, true)));
            propertyString.Add(string.Format("Magical absorption: {0}%", _fixValue(101, true)));

            propertyString.Add(string.Format("Slots of Adding Magical Properties: {0} Unit", int.Parse(_item.getValue("999").ToString())));
            break;

        case TypeEquipmentCharacter.Buff:

            int    _idRate    = MappingData.ConvertIdBuffToAttribute(_myEquipment.idItemInit);
            string _valueRate = _fixValue(_idRate, true);
            switch (_item.idItemInit)
            {
            case 1: propertyString.Add(string.Format("Damage against Assassin: {0}%", _valueRate)); break;

            case 2: propertyString.Add(string.Format("Damage against Paladin: {0}%", _valueRate)); break;

            case 3: propertyString.Add(string.Format("Damage against Zealot: {0}%", _valueRate)); break;

            case 4: propertyString.Add(string.Format("Damage against Sorceress: {0}%", _valueRate)); break;

            case 5: propertyString.Add(string.Format("Damage against Wizard: {0}%", _valueRate)); break;

            case 6: propertyString.Add(string.Format("Damage against Marksman: {0}%", _valueRate)); break;

            case 7: propertyString.Add(string.Format("Damage against Orc: {0}%", _valueRate)); break;

            case 8: propertyString.Add(string.Format("Damage against Barbarian: {0}%", _valueRate)); break;

            case 9: propertyString.Add(string.Format("Knock back resistance: {0}%", _valueRate)); break;

            case 10: propertyString.Add(string.Format("Immobilization resistance: {0}%", _valueRate)); break;

            case 11: propertyString.Add(string.Format("Blindness resistance: {0}%", _valueRate)); break;

            case 12: propertyString.Add(string.Format("Dementia resistance: {0}%", _valueRate)); break;

            case 13: propertyString.Add(string.Format("Disease resistance: {0}%", _valueRate)); break;

            case 14: propertyString.Add(string.Format("Fear resistance: {0}%", _valueRate)); break;

            case 15: propertyString.Add(string.Format("Sleep resistance: {0}%", _valueRate)); break;

            case 16: propertyString.Add(string.Format("Glamour resistance: {0}%", _valueRate)); break;

            case 17: propertyString.Add(string.Format("Stun resistance: {0}%", _valueRate)); break;

            case 18: propertyString.Add(string.Format("Hypnotic resistance: {0}%", _valueRate)); break;

            case 19: propertyString.Add(string.Format("Impotent resistance: {0}%", _valueRate)); break;

            case 20: propertyString.Add(string.Format("Rot resistance: {0}%", _valueRate)); break;

            case 21: propertyString.Add(string.Format("Pain resistance: {0}%", _valueRate)); break;

            case 22: propertyString.Add(string.Format("Bleed resistance: {0}%", _valueRate)); break;

            case 23: propertyString.Add(string.Format("Crazy resistance: {0}%", _valueRate)); break;

            case 24: propertyString.Add(string.Format("Dull resistance: {0}%", _valueRate)); break;

            default: Debug.Log("Sao không có cái nào trùng"); break;
            }
            break;
        }
        try
        {
            var N = SimpleJSON.JSON.Parse(_item.getValue("listidproperty").ToString());
            foreach (KeyValuePair <string, JSONNode> _temp in N.AsObject)
            {
                propertyString.Add("+" + Constant.getPropertiesName(_temp.Key.ToString()) + ": " + Constant.displayTypeProperty(int.Parse(_temp.Key.ToString()), float.Parse(_temp.Value.AsFloat.ToString())));
            }
        }
        catch (Exception e)
        {
        }

        propertyString.Add(string.Format("Sell price: {0}", _item.priceItem));
    }
Пример #4
0
    public void RemoveBonusItem(EquipmentItem _item)
    {
        minPhysicalDamage     -= float.Parse(_item.getValue("1").ToString());
        maxPhysicalDamage     -= float.Parse(_item.getValue("2").ToString());
        minMagicalDamage      -= float.Parse(_item.getValue("3").ToString());
        maxMagicalDamage      -= float.Parse(_item.getValue("4").ToString());
        CriticalChance        -= float.Parse(_item.getValue("5").ToString());
        MulticastChance       -= float.Parse(_item.getValue("6").ToString());
        minPhysicalReinforce  -= float.Parse(_item.getValue("7").ToString());
        maxPhysicalReinforce  -= float.Parse(_item.getValue("8").ToString());
        minMagicalReinforce   -= float.Parse(_item.getValue("9").ToString());
        maxMagicalReinforce   -= float.Parse(_item.getValue("10").ToString());
        minAttackRate         -= float.Parse(_item.getValue("11").ToString());
        maxAttackRate         -= float.Parse(_item.getValue("12").ToString());
        minParryRate          -= float.Parse(_item.getValue("13").ToString());
        maxParryRate          -= float.Parse(_item.getValue("14").ToString());
        minBlockChance        -= float.Parse(_item.getValue("15").ToString());
        maxBlockChance        -= float.Parse(_item.getValue("16").ToString());
        minPhysicalDef        -= float.Parse(_item.getValue("17").ToString());
        maxPhysicalDef        -= float.Parse(_item.getValue("18").ToString());
        minMagicalDef         -= float.Parse(_item.getValue("19").ToString());
        maxMagicalDef         -= float.Parse(_item.getValue("20").ToString());
        minPhysicalRedution   -= float.Parse(_item.getValue("21").ToString());
        maxPhysicalRedution   -= float.Parse(_item.getValue("22").ToString());
        minPhysicalAbsorption -= float.Parse(_item.getValue("23").ToString());
        maxPhysicalAbsorption -= float.Parse(_item.getValue("24").ToString());
        minMagicalAbsorption  -= float.Parse(_item.getValue("27").ToString());
        maxMagicalAbsorption  -= float.Parse(_item.getValue("28").ToString());

        try
        {
            var N = SimpleJSON.JSON.Parse(_item.getValue("listidproperty").ToString());

            for (int i = 0; i < N.Count; i++)
            {
                foreach (KeyValuePair <string, JSONNode> _temp in N[i].AsObject)
                {
                    SubBonusProperties(int.Parse(_temp.Key.ToString()), float.Parse(_temp.Value.ToString()));
                }
            }
        }
        catch (Exception e)
        {
        }
    }