Beispiel #1
0
    void UpdateTables()
    {
        PlayerPersistantInfo player = PPIManager.Instance.GetLocalPlayerPPI();

        if (player == null)
        {
            return;
        }

        int killedMe   = 0;
        int killedByMe = 0;

        if (m_MyBestVictim != null)
        {
            PlayerPersistantInfo victim = PPILocalStats.GetBestVictim(player, ref killedByMe);

            if (victim != null)
            {
                killedMe = PPILocalStats.GetKills(victim, player);

                m_MyBestVictim.Show();
                m_MyBestVictim.Update(victim, killedMe, killedByMe);
            }
            else
            {
                m_MyBestVictim.Hide();
            }
        }

        if (m_MyBestKiller != null)
        {
            PlayerPersistantInfo killer = PPILocalStats.GetBestKiller(player, ref killedMe);

            if (killer != null)
            {
                killedByMe = PPILocalStats.GetKills(player, killer);

                m_MyBestKiller.Show();
                m_MyBestKiller.Update(killer, killedMe, killedByMe);
            }
            else
            {
                m_MyBestKiller.Hide();
            }
        }
    }
Beispiel #2
0
    protected void RoundEnded(RoundFinalResult results)
    {
        CancelInvoke();

        GameState.State = ClientGameState.WaitingToRestart;

        PlayerPersistantInfo localPPI = PPIManager.Instance.GetLocalPlayerPPI();

        GuiFrontendIngame.ShowFinalMenu(/*GameState.GameType, true*/);

        int place = results.Place;

        if ((GameState.GameType == E_MPGameType.ZoneControl) && (localPPI.Team == GameState.GetWinnerTeam()))
        {
            Audio.PlayOneShot(Sounds.Score.FirstPlace);
        }
        else if (place == 0)
        {
            Audio.PlayOneShot(Sounds.Score.FirstPlace);
        }
        else if (place == 1)
        {
            Audio.PlayOneShot(Sounds.Score.SecondPlace);
        }
        else if (place == 2)
        {
            Audio.PlayOneShot(Sounds.Score.ThirdPlace);
        }
        else if (Mission.Instance && Mission.Instance.RoundEnd)
        {
            Audio.PlayOneShot(Mission.Instance.RoundEnd);
        }

        PlayerPersistantInfo ppi = PPILocalStats.GetBestVictim(localPPI, ref results.Prey.KilledByMe);

        if (ppi != null)
        {
            results.Prey.PrimaryKey = ppi.PrimaryKey;
            results.Prey.KilledMe   = PPILocalStats.GetKills(ppi, localPPI);
        }

        ppi = PPILocalStats.GetBestKiller(localPPI, ref results.Nightmare.KilledMe);

        if (ppi != null)
        {
            results.Nightmare.PrimaryKey = ppi.PrimaryKey;
            results.Nightmare.KilledByMe = PPILocalStats.GetKills(localPPI, ppi);
        }

        foreach (var score in results.PlayersScore)
        {
            ppi = PPIManager.Instance.GetPPIList().Find(obj => obj.PrimaryKey == score.PrimaryKey);
            if (ppi != null)
            {
                score.Experience = ppi.Experience;
            }
        }

        results.MapName = GameState.LevelName;

        Game.Instance.LastRoundResult = results;
    }