Пример #1
0
 public ItemChangingRequest(ItemActionType actionType, List <long> worldIds,
                            Action <ItemsChangingResponse> callback)
 {
     ActionType = actionType;
     WorldIds   = worldIds;
     Callback   = callback;
 }
Пример #2
0
    /// <summary>
    /// 展示物品信息  by吴江
    /// </summary>
    /// <param name="_info">装备信息</param>
    /// <param name="_left">左边功能按钮的行为类型</param>
    /// <param name="_middle">中间功能按钮的行为类型</param>
    /// <param name="_right">右边功能按钮的行为类型</param>
    /// <param name="_itemUI">展示界面的碰撞依据。为空的话则是物品控件本身</param>
    public static void ShowEquipmentTooltip(EquipmentInfo _info, ItemActionType _left, ItemActionType _middle, ItemActionType _right, ItemActionType _other, GameObject _tiggerUI = null)
    {
        CloseAllTooltip();
        if (_info == null)
        {
            return;
        }
        GUIBase panel = GetPanelByType(TooltipType.Equipment);

        if (panel == null)
        {
            return;
        }
        EquipmentTooltip equipmentTooltip = panel.GetComponent <EquipmentTooltip>();

        if (equipmentTooltip == null)
        {
            GameSys.LogError("在预制上找不到组件 : <EquipmentTooltip>!");
            return;
        }
        equipmentTooltip.EquipmentInfo = _info;
        equipmentTooltip.SetActionBtn(_left, _middle, _right, _other);
        panel.OpenUI();
        //SetEquipTooltipPostion(panel.gameObject, _tiggerUI);
        if (_info.IsEquip && _info.BelongTo != EquipmentBelongTo.EQUIP)
        {
            EquipmentInfo compareEquip = GameCenter.inventoryMng.GetEquipFromEquipDicBySlot(_info.Slot);
            if (compareEquip != null && _info.InstanceID != compareEquip.InstanceID)
            {
                ToolTipMng.ShowCompareEquipmentTooltip(compareEquip);
            }
        }
    }
Пример #3
0
    /// <summary>
    /// 展示物品信息 by 贺丰
    /// </summary>
    /// <param name="_itemUI"></param>
    /// <param name="_left"></param>
    /// <param name="_middle"></param>
    /// <param name="_right"></param>
    /// <param name="_tiggerUI"></param>
    public static void ShowEquipmentTooltip(ItemUI _itemUI, ItemActionType _left, ItemActionType _middle, ItemActionType _right, ItemActionType _other, GameObject _tiggerUI = null)
    {
        CloseAllTooltip();
        EquipmentInfo info = _itemUI.EQInfo;

        if (info == null)
        {
            return;
        }
        GUIBase panel = GetPanelByType(TooltipType.Equipment);

        if (panel == null)
        {
            return;
        }
        EquipmentTooltip equipmentTooltip = panel.GetComponent <EquipmentTooltip>();

        if (equipmentTooltip == null)
        {
            GameSys.LogError("在预制上找不到组件 : <EquipmentTooltip>!");
            return;
        }
        //		Debug.Log("ShowEquipmentTooltip   热感");
        equipmentTooltip.mSyncTriggerChk = _itemUI.GetComponent <UIToggle>();
        equipmentTooltip.EquipmentInfo   = info;
        equipmentTooltip.SetActionBtn(_left, _middle, _right, _other);
        panel.OpenUI();
        //SetEquipTooltipPostion(panel.gameObject, _tiggerUI);
    }
Пример #4
0
    private void ExecutePlayerFootItemAction(ItemActionType actionType, FieldItem fieldItem)
    {
        Assert.IsTrue(_acts.Count == 0);

        switch (actionType)
        {
        case ItemActionType.Close:
            ChangeGameState(GameState.InputWait);
            break;

        case ItemActionType.Use:
            ExecutePlayerUseFootItem(fieldItem);
            break;

        case ItemActionType.Throw:
            ExecutePlayerThrowFootItem(fieldItem);
            break;

        case ItemActionType.Take:
            ExecutePlayerTakeFootItem(fieldItem);
            break;

        default:
            Assert.IsTrue(false);
            break;
        }
    }
