Esempio n. 1
0
    public void RefreshDescription()
    {
        title.text           = selectedQuest.Model.Title;
        giver.text           = $"[委托人:{selectedQuest.originalQuestHolder.TalkerName}]";
        descriptionText.text = selectedQuest.Model.Description;
        StringBuilder objectives        = new StringBuilder();
        var           displayObjectives = selectedQuest.Objectives.Where(x => x.Model.Display).ToArray();
        int           lineCount         = displayObjectives.Length - 1;

        for (int i = 0; i < displayObjectives.Length; i++)
        {
            string endLine = i == lineCount ? string.Empty : "\n";
            if (selectedQuest.IsFinished)
            {
                objectives.AppendFormat("-{0}{1}", displayObjectives[i].Model.DisplayName, endLine);
            }
            else
            {
                objectives.AppendFormat("-{0}{1}{2}", displayObjectives[i], displayObjectives[i].IsComplete ? "\t(达成)" : string.Empty, endLine);
            }
        }
        objectiveText.text = objectives.ToString();
        rewardList.Refresh(ItemSlotData.Convert(selectedQuest.Model.RewardItems, maxRewardCount));

        ZetanUtility.SetActive(abandonButton.gameObject, !selectedQuest.IsFinished && selectedQuest.Model.Abandonable);
        ZetanUtility.SetActive(traceButton.gameObject, !selectedQuest.IsFinished);
        RefreshTraceText();
    }
    /// <summary>
    /// Updates the item data by data.LocationID
    /// </summary>
    /// <param name='type'>
    /// Type.
    /// </param>
    /// <param name='data'>
    /// Data with right locatioID
    /// </param>
    public void UpdateItemData(ItemSlotType type, ItemSlotData data)
    {
        List <ItemSlotData> tList = GetItemDataList(type);

        bool t_found = false;

        for (int i = 0; i < tList.Count; i++)
        {
            ItemSlotData item = tList[i];

            if (item.LocationID == data.LocationID)
            {
                tList[i] = data;
                t_found  = true;
                break;
            }
        }

        if (!t_found)
        {
            tList.Add(data);
        }

        PackageUnit.UpdatePackageList(type);
    }
Esempio n. 3
0
 public void TakeItem(ItemSlotData info, bool all = false)
 {
     if (!lootAgent || info == null || !info.item)
     {
         return;
     }
     WindowsManager.CloseWindow <ItemWindow>();
     if (!all)
     {
         if (info.amount == 1)
         {
             OnTake(info, 1);
         }
         else
         {
             AmountWindow.StartInput(delegate(long amount)
             {
                 OnTake(info, (int)amount);
             }, info.amount, "拾取数量", ZetanUtility.ScreenCenter, Vector2.zero);
         }
     }
     else
     {
         OnTake(info, info.amount);
     }
 }
Esempio n. 4
0
    private void OnTake(ItemSlotData item, int amount)
    {
        if (!lootAgent)
        {
            return;
        }
        if (!lootAgent.lootItems.Exists(x => x.source == item.item))
        {
            return;
        }
        int takeAmount = BackpackManager.Instance.Inventory.PeekGet(item.item, amount);

        if (BackpackManager.Instance.GetItem(item.item, takeAmount))
        {
            item.amount -= takeAmount;
        }
        if (item.amount < 1)
        {
            lootAgent.lootItems.RemoveAll(x => x.source == item.item);
        }
        if (lootAgent.lootItems.Count < 1)
        {
            lootAgent.Recycle();
            Close();
        }
        else
        {
            productList.Refresh(ItemSlotData.Convert(lootAgent.lootItems, slotCount));
        }
    }
    public void BuildInitTreasureMapDatas()
    {
        currentTreasureMapItemDatas.Clear();
        for (int i = 0; i < TREASURE_MAP_MAX_GRIDS; ++i)
        {
            ItemSlotData data = new ItemSlotData();
            data.LocationID = i;
            data.SlotState  = ItemSlotState.LOCK;
            data.SlotType   = ItemSlotType.JUNHUN_TREASURE_MAP;

            currentTreasureMapItemDatas.Add(data);
        }

        // Test code

        /*currentCanbeFoundJunhunDatas.Clear();
         * for (int i = 0; i < 10; ++i)
         * {
         *      ItemSlotData data = new ItemSlotData();
         *      data.LocationID = TREASURE_MAP_MAX_GRIDS + i;
         *      data.SlotState = ItemSlotState.LOCK;
         *      data.SlotType = ItemSlotType.JUNHUN_TREASURE_MAP;
         *
         *      currentCanbeFoundJunhunDatas.Add(data.LocationID, data);
         * }*/
    }
