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.
38 lines
1.1 KiB
38 lines
1.1 KiB
using CoreGame;
|
|
using Proto;
|
|
using xFrame;
|
|
|
|
namespace CoreGame.Render
|
|
{
|
|
public class Trigger_OnBulletBounce : TriggerBase
|
|
{
|
|
public override void OnEvent(TriggerSpec self, int eventId, object param1)
|
|
{
|
|
var originProp = self.owner.property;
|
|
var originBulletBounceCount = (int)originProp.GetProperty(PropertyDef.BulletBounceCount);
|
|
if (originBulletBounceCount <= 0)
|
|
{
|
|
XLog.LogDebug("TaskBulletBounce 弹跳次数不足");
|
|
return;
|
|
}
|
|
|
|
if (param1 is not HurtData hurtData)
|
|
{
|
|
XLog.LogWarning("TaskBulletBounce param1 type is not HurtData");
|
|
return;
|
|
}
|
|
self.abilitySpec?.ctx.filterEids.Add(hurtData.dst.creationIndex);
|
|
OnTrigger(self, eventId, param1);
|
|
}
|
|
|
|
public override void Init(TriggerSpec self)
|
|
{
|
|
RegEntityEvent(self, ClientEvent.OnBulletBounce);
|
|
}
|
|
|
|
public override void UnInit(TriggerSpec self)
|
|
{
|
|
UnRegEntityEvent(self, ClientEvent.OnBulletBounce);
|
|
}
|
|
}
|
|
}
|