Пример #5
0
 public ItemChangingRequest(ItemActionType actionType, long worldId,
                            Action <ItemsChangingResponse> callback)
 {
     ActionType = actionType;
     WorldId    = worldId;
     Callback   = callback;
 }
Пример #6
0
 protected override void OnItemClicked(ItemActionType actionType, MarketItemModel model)
 {
     if (actionType == ItemActionType.CreateSellOffer)
     {
         if (WidgetModel.CurrentItemType == ItemModelType.GameInventory)
         {
             MoveToMarketAndSell();
         }
         else
         {
             ApplyCreateSellOfferCommand(model);
         }
     }
     else if (actionType == ItemActionType.EditSellOffer)
     {
         if (WidgetModel.CurrentItemType == ItemModelType.MySellOffers)
         {
             ApplyEditSellOfferCommand(model);
         }
     }
     else
     {
         base.OnItemClicked(actionType, model);
     }
 }
Пример #7
0
 public AppChangingItemsMessage(ItemActionType actionType)
 {
     Params = new RequestParams()
     {
         ActionType = actionType
     };
 }
Пример #8
0
 public void SetActionBtn(ItemActionType _left, ItemActionType _middle, ItemActionType _right, ItemActionType _other)
 {
     leftAction   = _left;
     middleAction = _middle;
     rightAction  = _right;
     otherAction  = _other;
 }
Пример #9
0
 public override void Deserialize(NetworkReader reader)
 {
     base.Deserialize(reader);
     ActionType = (ItemActionType)reader.ReadInt32();
     WorldId    = reader.ReadInt64();
     ItemType   = (GameItemType)reader.ReadInt32();
 }
Пример #10
0
        protected override void OnItemClicked(ItemActionType actionType, MarketItemModel itemModel)
        {
            base.OnItemClicked(actionType, itemModel);

            switch (actionType)
            {
            case ItemActionType.Select:
                OnItemSelected(itemModel);
                break;

            case ItemActionType.SendToDmarket:
                ApplyChangeItemInventoryCommand(itemModel, MarketMoveItemType.ToMarket);
                break;

            case ItemActionType.SendToGameInventory:
                ApplyChangeItemInventoryCommand(itemModel, MarketMoveItemType.FromMarket);
                break;

            case ItemActionType.CancelSellOffer:
                ApplyCancelSellOfferCommand(itemModel);
                break;

            case ItemActionType.EditSellOffer:
                OnEditSellOffer(itemModel);
                break;
            }
        }
Пример #11
0
        private void UpdateActionSlot(EntityUid item, ItemActionType itemActionType, ActionSlot actionSlot,
            ActionAssignment? assignedActionType)
        {
            if (!_entityManager.TryGetEntity(item, out var itemEntity)) return;
            if (_actionManager.TryGet(itemActionType, out var action))
            {
                actionSlot.Assign(action, itemEntity, true);
            }
            else
            {
                Logger.ErrorS("action", "unrecognized actionType {0}", assignedActionType);
                actionSlot.Clear();
                return;
            }

            if (!_actionsComponent.TryGetItemActionState(itemActionType, item, out var actionState))
            {
                // action is no longer tied to an item, this should never happen as we
                // check this at the start of this method. But just to be safe
                // we will restore our assignment here to the correct state
                Logger.ErrorS("action", "coding error, expected actionType {0} to have" +
                                          " a state but it didn't", assignedActionType);
                _actionsComponent.Assignments.AssignSlot(SelectedHotbar, actionSlot.SlotIndex,
                    ActionAssignment.For(itemActionType));
                actionSlot.Assign(action);
                return;
            }

            if (!actionState.Enabled)
            {
                // just disabled an action we were trying to target with, stop targeting
                if (SelectingTargetFor?.Action != null && SelectingTargetFor.Action == action)
                {
                    StopTargeting();
                }

                actionSlot.DisableAction();
            }
            else
            {
                // action is currently granted
                actionSlot.EnableAction();

                // if we are targeting with an action now on cooldown, stop targeting if we should
                if (SelectingTargetFor?.Action != null && SelectingTargetFor.Action == action &&
                    SelectingTargetFor.Item == itemEntity &&
                    actionState.IsOnCooldown(_gameTiming) && action.DeselectOnCooldown)
                {
                    StopTargeting();
                }
            }
            actionSlot.Cooldown = actionState.Cooldown;

            // check if we need to toggle it
            if (action.BehaviorType == BehaviorType.Toggle)
            {
                actionSlot.ToggledOn = actionState.ToggledOn;
            }
        }
