Exemplo n.º 1
0
        public void RemoveShotByImpact(int bzfsID)
        {
            Shot s = GetShotByBZFSID(bzfsID);

            if (s == null)
            {
                return;
            }

            RemoveShotByGID(s.GlobalID);

            if (ExplosionCreated != null)
            {
                ExplosionEventArgs args = new ExplosionEventArgs();
                args.Position     = s.Position;
                args.LastVelocity = s.Velocity;
                args.Reson        = ExplosionEventArgs.Reasons.ImpactEnd;

                ExplosionCreated.Invoke(this, args);
            }
        }
Exemplo n.º 2
0
        public void HandleShotEnd(NetworkMessage msg)
        {
            MsgShotEnd se = msg as MsgShotEnd;

            Shot s = GetShotByBZFSID(BuildBZFSShotID(se.PlayerID, se.ShotID));

            if (s == null)
            {
                return;
            }

            RemoveShotByGID(s.GlobalID);

            if (ExplosionCreated != null)
            {
                ExplosionEventArgs args = new ExplosionEventArgs();
                args.Position     = s.Position;
                args.LastVelocity = s.Velocity;
                args.Reson        = se.Exploded ? ExplosionEventArgs.Reasons.ImpactEnd : ExplosionEventArgs.Reasons.LifetimeEnd;

                ExplosionCreated.Invoke(this, args);
            }
        }