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