Пример #12
0
 public static void RegisterWorkItemEvent(EventStep step, ItemActionType type, Action <IWorkflowInstance, IWorkflowItem> predicate)
 {
     if (predicate != null)
     {
         string key = KeyTemplate.FormatTo(step.ToString(), type.ToString());
         WorkItemEventList.Add(key, predicate);
     }
 }
Пример #13
0
        private void SendToServer(ItemActionType actionType, long worldId)
        {
            var message = new ItemChangingRequest(actionType, worldId,
                                                  OnServerCallback);

            Controller.MakedItemAction(message);
            View.WaitingForm.Show();
        }
Пример #14
0
        private void SendToServer(ItemActionType actionType, long worldId)
        {
            var message = new ItemChangingRequest(actionType, new List <long>()
            {
                worldId
            }, OnItemMoveCallback);

            Controller.MarketItemAction(message);
            View.WaitingForm.Show();
        }
Пример #15
0
    public static void DoItemAction(this EquipmentInfo _eq, ItemActionType _type)
    {
//		if(_type == ItemActionType.SelectAdd){
//			NGUIDebug.Log("DoItemAction    " + _eq.InstanceID);
//		}
//		Debug.Log("Check Click Times---------DoItemAction--------------");
//		System.Action action = _eq.GetItemAction(_type);
//        if (action != null) action();
        _eq.GetItemAction(_type);
    }
Пример #16
0
    /// <summary>
    /// 设置功能按钮 by吴江
    /// </summary>
    /// <param name="_left"></param>
    /// <param name="_middle"></param>
    /// <param name="_right"></param>
    public void SetActionBtn(ItemActionType _left, ItemActionType _middle, ItemActionType _right)
    {
        HideAllBtn();
//		gamesBtn.Clear();
        if (curEquipInfo == null)
        {
            return;
        }

        string name = curEquipInfo.GetItemActionName(_left);

        if (name != string.Empty)
        {
            ShowButton(leftButton, leftButtonText, name, x1 => {
//				if(_left == ItemActionType.SelectAdd){
//					InventoryUtility.TryToSelect(this.curEquipInfo);
//				}else{
//					curEquipInfo.DoItemAction(_left);
//				}
                curEquipInfo.DoItemAction(_left);
                Close(leftButton.gameObject);
            });
        }
        name = curEquipInfo.GetItemActionName(_middle);
        if (name != string.Empty)
        {
            ShowButton(middleButton, middleButtonText, name, x2 => {
//				if(name == "强 化"){
//					InventoryUtility.Strengthen(this.curEquipInfo);
//				}else{
//					if(_middle == ItemActionType.SelectAdd){
//						InventoryUtility.TryToSelect(this.curEquipInfo);
//					}else{
//						curEquipInfo.DoItemAction(_middle);
//					}
                curEquipInfo.DoItemAction(_middle);
                Close(middleButton.gameObject);
//				}
            });
        }
        name = curEquipInfo.GetItemActionName(_right);
        if (name != string.Empty)
        {
            ShowButton(rightButton, rightButtonText, name, x3 => {
//				if(_right == ItemActionType.SelectAdd){
//					InventoryUtility.TryToSelect(this.curEquipInfo);
//				}else{
//					curEquipInfo.DoItemAction(_right);
//				}
                curEquipInfo.DoItemAction(_right);
                Close(rightButton.gameObject);
            });
        }
    }
