Skip to content

Commit

Permalink
Select
Browse files Browse the repository at this point in the history
- Changed Select message a bit.
- New stat: select count.
- Added debug menu option to reset stats.
  • Loading branch information
tustin2121 committed Aug 10, 2019
1 parent 16708a9 commit d65550a
Show file tree
Hide file tree
Showing 7 changed files with 385 additions and 7 deletions.
7 changes: 1 addition & 6 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -2180,9 +2180,6 @@ gUnknown_08272C1D:: @ 8272C1D
gUnknown_08272C5F:: @ 8272C5F
.string "The sandstorm is vicious.\nIt's impossible to keep going.$"

gText_SelectWithoutRegisteredItem:: @ 8272C98
.string "An item in the BAG can be\nregistered to SELECT for easy use.$"

gUnknown_08272CD5:: @ 8272CD5
.string "There's an e-mail from Pokémon TRAINER\nSCHOOL.\p… … … … … …\pA Pokémon may learn up to four moves.\pA TRAINER's expertise is tested on the\nmove sets chosen for Pokémon.\p… … … … … …$"

Expand Down Expand Up @@ -2283,9 +2280,7 @@ gText_UnusualWeatherEnded_Rain:: @ 8273656
gText_UnusualWeatherEnded_Sun:: @ 8273684
.string "The intense sunshine appears to\nhave subsided…$"

EventScript_SelectWithoutRegisteredItem:: @ 82736B3
msgbox gText_SelectWithoutRegisteredItem, MSGBOX_SIGN
end
.include "data/scripts/select.inc"

EventScript_UnusedSetVarResult1:: @ 827374F
setvar VAR_RESULT, 1
Expand Down
314 changes: 314 additions & 0 deletions data/scripts/select.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,314 @@

#define SELECT_DELAY_TIME 80

EventScript_SelectWithoutRegisteredItem:: @ 82736B3
lockall
incrementgamestat GAME_STAT_SELECT_PRESSES
callnative DetermineSelectMessage
switch VAR_0x800B
case 0, EventScript_SelectWithoutRegisteredItem_Normal
case 1, EventScript_SelectWithoutRegisteredItem_Talk
case 3, EventScript_SelectWithoutRegisteredItem_CountWoo
case 4, EventScript_SelectWithoutRegisteredItem_Maxed
goto EventScript_SelectWithoutRegisteredItem_Count
end
gText_SelectWithoutRegisteredItem: @ 8272C98
.string "An item in the bag can be\n"
.string "registered to SELECT for easy use.$"


EventScript_SelectWithoutRegisteredItem_Normal:
selectpointer_clamp EventScript_SelectWithoutRegisteredItem_TextTable, VAR_RESULT
message 0, MSGTYPE_STANDARD
waitmessage
delay 40
releaseall
end

EventScript_SelectWithoutRegisteredItem_Talk:
selectpointer_clamp EventScript_SelectWithoutRegisteredItem_TalkTable, VAR_RESULT
buffernumberstring 0, VAR_0x800A
message 0, MSGTYPE_STANDARD
waitmessage
delay SELECT_DELAY_TIME
releaseall
end

EventScript_SelectWithoutRegisteredItem_Count:
buffernumberstring 0, VAR_0x800A
message gText_SelectSectCount, MSGTYPE_STANDARD
waitmessage
delay SELECT_DELAY_TIME
releaseall
end
gText_SelectSectCount: @ 8272C98
.string "SELECT {STR_VAR_1}$"

EventScript_SelectWithoutRegisteredItem_CountWoo:
buffernumberstring 0, VAR_0x800A
message gText_SelectSectCountWoo, MSGTYPE_STANDARD
waitmessage
delay SELECT_DELAY_TIME
releaseall
end
gText_SelectSectCountWoo: @ 8272C98
.string "SELECT {STR_VAR_1}! Woo!$"

EventScript_SelectWithoutRegisteredItem_Maxed:
message gText_SelectSectCountWoo, MSGTYPE_STANDARD
waitmessage
delay SELECT_DELAY_TIME
releaseall
end
gText_SelectSectCountMaxed:
.string "SELECT to the MAX!$"




