CTT/Server/Hotfix/Game/Handler/Other/C2M_GetBuffTimeHandler.cs

24 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
namespace ET
{
[ActorMessageHandler]
public class C2M_GetBuffTimeHandler : AMActorLocationHandler<Unit, C2M_GetBuffTime>
{
protected override async ETTask Run(Unit unit, C2M_GetBuffTime message)
{
string ret = string.Empty;
PlayerData data = unit.GetComponent<PlayerData>();
ret += $"血球Buff剩余量{data.hpAutoFullCapatial.Key}";
ret += $"\n蓝球Buff剩余量{data.mpAutoFullCapatial.Key}";
ret += $"\n普通跑图剩余量{TimeSpan.FromMilliseconds(data.mainstoryAITime):dd\\:hh\\:mm\\:ss}";
ret += $"\n畅爽跑图剩余量{TimeSpan.FromMilliseconds(data.mainstoryVIPAITime):dd\\:hh\\:mm\\:ss}";
long now = TimeHelper.ClientNow();
long dTime = data.battleExpSpeedLeastTime - now;
if (dTime < 0) dTime = 0;
ret += $"\n{MathHelper.RoundToInt(data.BattleExpSpeed)}倍战斗经验Buff剩余剩余时间{TimeSpan.FromMilliseconds(dTime).TotalMinutes:f2}分钟";
MessageHelper.SendActor(unit, new M2C_SendTip { Message = ret });
await ETTask.CompletedTask;
}
}
}