Пример #17
0
 protected override void OnItemClicked(ItemActionType actionType, MarketItemModel model)
 {
     if (actionType == ItemActionType.Buy)
     {
         ApplyBuyItemCommand(model);
     }
     else
     {
         base.OnItemClicked(actionType, model);
     }
 }
Пример #18
0
 public ItemActionEventArgs(IEntity performer, IEntity item, ItemActionType actionType)
 {
     Performer  = performer;
     ActionType = actionType;
     Item       = item;
     if (!Item.TryGetComponent(out ItemActions))
     {
         throw new InvalidOperationException($"performer {performer.Name} tried to perform item action {actionType} " +
                                             $" for item {Item.Name} but the item had no ItemActionsComponent," +
                                             " which should never occur");
     }
 }
        public ItemActionEventArgs(EntityUid performer, EntityUid item, ItemActionType actionType)
        {
            Performer  = performer;
            ActionType = actionType;
            Item       = item;
            var entMan = IoCManager.Resolve <IEntityManager>();

            if (!entMan.TryGetComponent(Item, out ItemActions))
            {
                throw new InvalidOperationException($"performer {entMan.GetComponent<MetaDataComponent>(performer).EntityName} tried to perform item action {actionType} " +
                                                    $" for item {entMan.GetComponent<MetaDataComponent>(Item).EntityName} but the item had no ItemActionsComponent," +
                                                    " which should never occur");
            }
        }
Пример #20
0
 private void UpdateActionSlot(ItemActionType itemlessActionType, ActionSlot actionSlot,
                               ActionAssignment?assignedActionType)
 {
     if (_actionManager.TryGet(itemlessActionType, out var action))
     {
         actionSlot.Assign(action);
     }
     else
     {
         Logger.ErrorS("action", "unrecognized actionType {0}", assignedActionType);
         actionSlot.Clear();
     }
     actionSlot.Cooldown = null;
 }
 public ItemActionMessage(
     ItemActionType itemActionType,
     [NotNull] IItemContainer container,
     InterfaceMetadata @interface,
     int itemIndexInContainer)
 {
     if (0 > itemIndexInContainer || itemIndexInContainer >= container.Provider.Count)
     {
         throw new ArgumentOutOfRangeException(nameof(itemIndexInContainer));
     }
     ItemActionType       = itemActionType;
     Container            = container ?? throw new ArgumentNullException(nameof(container));
     Interface            = @interface;
     ItemIndexInContainer = itemIndexInContainer;
 }
Пример #22
0
 public void SetActionBtn(ItemActionType _left, ItemActionType _middle, ItemActionType _right, ItemActionType _access)
 {
     leftAction   = _left;
     middleAction = _middle;
     rightAction  = _right;
     if (girdDic.Count > 0)
     {
         using (var e = girdDic.GetEnumerator())
         {
             while (e.MoveNext())
             {
                 ItemUI item = e.Current.Value;
                 item.SetActionBtn(_left, _middle, _right);
             }
         }
     }
 }
Пример #23
0
        public static void RaiseWorkItemEvent(EventStep step, ItemActionType type, IWorkflowInstance instance, IWorkflowItem item)
        {
            string key = KeyTemplate.FormatTo(step.ToString(), type.ToString());

            if (WorkItemEventList.ContainsKey(key))
            {
                try
                {
                    Logger.GetLogger("Workflow").Info("{0}:Raise WorkflowItemEvent:{1}".FormatTo(instance.Id, key));
                    WorkItemEventList[key](instance, item);
                }
                catch (Exception ex)
                {
                    Logger.GetLogger("Workflow").Info("{0}:Raise WorkflowEvent:{1} Error:{2},{3}".FormatTo(instance.Id, key, ex.Message, ex.StackTrace));
                }
            }
        }
