You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
782 B
28 lines
782 B
3 years ago
|
using System;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
[FriendClass(typeof(Unit))]
|
||
|
public class C2M_UseSkillHandler: AMActorLocationRpcHandler<Unit, C2M_UseSkill, M2C_UseSkill>
|
||
|
{
|
||
|
protected async override ETTask Run(Unit unit, C2M_UseSkill request, M2C_UseSkill response, Action reply)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
var battle = unit.GetChild<Battle>(unit.BattleId);
|
||
|
if (battle != null)
|
||
|
{
|
||
|
response.Error = battle.UseSkill(request.AtkId, request.SkillId, 1);
|
||
|
}
|
||
|
reply();
|
||
|
}
|
||
|
catch (Exception e)
|
||
|
{
|
||
|
response.Message = e.ToString();
|
||
|
reply();
|
||
|
}
|
||
|
|
||
|
await ETTask.CompletedTask;
|
||
|
}
|
||
|
}
|
||
|
}
|