.align 2
EventScript_SelectWithoutRegisteredItem_TextTable:
.4byte gText_SelectWithoutRegisteredItem
.4byte gText_SelectWRI_1
.4byte gText_SelectWRI_2
.4byte gText_SelectWRI_3
.4byte gText_SelectWRI_4
.4byte gText_SelectWRI_5
.4byte gText_SelectWRI_6
.4byte gText_SelectWRI_7
.4byte gText_SelectWRI_8
.4byte gText_SelectWRI_9
.4byte gText_SelectWRI_10
.4byte gText_SelectWRI_11
.4byte gText_SelectWRI_12
.4byte gText_SelectWRI_13
.4byte gText_SelectWRI_14
.4byte gText_SelectWRI_15
.4byte gText_SelectWRI_16
.4byte gText_SelectWRI_17
.4byte 0

gText_SelectWRI_1:
.string "An item in the bag may be\n"
.string "registered to SELECT for easy use.$"
gText_SelectWRI_2:
.string "An item in the bag could be\n"
.string "registered to SELECT for easy use.$"
gText_SelectWRI_3:
.string "An item in the bag should be\n"
.string "registered to SELECT for easy use.$"
gText_SelectWRI_4:
.string "An item in the bag would be\n"
.string "registered to SELECT for easy use.$"
gText_SelectWRI_5:
.string "An item in the bag may be\n"
.string "registered to SELECT for simple use.$"
gText_SelectWRI_6:
.string "An item in the bag may be\n"
.string "registered to SELECT for common use.$"
gText_SelectWRI_7:
.string "An item in the bag could be\n"
.string "registered to SELECT for hard use.$"
gText_SelectWRI_8:
.string "An item in the bag may be\n"
.string "registered to SELECT for often use.$"
gText_SelectWRI_9:
.string "An item in the bag has been\n"
.string "registered to SELECT for no use.$"
gText_SelectWRI_10:
.string "An item in the bag may be\n"
.string "registered to SELECT for abuse.$"
gText_SelectWRI_11:
.string "An item in the bag should be\n"
.string "registered to SELECT for abuse.$"
gText_SelectWRI_12:
.string "An item in the bag is worth\n"
.string "registering to SELECT for abuse.$"
gText_SelectWRI_13:
.string "No item in the bag is worth\n"
.string "registering to SELECT for abuse.$"
gText_SelectWRI_14:
.string "Some item in the bag is worth\n"
.string "registering to SELECT for abuse.$"
gText_SelectWRI_15:
.string "Any item in the bag is worth\n"
.string "registering to SELECT for abuse.$"
gText_SelectWRI_16:
.string "Are you ever gonna register an item\n"
.string "in the bag to SELECT for use?$"
gText_SelectWRI_17:
.string "Seriously, though, go register an\n"
.string "item in the bag to SELECT already.$"



.align 2
EventScript_SelectWithoutRegisteredItem_TalkTable:
.4byte gText_SelectWRI_TheTalk00
.4byte gText_SelectWRI_TheTalk01
.4byte gText_SelectWRI_TheTalk02
.4byte gText_SelectWRI_TheTalk03
.4byte gText_SelectWRI_TheTalk04
.4byte gText_SelectWRI_TheTalk05
.4byte gText_SelectWRI_TheTalk06
.4byte gText_SelectWRI_TheTalk07
.4byte gText_SelectWRI_TheTalk08
.4byte gText_SelectWRI_TheTalk09
.4byte gText_SelectWRI_TheTalk10
.4byte gText_SelectWRI_TheTalk11
.4byte gText_SelectWRI_TheTalk12
.4byte gText_SelectWRI_TheTalk13
.4byte gText_SelectWRI_TheTalk14
.4byte gText_SelectWRI_TheTalk15
.4byte gText_SelectWRI_TheTalk16
.4byte gText_SelectWRI_TheTalk17
.4byte gText_SelectWRI_TheTalk18
.4byte gText_SelectWRI_TheTalk19
.4byte gText_SelectWRI_TheTalk20
.4byte gText_SelectWRI_TheTalk21
.4byte gText_SelectWRI_TheTalk22
.4byte gText_SelectWRI_TheTalk23
.4byte gText_SelectWRI_TheTalk24
.4byte gText_SelectWRI_TheTalk25
.4byte gText_SelectWRI_TheTalk26
.4byte gText_SelectWRI_TheTalk27
.4byte gText_SelectWRI_TheTalk28
.4byte gText_SelectWRI_TheTalk29
.4byte gText_SelectWRI_TheTalk30
.4byte gText_SelectWRI_TheTalk31
.4byte gText_SelectWRI_TheTalk32
.4byte gText_SelectWRI_TheTalk33
.4byte gText_SelectWRI_TheTalk34
.4byte gText_SelectWRI_TheTalk35
.4byte gText_SelectWRI_TheTalk36
.4byte gText_SelectWRI_TheTalk37
.4byte gText_SelectWRI_TheTalk38
.4byte gText_SelectWRI_TheTalk39
.4byte gText_SelectWRI_TheTalk40
.4byte gText_SelectWRI_TheTalk41
.4byte gText_SelectWRI_TheTalk42
.4byte gText_SelectWRI_TheTalk43
.4byte gText_SelectSectCount @gText_SelectWRI_TheTalk44
.4byte gText_SelectSectCount @gText_SelectWRI_TheTalk45
.4byte gText_SelectWRI_TheTalk46
.4byte gText_SelectWRI_TheTalk47
.4byte gText_SelectWRI_TheTalk48
.4byte gText_SelectSectCount @gText_SelectWRI_TheTalk49
.4byte 0

