Example #1
0
        public override void OnPlayerDeath(Mobile m)
        {
            base.OnPlayerDeath(m);

            CTFTeam team = GetTeam(m) as CTFTeam;

            if (team == null)
                return;

            RemoveTimer(m);

            Timer t = new DeathTimer(m, team, this, DeathDelay);
            m_Table[m] = t;
            t.Start();

            Mobile killer = m.LastKiller;
            CTFTeam killerteam = GetTeam(killer) as CTFTeam;

            if (killerteam != null && team != null && ((CTFGame)killerteam.Game).DeathPoint && killerteam != team)
            {
                ++killerteam.Score;
                AddPlayerScore(killer, 1);
                SendGMGump();
                SendPlayerGumps();
            }
        }
Example #2
0
        public override void OnPlayerDeath(Mobile killed)
        {
            base.OnPlayerDeath(killed);

            Mobile killer = killed.LastKiller;
            CWTeam killerteam = (CWTeam)GetTeam(killer);
            CWTeam killedteam = (CWTeam)GetTeam(killed);

            if (killedteam == null)
                return;
            
            if (ResDelay <= 0)
            {
                bool teamkilled = true;

                for (int i = 0; i < killedteam.Players.Count; i++)
                {
                    Mobile m = (Mobile)killedteam.Players[i];

                    if (m.Alive)
                    {
                        teamkilled = false;
                        break;
                    }
                }

                if (teamkilled)
                {
                    AnnounceToPlayers(string.Format("{0} got taken out!", killedteam.Name));
                    teamskilled.Add(killedteam);
                }

                if (teamskilled.Count >= (TeamCount - 1))
                {
                    AnnounceToPlayers(string.Format("{0} is the only team standing and gets {1} points", killerteam.Name, LastStandingPoints));
                    killerteam.Score += LastStandingPoints;
                    teamskilled.Clear();
                    Reset();
                }
            }
            else
            {
                RemoveTimer(killed);

                Timer t = new DeathTimer(killed, killedteam);
                m_Table[killed] = t;
                t.Start();
            }

            if (killerteam != null && killerteam != killedteam)
            {
                killerteam.Score += KillPoints;
                AddPlayerScore(killer, KillPoints);
            }

            if (((CWGame)killedteam.Game).DeathPoints > 0 && killerteam != killedteam)
            {
                SubtractPlayerScore(killed, DeathPoints);
                killedteam.Score -= DeathPoints;
            }
        }