Exemple #1
0
 public void spawnPlayer(Player p, bool announce)
 {
     addMember(p);
     p.setLoc(teamSpawn);
     if (announce)
     {
         CTF.Message(p.getTeam().teamColor + p.name + c.def + " joined the "
                     + p.getTeam().teamColor + p.getTeam().name + c.def + " team");
     }
 }
Exemple #2
0
        public void openSpawn()
        {
            ushort x = teamSpawn[0], y = (ushort)teamSpawn[1]--, yy = (ushort)teamSpawn[1]--, z = (ushort)teamSpawn[2];

            yy--;

            CTF.gameLevel.SetTile(x, y, z, Block.air); CTF.gameLevel.SetTile(x, yy, z, Block.air);
            CTF.gameStarted = true;
            CTF.Message("The game has started! Go go go!");
        }
Exemple #3
0
        public void takeFlag(Player p, CTFTeam taker)
        {
            CTF.Message(p.getTeam().teamColor + " took the " + (taker == CTF.redTeam ? "%cred" : "%9blue") + c.def + " flag!");
            taker.hasFlag  = true;
            p.carryingFlag = true;
            p.opponentTeam().flagAtBase = false;

            if (p.opponentTeam().hasFlag)
            {
                CTF.antiStalemate = true;
                CTF.Message(c.green + "Anti-Stalemate mode activated!");
                CTF.Message("If someone is tagged, their team's flag-carrier automatically drops the flag!");
            }
        }
Exemple #4
0
        public static void playerProximity(Player p, ushort x, ushort y, ushort z)
        {
            int           count        = 0;
            List <Player> peopleKilled = new List <Player>();

            foreach (Player o in p.opponentTeam().players.ToArray())
            {
                if ((o.getLoc(false)[0] == x && o.getLoc(false)[1] == y && o.getLoc(false)[2] == z) ||
                    (o.getLoc(true)[0] == x && o.getLoc(true)[1] == y && o.getLoc(true)[2] == z))
                {
                    count++; peopleKilled.Add(o);
                }
                if (count == 0)
                {
                    return;
                }
                if (peopleKilled.Count > 0)
                {
                    foreach (Player m in peopleKilled.ToArray())
                    {
                        KillPlayer(p, m, KillType.Explode);
                    }
                }
            }
            if (count > 1)
            {
                switch (count)
                {
                case 2:
                    CTF.Message(p.getTeam().teamColor + "DOUBLE KILL!");
                    break;

                case 3:
                    CTF.Message(p.getTeam().teamColor + "TRIPLE KILL!");
                    break;

                case 4:
                    CTF.Message(p.getTeam().teamColor + "QUAD KILL!");
                    break;

                default:
                    CTF.Message(p.getTeam().teamColor + "x" + count.ToString() + "KILL!");
                    break;
                }
            }
            peopleKilled.Clear();
        }
Exemple #5
0
        public static void KillPlayer(Player killer, Player victim, KillType killtype)
        {
            if (victim.carryingFlag)
            {
                string col = victim.getTeam().teamColor;
                CTF.Message(col + victim.name + c.def + " dropped the " + killer.getTeam().teamColor + killer.getTeam().name + c.def + " flag.");
                victim.carryingFlag = false;
                victim.getTeam().hasFlag = false;
                killer.points         += 5;
                killer.money          += 5;
                killer.pointsThisGame += 10;
            }
            switch (killtype)
            {
            case KillType.Explode:

                Player.GlobalMessage(c.white + "- " + killer.getTeam().teamColor + killer.name + c.def + getDeathMessage() + killer.getTeam().teamColor + victim.name);
                killer.explodes++;
                break;

            case KillType.Mine:
                killer.mines++;
                Player.GlobalMessage(c.white + "- " + killer.getTeam().teamColor + killer.name + c.def + " mined " + killer.getTeam().teamColor + victim.name);
                break;

            case KillType.Tag:
                killer.tags++;
                Player.GlobalMessage(c.white + "- " + killer.getTeam().teamColor + killer.name + c.def + " tagged " + killer.getTeam().teamColor + victim.name);
                break;
            }
            killer.pointsThisGame += 5;
            if (!doublePoints)
            {
                killer.points += 5;
            }
            else
            {
                killer.points += 10;
            }

            killer.opponentTeam().spawnPlayer(victim, false);
        }