Пример #24
0
        protected virtual void OnItemClicked(ItemActionType actionType, MarketItemModel itemModel)
        {
            switch (actionType)
            {
            case ItemActionType.SellOnDmarket:
                ApplySellItemState(itemModel);
                break;

            case ItemActionType.Buy:
                ApplyCheckoutItemState(itemModel);
                break;

            case ItemActionType.BuyItem:
                ApplyBuyItemState(itemModel);
                break;
            }
        }
Пример #25
0
        protected override List <ItemActionType> ResolveCore(List <ProvisioningEngineItemActionTypesSetting> provisioningEngineItemActionTypesSettings)
        {
            var result = new List <ItemActionType>();

            foreach (var group in provisioningEngineItemActionTypesSettings.GroupBy(p => p.ItemTypeEnumId))
            {
                var item = new ItemActionType {
                    ItemType = (ItemType)group.Key, ActionTypes = new List <ActionType>()
                };
                foreach (var provisioningEngineItemActionTypesSetting in group)
                {
                    item.ActionTypes.Add((ActionType)provisioningEngineItemActionTypesSetting.ActionTypeEnumId);
                }
                result.Add(item);
            }

            return(result);
        }
Пример #26
0
 private void ExecuteActionType(ItemActionType iat)
 {
     if (iat == ItemActionType.Equip)
     {
         ((HeroModel)context).EquipItem(this.item);
     }
     else if (iat == ItemActionType.Unequip)
     {
         ((HeroModel)context).UnequipItem(this.item);
     }
     else if (iat == ItemActionType.Sell)
     {
         print($"Sell");
     }
     else if (iat == ItemActionType.Upgrade)
     {
         print($"Upgrade");
     }
     else if (iat == ItemActionType.Destroy)
     {
         print($"Destroy");
     }
 }
Пример #27
0
    private void ExecutePlayerItemAction(ItemActionType actionType, Item item)
    {
        Debug.Log("Count = " + _acts.Count);
        Assert.IsTrue(_acts.Count == 0);

        switch (actionType)
        {
        case ItemActionType.Use:
            ExecutePlayerUseItem(item);
            break;

        case ItemActionType.Throw:
            ExecutePlayerThrowItem(item);
            break;

        case ItemActionType.Put:
            ExecutePlayerPutItem(item);
            break;

        default:
            Assert.IsTrue(false);
            break;
        }
    }
 public TargetEntityItemActionEventArgs(IEntity performer, IEntity target, IEntity item,
                                        ItemActionType actionType) : base(performer, item, actionType)
 {
     Target = target;
 }
Пример #29
0
 public ToggleItemActionEventArgs(IEntity performer, bool toggledOn, IEntity item,
                                  ItemActionType actionType) : base(performer, item, actionType)
 {
     ToggledOn = toggledOn;
 }
 public PerformTargetEntityItemActionMessage(ItemActionType actionType, EntityUid item, EntityUid target) : base(actionType, item)
 {
     _target = target;
 }
