33 lines
866 B
C#
33 lines
866 B
C#
using ET.EventType;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ET
|
|
{
|
|
public class DamageEventEvent : AEvent<DamageEvent>
|
|
{
|
|
public override async ETTask Run(DamageEvent args)
|
|
{
|
|
try
|
|
{
|
|
Unit attacker = args.attacker;
|
|
BattleBase battleBase = BattleMgrCompnent.Instance.GetBattle(attacker);
|
|
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;
|
|
}
|
|
}
|
|
}
|