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); } } }