Пример #31
0
        // Methods
        public ItemAction(byte[] data)
            : base(data)
        {
            this.superiorType = SuperiorItemType.NotApplicable;
            this.charClass = CharacterClass.NotApplicable;
            this.level = -1;
            this.usedSockets = -1;
            this.use = -1;
            this.graphic = -1;
            this.color = -1;
            this.stats = new List<StatBase>();
            this.unknown1 = -1;
            this.runewordID = -1;
            this.runewordParam = -1;
            BitReader br = new BitReader(data, 1);
            this.action = (ItemActionType) br.ReadByte();
            br.SkipBytes(1);
            this.category = (ItemCategory) br.ReadByte();
            this.uid = br.ReadUInt32();
            if (data[0] == 0x9d)
            {
                br.SkipBytes(5);
            }
            this.flags = (ItemFlags) br.ReadUInt32();
            this.version = (ItemVersion) br.ReadByte();
            this.unknown1 = br.ReadByte(2);
            this.destination = (ItemDestination) br.ReadByte(3);
            if (this.destination == ItemDestination.Ground)
            {
                this.x = br.ReadUInt16();
                this.y = br.ReadUInt16();
            }
            else
            {
                this.location = (EquipmentLocation) br.ReadByte(4);
                this.x = br.ReadByte(4);
                this.y = br.ReadByte(3);
                this.container = (ItemContainer) br.ReadByte(4);
            }
            if ((this.action == ItemActionType.AddToShop) || (this.action == ItemActionType.RemoveFromShop))
            {
                int num = ((int) this.container) | 0x80;
                if ((num & 1) == 1)
                {
                    num--;
                    this.y += 8;
                }
                this.container = (ItemContainer) num;
            }
            else if (this.container == ItemContainer.Unspecified)
            {
                if (this.location == EquipmentLocation.NotApplicable)
                {
                    if ((this.Flags & ItemFlags.InSocket) == ItemFlags.InSocket)
                    {
                        this.container = ItemContainer.Item;
                        this.y = -1;
                    }
                    else if ((this.action == ItemActionType.PutInBelt) || (this.action == ItemActionType.RemoveFromBelt))
                    {
                        this.container = ItemContainer.Belt;
                        this.y = this.x / 4;
                        this.x = this.x % 4;
                    }
                }
                else
                {
                    this.x = -1;
                    this.y = -1;
                }
            }
            if ((this.flags & ItemFlags.Ear) == ItemFlags.Ear)
            {
                this.charClass = (CharacterClass) br.ReadByte(3);
                this.level = br.ReadByte(7);
                this.name = br.ReadString(7, '\0', 0x10);
                this.baseItem = BaseItem.Get(ItemType.Ear);
            }
            else
            {
                this.baseItem = BaseItem.GetByID(this.category, br.ReadUInt32());
                if (this.baseItem.Type == ItemType.Gold)
                {
                    this.stats.Add(new SignedStat(BaseStat.Get(StatType.Quantity), br.ReadInt32(br.ReadBoolean(1) ? 0x20 : 12)));
                }
                else
                {
                    this.usedSockets = br.ReadByte(3);
                    if ((this.flags & (ItemFlags.Compact | ItemFlags.Gamble)) == ItemFlags.None)
                    {
                        BaseStat stat;
                        int num2;
                        this.level = br.ReadByte(7);
                        this.quality = (ItemQuality) br.ReadByte(4);
                        if (br.ReadBoolean(1))
                        {
                            this.graphic = br.ReadByte(3);
                        }
                        if (br.ReadBoolean(1))
                        {
                            this.color = br.ReadInt32(11);
                        }
                        if ((this.flags & ItemFlags.Identified) == ItemFlags.Identified)
                        {
                            switch (this.quality)
                            {
                                case ItemQuality.Inferior:
                                    this.prefix = new ItemAffix(ItemAffixType.InferiorPrefix, br.ReadByte(3));
                                    break;

                                case ItemQuality.Superior:
                                    this.prefix = new ItemAffix(ItemAffixType.SuperiorPrefix, 0);
                                    this.superiorType = (SuperiorItemType) br.ReadByte(3);
                                    break;

                                case ItemQuality.Magic:
                                    this.prefix = new ItemAffix(ItemAffixType.MagicPrefix, br.ReadUInt16(11));
                                    this.suffix = new ItemAffix(ItemAffixType.MagicSuffix, br.ReadUInt16(11));
                                    break;

                                case ItemQuality.Set:
                                    this.setItem = BaseSetItem.Get(br.ReadUInt16(12));
                                    break;

                                case ItemQuality.Rare:
                                case ItemQuality.Crafted:
                                    this.prefix = new ItemAffix(ItemAffixType.RarePrefix, br.ReadByte(8));
                                    this.suffix = new ItemAffix(ItemAffixType.RareSuffix, br.ReadByte(8));
                                    break;

                                case ItemQuality.Unique:
                                    if (this.baseItem.Code != "std")
                                    {
                                        try
                                        {
                                            this.uniqueItem = BaseUniqueItem.Get(br.ReadUInt16(12));
                                        }
                                        catch{}
                                    }
                                    break;
                            }
                        }
                        if ((this.quality == ItemQuality.Rare) || (this.quality == ItemQuality.Crafted))
                        {
                            this.magicPrefixes = new List<MagicPrefixType>();
                            this.magicSuffixes = new List<MagicSuffixType>();
                            for (int i = 0; i < 3; i++)
                            {
                                if (br.ReadBoolean(1))
                                {
                                    this.magicPrefixes.Add((MagicPrefixType) br.ReadUInt16(11));
                                }
                                if (br.ReadBoolean(1))
                                {
                                    this.magicSuffixes.Add((MagicSuffixType) br.ReadUInt16(11));
                                }
                            }
                        }
                        if ((this.Flags & ItemFlags.Runeword) == ItemFlags.Runeword)
                        {
                            this.runewordID = br.ReadUInt16(12);
                            this.runewordParam = br.ReadUInt16(4);
                            num2 = -1;
                            if (this.runewordParam == 5)
                            {
                                num2 = this.runewordID - (this.runewordParam * 5);
                                if (num2 < 100)
                                {
                                    num2--;
                                }
                            }
                            else if (this.runewordParam == 2)
                            {
                                num2 = ((this.runewordID & 0x3ff) >> 5) + 2;
                            }
                            br.ByteOffset -= 2;
                            this.runewordParam = br.ReadUInt16();
                            this.runewordID = num2;
                            if (num2 == -1)
                            {
                                throw new Exception("Unknown Runeword: " + this.runewordParam);
                            }
                            this.runeword = BaseRuneword.Get(num2);
                        }
                        if ((this.Flags & ItemFlags.Personalized) == ItemFlags.Personalized)
                        {
                            this.name = br.ReadString(7, '\0', 0x10);
                        }
                        if (this.baseItem is BaseArmor)
                        {
                            stat = BaseStat.Get(StatType.ArmorClass);
                            this.stats.Add(new SignedStat(stat, br.ReadInt32(stat.SaveBits) - stat.SaveAdd));
                        }
                        if ((this.baseItem is BaseArmor) || (this.baseItem is BaseWeapon))
                        {
                            stat = BaseStat.Get(StatType.MaxDurability);
                            num2 = br.ReadInt32(stat.SaveBits);
                            this.stats.Add(new SignedStat(stat, num2));
                            if (num2 > 0)
                            {
                                stat = BaseStat.Get(StatType.Durability);
                                this.stats.Add(new SignedStat(stat, br.ReadInt32(stat.SaveBits)));
                            }
                        }
                        if ((this.Flags & (ItemFlags.None | ItemFlags.Socketed)) == (ItemFlags.None | ItemFlags.Socketed))
                        {
                            stat = BaseStat.Get(StatType.Sockets);
                            this.stats.Add(new SignedStat(stat, br.ReadInt32(stat.SaveBits)));
                        }
                        if (this.baseItem.Stackable)
                        {
                            if (this.baseItem.Useable)
                            {
                                this.use = br.ReadByte(5);
                            }
                            this.stats.Add(new SignedStat(BaseStat.Get(StatType.Quantity), br.ReadInt32(9)));
                        }
                        if ((this.Flags & ItemFlags.Identified) == ItemFlags.Identified)
                        {
                            StatBase base2;
                            int num4 = (this.Quality == ItemQuality.Set) ? br.ReadByte(5) : -1;
                            this.mods = new List<StatBase>();
                            while ((base2 = ReadStat(br)) != null)
                            {
                                this.mods.Add(base2);
                            }
                            if ((this.flags & ItemFlags.Runeword) == ItemFlags.Runeword)
                            {
                                while ((base2 = ReadStat(br)) != null)
                                {
                                    this.mods.Add(base2);
                                }
                            }
                            if (num4 > 0)
                            {
                                this.setBonuses = new List<StatBase>[5];
                                for (int j = 0; j < 5; j++)
                                {
                                    if ((num4 & (((int) 1) << j)) != 0)
                                    {
                                        this.setBonuses[j] = new List<StatBase>();
                                        while ((base2 = ReadStat(br)) != null)
                                        {
                                            this.setBonuses[j].Add(base2);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }