CTT/Server/Hotfix/Game/Event/Battle/TreatEventEvent.cs

33 lines
861 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 TreatEventEvent : AEvent<TreatEvent>
{
public override async ETTask Run(TreatEvent 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.ChangeTreatData(attacker, args.treat);
}
}
catch (Exception e)
{
Log.Error(e);
}
await ETTask.CompletedTask;
}
}
}