|
@@ -1,5 +1,6 @@
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
|
+using System.Reflection;
|
|
|
using Excel2Json;
|
|
using Excel2Json;
|
|
|
using Fort23.UTool;
|
|
using Fort23.UTool;
|
|
|
using GameLogic.Bag;
|
|
using GameLogic.Bag;
|
|
@@ -168,6 +169,7 @@ namespace GameLogic.Player
|
|
|
itemInfo = new ItemInfo(dropItemConfig.itemID[itemIndex], c);
|
|
itemInfo = new ItemInfo(dropItemConfig.itemID[itemIndex], c);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
itemInfos.Add(itemInfo);
|
|
itemInfos.Add(itemInfo);
|
|
|
// for (int j = 0; j < dropItemConfig.itemID.Length; j++)
|
|
// for (int j = 0; j < dropItemConfig.itemID.Length; j++)
|
|
|
// {
|
|
// {
|
|
@@ -254,17 +256,35 @@ namespace GameLogic.Player
|
|
|
public List<ItemInfo> Drop(int itemID, int count)
|
|
public List<ItemInfo> Drop(int itemID, int count)
|
|
|
{
|
|
{
|
|
|
List<ItemInfo> itemInfos = new List<ItemInfo>();
|
|
List<ItemInfo> itemInfos = new List<ItemInfo>();
|
|
|
|
|
+ DropConfig dropConfig = ConfigComponent.Instance.Get<DropConfig>(itemID);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if (count < 0)
|
|
if (count < 0)
|
|
|
{
|
|
{
|
|
|
itemInfos.Add(DropResourceLevel(itemID, count));
|
|
itemInfos.Add(DropResourceLevel(itemID, count));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- DropConfig dropConfig = ConfigComponent.Instance.Get<DropConfig>(itemID);
|
|
|
|
|
if (dropConfig.dropType == 3)
|
|
if (dropConfig.dropType == 3)
|
|
|
{
|
|
{
|
|
|
- ItemInfo itemInfo = new ItemInfo(dropConfig.dropGroupID[0], count);
|
|
|
|
|
- itemInfos.Add(itemInfo);
|
|
|
|
|
|
|
+ ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(dropConfig.dropGroupID[0]);
|
|
|
|
|
+ if (itemConfig.associateID == 14)
|
|
|
|
|
+ {
|
|
|
|
|
+ ResourceLevelConfig resourceLevelConfig =
|
|
|
|
|
+ ConfigComponent.Instance.Get<ResourceLevelConfig>(PlayerManager.Instance.myHero
|
|
|
|
|
+ .powerUpConfig.ID);
|
|
|
|
|
+ FieldInfo scoreField =
|
|
|
|
|
+ resourceLevelConfig.GetType().GetField("value" + itemConfig.associateVlaue);
|
|
|
|
|
+ int itemId = (int)scoreField.GetValue(resourceLevelConfig);
|
|
|
|
|
+ ItemInfo itemInfo = new ItemInfo(itemId, count);
|
|
|
|
|
+ itemInfos.Add(itemInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ ItemInfo itemInfo = new ItemInfo(dropConfig.dropGroupID[0], count);
|
|
|
|
|
+ itemInfos.Add(itemInfo);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -278,7 +298,8 @@ namespace GameLogic.Player
|
|
|
|
|
|
|
|
public ItemInfo DropResourceLevel(int itemID, int count)
|
|
public ItemInfo DropResourceLevel(int itemID, int count)
|
|
|
{
|
|
{
|
|
|
- ResourceLevelConfig resourceLevelConfig = ConfigComponent.Instance.Get<ResourceLevelConfig>(PlayerManager.Instance.myHero.powerUpConfig.ID);
|
|
|
|
|
|
|
+ ResourceLevelConfig resourceLevelConfig =
|
|
|
|
|
+ ConfigComponent.Instance.Get<ResourceLevelConfig>(PlayerManager.Instance.myHero.powerUpConfig.ID);
|
|
|
ItemInfo itemInfo = null;
|
|
ItemInfo itemInfo = null;
|
|
|
float c = Math.Abs(count / (float)1000);
|
|
float c = Math.Abs(count / (float)1000);
|
|
|
switch (itemID)
|
|
switch (itemID)
|