| | |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | using System.Linq;
|
| | |
|
| | | using System.Linq; |
| | | |
| | | namespace Snxxz.UI |
| | | {
|
| | | { |
| | | [XLua.LuaCallCSharp] |
| | | public class ItemTipUtility |
| | | { |
| | | public enum TipType
|
| | | {
|
| | | Item,
|
| | | Equip,
|
| | | Dogz,
|
| | | GatherSoul,
|
| | | KingTreasure,
|
| | | PetMount,
|
| | | SpiritWeapon,
|
| | | PeerlessChest,
|
| | | public enum TipType |
| | | { |
| | | Item, |
| | | Equip, |
| | | Dogz, |
| | | GatherSoul, |
| | | KingTreasure, |
| | | PetMount, |
| | | SpiritWeapon, |
| | | PeerlessChest, |
| | | } |
| | | |
| | | public class TipData |
| | |
| | | public List<Int2> starProperties; |
| | | } |
| | | |
| | | public struct SpiritWeaponProperty
|
| | | {
|
| | | public int itemId;
|
| | | public List<Int3> properties;
|
| | | public struct SpiritWeaponProperty |
| | | { |
| | | public int itemId; |
| | | public List<Int3> properties; |
| | | } |
| | | |
| | | public struct LegendProperty |
| | |
| | | public List<int> ways; |
| | | } |
| | | |
| | | public struct GatherSoulInfo
|
| | | {
|
| | | public PackType packType;
|
| | | public int index;
|
| | | public int level;
|
| | | public struct GatherSoulInfo |
| | | { |
| | | public PackType packType; |
| | | public int index; |
| | | public int level; |
| | | } |
| | | |
| | | public struct CustomEquipInfo
|
| | | {
|
| | | public int job;
|
| | | public int itemId;
|
| | | public int score;
|
| | | public bool isEquiped;
|
| | | public List<Int2> legendProperties;
|
| | | public List<int> suitPlaces;
|
| | | public Dictionary<int, int> placeStars;
|
| | | public Dictionary<EquipSuitType, int> suitLevels;
|
| | | public int strengthenLevel;
|
| | | public int starLevel;
|
| | | public List<Int2> trainProperties;
|
| | | public struct CustomEquipInfo |
| | | { |
| | | public int job; |
| | | public int itemId; |
| | | public int score; |
| | | public bool isEquiped; |
| | | public List<Int2> legendProperties; |
| | | public List<int> suitPlaces; |
| | | public Dictionary<int, int> placeStars; |
| | | public Dictionary<EquipSuitType, int> suitLevels; |
| | | public int strengthenLevel; |
| | | public int starLevel; |
| | | public List<Int2> trainProperties; |
| | | public Dictionary<int, bool> gemHoleActiveStates; |
| | | public Dictionary<int, int> gems;
|
| | | public Dictionary<int, int> gems; |
| | | } |
| | | |
| | | public struct CustomItemPlus
|
| | | {
|
| | | public int ItemID;
|
| | | public int count;
|
| | | public int Equipped;
|
| | | public int Preview;
|
| | | public int Star;
|
| | | public int PlusLV;
|
| | | public int EvolveLV;
|
| | | public string UserData;
|
| | | public int[] Stone;
|
| | | public CustomEquipWash Wash;
|
| | | public int[][] Equips;
|
| | | public int[] suitPlaces;
|
| | | public int[] suitLevels;
|
| | | public int[] placeStars;
|
| | | public struct CustomItemPlus |
| | | { |
| | | public int ItemID; |
| | | public int count; |
| | | public int Equipped; |
| | | public int Preview; |
| | | public int Star; |
| | | public int PlusLV; |
| | | public int EvolveLV; |
| | | public string UserData; |
| | | public int[] Stone; |
| | | public CustomEquipWash Wash; |
| | | public int[][] Equips; |
| | | public int[] suitPlaces; |
| | | public int[] suitLevels; |
| | | public int[] placeStars; |
| | | } |
| | | |
| | | public struct CustomEquipWash
|
| | | {
|
| | | public int LV;
|
| | | public int[] Value;
|
| | | public struct CustomEquipWash |
| | | { |
| | | public int LV; |
| | | public int[] Value; |
| | | } |
| | | |
| | | public struct ItemViewInfo
|
| | | {
|
| | | public int itemId;
|
| | | public bool compare;
|
| | | public bool unfoldGetWay;
|
| | | public bool isAuctionEquip;
|
| | | public LegendProperty legendProperty;
|
| | | public int score;
|
| | | public struct ItemViewInfo |
| | | { |
| | | public int itemId; |
| | | public bool compare; |
| | | public bool unfoldGetWay; |
| | | public bool isAuctionEquip; |
| | | public LegendProperty legendProperty; |
| | | public int score; |
| | | } |
| | | |
| | | static PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | |
| | | |
| | | public static void Show(int itemId) |
| | | { |
| | | if (!ItemConfig.Has(itemId))
|
| | | {
|
| | | Debug.LogErrorFormat("查无此物品:{0}", itemId);
|
| | | return;
|
| | | if (!ItemConfig.Has(itemId)) |
| | | { |
| | | Debug.LogErrorFormat("查无此物品:{0}", itemId); |
| | | return; |
| | | } |
| | | |
| | | Show(new ItemViewInfo()
|
| | | {
|
| | | itemId = itemId,
|
| | | });
|
| | | Show(new ItemViewInfo() |
| | | { |
| | | itemId = itemId, |
| | | }); |
| | | } |
| | | |
| | | public static void Show(ItemViewInfo item)
|
| | | {
|
| | | var itemId = item.itemId;
|
| | | if (!ItemConfig.Has(itemId))
|
| | | {
|
| | | Debug.LogErrorFormat("查无此物品:{0}", itemId);
|
| | | return;
|
| | | }
|
| | |
|
| | | public static void Show(ItemViewInfo item) |
| | | { |
| | | var itemId = item.itemId; |
| | | if (!ItemConfig.Has(itemId)) |
| | | { |
| | | Debug.LogErrorFormat("查无此物品:{0}", itemId); |
| | | return; |
| | | } |
| | | |
| | | secondaryData = null; |
| | |
|
| | | var config = ItemConfig.Get(itemId);
|
| | | PrintItemBrief(itemId);
|
| | |
|
| | | |
| | | var config = ItemConfig.Get(itemId); |
| | | PrintItemBrief(itemId); |
| | | |
| | | var tipType = GetTipType(itemId); |
| | | switch (tipType)
|
| | | {
|
| | | case TipType.Equip:
|
| | | mainTipData = CreateNormalEquipData(itemId);
|
| | | if (item.isAuctionEquip && !item.legendProperty.Equals(default(LegendProperty)))
|
| | | {
|
| | | mainTipData.legendProperty = item.legendProperty;
|
| | | mainTipData.baseInfo.score = item.score;
|
| | | mainTipData.baseInfo.isPreview = false;
|
| | | }
|
| | |
|
| | | if (item.compare)
|
| | | {
|
| | | if (ItemLogicUtility.Instance.IsJobCompatibleItem(itemId))
|
| | | {
|
| | | var equipedGuid = equipModel.GetEquip(new Int2(config.LV, config.EquipPlace));
|
| | | if (equipedGuid != string.Empty)
|
| | | {
|
| | | secondaryData = CreateNormalEquipData(equipedGuid, false);
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | case TipType.Dogz:
|
| | | mainTipData = CreateDogzEquipData(itemId);
|
| | | break;
|
| | | case TipType.PeerlessChest:
|
| | | mainTipData = CreateItemData(itemId);
|
| | | mainTipData.getWay = default(GetWay);
|
| | | Dictionary<int, int> selectItems;
|
| | | if (boxGetItemModel.IsSelectItemByID(itemId, out selectItems))
|
| | | {
|
| | | secondaryData = CreateNormalEquipData(selectItems.Keys.First());
|
| | | secondaryData.getWay = default(GetWay);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | mainTipData = CreateItemData(itemId);
|
| | | break;
|
| | | }
|
| | |
|
| | | mainTipData.getWay.defaultUnfold = item.unfoldGetWay;
|
| | | switch (tipType)
|
| | | {
|
| | | case TipType.Equip:
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | break;
|
| | | case TipType.Dogz:
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | break;
|
| | | case TipType.GatherSoul:
|
| | | ShowGatherSoul(itemId, 0);
|
| | | break;
|
| | | case TipType.KingTreasure:
|
| | | var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
|
| | | kingTreasureShow.SetInitData(itemId);
|
| | | break;
|
| | | case TipType.PetMount:
|
| | | WindowCenter.Instance.Open<PetMountTipWin>();
|
| | | break;
|
| | | case TipType.SpiritWeapon:
|
| | | WindowCenter.Instance.Open<SpiritWeaponTipWin>();
|
| | | break;
|
| | | case TipType.PeerlessChest:
|
| | | WindowCenter.Instance.Open<PeerlessChestTipWin>();
|
| | | break;
|
| | | default:
|
| | | WindowCenter.Instance.Open<ItemTipWin>();
|
| | | break;
|
| | | }
|
| | | switch (tipType) |
| | | { |
| | | case TipType.Equip: |
| | | mainTipData = CreateNormalEquipData(itemId); |
| | | if (item.isAuctionEquip && !item.legendProperty.Equals(default(LegendProperty))) |
| | | { |
| | | mainTipData.legendProperty = item.legendProperty; |
| | | mainTipData.baseInfo.score = item.score; |
| | | mainTipData.baseInfo.isPreview = false; |
| | | } |
| | | |
| | | if (item.compare) |
| | | { |
| | | if (ItemLogicUtility.Instance.IsJobCompatibleItem(itemId)) |
| | | { |
| | | var equipedGuid = equipModel.GetEquip(new Int2(config.LV, config.EquipPlace)); |
| | | if (equipedGuid != string.Empty) |
| | | { |
| | | secondaryData = CreateNormalEquipData(equipedGuid, false); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case TipType.Dogz: |
| | | mainTipData = CreateDogzEquipData(itemId); |
| | | break; |
| | | case TipType.PeerlessChest: |
| | | mainTipData = CreateItemData(itemId); |
| | | mainTipData.getWay = default(GetWay); |
| | | Dictionary<int, int> selectItems; |
| | | if (boxGetItemModel.IsSelectItemByID(itemId, out selectItems)) |
| | | { |
| | | secondaryData = CreateNormalEquipData(selectItems.Keys.First()); |
| | | secondaryData.getWay = default(GetWay); |
| | | } |
| | | break; |
| | | default: |
| | | mainTipData = CreateItemData(itemId); |
| | | break; |
| | | } |
| | | |
| | | mainTipData.getWay.defaultUnfold = item.unfoldGetWay; |
| | | switch (tipType) |
| | | { |
| | | case TipType.Equip: |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | break; |
| | | case TipType.Dogz: |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | break; |
| | | case TipType.GatherSoul: |
| | | ShowGatherSoul(itemId, 0); |
| | | break; |
| | | case TipType.KingTreasure: |
| | | var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>(); |
| | | kingTreasureShow.SetInitData(itemId); |
| | | break; |
| | | case TipType.PetMount: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case TipType.SpiritWeapon: |
| | | WindowCenter.Instance.Open<SpiritWeaponTipWin>(); |
| | | break; |
| | | case TipType.PeerlessChest: |
| | | WindowCenter.Instance.Open<PeerlessChestTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | public static void Show(string guid, bool operatable = true) |
| | |
| | | if (item == null) |
| | | { |
| | | return; |
| | | }
|
| | | PrintItemBrief(item.itemId, guid);
|
| | |
|
| | | secondaryData = null;
|
| | | var tipType = GetTipType(item.itemId);
|
| | | switch (tipType)
|
| | | {
|
| | | case TipType.Equip:
|
| | | var packType = item.packType;
|
| | | switch (packType)
|
| | | {
|
| | | case PackType.Equip:
|
| | | mainTipData = CreateNormalEquipData(guid, operatable);
|
| | | break;
|
| | | default:
|
| | | if (item.isAuction)
|
| | | {
|
| | | mainTipData = CreateEquipAuctionData(guid, operatable);
|
| | |
|
| | | if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId))
|
| | | {
|
| | | var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
|
| | | if (equipedGuid != string.Empty)
|
| | | {
|
| | | secondaryData = CreateNormalEquipData(equipedGuid, false);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | mainTipData = CreateNormalEquipData(guid, operatable);
|
| | | var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
|
| | | if (equipedGuid != guid)
|
| | | {
|
| | | secondaryData = CreateNormalEquipData(equipedGuid, false);
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | break;
|
| | | case TipType.Dogz:
|
| | | mainTipData = CreateDogzEquipData(guid);
|
| | | break;
|
| | | default:
|
| | | mainTipData = CreateItemData(guid, operatable);
|
| | | break;
|
| | | }
|
| | |
|
| | | switch (tipType)
|
| | | {
|
| | | case TipType.Equip:
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | break;
|
| | | case TipType.Dogz:
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | break;
|
| | | case TipType.GatherSoul:
|
| | | ShowGatherSoul(item.itemId, 0);
|
| | | break;
|
| | | case TipType.KingTreasure:
|
| | | var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
|
| | | kingTreasureShow.SetInitData(item.itemId);
|
| | | break;
|
| | | case TipType.PetMount:
|
| | | WindowCenter.Instance.Open<PetMountTipWin>();
|
| | | break;
|
| | | case TipType.SpiritWeapon:
|
| | | WindowCenter.Instance.Open<SpiritWeaponTipWin>();
|
| | | break;
|
| | | default:
|
| | | WindowCenter.Instance.Open<ItemTipWin>();
|
| | | break;
|
| | | }
|
| | |
|
| | | } |
| | | PrintItemBrief(item.itemId, guid); |
| | | |
| | | secondaryData = null; |
| | | var tipType = GetTipType(item.itemId); |
| | | switch (tipType) |
| | | { |
| | | case TipType.Equip: |
| | | var packType = item.packType; |
| | | switch (packType) |
| | | { |
| | | case PackType.Equip: |
| | | mainTipData = CreateNormalEquipData(guid, operatable); |
| | | break; |
| | | default: |
| | | if (item.isAuction) |
| | | { |
| | | mainTipData = CreateEquipAuctionData(guid, operatable); |
| | | |
| | | if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId)) |
| | | { |
| | | var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace)); |
| | | if (equipedGuid != string.Empty) |
| | | { |
| | | secondaryData = CreateNormalEquipData(equipedGuid, false); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | mainTipData = CreateNormalEquipData(guid, operatable); |
| | | var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace)); |
| | | if (equipedGuid != guid) |
| | | { |
| | | secondaryData = CreateNormalEquipData(equipedGuid, false); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | break; |
| | | case TipType.Dogz: |
| | | mainTipData = CreateDogzEquipData(guid); |
| | | break; |
| | | default: |
| | | mainTipData = CreateItemData(guid, operatable); |
| | | break; |
| | | } |
| | | |
| | | switch (tipType) |
| | | { |
| | | case TipType.Equip: |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | break; |
| | | case TipType.Dogz: |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | break; |
| | | case TipType.GatherSoul: |
| | | ShowGatherSoul(item.itemId, 0); |
| | | break; |
| | | case TipType.KingTreasure: |
| | | var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>(); |
| | | kingTreasureShow.SetInitData(item.itemId); |
| | | break; |
| | | case TipType.PetMount: |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case TipType.SpiritWeapon: |
| | | WindowCenter.Instance.Open<SpiritWeaponTipWin>(); |
| | | break; |
| | | default: |
| | | WindowCenter.Instance.Open<ItemTipWin>(); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void ShowGood(int goodId, int itemId) |
| | |
| | | WindowCenter.Instance.Open<PetMountTipWin>(); |
| | | break; |
| | | case 113: |
| | | case 114:
|
| | | case 116:
|
| | | case 114: |
| | | case 116: |
| | | case 117: |
| | | WindowCenter.Instance.Open<SpiritWeaponTipWin>(); |
| | | break; |
| | |
| | | break; |
| | | } |
| | | } |
| | | }
|
| | |
|
| | | public static void ShowCustomEquip(CustomEquipInfo info)
|
| | | {
|
| | | secondaryData = null;
|
| | | mainTipData = CreateCustomEquipData(info);
|
| | | WindowCenter.Instance.Open<EquipTipWin>();
|
| | | }
|
| | |
|
| | | public static void ShowGatherSoul(PackType packType, int index)
|
| | | {
|
| | | if (packType == PackType.GatherSoul || packType == PackType.InterimPack)
|
| | | {
|
| | | mainTipData = CreateGatherSoulData(packType, index);
|
| | | }
|
| | | WindowCenter.Instance.Open<GatherSoulTipWin>();
|
| | | } |
| | | |
| | | public static void ShowGatherSoul(int itemId, int level)
|
| | | {
|
| | | mainTipData = new TipData()
|
| | | {
|
| | | itemId = itemId,
|
| | | gatherSoul = new GatherSoulInfo()
|
| | | {
|
| | | index = -1,
|
| | | level = level,
|
| | | packType = PackType.Deleted,
|
| | | },
|
| | | };
|
| | | WindowCenter.Instance.Open<GatherSoulTipWin>();
|
| | | public static void ShowCustomEquip(CustomEquipInfo info) |
| | | { |
| | | secondaryData = null; |
| | | mainTipData = CreateCustomEquipData(info); |
| | | WindowCenter.Instance.Open<EquipTipWin>(); |
| | | } |
| | | |
| | | public static void ShowGatherSoul(PackType packType, int index) |
| | | { |
| | | if (packType == PackType.GatherSoul || packType == PackType.InterimPack) |
| | | { |
| | | mainTipData = CreateGatherSoulData(packType, index); |
| | | } |
| | | WindowCenter.Instance.Open<GatherSoulTipWin>(); |
| | | } |
| | | |
| | | public static void ShowGatherSoul(int itemId, int level) |
| | | { |
| | | mainTipData = new TipData() |
| | | { |
| | | itemId = itemId, |
| | | gatherSoul = new GatherSoulInfo() |
| | | { |
| | | index = -1, |
| | | level = level, |
| | | packType = PackType.Deleted, |
| | | }, |
| | | }; |
| | | WindowCenter.Instance.Open<GatherSoulTipWin>(); |
| | | } |
| | | |
| | | static TipData CreateNormalEquipData(string guid, bool operatable) |
| | |
| | | guid = guid, |
| | | |
| | | baseInfo = GetBaseInfo(guid), |
| | | baseProperty = GetBaseProperty(guid),
|
| | | baseProperty = GetBaseProperty(guid), |
| | | spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId), |
| | | legendProperty = GetLegendProperty(guid), |
| | | skillInfo = GetSkillInfo(item.itemId), |
| | |
| | | }; |
| | | } |
| | | |
| | | static TipData CreateNormalEquipData(int itemId)
|
| | | static TipData CreateNormalEquipData(int itemId) |
| | | { |
| | | return new TipData() |
| | | { |
| | |
| | | |
| | | baseInfo = GetBaseInfo(itemId), |
| | | baseProperty = GetBaseProperty(itemId), |
| | | legendProperty = GetLegendProperty(itemId),
|
| | | legendProperty = GetLegendProperty(itemId), |
| | | spiritWeaponProperty = GetSpiritWeaponProperty(itemId), |
| | | skillInfo = GetSkillInfo(itemId), |
| | | suitInfo = GetSuitInfo(itemId), |
| | |
| | | starInfo = GetStarInfo(itemId), |
| | | getWay = GetGetWay(itemId) |
| | | }; |
| | | }
|
| | |
|
| | | } |
| | | |
| | | static TipData CreateDogzEquipData(string guid) |
| | | { |
| | | var item = packModel.GetItemByGuid(guid); |
| | |
| | | }; |
| | | } |
| | | |
| | | static TipData CreateCustomEquipData(CustomEquipInfo info)
|
| | | {
|
| | | var config = ItemConfig.Get(info.itemId);
|
| | | if (config == null)
|
| | | {
|
| | | return default(TipData);
|
| | | }
|
| | |
|
| | | var baseInfo = new BaseInfo()
|
| | | {
|
| | | itemId = info.itemId,
|
| | | star = info.starLevel,
|
| | | strengthenLevel = info.strengthenLevel,
|
| | | score = info.score,
|
| | | isEquiped = info.isEquiped,
|
| | | };
|
| | |
|
| | | var baseProperty = GetBaseProperty(info.itemId);
|
| | | if (info.starLevel > 0)
|
| | | {
|
| | | var starProperties = new List<Int2>();
|
| | | baseProperty.star = info.starLevel;
|
| | | var starConfig = EquipStarConfig.Get(config.LV, config.EquipPlace, info.starLevel);
|
| | | starProperties.AddRange(starConfig.BaseAttrInfo);
|
| | | baseProperty.starProperties = starProperties;
|
| | | }
|
| | |
|
| | | var legendProperty = new LegendProperty()
|
| | | {
|
| | | properties = info.legendProperties,
|
| | | };
|
| | |
|
| | | var skillInfo = GetSkillInfo(info.itemId);
|
| | | var suitInfo = default(SuitInfo); |
| | | if (ItemLogicUtility.Instance.IsSuitEquip(info.itemId))
|
| | | {
|
| | | var job = config.JobLimit;
|
| | | var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
|
| | | var name = twoConfigs[0].name;
|
| | | var level = config.LV;
|
| | | var maxSuitLevel = EquipStarModel.GetMaxStarLevel(level);
|
| | |
|
| | | var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
|
| | | var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
|
| | | var eightSuits = new Dictionary<int, bool>();
|
| | | var eightSuitLevel = info.suitLevels[EquipSuitType.EightSuit];
|
| | |
|
| | | for (var i = 0; i <= 9; i++, i++, i++)
|
| | | {
|
| | | var configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.TwoSuit);
|
| | | var actived = info.suitLevels[EquipSuitType.TwoSuit] >= i;
|
| | | var properties = new List<Int2>();
|
| | | foreach (var item in configs)
|
| | | {
|
| | | if (item.star == i)
|
| | | {
|
| | | properties.AddRange(item.attr);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | twoSuitProperties[i] = new EquipSuitPropertyEntry()
|
| | | {
|
| | | type = EquipSuitType.TwoSuit,
|
| | | actived = actived,
|
| | | properties = properties,
|
| | | };
|
| | |
|
| | | configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.FiveSuit);
|
| | | actived = info.suitLevels[EquipSuitType.FiveSuit] >= i;
|
| | | properties = new List<Int2>();
|
| | | foreach (var item in configs)
|
| | | {
|
| | | if (item.star == i)
|
| | | {
|
| | | properties.AddRange(item.attr);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | fiveSuitProperties[i] = new EquipSuitPropertyEntry()
|
| | | {
|
| | | type = EquipSuitType.TwoSuit,
|
| | | actived = actived,
|
| | | properties = properties,
|
| | | };
|
| | |
|
| | | eightSuits[i] = eightSuitLevel >= i;
|
| | | }
|
| | |
|
| | | suitInfo = new SuitInfo()
|
| | | {
|
| | | name = name,
|
| | | level = level,
|
| | | job = job,
|
| | | maxSuitLevel = maxSuitLevel,
|
| | | places = info.suitPlaces,
|
| | | placeStars = info.placeStars,
|
| | | twoSuitProperties = twoSuitProperties,
|
| | | fiveSuitProperties = fiveSuitProperties,
|
| | | eightSuits = eightSuits
|
| | | };
|
| | | static TipData CreateCustomEquipData(CustomEquipInfo info) |
| | | { |
| | | var config = ItemConfig.Get(info.itemId); |
| | | if (config == null) |
| | | { |
| | | return default(TipData); |
| | | } |
| | |
|
| | | var starInfo = new StarInfo()
|
| | | {
|
| | | equipPosition = new Int2(config.LV, config.EquipPlace),
|
| | | starLevel = info.starLevel,
|
| | | maxLevel = config.LV == 0 ? 0 : EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV),
|
| | | };
|
| | |
|
| | | |
| | | var baseInfo = new BaseInfo() |
| | | { |
| | | itemId = info.itemId, |
| | | star = info.starLevel, |
| | | strengthenLevel = info.strengthenLevel, |
| | | score = info.score, |
| | | isEquiped = info.isEquiped, |
| | | }; |
| | | |
| | | var baseProperty = GetBaseProperty(info.itemId); |
| | | if (info.starLevel > 0) |
| | | { |
| | | var starProperties = new List<Int2>(); |
| | | baseProperty.star = info.starLevel; |
| | | var starConfig = EquipStarConfig.Get(config.LV, config.EquipPlace, info.starLevel); |
| | | starProperties.AddRange(starConfig.BaseAttrInfo); |
| | | baseProperty.starProperties = starProperties; |
| | | } |
| | | |
| | | var legendProperty = new LegendProperty() |
| | | { |
| | | properties = info.legendProperties, |
| | | }; |
| | | |
| | | var skillInfo = GetSkillInfo(info.itemId); |
| | | var suitInfo = default(SuitInfo); |
| | | if (ItemLogicUtility.Instance.IsSuitEquip(info.itemId)) |
| | | { |
| | | var job = config.JobLimit; |
| | | var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit); |
| | | var name = twoConfigs[0].name; |
| | | var level = config.LV; |
| | | var maxSuitLevel = EquipStarModel.GetMaxStarLevel(level); |
| | | |
| | | var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>(); |
| | | var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>(); |
| | | var eightSuits = new Dictionary<int, bool>(); |
| | | var eightSuitLevel = info.suitLevels[EquipSuitType.EightSuit]; |
| | | |
| | | for (var i = 0; i <= 9; i++, i++, i++) |
| | | { |
| | | var configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.TwoSuit); |
| | | var actived = info.suitLevels[EquipSuitType.TwoSuit] >= i; |
| | | var properties = new List<Int2>(); |
| | | foreach (var item in configs) |
| | | { |
| | | if (item.star == i) |
| | | { |
| | | properties.AddRange(item.attr); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | twoSuitProperties[i] = new EquipSuitPropertyEntry() |
| | | { |
| | | type = EquipSuitType.TwoSuit, |
| | | actived = actived, |
| | | properties = properties, |
| | | }; |
| | | |
| | | configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.FiveSuit); |
| | | actived = info.suitLevels[EquipSuitType.FiveSuit] >= i; |
| | | properties = new List<Int2>(); |
| | | foreach (var item in configs) |
| | | { |
| | | if (item.star == i) |
| | | { |
| | | properties.AddRange(item.attr); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | fiveSuitProperties[i] = new EquipSuitPropertyEntry() |
| | | { |
| | | type = EquipSuitType.TwoSuit, |
| | | actived = actived, |
| | | properties = properties, |
| | | }; |
| | | |
| | | eightSuits[i] = eightSuitLevel >= i; |
| | | } |
| | | |
| | | suitInfo = new SuitInfo() |
| | | { |
| | | name = name, |
| | | level = level, |
| | | job = job, |
| | | maxSuitLevel = maxSuitLevel, |
| | | places = info.suitPlaces, |
| | | placeStars = info.placeStars, |
| | | twoSuitProperties = twoSuitProperties, |
| | | fiveSuitProperties = fiveSuitProperties, |
| | | eightSuits = eightSuits |
| | | }; |
| | | } |
| | | |
| | | var starInfo = new StarInfo() |
| | | { |
| | | equipPosition = new Int2(config.LV, config.EquipPlace), |
| | | starLevel = info.starLevel, |
| | | maxLevel = config.LV == 0 ? 0 : EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV), |
| | | }; |
| | | |
| | | var type = EquipStrengthModel.GetEquipStrengthType(config.EquipPlace); |
| | | var strengthenConfig = ItemPlusConfig.GetTypeAndLevel(type, info.strengthenLevel); |
| | | var strengthenProperties = new List<Int2>(); |
| | | for (int i = 0; i < strengthenConfig.attType.Length; i++) |
| | | {
|
| | | { |
| | | strengthenProperties.Add(new Int2(strengthenConfig.attType[i], strengthenConfig.attValue[i])); |
| | | }
|
| | | var strengthenProperty = new StrengthenProperty()
|
| | | {
|
| | | strengthenLevel = info.strengthenLevel,
|
| | | properties = strengthenProperties
|
| | | };
|
| | |
|
| | | var gemInfo = new GemInfo()
|
| | | {
|
| | | activeStates = info.gemHoleActiveStates,
|
| | | gems = info.gems,
|
| | | };
|
| | |
|
| | | var trainProperty = new TrainProperty()
|
| | | {
|
| | | properties = info.trainProperties,
|
| | | };
|
| | |
|
| | | } |
| | | var strengthenProperty = new StrengthenProperty() |
| | | { |
| | | strengthenLevel = info.strengthenLevel, |
| | | properties = strengthenProperties |
| | | }; |
| | | |
| | | var gemInfo = new GemInfo() |
| | | { |
| | | activeStates = info.gemHoleActiveStates, |
| | | gems = info.gems, |
| | | }; |
| | | |
| | | var trainProperty = new TrainProperty() |
| | | { |
| | | properties = info.trainProperties, |
| | | }; |
| | | |
| | | return new TipData() |
| | | { |
| | | itemId = info.itemId, |
| | |
| | | strengthenProperty = strengthenProperty, |
| | | gemInfo = gemInfo, |
| | | trainProperty = trainProperty, |
| | | };
|
| | | }; |
| | | } |
| | | |
| | | static TipData CreateGoodEquipData(int itemId, int goodId) |
| | |
| | | goodId = goodId, |
| | | |
| | | baseInfo = GetBaseInfo(itemId), |
| | | baseProperty = GetBaseProperty(itemId),
|
| | | baseProperty = GetBaseProperty(itemId), |
| | | spiritWeaponProperty = GetSpiritWeaponProperty(itemId), |
| | | legendProperty = GetLegendProperty(itemId), |
| | | skillInfo = GetSkillInfo(itemId), |
| | |
| | | } |
| | | |
| | | var legendProperty = GetLegendProperty(guid); |
| | | if (legendProperty.properties.IsNullOrEmpty())
|
| | | {
|
| | | legendProperty = GetLegendProperty(item.itemId);
|
| | | if (legendProperty.properties.IsNullOrEmpty()) |
| | | { |
| | | legendProperty = GetLegendProperty(item.itemId); |
| | | } |
| | | |
| | | return new TipData() |
| | |
| | | guid = guid, |
| | | |
| | | baseInfo = GetBaseInfo(guid), |
| | | baseProperty = GetBaseProperty(item.itemId),
|
| | | baseProperty = GetBaseProperty(item.itemId), |
| | | spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId), |
| | | legendProperty = legendProperty, |
| | | skillInfo = GetSkillInfo(item.itemId), |
| | |
| | | { |
| | | itemId = itemId, |
| | | baseInfo = GetBaseInfo(itemId), |
| | | baseProperty = GetBaseProperty(itemId),
|
| | | exchangeItemId = itemId,
|
| | | baseProperty = GetBaseProperty(itemId), |
| | | exchangeItemId = itemId, |
| | | spiritWeaponProperty = GetSpiritWeaponProperty(itemId), |
| | | legendProperty = GetLegendProperty(itemId), |
| | | petMountBaseProperty = GetPetMountBaseProperty(itemId), |
| | |
| | | }; |
| | | } |
| | | |
| | | static TipData CreateGatherSoulData(PackType packType, int index)
|
| | | {
|
| | | GatherSoulItem soulItem;
|
| | | if (packType == PackType.GatherSoul)
|
| | | {
|
| | | virtualPackModel.TryGetItem(PackType.GatherSoul, index, out soulItem);
|
| | | }
|
| | | else
|
| | | {
|
| | | gatherSoulModel.TryGetItem(index, out soulItem);
|
| | | }
|
| | | return new TipData()
|
| | | {
|
| | | itemId = soulItem.id,
|
| | | gatherSoul = new GatherSoulInfo()
|
| | | {
|
| | | packType = packType,
|
| | | level = soulItem.level,
|
| | | index = soulItem.index,
|
| | | },
|
| | | operates = GetGatherSoulOperates(packType, index),
|
| | | };
|
| | | static TipData CreateGatherSoulData(PackType packType, int index) |
| | | { |
| | | GatherSoulItem soulItem; |
| | | if (packType == PackType.GatherSoul) |
| | | { |
| | | virtualPackModel.TryGetItem(PackType.GatherSoul, index, out soulItem); |
| | | } |
| | | else |
| | | { |
| | | gatherSoulModel.TryGetItem(index, out soulItem); |
| | | } |
| | | return new TipData() |
| | | { |
| | | itemId = soulItem.id, |
| | | gatherSoul = new GatherSoulInfo() |
| | | { |
| | | packType = packType, |
| | | level = soulItem.level, |
| | | index = soulItem.index, |
| | | }, |
| | | operates = GetGatherSoulOperates(packType, index), |
| | | }; |
| | | } |
| | | |
| | | public static void Operate(ItemOperateType type, string guid) |
| | |
| | | { |
| | | case ItemOperateType.putOn: |
| | | ItemOperateUtility.Instance.PutOnItem(guid); |
| | | break;
|
| | | case ItemOperateType.gotoPuton:
|
| | | ItemOperateUtility.Instance.GotoPutOnEquip(guid);
|
| | | break; |
| | | case ItemOperateType.gotoPuton: |
| | | ItemOperateUtility.Instance.GotoPutOnEquip(guid); |
| | | break; |
| | | case ItemOperateType.putOff: |
| | | ItemOperateUtility.Instance.PutOffEquip(guid); |
| | |
| | | { |
| | | ItemOperateUtility.Instance.GotoComposeItem(jumpId); |
| | | } |
| | | break;
|
| | | break; |
| | | case ItemOperateType.renewal: |
| | | ItemOperateUtility.Instance.RenewalItem(guid); |
| | | break; |
| | | case ItemOperateType.exchange: |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.ExchangeActiveToken); |
| | | break; |
| | | } |
| | | } |
| | |
| | | storeModel.SendBuyShopItem(config, count); |
| | | } |
| | | |
| | | public static void GatherSoulOperate(ItemOperateType type)
|
| | | {
|
| | | if (mainTipData == null)
|
| | | {
|
| | | WindowCenter.Instance.Close<GatherSoulTipWin>();
|
| | | return;
|
| | | }
|
| | | if (mainTipData.gatherSoul.packType == PackType.GatherSoul)
|
| | | {
|
| | | GatherSoulItem item;
|
| | | if (!virtualPackModel.TryGetItem(mainTipData.gatherSoul.packType,
|
| | | mainTipData.gatherSoul.index, out item))
|
| | | {
|
| | | WindowCenter.Instance.Close<GatherSoulTipWin>();
|
| | | return;
|
| | | }
|
| | | gatherSoulModel.HandleSoulTipFunc(type, item);
|
| | | }
|
| | | else if (mainTipData.gatherSoul.packType == PackType.InterimPack)
|
| | | {
|
| | | GatherSoulItem item;
|
| | | if (!gatherSoulModel.TryGetItem(mainTipData.gatherSoul.index, out item))
|
| | | {
|
| | | return;
|
| | | }
|
| | | switch (type)
|
| | | {
|
| | | case ItemOperateType.compose:
|
| | | {
|
| | | gatherSoulModel.HandleSoulTipFunc(type, item);
|
| | | }
|
| | | break;
|
| | | case ItemOperateType.putOff:
|
| | | {
|
| | | WindowCenter.Instance.Close<GatherSoulTipWin>();
|
| | | gatherSoulModel.ExecutePutOffSoul(item);
|
| | | }
|
| | | break;
|
| | | case ItemOperateType.LevelUp:
|
| | | WindowCenter.Instance.Close<GatherSoulTipWin>();
|
| | | GatherSoulLevelUpWin.selectHole = item.index;
|
| | | WindowCenter.Instance.Open<GatherSoulLevelUpWin>();
|
| | | break;
|
| | | case ItemOperateType.Replace:
|
| | | WindowCenter.Instance.Close<GatherSoulTipWin>();
|
| | | GatherSoulEquipListWin.selectHole = item.index;
|
| | | WindowCenter.Instance.Open<GatherSoulEquipListWin>();
|
| | | break;
|
| | | }
|
| | | }
|
| | | public static void GatherSoulOperate(ItemOperateType type) |
| | | { |
| | | if (mainTipData == null) |
| | | { |
| | | WindowCenter.Instance.Close<GatherSoulTipWin>(); |
| | | return; |
| | | } |
| | | if (mainTipData.gatherSoul.packType == PackType.GatherSoul) |
| | | { |
| | | GatherSoulItem item; |
| | | if (!virtualPackModel.TryGetItem(mainTipData.gatherSoul.packType, |
| | | mainTipData.gatherSoul.index, out item)) |
| | | { |
| | | WindowCenter.Instance.Close<GatherSoulTipWin>(); |
| | | return; |
| | | } |
| | | gatherSoulModel.HandleSoulTipFunc(type, item); |
| | | } |
| | | else if (mainTipData.gatherSoul.packType == PackType.InterimPack) |
| | | { |
| | | GatherSoulItem item; |
| | | if (!gatherSoulModel.TryGetItem(mainTipData.gatherSoul.index, out item)) |
| | | { |
| | | return; |
| | | } |
| | | switch (type) |
| | | { |
| | | case ItemOperateType.compose: |
| | | { |
| | | gatherSoulModel.HandleSoulTipFunc(type, item); |
| | | } |
| | | break; |
| | | case ItemOperateType.putOff: |
| | | { |
| | | WindowCenter.Instance.Close<GatherSoulTipWin>(); |
| | | gatherSoulModel.ExecutePutOffSoul(item); |
| | | } |
| | | break; |
| | | case ItemOperateType.LevelUp: |
| | | WindowCenter.Instance.Close<GatherSoulTipWin>(); |
| | | GatherSoulLevelUpWin.selectHole = item.index; |
| | | WindowCenter.Instance.Open<GatherSoulLevelUpWin>(); |
| | | break; |
| | | case ItemOperateType.Replace: |
| | | WindowCenter.Instance.Close<GatherSoulTipWin>(); |
| | | GatherSoulEquipListWin.selectHole = item.index; |
| | | WindowCenter.Instance.Open<GatherSoulEquipListWin>(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static BaseInfo GetBaseInfo(int itemId) |
| | |
| | | var baseProperties = new List<Int2>(); |
| | | var config = ItemConfig.Get(itemId); |
| | | |
| | | if (config.Effect1 == 220)
|
| | | {
|
| | | return GetBaseProperty(config.EffectValueA1);
|
| | | if (config.Effect1 == 220) |
| | | { |
| | | return GetBaseProperty(config.EffectValueA1); |
| | | } |
| | | |
| | | if (!ItemLogicUtility.Instance.IsDogzEquip(itemId))
|
| | | {
|
| | | if (config.Effect1 != 0)
|
| | | {
|
| | | baseProperties.Add(new Int2(config.Effect1, config.EffectValueA1));
|
| | | }
|
| | | if (!ItemLogicUtility.Instance.IsDogzEquip(itemId)) |
| | | { |
| | | if (config.Effect1 != 0) |
| | | { |
| | | baseProperties.Add(new Int2(config.Effect1, config.EffectValueA1)); |
| | | } |
| | | } |
| | | |
| | | if (config.Effect2 != 0) |
| | |
| | | data.isPreview = true; |
| | | data.itemId = itemId; |
| | | |
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config.Effect1 == 220)
|
| | | {
|
| | | data.isPreview = false;
|
| | | var appConfig = AppointItemConfig.Get(itemId);
|
| | | data.trueCount = 0;
|
| | |
|
| | | data.properties = new List<Int2>();
|
| | | for (var i = 0; i < appConfig.LegendAttrID.Length; i++)
|
| | | {
|
| | | data.properties.Add(new Int2(appConfig.LegendAttrID[i], appConfig.LegendAttrValue[i]));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId);
|
| | | data.properties = LegendPropertyUtility.GetEquipProperties(itemId);
|
| | | var config = ItemConfig.Get(itemId); |
| | | if (config.Effect1 == 220) |
| | | { |
| | | data.isPreview = false; |
| | | var appConfig = AppointItemConfig.Get(itemId); |
| | | data.trueCount = 0; |
| | | |
| | | data.properties = new List<Int2>(); |
| | | for (var i = 0; i < appConfig.LegendAttrID.Length; i++) |
| | | { |
| | | data.properties.Add(new Int2(appConfig.LegendAttrID[i], appConfig.LegendAttrValue[i])); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId); |
| | | data.properties = LegendPropertyUtility.GetEquipProperties(itemId); |
| | | } |
| | | |
| | | return data; |
| | | } |
| | | |
| | | private static SpiritWeaponProperty GetSpiritWeaponProperty(int itemId)
|
| | | {
|
| | | var config = SpiritWeaponConfig.Get(itemId);
|
| | | if (config == null)
|
| | | {
|
| | | return default(SpiritWeaponProperty);
|
| | | }
|
| | |
|
| | | var properties = new List<Int3>();
|
| | | for (var i = 0; i < config.AttrIDList.Length; i++)
|
| | | {
|
| | | properties.Add(new Int3(config.AttrIDList[i], config.AttrValueList[i], config.AttrColorList[i]));
|
| | | }
|
| | |
|
| | | var spiritWeaponProperty = new SpiritWeaponProperty();
|
| | | spiritWeaponProperty.itemId = itemId;
|
| | | spiritWeaponProperty.properties = properties;
|
| | | return spiritWeaponProperty;
|
| | | private static SpiritWeaponProperty GetSpiritWeaponProperty(int itemId) |
| | | { |
| | | var config = SpiritWeaponConfig.Get(itemId); |
| | | if (config == null) |
| | | { |
| | | return default(SpiritWeaponProperty); |
| | | } |
| | | |
| | | var properties = new List<Int3>(); |
| | | for (var i = 0; i < config.AttrIDList.Length; i++) |
| | | { |
| | | properties.Add(new Int3(config.AttrIDList[i], config.AttrValueList[i], config.AttrColorList[i])); |
| | | } |
| | | |
| | | var spiritWeaponProperty = new SpiritWeaponProperty(); |
| | | spiritWeaponProperty.itemId = itemId; |
| | | spiritWeaponProperty.properties = properties; |
| | | return spiritWeaponProperty; |
| | | } |
| | | |
| | | private static LegendProperty GetLegendProperty(string guid) |
| | |
| | | return data; |
| | | } |
| | | |
| | | public static LegendProperty GetLegendProperty(int itemId, Dictionary<int, List<int>> userData)
|
| | | {
|
| | | public static LegendProperty GetLegendProperty(int itemId, Dictionary<int, List<int>> userData) |
| | | { |
| | | var data = new LegendProperty(); |
| | | data.isPreview = false; |
| | | data.itemId = itemId;
|
| | |
|
| | | List<int> ids = null;
|
| | | data.itemId = itemId; |
| | | |
| | | List<int> ids = null; |
| | | List<int> values = null; |
| | | if (userData != null)
|
| | | {
|
| | | userData.TryGetValue(17, out ids);
|
| | | userData.TryGetValue(19, out values);
|
| | | if (userData != null) |
| | | { |
| | | userData.TryGetValue(17, out ids); |
| | | userData.TryGetValue(19, out values); |
| | | } |
| | | if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty()) |
| | | { |
| | |
| | | data.properties = properties; |
| | | } |
| | | |
| | | return data;
|
| | | return data; |
| | | } |
| | | |
| | | private static SuitInfo GetSuitInfo(int itemId) |
| | |
| | | private static GetWay GetGetWay(int itemId) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | if (config == null)
|
| | | {
|
| | | return default(GetWay);
|
| | | if (config == null) |
| | | { |
| | | return default(GetWay); |
| | | } |
| | | |
| | | var getWay = new GetWay(); |
| | |
| | | operates.Add(ItemOperateType.sell); |
| | | } |
| | | |
| | | if (itemCount > 1)
|
| | | {
|
| | | if (itemCount > 1) |
| | | { |
| | | operates.Add(ItemOperateType.split); |
| | | } |
| | | |
| | |
| | | operates.Add(ItemOperateType.strength); |
| | | } |
| | | |
| | | if (FuncOpen.Instance.IsFuncOpen(172))
|
| | | {
|
| | | operates.Add(ItemOperateType.star);
|
| | | }
|
| | |
|
| | | if (FuncOpen.Instance.IsFuncOpen(172)) |
| | | { |
| | | operates.Add(ItemOperateType.star); |
| | | } |
| | | |
| | | if (FuncOpen.Instance.IsFuncOpen(2)) |
| | | { |
| | | operates.Add(ItemOperateType.inlay); |
| | | }
|
| | |
|
| | | } |
| | | |
| | | if (FuncOpen.Instance.IsFuncOpen(91)) |
| | | {
|
| | | operates.Add(ItemOperateType.train);
|
| | | }
|
| | | { |
| | | operates.Add(ItemOperateType.train); |
| | | } |
| | | |
| | | return operates; |
| | | } |
| | |
| | | { |
| | | operates.Add(ItemOperateType.putOff); |
| | | return operates; |
| | | }
|
| | |
|
| | | } |
| | | |
| | | if (ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId) && WindowCenter.Instance.IsOpen("SpiritEquipBagWin")) |
| | | { |
| | | operates.Add(ItemOperateType.putOff); |
| | |
| | | operates.Add(ItemOperateType.renewal); |
| | | } |
| | | |
| | | if (!isOverdue && ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId)) |
| | | if (!isOverdue) |
| | | { |
| | | if (isEquip)
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<RoleEquipWin>())
|
| | | {
|
| | | operates.Add(ItemOperateType.gotoPuton);
|
| | | }
|
| | | else if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() || WindowCenter.Instance.IsOpen<RealmEquipWin>())
|
| | | {
|
| | | operates.Add(ItemOperateType.putOn);
|
| | | }
|
| | | } |
| | | if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId)) |
| | | { |
| | | if (isEquip) |
| | | { |
| | | if (WindowCenter.Instance.IsOpen<RoleEquipWin>()) |
| | | { |
| | | operates.Add(ItemOperateType.gotoPuton); |
| | | } |
| | | else if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() || WindowCenter.Instance.IsOpen<RealmEquipWin>()) |
| | | { |
| | | operates.Add(ItemOperateType.putOn); |
| | | } |
| | | } |
| | | |
| | | if (isSpiritWeapon)
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<RoleEquipWin>())
|
| | | {
|
| | | operates.Add(ItemOperateType.gotoPuton);
|
| | | }
|
| | | else if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() || WindowCenter.Instance.IsOpen("SpiritEquipBagWin"))
|
| | | {
|
| | | operates.Add(ItemOperateType.putOn);
|
| | | }
|
| | | if (isSpiritWeapon) |
| | | { |
| | | if (WindowCenter.Instance.IsOpen<RoleEquipWin>()) |
| | | { |
| | | operates.Add(ItemOperateType.gotoPuton); |
| | | } |
| | | else if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() || WindowCenter.Instance.IsOpen("SpiritEquipBagWin")) |
| | | { |
| | | operates.Add(ItemOperateType.putOn); |
| | | } |
| | | } |
| | | } |
| | |
|
| | | else |
| | | { |
| | | operates.Add(ItemOperateType.exchange); |
| | | } |
| | | } |
| | | |
| | | return operates; |
| | |
| | | return operates; |
| | | } |
| | | |
| | | public static List<ItemOperateType> GetGatherSoulOperates(PackType packType, int index)
|
| | | {
|
| | | var operates = new List<ItemOperateType>();
|
| | |
|
| | | GatherSoulItem item;
|
| | |
|
| | | if (packType == PackType.InterimPack)
|
| | | {
|
| | | gatherSoulModel.TryGetItem(index, out item);
|
| | | operates.Add(ItemOperateType.putOff);
|
| | | GatherSoulComposeModel.Compose compose;
|
| | | bool requireCompose = gatherSoulComposeModel.ExistInComposeMat(item.id, out compose);
|
| | | if (requireCompose)
|
| | | {
|
| | | operates.Add(ItemOperateType.compose);
|
| | | }
|
| | | if (!gatherSoulModel.IsGatherSoulMaxLevel(item.id, item.level))
|
| | | {
|
| | | operates.Add(ItemOperateType.LevelUp);
|
| | | }
|
| | | List<GatherSoulItem> list = new List<GatherSoulItem>();
|
| | | gatherSoulModel.TryGetSatisfyReplaceSouls(item.index, ref list);
|
| | | if (list.Count > 0)
|
| | | {
|
| | | operates.Add(ItemOperateType.Replace);
|
| | | }
|
| | | }
|
| | | else if (packType == PackType.GatherSoul)
|
| | | {
|
| | | virtualPackModel.TryGetItem(PackType.GatherSoul, index, out item);
|
| | | if (item.itemType != GatheringSoulModel.GATHERSOUL_ESSENCE_TYPE)
|
| | | {
|
| | | GatherSoulComposeModel.Compose compose;
|
| | | if (gatherSoulComposeModel.TryGetCompose(item.id, out compose)
|
| | | && compose.requireItems.Count > 0)
|
| | | {
|
| | | operates.Add(ItemOperateType.dismantle);
|
| | | }
|
| | | else
|
| | | {
|
| | | operates.Add(ItemOperateType.Resolve);
|
| | | }
|
| | | GatherSoulComposeModel.Compose outCompose;
|
| | | bool requireCompose = gatherSoulComposeModel.ExistInComposeMat(item.id, out outCompose);
|
| | | if (requireCompose)
|
| | | {
|
| | | operates.Add(ItemOperateType.compose);
|
| | | }
|
| | | bool existSamePropertyHole = gatherSoulModel.IsSamePropertyCompareHoles(-1, item as GatherSoulItem) != -1;
|
| | | bool existCoreHoleItem = false;
|
| | | GatherSoulItem holeItem;
|
| | | if (gatherSoulModel.TryGetItem(gatherSoulModel.coreHole, out holeItem))
|
| | | {
|
| | | existCoreHoleItem = true;
|
| | | }
|
| | | if (item.itemType == GatheringSoulModel.GATHERSOUL_CORE_TYPE)
|
| | | {
|
| | | operates.Add(existCoreHoleItem ? ItemOperateType.Replace : ItemOperateType.Wear);
|
| | | }
|
| | | else
|
| | | {
|
| | | operates.Add(existSamePropertyHole ? ItemOperateType.Replace : ItemOperateType.Wear);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | operates.Add(ItemOperateType.Resolve);
|
| | | }
|
| | | }
|
| | |
|
| | | return operates;
|
| | | public static List<ItemOperateType> GetGatherSoulOperates(PackType packType, int index) |
| | | { |
| | | var operates = new List<ItemOperateType>(); |
| | | |
| | | GatherSoulItem item; |
| | | |
| | | if (packType == PackType.InterimPack) |
| | | { |
| | | gatherSoulModel.TryGetItem(index, out item); |
| | | operates.Add(ItemOperateType.putOff); |
| | | GatherSoulComposeModel.Compose compose; |
| | | bool requireCompose = gatherSoulComposeModel.ExistInComposeMat(item.id, out compose); |
| | | if (requireCompose) |
| | | { |
| | | operates.Add(ItemOperateType.compose); |
| | | } |
| | | if (!gatherSoulModel.IsGatherSoulMaxLevel(item.id, item.level)) |
| | | { |
| | | operates.Add(ItemOperateType.LevelUp); |
| | | } |
| | | List<GatherSoulItem> list = new List<GatherSoulItem>(); |
| | | gatherSoulModel.TryGetSatisfyReplaceSouls(item.index, ref list); |
| | | if (list.Count > 0) |
| | | { |
| | | operates.Add(ItemOperateType.Replace); |
| | | } |
| | | } |
| | | else if (packType == PackType.GatherSoul) |
| | | { |
| | | virtualPackModel.TryGetItem(PackType.GatherSoul, index, out item); |
| | | if (item.itemType != GatheringSoulModel.GATHERSOUL_ESSENCE_TYPE) |
| | | { |
| | | GatherSoulComposeModel.Compose compose; |
| | | if (gatherSoulComposeModel.TryGetCompose(item.id, out compose) |
| | | && compose.requireItems.Count > 0) |
| | | { |
| | | operates.Add(ItemOperateType.dismantle); |
| | | } |
| | | else |
| | | { |
| | | operates.Add(ItemOperateType.Resolve); |
| | | } |
| | | GatherSoulComposeModel.Compose outCompose; |
| | | bool requireCompose = gatherSoulComposeModel.ExistInComposeMat(item.id, out outCompose); |
| | | if (requireCompose) |
| | | { |
| | | operates.Add(ItemOperateType.compose); |
| | | } |
| | | bool existSamePropertyHole = gatherSoulModel.IsSamePropertyCompareHoles(-1, item as GatherSoulItem) != -1; |
| | | bool existCoreHoleItem = false; |
| | | GatherSoulItem holeItem; |
| | | if (gatherSoulModel.TryGetItem(gatherSoulModel.coreHole, out holeItem)) |
| | | { |
| | | existCoreHoleItem = true; |
| | | } |
| | | if (item.itemType == GatheringSoulModel.GATHERSOUL_CORE_TYPE) |
| | | { |
| | | operates.Add(existCoreHoleItem ? ItemOperateType.Replace : ItemOperateType.Wear); |
| | | } |
| | | else |
| | | { |
| | | operates.Add(existSamePropertyHole ? ItemOperateType.Replace : ItemOperateType.Wear); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | operates.Add(ItemOperateType.Resolve); |
| | | } |
| | | } |
| | | |
| | | return operates; |
| | | } |
| | | |
| | | private static List<ItemOperateType> GetGoodOperates(int goodId) |
| | |
| | | return true; |
| | | } |
| | | |
| | | private static TipType GetTipType(int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | |
|
| | | if (GeneralDefine.chestDisplayItems.Contains(itemId))
|
| | | {
|
| | | return TipType.PeerlessChest;
|
| | | }
|
| | |
|
| | | switch (config.Type)
|
| | | {
|
| | | case 101:
|
| | | case 102:
|
| | | case 103:
|
| | | case 104:
|
| | | case 105:
|
| | | case 106:
|
| | | case 107:
|
| | | case 108:
|
| | | case 109:
|
| | | case 110:
|
| | | case 111:
|
| | | case 112:
|
| | | return TipType.Equip;
|
| | | case 119:
|
| | | case 120:
|
| | | case 121:
|
| | | case 122:
|
| | | case 123:
|
| | | return TipType.Dogz;
|
| | | case 61:
|
| | | case 62:
|
| | | case 63:
|
| | | return TipType.GatherSoul;
|
| | | case 53:
|
| | | return TipType.KingTreasure;
|
| | | case 26:
|
| | | case 41:
|
| | | case 42:
|
| | | return TipType.PetMount;
|
| | | case 113:
|
| | | case 114:
|
| | | case 116:
|
| | | case 117:
|
| | | return TipType.SpiritWeapon;
|
| | | default:
|
| | | return TipType.Item;
|
| | | }
|
| | |
|
| | | private static TipType GetTipType(int itemId) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | |
| | | if (GeneralDefine.chestDisplayItems.Contains(itemId)) |
| | | { |
| | | return TipType.PeerlessChest; |
| | | } |
| | | |
| | | switch (config.Type) |
| | | { |
| | | case 101: |
| | | case 102: |
| | | case 103: |
| | | case 104: |
| | | case 105: |
| | | case 106: |
| | | case 107: |
| | | case 108: |
| | | case 109: |
| | | case 110: |
| | | case 111: |
| | | case 112: |
| | | return TipType.Equip; |
| | | case 119: |
| | | case 120: |
| | | case 121: |
| | | case 122: |
| | | case 123: |
| | | return TipType.Dogz; |
| | | case 61: |
| | | case 62: |
| | | case 63: |
| | | return TipType.GatherSoul; |
| | | case 53: |
| | | return TipType.KingTreasure; |
| | | case 26: |
| | | case 41: |
| | | case 42: |
| | | return TipType.PetMount; |
| | | case 113: |
| | | case 114: |
| | | case 116: |
| | | case 117: |
| | | return TipType.SpiritWeapon; |
| | | default: |
| | | return TipType.Item; |
| | | } |
| | | |
| | | } |
| | | |
| | | [System.Diagnostics.Conditional("UNITY_EDITOR")] |
| | | private static void PrintItemBrief(int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | private static void PrintItemBrief(int itemId) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | Debug.LogFormat("你查看的物品是:itemId->{0} ;name->{1}", itemId, config.ItemName); |
| | | }
|
| | |
|
| | | } |
| | | |
| | | [System.Diagnostics.Conditional("UNITY_EDITOR")] |
| | | private static void PrintItemBrief(int itemId, string guid)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | private static void PrintItemBrief(int itemId, string guid) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | Debug.LogFormat("你查看的物品是:itemId->{0};name->{1};guid->{2};", itemId, config.ItemName, string.IsNullOrEmpty(guid) ? "" : guid); |
| | | } |
| | | |