Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Called at game over screen
void __cdecl update_fireworks(int player_data)
{
if ( *(_BYTE *)(player_data + 0xF2) & 2 && *(_BYTE *)(player_data + 0x16) & 1 )// master mode, logged in
{
if ( (double)(random(&seed, 1) % 20000) < 625.0 )
++*(_WORD *)(player_data + 0x1216); // +0x1216 = fireworks count
if ( (double)(random(&seed, 1) % 20000) < 312.5 )
++*(_WORD *)(player_data + 0x1216);
if ( (double)(random(&seed, 1) % 20000) < 4.8828125 )
*(_WORD *)(player_data + 0x1216) += random(&seed, 1) % 3 + 6;
if ( *(_BYTE *)(player_data + 0x30) ) // eligible for promo exam?
{
if ( (double)(random(&seed, 1) % 20000) < 6666.6665 )
++*(_WORD *)(player_data + 0x1216);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.