zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Hotfix/Game/Event/Battle/DamageEventEvent.cs

33 lines
866 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using ET.EventType;
using System;
using System.Collections.Generic;
namespace ET
{
public class DamageEventEvent : AEvent<DamageEvent>
{
public override async ETTask Run(DamageEvent args)
{
try
{
2021-04-11 19:50:39 +08:00
Unit attacker = args.attacker;
BattleBase battleBase = BattleMgrCompnent.Instance.GetBattle(attacker);
2021-04-08 20:09:59 +08:00
if (battleBase == null)
{
Log.Error($"battleBase is null");
return;
}
if (battleBase is FamilyBossBattle battle)
{
battle.ChangeDamageData(attacker, args.damage);
}
}
catch (Exception e)
{
Log.Error(e);
}
await ETTask.CompletedTask;
}
}
}