2021-04-13 20:39:32 +08:00
|
|
|
|
using Cal.DataTable;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public static class TrialCopyHelper
|
|
|
|
|
{
|
2021-05-01 11:27:41 +08:00
|
|
|
|
public static async ETTask GetReword(Unit unit, MonsterBase monsterBase, UnOrderMultiMap<long, (int, int)> rewordMap)
|
2021-04-13 20:39:32 +08:00
|
|
|
|
{
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
|
|
|
|
|
float expAddtion = 1;
|
|
|
|
|
PlayerData playerData = unit.GetComponent<PlayerData>();
|
|
|
|
|
float drop = 1;
|
|
|
|
|
NumericComponent num = unit.GetComponent<NumericComponent>();
|
|
|
|
|
if (!unit.IsAlive)
|
|
|
|
|
{
|
|
|
|
|
expAddtion *= 0.5f;
|
|
|
|
|
drop *= 0.5f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//!Exp
|
|
|
|
|
long exp = MathHelper.RoundToLong(monsterBase.Exp * playerData.BattleExpSpeed * expAddtion);
|
|
|
|
|
num.AddSet(NumericType.Exp, exp);
|
|
|
|
|
|
|
|
|
|
if (drop != 0)
|
|
|
|
|
{
|
2021-04-15 00:12:07 +08:00
|
|
|
|
M2C_SendReward rewardRet = new M2C_SendReward();
|
|
|
|
|
DropHelper. Drop(unit, playerData, BattleType.TrialCopy, monsterBase.Dropasubset, rewordMap, drop, "试炼掉落", list:rewardRet.ItemList);
|
2021-04-13 20:39:32 +08:00
|
|
|
|
SendMessage(unit, num, rewardRet, exp, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-29 11:28:15 +08:00
|
|
|
|
UnitHelper.Save<Bag>(unit);
|
2021-04-13 20:39:32 +08:00
|
|
|
|
}
|
|
|
|
|
private static void SendMessage(Unit unit, NumericComponent num, M2C_SendReward rewardRet, long exp, long coin)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
M2C_SendBag bagRet = new M2C_SendBag();
|
|
|
|
|
BagHelper.GetBagInfo(unit, bagRet.BagMapList);
|
|
|
|
|
MessageHelper.SendActor(unit, bagRet);
|
|
|
|
|
//!发送奖励信息
|
|
|
|
|
rewardRet.Exp = exp;
|
|
|
|
|
rewardRet.Coin = coin;
|
|
|
|
|
MessageHelper.SendActor(unit, rewardRet);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|