Use STR_VAR names for apprentice_buff and frontier_gettrainername

This commit is contained in:
GriffinR 2021-11-18 23:20:05 -05:00
parent e66ea0cb99
commit 42a83ee50e
4 changed files with 37 additions and 23 deletions

View File

@ -94,11 +94,19 @@
@ Buffer some APPRENTICE_BUFF_* string to the given stringvar (0 for STR_VAR_1, 1 for STR_VAR_2, 2 for STR_VAR_3) @ Buffer some APPRENTICE_BUFF_* string to the given stringvar (0 for STR_VAR_1, 1 for STR_VAR_2, 2 for STR_VAR_3)
.macro apprentice_buff stringvar:req, tobuff:req .macro apprentice_buff stringvar:req, tobuff:req
setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING
setvar VAR_0x8005, \stringvar .if \stringvar == STR_VAR_1
.if \tobuff >= VARS_START setvar VAR_0x8005, 0
copyvar VAR_0x8006, \tobuff .elseif \stringvar == STR_VAR_2
setvar VAR_0x8005, 1
.elseif \stringvar == STR_VAR_3
setvar VAR_0x8005, 2
.else .else
setvar VAR_0x8006, \tobuff setvar VAR_0x8005, \stringvar
.endif
.if \tobuff >= VARS_START
copyvar VAR_0x8006, \tobuff
.else
setvar VAR_0x8006, \tobuff
.endif .endif
special CallApprenticeFunction special CallApprenticeFunction
.endm .endm

View File

@ -136,7 +136,13 @@
@ Buffer the name of gTrainerBattleOpponent_A in STR_VAR_1 (0) or STR_VAR_2 (1) @ Buffer the name of gTrainerBattleOpponent_A in STR_VAR_1 (0) or STR_VAR_2 (1)
.macro frontier_gettrainername stringVar:req .macro frontier_gettrainername stringVar:req
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_BUFFER_TRAINER_NAME setvar VAR_0x8004, FRONTIER_UTIL_FUNC_BUFFER_TRAINER_NAME
setvar VAR_0x8005, \stringVar .if \stringVar == STR_VAR_1
setvar VAR_0x8005, 0
.elseif \stringVar == STR_VAR_2
setvar VAR_0x8005, 1
.else
setvar VAR_0x8005, \stringVar
.endif
special CallFrontierUtilFunc special CallFrontierUtilFunc
.endm .endm

View File

@ -118,13 +118,13 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_WarpToLobbyLost::
goto BattleFrontier_BattleDomeBattleRoom_EventScript_WarpToLobby goto BattleFrontier_BattleDomeBattleRoom_EventScript_WarpToLobby
BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWon:: BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWon::
frontier_gettrainername 1 frontier_gettrainername STR_VAR_2
message BattleFrontier_BattleDomeBattleRoom_Text_TrainerIsWinner message BattleFrontier_BattleDomeBattleRoom_Text_TrainerIsWinner
waitmessage waitmessage
return return
BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWonDraw:: BattleFrontier_BattleDomeBattleRoom_EventScript_OpponentWonDraw::
frontier_gettrainername 0 frontier_gettrainername STR_VAR_1
message BattleFrontier_BattleDomeBattleRoom_Text_RefereesDecidedWinnerTrainer message BattleFrontier_BattleDomeBattleRoom_Text_RefereesDecidedWinnerTrainer
waitmessage waitmessage
return return

View File

