using Snxxz.UI;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using TableConfig;
|
using LitJson;
|
using UnityEngine;
|
|
namespace Snxxz.UI
|
{
|
[XLua.LuaCallCSharp]
|
public class ItemTipsModel : Model, IBeforePlayerDataInitialize
|
{
|
|
FuncConfigConfig exhaustedFunc;
|
|
public Dictionary<int, List<int>> equipLegendAttrTypeDict { get; private set; }
|
public Dictionary<int, Dictionary<int, string>> wingsLegendAttrColorDict { get; private set; }
|
public Dictionary<string, Dictionary<LegendAttrType, int>> legendAttrCntPreviewDict { get; private set; } // key 品质+星级 value 属性条目数
|
public Dictionary<int, Dictionary<LegendAttrType, List<int>>> legendAttrIDPreviewDict { get; private set; } // key 装备位 value 属性类型,属性ID
|
public Dictionary<int, Dictionary<int, int>> legendAttrColorValuePreviewDict { get; private set; } // key 属性ID value 装备品质,属性数值
|
public Dictionary<int, Dictionary<int, int>> legendAttrLvValuePreviewDict { get; private set; } // key 属性ID value 装备阶级,属性数值
|
public Dictionary<int, int> wingsLegendAttrCntPreviewDict { get; private set; } //key 阶数 value属性数
|
public Dictionary<int, Dictionary<int, List<int>>> wingsLegendAttrValuePreviewDict { get; private set; } //key 阶数 value 属性ID 属性数值
|
public Dictionary<int, Dictionary<LegendAttrType, List<int>>> dogzLegendAttrIDPreviewDict { get; private set; } // key 装备位 value 属性类型,属性ID
|
public Dictionary<int, Dictionary<int, int>> dogzLegendAttrColorValuePreviewDict { get; private set; } // key 属性ID value 装备品质,属性数值
|
public Dictionary<string, Dictionary<LegendAttrType, int>> dogzLegendAttrCntPreviewDict { get; private set; } // key 品质+星级 value 属性条目数
|
public Dictionary<int, List<int>> dogzLegendAttrTypeDict { get; private set; }
|
public Dictionary<int, List<string>> guardDesDict { get; private set; }
|
|
public Dictionary<int, PetInfoConfig> unlockPetDict { get; private set; }
|
public Dictionary<int, HorseConfig> unlockMountDict { get; private set; }
|
private Dictionary<int, Dictionary<int, int>> petSkillDict = new Dictionary<int, Dictionary<int, int>>(); // 编号 解锁阶级 技能
|
private Dictionary<int, Dictionary<int, List<int>>> mountSkillDict = new Dictionary<int, Dictionary<int, List<int>>>(); // 编号 解锁阶级 技能
|
public Dictionary<int, string> petAndMountQualityDict = new Dictionary<int, string>();
|
public string expValueFormula = "";
|
|
public int[] guardAutoDrops;
|
|
public int[] gemOpenLvs { get; private set; }
|
public int gemOpenVipLv { get; private set; }
|
public int[] gemType1s { get; private set; }
|
public int[] gemType2s { get; private set; }
|
|
public int[] equipMidHeights { get; private set; }
|
public int[] wingsMidHeights { get; private set; }
|
|
public int[] jumpAndUseTypes { get; private set; }
|
|
public int equipSuitStar { get; private set; }
|
|
public int[] ItemRenewalIds { get; private set; }
|
public int[] tryPutOnEquipIds { get; private set; }
|
|
public int[] randomRuneIds { get; private set; }
|
PlayerPackModel _playerPack;
|
PlayerPackModel playerPack
|
{
|
get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
|
}
|
|
StoreModel _storeModel;
|
StoreModel m_storeModel
|
{
|
get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
|
}
|
|
PackModelInterface _modelInterface;
|
PackModelInterface modelInterface
|
{
|
get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
}
|
|
DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
|
public override void Init()
|
{
|
m_storeModel.RefreshTCBPlayerDataEvent += RefreshOfflinePluginTime;
|
|
exhaustedFunc = Config.Instance.Get<FuncConfigConfig>("OutOfPrintValue");
|
FuncConfigConfig suitlimitModel = Config.Instance.Get<FuncConfigConfig>("EquipSuitLimit");
|
equipSuitStar = int.Parse(suitlimitModel.Numerical2);
|
|
FuncConfigConfig bagUseItem = Config.Instance.Get<FuncConfigConfig>("BagUseItem");
|
jumpAndUseTypes = ConfigParse.GetMultipleStr<int>(bagUseItem.Numerical1);
|
|
FuncConfigConfig renewalFunc = Config.Instance.Get<FuncConfigConfig>("ItemRepayButton");
|
ItemRenewalIds = ConfigParse.GetMultipleStr<int>(renewalFunc.Numerical1);
|
tryPutOnEquipIds = ConfigParse.GetMultipleStr<int>(renewalFunc.Numerical2);
|
|
FuncConfigConfig legendAttrColor = Config.Instance.Get<FuncConfigConfig>("LegendAttrColor");
|
equipLegendAttrTypeDict = new Dictionary<int, List<int>>();
|
wingsLegendAttrColorDict = new Dictionary<int, Dictionary<int, string>>();
|
if (legendAttrColor != null)
|
{
|
JsonData jsonData = JsonMapper.ToObject(legendAttrColor.Numerical1);
|
foreach (var key in jsonData.Keys)
|
{
|
List<int> attrIDlist = new List<int>();
|
equipLegendAttrTypeDict.Add(int.Parse(key), attrIDlist);
|
for (int i = 0; i < jsonData[key].Count; i++)
|
{
|
attrIDlist.Add((int)jsonData[key][i]);
|
}
|
}
|
|
JsonData jsonData2 = JsonMapper.ToObject(legendAttrColor.Numerical2);
|
foreach (var key in jsonData2.Keys)
|
{
|
Dictionary<int, string> colorDict = new Dictionary<int, string>();
|
wingsLegendAttrColorDict.Add(int.Parse(key), colorDict);
|
foreach (var key2 in jsonData2[key].Keys)
|
{
|
colorDict.Add(int.Parse(key2), jsonData2[key][key2][0].ToString());
|
}
|
}
|
}
|
|
FuncConfigConfig dogzlegendAttrColor = Config.Instance.Get<FuncConfigConfig>("DogzLegendAttrColor");
|
dogzLegendAttrTypeDict = new Dictionary<int, List<int>>();
|
if (dogzlegendAttrColor != null)
|
{
|
JsonData jsonData = JsonMapper.ToObject(dogzlegendAttrColor.Numerical1);
|
foreach (var key in jsonData.Keys)
|
{
|
List<int> attrIDlist = new List<int>();
|
dogzLegendAttrTypeDict.Add(int.Parse(key), attrIDlist);
|
for (int i = 0; i < jsonData[key].Count; i++)
|
{
|
attrIDlist.Add((int)jsonData[key][i]);
|
}
|
}
|
}
|
|
FuncConfigConfig legendAttrCountPreview = Config.Instance.Get<FuncConfigConfig>("LegendAttrCountPreview");
|
JsonData legendAttrCntData = JsonMapper.ToObject(legendAttrCountPreview.Numerical1);
|
legendAttrCntPreviewDict = new Dictionary<string, Dictionary<LegendAttrType, int>>();
|
foreach (var color in legendAttrCntData.Keys)
|
{
|
foreach (var star in legendAttrCntData[color].Keys)
|
{
|
Dictionary<LegendAttrType, int> legendCntDic = new Dictionary<LegendAttrType, int>();
|
legendAttrCntPreviewDict.Add(StringUtility.Contact(color, star), legendCntDic);
|
if (legendAttrCntData[color][star].IsArray)
|
{
|
int i = 0;
|
for (i = 0; i < legendAttrCntData[color][star].Count; i++)
|
{
|
legendCntDic.Add((LegendAttrType)i, int.Parse(legendAttrCntData[color][star][i].ToString()));
|
}
|
}
|
}
|
}
|
|
FuncConfigConfig dogzlegendAttrCountPreview = Config.Instance.Get<FuncConfigConfig>("DogzLegendAttrCountPreview");
|
JsonData dogzlegendAttrCntData = JsonMapper.ToObject(dogzlegendAttrCountPreview.Numerical1);
|
dogzLegendAttrCntPreviewDict = new Dictionary<string, Dictionary<LegendAttrType, int>>();
|
foreach (var color in dogzlegendAttrCntData.Keys)
|
{
|
foreach (var star in dogzlegendAttrCntData[color].Keys)
|
{
|
Dictionary<LegendAttrType, int> legendCntDic = new Dictionary<LegendAttrType, int>();
|
dogzLegendAttrCntPreviewDict.Add(StringUtility.Contact(color, star), legendCntDic);
|
if (dogzlegendAttrCntData[color][star].IsArray)
|
{
|
int i = 0;
|
for (i = 0; i < dogzlegendAttrCntData[color][star].Count; i++)
|
{
|
legendCntDic.Add((LegendAttrType)i, int.Parse(dogzlegendAttrCntData[color][star][i].ToString()));
|
}
|
}
|
}
|
}
|
|
FuncConfigConfig legendAttrRulePreview = Config.Instance.Get<FuncConfigConfig>("LegendAttrRulePreview");
|
JsonData legendAttrRuleData = JsonMapper.ToObject(legendAttrRulePreview.Numerical1);
|
legendAttrIDPreviewDict = new Dictionary<int, Dictionary<LegendAttrType, List<int>>>();
|
foreach (var itemPlace in legendAttrRuleData.Keys)
|
{
|
Dictionary<LegendAttrType, List<int>> legendIdDic = new Dictionary<LegendAttrType, List<int>>();
|
legendAttrIDPreviewDict.Add(int.Parse(itemPlace.ToString()), legendIdDic);
|
if (legendAttrRuleData[itemPlace].IsArray)
|
{
|
int i = 0;
|
for (i = 0; i < legendAttrRuleData[itemPlace].Count; i++)
|
{
|
if (legendAttrRuleData[itemPlace][i].IsArray)
|
{
|
List<int> attrIdlist = new List<int>();
|
legendIdDic.Add((LegendAttrType)i, attrIdlist);
|
int j = 0;
|
for (j = 0; j < legendAttrRuleData[itemPlace][i].Count; j++)
|
{
|
attrIdlist.Add(int.Parse(legendAttrRuleData[itemPlace][i][j].ToString()));
|
}
|
}
|
}
|
}
|
}
|
|
FuncConfigConfig dogzlegendAttrRulePreview = Config.Instance.Get<FuncConfigConfig>("DogzLegendAttrRulePreview");
|
JsonData dogzlegendAttrRuleData = JsonMapper.ToObject(dogzlegendAttrRulePreview.Numerical1);
|
dogzLegendAttrIDPreviewDict = new Dictionary<int, Dictionary<LegendAttrType, List<int>>>();
|
foreach (var itemPlace in dogzlegendAttrRuleData.Keys)
|
{
|
Dictionary<LegendAttrType, List<int>> legendIdDic = new Dictionary<LegendAttrType, List<int>>();
|
dogzLegendAttrIDPreviewDict.Add(int.Parse(itemPlace.ToString()), legendIdDic);
|
if (dogzlegendAttrRuleData[itemPlace].IsArray)
|
{
|
int i = 0;
|
for (i = 0; i < dogzlegendAttrRuleData[itemPlace].Count; i++)
|
{
|
if (dogzlegendAttrRuleData[itemPlace][i].IsArray)
|
{
|
List<int> attrIdlist = new List<int>();
|
legendIdDic.Add((LegendAttrType)i, attrIdlist);
|
int j = 0;
|
for (j = 0; j < dogzlegendAttrRuleData[itemPlace][i].Count; j++)
|
{
|
attrIdlist.Add(int.Parse(dogzlegendAttrRuleData[itemPlace][i][j].ToString()));
|
}
|
}
|
}
|
}
|
}
|
|
FuncConfigConfig legendAttrColorValuePreview = Config.Instance.Get<FuncConfigConfig>("LegendAttrValueByColorPreview");
|
JsonData legendAttrColorData = JsonMapper.ToObject(legendAttrColorValuePreview.Numerical1);
|
legendAttrColorValuePreviewDict = new Dictionary<int, Dictionary<int, int>>();
|
foreach (var attrID in legendAttrColorData.Keys)
|
{
|
Dictionary<int, int> legendValueDic = new Dictionary<int, int>();
|
legendAttrColorValuePreviewDict.Add(int.Parse(attrID.ToString()), legendValueDic);
|
if (legendAttrColorData[attrID].IsArray)
|
{
|
int i = 0;
|
for (i = 0; i < legendAttrColorData[attrID].Count; i++)
|
{
|
if (legendAttrColorData[attrID][i].IsArray)
|
{
|
legendValueDic.Add(int.Parse(legendAttrColorData[attrID][i][0].ToString()), int.Parse(legendAttrColorData[attrID][i][1].ToString()));
|
}
|
}
|
}
|
}
|
|
FuncConfigConfig dogzlegendAttrColorValuePreview = Config.Instance.Get<FuncConfigConfig>("DogzLegendAttrValueByColorPreview");
|
JsonData dogzlegendAttrColorData = JsonMapper.ToObject(dogzlegendAttrColorValuePreview.Numerical1);
|
dogzLegendAttrColorValuePreviewDict = new Dictionary<int, Dictionary<int, int>>();
|
foreach (var attrID in dogzlegendAttrColorData.Keys)
|
{
|
Dictionary<int, int> legendValueDic = new Dictionary<int, int>();
|
dogzLegendAttrColorValuePreviewDict.Add(int.Parse(attrID.ToString()), legendValueDic);
|
if (dogzlegendAttrColorData[attrID].IsArray)
|
{
|
int i = 0;
|
for (i = 0; i < dogzlegendAttrColorData[attrID].Count; i++)
|
{
|
if (dogzlegendAttrColorData[attrID][i].IsArray)
|
{
|
legendValueDic.Add(int.Parse(dogzlegendAttrColorData[attrID][i][0].ToString()), int.Parse(dogzlegendAttrColorData[attrID][i][1].ToString()));
|
}
|
}
|
}
|
}
|
|
FuncConfigConfig legendAttrLvValuePreview = Config.Instance.Get<FuncConfigConfig>("LegendAttrValueByClassLVPreview");
|
JsonData legendAttrLvData = JsonMapper.ToObject(legendAttrLvValuePreview.Numerical1);
|
legendAttrLvValuePreviewDict = new Dictionary<int, Dictionary<int, int>>();
|
foreach (var attrID in legendAttrLvData.Keys)
|
{
|
Dictionary<int, int> legendValueDic = new Dictionary<int, int>();
|
legendAttrLvValuePreviewDict.Add(int.Parse(attrID.ToString()), legendValueDic);
|
if (legendAttrLvData[attrID].IsArray)
|
{
|
int i = 0;
|
for (i = 0; i < legendAttrLvData[attrID].Count; i++)
|
{
|
if (legendAttrLvData[attrID][i].IsArray)
|
{
|
legendValueDic.Add(int.Parse(legendAttrLvData[attrID][i][0].ToString()), int.Parse(legendAttrLvData[attrID][i][1].ToString()));
|
}
|
}
|
}
|
}
|
|
FuncConfigConfig wingsLegendAtrrCntPreview = Config.Instance.Get<FuncConfigConfig>("WingLegendAttrCountPreview");
|
JsonData wingsLegendAttrCntData = JsonMapper.ToObject(wingsLegendAtrrCntPreview.Numerical1);
|
wingsLegendAttrCntPreviewDict = new Dictionary<int, int>();
|
if (wingsLegendAttrCntData.IsArray)
|
{
|
for (int i = 0; i < wingsLegendAttrCntData.Count; i++)
|
{
|
JsonData data1 = wingsLegendAttrCntData[i];
|
if (wingsLegendAttrCntData[i].IsArray)
|
{
|
wingsLegendAttrCntPreviewDict.Add(int.Parse(wingsLegendAttrCntData[i][0].ToString())
|
, int.Parse(wingsLegendAttrCntData[i][1].ToString()));
|
}
|
}
|
}
|
|
FuncConfigConfig wingsLegendAtrrValuePreview = Config.Instance.Get<FuncConfigConfig>("WingLegendAttrValuePreview");
|
JsonData wingsLegendAttrValueData = JsonMapper.ToObject(wingsLegendAtrrValuePreview.Numerical1);
|
wingsLegendAttrValuePreviewDict = new Dictionary<int, Dictionary<int, List<int>>>();
|
foreach (var lv in wingsLegendAttrValueData.Keys)
|
{
|
Dictionary<int, List<int>> attrValueDic = new Dictionary<int, List<int>>();
|
wingsLegendAttrValuePreviewDict.Add(int.Parse(lv.ToString()),attrValueDic);
|
foreach(var attrId in wingsLegendAttrValueData[lv].Keys)
|
{
|
List<int> attrValuelist = new List<int>();
|
attrValueDic.Add(int.Parse(attrId.ToString()),attrValuelist);
|
if(wingsLegendAttrValueData[lv][attrId].IsArray)
|
{
|
for(int i = 0;i < wingsLegendAttrValueData[lv][attrId].Count; i++)
|
{
|
attrValuelist.Add(int.Parse(wingsLegendAttrValueData[lv][attrId][i].ToString()));
|
}
|
}
|
}
|
}
|
|
|
guardDesDict = new Dictionary<int, List<string>>();
|
FuncConfigConfig guardDesFunc = Config.Instance.Get<FuncConfigConfig>("GuardianTips");
|
FuncConfigConfig guardAutoDropFunc = Config.Instance.Get<FuncConfigConfig>("GuardianPickUpID");
|
guardAutoDrops = ConfigParse.GetMultipleStr<int>(guardAutoDropFunc.Numerical1);
|
JsonData guardDesData = JsonMapper.ToObject(guardDesFunc.Numerical1);
|
foreach (var key in guardDesData.Keys)
|
{
|
List<string> list = new List<string>();
|
for (int i = 0; i < guardDesData[key].Count; i++)
|
{
|
list.Add(guardDesData[key][i].ToString());
|
}
|
guardDesDict.Add(int.Parse(key), list);
|
}
|
|
gemOpenLvs = null;
|
gemOpenVipLv = 0;
|
FuncConfigConfig gemOpenModel = Config.Instance.Get<FuncConfigConfig>("GemOpen");
|
FuncConfigConfig gemOpenVipModel = Config.Instance.Get<FuncConfigConfig>("GemOpenVip");
|
gemOpenLvs = ConfigParse.GetMultipleStr<int>(gemOpenModel.Numerical1);
|
gemOpenVipLv = int.Parse(gemOpenVipModel.Numerical1);
|
FuncConfigConfig gemtype1 = Config.Instance.Get<FuncConfigConfig>("GemType1");
|
gemType1s = ConfigParse.GetMultipleStr<int>(gemtype1.Numerical1);
|
FuncConfigConfig gemtype2 = Config.Instance.Get<FuncConfigConfig>("GemType2");
|
gemType2s = ConfigParse.GetMultipleStr<int>(gemtype2.Numerical1);
|
|
FuncConfigConfig equipMidFunc = Config.Instance.Get<FuncConfigConfig>("EquipPartLength");
|
equipMidHeights = ConfigParse.GetMultipleStr<int>(equipMidFunc.Numerical1);
|
FuncConfigConfig wingsMidFunc = Config.Instance.Get<FuncConfigConfig>("WingsPartLength");
|
wingsMidHeights = ConfigParse.GetMultipleStr<int>(wingsMidFunc.Numerical1);
|
|
FuncConfigConfig expFormula = Config.Instance.Get<FuncConfigConfig>("ExpValueDes");
|
expValueFormula = expFormula.Numerical1;
|
|
#region 灵宠坐骑解锁
|
unlockPetDict = new Dictionary<int, PetInfoConfig>();
|
petSkillDict.Clear();
|
List<PetInfoConfig> petInfolist = Config.Instance.GetAllValues<PetInfoConfig>();
|
for(int i = 0;i < petInfolist.Count; i++)
|
{
|
if(!unlockPetDict.ContainsKey(petInfolist[i].UnLockNeedItemID))
|
{
|
unlockPetDict.Add(petInfolist[i].UnLockNeedItemID,petInfolist[i]);
|
}
|
Dictionary<int, int> skillDict = new Dictionary<int, int>();
|
petSkillDict.Add(petInfolist[i].ID,skillDict);
|
int[] skillIds = ConfigParse.GetMultipleStr<int>(petInfolist[i].SkillID);
|
int[] skillUnlocks = ConfigParse.GetMultipleStr<int>(petInfolist[i].SkillUnLock);
|
if(skillIds != null)
|
{
|
for (int j = 0; j < skillIds.Length; j++)
|
{
|
skillDict.Add(skillUnlocks[j], skillIds[j]);
|
}
|
}
|
}
|
unlockMountDict = new Dictionary<int, HorseConfig>();
|
mountSkillDict.Clear();
|
List<HorseConfig> horselist = Config.Instance.GetAllValues<HorseConfig>();
|
for(int i = 0; i < horselist.Count; i++)
|
{
|
if (!unlockMountDict.ContainsKey(horselist[i].UnlockItemID))
|
{
|
unlockMountDict.Add(horselist[i].UnlockItemID, horselist[i]);
|
}
|
Dictionary<int,List<int>> skillDict = new Dictionary<int, List<int>>();
|
mountSkillDict.Add(horselist[i].HorseID, skillDict);
|
List<HorseUpConfig> mountlist = HorseUpConfig.GetMountlistById(horselist[i].HorseID);
|
if(mountlist != null)
|
{
|
for(int j = 0; j < mountlist.Count; j++)
|
{
|
int[] skills = mountlist[j].SkillID;
|
List<int> skilllist = new List<int>();
|
if(skills != null)
|
{
|
for (int k = 0; k < skills.Length; k++)
|
{
|
if (skills[k] != 0)
|
{
|
skilllist.Add(skills[k]);
|
skillDict.Add(mountlist[j].LV, skilllist);
|
}
|
}
|
}
|
}
|
}
|
}
|
#endregion
|
|
FuncConfigConfig randomRuneConfig = Config.Instance.Get<FuncConfigConfig>("RandomRuneIDList");
|
randomRuneIds = ConfigParse.GetMultipleStr<int>(randomRuneConfig.Numerical1);
|
|
FuncConfigConfig petQuality = Config.Instance.Get<FuncConfigConfig>("PetQuality");
|
int[] qualitys = ConfigParse.GetMultipleStr<int>(petQuality.Numerical1);
|
string[] qualityNames = ConfigParse.GetMultipleStr(petQuality.Numerical2);
|
if (qualitys != null && qualityNames != null
|
&& qualitys.Length == qualityNames.Length)
|
{
|
for(int i = 0; i < qualitys.Length; i++)
|
{
|
petAndMountQualityDict.Add(qualitys[i],qualityNames[i]);
|
}
|
}
|
|
}
|
|
public void OnBeforePlayerDataInitialize()
|
{
|
|
}
|
|
public override void UnInit()
|
{
|
|
}
|
|
/// <summary>
|
/// 刷新脱机外挂时间
|
/// </summary>
|
/// <param name="refresh"></param>
|
private void RefreshOfflinePluginTime(PlayerDataRefresh refresh)
|
{
|
if (refresh != PlayerDataRefresh.HappyPoint) return;
|
|
HangUpSetModel.Instance.SetOfflinePluginTime(m_storeModel.GetTCBPlayerData(refresh));
|
}
|
|
public ItemAttrData curAttrData { get; private set; }
|
public ItemAttrData compareAttrData { get; private set; }
|
|
/// <summary>
|
///从背包类型中得到物品展示
|
/// </summary>
|
public void SetItemTipsModel(PackType type,string guid,bool isShowUINow = true,bool isCompare = false,ItemTipChildType childType = ItemTipChildType.Normal)
|
{
|
curAttrData = null;
|
compareAttrData = null;
|
curTips = null;
|
compareTips = null;
|
ItemModel itemModel = playerPack.GetItemModelByGUID(guid);
|
if (itemModel != null)
|
{
|
curAttrData = new ItemAttrData(itemModel.itemInfo.ItemID,false, (ulong)itemModel.itemInfo.ItemCount
|
, itemModel.itemInfo.ItemPlace, itemModel.itemInfo.IsBind,isCompare
|
, type, guid, ConfigParse.Analysis(itemModel.itemInfo.UserData),childType);
|
|
if (isCompare)
|
{
|
if(type != PackType.rptDogzItem)
|
{
|
SetCompareAttrData(PackType.rptEquip, itemModel.chinItemModel.EquipPlace);
|
}
|
else
|
{
|
SetCompareAttrData(PackType.rptDogzEquip, itemModel.chinItemModel.EquipPlace);
|
}
|
|
}
|
}
|
|
if(isShowUINow)
|
{
|
ShowUICtrl();
|
}
|
}
|
|
/// <summary>
|
/// 预览物品信息
|
/// </summary>
|
/// <param name="itemAttrData"></param>
|
public void SetItemTipsModel(ItemAttrData itemAttrData,bool isShowUINow = true)
|
{
|
compareAttrData = null;
|
curTips = null;
|
compareTips = null;
|
curAttrData = itemAttrData;
|
if (itemAttrData == null) return;
|
|
if (itemAttrData.isCompare)
|
{
|
if (itemAttrData.packType != PackType.rptDogzItem)
|
{
|
SetCompareAttrData(PackType.rptEquip, itemAttrData.itemConfig.EquipPlace);
|
}
|
else
|
{
|
SetCompareAttrData(PackType.rptDogzEquip, itemAttrData.itemConfig.EquipPlace);
|
}
|
}
|
|
if (isShowUINow)
|
{
|
ShowUICtrl();
|
}
|
}
|
|
public void SetCurrentAttrData(ItemModel itemModel,bool isCompare )
|
{
|
curAttrData = new ItemAttrData(itemModel.itemInfo.ItemID, false, (ulong)itemModel.itemInfo.ItemCount
|
, itemModel.itemInfo.ItemPlace, itemModel.itemInfo.IsBind, isCompare
|
, itemModel.packType, itemModel.itemInfo.ItemGUID, ConfigParse.Analysis(itemModel.itemInfo.UserData),ItemTipChildType.Normal);
|
}
|
|
|
public void SetCompareAttrData(ItemModel itemModel)
|
{
|
compareAttrData = new ItemAttrData(itemModel.itemInfo.ItemID, false, (ulong)itemModel.itemInfo.ItemCount
|
, itemModel.itemInfo.ItemPlace, itemModel.itemInfo.IsBind, true
|
, itemModel.packType, itemModel.itemInfo.ItemGUID, ConfigParse.Analysis(itemModel.itemInfo.UserData));
|
}
|
|
private void SetCompareAttrData(PackType type,int equipPlace)
|
{
|
compareAttrData = null;
|
ItemModel itemModel = null;
|
switch (type)
|
{
|
case PackType.rptEquip:
|
itemModel = playerPack.GetItemModelByIndex(type, equipPlace);
|
break;
|
case PackType.rptDogzEquip:
|
var dogzModel = ModelCenter.Instance.GetModel<DogzModel>();
|
dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz,equipPlace,out itemModel);
|
break;
|
}
|
|
if (itemModel == null) return;
|
|
if (equipPlace == (int)RoleEquipType.retFairyCan)
|
{
|
ItemModel fairyModel2 = playerPack.GetItemModelByIndex(type,(int)RoleEquipType.retFairyCan2);
|
if (fairyModel2 != null)
|
{
|
if (itemModel != null)
|
{
|
if (fairyModel2.equipScore < itemModel.equipScore)
|
{
|
itemModel = fairyModel2;
|
}
|
}
|
}
|
else
|
{
|
itemModel = fairyModel2;
|
}
|
}
|
if (itemModel != null)
|
{
|
compareAttrData = new ItemAttrData(itemModel.itemInfo.ItemID, false, (ulong)itemModel.itemInfo.ItemCount
|
, itemModel.itemInfo.ItemPlace, itemModel.itemInfo.IsBind, true
|
, type,itemModel.itemInfo.ItemGUID, ConfigParse.Analysis(itemModel.itemInfo.UserData));
|
|
}
|
}
|
|
public void ShowUICtrl()
|
{
|
if (curAttrData == null) return;
|
|
#if UNITY_EDITOR
|
string itemInfo = StringUtility.Contact("物品ID:",curAttrData.itemId,"物品名称:",curAttrData.itemConfig.ItemName);
|
DebugEx.Log(itemInfo);
|
#endif
|
|
switch (curAttrData.winType)
|
{
|
case ItemWinType.itemWin:
|
WindowCenter.Instance.Open<ItemInfoWin>();
|
break;
|
case ItemWinType.boxWin:
|
WindowCenter.Instance.Open<BoxInfoWin>();
|
break;
|
case ItemWinType.equipWin:
|
WindowCenter.Instance.Open<EquipWin>();
|
break;
|
case ItemWinType.wingsWin:
|
WindowCenter.Instance.Open<WingsWin>();
|
break;
|
case ItemWinType.guardWin:
|
WindowCenter.Instance.Open<GuardianWin>();
|
break;
|
case ItemWinType.BuyItemWin:
|
WindowCenter.Instance.Open<BuyItemInfoWin>();
|
break;
|
case ItemWinType.buyBoxWin:
|
WindowCenter.Instance.Open<BuyBoxInfoWin>();
|
break;
|
case ItemWinType.petMatWin:
|
WindowCenter.Instance.Open<PetMatInfoWin>();
|
break;
|
case ItemWinType.buyPetMatWin:
|
WindowCenter.Instance.Open<BuyPetMatInfoWin>();
|
break;
|
}
|
}
|
|
private StringBuilder attrSB = new StringBuilder();
|
private PlayerPropertyConfig playerProModel;
|
|
|
#region 设置装备基础信息
|
/// <summary>
|
/// 得到弹框标题
|
/// </summary>
|
/// <returns></returns>
|
public string GetItemTipsTitle(ItemAttrData attrData)
|
{
|
string equipName = "";
|
if (attrData == null) return equipName;
|
|
List<int> useDatalist = attrData.GetUseDataModel(30);
|
if (useDatalist != null)
|
{
|
if (useDatalist[0] == 1)
|
{
|
equipName = Language.Get("EquipSuit109");
|
}
|
else if (useDatalist[0] == 2)
|
{
|
equipName = Language.Get("EquipSuit110");
|
}
|
}
|
|
if (attrData.StrengthLV > 0)
|
{
|
equipName = StringUtility.Contact(equipName, attrData.itemConfig.ItemName, "+", attrData.StrengthLV);
|
}
|
else
|
{
|
equipName = StringUtility.Contact(equipName, attrData.itemConfig.ItemName);
|
}
|
return equipName;
|
}
|
|
/// <summary>
|
/// 得到装备的职业
|
/// </summary>
|
/// <param name="attrData"></param>
|
/// <returns></returns
|
string jobName = "";
|
public string GetEquipJobName(ItemAttrData attrData)
|
{
|
|
jobName = "";
|
if (attrData == null) return jobName;
|
|
string playerJob = StringUtility.Contact(PlayerDatas.Instance.baseData.Job, "0", PlayerDatas.Instance.baseData.ExAttr1);
|
if (!attrData.isHavePutLimit)
|
{
|
SetJobName(attrData, int.Parse(playerJob), attrData.itemConfig.JobLimit);
|
}
|
else
|
{
|
double job = Math.Floor((double)attrData.itemConfig.JobLimit / 100) * 100 + 1;
|
SetJobName(attrData, int.Parse(playerJob), (int)job);
|
}
|
|
return jobName;
|
}
|
|
private void SetJobName(ItemAttrData attrData, int playerJob, int equipJob)
|
{
|
if (attrData.itemConfig.JobLimit != 0)
|
{
|
JobNameConfig jobNameConfig = Config.Instance.Get<JobNameConfig>(attrData.itemConfig.JobLimit);
|
if (playerJob >= equipJob)
|
{
|
jobName = UIHelper.GetTextColorByItemColor(TextColType.White, jobNameConfig.name);
|
}
|
else
|
{
|
jobName = UIHelper.GetTextColorByItemColor(TextColType.Red, jobNameConfig.name);
|
}
|
|
}
|
else
|
{
|
jobName = UIHelper.GetTextColorByItemColor(TextColType.White, Language.Get("StoreWin110"));
|
}
|
}
|
|
#endregion
|
|
#region 设置弹框按钮
|
|
/// <summary>
|
/// 设置背包的弹框按钮
|
/// </summary>
|
/// <param name="attrData"></param>
|
public void SetBagTipsBtn(ItemAttrData attrData)
|
{
|
if (attrData == null) return;
|
|
bool isOverdue = modelInterface.IsOverdue(attrData.guid,attrData.itemId,attrData.useDataDict);
|
|
if (attrData.itemConfig.CanSell == 1)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.sell, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendSellQuest(ItemWinBtnType.sell,attrData); });
|
}
|
|
List<int> dismantleReturnlist = attrData.GetUseDataModel((int)ItemUseDataKey.Def_IudetItemDecompound);
|
if (dismantleReturnlist != null && dismantleReturnlist.Count > 0)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.dismantle, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendDismantleQuest(ItemWinBtnType.dismantle, attrData); });
|
}
|
|
if (!isOverdue)
|
{
|
if(attrData.itemConfig.JumpComposeCondi != null && attrData.itemConfig.JumpComposeCondi.Length > 0)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.compose, (ItemWinBtnType, ItemAttrData) => {
|
int jumpId = 0;
|
bool isUnlock = ModelCenter.Instance.GetModel<ComposeWinModel>().CheckComposeItemById(attrData.itemId,out jumpId);
|
if (isUnlock)
|
{
|
PackSendQuestMgr.Instance.ClickComposeBtn(ItemWinBtnType.compose,jumpId);
|
}
|
});
|
}
|
|
if (attrData.itemConfig.Type == 25 && attrData.itemConfig.Effect1 == 225)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.inlay, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.ClickInlayBtn(ItemWinBtnType.inlay, attrData.guid); });
|
}
|
|
if (attrData.itemConfig.CanTrade == 1 && attrData.isBind == 0)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.putAway, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutAwayQuest(ItemWinBtnType.putAway, attrData.guid); });
|
}
|
|
if((ItemType)attrData.itemConfig.Type == ItemType.WingsMat)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.refine, (ItemWinBtnType, ItemAttrData) =>
|
{
|
// BoxGetItemModel.Instance.SetModel(attrData.guid);
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StrengthFunc3);
|
});
|
|
}
|
}
|
|
if (attrData.count > 1)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.split, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.OnClickSplitBtn(ItemWinBtnType.split, attrData.guid); });
|
}
|
|
if(!isOverdue)
|
{
|
switch (attrData.winType)
|
{
|
case ItemWinType.equipWin:
|
case ItemWinType.wingsWin:
|
case ItemWinType.guardWin:
|
attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn, attrData.guid); });
|
break;
|
}
|
|
if (attrData.itemConfig.UseTag == 1)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.makeUse, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendUseItemQuest(ItemWinBtnType.makeUse, attrData.index); });
|
}
|
}
|
|
for (int i = 0; i < ItemRenewalIds.Length; i++)
|
{
|
if (ItemRenewalIds[i] == attrData.itemId)
|
{
|
if(isOverdue)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.renewal, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendRenewalQuest(ItemWinBtnType.renewal, attrData.guid); });
|
}
|
}
|
}
|
|
for (int i = 0; i < tryPutOnEquipIds.Length; i++)
|
{
|
if (tryPutOnEquipIds[i] == attrData.itemId)
|
{
|
if(PlayerDatas.Instance.baseData.coinPointTotal <= 0)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.renewal, (ItemWinBtnType, ItemAttrData) => { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FirstRecharge); });
|
}
|
}
|
}
|
}
|
|
/// <summary>
|
/// 设置仓库弹框按钮
|
/// </summary>
|
/// <param name="attrData"></param>
|
public void SetDepotTipsBtn(ItemAttrData attrData)
|
{
|
if (attrData == null) return;
|
|
attrData.SetTipsFuncBtn(ItemWinBtnType.putOut, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutOutQuest(ItemWinBtnType.putOut,attrData.guid); });
|
|
}
|
|
public void SetDogzItemBtn(ItemAttrData attrData)
|
{
|
if (attrData == null) return;
|
|
if (attrData.itemConfig.CanSell == 1)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.sell, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendSellQuest(ItemWinBtnType.sell, attrData); });
|
}
|
|
switch (attrData.winType)
|
{
|
case ItemWinType.equipWin:
|
attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => {
|
if(dogzModel.CheckIsPutOn(attrData.itemId))
|
{
|
List<int> indexlist = new List<int>();
|
indexlist.Add(attrData.index);
|
dogzModel.SendPutOnEquip(indexlist);
|
}
|
|
});
|
break;
|
}
|
}
|
|
public void SetDogzEquipBtn(ItemAttrData attrData)
|
{
|
if (attrData == null) return;
|
|
attrData.SetTipsFuncBtn(ItemWinBtnType.putOff, (ItemWinBtnType, ItemAttrData) => {
|
dogzModel.CheckPutOff(dogzModel.GetDogzEquipPlaceByIndex(attrData.index));
|
});
|
|
if(dogzModel.TryGetAssistDogzState(dogzModel.presentSelectDogz))
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.strength, (ItemWinBtnType, ItemAttrData) => {
|
dogzModel.OpenDogzFuncEvent(1, attrData.index);
|
});
|
}
|
|
}
|
|
/// <summary>
|
/// 设置仓库弹框按钮
|
/// </summary>
|
/// <param name="attrData"></param>
|
public void SetDepotBagTipsBtn(ItemAttrData attrData)
|
{
|
if (attrData == null) return;
|
|
attrData.SetTipsFuncBtn(ItemWinBtnType.putIn, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutInQuest(ItemWinBtnType.putIn, attrData.guid); });
|
|
}
|
|
/// <summary>
|
/// 设置装备弹框按钮
|
/// </summary>
|
/// <param name="attrData"></param>
|
public void SetPutOnTipsBtn(ItemAttrData attrData)
|
{
|
if (attrData == null) return;
|
|
RoleEquipType equipType = (RoleEquipType)attrData.itemConfig.EquipPlace;
|
if(equipType == RoleEquipType.retWing)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.refine, (ItemWinBtnType, ItemAttrData) => {
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StrengthFunc3);
|
});
|
}
|
else if(equipType != RoleEquipType.retSpiritAnimal)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.strength, (ItemWinBtnType, ItemAttrData) => {
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StrengthFunc1);
|
});
|
}
|
|
attrData.SetTipsFuncBtn(ItemWinBtnType.putOff,(ItemWinBtnType,ItemAttrData) => {
|
PackSendQuestMgr.Instance.SendPutOffQuest(ItemWinBtnType.putOff, attrData.guid);
|
});
|
|
for (int i = 0; i < tryPutOnEquipIds.Length; i++)
|
{
|
if (tryPutOnEquipIds[i] == attrData.itemId)
|
{
|
if (PlayerDatas.Instance.baseData.coinPointTotal <= 0)
|
{
|
attrData.SetTipsFuncBtn(ItemWinBtnType.renewal, (ItemWinBtnType, ItemAttrData) => { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FirstRecharge); });
|
}
|
}
|
}
|
}
|
#endregion
|
|
#region 设置获取途径列表
|
private List<GetItemWaysConfig> getWayslist = new List<GetItemWaysConfig>();
|
public List<GetItemWaysConfig> GetWaysList(ItemAttrData attrData)
|
{
|
getWayslist.Clear();
|
if (attrData == null) return getWayslist;
|
|
int[] waysArray = attrData.itemConfig.GetWay;
|
if (waysArray != null)
|
{
|
int i = 0;
|
for (i = 0; i < waysArray.Length; i++)
|
{
|
GetItemWaysConfig itemWaysModel = Config.Instance.Get<GetItemWaysConfig>(waysArray[i]);
|
if (itemWaysModel != null)
|
{
|
getWayslist.Add(itemWaysModel);
|
}
|
}
|
}
|
|
return getWayslist;
|
}
|
#endregion
|
|
#region 设置基础属性
|
|
public string GetBasicAttr(ItemAttrData attrData)
|
{
|
switch ((RoleEquipType)attrData.itemConfig.EquipPlace)
|
{
|
case RoleEquipType.retWing:
|
return SetWingsBasicAttr(attrData);
|
case RoleEquipType.retSpiritAnimal:
|
return SetGuardBasicAttr(attrData);
|
default:
|
return SetEquipBasicAttr(attrData);
|
}
|
}
|
|
private string SetEquipBasicAttr(ItemAttrData attrData)
|
{
|
if (attrData == null)
|
return "";
|
|
Dictionary<int, int> itemEffectDict = SetItemEffectDict(attrData.itemConfig);
|
attrSB.Length = 0;
|
string atkStr = "";
|
string otherStr = "";
|
foreach (var key in itemEffectDict.Keys)
|
{
|
PlayerPropertyConfig playerProModel = Config.Instance.Get<PlayerPropertyConfig>(key);
|
if (playerProModel != null)
|
{
|
if (key == (int)AttrEnum.MinAtk)
|
{
|
playerProModel = Config.Instance.Get<PlayerPropertyConfig>((int)AttrEnum.ATK);
|
atkStr = StringUtility.Contact(playerProModel.Name, ":", GetProValueTypeStr(playerProModel, itemEffectDict[key]));
|
}
|
else if (key == (int)AttrEnum.MaxAtk)
|
{
|
playerProModel = Config.Instance.Get<PlayerPropertyConfig>((int)AttrEnum.ATK);
|
atkStr = StringUtility.Contact(atkStr, "-", GetProValueTypeStr(playerProModel, itemEffectDict[key]));
|
if (attrData.strengthDataDict != null)
|
{
|
if (attrData.strengthDataDict.ContainsKey((int)AttrEnum.ATK))
|
{
|
atkStr = StringUtility.Contact(atkStr, Language.Get("KnapS116", GetProValueTypeStr(playerProModel, attrData.strengthDataDict[(int)AttrEnum.ATK])));
|
}
|
}
|
if (attrSB.Length <= 0)
|
{
|
attrSB.Append(atkStr);
|
}
|
else
|
{
|
attrSB.Append("\n" + atkStr);
|
}
|
|
}
|
else
|
{
|
otherStr = StringUtility.Contact(playerProModel.Name, ":", GetProValueTypeStr(playerProModel, itemEffectDict[key]));
|
if (attrData.strengthDataDict != null)
|
{
|
if (attrData.strengthDataDict.ContainsKey(key))
|
{
|
otherStr = StringUtility.Contact(otherStr, Language.Get("KnapS116", GetProValueTypeStr(playerProModel, attrData.strengthDataDict[key])));
|
}
|
}
|
|
if (attrSB.Length <= 0)
|
{
|
attrSB.Append(otherStr);
|
}
|
else
|
{
|
attrSB.Append("\n" + otherStr);
|
}
|
}
|
}
|
}
|
return attrSB.ToString();
|
}
|
|
private string SetWingsBasicAttr(ItemAttrData attrData)
|
{
|
if (attrData == null)
|
return "";
|
|
WingRefineAttrConfig wingRefine = WingRefineAttrConfig.GetWingRefineModel(attrData.itemConfig.LV);
|
if (wingRefine == null)
|
return "";
|
|
attrSB.Length = 0;
|
int maxHp = 0;
|
int maxHurt = 0;
|
int curHp = 0;
|
int curHurt = 0;
|
|
Dictionary<int, int> itemEffectDict = SetItemEffectDict(attrData.itemConfig);
|
Dictionary<int, int> wingAttrModelDict = ConfigParse.GetDic<int, int>(wingRefine.attrupper);
|
|
foreach (var key in itemEffectDict.Keys)
|
{
|
playerProModel = Config.Instance.Get<PlayerPropertyConfig>(key);
|
string rangeStr = "";
|
if (key == 23)
|
{
|
rangeStr = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, itemEffectDict[key]);
|
}
|
else if (key == 6)
|
{
|
if (wingAttrModelDict.ContainsKey(key))
|
{
|
maxHp = itemEffectDict[key] + wingAttrModelDict[key];
|
}
|
|
if (attrData.GetUseDataModel(42) != null)
|
{
|
curHp = itemEffectDict[key] + (int)attrData.strengthengmodel.BackpackWings(attrData.itemId, attrData.GetUseDataModel(42)[0])[1];
|
}
|
else
|
{
|
curHp = itemEffectDict[key];
|
}
|
|
rangeStr = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, curHp) + "[" + GetProValueTypeStr(playerProModel, itemEffectDict[key]) + "-" + GetProValueTypeStr(playerProModel, maxHp) + "]";
|
}
|
else if (key == 19)
|
{
|
if (wingAttrModelDict.ContainsKey(key))
|
{
|
maxHurt = itemEffectDict[key] + wingAttrModelDict[key];
|
}
|
|
if (attrData.GetUseDataModel(42) != null)
|
{
|
curHurt = itemEffectDict[key] + (int)attrData.strengthengmodel.BackpackWings(attrData.itemId, attrData.GetUseDataModel(42)[0])[0];
|
}
|
else
|
{
|
curHurt = itemEffectDict[key];
|
}
|
rangeStr = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, curHurt) + "[" + GetProValueTypeStr(playerProModel, itemEffectDict[key]) + "-" + GetProValueTypeStr(playerProModel, maxHurt) + "]";
|
}
|
|
if (rangeStr != "")
|
{
|
if (attrSB.Length <= 0)
|
{
|
attrSB.Append(rangeStr);
|
}
|
else
|
{
|
attrSB.Append("\n" + rangeStr);
|
}
|
|
}
|
}
|
|
return attrSB.ToString();
|
}
|
|
private string SetGuardBasicAttr(ItemAttrData attrData)
|
{
|
string s = "";
|
if (guardAutoDrops.Contains(attrData.itemId))
|
{
|
s = StringUtility.Contact(SetEquipBasicAttr(attrData), "\n", Language.Get("GuardTips101"));
|
}
|
else
|
{
|
s = SetEquipBasicAttr(attrData);
|
}
|
return s;
|
}
|
#endregion
|
|
#region 设置传奇属性
|
private Dictionary<int, int> attrDict = new Dictionary<int, int>();
|
|
public string GetLegendAttr(ItemAttrData attrData)
|
{
|
if (!attrData.isPreview)
|
{
|
return SetLegendAttr(attrData.legendDataDict.Keys.ToList(), attrData.legendDataDict.Values.ToList(),attrData.itemConfig);
|
}
|
else
|
{
|
return SetLegendAttr(attrData.legendDataDict.Keys.ToList(), attrData.legendDataDict.Values.ToList(),
|
attrData.itemConfig, true, attrData.isCustom);
|
}
|
}
|
|
public string GetEquipLegendAttrCntPreview(ItemAttrData attrData)
|
{
|
string s = "";
|
if (attrData.isCustom)
|
{
|
s = Language.Get("LegendAttPreview_MustTitle", attrData.legendDataDict.Count);
|
}
|
else
|
{
|
int attrCnt = 0;
|
string attrCntKey = StringUtility.Contact(attrData.itemConfig.ItemColor, attrData.itemConfig.StarLevel);
|
if (legendAttrCntPreviewDict.ContainsKey(attrCntKey))
|
{
|
foreach (var key in legendAttrCntPreviewDict[attrCntKey].Keys)
|
{
|
switch (key)
|
{
|
case LegendAttrType.Normal:
|
attrCnt += legendAttrCntPreviewDict[attrCntKey][key];
|
break;
|
case LegendAttrType.Pursuit:
|
attrCnt += legendAttrCntPreviewDict[attrCntKey][key];
|
break;
|
case LegendAttrType.Fixed:
|
attrCnt += legendAttrCntPreviewDict[attrCntKey][key];
|
break;
|
}
|
}
|
}
|
|
if (attrData.itemConfig.StarLevel > 2)
|
{
|
s = Language.Get("LegendAttPreview_MustTitle", attrCnt);
|
}
|
else
|
{
|
s = Language.Get("LegendAttPreview_MightTitle", attrCnt);
|
}
|
}
|
|
return s;
|
}
|
|
public string GetDogzLegendAttrCntPreview(ItemAttrData attrData)
|
{
|
string s = "";
|
if (attrData.isCustom)
|
{
|
s = Language.Get("LegendAttPreview_MustTitle", attrData.legendDataDict.Count);
|
}
|
else
|
{
|
int attrCnt = 0;
|
string attrCntKey = StringUtility.Contact(attrData.itemConfig.ItemColor, attrData.itemConfig.StarLevel);
|
if (dogzLegendAttrCntPreviewDict.ContainsKey(attrCntKey))
|
{
|
foreach (var key in dogzLegendAttrCntPreviewDict[attrCntKey].Keys)
|
{
|
switch (key)
|
{
|
case LegendAttrType.Normal:
|
attrCnt += dogzLegendAttrCntPreviewDict[attrCntKey][key];
|
break;
|
case LegendAttrType.Pursuit:
|
attrCnt += dogzLegendAttrCntPreviewDict[attrCntKey][key];
|
break;
|
case LegendAttrType.Fixed:
|
attrCnt += dogzLegendAttrCntPreviewDict[attrCntKey][key];
|
break;
|
}
|
}
|
}
|
|
if (attrData.itemConfig.StarLevel > 2)
|
{
|
s = Language.Get("LegendAttPreview_MustTitle", attrCnt);
|
}
|
else
|
{
|
s = Language.Get("LegendAttPreview_MightTitle", attrCnt);
|
}
|
}
|
|
return s;
|
}
|
|
public string GetWingsLegendAttrCntPreview(ItemAttrData attrData)
|
{
|
string s = "";
|
if (attrData.isCustom)
|
{
|
s = Language.Get("LegendAttPreview_MustTitle", attrData.legendDataDict.Count);
|
}
|
else
|
{
|
if (wingsLegendAttrCntPreviewDict.ContainsKey(attrData.itemConfig.LV))
|
{
|
int attrCnt = wingsLegendAttrCntPreviewDict[attrData.itemConfig.LV];
|
if (attrCnt > 1)
|
{
|
s = Language.Get("LegendAttPreview_MustTitle", attrCnt);
|
}
|
else
|
{
|
s = Language.Get("LegendAttPreview_MightTitle", attrCnt);
|
}
|
}
|
}
|
|
return s;
|
}
|
|
//即将丢弃
|
public string GetLegendAttr(List<int> idlist, List<int> valuelist,ItemConfig itemConfig)
|
{
|
return SetLegendAttr(idlist, valuelist,itemConfig);
|
}
|
|
//即将丢弃
|
public string GetPreviewLegendAttr(List<int> idlist, List<int> valuelist,ItemConfig itemConfig,bool isCustom)
|
{
|
return SetLegendAttr(idlist, valuelist, itemConfig,true,isCustom);
|
}
|
|
private string SetLegendAttr(List<int> idlist, List<int> valuelist,ItemConfig itemConfig,bool isPreview = false, bool isCustom = false)
|
{
|
if (idlist == null)
|
return "";
|
|
attrDict.Clear();
|
int i = 0;
|
attrSB.Length = 0;
|
|
for (i = 0; i < idlist.Count; i++)
|
{
|
attrDict.Add(idlist[i], valuelist[i]);
|
}
|
|
switch (itemConfig.EquipPlace)
|
{
|
case 11:
|
break;
|
case 1:
|
case 2:
|
case 3:
|
case 4:
|
case 5:
|
case 6:
|
case 7:
|
case 8:
|
case 9:
|
case 10:
|
case 12:
|
idlist.Sort(CompareLegendAttrType);
|
break;
|
case 101:
|
case 102:
|
case 103:
|
case 104:
|
case 105:
|
idlist.Sort(CompareDogzLegendAttrType);
|
break;
|
}
|
|
for (i = 0; i < idlist.Count; i++)
|
{
|
playerProModel = Config.Instance.Get<PlayerPropertyConfig>(idlist[i]);
|
if (playerProModel != null)
|
{
|
string s = "";
|
if (playerProModel.Name.Contains("%s"))
|
{
|
if(!isPreview)
|
{
|
s = playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[idlist[i]]));
|
}
|
else
|
{
|
if(itemConfig.EquipPlace != (int)RoleEquipType.retWing)
|
{
|
if (isCustom || itemConfig.StarLevel >= 3)
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[idlist[i]])));
|
}
|
else
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Might"), playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[idlist[i]])));
|
}
|
}
|
else
|
{
|
if(isCustom)
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[idlist[i]])));
|
}
|
else if(wingsLegendAttrCntPreviewDict.ContainsKey(itemConfig.LV))
|
{
|
int minValue = 0;
|
int maxValue = 0;
|
if(wingsLegendAttrValuePreviewDict.ContainsKey(itemConfig.LV))
|
{
|
if(wingsLegendAttrValuePreviewDict[itemConfig.LV].ContainsKey(idlist[i]))
|
{
|
List<int> attrValuelist = wingsLegendAttrValuePreviewDict[itemConfig.LV][idlist[i]];
|
minValue = attrValuelist[0];
|
maxValue = attrValuelist[attrValuelist.Count - 1];
|
}
|
}
|
if(wingsLegendAttrCntPreviewDict[itemConfig.LV] > 1)
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name.Replace("%s",StringUtility.Contact("[",GetProValueTypeStr(playerProModel,minValue),"~", StringUtility.Contact(GetProValueTypeStr(playerProModel,maxValue)), "]")));
|
}
|
else
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Might"), playerProModel.Name.Replace("%s", StringUtility.Contact("[",GetProValueTypeStr(playerProModel, minValue), "~", StringUtility.Contact(GetProValueTypeStr(playerProModel, maxValue)),"]")));
|
}
|
}
|
|
}
|
|
}
|
|
}
|
else
|
{
|
if(!isPreview)
|
{
|
s = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, attrDict[idlist[i]]);
|
}
|
else
|
{
|
if (itemConfig.EquipPlace != (int)RoleEquipType.retWing)
|
{
|
if (isCustom || itemConfig.StarLevel >= 3)
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name, "+", GetProValueTypeStr(playerProModel, attrDict[idlist[i]]));
|
}
|
else
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Might"), playerProModel.Name, "+", GetProValueTypeStr(playerProModel, attrDict[idlist[i]]));
|
}
|
}
|
else
|
{
|
if (isCustom)
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name,"+", GetProValueTypeStr(playerProModel, attrDict[idlist[i]]));
|
}
|
else if (wingsLegendAttrCntPreviewDict.ContainsKey(itemConfig.LV))
|
{
|
int minValue = 0;
|
int maxValue = 0;
|
if (wingsLegendAttrValuePreviewDict.ContainsKey(itemConfig.LV))
|
{
|
if (wingsLegendAttrValuePreviewDict[itemConfig.LV].ContainsKey(idlist[i]))
|
{
|
List<int> attrValuelist = wingsLegendAttrValuePreviewDict[itemConfig.LV][idlist[i]];
|
minValue = attrValuelist[0];
|
maxValue = attrValuelist[attrValuelist.Count - 1];
|
}
|
}
|
if (wingsLegendAttrCntPreviewDict[itemConfig.LV] > 1)
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name,"[+", StringUtility.Contact(GetProValueTypeStr(playerProModel, minValue), "~", StringUtility.Contact(GetProValueTypeStr(playerProModel, maxValue)),"]"));
|
}
|
else
|
{
|
s = StringUtility.Contact(Language.Get("LegendAttPreview_Might"), playerProModel.Name,"[+",StringUtility.Contact(GetProValueTypeStr(playerProModel, minValue), "~", StringUtility.Contact(GetProValueTypeStr(playerProModel, maxValue)),"]"));
|
}
|
}
|
|
}
|
|
}
|
|
}
|
|
switch (itemConfig.EquipPlace)
|
{
|
case 11:
|
foreach (var key in wingsLegendAttrColorDict.Keys)
|
{
|
if (key == idlist[i])
|
{
|
foreach (var key2 in wingsLegendAttrColorDict[key].Keys)
|
{
|
if (attrDict[idlist[i]] < key2)
|
{
|
s = string.Format("<color=#{0}>{1}</color>", wingsLegendAttrColorDict[key][key2], s);
|
break;
|
}
|
}
|
break;
|
}
|
}
|
break;
|
case 1:
|
case 2:
|
case 3:
|
case 4:
|
case 5:
|
case 6:
|
case 7:
|
case 8:
|
case 9:
|
case 10:
|
case 12:
|
s = GetTextColorByLegendType(GetLegendType(idlist[i]), s);
|
break;
|
case 101:
|
case 102:
|
case 103:
|
case 104:
|
case 105:
|
s = GetTextColorByLegendType(GetDogzLegendType(idlist[i]), s);
|
break;
|
}
|
|
if (attrSB.Length <= 0)
|
{
|
attrSB.Append(s);
|
}
|
else
|
{
|
attrSB.Append("\n" + s);
|
}
|
|
}
|
}
|
return attrSB.ToString();
|
}
|
|
private int CompareLegendAttrType(int start, int end)
|
{
|
int type1 = GetLegendType(start);
|
int type2 = GetLegendType(end);
|
if (type1.CompareTo(type2) != 0) return type1.CompareTo(type2);
|
|
return 0;
|
}
|
|
private int CompareDogzLegendAttrType(int start, int end)
|
{
|
int type1 = GetDogzLegendType(start);
|
int type2 = GetDogzLegendType(end);
|
if (type1.CompareTo(type2) != 0) return type1.CompareTo(type2);
|
|
return 0;
|
}
|
|
private int GetLegendType(int id)
|
{
|
foreach (var key in equipLegendAttrTypeDict.Keys)
|
{
|
if (equipLegendAttrTypeDict[key].Contains(id))
|
{
|
return key;
|
}
|
}
|
return 0;
|
}
|
|
private int GetDogzLegendType(int id)
|
{
|
foreach (var key in dogzLegendAttrTypeDict.Keys)
|
{
|
if (dogzLegendAttrTypeDict[key].Contains(id))
|
{
|
return key;
|
}
|
}
|
return 0;
|
}
|
|
private string GetTextColorByLegendType(int type, string msg)
|
{
|
switch (type)
|
{
|
case 1:
|
return string.Format("<color=#fedd00>{0}</color>", msg);
|
case 2:
|
return string.Format("<color=#ec4bf6>{0}</color>", msg);
|
case 3:
|
return string.Format("<color=#31cefb>{0}</color>", msg);
|
|
}
|
return msg;
|
}
|
#endregion
|
|
#region 设置翅膀精炼材料
|
public string GetWingsRefineMatStr(ItemAttrData attrData)
|
{
|
if (attrData.wingsRefineMatDict == null) return "";
|
|
attrSB.Length = 0;
|
foreach (var id in attrData.wingsRefineMatDict.Keys)
|
{
|
ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(id);
|
if(itemConfig != null)
|
{
|
string des = StringUtility.Contact(itemConfig.ItemName,"X",attrData.wingsRefineMatDict[id]);
|
if (attrSB.Length <= 0)
|
{
|
attrSB.Append(des);
|
}
|
else
|
{
|
attrSB.Append("\n" + des);
|
}
|
}
|
}
|
return attrSB.ToString();
|
}
|
#endregion
|
|
#region 设置洗练属性
|
public string GetWashAttr(ItemAttrData attrData)
|
{
|
if (attrData == null) return "";
|
|
attrSB.Length = 0;
|
if (attrData.washDataDict != null)
|
{
|
foreach (var attr in attrData.washDataDict.Keys)
|
{
|
playerProModel = Config.Instance.Get<PlayerPropertyConfig>(attr);
|
if (playerProModel != null)
|
{
|
string s = "";
|
if (playerProModel.Name.Contains("%s"))
|
{
|
s = playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrData.washDataDict[attr]));
|
}
|
else
|
{
|
s = StringUtility.Contact(playerProModel.Name, "+", GetProValueTypeStr(playerProModel, attrData.washDataDict[attr]));
|
}
|
|
if (attrSB.Length <= 0)
|
{
|
attrSB.Append(s);
|
}
|
else
|
{
|
attrSB.Append("\n" + s);
|
}
|
|
}
|
|
}
|
}
|
return attrSB.ToString();
|
}
|
#endregion
|
|
#region 设置绝版属性
|
public string GetExhaustedAtrr(ItemAttrData attrData)
|
{
|
return SetExhaustedAttr(attrData.exhaustedMaxDataDict.Keys.ToList(),attrData.exhaustedMaxDataDict.Values.ToList());
|
}
|
|
//即将丢弃
|
public string GetEquipExhaustedAtrr(List<int> idlist, List<int> valuelist)
|
{
|
return SetExhaustedAttr(idlist, valuelist);
|
}
|
|
private string SetExhaustedAttr(List<int> idlist, List<int> valuelist)
|
{
|
if (idlist == null)
|
return "";
|
|
int i = 0;
|
attrSB.Length = 0;
|
for (i = 0; i < idlist.Count; i++)
|
{
|
playerProModel = Config.Instance.Get<PlayerPropertyConfig>(idlist[i]);
|
if (playerProModel != null)
|
{
|
string s = "";
|
switch ((AttrEnum)idlist[i])
|
{
|
case AttrEnum.OnlyFinalHurt:
|
s = Language.Get("EquipTip_ExtraDamage",GetExhaustedAttrValue(valuelist[i]),valuelist[i]);
|
break;
|
case AttrEnum.PVPAtkBackHP:
|
s = Language.Get("EquipTip_ExtraHpBack", GetExhaustedAttrValue(valuelist[i]), valuelist[i]);
|
break;
|
}
|
|
if (attrSB.Length <= 0)
|
{
|
attrSB.Append(s);
|
}
|
else
|
{
|
attrSB.Append("\n" + s);
|
}
|
|
}
|
}
|
return attrSB.ToString();
|
}
|
|
private int GetExhaustedAttrValue(int value)
|
{
|
Equation.Instance.Clear();
|
Equation.Instance.AddKeyValue("maxOOPValue",value);
|
Equation.Instance.AddKeyValue("lv", PlayerDatas.Instance.baseData.LV);
|
return Equation.Instance.Eval<int>(exhaustedFunc.Numerical1);
|
}
|
#endregion
|
|
public string GetProValueTypeStr(PlayerPropertyConfig playerproModel, int value)
|
{
|
string s = "";
|
if (playerproModel.ISPercentage == 0)
|
{
|
s = value.ToString();
|
}
|
else if (playerproModel.ISPercentage == 1)
|
{
|
s = (float)Math.Round(value / 100f, 1) + "%";
|
}
|
else if (playerproModel.ISPercentage == 2)
|
{
|
s = ((float)Math.Round(value / 100f, 1)).ToString();
|
}
|
return s;
|
}
|
|
public Dictionary<int, int> SetItemEffectDict(ItemConfig config)
|
{
|
Dictionary<int, int> itemEffectDict = new Dictionary<int, int>();
|
try
|
{
|
if (config.Effect1 != 0)
|
itemEffectDict.Add(config.Effect1, config.EffectValueA1);
|
if (config.Effect2 != 0)
|
itemEffectDict.Add(config.Effect2, config.EffectValueA2);
|
if (config.Effect3 != 0)
|
itemEffectDict.Add(config.Effect3, config.EffectValueA3);
|
if (config.Effect4 != 0)
|
itemEffectDict.Add(config.Effect4, config.EffectValueA4);
|
if (config.Effect5 != 0)
|
itemEffectDict.Add(config.Effect5, config.EffectValueA5);
|
|
}
|
catch (Exception ex)
|
{
|
DebugEx.Log(ex.ToString());
|
}
|
return itemEffectDict;
|
}
|
|
#region 设置弹框位置
|
private RectTransform curTips = null;
|
private RectTransform compareTips = null;
|
public void SetCurTips(RectTransform rect)
|
{
|
curTips = rect;
|
SetTipsPos();
|
}
|
public void SetCompareTips(RectTransform rect)
|
{
|
compareTips = rect;
|
SetTipsPos();
|
}
|
|
public void SetTipsPos()
|
{
|
if(compareAttrData == null)
|
{
|
if(curTips != null)
|
{
|
curTips.anchoredPosition3D = new Vector3(curTips.rect.width/2, curTips.rect.height / 2, 0);
|
}
|
}
|
else
|
{
|
if (curTips != null && compareTips != null)
|
{
|
if (curTips.rect.height >= compareTips.rect.height)
|
{
|
|
curTips.anchoredPosition3D = new Vector3(curTips.rect.width, curTips.rect.height / 2, 0);
|
compareTips.anchoredPosition3D = new Vector3(0, curTips.rect.height / 2, 0);
|
}
|
else
|
{
|
curTips.anchoredPosition3D = new Vector3(curTips.rect.width, compareTips.rect.height / 2, 0);
|
compareTips.anchoredPosition3D = new Vector3(0, compareTips.rect.height / 2, 0);
|
}
|
}
|
|
}
|
}
|
|
public void SetCommonTipPos(RectTransform rect)
|
{
|
float y = -750 / 2 + rect.sizeDelta.y / 2;
|
rect.anchoredPosition3D = new Vector3(rect.anchoredPosition3D.x, y, 0);
|
}
|
#endregion
|
|
#region 解锁背包格子数据
|
public int OpenCount
|
{
|
get; private set;
|
}
|
|
public PackType packType { get; private set; }
|
|
public int Index
|
{
|
get; private set;
|
}
|
|
public void SetExtendGirdModel(int openCount = 0, int index = -1, PackType type = PackType.rptDeleted)
|
{
|
this.OpenCount = openCount;
|
this.packType = type;
|
this.Index = index;
|
}
|
#endregion
|
|
#region 计算增加经验
|
public ulong GetAddExpValue(int timeValue,int maxExpLv)
|
{
|
PlayerLVConfig playerLVConfig = Config.Instance.Get<PlayerLVConfig>(PlayerDatas.Instance.baseData.LV);
|
PlayerLVConfig maxLvConfig = Config.Instance.Get<PlayerLVConfig>(maxExpLv);
|
int playerReExp = 0;
|
int maxReExp = 0;
|
if(playerLVConfig != null)
|
{
|
playerReExp = playerLVConfig.ReExp;
|
}
|
if(maxLvConfig != null)
|
{
|
maxReExp = maxLvConfig.ReExp;
|
}
|
Equation.Instance.Clear();
|
Equation.Instance.AddKeyValue("PlayerReExp",playerReExp);
|
Equation.Instance.AddKeyValue("MaxReExp", maxReExp);
|
Equation.Instance.AddKeyValue("TimeValue", timeValue);
|
return Equation.Instance.Eval<ulong>(expValueFormula);
|
}
|
#endregion
|
|
#region 设置宠物和坐骑数据
|
public Dictionary<int,int> GetPetSkillDict(int unlockId)
|
{
|
if(unlockPetDict.ContainsKey(unlockId))
|
{
|
if(petSkillDict.ContainsKey(unlockPetDict[unlockId].ID))
|
{
|
return petSkillDict[unlockPetDict[unlockId].ID];
|
}
|
}
|
return null;
|
}
|
|
public string GetQualityName(int quality)
|
{
|
string nameStr = string.Empty;
|
petAndMountQualityDict.TryGetValue(quality,out nameStr);
|
return nameStr;
|
}
|
|
public Dictionary<int,List<int>> GetMountSkillDict(int unlockId)
|
{
|
if(unlockMountDict.ContainsKey(unlockId))
|
{
|
if(mountSkillDict.ContainsKey(unlockMountDict[unlockId].HorseID))
|
{
|
return mountSkillDict[unlockMountDict[unlockId].HorseID];
|
}
|
}
|
|
return null;
|
}
|
|
public void SetPetAttrStr(int attrId,int attrValue,out string attrName,out string attrValueStr,string contanctStr = "")
|
{
|
attrName = "";
|
attrValueStr = "";
|
PlayerPropertyConfig playerProModel = null;
|
if (attrId == (int)AttrEnum.MaxAtk || attrId == (int)AttrEnum.PetMaxAtk)
|
{
|
playerProModel = Config.Instance.Get<PlayerPropertyConfig>((int)AttrEnum.ATK);
|
}
|
else
|
{
|
playerProModel = Config.Instance.Get<PlayerPropertyConfig>(attrId);
|
}
|
|
if (playerProModel != null)
|
{
|
attrName = playerProModel.Name;
|
if (contanctStr == "")
|
{
|
attrValueStr = GetProValueTypeStr(playerProModel, attrValue);
|
}
|
else
|
{
|
attrValueStr = StringUtility.Contact(contanctStr, "-", GetProValueTypeStr(playerProModel, attrValue));
|
}
|
}
|
}
|
#endregion
|
|
#region 设置物品使用的限制条件
|
#endregion
|
|
}
|
|
public class ItemAttrData
|
{
|
public PackType packType { get; private set; }
|
public string guid { get; private set; }
|
public int itemId { get; private set; }
|
public int index { get; private set; }
|
public ulong count { get; private set; }
|
public int isBind { get; private set; }
|
public int unionWarehouseScore { get; private set;}
|
public uint[] stones { get; private set; } //可镶嵌宝石数组 长度为0 未镶嵌 数值为0 未镶嵌
|
public int score { get; private set; }
|
public bool isCompare { get; private set;} //是否进行装备比较
|
public bool isPreview { get; private set; }//是否预览
|
public ItemConfig itemConfig { get; private set; }
|
public bool isCustom { get; private set; } //是否是定制物品
|
public ItemTipChildType ChildType { get; private set; } //决定当前面板打开哪个
|
public Dictionary<int, List<int>> useDataDict { get; private set;}
|
public Dictionary<int, int> strengthDataDict { get; private set; }
|
public Dictionary<int, int> washDataDict { get; private set; }
|
public Dictionary<int, int> legendDataDict { get; private set; }
|
public Dictionary<int, int> exhaustedMaxDataDict { get; private set; }
|
public Dictionary<int, int> wingsRefineMatDict { get; private set; }
|
public Dictionary<ItemWinBtnType,Action<ItemWinBtnType,string>> tipsFuncBtnDic { get; private set; }
|
|
public Dictionary<SuitType,ItemSuitAttrData> suitAttrDataDict { get; private set; }
|
public Dictionary<SuitType, int> suitTypeCntDict { get; private set; }
|
|
public bool isHavePutLimit { get; private set; }
|
PlayerStrengthengDatas m_StrengthengModel;
|
public PlayerStrengthengDatas strengthengmodel
|
{
|
get
|
{
|
return m_StrengthengModel ?? (m_StrengthengModel = ModelCenter.Instance.GetModel<PlayerStrengthengDatas>());
|
}
|
}
|
|
PackModelInterface _modelInterface;
|
PackModelInterface modelInterface
|
{
|
get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
}
|
|
EquipWashModel _washModel;
|
EquipWashModel washModel
|
{
|
get
|
{
|
return _washModel ?? (_washModel = ModelCenter.Instance.GetModel<EquipWashModel>());
|
}
|
}
|
|
ItemTipsModel _itemTipsModel;
|
ItemTipsModel itemTipsModel
|
{
|
get
|
{
|
return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
|
}
|
}
|
|
PlayerSuitModel _suitModel;
|
PlayerSuitModel SuitModel
|
{
|
get { return _suitModel ?? (_suitModel = ModelCenter.Instance.GetModel<PlayerSuitModel>()); }
|
}
|
|
RuneModel runeModel { get { return ModelCenter.Instance.GetModel<RuneModel>(); } }
|
GodBeastModel beastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
|
|
public ItemAttrData(int id,bool isPreview = false,ulong count = 0,int index = -1, int isBind = 0,bool isCompare = false,PackType type = PackType.rptDeleted, string guid = "", Dictionary<int, List<int>> useDataDict = null,ItemTipChildType childType = ItemTipChildType.Normal)
|
{
|
this.packType = type;
|
this.itemConfig = Config.Instance.Get<ItemConfig>(id);
|
this.tipsFuncBtnDic = new Dictionary<ItemWinBtnType, Action<ItemWinBtnType,string>>();
|
this.guid = guid;
|
this.itemId = id;
|
this.count = count;
|
this.index = index;
|
this.isBind = isBind;
|
this.isPreview = isPreview;
|
this.isCompare = isCompare;
|
this.useDataDict = useDataDict;
|
this.StrengthLV = 0;
|
this.ChildType = childType;
|
this.isCustom = false;
|
this.extraInfos = null;
|
isHavePutLimit = true;
|
this.isCustom = CheckIsCustomItem();
|
if(isCustom)
|
{
|
AppointItemConfig appointItemConfig = Config.Instance.Get<AppointItemConfig>(itemId);
|
if (appointItemConfig != null)
|
{
|
if (appointItemConfig.CancelUseLimit == 1)
|
{
|
isHavePutLimit = false;
|
}
|
SetCustomAttrData(appointItemConfig);
|
}
|
this.itemId = itemConfig.EffectValueA1;
|
this.itemConfig = Config.Instance.Get<ItemConfig>(this.itemId);
|
}
|
else
|
{
|
if (isPreview)
|
{
|
List<int> legendIdlist = null;
|
List<int> legendValuelist = null;
|
switch(itemConfig.EquipPlace)
|
{
|
case 11:
|
SetWingsLegendAttrPreview(out legendIdlist,out legendValuelist);
|
break;
|
case 1:
|
case 2:
|
case 3:
|
case 4:
|
case 5:
|
case 6:
|
case 7:
|
case 8:
|
case 9:
|
case 10:
|
case 12:
|
SetEquipLegendAttrPreview(out legendIdlist,out legendValuelist);
|
break;
|
case 101:
|
case 102:
|
case 103:
|
case 104:
|
case 105:
|
SetDogzEquipLegendAttrPreview(out legendIdlist, out legendValuelist);
|
break;
|
}
|
if(legendIdlist != null && legendValuelist != null)
|
{
|
if (legendIdlist.Count == legendValuelist.Count)
|
{
|
SetLegendData(legendIdlist, legendValuelist);
|
}
|
}
|
}
|
else
|
{
|
if (GetUseDataModel(20) != null)
|
{
|
if (GetUseDataModel(20)[0] == 1)
|
{
|
isHavePutLimit = false;
|
}
|
}
|
|
if (type == PackType.rptEquip)
|
{
|
Dictionary<int, EquipmentInitialization> p_strengInfoDict = strengthengmodel._EqInfo;
|
if (p_strengInfoDict.ContainsKey(index))
|
{
|
SetStrengthData(strengthengmodel.StrengthenTheCeiling(index), strengthengmodel.GameDefineIndex(index));
|
}
|
|
WashProCount washPro = washModel.GetWashEquipInfo(index);
|
if (washPro != null)
|
{
|
SetWashModel(washModel.OnGetWashType(index), washPro.XLAttrLV, washModel.WashProValues(index));
|
}
|
SetGemModel(PlayerStoneData.Instance.GetStoneInfo(index));
|
SetSuitData(itemId, index);
|
}
|
|
SetLegendData(GetUseDataModel(17), GetUseDataModel(19));
|
SetExhaustedData(GetUseDataModel(21), GetUseDataModel(23));
|
SetWingsRefineMat(GetUseDataModel((int)ItemUseDataKey.Def_IudetWingMaterialItemID), GetUseDataModel((int)ItemUseDataKey.Def_IudetWingMaterialItemCount));
|
}
|
}
|
this.score = modelInterface.SetEquipScore(type,id,useDataDict,isPreview);
|
PetEatEquipConfig petEatConfig = PetEatEquipConfig.GetEquipColorAndEquipClass(itemConfig.ItemColor,itemConfig.LV);//仙盟仓库装备积分兑换表
|
this.unionWarehouseScore = 0;
|
if(petEatConfig != null)
|
{
|
this.unionWarehouseScore = petEatConfig.integrate;
|
}
|
|
if(itemTipsModel.randomRuneIds.Contains(this.itemId))
|
{
|
Dictionary<int, List<int>> unlockRuneDict = runeModel.GetAllUnlockRuneIdlist();
|
List<string> extraInfos = new List<string>();
|
if(unlockRuneDict != null)
|
{
|
foreach(var key in unlockRuneDict.Keys)
|
{
|
int runeId = unlockRuneDict[key][0];
|
ItemConfig runeConfig = Config.Instance.Get<ItemConfig>(runeId);
|
string effectDes = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green, runeConfig.ItemName),":",Language.Get(StringUtility.Contact("RuneTypeDesc_",runeConfig.Effect1)));
|
extraInfos.Add(effectDes);
|
}
|
}
|
SetExtraInfos(extraInfos.ToArray());
|
}
|
|
if(type == PackType.rptDogzEquip || type == PackType.rptDogzItem)
|
{
|
strengthDataDict = new Dictionary<int, int>();
|
if (GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus) != null)
|
{
|
StrengthLV = GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus)[0];
|
}
|
Dictionary<int,int> getStregthDict = beastModel.SiteEnhancementAttribute(type,index);
|
foreach(var key in getStregthDict.Keys)
|
{
|
strengthDataDict.Add(key,getStregthDict[key]);
|
}
|
}
|
|
SetWinType();
|
}
|
|
public string[] extraInfos { get; private set; }
|
public void SetExtraInfos(params string[] extraInfos)
|
{
|
this.extraInfos = extraInfos;
|
}
|
|
private void SetWingsLegendAttrPreview(out List<int> legendIdlist, out List<int> legendValuelist)
|
{
|
legendIdlist = new List<int>();
|
legendValuelist = new List<int>();
|
if (itemTipsModel.wingsLegendAttrValuePreviewDict.ContainsKey(itemConfig.LV))
|
{
|
Dictionary<int, List<int>> attrIdDict = itemTipsModel.wingsLegendAttrValuePreviewDict[itemConfig.LV];
|
foreach (var attrId in attrIdDict.Keys)
|
{
|
legendIdlist.Add(attrId);
|
legendValuelist.Add(attrIdDict[attrId][0]);
|
}
|
|
}
|
}
|
|
private void SetEquipLegendAttrPreview(out List<int> legendIdlist, out List<int> legendValuelist)
|
{
|
legendIdlist = new List<int>();
|
legendValuelist = new List<int>();
|
string attrCntKey = StringUtility.Contact(itemConfig.ItemColor, itemConfig.StarLevel);
|
if (itemTipsModel.legendAttrIDPreviewDict.ContainsKey(itemConfig.EquipPlace))
|
{
|
foreach (var attrType in itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace].Keys)
|
{
|
int attrCnt = 0;
|
if (itemTipsModel.legendAttrCntPreviewDict.ContainsKey(attrCntKey))
|
{
|
attrCnt = itemTipsModel.legendAttrCntPreviewDict[attrCntKey][attrType];
|
}
|
if(attrCnt > 0)
|
{
|
switch (attrType)
|
{
|
case LegendAttrType.Pursuit:
|
legendIdlist.AddRange(itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace][attrType]);
|
break;
|
case LegendAttrType.Fixed:
|
legendIdlist.AddRange(itemTipsModel.legendAttrIDPreviewDict[itemConfig.EquipPlace][attrType]);
|
break;
|
}
|
}
|
|
}
|
}
|
int i = 0;
|
for (i = 0; i < legendIdlist.Count; i++)
|
{
|
if (itemTipsModel.legendAttrColorValuePreviewDict.ContainsKey(legendIdlist[i]))
|
{
|
if (itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.ItemColor))
|
{
|
legendValuelist.Add(itemTipsModel.legendAttrColorValuePreviewDict[legendIdlist[i]][itemConfig.ItemColor]);
|
}
|
}
|
else if (itemTipsModel.legendAttrLvValuePreviewDict.ContainsKey(legendIdlist[i]))
|
{
|
if (itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.LV))
|
{
|
legendValuelist.Add(itemTipsModel.legendAttrLvValuePreviewDict[legendIdlist[i]][itemConfig.LV]);
|
}
|
}
|
}
|
}
|
|
private void SetDogzEquipLegendAttrPreview(out List<int> legendIdlist, out List<int> legendValuelist)
|
{
|
legendIdlist = new List<int>();
|
legendValuelist = new List<int>();
|
if (itemTipsModel.dogzLegendAttrIDPreviewDict.ContainsKey(itemConfig.EquipPlace))
|
{
|
foreach (var attrType in itemTipsModel.dogzLegendAttrIDPreviewDict[itemConfig.EquipPlace].Keys)
|
{
|
switch (attrType)
|
{
|
case LegendAttrType.Pursuit:
|
legendIdlist.AddRange(itemTipsModel.dogzLegendAttrIDPreviewDict[itemConfig.EquipPlace][attrType]);
|
break;
|
case LegendAttrType.Fixed:
|
legendIdlist.AddRange(itemTipsModel.dogzLegendAttrIDPreviewDict[itemConfig.EquipPlace][attrType]);
|
break;
|
}
|
}
|
}
|
int i = 0;
|
for (i = 0; i < legendIdlist.Count; i++)
|
{
|
if (itemTipsModel.dogzLegendAttrColorValuePreviewDict.ContainsKey(legendIdlist[i]))
|
{
|
if (itemTipsModel.dogzLegendAttrColorValuePreviewDict[legendIdlist[i]].ContainsKey(itemConfig.ItemColor))
|
{
|
legendValuelist.Add(itemTipsModel.dogzLegendAttrColorValuePreviewDict[legendIdlist[i]][itemConfig.ItemColor]);
|
}
|
}
|
}
|
}
|
|
|
private StringBuilder _extraInfoBuider = new StringBuilder();
|
private StringBuilder _allInfoDesBuider = new StringBuilder();
|
public string GetExtraInfos()
|
{
|
_extraInfoBuider.Length = 0;
|
if (extraInfos == null)
|
return "";
|
|
int i = 0;
|
for (i = 0; i < extraInfos.Length; i++)
|
{
|
_extraInfoBuider.Append(extraInfos[i] + "\n");
|
}
|
return _extraInfoBuider.ToString();
|
}
|
|
public string GetAllInfoDes()
|
{
|
_allInfoDesBuider.Length = 0;
|
if (itemConfig == null)
|
return "";
|
|
if (itemTipsModel.randomRuneIds.Contains(itemConfig.ID))
|
{
|
return string.Format(itemConfig.Description, GetExtraInfos());
|
}
|
else
|
{
|
_allInfoDesBuider.Append(itemConfig.Description + "\n");
|
_allInfoDesBuider.Append(GetExtraInfos());
|
}
|
return _allInfoDesBuider.ToString();
|
}
|
|
/// <summary>
|
/// 设置强化数据
|
/// </summary>
|
private ItemPlusConfig itemPlus;
|
public int StrengthLV { get; private set; }
|
public void SetStrengthData(int lv, int type)
|
{
|
this.StrengthLV = lv;
|
strengthDataDict = null;
|
if (lv <= 0) return;
|
|
strengthDataDict = new Dictionary<int, int>();
|
itemPlus = ItemPlusConfig.GetTypeAndGrade(type,lv);
|
if (itemPlus != null)
|
{
|
int[] attrIDs = ConfigParse.GetMultipleStr<int>(itemPlus.attType);
|
int[] attrValues = ConfigParse.GetMultipleStr<int>(itemPlus.attValue);
|
int i = 0;
|
for (i = 0; i < attrIDs.Length; i++)
|
{
|
strengthDataDict.Add(attrIDs[i], attrValues[i]);
|
}
|
}
|
}
|
|
/// <summary>
|
/// 设置传奇属性数据
|
/// </summary>
|
/// <param name="ids"></param>
|
/// <param name="values"></param>
|
private void SetLegendData(List<int> ids, List<int> values)
|
{
|
legendDataDict = null;
|
if (ids == null || ids.Count < 1) return;
|
|
legendDataDict = new Dictionary<int, int>();
|
int i = 0;
|
for (i = 0; i < ids.Count; i++)
|
{
|
legendDataDict.Add(ids[i], values[i]);
|
}
|
}
|
|
|
private void SetWingsRefineMat(List<int> ids, List<int> nums)
|
{
|
wingsRefineMatDict = null;
|
if (ids == null || ids.Count < 1) return;
|
|
wingsRefineMatDict = new Dictionary<int, int>();
|
for(int i = 0; i < ids.Count;i++)
|
{
|
wingsRefineMatDict.Add(ids[i],nums[i]);
|
}
|
}
|
|
/// <summary>
|
/// 设置绝版属性数据
|
/// </summary>
|
/// <param name="ids"></param>
|
/// <param name="values"></param>
|
private void SetExhaustedData(List<int> ids, List<int> values)
|
{
|
exhaustedMaxDataDict = null;
|
if (ids == null || ids.Count < 1) return;
|
|
exhaustedMaxDataDict = new Dictionary<int, int>();
|
int i = 0;
|
for (i = 0; i < ids.Count; i++)
|
{
|
exhaustedMaxDataDict.Add(ids[i], values[i]);
|
}
|
|
}
|
|
/// <summary>
|
/// 设置弹框的洗练数据
|
/// </summary>
|
/// <param name="type"></param>
|
/// <param name="lv"></param>
|
/// <param name="values"></param>
|
private EquipWashConfig tagWashModel;
|
public void SetWashModel(int type, int lv, int[] values)
|
{
|
washDataDict = null;
|
bool isWash = false;
|
int i = 0;
|
for (i = 0; i < values.Length; i++)
|
{
|
if(values[i] > 0)
|
{
|
isWash = true;
|
break;
|
}
|
}
|
|
if(!isWash)
|
{
|
return;
|
}
|
|
washDataDict = new Dictionary<int, int>();
|
this.tagWashModel = EquipWashConfig.GetCurrentWashEquipModel(type, lv);
|
|
for (i = 0; i < values.Length; i++)
|
{
|
switch (i)
|
{
|
case 0:
|
washDataDict.Add(tagWashModel.attType1, values[0]);
|
break;
|
case 1:
|
washDataDict.Add(tagWashModel.attType2, values[1]);
|
break;
|
case 2:
|
washDataDict.Add(tagWashModel.attType3, values[2]);
|
break;
|
}
|
}
|
}
|
|
//设置弹框的宝石数据
|
public void SetGemModel(params uint[] stones)
|
{
|
this.stones = stones;
|
}
|
|
/// <summary>
|
/// 设置套装数据
|
/// </summary>
|
/// <param name="suitType"></param>
|
public void SetSuitData(int itemId,int equipPlace)
|
{
|
suitAttrDataDict = null;
|
suitTypeCntDict = null;
|
|
|
Dictionary<int,int> suitTypeDict = SuitModel.GetServerSuitModelByPlace(index);
|
if (suitTypeDict == null) return;
|
|
suitAttrDataDict = new Dictionary<SuitType, ItemSuitAttrData>();
|
suitTypeCntDict = new Dictionary<SuitType, int>();
|
int groupType = SuitModel.GetGroupType(index);
|
int equipJob = SuitModel.GetEquipJob(itemId);
|
foreach (var type in suitTypeDict.Keys)
|
{
|
bool isMaker = SuitModel.IsMakerSuit((SuitType)type,itemConfig.ItemColor,itemConfig.StarLevel);
|
|
if (suitTypeDict[type] > 0 && isMaker)
|
{
|
|
List<int> placelist = null;
|
int suitCnt = 0;
|
ItemSuitAttrData suitAttrData = default(ItemSuitAttrData);
|
if (this.itemConfig.LV < suitTypeDict[type])
|
{
|
suitAttrData = new ItemSuitAttrData(groupType, type, this.itemConfig.LV, equipJob);
|
suitCnt = SuitModel.GetSameSuitCnt((SuitType)type, equipPlace,this.itemConfig.LV, out placelist, equipJob);
|
}
|
else
|
{
|
suitAttrData = new ItemSuitAttrData(groupType, type, suitTypeDict[type], equipJob);
|
suitCnt = SuitModel.GetSameSuitCnt((SuitType)type, equipPlace, suitTypeDict[type], out placelist, equipJob);
|
}
|
suitAttrDataDict.Add((SuitType)type, suitAttrData);
|
suitTypeCntDict.Add((SuitType)type, suitCnt);
|
}
|
}
|
}
|
|
//设置其他玩家的套装数据
|
public void SetOtherSuitData(int itemId,int equipPlace,Dictionary<int,int> suitTypeDict,Dictionary<SuitType,int> suitCntDict)
|
{
|
this.suitAttrDataDict = null;
|
this.suitTypeCntDict = null;
|
if (suitTypeDict == null || suitCntDict == null) return;
|
|
suitAttrDataDict = new Dictionary<SuitType, ItemSuitAttrData>();
|
suitTypeCntDict = new Dictionary<SuitType, int>();
|
|
int groupType = SuitModel.GetGroupType(equipPlace);
|
int equipJob = SuitModel.GetEquipJob(itemId);
|
ItemConfig curConfig = Config.Instance.Get<ItemConfig>(itemId);
|
foreach (var type in suitTypeDict.Keys)
|
{
|
bool isMaker = SuitModel.IsMakerSuit((SuitType)type, curConfig.ItemColor, curConfig.StarLevel);
|
|
if (suitTypeDict[type] > 0 && isMaker)
|
{
|
|
List<int> placelist = null;
|
int suitCnt = 0;
|
ItemSuitAttrData suitAttrData = default(ItemSuitAttrData);
|
if (curConfig.LV < suitTypeDict[type])
|
{
|
suitAttrData = new ItemSuitAttrData(groupType, type, curConfig.LV, equipJob);
|
suitCnt = SuitModel.GetSameSuitCnt((SuitType)type, equipPlace, curConfig.LV, out placelist, equipJob);
|
}
|
else
|
{
|
suitAttrData = new ItemSuitAttrData(groupType, type, suitTypeDict[type], equipJob);
|
suitCnt = SuitModel.GetSameSuitCnt((SuitType)type, equipPlace, suitTypeDict[type], out placelist, equipJob);
|
}
|
suitAttrDataDict.Add((SuitType)type, suitAttrData);
|
this.suitTypeCntDict = suitCntDict;
|
}
|
}
|
}
|
|
public int GetSuitCntByType(SuitType suitType)
|
{
|
int cnt = 0;
|
if(this.suitTypeCntDict != null)
|
{
|
this.suitTypeCntDict.TryGetValue(suitType, out cnt);
|
}
|
return cnt;
|
}
|
|
#region 预览定制属性逻辑处理
|
public bool CheckIsCustomItem()
|
{
|
if (itemConfig == null) return false;
|
|
if (itemConfig.Effect1 == 220)
|
{
|
return true;
|
}
|
return false;
|
}
|
|
/// <summary>
|
/// 设置定制属性的数据
|
/// </summary>
|
private void SetCustomAttrData(AppointItemConfig appointItemConfig)
|
{
|
if (appointItemConfig == null)
|
return;
|
|
List<int> legendIdlist = null;
|
List<int> legendValuelist = null;
|
List<int> exhaustedIdlist = null;
|
List<int> exhaustedValuelist = null;
|
int i = 0;
|
if (appointItemConfig.LegendAttrID.Length > 0)
|
{
|
legendIdlist = new List<int>();
|
legendValuelist = new List<int>();
|
for (i = 0; i < appointItemConfig.LegendAttrID.Length; i++)
|
{
|
if(appointItemConfig.LegendAttrID[i] != 0)
|
{
|
legendIdlist.Add(appointItemConfig.LegendAttrID[i]);
|
legendValuelist.Add(appointItemConfig.LegendAttrValue[i]);
|
}
|
}
|
}
|
|
if (appointItemConfig.OutOfPrintAttr.Length > 0)
|
{
|
exhaustedIdlist = new List<int>();
|
exhaustedValuelist = new List<int>();
|
for (i = 0; i < appointItemConfig.OutOfPrintAttr.Length; i++)
|
{
|
if(appointItemConfig.OutOfPrintAttr[i] != 0)
|
{
|
exhaustedIdlist.Add(appointItemConfig.OutOfPrintAttr[i]);
|
exhaustedValuelist.Add(appointItemConfig.OutOfPrintAttrValue[i]);
|
}
|
}
|
}
|
SetLegendData(legendIdlist, legendValuelist);
|
SetExhaustedData(exhaustedIdlist,exhaustedValuelist);
|
//SetSuitData(appointItemConfig.SuiteLv);
|
|
}
|
#endregion
|
|
public List<int> GetUseDataModel(int key)
|
{
|
List<int> list = null;
|
if (useDataDict != null)
|
{
|
useDataDict.TryGetValue(key, out list);
|
}
|
return list;
|
}
|
|
/// <summary>
|
/// 设置弹框功能按钮
|
/// </summary>
|
/// <param name="type"></param>
|
/// <param name="func"></param>
|
public void SetTipsFuncBtn(ItemWinBtnType type, Action<ItemWinBtnType,string> func)
|
{
|
tipsFuncBtnDic.Add(type,func);
|
}
|
|
/// <summary>
|
/// 设置该物品的弹框类型
|
/// </summary>
|
public ItemWinType winType { get; private set; }
|
public void SetWinType()
|
{
|
if (this.itemConfig == null)
|
return;
|
|
switch (this.itemConfig.Template.Trim())
|
{
|
case "ItemInfoPanel":
|
switch (ChildType)
|
{
|
case ItemTipChildType.Normal:
|
winType = ItemWinType.itemWin;
|
break;
|
case ItemTipChildType.Buy:
|
winType = ItemWinType.BuyItemWin;
|
break;
|
}
|
break;
|
case "BoxInfoWin":
|
switch (ChildType)
|
{
|
case ItemTipChildType.Normal:
|
winType = ItemWinType.boxWin;
|
break;
|
case ItemTipChildType.Buy:
|
winType = ItemWinType.buyBoxWin;
|
break;
|
}
|
break;
|
case "PetMatInfoWin":
|
switch (ChildType)
|
{
|
case ItemTipChildType.Normal:
|
winType = ItemWinType.petMatWin;
|
break;
|
case ItemTipChildType.Buy:
|
winType = ItemWinType.buyPetMatWin;
|
break;
|
}
|
break;
|
case "EquipPanel":
|
winType = ItemWinType.equipWin;
|
break;
|
case "WingsPanel":
|
winType = ItemWinType.wingsWin;
|
break;
|
case "GuardPanel":
|
winType = ItemWinType.guardWin;
|
break;
|
default:
|
DebugEx.Log("没有此物品的弹框类型" + this.itemConfig.Template.Trim());
|
break;
|
}
|
}
|
}
|
|
public struct ItemSuitAttrData
|
{
|
public EquipSuitAttrConfig suitAttrConfig { get; private set; }
|
public int[] firstSuitAttrs { get; private set; }
|
public int[] firstSuitAttrValues { get; private set; }
|
public int[] secondSuitAttrs { get; private set; }
|
public int[] secondSuitAttrValues { get; private set; }
|
public int[] thirdSuitAttrs { get; private set; }
|
public int[] thirdSuitAttrValues { get; private set; }
|
|
public ItemSuitAttrData(int groupType,int suitType,int suitLv,int equipJob)
|
{
|
this.suitAttrConfig = EquipSuitAttrConfig.GetSuitAttrConfig(groupType,suitType,suitLv,equipJob);
|
if (suitAttrConfig != null)
|
{
|
this.firstSuitAttrs = ConfigParse.GetMultipleStr<int>(this.suitAttrConfig.propList1);
|
this.firstSuitAttrValues = ConfigParse.GetMultipleStr<int>(this.suitAttrConfig.propValueList1);
|
this.secondSuitAttrs = ConfigParse.GetMultipleStr<int>(this.suitAttrConfig.propList2);
|
this.secondSuitAttrValues = ConfigParse.GetMultipleStr<int>(this.suitAttrConfig.propValueList2);
|
this.thirdSuitAttrs = ConfigParse.GetMultipleStr<int>(this.suitAttrConfig.propList3);
|
this.thirdSuitAttrValues = ConfigParse.GetMultipleStr<int>(this.suitAttrConfig.propValueList3);
|
}
|
else
|
{
|
this.firstSuitAttrs = null;
|
this.firstSuitAttrValues = null;
|
this.secondSuitAttrs = null;
|
this.secondSuitAttrValues = null;
|
this.thirdSuitAttrs = null;
|
this.thirdSuitAttrValues = null;
|
}
|
|
}
|
}
|
}
|