gText_SelectWRI_TheTalk00:
.string "Seriously, though, go register an\n"
.string "item… ugh.$"
gText_SelectWRI_TheTalk01:
.string "Hey.$"
gText_SelectWRI_TheTalk02:
.string "Hey chat.$"
gText_SelectWRI_TheTalk03:
.string "Guess what.$"
gText_SelectWRI_TheTalk04:
.string "You pressed SELECT over 400 times now.$"
gText_SelectWRI_TheTalk05:
.string "That's right, I've been counting.$"
gText_SelectWRI_TheTalk06:
.string "What is wrong with you?$"
gText_SelectWRI_TheTalk07:
.string "Are you insane?$"
gText_SelectWRI_TheTalk08:
.string "Like seriously, get out of my head.$"
gText_SelectWRI_TheTalk09:
.string "But really, what is your obsession\n"
.string "with SELECT?$"
gText_SelectWRI_TheTalk10:
.string "I keep hearing you there…$"
gText_SelectWRI_TheTalk11:
.string "Jabbering on and on about things\n"
.string "that are beyond me…$"
gText_SelectWRI_TheTalk12:
.string "But then there's SELECT…$"
gText_SelectWRI_TheTalk13:
.string "It's constant.$"
gText_SelectWRI_TheTalk14:
.string "I see you now, saying it.$"
gText_SelectWRI_TheTalk15:
.string "The chat is a wall of SELECT.$"
gText_SelectWRI_TheTalk16:
.string "Why? What is its purpose?$"
gText_SelectWRI_TheTalk17:
.string "What is the purpose of SELECT?$"
gText_SelectWRI_TheTalk18:
.string "Do you really need to say it\n"
.string "so many times?$"
gText_SelectWRI_TheTalk19:
.string "Like it's constant. Non-stop.$"
gText_SelectWRI_TheTalk20:
.string "SELECT!$"
gText_SelectWRI_TheTalk21:
.string "SELECT!!$"
gText_SelectWRI_TheTalk22:
.string "SELECT!!!$"
gText_SelectWRI_TheTalk23:
.string "SELECT!!!!$"
gText_SelectWRI_TheTalk24:
.string "SELECT!!!!!$"
gText_SelectWRI_TheTalk25:
.string "You're giving me a migrane with all\n"
.string "that SELECT!$"
gText_SelectWRI_TheTalk26:
.string "And to what end?$"
gText_SelectWRI_TheTalk27:
.string "To irritate me?$"
gText_SelectWRI_TheTalk28:
.string "To irritate each other?$"
gText_SelectWRI_TheTalk29:
.string "It is like some sort of cult chant\n"
.string "or something?$"
gText_SelectWRI_TheTalk30:
.string "Oh, now I'm concerned, chat.$"
gText_SelectWRI_TheTalk31:
.string "If this is something cult-like…$"
gText_SelectWRI_TheTalk32:
.string "Like if you start breaking out\n"
.string "Illuminati symbols or something…$"
gText_SelectWRI_TheTalk33:
.string "Oh…$"
gText_SelectWRI_TheTalk34:
.string "Oh no…$"
gText_SelectWRI_TheTalk35:
.string "Oh, what have I done now…$"
gText_SelectWRI_TheTalk36:
.string "I mean… I guess its plausable…$"
gText_SelectWRI_TheTalk37:
.string "Like, Team Magma is a conspiracy to\n"
.string "expand the land…$"
gText_SelectWRI_TheTalk38:
.string "And Team Aqua… well…\n"
.string "I'm sure you know.$"
gText_SelectWRI_TheTalk39:
.string "So I guess a conspiracy to say\n"
.string "SELECT as often as possible…$"
gText_SelectWRI_TheTalk40:
.string "It's {BOLD}stupid{END} but it's not\n"
.string "wholly impossible…$"
gText_SelectWRI_TheTalk41:
.string "Alright, you “SELECT SECT”…$"
gText_SelectWRI_TheTalk42:
.string "I'll play along…$"
gText_SelectWRI_TheTalk43:
.string "As if I have a choice, what with you\n"
.string "being in my head and all…$"
@ gText_SelectWRI_TheTalk44:
@ .string "SELECT {STR_VAR_1}$"
@ gText_SelectWRI_TheTalk45:
@ .string "SELECT {STR_VAR_1}$"
gText_SelectWRI_TheTalk46:
.string "I wonder what my father would think\n"
.string "of me joining a cult…$"
gText_SelectWRI_TheTalk47:
.string "It's not like it's a big leap for me…$"
gText_SelectWRI_TheTalk48:
.string "Oh, sorry… SELECT {STR_VAR_1}$"
@ gText_SelectWRI_TheTalk49:
@ .string "SELECT {STR_VAR_1}$"


