Beispiel #1
0
        public override void UpdateLights(EffectFrame frame, IGameState new_game_state)
        {
            if (new_game_state is GameState_CSGO)
            {
                _game_state = new_game_state;

                GameState_CSGO gs = (new_game_state as GameState_CSGO);

                try
                {
                    UpdateLights(frame);
                }
                catch (Exception e)
                {
                    Global.logger.LogLine("Exception during OnNewGameState. Error: " + e, Logging_Level.Error);
                    Global.logger.LogLine(gs.ToString(), Logging_Level.None);
                }
            }
        }
Beispiel #2
0
        public override void UpdateLights(EffectFrame frame, GameState new_game_state)
        {
            if (new_game_state is GameState_CSGO)
            {
                _game_state = new_game_state;

                GameState_CSGO gs = (new_game_state as GameState_CSGO);

                try
                {
                    if (!IsPlanted &&
                        gs.Round.Phase == RoundPhase.Live &&
                        gs.Round.Bomb == BombState.Planted &&
                        gs.Previously.Round.Bomb == BombState.Undefined)
                    {
                        IsPlanted = true;
                        SetBombState(BombState.Planted);
                    }
                    else if (IsPlanted && gs.Round.Phase == RoundPhase.FreezeTime)
                    {
                        IsPlanted = false;
                        SetBombState(BombState.Undefined);
                    }
                    else if (IsPlanted && gs.Round.Bomb == BombState.Defused)
                    {
                        SetBombState(BombState.Defused);
                    }
                    else if (IsPlanted && gs.Round.Bomb == BombState.Exploded)
                    {
                        SetBombState(BombState.Exploded);
                    }

                    SetTeam(gs.Player.Team);
                    SetHealth(gs.Player.State.Health);
                    SetFlashAmount(gs.Player.State.Flashed);
                    SetBurnAmount(gs.Player.State.Burning);
                    SetClip(gs.Player.Weapons.ActiveWeapon.AmmoClip);
                    SetClipMax(gs.Player.Weapons.ActiveWeapon.AmmoClipMax);
                    SetPlayerActivity(gs.Player.Activity);
                    SetIsLocalPlayer(gs.Provider.SteamID.Equals(gs.Player.SteamID));
                    if (gs.Round.WinTeam == RoundWinTeam.Undefined && gs.Previously.Round.WinTeam != RoundWinTeam.Undefined)
                    {
                        RoundStart();
                    }
                    if (gs.Previously.Player.State.RoundKills != -1 && gs.Player.State.RoundKills != -1 && gs.Previously.Player.State.RoundKills < gs.Player.State.RoundKills && gs.Provider.SteamID.Equals(gs.Player.SteamID))
                    {
                        GotAKill(gs.Previously.Player.State.RoundKillHS != -1 && gs.Player.State.RoundKillHS != -1 && gs.Previously.Player.State.RoundKillHS < gs.Player.State.RoundKillHS);
                    }
                    if (gs.Player.State.Health == 100 && ((gs.Previously.Player.State.Health > -1 && gs.Previously.Player.State.Health < 100) || (gs.Round.WinTeam == RoundWinTeam.Undefined && gs.Previously.Round.WinTeam != RoundWinTeam.Undefined)) && gs.Provider.SteamID.Equals(gs.Player.SteamID))
                    {
                        Respawned();
                    }

                    UpdateLights(frame);
                }
                catch (Exception e)
                {
                    Global.logger.LogLine("Exception during OnNewGameState. Error: " + e, Logging_Level.Error);
                    Global.logger.LogLine(gs.ToString(), Logging_Level.None);
                }
            }
        }