Ejemplo n.º 1
0
 public void AddFlagbase(Player p, string color, ushort x, ushort y, ushort z)
 {
     Level worklevel = p.level;
     char teamCol = (char)color[1];
     if (worklevel.teams.Exists(team => team.color == teamCol))
     {
         Team workTeam = worklevel.teams.Find(team => team.color == teamCol);
         Level.Flag workFlag = new Level.Flag();
         workTeam.flagBase[0] = x;
         workTeam.flagBase[1] = y;
         workTeam.flagBase[2] = z;
         workFlag.x = x;
         workFlag.y = y;
         workFlag.z = z;
         workFlag.team = workTeam;
         worklevel.flags.Add(workFlag);
         Player.SendMessage(p, workTeam.teamname + " team" +Server.DefaultColor +" flag has been set.");
         workTeam.flagishome = true;
         p.level.Blockchange(p, x, y, z, Block.flagbase);
         p.level.Blockchange(p, x, (ushort)(y + 1), z, Block.mushroom);
         p.level.Blockchange(x, (ushort)(y + 2), z, Team.GetColorBlock(teamCol));
     }
     else
     {
         Player.SendMessage(p, "That team has not been initialized on this level.");
     }
 }
Ejemplo n.º 2
0
        public void AddFlagbase(Player p, string color, ushort x, ushort y, ushort z)
        {
            Level worklevel = p.level;
            char  teamCol   = (char)color[1];

            if (worklevel.teams.Exists(team => team.color == teamCol))
            {
                Team       workTeam = worklevel.teams.Find(team => team.color == teamCol);
                Level.Flag workFlag = new Level.Flag();
                workTeam.flagBase[0] = x;
                workTeam.flagBase[1] = y;
                workTeam.flagBase[2] = z;
                workFlag.x           = x;
                workFlag.y           = y;
                workFlag.z           = z;
                workFlag.team        = workTeam;
                worklevel.flags.Add(workFlag);
                Player.SendMessage(p, workTeam.teamname + " team" + Server.DefaultColor + " flag has been set.");
                workTeam.flagishome = true;
                p.level.Blockchange(p, x, y, z, Block.flagbase);
                p.level.Blockchange(p, x, (ushort)(y + 1), z, Block.mushroom);
                p.level.Blockchange(x, (ushort)(y + 2), z, Team.GetColorBlock(teamCol));
            }
            else
            {
                Player.SendMessage(p, "That team has not been initialized on this level.");
            }
        }