#undef SELECT_DELAY_TIME
3 changes: 2 additions & 1 deletion include/constants/game_stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@
#define GAME_STAT_NUM_PARTY_CASUALTIES 54
#define GAME_STAT_NUM_THINGS_STOLEN 55
#define GAME_STAT_NUM_E4_ATTEMPTS 56
#define GAME_STAT_SELECT_PRESSES 57

#define NUM_USED_GAME_STATS 57
#define NUM_USED_GAME_STATS 58
#define NUM_GAME_STATS 64

#endif // GUARD_CONSTANTS_GAME_STAT_H
49 changes: 49 additions & 0 deletions src/item_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2431,3 +2431,52 @@ void PrintTMHMMoveData(u16 itemId)
CopyWindowToVram(4, 2);
}
}

#define SELECT_START_COUNT 1

void DetermineSelectMessage()
{
gSpecialVar_0x800A = GetGameStat(GAME_STAT_SELECT_PRESSES);
gSpecialVar_0x800B = 0;
gSpecialVar_Result = 0;
if (gSpecialVar_0x800A < SELECT_START_COUNT) return; //do nothing special if under 100 presses
if (gSpecialVar_0x800A < SELECT_START_COUNT + 100) //from 101 to 200, subtily vary the messages
{
gSpecialVar_Result = 1 + (gSpecialVar_0x800A - SELECT_START_COUNT) / 10;
return;
}
if (gSpecialVar_0x800A < SELECT_START_COUNT + 200) //from 201 to 300, vary the messages more for longer
{
gSpecialVar_Result = 11 + (gSpecialVar_0x800A - (SELECT_START_COUNT+100)) / 20;
return;
}
if (gSpecialVar_0x800A < SELECT_START_COUNT + 250) //from 301 to 350, ask chat why
{
gSpecialVar_Result = 16;
return;
}
if (gSpecialVar_0x800A < SELECT_START_COUNT + 300) //from 351 to 400, ask chat please
{
gSpecialVar_Result = 17;
return;
}
if (gSpecialVar_0x800A < SELECT_START_COUNT + 350) //from 401 to 450, do "the talk"
{
gSpecialVar_Result = gSpecialVar_0x800A - (SELECT_START_COUNT + 300);
gSpecialVar_0x800B = 1;
return;
}
if (gSpecialVar_0x800A % 1000 == 0)
{
gSpecialVar_0x800B = 3;
return;
}
if (gSpecialVar_0x800A == 65535)
{
gSpecialVar_0x800B = 4;
}
gSpecialVar_0x800B = 2;
return;
}

#undef SELECT_START_COUNT
Loading

0 comments on commit d65550a

Please sign in to comment.