@ -20,7 +20,7 @@ Apprentice_EventScript_AskQuestion:
end end
Apprentice_EventScript_FirstMeeting: Apprentice_EventScript_FirstMeeting:
apprentice_buff 0, APPRENTICE_BUFF_NAME apprentice_buff STR_VAR_1, APPRENTICE_BUFF_NAME
apprentice_msg FALSE, APPRENTICE_MSG_PLEASE_TEACH apprentice_msg FALSE, APPRENTICE_MSG_PLEASE_TEACH
Apprentice_EventScript_WhichLvlMode: Apprentice_EventScript_WhichLvlMode:
apprentice_menu APPRENTICE_ASK_YES_NO apprentice_menu APPRENTICE_ASK_YES_NO
@ -29,7 +29,7 @@ Apprentice_EventScript_WhichLvlMode:
apprentice_menu APPRENTICE_ASK_WHICH_LEVEL apprentice_menu APPRENTICE_ASK_WHICH_LEVEL
apprentice_setlvlmode VAR_RESULT apprentice_setlvlmode VAR_RESULT
apprentice_shufflespecies apprentice_shufflespecies
apprentice_buff 0, APPRENTICE_BUFF_LEVEL apprentice_buff STR_VAR_1, APPRENTICE_BUFF_LEVEL
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_LVL_MODE apprentice_msg TRUE, APPRENTICE_MSG_THANKS_LVL_MODE
call Apprentice_EventScript_SetHideFlags call Apprentice_EventScript_SetHideFlags
release release
@ -46,8 +46,8 @@ Apprentice_EventScript_RejectTeach:
Apprentice_EventScript_UseWhichMon: Apprentice_EventScript_UseWhichMon:
apprentice_initquestion APPRENTICE_QUESTION_WHICH_MON apprentice_initquestion APPRENTICE_QUESTION_WHICH_MON
apprentice_buff 0, APPRENTICE_BUFF_SPECIES1 apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES1
apprentice_buff 1, APPRENTICE_BUFF_SPECIES2 apprentice_buff STR_VAR_2, APPRENTICE_BUFF_SPECIES2
apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MON apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MON
apprentice_menu APPRENTICE_ASK_2SPECIES apprentice_menu APPRENTICE_ASK_2SPECIES
copyvar VAR_0x8005, VAR_RESULT copyvar VAR_0x8005, VAR_RESULT
@ -58,7 +58,7 @@ Apprentice_EventScript_UseWhichMon:
apprentice_answeredquestion apprentice_answeredquestion
apprentice_getnumpartymons apprentice_getnumpartymons
call_if_eq VAR_RESULT, MULTI_PARTY_SIZE, Apprentice_EventScript_LastMonSelected call_if_eq VAR_RESULT, MULTI_PARTY_SIZE, Apprentice_EventScript_LastMonSelected
apprentice_buff 0, VAR_0x8007 apprentice_buff STR_VAR_1, VAR_0x8007
apprentice_freequestion apprentice_freequestion
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MON apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MON
call Apprentice_EventScript_SetHideFlags call Apprentice_EventScript_SetHideFlags
@ -83,7 +83,7 @@ Apprentice_EventScript_LastMonSelected:
Apprentice_EventScript_UseWhatHeldItem: Apprentice_EventScript_UseWhatHeldItem:
apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM
apprentice_buff 0, APPRENTICE_BUFF_SPECIES3 apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3
apprentice_msg TRUE, APPRENTICE_MSG_WHAT_HELD_ITEM apprentice_msg TRUE, APPRENTICE_MSG_WHAT_HELD_ITEM
apprentice_freequestion apprentice_freequestion
Apprentice_EventScript_ChooseHoldItem: Apprentice_EventScript_ChooseHoldItem:
@ -93,7 +93,7 @@ Apprentice_EventScript_ChooseHoldItem:
goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_ConfirmHoldNothing goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_ConfirmHoldNothing
apprentice_trysetitem apprentice_trysetitem
goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_AlreadySuggestedItem goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_AlreadySuggestedItem
apprentice_buff 0, APPRENTICE_BUFF_ITEM apprentice_buff STR_VAR_1, APPRENTICE_BUFF_ITEM
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_HELD_ITEM apprentice_msg TRUE, APPRENTICE_MSG_THANKS_HELD_ITEM
apprentice_answeredquestion apprentice_answeredquestion
call Apprentice_EventScript_SetHideFlags call Apprentice_EventScript_SetHideFlags
@ -106,7 +106,7 @@ Apprentice_EventScript_ChooseHoldItem:
Apprentice_EventScript_ConfirmHoldNothing: Apprentice_EventScript_ConfirmHoldNothing:
apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM
apprentice_buff 0, APPRENTICE_BUFF_SPECIES3 apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3
apprentice_msg FALSE, APPRENTICE_MSG_HOLD_NOTHING apprentice_msg FALSE, APPRENTICE_MSG_HOLD_NOTHING
apprentice_menu APPRENTICE_ASK_GIVE apprentice_menu APPRENTICE_ASK_GIVE
apprentice_freequestion apprentice_freequestion
@ -126,8 +126,8 @@ Apprentice_EventScript_HoldNothing:
@ different item if theyve already told the Apprentice to use it for another mon @ different item if theyve already told the Apprentice to use it for another mon
Apprentice_EventScript_AlreadySuggestedItem: Apprentice_EventScript_AlreadySuggestedItem:
apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM
apprentice_buff 0, APPRENTICE_BUFF_ITEM apprentice_buff STR_VAR_1, APPRENTICE_BUFF_ITEM
apprentice_buff 1, APPRENTICE_BUFF_SPECIES3 apprentice_buff STR_VAR_2, APPRENTICE_BUFF_SPECIES3
apprentice_msg FALSE, APPRENTICE_MSG_ITEM_ALREADY_SUGGESTED apprentice_msg FALSE, APPRENTICE_MSG_ITEM_ALREADY_SUGGESTED
apprentice_menu APPRENTICE_ASK_GIVE apprentice_menu APPRENTICE_ASK_GIVE
apprentice_freequestion apprentice_freequestion
@ -137,9 +137,9 @@ Apprentice_EventScript_AlreadySuggestedItem:
Apprentice_EventScript_UseWhichMove: Apprentice_EventScript_UseWhichMove:
apprentice_initquestion APPRENTICE_QUESTION_WHICH_MOVE apprentice_initquestion APPRENTICE_QUESTION_WHICH_MOVE
apprentice_buff 0, APPRENTICE_BUFF_SPECIES3 apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3
apprentice_buff 1, APPRENTICE_BUFF_MOVE1 apprentice_buff STR_VAR_2, APPRENTICE_BUFF_MOVE1
apprentice_buff 2, APPRENTICE_BUFF_MOVE2 apprentice_buff STR_VAR_3, APPRENTICE_BUFF_MOVE2
apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MOVE apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MOVE
apprentice_menu APPRENTICE_ASK_MOVES apprentice_menu APPRENTICE_ASK_MOVES
copyvar VAR_0x8005, VAR_RESULT copyvar VAR_0x8005, VAR_RESULT
@ -147,7 +147,7 @@ Apprentice_EventScript_UseWhichMove:
call_if_eq VAR_0x8005, 1, Apprentice_EventScript_ChoseMove2 call_if_eq VAR_0x8005, 1, Apprentice_EventScript_ChoseMove2
apprentice_setmove apprentice_setmove
apprentice_answeredquestion apprentice_answeredquestion
apprentice_buff 0, VAR_0x8007 apprentice_buff STR_VAR_1, VAR_0x8007
apprentice_freequestion apprentice_freequestion
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MOVE apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MOVE
call Apprentice_EventScript_SetHideFlags call Apprentice_EventScript_SetHideFlags
@ -171,7 +171,7 @@ Apprentice_EventScript_PutWhichMonFirst:
apprentice_menu APPRENTICE_ASK_3SPECIES apprentice_menu APPRENTICE_ASK_3SPECIES
apprentice_setleadmon VAR_RESULT apprentice_setleadmon VAR_RESULT
apprentice_answeredquestion apprentice_answeredquestion
apprentice_buff 0, APPRENTICE_BUFF_LEAD_MON_SPECIES apprentice_buff STR_VAR_1, APPRENTICE_BUFF_LEAD_MON_SPECIES
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MON_FIRST apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MON_FIRST
call Apprentice_EventScript_SetHideFlags call Apprentice_EventScript_SetHideFlags
release release
@ -190,7 +190,7 @@ Apprentice_EventScript_PickWinSpeech:
lock lock
faceplayer faceplayer
apprentice_save apprentice_save
apprentice_buff 0, APPRENTICE_BUFF_WIN_SPEECH apprentice_buff STR_VAR_1, APPRENTICE_BUFF_WIN_SPEECH
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_WIN_SPEECH apprentice_msg TRUE, APPRENTICE_MSG_THANKS_WIN_SPEECH
apprentice_reset apprentice_reset
call Apprentice_EventScript_SetHideFlags call Apprentice_EventScript_SetHideFlags