|
@@ -1,6 +1,8 @@
|
|
|
-using Core.Utility;
|
|
|
+using Codice.CM.Common;
|
|
|
+using Core.Utility;
|
|
|
using Excel2Json;
|
|
|
using Fort23.UTool;
|
|
|
+using ItemInfo = GameLogic.Bag.ItemInfo;
|
|
|
|
|
|
namespace GameLogic.Equipment
|
|
|
{
|
|
@@ -10,6 +12,7 @@ namespace GameLogic.Equipment
|
|
|
public string guid;
|
|
|
public HeroBasicEquipConfig basicEquipConfig;
|
|
|
public ItemConfig itemConfig;
|
|
|
+ // public ItemInfo itemInfo;
|
|
|
public int count;
|
|
|
public int quality;
|
|
|
|
|
@@ -25,11 +28,30 @@ namespace GameLogic.Equipment
|
|
|
private int m_Defense;
|
|
|
private int m_HP;
|
|
|
|
|
|
-
|
|
|
|
|
|
- public void InitEquipment(int itemID, int eLv, int quality)
|
|
|
+ public void InitEquipment(ItemInfo modelInfo, ItemInfo lvInfo, ItemInfo qualityInfo)
|
|
|
+ {
|
|
|
+ //有效性检查
|
|
|
+ if (modelInfo.dropItemConfig.dropItemType != 1 &&
|
|
|
+ lvInfo.dropItemConfig.dropItemType != 3 &&
|
|
|
+ qualityInfo.dropItemConfig.dropItemType != 2)
|
|
|
+ {
|
|
|
+ string errorTip = "modelInfo.dropItemConfig.dropItemType=" +
|
|
|
+ modelInfo.dropItemConfig.dropItemType +
|
|
|
+ " |lvInfo.dropItemConfig.dropItemType" +
|
|
|
+ lvInfo.dropItemConfig.dropItemType +
|
|
|
+ " |qualityInfo.dropItemConfig.dropItemType" +
|
|
|
+ qualityInfo.dropItemConfig.dropItemType;
|
|
|
+ LogTool.Error(errorTip);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void InitEquipment(ItemConfig itemConfig, int eLv, int quality)
|
|
|
{
|
|
|
- itemConfig = ConfigComponent.Instance.Get<ItemConfig>(itemID);
|
|
|
+ // itemInfo = new ItemInfo(itemID);
|
|
|
+ // itemConfig = ConfigComponent.Instance.Get<ItemConfig>(itemID);
|
|
|
+ this.itemConfig = itemConfig;
|
|
|
+ this.quality = quality;
|
|
|
|
|
|
// int equipmentConfigID = itemConfig.itemParam[0] * 10000 + itemConfig.itemParam[1] * 1000 + eLv;
|
|
|
int equipmentConfigID =
|
|
@@ -49,19 +71,20 @@ namespace GameLogic.Equipment
|
|
|
for(int i=0; i < basicEquipConfig.AttType.Length; i++)
|
|
|
{
|
|
|
int attTyp = basicEquipConfig.AttType[i];
|
|
|
+ int value = basicEquipConfig.AttValue[i] *
|
|
|
+ PlayerManager.Instance.eqController.
|
|
|
+ GetEquipmentRarityAttributeFactor(quality);
|
|
|
switch (attTyp)
|
|
|
{
|
|
|
case 1:
|
|
|
- int value = basicEquipConfig.AttValue[i] *
|
|
|
- PlayerManager.Instance.eqController.
|
|
|
- GetEquipmentRarityAttributeFactor(quality);
|
|
|
m_HP = value;
|
|
|
break;
|
|
|
case 2:
|
|
|
+ m_Attack = value;
|
|
|
break;
|
|
|
case 3:
|
|
|
+ m_Defense = value;
|
|
|
break;
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|