Пример #1
0
    public void AddSmokeNadeEffect(DemoParser parser, SmokeEventArgs eventArgs)
    {
        if (!NadeEffectFrames.Any(n => n.Tick == parser.CurrentTick))
        {
            NadeEffectFrames.Add(new NadeEffectFrame()
            {
                Tick        = parser.CurrentTick,
                Round       = MatchInfoManager.Instance.Rounds.Last().Number,
                NadeEffects = new List <NadeEffect>()
            });
        }

        if (eventArgs.ThrownBy == null)
        {
            return;
        }

        var nadeEffect = new NadeEffect()
        {
            Guid     = Guid.NewGuid(),
            Duration = 18,
            Thrower  = eventArgs.ThrownBy.SteamID.ToString(),
            NadeType = EquipmentElement.Smoke,
            Position = (DemoInfoHelper.SourceToUnityVector(eventArgs.Position.Copy()) / GraphicsManager.PlaybackScale) - GraphicsManager.Instance.Map.Offset
        };

        NadeEffectFrames.Last().NadeEffects.Add(nadeEffect);
    }
        protected void HandleSmokeNadeStarted(object sender, SmokeEventArgs e)
        {
            if (!isMatchStarted || e.ThrownBy == null || currentRoundNumber > stopRoundNumber)
            {
                return;
            }

            sbNade.AppendLine(parser.CurrentTick + "," + e.ThrownBy.SteamID + "," + e.ThrownBy.Name + "," + (int)e.NadeType + "," + (int)ActionEnum.HurtByNade + "," + e.Position.X + "," + e.Position.Y + "," + e.Position.Z);
        }
Пример #3
0
 void SmokeNadeEnded_Event(object sender, SmokeEventArgs e)
 {
     if (e.ThrownBy != null)
     {
         Grenade grenade = CurrentRound.Players[e.ThrownBy.SteamID].PlayerRoundGrenade.Smokes.Last();
         grenade.EndTick = parser.CurrentTick;
         grenade.EndTime = parser.CurrentTime;
     }
 }
Пример #4
0
        private void HandleSmokeNadeEnded(object sender, SmokeEventArgs e)
        {
            SmokeNadeEndedEvent newEvent = new SmokeNadeEndedEvent()
            {
                ThrownBySteamID = e.ThrownBy.SteamID,
                NadeType        = (Models.EquipmentElement)((int)e.NadeType),
                Position        = new Models.Vector(e.Position.X, e.Position.Y, e.Position.Z)
            };

            CurrentTick.Events.Add(newEvent);
        }
Пример #5
0
        void HandleSmokeNadeStarted(object sender, SmokeEventArgs e)
        {
            if (e.ThrownBy == null)
            {
                return;
            }

            if (e.ThrownBy.Team == Team.CounterTerrorist)
            {
                CTSmokes.AddPoint(MapPoint(e.Position, e.ThrownBy));
            }
            else
            {
                TSmokes.AddPoint(MapPoint(e.Position, e.ThrownBy));
            }
        }
Пример #6
0
        void SmokeNadeStarted_Event(object sender, SmokeEventArgs e)
        {
            if (e.ThrownBy != null)
            {
                CurrentRound.Players[e.ThrownBy.SteamID].PlayerRoundGrenade.Smokes.Add(new Grenade {
                    StartTick = parser.CurrentTick, StartTime = parser.CurrentTime, Type = (int)e.NadeType
                });

                if (MatchData.Players[e.ThrownBy.SteamID].Team == 0)
                {
                    CurrentRound.Team1.SmokesThrown += 1;
                }
                else
                {
                    CurrentRound.Team2.SmokesThrown += 1;
                }
            }
        }
Пример #7
0
 private void CurrentDemoParser_SmokeNadeEnded(object sender, SmokeEventArgs e)
 {
     SteamController.LogToConsole(e.NadeType + " that was thrown by " + (e.ThrownBy != null ? e.ThrownBy.Name : "nobody") + " ended at " + e.Position);
 }