Skip to content

Instantly share code, notes, and snippets.

@ChadSki
Last active December 24, 2015 03:29
Show Gist options
  • Select an option

  • Save ChadSki/6737365 to your computer and use it in GitHub Desktop.

Select an option

Save ChadSki/6737365 to your computer and use it in GitHub Desktop.
Dictionary literal plugins
# dictionary layouts, with inheritance
obje = HaloStruct(layout={
'model': reference(offset=0x28),
'animation': reference(offset=0x38),
'collision': reference(offset=0x70),
'physics': reference(offset=0x80),
})
weap = HaloStruct(parent=obje, layout={
'magazines': reflexive(offset=0x4F0, size=112, layout={
'rounds_recharged': uint16(offset=0x4),
'rounds_total_initial': uint16(offset=0x6),
'rounds_total_maximum': uint16(offset=0x8),
'rounds_loaded_maximum': uint16(offset=0xA),
}),
'triggers': reflexive(offset=0x4FC, size=276, layout={
'initial_rounds_per_second': float32(offset=0x4),
'final_rounds_per_second': float32(offset=0x8),
'rounds_per_second_acceleration': float32(offset=0x8),
'rounds_per_second_deceleration': float32(offset=0x8),
'projectiles_per_shot': uint16(offset=0x6E),
'projectile': reference(offset=0x94),
'firing_effects': reflexive(offset=0x108, size=132, layout={
'fire_effect': reference(offset=0x24),
'misfire_effect': reference(offset=0x34),
'no_ammo_effect': reference(offset=0x44),
'fire_damage': reference(offset=0x54),
'misfire_damage': reference(offset=0x64),
'no_ammo_damage': reference(offset=0x74),
}),
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment