示例#1
0
 public PlayerDiedEventArgs(Player player, Player killer, MeansOfDeath meansOfDeath, HitLocation hitLocation)
     : base(player)
 {
     Location = hitLocation;
     MeansOfDeath = meansOfDeath;
     Killer = killer;
 }
示例#2
0
文件: Game.cs 项目: VSVeras/Quake
        //<world> não é um player e não deve aparecer na lista de players e nem no dicionário de kills.
        public void KillByNaturalDeath(Player victim, MeansOfDeath meansOfDeath)
        {
            var deadPlayerExist = FindPlayerDead(victim.Id);

            if (deadPlayerExist != null)
            {
                deadPlayerExist.Subtract(); //Quando o <world> mata o player ele perde -1 kill.
            }
            TotalKills++;                   //total_kills são os kills dos games, isso inclui mortes do <world>.
            GeneratorStatistics.BecauseOfDeath(meansOfDeath, this);
        }
示例#3
0
 private void Kill(Game currentGame, int idFirstPlayer, int idSecondPlayer, MeansOfDeath meansOfDeath)
 {
     if (idFirstPlayer == _deadByTheWorld)
     {
         var killer = new Player(idSecondPlayer);
         currentGame.KillByNaturalDeath(killer, meansOfDeath);
     }
     else
     {
         var killer = new Player(idFirstPlayer);
         var victim = new Player(idSecondPlayer);
         currentGame.KillForMurder(killer, victim, meansOfDeath);
     }
 }
        public void BecauseOfDeath(MeansOfDeath meansOfDeath, Game game)
        {
            var killsByMeans = game.KillsByMeans.FirstOrDefault(atWhere => atWhere.MeansOfDeath == meansOfDeath);

            if (killsByMeans != null)
            {
                killsByMeans.Sum();
                return;
            }

            killsByMeans = new KillsByMeans(meansOfDeath);
            killsByMeans.Sum();
            game.AddDeathStatistics(killsByMeans);
        }
    public void SetupKillInfo(string killer, string victim, AvailableWeapon weapon, MeansOfDeath meansOfDeath)
    {
        killerText.text = killer;
        victimText.text = victim;

        if (meansOfDeath == MeansOfDeath.falldamage)
        {
            weaponImage.sprite = PlayerUI.instance.fallDamageHudIcon;
            killerText.text    = "";
        }
        else
        {
            weaponImage.sprite = PlayerUI.weaponHudSprites[weapon];
        }

        Init();
    }
示例#6
0
文件: Game.cs 项目: VSVeras/Quake
        public void KillForMurder(Player killer, Player victim, MeansOfDeath meansOfDeath)
        {
            var killerPlayerExist = FindPlayers(killer.Id);

            if (killerPlayerExist != null)
            {
                var deadPlayerExist = FindPlayerDead(victim.Id);
                if (deadPlayerExist != null)
                {
                    deadPlayerExist.Sum();
                }
                else
                {
                    AddNewDeadPlayer(victim);
                }
                TotalKills++; //total_kills são os kills dos games, isso inclui mortes do <world>.
                GeneratorStatistics.BecauseOfDeath(meansOfDeath, this);
            }
        }
示例#7
0
 public KillsByMeans(MeansOfDeath meansOfDeath)
 {
     MeansOfDeath = meansOfDeath;
 }
示例#8
0
        void player_die(gentity_t self, gentity_t inflictor, gentity_t attacker, int damage, MeansOfDeath mod)
        {
            if (self.client.ps.pm_type == Common.PMType.DEAD)
                return;

            if (level.intermissiontime > 0)
                return;

            self.client.ps.pm_type = Common.PMType.DEAD;
            int killer;
            string killerName = "";
            if (attacker != null)
            {
                killer = attacker.s.number;
                if (attacker.client != null)
                    killerName = attacker.client.pers.netname;
                else
                    killerName = "<non-client>";
            }
            else
            {
                killer = 1022;
                killerName = "<world>";
            }

            if (killer < 0 || killer >= 64)
            {
                killer = 1022;
                killerName = "<world>";
            }

            string obit = Enum.GetName(typeof(MeansOfDeath), mod);

            LogPrintf("Kill: {0} {1}: {2} killed {3} by {4}\n", killer, self.s.number, killerName, self.client.pers.netname, obit);

            self.enemy = attacker;

            // FIX: Add score

            Cmd_Score_f(self); // Score scores
            // send updated scores to any clients that are following this one,
            // or they would get stale scoreboards
            for (int j = 0; j < level.maxclients; j++)
            {
                gclient_t client;
                client = level.clients[j];

                if (client.pers.connected != clientConnected_t.CON_CONNECTED)
                    continue;

                if (client.sess.sessionTeam != team_t.TEAM_SPECTATOR)
                    continue;
                if (client.sess.spectatorClient == self.s.number)
                    Cmd_Score_f(g_entities[j]);
            }

            self.client.respawnTime = (int)level.time + 1700;
            Server.Instance.LinkEntity(GEntityToSharedEntity(self));
        }