mrcrowbar.lib.games.lemmings module

File format classes for the game Lemmings (DOS, 1991).

Sources: DAT compressor http://www.camanis.net/lemmings/files/docs/lemmings_dat_file_format.txt

Level file format http://www.camanis.net/lemmings/files/docs/lemmings_lvl_file_format.txt

Vgagr/Ground DAT file formats http://www.camanis.net/lemmings/files/docs/lemmings_vgagrx_dat_groundxo_dat_file_format.txt

Main DAT file format http://www.camanis.net/lemmings/files/docs/lemmings_main_dat_file_format.txt

Vgaspec compressor/DAT file format http://www.camanis.net/lemmings/files/docs/lemmings_vgaspecx_dat_file_format.txt

Extra special thanks to ccexplore and Mindless

class mrcrowbar.lib.games.lemmings.Anim(width, height, bpp, frame_count, *args, **kwargs)[source]

Bases: mrcrowbar.blocks.Block

image_data = <Bytes: offset=0x0, transform=<mrcrowbar.lib.images.base.Planarizer object>>
mrcrowbar.lib.games.lemmings.AnimField(offset, width, height, bpp, frame_count)
class mrcrowbar.lib.games.lemmings.DATCompressor[source]

Bases: mrcrowbar.transforms.Transform

export_data(buffer, parent=None)[source]

Perform a transform on a byte string.

buffer
Source byte string.
parent
Parent object of the source (to provide context for Refs).
import_data(buffer, parent=None)[source]

Perform a reverse-transform on a byte string.

