2023-11-23 20:31:33 +00:00
|
|
|
.set LOCAL_VAR_SPRAY, VAR_0x8004
|
|
|
|
.set LOCAL_VAR_NUM_SPRAY_STRENGTH, VAR_0x8005
|
|
|
|
.set LOCAL_VAR_SPRAY_TYPE, VAR_0x8009
|
|
|
|
.set LOCAL_VAR_NEW_SPRAY, VAR_0x8007
|
|
|
|
|
|
|
|
EventScript_BufferSprayName::
|
|
|
|
.if VAR_LAST_REPEL_LURE_USED != 0
|
|
|
|
bufferitemname STR_VAR_1, VAR_LAST_REPEL_LURE_USED
|
|
|
|
return
|
2022-09-14 04:17:04 +01:00
|
|
|
.endif
|
2023-11-23 20:31:33 +00:00
|
|
|
specialvar LOCAL_VAR_SPRAY_TYPE, GetLastUsedSprayType
|
|
|
|
compare LOCAL_VAR_SPRAY_TYPE, ITEM_REPEL
|
|
|
|
goto_if_eq EventScript_BufferSprayName_2
|
|
|
|
bufferitemname STR_VAR_1, ITEM_LURE
|
|
|
|
EventScript_BufferSprayName_1:
|
|
|
|
return
|
2022-08-28 00:46:59 +01:00
|
|
|
|
2023-11-23 20:31:33 +00:00
|
|
|
EventScript_BufferSprayName_2:
|
|
|
|
bufferitemname STR_VAR_1, ITEM_REPEL
|
|
|
|
goto EventScript_BufferSprayName_1
|
|
|
|
|
|
|
|
|
|
|
|
EventScript_SprayWoreOff::
|
2022-08-28 00:46:59 +01:00
|
|
|
lock
|
2023-11-23 20:31:33 +00:00
|
|
|
call EventScript_BufferSprayName
|
|
|
|
specialvar LOCAL_VAR_NUM_SPRAY_STRENGTH, GetNumberSprayStrength
|
|
|
|
switch LOCAL_VAR_NUM_SPRAY_STRENGTH
|
|
|
|
case 0, EventScript_SprayWoreOffMessage
|
|
|
|
case 1, EventScript_UseSingleSpray
|
|
|
|
goto EventScript_HandleMultipleSprays
|
|
|
|
return
|
|
|
|
|
|
|
|
EventScript_HandleMultipleSprays::
|
2022-09-14 04:17:04 +01:00
|
|
|
.if I_REPEL_LURE_MENU == TRUE
|
2023-11-23 20:31:33 +00:00
|
|
|
goto EventScript_ChooseWhichSpray
|
2022-09-14 04:17:04 +01:00
|
|
|
.else
|
2023-11-23 20:31:33 +00:00
|
|
|
goto EventScript_UseSingleSpray
|
2022-09-14 04:17:04 +01:00
|
|
|
.endif
|
2023-11-23 20:31:33 +00:00
|
|
|
return
|
2022-08-28 00:46:59 +01:00
|
|
|
|
2023-11-23 20:31:33 +00:00
|
|
|
|
|
|
|
EventScript_SprayWoreOffMessage::
|
|
|
|
msgbox Text_SprayWoreOff, MSGBOX_SIGN
|
|
|
|
releaseall
|
2019-10-21 11:46:57 +01:00
|
|
|
end
|
|
|
|
|
2023-11-23 20:31:33 +00:00
|
|
|
|
|
|
|
EventScript_UseSingleSpray::
|
|
|
|
.if VAR_LAST_REPEL_LURE_USED == 0
|
|
|
|
call EventScript_UseDifferentSpray
|
2022-09-14 04:17:04 +01:00
|
|
|
.else
|
|
|
|
checkitem VAR_LAST_REPEL_LURE_USED, 1
|
2023-11-23 20:31:33 +00:00
|
|
|
compare VAR_RESULT, TRUE
|
|
|
|
goto_if_eq EventScript_UseSingleSpray_2
|
|
|
|
call EventScript_UseDifferentSpray
|
2022-09-14 04:17:04 +01:00
|
|
|
.endif
|
2023-11-23 20:31:33 +00:00
|
|
|
EventScript_UseSingleSpray_1:
|
|
|
|
closemessage
|
|
|
|
releaseall
|
2022-09-12 00:48:27 +01:00
|
|
|
end
|
|
|
|
|
2023-11-23 20:31:33 +00:00
|
|
|
.if VAR_LAST_REPEL_LURE_USED != 0
|
|
|
|
EventScript_UseSingleSpray_2:
|
|
|
|
call EventScript_UseLastUsedSpray
|
|
|
|
goto EventScript_UseSingleSpray_1
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
EventScript_SetSingleSprayAndUse::
|
|
|
|
setvar VAR_RESULT, 0
|
|
|
|
call EventScript_UseSpray
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
EventScript_UseDifferentSpray::
|
|
|
|
specialvar LOCAL_VAR_NEW_SPRAY, GetSprayId
|
|
|
|
bufferitemname STR_VAR_2, LOCAL_VAR_NEW_SPRAY
|
|
|
|
msgbox Text_SprayWoreOffAskUseX, MSGBOX_YESNO
|
|
|
|
compare VAR_RESULT, YES
|
|
|
|
goto_if_eq EventScript_UseDifferentSpray_2
|
|
|
|
EventScript_UseDifferentSpray_1:
|
|
|
|
return
|
|
|
|
|
|
|
|
EventScript_UseDifferentSpray_2:
|
|
|
|
copyvar LOCAL_VAR_SPRAY, LOCAL_VAR_NEW_SPRAY
|
|
|
|
call EventScript_SetSingleSprayAndUse
|
|
|
|
goto EventScript_UseDifferentSpray_1
|
|
|
|
|
|
|
|
|
|
|
|
.if VAR_LAST_REPEL_LURE_USED != 0
|
|
|
|
EventScript_UseLastUsedSpray::
|
|
|
|
msgbox Text_SprayWoreOffAskUseAnother, MSGBOX_YESNO
|
|
|
|
compare VAR_RESULT, YES
|
|
|
|
goto_if_eq EventScript_UseLastUsedSpray_2
|
|
|
|
EventScript_UseLastUsedSpray_1:
|
|
|
|
return
|
|
|
|
|
|
|
|
EventScript_UseLastUsedSpray_2:
|
|
|
|
copyvar LOCAL_VAR_SPRAY, VAR_LAST_REPEL_LURE_USED
|
|
|
|
call EventScript_SetSingleSprayAndUse
|
|
|
|
goto EventScript_UseLastUsedSpray_1
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2022-09-14 04:17:04 +01:00
|
|
|
.if I_REPEL_LURE_MENU == TRUE
|
2023-11-23 20:31:33 +00:00
|
|
|
EventScript_ChooseWhichSpray::
|
|
|
|
message Text_SprayWoreOffAskUseAnother
|
|
|
|
waitmessage
|
|
|
|
callnative DrawSprayMenu
|
2022-09-14 04:17:04 +01:00
|
|
|
waitstate
|
2023-11-23 20:31:33 +00:00
|
|
|
compare VAR_RESULT, MULTI_B_PRESSED
|
|
|
|
goto_if_ne EventScript_ChooseWhichSpray_3
|
|
|
|
EventScript_ChooseWhichSpray_1:
|
|
|
|
closemessage
|
|
|
|
releaseall
|
2022-09-12 00:48:27 +01:00
|
|
|
end
|
|
|
|
|
2023-11-23 20:31:33 +00:00
|
|
|
EventScript_ChooseWhichSpray_2:
|
|
|
|
call EventScript_UseSpray
|
|
|
|
goto EventScript_ChooseWhichSpray_1
|
|
|
|
|
|
|
|
EventScript_ChooseWhichSpray_3:
|
|
|
|
compare VAR_RESULT, VAR_0x8003
|
|
|
|
goto_if_ne EventScript_ChooseWhichSpray_2
|
|
|
|
goto EventScript_ChooseWhichSpray_1
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
EventScript_UseSpray::
|
2022-09-12 00:48:27 +01:00
|
|
|
playse SE_REPEL
|
|
|
|
waitse
|
2023-11-23 20:31:33 +00:00
|
|
|
callnative HandleSprayMenuChoice
|
|
|
|
removeitem LOCAL_VAR_SPRAY, 1
|
|
|
|
bufferitemname STR_VAR_2, LOCAL_VAR_SPRAY
|
|
|
|
msgbox Text_SprayWoreOffUseX, MSGBOX_SIGN
|
|
|
|
return
|
2022-09-12 00:48:27 +01:00
|
|
|
|
2022-09-14 04:17:04 +01:00
|
|
|
|
2023-11-23 20:31:33 +00:00
|
|
|
Text_SprayWoreOff::
|
|
|
|
.string "{STR_VAR_1}'s effect wore off…$"
|
2022-09-14 04:17:04 +01:00
|
|
|
|
2023-11-23 20:31:33 +00:00
|
|
|
Text_SprayWoreOffAskUseAnother::
|
|
|
|
.string "{STR_VAR_1}'s effect wore off!\n"
|
2022-09-12 00:48:27 +01:00
|
|
|
.string "Use another?$"
|
2022-09-14 04:17:04 +01:00
|
|
|
|
2023-11-23 20:31:33 +00:00
|
|
|
Text_SprayWoreOffAskUseX::
|
|
|
|
.string "{STR_VAR_1}'s effect wore off…\n"
|
|
|
|
.string "Use a {STR_VAR_2}?$"
|
|
|
|
|
|
|
|
Text_SprayWoreOffUseX::
|
2022-09-14 04:17:04 +01:00
|
|
|
.string "{PLAYER} used the\n"
|
|
|
|
.string "{STR_VAR_2}.$"
|