예제 #1
0
		protected void HandleBombDefused(object sender, BombEventArgs e)
		{
			if (!IsMatchStarted) return;

			BombDefusedEvent bombDefusedEvent = new BombDefusedEvent(Parser.IngameTick);
			if (e.Player.SteamID != 0)
			{
				PlayerExtended player = Demo.Players.FirstOrDefault(p => p.SteamId == e.Player.SteamID);
				if (player != null)
				{
					player.BombDefusedCount++;
					bombDefusedEvent.Player = player;
				}
			}
			Demo.BombDefused.Add(bombDefusedEvent);
			CurrentRound.BombDefused.Add(bombDefusedEvent);

			if (AnalyzePlayersPosition && bombDefusedEvent.Player != null)
			{
				PositionPoint positionPoint = new PositionPoint
				{
					X = Demo.BombPlanted.Last().X,
					Y = Demo.BombPlanted.Last().Y,
					Player = bombDefusedEvent.Player,
					Team = e.Player.Team,
					Event = bombDefusedEvent,
					Round = CurrentRound
				};
				Demo.PositionsPoint.Add(positionPoint);
			}
		}
예제 #2
0
		protected void HandleBombDefused(object sender, BombEventArgs e)
		{
			if (!IsMatchStarted || e.Player == null) return;

			BombDefusedEvent bombDefusedEvent = new BombDefusedEvent(Parser.IngameTick, Parser.CurrentTime)
			{
				DefuserSteamId = e.Player.SteamID,
				DefuserName = e.Player.Name,
				Site = e.Site.ToString()
			};

			if (e.Player.SteamID != 0)
			{
				PlayerExtended player = Demo.Players.FirstOrDefault(p => p.SteamId == e.Player.SteamID);
				if (player != null) player.BombDefusedCount++;
			}
			Demo.BombDefused.Add(bombDefusedEvent);
			CurrentRound.BombDefused = bombDefusedEvent;

			if (AnalyzePlayersPosition && bombDefusedEvent.DefuserSteamId != 0)
			{
				PositionPoint positionPoint = new PositionPoint
				{
					X = e.Player.Position.X,
					Y = e.Player.Position.Y,
					PlayerSteamId = e.Player.SteamID,
					PlayerName = e.Player.Name,
					Team = e.Player.Team,
					Event = bombDefusedEvent,
					RoundNumber = CurrentRound.Number
				};
				Demo.PositionsPoint.Add(positionPoint);
			}
		}