Esempio n. 6
0
    public void Initialize(ItemSlotData data, InventoryUi ui)
    {
        inventoryUi = ui;
//        uiItem = data.uiItem;
//        slotType = data.slotType;
//        physicalItemLocation = data.physicalItemLocation;
//        humanInventoryUi = data.inventoryUi;
    }
    /// <summary>
    /// Adds the item data.
    /// </summary>
    /// <param name='type'>
    /// Type.
    /// </param>
    /// <param name='data'>
    /// Data.
    /// </param>
    public void AddItemData(ItemSlotType type, ItemSlotData data)
    {
        List <ItemSlotData> tList = GetItemDataList(type);

        tList.Add(data);

        PackageUnit.UpdatePackageList(data.SlotType);
    }
Esempio n. 8
0
    /*    private bool IsInventoryNull()
     *  {
     *      for (int i = 0; i < inventory.ItemSlots.Count; i++)
     *      {
     *          if (inventory.ItemSlots[i].Item != null)
     *          {
     *              return false;
     *          }
     *      }
     *      return true;
     *  }
     *
     *  private bool IsEquippedPanelNull()
     *  {
     *      for (int i = 0; i < equippedItemsPanel.equippedItemSlots.Length; i++)
     *      {
     *          if (equippedItemsPanel.equippedItemSlots[i].Item != null)
     *          {
     *              return false;
     *          }
     *      }
     *      return true;
     *  }*/

    /*    private void InventoryLeftClick(BaseItemSlot itemSlot)
     *  {
     *      if (unit != null)
     *      {
     *          selectedItemSlot = itemSlot;
     *
     *          if (itemSlot.Item != null)
     *          {
     *              if (itemSlot.Item is EquippableItem)
     *              {
     *                  EquippableItem equippableItem = (EquippableItem)itemSlot.Item;
     *                  if (inventory.RemoveItem(itemSlot.Item) && equippedItemsPanel.AddItem(equippableItem))
     *                  {
     *                      unit.unitItems.Add(equippableItem);
     *                  }
     *                  else
     *                  {
     *                      Debug.Log("No more space in unit");
     *                      inventory.AddItem(equippableItem);
     *                  }
     *              }
     *              else
     *              {
     *                  // add consumable to the unit inventory (dont use)
     *              }
     *          }
     *      }
     *      // AfterRightClickEvent();
     *  }*/
    /*    private void EquippedItemsPanelLeftClick(BaseItemSlot itemSlot)
     *  {
     *      if (unit != null)
     *      {
     *          selectedItemSlot = itemSlot;
     *          if (itemSlot.Item != null)
     *          {
     *              EquippableItem equippableItem = (EquippableItem)itemSlot.Item;
     *              if (inventory.CanAddItem(itemSlot.Item) && equippedItemsPanel.RemoveItem(equippableItem))
     *              {
     *                  // equippedItemsPanel.RemoveItem(equippableItem);
     *                  inventory.AddItem(equippableItem);
     *                  equippedItemsPanel.RemoveItem(equippableItem);
     *                  unit.unitItems.Remove(equippableItem);
     *              }
     *              else
     *              {
     *                  equippedItemsPanel.AddItem(equippableItem);
     *              }
     *          }
     *      }
     *  }
     *
     *  // item in inventory can be some other type, not nec equippable so need to check if its equippable only then will equip
     *  private void InventoryRightClick(BaseItemSlot itemSlot)
     *  {
     *      selectedItemSlot = itemSlot;
     *      // Debug.Log(itemSlot.Item);
     *      // AfterInventoryRightClickEvent();
     *      if (itemSlot.Item != null)
     *      {
     *          if (itemSlot.Item is EquippableItem)
     *          {
     *              Equip((EquippableItem)itemSlot.Item);
     *          }
     *          else if (itemSlot.Item is UsableItem)
     *          {
     *              UsableItem usableItem = (UsableItem)itemSlot.Item;
     *              usableItem.Use(this);
     *
     *              if (usableItem.IsConsumable)
     *              {
     *                  itemSlot.Amount--;
     *                  // inventory.RemoveItem(usableItem);
     *                  usableItem.Destroy();
     *              }
     *          }
     *      }
     *      AfterRightClickEvent();
     *  }*/

    /*   private void EquippedItemPanelRightClick(BaseItemSlot itemSlot)
     * {
     *     selectedItemSlot = itemSlot;
     *     if (itemSlot.Item != null)
     *     {
     *         if (itemSlot.Item is EquippableItem)
     *         {
     *             Unequip((EquippableItem)itemSlot.Item);
     *         }
     *     }
     *     AfterRightClickEvent();
     * }*/


    #endregion


    private void PersonalInventoryLeftClick(BaseItemSlot itemSlot)
    {
        selectedItemSlot = itemSlot;
        ItemSlotData previousItemSlotData = unit.unitInventory.Find(x =>
        {
            if (x.Item is EquippableItem)
            {
                return(((EquippableItem)x.Item).equipped);
            }

            return(false);
        });

        if (unit == null || itemSlot.Item == null)
        {
            return;
        }

        if (itemSlot.Item is EquippableItem)
        {
            EquippableItem currItem = (EquippableItem)itemSlot.Item;
            if (previousItemSlotData != null)
            {
                EquippableItem prevItem = (EquippableItem)previousItemSlotData.Item;
                Unequip(prevItem);
                previousItem = prevItem;
                foreach (ItemSlot _itemSlot in unitPersonalInventory.ItemSlots)
                {
                    if (_itemSlot.Item == previousItem)
                    {
                        _itemSlot.itemName.color = Color.white;
                    }
                }
            }
            if (!currItem.equipped && (previousItem == null || previousItem != currItem))
            {
                Equip(currItem);
                itemSlot.itemName.color = itemSlot.equippedColor;
            }
            else
            {
                Unequip(currItem);
                itemSlot.itemName.color = Color.white;
            }
            unit.UpdateUI();
            unit.AssignInventory(unitPersonalInventory.GetOccupiedItemSlots());
        }
        else if (itemSlot.Item is UsableItem)
        {
            currUsableItemSlot = itemSlot;
            usableItemConfirmationPanel.SetActive(true);
            usableItemConfirmationPanel.GetComponent <RectTransform>().position = Input.mousePosition;
        }

        previousItem = null;
    }
 public void UpdateTreasureMapData(ItemSlotData data)
 {
     for (int i = 0; i < currentTreasureMapItemDatas.Count; i++)
     {
         if (currentTreasureMapItemDatas[i].LocationID == data.LocationID)
         {
             currentTreasureMapItemDatas[i] = data;
         }
     }
 }
 // 전투 아이템 인벤토리 추가
 public void AddBattleInventory(ItemSlotData itemSlotData)
 {
     if (battleInventory.Count < 12)
     {
         battleInventory.Add(itemSlotData);
     }
     else
     {
         Debug.LogWarning("아이템 초과해서 추가할수없습니다.");
     }
 }
