forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First draft of repel lure * Updated all lure and repel scripts * Optimized inc file * Updated y coord * optimized sprays.c * Removed spray.inc * Updated cosnt use * Removed dead repel and lure code * Updated debug for testing * testing new inc file * turn on debug and options * playground generated inc file without ifs * pory generated inc with ifdef complete * Updated spray.c with new inc * reverted item config * Reverted event scripts * Reverted event scripts * Revert config * Added testing scripts for debug * Added back specials * reverted debug scripts * Updated use of constants * Addressed tabs > spaces feedback https://github.com/rh-hideout/pokeemerald-expansion/pull/3594\#discussion_r1402917676 * Updated constant names to avoid confusion Made inc file changes https://github.com/rh-hideout/pokeemerald-expansion/pull/3594\#pullrequestreview-1746418044 * Updated constant name of NUM_SPRAY_TYPES to NUM_SPRAY_STRENGTH to be more accurate
- Loading branch information
Showing
6 changed files
with
250 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,152 @@ | ||
EventScript_RepelWoreOff:: | ||
.if I_REPEL_LURE_MENU == TRUE | ||
checkitem ITEM_REPEL, 1 | ||
goto_if_eq VAR_RESULT, TRUE, EventScript_RepelUseAnother | ||
checkitem ITEM_SUPER_REPEL, 1 | ||
goto_if_eq VAR_RESULT, TRUE, EventScript_RepelUseAnother | ||
checkitem ITEM_MAX_REPEL, 1 | ||
goto_if_eq VAR_RESULT, TRUE, EventScript_RepelUseAnother | ||
.else | ||
checkitem VAR_LAST_REPEL_LURE_USED, 1 | ||
goto_if_eq VAR_RESULT, TRUE, EventScript_RepelUseAnother | ||
.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 | ||
.endif | ||
lock | ||
msgbox Text_RepelWoreOff, MSGBOX_SIGN | ||
release | ||
end | ||
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 | ||
|
||
EventScript_RepelUseAnother: | ||
EventScript_BufferSprayName_2: | ||
bufferitemname STR_VAR_1, ITEM_REPEL | ||
goto EventScript_BufferSprayName_1 | ||
|
||
|
||
EventScript_SprayWoreOff:: | ||
lock | ||
msgbox Text_UseAnotherRepel, MSGBOX_YESNO | ||
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:: | ||
.if I_REPEL_LURE_MENU == TRUE | ||
goto_if_eq VAR_RESULT, NO, EventScript_RepelWoreOff_End | ||
callnative TryDrawRepelMenu | ||
goto_if_eq VAR_RESULT, FALSE, EventScript_RepelWoreOff_Chose | ||
waitstate | ||
goto_if_eq VAR_RESULT, 127, EventScript_RepelWoreOff_End | ||
EventScript_RepelWoreOff_Chose: | ||
callnative HandleRepelMenuChoice | ||
bufferitemname 1, VAR_0x8004 | ||
removeitem VAR_0x8004, 1 | ||
playse SE_REPEL | ||
msgbox Text_UsedNewRepelLure, MSGBOX_SIGN | ||
goto EventScript_ChooseWhichSpray | ||
.else | ||
goto_if_eq VAR_RESULT, YES, EventScript_UsedRepel | ||
goto EventScript_UseSingleSpray | ||
.endif | ||
EventScript_RepelWoreOff_End: | ||
release | ||
end | ||
return | ||
|
||
EventScript_UsedRepel: | ||
bufferitemname 1, VAR_LAST_REPEL_LURE_USED | ||
playse SE_REPEL | ||
lock | ||
msgbox Text_UsedNewRepelLure, MSGBOX_SIGN | ||
removeitem VAR_LAST_REPEL_LURE_USED, 1 | ||
waitse | ||
callnative HandleUseExpiredRepel | ||
release | ||
|
||
EventScript_SprayWoreOffMessage:: | ||
msgbox Text_SprayWoreOff, MSGBOX_SIGN | ||
releaseall | ||
end | ||
|
||
EventScript_LureWoreOff:: | ||
.if I_REPEL_LURE_MENU == TRUE | ||
checkitem ITEM_LURE, 1 | ||
goto_if_eq VAR_RESULT, TRUE, EventScript_LureUseAnother | ||
checkitem ITEM_SUPER_LURE, 1 | ||
goto_if_eq VAR_RESULT, TRUE, EventScript_LureUseAnother | ||
checkitem ITEM_MAX_LURE, 1 | ||
goto_if_eq VAR_RESULT, TRUE, EventScript_LureUseAnother | ||
|
||
EventScript_UseSingleSpray:: | ||
.if VAR_LAST_REPEL_LURE_USED == 0 | ||
call EventScript_UseDifferentSpray | ||
.else | ||
checkitem VAR_LAST_REPEL_LURE_USED, 1 | ||
goto_if_eq VAR_RESULT, TRUE, EventScript_LureUseAnother | ||
compare VAR_RESULT, TRUE | ||
goto_if_eq EventScript_UseSingleSpray_2 | ||
call EventScript_UseDifferentSpray | ||
.endif | ||
lock | ||
msgbox Text_LureWoreOff, MSGBOX_SIGN | ||
release | ||
EventScript_UseSingleSpray_1: | ||
closemessage | ||
releaseall | ||
end | ||
|
||
EventScript_LureUseAnother: | ||
lock | ||
msgbox Text_UseAnotherLure, MSGBOX_YESNO | ||
.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 | ||
|
||
|
||
.if I_REPEL_LURE_MENU == TRUE | ||
goto_if_eq VAR_RESULT, NO, EventScript_LureWoreOff_End | ||
callnative TryDrawLureMenu | ||
goto_if_eq VAR_RESULT, FALSE, EventScript_LureWoreOff_Chose | ||
EventScript_ChooseWhichSpray:: | ||
message Text_SprayWoreOffAskUseAnother | ||
waitmessage | ||
callnative DrawSprayMenu | ||
waitstate | ||
goto_if_eq VAR_RESULT, 127, EventScript_LureWoreOff_End | ||
EventScript_LureWoreOff_Chose: | ||
callnative HandleLureMenuChoice | ||
bufferitemname 1, VAR_0x8004 | ||
removeitem VAR_0x8004, 1 | ||
playse SE_REPEL | ||
msgbox Text_UsedNewRepelLure, MSGBOX_SIGN | ||
.else | ||
goto_if_eq VAR_RESULT, YES, EventScript_UsedLure | ||
.endif | ||
EventScript_LureWoreOff_End: | ||
release | ||
compare VAR_RESULT, MULTI_B_PRESSED | ||
goto_if_ne EventScript_ChooseWhichSpray_3 | ||
EventScript_ChooseWhichSpray_1: | ||
closemessage | ||
releaseall | ||
end | ||
|
||
EventScript_UsedLure: | ||
bufferitemname 1, VAR_LAST_REPEL_LURE_USED | ||
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:: | ||
playse SE_REPEL | ||
lock | ||
msgbox Text_UsedNewRepelLure, MSGBOX_SIGN | ||
removeitem VAR_LAST_REPEL_LURE_USED, 1 | ||
waitse | ||
callnative HandleUseExpiredLure | ||
release | ||
end | ||
callnative HandleSprayMenuChoice | ||
removeitem LOCAL_VAR_SPRAY, 1 | ||
bufferitemname STR_VAR_2, LOCAL_VAR_SPRAY | ||
msgbox Text_SprayWoreOffUseX, MSGBOX_SIGN | ||
return | ||
|
||
Text_RepelWoreOff: | ||
.string "REPEL's effect wore off…$" | ||
|
||
Text_UseAnotherRepel:: | ||
.string "REPEL's effect wore off!\n" | ||
.string "Use another?$" | ||
Text_SprayWoreOff:: | ||
.string "{STR_VAR_1}'s effect wore off…$" | ||
|
||
Text_LureWoreOff: | ||
.string "Lure's effect wore off…$" | ||
|
||
Text_UseAnotherLure:: | ||
.string "Lure's effect wore off!\n" | ||
Text_SprayWoreOffAskUseAnother:: | ||
.string "{STR_VAR_1}'s effect wore off!\n" | ||
.string "Use another?$" | ||
|
||
Text_UsedNewRepelLure:: | ||
Text_SprayWoreOffAskUseX:: | ||
.string "{STR_VAR_1}'s effect wore off…\n" | ||
.string "Use a {STR_VAR_2}?$" | ||
|
||
Text_SprayWoreOffUseX:: | ||
.string "{PLAYER} used the\n" | ||
.string "{STR_VAR_2}.$" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.