using CoreGame; using xFrame; namespace CoreGame.Render { public class Trigger_OnShootBouncyBullets : TriggerBase { public override void OnEvent(TriggerSpec self, int eventId, object param1) { OnTrigger(self, eventId, param1); } public override bool OnPreExecuteCheck(TriggerSpec self, int eventId, object param1) { if (param1 is not CombatEntity[] bulletEntities) { XLog.LogWarning("OnPreExecuteCheck: param1 is not bulletEntities"); return false; } var ctx = self.abilitySpec?.ctx; if (ctx == null) { XLog.LogWarning("OnPreExecuteCheck: ctx is null"); return false; } ctx.castTarget.Clear(); for (var index = 0; index < bulletEntities.Length; index++) { ctx.castTarget.Add(bulletEntities[index].creationIndex); } return true; } public override void Init(TriggerSpec self) { RegEntityEvent(self, ClientEvent.OnShootBullets); } public override void UnInit(TriggerSpec self) { UnRegEntityEvent(self, ClientEvent.OnShootBullets); } } }