Esempio n. 11
0
    bool IsHaveThisEquip(ItemSlotData data)
    {
        PlayerData playerData = Globals.Instance.MGameDataManager.MActorData;
        int        type       = data.MItemData.BasicData.JuniorType;

        if (!playerData.ClothDatas.ContainsKey(type))
        {
            return(false);
        }
        return(playerData.ClothDatas[type].MItemData.BasicData.LogicID == data.MItemData.BasicData.LogicID);
    }
Esempio n. 12
0
 void SetItemCount(ItemSlotData data)
 {
     if (data.MItemData.BasicData.Count > 1)
     {
         Count.transform.localScale = Vector3.one;
         Count.Text = data.MItemData.BasicData.Count.ToString();
     }
     else
     {
         Count.transform.localScale = Vector3.zero;
     }
 }
    public void BuildUnkndownTreasureMapDatas()
    {
        currentTreasureMapItemDatas.Clear();
        for (int i = 0; i < TREASURE_MAP_MAX_GRIDS; ++i)
        {
            ItemSlotData data = new ItemSlotData();
            data.LocationID = i;
            data.SlotState  = ItemSlotState.LOCK;            // Lock is mean a unknown slot in treasure map
            data.SlotType   = ItemSlotType.JUNHUN_TREASURE_MAP;

            currentTreasureMapItemDatas.Add(data);
        }
    }
