Пример #1
0
        protected override void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type, byte extType) {
            RevertAndClearState(p, x, y, z);
            CatchPos cpos = (CatchPos)p.blockchangeObject;
            GetRealBlock(type, extType, p, ref cpos);
            DrawOp drawOp = null;
            Brush brush = new SolidBrush(cpos.type, cpos.extType);
            
            if (y != cpos.y) {
                Player.SendMessage(p, "The two edges of the pyramid must be on the same level");
                return;
            }

            switch (cpos.solid) {
                case SolidType.solid:
                    drawOp = new PyramidSolidDrawOp(); break;
                case SolidType.hollow:
                    drawOp = new PyramidHollowDrawOp(); break;
                case SolidType.reverse:
                    drawOp = new PyramidReverseDrawOp(); break;
            }
            
            ushort x1 = Math.Min(cpos.x, x), x2 = Math.Max(cpos.x, x);
            ushort y1 = Math.Min(cpos.y, y), y2 = Math.Max(cpos.y, y);
            ushort z1 = Math.Min(cpos.z, z), z2 = Math.Max(cpos.z, z);            
            if (!DrawOp.DoDrawOp(drawOp, brush, p, x1, y1, z1, x2, y2, z2))
                return;
            if (p.staticCommands)
                p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
        }
Пример #2
0
        protected override void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type, byte extType)
        {
            RevertAndClearState(p, x, y, z);
            CatchPos cpos = (CatchPos)p.blockchangeObject;

            GetRealBlock(type, extType, p, ref cpos);
            DrawOp drawOp      = null;
            int    brushOffset = cpos.mode == DrawMode.normal ? 0 : 1;
            Brush  brush       = GetBrush(p, cpos, brushOffset);

            if (brush == null)
            {
                return;
            }

            if (y != cpos.y)
            {
                Player.SendMessage(p, "The two edges of the pyramid must be on the same level");
                return;
            }

            switch (cpos.mode)
            {
            case DrawMode.solid:
            case DrawMode.normal:
                drawOp = new PyramidSolidDrawOp(); break;

            case DrawMode.hollow:
                drawOp = new PyramidHollowDrawOp(); break;

            case DrawMode.reverse:
                drawOp = new PyramidReverseDrawOp(); break;
            }

            if (!DrawOp.DoDrawOp(drawOp, brush, p, cpos.x, cpos.y, cpos.z, x, y, z))
            {
                return;
            }
            if (p.staticCommands)
            {
                p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
            }
        }