コード例 #1
0
        public override bool UseBlock(int x, int y, BaseDimension dimension, DynamicEntity entity)
        {
            var xDoor  = x;
            var yDoor  = y + (2 - dimension.MapTile[x, y].IdSubTexture);
            int idDoor = dimension.MapTile[xDoor, yDoor].IdTexture;

            for (var j = 0; j < 3; j++)
            {
                dimension.Reset(xDoor, yDoor - j);
            }
            dimension.AddDoor(idDoor, xDoor, yDoor, true);
            return(true);
        }
コード例 #2
0
ファイル: OpenDoor.cs プロジェクト: FLYOFFLY/TwoSides
        public override bool UseBlock(int x, int y, BaseDimension dimension, DynamicEntity entity)
        {
            var xDoor  = x;
            var yDoor  = y + (2 - dimension.MapTile[x, y].IdSubTexture);
            int iddoor = dimension.MapTile[xDoor, yDoor].IdTexture;

            if (dimension.MapTile[xDoor, yDoor].IdTexture == dimension.MapTile[xDoor - 1, yDoor].IdTexture)
            {
                xDoor -= 1;
            }
            for (var i = 0; i < 2; i++)
            {
                for (var j = 0; j < 3; j++)
                {
                    dimension.Reset(xDoor + i, yDoor - j);
                }
            }
            dimension.AddDoor(iddoor - 1, xDoor, yDoor, false);
            return(true);
        }