Esempio n. 14
0
        private void InstantiateItemUi(ItemSlotData slotData)
        {
            _itemUi                    = Instantiate(ItemUiPrefab, transform).GetComponent <ItemUi>();
            _itemUi.ItemData           = _slotData.OccupantItemData;
            _itemUi.AttachedItemSlotUi = this;

            GameManager.ItemDictionary.TryGetValue(SlotData.OccupantItemData.ItemId, out var itemObject);
            if (itemObject == null)
            {
                return;
            }
            ItemReference         = itemObject.GetComponent <Item>();
            _itemUi.ItemReference = ItemReference;
        }
Esempio n. 15
0
 public void Swap(ItemSlotData slot)
 {
     if (!slot)
     {
         return;
     }
     (item, slot.item) = (slot.item, item);
     amount           += slot.amount;
     slot.amount       = amount - slot.amount;
     amount           -= slot.amount;
     OnSlotStateChanged?.Invoke(this);
     slot.OnSlotStateChanged?.Invoke(slot);
     OnSlotSwap?.Invoke(this, slot);
 }
Esempio n. 16
0
 protected override void OnAwake()
 {
     makeButton.onClick.AddListener(MakeCurrent);
     DIYButton.onClick.AddListener(DIY);
     pageSelector.onValueChanged.AddListener(SetPage);
     icon.SetCallbacks((i) =>
     {
         return(new ButtonWithTextData[] { new ButtonWithTextData("制作", MakeCurrent) });
     });
     slot = new ItemSlotData();
     icon.Refresh(slot);
     list.SetItemModifier(ia => ia.SetWindow(this));
     inventorySelector.onValueChanged.AddListener(SelectInventory);
 }
Esempio n. 17
0
 public void ShowQuestDescription(QuestData quest)
 {
     if (quest == null)
     {
         return;
     }
     currentQuest         = quest;
     descriptionText.text = new StringBuilder().AppendFormat("<b>{0}</b>\n[委托人: {1}]\n{2}",
                                                             currentQuest.Model.Title,
                                                             currentQuest.originalQuestHolder.TalkerName,
                                                             currentQuest.Model.Description).ToString();
     rewardList.Refresh(ItemSlotData.Convert(currentQuest.Model.RewardItems, 10));
     descriptionWindow.alpha          = 1;
     descriptionWindow.blocksRaycasts = true;
 }
Esempio n. 18
0
 public Inventory(uint ID)
 {
     UID               = ID;
     ItemCardEquip     = new CardEquipCollection((int)UID);
     ItemCharacter     = new CharacterCollection((int)UID);
     ItemMascot        = new MascotCollection((int)UID);
     ItemWarehouse     = new WarehouseCollection((int)UID);
     ItemCaddie        = new CaddieCollection((int)UID);
     ItemCard          = new CardCollection((int)UID);
     ItemTransaction   = new TransactionsCollection();
     ItemRoom          = new FurnitureCollection((int)UID);
     ItemSlot          = new ItemSlotData();
     ItemDecoration    = new ItemDecorationData();
     ItemTrophies      = new TrophyCollection();
     ItemTrophySpecial = new TrophySpecialCollection();
 }
Esempio n. 19
0
        public PlayerInventory(UInt32 TUID)
        {
            UID               = TUID;
            ItemCardEquip     = new CardEquipCollection((int)UID);
            ItemCharacter     = new CharacterCollection((int)UID);
            ItemMascot        = new MascotCollection((int)UID);
            ItemWarehouse     = new WarehouseCollection((int)UID);
            ItemCaddie        = new CaddieCollection((int)UID);
            ItemCard          = new CardCollection((int)UID);
            ItemTransaction   = new TransactionsCollection();
            ItemRoom          = new FurnitureCollection((int)UID);
            ItemSlot          = new ItemSlotData();
            ItemDecoration    = new ItemDecorationData();
            ItemTrophies      = new TrophyCollection();
            ItemTrophyGP      = new TrophyGPCollection();
            ItemTrophySpecial = new TrophySpecialCollection();
            ItemSlotData Items;
            var          _db = new PangyaEntities();

            foreach (var info in _db.ProcGetToolbar((int)UID))
            {
                Items = new ItemSlotData
                {
                    Slot1  = (uint)info.ITEM_SLOT_1,
                    Slot2  = (uint)info.ITEM_SLOT_2,
                    Slot3  = (uint)info.ITEM_SLOT_3,
                    Slot4  = (uint)info.ITEM_SLOT_4,
                    Slot5  = (uint)info.ITEM_SLOT_5,
                    Slot6  = (uint)info.ITEM_SLOT_6,
                    Slot7  = (uint)info.ITEM_SLOT_7,
                    Slot8  = (uint)info.ITEM_SLOT_8,
                    Slot9  = (uint)info.ITEM_SLOT_9,
                    Slot10 = (uint)info.ITEM_SLOT_10,
                };

                ItemSlot.SetItemSlot(Items);
                SetTitleIndex((uint)info.Skin_1);
                SetCharIndex((uint)info.CHARACTER_ID);
                SetCaddieIndex((uint)info.CADDIE);
                SetBallTypeID((uint)info.BALL_ID);
                SetClubSetIndex((uint)info.CLUB_ID);
                SetMascotIndex((uint)info.MASCOT_ID);
                SetPoster((uint)info.POSTER_1, (uint)info.POSTER_2);
            }

            ItemCharacter.Card = ItemCardEquip;
        }