buffer
Source byte string.
parent
Parent object of the source (to provide context for Refs).
class mrcrowbar.lib.games.lemmings.GroundDAT(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
interactive_info = <BlockField: 0x00007f13d2ae9a10>

Information for every type of interactive piece.

palette
palette_ega_custom = <Palette: 0x00007f13d2ae9b10>

EGA palette used for rendering interactive/terrain pieces.

palette_ega_preview = <Palette: 0x00007f13d2ae9a90>

Extended EGA palette used for rendering the level preview.

palette_ega_standard = <Palette: 0x00007f13d2ae9ad0>

Copy of EGA palette used for rendering lemmings/action bar. Colours 0-6 are not used by the game, instead there is a palette embedded in the executable. Colour 7 is used for drawing the minimap and dirt particles.

palette_vga_custom = <Palette: 0x00007f13d2ae9b50>

VGA palette used for rendering interactive/terrain pieces.

palette_vga_preview = <Palette: 0x00007f13d2ae9bd0>

VGA palette used for rendering the level preview.

palette_vga_standard = <Palette: 0x00007f13d2ae9b90>

Copy of VGA palette used for rendering lemmings/action bar. Colours 0-6 are not used by the game, instead there is a palette embedded in the executable. Colour 7 is used for drawing the minimap and dirt particles.

terrain_info = <BlockField: 0x00007f13d2ae9a50>

Information for every type of terrain piece.

class mrcrowbar.lib.games.lemmings.Interactive(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
draw_back = <Bits: offset=0x6, bits=0b10000000>

If 1, blit image behind background.

draw_masked = <Bits: offset=0x6, bits=0b1000000>

If 1, draw piece flipped vertically.

draw_upsidedown = <Bits: offset=0x7, bits=0b10000000>

If 1, draw piece as a hole.

mod_check = <UInt16_BE: offset=0x6, bitmask=b'?\x7f'>

Check to ensure the last chunk of the block is empty.

obj_id = <UInt16_BE: offset=0x4, range=range(0, 16)>

Index of the InteractiveInfo block in the accompanying GroundDAT.

repr

Plaintext summary of the Block.

x

The x position of the left edge.

x_raw = <Int16_BE: offset=0x0, range=range(-8, 1601)>

Raw value for the x position of the left edge.

y = <Int16_BE: offset=0x2, range=range(-41, 201)>

The y position of the top edge.

class mrcrowbar.lib.games.lemmings.InteractiveImage(*args, **kwargs)[source]

Bases: mrcrowbar.blocks.Block

Represents the sprite data for an interactive object.

image_data = <Bytes: offset=0x0, transform=<mrcrowbar.lib.images.base.Planarizer object>>
mask_data = <Bytes: offset=<Ref: _parent.mask_rel_offset (rw)>, transform=<mrcrowbar.lib.images.base.Planarizer object>>
class mrcrowbar.lib.games.lemmings.InteractiveInfo(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
anim_flags = <UInt16_LE: offset=0x0>
base_offset = <UInt16_LE: offset=0x15>
end_frame = <UInt8: offset=0x3>
frame_data_size = <UInt16_LE: offset=0x6>
height = <UInt8: offset=0x5>
mask_rel_offset = <UInt16_LE: offset=0x8>
plane_padding
preview_frame = <UInt16_LE: offset=0x17>
size
sound_effect = <UInt8: offset=0x1b>

Sound effect to play. Only used when trigger_effect is set to TRAP.

start_frame = <UInt8: offset=0x2>
trigger_effect = <UInt8: offset=0x14>
trigger_height
trigger_height_raw = <UInt8: offset=0x13>
trigger_width
trigger_width_raw = <UInt8: offset=0x12>
trigger_x
trigger_x_raw = <UInt16_LE: offset=0xe>
trigger_y
trigger_y_raw = <UInt16_LE: offset=0x10>
unknown_1 = <UInt16_LE: offset=0xa>
unknown_2 = <UInt16_LE: offset=0xc>
unknown_3 = <UInt16_LE: offset=0x19>
vgagr = <StoreRef: 0x00007f13d2ae2810>
width = <UInt8: offset=0x4>
class mrcrowbar.lib.games.lemmings.Level(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
camera_x

Start x position of the camera.

camera_x_raw = <UInt16_BE: offset=0x18, range=range(0, 1265)>

Raw value for the start x position of the camera.

custom_index = <UInt16_BE: offset=0x1c>

Index denoting which Special graphic to use (optional).

interactives = <BlockField: 0x00007f13d3093750>

List of Interactive object references (32 slots).

name = <Bytes: offset=0x7e0, length=32, default=b' '>

Name of the level (ASCII string).

num_bashers = <UInt16_BE: offset=0x12, range=range(0, 251)>

Number of Basher skills.

num_blockers = <UInt16_BE: offset=0xe, range=range(0, 251)>

Number of Blocker skills.

num_bombers = <UInt16_BE: offset=0xc, range=range(0, 251)>

Number of Bomber skills.

num_builders = <UInt16_BE: offset=0x10, range=range(0, 251)>

Number of Builder skills.

num_climbers = <UInt16_BE: offset=0x8, range=range(0, 251)>

Number of Climber skills.

num_diggers = <UInt16_BE: offset=0x16, range=range(0, 251)>

Number of Digger skills.

num_floaters = <UInt16_BE: offset=0xa, range=range(0, 251)>

Number of Floater skills.

num_miners = <UInt16_BE: offset=0x14, range=range(0, 251)>

Number of Miner skills.

num_released = <UInt16_BE: offset=0x2, range=range(0, 115)>

Number of Lemmings released.

num_to_save = <UInt16_BE: offset=0x4, range=range(0, 115)>

Number of Lemmings required to be saved.

release_rate = <UInt16_BE: offset=0x0, range=range(0, 251)>

Minimum Lemming release-rate.

repr

Plaintext summary of the Block.

steel_areas = <BlockField: 0x00007f13d30937d0>

List of SteelArea object references (32 slots).

style_index = <UInt16_BE: offset=0x1a>

Index denoting which graphical Style to use.

terrains = <BlockField: 0x00007f13d3093790>

List of Terrain object references (400 slots).

time_limit_mins = <UInt16_BE: offset=0x6, range=range(0, 256)>

Time limit for the level (minutes).

class mrcrowbar.lib.games.lemmings.LevelDAT(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
levels = <BlockField: 0x00007f13d3093d50>
class mrcrowbar.lib.games.lemmings.Loader[source]

Bases: mrcrowbar.loaders.Loader

post_load()[source]
class mrcrowbar.lib.games.lemmings.MainAnims(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
anim_basher_l = <BlockField: 0x00007f13d2af0810>
anim_basher_r = <BlockField: 0x00007f13d2af07d0>
anim_blocker = <BlockField: 0x00007f13d2af0b10>
anim_bounder_l = <BlockField: 0x00007f13d2af0590>
anim_bounder_r = <BlockField: 0x00007f13d2af04d0>
anim_builder_l = <BlockField: 0x00007f13d2af0790>
anim_builder_r = <BlockField: 0x00007f13d2af0750>
anim_burner = <BlockField: 0x00007f13d2af0ad0>
anim_climber_l = <BlockField: 0x00007f13d2af0650>
anim_climber_r = <BlockField: 0x00007f13d2af0610>
anim_digger = <BlockField: 0x00007f13d2af05d0>
anim_drowner = <BlockField: 0x00007f13d2af0690>
anim_exploder = <BlockField: 0x00007f13d2af0c10>
anim_faller_l = <BlockField: 0x00007f13d2af0910>
anim_faller_r = <BlockField: 0x00007f13d2af08d0>
anim_floater_l = <BlockField: 0x00007f13d2af0a10>
anim_floater_r = <BlockField: 0x00007f13d2af0990>
anim_goner = <BlockField: 0x00007f13d2af0bd0>
anim_leaver = <BlockField: 0x00007f13d2af0a90>
anim_miner_l = <BlockField: 0x00007f13d2af0890>
anim_miner_r = <BlockField: 0x00007f13d2af0850>
anim_postclimber_l = <BlockField: 0x00007f13d2af0710>
anim_postclimber_r = <BlockField: 0x00007f13d2af06d0>
anim_prefloater_l = <BlockField: 0x00007f13d2af09d0>
anim_prefloater_r = <BlockField: 0x00007f13d2af0950>
anim_shrugger_l = <BlockField: 0x00007f13d2af0b90>
anim_shrugger_r = <BlockField: 0x00007f13d2af0b50>
anim_splatter = <BlockField: 0x00007f13d2af0a50>
anim_walker_l = <BlockField: 0x00007f13d2af0550>
anim_walker_r = <BlockField: 0x00007f13d2af0510>
class mrcrowbar.lib.games.lemmings.MainDAT(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
class mrcrowbar.lib.games.lemmings.MainHUDGraphics(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
class mrcrowbar.lib.games.lemmings.MainHUDGraphicsHP(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
class mrcrowbar.lib.games.lemmings.MainMasks(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
mask_basher_l = <BlockField: 0x00007f13d2af9490>
mask_basher_r = <BlockField: 0x00007f13d2af9450>
mask_exploder = <BlockField: 0x00007f13d2af9550>
mask_miner_l = <BlockField: 0x00007f13d2af9510>
mask_miner_r = <BlockField: 0x00007f13d2af94d0>
number_0 = <BlockField: 0x00007f13d2af97d0>
number_1 = <BlockField: 0x00007f13d2af9790>
number_2 = <BlockField: 0x00007f13d2af9750>
number_3 = <BlockField: 0x00007f13d2af9710>
number_4 = <BlockField: 0x00007f13d2af96d0>
number_5 = <BlockField: 0x00007f13d2af9690>
number_6 = <BlockField: 0x00007f13d2af9650>
number_7 = <BlockField: 0x00007f13d2af9610>
number_8 = <BlockField: 0x00007f13d2af95d0>
number_9 = <BlockField: 0x00007f13d2af9590>
class mrcrowbar.lib.games.lemmings.MainMenuAnims(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
class mrcrowbar.lib.games.lemmings.MainMenuGraphics(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
class mrcrowbar.lib.games.lemmings.MainSection5(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
class mrcrowbar.lib.games.lemmings.OddRecord(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
name = <Bytes: offset=0x18, length=32, default=b' '>

Name of the level (ASCII string).

num_bashers = <UInt16_BE: offset=0x12, range=range(0, 251)>

Number of Basher skills.

num_blockers = <UInt16_BE: offset=0xe, range=range(0, 251)>

Number of Blocker skills.

num_bombers = <UInt16_BE: offset=0xc, range=range(0, 251)>

Number of Bomber skills.

num_builders = <UInt16_BE: offset=0x10, range=range(0, 251)>

Number of Builder skills.

num_climbers = <UInt16_BE: offset=0x8, range=range(0, 251)>

Number of Climber skills.

num_diggers = <UInt16_BE: offset=0x16, range=range(0, 251)>

Number of Digger skills.

num_floaters = <UInt16_BE: offset=0xa, range=range(0, 251)>

Number of Floater skills.

num_miners = <UInt16_BE: offset=0x14, range=range(0, 251)>

Number of Miner skills.

num_released = <UInt16_BE: offset=0x2, range=range(0, 115)>

Number of Lemmings released.

num_to_save = <UInt16_BE: offset=0x4, range=range(0, 115)>

Number of Lemmings required to be saved.

release_rate = <UInt16_BE: offset=0x0, range=range(0, 251)>

Minimum Lemming release-rate.

repr

Plaintext summary of the Block.

time_limit_mins = <UInt16_BE: offset=0x6, range=range(0, 256)>

Time limit for the level (minutes).

class mrcrowbar.lib.games.lemmings.OddtableDAT(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
records = <BlockField: 0x00007f13d2ae0550>

List of OddRecord objects (80 slots).

class mrcrowbar.lib.games.lemmings.SoundEffect[source]

Bases: enum.IntEnum

An enumeration.

ASSIGN = 4
BEAR_TRAP = 15
BOMBER = 12
BUILDER = 18
CRUSH_TRAP = 7
DROWN = 17
ELECTRIC_TRAP = 6
FIRE_TRAP = 13
HATCH_OPEN = 2
HEAVY_TRAP = 14
HIT_STEEL = 10
LETS_GO = 3
NONE = 0
OH_NO = 5
ROPE_TRAP = 9
SKILL_SELECT = 1
SPLAT = 8
UNKNOWN_1 = 11
YIPPEE = 16
class mrcrowbar.lib.games.lemmings.Special(*args, **kwargs)[source]

Bases: mrcrowbar.blocks.Block

image_data = <Bytes: offset=0x28, transform=<mrcrowbar.lib.games.lemmings.SpecialCompressor object>>
palette_ega = <Palette: 0x00007f13d2af9c90>
palette_ega_preview = <Palette: 0x00007f13d2af9e50>
palette_vga = <Palette: 0x00007f13d2af9dd0>
class mrcrowbar.lib.games.lemmings.SpecialCompressor[source]

Bases: mrcrowbar.transforms.Transform

DECOMPRESSED_SIZE = 14400
export_data(buffer, parent=None)[source]

Perform a transform on a byte string.

buffer
Source byte string.
parent
Parent object of the source (to provide context for Refs).
import_data(buffer, parent=None)[source]

Perform a reverse-transform on a byte string.

buffer
Source byte string.
parent
Parent object of the source (to provide context for Refs).
plan = <mrcrowbar.lib.images.base.Planarizer object>
class mrcrowbar.lib.games.lemmings.SteelArea(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
height

Height of the steel area.

height_raw = <Bits: offset=0x2, bits=0b1111>

Raw value for the height.

mod_check = <UInt8: offset=0x3>

Check to ensure the last byte of the block is empty.

repr

Plaintext summary of the Block.

width

Width of the steel area.

width_raw = <Bits: offset=0x2, bits=0b11110000>

Raw value for the width.

x

The x position of the left edge.

x_raw_coarse = <UInt8: offset=0x0, range=range(0, 200)>

Raw value (coarse component) for the x position of the left edge.

x_raw_fine = <Bits: offset=0x1, bits=0b10000000>

Raw value (fine component) for the x position of the left edge.

y

The y position of the top edge.

y_raw = <UInt8: offset=0x1, range=range(0, 128), bitmask=b'\x7f'>

Raw value for the y position of the area’s top edge.

class mrcrowbar.lib.games.lemmings.Terrain(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
draw_back = <Bits: offset=0x0, bits=0b10000000>

If 1, blit image behind background.

draw_erase = <Bits: offset=0x0, bits=0b100000>

If 1, draw piece as a hole.

draw_upsidedown = <Bits: offset=0x0, bits=0b1000000>

If 1, draw piece flipped vertically.

obj_id = <UInt8: offset=0x3, range=range(0, 64), bitmask=b'?'>

Index of the TerrainInfo block in the accompanying GroundDAT.

repr

Plaintext summary of the Block.

unknown_1 = <Bits: offset=0x3, bits=0b1000000>
x

The x position of the left edge.

x_raw = <UInt16_BE: offset=0x0, bitmask=b'\x0f\xff'>

Raw value for the x position of the left edge.

y

The y position of the top edge.

y_raw_coarse = <Int8: offset=0x2>

Raw value (coarse component) for the y position of the top edge.

y_raw_fine = <Bits: offset=0x3, bits=0b10000000>

Raw value (fine component) for the y position of the top edge.

class mrcrowbar.lib.games.lemmings.TerrainImage(*args, **kwargs)[source]

Bases: mrcrowbar.blocks.Block

image_data = <Bytes: offset=0x0, transform=<mrcrowbar.lib.images.base.Planarizer object>>
mask_data = <Bytes: offset=<Ref: _parent.mask_offset (rw)>, transform=<mrcrowbar.lib.images.base.Planarizer object>>
class mrcrowbar.lib.games.lemmings.TerrainInfo(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
base_offset = <UInt16_LE: offset=0x2>
height = <UInt8: offset=0x1>
mask_offset
mask_rel_offset = <UInt16_LE: offset=0x4>
mask_size
mask_stride
size
unknown_1 = <UInt16_LE: offset=0x6>
vgagr = <StoreRef: 0x00007f13d2ae97d0>
width = <UInt8: offset=0x0>
class mrcrowbar.lib.games.lemmings.TriggerEffect[source]

Bases: enum.IntEnum

An enumeration.

DISINTEGRATE = 6
DROWN = 5
EXIT_LEVEL = 1
NONE = 0
ONEWAY_LEFT = 7
ONEWAY_RIGHT = 8
STEEL = 9
TRAP = 4
class mrcrowbar.lib.games.lemmings.VgagrDAT(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
interact_store
stores = <BlockField: 0x00007f13d2ae9fd0>
terrain_store
class mrcrowbar.lib.games.lemmings.VgagrStore(*args, **kwargs)[source]

Bases: mrcrowbar.blocks.Block

Represents a blob store for style graphics.

data = <Bytes: offset=0x0>
class mrcrowbar.lib.games.lemmings.VgaspecDAT(source_data=None, *, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None, strict=False)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
special = <BlockField: 0x00007f13d2b00150>