|
@@ -15,7 +15,7 @@ namespace GFGGame
|
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
|
|
|
if (itemCfg == null)
|
|
|
{
|
|
|
- Debug.LogError($"添加了一个不存在的物品 {itemID}");
|
|
|
+ Debug.LogError($"娣诲姞浜嗕竴涓�笉瀛樺湪鐨勭墿鍝� {itemID}");
|
|
|
return;
|
|
|
}
|
|
|
ItemData itemData = null;
|
|
@@ -24,7 +24,7 @@ namespace GFGGame
|
|
|
itemData = _dataDic[itemID];
|
|
|
if (itemCfg.itemType == ConstItemType.CARD)
|
|
|
{
|
|
|
- return;//每张卡牌只有一张
|
|
|
+ return;//姣忓紶鍗$墝鍙�湁涓€寮�
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -36,7 +36,7 @@ namespace GFGGame
|
|
|
itemData.num += itemNum;
|
|
|
if (ItemUtilCS.IsDressUpItem(itemID) && itemID % GameConst.MAX_COUNT_EVERY_TYPE_ITEM > 0)
|
|
|
{
|
|
|
- //游戏角色初始数据完成后才执行
|
|
|
+ //娓告垙瑙掕壊鍒濆�鏁版嵁瀹屾垚鍚庢墠鎵ц�
|
|
|
bool dataInited = GameGlobal.DataInited;
|
|
|
DressUpMenuItemDataManager.Add(itemID);
|
|
|
if (!DressUpMenuItemDataManager.CheckIsSceneType(itemID))
|
|
@@ -152,7 +152,7 @@ namespace GFGGame
|
|
|
_itemExchangeDic.Add(itemId, exchangTimes);
|
|
|
}
|
|
|
}
|
|
|
- //获取物品已兑换次数
|
|
|
+ //鑾峰彇鐗╁搧宸插厬鎹㈡�鏁�
|
|
|
public static int GetItemExchangeTimes(int itemId)
|
|
|
{
|
|
|
if (_itemExchangeDic.ContainsKey(itemId) == false)
|
|
@@ -171,7 +171,7 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 获取表格配置的基础属性
|
|
|
+ /// 鑾峰彇琛ㄦ牸閰嶇疆鐨勫熀纭€灞炴€�
|
|
|
/// </summary>
|
|
|
/// <param name="itemId"></param>
|
|
|
/// <param name="scoreType"></param>
|
|
@@ -199,18 +199,52 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 获取当前(养护/升级/升星后)的属性
|
|
|
+ /// 鑾峰彇褰撳墠锛堝吇鎶�/鍗囩骇/鍗囨槦鍚庯級鐨勫睘鎬�
|
|
|
/// </summary>
|
|
|
/// <param name="itemId"></param>
|
|
|
/// <param name="scoreType"></param>
|
|
|
/// <returns></returns>
|
|
|
- public static int GetItemAdditionScore(int itemId, int scoreType)
|
|
|
+ public static int GetItemAdditionScore(int itemId, int scoreType, string[] tags = null)
|
|
|
{
|
|
|
if (_dataDic.TryGetValue(itemId, out var itemData))
|
|
|
{
|
|
|
- return itemData.GetScore(scoreType);
|
|
|
+ int scroe = 0;
|
|
|
+ if (tags != null)
|
|
|
+ {
|
|
|
+ scroe += GetItemTagScore(itemId, tags);
|
|
|
+ }
|
|
|
+ scroe += itemData.GetScore(scoreType);
|
|
|
+ return scroe;
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 鑾峰彇涓€涓�崲瑁呴儴浠跺�搴旂殑鏍囩�鍒嗘暟
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="itemId"></param>
|
|
|
+ /// <param name="tags"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static int GetItemTagScore(int itemId, string[] tags)
|
|
|
+ {
|
|
|
+ int score = 0;
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
+ if (itemCfg == null)
|
|
|
+ {
|
|
|
+ ET.Log.Error("鐗╁搧锛�" + itemId + "涓嶅瓨鍦�");
|
|
|
+ return score;
|
|
|
+ }
|
|
|
+ for (int i = 0; i < itemCfg.tagsArr.Length; i++)
|
|
|
+ {
|
|
|
+ for (int j = 0; j < tags.Length; j++)
|
|
|
+ {
|
|
|
+ if (itemCfg.tagsArr[i][0] == tags[j])
|
|
|
+ {
|
|
|
+ score += int.Parse(itemCfg.tagsArr[i][1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return score;
|
|
|
+ }
|
|
|
}
|
|
|
}
|