Esempio n. 20
0
    public void AddItem(Item item, int amount)
    {
        bool checkList(ItemSlotData slot)
        {
            return(slot.item == item);
        }

        if (!inventoryList.Exists(checkList))
        {
            ItemSlotData itemSlotData = new ItemSlotData(item, amount);
            inventoryList.Add(itemSlotData);
        }
        else
        {
            inventoryList.Find(checkList).amount += amount;
        }
    }
Esempio n. 21
0
    public void LoadPropInfo(int taskId)
    {
        TaskConfig.TaskObject element = null;
        bool hasData = taskConfig.GetTaskObject(taskId, out element);

        if (!hasData)
        {
            return;
        }
        PlayerData playerData = Globals.Instance.MGameDataManager.MActorData;
        Dictionary <int, ItemSlotData> clothDic = playerData.ClothDatas;

        if (element.Progress_Count > 0)
        {
            List <int> themeLst = StrParser.ParseDecIntList(element.Theme_Effect, 0);
            List <int> limitLst = StrParser.ParseDecIntList(element.Material_Effect, 0);            //可使用的衣服类型
            foreach (KeyValuePair <int, PropItem> v in MPropItemDic)
            {
                if (limitLst.Contains(v.Key))
                {
                    if (clothDic.ContainsKey(v.Key))
                    {
                        ItemSlotData slotData = clothDic [v.Key];
                        if (slotData.MItemData != null && themeLst.Contains(slotData.MItemData.BasicData.ItemConfigElement.Item_Style))
                        {
                            MPropItemDic [v.Key].InitUse(slotData);
                        }
                        else
                        {
                            MPropItemDic [v.Key].InitNoLock(slotData);
                        }
                    }
                    else
                    {
                        MPropItemDic [v.Key].InitNoUse();
                    }
                }
                else
                {
                    MPropItemDic [v.Key].NoOpenProp();
                }
            }
        }
    }
Esempio n. 22
0
    public GeneralData()
    {
        for (int i = (int)GeneralEquipLocation.WEAPON; i < (int)GeneralEquipLocation.MAX; i++)
        {
            ItemSlotData data = new ItemSlotData();

            data.LocationID = i;
            data.SlotType   = ItemSlotType.GENERAL_EQUIPMENT;
            EquipmentDatas[data.LocationID] = data;
        }

        for (int i = 0; i < JUNHUN_SLOT_COUNT; i++)
        {
            ItemSlotData data = new ItemSlotData();

            data.LocationID = i;
            data.SlotType   = ItemSlotType.JUNHUN_EQUIPMENT;
            JunHunDatas[data.LocationID] = data;
        }
    }
Esempio n. 23
0
    //这个部位的衣服 相性不匹配
    public void InitNoLock(ItemSlotData slotData)
    {
        NoPropBg.SetActive(false);
        PropBg.SetActive(true);
        PropLock.SetActive(true);
        MagicObj.SetActive(false);
        UseObj.SetActive(false);

        PropStatus = 1;

        MSlotData = slotData;

        PropIcon.mainTexture = Resources.Load("Icon/ItemIcon/" + slotData.MItemData.BasicData.Icon, typeof(Texture2D)) as Texture2D;

        if (gPropInfo.GetPropInfoElementList().ContainsKey(MSlotData.MItemData.BasicData.ItemConfigElement.Item_Theme))
        {
            MPropInfo = gPropInfo.GetPropInfoElementList()[MSlotData.MItemData.BasicData.ItemConfigElement.Item_Theme];
        }

        UseMaxNum = 1;
    }
