Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // NAME: RandomShopsInC(v2)
- // GAMES: MP3_USA
- // EXECUTION: Direct
- typedef signed char s8;
- typedef unsigned char u8;
- typedef signed short int s16;
- typedef unsigned short int u16;
- typedef signed int s32;
- typedef unsigned int u32;
- typedef float f32;
- typedef double f64;
- extern s16 GetCurrentPlayerIndex();
- extern struct player *GetPlayerStruct(s32 player_index);
- extern s32 PlayerHasEmptyItemSlot(s32 player_index);
- void main() {
- s32 cur_player_index = GetCurrentPlayerIndex();
- s32 open_index = PlayerHasEmptyItemSlot(cur_player_index);
- if (open_index != -1) {
- struct player *player = GetPlayerStruct(cur_player_index);
- // player->items[open_index] = 0x0A; // Golden Mushroom (errors on this line)
- }
- }
- //====================================================================
- // Data defined below
- //====================================================================
- asm(".definelabel ShopFormatters, 0");
- asm(
- ".align 0x10\n"
- //"ShopMenuFormatters:
- ".byte 0x0B\n" // Start the message
- ".byte 0x06\n" // Blue font
- ".byte 0x0E, 0x0E\n" //Tab x2
- ".byte 0x0C\n" //start option
- ".ascii \"%s\"\n" //Item 1 String
- ".ascii \"%s\"\n" //specific item indentation
- ".byte 0x08\n" // White Font
- ".byte 0x29\n" //coin icon
- ".byte 0x3E\n" //x after coin icon
- ".ascii \"%s\"\n"//Item 1 Cost
- ".byte 0x0D\n" // End option
- ".byte 0x0A\n" // Newline
- //
- ".byte 0x06\n" // Blue font
- ".byte 0x0E, 0x0E\n" //Tab x2
- ".byte 0x0C\n" //start option
- ".ascii \"%s\"\n" //Item 2 String
- ".ascii \"%s\"\n" //specific item indentation
- ".byte 0x08\n" // White Font
- ".byte 0x29\n" //coin icon
- ".byte 0x3E\n" //x after coin icon
- ".ascii \"%s\"\n" //Item 2 Cost
- ".byte 0x0D\n" // End option
- ".byte 0x0A\n" // Newline
- //
- ".byte 0x06\n" // Blue font
- ".byte 0x0E, 0x0E\n" //Tab x2
- ".byte 0x0C\n" //start option
- ".ascii \"%s\"\n" //Item 3 String
- ".ascii \"%s\"\n" //specific item indentation
- ".byte 0x08\n" // White Font
- ".byte 0x29\n" //coin icon
- ".byte 0x3E\n" //x after coin icon
- ".ascii \"%s\"\n" //Item 3 Cost
- ".byte 0x0D\n" // End option
- //
- ".byte 0x00" //end of text box
- );
- asm(".definelabel ItemChances, 1");
- asm(
- ".align 0x10\n"
- //ItemChances:
- ".byte 0x0B\n" // Mushroom (00-0B) 10%
- ".byte 0x15\n" // Skeleton Key (0C-14) 10%
- ".byte 0x1B\n" // Poison Mushroom 6%
- ".byte 0x21\n" // Reverse Mushroom 6%
- ".byte 0x27\n" // Cellular Shopper 6%
- ".byte 0x2D\n" // Warp Block 6%
- ".byte 0x33\n" // Plunder Chest 6%
- ".byte 0x39\n" // Bowser Phone 6%
- ".byte 0x3F\n" // Dueling Glove 6%
- ".byte 0x45\n" // Lucky Lamp 6%
- ".byte 0x4B\n" // Golden Mushroom 6%
- ".byte 0x51\n" // Boo Bell 6%
- ".byte 0x59\n" // Boo Repellant 8%
- ".byte 0x5F\n" // Bowser Suit 6%
- ".byte 0x64\n" // Magic Lamp 5%
- ".byte 0x64\n" // Koopa Kard
- ".byte 0x64\n" // Barter Box
- ".byte 0x64\n" // Lucky Charm
- ".byte 0x64\n" // Wacky Watch
- );
- //ItemsEnum
- //byte 0x00 // Mushroom
- //byte 0x01 // Skeleton Key
- //byte 0x02 // Poison Mushroom
- //byte 0x03 // Reverse Mushroom
- //byte 0x04 // Cellular Shopper
- //byte 0x05 // Warp Block
- //byte 0x06 // Plunder Chest
- //byte 0x07 // Bowser Phone
- //byte 0x08 // Dueling Glove
- //byte 0x09 // Lucky Lamp
- //byte 0x0A // Golden Mushroom
- //byte 0x0B // Boo Bell
- //byte 0x0C // Boo Repellant
- //byte 0x0D // Bowser Suit
- //byte 0x0E // Magic Lamp
- //byte 0x0F // Koopa Kard
- //byte 0x10 // Barter Box
- //byte 0x11 // Lucky Charm
- //byte 0x12 // Wacky Watch
- //====================================================================
- // Structs defined below
- //====================================================================
- struct playermain {
- s8 unk0; //0x00
- s8 cpu_difficulty; //0x01
- s8 controller; //0x02
- u8 character; //0x03
- u8 flags; //0x04
- s8 pad0[5]; //0x05-0x09
- s16 coins; //0x0A-0x0B
- s16 minigame_coins; //0x0C-0x0D
- s8 stars; //0x0E
- u8 cur_chain_index; //0x0F
- u8 cur_space_index; //0x10
- u8 next_chain_index; //0x11
- u8 next_space_index; //0x12
- u8 unk1_chain_index; //0x13
- u8 unk1_space_index; //0x14
- u8 reverse_chain_index; //0x15
- u8 reverse_space_index; //0x16
- u8 flags2; //0x17
- u8 items[3]; //0x18-0x1A
- u8 bowser_suit_flag; //0x1B
- u8 turn_color_status; //0x1C
- s8 pad1[7]; //0x1D-0x23
- void *playerpos; //0x24-0x27
- s16 minigame_star; //0x28-0x29
- s16 coin_star; //0x2A-0x2B
- s8 happening_space_count;//0x2C
- s8 red_space_count; //0x2D
- s8 blue_space_count; //0x2E
- s8 chance_space_count; //0x2F
- s8 bowser_space_count; //0x30
- s8 battle_space_count; //0x31
- s8 item_space_count; //0x32
- s8 bank_space_count; //0x33
- s8 game_guy_space_count;//0x34
- s8 pad3[3]; //0x35-0x37
- }; // sizeof == 56, 0x38
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement