Exemple #1
0
        public void portalCuboid2(Player p, ushort x, ushort y, ushort z, byte type)
        {
            p.ClearBlockchange();
            byte b = p.level.GetTile(x, y, z);

            p.SendBlockchange(x, y, z, b);
            portalPos bp = (portalPos)p.blockchangeObject;

            if (bp.Multi != "cuboid")
            {
                Player.SendMessage(p, "lolwut, glitch :/"); return;
            }
            portPos pos = bp.port[0];

            if (pos.portMapName != p.level.name)
            {
                Player.SendMessage(p, "Portal cuboid must be on same map as first point."); return;
            }
            ushort xx; ushort yy; ushort zz; portPos port; int counter = 0;

            for (xx = Math.Min(pos.x, x); xx <= Math.Max(pos.x, x); ++xx)
            {
                for (yy = Math.Min(pos.y, y); yy <= Math.Max(pos.y, y); ++yy)
                {
                    for (zz = Math.Min(pos.z, z); zz <= Math.Max(pos.z, z); ++zz)
                    {
                        counter++;
                        port   = new portPos();
                        port.x = xx; port.y = yy; port.z = zz; port.portMapName = p.level.name;
                        bp.port.Add(port);
                        p.level.Blockchange(xx, yy, zz, bp.type);
                        p.SendBlockchange(xx, yy, zz, Block.green);
                    }
                }
            }
            p.blockchangeObject = bp;
            Player.SendMessage(p, "Cuboided " + counter + " portals.");
            if (bp.port.Count != (counter + 1))
            {
                Player.SendMessage(p, "You have " + bp.port.Count + " portals in total.");
            }
            Player.SendMessage(p, "&aYou can continue cuboiding, or &cplace a red block for exit.");
            p.Blockchange += new Player.BlockchangeEventHandler(portalCuboid1);
        }
Exemple #2
0
        public void portalCuboid1(Player p, ushort x, ushort y, ushort z, byte type)
        {
            p.ClearBlockchange();
            if (type == Block.red)
            {
                ExitChange(p, x, y, z, type); return;
            }
            byte b = p.level.GetTile(x, y, z);

            p.SendBlockchange(x, y, z, b);
            portalPos bp = (portalPos)p.blockchangeObject;

            if (bp.Multi != "cuboid")
            {
                Player.SendMessage(p, "lolwut, glitch :/"); return;
            }
            portPos port = new portPos();

            port.x = x; port.y = y; port.z = z; port.portMapName = p.level.name;
            bp.port.Add(port);
            p.blockchangeObject = bp;
            p.Blockchange      += new Player.BlockchangeEventHandler(portalCuboid2);
        }
Exemple #3
0
 public void portalCuboid2(Player p, ushort x, ushort y, ushort z, byte type)
 {
     p.ClearBlockchange();
     byte b = p.level.GetTile(x, y, z);
     p.SendBlockchange(x, y, z, b);
     portalPos bp = (portalPos)p.blockchangeObject;
     if (bp.Multi != "cuboid") { Player.SendMessage(p, "lolwut, glitch :/"); return; }
     portPos pos = bp.port[0];
     if (pos.portMapName != p.level.name) { Player.SendMessage(p, "Portal cuboid must be on same map as first point."); return; }
     ushort xx; ushort yy; ushort zz; portPos port; int counter = 0;
     for (xx = Math.Min(pos.x, x); xx <= Math.Max(pos.x, x); ++xx)
         for (yy = Math.Min(pos.y, y); yy <= Math.Max(pos.y, y); ++yy)
             for (zz = Math.Min(pos.z, z); zz <= Math.Max(pos.z, z); ++zz)
             {
                 counter++;
                 port = new portPos();
                 port.x = xx; port.y = yy; port.z = zz; port.portMapName = p.level.name;
                 bp.port.Add(port);
                 p.level.Blockchange(xx, yy, zz, bp.type);
                 p.SendBlockchange(xx, yy, zz, Block.green);
             }
     p.blockchangeObject = bp;
     Player.SendMessage(p, "Cuboided " + counter + " portals.");
     if (bp.port.Count != (counter + 1)) { Player.SendMessage(p, "You have " + bp.port.Count + " portals in total."); }
     Player.SendMessage(p, "&aYou can continue cuboiding, or &cplace a red block for exit.");
     p.Blockchange += new Player.BlockchangeEventHandler(portalCuboid1);
 }
Exemple #4
0
 public void portalCuboid1(Player p, ushort x, ushort y, ushort z, byte type)
 {
     p.ClearBlockchange();
     if (type == Block.red) { ExitChange(p, x, y, z, type); return; }
     byte b = p.level.GetTile(x, y, z);
     p.SendBlockchange(x, y, z, b);
     portalPos bp = (portalPos)p.blockchangeObject;
     if (bp.Multi != "cuboid") { Player.SendMessage(p, "lolwut, glitch :/"); return; }
     portPos port = new portPos();
     port.x = x; port.y = y; port.z = z; port.portMapName = p.level.name;
     bp.port.Add(port);
     p.blockchangeObject = bp;
     p.Blockchange += new Player.BlockchangeEventHandler(portalCuboid2);
 }