Esempio n. 24
0
    public void SetItemData(ItemSlotData data)
    {
        ItemBGBtn.Data = data;

        setIconQiangHuaVisible(false);

        if (data.IsUnLock())
        {
            if (null == data.MItemData)
            {
                if (data.SlotType == ItemSlotType.SHIP_EQUIPMENT)
                {
                    Icon.PlayAnim(IconShipEquipNulls[data.LocationID]);
                    Plus.transform.localScale = Vector3.one;
                }
                else if (data.SlotType == ItemSlotType.CLOTH_BAG)
                {
                    Icon.PlayAnim(IconNullNormal);
                    Plus.transform.localScale = Vector3.zero;
                }
                else
                {
                    Plus.transform.localScale = Vector3.zero;
                }

                Count.transform.localScale = Vector3.zero;
            }
            else
            {
                Plus.transform.localScale = Vector3.zero;

                Icon.PlayAnim(data.MItemData.BasicData.Icon);
                SetItemCount(data);
            }
        }
        else
        {
            Icon.PlayAnim(IconLock);
        }
    }
Esempio n. 25
0
    protected override bool OnOpen(params object[] args)
    {
        if (IsOpen)
        {
            MessageManager.Instance.New("请先拾取完上一个物品");
            return(false);
        }
        if (GatherManager.Instance.IsGathering)
        {
            MessageManager.Instance.New("请先等待采集完成");
            return(false);
        }
        LootAgent lootAgent = openBy as LootAgent;

        if (!lootAgent)
        {
            return(false);
        }
        this.lootAgent = lootAgent;
        productList.Refresh(ItemSlotData.Convert(this.lootAgent.lootItems, slotCount));
        return(base.OnOpen(args));
    }
Esempio n. 26
0
 public void TakeAll()
 {
     if (!lootAgent)
     {
         return;
     }
     foreach (var item in lootAgent.lootItems)
     {
         int takeAmount = BackpackManager.Instance.Inventory.PeekGet(item.source, item.amount);
         if (BackpackManager.Instance.GetItem(item.source, takeAmount))
         {
             item.amount -= takeAmount;
         }
         productList.Refresh(ItemSlotData.Convert(lootAgent.lootItems, slotCount));
     }
     lootAgent.lootItems.RemoveAll(x => x.amount < 1);
     if (lootAgent.lootItems.Count < 1)
     {
         lootAgent.Recycle();
         Close();
     }
 }
Esempio n. 27
0
 public void ShowPropInfo(ItemSlotData slotData, int isUse)
 {
     if (gPropInfo == null)
     {
         gPropInfo = Globals.Instance.MDataTableManager.GetConfig <GPropInfo> ();
     }
     if (gPropInfo.GetPropInfoElementList().ContainsKey(slotData.MItemData.BasicData.ItemConfigElement.Item_Theme))
     {
         GPropInfo.PropInfoElement info = gPropInfo.GetPropInfoElementList() [slotData.MItemData.BasicData.ItemConfigElement.Item_Theme];
         PropIcon.mainTexture = Resources.Load("Icon/ItemIcon/" + slotData.MItemData.BasicData.Icon, typeof(Texture2D)) as Texture2D;
         PropName.text        = slotData.MItemData.BasicData.Name;
         UseMagicNum.text     = info.MagicPoint.ToString();
         PropDec.text         = Globals.Instance.MDataTableManager.GetWordText(info.PropDesc);
         if (isUse == 0)
         {
             UseStatus.text = Globals.Instance.MDataTableManager.GetWordText("6022");
         }
         else if (isUse == 1)
         {
             UseStatus.text = Globals.Instance.MDataTableManager.GetWordText("6023");
         }
         else if (isUse == 2)
         {
             UseStatus.text = Globals.Instance.MDataTableManager.GetWordText("6011");
         }
         else if (isUse == 3)
         {
             UseStatus.text = Globals.Instance.MDataTableManager.GetWordText("6024");
         }
         this.gameObject.SetActive(true);
     }
     else
     {
         this.gameObject.SetActive(false);
     }
 }
Esempio n. 28
0
 int MySort(ItemSlotData ItemSlotData0, ItemSlotData ItemSlotDat1)
 {
     if (ItemSlotData0.MItemData == null || ItemSlotDat1.MItemData == null)
     {
         return(0);
     }
     if (ItemSlotData0.MItemData.BasicData.SuitSex != ItemSlotDat1.MItemData.BasicData.SuitSex)               //性别排序//
     {
         return(ItemSlotData0.MItemData.BasicData.SuitSex > ItemSlotDat1.MItemData.BasicData.SuitSex ? 1 : -1);
     }
     else
     {
         if (ItemSlotData0.MItemData.BasicData.LogicID != ItemSlotDat1.MItemData.BasicData.LogicID)                   //LogicID排序//
         {
             return(ItemSlotData0.MItemData.BasicData.LogicID > ItemSlotDat1.MItemData.BasicData.LogicID? -1 :1);
         }
         else
         {
             return(ItemSlotData0.MItemData.BasicData.Count > ItemSlotDat1.MItemData.BasicData.Count? 1 :                         //数量排序//
                    (ItemSlotData0.MItemData.BasicData.Count == ItemSlotDat1.MItemData.BasicData.Count ? 0 : -1));
         }
     }
     return(0);
 }
Esempio n. 29
0
    public void UpdateFromServerData(sg.Role_General source)
    {
        this.GeneralID     = source.generalListId;
        this.ArmySoulPoint = source.armySoulPoint;
        if (null != source.roleGeneralBase)
        {
            BasicData.LogicID    = source.roleGeneralBase.generalId;
            BasicData.Name       = source.roleGeneralBase.admiralName;
            BasicData.Avatar     = source.roleGeneralBase.admiralAvatar;
            BasicData.IsAdmiral  = source.roleGeneralBase.isAdmiral;
            BasicData.Profession = (EGeneralProfession)source.roleGeneralBase.profession;

            BasicData.FillDataFromConfig();
        }

        if (null != source.roleGeneralDegree)
        {
            BasicData.Level        = source.roleGeneralDegree.generalDegree;
            BasicData.CurrentExp   = source.roleGeneralDegree.generalExp;
            BasicData.NextLevelExp = source.roleGeneralDegree.nextLevelExp;
        }

        if (null != source.roleGeneralProperty)
        {
            if (null == PropertyData)
            {
                PropertyData = new GeneralPropertyData();
            }

            PropertyData.Life    = source.roleGeneralProperty.maxLife;
            PropertyData.MaxLife = source.roleGeneralProperty.maxLife;
            PropertyData.Defense = source.roleGeneralProperty.warShipDefense;

            PropertyData.Valiant      = source.roleGeneralProperty.generalChivalrous;
            PropertyData.Command      = source.roleGeneralProperty.generalCommand;
            PropertyData.Intelligence = source.roleGeneralProperty.generalIntelligence;

            PropertyData.MinSeaAttack       = source.roleGeneralProperty.minSeaAttack;
            PropertyData.MaxSeaAttack       = source.roleGeneralProperty.maxSeaAttack;
            PropertyData.MinSubmarineAttack = source.roleGeneralProperty.minSubmarineAttack;
            PropertyData.MaxSubmarineAttack = source.roleGeneralProperty.maxSubmarineAttack;
            PropertyData.SkillAttack        = source.roleGeneralProperty.skillAddition;

            PropertyData.SeaAttack       = (int)(0.5f * (PropertyData.MinSeaAttack + PropertyData.MaxSeaAttack));
            PropertyData.SubmarineAttack = (int)(0.5f * (PropertyData.MinSubmarineAttack + PropertyData.MaxSubmarineAttack));

            // PropertyData.HitRate = source.roleGeneralProperty.hitRate;
            // PropertyData.CritRate = source.roleGeneralProperty.critRate;
            // PropertyData.DodgeRate = source.roleGeneralProperty.dodgeRate;
            PropertyData.Range = source.roleGeneralProperty.range;

            PropertyData.Power           = source.roleGeneralProperty.powerInitial;
            PropertyData.PowerTimeUp     = source.roleGeneralProperty.powerTimeUp;
            PropertyData.PowerAttackUp   = source.roleGeneralProperty.powerAttackUp;
            PropertyData.PowerAttackedUp = source.roleGeneralProperty.powerAttackedUp;

            BasicData.QualityStar = PropertyData.CalculateQualityStar();
        }

        if (null != source.roleGeneralCulture)
        {
            // Train
            if (null == TrainData)
            {
                TrainData = new GeneralTrainData();
            }

            TrainData.TrainCount          = source.roleGeneralCulture.cultureNum;
            TrainData.BaseChivalrousMod   = source.roleGeneralCulture.baseChivalrousMod;
            TrainData.BaseCommandMod      = source.roleGeneralCulture.baseCommandMod;
            TrainData.BaseIntelligenceMod = source.roleGeneralCulture.baseIntelligenceMod;
            TrainData.TempChivalrousMod   = source.roleGeneralCulture.tempChivalrousMod;
            TrainData.TempCommandMod      = source.roleGeneralCulture.tempCommandMod;
            TrainData.TempIntelligenceMod = source.roleGeneralCulture.tempIntelligenceMod;
        }

        if (null != source.roleGeneralPharmacy)
        {
            if (null == PotionData)
            {
                PotionData = new GeneralPotionData();
            }

            PotionData.PotionYongWuLevel[0] = source.roleGeneralPharmacy.pharmacyChivalrous1Num;
            PotionData.PotionYongWuLevel[1] = source.roleGeneralPharmacy.pharmacyChivalrous2Num;
            PotionData.PotionYongWuLevel[2] = source.roleGeneralPharmacy.pharmacyChivalrous3Num;
            PotionData.PotionYongWuLevel[3] = source.roleGeneralPharmacy.pharmacyChivalrous4Num;
            PotionData.PotionYongWuLevel[4] = source.roleGeneralPharmacy.pharmacyChivalrous5Num;
            PotionData.PotionYongWuLevel[5] = source.roleGeneralPharmacy.pharmacyChivalrous6Num;

            PotionData.PotionTongShuaiLevel[0] = source.roleGeneralPharmacy.pharmacyCommand1Num;
            PotionData.PotionTongShuaiLevel[1] = source.roleGeneralPharmacy.pharmacyCommand2Num;
            PotionData.PotionTongShuaiLevel[2] = source.roleGeneralPharmacy.pharmacyCommand3Num;
            PotionData.PotionTongShuaiLevel[3] = source.roleGeneralPharmacy.pharmacyCommand4Num;
            PotionData.PotionTongShuaiLevel[4] = source.roleGeneralPharmacy.pharmacyCommand5Num;
            PotionData.PotionTongShuaiLevel[5] = source.roleGeneralPharmacy.pharmacyCommand6Num;

            PotionData.PotionZhiLiLevel[0] = source.roleGeneralPharmacy.pharmacyIntelligence1Num;
            PotionData.PotionZhiLiLevel[1] = source.roleGeneralPharmacy.pharmacyIntelligence2Num;
            PotionData.PotionZhiLiLevel[2] = source.roleGeneralPharmacy.pharmacyIntelligence3Num;
            PotionData.PotionZhiLiLevel[3] = source.roleGeneralPharmacy.pharmacyIntelligence4Num;
            PotionData.PotionZhiLiLevel[4] = source.roleGeneralPharmacy.pharmacyIntelligence5Num;
            PotionData.PotionZhiLiLevel[5] = source.roleGeneralPharmacy.pharmacyIntelligence6Num;
        }

        if (null != source.roleGeneralSkill)
        {
            SkillDatas.Clear();
            foreach (int id in source.roleGeneralSkill.skillIds)
            {
                SkillData data = new SkillData(id);
                data.FillDataFromConfig();

                SkillDatas[id] = data;
            }
        }

        foreach (sg.Item_Pack info in source.roleGeneralEquipmentList)
        {
            ItemSlotData slotData = new ItemSlotData();
            slotData.UpdateFromServerData(info);
            this.EquipmentDatas[slotData.LocationID] = slotData;
        }

        foreach (sg.Item_Pack info in source.roleGeneralArmySoulList)
        {
            ItemSlotData slotData = new ItemSlotData();
            slotData.UpdateFromServerData(info);
            this.JunHunDatas[slotData.LocationID] = slotData;
        }
    }
Esempio n. 30
0
 public void UpdateJunHunData(ItemSlotData data)
 {
     JunHunDatas[data.LocationID] = data;
 }