diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-07-18 20:24:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-18 20:24:09 -0400 |
commit | af09e73d6733245ea61189f339b81ab68f645c17 (patch) | |
tree | d425cff00e4c7dd8a564dbf17091d0d5d5f563fe | |
parent | e129d04b931a4fc0e6584b4340dc57b9162264d5 (diff) | |
parent | 8e6dd3bafeab105f079e120d3b2cd7e61cf10477 (diff) |
Merge branch 'master' into doc-overworld
247 files changed, 4797 insertions, 4045 deletions
diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index eda410c5b..37548f410 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1263,8 +1263,8 @@ various \battler, VARIOUS_GET_MOVE_TARGET .endm - .macro various4 battler:req - various \battler, 4 + .macro getbattlerfainted battler:req + various \battler, VARIOUS_GET_BATTLER_FAINTED .endm .macro resetintimidatetracebits battler:req @@ -1279,8 +1279,8 @@ various \battler, 7 .endm - .macro various8 battler:req - various \battler, 8 + .macro palaceflavortext battler:req + various \battler, VARIOUS_PALACE_FLAVOR_TEXT .endm .macro arenajudgmentwindow @@ -1365,11 +1365,11 @@ .endm .macro chosenstatus1animation battler:req, status:req - chosenstatusanimation \battler 0x0 \status + chosenstatusanimation \battler, 0x0, \status .endm .macro chosenstatus2animation battler:req, status:req - chosenstatusanimation \battler 0x1 \status + chosenstatusanimation \battler, 0x1, \status .endm .macro sethword dst:req, value:req diff --git a/berry_fix/asm/loader.s b/berry_fix/asm/loader.s index 39e0b768a..a78014078 100644 --- a/berry_fix/asm/loader.s +++ b/berry_fix/asm/loader.s @@ -75,21 +75,21 @@ _send: @ 14c _150: bl _recv bne _150 - mov r2, 0 + mov r2, #0 strh r2, [r0, 0xa] @ SIOMLT_SEND - cmp r1, 0 + cmp r1, #0 bne _150 mov r2, 0x8000 _16c: - mov r1, 0 + mov r1, #0 _170: strh r1, [r0, 0xa] @ SIOMLT_SEND bl _recv bne _150 cmp r1, r2 bne _16c - lsr r2, 5 - cmp r1, 0 + lsr r2, #5 + cmp r1, #0 bne _170 ldr r3, =BerryFixMBHeaderGameCode ldrh r2, [r3] @@ -105,7 +105,7 @@ _1a0: bne _1a0 cmp r1, r2 bne _1a0 - mov r1, 0 + mov r1, #0 strh r1, [r0, 0xa] @ SIOMLT_SEND ldr r0, =_data_2f0 ldr r1, =gCode diff --git a/berry_fix/payload/asm/crt0.s b/berry_fix/payload/asm/crt0.s index 872a63018..2bca00636 100644 --- a/berry_fix/payload/asm/crt0.s +++ b/berry_fix/payload/asm/crt0.s @@ -9,10 +9,10 @@ .align 2, 0 .global Init Init: - mov r0, PSR_IRQ_MODE + mov r0, #PSR_IRQ_MODE msr cpsr_cf, r0 ldr sp, sp_irq - mov r0, PSR_SYS_MODE + mov r0, #PSR_SYS_MODE msr cpsr_cf, r0 ldr sp, sp_sys ldr r1, =INTR_VECTOR @@ -34,8 +34,8 @@ sp_irq: .word IWRAM_END - 0x60 .align 2, 0 .global IntrMain IntrMain: @ 0x2010048 - mov ip, REG_BASE - add r3, ip, OFFSET_REG_IE + mov ip, #REG_BASE + add r3, ip, #OFFSET_REG_IE ldr r2, [r3] and r1, r2, r2, lsr #16 mov r2, #0 diff --git a/berry_fix/payload/asm/libagbsyscall.s b/berry_fix/payload/asm/libagbsyscall.s index ea8ef3e89..9548e80d2 100644 --- a/berry_fix/payload/asm/libagbsyscall.s +++ b/berry_fix/payload/asm/libagbsyscall.s @@ -7,39 +7,39 @@ thumb_func_start CpuSet CpuSet: @ 81E3B64 - swi 0xB + svc 0xB bx lr thumb_func_end CpuSet thumb_func_start Div Div: @ 81E3B68 - swi 0x6 + svc 0x6 bx lr thumb_func_end Div thumb_func_start Mod Mod: - swi 0x6 + svc 0x6 adds r0, r1, 0 bx lr thumb_func_end Mod thumb_func_start LZ77UnCompVram LZ77UnCompVram: @ 81E3B6C - swi 0x12 + svc 0x12 bx lr thumb_func_end LZ77UnCompVram thumb_func_start RegisterRamReset RegisterRamReset: @ 81E3B80 - swi 0x1 + svc 0x1 bx lr thumb_func_end RegisterRamReset thumb_func_start VBlankIntrWait VBlankIntrWait: @ 81E3BA0 movs r2, 0 - swi 0x5 + svc 0x5 bx lr thumb_func_end VBlankIntrWait diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index f2f82ee50..3db9f28ff 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3153,8 +3153,8 @@ BattleScript_PursuitDmgOnSwitchOut:: waitmessage 0x40 tryfaintmon BS_TARGET, FALSE, NULL moveendfromto MOVEEND_ON_DAMAGE_ABILITIES, MOVEEND_CHOICE_MOVE - various4 BS_TARGET - jumpifbyte CMP_EQUAL, gBattleCommunication, 0x0, BattleScript_PursuitDmgOnSwitchOutRet + getbattlerfainted BS_TARGET + jumpifbyte CMP_EQUAL, gBattleCommunication, FALSE, BattleScript_PursuitDmgOnSwitchOutRet setbyte sGIVEEXP_STATE, 0x0 getexp BS_TARGET BattleScript_PursuitDmgOnSwitchOutRet: @@ -4442,18 +4442,18 @@ BattleScript_FlushMessageBox:: printstring STRINGID_EMPTYSTRING3 return -BattleScript_82DB881:: - setbyte gBattleCommunication + 1, 0x0 -BattleScript_82DB887:: - various8 BS_ATTACKER - jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x1, BattleScript_82DB89D - printfromtable gStringIds_85CCF0A - waitmessage 0x40 -BattleScript_82DB89D:: - addbyte gBattleCommunication + 1, 0x1 - jumpifbytenotequal gBattleCommunication + 1, gBattlersCount, BattleScript_82DB887 - setbyte gBattleCommunication, 0x0 - setbyte gBattleCommunication + 1, 0x0 +BattleScript_PalacePrintFlavorText:: + setbyte gBattleCommunication + 1, 0 +BattleScript_PalaceTryBattlerFlavorText:: + palaceflavortext BS_ATTACKER @ BS_ATTACKER here overwritten by gBattleCommunication + 1 + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, TRUE, BattleScript_PalaceEndFlavorText + printfromtable gBattlePalaceFlavorTextTable + waitmessage 0x40 +BattleScript_PalaceEndFlavorText:: + addbyte gBattleCommunication + 1, 1 + jumpifbytenotequal gBattleCommunication + 1, gBattlersCount, BattleScript_PalaceTryBattlerFlavorText + setbyte gBattleCommunication, 0 + setbyte gBattleCommunication + 1, 0 end2 BattleScript_ArenaTurnBeginning:: diff --git a/data/event_scripts.s b/data/event_scripts.s index 4cc10fef8..7cc5960d4 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -775,8 +775,8 @@ EventScript_HideMrBriney:: @ 82721F8 return RusturfTunnel_EventScript_SetRusturfTunnelOpen:: @ 8272216 - removeobject 1 - removeobject 10 + removeobject LOCALID_WANDAS_BF + removeobject LOCALID_WANDA clearflag FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WANDAS_BOYFRIEND clearflag FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WANDA setvar VAR_RUSTURF_TUNNEL_STATE, 6 diff --git a/data/maps/AbandonedShip_CaptainsOffice/scripts.inc b/data/maps/AbandonedShip_CaptainsOffice/scripts.inc index b2940eb6f..139701edb 100644 --- a/data/maps/AbandonedShip_CaptainsOffice/scripts.inc +++ b/data/maps/AbandonedShip_CaptainsOffice/scripts.inc @@ -6,7 +6,7 @@ AbandonedShip_CaptainsOffice_EventScript_CaptSternAide:: @ 82387E2 faceplayer goto_if_set FLAG_EXCHANGED_SCANNER, AbandonedShip_CaptainsOffice_EventScript_ThisIsSSCactus checkitem ITEM_SCANNER, 1 - compare VAR_RESULT, 1 + compare VAR_RESULT, TRUE goto_if_eq AbandonedShip_CaptainsOffice_EventScript_CanYouDeliverScanner goto_if_set FLAG_ITEM_ABANDONED_SHIP_HIDDEN_FLOOR_ROOM_4_SCANNER, AbandonedShip_CaptainsOffice_EventScript_ThisIsSSCactus msgbox AbandonedShip_CaptainsOffice_Text_NoSuccessFindingScanner, MSGBOX_DEFAULT diff --git a/data/maps/AquaHideout_B2F/scripts.inc b/data/maps/AquaHideout_B2F/scripts.inc index dd2c38fa4..25fc1820f 100644 --- a/data/maps/AquaHideout_B2F/scripts.inc +++ b/data/maps/AquaHideout_B2F/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_MATT, 1 +.set LOCALID_SUBMARINE, 4 + AquaHideout_B2F_MapScripts:: @ 8233DCF map_script MAP_SCRIPT_ON_TRANSITION, AquaHideout_B2F_OnTransition .byte 0 @@ -12,7 +15,7 @@ AquaHideout_B2F_EventScript_PreventMattNoticing:: @ 8233DDF AquaHideout_B2F_EventScript_MattNoticePlayer:: @ 8233DE5 lockall - setvar VAR_0x8008, 1 @ Matt object event id + setvar VAR_0x8008, LOCALID_MATT playse SE_PIN applymovement VAR_0x8008, Common_Movement_ExclamationMark waitmovement 0 @@ -29,8 +32,8 @@ AquaHideout_B2F_EventScript_Matt:: @ 8233E09 end AquaHideout_B2F_EventScript_SubmarineEscape:: @ 8233E25 - setvar VAR_0x8008, 1 @ Matt object event id - setvar VAR_0x8009, 4 @ Submarine object event id + setvar VAR_0x8008, LOCALID_MATT + setvar VAR_0x8009, LOCALID_SUBMARINE applymovement VAR_0x8008, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 delay 20 diff --git a/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc index 910cabac3..c3b4154ba 100644 --- a/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc @@ -1,3 +1,12 @@ +.set LOCALID_BLACK_BELT_1, 1 +.set LOCALID_BLACK_BELT_2, 2 +.set LOCALID_BLACK_BELT_3, 3 +.set LOCALID_BLACK_BELT_4, 4 +.set LOCALID_ATTENDANT, 5 +.set LOCALID_OPPONENT, 7 +.set LOCALID_PLAYER, 8 +.set LOCALID_ANNOUNCER, 9 + BattleFrontier_BattleArenaBattleRoom_MapScripts:: @ 8257487 map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleArenaBattleRoom_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleArenaBattleRoom_OnFrame @@ -6,7 +15,7 @@ BattleFrontier_BattleArenaBattleRoom_MapScripts:: @ 8257487 .byte 0 @ On this map the player (OBJ_EVENT_ID_PLAYER) is hidden - @ The player is represented instead by object event 8, which has the gfx id VAR_OBJ_GFX_ID_1 + @ The player is represented instead by LOCALID_PLAYER, which has the gfx id VAR_OBJ_GFX_ID_1 BattleFrontier_BattleArenaBattleRoom_OnResume: @ 825749C special OffsetCameraForBattle @@ -39,48 +48,48 @@ BattleFrontier_BattleArenaBattleRoom_OnFrame: @ 82574D2 BattleFrontier_BattleArenaBattleRoom_EventScript_EnterRoom:: @ 82574DC lockall - showobjectat 8, MAP_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerEnter + showobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerEnter waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM compare VAR_RESULT, 0 goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_AnnounceTrainers - applymovement 5, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceDown - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceLeft + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceDown + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceLeft setvar VAR_TEMP_2, 1 frontier_set FRONTIER_DATA_RECORD_DISABLED, TRUE goto BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForOpponent BattleFrontier_BattleArenaBattleRoom_EventScript_AnnounceTrainers:: @ 825752E tower_setopponent - addobject 7 - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentEnter + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentEnter waitmovement 0 - applymovement 9, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown playse SE_W187 waitse waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_PlayerStepForward, MSGBOX_DEFAULT closemessage - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerStepForward + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerStepForward waitmovement 0 - applymovement 9, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown playse SE_W187 waitse waitmovement 0 arena_gettrainername msgbox BattleFrontier_BattleArenaBattleRoom_Text_OpponentStepForward, MSGBOX_DEFAULT closemessage - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForward + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForward waitmovement 0 - applymovement 9, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown playse SE_W187 waitse waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_SetKOTourneyBegin, MSGBOX_DEFAULT closemessage - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerStepForward - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForward + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerStepForward + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForward waitmovement 0 palace_getopponentintro msgbox gStringVar4, MSGBOX_DEFAULT @@ -89,11 +98,11 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_AnnounceTrainers:: @ 825752E switch VAR_RESULT case 1, BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedOpponent BattleFrontier_BattleArenaBattleRoom_EventScript_DeclareOpponentWinner:: @ 82575DB - applymovement 9, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown - applymovement 1, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown - applymovement 2, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown - applymovement 3, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceUp - applymovement 4, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceUp + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_BLACK_BELT_1, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_BLACK_BELT_2, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_BLACK_BELT_3, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceUp + applymovement LOCALID_BLACK_BELT_4, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceUp playse SE_W173 waitse waitmovement 0 @@ -111,12 +120,12 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedOpponent:: @ 8257630 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT switch VAR_RESULT case 7, BattleFrontier_BattleArenaBattleRoom_EventScript_ReturnToLobbyWon - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerWalkBackToLine - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentExit + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerWalkBackToLine + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentExit waitmovement 0 - removeobject 7 - applymovement 5, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceDown - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceLeft + removeobject LOCALID_OPPONENT + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceDown + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceLeft waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_MonsWillBeRestored, MSGBOX_DEFAULT special LoadPlayerParty @@ -193,8 +202,8 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_AskRetireChallenge:: @ 8257808 BattleFrontier_BattleArenaBattleRoom_EventScript_ContinueChallenge:: @ 825783A closemessage - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceRight - applymovement 5, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceRight + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceRight + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceRight waitmovement 0 goto BattleFrontier_BattleArenaBattleRoom_EventScript_AnnounceTrainers waitstate @@ -273,27 +282,27 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_AskReadyForTycoonNoRecord:: @ 8 BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGreta:: @ 8257961 call BattleFrontier_EventScript_SetBrainObjectGfx - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceRight - applymovement 5, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceRight + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceRight + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaBattleRoom_Movement_WalkInPlaceRight waitmovement 0 - applymovement 9, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown playse SE_W187 waitse waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_PlayerStepForward, MSGBOX_DEFAULT closemessage - applymovement 8, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerStepForwardLong + applymovement LOCALID_PLAYER, BattleFrontier_BattleArenaBattleRoom_Movement_PlayerStepForwardLong waitmovement 0 - applymovement 9, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown playse SE_W187 waitse waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_MakeWayForGreta, MSGBOX_DEFAULT closemessage - addobject 7 - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_GretaEnter + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_GretaEnter waitmovement 0 - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForward + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForward waitmovement 0 switch VAR_TEMP_F case FRONTIER_BRAIN_GOLD, BattleFrontier_BattleArenaBattleRoom_EventScript_IntroGretaGold @@ -305,11 +314,11 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGreta:: @ 8257961 msgbox BattleFrontier_BattleArenaBattleRoom_Text_GretaYoureChallenger, MSGBOX_DEFAULT closemessage frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_GretaLookAroundPlayer + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_GretaLookAroundPlayer waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_IsThatRight, MSGBOX_DEFAULT closemessage - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_GretaWalkBackToCenter + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_GretaWalkBackToCenter waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_YouLookWeakTakeThingsEasy, MSGBOX_DEFAULT BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaSilver:: @ 8257A3F @@ -324,7 +333,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaSilver:: @ 8257A5C frontier_getsymbols compare VAR_RESULT, 0 goto_if_ne BattleFrontier_BattleArenaBattleRoom_EventScript_ReturnToLobbyWon - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForwardLong + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForwardLong waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_GretaYoureToughAfterAll, MSGBOX_DEFAULT playfanfare MUS_ME_SYMBOLGET @@ -342,11 +351,11 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_IntroGretaGold:: @ 8257AA5 msgbox BattleFrontier_BattleArenaBattleRoom_Text_GretaLookingForwardToSeeingAgain, MSGBOX_DEFAULT closemessage frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_GretaLookAroundPlayer + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_GretaLookAroundPlayer waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_SoAreYouReady, MSGBOX_DEFAULT closemessage - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_GretaWalkBackToCenter + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_GretaWalkBackToCenter waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_WontAllowHalfheartedEffort, MSGBOX_DEFAULT BattleFrontier_BattleArenaBattleRoom_EventScript_BattleGretaGold:: @ 8257AF8 @@ -361,7 +370,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_DefeatedGretaGold:: @ 8257B15 frontier_getsymbols compare VAR_RESULT, 2 goto_if_eq BattleFrontier_BattleArenaBattleRoom_EventScript_ReturnToLobbyWon - applymovement 7, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForwardLong + applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForwardLong waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_GretaBlownAway, MSGBOX_DEFAULT playfanfare MUS_ME_SYMBOLGET @@ -392,11 +401,11 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_DoArenaBattle:: @ 8257B6C return BattleFrontier_BattleArenaBattleRoom_EventScript_DeclarePlayerWinner:: @ 8257BA9 - applymovement 9, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown - applymovement 1, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown - applymovement 2, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown - applymovement 3, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceUp - applymovement 4, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceUp + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_BLACK_BELT_1, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_BLACK_BELT_2, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceDown + applymovement LOCALID_BLACK_BELT_3, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceUp + applymovement LOCALID_BLACK_BELT_4, BattleFrontier_BattleArenaBattleRoom_Movement_JumpInPlaceUp playse SE_BAN waitse waitmovement 0 @@ -479,8 +488,8 @@ BattleFrontier_BattleArenaBattleRoom_OnWarp: @ 8257C0C .2byte 0 BattleFrontier_BattleArenaBattleRoom_EventScript_SetUpRoomObjects:: @ 8257C16 - hideobjectat 8, MAP_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM - removeobject 7 + hideobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM + removeobject LOCALID_OPPONENT call BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfx applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeBattleRoom_Movement_SetInvisible setvar VAR_TEMP_1, 1 diff --git a/data/maps/BattleFrontier_BattleArenaCorridor/scripts.inc b/data/maps/BattleFrontier_BattleArenaCorridor/scripts.inc index f75f53893..7044caa39 100644 --- a/data/maps/BattleFrontier_BattleArenaCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattleArenaCorridor/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattleArenaCorridor_MapScripts:: @ 82573B9 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleArenaCorridor_OnFrame .byte 0 @@ -9,13 +11,13 @@ BattleFrontier_BattleArenaCorridor_OnFrame: @ 82573BF BattleFrontier_BattleArenaCorridor_EventScript_WalkToBattleRoom:: @ 82573C9 delay 16 setvar VAR_TEMP_0, 1 - applymovement 1, BattleFrontier_BattleArenaCorridor_Movement_AttendantWalkToDoor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaCorridor_Movement_AttendantWalkToDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleArenaCorridor_Movement_PlayerWalkToDoor waitmovement 0 - applymovement 1, BattleFrontier_BattleArenaCorridor_Movement_AttendantFacePlayer + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaCorridor_Movement_AttendantFacePlayer waitmovement 0 msgbox BattleFrontier_BattleArenaCorridor_Text_PleaseStepIn, MSGBOX_SIGN - applymovement 1, BattleFrontier_BattleArenaCorridor_Movement_AttendantMoveOutOfWay + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaCorridor_Movement_AttendantMoveOutOfWay waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleArenaCorridor_Movement_PlayerEnterDoor waitmovement 0 diff --git a/data/maps/BattleFrontier_BattleArenaLobby/scripts.inc b/data/maps/BattleFrontier_BattleArenaLobby/scripts.inc index 90c374c23..a2d785e66 100644 --- a/data/maps/BattleFrontier_BattleArenaLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleArenaLobby/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattleArenaLobby_MapScripts:: @ 8255C36 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleArenaLobby_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleArenaLobby_OnWarp @@ -206,12 +208,12 @@ BattleFrontier_BattleArenaLobby_EventScript_EndCancelChallenge:: @ 8256003 end BattleFrontier_BattleArenaLobby_EventScript_WalkToDoorLv50:: @ 8256005 - applymovement 1, BattleFrontier_BattleArenaLobby_Movement_AttendantWalkToLeftDoor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaLobby_Movement_AttendantWalkToLeftDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleArenaLobby_Movement_PlayerWalkToLeftDoor waitmovement 0 opendoor 2, 2 waitdooranim - applymovement 1, BattleFrontier_BattleArenaLobby_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaLobby_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleArenaLobby_Movement_PlayerEnterDoor waitmovement 0 closedoor 2, 2 @@ -255,12 +257,12 @@ BattleFrontier_BattleArenaLobby_Movement_PlayerEnterDoor: @ 825604C step_end BattleFrontier_BattleArenaLobby_EventScript_WalkToDoorLvOpen:: @ 8256050 - applymovement 1, BattleFrontier_BattleArenaLobby_Movement_AttendantWalkToRightDoor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaLobby_Movement_AttendantWalkToRightDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleArenaLobby_Movement_PlayerWalkToRightDoor waitmovement 0 opendoor 11, 2 waitdooranim - applymovement 1, BattleFrontier_BattleArenaLobby_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleArenaLobby_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleArenaLobby_Movement_PlayerEnterDoor waitmovement 0 closedoor 11, 2 diff --git a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc index 048c4fc80..78665edc1 100644 --- a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_ANNOUNCER, 1 +.set LOCALID_AUDIENCE_TWIN, 2 +.set LOCALID_AUDIENCE_WALKING, 6 +.set LOCALID_REFEREE, 9 +.set LOCALID_PLAYER, 13 +.set LOCALID_OPPONENT, 15 + BattleFrontier_BattleDomeBattleRoom_MapScripts:: @ 824BC9C map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleDomeBattleRoom_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleDomeBattleRoom_OnFrame @@ -43,22 +50,22 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_EnterRoom:: @ 824BD0A call BattleFrontier_BattleDomeBattleRoom_EventScript_GetRoundNum compare VAR_RESULT, DOME_ROUND1 call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_TryDoAudienceMemberWalkToSeat - applymovement 1, Common_Movement_WalkInPlaceDown + applymovement LOCALID_ANNOUNCER, Common_Movement_WalkInPlaceDown waitmovement 0 call BattleFrontier_BattleDomeBattleRoom_EventScript_AnnouncePlayer msgbox BattleFrontier_BattleDomeBattleRoom_Text_PlayerHasEnteredDome, MSGBOX_DEFAULT closemessage - showobjectat 13, MAP_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM + showobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM compare VAR_TEMP_F, DOME_FINAL goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnter compare VAR_TEMP_E, FRONTIER_BRAIN_NOT_READY goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnterForTucker BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnter:: @ 824BD4E - applymovement 13, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerEnter + applymovement LOCALID_PLAYER, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerEnter goto BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceReactToPlayer BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerEnterForTucker:: @ 824BD5A - applymovement 13, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerEnterForTucker + applymovement LOCALID_PLAYER, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerEnterForTucker BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceReactToPlayer:: @ 824BD61 playse SE_W227B call BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceLookAround @@ -71,8 +78,8 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_BattleOpponent:: @ 824BD82 dome_getopponentname msgbox BattleFrontier_BattleDomeBattleRoom_Text_PlayerVersusTrainer, MSGBOX_DEFAULT closemessage - applymovement 13, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerStepForward - applymovement 15, BattleFrontier_BattleDomeBattleRoom_Movement_OpponentStepForward + applymovement LOCALID_PLAYER, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerStepForward + applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_OpponentStepForward waitmovement 0 tower_getopponentintro 0 msgbox gStringVar4, MSGBOX_DEFAULT @@ -91,12 +98,12 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_Draw:: @ 824BDF7 playse SE_W227B call BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceLookAround delay 60 - applymovement 9, BattleFrontier_BattleDomeBattleRoom_Movement_TieRefereeEnter + applymovement LOCALID_REFEREE, BattleFrontier_BattleDomeBattleRoom_Movement_RefereeEnter waitmovement 0 - applymovement 1, BattleFrontier_BattleDomeBattleRoom_Movement_RefereeFaceLeft + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleDomeBattleRoom_Movement_AnnouncerFaceLeft waitmovement 0 delay 180 - applymovement 9, BattleFrontier_BattleDomeBattleRoom_Movement_TieRefereeExit + applymovement LOCALID_REFEREE, BattleFrontier_BattleDomeBattleRoom_Movement_RefereeExit waitmovement 0 compare VAR_TEMP_2, DRAW_TUCKER @ Tucker always wins on a draw goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_LostToOpponent @@ -104,7 +111,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_Draw:: @ 824BDF7 switch VAR_RESULT case 1, BattleFrontier_BattleDomeBattleRoom_EventScript_DefeatedOpponent BattleFrontier_BattleDomeBattleRoom_EventScript_LostToOpponent:: @ 824BE4F - applymovement 1, Common_Movement_WalkInPlaceDown + applymovement LOCALID_ANNOUNCER, Common_Movement_WalkInPlaceDown waitmovement 0 dome_getopponentname compare VAR_TEMP_2, NO_DRAW @@ -140,7 +147,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_TuckerWonDraw:: @ 824BED9 return BattleFrontier_BattleDomeBattleRoom_EventScript_DefeatedOpponent:: @ 824BEE0 - applymovement 1, Common_Movement_WalkInPlaceDown + applymovement LOCALID_ANNOUNCER, Common_Movement_WalkInPlaceDown waitmovement 0 compare VAR_TEMP_2, NO_DRAW call_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_PlayerWon @@ -161,7 +168,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_DefeatedOpponent:: @ 824BEE0 waitstate BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney:: @ 824BF62 - applymovement 13, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerApproachAudience + applymovement LOCALID_PLAYER, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerApproachAudience waitmovement 0 frontier_get FRONTIER_DATA_LVL_MODE switch VAR_RESULT @@ -351,9 +358,9 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_AnnounceTuckerGold:: @ 824C209 msgbox BattleFrontier_BattleDomeBattleRoom_Text_LegendHasReturnedDomeAceTucker, MSGBOX_DEFAULT BattleFrontier_BattleDomeBattleRoom_EventScript_TuckerEnter:: @ 824C211 closemessage - applymovement 2, BattleFrontier_BattleDomeBattleRoom_Movement_AudienceTwinJump - applymovement 1, BattleFrontier_BattleDomeBattleRoom_Movement_RefereeMoveForTuckerEntrance - applymovement 15, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerEnterAndDance + applymovement LOCALID_AUDIENCE_TWIN, BattleFrontier_BattleDomeBattleRoom_Movement_AudienceTwinJump + applymovement LOCALID_ANNOUNCER, BattleFrontier_BattleDomeBattleRoom_Movement_AnnouncerMoveForTuckerEntrance + applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerEnterAndDance playse SE_W227B call BattleFrontier_BattleDomeBattleRoom_EventScript_AudienceLookAround waitse @@ -397,7 +404,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerSilver:: @ 824C2B9 compare VAR_RESULT, 0 goto_if_ne BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney closemessage - applymovement 15, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerApproachPlayer + applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerApproachPlayer waitmovement 0 msgbox BattleFrontier_BattleDomeBattleRoom_Text_SeeYourFrontierPass, MSGBOX_DEFAULT playfanfare MUS_ME_SYMBOLGET @@ -427,7 +434,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerGold:: @ 824C373 compare VAR_RESULT, 2 goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_WonTourney closemessage - applymovement 15, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerApproachPlayer + applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerApproachPlayer waitmovement 0 msgbox BattleFrontier_BattleDomeBattleRoom_Text_NeverLostWhenPowerUnleashed, MSGBOX_DEFAULT playfanfare MUS_ME_SYMBOLGET @@ -441,8 +448,8 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_BattleTuckerGold:: @ 824C373 BattleFrontier_BattleDomeBattleRoom_EventScript_DoTuckerBattle:: @ 824C400 msgbox BattleFrontier_BattleDomeBattleRoom_Text_PlayerVersusTucker, MSGBOX_DEFAULT closemessage - applymovement 13, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerStepForward2 - applymovement 15, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerStepForward + applymovement LOCALID_PLAYER, BattleFrontier_BattleDomeBattleRoom_Movement_PlayerStepForward2 + applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_TuckerStepForward waitmovement 0 call BattleFrontier_BattleDomeBattleRoom_EventScript_DoDomeBattle return @@ -477,7 +484,7 @@ BattleFrontier_BattleDomeBattleRoom_OnWarp: @ 824C481 .2byte 0 BattleFrontier_BattleDomeBattleRoom_EventScript_SetUpObjects:: @ 824C48B - hideobjectat 13, MAP_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM + hideobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM call BattleFrontier_BattleDomeBattleRoom_EventScript_AddAudience call BattleFrontier_BattleDomeBattleRoom_EventScript_SetPlayerGfx setvar VAR_TEMP_1, 1 @@ -490,10 +497,10 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_SetUpObjects:: @ 824C48B compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY goto_if_eq BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects call BattleFrontier_EventScript_SetBrainObjectGfx - setobjectxyperm 15, 13, 9 - removeobject 15 - addobject 15 - applymovement 15, BattleFrontier_BattleDomeBattleRoom_Movement_SetInvisibleFacingUp + setobjectxyperm LOCALID_OPPONENT, 13, 9 + removeobject LOCALID_OPPONENT + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_SetInvisibleFacingUp BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects:: @ 824C4EF end @@ -746,7 +753,7 @@ BattleFrontier_BattleDomeBattleRoom_Movement_TuckerEnterAndDance: @ 824C78E walk_left step_end -BattleFrontier_BattleDomeBattleRoom_Movement_RefereeMoveForTuckerEntrance: @ 824C7F9 +BattleFrontier_BattleDomeBattleRoom_Movement_AnnouncerMoveForTuckerEntrance: @ 824C7F9 delay_16 delay_16 walk_left @@ -893,14 +900,14 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_SetWalkingAudienceMemberPos:: @ copyvar VAR_TEMP_D, VAR_RESULT compare VAR_TEMP_D, 0 goto_if_eq Common_EventScript_NopReturn - setobjectxyperm 6, 2, 0 - setobjectmovementtype 6, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_AUDIENCE_WALKING, 2, 0 + setobjectmovementtype LOCALID_AUDIENCE_WALKING, MOVEMENT_TYPE_FACE_RIGHT return BattleFrontier_BattleDomeBattleRoom_EventScript_TryDoAudienceMemberWalkToSeat:: @ 824C938 compare VAR_TEMP_D, 0 goto_if_eq Common_EventScript_NopReturn - applymovement 6, BattleFrontier_BattleDomeBattleRoom_Movement_AudienceMemberWalkToSeat + applymovement LOCALID_AUDIENCE_WALKING, BattleFrontier_BattleDomeBattleRoom_Movement_AudienceMemberWalkToSeat return BattleFrontier_BattleDomeBattleRoom_Movement_AudienceTwinJump: @ 824C94B @@ -932,18 +939,18 @@ BattleFrontier_BattleDomeBattleRoom_Movement_AudienceMemberWalkToSeat: @ 824C95E walk_in_place_fastest_down step_end -BattleFrontier_BattleDomeBattleRoom_Movement_TieRefereeEnter: @ 824C964 +BattleFrontier_BattleDomeBattleRoom_Movement_RefereeEnter: @ 824C964 walk_right walk_right walk_right walk_right step_end -BattleFrontier_BattleDomeBattleRoom_Movement_RefereeFaceLeft: @ 824C969 +BattleFrontier_BattleDomeBattleRoom_Movement_AnnouncerFaceLeft: @ 824C969 walk_in_place_fastest_left step_end -BattleFrontier_BattleDomeBattleRoom_Movement_TieRefereeExit: @ 824C96B +BattleFrontier_BattleDomeBattleRoom_Movement_RefereeExit: @ 824C96B walk_left walk_left walk_left diff --git a/data/maps/BattleFrontier_BattleDomeCorridor/scripts.inc b/data/maps/BattleFrontier_BattleDomeCorridor/scripts.inc index ea9da5183..44db802e8 100644 --- a/data/maps/BattleFrontier_BattleDomeCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeCorridor/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattleDomeCorridor_MapScripts:: @ 824B0FE map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleDomeCorridor_OnFrame .byte 0 @@ -12,12 +14,12 @@ BattleFrontier_BattleDomeCorridor_EventScript_EnterCorridor:: @ 824B10E frontier_get FRONTIER_DATA_LVL_MODE compare VAR_RESULT, FRONTIER_LVL_OPEN goto_if_eq BattleFrontier_BattleDomeCorridor_EventScript_WalkToBattleRoomLvOpen - applymovement 1, BattleFrontier_BattleDomeCorridor_Movement_AttendantWalkToDoorLv50 + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleDomeCorridor_Movement_AttendantWalkToDoorLv50 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeCorridor_Movement_PlayerWalkToDoorLv50 waitmovement 0 opendoor 13, 3 waitdooranim - applymovement 1, BattleFrontier_BattleDomeCorridor_Movement_AttendantEnterDoorLv50 + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleDomeCorridor_Movement_AttendantEnterDoorLv50 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeCorridor_Movement_PlayerEnterDoorLv50 waitmovement 0 closedoor 13, 3 @@ -25,12 +27,12 @@ BattleFrontier_BattleDomeCorridor_EventScript_EnterCorridor:: @ 824B10E goto BattleFrontier_BattleDomeCorridor_EventScript_WarpToPreBattleRoom BattleFrontier_BattleDomeCorridor_EventScript_WalkToBattleRoomLvOpen:: @ 824B161 - applymovement 1, BattleFrontier_BattleDomeCorridor_Movement_AttendantWalkToDoorLvOpen + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleDomeCorridor_Movement_AttendantWalkToDoorLvOpen applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeCorridor_Movement_PlayerWalkToDoorLvOpen waitmovement 0 opendoor 37, 3 waitdooranim - applymovement 1, BattleFrontier_BattleDomeCorridor_Movement_AttendantEnterDoorLvOpen + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleDomeCorridor_Movement_AttendantEnterDoorLvOpen applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomeCorridor_Movement_PlayerEnterDoorLvOpen waitmovement 0 closedoor 37, 3 diff --git a/data/maps/BattleFrontier_BattleDomeLobby/scripts.inc b/data/maps/BattleFrontier_BattleDomeLobby/scripts.inc index 6dfae4acc..328f7bd40 100644 --- a/data/maps/BattleFrontier_BattleDomeLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeLobby/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_ATTENDANT_SINGLES, 1 +.set LOCALID_ATTENDANT_DOUBLES, 6 + BattleFrontier_BattleDomeLobby_MapScripts:: @ 82497E2 map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattleDomeLobby_OnResume map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleDomeLobby_OnFrame @@ -262,19 +265,19 @@ BattleFrontier_BattleDomeLobby_EventScript_WalkToDoor:: @ 8249C6E return BattleFrontier_BattleDomeLobby_EventScript_SinglesAttendantWalkToDoor:: @ 8249CDD - applymovement 1, BattleFrontier_BattleDomeLobby_Movement_WalkToDoor + applymovement LOCALID_ATTENDANT_SINGLES, BattleFrontier_BattleDomeLobby_Movement_WalkToDoor return BattleFrontier_BattleDomeLobby_EventScript_DoublesAttendantWalkToDoor:: @ 8249CE5 - applymovement 6, BattleFrontier_BattleDomeLobby_Movement_WalkToDoor + applymovement LOCALID_ATTENDANT_DOUBLES, BattleFrontier_BattleDomeLobby_Movement_WalkToDoor return BattleFrontier_BattleDomeLobby_EventScript_SinglesAttendantEnterDoor:: @ 8249CED - applymovement 1, BattleFrontier_BattleDomeLobby_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT_SINGLES, BattleFrontier_BattleDomeLobby_Movement_AttendantEnterDoor return BattleFrontier_BattleDomeLobby_EventScript_DoublesAttendantEnterDoor:: @ 8249CF5 - applymovement 6, BattleFrontier_BattleDomeLobby_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT_DOUBLES, BattleFrontier_BattleDomeLobby_Movement_AttendantEnterDoor return BattleFrontier_BattleDomeLobby_EventScript_WelcomeSingles:: @ 8249CFD diff --git a/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc index b09674268..0d67792b9 100644 --- a/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomePreBattleRoom/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattleDomePreBattleRoom_MapScripts:: @ 824B1F9 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleDomePreBattleRoom_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleDomePreBattleRoom_OnWarp @@ -151,7 +153,7 @@ BattleFrontier_BattleDomePreBattleRoom_EventScript_ContinueChallenge:: @ 824B46D dome_setopponent msgbox BattleFrontier_BattleDomePreBattleRoom_Text_RightThisWay, MSGBOX_DEFAULT closemessage - applymovement 1, BattleFrontier_BattleDomePreBattleRoom_Movement_AttendantMoveAside + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleDomePreBattleRoom_Movement_AttendantMoveAside waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleDomePreBattleRoom_Movement_PlayerWalkToDoor waitmovement 0 diff --git a/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc index f3befad15..ee7a724d1 100644 --- a/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryBattleRoom/scripts.inc @@ -1,3 +1,12 @@ +.set LOCALID_SCIENTIST_1, 1 +.set LOCALID_OPPONENT, 2 +.set LOCALID_SCIENTIST_2, 3 +.set LOCALID_SCIENTIST_3, 4 +.set LOCALID_SCIENTIST_4, 5 +.set LOCALID_SCIENTIST_5, 6 +.set LOCALID_SCIENTIST_6, 7 +.set LOCALID_PLAYER, 8 + BattleFrontier_BattleFactoryBattleRoom_MapScripts:: @ 825ADAB map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleFactoryBattleRoom_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleFactoryBattleRoom_OnWarp @@ -5,7 +14,7 @@ BattleFrontier_BattleFactoryBattleRoom_MapScripts:: @ 825ADAB .byte 0 @ On this map the player (OBJ_EVENT_ID_PLAYER) is hidden - @ The player is represented instead by object event 8, which has the gfx id VAR_OBJ_GFX_ID_F + @ The player is represented instead by LOCALID_PLAYER, which has the gfx id VAR_OBJ_GFX_ID_F BattleFrontier_BattleFactoryBattleRoom_OnTransition: @ 825ADBB frontier_settrainers @@ -22,7 +31,7 @@ BattleFrontier_BattleFactoryBattleRoom_OnTransition: @ 825ADBB BattleFrontier_BattleFactoryBattleRoom_EventScript_SetUpFactoryHeadObj:: @ 825ADF3 call BattleFrontier_EventScript_SetBrainObjectGfx - setobjectxyperm 2, 7, 9 + setobjectxyperm LOCALID_OPPONENT, 7, 9 end BattleFrontier_BattleFactoryBattleRoom_OnWarp: @ 825AE00 @@ -34,7 +43,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_HideObjects:: @ 825AE0A hideobjectat OBJ_EVENT_ID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM compare VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_EndHideObjects - hideobjectat 2, MAP_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM + hideobjectat LOCALID_OPPONENT, MAP_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM BattleFrontier_BattleFactoryBattleRoom_EventScript_EndHideObjects:: @ 825AE24 end @@ -53,8 +62,8 @@ BattleFrontier_BattleFactoryBattleRoom_OnFrame: @ 825AE31 BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoomFactoryHeadBattle:: @ 825AE3B msgbox BattleFrontier_BattleFactoryBattleRoom_Text_GetAMoveOn, MSGBOX_DEFAULT closemessage - applymovement 2, BattleFrontier_BattleFactoryBattleRoom_Movement_NolandMoveToBattle - applymovement 8, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerEnterRoom + applymovement LOCALID_OPPONENT, BattleFrontier_BattleFactoryBattleRoom_Movement_NolandMoveToBattle + applymovement LOCALID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerEnterRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerEnterRoom waitmovement 0 call BattleFrontier_BattleFactoryBattleRoom_EventScript_ScientistsFaceBattle @@ -64,15 +73,15 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoomFactoryHeadBattle:: BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoom:: @ 825AE67 compare VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_EnterRoomFactoryHeadBattle - applymovement 8, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerEnterRoom + applymovement LOCALID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerEnterRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerEnterRoom waitmovement 0 call BattleFrontier_BattleFactoryBattleRoom_EventScript_ScientistsFaceBattle factory_setopponentgfx - removeobject 2 - setobjectxyperm 2, 7, 1 - addobject 2 - applymovement 2, BattleFrontier_BattleFactoryBattleRoom_Movement_OpponentEnter + removeobject LOCALID_OPPONENT + setobjectxyperm LOCALID_OPPONENT, 7, 1 + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, BattleFrontier_BattleFactoryBattleRoom_Movement_OpponentEnter waitmovement 0 BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleOpponent:: @ 825AEA7 compare VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY @@ -139,7 +148,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandSilver:: @ 825B goto_if_ne BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNoland msgbox BattleFrontier_BattleFactoryBattleRoom_Text_NolandLetsSeeFrontierPass, MSGBOX_DEFAULT closemessage - applymovement 8, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerApproachNoland + applymovement LOCALID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerApproachNoland waitmovement 0 playfanfare MUS_ME_SYMBOLGET message BattleFrontier_BattleFactoryBattleRoom_Text_ReceivedKnowledgeSymbol @@ -168,7 +177,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNolandGold:: @ 825B09 goto_if_eq BattleFrontier_BattleFactoryBattleRoom_EventScript_DefeatedNoland msgbox BattleFrontier_BattleFactoryBattleRoom_Text_OutOfMyLeagueLetsSeePass, MSGBOX_DEFAULT waitmessage - applymovement 8, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerApproachNoland + applymovement LOCALID_PLAYER, BattleFrontier_BattleFactoryBattleRoom_Movement_PlayerApproachNoland waitmovement 0 playfanfare MUS_ME_SYMBOLGET message BattleFrontier_BattleFactoryBattleRoom_Text_KnowledgeSymbolTookGoldenShine @@ -248,12 +257,12 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_WarpToLobbyDoubles:: @ 825B1A end BattleFrontier_BattleFactoryBattleRoom_EventScript_ScientistsFaceBattle:: @ 825B1B4 - applymovement 1, Common_Movement_WalkInPlaceFastestRight - applymovement 3, Common_Movement_WalkInPlaceFastestRight - applymovement 4, Common_Movement_WalkInPlaceFastestRight - applymovement 5, Common_Movement_WalkInPlaceFastestLeft - applymovement 6, Common_Movement_WalkInPlaceFastestLeft - applymovement 7, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_SCIENTIST_1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_SCIENTIST_2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_SCIENTIST_3, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_SCIENTIST_4, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_SCIENTIST_5, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_SCIENTIST_6, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return diff --git a/data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc b/data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc index 87c7dcbbb..60d0ae587 100644 --- a/data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_ATTENDANT_SINGLES, 1 +.set LOCALID_ATTENDANT_DOUBLES, 6 + BattleFrontier_BattleFactoryLobby_MapScripts:: @ 82583E8 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleFactoryLobby_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleFactoryLobby_OnWarp @@ -184,11 +187,11 @@ BattleFrontier_BattleFactoryLobby_EventScript_EnterChallenge:: @ 825871A end BattleFrontier_BattleFactoryLobby_EventScript_TalkedToSinglesAttendant:: @ 825875C - setvar VAR_LAST_TALKED, 1 + setvar VAR_LAST_TALKED, LOCALID_ATTENDANT_SINGLES return BattleFrontier_BattleFactoryLobby_EventScript_TalkedToDoublesAttendant:: @ 8258762 - setvar VAR_LAST_TALKED, 6 + setvar VAR_LAST_TALKED, LOCALID_ATTENDANT_DOUBLES return BattleFrontier_BattleFactoryLobby_EventScript_ExplainChallenge:: @ 8258768 diff --git a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc index 862b04de5..0491c925a 100644 --- a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattleFactoryPreBattleRoom_MapScripts:: @ 8259ABA map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleFactoryPreBattleRoom_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleFactoryPreBattleRoom_OnWarp @@ -11,8 +13,8 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_SetUpObjects:: @ 8259ACF setvar VAR_TEMP_1, 1 compare VAR_0x8006, 1 goto_if_ne BattleFrontier_BattleFactoryPreBattleRoom_EventScript_TurnPlayerNorth - setobjectxy 1, 8, 7 - turnobject 1, DIR_SOUTH + setobjectxy LOCALID_ATTENDANT, 8, 7 + turnobject LOCALID_ATTENDANT, DIR_SOUTH BattleFrontier_BattleFactoryPreBattleRoom_EventScript_TurnPlayerNorth:: @ 8259AEA turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH end @@ -25,7 +27,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterRoom:: @ 8259AF9 compare VAR_0x8006, 1 goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReturnToRoomFromBattle setvar VAR_TEMP_0, 1 - applymovement 1, BattleFrontier_BattleFactoryPreBattleRoom_Movement_AttendantEnterRoom + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleFactoryPreBattleRoom_Movement_AttendantEnterRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleFactoryPreBattleRoom_Movement_PlayerEnterRoom waitmovement 0 compare VAR_0x8006, 2 @@ -70,11 +72,11 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_ReturnToRoomFromBattle:: @ waitse msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_WaitFewMoments, MSGBOX_DEFAULT closemessage - applymovement 1, BattleFrontier_BattleFactoryPreBattleRoom_Movement_AttendantMoveToReceiveCall + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleFactoryPreBattleRoom_Movement_AttendantMoveToReceiveCall waitmovement 0 msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_UnderstoodSirWillDo, MSGBOX_DEFAULT closemessage - applymovement 1, BattleFrontier_BattleFactoryPreBattleRoom_Movement_AttendantReturnToPlayer + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleFactoryPreBattleRoom_Movement_AttendantReturnToPlayer waitmovement 0 msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_MessageFromHeadComeRightNow, MSGBOX_DEFAULT closemessage @@ -419,12 +421,12 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_AskSwapBeforeHead:: @ 825A case MULTI_B_PRESSED, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterBattleRoom BattleFrontier_BattleFactoryPreBattleRoom_EventScript_WalkToBattleRoomLv50:: @ 825A17C - applymovement 1, BattleFrontier_BattleFactoryPreBattleRoom_Movement_GuideWalkToBattleRoomLv50 + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleFactoryPreBattleRoom_Movement_GuideWalkToBattleRoomLv50 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleFactoryPreBattleRoom_Movement_PlayerWalkToBattleRoomLv50 return BattleFrontier_BattleFactoryPreBattleRoom_EventScript_WalkToBattleRoomLvOpen:: @ 825A18B - applymovement 1, BattleFrontier_BattleFactoryPreBattleRoom_Movement_GuideWalkToBattleRoomLvOpen + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleFactoryPreBattleRoom_Movement_GuideWalkToBattleRoomLvOpen applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleFactoryPreBattleRoom_Movement_PlayerWalkToBattleRoomLvOpen return diff --git a/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc index 55a8dcbb7..f1ea064d6 100644 --- a/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattlePalaceBattleRoom/scripts.inc @@ -1,3 +1,9 @@ +.set LOCALID_PLAYER, 1 +.set LOCALID_OPPONENT, 2 +.set LOCALID_ATTENDANT, 3 +.set LOCALID_DUSCLOPS, 4 +.set LOCALID_AZURILL, 5 + BattleFrontier_BattlePalaceBattleRoom_MapScripts:: @ 824F815 map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattlePalaceBattleRoom_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePalaceBattleRoom_OnFrame @@ -5,8 +11,8 @@ BattleFrontier_BattlePalaceBattleRoom_MapScripts:: @ 824F815 .byte 0 @ On this map the player (OBJ_EVENT_ID_PLAYER) is hidden - @ The player is represented instead by object event 1, which has the gfx id VAR_OBJ_GFX_ID_0 - @ The opponent is represented by object event 2, which has the gfx id VAR_OBJ_GFX_ID_1 + @ The player is represented instead by LOCALID_PLAYER, which has the gfx id VAR_OBJ_GFX_ID_0 + @ The opponent is represented by LOCALID_OPPONENT, which has the gfx id VAR_OBJ_GFX_ID_1 BattleFrontier_BattlePalaceBattleRoom_OnTransition: @ 824F825 frontier_settrainers @@ -37,24 +43,24 @@ BattleFrontier_BattlePalaceBattleRoom_OnFrame: @ 824F861 .2byte 0 BattleFrontier_BattlePalaceBattleRoom_EventScript_EnterRoom:: @ 824F86B - showobjectat 1, MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM + showobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM frontier_get FRONTIER_DATA_BATTLE_NUM compare VAR_RESULT, 0 goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_BeginChallenge - applymovement 1, BattleFrontier_BattlePalaceBattleRoom_Movement_PlayerReturnToChallenge + applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_PlayerReturnToChallenge waitmovement 0 - applymovement 3, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown setvar VAR_TEMP_2, 1 frontier_set FRONTIER_DATA_RECORD_DISABLED, TRUE goto BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForOpponent BattleFrontier_BattlePalaceBattleRoom_EventScript_BeginChallenge:: @ 824F8B5 - applymovement 1, BattleFrontier_BattlePalaceBattleRoom_Movement_PlayerEnterRoom + applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_PlayerEnterRoom waitmovement 0 BattleFrontier_BattlePalaceBattleRoom_EventScript_NextOpponentEnter:: @ 824F8BF tower_setopponent - addobject 2 - applymovement 2, BattleFrontier_BattlePalaceBattleRoom_Movement_OpponentEnter + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, BattleFrontier_BattlePalaceBattleRoom_Movement_OpponentEnter waitmovement 0 palace_getopponentintro msgbox gStringVar4, MSGBOX_DEFAULT @@ -73,11 +79,11 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedOpponent:: @ 824F911 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT switch VAR_RESULT case 7, BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon - applymovement 2, BattleFrontier_BattlePalaceBattleRoom_Movement_OpponentExit + applymovement LOCALID_OPPONENT, BattleFrontier_BattlePalaceBattleRoom_Movement_OpponentExit waitmovement 0 - removeobject 2 - applymovement 1, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceUp - applymovement 3, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown + removeobject LOCALID_OPPONENT + applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceUp + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown waitmovement 0 msgbox BattleFrontier_BattlePalaceBattleRoom_Text_LetMeRestoreYourMons, MSGBOX_DEFAULT special LoadPlayerParty @@ -153,8 +159,8 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_AskRetireChallenge:: @ 824FAE2 case MULTI_B_PRESSED, BattleFrontier_BattlePalaceBattleRoom_EventScript_AskReadyForOpponent BattleFrontier_BattlePalaceBattleRoom_EventScript_ContinueChallenge:: @ 824FB14 - applymovement 1, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceRight - applymovement 3, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceRight + applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceRight + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceRight closemessage goto BattleFrontier_BattlePalaceBattleRoom_EventScript_NextOpponentEnter @@ -203,16 +209,16 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_BattleSpenser:: @ 824FC06 call BattleFrontier_EventScript_SetBrainObjectGfx msgbox BattleFrontier_BattlePalaceBattleRoom_Text_AnnounceArrivalOfSpenser, MSGBOX_DEFAULT closemessage - applymovement 1, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceRight - applymovement 3, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceRight - setobjectxyperm 2, 15, 1 - addobject 2 - hideobjectat 2, MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM - setobjectxy 2, 13, 1 - setobjectxyperm 2, 13, 1 - applymovement 4, BattleFrontier_BattlePalaceBattleRoom_Movement_DusclopsEnter - applymovement 5, BattleFrontier_BattlePalaceBattleRoom_Movement_AzurillEnter - applymovement 2, BattleFrontier_BattlePalaceBattleRoom_Movement_SpenserEnter + applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceRight + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceRight + setobjectxyperm LOCALID_OPPONENT, 15, 1 + addobject LOCALID_OPPONENT + hideobjectat LOCALID_OPPONENT, MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM + setobjectxy LOCALID_OPPONENT, 13, 1 + setobjectxyperm LOCALID_OPPONENT, 13, 1 + applymovement LOCALID_DUSCLOPS, BattleFrontier_BattlePalaceBattleRoom_Movement_DusclopsEnter + applymovement LOCALID_AZURILL, BattleFrontier_BattlePalaceBattleRoom_Movement_AzurillEnter + applymovement LOCALID_OPPONENT, BattleFrontier_BattlePalaceBattleRoom_Movement_SpenserEnter waitmovement 0 switch VAR_TEMP_F case FRONTIER_BRAIN_GOLD, BattleFrontier_BattlePalaceBattleRoom_EventScript_IntroSpenserGold @@ -236,18 +242,18 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserSilver:: @ 824F compare VAR_RESULT, 0 goto_if_ne BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SpenserPostSilverBattle, MSGBOX_DEFAULT - applymovement 1, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceUp - applymovement 3, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown + applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceUp + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown msgbox BattleFrontier_BattlePalaceBattleRoom_Text_LetsSeeFrontierPass, MSGBOX_DEFAULT playfanfare MUS_ME_SYMBOLGET message BattleFrontier_BattlePalaceBattleRoom_Text_ReceivedSpiritsSymbol waitmessage waitfanfare frontier_givesymbol - applymovement 2, Common_Movement_WalkInPlaceLeft + applymovement LOCALID_OPPONENT, Common_Movement_WalkInPlaceLeft waitmovement 0 - applymovement 1, Common_Movement_WalkInPlaceFastestRight - applymovement 3, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SpenserAwaitNextTime, MSGBOX_DEFAULT goto BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon @@ -271,18 +277,18 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_DefeatedSpenserGold:: @ 824FD8 compare VAR_RESULT, 2 goto_if_eq BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SpenserYourTeamIsAdmirable, MSGBOX_DEFAULT - applymovement 1, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceUp - applymovement 3, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown + applymovement LOCALID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceUp + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceBattleRoom_Movement_FaceDown msgbox BattleFrontier_BattlePalaceBattleRoom_Text_HurryWithFrontierPass, MSGBOX_DEFAULT playfanfare MUS_ME_SYMBOLGET message BattleFrontier_BattlePalaceBattleRoom_Text_SpiritsSymbolTookGoldenShine waitmessage waitfanfare frontier_givesymbol - applymovement 2, Common_Movement_WalkInPlaceLeft + applymovement LOCALID_OPPONENT, Common_Movement_WalkInPlaceLeft waitmovement 0 - applymovement 1, Common_Movement_WalkInPlaceFastestRight - applymovement 3, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SpenserComeSeeMeAgain, MSGBOX_DEFAULT goto BattleFrontier_BattlePalaceBattleRoom_EventScript_WarpToLobbyWon @@ -306,13 +312,13 @@ BattleFrontier_BattlePalaceBattleRoom_OnWarp: @ 824FE34 .2byte 0 BattleFrontier_BattlePalaceBattleRoom_EventScript_SetUpRoomObjects:: @ 824FE3E - hideobjectat 1, MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM + hideobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM call BattleFrontier_BattlePalaceBattleRoom_EventScript_SetPlayerGfx setvar VAR_TEMP_1, 1 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceBattleRoom_Movement_SetInvisible - removeobject 2 - applymovement 4, BattleFrontier_BattlePalaceBattleRoom_Movement_SetInvisible - applymovement 5, BattleFrontier_BattlePalaceBattleRoom_Movement_SetInvisible + removeobject LOCALID_OPPONENT + applymovement LOCALID_DUSCLOPS, BattleFrontier_BattlePalaceBattleRoom_Movement_SetInvisible + applymovement LOCALID_AZURILL, BattleFrontier_BattlePalaceBattleRoom_Movement_SetInvisible end BattleFrontier_BattlePalaceBattleRoom_EventScript_ReadyFor2ndOpponent:: @ 824FE66 diff --git a/data/maps/BattleFrontier_BattlePalaceCorridor/scripts.inc b/data/maps/BattleFrontier_BattlePalaceCorridor/scripts.inc index 64fd79d76..2b3b8aab3 100644 --- a/data/maps/BattleFrontier_BattlePalaceCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattlePalaceCorridor/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattlePalaceCorridor_MapScripts:: @ 824F4A3 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePalaceCorridor_OnFrame .byte 0 @@ -8,7 +10,7 @@ BattleFrontier_BattlePalaceCorridor_OnFrame: @ 824F4A9 BattleFrontier_BattlePalaceCorridor_EventScript_WalkThroughCorridor:: @ 824F4B3 delay 16 - applymovement 1, BattleFrontier_BattlePalaceCorridor_Movement_EnterCorridor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceCorridor_Movement_EnterCorridor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceCorridor_Movement_EnterCorridor waitmovement 0 lockall @@ -27,12 +29,12 @@ BattleFrontier_BattlePalaceCorridor_EventScript_WalkThroughCorridor:: @ 824F4B3 frontier_get FRONTIER_DATA_LVL_MODE compare VAR_RESULT, FRONTIER_LVL_OPEN goto_if_eq BattleFrontier_BattlePalaceCorridor_EventScript_WalkToOpenBattleRoom - applymovement 1, BattleFrontier_BattlePalaceCorridor_Movement_AttendantWalkTo50BattleRoom + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceCorridor_Movement_AttendantWalkTo50BattleRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceCorridor_Movement_PlayerWalkTo50BattleRoom waitmovement 0 opendoor 6, 3 waitdooranim - applymovement 1, BattleFrontier_BattlePalaceCorridor_Movement_AttendantEnterBattleRoom + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceCorridor_Movement_AttendantEnterBattleRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceCorridor_Movement_PlayerEnterBattleRoom waitmovement 0 closedoor 6, 3 @@ -40,12 +42,12 @@ BattleFrontier_BattlePalaceCorridor_EventScript_WalkThroughCorridor:: @ 824F4B3 goto BattleFrontier_BattlePalaceCorridor_EventScript_WarpToBattleRoom BattleFrontier_BattlePalaceCorridor_EventScript_WalkToOpenBattleRoom:: @ 824F553 - applymovement 1, BattleFrontier_BattlePalaceCorridor_Movement_AttendantWalkToOpenBattleRoom + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceCorridor_Movement_AttendantWalkToOpenBattleRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceCorridor_Movement_PlayerWalkToOpenBattleRoom waitmovement 0 opendoor 10, 3 waitdooranim - applymovement 1, BattleFrontier_BattlePalaceCorridor_Movement_AttendantEnterBattleRoom + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePalaceCorridor_Movement_AttendantEnterBattleRoom applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePalaceCorridor_Movement_PlayerEnterBattleRoom waitmovement 0 closedoor 10, 3 diff --git a/data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc b/data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc index 4d5c1d312..dc0fe4af1 100644 --- a/data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_ATTENDANT_SINGLES, 1 +.set LOCALID_ATTENDANT_DOUBLES, 6 + BattleFrontier_BattlePalaceLobby_MapScripts:: @ 824D77E map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePalaceLobby_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattlePalaceLobby_OnWarp @@ -269,11 +272,11 @@ BattleFrontier_BattlePalaceLobby_EventScript_WalkToDoor:: @ 824DBBC return BattleFrontier_BattlePalaceLobby_EventScript_TalkedToSinglesAttendant:: @ 824DC23 - setvar VAR_LAST_TALKED, 1 + setvar VAR_LAST_TALKED, LOCALID_ATTENDANT_SINGLES return BattleFrontier_BattlePalaceLobby_EventScript_TalkedToDoublesAttendant:: @ 824DC29 - setvar VAR_LAST_TALKED, 6 + setvar VAR_LAST_TALKED, LOCALID_ATTENDANT_DOUBLES return BattleFrontier_BattlePalaceLobby_EventScript_OpenSinglesHallDoor:: @ 824DC2F diff --git a/data/maps/BattleFrontier_BattlePikeCorridor/scripts.inc b/data/maps/BattleFrontier_BattlePikeCorridor/scripts.inc index e4421acbe..1c55d7bf5 100644 --- a/data/maps/BattleFrontier_BattlePikeCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeCorridor/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattlePikeCorridor_MapScripts:: @ 825C771 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePikeCorridor_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattlePikeCorridor_OnWarp @@ -13,7 +15,7 @@ BattleFrontier_BattlePikeCorridor_EventScript_EnterCorridor:: @ 825C786 pike_cleartrainerids pike_nohealing TRUE applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeCorridor_Movement_PlayerEnterCorridor - applymovement 1, BattleFrontier_BattlePikeCorridor_Movement_AttendantEnterCorridor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePikeCorridor_Movement_AttendantEnterCorridor waitmovement 0 lockall msgbox BattleFrontier_BattlePikeCorridor_Text_YourChallengeHasBegun, MSGBOX_DEFAULT diff --git a/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc b/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc index d2cf3fe32..c1d3fc974 100644 --- a/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattlePikeLobby_MapScripts:: @ 825B6C6 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePikeLobby_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattlePikeLobby_OnWarp @@ -200,7 +202,7 @@ BattleFrontier_BattlePikeLobby_EventScript_ShowResults:: @ 825BA80 end BattleFrontier_BattlePikeLobby_EventScript_WalkToCorridor:: @ 825BA94 - applymovement 1, BattleFrontier_BattlePikeLobby_Movement_AttendantWalkToCorridor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePikeLobby_Movement_AttendantWalkToCorridor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeLobby_Movement_PlayerWalkToCorridor waitmovement 0 return diff --git a/data/maps/BattleFrontier_BattlePikeRoomFinal/scripts.inc b/data/maps/BattleFrontier_BattlePikeRoomFinal/scripts.inc index d6c6c3993..51c7d5610 100644 --- a/data/maps/BattleFrontier_BattlePikeRoomFinal/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeRoomFinal/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattlePikeRoomFinal_MapScripts:: @ 825E392 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePikeRoomFinal_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattlePikeRoomFinal_OnWarp @@ -9,7 +11,7 @@ BattleFrontier_BattlePikeRoomFinal_OnFrame: @ 825E39D BattleFrontier_BattlePikeRoomFinal_EventScript_EnterRoom:: @ 825E3A7 delay 16 - applymovement 1, BattleFrontier_BattlePikeRoomFinal_Movement_AttendantApproachPlayer + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePikeRoomFinal_Movement_AttendantApproachPlayer waitmovement 0 frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_WON lockall diff --git a/data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc b/data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc index d8ff75e1e..327b6463c 100644 --- a/data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc @@ -1,3 +1,8 @@ +@ Objects in this room are set dynamically with OBJ_EVENT_GFX_VAR_0 and OBJ_EVENT_GFX_VAR_1 +@ Note: LOCALIDs shared with data/scripts/battle_pike.inc +.equ LOCALID_OBJ_0, 1 +.equ LOCALID_OBJ_1, 2 + BattleFrontier_BattlePikeRoomNormal_MapScripts:: @ 825D152 map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattlePikeRoom_OnResume map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattlePikeRoom_OnTransition @@ -24,7 +29,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterRoom:: @ 825D171 BattleFrontier_BattlePikeRoomNormal_EventScript_EnterSingleBattleRoom:: @ 825D1C6 lockall delay 16 - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_ApproachPlayer + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_ApproachPlayer waitmovement 0 pike_gettrainerintro 0 msgbox gStringVar4, MSGBOX_DEFAULT @@ -44,7 +49,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_WarpToLobbyLost:: @ 825D20A end BattleFrontier_BattlePikeRoomNormal_EventScript_WonSingleBattle:: @ 825D226 - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_NPCExit + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_NPCExit waitmovement 0 end @@ -54,7 +59,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterHardBattleRoom:: @ 825D231 msgbox BattleFrontier_BattlePikeRoomNormal_Text_BattleSomewhatToughTrainer, MSGBOX_DEFAULT waitmessage closemessage - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_ApproachPlayer + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_ApproachPlayer waitmovement 0 pike_gettrainerintro 0 msgbox gStringVar4, MSGBOX_DEFAULT @@ -71,9 +76,9 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterHardBattleRoom:: @ 825D231 end BattleFrontier_BattlePikeRoomNormal_EventScript_WonHardBattle:: @ 825D285 - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_NPCExit + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_NPCExit waitmovement 0 - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_HealNPCApproachPlayer + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_HealNPCApproachPlayer waitmovement 0 lock faceplayer @@ -84,14 +89,14 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_WonHardBattle:: @ 825D285 msgbox BattleFrontier_BattlePikeRoomNormal_Text_EnjoyRestOfChallenge2, MSGBOX_DEFAULT closemessage release - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_NPCExit + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_NPCExit waitmovement 0 end BattleFrontier_BattlePikeRoomNormal_EventScript_EnterBrainRoom:: @ 825D2BF delay 22 lockall - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_PreQueenHealNPCApproachPlayer + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_PreQueenHealNPCApproachPlayer waitmovement 0 pike_prequeenheal switch VAR_RESULT @@ -104,7 +109,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_LucyEnter:: @ 825D2FB closemessage special SpawnCameraObject applymovement OBJ_EVENT_ID_CAMERA, BattleFrontier_BattlePikeRoomNormal_Movement_CameraPanUp - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_HealNPCExitForLucy + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_HealNPCExitForLucy waitmovement 0 playse SE_CURTAIN call BattleFrontier_BattlePikeRoomNormal_EventScript_SetCurtainTilesLittleClosed @@ -118,13 +123,13 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_LucyEnter:: @ 825D2FB playse SE_CURTAIN1 delay 65 call BattleFrontier_BattlePikeRoomNormal_EventScript_SetCurtainTilesMostlyClosed - showobjectat 1, MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL + showobjectat LOCALID_OBJ_0, MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL delay 4 call BattleFrontier_BattlePikeRoomNormal_EventScript_SetCurtainTilesLittleClosed delay 4 call BattleFrontier_BattlePikeRoomNormal_EventScript_SetCurtainTilesOpen waitse - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_LucyEnter + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_LucyEnter waitmovement 0 pike_getbrainstatus switch VAR_RESULT @@ -188,7 +193,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucyGold:: @ 825D460 end BattleFrontier_BattlePikeRoomNormal_EventScript_DefeatedLucy:: @ 825D49D - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_LucyMoveAside + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_LucyMoveAside waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoomNormal_Movement_PlayerWalkUp2 waitmovement 0 @@ -221,7 +226,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_PreQueenHealTwoMons:: @ 825D4FC BattleFrontier_BattlePikeRoomNormal_EventScript_EnterFullHealRoom:: @ 825D50E lockall delay 16 - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_ApproachPlayer + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_ApproachPlayer waitmovement 0 message BattleFrontier_BattlePikeRoomNormal_Text_WillRestoreToFullHealth waitmessage @@ -230,7 +235,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterFullHealRoom:: @ 825D50E special HealPlayerParty msgbox BattleFrontier_BattlePikeRoomNormal_Text_EnjoyRestOfChallenge, MSGBOX_DEFAULT closemessage - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_NPCExit + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_NPCExit waitmovement 0 releaseall end @@ -238,14 +243,14 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterFullHealRoom:: @ 825D50E BattleFrontier_BattlePikeRoomNormal_EventScript_EnterDoubleBattleRoom:: @ 825D53E lockall delay 16 - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer1WalkRight - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer2WalkLeft + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer1WalkRight + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer2WalkLeft waitmovement 0 - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_DoubleTrainersWalkDown - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_DoubleTrainersWalkDown + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_DoubleTrainersWalkDown + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_DoubleTrainersWalkDown waitmovement 0 - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer1FacePlayer - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer2FacePlayer + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer1FacePlayer + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer2FacePlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoomNormal_Movement_PlayerFaceTrainer1 waitmovement 0 @@ -270,9 +275,9 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterDoubleBattleRoom:: @ 825D53 BattleFrontier_BattlePikeRoomNormal_EventScript_WonDoubleBattle:: @ 825D5DC applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoomNormal_Movement_PlayerFaceTrainer2 waitmovement 0 - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer1Exit + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer1Exit waitmovement 0 - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer2Exit + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_Trainer2Exit waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoomNormal_Movement_PlayerFaceUp waitmovement 0 @@ -281,7 +286,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_WonDoubleBattle:: @ 825D5DC BattleFrontier_BattlePikeRoomNormal_EventScript_EnterStatusRoom:: @ 825D605 lockall message BattleFrontier_BattlePikeRoomNormal_Text_WatchOut - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_MonApproachPlayer + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_MonApproachPlayer waitmovement 0 pike_getstatusmon copyvar VAR_0x8004, VAR_RESULT @@ -311,9 +316,9 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaAttack:: @ 825D643 call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaUsedHypnosis pike_flashscreen waitstate - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_NPCApproachMon + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_NPCApproachMon waitmovement 0 - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_MonFaceNPC + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_MonFaceNPC waitmovement 0 waitse playmoncry SPECIES_KIRLIA, 0 @@ -323,8 +328,8 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_KirliaAttack:: @ 825D643 playmoncry SPECIES_KIRLIA, 0 waitmoncry closemessage - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_MonMoveAside - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_StatusNPCApproachPlayer + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_MonMoveAside + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_StatusNPCApproachPlayer waitmovement 0 msgbox BattleFrontier_BattlePikeRoomNormal_Text_ApologizeForKirlia, MSGBOX_DEFAULT return @@ -342,9 +347,9 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsAttack:: @ 825D6D5 call_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsUsedWillOWisp pike_flashscreen waitstate - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_NPCApproachMon + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_NPCApproachMon waitmovement 0 - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_MonFaceNPC + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_MonFaceNPC waitmovement 0 waitse playmoncry SPECIES_DUSCLOPS, 0 @@ -354,8 +359,8 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_DusclopsAttack:: @ 825D6D5 playmoncry SPECIES_DUSCLOPS, 0 waitmoncry closemessage - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_MonMoveAside - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_StatusNPCApproachPlayer + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_MonMoveAside + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_StatusNPCApproachPlayer waitmovement 0 msgbox BattleFrontier_BattlePikeRoomNormal_Text_ApologizeForDusclops, MSGBOX_DEFAULT return @@ -573,7 +578,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_HealNPC:: @ 825D83E msgbox BattleFrontier_BattlePikeRoomNormal_Text_BestOfLuckFarewell, MSGBOX_DEFAULT closemessage release - applymovement 1, BattleFrontier_BattlePikeRoomNormal_Movement_HealNPCExit + applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_HealNPCExit waitmovement 0 end @@ -598,7 +603,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_StatusMon:: @ 825D88D msgbox BattleFrontier_BattlePikeRoomNormal_Text_Silence, MSGBOX_DEFAULT closemessage release - applymovement 2, BattleFrontier_BattlePikeRoomNormal_Movement_MonFaceRight + applymovement LOCALID_OBJ_1, BattleFrontier_BattlePikeRoomNormal_Movement_MonFaceRight waitmovement 0 end diff --git a/data/maps/BattleFrontier_BattlePikeThreePathRoom/scripts.inc b/data/maps/BattleFrontier_BattlePikeThreePathRoom/scripts.inc index a9da7a092..46edebce6 100644 --- a/data/maps/BattleFrontier_BattlePikeThreePathRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeThreePathRoom/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_HINT_GIVER, 2 + BattleFrontier_BattlePikeThreePathRoom_MapScripts:: @ 825C843 map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattlePikeRoom_OnResume map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePikeThreePathRoom_OnFrame @@ -159,12 +161,12 @@ BattleFrontier_BattlePikeThreePathRoom_EventScript_SetPikeQueenHint:: @ 825CA91 end BattleFrontier_BattlePikeThreePathRoom_EventScript_GivePikeQueenHint:: @ 825CA97 - applymovement 2, BattleFrontier_BattlePikeThreePathRoom_Movement_HintGiverApproachPlayer + applymovement LOCALID_HINT_GIVER, BattleFrontier_BattlePikeThreePathRoom_Movement_HintGiverApproachPlayer waitmovement 0 lockall msgbox BattleFrontier_BattlePikeThreePathRoom_Text_TerrifyingEvent, MSGBOX_DEFAULT releaseall - applymovement 2, BattleFrontier_BattlePikeThreePathRoom_Movement_HintGiverReturnToPos + applymovement LOCALID_HINT_GIVER, BattleFrontier_BattlePikeThreePathRoom_Movement_HintGiverReturnToPos waitmovement 0 setvar VAR_TEMP_5, 255 end diff --git a/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc b/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc index c23f62d78..6c17ca02a 100644 --- a/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_ATTENDANT, 1 +.set LOCALID_HINT_GIVER, 2 + BattleFrontier_BattlePyramidLobby_MapScripts:: @ 8250716 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePyramidLobby_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleDomeLobby_OnWarp @@ -206,7 +209,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_EndCancelChallenge:: @ 8250ACC BattleFrontier_BattlePyramidLobby_EventScript_HintGiver:: @ 8250ACE lockall - applymovement 2, Common_Movement_FacePlayer + applymovement LOCALID_HINT_GIVER, Common_Movement_FacePlayer waitmovement 0 msgbox BattleFrontier_BattlePyramidLobby_Text_TellYouWhatMisfortunesAwait, MSGBOX_DEFAULT call BattleFrontier_BattlePyramidLobby_EventScript_GiveHint @@ -370,7 +373,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_ShowResults:: @ 8250D42 end BattleFrontier_BattlePyramidLobby_EventScript_WalkToPanelAndReceiveBag:: @ 8250D56 - applymovement 1, BattleFrontier_BattlePyramidLobby_Movement_AttendantWalkToPanel + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePyramidLobby_Movement_AttendantWalkToPanel applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePyramidLobby_Movement_PlayerWalkToPanel waitmovement 0 msgbox BattleFrontier_BattlePyramidLobby_Text_WeWillHoldBagForSafekeeping, MSGBOX_DEFAULT @@ -389,7 +392,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_ReceiveBattleBag:: @ 8250D9C waitse msgbox BattleFrontier_BattlePyramidLobby_Text_StepOnFloorPanel, MSGBOX_DEFAULT closemessage - applymovement 1, BattleFrontier_BattlePyramidLobby_Movement_AttendantMoveAside + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePyramidLobby_Movement_AttendantMoveAside waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePyramidLobby_Movement_PlayerStepOnPanel waitmovement 0 diff --git a/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc b/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc index d09bac10f..7aee4512d 100644 --- a/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidTop/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_ATTENDANT, 1 +.set LOCALID_BRANDON, 2 + BattleFrontier_BattlePyramidTop_MapScripts:: @ 82550A1 map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattlePyramidTop_OnResume map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePyramidTop_OnFrame @@ -19,7 +22,7 @@ BattleFrontier_BattlePyramidTop_EventScript_SetUpObjects:: @ 82550D8 turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH compare VAR_TEMP_C, 0 goto_if_ne BattleFrontier_BattlePyramidTop_EventScript_EndSetUpObjects - setobjectxyperm 2, 0, 0 + setobjectxyperm LOCALID_BRANDON, 0, 0 BattleFrontier_BattlePyramidTop_EventScript_EndSetUpObjects:: @ 82550F3 end @@ -77,11 +80,11 @@ BattleFrontier_BattlePyramidTop_EventScript_Attendant:: @ 82551D0 goto_if_ne BattleFrontier_BattlePyramidTop_EventScript_BrandonHereMoveAside msgbox BattleFrontier_BattlePyramidTop_Text_ReachedSummitUpYouGo, MSGBOX_DEFAULT closemessage - applymovement 1, BattleFrontier_BattlePyramidTop_Movement_AttendantMoveAside + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePyramidTop_Movement_AttendantMoveAside waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePyramidTop_Movement_PlayerClimbToTop waitmovement 0 - applymovement 1, BattleFrontier_BattlePyramidTop_Movement_AttendantBlockPath + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePyramidTop_Movement_AttendantBlockPath waitmovement 0 message BattleFrontier_BattlePyramidTop_Text_PlayerConqueredPyramid waitmessage @@ -101,7 +104,7 @@ BattleFrontier_BattlePyramidTop_EventScript_StepForwardWhenReady:: @ 8255236 BattleFrontier_BattlePyramidTop_EventScript_BrandonHereMoveAside:: @ 8255240 msgbox BattleFrontier_BattlePyramidTop_Text_ChiefBeatYouHere, MSGBOX_DEFAULT - applymovement 1, BattleFrontier_BattlePyramidTop_Movement_AttendantMoveAside + applymovement LOCALID_ATTENDANT, BattleFrontier_BattlePyramidTop_Movement_AttendantMoveAside setvar VAR_TEMP_D, 1 closemessage end @@ -121,14 +124,14 @@ BattleFrontier_BattlePyramidTop_EventScript_BattleBrandon:: @ 8255256 msgbox BattleFrontier_BattlePyramidTop_Text_ExplorationsAreGrandestAdventure, MSGBOX_DEFAULT closemessage frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH - applymovement 2, BattleFrontier_BattlePyramidTop_Movement_BrandonApproachPlayer + applymovement LOCALID_BRANDON, BattleFrontier_BattlePyramidTop_Movement_BrandonApproachPlayer waitmovement 0 msgbox BattleFrontier_BattlePyramidTop_Text_ImPyramidKingBrandon, MSGBOX_DEFAULT goto BattleFrontier_BattlePyramidTop_EventScript_BattleBrandonSilver end BattleFrontier_BattlePyramidTop_EventScript_BrandonHeardSilverSpeech:: @ 82552D0 - applymovement 2, BattleFrontier_BattlePyramidTop_Movement_BrandonApproachPlayer + applymovement LOCALID_BRANDON, BattleFrontier_BattlePyramidTop_Movement_BrandonApproachPlayer waitmovement 0 BattleFrontier_BattlePyramidTop_EventScript_BattleBrandonSilver:: @ 82552DA msgbox BattleFrontier_BattlePyramidTop_Text_BringCourageToOurBattle, MSGBOX_DEFAULT @@ -161,14 +164,14 @@ BattleFrontier_BattlePyramidTop_EventScript_BrandonIntroGold:: @ 8255335 msgbox BattleFrontier_BattlePyramidTop_Text_BrandonYouveReturned, MSGBOX_DEFAULT closemessage frontier_set FRONTIER_DATA_HEARD_BRAIN_SPEECH - applymovement 2, BattleFrontier_BattlePyramidTop_Movement_BrandonApproachPlayer + applymovement LOCALID_BRANDON, BattleFrontier_BattlePyramidTop_Movement_BrandonApproachPlayer waitmovement 0 msgbox BattleFrontier_BattlePyramidTop_Text_MyCourageIsOffMeter, MSGBOX_DEFAULT goto BattleFrontier_BattlePyramidTop_EventScript_BattleBrandonGold end BattleFrontier_BattlePyramidTop_EventScript_BrandonHeardGoldSpeech:: @ 8255388 - applymovement 2, BattleFrontier_BattlePyramidTop_Movement_BrandonApproachPlayer + applymovement LOCALID_BRANDON, BattleFrontier_BattlePyramidTop_Movement_BrandonApproachPlayer waitmovement 0 BattleFrontier_BattlePyramidTop_EventScript_BattleBrandonGold:: @ 8255392 msgbox BattleFrontier_BattlePyramidTop_Text_EverythingYouHave, MSGBOX_DEFAULT diff --git a/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc index 89eaeda50..bc12c14f4 100644 --- a/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_OPPONENT, 1 +.set LOCALID_ATTENDANT_1, 2 +.set LOCALID_ATTENDANT_2, 3 + BattleFrontier_BattleTowerBattleRoom_MapScripts:: @ 8241B40 map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleTowerBattleRoom_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleTowerBattleRoom_OnWarp @@ -9,7 +13,7 @@ BattleFrontier_BattleTowerBattleRoom_OnWarp: @ 8241B4B BattleFrontier_BattleTowerBattleRoom_EventScript_SetUpObjects:: @ 8241B55 setvar VAR_TEMP_1, 1 - applymovement 3, BattleFrontier_BattleTowerBattleRoom_Movement_SetInvisible + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerBattleRoom_Movement_SetInvisible end BattleFrontier_BattleTowerBattleRoom_OnFrame: @ 8241B62 @@ -23,7 +27,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_EnterRoom:: @ 8241B6C frontier_get FRONTIER_DATA_BATTLE_NUM compare VAR_RESULT, 0 goto_if_eq BattleFrontier_BattleTowerBattleRoom_EventScript_OpponentEnter - applymovement 2, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantApproachPlayer + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerBattleRoom_Movement_PlayerFaceAttendant waitmovement 0 @@ -33,8 +37,8 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_EnterRoom:: @ 8241B6C BattleFrontier_BattleTowerBattleRoom_EventScript_OpponentEnter:: @ 8241BC3 tower_setopponent - addobject 1 - applymovement 1, BattleFrontier_BattleTowerBattleRoom_Movement_OpponentEnter + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, BattleFrontier_BattleTowerBattleRoom_Movement_OpponentEnter waitmovement 0 tower_getopponentintro 0 msgbox gStringVar4, MSGBOX_DEFAULT @@ -54,13 +58,13 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_DefeatedOpponent:: @ 8241C2F tower_setbattlewon switch VAR_RESULT case 7, BattleFrontier_BattleTowerBattleRoom_EventScript_WarpToLobbyWon - applymovement 1, BattleFrontier_BattleTowerBattleRoom_Movement_OpponentExit + applymovement LOCALID_OPPONENT, BattleFrontier_BattleTowerBattleRoom_Movement_OpponentExit waitmovement 0 - removeobject 1 + removeobject LOCALID_OPPONENT frontier_getbrainstatus compare VAR_RESULT, FRONTIER_BRAIN_NOT_READY call_if_ne BattleFrontier_BattleTowerBattleRoom_EventScript_SecondAttendantEnter - applymovement 2, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantApproachPlayer + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerBattleRoom_Movement_PlayerFaceAttendant waitmovement 0 @@ -127,7 +131,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_ContinueChallenge:: @ 8241DDC closemessage applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerBattleRoom_Movement_PlayerFaceBattle waitmovement 0 - applymovement 2, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantReturnToPos + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantReturnToPos waitmovement 0 goto BattleFrontier_BattleTowerBattleRoom_EventScript_OpponentEnter @@ -193,19 +197,19 @@ BattleFrontier_EventScript_IncrementWinStreak:: @ 8241EBA return BattleFrontier_BattleTowerBattleRoom_EventScript_SecondAttendantEnter:: @ 8241EC3 - applymovement 3, BattleFrontier_BattleTowerBattleRoom_Movement_SecondAttendantEnter + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerBattleRoom_Movement_SecondAttendantEnter waitmovement 0 - applymovement 3, Common_Movement_WalkInPlaceLeft + applymovement LOCALID_ATTENDANT_2, Common_Movement_WalkInPlaceLeft waitmovement 0 playse SE_PIN - applymovement 2, Common_Movement_ExclamationMark + applymovement LOCALID_ATTENDANT_1, Common_Movement_ExclamationMark waitmovement 0 - applymovement 2, Common_Movement_Delay48 + applymovement LOCALID_ATTENDANT_1, Common_Movement_Delay48 waitmovement 0 - applymovement 3, BattleFrontier_BattleTowerBattleRoom_Movement_SecondAttendantDelay - applymovement 2, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantFaceSecondAttendant + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerBattleRoom_Movement_SecondAttendantDelay + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantFaceSecondAttendant waitmovement 0 - applymovement 3, BattleFrontier_BattleTowerBattleRoom_Movement_SecondAttendantExit + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerBattleRoom_Movement_SecondAttendantExit waitmovement 0 return @@ -241,10 +245,10 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_BattleAnabel:: @ 8241FAF closemessage applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerBattleRoom_Movement_PlayerFaceBattle waitmovement 0 - applymovement 2, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantReturnToPos + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerBattleRoom_Movement_AttendantReturnToPos waitmovement 0 - addobject 1 - applymovement 1, BattleFrontier_BattleTowerBattleRoom_Movement_AnabelEnter + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, BattleFrontier_BattleTowerBattleRoom_Movement_AnabelEnter waitmovement 0 switch VAR_TEMP_F case FRONTIER_BRAIN_GOLD, BattleFrontier_BattleTowerBattleRoom_EventScript_AnabelGoldIntro diff --git a/data/maps/BattleFrontier_BattleTowerCorridor/scripts.inc b/data/maps/BattleFrontier_BattleTowerCorridor/scripts.inc index 1acea4785..0237e525c 100644 --- a/data/maps/BattleFrontier_BattleTowerCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerCorridor/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattleTowerCorridor_MapScripts:: @ 8241AAA map_script MAP_SCRIPT_ON_LOAD, BattleFrontier_BattleTowerCorridor_OnLoad map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleTowerCorridor_OnFrame @@ -23,13 +25,13 @@ BattleFrontier_BattleTowerCorridor_EventScript_EnterCorridor:: @ 8241AF0 setvar VAR_TEMP_0, 1 compare VAR_0x8006, 1 goto_if_eq BattleFrontier_BattleTowerCorridor_EventScript_WalkToFarDoor - applymovement 1, BattleFrontier_BattleTowerCorridor_Movement_AttendantWalkToDoor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerCorridor_Movement_AttendantWalkToDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerCorridor_Movement_PlayerWalkToDoor waitmovement 0 goto BattleFrontier_BattleTowerCorridor_EventScript_WarpToBattleRoom BattleFrontier_BattleTowerCorridor_EventScript_WalkToFarDoor:: @ 8241B16 - applymovement 1, BattleFrontier_BattleTowerCorridor_Movement_AttendantWalkToFarDoor + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerCorridor_Movement_AttendantWalkToFarDoor applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerCorridor_Movement_PlayerWalkToFarDoor waitmovement 0 diff --git a/data/maps/BattleFrontier_BattleTowerElevator/scripts.inc b/data/maps/BattleFrontier_BattleTowerElevator/scripts.inc index e74d08a17..8e66465b7 100644 --- a/data/maps/BattleFrontier_BattleTowerElevator/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerElevator/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattleTowerElevator_MapScripts:: @ 82419DB map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleTowerElevator_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleTowerElevator_OnWarp @@ -9,7 +11,7 @@ BattleFrontier_BattleTowerElevator_OnFrame: @ 82419E6 BattleFrontier_BattleTowerElevator_EventScript_EnterElevator:: @ 82419F0 setvar VAR_TEMP_0, 1 - applymovement 1, BattleFrontier_BattleTowerElevator_Movement_AttendantEnter + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerElevator_Movement_AttendantEnter applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerElevator_Movement_PlayerEnter waitmovement 0 special BufferBattleTowerElevatorFloors @@ -17,7 +19,7 @@ BattleFrontier_BattleTowerElevator_EventScript_EnterElevator:: @ 82419F0 special MoveElevator waitstate delay 48 - applymovement 1, BattleFrontier_BattleTowerElevator_Movement_AttendantExit + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerElevator_Movement_AttendantExit applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerElevator_Movement_PlayerExit waitmovement 0 call BattleFrontier_BattleTowerElevator_EventScript_WarpToNextRoom diff --git a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc index 14e5afb11..4b1f196e3 100644 --- a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_ATTENDANT_SINGLES, 1 +.set LOCALID_ATTENDANT_DOUBLES, 7 +.set LOCALID_ATTENDANT_MULTIS, 8 +.set LOCALID_ATTENDANT_LINK_MULTIS, 9 + BattleFrontier_BattleTowerLobby_MapScripts:: @ 823E67B map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattleTowerLobby_OnResume map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleTowerLobby_OnTransition @@ -706,19 +711,19 @@ BattleFrontier_BattleTowerLobby_EventScript_SetAttendantTalkedTo:: @ 823F1E8 return BattleFrontier_BattleTowerLobby_EventScript_TalkedToSinglesAttendant:: @ 823F215 - setvar VAR_LAST_TALKED, 1 + setvar VAR_LAST_TALKED, LOCALID_ATTENDANT_SINGLES return BattleFrontier_BattleTowerLobby_EventScript_TalkedToDoublesAttendant:: @ 823F21B - setvar VAR_LAST_TALKED, 7 + setvar VAR_LAST_TALKED, LOCALID_ATTENDANT_DOUBLES return BattleFrontier_BattleTowerLobby_EventScript_TalkedToMultisAttendant:: @ 823F221 - setvar VAR_LAST_TALKED, 8 + setvar VAR_LAST_TALKED, LOCALID_ATTENDANT_MULTIS return BattleFrontier_BattleTowerLobby_EventScript_TalkedToLinkMultisAttendant:: @ 823F227 - setvar VAR_LAST_TALKED, 9 + setvar VAR_LAST_TALKED, LOCALID_ATTENDANT_LINK_MULTIS return BattleFrontier_BattleTowerLobby_EventScript_GetDoorXCoord:: @ 823F22D diff --git a/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc index 754384136..d764419fd 100644 --- a/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerMultiBattleRoom/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_OPPONENT_1, 1 +.set LOCALID_ATTENDANT_1, 2 +.set LOCALID_ATTENDANT_2, 3 +.set LOCALID_OPPONENT_2, 4 +.set LOCALID_PLAYER, 5 +.set LOCALID_PARTNER, 6 + BattleFrontier_BattleTowerMultiBattleRoom_MapScripts:: @ 8248EE8 map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleTowerMultiBattleRoom_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleTowerMultiBattleRoom_OnWarp @@ -5,8 +12,8 @@ BattleFrontier_BattleTowerMultiBattleRoom_MapScripts:: @ 8248EE8 .byte 0 @ On this map the player (OBJ_EVENT_ID_PLAYER) is hidden - @ The player is represented instead by object event 5, which has the gfx id VAR_OBJ_GFX_ID_F - @ The multi partner is represented by object event 6, which has the gfx id VAR_OBJ_GFX_ID_E + @ The player is represented instead by LOCALID_PLAYER, which has the gfx id VAR_OBJ_GFX_ID_F + @ The multi partner is represented by LOCALID_PARTNER, which has the gfx id VAR_OBJ_GFX_ID_E BattleFrontier_BattleTowerMultiBattleRoom_OnTransition: @ 8248EF8 compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS @@ -45,38 +52,38 @@ BattleFrontier_BattleTowerMultiBattleRoom_OnFrame: @ 8248F43 BattleFrontier_BattleTowerMultiBattleRoom_EventScript_EnterRoom:: @ 8248F4D setvar VAR_TEMP_0, 1 - applymovement 5, BattleFrontier_BattleTowerMultiBattleRoom_Movement_PlayerEnterRoom - applymovement 6, BattleFrontier_BattleTowerMultiBattleRoom_Movement_PartnerEnterRoom + applymovement LOCALID_PLAYER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_PlayerEnterRoom + applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_PartnerEnterRoom waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM compare VAR_RESULT, 0 goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_OpponentsEnter - applymovement 2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer - applymovement 3, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 - applymovement 5, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant - applymovement 6, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant + applymovement LOCALID_PLAYER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant + applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant waitmovement 0 frontier_set FRONTIER_DATA_RECORD_DISABLED, TRUE goto BattleFrontier_BattleTowerMultiBattleRoom_EventScript_AskReadyForOpponents BattleFrontier_BattleTowerMultiBattleRoom_EventScript_OpponentsEnter:: @ 8248FB4 tower_setopponent - addobject 1 - addobject 4 - applymovement 1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent1Enter - applymovement 4, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent2Enter + addobject LOCALID_OPPONENT_1 + addobject LOCALID_OPPONENT_2 + applymovement LOCALID_OPPONENT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent1Enter + applymovement LOCALID_OPPONENT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent2Enter waitmovement 0 compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DoOpponentIntrosLink tower_getopponentintro 0 delay 15 - applymovement 1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft + applymovement LOCALID_OPPONENT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft waitmovement 0 msgbox gStringVar4, MSGBOX_DEFAULT waitmessage tower_getopponentintro 1 - applymovement 4, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft + applymovement LOCALID_OPPONENT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft waitmovement 0 msgbox gStringVar4, MSGBOX_DEFAULT waitmessage @@ -85,13 +92,13 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_OpponentsEnter:: @ 8248FB4 BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DoOpponentIntrosLink:: @ 8249026 tower_getopponentintro 0 delay 15 - applymovement 1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft + applymovement LOCALID_OPPONENT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft waitmovement 0 messageautoscroll gStringVar4 waitmessage delay 48 tower_getopponentintro 1 - applymovement 4, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft + applymovement LOCALID_OPPONENT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft waitmovement 0 messageautoscroll gStringVar4 waitmessage @@ -112,16 +119,16 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DefeatedOpponents:: @ 8249 tower_setbattlewon switch VAR_RESULT case 7, BattleFrontier_BattleTowerMultiBattleRoom_EventScript_WarpToLobbyWon - applymovement 4, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent2Exit - applymovement 1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent1Exit + applymovement LOCALID_OPPONENT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent2Exit + applymovement LOCALID_OPPONENT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_Opponent1Exit waitmovement 0 - removeobject 1 - removeobject 4 - applymovement 2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer - applymovement 3, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer + removeobject LOCALID_OPPONENT_1 + removeobject LOCALID_OPPONENT_2 + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 - applymovement 5, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant - applymovement 6, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant + applymovement LOCALID_PLAYER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant + applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceAttendant waitmovement 0 compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_LINK_MULTIS goto_if_eq BattleFrontier_BattleTowerMultiBattleRoom_EventScript_RetorePartyMsgLink @@ -196,11 +203,11 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_AskRetireChallenge:: @ 824 BattleFrontier_BattleTowerMultiBattleRoom_EventScript_ContinueChallenge:: @ 8249283 closemessage clearflag FLAG_TEMP_2 - applymovement 5, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceBattle - applymovement 6, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceBattle + applymovement LOCALID_PLAYER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceBattle + applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiBattleRoom_Movement_FaceBattle waitmovement 0 - applymovement 2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantReturnToPos - applymovement 3, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantReturnToPos + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantReturnToPos + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_AttendantReturnToPos waitmovement 0 goto BattleFrontier_BattleTowerMultiBattleRoom_EventScript_OpponentsEnter end diff --git a/data/maps/BattleFrontier_BattleTowerMultiCorridor/scripts.inc b/data/maps/BattleFrontier_BattleTowerMultiCorridor/scripts.inc index 532347ea9..5e496527e 100644 --- a/data/maps/BattleFrontier_BattleTowerMultiCorridor/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerMultiCorridor/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_PLAYER, 1 +.set LOCALID_ATTENDANT_1, 2 +.set LOCALID_ATTENDANT_2, 3 +.set LOCALID_PARTNER, 4 + BattleFrontier_BattleTowerMultiCorridor_MapScripts:: @ 8248D4A map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleTowerMultiCorridor_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattleTowerMultiCorridor_OnWarp @@ -5,8 +10,8 @@ BattleFrontier_BattleTowerMultiCorridor_MapScripts:: @ 8248D4A .byte 0 @ On this map the player (OBJ_EVENT_ID_PLAYER) is hidden - @ The player is represented instead by object event 1, which has the gfx id VAR_OBJ_GFX_ID_F - @ The multi partner is represented by object event 4, which has the gfx id VAR_OBJ_GFX_ID_E + @ The player is represented instead by LOCALID_PLAYER, and has the gfx id VAR_OBJ_GFX_ID_F + @ The multi partner is represented by LOCALID_PARTNER, and has the gfx id VAR_OBJ_GFX_ID_E BattleFrontier_BattleTowerMultiCorridor_OnTransition: @ 8248D5A compare VAR_FRONTIER_BATTLE_MODE, FRONTIER_MODE_MULTIS @@ -37,8 +42,8 @@ BattleFrontier_BattleTowerMultiCorridor_OnWarp: @ 8248D95 BattleFrontier_BattleTowerMultiCorridor_EventScript_SetUpObjects:: @ 8248D9F hideobjectat OBJ_EVENT_ID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR - hideobjectat 1, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR - hideobjectat 4, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR + hideobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR + hideobjectat LOCALID_PARTNER, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR special OffsetCameraForBattle end @@ -54,10 +59,10 @@ BattleFrontier_BattleTowerMultiCorridor_EventScript_EnterCorridor:: @ 8248DBC opendoor 1, 1 waitdooranim clearflag FLAG_ENABLE_MULTI_CORRIDOR_DOOR - showobjectat 1, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR - showobjectat 4, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR - applymovement 1, BattleFrontier_BattleTowerMultiCorridor_Movement_ExitElevator - applymovement 4, BattleFrontier_BattleTowerMultiCorridor_Movement_ExitElevator + showobjectat LOCALID_PLAYER, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR + showobjectat LOCALID_PARTNER, MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR + applymovement LOCALID_PLAYER, BattleFrontier_BattleTowerMultiCorridor_Movement_ExitElevator + applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiCorridor_Movement_ExitElevator waitmovement 0 setflag FLAG_ENABLE_MULTI_CORRIDOR_DOOR setvar VAR_0x8004, 14 @ x coord of far door, used by DrawDoor @@ -65,21 +70,21 @@ BattleFrontier_BattleTowerMultiCorridor_EventScript_EnterCorridor:: @ 8248DBC closedoor 1, 1 waitdooranim clearflag FLAG_ENABLE_MULTI_CORRIDOR_DOOR - applymovement 1, BattleFrontier_BattleTowerMultiCorridor_Movement_PlayerWalkToDoor - applymovement 4, BattleFrontier_BattleTowerMultiCorridor_Movement_PartnerWalkToDoor - applymovement 3, BattleFrontier_BattleTowerMultiCorridor_Movement_PlayerAttendantWalkToDoor - applymovement 2, BattleFrontier_BattleTowerMultiCorridor_Movement_PartnerAttendantWalkToDoor + applymovement LOCALID_PLAYER, BattleFrontier_BattleTowerMultiCorridor_Movement_PlayerWalkToDoor + applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiCorridor_Movement_PartnerWalkToDoor + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerMultiCorridor_Movement_PlayerAttendantWalkToDoor + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerMultiCorridor_Movement_PartnerAttendantWalkToDoor waitmovement 0 delay 40 - applymovement 3, Common_Movement_WalkInPlaceFastestUp - applymovement 2, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_ATTENDANT_2, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_ATTENDANT_1, Common_Movement_WalkInPlaceFastestUp waitmovement 0 opendoor 7, 1 waitdooranim - applymovement 3, BattleFrontier_BattleTowerMultiCorridor_Movement_AttendantEnterDoor - applymovement 2, BattleFrontier_BattleTowerMultiCorridor_Movement_AttendantEnterDoor - applymovement 1, BattleFrontier_BattleTowerMultiCorridor_Movement_TrainerEnterDoor - applymovement 4, BattleFrontier_BattleTowerMultiCorridor_Movement_TrainerEnterDoor + applymovement LOCALID_ATTENDANT_2, BattleFrontier_BattleTowerMultiCorridor_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT_1, BattleFrontier_BattleTowerMultiCorridor_Movement_AttendantEnterDoor + applymovement LOCALID_PLAYER, BattleFrontier_BattleTowerMultiCorridor_Movement_TrainerEnterDoor + applymovement LOCALID_PARTNER, BattleFrontier_BattleTowerMultiCorridor_Movement_TrainerEnterDoor waitmovement 0 closedoor 7, 1 waitdooranim diff --git a/data/maps/BattleFrontier_BattleTowerMultiPartnerRoom/scripts.inc b/data/maps/BattleFrontier_BattleTowerMultiPartnerRoom/scripts.inc index 77b9d1cd0..71487225c 100644 --- a/data/maps/BattleFrontier_BattleTowerMultiPartnerRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerMultiPartnerRoom/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + BattleFrontier_BattleTowerMultiPartnerRoom_MapScripts:: @ 8243D92 map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattleTowerMultiPartnerRoom_OnResume map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleTowerMultiPartnerRoom_OnTransition @@ -33,7 +35,7 @@ BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_ChosePartner:: @ 8243DDA setvar VAR_OBJ_GFX_ID_7, OBJ_EVENT_GFX_BOY_1 setvar VAR_TEMP_1, 1 setvar VAR_TEMP_3, 1 - setobjectxyperm 1, 10, 2 + setobjectxyperm LOCALID_ATTENDANT, 10, 2 end BattleFrontier_BattleTowerMultiPartnerRoom_OnWarp: @ 8243E14 @@ -59,9 +61,9 @@ BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_EnterRoom:: @ 8243E41 lockall applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_PlayerEnterRoom waitmovement 0 - applymovement 1, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_AttendantBlockExit + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_AttendantBlockExit waitmovement 0 - copyobjectxytoperm 1 + copyobjectxytoperm LOCALID_ATTENDANT applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox BattleFrontier_BattleTowerMultiPartnerRoom_Text_PleaseFindPartner, MSGBOX_DEFAULT @@ -99,7 +101,7 @@ BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_QuitChallenge:: @ 8243E9D BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_EnterElevator:: @ 8243EB5 msgbox BattleFrontier_BattleTowerMultiPartnerRoom_Text_ThankYouForChoosingPartner, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFastestUp waitmovement 0 opendoor 10, 1 waitdooranim @@ -112,21 +114,21 @@ BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_EnterElevator:: @ 8243EB5 end BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_MoveToElevator:: @ 8243EE4 - applymovement 1, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_AttendantEnterElevator + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_AttendantEnterElevator applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_PlayerEnterElevator waitmovement 0 return @ Unused BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_MoveToElevatorEast: @ 8243EF6 - applymovement 1, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_AttendantEnterElevator + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_AttendantEnterElevator applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_PlayerEnterElevatorEast waitmovement 0 return @ Unused BattleFrontier_BattleTowerMultiPartnerRoom_EventScript_MoveToElevatorWest: @ 8243F08 - applymovement 1, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_AttendantEnterElevator + applymovement LOCALID_ATTENDANT, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_AttendantEnterElevator applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattleTowerMultiPartnerRoom_Movement_PlayerEneterElevatorWest waitmovement 0 return diff --git a/data/maps/BattleFrontier_Mart/scripts.inc b/data/maps/BattleFrontier_Mart/scripts.inc index e04a2e6d3..4e60e9ce5 100644 --- a/data/maps/BattleFrontier_Mart/scripts.inc +++ b/data/maps/BattleFrontier_Mart/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_OLD_WOMAN, 2 + BattleFrontier_Mart_MapScripts:: @ 8267ACB .byte 0 @@ -36,7 +38,7 @@ BattleFrontier_Mart_EventScript_OldMan:: @ 8267B02 BattleFrontier_Mart_EventScript_OldWoman:: @ 8267B0B lock - applymovement 2, Common_Movement_FaceDown + applymovement LOCALID_OLD_WOMAN, Common_Movement_FaceDown waitmovement 0 msgbox BattleFrontier_Mart_Text_ProteinMakeNiceGift, MSGBOX_DEFAULT release diff --git a/data/maps/BattleFrontier_OutsideEast/scripts.inc b/data/maps/BattleFrontier_OutsideEast/scripts.inc index ebfdba916..6995e405e 100644 --- a/data/maps/BattleFrontier_OutsideEast/scripts.inc +++ b/data/maps/BattleFrontier_OutsideEast/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_SUDOWOODO, 14 + BattleFrontier_OutsideEast_MapScripts:: @ 8242C04 map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_OutsideEast_OnResume map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_OutsideEast_OnTransition @@ -106,8 +108,8 @@ BattleFrontier_OutsideEast_EventScript_Sudowoodo:: @ 8242CEA lock faceplayer waitse - playse 269 - applymovement 14, BattleFrontier_OutsideEast_Movement_SudowoodoShake + playse SE_USSOKI + applymovement LOCALID_SUDOWOODO, BattleFrontier_OutsideEast_Movement_SudowoodoShake waitmovement 0 release end @@ -119,7 +121,7 @@ BattleFrontier_OutsideEast_EventScript_WaterSudowoodo:: @ 8242CFC waitstate waitse playse SE_USSOKI - applymovement 14, BattleFrontier_OutsideEast_Movement_SudowoodoShake + applymovement LOCALID_SUDOWOODO, BattleFrontier_OutsideEast_Movement_SudowoodoShake waitmovement 0 msgbox gText_Sudowoodo_Attacked, MSGBOX_DEFAULT closemessage @@ -127,7 +129,7 @@ BattleFrontier_OutsideEast_EventScript_WaterSudowoodo:: @ 8242CFC playmoncry SPECIES_SUDOWOODO, 2 delay 40 waitmoncry - setvar VAR_LAST_TALKED, 14 @ Sudowoodo object event id + setvar VAR_LAST_TALKED, LOCALID_SUDOWOODO setwildbattle SPECIES_SUDOWOODO, 40, ITEM_NONE setflag FLAG_SYS_CTRL_OBJ_DELETE dowildbattle diff --git a/data/maps/BattleFrontier_OutsideWest/scripts.inc b/data/maps/BattleFrontier_OutsideWest/scripts.inc index 4fb750023..561b4e86a 100644 --- a/data/maps/BattleFrontier_OutsideWest/scripts.inc +++ b/data/maps/BattleFrontier_OutsideWest/scripts.inc @@ -1,3 +1,12 @@ +.set LOCALID_SS_TIDAL, 2 +.set LOCALID_FERRY_ATTENDANT, 3 +.set LOCALID_MANIAC_1, 9 +.set LOCALID_MANIAC_2, 10 +.set LOCALID_GIRL, 12 +.set LOCALID_CAMPER, 14 +.set LOCALID_FISHERMAN_2, 18 +.set LOCALID_MAN_4, 23 + BattleFrontier_OutsideWest_MapScripts:: @ 823D3E1 map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_OutsideWest_OnTransition .byte 0 @@ -66,8 +75,8 @@ BattleFrontier_OutsideWest_EventScript_BoardFerry:: @ 823D4BA applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 30 - hideobjectat 3, MAP_BATTLE_FRONTIER_OUTSIDE_WEST - setvar VAR_0x8004, 2 + hideobjectat LOCALID_FERRY_ATTENDANT, MAP_BATTLE_FRONTIER_OUTSIDE_WEST + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland return @@ -107,7 +116,7 @@ BattleFrontier_OutsideWest_EventScript_Fisherman2:: @ 823D518 faceplayer message BattleFrontier_OutsideWest_Text_GotSeasickOnWayHere waitmessage - applymovement 18, Common_Movement_FaceAwayPlayer + applymovement LOCALID_FISHERMAN_2, Common_Movement_FaceAwayPlayer waitmovement 0 waitbuttonpress release @@ -128,16 +137,16 @@ BattleFrontier_OutsideWest_EventScript_Maniac2:: @ 823D53D end BattleFrontier_OutsideWest_EventScript_FactoryChallengersTalk:: @ 823D544 - applymovement 9, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_MANIAC_1, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox BattleFrontier_OutsideWest_Text_SureWeCanChallengeWithNoMons, MSGBOX_DEFAULT - applymovement 10, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_MANIAC_2, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox BattleFrontier_OutsideWest_Text_BigGuySaidIllLendYouMons, MSGBOX_DEFAULT closemessage delay 25 - applymovement 9, Common_Movement_WalkInPlaceFastestUp - applymovement 10, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_MANIAC_1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_MANIAC_2, Common_Movement_WalkInPlaceFastestUp waitmovement 0 release end @@ -159,7 +168,7 @@ BattleFrontier_OutsideWest_EventScript_Camper:: @ 823D57F end BattleFrontier_OutsideWest_EventScript_CamperFaceFactory:: @ 823D5BA - applymovement 14, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_CAMPER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return @@ -184,22 +193,22 @@ BattleFrontier_OutsideWest_EventScript_Girl:: @ 823D5C6 end BattleFrontier_OutsideWest_EventScript_GirlShudderNorth:: @ 823D5FD - applymovement 12, BattleFrontier_OutsideWest_Movement_GirlShudderNorth + applymovement LOCALID_GIRL, BattleFrontier_OutsideWest_Movement_GirlShudderNorth waitmovement 0 return BattleFrontier_OutsideWest_EventScript_GirlShudderSouth:: @ 823D608 - applymovement 12, BattleFrontier_OutsideWest_Movement_GirlShudderSouth + applymovement LOCALID_GIRL, BattleFrontier_OutsideWest_Movement_GirlShudderSouth waitmovement 0 return BattleFrontier_OutsideWest_EventScript_GirlShudderWest:: @ 823D613 - applymovement 12, BattleFrontier_OutsideWest_Movement_GirlShudderWest + applymovement LOCALID_GIRL, BattleFrontier_OutsideWest_Movement_GirlShudderWest waitmovement 0 return BattleFrontier_OutsideWest_EventScript_GirlShudderEast:: @ 823D61E - applymovement 12, BattleFrontier_OutsideWest_Movement_GirlShudderEast + applymovement LOCALID_GIRL, BattleFrontier_OutsideWest_Movement_GirlShudderEast waitmovement 0 return @@ -301,7 +310,7 @@ BattleFrontier_OutsideWest_EventScript_Man4:: @ 823D6D7 faceplayer msgbox BattleFrontier_OutsideWest_Text_FansOverThereUsedToBeTrainers, MSGBOX_DEFAULT closemessage - applymovement 23, Common_Movement_FaceOriginalDirection + applymovement LOCALID_MAN_4, Common_Movement_FaceOriginalDirection waitmovement 0 release end diff --git a/data/maps/BattleFrontier_PokemonCenter_1F/scripts.inc b/data/maps/BattleFrontier_PokemonCenter_1F/scripts.inc index f77d9ab83..795c3fabe 100644 --- a/data/maps/BattleFrontier_PokemonCenter_1F/scripts.inc +++ b/data/maps/BattleFrontier_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + BattleFrontier_PokemonCenter_1F_MapScripts:: @ 82678F9 map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -7,9 +9,8 @@ BattleFrontier_PokemonCenter_1F_OnTransition: @ 8267904 setrespawn HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST end -@ VAR_0x800B is the Nurse's object event id BattleFrontier_PokemonCenter_1F_EventScript_Nurse:: @ 8267908 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/BattleFrontier_ReceptionGate/scripts.inc b/data/maps/BattleFrontier_ReceptionGate/scripts.inc index 94fadd69a..495ad165f 100644 --- a/data/maps/BattleFrontier_ReceptionGate/scripts.inc +++ b/data/maps/BattleFrontier_ReceptionGate/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_GREETER, 1 +.set LOCALID_GUIDE, 2 +.set LOCALID_SCOTT, 4 + BattleFrontier_ReceptionGate_MapScripts:: @ 82661DA map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_ReceptionGate_OnFrame map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_ReceptionGate_OnTransition @@ -15,9 +19,9 @@ BattleFrontier_ReceptionGate_EventScript_FirstTimeEntering:: @ 82661F3 lockall setvar VAR_HAS_ENTERED_BATTLE_FRONTIER, 1 playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_GREETER, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_GREETER, Common_Movement_Delay48 waitmovement 0 msgbox BattleFrontier_ReceptionGate_Text_FirstTimeHereThisWay, MSGBOX_DEFAULT closemessage @@ -38,27 +42,27 @@ BattleFrontier_ReceptionGate_EventScript_ScottScene:: @ 8266229 msgbox BattleFrontier_ReceptionGate_Text_EnjoyBattleFrontier, MSGBOX_DEFAULT msgbox BattleFrontier_ReceptionGate_Text_IfItIsntPlayerYouCame, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_WalkInPlaceFastestUp - applymovement 2, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_GREETER, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_GUIDE, Common_Movement_WalkInPlaceFastestUp applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark - applymovement 2, Common_Movement_ExclamationMark + applymovement LOCALID_GREETER, Common_Movement_ExclamationMark + applymovement LOCALID_GUIDE, Common_Movement_ExclamationMark applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_ExclamationMark waitmovement 0 msgbox BattleFrontier_ReceptionGate_Text_OhMrScottGoodDay, MSGBOX_DEFAULT closemessage - applymovement 1, BattleFrontier_ReceptionGate_Movement_GreeterFaceScott - applymovement 2, BattleFrontier_ReceptionGate_Movement_FacilityGuideFaceScott + applymovement LOCALID_GREETER, BattleFrontier_ReceptionGate_Movement_GreeterFaceScott + applymovement LOCALID_GUIDE, BattleFrontier_ReceptionGate_Movement_FacilityGuideFaceScott applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_ReceptionGate_Movement_PlayerFaceScott - applymovement 4, BattleFrontier_ReceptionGate_Movement_ScottEnter + applymovement LOCALID_SCOTT, BattleFrontier_ReceptionGate_Movement_ScottEnter waitmovement 0 msgbox BattleFrontier_ReceptionGate_Text_ScottGreatToSeeYouHere, MSGBOX_DEFAULT closemessage - applymovement 4, BattleFrontier_ReceptionGate_Movement_ScottExit + applymovement LOCALID_SCOTT, BattleFrontier_ReceptionGate_Movement_ScottExit waitmovement 0 - removeobject 4 + removeobject LOCALID_SCOTT releaseall end diff --git a/data/maps/BattleFrontier_ScottsHouse/scripts.inc b/data/maps/BattleFrontier_ScottsHouse/scripts.inc index e4b0c28e9..ece1577b4 100644 --- a/data/maps/BattleFrontier_ScottsHouse/scripts.inc +++ b/data/maps/BattleFrontier_ScottsHouse/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_SCOTT, 1 + BattleFrontier_ScottsHouse_MapScripts:: @ 82636A7 .byte 0 @@ -161,7 +163,7 @@ BattleFrontier_ScottsHouse_EventScript_WelcomeToFrontier:: @ 8263943 compare VAR_FACING, DIR_WEST call_if_eq BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayWest msgbox BattleFrontier_ScottsHouse_Text_HowMuchEffortItTookToMakeReal, MSGBOX_DEFAULT - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_SCOTT, Common_Movement_FacePlayer waitmovement 0 msgbox BattleFrontier_ScottsHouse_Text_HaveThisAsMementoOfOurPathsCrossing, MSGBOX_DEFAULT compare VAR_SCOTT_STATE, 13 @@ -207,22 +209,22 @@ BattleFrontier_ScottsHouse_EventScript_GiveBattlePoints:: @ 82639F8 end BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayNorth:: @ 8263A13 - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return BattleFrontier_ScottsHouse_EventScript_ScottFaceAwaySouth:: @ 8263A1E - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayEast:: @ 8263A29 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return BattleFrontier_ScottsHouse_EventScript_ScottFaceAwayWest:: @ 8263A34 - applymovement 1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return diff --git a/data/maps/BirthIsland_Exterior/scripts.inc b/data/maps/BirthIsland_Exterior/scripts.inc index d3963958b..5c06e6f3a 100644 --- a/data/maps/BirthIsland_Exterior/scripts.inc +++ b/data/maps/BirthIsland_Exterior/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_DEOXYS_ROCK, 1 +.set LOCALID_DEOXYS, 2 + BirthIsland_Exterior_MapScripts:: @ 8267F15 map_script MAP_SCRIPT_ON_TRANSITION, BirthIsland_Exterior_OnTransition map_script MAP_SCRIPT_ON_RESUME, BirthIsland_Exterior_OnResume @@ -36,7 +39,7 @@ BirthIsland_Exterior_EventScript_TryRemoveDeoxys:: @ 8267F6F specialvar VAR_RESULT, GetBattleOutcome compare VAR_RESULT, B_OUTCOME_CAUGHT goto_if_ne Common_EventScript_NopReturn - removeobject 2 + removeobject LOCALID_DEOXYS return BirthIsland_Exterior_EventScript_Triangle:: @ 8267F83 @@ -65,20 +68,20 @@ BirthIsland_Exterior_EventScript_NotSolved3:: @ 8267FBF BirthIsland_Exterior_EventScript_Deoxys:: @ 8267FC1 waitse - setfieldeffectargument 0, 1 + setfieldeffectargument 0, LOCALID_DEOXYS_ROCK setfieldeffectargument 1, 58 setfieldeffectargument 2, 26 dofieldeffect FLDEFF_DESTROY_DEOXYS_ROCK playbgm MUS_RG_DEOEYE, 0 waitfieldeffect FLDEFF_DESTROY_DEOXYS_ROCK - addobject 2 - applymovement 2, BirthIsland_Exterior_Movement_DeoxysApproach + addobject LOCALID_DEOXYS + applymovement LOCALID_DEOXYS, BirthIsland_Exterior_Movement_DeoxysApproach waitmovement 0 waitse playmoncry SPECIES_DEOXYS, 2 delay 40 waitmoncry - setvar VAR_LAST_TALKED, 2 + setvar VAR_LAST_TALKED, LOCALID_DEOXYS setvar VAR_0x8004, SPECIES_DEOXYS setvar VAR_0x8005, 30 @ level setvar VAR_0x8006, ITEM_NONE diff --git a/data/maps/BirthIsland_Harbor/scripts.inc b/data/maps/BirthIsland_Harbor/scripts.inc index f19b373f5..b9274ee2f 100644 --- a/data/maps/BirthIsland_Harbor/scripts.inc +++ b/data/maps/BirthIsland_Harbor/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_SAILOR, 1 +.set LOCALID_SS_TIDAL, 2 + BirthIsland_Harbor_MapScripts:: @ 826805C .byte 0 @@ -12,8 +15,8 @@ BirthIsland_Harbor_EventScript_Sailor:: @ 826805D applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 30 - hideobjectat 1, MAP_BIRTH_ISLAND_HARBOR - setvar VAR_0x8004, 2 + hideobjectat LOCALID_SAILOR, MAP_BIRTH_ISLAND_HARBOR + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 waitstate diff --git a/data/maps/CaveOfOrigin_B1F/scripts.inc b/data/maps/CaveOfOrigin_B1F/scripts.inc index 552f3b095..ea8d6cec8 100644 --- a/data/maps/CaveOfOrigin_B1F/scripts.inc +++ b/data/maps/CaveOfOrigin_B1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WALLACE, 1 + CaveOfOrigin_B1F_MapScripts:: @ 82357A8 .byte 0 @@ -6,16 +8,16 @@ CaveOfOrigin_B1F_EventScript_Wallace:: @ 82357A9 faceplayer msgbox CaveOfOrigin_B1F_Text_WallaceStory, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestUp waitmovement 0 delay 60 playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_WALLACE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_WALLACE, Common_Movement_Delay48 waitmovement 0 delay 30 - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_WALLACE, Common_Movement_FacePlayer waitmovement 0 message CaveOfOrigin_B1F_Text_WhereIsRayquaza waitmessage @@ -53,7 +55,7 @@ CaveOfOrigin_B1F_EventScript_AtSkyPillar:: @ 823584D fadescreenspeed FADE_TO_BLACK, 4 setflag FLAG_WALLACE_GOES_TO_SKY_PILLAR setvar VAR_SOOTOPOLIS_CITY_STATE, 3 - removeobject 1 + removeobject LOCALID_WALLACE clearflag FLAG_HIDE_SKY_PILLAR_WALLACE fadescreen FADE_FROM_BLACK release diff --git a/data/maps/DesertUnderpass/scripts.inc b/data/maps/DesertUnderpass/scripts.inc index bba7dfe08..7025a268b 100644 --- a/data/maps/DesertUnderpass/scripts.inc +++ b/data/maps/DesertUnderpass/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_FOSSIL, 1 + DesertUnderpass_MapScripts:: @ 823AF37 map_script MAP_SCRIPT_ON_TRANSITION, DesertUnderpass_OnTransition .byte 0 @@ -16,13 +18,13 @@ DesertUnderpass_EventScript_Fossil:: @ 823AF41 DesertUnderpass_EventScript_GiveClawFossil:: @ 823AF57 giveitem ITEM_CLAW_FOSSIL - removeobject 1 + removeobject LOCALID_FOSSIL release end DesertUnderpass_EventScript_GiveRootFossil:: @ 823AF68 giveitem ITEM_ROOT_FOSSIL - removeobject 1 + removeobject LOCALID_FOSSIL release end diff --git a/data/maps/DewfordTown/scripts.inc b/data/maps/DewfordTown/scripts.inc index 6682d8cdb..f6d06bea7 100644 --- a/data/maps/DewfordTown/scripts.inc +++ b/data/maps/DewfordTown/scripts.inc @@ -1,3 +1,15 @@ +@ Sailing to and from Dewford uses local IDs from different maps +@ e.g. Route 104's sail to Dewford script references local IDs from Dewford's map +@ All of these local IDs are labeled here +.equ LOCALID_BRINEY_DEWFORD, 2 +.equ LOCALID_BOAT_DEWFORD, 4 + +.equ LOCALID_BOAT_R109, 1 +.equ LOCALID_BRINEY_R109, 2 + +.equ LOCALID_BOAT_R104, 7 +.equ LOCALID_BRINEY_R104, 8 + DewfordTown_MapScripts:: @ 81E9507 map_script MAP_SCRIPT_ON_TRANSITION, DewfordTown_OnTransition .byte 0 @@ -116,16 +128,16 @@ DewfordTown_EventScript_FishingNotSoGood:: @ 81E9656 DewfordTown_EventScript_SailToPetalburg:: @ 81E9660 call EventScript_BackupMrBrineyLocation - setobjectpriority 2, MAP_DEWFORD_TOWN, 0 + setobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 setobjectpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN, 0 - applymovement 2, DewfordTown_Movement_BrineyBoardBoat + applymovement LOCALID_BRINEY_DEWFORD, DewfordTown_Movement_BrineyBoardBoat waitmovement 0 - removeobject 2 + removeobject LOCALID_BRINEY_DEWFORD applymovement OBJ_EVENT_ID_PLAYER, DewfordTown_Movement_PlayerBoardBoat waitmovement 0 hideobjectat OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN call Common_EventScript_PlayBrineysBoatMusic - applymovement 4, DewfordTown_Movement_SailToPetalburg + applymovement LOCALID_BOAT_DEWFORD, DewfordTown_Movement_SailToPetalburg applymovement OBJ_EVENT_ID_PLAYER, DewfordTown_Movement_SailToPetalburg waitmovement 0 showobjectat OBJ_EVENT_ID_PLAYER, MAP_ROUTE104 @@ -137,7 +149,7 @@ DewfordTown_EventScript_SailToPetalburg:: @ 81E9660 clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO clearflag FLAG_HIDE_ROUTE_104_MR_BRINEY_BOAT setflag FLAG_HIDE_MR_BRINEY_BOAT_DEWFORD_TOWN - hideobjectat 4, MAP_DEWFORD_TOWN + hideobjectat LOCALID_BOAT_DEWFORD, MAP_DEWFORD_TOWN setvar VAR_BOARD_BRINEY_BOAT_STATE, 2 resetobjectpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN warp MAP_ROUTE104_MR_BRINEYS_HOUSE, 255, 5, 4 @@ -148,39 +160,39 @@ DewfordTown_EventScript_SailToPetalburg:: @ 81E9660 DewfordTown_EventScript_SailToSlateport:: @ 81E96E7 call EventScript_BackupMrBrineyLocation - setobjectpriority 2, MAP_DEWFORD_TOWN, 0 + setobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 setobjectpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN, 1 - applymovement 2, DewfordTown_Movement_BrineyBoardBoat + applymovement LOCALID_BRINEY_DEWFORD, DewfordTown_Movement_BrineyBoardBoat waitmovement 0 - removeobject 2 + removeobject LOCALID_BRINEY_DEWFORD applymovement OBJ_EVENT_ID_PLAYER, DewfordTown_Movement_PlayerBoardBoat waitmovement 0 hideobjectat OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN call Common_EventScript_PlayBrineysBoatMusic - applymovement 4, DewfordTown_Movement_SailToSlateport + applymovement LOCALID_BOAT_DEWFORD, DewfordTown_Movement_SailToSlateport applymovement OBJ_EVENT_ID_PLAYER, DewfordTown_Movement_SailToSlateport waitmovement 0 call Common_EventScript_StopBrineysBoatMusic showobjectat OBJ_EVENT_ID_PLAYER, MAP_ROUTE109 applymovement OBJ_EVENT_ID_PLAYER, DewfordTown_Movement_ExitBoatSlateport waitmovement 0 - setobjectxyperm 2, 21, 26 - addobject 2 - setobjectpriority 2, MAP_ROUTE109, 0 - applymovement 2, DewfordTown_Movement_BrineyExitBoat + setobjectxyperm LOCALID_BRINEY_R109, 21, 26 + addobject LOCALID_BRINEY_R109 + setobjectpriority LOCALID_BRINEY_R109, MAP_ROUTE109, 0 + applymovement LOCALID_BRINEY_R109, DewfordTown_Movement_BrineyExitBoat waitmovement 0 clearflag FLAG_HIDE_ROUTE_109_MR_BRINEY - addobject 1 + addobject LOCALID_BOAT_R109 clearflag FLAG_HIDE_ROUTE_109_MR_BRINEY_BOAT setflag FLAG_HIDE_MR_BRINEY_BOAT_DEWFORD_TOWN - hideobjectat 4, MAP_DEWFORD_TOWN + hideobjectat LOCALID_BOAT_DEWFORD, MAP_DEWFORD_TOWN call_if_unset FLAG_DELIVERED_DEVON_GOODS, DewfordTown_EventScript_LandedSlateportDeliverGoods call_if_set FLAG_DELIVERED_DEVON_GOODS, DewfordTown_EventScript_LandedSlateport closemessage copyvar VAR_BRINEY_LOCATION, VAR_0x8008 resetobjectpriority OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN - resetobjectpriority 2, MAP_ROUTE109 - copyobjectxytoperm 2 + resetobjectpriority LOCALID_BRINEY_R109, MAP_ROUTE109 + copyobjectxytoperm LOCALID_BRINEY_R109 release end diff --git a/data/maps/DewfordTown_Hall/scripts.inc b/data/maps/DewfordTown_Hall/scripts.inc index e63f1b24e..72db32317 100644 --- a/data/maps/DewfordTown_Hall/scripts.inc +++ b/data/maps/DewfordTown_Hall/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_EXPERT_M, 4 +.set LOCALID_TWIN, 5 +.set LOCALID_SCHOOL_KID_M, 7 +.set LOCALID_PSYCHIC_M, 8 + DewfordTown_Hall_MapScripts:: @ 81FD4CF .byte 0 @@ -53,7 +58,7 @@ DewfordTown_Hall_EventScript_ExpertM:: @ 81FD547 call Common_EventScript_BufferTrendyPhrase msgbox DewfordTown_Hall_Text_TVShowAboutTrend, MSGBOX_DEFAULT closemessage - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_EXPERT_M, Common_Movement_WalkInPlaceFastestUp waitmovement 0 release end @@ -64,7 +69,7 @@ DewfordTown_Hall_EventScript_Twin:: @ 81FD563 call Common_EventScript_BufferTrendyPhrase msgbox DewfordTown_Hall_Text_IsTrendMorePopularAcrossSea, MSGBOX_DEFAULT closemessage - applymovement 5, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_TWIN, Common_Movement_WalkInPlaceFastestUp waitmovement 0 release end @@ -189,7 +194,7 @@ DewfordTown_Hall_EventScript_DontMovePlayer1:: @ 81FD739 return DewfordTown_Hall_EventScript_DebateReact1:: @ 81FD73A - applymovement 8, DewfordTown_Hall_Movement_PsychicWalkInPlaceLeft + applymovement LOCALID_PSYCHIC_M, DewfordTown_Hall_Movement_PsychicWalkInPlaceLeft waitmovement 0 compare VAR_0x8008, 0 goto_if_eq DewfordTown_Hall_EventScript_PlayerReactWest @@ -208,7 +213,7 @@ DewfordTown_Hall_EventScript_DontMovePlayer2:: @ 81FD771 return DewfordTown_Hall_EventScript_DebateReact2:: @ 81FD772 - applymovement 7, DewfordTown_Hall_Movement_SchoolKidWalkInPlaceRight + applymovement LOCALID_SCHOOL_KID_M, DewfordTown_Hall_Movement_SchoolKidWalkInPlaceRight waitmovement 0 compare VAR_0x8008, 0 goto_if_eq DewfordTown_Hall_EventScript_PlayerReactNorthSouth diff --git a/data/maps/DewfordTown_PokemonCenter_1F/scripts.inc b/data/maps/DewfordTown_PokemonCenter_1F/scripts.inc index 99d180d8f..9873c9e7a 100644 --- a/data/maps/DewfordTown_PokemonCenter_1F/scripts.inc +++ b/data/maps/DewfordTown_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + DewfordTown_PokemonCenter_1F_MapScripts:: @ 81FC523 map_script MAP_SCRIPT_ON_TRANSITION, DewfordTown_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -8,9 +10,8 @@ DewfordTown_PokemonCenter_1F_OnTransition: @ 81FC52E call Common_EventScript_UpdateBrineyLocation end -@ VAR_0x800B is the Nurse's object event id DewfordTown_PokemonCenter_1F_EventScript_Nurse:: @ 81FC537 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/EverGrandeCity_ChampionsRoom/scripts.inc b/data/maps/EverGrandeCity_ChampionsRoom/scripts.inc index 4ea20827a..5ef3a946e 100644 --- a/data/maps/EverGrandeCity_ChampionsRoom/scripts.inc +++ b/data/maps/EverGrandeCity_ChampionsRoom/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_WALLACE, 1 +.set LOCALID_RIVAL, 2 +.set LOCALID_BIRCH, 3 + EverGrandeCity_ChampionsRoom_MapScripts:: @ 82289EF map_script MAP_SCRIPT_ON_TRANSITION, EverGrandeCity_ChampionsRoom_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, EverGrandeCity_ChampionsRoom_OnWarp @@ -57,7 +61,7 @@ EverGrandeCity_ChampionsRoom_EventScript_Defeated:: @ 8228A61 call_if_eq EverGrandeCity_ChampionsRoom_EventScript_PlayMayMusic compare VAR_RESULT, FEMALE call_if_eq EverGrandeCity_ChampionsRoom_EventScript_PlayBrendanMusic - addobject 2 + addobject LOCALID_RIVAL call EverGrandeCity_ChampionsRoom_EventScript_RivalApproachPlayer checkplayergender compare VAR_RESULT, MALE @@ -78,9 +82,9 @@ EverGrandeCity_ChampionsRoom_EventScript_MayAdvice:: @ 8228AC6 msgbox EverGrandeCity_ChampionsRoom_Text_MayAdvice, MSGBOX_DEFAULT delay 40 playse SE_PIN - applymovement 2, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 2, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 call EverGrandeCity_ChampionsRoom_EventScript_RivalLookBackAndForth msgbox EverGrandeCity_ChampionsRoom_Text_MayItsAlreadyOver, MSGBOX_DEFAULT @@ -91,9 +95,9 @@ EverGrandeCity_ChampionsRoom_EventScript_BrendanAdvice:: @ 8228AFB msgbox EverGrandeCity_ChampionsRoom_Text_BrendanAdvice, MSGBOX_DEFAULT delay 40 playse SE_PIN - applymovement 2, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 2, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 call EverGrandeCity_ChampionsRoom_EventScript_RivalLookBackAndForth msgbox EverGrandeCity_ChampionsRoom_Text_BrendanYouveWon, MSGBOX_DEFAULT @@ -102,26 +106,26 @@ EverGrandeCity_ChampionsRoom_EventScript_BrendanAdvice:: @ 8228AFB EverGrandeCity_ChampionsRoom_EventScript_BirchArrivesExitForHoF:: @ 8228B30 closemessage - addobject 3 - applymovement 3, EverGrandeCity_ChampionsRoom_Movement_BirchArrives + addobject LOCALID_BIRCH + applymovement LOCALID_BIRCH, EverGrandeCity_ChampionsRoom_Movement_BirchArrives waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox EverGrandeCity_ChampionsRoom_Text_BirchArriveRatePokedex, MSGBOX_DEFAULT call ProfBirch_EventScript_RatePokedex msgbox EverGrandeCity_ChampionsRoom_Text_BirchCongratulations, MSGBOX_DEFAULT - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestUp waitmovement 0 delay 20 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox EverGrandeCity_ChampionsRoom_Text_WallaceComeWithMe, MSGBOX_DEFAULT closemessage delay 30 - applymovement 1, EverGrandeCity_ChampionsRoom_Movement_WallaceExitStart + applymovement LOCALID_WALLACE, EverGrandeCity_ChampionsRoom_Movement_WallaceExitStart applymovement OBJ_EVENT_ID_PLAYER, EverGrandeCity_ChampionsRoom_Movement_PlayerExitStart - applymovement 3, Common_Movement_WalkInPlaceFastestUp - applymovement 2, EverGrandeCity_ChampionsRoom_Movement_RivalFollows + applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_RIVAL, EverGrandeCity_ChampionsRoom_Movement_RivalFollows waitmovement 0 delay 20 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown @@ -133,7 +137,7 @@ EverGrandeCity_ChampionsRoom_EventScript_BirchArrivesExitForHoF:: @ 8228B30 compare VAR_RESULT, FEMALE call_if_eq EverGrandeCity_ChampionsRoom_EventScript_BrendanCongratulations closemessage - applymovement 1, EverGrandeCity_ChampionsRoom_Movement_WallaceExit + applymovement LOCALID_WALLACE, EverGrandeCity_ChampionsRoom_Movement_WallaceExit applymovement OBJ_EVENT_ID_PLAYER, EverGrandeCity_ChampionsRoom_Movement_PlayerExit waitmovement 0 setflag FLAG_HIDE_PETALBURG_GYM_GREETER @@ -151,14 +155,14 @@ EverGrandeCity_ChampionsRoom_EventScript_BrendanCongratulations:: @ 8228BF4 return EverGrandeCity_ChampionsRoom_EventScript_RivalApproachPlayer:: @ 8228BFD - applymovement 2, EverGrandeCity_ChampionsRoom_Movement_RivalApproachPlayer + applymovement LOCALID_RIVAL, EverGrandeCity_ChampionsRoom_Movement_RivalApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return EverGrandeCity_ChampionsRoom_EventScript_RivalLookBackAndForth:: @ 8228C12 - applymovement 2, EverGrandeCity_ChampionsRoom_Movement_RivalLookBackAndForth + applymovement LOCALID_RIVAL, EverGrandeCity_ChampionsRoom_Movement_RivalLookBackAndForth waitmovement 0 return diff --git a/data/maps/EverGrandeCity_HallOfFame/scripts.inc b/data/maps/EverGrandeCity_HallOfFame/scripts.inc index b377271ad..c6281a684 100644 --- a/data/maps/EverGrandeCity_HallOfFame/scripts.inc +++ b/data/maps/EverGrandeCity_HallOfFame/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WALLACE, 1 + EverGrandeCity_HallOfFame_MapScripts:: @ 822982C map_script MAP_SCRIPT_ON_FRAME_TABLE, EverGrandeCity_HallOfFame_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, EverGrandeCity_HallOfFame_OnWarp @@ -17,24 +19,24 @@ EverGrandeCity_HallOfFame_OnFrame: @ 8229846 EverGrandeCity_HallOfFame_EventScript_EnterHallOfFame:: @ 8229850 lockall - applymovement 1, EverGrandeCity_HallOfFame_Movement_WalkIntoHallOfFame1 + applymovement LOCALID_WALLACE, EverGrandeCity_HallOfFame_Movement_WalkIntoHallOfFame1 applymovement OBJ_EVENT_ID_PLAYER, EverGrandeCity_HallOfFame_Movement_WalkIntoHallOfFame1 waitmovement 0 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestRight applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox EverGrandeCity_HallOfFame_Text_HereWeHonorLeagueChampions, MSGBOX_DEFAULT closemessage - applymovement 1, EverGrandeCity_HallOfFame_Movement_WalkIntoHallOfFame2 + applymovement LOCALID_WALLACE, EverGrandeCity_HallOfFame_Movement_WalkIntoHallOfFame2 applymovement OBJ_EVENT_ID_PLAYER, EverGrandeCity_HallOfFame_Movement_WalkIntoHallOfFame2 waitmovement 0 delay 20 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestRight applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox EverGrandeCity_HallOfFame_Text_LetsRecordYouAndYourPartnersNames, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestUp applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 delay 20 diff --git a/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc b/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc index 333bffc37..3b6d94249 100644 --- a/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_NURSE, 1 +.set LOCALID_SCOTT, 4 + EverGrandeCity_PokemonCenter_1F_MapScripts:: @ 8229A34 map_script MAP_SCRIPT_ON_TRANSITION, EverGrandeCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -13,9 +16,8 @@ EverGrandeCity_PokemonCenter_1F_EventScript_TryShowScott:: @ 8229A4C clearflag FLAG_HIDE_EVER_GRANDE_POKEMON_CENTER_1F_SCOTT return -@ VAR_0x800B is the Nurse's object event id EverGrandeCity_PokemonCenter_1F_EventScript_Nurse:: @ 8229A59 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress @@ -45,17 +47,17 @@ EverGrandeCity_PokemonCenter_1F_EventScript_Scott:: @ 8229A79 setflag FLAG_MET_SCOTT_IN_EVERGRANDE playse SE_KAIDAN waitse - removeobject 4 + removeobject LOCALID_SCOTT release end EverGrandeCity_PokemonCenter_1F_EventScript_ScottExitNorth:: @ 8229AB6 - applymovement 4, EverGrandeCity_PokemonCenter_1F_Movement_ScottExitNorth + applymovement LOCALID_SCOTT, EverGrandeCity_PokemonCenter_1F_Movement_ScottExitNorth waitmovement 0 return EverGrandeCity_PokemonCenter_1F_EventScript_ScottExit:: @ 8229AC1 - applymovement 4, EverGrandeCity_PokemonCenter_1F_Movement_ScottExit + applymovement LOCALID_SCOTT, EverGrandeCity_PokemonCenter_1F_Movement_ScottExit waitmovement 0 return diff --git a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc index c69c28d8b..cf824b8e8 100644 --- a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc +++ b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_NURSE, 1 +.set LOCALID_GUARD_1, 3 +.set LOCALID_GUARD_2, 4 + EverGrandeCity_PokemonLeague_1F_MapScripts:: @ 82295D2 map_script MAP_SCRIPT_ON_TRANSITION, EverGrandeCity_PokemonLeague_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -10,13 +14,12 @@ EverGrandeCity_PokemonLeague_1F_OnTransition: @ 82295DD end EverGrandeCity_PokemonLeague_1F_EventScript_GuardsBlockDoor:: @ 82295ED - setobjectxyperm 3, 9, 2 - setobjectxyperm 4, 10, 2 + setobjectxyperm LOCALID_GUARD_1, 9, 2 + setobjectxyperm LOCALID_GUARD_2, 10, 2 return -@ VAR_0x800B is the Nurse's object event id EverGrandeCity_PokemonLeague_1F_EventScript_Nurse:: @ 82295FC - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress @@ -61,8 +64,8 @@ EverGrandeCity_PokemonLeague_1F_EventScript_DoorGuard:: @ 8229636 delay 120 goto_if_unset FLAG_BADGE06_GET, EverGrandeCity_PokemonLeague_1F_EventScript_NotAllBadges closemessage - applymovement 3, EverGrandeCity_PokemonLeague_1F_Movement_LeftGuardOutOfWay - applymovement 4, EverGrandeCity_PokemonLeague_1F_Movement_RightGuardOutOfWay + applymovement LOCALID_GUARD_1, EverGrandeCity_PokemonLeague_1F_Movement_LeftGuardOutOfWay + applymovement LOCALID_GUARD_2, EverGrandeCity_PokemonLeague_1F_Movement_RightGuardOutOfWay waitmovement 0 delay 10 playfanfare MUS_ME_BACHI @@ -70,8 +73,8 @@ EverGrandeCity_PokemonLeague_1F_EventScript_DoorGuard:: @ 8229636 waitmessage waitfanfare closemessage - copyobjectxytoperm 3 - copyobjectxytoperm 4 + copyobjectxytoperm LOCALID_GUARD_1 + copyobjectxytoperm LOCALID_GUARD_2 setflag FLAG_ENTERED_ELITE_FOUR releaseall end diff --git a/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc b/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc index 439b37f8c..feb8f49e1 100644 --- a/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc +++ b/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_PLAYER, 1 +.set LOCALID_ATTENDANT, 2 +.set LOCALID_OPPONENT, 3 + FallarborTown_BattleTentBattleRoom_MapScripts:: @ 8200899 map_script MAP_SCRIPT_ON_TRANSITION, FallarborTown_BattleTentBattleRoom_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, FallarborTown_BattleTentBattleRoom_OnFrame @@ -36,18 +40,18 @@ FallarborTown_BattleTentBattleRoom_OnFrame: @ 82008DD FallarborTown_BattleTentBattleRoom_EventScript_EnterRoom:: @ 82008E7 lockall - showobjectat 1, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM - applymovement 1, FallarborTown_BattleTentBattleRoom_Movement_PlayerEnter + showobjectat LOCALID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM + applymovement LOCALID_PLAYER, FallarborTown_BattleTentBattleRoom_Movement_PlayerEnter waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM compare VAR_RESULT, 0 goto_if_ne FallarborTown_BattleTentBattleRoom_EventScript_ResumeChallenge FallarborTown_BattleTentBattleRoom_EventScript_NextOpponentEnter:: @ 820090F tower_setopponent - addobject 3 - applymovement 3, FallarborTown_BattleTentBattleRoom_Movement_OpponentEnter + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, FallarborTown_BattleTentBattleRoom_Movement_OpponentEnter waitmovement 0 - applymovement 2, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump playse SE_W187 waitse waitmovement 0 @@ -58,7 +62,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_NextOpponentEnter:: @ 820090F call BattleFrontier_BattleArenaBattleRoom_EventScript_DoArenaBattle switch VAR_RESULT case 1, FallarborTown_BattleTentBattleRoom_EventScript_DefeatedOpponent - applymovement 2, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump playse SE_W173 waitse waitmovement 0 @@ -71,7 +75,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_WarpToLobbyLost:: @ 820097E waitstate FallarborTown_BattleTentBattleRoom_EventScript_DefeatedOpponent:: @ 820099C - applymovement 2, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump playse SE_BAN waitse waitmovement 0 @@ -83,12 +87,12 @@ FallarborTown_BattleTentBattleRoom_EventScript_IncrementBattleNum:: @ 82009B3 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT switch VAR_RESULT case 3, FallarborTown_BattleTentBattleRoom_EventScript_WarpToLobbyWon - applymovement 3, FallarborTown_BattleTentBattleRoom_Movement_OpponentExit + applymovement LOCALID_OPPONENT, FallarborTown_BattleTentBattleRoom_Movement_OpponentExit waitmovement 0 - removeobject 3 - applymovement 2, FallarborTown_BattleTentBattleRoom_Movement_AttendantApproachPlayer + removeobject LOCALID_OPPONENT + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 - applymovement 1, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceAttendant + applymovement LOCALID_PLAYER, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceAttendant waitmovement 0 msgbox BattleFrontier_BattleArenaBattleRoom_Text_MonsWillBeRestored, MSGBOX_DEFAULT special LoadPlayerParty @@ -127,9 +131,9 @@ FallarborTown_BattleTentBattleRoom_EventScript_AskRetireChallenge:: @ 8200AA6 FallarborTown_BattleTentBattleRoom_EventScript_ContinueChallenge:: @ 8200AD8 closemessage - applymovement 2, FallarborTown_BattleTentBattleRoom_Movement_AttendantReturnToPos + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantReturnToPos waitmovement 0 - applymovement 1, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceBattle + applymovement LOCALID_PLAYER, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceBattle waitmovement 0 goto FallarborTown_BattleTentBattleRoom_EventScript_NextOpponentEnter waitstate @@ -170,9 +174,9 @@ FallarborTown_BattleTentBattleRoom_EventScript_PauseChallenge:: @ 8200B51 end FallarborTown_BattleTentBattleRoom_EventScript_ResumeChallenge:: @ 8200B73 - applymovement 2, FallarborTown_BattleTentBattleRoom_Movement_AttendantApproachPlayer + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantApproachPlayer waitmovement 0 - applymovement 1, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceAttendant + applymovement LOCALID_PLAYER, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceAttendant waitmovement 0 goto FallarborTown_BattleTentBattleRoom_EventScript_AskContinueChallenge end @@ -237,8 +241,8 @@ FallarborTown_BattleTentBattleRoom_OnWarp: @ 8200BB0 FallarborTown_BattleTentBattleRoom_EventScript_SetUpObjects:: @ 8200BBA hideobjectat OBJ_EVENT_ID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM - hideobjectat 1, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM - removeobject 3 + hideobjectat LOCALID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM + removeobject LOCALID_OPPONENT setvar VAR_TEMP_1, 1 end diff --git a/data/maps/FallarborTown_BattleTentCorridor/scripts.inc b/data/maps/FallarborTown_BattleTentCorridor/scripts.inc index 53f5a2b42..89daef9b9 100644 --- a/data/maps/FallarborTown_BattleTentCorridor/scripts.inc +++ b/data/maps/FallarborTown_BattleTentCorridor/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + FallarborTown_BattleTentCorridor_MapScripts:: @ 82006A7 map_script MAP_SCRIPT_ON_FRAME_TABLE, FallarborTown_BattleTentCorridor_OnFrame .byte 0 @@ -9,12 +11,12 @@ FallarborTown_BattleTentCorridor_OnFrame: @ 82006AD FallarborTown_BattleTentCorridor_EventScript_EnterCorridor:: @ 82006B7 lockall setvar VAR_TEMP_0, 1 - applymovement 1, FallarborTown_BattleTentCorridor_Movement_WalkToDoor + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentCorridor_Movement_WalkToDoor applymovement OBJ_EVENT_ID_PLAYER, FallarborTown_BattleTentCorridor_Movement_WalkToDoor waitmovement 0 opendoor 2, 1 waitdooranim - applymovement 1, FallarborTown_BattleTentCorridor_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentCorridor_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, FallarborTown_BattleTentCorridor_Movement_PlayerEnterDoor waitmovement 0 closedoor 2, 1 diff --git a/data/maps/FallarborTown_BattleTentLobby/scripts.inc b/data/maps/FallarborTown_BattleTentLobby/scripts.inc index cfcffa9ca..54248e402 100644 --- a/data/maps/FallarborTown_BattleTentLobby/scripts.inc +++ b/data/maps/FallarborTown_BattleTentLobby/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + FallarborTown_BattleTentLobby_MapScripts:: @ 81FFE66 map_script MAP_SCRIPT_ON_FRAME_TABLE, FallarborTown_BattleTentLobby_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, FallarborTown_BattleTentLobby_OnWarp @@ -193,12 +195,12 @@ FallarborTown_BattleTentLobby_EventScript_EndCancelChallenge:: @ 82001CD end FallarborTown_BattleTentLobby_EventScript_WalkToDoor:: @ 82001CF - applymovement 1, FallarborTown_BattleTentLobby_Movement_AttendantWalkToDoor + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentLobby_Movement_AttendantWalkToDoor applymovement OBJ_EVENT_ID_PLAYER, FallarborTown_BattleTentLobby_Movement_PlayerWalkToDoor waitmovement 0 opendoor 6, 1 waitdooranim - applymovement 1, FallarborTown_BattleTentLobby_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentLobby_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, FallarborTown_BattleTentLobby_Movement_PlayerEnterDoor waitmovement 0 closedoor 6, 1 diff --git a/data/maps/FallarborTown_MoveRelearnersHouse/scripts.inc b/data/maps/FallarborTown_MoveRelearnersHouse/scripts.inc index ac0f42f20..780901c42 100644 --- a/data/maps/FallarborTown_MoveRelearnersHouse/scripts.inc +++ b/data/maps/FallarborTown_MoveRelearnersHouse/scripts.inc @@ -1,9 +1,11 @@ +.set LOCALID_MOVE_RELEARNER, 1 + FallarborTown_MoveRelearnersHouse_MapScripts:: @ 8201382 .byte 0 FallarborTown_MoveRelearnersHouse_EventScript_MoveRelearner:: @ 8201383 lockall - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_MOVE_RELEARNER, Common_Movement_FacePlayer waitmovement 0 goto_if_set FLAG_TEMP_1, FallarborTown_MoveRelearnersHouse_EventScript_AskTeachMove msgbox FallarborTown_MoveRelearnersHouse_Text_ImTheMoveTutor, MSGBOX_DEFAULT @@ -13,7 +15,7 @@ FallarborTown_MoveRelearnersHouse_EventScript_MoveRelearner:: @ 8201383 FallarborTown_MoveRelearnersHouse_EventScript_AskTeachMove:: @ 82013A8 checkitem ITEM_HEART_SCALE, 1 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq FallarborTown_MoveRelearnersHouse_EventScript_ComeBackWithHeartScale msgbox FallarborTown_MoveRelearnersHouse_Text_ThatsAHeartScaleWantMeToTeachMove, MSGBOX_YESNO switch VAR_RESULT diff --git a/data/maps/FallarborTown_PokemonCenter_1F/scripts.inc b/data/maps/FallarborTown_PokemonCenter_1F/scripts.inc index 70c209ef9..c65cf5d4e 100644 --- a/data/maps/FallarborTown_PokemonCenter_1F/scripts.inc +++ b/data/maps/FallarborTown_PokemonCenter_1F/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_NURSE, 1 +.set LOCALID_LANETTE, 4 + FallarborTown_PokemonCenter_1F_MapScripts:: @ 8200BCD map_script MAP_SCRIPT_ON_TRANSITION, FallarborTown_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -8,9 +11,8 @@ FallarborTown_PokemonCenter_1F_OnTransition: @ 8200BD8 call Common_EventScript_UpdateBrineyLocation end -@ VAR_0x800B is the Nurse's object event id FallarborTown_PokemonCenter_1F_EventScript_Nurse:: @ 8200BE1 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress @@ -36,20 +38,20 @@ FallarborTown_PokemonCenter_1F_EventScript_Lanette:: @ 8200C01 end FallarborTown_PokemonCenter_1F_EventScript_LanetteExitNorth:: @ 8200C28 - applymovement 4, FallarborTown_PokemonCenter_1F_Movement_LanetteExitNorth + applymovement LOCALID_LANETTE, FallarborTown_PokemonCenter_1F_Movement_LanetteExitNorth waitmovement 0 goto FallarborTown_PokemonCenter_1F_EventScript_LanetteExited end FallarborTown_PokemonCenter_1F_EventScript_LanetteExitWest:: @ 8200C38 - applymovement 4, FallarborTown_PokemonCenter_1F_Movement_LanetteExitWest + applymovement LOCALID_LANETTE, FallarborTown_PokemonCenter_1F_Movement_LanetteExitWest waitmovement 0 goto FallarborTown_PokemonCenter_1F_EventScript_LanetteExited end FallarborTown_PokemonCenter_1F_EventScript_LanetteExited:: @ 8200C48 playse SE_JIDO_DOA - removeobject 4 + removeobject LOCALID_LANETTE clearflag FLAG_HIDE_LANETTES_HOUSE_LANETTE release end diff --git a/data/maps/FarawayIsland_Entrance/scripts.inc b/data/maps/FarawayIsland_Entrance/scripts.inc index 23ce12098..ce0c10c16 100644 --- a/data/maps/FarawayIsland_Entrance/scripts.inc +++ b/data/maps/FarawayIsland_Entrance/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_SAILOR, 1 +.set LOCALID_SS_TIDAL, 2 + FarawayIsland_Entrance_MapScripts:: @ 8267C8E map_script MAP_SCRIPT_ON_TRANSITION, FarawayIsland_Entrance_OnTransition .byte 0 @@ -27,8 +30,8 @@ FarawayIsland_Entrance_EventScript_Sailor:: @ 8267CA2 applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 30 - hideobjectat 1, MAP_FARAWAY_ISLAND_ENTRANCE - setvar VAR_0x8004, 2 + hideobjectat LOCALID_SAILOR, MAP_FARAWAY_ISLAND_ENTRANCE + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 waitstate diff --git a/data/maps/FarawayIsland_Interior/scripts.inc b/data/maps/FarawayIsland_Interior/scripts.inc index 2cdb626bd..cad875b65 100644 --- a/data/maps/FarawayIsland_Interior/scripts.inc +++ b/data/maps/FarawayIsland_Interior/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_MEW, 1 + FarawayIsland_Interior_MapScripts:: @ 8267CFA map_script MAP_SCRIPT_ON_RESUME, FarawayIsland_Interior_OnResume map_script MAP_SCRIPT_ON_TRANSITION, FarawayIsland_Interior_OnTransition @@ -56,13 +58,13 @@ FarawayIsland_Interior_OnFrame: @ 8267D98 FarawayIsland_Interior_EventScript_FindMew:: @ 8267DA2 lockall playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_MEW, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_MEW, Common_Movement_Delay48 waitmovement 0 - applymovement 1, FarawayIsland_Interior_Movement_MewMoveAndHide + applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewMoveAndHide waitmovement 0 - copyobjectxytoperm 1 + copyobjectxytoperm LOCALID_MEW setvar VAR_TEMP_1, 1 releaseall end @@ -118,7 +120,7 @@ FarawayIsland_Interior_Movement_MewHideLeft: @ 8267DEB FarawayIsland_Interior_EventScript_Mew:: @ 8267DF2 lock faceplayer - applymovement 1, FarawayIsland_Interior_Movement_MewAppear + applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewAppear waitmovement 0 setvar VAR_0x8004, 0 special sub_81D4A90 @@ -169,22 +171,22 @@ FarawayIsland_Interior_EventScript_PlayerOrMewRan:: @ 8267EA4 end FarawayIsland_Interior_EventScript_MewHideDown:: @ 8267EAF - applymovement 1, FarawayIsland_Interior_Movement_MewHideDown + applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewHideDown waitmovement 0 return FarawayIsland_Interior_EventScript_MewHideUp:: @ 8267EBA - applymovement 1, FarawayIsland_Interior_Movement_MewHideUp + applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewHideUp waitmovement 0 return FarawayIsland_Interior_EventScript_MewHideRight:: @ 8267EC5 - applymovement 1, FarawayIsland_Interior_Movement_MewHideRight + applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewHideRight waitmovement 0 return FarawayIsland_Interior_EventScript_MewHideLeft:: @ 8267ED0 - applymovement 1, FarawayIsland_Interior_Movement_MewHideLeft + applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewHideLeft waitmovement 0 return @@ -192,7 +194,7 @@ FarawayIsland_Interior_EventScript_HideMewWhenGrassCut:: @ 8267EDB lockall fadescreenswapbuffers FADE_TO_BLACK setflag FLAG_HIDE_MEW - removeobject 1 + removeobject LOCALID_MEW fadescreenswapbuffers FADE_FROM_BLACK msgbox FarawayIsland_Interior_Text_TheFeelingOfBeingWatchedFaded, MSGBOX_DEFAULT closemessage diff --git a/data/maps/FortreeCity_Gym/scripts.inc b/data/maps/FortreeCity_Gym/scripts.inc index 15e359175..f209ceefa 100644 --- a/data/maps/FortreeCity_Gym/scripts.inc +++ b/data/maps/FortreeCity_Gym/scripts.inc @@ -50,7 +50,7 @@ FortreeCity_Gym_EventScript_WinonaDefeated:: @ 82165FD FortreeCity_Gym_EventScript_GiveAerialAce2:: @ 8216646 giveitem ITEM_TM40 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull msgbox FortreeCity_Gym_Text_ExplainAerialAce, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM40 @@ -59,7 +59,7 @@ FortreeCity_Gym_EventScript_GiveAerialAce2:: @ 8216646 FortreeCity_Gym_EventScript_GiveAerialAce:: @ 821666A giveitem ITEM_TM40 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_BagIsFull msgbox FortreeCity_Gym_Text_ExplainAerialAce, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM40 diff --git a/data/maps/FortreeCity_House4/scripts.inc b/data/maps/FortreeCity_House4/scripts.inc index be5ff9c6e..891e8eb75 100644 --- a/data/maps/FortreeCity_House4/scripts.inc +++ b/data/maps/FortreeCity_House4/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WINGULL, 3 + FortreeCity_House4_MapScripts:: @ 8217C80 .byte 0 @@ -14,9 +16,9 @@ FortreeCity_House4_EventScript_Boy:: @ 8217C8A closemessage setflag FLAG_WINGULL_SENT_ON_ERRAND clearflag FLAG_HIDE_MOSSDEEP_CITY_HOUSE_2_WINGULL - applymovement 3, FortreeCity_House4_Movement_WingullExit + applymovement LOCALID_WINGULL, FortreeCity_House4_Movement_WingullExit waitmovement 0 - removeobject 3 + removeobject LOCALID_WINGULL releaseall end diff --git a/data/maps/FortreeCity_PokemonCenter_1F/scripts.inc b/data/maps/FortreeCity_PokemonCenter_1F/scripts.inc index e759d2d93..5be9e6616 100644 --- a/data/maps/FortreeCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/FortreeCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + FortreeCity_PokemonCenter_1F_MapScripts:: @ 82173D8 map_script MAP_SCRIPT_ON_TRANSITION, FortreeCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -7,9 +9,8 @@ FortreeCity_PokemonCenter_1F_OnTransition: @ 82173E3 setrespawn HEAL_LOCATION_FORTREE_CITY end -@ VAR_0x800B is the Nurse's object event id FortreeCity_PokemonCenter_1F_EventScript_Nurse:: @ 82173E7 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/GraniteCave_StevensRoom/scripts.inc b/data/maps/GraniteCave_StevensRoom/scripts.inc index 01ce14588..7d0b275a5 100644 --- a/data/maps/GraniteCave_StevensRoom/scripts.inc +++ b/data/maps/GraniteCave_StevensRoom/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_STEVEN, 1 + GraniteCave_StevensRoom_MapScripts:: @ 822DC7A .byte 0 @@ -32,24 +34,24 @@ GraniteCave_StevensRoom_EventScript_Steven:: @ 822DC7B compare VAR_FACING, DIR_EAST call_if_eq GraniteCave_StevensRoom_EventScript_StevenExitWestEast playse SE_KAIDAN - removeobject 1 + removeobject LOCALID_STEVEN release end GraniteCave_StevensRoom_EventScript_StevenExitNorth:: @ 822DD0D - applymovement 1, GraniteCave_StevensRoom_Movement_StevenExit + applymovement LOCALID_STEVEN, GraniteCave_StevensRoom_Movement_StevenExit waitmovement 0 return GraniteCave_StevensRoom_EventScript_StevenExitWestEast:: @ 822DD18 applymovement OBJ_EVENT_ID_PLAYER, GraniteCave_StevensRoom_Movement_PlayerTurnTowardExit - applymovement 1, GraniteCave_StevensRoom_Movement_StevenExit + applymovement LOCALID_STEVEN, GraniteCave_StevensRoom_Movement_StevenExit waitmovement 0 return GraniteCave_StevensRoom_EventScript_StevenExitSouth:: @ 822DD2A applymovement OBJ_EVENT_ID_PLAYER, GraniteCave_StevensRoom_Movement_PlayerTurnTowardExit - applymovement 1, GraniteCave_StevensRoom_Movement_StevenExitSouth + applymovement LOCALID_STEVEN, GraniteCave_StevensRoom_Movement_StevenExitSouth waitmovement 0 return diff --git a/data/maps/JaggedPass/scripts.inc b/data/maps/JaggedPass/scripts.inc index 9b4aa5383..eacc7835e 100644 --- a/data/maps/JaggedPass/scripts.inc +++ b/data/maps/JaggedPass/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_HIDEOUT_GUARD, 5 + JaggedPass_MapScripts:: @ 8230656 map_script MAP_SCRIPT_ON_RESUME, JaggedPass_OnResume map_script MAP_SCRIPT_ON_TRANSITION, JaggedPass_OnTransition @@ -12,7 +14,7 @@ JaggedPass_OnResume: @ 8230666 JaggedPass_EventScript_CheckHasMagmaEmblem:: @ 8230674 checkitem ITEM_MAGMA_EMBLEM, 1 - compare VAR_RESULT, 1 + compare VAR_RESULT, TRUE goto_if_eq JaggedPass_EventScript_SetReadyToOpenHideout return @@ -71,27 +73,27 @@ JaggedPass_EventScript_MagmaHideoutGuard:: @ 8230718 goto_if_set FLAG_BEAT_MAGMA_GRUNT_JAGGED_PASS, JaggedPass_EventScript_GuardDefeated waitse playse SE_PIN - applymovement 5, Common_Movement_ExclamationMark + applymovement LOCALID_HIDEOUT_GUARD, Common_Movement_ExclamationMark waitmovement 0 - applymovement 5, Common_Movement_Delay48 + applymovement LOCALID_HIDEOUT_GUARD, Common_Movement_Delay48 waitmovement 0 - applymovement 5, Common_Movement_FacePlayer + applymovement LOCALID_HIDEOUT_GUARD, Common_Movement_FacePlayer waitmovement 0 msgbox JaggedPass_Text_GruntIntro, MSGBOX_DEFAULT closemessage trainerbattle_no_intro TRAINER_GRUNT_JAGGED_PASS, JaggedPass_Text_GruntDefeat setflag FLAG_BEAT_MAGMA_GRUNT_JAGGED_PASS - applymovement 5, Common_Movement_FaceOriginalDirection + applymovement LOCALID_HIDEOUT_GUARD, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end JaggedPass_EventScript_GuardDefeated:: @ 8230766 - applymovement 5, Common_Movement_FacePlayer + applymovement LOCALID_HIDEOUT_GUARD, Common_Movement_FacePlayer waitmovement 0 msgbox JaggedPass_Text_GoWhereverYouWant, MSGBOX_DEFAULT closemessage - applymovement 5, Common_Movement_FaceOriginalDirection + applymovement LOCALID_HIDEOUT_GUARD, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end @@ -104,7 +106,7 @@ JaggedPass_EventScript_Eric:: @ 8230785 JaggedPass_EventScript_Diana:: @ 823079C trainerbattle_single TRAINER_DIANA_1, JaggedPass_Text_DianaIntro, JaggedPass_Text_DianaDefeat, JaggedPass_EventScript_RegisterDiana specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, 1 + compare VAR_RESULT, TRUE goto_if_eq JaggedPass_EventScript_DianaRematch msgbox JaggedPass_Text_DianaPostBattle, MSGBOX_DEFAULT release @@ -125,7 +127,7 @@ JaggedPass_EventScript_DianaRematch:: @ 82307E4 JaggedPass_EventScript_Ethan:: @ 82307FB trainerbattle_single TRAINER_ETHAN_1, JaggedPass_Text_EthanIntro, JaggedPass_Text_EthanDefeat, JaggedPass_EventScript_RegisterEthan specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, 1 + compare VAR_RESULT, TRUE goto_if_eq JaggedPass_EventScript_EthanRematch msgbox JaggedPass_Text_EthanPostBattle, MSGBOX_DEFAULT release diff --git a/data/maps/LavaridgeTown/scripts.inc b/data/maps/LavaridgeTown/scripts.inc index d1facba32..47c5482a6 100644 --- a/data/maps/LavaridgeTown/scripts.inc +++ b/data/maps/LavaridgeTown/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_RIVAL_ON_BIKE, 7 +.set LOCALID_RIVAL, 8 + LavaridgeTown_MapScripts:: @ 81EA4D3 map_script MAP_SCRIPT_ON_TRANSITION, LavaridgeTown_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, LavaridgeTown_OnFrame @@ -26,9 +29,9 @@ LavaridgeTown_EventScript_CheckSetRivalPos:: @ 81EA518 return LavaridgeTown_EventScript_SetRivalPos:: @ 81EA529 - setobjectxyperm 8, 11, 9 - setobjectxyperm 7, 9, 8 - setobjectmovementtype 7, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_RIVAL, 11, 9 + setobjectxyperm LOCALID_RIVAL_ON_BIKE, 9, 8 + setobjectmovementtype LOCALID_RIVAL_ON_BIKE, MOVEMENT_TYPE_FACE_UP clearflag FLAG_HIDE_LAVARIDGE_TOWN_RIVAL return @@ -86,14 +89,14 @@ LavaridgeTown_EventScript_BrendanGiveGoGoggles:: @ 81EA5DA LavaridgeTown_EventScript_RivalExit:: @ 81EA5FF closemessage - removeobject 8 - addobject 7 + removeobject LOCALID_RIVAL + addobject LOCALID_RIVAL_ON_BIKE delay 30 compare VAR_0x8008, 9 call_if_eq LavaridgeTown_EventScript_RivalExit1 compare VAR_0x8008, 9 call_if_ne LavaridgeTown_EventScript_RivalExit2 - removeobject 7 + removeobject LOCALID_RIVAL_ON_BIKE setvar VAR_LAVARIDGE_TOWN_STATE, 2 clearflag FLAG_HIDE_MAP_NAME_POPUP savebgm MUS_DUMMY @@ -110,52 +113,52 @@ LavaridgeTown_EventScript_PlayBrendanMusic:: @ 81EA635 return LavaridgeTown_EventScript_RivalNoticePlayer:: @ 81EA63A - applymovement 8, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestUp waitmovement 0 playse SE_PIN - applymovement 8, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 8, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 return LavaridgeTown_EventScript_RivalExitHerbShop:: @ 81EA65C opendoor 12, 15 waitdooranim - addobject 8 - applymovement 8, LavaridgeTown_Movement_RivalExitHerbShop + addobject LOCALID_RIVAL + applymovement LOCALID_RIVAL, LavaridgeTown_Movement_RivalExitHerbShop waitmovement 0 closedoor 12, 15 waitdooranim - applymovement 8, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 playse SE_PIN - applymovement 8, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 8, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return LavaridgeTown_EventScript_RivalApproachPlayer1:: @ 81EA6A1 - applymovement 8, LavaridgeTown_Movement_RivalApproachPlayer1 + applymovement LOCALID_RIVAL, LavaridgeTown_Movement_RivalApproachPlayer1 waitmovement 0 return LavaridgeTown_EventScript_RivalApproachPlayer2:: @ 81EA6AC - applymovement 8, LavaridgeTown_Movement_RivalApproachPlayer2 + applymovement LOCALID_RIVAL, LavaridgeTown_Movement_RivalApproachPlayer2 waitmovement 0 return LavaridgeTown_EventScript_RivalExit1:: @ 81EA6B7 applymovement OBJ_EVENT_ID_PLAYER, LavaridgeTown_Movement_PlayerWatchRivalExit - applymovement 7, LavaridgeTown_Movement_RivalExit1 + applymovement LOCALID_RIVAL_ON_BIKE, LavaridgeTown_Movement_RivalExit1 waitmovement 0 return LavaridgeTown_EventScript_RivalExit2:: @ 81EA6C9 - applymovement 7, LavaridgeTown_Movement_RivalExit2 + applymovement LOCALID_RIVAL_ON_BIKE, LavaridgeTown_Movement_RivalExit2 waitmovement 0 return diff --git a/data/maps/LavaridgeTown_Gym_1F/scripts.inc b/data/maps/LavaridgeTown_Gym_1F/scripts.inc index 904abfae9..3747d854d 100644 --- a/data/maps/LavaridgeTown_Gym_1F/scripts.inc +++ b/data/maps/LavaridgeTown_Gym_1F/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_COLE, 2 +.set LOCALID_GERALD, 3 +.set LOCALID_AXLE, 4 +.set LOCALID_DANIELLE, 5 + LavaridgeTown_Gym_1F_MapScripts:: @ 81FE6F4 map_script MAP_SCRIPT_ON_TRANSITION, LavaridgeTown_Gym_1F_OnTransition .byte 0 @@ -30,23 +35,23 @@ LavaridgeTown_Gym_1F_EventScript_EndSetTrainerTempVars:: @ 81FE756 LavaridgeTown_Gym_1F_EventScript_CheckHideTrainers:: @ 81FE757 goto_if_defeated TRAINER_COLE, LavaridgeTown_Gym_1F_EventScript_CheckHideGerald - setobjectmovementtype 2, MOVEMENT_TYPE_HIDDEN + setobjectmovementtype LOCALID_COLE, MOVEMENT_TYPE_HIDDEN LavaridgeTown_Gym_1F_EventScript_CheckHideGerald:: @ 81FE764 goto_if_defeated TRAINER_GERALD, LavaridgeTown_Gym_1F_EventScript_CheckHideAxle - setobjectmovementtype 3, MOVEMENT_TYPE_HIDDEN + setobjectmovementtype LOCALID_GERALD, MOVEMENT_TYPE_HIDDEN LavaridgeTown_Gym_1F_EventScript_CheckHideAxle:: @ 81FE771 goto_if_defeated TRAINER_AXLE, LavaridgeTown_Gym_1F_EventScript_CheckHideDanielle - setobjectmovementtype 4, MOVEMENT_TYPE_HIDDEN + setobjectmovementtype LOCALID_AXLE, MOVEMENT_TYPE_HIDDEN LavaridgeTown_Gym_1F_EventScript_CheckHideDanielle:: @ 81FE77E goto_if_defeated TRAINER_DANIELLE, LavaridgeTown_Gym_1F_EventScript_EndCheckHideTrainers - setobjectmovementtype 5, MOVEMENT_TYPE_HIDDEN + setobjectmovementtype LOCALID_DANIELLE, MOVEMENT_TYPE_HIDDEN LavaridgeTown_Gym_1F_EventScript_EndCheckHideTrainers:: @ 81FE78B return LavaridgeTown_Gym_1F_EventScript_Flannery:: @ 81FE78C trainerbattle_single TRAINER_FLANNERY_1, LavaridgeTown_Gym_1F_Text_FlanneryIntro, LavaridgeTown_Gym_1F_Text_FlanneryDefeat, LavaridgeTown_Gym_1F_EventScript_FlanneryDefeated, NO_MUSIC specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, 1 + compare VAR_RESULT, TRUE goto_if_eq LavaridgeTown_Gym_1F_EventScript_FlanneryRematch goto_if_unset FLAG_RECEIVED_TM50, LavaridgeTown_Gym_1F_EventScript_GiveOverheat2 msgbox LavaridgeTown_Gym_1F_Text_FlanneryPostBattle, MSGBOX_DEFAULT @@ -82,7 +87,7 @@ LavaridgeTown_Gym_1F_EventScript_FlanneryDefeated:: @ 81FE7C1 LavaridgeTown_Gym_1F_EventScript_GiveOverheat2:: @ 81FE81D giveitem ITEM_TM50 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull msgbox LavaridgeTown_Gym_1F_Text_ExplainOverheat, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM50 @@ -91,7 +96,7 @@ LavaridgeTown_Gym_1F_EventScript_GiveOverheat2:: @ 81FE81D LavaridgeTown_Gym_1F_EventScript_GiveOverheat:: @ 81FE841 giveitem ITEM_TM50 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_BagIsFull msgbox LavaridgeTown_Gym_1F_Text_ExplainOverheat, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM50 @@ -103,7 +108,7 @@ LavaridgeTown_Gym_1F_EventScript_FlanneryRematch:: @ 81FE864 end LavaridgeTown_Gym_1F_EventScript_Cole:: @ 81FE87F - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_COLE, 2, LavaridgeTown_Gym_1F_Text_ColeIntro, LavaridgeTown_Gym_1F_Text_ColeDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_COLE, LOCALID_COLE, LavaridgeTown_Gym_1F_Text_ColeIntro, LavaridgeTown_Gym_1F_Text_ColeDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript msgbox LavaridgeTown_Gym_1F_Text_ColePostBattle MSGBOX_AUTOCLOSE end @@ -116,37 +121,37 @@ LavaridgeTown_Gym_EventScript_CheckTrainerScript:: @ 81FE89A end LavaridgeTown_Gym_1F_EventScript_Axle:: @ 81FE8AF - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_AXLE, 4, LavaridgeTown_Gym_1F_Text_AxleIntro, LavaridgeTown_Gym_1F_Text_AxleDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_AXLE, LOCALID_AXLE, LavaridgeTown_Gym_1F_Text_AxleIntro, LavaridgeTown_Gym_1F_Text_AxleDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript msgbox LavaridgeTown_Gym_1F_Text_AxlePostBattle, MSGBOX_AUTOCLOSE end LavaridgeTown_Gym_B1F_EventScript_Keegan:: @ 81FE8CA - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_KEEGAN, 2, LavaridgeTown_Gym_B1F_Text_KeeganIntro, LavaridgeTown_Gym_B1F_Text_KeeganDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_KEEGAN, LOCALID_KEEGAN, LavaridgeTown_Gym_B1F_Text_KeeganIntro, LavaridgeTown_Gym_B1F_Text_KeeganDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript msgbox LavaridgeTown_Gym_B1F_Text_KeeganPostBattle, MSGBOX_AUTOCLOSE end LavaridgeTown_Gym_1F_EventScript_Danielle:: @ 81FE8E5 - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_DANIELLE, 5, LavaridgeTown_Gym_1F_Text_DanielleIntro, LavaridgeTown_Gym_1F_Text_DanielleDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_DANIELLE, LOCALID_DANIELLE, LavaridgeTown_Gym_1F_Text_DanielleIntro, LavaridgeTown_Gym_1F_Text_DanielleDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript msgbox LavaridgeTown_Gym_1F_Text_DaniellePostBattle, MSGBOX_AUTOCLOSE end LavaridgeTown_Gym_1F_EventScript_Gerald:: @ 81FE900 - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_GERALD, 3, LavaridgeTown_Gym_1F_Text_GeraldIntro, LavaridgeTown_Gym_1F_Text_GeraldDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_GERALD, LOCALID_GERALD, LavaridgeTown_Gym_1F_Text_GeraldIntro, LavaridgeTown_Gym_1F_Text_GeraldDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript msgbox LavaridgeTown_Gym_1F_Text_GeraldPostBattle, MSGBOX_AUTOCLOSE end LavaridgeTown_Gym_B1F_EventScript_Jace:: @ 81FE91B - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_JACE, 1, LavaridgeTown_Gym_B1F_Text_JaceIntro, LavaridgeTown_Gym_B1F_Text_JaceDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_JACE, LOCALID_JACE, LavaridgeTown_Gym_B1F_Text_JaceIntro, LavaridgeTown_Gym_B1F_Text_JaceDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript msgbox LavaridgeTown_Gym_B1F_Text_JacePostBattle, MSGBOX_AUTOCLOSE end LavaridgeTown_Gym_B1F_EventScript_Jeff:: @ 81FE936 - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_JEFF, 3, LavaridgeTown_Gym_B1F_Text_JeffIntro, LavaridgeTown_Gym_B1F_Text_JeffDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_JEFF, LOCALID_JEFF, LavaridgeTown_Gym_B1F_Text_JeffIntro, LavaridgeTown_Gym_B1F_Text_JeffDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript msgbox LavaridgeTown_Gym_B1F_Text_JeffPostBattle, MSGBOX_AUTOCLOSE end LavaridgeTown_Gym_B1F_EventScript_Eli:: @ 81FE951 - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_ELI, 4, LavaridgeTown_Gym_B1F_Text_EliIntro, LavaridgeTown_Gym_B1F_Text_EliDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, TRAINER_ELI, LOCALID_ELI, LavaridgeTown_Gym_B1F_Text_EliIntro, LavaridgeTown_Gym_B1F_Text_EliDefeat, LavaridgeTown_Gym_EventScript_CheckTrainerScript msgbox LavaridgeTown_Gym_B1F_Text_EliPostBattle, MSGBOX_AUTOCLOSE end diff --git a/data/maps/LavaridgeTown_Gym_B1F/scripts.inc b/data/maps/LavaridgeTown_Gym_B1F/scripts.inc index 3a8f71fad..aad7c4778 100644 --- a/data/maps/LavaridgeTown_Gym_B1F/scripts.inc +++ b/data/maps/LavaridgeTown_Gym_B1F/scripts.inc @@ -1,3 +1,8 @@ +.equ LOCALID_JACE, 1 +.equ LOCALID_KEEGAN, 2 +.equ LOCALID_JEFF, 3 +.equ LOCALID_ELI, 4 + LavaridgeTown_Gym_B1F_MapScripts:: @ 81FF87E map_script MAP_SCRIPT_ON_TRANSITION, LavaridgeTown_Gym_B1F_OnTransition .byte 0 @@ -29,16 +34,16 @@ LavaridgeTown_Gym_B1F_EventScript_EndSetTrainerTempVars:: @ 81FF8DB LavaridgeTown_Gym_B1F_EventScript_CheckHideTrainers:: @ 81FF8DC goto_if_defeated TRAINER_KEEGAN, LavaridgeTown_Gym_B1F_EventScript_CheckHideJace - setobjectmovementtype 2, MOVEMENT_TYPE_HIDDEN + setobjectmovementtype LOCALID_KEEGAN, MOVEMENT_TYPE_HIDDEN LavaridgeTown_Gym_B1F_EventScript_CheckHideJace:: @ 81FF8E9 goto_if_defeated TRAINER_JACE, LavaridgeTown_Gym_B1F_EventScript_CheckHideJeff - setobjectmovementtype 1, MOVEMENT_TYPE_HIDDEN + setobjectmovementtype LOCALID_JACE, MOVEMENT_TYPE_HIDDEN LavaridgeTown_Gym_B1F_EventScript_CheckHideJeff:: @ 81FF8F6 goto_if_defeated TRAINER_JEFF, LavaridgeTown_Gym_B1F_EventScript_CheckHideEli - setobjectmovementtype 3, MOVEMENT_TYPE_HIDDEN + setobjectmovementtype LOCALID_JEFF, MOVEMENT_TYPE_HIDDEN LavaridgeTown_Gym_B1F_EventScript_CheckHideEli:: @ 81FF903 goto_if_defeated TRAINER_ELI, LavaridgeTown_Gym_B1F_EventScript_EndCheckHideTrainers - setobjectmovementtype 4, MOVEMENT_TYPE_HIDDEN + setobjectmovementtype LOCALID_ELI, MOVEMENT_TYPE_HIDDEN LavaridgeTown_Gym_B1F_EventScript_EndCheckHideTrainers:: @ 81FF910 return diff --git a/data/maps/LavaridgeTown_HerbShop/scripts.inc b/data/maps/LavaridgeTown_HerbShop/scripts.inc index 5f320a942..c08d37609 100644 --- a/data/maps/LavaridgeTown_HerbShop/scripts.inc +++ b/data/maps/LavaridgeTown_HerbShop/scripts.inc @@ -31,7 +31,7 @@ LavaridgeTown_HerbShop_EventScript_OldMan:: @ 81FE505 goto_if_set FLFLAG_RECEIVED_CHARCOAL, LavaridgeTown_HerbShop_EventScript_ExplainCharcoal msgbox LavaridgeTown_HerbShop_Text_YouveComeToLookAtHerbalMedicine, MSGBOX_DEFAULT giveitem ITEM_CHARCOAL - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLFLAG_RECEIVED_CHARCOAL release diff --git a/data/maps/LavaridgeTown_PokemonCenter_1F/scripts.inc b/data/maps/LavaridgeTown_PokemonCenter_1F/scripts.inc index a2b25fe0e..0b596ba5b 100644 --- a/data/maps/LavaridgeTown_PokemonCenter_1F/scripts.inc +++ b/data/maps/LavaridgeTown_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + LavaridgeTown_PokemonCenter_1F_MapScripts:: @ 81FFAFA map_script MAP_SCRIPT_ON_TRANSITION, LavaridgeTown_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -8,9 +10,8 @@ LavaridgeTown_PokemonCenter_1F_OnTransition: @ 81FFB05 call Common_EventScript_UpdateBrineyLocation end -@ VAR_0x800B is the Nurse's object event id LavaridgeTown_PokemonCenter_1F_EventScript_Nurse:: @ 81FFB0E - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/LilycoveCity/scripts.inc b/data/maps/LilycoveCity/scripts.inc index fb3775f95..b8f0cd566 100644 --- a/data/maps/LilycoveCity/scripts.inc +++ b/data/maps/LilycoveCity/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_WOMAN_1, 19 +.set LOCALID_MAN_1, 20 + LilycoveCity_MapScripts:: @ 81E2B3C map_script MAP_SCRIPT_ON_TRANSITION, LilycoveCity_OnTransition map_script MAP_SCRIPT_ON_LOAD, LilycoveCity_OnLoad @@ -134,13 +137,13 @@ LilycoveCity_EventScript_FatMan:: @ 81E2CD4 LilycoveCity_EventScript_Man1:: @ 81E2CDD lockall msgbox LilycoveCity_Text_JustArrivedAndSawRarePokemon, MSGBOX_NPC - applymovement 20, Common_Movement_FaceOriginalDirection + applymovement LOCALID_MAN_1, Common_Movement_FaceOriginalDirection end LilycoveCity_EventScript_Woman1:: @ 81E2CEE lockall msgbox LilycoveCity_Text_HoneymoonVowToSeeRarePokemon, MSGBOX_NPC - applymovement 19, Common_Movement_FaceOriginalDirection + applymovement LOCALID_WOMAN_1, Common_Movement_FaceOriginalDirection end LilycoveCity_EventScript_CitySign:: @ 81E2CFF diff --git a/data/maps/LilycoveCity_ContestHall/scripts.inc b/data/maps/LilycoveCity_ContestHall/scripts.inc index fb98c72f6..f390e9b24 100644 --- a/data/maps/LilycoveCity_ContestHall/scripts.inc +++ b/data/maps/LilycoveCity_ContestHall/scripts.inc @@ -1,3 +1,32 @@ +@ VAR_LAST_TALKED would have made all these direct references unnecessary +.set LOCALID_SMART_MC, 4 +.set LOCALID_SMART_JUDGE, 5 +.set LOCALID_SMART_CONTESTANT_1, 6 +.set LOCALID_SMART_CONTESTANT_2, 7 +.set LOCALID_SMART_CONTESTANT_3, 8 +.set LOCALID_SMART_CONTESTANT_4, 9 +.set LOCALID_SMART_AUDIENCE_4, 11 +.set LOCALID_SMART_AUDIENCE_2, 12 +.set LOCALID_BEAUTY_MC, 13 +.set LOCALID_BEAUTY_JUDGE, 14 +.set LOCALID_BEAUTY_CONTESTANT_1, 15 +.set LOCALID_BEAUTY_CONTESTANT_2, 16 +.set LOCALID_BEAUTY_CONTESTANT_3, 17 +.set LOCALID_BEAUTY_CONTESTANT_4, 18 +.set LOCALID_BEAUTY_AUDIENCE_1, 19 +.set LOCALID_BEAUTY_AUDIENCE_3, 20 +.set LOCALID_BEAUTY_AUDIENCE_2, 21 +.set LOCALID_SMART_AUDIENCE_3, 22 +.set LOCALID_CUTE_MC, 23 +.set LOCALID_CUTE_JUDGE, 24 +.set LOCALID_CUTE_CONTESTANT_1, 25 +.set LOCALID_CUTE_CONTESTANT_2, 26 +.set LOCALID_CUTE_CONTESTANT_3, 27 +.set LOCALID_CUTE_CONTESTANT_4, 28 +.set LOCALID_CUTE_AUDIENCE_1, 29 +.set LOCALID_CUTE_AUDIENCE_3, 30 +.set LOCALID_CUTE_AUDIENCE_2, 31 + LilycoveCity_ContestHall_MapScripts:: @ 821B484 .byte 0 @@ -22,7 +51,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestMC:: @ 821B4A9 faceplayer msgbox LilycoveCity_ContestHall_Text_GiveItBestSmartAppeal, MSGBOX_DEFAULT closemessage - applymovement 4, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_MC, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -32,7 +61,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestJudge:: @ 821B4C0 faceplayer msgbox LilycoveCity_ContestHall_Text_AreYouEnjoyingThisContest, MSGBOX_DEFAULT closemessage - applymovement 5, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_JUDGE, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -42,7 +71,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestant1:: @ 821B4D7 faceplayer msgbox LilycoveCity_ContestHall_Text_EnteredWrongContest, MSGBOX_DEFAULT closemessage - applymovement 6, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_CONTESTANT_1, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -52,7 +81,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestant2:: @ 821B4EE faceplayer msgbox LilycoveCity_ContestHall_Text_RaisedMonToBeSmart, MSGBOX_DEFAULT closemessage - applymovement 7, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_CONTESTANT_2, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -62,7 +91,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestant3:: @ 821B505 faceplayer msgbox LilycoveCity_ContestHall_Text_IfMonPullsSmartMoveNext, MSGBOX_DEFAULT closemessage - applymovement 8, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_CONTESTANT_3, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -72,7 +101,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestant4:: @ 821B51C faceplayer msgbox LilycoveCity_ContestHall_Text_DontAppreciateCuteLeechLife, MSGBOX_DEFAULT closemessage - applymovement 9, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_CONTESTANT_4, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -86,7 +115,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestAudience2:: @ 821B53C faceplayer msgbox LilycoveCity_ContestHall_Text_AllSeemToUseDifferentMoves, MSGBOX_DEFAULT closemessage - applymovement 12, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_AUDIENCE_2, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -96,7 +125,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestAudience3:: @ 821B553 faceplayer msgbox LilycoveCity_ContestHall_Text_PokemonSmarterThanTrainers, MSGBOX_DEFAULT closemessage - applymovement 22, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_AUDIENCE_3, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -106,7 +135,7 @@ LilycoveCity_ContestHall_EventScript_SmartContestAudience4:: @ 821B56A faceplayer msgbox LilycoveCity_ContestHall_Text_StillLoveSmartnessContests, MSGBOX_DEFAULT closemessage - applymovement 11, Common_Movement_FaceOriginalDirection + applymovement LOCALID_SMART_AUDIENCE_4, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -116,7 +145,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestMC:: @ 821B581 faceplayer msgbox LilycoveCity_ContestHall_Text_AreYouEnteringBeautyContest, MSGBOX_DEFAULT closemessage - applymovement 13, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_MC, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -126,7 +155,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestJudge:: @ 821B598 faceplayer msgbox LilycoveCity_ContestHall_Text_EveryPokemonPristineBeauty, MSGBOX_DEFAULT closemessage - applymovement 14, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_JUDGE, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -136,7 +165,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestant1:: @ 821B5AF faceplayer msgbox LilycoveCity_ContestHall_Text_EyesWillBeGluedToMyBeauty, MSGBOX_DEFAULT closemessage - applymovement 15, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_CONTESTANT_1, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -146,7 +175,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestant2:: @ 821B5C6 faceplayer msgbox LilycoveCity_ContestHall_Text_OverdidGrooming, MSGBOX_DEFAULT closemessage - applymovement 16, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_CONTESTANT_2, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -156,7 +185,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestant3:: @ 821B5DD faceplayer msgbox LilycoveCity_ContestHall_Text_JudgeWontSeeAuroraBeam, MSGBOX_DEFAULT closemessage - applymovement 17, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_CONTESTANT_3, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -166,7 +195,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestant4:: @ 821B5F4 faceplayer msgbox LilycoveCity_ContestHall_Text_PokemonLooksLikeYoungerMe, MSGBOX_DEFAULT closemessage - applymovement 18, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_CONTESTANT_4, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -176,7 +205,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestAudience1:: @ 821B60B faceplayer msgbox LilycoveCity_ContestHall_Text_WinBeautyContestMakesMeHappy, MSGBOX_DEFAULT closemessage - applymovement 19, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_AUDIENCE_1, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -186,7 +215,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestAudience2:: @ 821B622 faceplayer msgbox LilycoveCity_ContestHall_Text_GanderAtAllThosePrettyPokemon, MSGBOX_DEFAULT closemessage - applymovement 21, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_AUDIENCE_2, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -196,7 +225,7 @@ LilycoveCity_ContestHall_EventScript_BeautyContestAudience3:: @ 821B639 faceplayer msgbox LilycoveCity_ContestHall_Text_CantWinOnBeautyAlone, MSGBOX_DEFAULT closemessage - applymovement 20, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BEAUTY_AUDIENCE_3, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -206,7 +235,7 @@ LilycoveCity_ContestHall_EventScript_CuteContestMC:: @ 821B650 faceplayer msgbox LilycoveCity_ContestHall_Text_InTheMiddleOfContest, MSGBOX_DEFAULT closemessage - applymovement 23, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_MC, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -216,7 +245,7 @@ LilycoveCity_ContestHall_EventScript_CuteContestJudge:: @ 821B667 faceplayer msgbox LilycoveCity_ContestHall_Text_SuchCharmingCuteAppeals, MSGBOX_DEFAULT closemessage - applymovement 24, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_JUDGE, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -226,7 +255,7 @@ LilycoveCity_ContestHall_EventScript_CuteContestant1:: @ 821B67E faceplayer msgbox LilycoveCity_ContestHall_Text_MyAzurillWasDistracted, MSGBOX_DEFAULT closemessage - applymovement 25, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_CONTESTANT_1, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -236,7 +265,7 @@ LilycoveCity_ContestHall_EventScript_CuteContestant2:: @ 821B695 faceplayer msgbox LilycoveCity_ContestHall_Text_NeverWonBattleButContest, MSGBOX_DEFAULT closemessage - applymovement 26, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_CONTESTANT_2, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -246,7 +275,7 @@ LilycoveCity_ContestHall_EventScript_CuteContestant3:: @ 821B6AC faceplayer msgbox LilycoveCity_ContestHall_Text_PetalDanceIsMarvel, MSGBOX_DEFAULT closemessage - applymovement 27, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_CONTESTANT_3, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -256,18 +285,18 @@ LilycoveCity_ContestHall_EventScript_CuteContestant4:: @ 821B6C3 faceplayer msgbox LilycoveCity_ContestHall_Text_MyMonAppealSoMuchCuter, MSGBOX_DEFAULT closemessage - applymovement 28, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_CONTESTANT_4, Common_Movement_FaceOriginalDirection waitmovement 0 release end LilycoveCity_ContestHall_EventScript_CuteContestAudience1:: @ 821B6DA lockall - applymovement 29, Common_Movement_FacePlayer + applymovement LOCALID_CUTE_AUDIENCE_1, Common_Movement_FacePlayer waitmovement 0 msgbox LilycoveCity_ContestHall_Text_MyChildIsInContest, MSGBOX_DEFAULT closemessage - applymovement 29, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_AUDIENCE_1, Common_Movement_FaceOriginalDirection waitmovement 0 delay 25 msgbox LilycoveCity_ContestHall_Text_ComeOnDear, MSGBOX_DEFAULT @@ -279,7 +308,7 @@ LilycoveCity_ContestHall_EventScript_CuteContestAudience2:: @ 821B705 faceplayer msgbox LilycoveCity_ContestHall_Text_WantCuteMonOfMyOwn, MSGBOX_DEFAULT closemessage - applymovement 31, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_AUDIENCE_2, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -289,7 +318,7 @@ LilycoveCity_ContestHall_EventScript_CuteContestAudience3:: @ 821B71C faceplayer msgbox LilycoveCity_ContestHall_Text_ThatGirlThereIsCutest, MSGBOX_DEFAULT closemessage - applymovement 30, Common_Movement_FaceOriginalDirection + applymovement LOCALID_CUTE_AUDIENCE_3, Common_Movement_FaceOriginalDirection waitmovement 0 release end diff --git a/data/maps/LilycoveCity_ContestLobby/scripts.inc b/data/maps/LilycoveCity_ContestLobby/scripts.inc index a3d232346..6b71c5125 100644 --- a/data/maps/LilycoveCity_ContestLobby/scripts.inc +++ b/data/maps/LilycoveCity_ContestLobby/scripts.inc @@ -1,3 +1,9 @@ +@ Note: data/scripts/berry_blender.inc is for the same map, so shares local IDs +.set LOCALID_RECEPTIONIST, 1 +.set LOCALID_LINK_RECEPTIONIST, 2 +.set LOCALID_ARTIST, 4 +.set LOCALID_ARTIST_LINK, 11 + LilycoveCity_ContestLobby_MapScripts:: @ 821A211 map_script MAP_SCRIPT_ON_TRANSITION, LilycoveCity_ContestLobby_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, LilycoveCity_ContestLobby_OnFrame @@ -35,9 +41,9 @@ LilycoveCity_ContestLobby_EventScript_TryDoContestArtist:: @ 821A255 LilycoveCity_ContestLobby_EventScript_ContestArtist:: @ 821A264 lockall - addobject 4 - applymovement 4, LilycoveCity_ContestLobby_Movement_ArtistApproachPlayer - waitmovement 4 + addobject LOCALID_ARTIST + applymovement LOCALID_ARTIST, LilycoveCity_ContestLobby_Movement_ArtistApproachPlayer + waitmovement LOCALID_ARTIST applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_ContestLobby_Movement_PlayerFaceArtist waitmovement 0 msgbox LilycoveCity_ContestLobby_Text_YourPokemonSpurredMeToPaint, MSGBOX_DEFAULT @@ -61,9 +67,9 @@ LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseum:: @ 821A2AA specialvar VAR_RESULT, GiveMonArtistRibbon compare VAR_RESULT, TRUE call_if_eq LilycoveCity_ContestLobby_EventScript_ReceivedArtistRibbon - applymovement 4, LilycoveCity_ContestLobby_Movement_ArtistExit + applymovement LOCALID_ARTIST, LilycoveCity_ContestLobby_Movement_ArtistExit waitmovement 0 - removeobject 4 + removeobject LOCALID_ARTIST call LilycoveCity_ContestLobby_EventScript_UpdateMuseumPatrons call LilycoveCity_ContestLobby_EventScript_SetPaintingFlag releaseall @@ -75,22 +81,22 @@ LilycoveCity_ContestLobby_EventScript_ConfirmDontTakePainting:: @ 821A2E4 goto_if_eq LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseum msgbox LilycoveCity_ContestLobby_Text_FineThatsTheWayItIs, MSGBOX_DEFAULT closemessage - applymovement 4, LilycoveCity_ContestLobby_Movement_ArtistExit + applymovement LOCALID_ARTIST, LilycoveCity_ContestLobby_Movement_ArtistExit waitmovement 0 setvar VAR_LILYCOVE_CONTEST_LOBBY_STATE, 0 - removeobject 4 + removeobject LOCALID_ARTIST releaseall end LilycoveCity_ContestLobby_EventScript_ReceivedArtistRibbon:: @ 821A314 incrementgamestat GAME_STAT_RECEIVED_RIBBONS special BufferContestWinnerMonName - applymovement 4, LilycoveCity_ContestLobby_Movement_ArtistBeginToExit + applymovement LOCALID_ARTIST, LilycoveCity_ContestLobby_Movement_ArtistBeginToExit waitmovement 0 playse SE_PIN - applymovement 4, Common_Movement_ExclamationMark + applymovement LOCALID_ARTIST, Common_Movement_ExclamationMark waitmovement 0 - applymovement 4, LilycoveCity_ContestLobby_Movement_ArtistReturnToPlayer + applymovement LOCALID_ARTIST, LilycoveCity_ContestLobby_Movement_ArtistReturnToPlayer waitmovement 0 msgbox LilycoveCity_ContestLobby_Text_TakeMementoOfPainting, MSGBOX_DEFAULT playfanfare MUS_FANFA4 @@ -209,9 +215,9 @@ LilycoveCity_ContestLobby_EventScript_TryDoLinkContestArtist:: @ 821A427 LilycoveCity_ContestLobby_EventScript_LinkContestArtist:: @ 821A436 lockall - addobject 11 - applymovement 11, LilycoveCity_ContestLobby_Movement_LinkArtistApproachPlayer - waitmovement 11 + addobject LOCALID_ARTIST_LINK + applymovement LOCALID_ARTIST_LINK, LilycoveCity_ContestLobby_Movement_LinkArtistApproachPlayer + waitmovement LOCALID_ARTIST_LINK applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_ContestLobby_Movement_PlayerFaceLinkArtist waitmovement 0 msgbox LilycoveCity_ContestLobby_Text_YourPokemonSpurredMeToPaint, MSGBOX_DEFAULT @@ -233,9 +239,9 @@ LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink:: @ 821A47A specialvar VAR_RESULT, GiveMonArtistRibbon compare VAR_RESULT, TRUE call_if_eq LilycoveCity_ContestLobby_EventScript_ReceivedLinkArtistRibbon - applymovement 11, LilycoveCity_ContestLobby_Movement_LinkArtistExit + applymovement LOCALID_ARTIST_LINK, LilycoveCity_ContestLobby_Movement_LinkArtistExit waitmovement 0 - removeobject 11 + removeobject LOCALID_ARTIST_LINK call LilycoveCity_ContestLobby_EventScript_UpdateMuseumPatrons call LilycoveCity_ContestLobby_EventScript_SetPaintingFlag releaseall @@ -247,10 +253,10 @@ LilycoveCity_ContestLobby_EventScript_ConfirmDontTakePaintingLink:: @ 821A4B4 goto_if_eq LilycoveCity_ContestLobby_EventScript_TakePaintingToMuseumLink msgbox LilycoveCity_ContestLobby_Text_FineThatsTheWayItIs, MSGBOX_DEFAULT closemessage - applymovement 11, LilycoveCity_ContestLobby_Movement_LinkArtistExit + applymovement LOCALID_ARTIST_LINK, LilycoveCity_ContestLobby_Movement_LinkArtistExit waitmovement 0 setvar VAR_LILYCOVE_CONTEST_LOBBY_STATE, 0 - removeobject 11 + removeobject LOCALID_ARTIST_LINK releaseall end @@ -258,12 +264,12 @@ LilycoveCity_ContestLobby_EventScript_ReceivedLinkArtistRibbon:: @ 821A4E4 incrementgamestat GAME_STAT_RECEIVED_RIBBONS setflag FLAG_SYS_RIBBON_GET special BufferContestWinnerMonName - applymovement 11, LilycoveCity_ContestLobby_Movement_LinkArtistBeginExit + applymovement LOCALID_ARTIST_LINK, LilycoveCity_ContestLobby_Movement_LinkArtistBeginExit waitmovement 0 playse SE_PIN - applymovement 11, Common_Movement_ExclamationMark + applymovement LOCALID_ARTIST_LINK, Common_Movement_ExclamationMark waitmovement 0 - applymovement 11, LilycoveCity_ContestLobby_Movement_LinkArtistReturnToPlayer + applymovement LOCALID_ARTIST_LINK, LilycoveCity_ContestLobby_Movement_LinkArtistReturnToPlayer waitmovement 0 msgbox LilycoveCity_ContestLobby_Text_TakeMementoOfPainting, MSGBOX_DEFAULT playfanfare MUS_FANFA4 @@ -409,26 +415,26 @@ LilycoveCity_ContestLobby_EventScript_WarpToToughContestHall:: @ 821A663 LilycoveCity_ContestLobby_EventScript_LeadToContestHall:: @ 821A670 lockall - applymovement 1, LilycoveCity_ContestLobby_Movement_ReceptionistApproachCounter + applymovement LOCALID_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_ReceptionistApproachCounter waitmovement 0 playse SE_HASHI setmetatile 12, 2, METATILE_Contest_WallShadow, 1 setmetatile 12, 3, METATILE_Contest_FloorShadow, 1 special DrawWholeMapView - applymovement 1, LilycoveCity_ContestLobby_Movement_ReceptionistExitCounter + applymovement LOCALID_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_ReceptionistExitCounter waitmovement 0 playse SE_HASHI setmetatile 12, 2, METATILE_Contest_CounterFlap_Top, 1 setmetatile 12, 3, METATILE_Contest_CounterFlap_Bottom, 1 special DrawWholeMapView delay 20 - applymovement 1, LilycoveCity_ContestLobby_Movement_ReceptionistFacePlayer + applymovement LOCALID_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_ReceptionistFacePlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_ContestLobby_Movement_PlayerApproachReceptionist waitmovement 0 msgbox LilycoveCity_ContestLobby_Text_ComeThroughHere, MSGBOX_DEFAULT closemessage - applymovement 1, LilycoveCity_ContestLobby_Movement_ReceptionistWalkToContestHall + applymovement LOCALID_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_ReceptionistWalkToContestHall applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_ContestLobby_Movement_PlayerWalkToContestHall waitmovement 0 releaseall @@ -930,20 +936,20 @@ LilycoveCity_ContestLobby_EventScript_LeadToLinkContestHall:: @ 821AC49 waitmessage delay 20 closemessage - applymovement 2, LilycoveCity_ContestLobby_Movement_LinkReceptionistApproachCounter + applymovement LOCALID_LINK_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_LinkReceptionistApproachCounter waitmovement 0 playse SE_HASHI setmetatile 17, 2, METATILE_Contest_WallShadow, 1 setmetatile 17, 3, METATILE_Contest_FloorShadow, 1 special DrawWholeMapView - applymovement 2, LilycoveCity_ContestLobby_Movement_LinkReceptionistExitCounter + applymovement LOCALID_LINK_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_LinkReceptionistExitCounter waitmovement 0 playse SE_HASHI setmetatile 17, 2, METATILE_Contest_CounterFlap_Top, 1 setmetatile 17, 3, METATILE_Contest_CounterFlap_Bottom, 1 special DrawWholeMapView delay 20 - applymovement 2, LilycoveCity_ContestLobby_Movement_LinkReceptionistFacePlayer + applymovement LOCALID_LINK_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_LinkReceptionistFacePlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_ContestLobby_Movement_PlayerApproachLinkReceptionist waitmovement 0 @@ -952,7 +958,7 @@ LilycoveCity_ContestLobby_EventScript_LeadToLinkContestHall:: @ 821AC49 delay 20 closemessage call LilycoveCity_ContestLobby_EventScript_DelayIfContestWithRSPlayer - applymovement 2, LilycoveCity_ContestLobby_Movement_LinkReceptionistWalkToContestHall + applymovement LOCALID_LINK_RECEPTIONIST, LilycoveCity_ContestLobby_Movement_LinkReceptionistWalkToContestHall applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_ContestLobby_Movement_PlayerWalkToLinkContestHall waitmovement 0 release diff --git a/data/maps/LilycoveCity_CoveLilyMotel_1F/scripts.inc b/data/maps/LilycoveCity_CoveLilyMotel_1F/scripts.inc index 49008b035..72667973d 100644 --- a/data/maps/LilycoveCity_CoveLilyMotel_1F/scripts.inc +++ b/data/maps/LilycoveCity_CoveLilyMotel_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_OWNER, 1 + LilycoveCity_CoveLilyMotel_1F_MapScripts:: @ 8218188 .byte 0 @@ -6,33 +8,33 @@ LilycoveCity_CoveLilyMotel_1F_EventScript_MotelOwner:: @ 8218189 goto_if_set FLAG_SYS_GAME_CLEAR, LilycoveCity_CoveLilyMotel_1F_EventScript_GameClear goto_if_set FLAG_BADGE07_GET, LilycoveCity_CoveLilyMotel_1F_EventScript_AquaHideoutBusted msgbox LilycoveCity_CoveLilyMotel_1F_Text_GuestsDoubledByMascot, MSGBOX_DEFAULT - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_OWNER, Common_Movement_FacePlayer waitmovement 0 msgbox LilycoveCity_CoveLilyMotel_1F_Text_NoGuestsWithTeamAqua, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_OWNER, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end LilycoveCity_CoveLilyMotel_1F_EventScript_AquaHideoutBusted:: @ 82181C3 msgbox LilycoveCity_CoveLilyMotel_1F_Text_MonFoundLostItem, MSGBOX_DEFAULT - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_OWNER, Common_Movement_FacePlayer waitmovement 0 msgbox LilycoveCity_CoveLilyMotel_1F_Text_HeardAquaHideoutBusted, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_OWNER, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end LilycoveCity_CoveLilyMotel_1F_EventScript_GameClear:: @ 82181EA msgbox LilycoveCity_CoveLilyMotel_1F_Text_HouseSittingMonCaughtBurglar, MSGBOX_DEFAULT - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_OWNER, Common_Movement_FacePlayer waitmovement 0 msgbox LilycoveCity_CoveLilyMotel_1F_Text_BetterGetWorkingOnGuestsDinner, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_OWNER, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end @@ -40,18 +42,18 @@ LilycoveCity_CoveLilyMotel_1F_EventScript_GameClear:: @ 82181EA LilycoveCity_CoveLilyMotel_1F_EventScript_BlockingTV:: @ 8218211 lockall playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_OWNER, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_OWNER, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox LilycoveCity_CoveLilyMotel_1F_Text_CantSeeTheTV, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_CoveLilyMotel_1F_Movement_PlayerPushFromTV - applymovement 1, LilycoveCity_CoveLilyMotel_1F_Movement_OwnerPushPlayer + applymovement LOCALID_OWNER, LilycoveCity_CoveLilyMotel_1F_Movement_OwnerPushPlayer waitmovement 0 - applymovement 1, LilycoveCity_CoveLilyMotel_1F_Movement_OwnerReturn + applymovement LOCALID_OWNER, LilycoveCity_CoveLilyMotel_1F_Movement_OwnerReturn waitmovement 0 release end diff --git a/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc b/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc index a3cf54ee0..191220091 100644 --- a/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc +++ b/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_LOTTERY_CLERK, 2 + LilycoveCity_DepartmentStore_1F_MapScripts:: @ 821F692 .byte 0 @@ -22,7 +24,7 @@ LilycoveCity_DepartmentStore_1F_EventScript_LotteryClerk:: @ 821F69C copyvar VAR_0x8008, VAR_RESULT special BufferLottoTicketNumber msgbox LilycoveCity_DepartmentStore_1F_Text_TicketNumberIsXPleaseWait, MSGBOX_DEFAULT - applymovement 2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_LOTTERY_CLERK, Common_Movement_WalkInPlaceFastestRight waitmovement 0 playse SE_PC_ON special DoLotteryCornerComputerEffect @@ -30,7 +32,7 @@ LilycoveCity_DepartmentStore_1F_EventScript_LotteryClerk:: @ 821F69C delay 220 special EndLotteryCornerComputerEffect delay 10 - applymovement 2, Common_Movement_FacePlayer + applymovement LOCALID_LOTTERY_CLERK, Common_Movement_FacePlayer waitmovement 0 compare VAR_0x8004, 0 goto_if_eq LilycoveCity_DepartmentStore_1F_EventScript_NoMatch diff --git a/data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc b/data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc index 0a2525b87..2b36e3d27 100644 --- a/data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc +++ b/data/maps/LilycoveCity_DepartmentStore_5F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WOMAN, 7 + LilycoveCity_DepartmentStore_5F_MapScripts:: @ 821FF7A map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, LilycoveCity_DepartmentStore_5F_OnWarp .byte 0 @@ -11,8 +13,8 @@ LilycoveCity_DepartmentStore_5F_OnWarp: @ 821FF80 .2byte 0 LilycoveCity_DepartmentStore_5F_EventScript_BlockRoofStairs:: @ 821FF9A - setobjectxy 7, 16, 2 - turnobject 7, DIR_NORTH + setobjectxy LOCALID_WOMAN, 16, 2 + turnobject LOCALID_WOMAN, DIR_NORTH end LilycoveCity_DepartmentStore_5F_EventScript_ClerkFarLeft:: @ 821FFA6 @@ -125,7 +127,7 @@ LilycoveCity_DepartmentStore_5F_EventScript_PokefanF:: @ 822006C LilycoveCity_DepartmentStore_5F_EventScript_Woman:: @ 8220075 lockall - applymovement 7, Common_Movement_FacePlayer + applymovement LOCALID_WOMAN, Common_Movement_FacePlayer waitmovement 0 compare VAR_SOOTOPOLIS_CITY_STATE, 0 goto_if_eq LilycoveCity_DepartmentStore_5F_EventScript_WomanNormal @@ -143,7 +145,7 @@ LilycoveCity_DepartmentStore_5F_EventScript_WomanNormal:: @ 822009C LilycoveCity_DepartmentStore_5F_EventScript_WomanLegendaryWeather:: @ 82200A7 msgbox LilycoveCity_DepartmentStore_5F_Text_ClosedRooftopForWeather, MSGBOX_DEFAULT closemessage - applymovement 7, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_WOMAN, Common_Movement_WalkInPlaceFastestUp waitmovement 0 releaseall end diff --git a/data/maps/LilycoveCity_Harbor/scripts.inc b/data/maps/LilycoveCity_Harbor/scripts.inc index 023f530fb..1d9ae6a01 100644 --- a/data/maps/LilycoveCity_Harbor/scripts.inc +++ b/data/maps/LilycoveCity_Harbor/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_ATTENDANT, 1 +.set LOCALID_SS_TIDAL, 2 +.set LOCALID_FERRY_SAILOR, 4 +.set LOCALID_BRINEY, 5 + LilycoveCity_Harbor_MapScripts:: @ 821E000 map_script MAP_SCRIPT_ON_TRANSITION, LilycoveCity_Harbor_OnTransition .byte 0 @@ -110,7 +115,7 @@ LilycoveCity_Harbor_EventScript_GetEonTicketState:: @ 821E194 setvar VAR_TEMP_E, 0 goto_if_unset FLAG_ENABLE_SHIP_SOUTHERN_ISLAND, Common_EventScript_NopReturn checkitem ITEM_EON_TICKET, 1 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_NopReturn setvar VAR_TEMP_E, 1 goto_if_set FLAG_SHOWN_EON_TICKET, Common_EventScript_NopReturn @@ -121,7 +126,7 @@ LilycoveCity_Harbor_EventScript_GetAuroraTicketState:: @ 821E1C6 setvar VAR_TEMP_D, 0 goto_if_unset FLAG_ENABLE_SHIP_BIRTH_ISLAND, Common_EventScript_NopReturn checkitem ITEM_AURORA_TICKET, 1 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_NopReturn setvar VAR_TEMP_D, 1 goto_if_set FLAG_SHOWN_AURORA_TICKET, Common_EventScript_NopReturn @@ -132,7 +137,7 @@ LilycoveCity_Harbor_EventScript_GetOldSeaMapState:: @ 821E1F8 setvar VAR_TEMP_C, 0 goto_if_unset FLAG_ENABLE_SHIP_FARAWAY_ISLAND, Common_EventScript_NopReturn checkitem ITEM_OLD_SEA_MAP, 1 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_NopReturn setvar VAR_TEMP_C, 1 goto_if_set FLAG_SHOWN_OLD_SEA_MAP, Common_EventScript_NopReturn @@ -143,7 +148,7 @@ LilycoveCity_Harbor_EventScript_GetMysticTicketState:: @ 821E22A setvar VAR_TEMP_9, 0 goto_if_unset FLAG_ENABLE_SHIP_NAVEL_ROCK, Common_EventScript_NopReturn checkitem ITEM_MYSTIC_TICKET, 1 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_NopReturn setvar VAR_TEMP_9, 1 goto_if_set FLAG_SHOWN_MYSTIC_TICKET, Common_EventScript_NopReturn @@ -247,18 +252,18 @@ LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime:: @ 821E350 call LilycoveCity_Harbor_EventScript_GetEventTicketSailor msgbox EventTicket_Text_OldSeaMapTooFar, MSGBOX_DEFAULT closemessage - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_FERRY_SAILOR, Common_Movement_WalkInPlaceFastestUp waitmovement 0 playse SE_PIN - applymovement 4, Common_Movement_ExclamationMark + applymovement LOCALID_FERRY_SAILOR, Common_Movement_ExclamationMark waitmovement 0 - applymovement 4, Common_Movement_Delay48 + applymovement LOCALID_FERRY_SAILOR, Common_Movement_Delay48 waitmovement 0 compare VAR_FACING, DIR_NORTH call_if_eq LilycoveCity_Harbor_EventScript_MoveSailorOutOfWayNorth compare VAR_FACING, DIR_EAST call_if_eq LilycoveCity_Harbor_EventScript_MoveSailorOutOfWayEast - addobject 5 + addobject LOCALID_BRINEY compare VAR_FACING, DIR_NORTH call_if_eq LilycoveCity_Harbor_EventScript_BrineyFaceSailorNorth compare VAR_FACING, DIR_EAST @@ -274,7 +279,7 @@ LilycoveCity_Harbor_EventScript_OldSeaMapFirstTime:: @ 821E350 call_if_eq LilycoveCity_Harbor_EventScript_BoardFerryWithBrineyAndSailorNorth compare VAR_FACING, DIR_EAST call_if_eq LilycoveCity_Harbor_EventScript_BoardFerryWithBrineyAndSailorEast - setvar VAR_0x8004, 2 + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepart warp MAP_FARAWAY_ISLAND_ENTRANCE, 255, 13, 38 waitstate @@ -329,14 +334,14 @@ LilycoveCity_Harbor_EventScript_MultipleEventTicketsFirstTime:: @ 821E44D LilycoveCity_Harbor_EventScript_ExitFirstTimeTicketSailSelect:: @ 821E4B6 msgbox EventTicket_Text_AsYouLike, MSGBOX_DEFAULT closemessage - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_FERRY_SAILOR, Common_Movement_WalkInPlaceFastestUp waitmovement 0 delay 30 - removeobject 4 + removeobject LOCALID_FERRY_SAILOR delay 30 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFastestDown waitmovement 0 - showobjectat 1, MAP_LILYCOVE_CITY_HARBOR + showobjectat LOCALID_ATTENDANT, MAP_LILYCOVE_CITY_HARBOR delay 30 msgbox LilycoveCity_Harbor_Text_SailAnotherTime, MSGBOX_DEFAULT release @@ -348,24 +353,24 @@ LilycoveCity_Harbor_EventScript_GetEventTicketSailor:: @ 821E4EE delay 30 hideobjectat VAR_LAST_TALKED, MAP_LILYCOVE_CITY_HARBOR delay 60 - addobject 4 + addobject LOCALID_FERRY_SAILOR delay 30 - applymovement 4, Common_Movement_FacePlayer + applymovement LOCALID_FERRY_SAILOR, Common_Movement_FacePlayer waitmovement 0 return LilycoveCity_Harbor_EventScript_BoardFerryWithSailor:: @ 821E514 - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_FERRY_SAILOR, Common_Movement_WalkInPlaceFastestUp waitmovement 0 delay 30 - removeobject 4 + removeobject LOCALID_FERRY_SAILOR compare VAR_FACING, DIR_NORTH call_if_eq LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth compare VAR_FACING, DIR_EAST call_if_eq LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast delay 30 hideobjectat OBJ_EVENT_ID_PLAYER, 0 - setvar VAR_0x8004, 2 + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepart return @@ -429,7 +434,7 @@ LilycoveCity_Harbor_EventScript_BoardFerry:: @ 821E5CC call_if_eq LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast delay 30 hideobjectat OBJ_EVENT_ID_PLAYER, 0 - setvar VAR_0x8004, 2 + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepart return @@ -475,12 +480,12 @@ LilycoveCity_Harbor_EventScript_SailorFerryAvailable:: @ 821E64C end LilycoveCity_Harbor_EventScript_MoveSailorOutOfWayNorth:: @ 821E656 - applymovement 4, LilycoveCity_Harbor_Movement_SailorOutOfWayNorth + applymovement LOCALID_FERRY_SAILOR, LilycoveCity_Harbor_Movement_SailorOutOfWayNorth waitmovement 0 return LilycoveCity_Harbor_EventScript_MoveSailorOutOfWayEast:: @ 821E661 - applymovement 4, LilycoveCity_Harbor_Movement_SailorOutOfWayEast + applymovement LOCALID_FERRY_SAILOR, LilycoveCity_Harbor_Movement_SailorOutOfWayEast waitmovement 0 return @@ -498,36 +503,36 @@ LilycoveCity_Harbor_Movement_SailorOutOfWayEast: @ 821E671 step_end LilycoveCity_Harbor_EventScript_BrineyFaceSailorNorth:: @ 821E675 - applymovement 5, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_BRINEY, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return LilycoveCity_Harbor_EventScript_BrineyFaceSailorEast:: @ 821E680 - applymovement 5, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_BRINEY, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return LilycoveCity_Harbor_EventScript_BrineyFacePlayerNorth:: @ 821E68B - applymovement 5, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_BRINEY, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return LilycoveCity_Harbor_EventScript_BrineyFacePlayerEast:: @ 821E696 - applymovement 5, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_BRINEY, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return LilycoveCity_Harbor_EventScript_BoardFerryWithBrineyAndSailorNorth:: @ 821E6A1 - applymovement 5, LilycoveCity_Harbor_Movement_BrineyBoardFerry + applymovement LOCALID_BRINEY, LilycoveCity_Harbor_Movement_BrineyBoardFerry applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_Harbor_Movement_PlayerBoardWithBrineyNorth - applymovement 4, LilycoveCity_Harbor_Movement_SailorBoardWithBrineyNorth + applymovement LOCALID_FERRY_SAILOR, LilycoveCity_Harbor_Movement_SailorBoardWithBrineyNorth waitmovement 0 return LilycoveCity_Harbor_EventScript_BoardFerryWithBrineyAndSailorEast:: @ 821E6BA - applymovement 5, LilycoveCity_Harbor_Movement_BrineyBoardFerry + applymovement LOCALID_BRINEY, LilycoveCity_Harbor_Movement_BrineyBoardFerry applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_Harbor_Movement_PlayerBoardWithBrineyEast - applymovement 4, LilycoveCity_Harbor_Movement_SailorBoardWithBrineyEast + applymovement LOCALID_FERRY_SAILOR, LilycoveCity_Harbor_Movement_SailorBoardWithBrineyEast waitmovement 0 return diff --git a/data/maps/LilycoveCity_LilycoveMuseum_1F/scripts.inc b/data/maps/LilycoveCity_LilycoveMuseum_1F/scripts.inc index 998cd2897..624e304c8 100644 --- a/data/maps/LilycoveCity_LilycoveMuseum_1F/scripts.inc +++ b/data/maps/LilycoveCity_LilycoveMuseum_1F/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_CURATOR, 2 +.set LOCALID_ARTIST_2, 8 + LilycoveCity_LilycoveMuseum_1F_MapScripts:: @ 8218CB8 .byte 0 @@ -7,7 +10,7 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_Greeter:: @ 8218CB9 LilycoveCity_LilycoveMuseum_1F_EventScript_Curator:: @ 8218CC2 lockall - applymovement 2, Common_Movement_FacePlayer + applymovement LOCALID_CURATOR, Common_Movement_FacePlayer message LilycoveCity_LilycoveMuseum_1F_Text_ImCuratorHaveYouViewedOurPaintings waitmessage multichoice 20, 8, MULTI_VIEWED_PAINTINGS, 1 @@ -36,9 +39,9 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_NotInterested:: @ 8218D14 LilycoveCity_LilycoveMuseum_1F_EventScript_InterestedInPaintings:: @ 8218D1E msgbox LilycoveCity_LilycoveMuseum_1F_Text_ExcellentCanYouComeWithMe, MSGBOX_SIGN - applymovement 2, LilycoveCity_LilycoveMuseum_1F_Movement_CuratorEnterStairs + applymovement LOCALID_CURATOR, LilycoveCity_LilycoveMuseum_1F_Movement_CuratorEnterStairs waitmovement 0 - removeobject 2 + removeobject LOCALID_CURATOR switch VAR_FACING case DIR_NORTH, LilycoveCity_LilycoveMuseum_1F_EventScript_FollowCuratorNorth case DIR_WEST, LilycoveCity_LilycoveMuseum_1F_EventScript_FollowCuratorWest @@ -153,7 +156,7 @@ LilycoveCity_LilycoveMuseum_1F_EventScript_Artist2:: @ 8218E2B faceplayer msgbox LilycoveCity_LilycoveMuseum_1F_Text_AimToSeeGreatPaintings, MSGBOX_DEFAULT closemessage - applymovement 8, Common_Movement_FaceOriginalDirection + applymovement LOCALID_ARTIST_2, Common_Movement_FaceOriginalDirection waitmovement 0 release end diff --git a/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc b/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc index 257bdd086..4cebebd82 100644 --- a/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc +++ b/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_CURATOR, 1 + LilycoveCity_LilycoveMuseum_2F_MapScripts:: @ 821973A map_script MAP_SCRIPT_ON_LOAD, LilycoveCity_LilycoveMuseum_2F_OnLoad map_script MAP_SCRIPT_ON_FRAME_TABLE, LilycoveCity_LilycoveMuseum_2F_OnFrame @@ -62,16 +64,16 @@ LilycoveCity_LilycoveMuseum_2F_OnFrame: @ 82197FE LilycoveCity_LilycoveMuseum_2F_EventScript_ShowExhibitHall:: @ 8219808 lockall - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_CURATOR, Common_Movement_FacePlayer applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_LilycoveMuseum_2F_Movement_PlayerWalkInPlaceLeft waitmovement 0 msgbox LilycoveCity_LilycoveMuseum_2F_Text_ThisIsExhibitHall, MSGBOX_SIGN - applymovement 1, LilycoveCity_LilycoveMuseum_2F_Movement_FaceExhibitHall + applymovement LOCALID_CURATOR, LilycoveCity_LilycoveMuseum_2F_Movement_FaceExhibitHall waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_LilycoveMuseum_2F_Movement_FaceExhibitHall waitmovement 0 msgbox LilycoveCity_LilycoveMuseum_2F_Text_ExplainExhibitHall, MSGBOX_SIGN - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_CURATOR, Common_Movement_FacePlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, LilycoveCity_LilycoveMuseum_2F_Movement_PlayerWalkInPlaceLeft waitmovement 0 @@ -107,16 +109,16 @@ LilycoveCity_LilycoveMuseum_2F_EventScript_AddedPainting:: @ 82198BA end LilycoveCity_LilycoveMuseum_2F_EventScript_ThankPlayer:: @ 82198C3 - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_CURATOR, Common_Movement_FacePlayer waitmovement 0 msgbox LilycoveCity_LilycoveMuseum_2F_Text_ItsYouPlayer, MSGBOX_DEFAULT - applymovement 1, LilycoveCity_LilycoveMuseum_2F_Movement_FaceExhibitHall + applymovement LOCALID_CURATOR, LilycoveCity_LilycoveMuseum_2F_Movement_FaceExhibitHall msgbox LilycoveCity_LilycoveMuseum_2F_Text_PaintingsAttractedMoreGuests, MSGBOX_DEFAULT goto LilycoveCity_LilycoveMuseum_2F_EventScript_GiveGlassOrnament end LilycoveCity_LilycoveMuseum_2F_EventScript_GiveGlassOrnament:: @ 82198EA - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_CURATOR, Common_Movement_FacePlayer msgbox LilycoveCity_LilycoveMuseum_2F_Text_TokenOfGratitude, MSGBOX_DEFAULT givedecoration DECOR_GLASS_ORNAMENT compare VAR_RESULT, FALSE diff --git a/data/maps/LilycoveCity_MoveDeletersHouse/scripts.inc b/data/maps/LilycoveCity_MoveDeletersHouse/scripts.inc index 2592ccd9c..6e7f9c580 100644 --- a/data/maps/LilycoveCity_MoveDeletersHouse/scripts.inc +++ b/data/maps/LilycoveCity_MoveDeletersHouse/scripts.inc @@ -1,9 +1,11 @@ +.set LOCALID_MOVE_DELETER, 1 + LilycoveCity_MoveDeletersHouse_MapScripts:: @ 821EA0A .byte 0 LilycoveCity_MoveDeletersHouse_EventScript_MoveDeleter:: @ 821EA0B lockall - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_MOVE_DELETER, Common_Movement_FacePlayer waitmovement 0 msgbox LilycoveCity_MoveDeletersHouse_Text_ICanMakeMonForgetMove, MSGBOX_YESNO switch VAR_RESULT diff --git a/data/maps/LilycoveCity_PokemonCenter_1F/scripts.inc b/data/maps/LilycoveCity_PokemonCenter_1F/scripts.inc index a7df8528e..829c55646 100644 --- a/data/maps/LilycoveCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/LilycoveCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + LilycoveCity_PokemonCenter_1F_MapScripts:: @ 821C5B2 map_script MAP_SCRIPT_ON_TRANSITION, LilycoveCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -25,9 +27,8 @@ LilycoveCity_PokemonCenter_1F_EventScript_ShowContestLadyMon:: @ 821C5E4 clearflag FLAG_HIDE_LILYCOVE_POKEMON_CENTER_CONTEST_LADY_MON end -@ VAR_0x800B is the Nurse's object event id LilycoveCity_PokemonCenter_1F_EventScript_Nurse:: @ 821C5E8 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc b/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc index b76f96b30..6ff869db3 100644 --- a/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc +++ b/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc @@ -1,3 +1,12 @@ +.set LOCALID_LASS, 1 +.set LOCALID_MAN, 2 +.set LOCALID_POKEFAN_M, 3 +.set LOCALID_LITTLE_GIRL, 4 +.set LOCALID_NINJA_BOY, 5 +.set LOCALID_BOY, 6 +.set LOCALID_WOMAN, 7 +.set LOCALID_EXPERT_F, 8 + LilycoveCity_PokemonTrainerFanClub_MapScripts:: @ 821C785 map_script MAP_SCRIPT_ON_FRAME_TABLE, LilycoveCity_PokemonTrainerFanClub_OnFrame map_script MAP_SCRIPT_ON_TRANSITION, LilycoveCity_PokemonTrainerFanClub_OnTransition @@ -11,20 +20,20 @@ LilycoveCity_PokemonTrainerFanClub_OnFrame: @ 821C790 LilycoveCity_PokemonTrainerFanClub_EventScript_MeetFirstFans:: @ 821C79A lockall - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_LASS, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox LilycoveCity_PokemonTrainerFanClub_Text_OhWowItsPlayer, MSGBOX_DEFAULT - applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlWatchPlayer - applymovement 2, LilycoveCity_PokemonTrainerFanClub_Movement_FanApproachPlayer + applymovement LOCALID_LITTLE_GIRL, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlWatchPlayer + applymovement LOCALID_MAN, LilycoveCity_PokemonTrainerFanClub_Movement_FanApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox LilycoveCity_PokemonTrainerFanClub_Text_HeardAboutYouImYourFan, MSGBOX_DEFAULT - applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlMoveCloserToPlayer + applymovement LOCALID_LITTLE_GIRL, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlMoveCloserToPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 - applymovement 4, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlHideFromPlayer + applymovement LOCALID_LITTLE_GIRL, LilycoveCity_PokemonTrainerFanClub_Movement_LittleGirlHideFromPlayer waitmovement 0 setvar VAR_LILYCOVE_FAN_CLUB_STATE, 2 releaseall @@ -168,35 +177,35 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_TrySetUpTVShow:: @ 821C9B4 return LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember1ToFarTable:: @ 821C9B8 - setobjectxyperm 1, 7, 5 + setobjectxyperm LOCALID_LASS, 7, 5 return LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember2ToFarTable:: @ 821C9C0 - setobjectxyperm 3, 3, 4 + setobjectxyperm LOCALID_POKEFAN_M, 3, 4 return LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember3ToFarTable:: @ 821C9C8 - setobjectxyperm 4, 7, 2 + setobjectxyperm LOCALID_LITTLE_GIRL, 7, 2 return LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember4ToFarTable:: @ 821C9D0 - setobjectxyperm 5, 5, 5 + setobjectxyperm LOCALID_NINJA_BOY, 5, 5 return LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember5ToFarTable:: @ 821C9D8 - setobjectxyperm 6, 5, 2 + setobjectxyperm LOCALID_BOY, 5, 2 return LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember6ToFarTable:: @ 821C9E0 - setobjectxyperm 2, 8, 4 + setobjectxyperm LOCALID_MAN, 8, 4 return LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember7ToFarTable:: @ 821C9E8 - setobjectxyperm 7, 3, 3 + setobjectxyperm LOCALID_WOMAN, 3, 3 return LilycoveCity_PokemonTrainerFanClub_EventScript_MoveMember8ToFarTable:: @ 821C9F0 - setobjectxyperm 8, 8, 3 + setobjectxyperm LOCALID_EXPERT_F, 8, 3 return LilycoveCity_PokemonTrainerFanClub_EventScript_SetFanMemberPositionsForFirstFanMeeting:: @ 821C9F8 diff --git a/data/maps/LittlerootTown/scripts.inc b/data/maps/LittlerootTown/scripts.inc index 5fd2a5fca..347a805e8 100644 --- a/data/maps/LittlerootTown/scripts.inc +++ b/data/maps/LittlerootTown/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_TWIN, 1 +.set LOCALID_MOM, 4 +.set LOCALID_RIVAL, 7 +.set LOCALID_BIRCH, 8 + LittlerootTown_MapScripts:: @ 81E7DCB map_script MAP_SCRIPT_ON_TRANSITION, LittlerootTown_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, LittlerootTown_OnFrame @@ -79,24 +84,24 @@ LittlerootTown_EventScript_SetExitedHouseAfterLatiSSTicketEvent:: @ 81E7E5C return LittlerootTown_EventScript_MoveMomToMaysDoor:: @ 81E7E67 - setobjectxyperm 4, 14, 8 + setobjectxyperm LOCALID_MOM, 14, 8 return LittlerootTown_EventScript_SetTwinPos:: @ 81E7E6F compare VAR_LITTLEROOT_TOWN_STATE, 0 goto_if_eq LittlerootTown_EventScript_SetTwinGuardingRoutePos - setobjectxyperm 1, 10, 1 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_TWIN, 10, 1 + setobjectmovementtype LOCALID_TWIN, MOVEMENT_TYPE_FACE_UP return LittlerootTown_EventScript_SetTwinGuardingRoutePos:: @ 81E7E86 - setobjectxyperm 1, 7, 2 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_TWIN, 7, 2 + setobjectmovementtype LOCALID_TWIN, MOVEMENT_TYPE_FACE_DOWN return LittlerootTown_EventScript_SetMomStandingInFrontOfDoorPos:: @ 81E7E92 clearflag FLAG_HIDE_LITTLEROOT_TOWN_MOM_OUTSIDE - setobjectmovementtype 4, MOVEMENT_TYPE_FACE_DOWN + setobjectmovementtype LOCALID_MOM, MOVEMENT_TYPE_FACE_DOWN checkplayergender compare VAR_RESULT, MALE call_if_eq LittlerootTown_EventScript_SetMomInFrontOfDoorMale @@ -105,11 +110,11 @@ LittlerootTown_EventScript_SetMomStandingInFrontOfDoorPos:: @ 81E7E92 return LittlerootTown_EventScript_SetMomInFrontOfDoorMale:: @ 81E7EB1 - setobjectxyperm 4, 5, 9 + setobjectxyperm LOCALID_MOM, 5, 9 return LittlerootTown_EventScript_SetMomInFrontOfDoorFemale:: @ 81E7EB9 - setobjectxyperm 4, 14, 9 + setobjectxyperm LOCALID_MOM, 14, 9 return LittlerootTown_OnFrame: @ 81E7EC1 @@ -147,22 +152,22 @@ LittlerootTown_EventScript_GoInsideWithMom:: @ 81E7F17 waitmovement 0 opendoor VAR_0x8004, VAR_0x8005 waitdooranim - addobject 4 - applymovement 4, LittlerootTown_Movement_MomExitHouse + addobject LOCALID_MOM + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitHouse waitmovement 0 closedoor VAR_0x8004, VAR_0x8005 waitdooranim delay 10 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerAtTruck + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerAtTruck waitmovement 0 msgbox LittlerootTown_Text_OurNewHomeLetsGoInside, MSGBOX_DEFAULT closemessage - applymovement 4, LittlerootTown_Movement_MomApproachDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachDoor applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_Movement_PlayerApproachDoor waitmovement 0 opendoor VAR_0x8004, VAR_0x8005 waitdooranim - applymovement 4, LittlerootTown_Movement_MomEnterHouse + applymovement LOCALID_MOM, LittlerootTown_Movement_MomEnterHouse applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_Movement_PlayerEnterHouse waitmovement 0 setflag FLAG_HIDE_LITTLEROOT_TOWN_MOM_OUTSIDE @@ -216,7 +221,7 @@ LittlerootTown_Movement_PlayerStepOffTruck: @ 81E7FAC LittlerootTown_EventScript_BeginDexUpgradeScene:: @ 81E7FB1 lockall playse SE_PIN - applymovement 8, Common_Movement_ExclamationMark + applymovement LOCALID_BIRCH, Common_Movement_ExclamationMark waitmovement 0 delay 80 msgbox LittlerootTown_Text_BirchSomethingToShowYouAtLab, MSGBOX_DEFAULT @@ -235,8 +240,8 @@ LittlerootTown_OnWarp: @ 81E7FE2 .2byte 0 LittlerootTown_EventScript_SetRivalBirchPosForDexUpgrade:: @ 81E7FEC - addobject 8 - addobject 7 + addobject LOCALID_BIRCH + addobject LOCALID_RIVAL checkplayergender compare VAR_RESULT, MALE goto_if_eq LittlerootTown_EventScript_SetRivalBirchPosForDexUpgradeMale @@ -244,13 +249,13 @@ LittlerootTown_EventScript_SetRivalBirchPosForDexUpgrade:: @ 81E7FEC end LittlerootTown_EventScript_SetRivalBirchPosForDexUpgradeMale:: @ 81E8004 - setobjectxy 7, 6, 10 - setobjectxy 8, 5, 10 + setobjectxy LOCALID_RIVAL, 6, 10 + setobjectxy LOCALID_BIRCH, 5, 10 end LittlerootTown_EventScript_SetRivalBirchPosForDexUpgradeFemale:: @ 81E8013 - setobjectxy 7, 13, 10 - setobjectxy 8, 14, 10 + setobjectxy LOCALID_RIVAL, 13, 10 + setobjectxy LOCALID_BIRCH, 14, 10 end LittlerootTown_EventScript_FatMan:: @ 81E8022 @@ -276,7 +281,7 @@ LittlerootTown_EventScript_GoSaveBirch:: @ 81E805D special GetPlayerBigGuyGirlString msgbox LittlerootTown_Text_CanYouGoSeeWhatsHappening, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_TWIN, Common_Movement_FaceOriginalDirection waitmovement 0 setvar VAR_LITTLEROOT_TOWN_STATE, 2 release @@ -295,10 +300,10 @@ LittlerootTown_EventScript_GoodLuck:: @ 81E8087 LittlerootTown_EventScript_NeedPokemonTriggerLeft:: @ 81E8091 lockall - applymovement 1, LittlerootTown_Movement_TwinApproachPlayerLeft + applymovement LOCALID_TWIN, LittlerootTown_Movement_TwinApproachPlayerLeft waitmovement 0 call LittlerootTown_EventScript_DangerousWithoutPokemon - applymovement 1, LittlerootTown_Movement_TwinReturnLeft + applymovement LOCALID_TWIN, LittlerootTown_Movement_TwinReturnLeft waitmovement 0 releaseall end @@ -306,7 +311,7 @@ LittlerootTown_EventScript_NeedPokemonTriggerLeft:: @ 81E8091 LittlerootTown_EventScript_DangerousWithoutPokemon:: @ 81E80AD msgbox LittlerootTown_Text_IfYouGoInGrassPokemonWillJumpOut, MSGBOX_DEFAULT closemessage - applymovement 1, LittlerootTown_Movement_TwinPushPlayerFromRoute + applymovement LOCALID_TWIN, LittlerootTown_Movement_TwinPushPlayerFromRoute applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_Movement_PushPlayerBackFromRoute waitmovement 0 msgbox LittlerootTown_Text_DangerousIfYouDontHavePokemon, MSGBOX_DEFAULT @@ -353,10 +358,10 @@ LittlerootTown_Movement_PushPlayerBackFromRoute: @ 81E80EB LittlerootTown_EventScript_NeedPokemonTriggerRight:: @ 81E80EF lockall - applymovement 1, LittlerootTown_Movement_TwinApproachPlayerRight + applymovement LOCALID_TWIN, LittlerootTown_Movement_TwinApproachPlayerRight waitmovement 0 call LittlerootTown_EventScript_DangerousWithoutPokemon - applymovement 1, LittlerootTown_Movement_TwinReturnRight + applymovement LOCALID_TWIN, LittlerootTown_Movement_TwinReturnRight waitmovement 0 releaseall end @@ -387,14 +392,14 @@ LittlerootTown_Movement_TwinReturnRight: @ 81E8118 LittlerootTown_EventScript_GoSaveBirchTrigger:: @ 81E811F lockall - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_TWIN, Common_Movement_WalkInPlaceFastestRight waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 special GetPlayerBigGuyGirlString msgbox LittlerootTown_Text_CanYouGoSeeWhatsHappening, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_TWIN, Common_Movement_FaceOriginalDirection waitmovement 0 setvar VAR_LITTLEROOT_TOWN_STATE, 2 releaseall @@ -447,14 +452,14 @@ LittlerootTown_EventScript_PlayersHouseSignFemale:: @ 81E81B2 LittlerootTown_EventScript_GiveRunningShoesTrigger0:: @ 81E81BB lockall setvar VAR_0x8008, 0 - setobjectxy 4, 10, 9 + setobjectxy LOCALID_MOM, 10, 9 goto LittlerootTown_EventScript_GiveRunningShoesTrigger end LittlerootTown_EventScript_GiveRunningShoesTrigger1:: @ 81E81CE lockall setvar VAR_0x8008, 1 - setobjectxy 4, 11, 9 + setobjectxy LOCALID_MOM, 11, 9 goto LittlerootTown_EventScript_GiveRunningShoesTrigger end @@ -520,12 +525,12 @@ LittlerootTown_EventScript_SetHomeDoorCoordsFemale:: @ 81E828C return LittlerootTown_EventScript_MomNoticePlayerMale:: @ 81E8297 - applymovement 4, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_MOM, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return LittlerootTown_EventScript_MomNoticePlayerFemale:: @ 81E82A2 - applymovement 4, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_MOM, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return @@ -562,70 +567,70 @@ LittlerootTown_EventScript_MomApproachPlayerFemale:: @ 81E82F0 LittlerootTown_EventScript_MomApproachPlayer0:: @ 81E8333 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayer0 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayer0 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayer1:: @ 81E8348 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayer1 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayer1 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayerMale2:: @ 81E835D applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerMale2 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerMale2 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayerMale3:: @ 81E8372 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerMale3 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerMale3 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayerMale4:: @ 81E8387 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerMale4 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerMale4 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayerMale5:: @ 81E839C applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerMale5 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerMale5 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayerFemale2:: @ 81E83B1 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerFemale2 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerFemale2 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayerFemale3:: @ 81E83C6 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerFemale3 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerFemale3 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayerFemale4:: @ 81E83DB applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerFemale4 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerFemale4 waitmovement 0 return LittlerootTown_EventScript_MomApproachPlayerFemale5:: @ 81E83F0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 - applymovement 4, LittlerootTown_Movement_MomApproachPlayerFemale5 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomApproachPlayerFemale5 waitmovement 0 return @@ -660,107 +665,107 @@ LittlerootTown_EventScript_MomReturnHomeFemale:: @ 81E8448 return LittlerootTown_EventScript_MomReturnHome0:: @ 81E848B - applymovement 4, LittlerootTown_Movement_MomReturnHome0 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHome0 waitmovement 0 return LittlerootTown_EventScript_MomReturnHome1:: @ 81E8496 - applymovement 4, LittlerootTown_Movement_MomReturnHome1 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHome1 waitmovement 0 return LittlerootTown_EventScript_MomReturnHomeMale2:: @ 81E84A1 - applymovement 4, LittlerootTown_Movement_MomReturnHomeMale2 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHomeMale2 waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim return LittlerootTown_EventScript_MomReturnHomeMale3:: @ 81E84C7 - applymovement 4, LittlerootTown_Movement_MomReturnHomeMale3 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHomeMale3 waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim return LittlerootTown_EventScript_MomReturnHomeMale4:: @ 81E84ED - applymovement 4, LittlerootTown_Movement_MomReturnHomeMale4 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHomeMale4 waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim return LittlerootTown_EventScript_MomReturnHomeMale5:: @ 81E8513 - applymovement 4, LittlerootTown_Movement_MomReturnHomeMale5 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHomeMale5 waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim return LittlerootTown_EventScript_MomReturnHomeFemale2:: @ 81E8539 - applymovement 4, LittlerootTown_Movement_MomReturnHomeFemale2 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHomeFemale2 waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim return LittlerootTown_EventScript_MomReturnHomeFemale3:: @ 81E855F - applymovement 4, LittlerootTown_Movement_MomReturnHomeFemale3 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHomeFemale3 waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim return LittlerootTown_EventScript_MomReturnHomeFemale4:: @ 81E8585 - applymovement 4, LittlerootTown_Movement_MomReturnHomeFemale4 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHomeFemale4 waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim return LittlerootTown_EventScript_MomReturnHomeFemale5:: @ 81E85AB - applymovement 4, LittlerootTown_Movement_MomReturnHomeFemale5 + applymovement LOCALID_MOM, LittlerootTown_Movement_MomReturnHomeFemale5 waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim return @@ -924,20 +929,20 @@ LittlerootTown_EventScript_Mom:: @ 81E863D compare VAR_RESULT, FEMALE call_if_eq LittlerootTown_EventScript_SetHomeDoorCoordsFemale call LittlerootTown_EventScript_GiveRunningShoes - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_MOM, Common_Movement_WalkInPlaceFastestUp waitmovement 0 opendoor VAR_0x8009, VAR_0x800A waitdooranim - applymovement 4, LittlerootTown_Movement_MomExitThroughDoor + applymovement LOCALID_MOM, LittlerootTown_Movement_MomExitThroughDoor waitmovement 0 - hideobjectat 4, MAP_LITTLEROOT_TOWN + hideobjectat LOCALID_MOM, MAP_LITTLEROOT_TOWN closedoor VAR_0x8009, VAR_0x800A waitdooranim goto LittlerootTown_EventScript_SetReceivedRunningShoes end LittlerootTown_EventScript_SetReceivedRunningShoes:: @ 81E8686 - removeobject 4 + removeobject LOCALID_MOM setflag FLAG_SYS_B_DASH setvar VAR_LITTLEROOT_TOWN_STATE, 4 release diff --git a/data/maps/LittlerootTown_BrendansHouse_1F/scripts.inc b/data/maps/LittlerootTown_BrendansHouse_1F/scripts.inc index 09b4ce152..65ff3ab98 100644 --- a/data/maps/LittlerootTown_BrendansHouse_1F/scripts.inc +++ b/data/maps/LittlerootTown_BrendansHouse_1F/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_MOM, 1 +.set LOCALID_RIVAL_MOM, 4 +.set LOCALID_RIVAL, 7 + LittlerootTown_BrendansHouse_1F_MapScripts:: @ 81F7755 map_script MAP_SCRIPT_ON_LOAD, LittlerootTown_BrendansHouse_1F_OnLoad map_script MAP_SCRIPT_ON_TRANSITION, LittlerootTown_BrendansHouse_1F_OnTransition @@ -35,18 +39,18 @@ LittlerootTown_BrendansHouse_1F_OnTransition: @ 81F77A4 end LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToStairs:: @ 81F77C6 - setobjectxyperm 1, 8, 4 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_MOM, 8, 4 + setobjectmovementtype LOCALID_MOM, MOVEMENT_TYPE_FACE_UP return LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToTV:: @ 81F77D2 - setobjectxyperm 1, 4, 5 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_MOM, 4, 5 + setobjectmovementtype LOCALID_MOM, MOVEMENT_TYPE_FACE_UP return LittlerootTown_BrendansHouse_1F_EventScript_MoveMomToDoor:: @ 81F77DE - setobjectxyperm 1, 9, 8 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_MOM, 9, 8 + setobjectmovementtype LOCALID_MOM, MOVEMENT_TYPE_FACE_UP return @ Many of the below scripts have no gender check because they assume youre in the correct house @@ -64,7 +68,7 @@ LittlerootTown_BrendansHouse_1F_EventScript_GoUpstairsToSetClock:: @ 81F7814 msgbox PlayersHouse_1F_Text_GoSetTheClock, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_BrendansHouse_1F_Movement_PushTowardStairs - applymovement 1, LittlerootTown_BrendansHouse_1F_Movement_PushTowardStairs + applymovement LOCALID_MOM, LittlerootTown_BrendansHouse_1F_Movement_PushTowardStairs waitmovement 0 warp MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F, 255, 7, 1 waitstate @@ -77,27 +81,27 @@ LittlerootTown_BrendansHouse_1F_Movement_PushTowardStairs: @ 81F783A LittlerootTown_BrendansHouse_1F_EventScript_EnterHouseMovingIn:: @ 81F783C lockall - setvar VAR_0x8004, 1 + setvar VAR_0x8004, LOCALID_MOM setvar VAR_0x8005, MALE goto PlayersHouse_1F_EventScript_EnterHouseMovingIn end LittlerootTown_BrendansHouse_1F_EventScript_PetalburgGymReport:: @ 81F784D lockall - setvar VAR_0x8004, 0 - setvar VAR_0x8005, 1 @ Object event ID for Mom + setvar VAR_0x8004, MALE + setvar VAR_0x8005, LOCALID_MOM goto PlayersHouse_1F_EventScript_PetalburgGymReportMale end LittlerootTown_BrendansHouse_1F_EventScript_YoureNewNeighbor:: @ 81F785E lockall playse SE_PIN - applymovement 4, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL_MOM, Common_Movement_ExclamationMark waitmovement 0 - applymovement 4, Common_Movement_Delay48 + applymovement LOCALID_RIVAL_MOM, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft - applymovement 4, LittlerootTown_BrendansHouse_1F_Movement_RivalMomApproach + applymovement LOCALID_RIVAL_MOM, LittlerootTown_BrendansHouse_1F_Movement_RivalMomApproach waitmovement 0 special GetRivalSonDaughterString msgbox RivalsHouse_1F_Text_OhYoureTheNewNeighbor, MSGBOX_DEFAULT @@ -117,7 +121,7 @@ LittlerootTown_BrendansHouse_1F_Movement_RivalMomApproach: @ 81F789C LittlerootTown_BrendansHouse_1F_EventScript_GoSeeRoom:: @ 81F78A3 lockall - setvar VAR_0x8004, 1 + setvar VAR_0x8004, LOCALID_MOM setvar VAR_0x8005, MALE applymovement VAR_0x8004, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 @@ -145,12 +149,12 @@ LittlerootTown_BrendansHouse_1F_EventScript_MeetRival2:: @ 81F78D6 LittlerootTown_BrendansHouse_1F_EventScript_MeetRival:: @ 81F78E2 playse SE_KAIDAN delay 10 - addobject 7 + addobject LOCALID_RIVAL delay 30 playse SE_PIN - applymovement 7, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 7, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 compare VAR_0x8008, 1 call_if_ne LittlerootTown_BrendansHouse_1F_EventScript_PlayerFaceBrendan @@ -170,7 +174,7 @@ LittlerootTown_BrendansHouse_1F_EventScript_MeetRival:: @ 81F78E2 compare VAR_0x8008, 2 call_if_eq LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs2 playse SE_KAIDAN - removeobject 7 + removeobject LOCALID_RIVAL setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_BRENDAN setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F_POKE_BALL clearflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_BEDROOM @@ -188,17 +192,17 @@ LittlerootTown_BrendansHouse_1F_EventScript_PlayerFaceBrendan:: @ 81F7981 return LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer0:: @ 81F798C - applymovement 7, LittlerootTown_BrendansHouse_1F_Movement_BrendanApproachPlayer0 + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_1F_Movement_BrendanApproachPlayer0 waitmovement 0 return LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer1:: @ 81F7997 - applymovement 7, LittlerootTown_BrendansHouse_1F_Movement_BrendanApproachPlayer1 + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_1F_Movement_BrendanApproachPlayer1 waitmovement 0 return LittlerootTown_BrendansHouse_1F_EventScript_BrendanApproachPlayer2:: @ 81F79A2 - applymovement 7, LittlerootTown_BrendansHouse_1F_Movement_BrendanApproachPlayer2 + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_1F_Movement_BrendanApproachPlayer2 waitmovement 0 return @@ -230,19 +234,19 @@ LittlerootTown_BrendansHouse_1F_Movement_BrendanApproachPlayer2: @ 81F79B9 LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs0:: @ 81F79C1 applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_BrendansHouse_1F_Movement_PlayerWatchBrendanExit0 - applymovement 7, LittlerootTown_BrendansHouse_1F_Movement_BrendanGoUpstairs0 + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_1F_Movement_BrendanGoUpstairs0 waitmovement 0 return LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs1:: @ 81F79D3 applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_BrendansHouse_1F_Movement_PlayerWatchBrendanExit1 - applymovement 7, LittlerootTown_BrendansHouse_1F_Movement_BrendanGoUpstairs1 + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_1F_Movement_BrendanGoUpstairs1 waitmovement 0 return LittlerootTown_BrendansHouse_1F_EventScript_BrendanGoUpstairs2:: @ 81F79E5 applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_BrendansHouse_1F_Movement_PlayerWatchBrendanExit2 - applymovement 7, LittlerootTown_BrendansHouse_1F_Movement_BrendanGoUpstairs2 + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_1F_Movement_BrendanGoUpstairs2 waitmovement 0 return diff --git a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc index 4f673a7be..7af4580c3 100644 --- a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc +++ b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_RIVAL, 1 + LittlerootTown_BrendansHouse_2F_MapScripts:: @ 81F83E3 map_script MAP_SCRIPT_ON_TRANSITION, LittlerootTown_BrendansHouse_2F_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, LittlerootTown_BrendansHouse_2F_OnWarp @@ -26,8 +28,8 @@ LittlerootTown_BrendansHouse_2F_EventScript_TryUpdateBrendanPos:: @ 81F8433 goto_if_eq LittlerootTown_BrendansHouse_2F_EventScript_Ret compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2 goto_if_ge LittlerootTown_MaysHouse_2F_EventScript_Ret @ Odd that the MaysHouse equivalent was used here instead - setobjectxyperm 1, 0, 2 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_RIVAL, 0, 2 + setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_FACE_UP return LittlerootTown_BrendansHouse_2F_EventScript_Ret:: @ 81F8456 @@ -63,13 +65,13 @@ LittlerootTown_BrendansHouse_2F_EventScript_RivalsPokeBall:: @ 81F8481 LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendan:: @ 81F8497 delay 10 - addobject 1 - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanEnters + addobject LOCALID_RIVAL + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanEnters waitmovement 0 playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 delay 10 playbgm MUS_BOY_SUP, 1 @@ -91,49 +93,49 @@ LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendan:: @ 81F8497 end LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanNorth:: @ 81F8507 - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanApproachPlayerNorth + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanApproachPlayerNorth waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox RivalsHouse_2F_Text_BrendanWhoAreYou, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_BrendansHouse_2F_Movement_PlayerWatchBrendanNorth - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanWalkToPCNorth + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanWalkToPCNorth waitmovement 0 return LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanSouth:: @ 81F8536 - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanApproachPlayerSouth + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanApproachPlayerSouth waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox RivalsHouse_2F_Text_BrendanWhoAreYou, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_BrendansHouse_2F_Movement_PlayerWatchBrendanSouth - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanWalkToPCSouth + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanWalkToPCSouth waitmovement 0 return LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanWest:: @ 81F8565 - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanApproachPlayerWest + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanApproachPlayerWest waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox RivalsHouse_2F_Text_BrendanWhoAreYou, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_BrendansHouse_2F_Movement_PlayerWatchBrendanWest - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanWalkToPCWest + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanWalkToPCWest waitmovement 0 return LittlerootTown_BrendansHouse_2F_EventScript_MeetBrendanEast:: @ 81F8594 - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanApproachPlayerEast + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanApproachPlayerEast waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox RivalsHouse_2F_Text_BrendanWhoAreYou, MSGBOX_DEFAULT closemessage - applymovement 1, LittlerootTown_BrendansHouse_2F_Movement_BrendanWalkToPCEast + applymovement LOCALID_RIVAL, LittlerootTown_BrendansHouse_2F_Movement_BrendanWalkToPCEast waitmovement 0 return diff --git a/data/maps/LittlerootTown_MaysHouse_1F/scripts.inc b/data/maps/LittlerootTown_MaysHouse_1F/scripts.inc index 2a4b653d3..958951dc9 100644 --- a/data/maps/LittlerootTown_MaysHouse_1F/scripts.inc +++ b/data/maps/LittlerootTown_MaysHouse_1F/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_MOM, 1 +.set LOCALID_RIVAL_MOM, 4 +.set LOCALID_RIVAL, 7 + LittlerootTown_MaysHouse_1F_MapScripts:: @ 81F88A5 map_script MAP_SCRIPT_ON_LOAD, LittlerootTown_MaysHouse_1F_OnLoad map_script MAP_SCRIPT_ON_TRANSITION, LittlerootTown_MaysHouse_1F_OnTransition @@ -35,18 +39,18 @@ LittlerootTown_MaysHouse_1F_OnTransition: @ 81F88F4 end LittlerootTown_MaysHouse_1F_EventScript_MoveMomToStairs:: @ 81F8916 - setobjectxyperm 1, 2, 4 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_MOM, 2, 4 + setobjectmovementtype LOCALID_MOM, MOVEMENT_TYPE_FACE_UP return LittlerootTown_MaysHouse_1F_EventScript_MoveMomToTV:: @ 81F8922 - setobjectxyperm 1, 6, 5 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_MOM, 6, 5 + setobjectmovementtype LOCALID_MOM, MOVEMENT_TYPE_FACE_UP return LittlerootTown_MaysHouse_1F_EventScript_MoveMomToDoor:: @ 81F892E - setobjectxyperm 1, 1, 8 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_MOM, 1, 8 + setobjectmovementtype LOCALID_MOM, MOVEMENT_TYPE_FACE_UP return @ Many of the below scripts have no gender check because they assume youre in the correct house @@ -63,7 +67,7 @@ LittlerootTown_MaysHouse_1F_EventScript_GoUpstairsToSetClock:: @ 81F8964 msgbox PlayersHouse_1F_Text_GoSetTheClock, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_MaysHouse_1F_Movement_PushTowardStairs - applymovement 1, LittlerootTown_MaysHouse_1F_Movement_PushTowardStairs + applymovement LOCALID_MOM, LittlerootTown_MaysHouse_1F_Movement_PushTowardStairs waitmovement 0 warp MAP_LITTLEROOT_TOWN_MAYS_HOUSE_2F, 255, 1, 1 waitstate @@ -76,27 +80,27 @@ LittlerootTown_MaysHouse_1F_Movement_PushTowardStairs: @ 81F898A LittlerootTown_MaysHouse_1F_EventScript_EnterHouseMovingIn:: @ 81F898C lockall - setvar VAR_0x8004, 1 + setvar VAR_0x8004, LOCALID_MOM setvar VAR_0x8005, FEMALE goto PlayersHouse_1F_EventScript_EnterHouseMovingIn end LittlerootTown_MaysHouse_1F_EventScript_PetalburgGymReport:: @ 81F899D lockall - setvar VAR_0x8004, 1 - setvar VAR_0x8005, 1 + setvar VAR_0x8004, FEMALE + setvar VAR_0x8005, LOCALID_MOM goto PlayersHouse_1F_EventScript_PetalburgGymReportFemale end LittlerootTown_MaysHouse_1F_EventScript_YoureNewNeighbor:: @ 81F89AE lockall playse SE_PIN - applymovement 4, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL_MOM, Common_Movement_ExclamationMark waitmovement 0 - applymovement 4, Common_Movement_Delay48 + applymovement LOCALID_RIVAL_MOM, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight - applymovement 4, LittlerootTown_MaysHouse_1F_Movement_RivalMomApproach + applymovement LOCALID_RIVAL_MOM, LittlerootTown_MaysHouse_1F_Movement_RivalMomApproach waitmovement 0 special GetRivalSonDaughterString msgbox RivalsHouse_1F_Text_OhYoureTheNewNeighbor, MSGBOX_DEFAULT @@ -151,7 +155,7 @@ RivalsHouse_1F_EventScript_RivalSibling:: @ 81F8A3D LittlerootTown_MaysHouse_1F_EventScript_GoSeeRoom:: @ 81F8A4C lockall - setvar VAR_0x8004, 1 + setvar VAR_0x8004, LOCALID_MOM setvar VAR_0x8005, FEMALE applymovement VAR_0x8004, Common_Movement_WalkInPlaceFastestRight waitmovement 0 @@ -179,12 +183,12 @@ LittlerootTown_MaysHouse_1F_EventScript_MeetRival2:: @ 81F8A7F LittlerootTown_MaysHouse_1F_EventScript_MeetRival:: @ 81F8A8B playse SE_KAIDAN delay 10 - addobject 7 + addobject LOCALID_RIVAL delay 30 playse SE_PIN - applymovement 7, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 7, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 compare VAR_0x8008, 1 call_if_ne LittlerootTown_MaysHouse_1F_EventScript_PlayerFaceMay @@ -204,7 +208,7 @@ LittlerootTown_MaysHouse_1F_EventScript_MeetRival:: @ 81F8A8B compare VAR_0x8008, 2 call_if_eq LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs2 playse SE_KAIDAN - removeobject 7 + removeobject LOCALID_RIVAL setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_MAY setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_POKE_BALL clearflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_BEDROOM @@ -222,17 +226,17 @@ LittlerootTown_MaysHouse_1F_EventScript_PlayerFaceMay:: @ 81F8B2A return LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer0:: @ 81F8B35 - applymovement 7, LittlerootTown_MaysHouse_1F_Movement_MayApproachPlayer0 + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_1F_Movement_MayApproachPlayer0 waitmovement 0 return LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer1:: @ 81F8B40 - applymovement 7, LittlerootTown_MaysHouse_1F_Movement_MayApproachPlayer1 + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_1F_Movement_MayApproachPlayer1 waitmovement 0 return LittlerootTown_MaysHouse_1F_EventScript_MayApproachPlayer2:: @ 81F8B4B - applymovement 7, LittlerootTown_MaysHouse_1F_Movement_MayApproachPlayer2 + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_1F_Movement_MayApproachPlayer2 waitmovement 0 return @@ -264,19 +268,19 @@ LittlerootTown_MaysHouse_1F_Movement_MayApproachPlayer2: @ 81F8B62 LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs0:: @ 81F8B6A applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_MaysHouse_1F_Movement_PlayerWatchMayExit0 - applymovement 7, LittlerootTown_MaysHouse_1F_Movement_MayGoUpstairs0 + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_1F_Movement_MayGoUpstairs0 waitmovement 0 return LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs1:: @ 81F8B7C applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_MaysHouse_1F_Movement_PlayerWatchMayExit1 - applymovement 7, LittlerootTown_MaysHouse_1F_Movement_MayGoUpstairs1 + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_1F_Movement_MayGoUpstairs1 waitmovement 0 return LittlerootTown_MaysHouse_1F_EventScript_MayGoUpstairs2:: @ 81F8B8E applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_MaysHouse_1F_Movement_PlayerWatchMayExit2 - applymovement 7, LittlerootTown_MaysHouse_1F_Movement_MayGoUpstairs2 + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_1F_Movement_MayGoUpstairs2 waitmovement 0 return diff --git a/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc b/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc index d40740835..7c943e0e2 100644 --- a/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc +++ b/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_RIVAL, 1 + LittlerootTown_MaysHouse_2F_MapScripts:: @ 81F9296 map_script MAP_SCRIPT_ON_TRANSITION, LittlerootTown_MaysHouse_2F_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, LittlerootTown_MaysHouse_2F_OnWarp @@ -26,8 +28,8 @@ LittlerootTown_MaysHouse_2F_EventScript_TryUpdateMayPos:: @ 81F92E6 goto_if_eq LittlerootTown_MaysHouse_2F_EventScript_Ret compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2 goto_if_ge LittlerootTown_MaysHouse_2F_EventScript_Ret - setobjectxyperm 1, 8, 2 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_RIVAL, 8, 2 + setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_FACE_UP return LittlerootTown_MaysHouse_2F_EventScript_Ret:: @ 81F9309 @@ -63,13 +65,13 @@ LittlerootTown_MaysHouse_2F_EventScript_RivalsPokeBall:: @ 81F9334 LittlerootTown_MaysHouse_2F_EventScript_MeetMay:: @ 81F934A delay 10 - addobject 1 - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayEnters + addobject LOCALID_RIVAL + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayEnters waitmovement 0 playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 delay 10 playbgm MUS_GIRL_SUP, 1 @@ -91,49 +93,49 @@ LittlerootTown_MaysHouse_2F_EventScript_MeetMay:: @ 81F934A end LittlerootTown_MaysHouse_2F_EventScript_MeetMayNorth:: @ 81F93BA - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayApproachPlayerNorth + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayApproachPlayerNorth waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox RivalsHouse_2F_Text_MayWhoAreYou, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_MaysHouse_2F_Movement_PlayerWatchMayNorth - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayWalkToPCNorth + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayWalkToPCNorth waitmovement 0 return LittlerootTown_MaysHouse_2F_EventScript_MeetMaySouth:: @ 81F93E9 - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayApproachPlayerSouth + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayApproachPlayerSouth waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox RivalsHouse_2F_Text_MayWhoAreYou, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_MaysHouse_2F_Movement_PlayerWatchMaySouth - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayWalkToPCSouth + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayWalkToPCSouth waitmovement 0 return LittlerootTown_MaysHouse_2F_EventScript_MeetMayWest:: @ 81F9418 - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayApproachPlayerWest + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayApproachPlayerWest waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox RivalsHouse_2F_Text_MayWhoAreYou, MSGBOX_DEFAULT closemessage - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayWalkToPCWest + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayWalkToPCWest waitmovement 0 return LittlerootTown_MaysHouse_2F_EventScript_MeetMayEast:: @ 81F9440 - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayApproachPlayerEast + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayApproachPlayerEast waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox RivalsHouse_2F_Text_MayWhoAreYou, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, LittlerootTown_MaysHouse_2F_Movement_PlayerWatchMayEast - applymovement 1, LittlerootTown_MaysHouse_2F_Movement_MayWalkToPCEast + applymovement LOCALID_RIVAL, LittlerootTown_MaysHouse_2F_Movement_MayWalkToPCEast waitmovement 0 return diff --git a/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc b/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc index b9ce0c809..7886bda18 100644 --- a/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc +++ b/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_AIDE, 1 +.set LOCALID_BIRCH, 2 +.set LOCALID_RIVAL, 3 +.set LOCALID_BALL_CYNDAQUIL, 4 +.set LOCALID_BALL_TOTODILE, 5 +.set LOCALID_BALL_CHIKORITA, 6 + LittlerootTown_ProfessorBirchsLab_MapScripts:: @ 81F9C91 map_script MAP_SCRIPT_ON_TRANSITION, LittlerootTown_ProfessorBirchsLab_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, LittlerootTown_ProfessorBirchsLab_OnWarp @@ -34,8 +41,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_CheckReadyForJohtoStarter:: @ 81F9 specialvar VAR_RESULT, HasAllHoennMons compare VAR_RESULT, TRUE goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_SetReadyForJohtoStarter - setobjectmovementtype 3, MOVEMENT_TYPE_WANDER_UP_AND_DOWN - setobjectxyperm 3, 5, 10 + setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_WANDER_UP_AND_DOWN + setobjectxyperm LOCALID_RIVAL, 5, 10 end LittlerootTown_ProfessorBirchsLab_EventScript_SetReadyForJohtoStarter:: @ 81F9CE9 @@ -48,8 +55,8 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SetJohtoStarterLayout:: @ 81F9CF3 LittlerootTown_ProfessorBirchsLab_EventScript_SetAfterJohtoStarterLayout:: @ 81F9CF7 setmaplayoutindex LAYOUT_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB_WITH_TABLE - setobjectmovementtype 3, MOVEMENT_TYPE_WANDER_UP_AND_DOWN - setobjectxyperm 3, 5, 10 + setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_WANDER_UP_AND_DOWN + setobjectxyperm LOCALID_RIVAL, 5, 10 end LittlerootTown_ProfessorBirchsLab_OnWarp: @ 81F9D06 @@ -68,35 +75,35 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SetPlayerPosForReceiveStarter:: @ LittlerootTown_ProfessorBirchsLab_EventScript_SetObjectPosForDexUpgrade:: @ 81F9D45 turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH - addobject 2 - addobject 3 - turnobject 3, DIR_NORTH - setobjectxy 3, 5, 5 - turnobject 2, DIR_SOUTH - setobjectxy 2, 6, 4 - turnobject 1, DIR_EAST - setobjectxy 1, 10, 10 + addobject LOCALID_BIRCH + addobject LOCALID_RIVAL + turnobject LOCALID_RIVAL, DIR_NORTH + setobjectxy LOCALID_RIVAL, 5, 5 + turnobject LOCALID_BIRCH, DIR_SOUTH + setobjectxy LOCALID_BIRCH, 6, 4 + turnobject LOCALID_AIDE, DIR_EAST + setobjectxy LOCALID_AIDE, 10, 10 end LittlerootTown_ProfessorBirchsLab_EventScript_AddRivalObject:: @ 81F9D71 - addobject 3 + addobject LOCALID_RIVAL end LittlerootTown_ProfessorBirchsLab_EventScript_SetObjectPosForJohtoStarters:: @ 81F9D75 - addobject 4 - addobject 5 - addobject 6 - addobject 3 - turnobject 4, DIR_SOUTH - setobjectxy 4, 8, 4 - turnobject 5, DIR_SOUTH - setobjectxy 5, 9, 4 - turnobject 6, DIR_SOUTH - setobjectxy 6, 10, 4 - turnobject 2, DIR_SOUTH - setobjectxy 2, 6, 4 - turnobject 3, DIR_EAST - setobjectxy 3, 5, 5 + addobject LOCALID_BALL_CYNDAQUIL + addobject LOCALID_BALL_TOTODILE + addobject LOCALID_BALL_CHIKORITA + addobject LOCALID_RIVAL + turnobject LOCALID_BALL_CYNDAQUIL, DIR_SOUTH + setobjectxy LOCALID_BALL_CYNDAQUIL, 8, 4 + turnobject LOCALID_BALL_TOTODILE, DIR_SOUTH + setobjectxy LOCALID_BALL_TOTODILE, 9, 4 + turnobject LOCALID_BALL_CHIKORITA, DIR_SOUTH + setobjectxy LOCALID_BALL_CHIKORITA, 10, 4 + turnobject LOCALID_BIRCH, DIR_SOUTH + setobjectxy LOCALID_BIRCH, 6, 4 + turnobject LOCALID_RIVAL, DIR_EAST + setobjectxy LOCALID_RIVAL, 5, 5 end LittlerootTown_ProfessorBirchsLab_OnFrame: @ 81F9DB9 @@ -173,7 +180,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_UpgradeToNationalDex:: @ 81F9E80 delay 30 msgbox LittlerootTown_ProfessorBirchsLab_Text_OtherRegionsUpgradeToNational, MSGBOX_DEFAULT closemessage - applymovement 2, LittlerootTown_ProfessorBirchsLab_Movement_BirchRetrievePokedexes + applymovement LOCALID_BIRCH, LittlerootTown_ProfessorBirchsLab_Movement_BirchRetrievePokedexes waitmovement 0 delay 20 playse SE_TK_KASYA @@ -184,7 +191,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_UpgradeToNationalDex:: @ 81F9E80 delay 10 playse SE_TK_KASYA delay 20 - applymovement 3, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestRight applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 checkplayergender @@ -195,9 +202,9 @@ LittlerootTown_ProfessorBirchsLab_EventScript_UpgradeToNationalDex:: @ 81F9E80 playse SE_PC_ON waitse delay 20 - applymovement 2, LittlerootTown_ProfessorBirchsLab_Movement_BirchReturnPokedex + applymovement LOCALID_BIRCH, LittlerootTown_ProfessorBirchsLab_Movement_BirchReturnPokedex waitmovement 0 - applymovement 3, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestUp applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox LittlerootTown_ProfessorBirchsLab_Text_OkayAllDone, MSGBOX_DEFAULT @@ -303,7 +310,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_Cyndaquil:: @ 81F9FBB release compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter - applymovement 2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFastestRight waitmovement 0 showmonpic SPECIES_CYNDAQUIL, 10, 3 msgbox LittlerootTown_ProfessorBirchsLab_Text_YoullTakeCyndaquil, MSGBOX_YESNO @@ -316,7 +323,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_Totodile:: @ 81F9FEF release compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter - applymovement 2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFastestRight waitmovement 0 showmonpic SPECIES_TOTODILE, 10, 3 msgbox LittlerootTown_ProfessorBirchsLab_Text_YoullTakeTotodile, MSGBOX_YESNO @@ -329,7 +336,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_Chikorita:: @ 81FA023 release compare VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 6 goto_if_ge LittlerootTown_ProfessorBirchsLab_EventScript_AlreadyChoseJohtoStarter - applymovement 2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFastestRight waitmovement 0 showmonpic SPECIES_CHIKORITA, 10, 3 msgbox LittlerootTown_ProfessorBirchsLab_Text_YoullTakeChikorita, MSGBOX_YESNO @@ -363,7 +370,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_GiveCyndaquil:: @ 81FA06C LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToParty:: @ 81FA0A1 call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter - removeobject 4 + removeobject LOCALID_BALL_CYNDAQUIL msgbox gText_NicknameThisPokemon, MSGBOX_YESNO compare VAR_RESULT, NO goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedCyndaquil @@ -374,7 +381,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToParty:: @ 81FA0A1 LittlerootTown_ProfessorBirchsLab_EventScript_SendCyndaquilToPC:: @ 81FA0CC call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter - removeobject 4 + removeobject LOCALID_BALL_CYNDAQUIL msgbox gText_NicknameThisPokemon, MSGBOX_YESNO compare VAR_RESULT, NO goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_CyndaquilTransferredToPC @@ -408,7 +415,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_GiveTotodile:: @ 81FA10D LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToParty:: @ 81FA142 call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter - removeobject 5 + removeobject LOCALID_BALL_TOTODILE msgbox gText_NicknameThisPokemon, MSGBOX_YESNO compare VAR_RESULT, NO goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedTotodile @@ -419,7 +426,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToParty:: @ 81FA142 LittlerootTown_ProfessorBirchsLab_EventScript_SendTotodileToPC:: @ 81FA16D call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter - removeobject 5 + removeobject LOCALID_BALL_TOTODILE msgbox gText_NicknameThisPokemon, MSGBOX_YESNO compare VAR_RESULT, NO goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_TotodileTransferredToPC @@ -453,7 +460,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_GiveChikorita:: @ 81FA1AE LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToParty:: @ 81FA1E3 call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter - removeobject 6 + removeobject LOCALID_BALL_CHIKORITA msgbox gText_NicknameThisPokemon, MSGBOX_YESNO compare VAR_RESULT, NO goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedChikorita @@ -464,7 +471,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToParty:: @ 81FA1E3 LittlerootTown_ProfessorBirchsLab_EventScript_SendChikoritaToPC:: @ 81FA20E call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivedJohtoStarter - removeobject 6 + removeobject LOCALID_BALL_CHIKORITA msgbox gText_NicknameThisPokemon, MSGBOX_YESNO compare VAR_RESULT, NO goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_ChikoritaTransferredToPC @@ -544,7 +551,7 @@ LittlerootTown_ProfessorBirchsLab_EventScript_GivePokedex:: @ 81FA2F8 call LittlerootTown_ProfessorBirchsLab_EventScript_ReceivePokedex msgbox LittlerootTown_ProfessorBirchsLab_Text_ExplainPokedex, MSGBOX_DEFAULT closemessage - applymovement 3, LittlerootTown_ProfessorBirchsLab_Movement_RivalApproachPlayer + applymovement LOCALID_RIVAL, LittlerootTown_ProfessorBirchsLab_Movement_RivalApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 diff --git a/data/maps/MagmaHideout_4F/scripts.inc b/data/maps/MagmaHideout_4F/scripts.inc index 5acc683a4..ffca9c75f 100644 --- a/data/maps/MagmaHideout_4F/scripts.inc +++ b/data/maps/MagmaHideout_4F/scripts.inc @@ -1,3 +1,11 @@ +.set LOCALID_GROUDON, 1 +.set LOCALID_GRUNT_1, 2 +.set LOCALID_GRUNT_2, 3 +.set LOCALID_GRUNT_3, 4 +.set LOCALID_TABITHA, 5 +.set LOCALID_MAXIE, 6 +.set LOCALID_GROUDON_SLEEPING, 7 + MagmaHideout_4F_MapScripts:: @ 823A55F .byte 0 @@ -18,11 +26,11 @@ MagmaHideout_4F_EventScript_Maxie:: @ 823A560 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 delay 150 - removeobject 7 @ sleeping Groudon - addobject 1 @ awakened Groudon + removeobject LOCALID_GROUDON_SLEEPING + addobject LOCALID_GROUDON waitstate delay 60 - applymovement 1, MagmaHideout_4F_Movement_GroudonApproach + applymovement LOCALID_GROUDON, MagmaHideout_4F_Movement_GroudonApproach waitmovement 0 special FadeOutOrbEffect waitstate @@ -32,9 +40,9 @@ MagmaHideout_4F_EventScript_Maxie:: @ 823A560 setvar VAR_0x8007, 5 @ shake delay special ShakeCamera waitstate - applymovement 1, MagmaHideout_4F_Movement_GroudonExit + applymovement LOCALID_GROUDON, MagmaHideout_4F_Movement_GroudonExit waitmovement 0 - removeobject 1 + removeobject LOCALID_GROUDON delay 4 setvar VAR_0x8004, 2 @ vertical pan setvar VAR_0x8005, 2 @ horizontal pan @@ -43,14 +51,14 @@ MagmaHideout_4F_EventScript_Maxie:: @ 823A560 special ShakeCamera waitstate delay 30 - applymovement 6, MagmaHideout_4F_Movement_MaxieLookAround + applymovement LOCALID_MAXIE, MagmaHideout_4F_Movement_MaxieLookAround waitmovement 0 msgbox MagmaHideout_4F_Text_MaxieGroudonWhatsWrong, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 30 - applymovement 6, Common_Movement_FacePlayer + applymovement LOCALID_MAXIE, Common_Movement_FacePlayer waitmovement 0 msgbox MagmaHideout_4F_Text_MaxieOhItWasYou, MSGBOX_DEFAULT closemessage @@ -63,11 +71,11 @@ MagmaHideout_4F_EventScript_Maxie:: @ 823A560 setflag FLAG_GROUDON_AWAKENED_MAGMA_HIDEOUT setvar VAR_SLATEPORT_HARBOR_STATE, 1 fadescreen FADE_TO_BLACK - removeobject 6 - removeobject 2 - removeobject 3 - removeobject 4 - removeobject 5 + removeobject LOCALID_MAXIE + removeobject LOCALID_GRUNT_1 + removeobject LOCALID_GRUNT_2 + removeobject LOCALID_GRUNT_3 + removeobject LOCALID_TABITHA setflag FLAG_HIDE_MAGMA_HIDEOUT_GRUNTS fadescreen FADE_FROM_BLACK releaseall diff --git a/data/maps/MarineCave_End/scripts.inc b/data/maps/MarineCave_End/scripts.inc index 6eaeb4b51..a6d894793 100644 --- a/data/maps/MarineCave_End/scripts.inc +++ b/data/maps/MarineCave_End/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_KYOGRE, 1 + MarineCave_End_MapScripts:: @ 823AFDF map_script MAP_SCRIPT_ON_RESUME, MarineCave_End_OnResume map_script MAP_SCRIPT_ON_TRANSITION, MarineCave_End_OnTransition @@ -11,7 +13,7 @@ MarineCave_End_EventScript_TryRemoveKyogre:: @ 823AFF4 specialvar VAR_RESULT, GetBattleOutcome compare VAR_RESULT, B_OUTCOME_CAUGHT goto_if_ne Common_EventScript_NopReturn - removeobject 1 + removeobject LOCALID_KYOGRE return MarineCave_End_OnTransition: @ 823B008 @@ -27,13 +29,13 @@ MarineCave_End_EventScript_Kyogre:: @ 823B01B lockall applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceUp waitmovement 0 - applymovement 1, MarineCave_End_Movement_KyogreApproach + applymovement LOCALID_KYOGRE, MarineCave_End_Movement_KyogreApproach waitmovement 0 waitse playmoncry SPECIES_KYOGRE, 2 delay 40 waitmoncry - setvar VAR_LAST_TALKED, 1 + setvar VAR_LAST_TALKED, LOCALID_KYOGRE setwildbattle SPECIES_KYOGRE, 70, ITEM_NONE setflag FLAG_SYS_CTRL_OBJ_DELETE special BattleSetup_StartLegendaryBattle diff --git a/data/maps/MauvilleCity/scripts.inc b/data/maps/MauvilleCity/scripts.inc index 4994b8775..701c36159 100644 --- a/data/maps/MauvilleCity/scripts.inc +++ b/data/maps/MauvilleCity/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_WALLY, 6 +.set LOCALID_WALLYS_UNCLE, 7 +.set LOCALID_SCOTT, 11 + MauvilleCity_MapScripts:: @ 81DF385 map_script MAP_SCRIPT_ON_TRANSITION, MauvilleCity_OnTransition .byte 0 @@ -70,7 +74,7 @@ MauvilleCity_EventScript_WallysUncle:: @ 81DF41D goto_if_set FLAG_DECLINED_WALLY_BATTLE_MAUVILLE, MauvilleCity_EventScript_UncleAskPlayerToBattleWally msgbox MauvilleCity_Text_UncleHesTooPeppy, MSGBOX_DEFAULT closemessage - applymovement 7, Common_Movement_FaceOriginalDirection + applymovement LOCALID_WALLYS_UNCLE, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -78,7 +82,7 @@ MauvilleCity_EventScript_WallysUncle:: @ 81DF41D MauvilleCity_EventScript_UncleAskPlayerToBattleWally:: @ 81DF43D msgbox MauvilleCity_Text_UncleCanYouBattleWally, MSGBOX_DEFAULT closemessage - applymovement 7, Common_Movement_FaceOriginalDirection + applymovement LOCALID_WALLYS_UNCLE, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -86,17 +90,17 @@ MauvilleCity_EventScript_UncleAskPlayerToBattleWally:: @ 81DF43D MauvilleCity_EventScript_Wally:: @ 81DF452 lockall goto_if_set FLAG_DECLINED_WALLY_BATTLE_MAUVILLE, MauvilleCity_EventScript_WallyRequestBattleAgain - applymovement 6, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLY, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox MauvilleCity_Text_WallyWantToChallengeGym, MSGBOX_DEFAULT msgbox MauvilleCity_Text_UncleYourePushingIt, MSGBOX_DEFAULT msgbox MauvilleCity_Text_WallyWeCanBeatAnyone, MSGBOX_DEFAULT - applymovement 6, Common_Movement_FacePlayer + applymovement LOCALID_WALLY, Common_Movement_FacePlayer waitmovement 0 playse SE_PIN - applymovement 6, Common_Movement_ExclamationMark + applymovement LOCALID_WALLY, Common_Movement_ExclamationMark waitmovement 0 - applymovement 6, Common_Movement_Delay48 + applymovement LOCALID_WALLY, Common_Movement_Delay48 waitmovement 0 msgbox MauvilleCity_Text_WallyWillYouBattleMe, MSGBOX_YESNO goto MauvilleCity_EventScript_BattleWallyPrompt @@ -115,46 +119,46 @@ MauvilleCity_EventScript_BattleWallyPrompt:: @ 81DF4AD MauvilleCity_EventScript_WallyAndUncleExitNorth:: @ 81DF4E0 applymovement OBJ_EVENT_ID_PLAYER, MauvilleCity_Movement_PlayerWatchWallyExitNorth1 - applymovement 6, MauvilleCity_Movement_WallyExitNorth1 - applymovement 7, MauvilleCity_Movement_WallysUncleExitNorth1 + applymovement LOCALID_WALLY, MauvilleCity_Movement_WallyExitNorth1 + applymovement LOCALID_WALLYS_UNCLE, MauvilleCity_Movement_WallysUncleExitNorth1 waitmovement 0 - applymovement 6, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLY, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 30 applymovement OBJ_EVENT_ID_PLAYER, MauvilleCity_Movement_PlayerFaceUncleNorth - applymovement 7, MauvilleCity_Movement_WallysUncleApproachPlayerNorth + applymovement LOCALID_WALLYS_UNCLE, MauvilleCity_Movement_WallysUncleApproachPlayerNorth waitmovement 0 msgbox MauvilleCity_Text_UncleVisitUsSometime, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, MauvilleCity_Movement_PlayerWatchWallyExitNorth2 - applymovement 7, MauvilleCity_Movement_WallysUncleExitNorth2 - applymovement 6, MauvilleCity_Movement_WallyExitNorth2 + applymovement LOCALID_WALLYS_UNCLE, MauvilleCity_Movement_WallysUncleExitNorth2 + applymovement LOCALID_WALLY, MauvilleCity_Movement_WallyExitNorth2 waitmovement 0 goto MauvilleCity_EventScript_DefeatedWally end MauvilleCity_EventScript_WallyAndUncleExitEast:: @ 81DF53D applymovement OBJ_EVENT_ID_PLAYER, MauvilleCity_Movement_PlayerWatchWallyExitEast1 - applymovement 6, MauvilleCity_Movement_WallyExitEast1 - applymovement 7, MauvilleCity_Movement_WallysUncleExitEast1 + applymovement LOCALID_WALLY, MauvilleCity_Movement_WallyExitEast1 + applymovement LOCALID_WALLYS_UNCLE, MauvilleCity_Movement_WallysUncleExitEast1 waitmovement 0 - applymovement 6, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLY, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 30 - applymovement 7, MauvilleCity_Movement_WallysUncleApproachPlayerEast + applymovement LOCALID_WALLYS_UNCLE, MauvilleCity_Movement_WallysUncleApproachPlayerEast waitmovement 0 msgbox MauvilleCity_Text_UncleVisitUsSometime, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, MauvilleCity_Movement_PlayerWatchWallyExitEast2 - applymovement 7, MauvilleCity_Movement_WallysUncleExitEast2 - applymovement 6, MauvilleCity_Movement_WallyExitEast2 + applymovement LOCALID_WALLYS_UNCLE, MauvilleCity_Movement_WallysUncleExitEast2 + applymovement LOCALID_WALLY, MauvilleCity_Movement_WallyExitEast2 waitmovement 0 goto MauvilleCity_EventScript_DefeatedWally end MauvilleCity_EventScript_DefeatedWally:: @ 81DF593 - removeobject 6 - removeobject 7 + removeobject LOCALID_WALLY + removeobject LOCALID_WALLYS_UNCLE clearflag FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WALLY clearflag FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WALLYS_UNCLE setflag FLAG_DEFEATED_WALLY_MAUVILLE @@ -173,45 +177,45 @@ MauvilleCity_EventScript_DefeatedWally:: @ 81DF593 call_if_eq MauvilleCity_EventScript_ScottExitNorth compare VAR_FACING, DIR_EAST call_if_eq MauvilleCity_EventScript_ScottExitEast - removeobject 11 + removeobject LOCALID_SCOTT releaseall end MauvilleCity_EventScript_ScottApproachPlayerNorth:: @ 81DF5F3 - addobject 11 - applymovement 11, MauvilleCity_Movement_ScottApproachPlayerNorth + addobject LOCALID_SCOTT + applymovement LOCALID_SCOTT, MauvilleCity_Movement_ScottApproachPlayerNorth waitmovement 0 return MauvilleCity_EventScript_ScottApproachPlayerEast:: @ 81DF601 - setobjectxyperm 11, 12, 13 - addobject 11 - applymovement 11, MauvilleCity_Movement_ScottApproachPlayerEast + setobjectxyperm LOCALID_SCOTT, 12, 13 + addobject LOCALID_SCOTT + applymovement LOCALID_SCOTT, MauvilleCity_Movement_ScottApproachPlayerEast waitmovement 0 return MauvilleCity_EventScript_ScottExitNorth:: @ 81DF616 applymovement OBJ_EVENT_ID_PLAYER, MauvilleCity_Movement_PlayerWatchScottExitNorth - applymovement 11, MauvilleCity_Movement_ScottExitNorth + applymovement LOCALID_SCOTT, MauvilleCity_Movement_ScottExitNorth waitmovement 0 return MauvilleCity_EventScript_ScottExitEast:: @ 81DF628 applymovement OBJ_EVENT_ID_PLAYER, MauvilleCity_Movement_PlayerWatchScottExitEast - applymovement 11, MauvilleCity_Movement_ScottExitEast + applymovement LOCALID_SCOTT, MauvilleCity_Movement_ScottExitEast waitmovement 0 return MauvilleCity_EventScript_BattleWally:: @ 81DF63A msgbox MauvilleCity_Text_WallyHereICome, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_WALLY_MAUVILLE, MauvilleCity_Text_WallyDefeat - applymovement 6, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLY, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox MauvilleCity_Text_WallyIllGoBackToVerdanturf, MSGBOX_DEFAULT - applymovement 6, Common_Movement_FacePlayer + applymovement LOCALID_WALLY, Common_Movement_FacePlayer waitmovement 0 msgbox MauvilleCity_Text_ThankYouNotEnoughToBattle, MSGBOX_DEFAULT - applymovement 6, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLY, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox MauvilleCity_Text_UncleNoNeedToBeDown, MSGBOX_DEFAULT return @@ -223,7 +227,7 @@ MauvilleCity_EventScript_DeclineWallyBattle:: @ 81DF683 end MauvilleCity_EventScript_WallyRequestBattleAgain:: @ 81DF690 - applymovement 6, Common_Movement_FacePlayer + applymovement LOCALID_WALLY, Common_Movement_FacePlayer waitmovement 0 msgbox MauvilleCity_Text_WallyPleaseBattleMe, MSGBOX_YESNO goto MauvilleCity_EventScript_BattleWallyPrompt diff --git a/data/maps/MauvilleCity_Gym/scripts.inc b/data/maps/MauvilleCity_Gym/scripts.inc index 1a62fb9df..edf0a3129 100644 --- a/data/maps/MauvilleCity_Gym/scripts.inc +++ b/data/maps/MauvilleCity_Gym/scripts.inc @@ -116,7 +116,7 @@ MauvilleCity_Gym_EventScript_WattsonDefeated:: @ 820DF2B MauvilleCity_Gym_EventScript_GiveShockWave2:: @ 820DF8D giveitem ITEM_TM34 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull msgbox MauvilleCity_Gym_Text_ExplainShockWave, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM34 @@ -125,7 +125,7 @@ MauvilleCity_Gym_EventScript_GiveShockWave2:: @ 820DF8D MauvilleCity_Gym_EventScript_GiveShockWave:: @ 820DFB1 giveitem ITEM_TM34 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_BagIsFull msgbox MauvilleCity_Gym_Text_ExplainShockWave, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM34 diff --git a/data/maps/MauvilleCity_PokemonCenter_1F/scripts.inc b/data/maps/MauvilleCity_PokemonCenter_1F/scripts.inc index ee13ffcfd..179dfad8a 100644 --- a/data/maps/MauvilleCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/MauvilleCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + MauvilleCity_PokemonCenter_1F_MapScripts:: @ 8210E5B map_script MAP_SCRIPT_ON_TRANSITION, MauvilleCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -13,9 +15,8 @@ MauvilleCity_PokemonCenter_1F_EventScript_SetMauvilleOldManGfx:: @ 8210E74 special ScrSpecial_SetMauvilleOldManObjEventGfx end -@ VAR_0x800B is the Nurse's object event id MauvilleCity_PokemonCenter_1F_EventScript_Nurse:: @ 8210E78 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/MeteorFalls_1F_1R/scripts.inc b/data/maps/MeteorFalls_1F_1R/scripts.inc index c86d50d4d..56deaa353 100644 --- a/data/maps/MeteorFalls_1F_1R/scripts.inc +++ b/data/maps/MeteorFalls_1F_1R/scripts.inc @@ -1,3 +1,9 @@ +.set LOCALID_MAGMA_GRUNT_1, 5 +.set LOCALID_MAGMA_GRUNT_2, 6 +.set LOCALID_ARCHIE, 7 +.set LOCALID_AQUA_GRUNT_1, 8 +.set LOCALID_AQUA_GRUNT_2, 9 + MeteorFalls_1F_1R_MapScripts:: @ 822BD2A map_script MAP_SCRIPT_ON_LOAD, MeteorFalls_1F_1R_OnLoad .byte 0 @@ -19,70 +25,70 @@ MeteorFalls_1F_1R_EventScript_MagmaStealsMeteoriteScene:: @ 822BD5F applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceDown waitmovement 0 delay 30 - applymovement 5, Common_Movement_WalkInPlaceDown + applymovement LOCALID_MAGMA_GRUNT_1, Common_Movement_WalkInPlaceDown waitmovement 0 msgbox MeteorFalls_1F_1R_Text_WithThisMeteorite, MSGBOX_DEFAULT closemessage - applymovement 5, Common_Movement_WalkInPlaceFastestUp - applymovement 6, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_MAGMA_GRUNT_1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_MAGMA_GRUNT_2, Common_Movement_WalkInPlaceFastestUp waitmovement 0 playse SE_PIN - applymovement 5, Common_Movement_ExclamationMark + applymovement LOCALID_MAGMA_GRUNT_1, Common_Movement_ExclamationMark waitmovement 0 - applymovement 5, Common_Movement_Delay48 + applymovement LOCALID_MAGMA_GRUNT_1, Common_Movement_Delay48 waitmovement 0 msgbox MeteorFalls_1F_1R_Text_DontExpectMercyFromMagma, MSGBOX_DEFAULT closemessage - applymovement 5, MeteorFalls_1F_1R_Movement_MagmaGruntApproachPlayer + applymovement LOCALID_MAGMA_GRUNT_1, MeteorFalls_1F_1R_Movement_MagmaGruntApproachPlayer waitmovement 0 msgbox MeteorFalls_1F_1R_Text_HoldItRightThereMagma, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft - applymovement 5, Common_Movement_WalkInPlaceFastestLeft - applymovement 6, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_MAGMA_GRUNT_1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_MAGMA_GRUNT_2, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 - addobject 7 - addobject 8 - addobject 9 + addobject LOCALID_ARCHIE + addobject LOCALID_AQUA_GRUNT_1 + addobject LOCALID_AQUA_GRUNT_2 playbgm MUS_AQA_0, 0 - applymovement 7, MeteorFalls_1F_1R_Movement_ArchieArrive - applymovement 8, MeteorFalls_1F_1R_Movement_AquaGrunt1Arrive - applymovement 9, MeteorFalls_1F_1R_Movement_AquaGrunt2Arrive + applymovement LOCALID_ARCHIE, MeteorFalls_1F_1R_Movement_ArchieArrive + applymovement LOCALID_AQUA_GRUNT_1, MeteorFalls_1F_1R_Movement_AquaGrunt1Arrive + applymovement LOCALID_AQUA_GRUNT_2, MeteorFalls_1F_1R_Movement_AquaGrunt2Arrive waitmovement 0 - applymovement 5, Common_Movement_WalkInPlaceFastestLeft - applymovement 6, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_MAGMA_GRUNT_1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_MAGMA_GRUNT_2, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox MeteorFalls_1F_1R_Text_BeSeeingYouTeamAqua, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, MeteorFalls_1F_1R_Movement_PushPlayerOutOfWay - applymovement 5, MeteorFalls_1F_1R_Movement_MagmaGrunt1Exit - applymovement 6, MeteorFalls_1F_1R_Movement_MagmaGrunt2Exit + applymovement LOCALID_MAGMA_GRUNT_1, MeteorFalls_1F_1R_Movement_MagmaGrunt1Exit + applymovement LOCALID_MAGMA_GRUNT_2, MeteorFalls_1F_1R_Movement_MagmaGrunt2Exit waitmovement 0 - removeobject 5 - removeobject 6 - applymovement 7, MeteorFalls_1F_1R_Movement_ArchieApproachPlayer + removeobject LOCALID_MAGMA_GRUNT_1 + removeobject LOCALID_MAGMA_GRUNT_2 + applymovement LOCALID_ARCHIE, MeteorFalls_1F_1R_Movement_ArchieApproachPlayer waitmovement 0 msgbox MeteorFalls_1F_1R_Text_ArchieSeenYouBefore, MSGBOX_DEFAULT closemessage - applymovement 8, MeteorFalls_1F_1R_Movement_AquaGrunt1ApproachArchie - applymovement 9, MeteorFalls_1F_1R_Movement_AquaGrunt2ApproachArchie + applymovement LOCALID_AQUA_GRUNT_1, MeteorFalls_1F_1R_Movement_AquaGrunt1ApproachArchie + applymovement LOCALID_AQUA_GRUNT_2, MeteorFalls_1F_1R_Movement_AquaGrunt2ApproachArchie waitmovement 0 msgbox MeteorFalls_1F_1R_Text_BossWeShouldChaseMagma, MSGBOX_DEFAULT - applymovement 7, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox MeteorFalls_1F_1R_Text_ArchieYesNoTellingWhatMagmaWillDo, MSGBOX_DEFAULT - applymovement 7, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox MeteorFalls_1F_1R_Text_ArchieFarewell, MSGBOX_DEFAULT closemessage - applymovement 7, MeteorFalls_1F_1R_Movement_ArchieExit - applymovement 8, MeteorFalls_1F_1R_Movement_AquaGrunt1Exit - applymovement 9, MeteorFalls_1F_1R_Movement_AquaGrunt2Exit + applymovement LOCALID_ARCHIE, MeteorFalls_1F_1R_Movement_ArchieExit + applymovement LOCALID_AQUA_GRUNT_1, MeteorFalls_1F_1R_Movement_AquaGrunt1Exit + applymovement LOCALID_AQUA_GRUNT_2, MeteorFalls_1F_1R_Movement_AquaGrunt2Exit waitmovement 0 fadedefaultbgm - removeobject 7 - removeobject 8 - removeobject 9 + removeobject LOCALID_ARCHIE + removeobject LOCALID_AQUA_GRUNT_1 + removeobject LOCALID_AQUA_GRUNT_2 setflag FLAG_HIDE_ROUTE_112_TEAM_MAGMA setflag FLAG_MET_ARCHIE_METEOR_FALLS setflag FLAG_HIDE_FALLARBOR_TOWN_BATTLE_TENT_SCOTT diff --git a/data/maps/MeteorFalls_StevensCave/scripts.inc b/data/maps/MeteorFalls_StevensCave/scripts.inc index 71313be67..9ccc2ca68 100644 --- a/data/maps/MeteorFalls_StevensCave/scripts.inc +++ b/data/maps/MeteorFalls_StevensCave/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_STEVEN, 1 + MeteorFalls_StevensCave_MapScripts:: @ 823B181 .byte 0 @@ -6,11 +8,11 @@ MeteorFalls_StevensCave_EventScript_Steven:: @ 823B182 goto_if_set FLAG_DEFEATED_METEOR_FALLS_STEVEN, MeteorFalls_StevensCave_EventScript_Defeated waitse playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_STEVEN, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_STEVEN, Common_Movement_Delay48 waitmovement 0 - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_STEVEN, Common_Movement_FacePlayer waitmovement 0 msgbox MeteorFalls_StevensCave_Text_ShouldKnowHowGoodIAmExpectWorst, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_STEVEN, MeteorFalls_StevensCave_Text_StevenDefeat @@ -20,7 +22,7 @@ MeteorFalls_StevensCave_EventScript_Steven:: @ 823B182 end MeteorFalls_StevensCave_EventScript_Defeated:: @ 823B1CD - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_STEVEN, Common_Movement_FacePlayer waitmovement 0 msgbox MeteorFalls_StevensCave_Text_MyPredictionCameTrue, MSGBOX_DEFAULT release diff --git a/data/maps/MirageTower_4F/scripts.inc b/data/maps/MirageTower_4F/scripts.inc index ceb78ab45..a258f9dec 100644 --- a/data/maps/MirageTower_4F/scripts.inc +++ b/data/maps/MirageTower_4F/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_ROOT_FOSSIL, 1 +.set LOCALID_CLAW_FOSSIL, 2 + MirageTower_4F_MapScripts:: @ 823AD47 .byte 0 @@ -11,7 +14,7 @@ MirageTower_4F_EventScript_RootFossil:: @ 823AD48 closemessage setflag FLAG_HIDE_MIRAGE_TOWER_ROOT_FOSSIL setflag FLAG_HIDE_MIRAGE_TOWER_CLAW_FOSSIL - removeobject 1 + removeobject LOCALID_ROOT_FOSSIL delay 30 setflag FLAG_CHOSE_ROOT_FOSSIL goto MirageTower_4F_EventScript_CollapseMirageTower @@ -32,7 +35,7 @@ MirageTower_4F_EventScript_ClawFossil:: @ 823AD89 closemessage setflag FLAG_HIDE_MIRAGE_TOWER_CLAW_FOSSIL setflag FLAG_HIDE_MIRAGE_TOWER_ROOT_FOSSIL - removeobject 2 + removeobject LOCALID_CLAW_FOSSIL delay 30 setflag FLAG_CHOSE_CLAW_FOSSIL goto MirageTower_4F_EventScript_CollapseMirageTower diff --git a/data/maps/MossdeepCity/scripts.inc b/data/maps/MossdeepCity/scripts.inc index fd5c69962..963635ccd 100644 --- a/data/maps/MossdeepCity/scripts.inc +++ b/data/maps/MossdeepCity/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_GRUNT_1, 10 +.set LOCALID_GRUNT_2, 11 +.set LOCALID_GRUNT_3, 12 +.set LOCALID_GRUNT_4, 13 +.set LOCALID_MAXIE, 14 +.set LOCALID_SCOTT, 16 + MossdeepCity_MapScripts:: @ 81E4A96 map_script MAP_SCRIPT_ON_TRANSITION, MossdeepCity_OnTransition .byte 0 @@ -75,24 +82,24 @@ MossdeepCity_EventScript_VisitedMossdeep:: @ 81E4B38 MossdeepCity_EventScript_TeamMagmaEnterSpaceCenter:: @ 81E4B41 lockall - applymovement 14, MossdeepCity_Movement_MaxieGestureToSpaceCenter + applymovement LOCALID_MAXIE, MossdeepCity_Movement_MaxieGestureToSpaceCenter waitmovement 0 - applymovement 10, MossdeepCity_Movement_GruntFaceSpaceCenter - applymovement 11, MossdeepCity_Movement_GruntFaceSpaceCenter - applymovement 12, MossdeepCity_Movement_GruntFaceSpaceCenter - applymovement 13, MossdeepCity_Movement_GruntFaceSpaceCenter + applymovement LOCALID_GRUNT_1, MossdeepCity_Movement_GruntFaceSpaceCenter + applymovement LOCALID_GRUNT_2, MossdeepCity_Movement_GruntFaceSpaceCenter + applymovement LOCALID_GRUNT_3, MossdeepCity_Movement_GruntFaceSpaceCenter + applymovement LOCALID_GRUNT_4, MossdeepCity_Movement_GruntFaceSpaceCenter waitmovement 0 - applymovement 14, MossdeepCity_Movement_MaxieEnterSpaceCenter - applymovement 10, MossdeepCity_Movement_Grunt1EnterSpaceCenter - applymovement 11, MossdeepCity_Movement_Grunt2EnterSpaceCenter - applymovement 12, MossdeepCity_Movement_Grunt3EnterSpaceCenter - applymovement 13, MossdeepCity_Movement_Grunt4EnterSpaceCenter + applymovement LOCALID_MAXIE, MossdeepCity_Movement_MaxieEnterSpaceCenter + applymovement LOCALID_GRUNT_1, MossdeepCity_Movement_Grunt1EnterSpaceCenter + applymovement LOCALID_GRUNT_2, MossdeepCity_Movement_Grunt2EnterSpaceCenter + applymovement LOCALID_GRUNT_3, MossdeepCity_Movement_Grunt3EnterSpaceCenter + applymovement LOCALID_GRUNT_4, MossdeepCity_Movement_Grunt4EnterSpaceCenter waitmovement 0 - removeobject 14 - removeobject 10 - removeobject 11 - removeobject 12 - removeobject 13 + removeobject LOCALID_MAXIE + removeobject LOCALID_GRUNT_1 + removeobject LOCALID_GRUNT_2 + removeobject LOCALID_GRUNT_3 + removeobject LOCALID_GRUNT_4 delay 30 setvar VAR_MOSSDEEP_CITY_STATE, 2 setflag FLAG_HIDE_MOSSDEEP_CITY_TEAM_MAGMA @@ -260,19 +267,19 @@ MossdeepCity_EventScript_Scott:: @ 81E4C85 compare VAR_FACING, DIR_EAST call_if_eq MossdeepCity_EventScript_ScottExitEast addvar VAR_SCOTT_STATE, 1 - removeobject 16 + removeobject LOCALID_SCOTT release end MossdeepCity_EventScript_ScottExitNorth:: @ 81E4CB0 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Movement_PlayerWatchScottExit - applymovement 16, MossdeepCity_Movement_ScottExitNorth + applymovement LOCALID_SCOTT, MossdeepCity_Movement_ScottExitNorth waitmovement 0 return MossdeepCity_EventScript_ScottExitEast:: @ 81E4CC2 applymovement OBJ_EVENT_ID_PLAYER, MossdeepCity_Movement_PlayerWatchScottExit - applymovement 16, MossdeepCity_Movement_ScottExitEast + applymovement LOCALID_SCOTT, MossdeepCity_Movement_ScottExitEast waitmovement 0 return diff --git a/data/maps/MossdeepCity_Gym/scripts.inc b/data/maps/MossdeepCity_Gym/scripts.inc index 7e78e3d9f..d8bff6dd1 100644 --- a/data/maps/MossdeepCity_Gym/scripts.inc +++ b/data/maps/MossdeepCity_Gym/scripts.inc @@ -92,7 +92,7 @@ MossdeepCity_Gym_EventScript_TateAndLizaDefeated:: @ 82208D1 MossdeepCity_Gym_EventScript_GiveCalmMind2:: @ 8220937 giveitem ITEM_TM04 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull msgbox MossdeepCity_Gym_Text_ExplainCalmMind, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM04 @@ -101,7 +101,7 @@ MossdeepCity_Gym_EventScript_GiveCalmMind2:: @ 8220937 MossdeepCity_Gym_EventScript_GiveCalmMind:: @ 822095B giveitem ITEM_TM04 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_BagIsFull msgbox MossdeepCity_Gym_Text_ExplainCalmMind, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM04 diff --git a/data/maps/MossdeepCity_House2/scripts.inc b/data/maps/MossdeepCity_House2/scripts.inc index 8f77aede2..5e4b3b342 100644 --- a/data/maps/MossdeepCity_House2/scripts.inc +++ b/data/maps/MossdeepCity_House2/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WINGULL, 3 + MossdeepCity_House2_MapScripts:: @ 82220DE .byte 0 @@ -23,17 +25,17 @@ MossdeepCity_House2_EventScript_Wingull:: @ 82220F1 call_if_eq MossdeepCity_House2_EventScript_WingullExitNorth compare VAR_FACING, DIR_WEST call_if_eq MossdeepCity_House2_EventScript_WingullExitWest - removeobject 3 + removeobject LOCALID_WINGULL release end MossdeepCity_House2_EventScript_WingullExitNorth:: @ 8222124 - applymovement 3, MossdeepCity_House2_Movement_WingullExitNorth + applymovement LOCALID_WINGULL, MossdeepCity_House2_Movement_WingullExitNorth waitmovement 0 return MossdeepCity_House2_EventScript_WingullExitWest:: @ 822212F - applymovement 3, MossdeepCity_House2_Movement_WingullExitEast + applymovement LOCALID_WINGULL, MossdeepCity_House2_Movement_WingullExitEast waitmovement 0 return diff --git a/data/maps/MossdeepCity_PokemonCenter_1F/scripts.inc b/data/maps/MossdeepCity_PokemonCenter_1F/scripts.inc index 49c31dc6b..7cefc796a 100644 --- a/data/maps/MossdeepCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/MossdeepCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + MossdeepCity_PokemonCenter_1F_MapScripts:: @ 822223F map_script MAP_SCRIPT_ON_TRANSITION, MossdeepCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -7,9 +9,8 @@ MossdeepCity_PokemonCenter_1F_OnTransition: @ 822224A setrespawn HEAL_LOCATION_MOSSDEEP_CITY end -@ VAR_0x800B is the Nurse's object event id MossdeepCity_PokemonCenter_1F_EventScript_Nurse:: @ 822224E - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc b/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc index 05c14f11a..667f44114 100644 --- a/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc +++ b/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_SCIENTIST_1, 1 +.set LOCALID_SCIENTIST_2, 2 +.set LOCALID_SAILOR, 3 +.set LOCALID_OLD_MAN, 4 +.set LOCALID_WOMAN, 5 +.set LOCALID_STAIR_GRUNT, 9 + MossdeepCity_SpaceCenter_1F_MapScripts:: @ 8222F41 map_script MAP_SCRIPT_ON_LOAD, MossdeepCity_SpaceCenter_1F_OnLoad map_script MAP_SCRIPT_ON_TRANSITION, MossdeepCity_SpaceCenter_1F_OnTransition @@ -9,15 +16,15 @@ MossdeepCity_SpaceCenter_1F_OnTransition: @ 8222F4C end MossdeepCity_SpaceCenter_1F_EventScript_MoveObjectsForTeamMagma:: @ 8222F58 - setobjectxyperm 3, 1, 9 - setobjectmovementtype 3, MOVEMENT_TYPE_FACE_RIGHT - setobjectxyperm 5, 0, 8 - setobjectmovementtype 5, MOVEMENT_TYPE_FACE_RIGHT - setobjectxyperm 4, 1, 6 - setobjectmovementtype 4, MOVEMENT_TYPE_FACE_RIGHT - setobjectxyperm 1, 3, 4 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_RIGHT - setobjectmovementtype 2, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_SAILOR, 1, 9 + setobjectmovementtype LOCALID_SAILOR, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_WOMAN, 0, 8 + setobjectmovementtype LOCALID_WOMAN, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_OLD_MAN, 1, 6 + setobjectmovementtype LOCALID_OLD_MAN, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_SCIENTIST_1, 3, 4 + setobjectmovementtype LOCALID_SCIENTIST_1, MOVEMENT_TYPE_FACE_RIGHT + setobjectmovementtype LOCALID_SCIENTIST_2, MOVEMENT_TYPE_FACE_RIGHT compare VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 1 goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardLeft compare VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 2 @@ -27,16 +34,16 @@ MossdeepCity_SpaceCenter_1F_EventScript_MoveObjectsForTeamMagma:: @ 8222F58 end MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardLeft:: @ 8222FAA - setobjectxyperm 9, 12, 2 + setobjectxyperm LOCALID_STAIR_GRUNT, 12, 2 end MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardDown:: @ 8222FB2 - setobjectxyperm 9, 13, 3 + setobjectxyperm LOCALID_STAIR_GRUNT, 13, 3 end @ Functionally unused. See comment on MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsEast MossdeepCity_SpaceCenter_1F_EventScript_MoveStairGuardRight:: @ 8222FBA - setobjectxyperm 9, 14, 2 + setobjectxyperm LOCALID_STAIR_GRUNT, 14, 2 end MossdeepCity_SpaceCenter_1F_OnLoad: @ 8222FC2 @@ -120,7 +127,7 @@ MossdeepCity_SpaceCenter_1F_EventScript_SunStoneMan:: @ 822308E goto_if_set FLAG_RECEIVED_SUN_STONE_MOSSDEEP, MossdeepCity_SpaceCenter_1F_EventScript_GaveSunStone msgbox MossdeepCity_SpaceCenter_1F_Text_FoundThisYouCanHaveIt, MSGBOX_DEFAULT giveitem ITEM_SUN_STONE - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_SUN_STONE_MOSSDEEP msgbox MossdeepCity_SpaceCenter_1F_Text_HoennFamousForMeteorShowers, MSGBOX_DEFAULT @@ -136,7 +143,7 @@ MossdeepCity_SpaceCenter_1F_EventScript_SunStoneManMagma:: @ 82230DA goto_if_set FLAG_RECEIVED_SUN_STONE_MOSSDEEP, MossdeepCity_SpaceCenter_1F_EventScript_GaveSunStoneMagma msgbox MossdeepCity_SpaceCenter_1F_Text_MagmaCantStealFuelTakeThis, MSGBOX_DEFAULT giveitem ITEM_SUN_STONE - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_SUN_STONE_MOSSDEEP msgbox MossdeepCity_SpaceCenter_1F_Text_CantStrollOnBeachWithMagma, MSGBOX_DEFAULT @@ -237,11 +244,11 @@ MossdeepCity_SpaceCenter_1F_EventScript_Grunt2:: @ 822321F msgbox MossdeepCity_SpaceCenter_1F_Text_Grunt2Intro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_GRUNT_SPACE_CENTER_2, MossdeepCity_SpaceCenter_1F_Text_Grunt2Defeat setflag FLAG_DEFEATED_GRUNT_SPACE_CENTER_1F - copyobjectxytoperm 9 + copyobjectxytoperm LOCALID_STAIR_GRUNT switch VAR_FACING case DIR_WEST, MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsWest case DIR_WEST, MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsEast @ BUG: This was meant to be case DIR_EAST - applymovement 9, MossdeepCity_SpaceCenter_1F_Movement_MoveGruntFromStairs + applymovement LOCALID_STAIR_GRUNT, MossdeepCity_SpaceCenter_1F_Movement_MoveGruntFromStairs waitmovement 0 setvar VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 2 release @@ -253,7 +260,7 @@ MossdeepCity_SpaceCenter_1F_EventScript_Grunt2Defeated:: @ 822326E end MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsWest:: @ 8223278 - applymovement 9, MossdeepCity_SpaceCenter_1F_Movement_MoveGruntFromStairsWest + applymovement LOCALID_STAIR_GRUNT, MossdeepCity_SpaceCenter_1F_Movement_MoveGruntFromStairsWest waitmovement 0 setvar VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 1 release @@ -262,7 +269,7 @@ MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsWest:: @ 8223278 @ Functionally unused by mistake. The movement is handled anyway after the switch (see above) @ This also means VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE can never be 3 MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsEast:: @ 8223289 - applymovement 9, MossdeepCity_SpaceCenter_1F_Movement_MoveGruntFromStairsEast + applymovement LOCALID_STAIR_GRUNT, MossdeepCity_SpaceCenter_1F_Movement_MoveGruntFromStairsEast waitmovement 0 setvar VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 3 release diff --git a/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc b/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc index 73908ab53..6c9d4a905 100644 --- a/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc +++ b/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc @@ -1,3 +1,14 @@ +.set LOCALID_RICH_BOY, 1 +.set LOCALID_GENTLEMAN, 2 +.set LOCALID_SCIENTIST, 3 +.set LOCALID_STEVEN, 4 +@ Grunt names numbered like their Trainer values (which are for the full Space Center) +.set LOCALID_GRUNT_6, 5 +.set LOCALID_GRUNT_5, 6 +.set LOCALID_GRUNT_7, 7 +.set LOCALID_TABITHA, 8 +.set LOCALID_MAXIE, 9 + MossdeepCity_SpaceCenter_2F_MapScripts:: @ 8223D58 map_script MAP_SCRIPT_ON_TRANSITION, MossdeepCity_SpaceCenter_2F_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, MossdeepCity_SpaceCenter_2F_OnFrame @@ -5,25 +16,25 @@ MossdeepCity_SpaceCenter_2F_MapScripts:: @ 8223D58 MossdeepCity_SpaceCenter_2F_OnTransition: @ 8223D63 compare VAR_MOSSDEEP_CITY_STATE, 2 - call_if_eq MossdeepCity_SpaceCenter_2F_EventScript_MoveStevenMaxieTabitha + call_if_eq MossdeepCity_SpaceCenter_2F_EventScript_MoveCivilians compare VAR_MOSSDEEP_SPACE_CENTER_STATE, 2 call_if_eq MossdeepCity_SpaceCenter_2F_EventScript_MoveDefeatedGrunts end -MossdeepCity_SpaceCenter_2F_EventScript_MoveStevenMaxieTabitha:: @ 8223D7A +MossdeepCity_SpaceCenter_2F_EventScript_MoveCivilians:: @ 8223D7A clearflag FLAG_INTERACTED_WITH_STEVEN_SPACE_CENTER - setobjectxyperm 3, 5, 3 - setobjectmovementtype 3, MOVEMENT_TYPE_FACE_RIGHT - setobjectxyperm 1, 3, 2 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_RIGHT - setobjectxyperm 2, 1, 3 - setobjectmovementtype 2, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_SCIENTIST, 5, 3 + setobjectmovementtype LOCALID_SCIENTIST, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_RICH_BOY, 3, 2 + setobjectmovementtype LOCALID_RICH_BOY, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_GENTLEMAN, 1, 3 + setobjectmovementtype LOCALID_GENTLEMAN, MOVEMENT_TYPE_FACE_RIGHT return MossdeepCity_SpaceCenter_2F_EventScript_MoveDefeatedGrunts:: @ 8223D9F - setobjectxyperm 5, 11, 2 - setobjectxyperm 7, 15, 2 - setobjectxyperm 6, 13, 4 + setobjectxyperm LOCALID_GRUNT_6, 11, 2 + setobjectxyperm LOCALID_GRUNT_7, 15, 2 + setobjectxyperm LOCALID_GRUNT_5, 13, 4 return MossdeepCity_SpaceCenter_2F_OnFrame: @ 8223DB5 @@ -55,24 +66,24 @@ MossdeepCity_SpaceCenter_2F_Movement_PlayerExit: @ 8223E07 MossdeepCity_SpaceCenter_2F_EventScript_BattleThreeMagmaGrunts:: @ 8223E09 msgbox MossdeepCity_SpaceCenter_2F_Text_Grunt5Intro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_GRUNT_SPACE_CENTER_5, MossdeepCity_SpaceCenter_2F_Text_Grunt5Defeat - applymovement 6, MossdeepCity_SpaceCenter_2F_Movement_Grunt5Defeated + applymovement LOCALID_GRUNT_5, MossdeepCity_SpaceCenter_2F_Movement_Grunt5Defeated waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox MossdeepCity_SpaceCenter_2F_Text_Grunt6Intro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_GRUNT_SPACE_CENTER_6, MossdeepCity_SpaceCenter_2F_Text_Grunt6Defeat - applymovement 5, MossdeepCity_SpaceCenter_2F_Movement_Grunt6Defeated + applymovement LOCALID_GRUNT_6, MossdeepCity_SpaceCenter_2F_Movement_Grunt6Defeated waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox MossdeepCity_SpaceCenter_2F_Text_Grunt7Intro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_GRUNT_SPACE_CENTER_7, MossdeepCity_SpaceCenter_2F_Text_Grunt7Defeat - applymovement 7, MossdeepCity_SpaceCenter_2F_Movement_Grunt7Defeated + applymovement LOCALID_GRUNT_7, MossdeepCity_SpaceCenter_2F_Movement_Grunt7Defeated waitmovement 0 setvar VAR_MOSSDEEP_SPACE_CENTER_STATE, 2 - copyobjectxytoperm 5 - copyobjectxytoperm 7 - copyobjectxytoperm 6 + copyobjectxytoperm LOCALID_GRUNT_6 + copyobjectxytoperm LOCALID_GRUNT_7 + copyobjectxytoperm LOCALID_GRUNT_5 releaseall end @@ -196,13 +207,13 @@ MossdeepCity_SpaceCenter_2F_EventScript_Steven:: @ 8223F7A playse SE_KOUKA_L switch VAR_FACING case DIR_SOUTH, MossdeepCity_SpaceCenter_2F_EventScript_StevenFightMovementSouth - applymovement 4, MossdeepCity_SpaceCenter_2F_Movement_StevenFight + applymovement LOCALID_STEVEN, MossdeepCity_SpaceCenter_2F_Movement_StevenFight waitmovement 0 releaseall end MossdeepCity_SpaceCenter_2F_EventScript_StevenFightMovementSouth:: @ 8223FBA - applymovement 4, MossdeepCity_SpaceCenter_2F_Movement_StevenFightSouth + applymovement LOCALID_STEVEN, MossdeepCity_SpaceCenter_2F_Movement_StevenFightSouth waitmovement 0 releaseall end @@ -275,12 +286,12 @@ MossdeepCity_SpaceCenter_2F_EventScript_DefeatedMaxieTabitha:: @ 8224071 msgbox MossdeepCity_SpaceCenter_2F_Text_MaxieWeFailedIsAquaAlsoMisguided, MSGBOX_DEFAULT closemessage delay 20 - applymovement 9, Common_Movement_WalkInPlaceFastestLeft - applymovement 8, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_MAXIE, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_TABITHA, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 60 - applymovement 9, Common_Movement_WalkInPlaceFastestUp - applymovement 8, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_MAXIE, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_TABITHA, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 20 msgbox MossdeepCity_SpaceCenter_2F_Text_MaxieWeWillGiveUp, MSGBOX_DEFAULT @@ -292,17 +303,17 @@ MossdeepCity_SpaceCenter_2F_EventScript_DefeatedMaxieTabitha:: @ 8224071 setflag FLAG_HIDE_MOSSDEEP_CITY_SPACE_CENTER_1F_TEAM_MAGMA setflag FLAG_HIDE_MOSSDEEP_CITY_SPACE_CENTER_2F_TEAM_MAGMA setflag FLAG_HIDE_MOSSDEEP_CITY_TEAM_MAGMA - removeobject 5 - removeobject 7 - removeobject 6 - removeobject 8 - removeobject 9 - setobjectxy 3, 5, 6 - turnobject 3, DIR_SOUTH - setobjectxy 2, 11, 8 - turnobject 2, DIR_NORTH - setobjectxy 1, 6, 2 - turnobject 1, DIR_NORTH + removeobject LOCALID_GRUNT_6 + removeobject LOCALID_GRUNT_7 + removeobject LOCALID_GRUNT_5 + removeobject LOCALID_TABITHA + removeobject LOCALID_MAXIE + setobjectxy LOCALID_SCIENTIST, 5, 6 + turnobject LOCALID_SCIENTIST, DIR_SOUTH + setobjectxy LOCALID_GENTLEMAN, 11, 8 + turnobject LOCALID_GENTLEMAN, DIR_NORTH + setobjectxy LOCALID_RICH_BOY, 6, 2 + turnobject LOCALID_RICH_BOY, DIR_NORTH call MossdeepCity_SpaceCenter_2F_EventScript_StevenFacePlayer fadescreen FADE_FROM_BLACK msgbox MossdeepCity_SpaceCenter_2F_Text_StevenThankYouComeSeeMeAtHome, MSGBOX_DEFAULT @@ -310,15 +321,15 @@ MossdeepCity_SpaceCenter_2F_EventScript_DefeatedMaxieTabitha:: @ 8224071 fadescreen FADE_TO_BLACK setflag FLAG_DEFEATED_MAGMA_SPACE_CENTER setflag FLAG_HIDE_MOSSDEEP_CITY_STEVENS_HOUSE_STEVEN - removeobject 4 + removeobject LOCALID_STEVEN setflag FLAG_HIDE_MOSSDEEP_CITY_SPACE_CENTER_MAGMA_NOTE clearflag FLAG_HIDE_MOSSDEEP_CITY_STEVENS_HOUSE_STEVEN setvar VAR_STEVENS_HOUSE_STATE, 1 setflag FLAG_HIDE_MOSSDEEP_CITY_SCOTT - removeobject 3 - setobjectxyperm 3, 5, 6 - setobjectmovementtype 3, MOVEMENT_TYPE_WANDER_AROUND - addobject 3 + removeobject LOCALID_SCIENTIST + setobjectxyperm LOCALID_SCIENTIST, 5, 6 + setobjectmovementtype LOCALID_SCIENTIST, MOVEMENT_TYPE_WANDER_AROUND + addobject LOCALID_SCIENTIST fadescreen FADE_FROM_BLACK end @@ -329,11 +340,11 @@ MossdeepCity_SpaceCenter_2F_EventScript_StevenFacePlayer:: @ 8224131 return MossdeepCity_SpaceCenter_2F_EventScript_StevenFacePlayerSouth:: @ 822414D - turnobject 4, DIR_NORTH + turnobject LOCALID_STEVEN, DIR_NORTH return MossdeepCity_SpaceCenter_2F_EventScript_StevenFacePlayerWest:: @ 8224152 - turnobject 4, DIR_EAST + turnobject LOCALID_STEVEN, DIR_EAST return MossdeepCity_SpaceCenter_2F_EventScript_MaxieTrainer:: @ 8224157 diff --git a/data/maps/MossdeepCity_StevensHouse/scripts.inc b/data/maps/MossdeepCity_StevensHouse/scripts.inc index bc71c6ca4..0017f553d 100644 --- a/data/maps/MossdeepCity_StevensHouse/scripts.inc +++ b/data/maps/MossdeepCity_StevensHouse/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_STEVEN, 1 +.set LOCALID_BELDUM_BALL, 2 + MossdeepCity_StevensHouse_MapScripts:: @ 8222784 map_script MAP_SCRIPT_ON_LOAD, MossdeepCity_StevensHouse_OnLoad map_script MAP_SCRIPT_ON_TRANSITION, MossdeepCity_StevensHouse_OnTransition @@ -18,8 +21,8 @@ MossdeepCity_StevensHouse_OnTransition: @ 82227A8 end MossdeepCity_StevensHouse_EventScript_SetStevenPos:: @ 82227B4 - setobjectxyperm 1, 6, 5 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_STEVEN, 6, 5 + setobjectmovementtype LOCALID_STEVEN, MOVEMENT_TYPE_FACE_UP return MossdeepCity_StevensHouse_OnFrame: @ 82227C0 @@ -28,14 +31,14 @@ MossdeepCity_StevensHouse_OnFrame: @ 82227C0 MossdeepCity_StevensHouse_EventScript_StevenGivesDive:: @ 82227CA lockall - applymovement 1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_STEVEN, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_STEVEN, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_STEVEN, Common_Movement_Delay48 waitmovement 0 - applymovement 1, MossdeepCity_StevensHouse_Movement_StevenApproachPlayer + applymovement LOCALID_STEVEN, MossdeepCity_StevensHouse_Movement_StevenApproachPlayer waitmovement 0 msgbox MossdeepCity_StevensHouse_Text_YouveEarnedHMDive, MSGBOX_DEFAULT giveitem ITEM_HM08 @@ -44,7 +47,7 @@ MossdeepCity_StevensHouse_EventScript_StevenGivesDive:: @ 82227CA msgbox MossdeepCity_StevensHouse_Text_ExplainDive, MSGBOX_DEFAULT closemessage delay 20 - applymovement 1, MossdeepCity_StevensHouse_Movement_StevenReturn + applymovement LOCALID_STEVEN, MossdeepCity_StevensHouse_Movement_StevenReturn waitmovement 0 setflag FLAG_HIDE_MOSSDEEP_CITY_SCOTT setflag FLAG_HIDE_SEAFLOOR_CAVERN_ENTRANCE_AQUA_GRUNT @@ -119,7 +122,7 @@ MossdeepCity_StevensHouse_EventScript_BeldumTransferredToPC:: @ 82228E0 MossdeepCity_StevensHouse_EventScript_ReceivedBeldumFanfare:: @ 82228EB bufferspeciesname 1, SPECIES_BELDUM - removeobject 2 + removeobject LOCALID_BELDUM_BALL playfanfare MUS_FANFA4 message MossdeepCity_StevensHouse_Text_ObtainedBeldum waitmessage diff --git a/data/maps/MtChimney/scripts.inc b/data/maps/MtChimney/scripts.inc index 9e1213c1b..42ebce0f9 100644 --- a/data/maps/MtChimney/scripts.inc +++ b/data/maps/MtChimney/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_ARCHIE, 1 +.set LOCALID_MAXIE, 2 +.set LOCALID_TABITHA, 3 +.set LOCALID_MAGMA_GRUNT_2, 22 +.set LOCALID_MAGMA_GRUNT_1, 29 + + MtChimney_MapScripts:: @ 822EDC1 map_script MAP_SCRIPT_ON_RESUME, MtChimney_OnResume map_script MAP_SCRIPT_ON_TRANSITION, MtChimney_OnTransition @@ -17,7 +24,7 @@ MtChimney_EventScript_Archie:: @ 822EDD5 call_if_unset FLAG_EVIL_LEADER_PLEASE_STOP, MtChimney_EventScript_ArchieGoStopTeamMagma call_if_set FLAG_EVIL_LEADER_PLEASE_STOP, MtChimney_EventScript_ArchieBusyFighting closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_ARCHIE, Common_Movement_FaceOriginalDirection waitmovement 0 setflag FLAG_EVIL_LEADER_PLEASE_STOP release @@ -35,12 +42,12 @@ MtChimney_EventScript_Maxie:: @ 822EE0B lockall playbgm MUS_MGM0, 0 msgbox MtChimney_Text_MeteoriteWillActivateVolcano, MSGBOX_DEFAULT - applymovement 2, Common_Movement_FacePlayer + applymovement LOCALID_MAXIE, Common_Movement_FacePlayer waitmovement 0 playse SE_PIN - applymovement 2, Common_Movement_ExclamationMark + applymovement LOCALID_MAXIE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 2, Common_Movement_Delay48 + applymovement LOCALID_MAXIE, Common_Movement_Delay48 waitmovement 0 msgbox MtChimney_Text_MaxieIntro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_MAXIE_MT_CHIMNEY, MtChimney_Text_MaxieDefeat @@ -48,14 +55,14 @@ MtChimney_EventScript_Maxie:: @ 822EE0B closemessage delay 30 fadescreen FADE_TO_BLACK - removeobject 2 - removeobject 29 - removeobject 3 - removeobject 22 + removeobject LOCALID_MAXIE + removeobject LOCALID_MAGMA_GRUNT_1 + removeobject LOCALID_TABITHA + removeobject LOCALID_MAGMA_GRUNT_2 setflag FLAG_HIDE_MT_CHIMNEY_TEAM_MAGMA fadescreen FADE_FROM_BLACK - setobjectxyperm 1, 10, 12 - addobject 1 + setobjectxyperm LOCALID_ARCHIE, 10, 12 + addobject LOCALID_ARCHIE compare VAR_FACING, DIR_EAST call_if_eq MtChimney_EventScript_ArchieApproachPlayerEast compare VAR_FACING, DIR_NORTH @@ -68,7 +75,7 @@ MtChimney_EventScript_Maxie:: @ 822EE0B call_if_eq MtChimney_EventScript_ArchieExitEast compare VAR_FACING, DIR_NORTH call_if_eq MtChimney_EventScript_ArchieExitNorth - removeobject 1 + removeobject LOCALID_ARCHIE setflag FLAG_HIDE_MT_CHIMNEY_TEAM_AQUA setflag FLAG_DEFEATED_EVIL_TEAM_MT_CHIMNEY clearflag FLAG_HIDE_FALLARBOR_HOUSE_PROF_COZMO @@ -78,22 +85,22 @@ MtChimney_EventScript_Maxie:: @ 822EE0B end MtChimney_EventScript_ArchieApproachPlayerEast:: @ 822EEC7 - applymovement 1, MtChimney_Movement_ArchieApproachPlayerEast + applymovement LOCALID_ARCHIE, MtChimney_Movement_ArchieApproachPlayerEast waitmovement 0 return MtChimney_EventScript_ArchieApproachPlayerNorth:: @ 822EED2 - applymovement 1, MtChimney_Movement_ArchieApproachPlayerNorth + applymovement LOCALID_ARCHIE, MtChimney_Movement_ArchieApproachPlayerNorth waitmovement 0 return MtChimney_EventScript_ArchieExitEast:: @ 822EEDD - applymovement 1, MtChimney_Movement_ArchieExitEast + applymovement LOCALID_ARCHIE, MtChimney_Movement_ArchieExitEast waitmovement 0 return MtChimney_EventScript_ArchieExitNorth:: @ 822EEE8 - applymovement 1, MtChimney_Movement_ArchieExitNorth + applymovement LOCALID_ARCHIE, MtChimney_Movement_ArchieExitNorth waitmovement 0 return diff --git a/data/maps/MtChimney_CableCarStation/scripts.inc b/data/maps/MtChimney_CableCarStation/scripts.inc index 8c4294126..6ce84933f 100644 --- a/data/maps/MtChimney_CableCarStation/scripts.inc +++ b/data/maps/MtChimney_CableCarStation/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + MtChimney_CableCarStation_MapScripts:: @ 822ABFA map_script MAP_SCRIPT_ON_TRANSITION, MtChimney_CableCarStation_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, MtChimney_CableCarStation_OnFrame @@ -9,8 +11,8 @@ MtChimney_CableCarStation_OnTransition: @ 822AC05 end MtChimney_CableCarStation_EventScript_MoveAttendantAside:: @ 822AC11 - setobjectxyperm 1, 5, 4 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_ATTENDANT, 5, 4 + setobjectmovementtype LOCALID_ATTENDANT, MOVEMENT_TYPE_FACE_RIGHT return MtChimney_CableCarStation_OnFrame: @ 822AC1D @@ -20,11 +22,11 @@ MtChimney_CableCarStation_OnFrame: @ 822AC1D MtChimney_CableCarStation_EventScript_ExitCableCar:: @ 822AC27 lockall applymovement OBJ_EVENT_ID_PLAYER, MtChimney_CableCarStation_Movement_ExitCableCar - applymovement 1, MtChimney_CableCarStation_Movement_FollowPlayerOutFromCableCar + applymovement LOCALID_ATTENDANT, MtChimney_CableCarStation_Movement_FollowPlayerOutFromCableCar waitmovement 0 setvar VAR_CABLE_CAR_STATION_STATE, 0 - setobjectxyperm 1, 6, 7 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_ATTENDANT, 6, 7 + setobjectmovementtype LOCALID_ATTENDANT, MOVEMENT_TYPE_FACE_DOWN releaseall end @@ -41,7 +43,7 @@ MtChimney_CableCarStation_EventScript_Attendant:: @ 822AC4B MtChimney_CableCarStation_EventScript_RideCableCar:: @ 822AC6C msgbox MtChimney_CableCarStation_Text_StepThisWay, MSGBOX_DEFAULT closemessage - applymovement 1, MtChimney_CableCarStation_Movement_LeadPlayerToCableCar + applymovement LOCALID_ATTENDANT, MtChimney_CableCarStation_Movement_LeadPlayerToCableCar applymovement OBJ_EVENT_ID_PLAYER, MtChimney_CableCarStation_Movement_BoardCableCar waitmovement 0 setvar VAR_0x8004, 1 diff --git a/data/maps/MtPyre_Summit/scripts.inc b/data/maps/MtPyre_Summit/scripts.inc index 0fa34bcce..9daf02f5b 100644 --- a/data/maps/MtPyre_Summit/scripts.inc +++ b/data/maps/MtPyre_Summit/scripts.inc @@ -1,3 +1,11 @@ +.set LOCALID_ARCHIE, 2 +.set LOCALID_OLD_LADY, 3 +.set LOCALID_GRUNT_1, 4 +.set LOCALID_GRUNT_2, 5 +.set LOCALID_GRUNT_3, 6 +.set LOCALID_GRUNT_4, 7 +.set LOCALID_MAXIE, 8 + MtPyre_Summit_MapScripts:: @ 8231FF7 map_script MAP_SCRIPT_ON_TRANSITION, MtPyre_Summit_OnTransition .byte 0 @@ -8,8 +16,8 @@ MtPyre_Summit_OnTransition: @ 8231FFD end MtPyre_Summit_EventScript_SetArchieMaxiePositions:: @ 8232009 - setobjectxyperm 8, 23, 6 - setobjectxyperm 2, 22, 6 + setobjectxyperm LOCALID_MAXIE, 23, 6 + setobjectxyperm LOCALID_ARCHIE, 22, 6 end MtPyre_Summit_EventScript_TeamAquaTrigger0:: @ 8232018 @@ -34,7 +42,7 @@ MtPyre_Summit_EventScript_TeamAquaExits:: @ 823203C playbgm MUS_AQA_0, 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceUp waitmovement 0 - applymovement 2, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 50 compare VAR_0x8008, 0 @@ -46,11 +54,11 @@ MtPyre_Summit_EventScript_TeamAquaExits:: @ 823203C msgbox MtPyre_Summit_Text_ArchieWeGotTheOrbLetsGo, MSGBOX_DEFAULT closemessage fadescreen FADE_TO_BLACK - removeobject 2 - removeobject 4 - removeobject 5 - removeobject 6 - removeobject 7 + removeobject LOCALID_ARCHIE + removeobject LOCALID_GRUNT_1 + removeobject LOCALID_GRUNT_2 + removeobject LOCALID_GRUNT_3 + removeobject LOCALID_GRUNT_4 setflag FLAG_HIDE_MT_PYRE_SUMMIT_ARCHIE setflag FLAG_HIDE_MT_PYRE_SUMMIT_TEAM_AQUA fadedefaultbgm @@ -71,7 +79,7 @@ MtPyre_Summit_EventScript_TeamAquaExits:: @ 823203C end MtPyre_Summit_EventScript_ArchieFacePlayer0:: @ 82320E0 - applymovement 2, MtPyre_Summit_Movement_ArchieFacePlayer0 + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieFacePlayer0 waitmovement 0 return @@ -80,24 +88,24 @@ MtPyre_Summit_EventScript_ArchieFacePlayer1:: @ 82320EB return MtPyre_Summit_EventScript_ArchieFacePlayer2:: @ 82320EC - applymovement 2, MtPyre_Summit_Movement_ArchieFacePlayer2 + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieFacePlayer2 waitmovement 0 return MtPyre_Summit_EventScript_OldLadyApproachPlayer0:: @ 82320F7 - applymovement 3, MtPyre_Summit_Movement_OldLadyApproachPlayer0 + applymovement LOCALID_OLD_LADY, MtPyre_Summit_Movement_OldLadyApproachPlayer0 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return MtPyre_Summit_EventScript_OldLadyApproachPlayer1:: @ 823210C - applymovement 3, MtPyre_Summit_Movement_OldLadyApproachPlayer1 + applymovement LOCALID_OLD_LADY, MtPyre_Summit_Movement_OldLadyApproachPlayer1 waitmovement 0 return MtPyre_Summit_EventScript_OldLadyApproachPlayer2:: @ 8232117 - applymovement 3, MtPyre_Summit_Movement_OldLadyApproachPlayer2 + applymovement LOCALID_OLD_LADY, MtPyre_Summit_Movement_OldLadyApproachPlayer2 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 @@ -218,9 +226,9 @@ MtPyre_Summit_EventScript_ArchieMaxieReturnOrbs:: @ 8232210 compare VAR_0x8008, 2 call_if_eq MtPyre_Summit_EventScript_ArchieMaxieBeginExit2 playse SE_PIN - applymovement 8, Common_Movement_ExclamationMark + applymovement LOCALID_MAXIE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 8, Common_Movement_Delay48 + applymovement LOCALID_MAXIE, Common_Movement_Delay48 waitmovement 0 delay 30 compare VAR_0x8008, 0 @@ -238,78 +246,78 @@ MtPyre_Summit_EventScript_ArchieMaxieReturnOrbs:: @ 8232210 compare VAR_0x8008, 2 call_if_eq MtPyre_Summit_EventScript_MaxieApproachArchie2 delay 30 - applymovement 2, MtPyre_Summit_Movement_MaxieExit - applymovement 8, MtPyre_Summit_Movement_ArchieExit + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieExit + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieExit waitmovement 0 - removeobject 2 - removeobject 8 + removeobject LOCALID_ARCHIE + removeobject LOCALID_MAXIE setvar VAR_MT_PYRE_STATE, 3 releaseall end MtPyre_Summit_EventScript_ArchieMaxieBeginExit0:: @ 82322C4 applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerWatchArchieMaxieExit0 - applymovement 2, MtPyre_Summit_Movement_MaxieExit - applymovement 8, MtPyre_Summit_Movement_ArchieExit + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieExit + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieExit waitmovement 0 return MtPyre_Summit_EventScript_ArchieMaxieBeginExit1:: @ 82322DD applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerWatchArchieMaxieExit1 - applymovement 2, MtPyre_Summit_Movement_MaxieExit - applymovement 8, MtPyre_Summit_Movement_ArchieExit + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieExit + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieExit waitmovement 0 return MtPyre_Summit_EventScript_ArchieMaxieBeginExit2:: @ 82322F6 applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerWatchArchieMaxieExit2 - applymovement 2, MtPyre_Summit_Movement_MaxieExit - applymovement 8, MtPyre_Summit_Movement_ArchieExit + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieExit + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieExit waitmovement 0 return MtPyre_Summit_EventScript_MaxieApproachPlayer0:: @ 823230F applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerFaceMaxie0 - applymovement 2, MtPyre_Summit_Movement_ArchieWatchMaxie - applymovement 8, MtPyre_Summit_Movement_MaxieApproachPlayer0 + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieWatchMaxie + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieApproachPlayer0 waitmovement 0 return MtPyre_Summit_EventScript_MaxieApproachPlayer1:: @ 8232328 applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerFaceMaxie - applymovement 2, MtPyre_Summit_Movement_ArchieWatchMaxie - applymovement 8, MtPyre_Summit_Movement_MaxieApproachPlayer1 + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieWatchMaxie + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieApproachPlayer1 waitmovement 0 return MtPyre_Summit_EventScript_MaxieApproachPlayer2:: @ 8232341 applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerFaceMaxie - applymovement 2, MtPyre_Summit_Movement_ArchieWatchMaxie - applymovement 8, MtPyre_Summit_Movement_MaxieApproachPlayer2 + applymovement LOCALID_ARCHIE, MtPyre_Summit_Movement_ArchieWatchMaxie + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieApproachPlayer2 waitmovement 0 return MtPyre_Summit_EventScript_MaxieApproachArchie0:: @ 823235A applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerWatchMaxie - applymovement 8, MtPyre_Summit_Movement_MaxieApproachArchie0 + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieApproachArchie0 waitmovement 0 - applymovement 2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return MtPyre_Summit_EventScript_MaxieApproachArchie1:: @ 8232376 applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerWatchMaxie - applymovement 8, MtPyre_Summit_Movement_MaxieApproachArchie1 + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieApproachArchie1 waitmovement 0 - applymovement 2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return MtPyre_Summit_EventScript_MaxieApproachArchie2:: @ 8232392 applymovement OBJ_EVENT_ID_PLAYER, MtPyre_Summit_Movement_PlayerWatchMaxie - applymovement 8, MtPyre_Summit_Movement_MaxieApproachArchie2 + applymovement LOCALID_MAXIE, MtPyre_Summit_Movement_MaxieApproachArchie2 waitmovement 0 - applymovement 2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return @@ -325,7 +333,7 @@ MtPyre_Summit_Movement_PlayerFaceMaxie: @ 82323B2 walk_in_place_fastest_left step_end -MtPyre_Summit_Movement_MaxieExit: @ 82323B6 +MtPyre_Summit_Movement_ArchieExit: @ 82323B6 walk_down walk_down walk_down @@ -334,7 +342,7 @@ MtPyre_Summit_Movement_MaxieExit: @ 82323B6 walk_down step_end -MtPyre_Summit_Movement_ArchieExit: @ 82323BD +MtPyre_Summit_Movement_MaxieExit: @ 82323BD walk_down walk_down walk_down diff --git a/data/maps/NavelRock_Bottom/scripts.inc b/data/maps/NavelRock_Bottom/scripts.inc index e43f6d513..f0c73b1f8 100644 --- a/data/maps/NavelRock_Bottom/scripts.inc +++ b/data/maps/NavelRock_Bottom/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_LUGIA, 1 + NavelRock_Bottom_MapScripts:: @ 8269255 map_script MAP_SCRIPT_ON_TRANSITION, NavelRock_Bottom_OnTransition map_script MAP_SCRIPT_ON_RESUME, NavelRock_Bottom_OnResume @@ -25,7 +27,7 @@ NavelRock_Bottom_EventScript_TryRemoveLugia:: @ 826928E specialvar VAR_RESULT, GetBattleOutcome compare VAR_RESULT, B_OUTCOME_CAUGHT goto_if_ne Common_EventScript_NopReturn - removeobject 1 + removeobject LOCALID_LUGIA return NavelRock_Bottom_EventScript_Lugia:: @ 82692A2 diff --git a/data/maps/NavelRock_Harbor/scripts.inc b/data/maps/NavelRock_Harbor/scripts.inc index b138b7c5a..7c0cbed6a 100644 --- a/data/maps/NavelRock_Harbor/scripts.inc +++ b/data/maps/NavelRock_Harbor/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_SAILOR, 1 +.set LOCALID_SS_TIDAL, 2 + NavelRock_Harbor_MapScripts:: @ 82690BC .byte 0 @@ -12,8 +15,8 @@ NavelRock_Harbor_EventScript_Sailor:: @ 82690BD applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 30 - hideobjectat 1, MAP_NAVEL_ROCK_HARBOR - setvar VAR_0x8004, 2 + hideobjectat LOCALID_SAILOR, MAP_NAVEL_ROCK_HARBOR + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 waitstate diff --git a/data/maps/NavelRock_Top/scripts.inc b/data/maps/NavelRock_Top/scripts.inc index 4cb110d81..c95596ff6 100644 --- a/data/maps/NavelRock_Top/scripts.inc +++ b/data/maps/NavelRock_Top/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_HO_OH, 1 + NavelRock_Top_MapScripts:: @ 8269113 map_script MAP_SCRIPT_ON_TRANSITION, NavelRock_Top_OnTransition map_script MAP_SCRIPT_ON_RESUME, NavelRock_Top_OnResume @@ -28,7 +30,7 @@ NavelRock_Top_EventScript_TryRemoveHoOh:: @ 826915B specialvar VAR_RESULT, GetBattleOutcome compare VAR_RESULT, B_OUTCOME_CAUGHT goto_if_ne Common_EventScript_NopReturn - removeobject 1 + removeobject LOCALID_HO_OH return NavelRock_Top_EventScript_HoOh:: @ 826916F @@ -38,7 +40,7 @@ NavelRock_Top_EventScript_HoOh:: @ 826916F setvar VAR_0x8004, 3 @ num loops setvar VAR_0x8005, 35 @ delay special LoopWingFlapSE - applymovement 1, NavelRock_Top_Movement_HoOhAppear + applymovement LOCALID_HO_OH, NavelRock_Top_Movement_HoOhAppear applymovement OBJ_EVENT_ID_CAMERA, NavelRock_Top_Movement_CameraPanUp waitmovement 0 delay 50 @@ -53,7 +55,7 @@ NavelRock_Top_EventScript_HoOh:: @ 826916F setvar VAR_0x8005, 35 @ delay special LoopWingFlapSE applymovement OBJ_EVENT_ID_CAMERA, NavelRock_Top_Movement_CameraPanDown - applymovement 1, NavelRock_Top_Movement_HoOhApproach + applymovement LOCALID_HO_OH, NavelRock_Top_Movement_HoOhApproach waitmovement 0 special RemoveCameraObject setvar VAR_0x8004, SPECIES_HO_OH @@ -64,7 +66,7 @@ NavelRock_Top_EventScript_HoOh:: @ 826916F special BattleSetup_StartLegendaryBattle waitstate clearflag FLAG_SYS_CTRL_OBJ_DELETE - setvar VAR_LAST_TALKED, 1 + setvar VAR_LAST_TALKED, LOCALID_HO_OH specialvar VAR_RESULT, GetBattleOutcome compare VAR_RESULT, B_OUTCOME_WON goto_if_eq NavelRock_Top_EventScript_DefeatedHoOh diff --git a/data/maps/OldaleTown/scripts.inc b/data/maps/OldaleTown/scripts.inc index 2d1dca1ae..aeb0c3dbd 100644 --- a/data/maps/OldaleTown/scripts.inc +++ b/data/maps/OldaleTown/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_MART_EMPLOYEE, 2 +.set LOCALID_FOOTPRINTS_MAN, 3 +.set LOCALID_RIVAL, 4 + OldaleTown_MapScripts:: @ 81E8EA2 map_script MAP_SCRIPT_ON_TRANSITION, OldaleTown_OnTransition .byte 0 @@ -16,13 +20,13 @@ OldaleTown_EventScript_SetOldaleState:: @ 81E8ECC return OldaleTown_EventScript_BlockWestEntrance:: @ 81E8ED2 - setobjectxyperm 3, 1, 11 - setobjectmovementtype 3, MOVEMENT_TYPE_FACE_LEFT + setobjectxyperm LOCALID_FOOTPRINTS_MAN, 1, 11 + setobjectmovementtype LOCALID_FOOTPRINTS_MAN, MOVEMENT_TYPE_FACE_LEFT return OldaleTown_EventScript_MoveMartEmployee:: @ 81E8EDE - setobjectxyperm 2, 13, 14 - setobjectmovementtype 2, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_MART_EMPLOYEE, 13, 14 + setobjectmovementtype LOCALID_MART_EMPLOYEE, MOVEMENT_TYPE_FACE_DOWN return OldaleTown_EventScript_CitySign:: @ 81E8EEA @@ -49,14 +53,14 @@ OldaleTown_EventScript_MartEmployee:: @ 81E8EFC end OldaleTown_EventScript_GoToMartSouth:: @ 81E8F47 - applymovement 2, OldaleTown_Movement_EmployeeSouth + applymovement LOCALID_MART_EMPLOYEE, OldaleTown_Movement_EmployeeSouth applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_PlayerSouth waitmovement 0 goto OldaleTown_EventScript_ExplainPokemonMart end OldaleTown_EventScript_GoToMartNorth:: @ 81E8F5E - applymovement 2, OldaleTown_Movement_EmployeeNorth + applymovement LOCALID_MART_EMPLOYEE, OldaleTown_Movement_EmployeeNorth applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_PlayerNorth waitmovement 0 goto OldaleTown_EventScript_ExplainPokemonMart @@ -64,7 +68,7 @@ OldaleTown_EventScript_GoToMartNorth:: @ 81E8F5E OldaleTown_EventScript_GoToMartEast:: @ 81E8F75 applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_PlayerEast - applymovement 2, OldaleTown_Movement_EmployeeEast + applymovement LOCALID_MART_EMPLOYEE, OldaleTown_Movement_EmployeeEast waitmovement 0 goto OldaleTown_EventScript_ExplainPokemonMart end @@ -72,7 +76,7 @@ OldaleTown_EventScript_GoToMartEast:: @ 81E8F75 OldaleTown_EventScript_ExplainPokemonMart:: @ 81E8F8C msgbox OldaleTown_Text_ThisIsAPokemonMart, MSGBOX_DEFAULT giveitem ITEM_POTION - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq OldaleTown_EventScript_BagIsFull msgbox OldaleTown_Text_PotionExplanation, MSGBOX_DEFAULT setflag FLAG_RECEIVED_POTION_OLDALE @@ -194,7 +198,7 @@ OldaleTown_EventScript_FootprintsMan:: @ 81E901F goto_if_set FLAG_ADVENTURE_STARTED, OldaleTown_EventScript_NotBlockingPath msgbox OldaleTown_Text_DiscoveredFootprints, MSGBOX_DEFAULT closemessage - applymovement 3, Common_Movement_FaceOriginalDirection + applymovement LOCALID_FOOTPRINTS_MAN, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -202,11 +206,11 @@ OldaleTown_EventScript_FootprintsMan:: @ 81E901F OldaleTown_EventScript_BlockedPath:: @ 81E903F lockall applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_PlayerStepBack - applymovement 3, OldaleTown_Movement_BackUp + applymovement LOCALID_FOOTPRINTS_MAN, OldaleTown_Movement_BackUp waitmovement 0 msgbox OldaleTown_Text_WaitDontComeInHere, MSGBOX_DEFAULT closemessage - applymovement 3, OldaleTown_Movement_ReturnToOriginalPosition + applymovement LOCALID_FOOTPRINTS_MAN, OldaleTown_Movement_ReturnToOriginalPosition waitmovement 0 releaseall end @@ -218,7 +222,7 @@ OldaleTown_EventScript_NotBlockingPath:: @ 81E9066 OldaleTown_EventScript_Rival:: @ 81E9070 lockall - applymovement 4, Common_Movement_FacePlayer + applymovement LOCALID_RIVAL, Common_Movement_FacePlayer waitmovement 0 setvar VAR_0x8009, 0 goto OldaleTown_EventScript_ShowRivalMessage @@ -226,7 +230,7 @@ OldaleTown_EventScript_Rival:: @ 81E9070 OldaleTown_EventScript_RivalTrigger1:: @ 81E9086 lockall - applymovement 4, OldaleTown_Movement_RivalApproachPlayer1 + applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalApproachPlayer1 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 @@ -236,7 +240,7 @@ OldaleTown_EventScript_RivalTrigger1:: @ 81E9086 OldaleTown_EventScript_RivalTrigger2:: @ 81E90A6 lockall - applymovement 4, OldaleTown_Movement_RivalApproachPlayer2 + applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalApproachPlayer2 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 @@ -246,7 +250,7 @@ OldaleTown_EventScript_RivalTrigger2:: @ 81E90A6 OldaleTown_EventScript_RivalTrigger3:: @ 81E90C6 lockall - applymovement 4, OldaleTown_Movement_RivalApproachPlayer3 + applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalApproachPlayer3 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 @@ -278,9 +282,9 @@ OldaleTown_EventScript_RivalFinish:: @ 81E911A call_if_eq OldaleTown_EventScript_DoExitMovement1 compare VAR_0x8009, 1 call_if_eq OldaleTown_EventScript_DoExitMovement2 - applymovement 4, OldaleTown_Movement_RivalExit + applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalExit waitmovement 0 - removeobject 4 + removeobject LOCALID_RIVAL setvar VAR_OLDALE_RIVAL_STATE, 2 setflag FLAG_HIDE_OLDALE_TOWN_RIVAL releaseall @@ -289,13 +293,13 @@ OldaleTown_EventScript_RivalFinish:: @ 81E911A OldaleTown_EventScript_DoExitMovement1:: @ 81E9148 compare VAR_FACING, DIR_SOUTH goto_if_ne OldaleTown_EventScript_DoExitMovement2 - applymovement 4, OldaleTown_Movement_RivalExit + applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalExit waitmovement 0 return OldaleTown_EventScript_DoExitMovement2:: @ 81E915E applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_WatchRivalExit - applymovement 4, OldaleTown_Movement_RivalExit + applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalExit waitmovement 0 return diff --git a/data/maps/OldaleTown_PokemonCenter_1F/scripts.inc b/data/maps/OldaleTown_PokemonCenter_1F/scripts.inc index df405376a..0918f3c39 100644 --- a/data/maps/OldaleTown_PokemonCenter_1F/scripts.inc +++ b/data/maps/OldaleTown_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + OldaleTown_PokemonCenter_1F_MapScripts:: @ 81FC006 map_script MAP_SCRIPT_ON_TRANSITION, OldaleTown_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -8,9 +10,8 @@ OldaleTown_PokemonCenter_1F_OnTransition: @ 81FC011 call Common_EventScript_UpdateBrineyLocation end -@ VAR_0x800B is the Nurse's object event id OldaleTown_PokemonCenter_1F_EventScript_Nurse:: @ 81FC01A - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/PacifidlogTown_House2/scripts.inc b/data/maps/PacifidlogTown_House2/scripts.inc index 2dcff9f29..60b6c9961 100644 --- a/data/maps/PacifidlogTown_House2/scripts.inc +++ b/data/maps/PacifidlogTown_House2/scripts.inc @@ -58,7 +58,7 @@ PacifidlogTown_House2_EventScript_PutInEffort:: @ 8203845 PacifidlogTown_House2_EventScript_GiveFrustration:: @ 820384F msgbox PacifidlogTown_House2_Text_ViciousPokemonTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM21 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_FANCLUB_TM_THIS_WEEK special SetPacifidlogTMReceivedDay diff --git a/data/maps/PacifidlogTown_PokemonCenter_1F/scripts.inc b/data/maps/PacifidlogTown_PokemonCenter_1F/scripts.inc index 8b0f0805a..fbe42ce99 100644 --- a/data/maps/PacifidlogTown_PokemonCenter_1F/scripts.inc +++ b/data/maps/PacifidlogTown_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + PacifidlogTown_PokemonCenter_1F_MapScripts:: @ 82034A7 map_script MAP_SCRIPT_ON_TRANSITION, PacifidlogTown_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -7,9 +9,8 @@ PacifidlogTown_PokemonCenter_1F_OnTransition: @ 82034B2 setrespawn HEAL_LOCATION_PACIFIDLOG_TOWN end -@ VAR_0x800B is the Nurse's object event id PacifidlogTown_PokemonCenter_1F_EventScript_Nurse:: @ 82034B6 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/PetalburgCity/map.json b/data/maps/PetalburgCity/map.json index 190d81118..03c0950ca 100644 --- a/data/maps/PetalburgCity/map.json +++ b/data/maps/PetalburgCity/map.json @@ -61,7 +61,7 @@ "movement_range_y": 0, "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", - "script": "PetalburgCity_EventScript_Boy1", + "script": "PetalburgCity_EventScript_Boy", "flag": "0" }, { @@ -126,7 +126,7 @@ "movement_range_y": 0, "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", - "script": "PetalburgCity_EventScript_Boy2", + "script": "PetalburgCity_EventScript_GymBoy", "flag": "0" }, { diff --git a/data/maps/PetalburgCity/scripts.inc b/data/maps/PetalburgCity/scripts.inc index 70dfee72f..b7df04857 100644 --- a/data/maps/PetalburgCity/scripts.inc +++ b/data/maps/PetalburgCity/scripts.inc @@ -1,3 +1,9 @@ +.set LOCALID_WALLY, 2 +.set LOCALID_BOY, 3 +.set LOCALID_WALLYS_UNCLE, 5 +.set LOCALID_GYM_BOY, 8 +.set LOCALID_SCOTT, 9 + PetalburgCity_MapScripts:: map_script MAP_SCRIPT_ON_TRANSITION, PetalburgCity_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, PetalburgCity_OnFrame @@ -6,7 +12,7 @@ PetalburgCity_MapScripts:: PetalburgCity_OnTransition: @ 81DC2D7 setflag FLAG_VISITED_PETALBURG_CITY compare VAR_PETALBURG_CITY_STATE, 0 - call_if_eq PetalburgCity_EventScript_MoveBoyToWestEntrance + call_if_eq PetalburgCity_EventScript_MoveGymBoyToWestEntrance compare VAR_PETALBURG_CITY_STATE, 2 call_if_eq PetalburgCity_EventScript_DisableMapNameAndMusic compare VAR_PETALBURG_CITY_STATE, 4 @@ -15,8 +21,8 @@ PetalburgCity_OnTransition: @ 81DC2D7 call_if_eq PetalburgCity_EventScript_SetGymDoorsUnlocked end -PetalburgCity_EventScript_MoveBoyToWestEntrance:: @ 81DC307 - setobjectxyperm 8, 5, 11 +PetalburgCity_EventScript_MoveGymBoyToWestEntrance:: @ 81DC307 + setobjectxyperm LOCALID_GYM_BOY, 5, 11 return PetalburgCity_EventScript_DisableMapNameAndMusic:: @ 81DC30F @@ -37,15 +43,15 @@ PetalburgCity_EventScript_WallyTutorial:: @ 81DC32E lockall special SavePlayerParty special PutZigzagoonInPlayerParty - applymovement 2, PetalburgCity_Movement_WallyTutorialWally + applymovement LOCALID_WALLY, PetalburgCity_Movement_WallyTutorialWally applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_WallyTutorialPlayer waitmovement 0 msgbox Route102_Text_WatchMeCatchPokemon, MSGBOX_DEFAULT special StartWallyTutorialBattle waitstate msgbox Route102_Text_WallyIDidIt, MSGBOX_DEFAULT - applymovement 2, Common_Movement_WalkInPlaceFastestLeft, MAP_PETALBURG_CITY - waitmovement 2, MAP_PETALBURG_CITY + applymovement LOCALID_WALLY, Common_Movement_WalkInPlaceFastestLeft, MAP_PETALBURG_CITY + waitmovement LOCALID_WALLY, MAP_PETALBURG_CITY msgbox Route102_Text_LetsGoBack, MSGBOX_DEFAULT closemessage clearflag FLAG_HIDE_MAP_NAME_POPUP @@ -62,14 +68,14 @@ PetalburgCity_EventScript_WallyTutorial:: @ 81DC32E PetalburgCity_EventScript_WalkToWallyHouse:: @ 81DC390 lockall setflag FLAG_HIDE_MAP_NAME_POPUP - applymovement 5, PetalburgCity_Movement_WalkToWallyHouseUncle + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Movement_WalkToWallyHouseUncle applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_WalkToWallyHousePlayer waitmovement 0 setvar VAR_0x8004, 7 setvar VAR_0x8005, 5 opendoor VAR_0x8004, VAR_0x8005 waitdooranim - applymovement 5, PetalburgCity_Movement_WalkInsideHouseUncle + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Movement_WalkInsideHouseUncle applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_WalkInsideHousePlayer waitmovement 0 setflag FLAG_HIDE_PETALBURG_CITY_WALLYS_UNCLE @@ -84,12 +90,12 @@ PetalburgCity_EventScript_WalkToWallyHouse:: @ 81DC390 releaseall end -PetalburgCity_EventScript_Boy1:: @ 81DC3E6 +PetalburgCity_EventScript_Boy:: @ 81DC3E6 lock faceplayer msgbox PetalburgCity_Text_WaterReflection, MSGBOX_DEFAULT closemessage - applymovement 3, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BOY, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -263,13 +269,13 @@ PetalburgCity_EventScript_ShowGymToPlayer3:: @ 81DC4BE end PetalburgCity_EventScript_ShowGymToPlayer:: @ 81DC4CA - applymovement 8, Common_Movement_FacePlayer + applymovement LOCALID_GYM_BOY, Common_Movement_FacePlayer waitmovement 0 playbgm MUS_TSURETEK, 0 playse SE_PIN - applymovement 8, Common_Movement_ExclamationMark + applymovement LOCALID_GYM_BOY, Common_Movement_ExclamationMark waitmovement 0 - applymovement 8, Common_Movement_Delay48 + applymovement LOCALID_GYM_BOY, Common_Movement_Delay48 waitmovement 0 compare VAR_0x8008, 0 call_if_eq PetalburgCity_EventScript_BoyApproachPlayer0 @@ -290,63 +296,63 @@ PetalburgCity_EventScript_ShowGymToPlayer:: @ 81DC4CA compare VAR_0x8008, 3 call_if_eq PetalburgCity_EventScript_LeadPlayerToGym3 msgbox PetalburgCity_Text_ThisIsPetalburgGym, MSGBOX_DEFAULT - applymovement 8, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_GYM_BOY, Common_Movement_WalkInPlaceFastestRight applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox PetalburgCity_Text_ThisIsGymSign, MSGBOX_DEFAULT closemessage - applymovement 8, PetalburgCity_Movement_BoyWalkAway + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkAway waitmovement 0 fadedefaultbgm releaseall end PetalburgCity_EventScript_BoyApproachPlayer0:: @ 81DC57F - applymovement 8, PetalburgCity_Movement_BoyApproachPlayer0 + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyApproachPlayer0 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return PetalburgCity_EventScript_BoyApproachPlayer1:: @ 81DC594 - applymovement 8, PetalburgCity_Movement_BoyApproachPlayer1 + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyApproachPlayer1 waitmovement 0 return PetalburgCity_EventScript_BoyApproachPlayer2:: @ 81DC59F - applymovement 8, PetalburgCity_Movement_BoyApproachPlayer2 + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyApproachPlayer2 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return PetalburgCity_EventScript_BoyApproachPlayer3:: @ 81DC5B4 - applymovement 8, PetalburgCity_Movement_BoyApproachPlayer3 + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyApproachPlayer3 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return PetalburgCity_EventScript_LeadPlayerToGym0:: @ 81DC5C9 - applymovement 8, PetalburgCity_Movement_BoyWalkToGym0 + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkToGym0 applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWalkToGym0 waitmovement 0 return PetalburgCity_EventScript_LeadPlayerToGym1:: @ 81DC5DB - applymovement 8, PetalburgCity_Movement_BoyWalkToGym1 + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkToGym1 applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWalkToGym1 waitmovement 0 return PetalburgCity_EventScript_LeadPlayerToGym2:: @ 81DC5ED - applymovement 8, PetalburgCity_Movement_BoyWalkToGym2 + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkToGym2 applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWalkToGym2 waitmovement 0 return PetalburgCity_EventScript_LeadPlayerToGym3:: @ 81DC5FF - applymovement 8, PetalburgCity_Movement_BoyWalkToGym3 + applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkToGym3 applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWalkToGym3 waitmovement 0 return @@ -510,57 +516,57 @@ PetalburgCity_Movement_PlayerWalkToGym3: @ 81DC686 PetalburgCity_EventScript_Scott0:: @ 81DC691 lockall - addobject 9 + addobject LOCALID_SCOTT setvar VAR_0x8008, 0 - setobjectxy 9, 13, 10 + setobjectxy LOCALID_SCOTT, 13, 10 goto PetalburgCity_EventScript_Scott end PetalburgCity_EventScript_Scott1:: @ 81DC6A7 lockall - addobject 9 + addobject LOCALID_SCOTT setvar VAR_0x8008, 1 - setobjectxy 9, 13, 11 + setobjectxy LOCALID_SCOTT, 13, 11 goto PetalburgCity_EventScript_Scott end PetalburgCity_EventScript_Scott2:: @ 81DC6BD lockall - addobject 9 + addobject LOCALID_SCOTT setvar VAR_0x8008, 2 - setobjectxy 9, 13, 12 + setobjectxy LOCALID_SCOTT, 13, 12 goto PetalburgCity_EventScript_Scott end PetalburgCity_EventScript_Scott3:: @ 81DC6D3 lockall - addobject 9 + addobject LOCALID_SCOTT setvar VAR_0x8008, 3 - setobjectxy 9, 13, 13 + setobjectxy LOCALID_SCOTT, 13, 13 goto PetalburgCity_EventScript_Scott end PetalburgCity_EventScript_Scott:: @ 81DC6E9 - applymovement 9, PetalburgCity_Movement_ScottStartWalkLeft + applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottStartWalkLeft waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_SCOTT, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_SCOTT, Common_Movement_Delay48 waitmovement 0 - applymovement 9, PetalburgCity_Movement_ScottApproachPlayer + applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 setvar VAR_SCOTT_STATE, 1 msgbox PetalburgCity_Text_AreYouATrainer, MSGBOX_DEFAULT closemessage - applymovement 9, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 30 msgbox PetalburgCity_Text_WellMaybeNot, MSGBOX_DEFAULT closemessage - applymovement 9, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 delay 30 msgbox PetalburgCity_Text_ImLookingForTalentedTrainers, MSGBOX_DEFAULT @@ -574,31 +580,31 @@ PetalburgCity_EventScript_Scott:: @ 81DC6E9 compare VAR_0x8008, 3 call_if_eq PetalburgCity_EventScript_ScottExit3 setvar VAR_SCOTT_PETALBURG_ENCOUNTER, 1 - removeobject 9 + removeobject LOCALID_SCOTT releaseall end PetalburgCity_EventScript_ScottExit0:: @ 81DC78E applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWatchScottExit0 - applymovement 9, PetalburgCity_Movement_ScottExit0 + applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottExit0 waitmovement 0 return PetalburgCity_EventScript_ScottExit1:: @ 81DC7A0 applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWatchScottExit1 - applymovement 9, PetalburgCity_Movement_ScottExit1 + applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottExit1 waitmovement 0 return PetalburgCity_EventScript_ScottExit2:: @ 81DC7B2 applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWatchScottExit2 - applymovement 9, PetalburgCity_Movement_ScottExit2 + applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottExit2 waitmovement 0 return PetalburgCity_EventScript_ScottExit3:: @ 81DC7C4 applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWatchScottExit3 - applymovement 9, PetalburgCity_Movement_ScottExit3 + applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottExit3 waitmovement 0 return @@ -710,7 +716,7 @@ PetalburgCity_Movement_PlayerWatchScottExit3: @ 81DC828 walk_in_place_fastest_left step_end -PetalburgCity_EventScript_Boy2:: @ 81DC82E +PetalburgCity_EventScript_GymBoy:: @ 81DC82E msgbox PetalburgCity_Text_AreYouRookieTrainer, MSGBOX_NPC end diff --git a/data/maps/PetalburgCity_Gym/scripts.inc b/data/maps/PetalburgCity_Gym/scripts.inc index bc947025c..5df31917f 100644 --- a/data/maps/PetalburgCity_Gym/scripts.inc +++ b/data/maps/PetalburgCity_Gym/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_NORMAN, 1 +.set LOCALID_WALLY, 10 +.set LOCALID_WALLYS_UNCLE, 11 + PetalburgCity_Gym_MapScripts:: @ 8204889 map_script MAP_SCRIPT_ON_LOAD, PetalburgCity_Gym_OnLoad map_script MAP_SCRIPT_ON_TRANSITION, PetalburgCity_Gym_OnTransition @@ -46,11 +50,11 @@ PetalburgCity_Gym_OnTransition: @ 820492D end PetalburgCity_Gym_EventScript_MoveWallyToEntrance:: @ 820494D - setobjectxyperm 10, 5, 108 + setobjectxyperm LOCALID_WALLY, 5, 108 return PetalburgCity_Gym_EventScript_MoveNormanToEntrance:: @ 8204955 - setobjectxyperm 1, 4, 107 + setobjectxyperm LOCALID_NORMAN, 4, 107 return PetalburgCity_Gym_EventScript_CheckNormanForRematch:: @ 820495D @@ -60,7 +64,7 @@ PetalburgCity_Gym_EventScript_CheckNormanForRematch:: @ 820495D goto_if_eq PetalburgCity_Gym_EventScript_DontMoveNormanToFront compare VAR_PETALBURG_GYM_STATE, 8 goto_if_eq PetalburgCity_Gym_EventScript_DontMoveNormanToFront - setobjectxyperm 1, 4, 107 + setobjectxyperm LOCALID_NORMAN, 4, 107 return PetalburgCity_Gym_EventScript_DontMoveNormanToFront:: @ 8204985 @@ -85,10 +89,10 @@ PetalburgCity_Gym_EventScript_ReturnFromWallyTutorial:: @ 82049A4 msgbox PetalburgCity_Gym_Text_WallyThankYouBye, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown - applymovement 10, PetalburgCity_Gym_Movement_WallyExitGym + applymovement LOCALID_WALLY, PetalburgCity_Gym_Movement_WallyExitGym waitmovement 0 playse SE_KAIDAN - removeobject 10 + removeobject LOCALID_WALLY setflag FLAG_HIDE_PETALBURG_CITY_WALLY delay 30 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp @@ -146,7 +150,7 @@ PetalburgCity_Gym_EventScript_BeginWallyTutorialEast:: @ 8204AA1 end PetalburgCity_Gym_EventScript_BeginWallyTutorial:: @ 8204AAC - addobject 10 @ Wally + addobject LOCALID_WALLY playse SE_DOOR compare VAR_0x8008, 0 call_if_eq PetalburgCity_Gym_EventScript_WallyArriveSouth @@ -208,7 +212,7 @@ PetalburgCity_Gym_EventScript_BeginWallyTutorial:: @ 8204AAC call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallyWest compare VAR_0x8008, 3 call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallyEast - removeobject 10 + removeobject LOCALID_WALLY setflag FLAG_HIDE_PETALBURG_CITY_WALLYS_AUNT setvar VAR_PETALBURG_GYM_STATE, 1 setvar VAR_PETALBURG_CITY_STATE, 2 @@ -222,101 +226,101 @@ PetalburgCity_Gym_EventScript_BeginWallyTutorial:: @ 8204AAC end PetalburgCity_Gym_EventScript_WallyArriveSouth:: @ 8204C31 - applymovement 1, Common_Movement_WalkInPlaceFastestDown - applymovement 10, PetalburgCity_Gym_Movement_WallyArrive + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_WALLY, PetalburgCity_Gym_Movement_WallyArrive waitmovement 0 return PetalburgCity_Gym_EventScript_WallyArriveNorth:: @ 8204C43 - applymovement 10, PetalburgCity_Gym_Movement_WallyArriveNorth + applymovement LOCALID_WALLY, PetalburgCity_Gym_Movement_WallyArriveNorth waitmovement 0 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestRight applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return PetalburgCity_Gym_EventScript_WallyArriveWestEast:: @ 8204C5F - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown - applymovement 10, PetalburgCity_Gym_Movement_WallyArrive + applymovement LOCALID_WALLY, PetalburgCity_Gym_Movement_WallyArrive waitmovement 0 return PetalburgCity_Gym_EventScript_ExitGymWithWallySouth:: @ 8204C78 - applymovement 1, Common_Movement_WalkInPlaceFastestDown - applymovement 10, PetalburgCity_Gym_Movement_WallyExitSouthWest + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_WALLY, PetalburgCity_Gym_Movement_WallyExitSouthWest applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Gym_Movement_PlayerExitWithWallySouth waitmovement 0 return PetalburgCity_Gym_EventScript_ExitGymWithWallyNorth:: @ 8204C91 - applymovement 10, PetalburgCity_Gym_Movement_WallyExitNorth + applymovement LOCALID_WALLY, PetalburgCity_Gym_Movement_WallyExitNorth applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Gym_Movement_PlayerExitWithWallyNorth waitmovement 0 return PetalburgCity_Gym_EventScript_ExitGymWithWallyWest:: @ 8204CA3 - applymovement 10, PetalburgCity_Gym_Movement_WallyExitSouthWest + applymovement LOCALID_WALLY, PetalburgCity_Gym_Movement_WallyExitSouthWest applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Gym_Movement_PlayerExitWithWallyWest waitmovement 0 return PetalburgCity_Gym_EventScript_ExitGymWithWallyEast:: @ 8204CB5 - applymovement 10, PetalburgCity_Gym_Movement_WallyExitEast + applymovement LOCALID_WALLY, PetalburgCity_Gym_Movement_WallyExitEast applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Gym_Movement_PlayerExitWithWallyEast waitmovement 0 return PetalburgCity_Gym_EventScript_NormanAddressPlayerSouth:: @ 8204CC7 - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return PetalburgCity_Gym_EventScript_NormanAddressPlayerNorth:: @ 8204CD2 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return PetalburgCity_Gym_EventScript_NormanAddressPlayerWest:: @ 8204CE4 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestRight applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return PetalburgCity_Gym_EventScript_NormanAddressPlayerEast:: @ 8204CF6 - applymovement 1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestLeft applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return PetalburgCity_Gym_EventScript_NormanAddressWallySouth:: @ 8204D08 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return PetalburgCity_Gym_EventScript_NormanAddressWallyNorth:: @ 8204D13 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return PetalburgCity_Gym_EventScript_NormanAddressWallyWest:: @ 8204D1E - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return PetalburgCity_Gym_EventScript_NormanAddressWallyEast:: @ 8204D29 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return PetalburgCity_Gym_EventScript_WallyFacePlayer:: @ 8204D34 - applymovement 10, Common_Movement_FacePlayer + applymovement LOCALID_WALLY, Common_Movement_FacePlayer waitmovement 0 return PetalburgCity_Gym_EventScript_WallyFaceDown:: @ 8204D3F - applymovement 10, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_WALLY, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return @@ -345,7 +349,7 @@ PetalburgCity_Gym_EventScript_NormanFaceDoorSouth:: @ 8204D72 @ For all other NormanFaceDoorX, Norman is already facing the door from NormanAddressWallyX PetalburgCity_Gym_EventScript_NormanFaceDoorNorth:: @ 8204D73 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return @@ -397,7 +401,7 @@ PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry:: @ 8204E17 PetalburgCity_Gym_EventScript_GiveEnigmaBerry:: @ 8204E1D giveitem ITEM_ENIGMA_BERRY - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setvar VAR_ENIGMA_BERRY_AVAILABLE, 0 release @@ -429,7 +433,7 @@ PetalburgCity_Gym_EventScript_NormanBattle:: @ 8204E3B delay 40 playse SE_DOOR delay 10 - addobject 11 @ Wallys Uncle + addobject LOCALID_WALLYS_UNCLE switch VAR_FACING case DIR_NORTH, PetalburgCity_Gym_EventScript_WallysUncleArrivesNorth case DIR_WEST, PetalburgCity_Gym_EventScript_WallysUncleArrivesWest @@ -438,7 +442,7 @@ PetalburgCity_Gym_EventScript_NormanBattle:: @ 8204E3B PetalburgCity_Gym_EventScript_GiveFacade:: @ 8204ED2 giveitem ITEM_TM42 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_BagIsFull setflag FLAG_RECEIVED_TM42 msgbox PetalburgCity_Gym_Text_ExplainFacade, MSGBOX_DEFAULT @@ -457,12 +461,12 @@ PetalburgCity_Gym_EventScript_WallysUncleArrivesWest:: @ 8204F09 goto PetalburgCity_Gym_EventScript_WallysUncleArrives PetalburgCity_Gym_EventScript_WallysUncleArrives:: @ 8204F13 - applymovement 11, PetalburgCity_Gym_Movement_WallysUncleEnterGym + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Gym_Movement_WallysUncleEnterGym waitmovement 0 playse SE_PIN - applymovement 11, Common_Movement_ExclamationMark + applymovement LOCALID_WALLYS_UNCLE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 11, Common_Movement_Delay48 + applymovement LOCALID_WALLYS_UNCLE, Common_Movement_Delay48 waitmovement 0 delay 10 compare VAR_0x8008, 1 @@ -490,7 +494,7 @@ PetalburgCity_Gym_EventScript_WallysUncleArrives:: @ 8204F13 call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallysUncleEast compare VAR_0x8008, 3 call_if_eq PetalburgCity_Gym_EventScript_ExitGymWithWallysUncleWest - removeobject 11 + removeobject LOCALID_WALLYS_UNCLE setvar VAR_PETALBURG_CITY_STATE, 4 clearflag FLAG_HIDE_PETALBURG_CITY_WALLYS_UNCLE warp MAP_PETALBURG_CITY, 255, 15, 8 @@ -499,59 +503,59 @@ PetalburgCity_Gym_EventScript_WallysUncleArrives:: @ 8204F13 end PetalburgCity_Gym_EventScript_WallysUncleFaceNormanNorth:: @ 8204FCC - applymovement 11, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_WALLYS_UNCLE, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return PetalburgCity_Gym_EventScript_WallysUncleFaceNormanEast:: @ 8204FD7 - applymovement 11, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLYS_UNCLE, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return PetalburgCity_Gym_EventScript_WallysUncleFaceNormanWest:: @ 8204FE2 - applymovement 11, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_WALLYS_UNCLE, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return PetalburgCity_Gym_EventScript_WallysUncleApproachPlayerNorth:: @ 8204FED - applymovement 11, PetalburgCity_Gym_Movement_WallysUncleApproachPlayerNorth + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Gym_Movement_WallysUncleApproachPlayerNorth waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft - applymovement 1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return PetalburgCity_Gym_EventScript_WallysUncleApproachPlayerEast:: @ 8205009 - applymovement 11, PetalburgCity_Gym_Movement_WallysUncleApproachPlayerEast + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Gym_Movement_WallysUncleApproachPlayerEast waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return PetalburgCity_Gym_EventScript_WallysUncleApproachPlayerWest:: @ 8205025 - applymovement 11, PetalburgCity_Gym_Movement_WallysUncleApproachPlayerWest + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Gym_Movement_WallysUncleApproachPlayerWest waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return PetalburgCity_Gym_EventScript_ExitGymWithWallysUncleNorth:: @ 8205041 - applymovement 11, PetalburgCity_Gym_Movement_WallysUncleExitNorth - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Gym_Movement_WallysUncleExitNorth + applymovement LOCALID_NORMAN, Common_Movement_WalkInPlaceFastestDown applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Gym_Movement_PlayerExitWithWallysUncleNorth waitmovement 0 return PetalburgCity_Gym_EventScript_ExitGymWithWallysUncleEast:: @ 820505A - applymovement 11, PetalburgCity_Gym_Movement_WallysUncleExitEast + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Gym_Movement_WallysUncleExitEast applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Gym_Movement_PlayerExitWithWallysUncleEast waitmovement 0 return PetalburgCity_Gym_EventScript_ExitGymWithWallysUncleWest:: @ 820506C - applymovement 11, PetalburgCity_Gym_Movement_WallysUncleExitWest + applymovement LOCALID_WALLYS_UNCLE, PetalburgCity_Gym_Movement_WallysUncleExitWest applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Gym_Movement_PlayerExitWithWallysUncleWest waitmovement 0 return diff --git a/data/maps/PetalburgCity_PokemonCenter_1F/scripts.inc b/data/maps/PetalburgCity_PokemonCenter_1F/scripts.inc index 151cd8afb..591014164 100644 --- a/data/maps/PetalburgCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/PetalburgCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + PetalburgCity_PokemonCenter_1F_MapScripts:: @ 82079E8 map_script MAP_SCRIPT_ON_TRANSITION, PetalburgCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -8,9 +10,8 @@ PetalburgCity_PokemonCenter_1F_OnTransition: @ 82079F3 call Common_EventScript_UpdateBrineyLocation end -@ VAR_0x800B is the Nurse's object event id PetalburgCity_PokemonCenter_1F_EventScript_Nurse:: @ 82079FC - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress @@ -30,7 +31,7 @@ PetalburgCity_PokemonCenter_1F_EventScript_Woman:: @ 8207A1C faceplayer msgbox PetalburgCity_PokemonCenter_1F_Text_ManyTypesOfPokemon, MSGBOX_DEFAULT specialvar VAR_RESULT, IsStarterInParty - compare VAR_RESULT, 1 + compare VAR_RESULT, TRUE goto_if_eq PetalburgCity_PokemonCenter_1F_EventScript_SayStarterTypeInfo release end diff --git a/data/maps/PetalburgCity_WallysHouse/scripts.inc b/data/maps/PetalburgCity_WallysHouse/scripts.inc index c4be6b292..a46f5d78d 100644 --- a/data/maps/PetalburgCity_WallysHouse/scripts.inc +++ b/data/maps/PetalburgCity_WallysHouse/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WALLYS_UNCLE, 1 + PetalburgCity_WallysHouse_MapScripts:: @ 8204229 map_script MAP_SCRIPT_ON_FRAME_TABLE, PetalburgCity_WallysHouse_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, PetalburgCity_WallysHouse_OnWarp @@ -9,7 +11,7 @@ PetalburgCity_WallysHouse_OnWarp: @ 8204234 PetalburgCity_WallysHouse_EventScript_PlayerUncleFaceEachOther:: @ 820423E turnobject OBJ_EVENT_ID_PLAYER, DIR_EAST - turnobject 1, DIR_WEST + turnobject LOCALID_WALLYS_UNCLE, DIR_WEST end PetalburgCity_WallysHouse_OnFrame: @ 8204247 diff --git a/data/maps/PetalburgWoods/scripts.inc b/data/maps/PetalburgWoods/scripts.inc index bbd888e05..292c2dfac 100644 --- a/data/maps/PetalburgWoods/scripts.inc +++ b/data/maps/PetalburgWoods/scripts.inc @@ -1,37 +1,40 @@ +.set LOCALID_GRUNT, 3 +.set LOCALID_DEVON_EMPLOYEE, 4 + PetalburgWoods_MapScripts:: @ 822DFD6 .byte 0 PetalburgWoods_EventScript_DevonResearcherLeft:: @ 822DFD7 lockall call PetalburgWoods_EventScript_DevonResearcherIntro - applymovement 4, PetalburgWoods_Movement_DevonResearcherApproachPlayerLeft + applymovement LOCALID_DEVON_EMPLOYEE, PetalburgWoods_Movement_DevonResearcherApproachPlayerLeft waitmovement 0 msgbox PetalburgWoods_Text_HaveYouSeenShroomish, MSGBOX_DEFAULT closemessage playbgm MUS_AQA_0, 0 - applymovement 3, PetalburgWoods_Movement_AquaEntrance + applymovement LOCALID_GRUNT, PetalburgWoods_Movement_AquaEntrance waitmovement 0 msgbox PetalburgWoods_Text_IWasGoingToAmbushYou, MSGBOX_DEFAULT closemessage - applymovement 3, PetalburgWoods_Movement_AquaApproachResearcherLeft + applymovement LOCALID_GRUNT, PetalburgWoods_Movement_AquaApproachResearcherLeft waitmovement 0 - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox PetalburgWoods_Text_HandOverThosePapers, MSGBOX_DEFAULT closemessage - applymovement 4, PetalburgWoods_Movement_DevonResearcherFleeToPlayerLeft + applymovement LOCALID_DEVON_EMPLOYEE, PetalburgWoods_Movement_DevonResearcherFleeToPlayerLeft waitmovement 0 msgbox PetalburgWoods_Text_YouHaveToHelpMe, MSGBOX_DEFAULT closemessage - applymovement 3, PetalburgWoods_Movement_AquaApproachPlayer + applymovement LOCALID_GRUNT, PetalburgWoods_Movement_AquaApproachPlayer waitmovement 0 msgbox PetalburgWoods_Text_NoOneCrossesTeamAqua, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_GRUNT_PETALBURG_WOODS, PetalburgWoods_Text_YoureKiddingMe - applymovement 3, PetalburgWoods_Movement_AquaBackOff + applymovement LOCALID_GRUNT, PetalburgWoods_Movement_AquaBackOff waitmovement 0 call PetalburgWoods_EventScript_DevonResearcherPostBattle applymovement OBJ_EVENT_ID_PLAYER, PetalburgWoods_Movement_WatchResearcherLeave - applymovement 4, PetalburgWoods_Movement_DevonResearcherExitLeft + applymovement LOCALID_DEVON_EMPLOYEE, PetalburgWoods_Movement_DevonResearcherExitLeft waitmovement 0 goto PetalburgWoods_EventScript_RemoveDevonResearcher end @@ -39,41 +42,41 @@ PetalburgWoods_EventScript_DevonResearcherLeft:: @ 822DFD7 PetalburgWoods_EventScript_DevonResearcherRight:: @ 822E079 lockall call PetalburgWoods_EventScript_DevonResearcherIntro - applymovement 4, PetalburgWoods_Movement_DevonResearcherApproachPlayerRight + applymovement LOCALID_DEVON_EMPLOYEE, PetalburgWoods_Movement_DevonResearcherApproachPlayerRight waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox PetalburgWoods_Text_HaveYouSeenShroomish, MSGBOX_DEFAULT closemessage playbgm MUS_AQA_0, 0 - applymovement 3, PetalburgWoods_Movement_AquaEntrance + applymovement LOCALID_GRUNT, PetalburgWoods_Movement_AquaEntrance waitmovement 0 msgbox PetalburgWoods_Text_IWasGoingToAmbushYou, MSGBOX_DEFAULT closemessage - applymovement 3, PetalburgWoods_Movement_AquaApproachResearcherRight + applymovement LOCALID_GRUNT, PetalburgWoods_Movement_AquaApproachResearcherRight waitmovement 0 - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox PetalburgWoods_Text_HandOverThosePapers, MSGBOX_DEFAULT closemessage - applymovement 4, PetalburgWoods_Movement_DevonResearcherFleeToPlayerRight + applymovement LOCALID_DEVON_EMPLOYEE, PetalburgWoods_Movement_DevonResearcherFleeToPlayerRight waitmovement 0 msgbox PetalburgWoods_Text_YouHaveToHelpMe, MSGBOX_DEFAULT applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox PetalburgWoods_Text_NoOneCrossesTeamAqua, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_GRUNT_PETALBURG_WOODS, PetalburgWoods_Text_YoureKiddingMe - applymovement 3, PetalburgWoods_Movement_AquaBackOff + applymovement LOCALID_GRUNT, PetalburgWoods_Movement_AquaBackOff waitmovement 0 call PetalburgWoods_EventScript_DevonResearcherPostBattle applymovement OBJ_EVENT_ID_PLAYER, PetalburgWoods_Movement_WatchResearcherLeave - applymovement 4, PetalburgWoods_Movement_DevonResearcherExitRight + applymovement LOCALID_DEVON_EMPLOYEE, PetalburgWoods_Movement_DevonResearcherExitRight waitmovement 0 goto PetalburgWoods_EventScript_RemoveDevonResearcher end PetalburgWoods_EventScript_DevonResearcherIntro:: @ 822E124 - applymovement 4, PetalburgWoods_Movement_DevonResearcherLookAround + applymovement LOCALID_DEVON_EMPLOYEE, PetalburgWoods_Movement_DevonResearcherLookAround waitmovement 0 msgbox PetalburgWoods_Text_NotAOneToBeFound, MSGBOX_DEFAULT closemessage @@ -82,14 +85,14 @@ PetalburgWoods_EventScript_DevonResearcherIntro:: @ 822E124 PetalburgWoods_EventScript_DevonResearcherPostBattle:: @ 822E138 msgbox PetalburgWoods_Text_YouveGotSomeNerve, MSGBOX_DEFAULT closemessage - applymovement 3, PetalburgWoods_Movement_AquaRunAway + applymovement LOCALID_GRUNT, PetalburgWoods_Movement_AquaRunAway waitmovement 0 - removeobject 3 + removeobject LOCALID_GRUNT applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox PetalburgWoods_Text_ThatWasAwfullyClose, MSGBOX_DEFAULT giveitem ITEM_GREAT_BALL - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq PetalburgWoods_EventScript_BagFull goto PetalburgWoods_EventScript_DevonResearcherFinish end @@ -101,14 +104,14 @@ PetalburgWoods_EventScript_BagFull:: @ 822E17D PetalburgWoods_EventScript_DevonResearcherFinish:: @ 822E18B msgbox PetalburgWoods_Text_TeamAquaAfterSomethingInRustboro, MSGBOX_DEFAULT - applymovement 4, PetalburgWoods_Movement_DevonResearcherStartExit + applymovement LOCALID_DEVON_EMPLOYEE, PetalburgWoods_Movement_DevonResearcherStartExit waitmovement 0 msgbox PetalburgWoods_Text_ICantBeWastingTime, MSGBOX_DEFAULT closemessage return PetalburgWoods_EventScript_RemoveDevonResearcher:: @ 822E1A7 - removeobject 4 + removeobject LOCALID_DEVON_EMPLOYEE setvar VAR_PETALBURG_WOODS_STATE, 1 releaseall end @@ -252,7 +255,7 @@ PetalburgWoods_EventScript_Girl:: @ 822E222 goto_if_set FLAG_RECEIVED_MIRACLE_SEED, PetalburgWoods_EventScript_ExplainMiracleSeed msgbox PetalburgWoods_Text_TryUsingThisItem, MSGBOX_DEFAULT giveitem ITEM_MIRACLE_SEED - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_MIRACLE_SEED release @@ -279,11 +282,11 @@ PetalburgWoods_EventScript_Lyle:: @ 822E26D PetalburgWoods_EventScript_James:: @ 822E284 trainerbattle_single TRAINER_JAMES_1, PetalburgWoods_Text_InstantlyPopularWithBugPokemon, PetalburgWoods_Text_CantBePopularIfILose, PetalburgWoods_EventScript_TryRegisterJames specialvar VAR_RESULT, ShouldTryRematchBattle - compare VAR_RESULT, 1 + compare VAR_RESULT, TRUE goto_if_eq PetalburgWoods_EventScript_JamesRematch setvar VAR_0x8004, TRAINER_JAMES_1 specialvar VAR_RESULT, IsTrainerRegistered - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq PetalburgWoods_EventScript_TryRegisterJames2 msgbox PetalburgWoods_Text_PeopleRespectYou, MSGBOX_DEFAULT release diff --git a/data/maps/Route101/scripts.inc b/data/maps/Route101/scripts.inc index e1805b73d..647c9ee16 100644 --- a/data/maps/Route101/scripts.inc +++ b/data/maps/Route101/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_BIRCH, 2 +.set LOCALID_ZIGZAGOON, 4 + Route101_MapScripts:: @ 81EBCBA map_script MAP_SCRIPT_ON_TRANSITION, Route101_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, Route101_OnFrame @@ -21,19 +24,19 @@ Route101_EventScript_StartBirchRescue:: @ 81EBCDE playbgm MUS_EVENT0, 1 msgbox Route101_Text_HelpMe, MSGBOX_DEFAULT closemessage - setobjectxy 2, 0, 15 - setobjectxy 4, 0, 16 + setobjectxy LOCALID_BIRCH, 0, 15 + setobjectxy LOCALID_ZIGZAGOON, 0, 16 applymovement OBJ_EVENT_ID_PLAYER, Route101_Movement_EnterScene - applymovement 2, Route101_Movement_BirchRunAway1 - applymovement 4, Route101_Movement_PoochyenaChase1 + applymovement LOCALID_BIRCH, Route101_Movement_BirchRunAway1 + applymovement LOCALID_ZIGZAGOON, Route101_Movement_ZigzagoonChase1 waitmovement 0 - applymovement 4, Route101_Movement_PoochyenaChaseInCircles - applymovement 2, Route101_Movement_BirchRunInCircles + applymovement LOCALID_ZIGZAGOON, Route101_Movement_ZigzagoonChaseInCircles + applymovement LOCALID_BIRCH, Route101_Movement_BirchRunInCircles waitmovement 0 - applymovement 2, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFastestRight waitmovement 0 - applymovement 4, Route101_Movement_PoochyenaFaceBirch - applymovement 2, Route101_Movement_BirchFacePoochyena + applymovement LOCALID_ZIGZAGOON, Route101_Movement_ZigzagoonFaceBirch + applymovement LOCALID_BIRCH, Route101_Movement_BirchFaceZigzagoon waitmovement 0 msgbox Route101_Text_PleaseHelp, MSGBOX_DEFAULT closemessage @@ -80,7 +83,7 @@ Route101_Movement_PreventExitNorth: @ 81EBD94 walk_down step_end -Route101_Movement_PoochyenaChaseInCircles: @ 81EBD96 +Route101_Movement_ZigzagoonChaseInCircles: @ 81EBD96 walk_fast_up walk_fast_up walk_fast_up @@ -113,7 +116,7 @@ Route101_Movement_PoochyenaChaseInCircles: @ 81EBD96 walk_fast_left step_end -Route101_Movement_PoochyenaChase1: @ 81EBDB5 +Route101_Movement_ZigzagoonChase1: @ 81EBDB5 walk_fast_up walk_fast_right walk_fast_right @@ -125,7 +128,7 @@ Route101_Movement_PoochyenaChase1: @ 81EBDB5 @ Leftover data? This command is unused. step_end -Route101_Movement_PoochyenaFaceBirch: @ 81EBDBD +Route101_Movement_ZigzagoonFaceBirch: @ 81EBDBD walk_in_place_fast_left walk_in_place_fast_left walk_in_place_fast_left @@ -185,7 +188,7 @@ Route101_Movement_BirchRunAway1: @ 81EBDE7 @ Leftover data? This command is unused. step_end -Route101_Movement_BirchFacePoochyena: @ 81EBDEF +Route101_Movement_BirchFaceZigzagoon: @ 81EBDEF walk_in_place_fast_right walk_in_place_fast_right walk_in_place_fast_right @@ -221,13 +224,13 @@ Route101_EventScript_BirchsBag:: @ 81EBE16 setflag FLAG_SYS_POKEMON_GET setflag FLAG_RESCUED_BIRCH fadescreen FADE_TO_BLACK - removeobject 4 + removeobject LOCALID_ZIGZAGOON setobjectxy OBJ_EVENT_ID_PLAYER, 6, 13 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 special ChooseStarter waitstate - applymovement 2, Route101_Movement_BirchApproachPlayer + applymovement LOCALID_BIRCH, Route101_Movement_BirchApproachPlayer waitmovement 0 msgbox Route101_Text_YouSavedMe, MSGBOX_DEFAULT special HealPlayerParty diff --git a/data/maps/Route103/scripts.inc b/data/maps/Route103/scripts.inc index 34f832b1e..df8c3b628 100644 --- a/data/maps/Route103/scripts.inc +++ b/data/maps/Route103/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_RIVAL, 2 + Route103_MapScripts:: @ 81EC38E map_script MAP_SCRIPT_ON_TRANSITION, Route103_OnTransition map_script MAP_SCRIPT_ON_LOAD, Route103_OnLoad @@ -30,11 +32,11 @@ Route103_EventScript_RivalMay:: @ 81EC3DA msgbox Route103_Text_MayRoute103Pokemon, MSGBOX_DEFAULT closemessage playbgm MUS_GIRL_SUP, 1 - applymovement 2, Common_Movement_FacePlayer + applymovement LOCALID_RIVAL, Common_Movement_FacePlayer waitmovement 0 - applymovement 2, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 2, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 msgbox Route103_Text_MayLetsBattle, MSGBOX_DEFAULT switch VAR_STARTER_MON @@ -47,11 +49,11 @@ Route103_EventScript_RivalBrendan:: @ 81EC434 msgbox Route103_Text_BrendanRoute103Pokemon, MSGBOX_DEFAULT closemessage playbgm MUS_BOY_SUP, 1 - applymovement 2, Common_Movement_FacePlayer + applymovement LOCALID_RIVAL, Common_Movement_FacePlayer waitmovement 0 - applymovement 2, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 2, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 msgbox Route103_Text_BrendanLetsBattle, MSGBOX_DEFAULT switch VAR_STARTER_MON @@ -111,35 +113,35 @@ Route103_EventScript_RivalExit:: @ 81EC50A Route103_EventScript_RivalExitFacingNorth:: @ 81EC53D applymovement OBJ_EVENT_ID_PLAYER, Route103_Movement_WatchRivalExitFacingNorth - applymovement 2, Route103_Movement_RivalExitFacingNorth1 + applymovement LOCALID_RIVAL, Route103_Movement_RivalExitFacingNorth1 waitmovement 0 playse SE_DANSA - applymovement 2, Route103_EventScript_RivalExitFacingNorth2 + applymovement LOCALID_RIVAL, Route103_EventScript_RivalExitFacingNorth2 waitmovement 0 goto Route103_EventScript_RivalEnd end Route103_EventScript_RivalExitFacingEastOrWest:: @ 81EC561 applymovement OBJ_EVENT_ID_PLAYER, Route103_Movement_WatchRivalExitFacingEastOrWest - applymovement 2, Route103_Movement_RivalExit1 + applymovement LOCALID_RIVAL, Route103_Movement_RivalExit1 waitmovement 0 playse SE_DANSA - applymovement 2, Route103_Movement_RivalExit2 + applymovement LOCALID_RIVAL, Route103_Movement_RivalExit2 waitmovement 0 goto Route103_EventScript_RivalEnd end Route103_EventScript_RivalExitFacingSouth:: @ 81EC585 - applymovement 2, Route103_Movement_RivalExit1 + applymovement LOCALID_RIVAL, Route103_Movement_RivalExit1 waitmovement 0 playse SE_DANSA - applymovement 2, Route103_Movement_RivalExit2 + applymovement LOCALID_RIVAL, Route103_Movement_RivalExit2 waitmovement 0 goto Route103_EventScript_RivalEnd end Route103_EventScript_RivalEnd:: @ 81EC5A2 - removeobject 2 + removeobject LOCALID_RIVAL setvar VAR_BIRCH_LAB_STATE, 4 clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_RIVAL setflag FLAG_DEFEATED_RIVAL_ROUTE103 diff --git a/data/maps/Route104/scripts.inc b/data/maps/Route104/scripts.inc index e7e698be6..ff9003887 100644 --- a/data/maps/Route104/scripts.inc +++ b/data/maps/Route104/scripts.inc @@ -1,3 +1,7 @@ +@ NOTE: Route 104's sail to Dewford script references local IDs from Dewford's map. +@ These are labeled in DewfordTown/scripts.inc +.set LOCALID_RIVAL, 34 + Route104_MapScripts:: @ 81ECC32 map_script MAP_SCRIPT_ON_FRAME_TABLE, Route104_OnFrame map_script MAP_SCRIPT_ON_TRANSITION, Route104_OnTransition @@ -33,7 +37,7 @@ Route104_EventScript_TrySetRivalPos:: @ 81ECC78 goto_if_ge Route104_EventScript_DontSetRivalPos goto_if_set FLAG_MET_RIVAL_RUSTBORO, Route104_EventScript_DontSetRivalPos goto_if_unset FLAG_REGISTER_RIVAL_POKENAV, Route104_EventScript_DontSetRivalPos - setobjectxyperm 34, 17, 52 + setobjectxyperm LOCALID_RIVAL, 17, 52 return Route104_EventScript_DontSetRivalPos:: @ 81ECC9D @@ -42,7 +46,7 @@ Route104_EventScript_DontSetRivalPos:: @ 81ECC9D Route104_EventScript_Rival:: @ 81ECC9E lockall setvar VAR_0x8008, 1 - applymovement 34, Common_Movement_FacePlayer + applymovement LOCALID_RIVAL, Common_Movement_FacePlayer waitmovement 0 goto Route104_EventScript_RivalEncounter @@ -54,19 +58,19 @@ Route104_EventScript_RivalTrigger:: @ 81ECCB3 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 delay 10 - addobject 34 + addobject LOCALID_RIVAL clearflag FLAG_HIDE_ROUTE_104_RIVAL applymovement OBJ_EVENT_ID_PLAYER, Route104_Movement_PlayerBackUp waitmovement 0 - applymovement 34, Route104_Movement_RivalExitBrineysCottage + applymovement LOCALID_RIVAL, Route104_Movement_RivalExitBrineysCottage waitmovement 0 delay 20 setvar VAR_0x8008, 0 call RustboroCity_EventScript_PlayRivalMusic playse SE_PIN - applymovement 34, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 34, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 goto Route104_EventScript_RivalEncounter @@ -109,13 +113,13 @@ Route104_EventScript_MayEncounter:: @ 81ECD4B delay 30 setflag FLAG_ENABLE_RIVAL_MATCH_CALL applymovement OBJ_EVENT_ID_PLAYER, Route104_Movement_PlayerFaceRival - applymovement 34, Route104_Movement_RivalWalkSlowLeft + applymovement LOCALID_RIVAL, Route104_Movement_RivalWalkSlowLeft msgbox Route104_Text_MayHowsYourPokedex, MSGBOX_DEFAULT closemessage waitmovement 0 - applymovement 34, Route104_Movement_RivalApproachPlayer + applymovement LOCALID_RIVAL, Route104_Movement_RivalApproachPlayer waitmovement 0 - copyobjectxytoperm 34 + copyobjectxytoperm LOCALID_RIVAL msgbox Route104_Text_MayMinesDecentLetsBattle, MSGBOX_YESNO compare VAR_RESULT, YES goto_if_eq Route104_EventScript_BattleMay @@ -198,13 +202,13 @@ Route104_EventScript_BrendanEncounter:: @ 81ECE6F delay 30 setflag FLAG_ENABLE_RIVAL_MATCH_CALL applymovement OBJ_EVENT_ID_PLAYER, Route104_Movement_PlayerFaceRival - applymovement 34, Route104_Movement_RivalWalkSlowLeft + applymovement LOCALID_RIVAL, Route104_Movement_RivalWalkSlowLeft msgbox Route104_Text_BrendanHowsYourPokedex, MSGBOX_DEFAULT closemessage waitmovement 0 - applymovement 34, Route104_Movement_RivalApproachPlayer + applymovement LOCALID_RIVAL, Route104_Movement_RivalApproachPlayer waitmovement 0 - copyobjectxytoperm 34 + copyobjectxytoperm LOCALID_RIVAL msgbox Route104_Text_BrendanDoingGreatLetsBattle, MSGBOX_YESNO compare VAR_RESULT, YES goto_if_eq Route104_EventScript_BattleBrendan @@ -357,11 +361,11 @@ Route104_EventScript_Girl2:: @ 81ED090 end Route104_EventScript_SailToDewford:: @ 81ED099 - setobjectpriority 8, MAP_ROUTE104, 0 + setobjectpriority LOCALID_BRINEY_R104, MAP_ROUTE104, 0 setobjectpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE104, 0 - applymovement 8, Route104_Movement_BrineyBoardBoat + applymovement LOCALID_BRINEY_R104, Route104_Movement_BrineyBoardBoat waitmovement 0 - removeobject 8 + removeobject LOCALID_BRINEY_R104 applymovement OBJ_EVENT_ID_PLAYER, Route104_Movement_PlayerBoardBoat waitmovement 0 hideobjectat OBJ_EVENT_ID_PLAYER, MAP_ROUTE104 @@ -371,13 +375,13 @@ Route104_EventScript_SailToDewford:: @ 81ED099 end Route104_EventScript_SailToDewfordNoCall:: @ 81ED0D9 - applymovement 7, Route104_Movement_SailToDewford + applymovement LOCALID_BOAT_R104, Route104_Movement_SailToDewford applymovement OBJ_EVENT_ID_PLAYER, Route104_Movement_SailToDewford waitmovement 0 goto Route104_EventScript_ArriveInDewford Route104_EventScript_SailToDewfordDadCalls:: @ 81ED0EF - applymovement 7, Route104_Movement_SailToDewfordBeforeDadCalls + applymovement LOCALID_BOAT_R104, Route104_Movement_SailToDewfordBeforeDadCalls applymovement OBJ_EVENT_ID_PLAYER, Route104_Movement_SailToDewfordBeforeDadCalls waitmovement 0 pokenavcall Route104_Text_DadPokenavCall @@ -390,8 +394,8 @@ Route104_EventScript_SailToDewfordDadCalls:: @ 81ED0EF delay 30 setflag FLAG_ENABLE_NORMAN_MATCH_CALL applymovement OBJ_EVENT_ID_PLAYER, Route104_Movement_SailToDewfordAfterDadCalls - applymovement 7, Route104_Movement_SailToDewfordAfterDadCalls, MAP_ROUTE104 - waitmovement 7, MAP_ROUTE104 + applymovement LOCALID_BOAT_R104, Route104_Movement_SailToDewfordAfterDadCalls, MAP_ROUTE104 + waitmovement LOCALID_BOAT_R104, MAP_ROUTE104 waitmovement 0 goto Route104_EventScript_ArriveInDewford @@ -403,21 +407,21 @@ Route104_EventScript_ArriveInDewford:: @ 81ED139 showobjectat OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN applymovement OBJ_EVENT_ID_PLAYER, Route104_Movement_PlayerMoveForBriney waitmovement 0 - setobjectxyperm 2, 12, 8 - addobject 2 - setobjectpriority 2, MAP_DEWFORD_TOWN, 0 + setobjectxyperm LOCALID_BRINEY_DEWFORD, 12, 8 + addobject LOCALID_BRINEY_DEWFORD + setobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 clearflag FLAG_HIDE_MR_BRINEY_DEWFORD_TOWN - applymovement 2, Route104_Movement_BrineyExitBoat + applymovement LOCALID_BRINEY_DEWFORD, Route104_Movement_BrineyExitBoat waitmovement 0 - addobject 4 + addobject LOCALID_BOAT_DEWFORD clearflag FLAG_HIDE_MR_BRINEY_BOAT_DEWFORD_TOWN call Common_EventScript_StopBrineysBoatMusic setflag FLAG_HIDE_ROUTE_104_MR_BRINEY_BOAT - hideobjectat 7, MAP_ROUTE104 + hideobjectat LOCALID_BOAT_R104, MAP_ROUTE104 copyvar VAR_BRINEY_LOCATION, VAR_0x8008 resetobjectpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE104 - resetobjectpriority 2, MAP_DEWFORD_TOWN - copyobjectxytoperm 2 + resetobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN + copyobjectxytoperm LOCALID_BRINEY_DEWFORD setvar VAR_BOARD_BRINEY_BOAT_STATE, 0 goto_if_unset FLAG_DELIVERED_STEVEN_LETTER, Route104_EventScript_DeliverLetterReminder goto_if_set FLAG_DELIVERED_STEVEN_LETTER, Route104_EventScript_LandedInDewford diff --git a/data/maps/Route104_MrBrineysHouse/scripts.inc b/data/maps/Route104_MrBrineysHouse/scripts.inc index 10fdddee3..aef3ae80f 100644 --- a/data/maps/Route104_MrBrineysHouse/scripts.inc +++ b/data/maps/Route104_MrBrineysHouse/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_BRINEY, 1 +.set LOCALID_PEEKO, 2 + Route104_MrBrineysHouse_MapScripts:: @ 8229D2E map_script MAP_SCRIPT_ON_TRANSITION, Route104_MrBrineysHouse_OnTransition .byte 0 @@ -14,10 +17,10 @@ Route104_MrBrineysHouse_EventScript_HideRustboroRival:: @ 8229D4C return Route104_MrBrineysHouse_EventScript_SetBrineyPeekoPos:: @ 8229D50 - setobjectxyperm 1, 9, 3 - setobjectmovementtype 1, MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_UP_RIGHT - setobjectxyperm 2, 9, 6 - setobjectmovementtype 2, MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_RIGHT_DOWN + setobjectxyperm LOCALID_BRINEY, 9, 3 + setobjectmovementtype LOCALID_BRINEY, MOVEMENT_TYPE_WALK_SEQUENCE_DOWN_LEFT_UP_RIGHT + setobjectxyperm LOCALID_PEEKO, 9, 6 + setobjectmovementtype LOCALID_PEEKO, MOVEMENT_TYPE_WALK_SEQUENCE_LEFT_UP_RIGHT_DOWN return Route104_MrBrineysHouse_EventScript_Briney:: @ 8229D67 diff --git a/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc b/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc index 253ae7192..e2ed46ddc 100644 --- a/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc +++ b/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_OWNER, 1 + Route104_PrettyPetalFlowerShop_MapScripts:: @ 822A34C map_script MAP_SCRIPT_ON_TRANSITION, Route104_PrettyPetalFlowerShop_OnTransition .byte 0 @@ -10,7 +12,7 @@ Route104_PrettyPetalFlowerShop_OnTransition: @ 822A352 end Route104_PrettyPetalFlowerShop_EventScript_MoveShopOwner:: @ 822A36B - setobjectxyperm 1, 4, 6 + setobjectxyperm LOCALID_OWNER, 4, 6 end Route104_PrettyPetalFlowerShop_EventScript_ShopOwner:: @ 822A373 diff --git a/data/maps/Route109/scripts.inc b/data/maps/Route109/scripts.inc index 39fa352e4..26da7f2b5 100644 --- a/data/maps/Route109/scripts.inc +++ b/data/maps/Route109/scripts.inc @@ -1,13 +1,16 @@ +@ NOTE: Route 109's sail to Dewford script references local IDs from Dewford's map. +@ These are labeled in DewfordTown/scripts.inc + Route109_MapScripts:: @ 81EE75F .byte 0 Route109_EventScript_StartDepartForDewford:: @ 81EE760 call EventScript_BackupMrBrineyLocation - setobjectpriority 2, MAP_ROUTE109, 0 + setobjectpriority LOCALID_BRINEY_R109, MAP_ROUTE109, 0 setobjectpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE109, 0 - applymovement 2, Route109_Movement_BrineyEnterBoat + applymovement LOCALID_BRINEY_R109, Route109_Movement_BrineyEnterBoat waitmovement 0 - removeobject 2 + removeobject LOCALID_BRINEY_R109 switch VAR_FACING case DIR_SOUTH, Route109_EventScript_EnterBoatSouth case DIR_WEST, Route109_EventScript_EnterBoatWest @@ -35,7 +38,7 @@ Route109_EventScript_EnterBoatWest:: @ 81EE7C5 Route109_EventScript_DoSailToDewford:: @ 81EE7D5 hideobjectat OBJ_EVENT_ID_PLAYER, MAP_ROUTE109 call Common_EventScript_PlayBrineysBoatMusic - applymovement 1, Route109_Movement_SailToDewford + applymovement LOCALID_BOAT_R109, Route109_Movement_SailToDewford applymovement OBJ_EVENT_ID_PLAYER, Route109_Movement_SailToDewford waitmovement 0 delay 50 @@ -43,22 +46,22 @@ Route109_EventScript_DoSailToDewford:: @ 81EE7D5 showobjectat OBJ_EVENT_ID_PLAYER, MAP_DEWFORD_TOWN applymovement OBJ_EVENT_ID_PLAYER, Route109_Movement_PlayerExitBoat waitmovement 0 - addobject 4 + addobject LOCALID_BOAT_DEWFORD clearflag FLAG_HIDE_MR_BRINEY_BOAT_DEWFORD_TOWN - setobjectxyperm 2, 12, 8 - addobject 2 - setobjectpriority 2, MAP_DEWFORD_TOWN, 0 - applymovement 2, Route109_Movement_BrineyExitBoat + setobjectxyperm LOCALID_BRINEY_DEWFORD, 12, 8 + addobject LOCALID_BRINEY_DEWFORD + setobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN, 0 + applymovement LOCALID_BRINEY_DEWFORD, Route109_Movement_BrineyExitBoat waitmovement 0 clearflag FLAG_HIDE_MR_BRINEY_DEWFORD_TOWN setflag FLAG_HIDE_ROUTE_109_MR_BRINEY_BOAT - hideobjectat 1, MAP_ROUTE109 + hideobjectat LOCALID_BOAT_R109, MAP_ROUTE109 msgbox DewfordTown_Text_BrineyLandedInDewford, MSGBOX_DEFAULT closemessage copyvar VAR_BRINEY_LOCATION, VAR_0x8008 resetobjectpriority OBJ_EVENT_ID_PLAYER, MAP_ROUTE109 - resetobjectpriority 2, MAP_DEWFORD_TOWN - copyobjectxytoperm 2 + resetobjectpriority LOCALID_BRINEY_DEWFORD, MAP_DEWFORD_TOWN + copyobjectxytoperm LOCALID_BRINEY_DEWFORD release end diff --git a/data/maps/Route109_SeashoreHouse/scripts.inc b/data/maps/Route109_SeashoreHouse/scripts.inc index dd29e47c3..9334772d6 100644 --- a/data/maps/Route109_SeashoreHouse/scripts.inc +++ b/data/maps/Route109_SeashoreHouse/scripts.inc @@ -25,7 +25,7 @@ Route109_SeashoreHouse_EventScript_AlreadyGaveIntroduction:: @ 8269428 Route109_SeashoreHouse_EventScript_DefeatedTrainers:: @ 8269432 msgbox Route109_SeashoreHouse_Text_TakeTheseSodaPopBottles, MSGBOX_DEFAULT giveitem ITEM_SODA_POP, 6 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Route109_SeashoreHouse_EventScript_BagFull setflag FLAG_RECEIVED_6_SODA_POP release diff --git a/data/maps/Route110/map.json b/data/maps/Route110/map.json index e9e61f70e..5e15be18c 100644 --- a/data/maps/Route110/map.json +++ b/data/maps/Route110/map.json @@ -392,7 +392,7 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "0x0", - "flag": "FLAG_HIDE_ROUTE_110_RIVAL_1" + "flag": "FLAG_HIDE_ROUTE_110_RIVAL" }, { "graphics_id": "OBJ_EVENT_GFX_VAR_3", @@ -405,7 +405,7 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "0x0", - "flag": "FLAG_HIDE_ROUTE_110_RIVAL_2" + "flag": "FLAG_HIDE_ROUTE_110_RIVAL_ON_BIKE" }, { "graphics_id": "OBJ_EVENT_GFX_YOUNGSTER", diff --git a/data/maps/Route110/scripts.inc b/data/maps/Route110/scripts.inc index 1cb4f4b88..02c13f4d9 100644 --- a/data/maps/Route110/scripts.inc +++ b/data/maps/Route110/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_CHALLENGE_BIKER, 21 +.set LOCALID_RIVAL, 28 +.set LOCALID_RIVAL_ON_BIKE, 29 +.set LOCALID_BIRCH, 36 + Route110_MapScripts:: @ 81EF269 map_script MAP_SCRIPT_ON_RESUME, Route110_OnResume map_script MAP_SCRIPT_ON_TRANSITION, Route110_OnTransition @@ -307,7 +312,7 @@ Route110_EventScript_Alyssa:: @ 81EF64A Route110_EventScript_CyclingChallengeEnd:: @ 81EF661 lockall - applymovement 21, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_CHALLENGE_BIKER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 call Route110_EventScript_CyclingChallengeResults releaseall @@ -383,11 +388,11 @@ Route110_EventScript_RivalScene:: @ 81EF76E call_if_eq Route110_EventScript_PlayMayMusic compare VAR_RESULT, FEMALE call_if_eq Route110_EventScript_PlayBrendanMusic - applymovement 28, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 - applymovement 28, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 28, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 delay 30 compare VAR_0x8008, 1 @@ -484,10 +489,10 @@ Route110_EventScript_RivalExit:: @ 81EF8EC call_if_eq Route110_EventScript_MoveRival2 compare VAR_0x8008, 3 call_if_eq Route110_EventScript_MoveRival3 - setobjectmovementtype 28, MOVEMENT_TYPE_FACE_RIGHT - setobjectmovementtype 29, MOVEMENT_TYPE_FACE_RIGHT - removeobject 28 - addobject 29 + setobjectmovementtype LOCALID_RIVAL, MOVEMENT_TYPE_FACE_RIGHT + setobjectmovementtype LOCALID_RIVAL_ON_BIKE, MOVEMENT_TYPE_FACE_RIGHT + removeobject LOCALID_RIVAL + addobject LOCALID_RIVAL_ON_BIKE delay 45 compare VAR_0x8008, 1 call_if_eq Route110_EventScript_RivalExit1 @@ -495,7 +500,7 @@ Route110_EventScript_RivalExit:: @ 81EF8EC call_if_eq Route110_EventScript_RivalExit2 compare VAR_0x8008, 3 call_if_eq Route110_EventScript_RivalExit3 - removeobject 29 + removeobject LOCALID_RIVAL_ON_BIKE setvar VAR_ROUTE110_STATE, 1 savebgm MUS_DUMMY fadedefaultbgm @@ -503,45 +508,45 @@ Route110_EventScript_RivalExit:: @ 81EF8EC end Route110_EventScript_RivalApproachPlayer1:: @ 81EF94E - applymovement 28, Route110_Movement_RivalApproachPlayer1 + applymovement LOCALID_RIVAL, Route110_Movement_RivalApproachPlayer1 waitmovement 0 return Route110_EventScript_RivalApproachPlayer2:: @ 81EF959 - applymovement 28, Route110_Movement_RivalApproachPlayer2 + applymovement LOCALID_RIVAL, Route110_Movement_RivalApproachPlayer2 waitmovement 0 return Route110_EventScript_RivalApproachPlayer3:: @ 81EF964 - applymovement 28, Route110_Movement_RivalApproachPlayer3 + applymovement LOCALID_RIVAL, Route110_Movement_RivalApproachPlayer3 waitmovement 0 return Route110_EventScript_RivalExit1:: @ 81EF96F - applymovement 29, Route110_Movement_RivalExit1 + applymovement LOCALID_RIVAL_ON_BIKE, Route110_Movement_RivalExit1 waitmovement 0 return Route110_EventScript_RivalExit2:: @ 81EF97A - applymovement 29, Route110_Movement_RivalExit2 + applymovement LOCALID_RIVAL_ON_BIKE, Route110_Movement_RivalExit2 waitmovement 0 return Route110_EventScript_RivalExit3:: @ 81EF985 - applymovement 29, Route110_Movement_RivalExit3 + applymovement LOCALID_RIVAL_ON_BIKE, Route110_Movement_RivalExit3 waitmovement 0 return Route110_EventScript_MoveRival1:: @ 81EF990 - setobjectxyperm 29, 33, 55 + setobjectxyperm LOCALID_RIVAL_ON_BIKE, 33, 55 return Route110_EventScript_MoveRival2:: @ 81EF998 - setobjectxyperm 29, 34, 55 + setobjectxyperm LOCALID_RIVAL_ON_BIKE, 34, 55 return Route110_EventScript_MoveRival3:: @ 81EF9A0 - setobjectxyperm 29, 35, 55 + setobjectxyperm LOCALID_RIVAL_ON_BIKE, 35, 55 return Route110_Movement_RivalApproachPlayer1: @ 81EF9A8 @@ -612,13 +617,13 @@ Route110_EventScript_BirchScene4:: @ 81EF9EC goto Route110_EventScript_BirchScene Route110_EventScript_BirchScene:: @ 81EF9F7 - addobject 36 - applymovement 36, Route110_Movement_BirchEntrance + addobject LOCALID_BIRCH + applymovement LOCALID_BIRCH, Route110_Movement_BirchEntrance waitmovement 0 playse SE_PIN - applymovement 36, Common_Movement_ExclamationMark + applymovement LOCALID_BIRCH, Common_Movement_ExclamationMark waitmovement 0 - applymovement 36, Common_Movement_Delay48 + applymovement LOCALID_BIRCH, Common_Movement_Delay48 waitmovement 0 compare VAR_0x8008, 1 call_if_eq Route110_EventScript_BirchApproachPlayer1 @@ -631,13 +636,13 @@ Route110_EventScript_BirchScene:: @ 81EF9F7 msgbox Route110_Text_ImagineSeeingYouHere, MSGBOX_DEFAULT closemessage delay 20 - applymovement 36, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 delay 10 - applymovement 36, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 20 - applymovement 36, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_BIRCH, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 30 msgbox Route110_Text_HeardYouInstallMatchCall, MSGBOX_DEFAULT @@ -659,48 +664,48 @@ Route110_EventScript_BirchScene:: @ 81EF9F7 call_if_eq Route110_EventScript_BirchExit3 compare VAR_0x8008, 4 call_if_eq Route110_EventScript_BirchExit4 - removeobject 36 + removeobject LOCALID_BIRCH setvar VAR_REGISTER_BIRCH_STATE, 2 releaseall end Route110_EventScript_BirchApproachPlayer1:: @ 81EFAD8 - applymovement 36, Route110_Movement_BirchApproachPlayer1 + applymovement LOCALID_BIRCH, Route110_Movement_BirchApproachPlayer1 waitmovement 0 return Route110_EventScript_BirchApproachPlayer2:: @ 81EFAE3 - applymovement 36, Route110_Movement_BirchApproachPlayer2 + applymovement LOCALID_BIRCH, Route110_Movement_BirchApproachPlayer2 waitmovement 0 return Route110_EventScript_BirchApproachPlayer3:: @ 81EFAEE - applymovement 36, Route110_Movement_BirchApproachPlayer3 + applymovement LOCALID_BIRCH, Route110_Movement_BirchApproachPlayer3 waitmovement 0 return Route110_EventScript_BirchApproachPlayer4:: @ 81EFAF9 - applymovement 36, Route110_Movement_BirchApproachPlayer4 + applymovement LOCALID_BIRCH, Route110_Movement_BirchApproachPlayer4 waitmovement 0 return Route110_EventScript_BirchExit1:: @ 81EFB04 - applymovement 36, Route110_Movement_BirchExit1 + applymovement LOCALID_BIRCH, Route110_Movement_BirchExit1 waitmovement 0 return Route110_EventScript_BirchExit2:: @ 81EFB0F - applymovement 36, Route110_Movement_BirchExit2 + applymovement LOCALID_BIRCH, Route110_Movement_BirchExit2 waitmovement 0 return Route110_EventScript_BirchExit3:: @ 81EFB1A - applymovement 36, Route110_Movement_BirchExit3 + applymovement LOCALID_BIRCH, Route110_Movement_BirchExit3 waitmovement 0 return Route110_EventScript_BirchExit4:: @ 81EFB25 - applymovement 36, Route110_Movement_BirchExit4 + applymovement LOCALID_BIRCH, Route110_Movement_BirchExit4 waitmovement 0 return diff --git a/data/maps/Route110_TrickHouseEnd/scripts.inc b/data/maps/Route110_TrickHouseEnd/scripts.inc index 96765aacc..7e6f6a5bf 100644 --- a/data/maps/Route110_TrickHouseEnd/scripts.inc +++ b/data/maps/Route110_TrickHouseEnd/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_TRICK_MASTER, 1 + Route110_TrickHouseEnd_MapScripts:: @ 826ACAF map_script MAP_SCRIPT_ON_RESUME, Route110_TrickHouseEnd_OnResume map_script MAP_SCRIPT_ON_TRANSITION, Route110_TrickHouseEnd_OnTransition @@ -21,9 +23,9 @@ Route110_TrickHouseEnd_OnWarp: @ 826ACDE .2byte 0 Route110_TrickHouseEnd_EventScript_SetTrickMasterPos:: @ 826ACE8 - addobject 1 - showobjectat 1, MAP_ROUTE110_TRICK_HOUSE_END - turnobject 1, DIR_EAST + addobject LOCALID_TRICK_MASTER + showobjectat LOCALID_TRICK_MASTER, MAP_ROUTE110_TRICK_HOUSE_END + turnobject LOCALID_TRICK_MASTER, DIR_EAST end Route110_TrickHouseEnd_OnFrame: @ 826ACF5 @@ -161,7 +163,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle8:: @ 826AF28 delay 30 msgbox Route110_TrickHouseEnd_Text_FountainOfIdeasRunDry, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_TRICK_MASTER, Common_Movement_FacePlayer waitmovement 0 delay 30 msgbox Route110_TrickHouseEnd_Text_DefeatedMePreferWhichTent, MSGBOX_DEFAULT @@ -190,12 +192,12 @@ Route110_TrickHouseEnd_EventScript_GiveBlueTent:: @ 826AFC7 return Route110_TrickHouseEnd_EventScript_TrickMasterExit:: @ 826AFCF - applymovement 1, Route110_TrickHouse_Movement_TrickMasterSpin + applymovement LOCALID_TRICK_MASTER, Route110_TrickHouse_Movement_TrickMasterSpin waitmovement 0 playse SE_W153 - applymovement 1, Route110_TrickHouse_Movement_TrickMasterJumpAway + applymovement LOCALID_TRICK_MASTER, Route110_TrickHouse_Movement_TrickMasterJumpAway waitmovement 0 - removeobject 1 + removeobject LOCALID_TRICK_MASTER addvar VAR_TRICK_HOUSE_LEVEL, 1 return @@ -212,33 +214,33 @@ Route110_TrickHouseEnd_EventScript_NoRoomForTent:: @ 826B002 return Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwaySouth:: @ 826B015 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_TRICK_MASTER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayNorth:: @ 826B020 - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_TRICK_MASTER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayWest:: @ 826B02B - applymovement 1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_TRICK_MASTER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return Route110_TrickHouseEnd_EventScript_TrickMasterFaceAwayEast:: @ 826B036 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_TRICK_MASTER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return Route110_TrickHouseEnd_EventScript_TrickMasterExitTrigger:: @ 826B041 lockall - turnobject 1, DIR_WEST + turnobject LOCALID_TRICK_MASTER, DIR_WEST playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_TRICK_MASTER, Common_Movement_ExclamationMark waitmovement 0 delay 20 - applymovement 1, Route110_TrickHouseEnd_Movement_TrickMasterSurprise + applymovement LOCALID_TRICK_MASTER, Route110_TrickHouseEnd_Movement_TrickMasterSurprise waitmovement 0 playse SE_W153 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown @@ -248,7 +250,7 @@ Route110_TrickHouseEnd_EventScript_TrickMasterExitTrigger:: @ 826B041 applymovement OBJ_EVENT_ID_PLAYER, Route110_TrickHouseEnd_Movement_KeepPlayerInRoom waitmovement 0 delay 4 - turnobject 1, DIR_EAST + turnobject LOCALID_TRICK_MASTER, DIR_EAST releaseall end diff --git a/data/maps/Route110_TrickHouseEntrance/scripts.inc b/data/maps/Route110_TrickHouseEntrance/scripts.inc index ed70894e3..98b06a94f 100644 --- a/data/maps/Route110_TrickHouseEntrance/scripts.inc +++ b/data/maps/Route110_TrickHouseEntrance/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_TRICK_MASTER, 1 + Route110_TrickHouseEntrance_MapScripts:: @ 8269A50 map_script MAP_SCRIPT_ON_TRANSITION, Route110_TrickHouseEntrance_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, Route110_TrickHouseEntrance_OnFrame @@ -108,7 +110,7 @@ Route110_TrickHouseEntrance_EventScript_NotReadyForPuzzle:: @ 8269BAD return Route110_TrickHouseEntrance_EventScript_MoveTrickMasterToDoor:: @ 8269BB3 - setobjectxyperm 1, 5, 2 + setobjectxyperm LOCALID_TRICK_MASTER, 5, 2 end Route110_TrickHouseEntrance_EventScript_ReadyBeingWatchedTrigger:: @ 8269BBB @@ -139,15 +141,15 @@ Route110_TrickHouseEntrance_OnWarp: @ 8269BD3 .2byte 0 Route110_TrickHouseEntrance_EventScript_TrickMasterFound:: @ 8269C15 - addobject 1 - showobjectat 1, MAP_ROUTE110_TRICK_HOUSE_ENTRANCE - turnobject 1, DIR_EAST + addobject LOCALID_TRICK_MASTER + showobjectat LOCALID_TRICK_MASTER, MAP_ROUTE110_TRICK_HOUSE_ENTRANCE + turnobject LOCALID_TRICK_MASTER, DIR_EAST turnobject OBJ_EVENT_ID_PLAYER, DIR_WEST end Route110_TrickHouseEntrance_EventScript_SetTrickMasterHidingSpot:: @ 8269C26 - addobject 1 - hideobjectat 1, MAP_ROUTE110_TRICK_HOUSE_ENTRANCE + addobject LOCALID_TRICK_MASTER + hideobjectat LOCALID_TRICK_MASTER, MAP_ROUTE110_TRICK_HOUSE_ENTRANCE switch VAR_TRICK_HOUSE_LEVEL case 0, Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle1 case 1, Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle2 @@ -160,51 +162,51 @@ Route110_TrickHouseEntrance_EventScript_SetTrickMasterHidingSpot:: @ 8269C26 end Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle1:: @ 8269C8C - setobjectxy 1, 6, 3 + setobjectxy LOCALID_TRICK_MASTER, 6, 3 end Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle2:: @ 8269C94 - setobjectxy 1, 11, 5 + setobjectxy LOCALID_TRICK_MASTER, 11, 5 end Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle3:: @ 8269C9C - setobjectxy 1, 9, 1 + setobjectxy LOCALID_TRICK_MASTER, 9, 1 end Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle4:: @ 8269CA4 - setobjectxy 1, 3, 1 + setobjectxy LOCALID_TRICK_MASTER, 3, 1 end Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle5:: @ 8269CAC - setobjectxy 1, 0, 5 + setobjectxy LOCALID_TRICK_MASTER, 0, 5 end Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle6:: @ 8269CB4 - setobjectxy 1, 11, 1 + setobjectxy LOCALID_TRICK_MASTER, 11, 1 end Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle7:: @ 8269CBC - setobjectxy 1, 8, 1 + setobjectxy LOCALID_TRICK_MASTER, 8, 1 end Route110_TrickHouseEntrance_EventScript_SetHidingSpotPuzzle8:: @ 8269CC4 - setobjectxy 1, 4, 4 + setobjectxy LOCALID_TRICK_MASTER, 4, 4 end Route110_TrickHouseEntrance_EventScript_RemoveTrickMaster:: @ 8269CCC - removeobject 1 + removeobject LOCALID_TRICK_MASTER end Route110_TrickHouseEntrance_EventScript_SetTrickMasterFacingDoor:: @ 8269CD0 - addobject 1 - setobjectxy 1, 5, 2 - turnobject 1, DIR_NORTH + addobject LOCALID_TRICK_MASTER + setobjectxy LOCALID_TRICK_MASTER, 5, 2 + turnobject LOCALID_TRICK_MASTER, DIR_NORTH end Route110_TrickHouseEntrance_EventScript_SetTrickMasterInFrontOfDoor:: @ 8269CDF - addobject 1 - setobjectxy 1, 5, 2 - turnobject 1, DIR_SOUTH + addobject LOCALID_TRICK_MASTER + setobjectxy LOCALID_TRICK_MASTER, 5, 2 + turnobject LOCALID_TRICK_MASTER, DIR_SOUTH end Route110_TrickHouseEntrance_OnFrame: @ 8269CEE @@ -219,12 +221,12 @@ Route110_TrickHouseEntrance_EventScript_BeginChallenge:: @ 8269CF8 msgbox Route110_TrickHouseEntrance_Text_ComeToChallengeTrickHouse, MSGBOX_DEFAULT closemessage delay 20 - applymovement 1, Route110_TrickHouse_Movement_TrickMasterSpin + applymovement LOCALID_TRICK_MASTER, Route110_TrickHouse_Movement_TrickMasterSpin waitmovement 0 playse SE_W153 - applymovement 1, Route110_TrickHouse_Movement_TrickMasterJumpAway + applymovement LOCALID_TRICK_MASTER, Route110_TrickHouse_Movement_TrickMasterJumpAway waitmovement 0 - removeobject 1 + removeobject LOCALID_TRICK_MASTER setvar VAR_TRICK_HOUSE_ENTRANCE_STATE, 1 setvar VAR_TRICK_HOUSE_FOUND_TRICK_MASTER, 0 releaseall @@ -333,21 +335,21 @@ Route110_TrickHouseEntrance_EventScript_MeetTrickMaster:: @ 8269E48 Route110_TrickHouseEntrance_EventScript_StillMakingPuzzle:: @ 8269E51 msgbox Route110_TrickHouseEntrance_Text_NextTimeUseThisTrick, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_TRICK_MASTER, Common_Movement_FacePlayer waitmovement 0 playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_TRICK_MASTER, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_TRICK_MASTER, Common_Movement_Delay48 waitmovement 0 msgbox Route110_TrickHouseEntrance_Text_InMidstOfDevisingNewChallenges, MSGBOX_DEFAULT - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_TRICK_MASTER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 releaseall end Route110_TrickHouseEntrance_EventScript_GiveReward:: @ 8269E8F - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_TRICK_MASTER, Common_Movement_FacePlayer waitmovement 0 msgbox Route110_TrickHouseEntrance_Text_YoureHereToAcceptReward, MSGBOX_DEFAULT compare VAR_TRICK_HOUSE_LEVEL, 1 @@ -439,13 +441,13 @@ Route110_TrickHouseEntrance_EventScript_GivePuzzle7Reward:: @ 8269FF7 Route110_TrickHouseEntrance_EventScript_GotReward:: @ 826A023 setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 setvar VAR_TRICK_HOUSE_ENTRANCE_STATE, 3 - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_TRICK_MASTER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 releaseall end Route110_TrickHouseEntrance_EventScript_MechadollReward:: @ 826A039 - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_TRICK_MASTER, Common_Movement_FacePlayer waitmovement 0 msgbox Route110_TrickHouseEntrance_Text_MechadollWhichTent, MSGBOX_DEFAULT call Route110_TrickHouseEntrance_EventScript_ChooseTent @@ -474,14 +476,14 @@ Route110_TrickHouseEntrance_EventScript_GiveBlueTent:: @ 826A092 Route110_TrickHouseEntrance_EventScript_ReceivedTent:: @ 826A09A msgbox Route110_TrickHouseEntrance_Text_ThenFarewell, MSGBOX_DEFAULT closemessage - applymovement 1, Route110_TrickHousePuzzle5_Movement_MechadollShake + applymovement LOCALID_TRICK_MASTER, Route110_TrickHousePuzzle5_Movement_MechadollShake waitmovement 0 - applymovement 1, Route110_TrickHouse_Movement_TrickMasterSpin + applymovement LOCALID_TRICK_MASTER, Route110_TrickHouse_Movement_TrickMasterSpin waitmovement 0 playse SE_W153 - applymovement 1, Route110_TrickHouse_Movement_TrickMasterJumpAway + applymovement LOCALID_TRICK_MASTER, Route110_TrickHouse_Movement_TrickMasterJumpAway waitmovement 0 - removeobject 1 + removeobject LOCALID_TRICK_MASTER setvar VAR_TRICK_HOUSE_PRIZE_PICKUP, 0 setvar VAR_TRICK_HOUSE_ENTRANCE_STATE, 5 releaseall diff --git a/data/maps/Route110_TrickHousePuzzle5/scripts.inc b/data/maps/Route110_TrickHousePuzzle5/scripts.inc index ac260981f..419fa2831 100644 --- a/data/maps/Route110_TrickHousePuzzle5/scripts.inc +++ b/data/maps/Route110_TrickHousePuzzle5/scripts.inc @@ -1,3 +1,9 @@ +.set LOCALID_MECHADOLL_1, 1 +.set LOCALID_MECHADOLL_2, 2 +.set LOCALID_MECHADOLL_3, 3 +.set LOCALID_MECHADOLL_4, 4 +.set LOCALID_MECHADOLL_5, 5 + Route110_TrickHousePuzzle5_MapScripts:: @ 826CAF0 map_script MAP_SCRIPT_ON_TRANSITION, Route110_TrickHousePuzzle5_OnTransition .byte 0 @@ -25,7 +31,7 @@ Route110_TrickHousePuzzle5_EventScript_FoundScroll:: @ 826CB27 Route110_TrickHousePuzzle5_EventScript_Mechadoll1:: @ 826CB32 lockall - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_MECHADOLL_1, Common_Movement_FacePlayer waitmovement 0 compare VAR_TEMP_1, 1 goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough @@ -35,7 +41,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll1:: @ 826CB32 Route110_TrickHousePuzzle5_EventScript_Mechadoll2:: @ 826CB53 lockall - applymovement 2, Common_Movement_FacePlayer + applymovement LOCALID_MECHADOLL_2, Common_Movement_FacePlayer waitmovement 0 compare VAR_TEMP_2, 1 goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough @@ -45,7 +51,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll2:: @ 826CB53 Route110_TrickHousePuzzle5_EventScript_Mechadoll3:: @ 826CB74 lockall - applymovement 3, Common_Movement_FacePlayer + applymovement LOCALID_MECHADOLL_3, Common_Movement_FacePlayer waitmovement 0 compare VAR_TEMP_3, 1 goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough @@ -55,7 +61,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll3:: @ 826CB74 Route110_TrickHousePuzzle5_EventScript_Mechadoll4:: @ 826CB95 lockall - applymovement 4, Common_Movement_FacePlayer + applymovement LOCALID_MECHADOLL_4, Common_Movement_FacePlayer waitmovement 0 compare VAR_TEMP_4, 1 goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough @@ -65,7 +71,7 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll4:: @ 826CB95 Route110_TrickHousePuzzle5_EventScript_Mechadoll5:: @ 826CBB6 lockall - applymovement 5, Common_Movement_FacePlayer + applymovement LOCALID_MECHADOLL_5, Common_Movement_FacePlayer waitmovement 0 compare VAR_TEMP_5, 1 goto_if_eq Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough @@ -214,11 +220,11 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll5Trigger0:: @ 826CCDF Route110_TrickHousePuzzle5_EventScript_Mechadoll1Activate:: @ 826CCEB setvar VAR_TEMP_1, 1 - setvar VAR_TEMP_8, 1 + setvar VAR_TEMP_8, LOCALID_MECHADOLL_1 playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_MECHADOLL_1, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_MECHADOLL_1, Common_Movement_Delay48 waitmovement 0 compare VAR_TEMP_9, 1 call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 @@ -238,11 +244,11 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll1Activate:: @ 826CCEB Route110_TrickHousePuzzle5_EventScript_Mechadoll2Activate:: @ 826CD6A setvar VAR_TEMP_2, 1 - setvar VAR_TEMP_8, 2 + setvar VAR_TEMP_8, LOCALID_MECHADOLL_2 playse SE_PIN - applymovement 2, Common_Movement_ExclamationMark + applymovement LOCALID_MECHADOLL_2, Common_Movement_ExclamationMark waitmovement 0 - applymovement 2, Common_Movement_Delay48 + applymovement LOCALID_MECHADOLL_2, Common_Movement_Delay48 waitmovement 0 compare VAR_TEMP_9, 1 call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight1 @@ -264,11 +270,11 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll2Activate:: @ 826CD6A Route110_TrickHousePuzzle5_EventScript_Mechadoll3Activate:: @ 826CDF4 setvar VAR_TEMP_3, 1 - setvar VAR_TEMP_8, 3 + setvar VAR_TEMP_8, LOCALID_MECHADOLL_3 playse SE_PIN - applymovement 3, Common_Movement_ExclamationMark + applymovement LOCALID_MECHADOLL_3, Common_Movement_ExclamationMark waitmovement 0 - applymovement 3, Common_Movement_Delay48 + applymovement LOCALID_MECHADOLL_3, Common_Movement_Delay48 waitmovement 0 compare VAR_TEMP_9, 1 call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 @@ -288,11 +294,11 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll3Activate:: @ 826CDF4 Route110_TrickHousePuzzle5_EventScript_Mechadoll4Activate:: @ 826CE73 setvar VAR_TEMP_4, 1 - setvar VAR_TEMP_8, 4 + setvar VAR_TEMP_8, LOCALID_MECHADOLL_4 playse SE_PIN - applymovement 4, Common_Movement_ExclamationMark + applymovement LOCALID_MECHADOLL_4, Common_Movement_ExclamationMark waitmovement 0 - applymovement 4, Common_Movement_Delay48 + applymovement LOCALID_MECHADOLL_4, Common_Movement_Delay48 waitmovement 0 compare VAR_TEMP_9, 1 call_if_eq Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1 @@ -312,11 +318,11 @@ Route110_TrickHousePuzzle5_EventScript_Mechadoll4Activate:: @ 826CE73 Route110_TrickHousePuzzle5_EventScript_Mechadoll5Activate:: @ 826CEF2 setvar VAR_TEMP_5, 1 - setvar VAR_TEMP_8, 5 + setvar VAR_TEMP_8, LOCALID_MECHADOLL_5 playse SE_PIN - applymovement 5, Common_Movement_ExclamationMark + applymovement LOCALID_MECHADOLL_5, Common_Movement_ExclamationMark waitmovement 0 - applymovement 5, Common_Movement_Delay48 + applymovement LOCALID_MECHADOLL_5, Common_Movement_Delay48 waitmovement 0 msgbox Route110_TrickHousePuzzle5_Text_Mechadoll5Intro, MSGBOX_DEFAULT random 3 @@ -450,11 +456,11 @@ Route110_TrickHousePuzzle5_EventScript_IncorrectAnswer:: @ 826D152 waitse playse SE_HAZURE msgbox Route110_TrickHousePuzzle5_Text_DisappointmentError, MSGBOX_DEFAULT - applymovement 1, Route110_TrickHousePuzzle5_Movement_MechadollShake - applymovement 2, Route110_TrickHousePuzzle5_Movement_MechadollShake - applymovement 3, Route110_TrickHousePuzzle5_Movement_MechadollShake - applymovement 4, Route110_TrickHousePuzzle5_Movement_MechadollShake - applymovement 5, Route110_TrickHousePuzzle5_Movement_MechadollShake + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_MechadollShake + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_MechadollShake + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_MechadollShake + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_MechadollShake + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_MechadollShake msgbox Route110_TrickHousePuzzle5_Text_Wahahahaha, MSGBOX_DEFAULT waitmovement 0 msgbox Route110_TrickHousePuzzle5_Text_WaitForNextChallenge, MSGBOX_DEFAULT @@ -481,382 +487,382 @@ Route110_TrickHousePuzzle5_EventScript_CorrectGoThrough:: @ 826D1AA @ Mechadoll 5 never walks, all the Mechadoll5Walk scripts are unused @ No mechadoll walks left 5 paces, all the WalkLeft5 scripts are unused Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft1:: @ 826D1B4 - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft1 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft1 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft1 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft1 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft1 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft2:: @ 826D1EC - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft2 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft2 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft2 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft2 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft2 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft3:: @ 826D224 - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft3 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft3 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft3 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft3 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft3 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft4:: @ 826D25C - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft4 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft4 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft4 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft4 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft4 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkLeft5:: @ 826D294 - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft5 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft5 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft5 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft5 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft5 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight1:: @ 826D2CC - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight1 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight1 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight1 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight1 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight1 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight2:: @ 826D304 - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight2 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight2 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight2 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight2 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight2 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight3:: @ 826D33C - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight3 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight3 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight3 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight3 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight3 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight4:: @ 826D374 - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight4 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight4 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight4 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight4 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight4 return Route110_TrickHousePuzzle5_EventScript_MechadollWalkRight5:: @ 826D3AC - compare VAR_TEMP_8, 1 + compare VAR_TEMP_8, LOCALID_MECHADOLL_1 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight5 - compare VAR_TEMP_8, 2 + compare VAR_TEMP_8, LOCALID_MECHADOLL_2 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight5 - compare VAR_TEMP_8, 3 + compare VAR_TEMP_8, LOCALID_MECHADOLL_3 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight5 - compare VAR_TEMP_8, 4 + compare VAR_TEMP_8, LOCALID_MECHADOLL_4 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight5 - compare VAR_TEMP_8, 5 + compare VAR_TEMP_8, LOCALID_MECHADOLL_5 call_if_eq Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight5 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft1:: @ 826D3E4 - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkLeft1 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkLeft1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft1:: @ 826D3EF - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkLeft1 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkLeft1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft1:: @ 826D3FA - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkLeft1 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkLeft1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft1:: @ 826D405 - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkLeft1 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkLeft1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft1:: @ 826D410 - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkLeft1 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkLeft1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft2:: @ 826D41B - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkLeft2 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkLeft2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft2:: @ 826D426 - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkLeft2 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkLeft2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft2:: @ 826D431 - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkLeft2 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkLeft2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft2:: @ 826D43C - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkLeft2 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkLeft2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft2:: @ 826D447 - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkLeft2 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkLeft2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft3:: @ 826D452 - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkLeft3 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkLeft3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft3:: @ 826D45D - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkLeft3 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkLeft3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft3:: @ 826D468 - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkLeft3 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkLeft3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft3:: @ 826D473 - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkLeft3 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkLeft3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft3:: @ 826D47E - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkLeft3 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkLeft3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft4:: @ 826D489 - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkLeft4 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkLeft4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft4:: @ 826D494 - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkLeft4 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkLeft4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft4:: @ 826D49F - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkLeft4 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkLeft4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft4:: @ 826D4AA - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkLeft4 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkLeft4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft4:: @ 826D4B5 - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkLeft4 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkLeft4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkLeft5:: @ 826D4C0 - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkLeft5 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkLeft5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkLeft5:: @ 826D4CB - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkLeft5 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkLeft5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkLeft5:: @ 826D4D6 - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkLeft5 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkLeft5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkLeft5:: @ 826D4E1 - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkLeft5 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkLeft5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkLeft5:: @ 826D4EC - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkLeft5 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkLeft5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight1:: @ 826D4F7 - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkRight1 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkRight1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight1:: @ 826D502 - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkRight1 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkRight1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight1:: @ 826D50D - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkRight1 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkRight1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight1:: @ 826D518 - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkRight1 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkRight1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight1:: @ 826D523 - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkRight1 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkRight1 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight2:: @ 826D52E - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkRight2 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkRight2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight2:: @ 826D539 - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkRight2 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkRight2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight2:: @ 826D544 - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkRight2 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkRight2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight2:: @ 826D54F - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkRight2 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkRight2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight2:: @ 826D55A - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkRight2 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkRight2 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight3:: @ 826D565 - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkRight3 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkRight3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight3:: @ 826D570 - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkRight3 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkRight3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight3:: @ 826D57B - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkRight3 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkRight3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight3:: @ 826D586 - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkRight3 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkRight3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight3:: @ 826D591 - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkRight3 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkRight3 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight4:: @ 826D59C - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkRight4 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkRight4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight4:: @ 826D5A7 - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkRight4 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkRight4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight4:: @ 826D5B2 - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkRight4 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkRight4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight4:: @ 826D5BD - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkRight4 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkRight4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight4:: @ 826D5C8 - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkRight4 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkRight4 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll1WalkRight5:: @ 826D5D3 - applymovement 1, Route110_TrickHousePuzzle5_Movement_WalkRight5 + applymovement LOCALID_MECHADOLL_1, Route110_TrickHousePuzzle5_Movement_WalkRight5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll2WalkRight5:: @ 826D5DE - applymovement 2, Route110_TrickHousePuzzle5_Movement_WalkRight5 + applymovement LOCALID_MECHADOLL_2, Route110_TrickHousePuzzle5_Movement_WalkRight5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll3WalkRight5:: @ 826D5E9 - applymovement 3, Route110_TrickHousePuzzle5_Movement_WalkRight5 + applymovement LOCALID_MECHADOLL_3, Route110_TrickHousePuzzle5_Movement_WalkRight5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll4WalkRight5:: @ 826D5F4 - applymovement 4, Route110_TrickHousePuzzle5_Movement_WalkRight5 + applymovement LOCALID_MECHADOLL_4, Route110_TrickHousePuzzle5_Movement_WalkRight5 waitmovement 0 return Route110_TrickHousePuzzle5_EventScript_Mechadoll5WalkRight5:: @ 826D5FF - applymovement 5, Route110_TrickHousePuzzle5_Movement_WalkRight5 + applymovement LOCALID_MECHADOLL_5, Route110_TrickHousePuzzle5_Movement_WalkRight5 waitmovement 0 return diff --git a/data/maps/Route111/scripts.inc b/data/maps/Route111/scripts.inc index 89002883c..281dddf0c 100644 --- a/data/maps/Route111/scripts.inc +++ b/data/maps/Route111/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_VICTOR, 1 +.set LOCALID_VICTORIA, 2 +.set LOCALID_VIVI, 3 +.set LOCALID_VICKY, 4 +.set LOCALID_PLAYER_FALLING, 45 +.set LOCALID_ROCK_SMASH_MAN, 46 + Route111_MapScripts:: @ 81F0CA7 map_script MAP_SCRIPT_ON_LOAD, Route111_OnLoad map_script MAP_SCRIPT_ON_TRANSITION, Route111_OnTransition @@ -120,11 +127,11 @@ Route111_EventScript_MirageTowerDisappear:: @ 81F0E60 waitstate delay 24 playse SE_RU_HYUU - addobject 45 + addobject LOCALID_PLAYER_FALLING special StartPlayerDescendMirageTower waitstate showobjectat OBJ_EVENT_ID_PLAYER, MAP_LITTLEROOT_TOWN - removeobject 45 + removeobject LOCALID_PLAYER_FALLING delay 16 turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH delay 16 @@ -286,68 +293,68 @@ Route111_EventScript_Victor:: @ 81F0FC5 Route111_EventScript_BattleWinstrates:: @ 81F0FE7 msgbox Route111_Text_VictorIntro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_VICTOR, Route111_Text_VictorDefeat - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_VICTOR, Common_Movement_WalkInPlaceFastestUp waitmovement 0 call Route111_EventScript_OpenWinstrateDoor msgbox Route111_Text_VictorPostBattle, MSGBOX_DEFAULT closemessage - applymovement 1, Route111_Movement_WinstrateEnterHouse + applymovement LOCALID_VICTOR, Route111_Movement_WinstrateEnterHouse waitmovement 0 - removeobject 1 + removeobject LOCALID_VICTOR call Route111_EventScript_CloseWinstrateDoor applymovement OBJ_EVENT_ID_PLAYER, Route111_Movement_WaitForNextWinstrate waitmovement 0 call Route111_EventScript_OpenWinstrateDoor - addobject 2 - applymovement 2, Route111_Movement_WinstrateExitHouse + addobject LOCALID_VICTORIA + applymovement LOCALID_VICTORIA, Route111_Movement_WinstrateExitHouse waitmovement 0 call Route111_EventScript_CloseWinstrateDoor msgbox Route111_Text_VictoriaIntro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_VICTORIA, Route111_Text_VictoriaDefeat - applymovement 2, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_VICTORIA, Common_Movement_WalkInPlaceFastestUp waitmovement 0 call Route111_EventScript_OpenWinstrateDoor msgbox Route111_Text_VictoriaPostBattle, MSGBOX_DEFAULT closemessage - applymovement 2, Route111_Movement_WinstrateEnterHouse + applymovement LOCALID_VICTORIA, Route111_Movement_WinstrateEnterHouse waitmovement 0 - removeobject 2 + removeobject LOCALID_VICTORIA call Route111_EventScript_CloseWinstrateDoor applymovement OBJ_EVENT_ID_PLAYER, Route111_Movement_WaitForNextWinstrate waitmovement 0 call Route111_EventScript_OpenWinstrateDoor - addobject 3 - applymovement 3, Route111_Movement_WinstrateExitHouse + addobject LOCALID_VIVI + applymovement LOCALID_VIVI, Route111_Movement_WinstrateExitHouse waitmovement 0 call Route111_EventScript_CloseWinstrateDoor msgbox Route111_Text_ViviIntro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_VIVI, Route111_Text_ViviDefeat - applymovement 3, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_VIVI, Common_Movement_WalkInPlaceFastestUp waitmovement 0 call Route111_EventScript_OpenWinstrateDoor msgbox Route111_Text_ViviPostBattle, MSGBOX_DEFAULT closemessage - applymovement 3, Route111_Movement_WinstrateEnterHouse + applymovement LOCALID_VIVI, Route111_Movement_WinstrateEnterHouse waitmovement 0 - removeobject 3 + removeobject LOCALID_VIVI call Route111_EventScript_CloseWinstrateDoor applymovement OBJ_EVENT_ID_PLAYER, Route111_Movement_WaitForNextWinstrate waitmovement 0 call Route111_EventScript_OpenWinstrateDoor - addobject 4 - applymovement 4, Route111_Movement_WinstrateExitHouse + addobject LOCALID_VICKY + applymovement LOCALID_VICKY, Route111_Movement_WinstrateExitHouse waitmovement 0 call Route111_EventScript_CloseWinstrateDoor msgbox Route111_Text_VickyIntro, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_VICKY, Route111_Text_VickyDefeat msgbox Route111_Text_VickyPostBattle, MSGBOX_DEFAULT closemessage - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_VICKY, Common_Movement_WalkInPlaceFastestUp waitmovement 0 call Route111_EventScript_OpenWinstrateDoor - applymovement 4, Route111_Movement_WinstrateEnterHouse + applymovement LOCALID_VICKY, Route111_Movement_WinstrateEnterHouse waitmovement 0 - removeobject 4 + removeobject LOCALID_VICKY call Route111_EventScript_CloseWinstrateDoor release end @@ -438,11 +445,11 @@ Route111_EventScript_HikerMirageTowerVisible:: @ 81F11DA Route111_EventScript_RockSmashTipFatMan:: @ 81F11E4 lockall - applymovement 46, Common_Movement_FacePlayer + applymovement LOCALID_ROCK_SMASH_MAN, Common_Movement_FacePlayer waitmovement 0 msgbox Route111_Text_MauvilleUncleToldMeToTakeRockSmash, MSGBOX_DEFAULT closemessage - applymovement 46, Common_Movement_FaceOriginalDirection + applymovement LOCALID_ROCK_SMASH_MAN, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end diff --git a/data/maps/Route111_WinstrateFamilysHouse/scripts.inc b/data/maps/Route111_WinstrateFamilysHouse/scripts.inc index 499459c24..28bf17dbf 100644 --- a/data/maps/Route111_WinstrateFamilysHouse/scripts.inc +++ b/data/maps/Route111_WinstrateFamilysHouse/scripts.inc @@ -1,10 +1,15 @@ +.set LOCALID_VIVI, 1 +.set LOCALID_VICTOR, 2 +.set LOCALID_VICTORIA, 3 +.set LOCALID_VICKY, 4 + Route111_WinstrateFamilysHouse_MapScripts:: @ 822A48C .byte 0 Route111_WinstrateFamilysHouse_EventScript_Victor:: @ 822A48D lock faceplayer - setvar VAR_0x8008, 2 + setvar VAR_0x8008, LOCALID_VICTOR msgbox Route111_WinstrateFamilysHouse_Text_MySonIsStrongerThanYou, MSGBOX_DEFAULT goto Route111_WinstrateFamilysHouse_EventScript_FaceOriginalDirection end @@ -12,7 +17,7 @@ Route111_WinstrateFamilysHouse_EventScript_Victor:: @ 822A48D Route111_WinstrateFamilysHouse_EventScript_Victoria:: @ 822A4A2 lock faceplayer - setvar VAR_0x8008, 3 + setvar VAR_0x8008, LOCALID_VICTORIA goto_if_set FLAG_RECEIVED_MACHO_BRACE, Route111_WinstrateFamilysHouse_EventScript_ReceivedMachoBrace msgbox Route111_WinstrateFamilysHouse_Text_LikeYouToHaveMachoBrace, MSGBOX_DEFAULT giveitem ITEM_MACHO_BRACE @@ -30,7 +35,7 @@ Route111_WinstrateFamilysHouse_EventScript_ReceivedMachoBrace:: @ 822A4DA Route111_WinstrateFamilysHouse_EventScript_Vivi:: @ 822A4E8 lock faceplayer - setvar VAR_0x8008, 1 + setvar VAR_0x8008, LOCALID_VIVI msgbox Route111_WinstrateFamilysHouse_Text_StrongerFamilyMembers, MSGBOX_DEFAULT goto Route111_WinstrateFamilysHouse_EventScript_FaceOriginalDirection end @@ -38,7 +43,7 @@ Route111_WinstrateFamilysHouse_EventScript_Vivi:: @ 822A4E8 Route111_WinstrateFamilysHouse_EventScript_Vicky:: @ 822A4FD lock faceplayer - setvar VAR_0x8008, 4 + setvar VAR_0x8008, LOCALID_VICKY goto_if_set FLAG_TEMP_4, Route111_WinstrateFamilysHouse_EventScript_AlreadySpokenTo msgbox Route111_WinstrateFamilysHouse_Text_GrandsonStrong, MSGBOX_DEFAULT setflag FLAG_TEMP_4 diff --git a/data/maps/Route112/scripts.inc b/data/maps/Route112/scripts.inc index 4dd4fe112..67f776f67 100644 --- a/data/maps/Route112/scripts.inc +++ b/data/maps/Route112/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_GRUNT_1, 1 +.set LOCALID_GRUNT_2, 6 + Route112_MapScripts:: @ 81F1DA8 map_script MAP_SCRIPT_ON_TRANSITION, Route112_OnTransition .byte 0 @@ -10,36 +13,36 @@ Route112_OnTransition: @ 81F1DAE Route112_EventScript_MagmaGrunts:: @ 81F1DB7 lockall delay 40 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_GRUNT_1, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 20 msgbox Route112_Text_LeaderGoingToAwakenThing, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_1, Common_Movement_FaceOriginalDirection waitmovement 0 delay 40 - applymovement 6, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_GRUNT_2, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 delay 20 msgbox Route112_Text_YeahWeNeedMeteorite, MSGBOX_DEFAULT closemessage - applymovement 6, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_2, Common_Movement_FaceOriginalDirection waitmovement 0 delay 40 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_GRUNT_1, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 20 msgbox Route112_Text_OhThatsWhyCrewWentToFallarbor, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_1, Common_Movement_FaceOriginalDirection waitmovement 0 delay 40 - applymovement 6, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_GRUNT_2, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 delay 20 msgbox Route112_Text_CantLetAnyonePassUntilTheyreBack, MSGBOX_DEFAULT closemessage - applymovement 6, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_2, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end diff --git a/data/maps/Route112_CableCarStation/scripts.inc b/data/maps/Route112_CableCarStation/scripts.inc index 63b33f264..b1da3e3cb 100644 --- a/data/maps/Route112_CableCarStation/scripts.inc +++ b/data/maps/Route112_CableCarStation/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + Route112_CableCarStation_MapScripts:: @ 822AABE map_script MAP_SCRIPT_ON_TRANSITION, Route112_CableCarStation_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, Route112_CableCarStation_OnFrame @@ -10,8 +12,8 @@ Route112_CableCarStation_OnTransition: @ 822AAC9 end Route112_CableCarStation_EventScript_MoveAttendantAside:: @ 822AADD - setobjectxyperm 1, 7, 4 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_LEFT + setobjectxyperm LOCALID_ATTENDANT, 7, 4 + setobjectmovementtype LOCALID_ATTENDANT, MOVEMENT_TYPE_FACE_LEFT return Route112_CableCarStation_OnFrame: @ 822AAE9 @@ -21,11 +23,11 @@ Route112_CableCarStation_OnFrame: @ 822AAE9 Route112_CableCarStation_EventScript_ExitCableCar:: @ 822AAF3 lockall applymovement OBJ_EVENT_ID_PLAYER, Route112_CableCarStation_Movement_ExitCableCar - applymovement 1, Route112_CableCarStation_Movement_FollowPlayerOutFromCableCar + applymovement LOCALID_ATTENDANT, Route112_CableCarStation_Movement_FollowPlayerOutFromCableCar waitmovement 0 setvar VAR_CABLE_CAR_STATION_STATE, 0 - setobjectxyperm 1, 6, 7 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_ATTENDANT, 6, 7 + setobjectmovementtype LOCALID_ATTENDANT, MOVEMENT_TYPE_FACE_DOWN releaseall end @@ -42,7 +44,7 @@ Route112_CableCarStation_EventScript_Attendant:: @ 822AB17 Route112_CableCarStation_EventScript_RideCableCar:: @ 822AB38 msgbox Route112_CableCarStation_Text_StepThisWay, MSGBOX_DEFAULT closemessage - applymovement 1, Route112_CableCarStation_Movement_LeadPlayerToCableCar + applymovement LOCALID_ATTENDANT, Route112_CableCarStation_Movement_LeadPlayerToCableCar applymovement OBJ_EVENT_ID_PLAYER, Route112_CableCarStation_Movement_BoardCableCar waitmovement 0 setvar VAR_0x8004, 0 diff --git a/data/maps/Route114_FossilManiacsTunnel/scripts.inc b/data/maps/Route114_FossilManiacsTunnel/scripts.inc index 7483b453f..86bb20eed 100644 --- a/data/maps/Route114_FossilManiacsTunnel/scripts.inc +++ b/data/maps/Route114_FossilManiacsTunnel/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_FOSSIL_MANIAC, 1 + Route114_FossilManiacsTunnel_MapScripts:: @ 822AF28 map_script MAP_SCRIPT_ON_TRANSITION, Route114_FossilManiacsTunnel_OnTransition map_script MAP_SCRIPT_ON_LOAD, Route114_FossilManiacsTunnel_OnLoad @@ -8,8 +10,8 @@ Route114_FossilManiacsTunnel_OnTransition: @ 822AF33 end Route114_FossilManiacsTunnel_EventScript_MoveFossilManiac:: @ 822AF3D - setobjectxyperm 1, 6, 5 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_FOSSIL_MANIAC, 6, 5 + setobjectmovementtype LOCALID_FOSSIL_MANIAC, MOVEMENT_TYPE_FACE_DOWN return Route114_FossilManiacsTunnel_OnLoad: @ 822AF49 @@ -23,7 +25,7 @@ Route114_FossilManiacsTunnel_EventScript_CloseDesertUnderpass:: @ 822AF53 Route114_FossilManiacsTunnel_EventScript_ManiacMentionCaveIn:: @ 822AF66 lockall - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_FOSSIL_MANIAC, Common_Movement_WalkInPlaceFastestUp applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox Route114_FossilManiacsTunnel_Text_NotSafeThatWay, MSGBOX_DEFAULT diff --git a/data/maps/Route116/scripts.inc b/data/maps/Route116/scripts.inc index 87ff20904..d904fb9eb 100644 --- a/data/maps/Route116/scripts.inc +++ b/data/maps/Route116/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_BRINEY, 11 +.set LOCALID_WANDAS_BF_OUTSIDE, 21 + Route116_MapScripts:: @ 81F2C0C map_script MAP_SCRIPT_ON_TRANSITION, Route116_OnTransition map_script MAP_SCRIPT_ON_LOAD, Route116_OnLoad @@ -15,7 +18,7 @@ Route116_OnTransition: @ 81F2C1C end Route116_EventScript_SetWandasBoyfriendPos:: @ 81F2C47 - setobjectxyperm 21, 38, 10 + setobjectxyperm LOCALID_WANDAS_BF_OUTSIDE, 38, 10 return Route116_OnLoad: @ 81F2C4F @@ -151,7 +154,7 @@ Route116_EventScript_Briney:: @ 81F2D84 Route116_EventScript_BrineyTrigger:: @ 81F2D95 lockall - applymovement 11, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_BRINEY, Common_Movement_WalkInPlaceFastestRight applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 msgbox Route116_Text_ScoundrelMadeOffWithPeeko, MSGBOX_DEFAULT diff --git a/data/maps/Route117/scripts.inc b/data/maps/Route117/scripts.inc index 47d8eced9..08f8d0500 100644 --- a/data/maps/Route117/scripts.inc +++ b/data/maps/Route117/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_DAYCARE_MAN, 3 + Route117_MapScripts:: @ 81F397D map_script MAP_SCRIPT_ON_TRANSITION, Route117_OnTransition .byte 0 @@ -8,7 +10,7 @@ Route117_OnTransition: @ 81F3983 Route117_EventScript_TryMoveDayCareMan:: @ 81F3989 goto_if_unset FLAG_PENDING_DAYCARE_EGG, Route117_EventScript_StopMoveDayCareMan - setobjectxyperm 3, 47, 6 + setobjectxyperm LOCALID_DAYCARE_MAN, 47, 6 Route117_EventScript_StopMoveDayCareMan:: @ 81F3999 return diff --git a/data/maps/Route118/scripts.inc b/data/maps/Route118/scripts.inc index 2fbbb7016..1a34ad96c 100644 --- a/data/maps/Route118/scripts.inc +++ b/data/maps/Route118/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_STEVEN, 19 + Route118_MapScripts:: @ 81F3DBC map_script MAP_SCRIPT_ON_TRANSITION, Route118_OnTransition map_script MAP_SCRIPT_ON_LOAD, Route118_OnLoad @@ -71,7 +73,7 @@ Route118_EventScript_StevenTrigger0:: @ 81F3E8E setvar VAR_0x8008, 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceUp waitmovement 0 - applymovement 19, Route118_Movement_StevenApproachLedge0 + applymovement LOCALID_STEVEN, Route118_Movement_StevenApproachLedge0 waitmovement 0 goto Route118_EventScript_StevenTrigger end @@ -89,14 +91,14 @@ Route118_EventScript_StevenTrigger2:: @ 81F3EC4 setvar VAR_0x8008, 2 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceUp waitmovement 0 - applymovement 19, Route118_Movement_StevenApproachLedge2 + applymovement LOCALID_STEVEN, Route118_Movement_StevenApproachLedge2 waitmovement 0 goto Route118_EventScript_StevenTrigger end Route118_EventScript_StevenTrigger:: @ 81F3EE4 playse SE_DANSA - applymovement 19, Route118_Movement_StevenJumpLedge + applymovement LOCALID_STEVEN, Route118_Movement_StevenJumpLedge waitmovement 0 delay 30 msgbox Route118_Text_StevenQuestions, MSGBOX_DEFAULT @@ -108,25 +110,25 @@ Route118_EventScript_StevenTrigger:: @ 81F3EE4 compare VAR_0x8008, 2 call_if_eq Route118_EventScript_StevenExit2 setvar VAR_ROUTE118_STATE, 1 - removeobject 19 + removeobject LOCALID_STEVEN releaseall end Route118_EventScript_StevenExit0:: @ 81F3F28 applymovement OBJ_EVENT_ID_PLAYER, Route118_Movement_PlayerWatchStevenExit - applymovement 19, Route118_Movement_StevenExit0 + applymovement LOCALID_STEVEN, Route118_Movement_StevenExit0 waitmovement 0 return Route118_EventScript_StevenExit1:: @ 81F3F3A applymovement OBJ_EVENT_ID_PLAYER, Route118_Movement_PlayerWatchStevenExit - applymovement 19, Route118_Movement_StevenExit1 + applymovement LOCALID_STEVEN, Route118_Movement_StevenExit1 waitmovement 0 return Route118_EventScript_StevenExit2:: @ 81F3F4C applymovement OBJ_EVENT_ID_PLAYER, Route118_Movement_PlayerWatchStevenExit - applymovement 19, Route118_Movement_StevenExit2 + applymovement LOCALID_STEVEN, Route118_Movement_StevenExit2 waitmovement 0 return diff --git a/data/maps/Route119/scripts.inc b/data/maps/Route119/scripts.inc index 93d7f257c..2800126f6 100644 --- a/data/maps/Route119/scripts.inc +++ b/data/maps/Route119/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_RIVAL, 16 +.set LOCALID_RIVAL_ON_BIKE, 25 +.set LOCALID_SCOTT, 43 + Route119_MapScripts:: @ 81F4424 map_script MAP_SCRIPT_ON_RESUME, Route119_OnResume map_script MAP_SCRIPT_ON_TRANSITION, Route119_OnTransition @@ -40,7 +44,7 @@ Route119_EventScript_RivalTrigger2:: @ 81F447D Route119_EventScript_RivalEncounter:: @ 81F4488 lockall - addobject 25 @ Rival on bike + addobject LOCALID_RIVAL_ON_BIKE checkplayergender compare VAR_RESULT, MALE call_if_eq Route119_EventScript_PlayMayMusic @@ -58,8 +62,8 @@ Route119_EventScript_RivalEncounter:: @ 81F4488 call_if_eq Route119_EventScript_SetRivalPos1 compare VAR_TEMP_1, 2 call_if_eq Route119_EventScript_SetRivalPos2 - removeobject 25 - addobject 16 @ Rival on foot + removeobject LOCALID_RIVAL_ON_BIKE + addobject LOCALID_RIVAL delay 30 checkplayergender compare VAR_RESULT, MALE @@ -148,14 +152,14 @@ Route119_EventScript_RivalExitScottArrive:: @ 81F460F call_if_eq Route119_EventScript_SetRivalPos1 compare VAR_TEMP_1, 2 call_if_eq Route119_EventScript_SetRivalPos2 - removeobject 16 @ Rival on foot - addobject 25 @ Rival on bike + removeobject LOCALID_RIVAL + addobject LOCALID_RIVAL_ON_BIKE delay 30 compare VAR_TEMP_1, 1 call_if_eq Route119_EventScript_RivalExit1 compare VAR_TEMP_1, 2 call_if_eq Route119_EventScript_RivalExit2 - removeobject 25 + removeobject LOCALID_RIVAL_ON_BIKE setvar VAR_ROUTE119_STATE, 1 savebgm MUS_DUMMY fadedefaultbgm @@ -164,8 +168,8 @@ Route119_EventScript_RivalExitScottArrive:: @ 81F460F call_if_eq Route119_EventScript_SetScottPos1 compare VAR_TEMP_1, 2 call_if_eq Route119_EventScript_SetScottPos2 - addobject 43 @ Scott - applymovement 43, Route119_Movement_ScottEnter + addobject LOCALID_SCOTT + applymovement LOCALID_SCOTT, Route119_Movement_ScottEnter waitmovement 0 addvar VAR_SCOTT_STATE, 1 msgbox Route119_Text_ScottWayToGoBeSeeingYou, MSGBOX_DEFAULT @@ -174,58 +178,58 @@ Route119_EventScript_RivalExitScottArrive:: @ 81F460F call_if_eq Route119_EventScript_ScottExit1 compare VAR_TEMP_1, 2 call_if_eq Route119_EventScript_ScottExit2 - removeobject 43 + removeobject LOCALID_SCOTT releaseall end Route119_EventScript_SetScottPos1:: @ 81F46A0 - setobjectxyperm 43, 27, 25 + setobjectxyperm LOCALID_SCOTT, 27, 25 return Route119_EventScript_SetScottPos2:: @ 81F46A8 - setobjectxyperm 43, 28, 25 + setobjectxyperm LOCALID_SCOTT, 28, 25 return Route119_EventScript_ScottExit1:: @ 81F46B0 - applymovement 43, Route119_Movement_ScottExit1 + applymovement LOCALID_SCOTT, Route119_Movement_ScottExit1 waitmovement 0 return Route119_EventScript_ScottExit2:: @ 81F46BB - applymovement 43, Route119_Movement_ScottExit2 + applymovement LOCALID_SCOTT, Route119_Movement_ScottExit2 waitmovement 0 return Route119_EventScript_RivalEnter1:: @ 81F46C6 - applymovement 25, Route119_Movement_RivalEnter1 + applymovement LOCALID_RIVAL_ON_BIKE, Route119_Movement_RivalEnter1 waitmovement 0 return Route119_EventScript_RivalEnter2:: @ 81F46D1 - applymovement 25, Route119_Movement_RivalEnter2 + applymovement LOCALID_RIVAL_ON_BIKE, Route119_Movement_RivalEnter2 waitmovement 0 return Route119_EventScript_RivalExit1:: @ 81F46DC applymovement OBJ_EVENT_ID_PLAYER, Route119_Movement_PlayerWatchRivalExit1 - applymovement 25, Route119_Movement_RivalExit1 + applymovement LOCALID_RIVAL_ON_BIKE, Route119_Movement_RivalExit1 waitmovement 0 return Route119_EventScript_RivalExit2:: @ 81F46EE applymovement OBJ_EVENT_ID_PLAYER, Route119_Movement_PlayerWatchRivalExit2 - applymovement 25, Route119_Movement_RivalExit2 + applymovement LOCALID_RIVAL_ON_BIKE, Route119_Movement_RivalExit2 waitmovement 0 return Route119_EventScript_SetRivalPos1:: @ 81F4700 - setobjectxyperm 16, 25, 32 - setobjectxyperm 25, 25, 32 + setobjectxyperm LOCALID_RIVAL, 25, 32 + setobjectxyperm LOCALID_RIVAL_ON_BIKE, 25, 32 return Route119_EventScript_SetRivalPos2:: @ 81F470F - setobjectxyperm 16, 26, 32 - setobjectxyperm 25, 26, 32 + setobjectxyperm LOCALID_RIVAL, 26, 32 + setobjectxyperm LOCALID_RIVAL_ON_BIKE, 26, 32 return Route119_Movement_PlayerWatchRivalExit1: @ 81F471E diff --git a/data/maps/Route119_WeatherInstitute_1F/scripts.inc b/data/maps/Route119_WeatherInstitute_1F/scripts.inc index c734ee3c4..03c537cf0 100644 --- a/data/maps/Route119_WeatherInstitute_1F/scripts.inc +++ b/data/maps/Route119_WeatherInstitute_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_LITTLE_BOY, 5 + Route119_WeatherInstitute_1F_MapScripts:: @ 826FA86 map_script MAP_SCRIPT_ON_TRANSITION, Route119_WeatherInstitute_1F_OnTransition .byte 0 @@ -8,8 +10,8 @@ Route119_WeatherInstitute_1F_OnTransition: @ 826FA8C end Route119_WeatherInstitute_1F_EventScript_SetLittleBoyPos:: @ 826FA98 - setobjectxyperm 5, 0, 5 - setobjectmovementtype 5, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_LITTLE_BOY, 0, 5 + setobjectmovementtype LOCALID_LITTLE_BOY, MOVEMENT_TYPE_FACE_RIGHT return Route119_WeatherInstitute_1F_EventScript_LittleBoy:: @ 826FAA4 diff --git a/data/maps/Route119_WeatherInstitute_2F/scripts.inc b/data/maps/Route119_WeatherInstitute_2F/scripts.inc index 9e22fca6e..7e2c15606 100644 --- a/data/maps/Route119_WeatherInstitute_2F/scripts.inc +++ b/data/maps/Route119_WeatherInstitute_2F/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_GRUNT_1, 1 +.set LOCALID_GRUNT_2, 2 +.set LOCALID_SHELLY, 3 +.set LOCALID_SCIENTIST, 5 +.set LOCALID_GRUNT_3, 7 +.set LOCALID_GRUNT_4, 8 + Route119_WeatherInstitute_2F_MapScripts:: @ 826FF1E map_script MAP_SCRIPT_ON_TRANSITION, Route119_WeatherInstitute_2F_OnTransition .byte 0 @@ -11,18 +18,18 @@ Route119_WeatherInstitute_2F_OnTransition: @ 826FF24 end Route119_WeatherInstitute_2F_EventScript_SetScientistPosAquaHere:: @ 826FF44 - setobjectxyperm 5, 1, 6 - setobjectmovementtype 5, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_SCIENTIST, 1, 6 + setobjectmovementtype LOCALID_SCIENTIST, MOVEMENT_TYPE_FACE_RIGHT return Route119_WeatherInstitute_2F_EventScript_SetScientistPosAquaGone:: @ 826FF50 - setobjectxyperm 5, 4, 6 - setobjectmovementtype 5, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_SCIENTIST, 4, 6 + setobjectmovementtype LOCALID_SCIENTIST, MOVEMENT_TYPE_FACE_RIGHT return Route119_WeatherInstitute_2F_EventScript_SetScientistPosGameClear:: @ 826FF5C - setobjectxyperm 5, 2, 2 - setobjectmovementtype 5, MOVEMENT_TYPE_FACE_UP + setobjectxyperm LOCALID_SCIENTIST, 2, 2 + setobjectmovementtype LOCALID_SCIENTIST, MOVEMENT_TYPE_FACE_UP return Route119_WeatherInstitute_2F_EventScript_Grunt5:: @ 826FF68 @@ -48,16 +55,16 @@ Route119_WeatherInstitute_2F_EventScript_Shelly:: @ 826FFAD Route119_WeatherInstitute_2F_EventScript_ShellyDefeated:: @ 826FFC8 msgbox Route119_WeatherInstitute_2F_Text_ShellyPostBattle, MSGBOX_DEFAULT closemessage - addobject 7 @ Aqua grunt - applymovement 7, Route119_WeatherInstitute_2F_Movement_GruntApproachShelly + addobject LOCALID_GRUNT_3 + applymovement LOCALID_GRUNT_3, Route119_WeatherInstitute_2F_Movement_GruntApproachShelly applymovement OBJ_EVENT_ID_PLAYER, Route119_WeatherInstitute_2F_Movement_ShovePlayerOutOfWay waitmovement 0 msgbox Route119_WeatherInstitute_2F_Text_TeamMagmaJustPassedBy, MSGBOX_DEFAULT closemessage playse SE_PIN - applymovement 3, Common_Movement_ExclamationMark + applymovement LOCALID_SHELLY, Common_Movement_ExclamationMark waitmovement 0 - applymovement 3, Common_Movement_Delay48 + applymovement LOCALID_SHELLY, Common_Movement_Delay48 waitmovement 0 msgbox Route119_WeatherInstitute_2F_Text_WeHaveToHurryToMtPyre, MSGBOX_DEFAULT closemessage @@ -67,17 +74,17 @@ Route119_WeatherInstitute_2F_EventScript_ShellyDefeated:: @ 826FFC8 fadescreen FADE_TO_BLACK setflag FLAG_HIDE_ROUTE_119_TEAM_AQUA setflag FLAG_HIDE_WEATHER_INSTITUTE_2F_AQUA_GRUNT_M - removeobject 1 - removeobject 2 - removeobject 3 - removeobject 8 - removeobject 7 + removeobject LOCALID_GRUNT_1 + removeobject LOCALID_GRUNT_2 + removeobject LOCALID_SHELLY + removeobject LOCALID_GRUNT_4 + removeobject LOCALID_GRUNT_3 applymovement OBJ_EVENT_ID_PLAYER, Route119_WeatherInstitute_2F_Movement_PlayerReturnToPosition waitmovement 0 fadescreen FADE_FROM_BLACK - applymovement 5, Route119_WeatherInstitute_2F_Movement_ScientistApproachPlayer + applymovement LOCALID_SCIENTIST, Route119_WeatherInstitute_2F_Movement_ScientistApproachPlayer waitmovement 0 - copyobjectxytoperm 5 + copyobjectxytoperm LOCALID_SCIENTIST goto Route119_WeatherInstitute_2F_EventScript_ReceiveCastform end diff --git a/data/maps/Route120/scripts.inc b/data/maps/Route120/scripts.inc index a8aff3f76..7ec3e1221 100644 --- a/data/maps/Route120/scripts.inc +++ b/data/maps/Route120/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_INVISIBLE_BRIDGE_KECLEON, 30 +.set LOCALID_STEVEN, 31 +.set LOCALID_VISIBLE_BRIDGE_KECLEON, 36 + Route120_MapScripts:: @ 81F53EC map_script MAP_SCRIPT_ON_RESUME, Route120_OnResume map_script MAP_SCRIPT_ON_TRANSITION, Route120_OnTransition @@ -27,8 +31,8 @@ Route120_EventScript_RemoveBridgeKecleon:: @ 81F5449 specialvar VAR_RESULT, GetBattleOutcome compare VAR_RESULT, B_OUTCOME_CAUGHT goto_if_ne Common_EventScript_NopReturn - removeobject 30 @ Invisible Bridge Kecleon - removeobject 36 @ Visible Bridge Kecleon + removeobject LOCALID_INVISIBLE_BRIDGE_KECLEON + removeobject LOCALID_VISIBLE_BRIDGE_KECLEON return Route120_EventScript_RemoveKecleon:: @ 81F5460 @@ -57,7 +61,7 @@ Route120_EventScript_SetBridgeClearMetatiles:: @ 81F54A3 return Route120_EventScript_SetBridgeKecleonMovement:: @ 81F54C8 - setobjectmovementtype 36, MOVEMENT_TYPE_FACE_RIGHT + setobjectmovementtype LOCALID_VISIBLE_BRIDGE_KECLEON, MOVEMENT_TYPE_FACE_RIGHT return Route120_OnTransition: @ 81F54CD @@ -146,7 +150,7 @@ Route120_EventScript_GiveIapapaBerry:: @ 81F55F6 Route120_EventScript_GiveBerry:: @ 81F5601 giveitem VAR_0x8004 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLAG_DAILY_ROUTE_120_RECEIVED_BERRY msgbox Route120_Text_BerryIsRareRaiseItWithCare, MSGBOX_DEFAULT @@ -196,14 +200,14 @@ Route120_EventScript_StevenBattleKecleon:: @ 81F568B call_if_eq Route120_EventScript_PlayerApproachKecleonNorth compare VAR_FACING, DIR_WEST call_if_eq Route120_EventScript_PlayerApproachKecleonWest - applymovement 31, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_STEVEN, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 delay 20 msgbox Route120_Text_StevenUsedDevonScope, MSGBOX_DEFAULT closemessage - applymovement 30, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_INVISIBLE_BRIDGE_KECLEON, Common_Movement_WalkInPlaceFastestRight waitmovement 0 - applymovement 30, Movement_KecleonAppears + applymovement LOCALID_INVISIBLE_BRIDGE_KECLEON, Movement_KecleonAppears waitmovement 0 waitse playmoncry SPECIES_KECLEON, 2 @@ -226,14 +230,14 @@ Route120_EventScript_StevenBattleKecleon:: @ 81F568B Route120_EventScript_RemoveBridgeKecleonPostBattle:: @ 81F571C fadescreenswapbuffers FADE_TO_BLACK - removeobject 30 @ Invisible Bridge Kecleon - removeobject 36 @ Visible Bridge Kecleon + removeobject LOCALID_INVISIBLE_BRIDGE_KECLEON + removeobject LOCALID_VISIBLE_BRIDGE_KECLEON fadescreenswapbuffers FADE_FROM_BLACK goto Route120_EventScript_StevenGiveDeconScope end Route120_EventScript_StevenGiveDeconScope:: @ 81F572C - applymovement 31, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_STEVEN, Common_Movement_WalkInPlaceFastestDown applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox Route120_Text_StevenGiveDevonScope, MSGBOX_DEFAULT @@ -241,13 +245,13 @@ Route120_EventScript_StevenGiveDeconScope:: @ 81F572C setflag FLAG_RECEIVED_DEVON_SCOPE msgbox Route120_Text_StevenGoodbye, MSGBOX_DEFAULT closemessage - applymovement 31, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_STEVEN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 50 setfieldeffectargument 0, 1 dofieldeffect FLDEFF_NPCFLY_OUT delay 15 - removeobject 31 + removeobject LOCALID_STEVEN waitfieldeffect FLDEFF_NPCFLY_OUT setmetatile 13, 15, METATILE_Fortree_WoodBridge1_Top, 0 setmetatile 12, 16, METATILE_Fortree_WoodBridge1_Bottom, 0 diff --git a/data/maps/Route121/scripts.inc b/data/maps/Route121/scripts.inc index 81330b6e8..1a7591a93 100644 --- a/data/maps/Route121/scripts.inc +++ b/data/maps/Route121/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_GRUNT_1, 12 +.set LOCALID_GRUNT_2, 13 +.set LOCALID_GRUNT_3, 14 + Route121_MapScripts:: @ 81F5DFC .byte 0 @@ -16,18 +20,18 @@ Route121_EventScript_SafariZoneSign:: @ 81F5E0F Route121_EventScript_AquaGruntsMoveOut:: @ 81F5E18 lockall playbgm MUS_AQA_0, 0 - applymovement 13, Common_Movement_WalkInPlaceRight + applymovement LOCALID_GRUNT_2, Common_Movement_WalkInPlaceRight waitmovement 0 msgbox Route121_Text_OkayMoveOutToMtPyre, MSGBOX_DEFAULT closemessage - applymovement 12, Route121_Movement_Grunt1Exit - applymovement 13, Route121_Movement_Grunt2Exit - applymovement 14, Route121_Movement_Grunt3Exit + applymovement LOCALID_GRUNT_1, Route121_Movement_Grunt1Exit + applymovement LOCALID_GRUNT_2, Route121_Movement_Grunt2Exit + applymovement LOCALID_GRUNT_3, Route121_Movement_Grunt3Exit waitmovement 0 fadedefaultbgm - removeobject 12 - removeobject 13 - removeobject 14 + removeobject LOCALID_GRUNT_1 + removeobject LOCALID_GRUNT_2 + removeobject LOCALID_GRUNT_3 setvar VAR_ROUTE121_STATE, 1 releaseall end diff --git a/data/maps/Route128/scripts.inc b/data/maps/Route128/scripts.inc index 807f6a382..2e69a50ad 100644 --- a/data/maps/Route128/scripts.inc +++ b/data/maps/Route128/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_STEVEN, 3 +.set LOCALID_ARCHIE, 4 +.set LOCALID_MAXIE, 5 + Route128_MapScripts:: @ 81F6B38 map_script MAP_SCRIPT_ON_TRANSITION, Route128_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, Route128_OnFrame @@ -14,64 +18,64 @@ Route128_OnFrame: @ 81F6B4D Route128_EventScript_KyogreAwakenedScene:: @ 81F6B57 lockall delay 20 - applymovement 4, Route128_Movement_ArchieLookAround + applymovement LOCALID_ARCHIE, Route128_Movement_ArchieLookAround waitmovement 0 msgbox Route128_Text_ArchieWhatHappened, MSGBOX_DEFAULT closemessage - applymovement 4, Route128_Movement_ArchieBackUp + applymovement LOCALID_ARCHIE, Route128_Movement_ArchieBackUp waitmovement 0 msgbox Route128_Text_ArchieIOnlyWanted, MSGBOX_DEFAULT closemessage - applymovement 5, Route128_Movement_MaxieApproachArchie + applymovement LOCALID_MAXIE, Route128_Movement_MaxieApproachArchie waitmovement 0 - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox Route128_Text_MaxieDoYouUnderstandNow, MSGBOX_DEFAULT closemessage - applymovement 5, Route128_Movement_MaxieApproachPlayer + applymovement LOCALID_MAXIE, Route128_Movement_MaxieApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox Route128_Text_MaxieResposibilityFallsToArchieAndMe, MSGBOX_DEFAULT closemessage - applymovement 4, Route128_Movement_ArchieRunLeft + applymovement LOCALID_ARCHIE, Route128_Movement_ArchieRunLeft applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft - applymovement 5, Route128_Movement_MaxieWalkLeft + applymovement LOCALID_MAXIE, Route128_Movement_MaxieWalkLeft waitmovement 0 msgbox Route128_Text_MaxieThisDefiesBelief, MSGBOX_DEFAULT closemessage delay 40 - applymovement 5, Route128_Movement_MaxieExit - applymovement 4, Route128_Movement_ArchieExit + applymovement LOCALID_MAXIE, Route128_Movement_MaxieExit + applymovement LOCALID_ARCHIE, Route128_Movement_ArchieExit waitmovement 0 - removeobject 5 - removeobject 4 + removeobject LOCALID_MAXIE + removeobject LOCALID_ARCHIE delay 100 setfieldeffectargument 0, 1 dofieldeffect FLDEFF_NPCFLY_OUT waitfieldeffect FLDEFF_NPCFLY_OUT - addobject 3 - applymovement 3, Route128_Movement_StevenApproachPlayer + addobject LOCALID_STEVEN + applymovement LOCALID_STEVEN, Route128_Movement_StevenApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox Route128_Text_StevenWhatIsHappening, MSGBOX_DEFAULT closemessage - applymovement 3, Route128_Movement_StevenWalkUp + applymovement LOCALID_STEVEN, Route128_Movement_StevenWalkUp applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox Route128_Text_StevenWholeWorldWillDrown, MSGBOX_DEFAULT - applymovement 3, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_STEVEN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox Route128_Text_StevenImGoingToSootopolis, MSGBOX_DEFAULT closemessage - applymovement 3, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_STEVEN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 50 setfieldeffectargument 0, 1 dofieldeffect FLDEFF_NPCFLY_OUT delay 15 - removeobject 3 + removeobject LOCALID_STEVEN waitfieldeffect FLDEFF_NPCFLY_OUT clearflag FLAG_HIDE_MAP_NAME_POPUP setvar VAR_ROUTE128_STATE, 2 diff --git a/data/maps/RustboroCity/scripts.inc b/data/maps/RustboroCity/scripts.inc index 27bfab94d..477b0d658 100644 --- a/data/maps/RustboroCity/scripts.inc +++ b/data/maps/RustboroCity/scripts.inc @@ -1,3 +1,10 @@ +.set LOCALID_LITTLE_BOY, 7 +.set LOCALID_LITTLE_GIRL, 8 +.set LOCALID_DEVON_EMPLOYEE, 9 +.set LOCALID_GRUNT, 10 +.set LOCALID_RIVAL, 14 +.set LOCALID_SCIENTIST, 15 + RustboroCity_MapScripts:: @ 81E06BD map_script MAP_SCRIPT_ON_TRANSITION, RustboroCity_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, RustboroCity_OnFrame @@ -16,11 +23,11 @@ RustboroCity_OnTransition: @ 81E06C8 RustboroCity_EventScript_PositionScientistForExit:: @ 81E06EC compare VAR_TEMP_0, 11 goto_if_eq RustboroCity_EventScript_PositionScientistLeftExit - setobjectxyperm 15, 12, 15 + setobjectxyperm LOCALID_SCIENTIST, 12, 15 end RustboroCity_EventScript_PositionScientistLeftExit:: @ 81E06FF - setobjectxyperm 15, 11, 15 + setobjectxyperm LOCALID_SCIENTIST, 11, 15 end RustboroCity_EventScript_HideMapNamePopup:: @ 81E0707 @@ -38,22 +45,22 @@ RustboroCity_EventScript_ScientistAddMatchCall:: @ 81E0715 waitmovement 0 playse SE_KAIDAN delay 10 - addobject 15 - applymovement 15, RustboroCity_Movement_ScientistApproachPlayer + addobject LOCALID_SCIENTIST + applymovement LOCALID_SCIENTIST, RustboroCity_Movement_ScientistApproachPlayer waitmovement 0 playse SE_PIN - applymovement 15, Common_Movement_ExclamationMark + applymovement LOCALID_SCIENTIST, Common_Movement_ExclamationMark waitmovement 0 - applymovement 15, Common_Movement_Delay48 + applymovement LOCALID_SCIENTIST, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 - applymovement 15, RustboroCity_Movement_ScientistWalkInPlaceDown + applymovement LOCALID_SCIENTIST, RustboroCity_Movement_ScientistWalkInPlaceDown waitmovement 0 msgbox RustboroCity_Text_DevelopedNewPokenavFeature, MSGBOX_DEFAULT closemessage setflag FLAG_HAS_MATCH_CALL - applymovement 15, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_SCIENTIST, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 playse SE_TK_KASYA delay 10 @@ -63,7 +70,7 @@ RustboroCity_EventScript_ScientistAddMatchCall:: @ 81E0715 delay 10 playse SE_TK_KASYA delay 20 - applymovement 15, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_SCIENTIST, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox RustboroCity_Text_AddedMatchCallPleaseCallMrStone, MSGBOX_DEFAULT closemessage @@ -94,10 +101,10 @@ RustboroCity_EventScript_MatchCallTutorial:: @ 81E07BD delay 20 msgbox RustboroCity_Text_IdBetterGetBackToWork, MSGBOX_DEFAULT closemessage - applymovement 15, RustboroCity_Movement_ScientistLeave + applymovement LOCALID_SCIENTIST, RustboroCity_Movement_ScientistLeave waitmovement 0 playse SE_KAIDAN - removeobject 15 + removeobject LOCALID_SCIENTIST setflag FLAG_HIDE_RUSTBORO_CITY_SCIENTIST setvar VAR_RUSTBORO_CITY_STATE, 7 clearflag FLAG_HIDE_MAP_NAME_POPUP @@ -223,7 +230,7 @@ RustboroCity_EventScript_LittleBoy:: @ 81E0922 lock faceplayer msgbox RustboroCity_Text_PokemonCanChangeLookFromExp, MSGBOX_DEFAULT - applymovement 7, Common_Movement_FaceOriginalDirection + applymovement LOCALID_LITTLE_BOY, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -232,7 +239,7 @@ RustboroCity_EventScript_LittleGirl:: @ 81E0938 lock faceplayer msgbox RustboroCity_Text_PokemonChangeShape, MSGBOX_DEFAULT - applymovement 8, Common_Movement_FaceOriginalDirection + applymovement LOCALID_LITTLE_GIRL, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -246,40 +253,40 @@ RustboroCity_EventScript_Man2:: @ 81E094E RustboroCity_EventScript_StolenGoodsTrigger0:: @ 81E095A lockall - setobjectxyperm 9, 14, 21 - setobjectmovementtype 9, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_DEVON_EMPLOYEE, 14, 21 + setobjectmovementtype LOCALID_DEVON_EMPLOYEE, MOVEMENT_TYPE_FACE_RIGHT setvar VAR_0x8004, 0 goto RustboroCity_EventScript_StolenGoodsScene end RustboroCity_EventScript_StolenGoodsTrigger1:: @ 81E0971 lockall - setobjectxyperm 9, 14, 21 - setobjectmovementtype 9, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_DEVON_EMPLOYEE, 14, 21 + setobjectmovementtype LOCALID_DEVON_EMPLOYEE, MOVEMENT_TYPE_FACE_RIGHT setvar VAR_0x8004, 1 goto RustboroCity_EventScript_StolenGoodsScene end RustboroCity_EventScript_StolenGoodsTrigger2:: @ 81E0988 lockall - setobjectxyperm 9, 14, 21 - setobjectmovementtype 9, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_DEVON_EMPLOYEE, 14, 21 + setobjectmovementtype LOCALID_DEVON_EMPLOYEE, MOVEMENT_TYPE_FACE_RIGHT setvar VAR_0x8004, 2 goto RustboroCity_EventScript_StolenGoodsScene end RustboroCity_EventScript_StolenGoodsTrigger3:: @ 81E099F lockall - setobjectxyperm 9, 14, 21 - setobjectmovementtype 9, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_DEVON_EMPLOYEE, 14, 21 + setobjectmovementtype LOCALID_DEVON_EMPLOYEE, MOVEMENT_TYPE_FACE_RIGHT setvar VAR_0x8004, 3 goto RustboroCity_EventScript_StolenGoodsScene end RustboroCity_EventScript_StolenGoodsTrigger4:: @ 81E09B6 lockall - setobjectxyperm 9, 14, 21 - setobjectmovementtype 9, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_DEVON_EMPLOYEE, 14, 21 + setobjectmovementtype LOCALID_DEVON_EMPLOYEE, MOVEMENT_TYPE_FACE_RIGHT setvar VAR_0x8004, 4 goto RustboroCity_EventScript_StolenGoodsScene end @@ -288,20 +295,20 @@ RustboroCity_EventScript_StolenGoodsScene:: @ 81E09CD msgbox RustboroCity_Text_OutOfTheWay, MSGBOX_DEFAULT closemessage playbgm MUS_AQA_0, 0 - addobject 10 - addobject 9 - applymovement 10, RustboroCity_Movement_GruntEscape + addobject LOCALID_GRUNT + addobject LOCALID_DEVON_EMPLOYEE + applymovement LOCALID_GRUNT, RustboroCity_Movement_GruntEscape waitmovement 0 - removeobject 10 - applymovement 9, RustboroCity_Movement_EmployeeChaseGrunt1 + removeobject LOCALID_GRUNT + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeChaseGrunt1 waitmovement 0 msgbox RustboroCity_Text_WaitDontTakeMyGoods, MSGBOX_DEFAULT closemessage - applymovement 9, RustboroCity_Movement_EmployeeChaseGrunt2 + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeChaseGrunt2 waitmovement 0 fadedefaultbgm - removeobject 9 - setobjectxyperm 9, 30, 10 + removeobject LOCALID_DEVON_EMPLOYEE + setobjectxyperm LOCALID_DEVON_EMPLOYEE, 30, 10 clearflag FLAG_HIDE_RUSTBORO_CITY_DEVON_EMPLOYEE_1 setflag FLAG_DEVON_GOODS_STOLEN setvar VAR_RUSTBORO_CITY_STATE, 2 @@ -327,31 +334,31 @@ RustboroCity_EventScript_YouGotItThankYou:: @ 81E0A44 @ Unknown, unused employee movements. Based on the differences in movement theyre for approaching an object (probably the player) in different positions RustboroCity_EventScript_EmployeeApproachUp:: @ 81E0A4D - applymovement 9, RustboroCity_Movement_EmployeeApproachUp + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeApproachUp waitmovement 0 return @ Unused, see above RustboroCity_EventScript_EmployeeApproachLeft:: @ 81E0A58 - applymovement 9, RustboroCity_Movement_EmployeeApproachLeft + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeApproachLeft waitmovement 0 return @ Unused, see above RustboroCity_EventScript_EmployeeApproachRight:: @ 81E0A63 - applymovement 9, RustboroCity_Movement_EmployeeApproachRight + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeApproachRight waitmovement 0 return @ Unused, see above RustboroCity_EventScript_EmployeeApproachDown:: @ 81E0A6E - applymovement 9, RustboroCity_Movement_EmployeeApproachDown + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeApproachDown waitmovement 0 return @ Unused, similar movement to the above scripts RustboroCity_EventScript_EmployeeApproachPlayerFar:: @ 81E0A79 - applymovement 9, RustboroCity_Movement_EmployeeApproachPlayerFar + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeApproachPlayerFar waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -509,57 +516,57 @@ RustboroCity_EventScript_EmployeeAskToGetGoods:: @ 81E0B2E call_if_eq RustboroCity_EventScript_EmployeeApproachPlayerDown1 setflag FLAG_INTERACTED_WITH_DEVON_EMPLOYEE_GOODS_STOLEN setvar VAR_RUSTBORO_CITY_STATE, 3 - copyobjectxytoperm 9 + copyobjectxytoperm LOCALID_DEVON_EMPLOYEE msgbox RustboroCity_Text_HelpMeIWasRobbed, MSGBOX_DEFAULT releaseall end @ The below movement scripts are either partially or fully duplicated by the movement scripts when the player returns the goods RustboroCity_EventScript_EmployeeFacePlayerUp1:: @ 81E0B6F - applymovement 9, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestUp waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return RustboroCity_EventScript_EmployeeFacePlayerLeft1:: @ 81E0B9B - applymovement 9, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceRight waitmovement 0 return RustboroCity_EventScript_EmployeeFacePlayerDown1:: @ 81E0BC7 - applymovement 9, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return RustboroCity_EventScript_EmployeeApproachPlayerDown1:: @ 81E0BF3 - applymovement 9, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 - applymovement 9, RustboroCity_Movement_EmployeeApproachPlayerDown + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeApproachPlayerDown waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -624,69 +631,69 @@ RustboroCity_EventScript_BagFull:: @ 81E0CD3 return RustboroCity_EventScript_EmployeeFacePlayerUp2:: @ 81E0CDC - applymovement 9, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestUp waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return RustboroCity_EventScript_EmployeeFacePlayerLeft2:: @ 81E0D08 - applymovement 9, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestRight waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceLeft waitmovement 0 return RustboroCity_EventScript_EmployeeFacePlayerDown2:: @ 81E0D34 - applymovement 9, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return RustboroCity_EventScript_EmployeeApproachPlayerDown2:: @ 81E0D60 - applymovement 9, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 - applymovement 9, RustboroCity_Movement_EmployeeApproachPlayerDown + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_Movement_EmployeeApproachPlayerDown waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 return RustboroCity_EventScript_EmployeeFacePlayerRight:: @ 81E0D96 - applymovement 9, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 playse SE_PIN - applymovement 9, Common_Movement_ExclamationMark + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_ExclamationMark waitmovement 0 - applymovement 9, Common_Movement_Delay48 + applymovement LOCALID_DEVON_EMPLOYEE, Common_Movement_Delay48 waitmovement 0 return RustboroCity_EventScript_Rival:: @ 81E0DB8 lockall call_if_unset FLAG_MET_RIVAL_RUSTBORO, RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_FacePlayer + applymovement LOCALID_RIVAL, Common_Movement_FacePlayer waitmovement 0 goto RustboroCity_EventScript_RivalEncounter @@ -709,14 +716,14 @@ RustboroCity_EventScript_PlayBrendanMusic:: @ 81E0DEE RustboroCity_EventScript_RivalTrigger0:: @ 81E0DF3 lockall call RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 14, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 14, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - applymovement 14, RustboroCity_Movement_RivalApproachPlayer0 + applymovement LOCALID_RIVAL, RustboroCity_Movement_RivalApproachPlayer0 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -725,14 +732,14 @@ RustboroCity_EventScript_RivalTrigger0:: @ 81E0DF3 RustboroCity_EventScript_RivalTrigger1:: @ 81E0E33 lockall call RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 14, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 14, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - applymovement 14, RustboroCity_Movement_RivalApproachPlayer1 + applymovement LOCALID_RIVAL, RustboroCity_Movement_RivalApproachPlayer1 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -741,14 +748,14 @@ RustboroCity_EventScript_RivalTrigger1:: @ 81E0E33 RustboroCity_EventScript_RivalTrigger2:: @ 81E0E73 lockall call RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 14, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 14, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - applymovement 14, RustboroCity_Movement_RivalApproachPlayer2 + applymovement LOCALID_RIVAL, RustboroCity_Movement_RivalApproachPlayer2 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -757,14 +764,14 @@ RustboroCity_EventScript_RivalTrigger2:: @ 81E0E73 RustboroCity_EventScript_RivalTrigger3:: @ 81E0EB3 lockall call RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 14, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 14, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - applymovement 14, RustboroCity_Movement_RivalApproachPlayer3 + applymovement LOCALID_RIVAL, RustboroCity_Movement_RivalApproachPlayer3 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -773,14 +780,14 @@ RustboroCity_EventScript_RivalTrigger3:: @ 81E0EB3 RustboroCity_EventScript_RivalTrigger4:: @ 81E0EF3 lockall call RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 14, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 14, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - applymovement 14, RustboroCity_Movement_RivalApproachPlayer4 + applymovement LOCALID_RIVAL, RustboroCity_Movement_RivalApproachPlayer4 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -789,14 +796,14 @@ RustboroCity_EventScript_RivalTrigger4:: @ 81E0EF3 RustboroCity_EventScript_RivalTrigger5:: @ 81E0F33 lockall call RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 14, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 14, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - applymovement 14, RustboroCity_Movement_RivalApproachPlayer5 + applymovement LOCALID_RIVAL, RustboroCity_Movement_RivalApproachPlayer5 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -805,14 +812,14 @@ RustboroCity_EventScript_RivalTrigger5:: @ 81E0F33 RustboroCity_EventScript_RivalTrigger6:: @ 81E0F73 lockall call RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 14, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 14, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - applymovement 14, RustboroCity_Movement_RivalApproachPlayer6 + applymovement LOCALID_RIVAL, RustboroCity_Movement_RivalApproachPlayer6 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 @@ -821,14 +828,14 @@ RustboroCity_EventScript_RivalTrigger6:: @ 81E0F73 RustboroCity_EventScript_RivalTrigger7:: @ 81E0FB3 lockall call RustboroCity_EventScript_PlayRivalMusic - applymovement 14, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_RIVAL, Common_Movement_WalkInPlaceFastestDown waitmovement 0 playse SE_PIN - applymovement 14, Common_Movement_ExclamationMark + applymovement LOCALID_RIVAL, Common_Movement_ExclamationMark waitmovement 0 - applymovement 14, Common_Movement_Delay48 + applymovement LOCALID_RIVAL, Common_Movement_Delay48 waitmovement 0 - applymovement 14, RustboroCity_Movement_RivalApproachPlayer7 + applymovement LOCALID_RIVAL, RustboroCity_Movement_RivalApproachPlayer7 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 diff --git a/data/maps/RustboroCity_DevonCorp_1F/scripts.inc b/data/maps/RustboroCity_DevonCorp_1F/scripts.inc index 3ee7e7dc8..80e8f3cf1 100644 --- a/data/maps/RustboroCity_DevonCorp_1F/scripts.inc +++ b/data/maps/RustboroCity_DevonCorp_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_STAIR_GUARD, 2 + RustboroCity_DevonCorp_1F_MapScripts:: @ 8211245 map_script MAP_SCRIPT_ON_TRANSITION, RustboroCity_DevonCorp_1F_OnTransition .byte 0 @@ -7,8 +9,8 @@ RustboroCity_DevonCorp_1F_OnTransition: @ 821124B end RustboroCity_DevonCorp_1F_EventScript_BlockStairs:: @ 8211255 - setobjectxyperm 2, 14, 2 - setobjectmovementtype 2, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_STAIR_GUARD, 14, 2 + setobjectmovementtype LOCALID_STAIR_GUARD, MOVEMENT_TYPE_FACE_DOWN return RustboroCity_DevonCorp_1F_EventScript_Employee:: @ 8211261 diff --git a/data/maps/RustboroCity_DevonCorp_2F/scripts.inc b/data/maps/RustboroCity_DevonCorp_2F/scripts.inc index 9df6d7ab6..e33fb2d0f 100644 --- a/data/maps/RustboroCity_DevonCorp_2F/scripts.inc +++ b/data/maps/RustboroCity_DevonCorp_2F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_FOSSIL_SCIENTIST, 5 + RustboroCity_DevonCorp_2F_MapScripts:: @ 8211857 map_script MAP_SCRIPT_ON_TRANSITION, RustboroCity_DevonCorp_2F_OnTransition .byte 0 @@ -80,9 +82,9 @@ RustboroCity_DevonCorp_2F_EventScript_FossilScientist:: @ 82118F1 RustboroCity_DevonCorp_2F_EventScript_NoticeRootFossil:: @ 8211933 closemessage playse SE_PIN - applymovement 5, Common_Movement_ExclamationMark + applymovement LOCALID_FOSSIL_SCIENTIST, Common_Movement_ExclamationMark waitmovement 0 - applymovement 5, Common_Movement_Delay48 + applymovement LOCALID_FOSSIL_SCIENTIST, Common_Movement_Delay48 waitmovement 0 msgbox RustboroCity_DevonCorp_2F_Text_WantToBringFossilBackToLife, MSGBOX_YESNO compare VAR_RESULT, NO @@ -105,9 +107,9 @@ RustboroCity_DevonCorp_2F_EventScript_GiveRootFossil:: @ 8211974 RustboroCity_DevonCorp_2F_EventScript_NoticeClawFossil:: @ 8211991 closemessage playse SE_PIN - applymovement 5, Common_Movement_ExclamationMark + applymovement LOCALID_FOSSIL_SCIENTIST, Common_Movement_ExclamationMark waitmovement 0 - applymovement 5, Common_Movement_Delay48 + applymovement LOCALID_FOSSIL_SCIENTIST, Common_Movement_Delay48 waitmovement 0 msgbox RustboroCity_DevonCorp_2F_Text_WantToBringFossilBackToLife, MSGBOX_YESNO compare VAR_RESULT, NO diff --git a/data/maps/RustboroCity_DevonCorp_3F/scripts.inc b/data/maps/RustboroCity_DevonCorp_3F/scripts.inc index aedbc9f9b..d24b4e902 100644 --- a/data/maps/RustboroCity_DevonCorp_3F/scripts.inc +++ b/data/maps/RustboroCity_DevonCorp_3F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_DEVON_EMPLOYEE, 2 + RustboroCity_DevonCorp_3F_MapScripts:: @ 821242D map_script MAP_SCRIPT_ON_TRANSITION, RustboroCity_DevonCorp_3F_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, RustboroCity_DevonCorp_3F_OnWarp @@ -10,8 +12,8 @@ RustboroCity_DevonCorp_3F_OnTransition: @ 821243D end RustboroCity_DevonCorp_3F_EventScript_SetEmployeePos:: @ 8212449 - setobjectxyperm 2, 3, 2 - setobjectmovementtype 2, MOVEMENT_TYPE_FACE_LEFT + setobjectxyperm LOCALID_DEVON_EMPLOYEE, 3, 2 + setobjectmovementtype LOCALID_DEVON_EMPLOYEE, MOVEMENT_TYPE_FACE_LEFT return RustboroCity_DevonCorp_3F_OnWarp: @ 8212455 @@ -30,21 +32,21 @@ RustboroCity_DevonCorp_3F_EventScript_MeetPresident:: @ 821246E lockall msgbox RustboroCity_DevonCorp_3F_Text_ThisIs3rdFloorWaitHere, MSGBOX_DEFAULT closemessage - applymovement 2, RustboroCity_DevonCorp_3F_Movement_EmployeeWalkOffscreen + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_DevonCorp_3F_Movement_EmployeeWalkOffscreen waitmovement 0 delay 80 - applymovement 2, RustboroCity_DevonCorp_3F_Movement_EmployeeReturnToPlayer + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_DevonCorp_3F_Movement_EmployeeReturnToPlayer waitmovement 0 msgbox RustboroCity_DevonCorp_3F_Text_WordWithPresidentComeWithMe, MSGBOX_DEFAULT closemessage playbgm MUS_TSURETEK, 0 - applymovement 2, RustboroCity_DevonCorp_3F_Movement_LeadPlayerToPresident + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_DevonCorp_3F_Movement_LeadPlayerToPresident applymovement OBJ_EVENT_ID_PLAYER, RustboroCity_DevonCorp_3F_Movement_PlayerFollowToPresident waitmovement 0 msgbox RustboroCity_DevonCorp_3F_Text_PleaseGoAhead, MSGBOX_DEFAULT closemessage fadedefaultbgm - applymovement 2, RustboroCity_DevonCorp_3F_Movement_EmployeeFaceDesk + applymovement LOCALID_DEVON_EMPLOYEE, RustboroCity_DevonCorp_3F_Movement_EmployeeFaceDesk applymovement OBJ_EVENT_ID_PLAYER, RustboroCity_DevonCorp_3F_Movement_PlayerApproachDesk waitmovement 0 msgbox RustboroCity_DevonCorp_3F_Text_MrStoneIHaveFavor, MSGBOX_DEFAULT @@ -162,7 +164,7 @@ RustboroCity_DevonCorp_3F_EventScript_MrStone:: @ 821256C RustboroCity_DevonCorp_3F_EventScript_GiveExpShare:: @ 8212595 msgbox RustboroCity_DevonCorp_3F_Text_ThankYouForDeliveringLetter, MSGBOX_DEFAULT giveitem ITEM_EXP_SHARE - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_EXP_SHARE msgbox RustboroCity_DevonCorp_3F_Text_ExplainExpShare, MSGBOX_DEFAULT diff --git a/data/maps/RustboroCity_Flat1_2F/scripts.inc b/data/maps/RustboroCity_Flat1_2F/scripts.inc index 4295f0447..a1943adae 100644 --- a/data/maps/RustboroCity_Flat1_2F/scripts.inc +++ b/data/maps/RustboroCity_Flat1_2F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WALDAS_DAD, 6 + RustboroCity_Flat1_2F_MapScripts:: @ 8215139 .byte 0 @@ -59,7 +61,7 @@ RustboroCity_Flat1_2F_EventScript_WaldaLikesPhrase:: @ 82151F8 msgbox RustboroCity_Flat1_2F_Text_LetsGiveItATry2, MSGBOX_DEFAULT call RustboroCity_Flat1_2F_EventScript_WaldasDadFaceWalda msgbox RustboroCity_Flat1_2F_Text_OhShesLaughing, MSGBOX_DEFAULT - applymovement 6, Common_Movement_FacePlayer + applymovement LOCALID_WALDAS_DAD, Common_Movement_FacePlayer waitmovement 0 msgbox RustboroCity_Flat1_2F_Text_ThankYouIllGiveYouWallpaper, MSGBOX_DEFAULT release @@ -73,7 +75,7 @@ RustboroCity_Flat1_2F_EventScript_WaldaDoesntLikePhrase:: @ 8215221 end RustboroCity_Flat1_2F_EventScript_WaldasDadFaceWalda:: @ 8215238 - turnobject 6, DIR_EAST + turnobject LOCALID_WALDAS_DAD, DIR_EAST return RustboroCity_Flat1_2F_EventScript_WaldasMom:: @ 821523D diff --git a/data/maps/RustboroCity_Flat2_2F/scripts.inc b/data/maps/RustboroCity_Flat2_2F/scripts.inc index 1caeda683..e7909d54b 100644 --- a/data/maps/RustboroCity_Flat2_2F/scripts.inc +++ b/data/maps/RustboroCity_Flat2_2F/scripts.inc @@ -11,7 +11,7 @@ RustboroCity_Flat2_2F_EventScript_NinjaBoy:: @ 8215FE1 goto_if_set FLAG_RECEIVED_PREMIER_BALL_RUSTBORO, RustboroCity_Flat2_2F_EventScript_GavePremierBall msgbox RustboroCity_Flat2_2F_Text_MyDaddyMadeThisYouCanHaveIt, MSGBOX_DEFAULT giveitem ITEM_PREMIER_BALL - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_PREMIER_BALL_RUSTBORO release diff --git a/data/maps/RustboroCity_Gym/scripts.inc b/data/maps/RustboroCity_Gym/scripts.inc index 94e032692..ce6fdb127 100644 --- a/data/maps/RustboroCity_Gym/scripts.inc +++ b/data/maps/RustboroCity_Gym/scripts.inc @@ -29,7 +29,7 @@ RustboroCity_Gym_EventScript_RoxanneDefeated:: @ 8212F66 RustboroCity_Gym_EventScript_GiveRockTomb:: @ 8212FA4 giveitem ITEM_TM39 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull setflag FLAG_RECEIVED_TM39 msgbox RustboroCity_Gym_Text_ExplainRockTomb, MSGBOX_DEFAULT diff --git a/data/maps/RustboroCity_PokemonCenter_1F/scripts.inc b/data/maps/RustboroCity_PokemonCenter_1F/scripts.inc index ca10592b0..fbe1ac739 100644 --- a/data/maps/RustboroCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/RustboroCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + RustboroCity_PokemonCenter_1F_MapScripts:: @ 8214D62 map_script MAP_SCRIPT_ON_TRANSITION, RustboroCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -8,9 +10,8 @@ RustboroCity_PokemonCenter_1F_OnTransition: @ 8214D6D call Common_EventScript_UpdateBrineyLocation end -@ VAR_0x800B is the Nurse's object event id RustboroCity_PokemonCenter_1F_EventScript_Nurse:: @ 8214D76 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/RusturfTunnel/scripts.inc b/data/maps/RusturfTunnel/scripts.inc index 853b94fc7..a342135bf 100644 --- a/data/maps/RusturfTunnel/scripts.inc +++ b/data/maps/RusturfTunnel/scripts.inc @@ -1,3 +1,9 @@ +.equ LOCALID_WANDAS_BF, 1 +.set LOCALID_BRINEY, 5 +.set LOCALID_GRUNT, 6 +.set LOCALID_PEEKO, 7 +.equ LOCALID_WANDA, 10 + RusturfTunnel_MapScripts:: @ 822CE27 map_script MAP_SCRIPT_ON_TRANSITION, RusturfTunnel_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, RusturfTunnel_OnFrame @@ -14,8 +20,8 @@ RusturfTunnel_OnTransition: @ 822CE44 end RusturfTunnel_EventScript_SetAquaGruntAndPeekoPos:: @ 822CE50 - setobjectxyperm 7, 13, 4 - setobjectxyperm 6, 13, 5 + setobjectxyperm LOCALID_PEEKO, 13, 4 + setobjectxyperm LOCALID_GRUNT, 13, 5 return RusturfTunnel_EventScript_Wanda:: @ 822CE5F @@ -86,35 +92,35 @@ RusturfTunnel_EventScript_ClearTunnelScene:: @ 822CEAE RusturfTunnel_EventScript_BoyfriendApproachWanda1:: @ 822CF5D applymovement OBJ_EVENT_ID_PLAYER, RusturfTunnel_Movement_PlayerWatchBoyfriend1 - applymovement 1, RusturfTunnel_Movement_BoyfriendApproachWanda1 + applymovement LOCALID_WANDAS_BF, RusturfTunnel_Movement_BoyfriendApproachWanda1 waitmovement 0 return RusturfTunnel_EventScript_BoyfriendApproachWanda2:: @ 822CF6F applymovement OBJ_EVENT_ID_PLAYER, RusturfTunnel_Movement_PlayerWatchBoyfriend - applymovement 1, RusturfTunnel_Movement_BoyfriendApproachWanda + applymovement LOCALID_WANDAS_BF, RusturfTunnel_Movement_BoyfriendApproachWanda waitmovement 0 - applymovement 10, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_WANDA, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return RusturfTunnel_EventScript_BoyfriendApproachWanda3:: @ 822CF8B applymovement OBJ_EVENT_ID_PLAYER, RusturfTunnel_Movement_PlayerWatchBoyfriend - applymovement 1, RusturfTunnel_Movement_BoyfriendApproachWanda + applymovement LOCALID_WANDAS_BF, RusturfTunnel_Movement_BoyfriendApproachWanda waitmovement 0 - applymovement 10, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_WANDA, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return RusturfTunnel_EventScript_FaceWandasBoyfriend1:: @ 822CFA7 - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_WANDAS_BF, Common_Movement_WalkInPlaceFastestUp waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return RusturfTunnel_EventScript_FaceWandasBoyfriend2:: @ 822CFBC - applymovement 1, RusturfTunnel_Movement_BoyfriendFaceRight + applymovement LOCALID_WANDAS_BF, RusturfTunnel_Movement_BoyfriendFaceRight waitmovement 0 return @@ -123,28 +129,28 @@ RusturfTunnel_EventScript_FaceWandasBoyfriend3:: @ 822CFC7 RusturfTunnel_EventScript_WandasBoyfriendApproachPlayer:: @ 822CFC8 closemessage - applymovement 1, RusturfTunnel_Movement_WandasBoyfriendApproachPlayer + applymovement LOCALID_WANDAS_BF, RusturfTunnel_Movement_WandasBoyfriendApproachPlayer waitmovement 0 return RusturfTunnel_EventScript_WandaAndBoyfriendExit1:: @ 822CFD4 - applymovement 10, RusturfTunnel_Movement_WandaExit1 - applymovement 1, RusturfTunnel_Movement_WandasBoyfriendExit1 + applymovement LOCALID_WANDA, RusturfTunnel_Movement_WandaExit1 + applymovement LOCALID_WANDAS_BF, RusturfTunnel_Movement_WandasBoyfriendExit1 waitmovement 0 return RusturfTunnel_EventScript_WandaAndBoyfriendExit:: @ 822CFE6 applymovement OBJ_EVENT_ID_PLAYER, RusturfTunnel_Movement_PlayerWatchWandaExit - applymovement 10, RusturfTunnel_Movement_WandaExit - applymovement 1, RusturfTunnel_Movement_WandasBoyfriendExit + applymovement LOCALID_WANDA, RusturfTunnel_Movement_WandaExit + applymovement LOCALID_WANDAS_BF, RusturfTunnel_Movement_WandasBoyfriendExit waitmovement 0 return RusturfTunnel_EventScript_WandasBoyfriendNotice:: @ 822CFFF playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_WANDAS_BF, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_WANDAS_BF, Common_Movement_Delay48 waitmovement 0 return @@ -282,11 +288,11 @@ RusturfTunnel_EventScript_AquaGruntBackUp:: @ 822D083 lockall msgbox RusturfTunnel_Text_ComeAndGetSome, MSGBOX_DEFAULT closemessage - applymovement 6, RusturfTunnel_Movement_GruntAndPeekoBackUp - applymovement 7, RusturfTunnel_Movement_GruntAndPeekoBackUp + applymovement LOCALID_GRUNT, RusturfTunnel_Movement_GruntAndPeekoBackUp + applymovement LOCALID_PEEKO, RusturfTunnel_Movement_GruntAndPeekoBackUp waitmovement 0 - copyobjectxytoperm 6 - copyobjectxytoperm 7 + copyobjectxytoperm LOCALID_GRUNT + copyobjectxytoperm LOCALID_PEEKO setvar VAR_RUSTURF_TUNNEL_STATE, 3 releaseall end @@ -317,18 +323,18 @@ RusturfTunnel_EventScript_Grunt:: @ 822D0C2 giveitem ITEM_DEVON_GOODS closemessage applymovement OBJ_EVENT_ID_PLAYER, RusturfTunnel_Movement_PushPlayerAsideForGrunt - applymovement 6, RusturfTunnel_Movement_GruntEscape + applymovement LOCALID_GRUNT, RusturfTunnel_Movement_GruntEscape waitmovement 0 - removeobject 6 + removeobject LOCALID_GRUNT delay 50 - addobject 5 - applymovement 5, RusturfTunnel_Movement_BrineyApproachPeeko1 + addobject LOCALID_BRINEY + applymovement LOCALID_BRINEY, RusturfTunnel_Movement_BrineyApproachPeeko1 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, RusturfTunnel_Movement_PlayerMoveAsideForBriney - applymovement 5, RusturfTunnel_Movement_BrineyApproachPeeko2 + applymovement LOCALID_BRINEY, RusturfTunnel_Movement_BrineyApproachPeeko2 waitmovement 0 msgbox RusturfTunnel_Text_PeekoGladToSeeYouSafe, MSGBOX_DEFAULT - applymovement 5, Common_Movement_FacePlayer + applymovement LOCALID_BRINEY, Common_Movement_FacePlayer waitmovement 0 message RusturfTunnel_Text_ThankYouLetsGoHomePeeko waitmessage @@ -338,11 +344,11 @@ RusturfTunnel_EventScript_Grunt:: @ 822D0C2 waitmoncry closemessage applymovement OBJ_EVENT_ID_PLAYER, RusturfTunnel_Movement_PlayerWatchBrineyExit - applymovement 5, RusturfTunnel_Movement_BrineyExit - applymovement 7, RusturfTunnel_Movement_PeekoExit + applymovement LOCALID_BRINEY, RusturfTunnel_Movement_BrineyExit + applymovement LOCALID_PEEKO, RusturfTunnel_Movement_PeekoExit waitmovement 0 - removeobject 5 - removeobject 7 + removeobject LOCALID_BRINEY + removeobject LOCALID_PEEKO clearflag FLAG_DEVON_GOODS_STOLEN setflag FLAG_RECOVERED_DEVON_GOODS setvar VAR_RUSTBORO_CITY_STATE, 4 diff --git a/data/maps/SSTidalCorridor/scripts.inc b/data/maps/SSTidalCorridor/scripts.inc index fae6efc1a..a055c6548 100644 --- a/data/maps/SSTidalCorridor/scripts.inc +++ b/data/maps/SSTidalCorridor/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_SAILOR, 1 +.set LOCALID_SCOTT, 5 + SSTidalCorridor_MapScripts:: @ 823BFCF map_script MAP_SCRIPT_ON_FRAME_TABLE, SSTidalCorridor_OnFrame .byte 0 @@ -191,20 +194,20 @@ SSTidalCorridor_EventScript_TrainerNotDefeated:: @ 823C218 SSTidalCorridor_EventScript_ScottScene:: @ 823C219 lockall - applymovement 5, SSTidalCorridor_Movement_ScottApproachPlayer + applymovement LOCALID_SCOTT, SSTidalCorridor_Movement_ScottApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox SSTidalCorridor_Text_ScottBattleFrontierInvite, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, SSTidalCorridor_Movement_PlayerWatchScottExit - applymovement 1, SSTidalCorridor_Movement_SailorMoveForScott - applymovement 5, SSTidalCorridor_Movement_ScottExit + applymovement LOCALID_SAILOR, SSTidalCorridor_Movement_SailorMoveForScott + applymovement LOCALID_SCOTT, SSTidalCorridor_Movement_ScottExit waitmovement 0 playse SE_KAIDAN waitse - removeobject 5 - applymovement 1, SSTidalCorridor_Movement_SailorReturn + removeobject LOCALID_SCOTT + applymovement LOCALID_SAILOR, SSTidalCorridor_Movement_SailorReturn waitmovement 0 delay 30 setflag FLAG_MET_SCOTT_ON_SS_TIDAL diff --git a/data/maps/SafariZone_South/scripts.inc b/data/maps/SafariZone_South/scripts.inc index 7918a9b96..75ea52347 100644 --- a/data/maps/SafariZone_South/scripts.inc +++ b/data/maps/SafariZone_South/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + SafariZone_South_MapScripts:: @ 823D279 map_script MAP_SCRIPT_ON_TRANSITION, SafariZone_South_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, SafariZone_South_OnFrame @@ -11,9 +13,9 @@ SafariZone_South_EventScript_EnterSafariZone:: @ 823D28E lockall applymovement OBJ_EVENT_ID_PLAYER, SafariZone_South_Movement_PlayerEnter waitmovement 0 - applymovement 1, SafariZone_South_Movement_ExitAttendantBlockDoor + applymovement LOCALID_ATTENDANT, SafariZone_South_Movement_ExitAttendantBlockDoor waitmovement 0 - setobjectxyperm 1, 32, 34 + setobjectxyperm LOCALID_ATTENDANT, 32, 34 setvar VAR_SAFARI_ZONE_STATE, 0 releaseall end @@ -24,7 +26,7 @@ SafariZone_South_OnTransition: @ 823D2B1 end SafariZone_South_EventScript_SetExitAttendantAside:: @ 823D2BD - setobjectxyperm 1, 31, 34 + setobjectxyperm LOCALID_ATTENDANT, 31, 34 return SafariZone_South_Movement_PlayerEnter: @ 823D2C5 @@ -74,7 +76,7 @@ SafariZone_South_EventScript_ExitEarly:: @ 823D31A end SafariZone_South_EventScript_ExitEarlyNorth:: @ 823D33F - applymovement 1, SafariZone_South_Movement_MoveExitAttendantNorth + applymovement LOCALID_ATTENDANT, SafariZone_South_Movement_MoveExitAttendantNorth waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, SafariZone_South_Movement_PlayerExitNorth waitmovement 0 @@ -82,7 +84,7 @@ SafariZone_South_EventScript_ExitEarlyNorth:: @ 823D33F end SafariZone_South_EventScript_ExitEarlyEast:: @ 823D359 - applymovement 1, SafariZone_South_Movement_MoveExitAttendantEast + applymovement LOCALID_ATTENDANT, SafariZone_South_Movement_MoveExitAttendantEast waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, SafariZone_South_Movement_PlayerExitEast waitmovement 0 diff --git a/data/maps/SeafloorCavern_Entrance/scripts.inc b/data/maps/SeafloorCavern_Entrance/scripts.inc index b9ff722e6..20f731044 100644 --- a/data/maps/SeafloorCavern_Entrance/scripts.inc +++ b/data/maps/SeafloorCavern_Entrance/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_GRUNT, 1 + SeafloorCavern_Entrance_MapScripts:: @ 823446E map_script MAP_SCRIPT_ON_RESUME, SeafloorCavern_Entrance_OnResume .byte 0 @@ -13,9 +15,9 @@ SeafloorCavern_Entrance_EventScript_Grunt:: @ 8234485 goto_if_eq SeafloorCavern_Entrance_EventScript_GruntSpeechShort waitse playse SE_PIN - applymovement 1, Common_Movement_ExclamationMark + applymovement LOCALID_GRUNT, Common_Movement_ExclamationMark waitmovement 0 - applymovement 1, Common_Movement_Delay48 + applymovement LOCALID_GRUNT, Common_Movement_Delay48 waitmovement 0 delay 20 compare VAR_FACING, DIR_WEST @@ -26,10 +28,10 @@ SeafloorCavern_Entrance_EventScript_Grunt:: @ 8234485 call_if_eq SeafloorCavern_Entrance_EventScript_GruntFacePlayerNorth delay 30 setvar VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT, 1 - copyobjectxytoperm 1 + copyobjectxytoperm LOCALID_GRUNT msgbox SeafloorCavern_Entrance_Text_HearMagmaNearMossdeep, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_GRUNT, Common_Movement_WalkInPlaceFastestUp waitmovement 0 releaseall end @@ -43,23 +45,23 @@ SeafloorCavern_Entrance_EventScript_GruntSpeechShort:: @ 82344ED call_if_eq SeafloorCavern_Entrance_EventScript_GruntFacePlayerNorth msgbox SeafloorCavern_Entrance_Text_HearMagmaNearMossdeepShort, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_GRUNT, Common_Movement_WalkInPlaceFastestUp waitmovement 0 releaseall end SeafloorCavern_Entrance_EventScript_GruntFacePlayerEast:: @ 8234523 - applymovement 1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_GRUNT, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return SeafloorCavern_Entrance_EventScript_GruntFacePlayerWest:: @ 823452E - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_GRUNT, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return SeafloorCavern_Entrance_EventScript_GruntFacePlayerNorth:: @ 8234539 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_GRUNT, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return diff --git a/data/maps/SeafloorCavern_Room9/scripts.inc b/data/maps/SeafloorCavern_Room9/scripts.inc index 64ed3ab7c..667251936 100644 --- a/data/maps/SeafloorCavern_Room9/scripts.inc +++ b/data/maps/SeafloorCavern_Room9/scripts.inc @@ -1,12 +1,19 @@ +.set LOCALID_KYOGRE, 1 +.set LOCALID_ARCHIE, 2 +.set LOCALID_MAXIE, 3 +.set LOCALID_GRUNT_1, 4 +.set LOCALID_GRUNT_2, 5 +.set LOCALID_KYOGRE_SLEEPING, 7 + SeafloorCavern_Room9_MapScripts:: @ 8234DC8 .byte 0 SeafloorCavern_Room9_EventScript_ArchieAwakenKyogre:: @ 8234DC9 lockall - setvar VAR_0x8004, 2 @ Archie - setvar VAR_0x8005, 3 @ Maxie - setvar VAR_0x8006, 4 @ Magma grunt 1 - setvar VAR_0x8007, 5 @ Magma grunt 2 + setvar VAR_0x8004, LOCALID_ARCHIE + setvar VAR_0x8005, LOCALID_MAXIE + setvar VAR_0x8006, LOCALID_GRUNT_1 + setvar VAR_0x8007, LOCALID_GRUNT_2 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, SeafloorCavern_Room9_Movement_Delay32 @@ -48,11 +55,11 @@ SeafloorCavern_Room9_EventScript_ArchieAwakenKyogre:: @ 8234DC9 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 delay 150 - removeobject 7 @ sleeping Kyogre - addobject 1 @ awakened Kyogre + removeobject LOCALID_KYOGRE_SLEEPING + addobject LOCALID_KYOGRE waitstate delay 60 - applymovement 1, SeafloorCavern_Room9_Movement_KyogreApproach + applymovement LOCALID_KYOGRE, SeafloorCavern_Room9_Movement_KyogreApproach waitmovement 0 special FadeOutOrbEffect waitstate @@ -62,9 +69,9 @@ SeafloorCavern_Room9_EventScript_ArchieAwakenKyogre:: @ 8234DC9 setvar VAR_0x8007, 5 @ shake delay special ShakeCamera waitstate - applymovement 1, SeafloorCavern_Room9_Movement_KyogreExit + applymovement LOCALID_KYOGRE, SeafloorCavern_Room9_Movement_KyogreExit waitmovement 0 - removeobject 1 + removeobject LOCALID_KYOGRE delay 4 setvar VAR_0x8004, 2 @ vertical pan setvar VAR_0x8005, 2 @ horizontal pan @@ -73,10 +80,10 @@ SeafloorCavern_Room9_EventScript_ArchieAwakenKyogre:: @ 8234DC9 special ShakeCamera waitstate delay 30 - setvar VAR_0x8004, 2 - setvar VAR_0x8005, 3 - setvar VAR_0x8006, 4 - setvar VAR_0x8007, 5 + setvar VAR_0x8004, LOCALID_ARCHIE + setvar VAR_0x8005, LOCALID_MAXIE + setvar VAR_0x8006, LOCALID_GRUNT_1 + setvar VAR_0x8007, LOCALID_GRUNT_2 msgbox SeafloorCavern_Room9_Text_ArchieWhereDidKyogreGo, MSGBOX_DEFAULT playse SE_PC_LOGIN applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft diff --git a/data/maps/SkyPillar_Outside/scripts.inc b/data/maps/SkyPillar_Outside/scripts.inc index 545a8126c..60a1702ab 100644 --- a/data/maps/SkyPillar_Outside/scripts.inc +++ b/data/maps/SkyPillar_Outside/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WALLACE, 1 + SkyPillar_Outside_MapScripts:: @ 82392A8 map_script MAP_SCRIPT_ON_TRANSITION, SkyPillar_Outside_OnTransition map_script MAP_SCRIPT_ON_LOAD, SkyPillar_Outside_OnLoad @@ -34,7 +36,7 @@ SkyPillar_Outside_OnFrame: @ 82392FA SkyPillar_Outside_EventScript_WallaceScene:: @ 8239304 lockall - applymovement 1, SkyPillar_Outside_Movement_WallaceApproachPlayer + applymovement LOCALID_WALLACE, SkyPillar_Outside_Movement_WallaceApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 @@ -51,7 +53,7 @@ SkyPillar_Outside_EventScript_WallaceScene:: @ 8239304 msgbox SkyPillar_Outside_Text_EarthquakeNotMomentToWaste, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, SkyPillar_Outside_Movement_PlayerClimbSkyPillar - applymovement 1, SkyPillar_Outside_Movement_WallaceClimbSkyPillar + applymovement LOCALID_WALLACE, SkyPillar_Outside_Movement_WallaceClimbSkyPillar waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 3 @ horizontal pan @@ -60,13 +62,13 @@ SkyPillar_Outside_EventScript_WallaceScene:: @ 8239304 special ShakeCamera waitstate delay 20 - applymovement 1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 delay 10 - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 20 - applymovement 1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_WALLACE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 30 msgbox SkyPillar_Outside_Text_SituationGettingWorse, MSGBOX_DEFAULT @@ -83,7 +85,7 @@ SkyPillar_Outside_EventScript_WallaceScene:: @ 8239304 fadescreenswapbuffers FADE_TO_BLACK clearflag FLAG_HIDE_MAP_NAME_POPUP setvar VAR_SOOTOPOLIS_CITY_STATE, 4 - removeobject 1 + removeobject LOCALID_WALLACE clearflag FLAG_HIDE_SOOTOPOLIS_CITY_WALLACE fadescreenswapbuffers FADE_FROM_BLACK releaseall diff --git a/data/maps/SkyPillar_Top/scripts.inc b/data/maps/SkyPillar_Top/scripts.inc index 422ec2d1a..b8173bc69 100644 --- a/data/maps/SkyPillar_Top/scripts.inc +++ b/data/maps/SkyPillar_Top/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_RAYQUAZA_SLEEPING, 1 + SkyPillar_Top_MapScripts:: @ 82396B8 map_script MAP_SCRIPT_ON_RESUME, SkyPillar_Top_OnResume map_script MAP_SCRIPT_ON_TRANSITION, SkyPillar_Top_OnTransition @@ -24,7 +26,7 @@ SkyPillar_Top_OnTransition: @ 82396E6 SkyPillar_Top_EventScript_SetCleanLayout:: @ 82396FD setmaplayoutindex LAYOUT_SKY_PILLAR_TOP_CLEAN - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_DOWN + setobjectmovementtype LOCALID_RAYQUAZA_SLEEPING, MOVEMENT_TYPE_FACE_DOWN return SkyPillar_Top_EventScript_TryShowRayquaza:: @ 8239705 @@ -40,7 +42,7 @@ SkyPillar_Top_OnWarp: @ 8239713 .2byte 0 SkyPillar_Top_EventScript_RayquazaFaceDown:: @ 823971D - turnobject 1, DIR_SOUTH + turnobject LOCALID_RAYQUAZA_SLEEPING, DIR_SOUTH end SkyPillar_Top_EventScript_Rayquaza:: @ 8239722 @@ -100,7 +102,7 @@ SkyPillar_Top_EventScript_AwakenRayquaza:: @ 823979A applymovement OBJ_EVENT_ID_CAMERA, SkyPillar_Top_Movement_CameraPanUp waitmovement 0 special RemoveCameraObject - applymovement 1, SkyPillar_Top_Movement_RayquazaStir + applymovement LOCALID_RAYQUAZA_SLEEPING, SkyPillar_Top_Movement_RayquazaStir waitmovement 0 waitse playmoncry SPECIES_RAYQUAZA, 2 @@ -119,9 +121,9 @@ SkyPillar_Top_EventScript_AwakenRayquaza:: @ 823979A special ShakeCamera waitstate waitmoncry - applymovement 1, SkyPillar_Top_Movement_RayquazaFlyOff + applymovement LOCALID_RAYQUAZA_SLEEPING, SkyPillar_Top_Movement_RayquazaFlyOff waitmovement 0 - removeobject 1 + removeobject LOCALID_RAYQUAZA_SLEEPING msgbox SkyPillar_Top_Text_RayquazaFlewOff, MSGBOX_DEFAULT closemessage delay 20 diff --git a/data/maps/SlateportCity/scripts.inc b/data/maps/SlateportCity/scripts.inc index a9d10e297..055e13565 100644 --- a/data/maps/SlateportCity/scripts.inc +++ b/data/maps/SlateportCity/scripts.inc @@ -1,3 +1,24 @@ +.set LOCALID_FAT_MAN, 1 +.set LOCALID_MAN_1, 2 +.set LOCALID_RICH_BOY, 3 +.set LOCALID_GRUNT_1, 5 +.set LOCALID_COOK, 6 +.set LOCALID_OLD_WOMAN, 7 +.set LOCALID_GIRL, 8 +.set LOCALID_TY, 9 +.set LOCALID_GABBY, 10 +.set LOCALID_CAPT_STERN, 11 +.set LOCALID_GRUNT_2, 18 +.set LOCALID_GRUNT_3, 19 +.set LOCALID_GRUNT_4, 26 +.set LOCALID_GRUNT_5, 27 +.set LOCALID_GRUNT_6, 28 +.set LOCALID_GRUNT_7, 29 +.set LOCALID_GRUNT_8, 30 +.set LOCALID_GRUNT_9, 31 +.set LOCALID_GRUNT_11, 33 +.set LOCALID_SCOTT, 35 + SlateportCity_MapScripts:: @ 81DCC61 map_script MAP_SCRIPT_ON_TRANSITION, SlateportCity_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, SlateportCity_OnFrame @@ -19,20 +40,20 @@ SlateportCity_EventScript_EnterSlateport:: @ 81DCC8D return SlateportCity_EventScript_MovePeopleForSternInterview:: @ 81DCC99 - setobjectxyperm 11, 28, 13 - setobjectxyperm 7, 25, 13 - setobjectxyperm 3, 25, 14 - setobjectxyperm 6, 27, 16 - setobjectxyperm 8, 28, 16 - setobjectxyperm 1, 29, 16 - setobjectxyperm 2, 31, 14 - setobjectmovementtype 11, MOVEMENT_TYPE_FACE_DOWN - setobjectmovementtype 7, MOVEMENT_TYPE_FACE_DOWN_AND_RIGHT - setobjectmovementtype 3, MOVEMENT_TYPE_FACE_UP_AND_RIGHT - setobjectmovementtype 6, MOVEMENT_TYPE_FACE_UP - setobjectmovementtype 8, MOVEMENT_TYPE_FACE_UP - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_UP - setobjectmovementtype 2, MOVEMENT_TYPE_FACE_LEFT + setobjectxyperm LOCALID_CAPT_STERN, 28, 13 + setobjectxyperm LOCALID_OLD_WOMAN, 25, 13 + setobjectxyperm LOCALID_RICH_BOY, 25, 14 + setobjectxyperm LOCALID_COOK, 27, 16 + setobjectxyperm LOCALID_GIRL, 28, 16 + setobjectxyperm LOCALID_FAT_MAN, 29, 16 + setobjectxyperm LOCALID_MAN_1, 31, 14 + setobjectmovementtype LOCALID_CAPT_STERN, MOVEMENT_TYPE_FACE_DOWN + setobjectmovementtype LOCALID_OLD_WOMAN, MOVEMENT_TYPE_FACE_DOWN_AND_RIGHT + setobjectmovementtype LOCALID_RICH_BOY, MOVEMENT_TYPE_FACE_UP_AND_RIGHT + setobjectmovementtype LOCALID_COOK, MOVEMENT_TYPE_FACE_UP + setobjectmovementtype LOCALID_GIRL, MOVEMENT_TYPE_FACE_UP + setobjectmovementtype LOCALID_FAT_MAN, MOVEMENT_TYPE_FACE_UP + setobjectmovementtype LOCALID_MAN_1, MOVEMENT_TYPE_FACE_LEFT return SlateportCity_EventScript_SetReadyForScottScene:: @ 81DCCE7 @@ -40,13 +61,13 @@ SlateportCity_EventScript_SetReadyForScottScene:: @ 81DCCE7 getplayerxy VAR_0x8004, VAR_0x8005 compare VAR_0x8004, 30 goto_if_eq SlateportCity_EventScript_MoveScottLeft - setobjectxyperm 35, 23, 27 - setobjectmovementtype 35, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_SCOTT, 23, 27 + setobjectmovementtype LOCALID_SCOTT, MOVEMENT_TYPE_FACE_RIGHT return SlateportCity_EventScript_MoveScottLeft:: @ 81DCD06 - setobjectxyperm 35, 22, 27 - setobjectmovementtype 35, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_SCOTT, 22, 27 + setobjectmovementtype LOCALID_SCOTT, MOVEMENT_TYPE_FACE_RIGHT return SlateportCity_OnFrame: @ 81DCD12 @@ -55,17 +76,17 @@ SlateportCity_OnFrame: @ 81DCD12 SlateportCity_EventScript_ScottScene:: @ 81DCD1C lockall - addobject 35 + addobject LOCALID_SCOTT applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_Movement_PlayerFaceScott - applymovement 35, SlateportCity_Movement_ScottApproachPlayer + applymovement LOCALID_SCOTT, SlateportCity_Movement_ScottApproachPlayer waitmovement 0 msgbox SlateportCity_Text_YouDroveTeamAquaAway, MSGBOX_DEFAULT closemessage - applymovement 35, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 delay 60 msgbox SlateportCity_Text_MaybeThisTrainer, MSGBOX_DEFAULT - applymovement 35, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestRight waitmovement 0 msgbox SlateportCity_Text_LetsRegisterEachOther, MSGBOX_DEFAULT closemessage @@ -78,11 +99,11 @@ SlateportCity_EventScript_ScottScene:: @ 81DCD1C setflag FLAG_ENABLE_SCOTT_MATCH_CALL msgbox SlateportCity_Text_KeepEyeOnTrainersBeSeeingYou, MSGBOX_DEFAULT closemessage - applymovement 35, SlateportCity_Movement_ScottExit + applymovement LOCALID_SCOTT, SlateportCity_Movement_ScottExit waitmovement 0 - removeobject 35 - setobjectxyperm 35, 10, 12 - setobjectmovementtype 35, MOVEMENT_TYPE_FACE_DOWN + removeobject LOCALID_SCOTT + setobjectxyperm LOCALID_SCOTT, 10, 12 + setobjectmovementtype LOCALID_SCOTT, MOVEMENT_TYPE_FACE_DOWN clearflag FLAG_HIDE_MAP_NAME_POPUP setvar VAR_SLATEPORT_OUTSIDE_MUSEUM_STATE, 2 addvar VAR_SCOTT_STATE, 1 @@ -360,7 +381,7 @@ SlateportCity_EventScript_AquaGrunt1:: @ 81DD009 faceplayer msgbox SlateportCity_Text_QuitPushing, MSGBOX_DEFAULT closemessage - applymovement 5, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_1, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -370,7 +391,7 @@ SlateportCity_EventScript_AquaGrunt2:: @ 81DD020 faceplayer msgbox SlateportCity_Text_AquaHasPolicy, MSGBOX_DEFAULT closemessage - applymovement 18, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_2, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -380,7 +401,7 @@ SlateportCity_EventScript_AquaGrunt3:: @ 81DD037 faceplayer msgbox SlateportCity_Text_BossIsBrilliant, MSGBOX_DEFAULT closemessage - applymovement 19, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_3, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -390,7 +411,7 @@ SlateportCity_EventScript_AquaGrunt4:: @ 81DD04E faceplayer msgbox SlateportCity_Text_WhatsNewSchemeIWonder, MSGBOX_DEFAULT closemessage - applymovement 26, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_4, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -400,7 +421,7 @@ SlateportCity_EventScript_AquaGrunt5:: @ 81DD065 faceplayer msgbox SlateportCity_Text_ShouldTakeItAll, MSGBOX_DEFAULT closemessage - applymovement 27, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_5, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -410,7 +431,7 @@ SlateportCity_EventScript_AquaGrunt6:: @ 81DD07C faceplayer msgbox SlateportCity_Text_DontButtIn, MSGBOX_DEFAULT closemessage - applymovement 28, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_6, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -420,7 +441,7 @@ SlateportCity_EventScript_AquaGrunt7:: @ 81DD093 faceplayer msgbox SlateportCity_Text_RemindsMeOfLongLineForGames, MSGBOX_DEFAULT closemessage - applymovement 29, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_7, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -430,7 +451,7 @@ SlateportCity_EventScript_AquaGrunt8:: @ 81DD0AA faceplayer msgbox SlateportCity_Text_WhyAreWeLiningUp, MSGBOX_DEFAULT closemessage - applymovement 30, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_8, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -439,31 +460,31 @@ SlateportCity_EventScript_AquaGrunt9:: @ 81DD0C1 lock faceplayer playse SE_PIN - applymovement 31, Common_Movement_ExclamationMark + applymovement LOCALID_GRUNT_9, Common_Movement_ExclamationMark waitmovement 0 - applymovement 31, Common_Movement_Delay48 + applymovement LOCALID_GRUNT_9, Common_Movement_Delay48 waitmovement 0 msgbox SlateportCity_Text_WhatDoYouWant, MSGBOX_DEFAULT closemessage - applymovement 31, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_9, Common_Movement_FaceOriginalDirection waitmovement 0 - applymovement 31, SlateportCity_Movement_DelayAquaGrunt + applymovement LOCALID_GRUNT_9, SlateportCity_Movement_DelayAquaGrunt waitmovement 0 - applymovement 31, Common_Movement_FacePlayer + applymovement LOCALID_GRUNT_9, Common_Movement_FacePlayer waitmovement 0 msgbox SlateportCity_Text_IllReadSignForYou, MSGBOX_DEFAULT closemessage - applymovement 31, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_9, Common_Movement_FaceOriginalDirection waitmovement 0 - applymovement 31, SlateportCity_Movement_DelayAquaGrunt + applymovement LOCALID_GRUNT_9, SlateportCity_Movement_DelayAquaGrunt waitmovement 0 msgbox SlateportCity_Text_SaysSomethingLikeSeaIsEndless, MSGBOX_DEFAULT closemessage - applymovement 31, Common_Movement_FacePlayer + applymovement LOCALID_GRUNT_9, Common_Movement_FacePlayer waitmovement 0 - applymovement 31, SlateportCity_Movement_DelayAquaGrunt + applymovement LOCALID_GRUNT_9, SlateportCity_Movement_DelayAquaGrunt waitmovement 0 - applymovement 31, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_9, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -482,7 +503,7 @@ SlateportCity_EventScript_AquaGrunt11:: @ 81DD153 faceplayer msgbox SlateportCity_Text_HotSpringsAfterOperation, MSGBOX_DEFAULT closemessage - applymovement 33, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GRUNT_11, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -565,48 +586,48 @@ SlateportCity_EventScript_CaptStern:: @ 81DD1F8 msgbox SlateportCity_Text_SternMoveAheadWithExploration, MSGBOX_DEFAULT msgbox SlateportCity_Text_GabbyWonderfulThanksForInterview, MSGBOX_DEFAULT closemessage - applymovement 10, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_GABBY, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 10 - applymovement 9, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_TY, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 25 - applymovement 11, SlateportCity_Movement_SternWatchGabbyAndTyExit + applymovement LOCALID_CAPT_STERN, SlateportCity_Movement_SternWatchGabbyAndTyExit applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_Movement_PlayerFaceStern - applymovement 10, SlateportCity_Movement_GabbyExit - applymovement 9, SlateportCity_Movement_TyExit + applymovement LOCALID_GABBY, SlateportCity_Movement_GabbyExit + applymovement LOCALID_TY, SlateportCity_Movement_TyExit waitmovement 0 - removeobject 10 - removeobject 9 + removeobject LOCALID_GABBY + removeobject LOCALID_TY msgbox SlateportCity_Text_SternWhewFirstInterview, MSGBOX_DEFAULT - applymovement 11, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_CAPT_STERN, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox SlateportCity_Text_OhPlayerWeMadeDiscovery, MSGBOX_DEFAULT playbgm MUS_AQA_0, 0 msgbox SlateportCity_Text_AquaWillAssumeControlOfSubmarine, MSGBOX_DEFAULT - applymovement 6, Common_Movement_WalkInPlaceFastestLeft - applymovement 1, Common_Movement_WalkInPlaceFastestLeft - applymovement 7, SlateportCity_Movement_OldWomanConcern - applymovement 3, Common_Movement_QuestionMark - applymovement 2, SlateportCity_Movement_ManConcern + applymovement LOCALID_COOK, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_FAT_MAN, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_OLD_WOMAN, SlateportCity_Movement_OldWomanConcern + applymovement LOCALID_RICH_BOY, Common_Movement_QuestionMark + applymovement LOCALID_MAN_1, SlateportCity_Movement_ManConcern waitmovement 0 - applymovement 11, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_CAPT_STERN, Common_Movement_WalkInPlaceFastestDown waitmovement 0 msgbox SlateportCity_Text_SternWhatWasAllThat, MSGBOX_DEFAULT playse SE_PIN - applymovement 11, Common_Movement_ExclamationMark + applymovement LOCALID_CAPT_STERN, Common_Movement_ExclamationMark waitmovement 0 - applymovement 11, Common_Movement_Delay48 + applymovement LOCALID_CAPT_STERN, Common_Movement_Delay48 waitmovement 0 - applymovement 11, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_CAPT_STERN, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox SlateportCity_Text_FromHarborTryingToTakeSub, MSGBOX_DEFAULT msgbox SlateportCity_Text_PleaseComeWithMe, MSGBOX_DEFAULT closemessage - applymovement 11, SlateportCity_Movement_SternEnterHarbor + applymovement LOCALID_CAPT_STERN, SlateportCity_Movement_SternEnterHarbor applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_Movement_PlayerEnterHarbor waitmovement 0 - removeobject 11 + removeobject LOCALID_CAPT_STERN clearflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_CAPTAIN_STERN clearflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_SUBMARINE_SHADOW clearflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_AQUA_GRUNT @@ -891,18 +912,18 @@ SlateportCity_EventScript_ScottBattleTentScene:: @ 81DD5DC waitmovement 0 opendoor 10, 12 waitdooranim - addobject 35 + addobject LOCALID_SCOTT applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_Movement_PushPlayerDown - applymovement 35, SlateportCity_Movement_ScottExitBattleTent + applymovement LOCALID_SCOTT, SlateportCity_Movement_ScottExitBattleTent waitmovement 0 closedoor 10, 12 waitdooranim msgbox SlateportCity_Text_TakingBattleTentChallenge, MSGBOX_DEFAULT closemessage applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_Movement_PlayerWatchScottExit - applymovement 35, SlateportCity_Movement_ScottExitAfterBattleTent + applymovement LOCALID_SCOTT, SlateportCity_Movement_ScottExitAfterBattleTent waitmovement 0 - removeobject 35 + removeobject LOCALID_SCOTT addvar VAR_SCOTT_STATE, 1 setvar VAR_SLATEPORT_OUTSIDE_MUSEUM_STATE, 3 releaseall diff --git a/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc b/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc index f67c6f081..e642a1386 100644 --- a/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc +++ b/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_OPPONENT, 2 +.set LOCALID_PLAYER, 3 + SlateportCity_BattleTentBattleRoom_MapScripts:: @ 8209960 map_script MAP_SCRIPT_ON_TRANSITION, SlateportCity_BattleTentBattleRoom_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, SlateportCity_BattleTentBattleRoom_OnWarp @@ -5,7 +8,7 @@ SlateportCity_BattleTentBattleRoom_MapScripts:: @ 8209960 .byte 0 @ On this map the player (OBJ_EVENT_ID_PLAYER) is hidden - @ The player is represented instead by object event 3, which has the gfx id VAR_OBJ_GFX_ID_1 + @ The player is represented instead by LOCALID_PLAYER, which has the gfx id VAR_OBJ_GFX_ID_1 SlateportCity_BattleTentBattleRoom_OnTransition: @ 8209970 call SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfx @@ -34,7 +37,7 @@ SlateportCity_BattleTentBattleRoom_OnWarp: @ 820999A SlateportCity_BattleTentBattleRoom_EventScript_SetUpObjects:: @ 82099A4 setvar VAR_TEMP_1, 1 hideobjectat OBJ_EVENT_ID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM - hideobjectat 2, MAP_SLATEPORT_CITY_BATTLE_TENT_BATTLE_ROOM + hideobjectat LOCALID_OPPONENT, MAP_SLATEPORT_CITY_BATTLE_TENT_BATTLE_ROOM end SlateportCity_BattleTentBattleRoom_OnFrame: @ 82099B4 @@ -42,13 +45,13 @@ SlateportCity_BattleTentBattleRoom_OnFrame: @ 82099B4 .2byte 0 SlateportCity_BattleTentBattleRoom_EventScript_EnterRoom:: @ 82099BE - applymovement 3, SlateportCity_BattleTentBattleRoom_Movement_PlayerEnter + applymovement LOCALID_PLAYER, SlateportCity_BattleTentBattleRoom_Movement_PlayerEnter waitmovement 0 factory_setopponentgfx - setobjectxyperm 2, 5, 1 - removeobject 2 - addobject 2 - applymovement 2, SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter + setobjectxyperm LOCALID_OPPONENT, 5, 1 + removeobject LOCALID_OPPONENT + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter waitmovement 0 battletent_getopponentintro lockall diff --git a/data/maps/SlateportCity_BattleTentCorridor/scripts.inc b/data/maps/SlateportCity_BattleTentCorridor/scripts.inc index 817e3eaba..85a95ded8 100644 --- a/data/maps/SlateportCity_BattleTentCorridor/scripts.inc +++ b/data/maps/SlateportCity_BattleTentCorridor/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + SlateportCity_BattleTentCorridor_MapScripts:: @ 8208E26 map_script MAP_SCRIPT_ON_FRAME_TABLE, SlateportCity_BattleTentCorridor_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, SlateportCity_BattleTentCorridor_OnWarp @@ -13,8 +15,8 @@ SlateportCity_BattleTentCorridor_EventScript_SetUpObjects:: @ 8208E3B setvar VAR_TEMP_1, 1 compare VAR_0x8006, 1 goto_if_ne SlateportCity_BattleTentCorridor_EventScript_TurnPlayerNorth - setobjectxy 1, 2, 2 - turnobject 1, DIR_SOUTH + setobjectxy LOCALID_ATTENDANT, 2, 2 + turnobject LOCALID_ATTENDANT, DIR_SOUTH SlateportCity_BattleTentCorridor_EventScript_TurnPlayerNorth:: @ 8208E56 turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH end @@ -27,7 +29,7 @@ SlateportCity_BattleTentCorridor_EventScript_EnterCorridor:: @ 8208E65 compare VAR_0x8006, 1 goto_if_eq SlateportCity_BattleTentCorridor_EventScript_ReturnToRoomFromBattle setvar VAR_TEMP_0, 1 - applymovement 1, SlateportCity_BattleTentCorridor_Movement_AttendantEnter + applymovement LOCALID_ATTENDANT, SlateportCity_BattleTentCorridor_Movement_AttendantEnter applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_BattleTentCorridor_Movement_PlayerEnter waitmovement 0 compare VAR_0x8006, 2 @@ -41,11 +43,11 @@ SlateportCity_BattleTentCorridor_EventScript_EnterCorridor:: @ 8208E65 SlateportCity_BattleTentCorridor_EventScript_EnterBattleRoom:: @ 8208EB4 msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_RightThisWay, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFastestUp waitmovement 0 opendoor 2, 1 waitdooranim - applymovement 1, SlateportCity_BattleTentCorridor_Movement_AttendantExit + applymovement LOCALID_ATTENDANT, SlateportCity_BattleTentCorridor_Movement_AttendantExit applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_BattleTentCorridor_Movement_PlayerExit waitmovement 0 closedoor 2, 1 diff --git a/data/maps/SlateportCity_BattleTentLobby/scripts.inc b/data/maps/SlateportCity_BattleTentLobby/scripts.inc index 811232e79..20f3c3e07 100644 --- a/data/maps/SlateportCity_BattleTentLobby/scripts.inc +++ b/data/maps/SlateportCity_BattleTentLobby/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + SlateportCity_BattleTentLobby_MapScripts:: @ 8208730 map_script MAP_SCRIPT_ON_FRAME_TABLE, SlateportCity_BattleTentLobby_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, SlateportCity_BattleTentLobby_OnWarp @@ -138,12 +140,12 @@ SlateportCity_BattleTentLobby_EventScript_EnterChallenge:: @ 82089AC end SlateportCity_BattleTentLobby_EventScript_WalkToDoor:: @ 82089C9 - applymovement 1, SlateportCity_BattleTentLobby_Movement_AttendantWalkToDoor + applymovement LOCALID_ATTENDANT, SlateportCity_BattleTentLobby_Movement_AttendantWalkToDoor applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_BattleTentLobby_Movement_PlayerWalkToDoor waitmovement 0 opendoor 6, 1 waitdooranim - applymovement 1, SlateportCity_BattleTentLobby_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT, SlateportCity_BattleTentLobby_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_BattleTentLobby_Movement_PlayerEnterDoor waitmovement 0 closedoor 6, 1 diff --git a/data/maps/SlateportCity_Harbor/scripts.inc b/data/maps/SlateportCity_Harbor/scripts.inc index e195485b2..5d8dad1db 100644 --- a/data/maps/SlateportCity_Harbor/scripts.inc +++ b/data/maps/SlateportCity_Harbor/scripts.inc @@ -1,3 +1,9 @@ +.set LOCALID_CAPT_STERN, 4 +.set LOCALID_SS_TIDAL, 5 +.set LOCALID_GRUNT, 6 +.set LOCALID_ARCHIE, 7 +.set LOCALID_SUBMARINE, 8 + SlateportCity_Harbor_MapScripts:: @ 820C97D map_script MAP_SCRIPT_ON_TRANSITION, SlateportCity_Harbor_OnTransition .byte 0 @@ -16,8 +22,8 @@ SlateportCity_Harbor_EventScript_ShowSSTidal:: @ 820C9A5 SlateportCity_Harbor_EventScript_ReadyAquaEscapeScene:: @ 820C9A9 savebgm MUS_AQA_0 - setobjectxyperm 4, 12, 13 - setobjectmovementtype 4, MOVEMENT_TYPE_FACE_LEFT + setobjectxyperm LOCALID_CAPT_STERN, 12, 13 + setobjectmovementtype LOCALID_CAPT_STERN, MOVEMENT_TYPE_FACE_LEFT setflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_PATRONS return @@ -48,20 +54,20 @@ SlateportCity_Harbor_EventScript_AquaEscapeTrigger3:: @ 820C9DF end SlateportCity_Harbor_EventScript_AquaEscapeScene:: @ 820C9F5 - applymovement 7, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_ARCHIE, Common_Movement_WalkInPlaceFastestDown waitmovement 0 - applymovement 6, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_GRUNT, Common_Movement_WalkInPlaceFastestDown applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox SlateportCity_Harbor_Text_ArchieYouAgainHideoutInLilycove, MSGBOX_DEFAULT closemessage - applymovement 6, SlateportCity_Harbor_Movement_AquaBoardSub - applymovement 7, SlateportCity_Harbor_Movement_AquaBoardSub - applymovement 8, SlateportCity_Harbor_Movement_SubmarineExit + applymovement LOCALID_GRUNT, SlateportCity_Harbor_Movement_AquaBoardSub + applymovement LOCALID_ARCHIE, SlateportCity_Harbor_Movement_AquaBoardSub + applymovement LOCALID_SUBMARINE, SlateportCity_Harbor_Movement_SubmarineExit waitmovement 0 - removeobject 6 - removeobject 7 - removeobject 8 + removeobject LOCALID_GRUNT + removeobject LOCALID_ARCHIE + removeobject LOCALID_SUBMARINE setvar VAR_SLATEPORT_HARBOR_STATE, 2 setflag FLAG_MET_TEAM_AQUA_HARBOR setflag FLAG_HIDE_LILCOVE_MOTEL_SCOTT @@ -77,27 +83,27 @@ SlateportCity_Harbor_EventScript_AquaEscapeScene:: @ 820C9F5 closemessage setflag FLAG_HIDE_AQUA_HIDEOUT_1F_GRUNT_1_BLOCKING_ENTRANCE setflag FLAG_HIDE_AQUA_HIDEOUT_1F_GRUNT_2_BLOCKING_ENTRANCE - copyobjectxytoperm 4 - setobjectmovementtype 4, MOVEMENT_TYPE_FACE_RIGHT + copyobjectxytoperm LOCALID_CAPT_STERN + setobjectmovementtype LOCALID_CAPT_STERN, MOVEMENT_TYPE_FACE_RIGHT releaseall end SlateportCity_Harbor_EventScript_SternApproachPlayer0:: @ 820CA89 - applymovement 4, SlateportCity_Harbor_Movement_SternApproachPlayer0 + applymovement LOCALID_CAPT_STERN, SlateportCity_Harbor_Movement_SternApproachPlayer0 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown waitmovement 0 return SlateportCity_Harbor_EventScript_SternApproachPlayer1:: @ 820CA9E - applymovement 4, SlateportCity_Harbor_Movement_SternApproachPlayer1 + applymovement LOCALID_CAPT_STERN, SlateportCity_Harbor_Movement_SternApproachPlayer1 waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 return SlateportCity_Harbor_EventScript_SternApproachPlayer:: @ 820CAB3 - applymovement 4, SlateportCity_Harbor_Movement_SternApproachPlayer + applymovement LOCALID_CAPT_STERN, SlateportCity_Harbor_Movement_SternApproachPlayer waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 @@ -238,7 +244,7 @@ SlateportCity_Harbor_EventScript_BoardFerry:: @ 820CBE9 call_if_eq SlateportCity_Harbor_EventScript_BoardFerryEast delay 30 hideobjectat OBJ_EVENT_ID_PLAYER, 0 - setvar VAR_0x8004, 5 + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepart return diff --git a/data/maps/SlateportCity_OceanicMuseum_1F/scripts.inc b/data/maps/SlateportCity_OceanicMuseum_1F/scripts.inc index 81b4c2008..8af4af40c 100644 --- a/data/maps/SlateportCity_OceanicMuseum_1F/scripts.inc +++ b/data/maps/SlateportCity_OceanicMuseum_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_FAMILIAR_GRUNT, 13 + SlateportCity_OceanicMuseum_1F_MapScripts:: @ 820AD95 .byte 0 @@ -33,7 +35,7 @@ SlateportCity_OceanicMuseum_1F_EventScript_PayEntranceFee:: @ 820ADC1 SlateportCity_OceanicMuseum_1F_EventScript_CheckMoneyForFee:: @ 820ADE8 checkmoney 50, 0 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq SlateportCity_OceanicMuseum_1F_EventScript_NotEnoughMoney playse SE_REGI removemoney 50, 0 @@ -146,9 +148,9 @@ SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGrunt:: @ 820AEF8 faceplayer delay 8 playse SE_PIN - applymovement 13, Common_Movement_ExclamationMark + applymovement LOCALID_FAMILIAR_GRUNT, Common_Movement_ExclamationMark waitmovement 0 - applymovement 13, Common_Movement_Delay48 + applymovement LOCALID_FAMILIAR_GRUNT, Common_Movement_Delay48 waitmovement 0 msgbox SlateportCity_OceanicMuseum_1F_Text_RememberMeTakeThis, MSGBOX_DEFAULT giveitem ITEM_TM46 @@ -169,20 +171,20 @@ SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGrunt:: @ 820AEF8 SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitNorth:: @ 820AF6C applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_OceanicMuseum_1F_Movement_PlayerWatchGruntExitNorth - applymovement 13, SlateportCity_OceanicMuseum_1F_Movement_FamiliarGruntExitNorth + applymovement LOCALID_FAMILIAR_GRUNT, SlateportCity_OceanicMuseum_1F_Movement_FamiliarGruntExitNorth waitmovement 0 goto SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExited end SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitSouth:: @ 820AF83 - applymovement 13, SlateportCity_OceanicMuseum_1F_Movement_FamiliarGruntExit + applymovement LOCALID_FAMILIAR_GRUNT, SlateportCity_OceanicMuseum_1F_Movement_FamiliarGruntExit waitmovement 0 goto SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExited end SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitWestEast:: @ 820AF93 applymovement OBJ_EVENT_ID_PLAYER, SlateportCity_OceanicMuseum_1F_Movement_PlayerWatchGruntExitWestEast - applymovement 13, SlateportCity_OceanicMuseum_1F_Movement_FamiliarGruntExit + applymovement LOCALID_FAMILIAR_GRUNT, SlateportCity_OceanicMuseum_1F_Movement_FamiliarGruntExit waitmovement 0 goto SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExited end @@ -190,7 +192,7 @@ SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExitWestEast:: @ 820AF93 SlateportCity_OceanicMuseum_1F_EventScript_FamiliarGruntExited:: @ 820AFAA setflag FLAG_HIDE_SLATEPORT_CITY_OCEANIC_MUSEUM_FAMILIAR_AQUA_GRUNT playse SE_KAIDAN - removeobject 13 + removeobject LOCALID_FAMILIAR_GRUNT release end diff --git a/data/maps/SlateportCity_OceanicMuseum_2F/scripts.inc b/data/maps/SlateportCity_OceanicMuseum_2F/scripts.inc index 885c512a3..8efd464c4 100644 --- a/data/maps/SlateportCity_OceanicMuseum_2F/scripts.inc +++ b/data/maps/SlateportCity_OceanicMuseum_2F/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_CAPT_STERN, 1 +.set LOCALID_ARCHIE, 2 +.set LOCALID_GRUNT_1, 3 +.set LOCALID_GRUNT_2, 4 + SlateportCity_OceanicMuseum_2F_MapScripts:: @ 820BAFF .byte 0 @@ -7,14 +12,14 @@ SlateportCity_OceanicMuseum_2F_EventScript_CaptStern:: @ 820BB00 msgbox SlateportCity_OceanicMuseum_2F_Text_ThankYouForTheParts, MSGBOX_DEFAULT closemessage playbgm MUS_AQA_0, 1 - addobject 3 - applymovement 3, SlateportCity_OceanicMuseum_2F_Movement_FirstGruntEnter + addobject LOCALID_GRUNT_1 + applymovement LOCALID_GRUNT_1, SlateportCity_OceanicMuseum_2F_Movement_FirstGruntEnter waitmovement 0 - addobject 4 - applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_SecondGruntEnter + addobject LOCALID_GRUNT_2 + applymovement LOCALID_GRUNT_2, SlateportCity_OceanicMuseum_2F_Movement_SecondGruntEnter waitmovement 0 - applymovement 3, SlateportCity_OceanicMuseum_2F_Movement_FirstGruntApproach - applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_SecondGruntApproach + applymovement LOCALID_GRUNT_1, SlateportCity_OceanicMuseum_2F_Movement_FirstGruntApproach + applymovement LOCALID_GRUNT_2, SlateportCity_OceanicMuseum_2F_Movement_SecondGruntApproach waitmovement 0 compare VAR_FACING, DIR_SOUTH call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_PlayerFaceGrunts @@ -26,7 +31,7 @@ SlateportCity_OceanicMuseum_2F_EventScript_CaptStern:: @ 820BB00 msgbox SlateportCity_OceanicMuseum_2F_Text_SternWhoAreYou, MSGBOX_DEFAULT msgbox SlateportCity_OceanicMuseum_2F_Text_WereTeamAqua, MSGBOX_DEFAULT closemessage - applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_GruntApproachToBattle + applymovement LOCALID_GRUNT_2, SlateportCity_OceanicMuseum_2F_Movement_GruntApproachToBattle waitmovement 0 compare VAR_FACING, DIR_SOUTH call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_PlayerApproachGruntSouth @@ -35,36 +40,36 @@ SlateportCity_OceanicMuseum_2F_EventScript_CaptStern:: @ 820BB00 trainerbattle_no_intro TRAINER_GRUNT_MUSEUM_1, SlateportCity_OceanicMuseum_2F_Text_Grunt1Defeat msgbox SlateportCity_OceanicMuseum_2F_Text_BossGoingToBeFurious, MSGBOX_DEFAULT closemessage - applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_GruntDefeated + applymovement LOCALID_GRUNT_2, SlateportCity_OceanicMuseum_2F_Movement_GruntDefeated waitmovement 0 - applymovement 3, SlateportCity_OceanicMuseum_2F_Movement_GruntApproachToBattle + applymovement LOCALID_GRUNT_1, SlateportCity_OceanicMuseum_2F_Movement_GruntApproachToBattle waitmovement 0 msgbox SlateportCity_OceanicMuseum_2F_Text_LetMeTakeCareOfThis, MSGBOX_DEFAULT trainerbattle_no_intro TRAINER_GRUNT_MUSEUM_2, SlateportCity_OceanicMuseum_2F_Text_Grunt2Defeat - applymovement 3, SlateportCity_OceanicMuseum_2F_Movement_GruntDefeated + applymovement LOCALID_GRUNT_1, SlateportCity_OceanicMuseum_2F_Movement_GruntDefeated waitmovement 0 - applymovement 3, Common_Movement_WalkInPlaceFastestDown - applymovement 4, Common_Movement_WalkInPlaceFastestUp + applymovement LOCALID_GRUNT_1, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_GRUNT_2, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox SlateportCity_OceanicMuseum_2F_Text_MeddlingKid, MSGBOX_DEFAULT closemessage delay 35 - addobject 2 - applymovement 2, SlateportCity_OceanicMuseum_2F_Movement_ArchieEnter - applymovement 4, SlateportCity_OceanicMuseum_2F_Movement_GruntMoveForArchie + addobject LOCALID_ARCHIE + applymovement LOCALID_ARCHIE, SlateportCity_OceanicMuseum_2F_Movement_ArchieEnter + applymovement LOCALID_GRUNT_2, SlateportCity_OceanicMuseum_2F_Movement_GruntMoveForArchie waitmovement 0 msgbox SlateportCity_OceanicMuseum_2F_Text_CameToSeeWhatsTakingSoLong, MSGBOX_DEFAULT closemessage - applymovement 2, SlateportCity_OceanicMuseum_2F_Movement_ArchieApproachPlayer + applymovement LOCALID_ARCHIE, SlateportCity_OceanicMuseum_2F_Movement_ArchieApproachPlayer waitmovement 0 msgbox SlateportCity_OceanicMuseum_2F_Text_ArchieWarning, MSGBOX_DEFAULT closemessage savebgm MUS_DUMMY fadedefaultbgm fadescreen FADE_TO_BLACK - removeobject 2 - removeobject 3 - removeobject 4 + removeobject LOCALID_ARCHIE + removeobject LOCALID_GRUNT_1 + removeobject LOCALID_GRUNT_2 fadescreen FADE_FROM_BLACK delay 30 setflag FLAG_HIDE_SLATEPORT_CITY_OCEANIC_MUSEUM_AQUA_GRUNTS @@ -79,7 +84,7 @@ SlateportCity_OceanicMuseum_2F_EventScript_CaptStern:: @ 820BB00 playfanfare MUS_ME_ASA waitfanfare special HealPlayerParty - removeobject 1 + removeobject LOCALID_CAPT_STERN setflag FLAG_HIDE_ROUTE_110_TEAM_AQUA compare VAR_REGISTER_BIRCH_STATE, 0 call_if_eq SlateportCity_OceanicMuseum_2F_EventScript_ReadyRegisterBirch @@ -101,7 +106,7 @@ SlateportCity_OceanicMuseum_2F_EventScript_PlayerFaceGrunts:: @ 820BC92 return SlateportCity_OceanicMuseum_2F_EventScript_SternFaceGrunts:: @ 820BC9D - applymovement 1, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_CAPT_STERN, Common_Movement_WalkInPlaceFastestLeft waitmovement 0 return diff --git a/data/maps/SlateportCity_PokemonCenter_1F/scripts.inc b/data/maps/SlateportCity_PokemonCenter_1F/scripts.inc index ba4319cba..e6b1acea8 100644 --- a/data/maps/SlateportCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/SlateportCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + SlateportCity_PokemonCenter_1F_MapScripts:: @ 820DABF map_script MAP_SCRIPT_ON_TRANSITION, SlateportCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -8,9 +10,8 @@ SlateportCity_PokemonCenter_1F_OnTransition: @ 820DACA call Common_EventScript_UpdateBrineyLocation end -@ VAR_0x800B is the Nurse's object event id SlateportCity_PokemonCenter_1F_EventScript_Nurse:: @ 820DAD3 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/SlateportCity_SternsShipyard_1F/scripts.inc b/data/maps/SlateportCity_SternsShipyard_1F/scripts.inc index 4939f5407..8c65f9592 100644 --- a/data/maps/SlateportCity_SternsShipyard_1F/scripts.inc +++ b/data/maps/SlateportCity_SternsShipyard_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_DOCK, 1 + SlateportCity_SternsShipyard_1F_MapScripts:: @ 8207F3F .byte 0 @@ -8,11 +10,11 @@ SlateportCity_SternsShipyard_1F_EventScript_Dock:: @ 8207F40 goto_if_set FLAG_DELIVERED_DEVON_GOODS, SlateportCity_SternsShipyard_1F_EventScript_NeedVeteran goto_if_set FLAG_DOCK_REJECTED_DEVON_GOODS, SlateportCity_SternsShipyard_1F_EventScript_GoFindStern msgbox SlateportCity_SternsShipyard_1F_Text_CantMakeHeadsOrTails, MSGBOX_DEFAULT - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_DOCK, Common_Movement_FacePlayer waitmovement 0 msgbox SlateportCity_SternsShipyard_1F_Text_MeetDockDeliverToStern, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_DOCK, Common_Movement_FaceOriginalDirection waitmovement 0 setflag FLAG_DOCK_REJECTED_DEVON_GOODS setflag FLAG_HIDE_SLATEPORT_CITY_TEAM_AQUA @@ -20,31 +22,31 @@ SlateportCity_SternsShipyard_1F_EventScript_Dock:: @ 8207F40 end SlateportCity_SternsShipyard_1F_EventScript_FerryReady:: @ 8207F92 - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_DOCK, Common_Movement_FacePlayer waitmovement 0 msgbox SlateportCity_SternsShipyard_1F_Text_FerryIsReady, MSGBOX_DEFAULT releaseall end SlateportCity_SternsShipyard_1F_EventScript_BrineyJoined:: @ 8207FA6 - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_DOCK, Common_Movement_FacePlayer waitmovement 0 msgbox SlateportCity_SternsShipyard_1F_Text_BrineyJoinedUs, MSGBOX_DEFAULT releaseall end SlateportCity_SternsShipyard_1F_EventScript_GoFindStern:: @ 8207FBA - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_DOCK, Common_Movement_FacePlayer waitmovement 0 msgbox SlateportCity_SternsShipyard_1F_Text_CouldYouFindStern, MSGBOX_DEFAULT closemessage - applymovement 1, Common_Movement_FaceOriginalDirection + applymovement LOCALID_DOCK, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end SlateportCity_SternsShipyard_1F_EventScript_NeedVeteran:: @ 8207FD9 - applymovement 1, Common_Movement_FacePlayer + applymovement LOCALID_DOCK, Common_Movement_FacePlayer waitmovement 0 msgbox SlateportCity_SternsShipyard_1F_Text_CouldUseAdviceFromVeteran, MSGBOX_DEFAULT releaseall diff --git a/data/maps/SootopolisCity/scripts.inc b/data/maps/SootopolisCity/scripts.inc index a973a0429..2979f104d 100644 --- a/data/maps/SootopolisCity/scripts.inc +++ b/data/maps/SootopolisCity/scripts.inc @@ -1,3 +1,21 @@ +.set LOCALID_EXPERT, 1 +.set LOCALID_WOMAN_2, 2 +.set LOCALID_KIRI, 3 +.set LOCALID_NINJA_BOY, 4 +.set LOCALID_BOY_1, 5 +.set LOCALID_STEVEN, 7 +.set LOCALID_WOMAN_1, 8 +.set LOCALID_GROUDON, 9 +.set LOCALID_KYOGRE, 10 +.set LOCALID_RAYQUAZA, 11 +.set LOCALID_MANIAC, 12 +.set LOCALID_GIRL, 13 +.set LOCALID_BLACK_BELT, 14 +.set LOCALID_BOY_2, 15 +.set LOCALID_MAXIE, 16 +.set LOCALID_ARCHIE, 17 +.set LOCALID_WALLACE, 18 + SootopolisCity_MapScripts:: @ 81E565C map_script MAP_SCRIPT_ON_LOAD, SootopolisCity_OnLoad map_script MAP_SCRIPT_ON_TRANSITION, SootopolisCity_OnTransition @@ -66,14 +84,14 @@ SootopolisCity_EventScript_HideMapNamePopup:: @ 81E5781 return SootopolisCity_EventScript_SetBattleSpectators:: @ 81E5785 - setobjectxyperm 3, 13, 48 - setobjectxyperm 5, 46, 32 - setobjectxyperm 4, 48, 41 - setobjectxyperm 8, 45, 43 - setobjectmovementtype 3, MOVEMENT_TYPE_FACE_UP - setobjectmovementtype 5, MOVEMENT_TYPE_FACE_LEFT - setobjectmovementtype 4, MOVEMENT_TYPE_FACE_LEFT - setobjectmovementtype 8, MOVEMENT_TYPE_FACE_LEFT + setobjectxyperm LOCALID_KIRI, 13, 48 + setobjectxyperm LOCALID_BOY_1, 46, 32 + setobjectxyperm LOCALID_NINJA_BOY, 48, 41 + setobjectxyperm LOCALID_WOMAN_1, 45, 43 + setobjectmovementtype LOCALID_KIRI, MOVEMENT_TYPE_FACE_UP + setobjectmovementtype LOCALID_BOY_1, MOVEMENT_TYPE_FACE_LEFT + setobjectmovementtype LOCALID_NINJA_BOY, MOVEMENT_TYPE_FACE_LEFT + setobjectmovementtype LOCALID_WOMAN_1, MOVEMENT_TYPE_FACE_LEFT return SootopolisCity_EventScript_SetLayout:: @ 81E57B2 @@ -125,21 +143,21 @@ SootopolisCity_EventScript_CheckSetEnterCaveOfOriginObjPos:: @ 81E5842 return SootopolisCity_EventScript_SetEnterCaveOfOriginObjPos:: @ 81E584C - setobjectxyperm 1, 30, 18 @ Expert - setobjectxyperm 7, 32, 18 @ Steven + setobjectxyperm LOCALID_EXPERT, 30, 18 + setobjectxyperm LOCALID_STEVEN, 32, 18 return SootopolisCity_EventScript_SetExitCaveOfOriginObjPos:: @ 81E585B - setobjectxyperm 1, 30, 18 @ Expert - setobjectxyperm 18, 31, 18 @ Wallace - setobjectxyperm 7, 32, 18 @ Steven + setobjectxyperm LOCALID_EXPERT, 30, 18 + setobjectxyperm LOCALID_WALLACE, 31, 18 + setobjectxyperm LOCALID_STEVEN, 32, 18 end SootopolisCity_EventScript_SetOutsideGymObjPos:: @ 81E5871 - setobjectxyperm 1, 31, 18 @ Expert - setobjectxyperm 7, 29, 33 @ Steven - setobjectxyperm 16, 33, 35 @ Maxie - setobjectxyperm 17, 34, 35 @ Archie + setobjectxyperm LOCALID_EXPERT, 31, 18 + setobjectxyperm LOCALID_STEVEN, 29, 33 + setobjectxyperm LOCALID_MAXIE, 33, 35 + setobjectxyperm LOCALID_ARCHIE, 34, 35 compare VAR_SOOTOPOLIS_WALLACE_STATE, 0 call_if_eq SootopolisCity_EventScript_SetWallaceMiddle compare VAR_SOOTOPOLIS_WALLACE_STATE, 1 @@ -149,22 +167,22 @@ SootopolisCity_EventScript_SetOutsideGymObjPos:: @ 81E5871 return SootopolisCity_EventScript_SetWallaceMiddle:: @ 81E58AF - setobjectxyperm 18, 31, 33 - setobjectmovementtype 18, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_WALLACE, 31, 33 + setobjectmovementtype LOCALID_WALLACE, MOVEMENT_TYPE_FACE_DOWN return SootopolisCity_EventScript_SetWallaceRight:: @ 81E58BB - setobjectxyperm 18, 32, 33 - setobjectmovementtype 18, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_WALLACE, 32, 33 + setobjectmovementtype LOCALID_WALLACE, MOVEMENT_TYPE_FACE_DOWN return SootopolisCity_EventScript_SetWallaceLeft:: @ 81E58C7 - setobjectxyperm 18, 30, 33 - setobjectmovementtype 18, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_WALLACE, 30, 33 + setobjectmovementtype LOCALID_WALLACE, MOVEMENT_TYPE_FACE_DOWN return SootopolisCity_EventScript_SetExpertBlockCaveEntrance:: @ 81E58D3 - setobjectxyperm 1, 31, 18 @ Expert + setobjectxyperm LOCALID_EXPERT, 31, 18 return SootopolisCity_OnWarp: @ 81E58DB @@ -220,14 +238,14 @@ SootopolisCity_EventScript_LegendariesSceneFromPokeCenter:: @ 81E5946 setvar VAR_0x8004, 0 special Script_DoRayquazaScene waitstate - applymovement 10, Common_Movement_WalkInPlaceFastestLeft - applymovement 9, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_KYOGRE, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_GROUDON, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 60 waitse playmoncry SPECIES_KYOGRE, 2 - applymovement 10, SootopolisCity_Movement_KyogreAttack - applymovement 9, SootopolisCity_Movement_GroudonDefend + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreAttack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonDefend waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 1 @ horizontal pan @@ -235,13 +253,13 @@ SootopolisCity_EventScript_LegendariesSceneFromPokeCenter:: @ 81E5946 setvar VAR_0x8007, 5 @ shake delay special ShakeCamera waitstate - applymovement 10, SootopolisCity_Movement_KyogreMoveBack - applymovement 9, SootopolisCity_Movement_GroudonMoveBack + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreMoveBack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonMoveBack waitmovement 0 waitse playmoncry SPECIES_GROUDON, 2 - applymovement 10, SootopolisCity_Movement_GroudonAttack - applymovement 9, SootopolisCity_Movement_KyogreDefend + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_GroudonAttack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_KyogreDefend waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 1 @ horizontal pan @@ -249,13 +267,13 @@ SootopolisCity_EventScript_LegendariesSceneFromPokeCenter:: @ 81E5946 setvar VAR_0x8007, 5 @ shake delay special ShakeCamera waitstate - applymovement 10, SootopolisCity_Movement_KyogreMoveBack - applymovement 9, SootopolisCity_Movement_GroudonMoveBack + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreMoveBack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonMoveBack waitmovement 0 waitse playmoncry SPECIES_KYOGRE, 2 - applymovement 10, SootopolisCity_Movement_KyogreAttack - applymovement 9, SootopolisCity_Movement_GroudonDefend + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreAttack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonDefend waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 1 @ horizontal pan @@ -263,12 +281,12 @@ SootopolisCity_EventScript_LegendariesSceneFromPokeCenter:: @ 81E5946 setvar VAR_0x8007, 5 @ shake delay special ShakeCamera waitstate - applymovement 10, SootopolisCity_Movement_KyogreMoveBack - applymovement 9, SootopolisCity_Movement_GroudonMoveBack + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreMoveBack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonMoveBack waitmovement 0 special SpawnCameraObject - applymovement 10, SootopolisCity_Movement_KyogreIdle - applymovement 9, SootopolisCity_Movement_GroudonIdle + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreIdle + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonIdle applymovement OBJ_EVENT_ID_CAMERA, SootopolisCity_Movement_PanBackToPokeCenter waitmovement 0 special RemoveCameraObject @@ -320,14 +338,14 @@ SootopolisCity_EventScript_LegendariesSceneFromDive:: @ 81E5A82 setvar VAR_0x8004, 0 special Script_DoRayquazaScene waitstate - applymovement 10, Common_Movement_WalkInPlaceFastestLeft - applymovement 9, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_KYOGRE, Common_Movement_WalkInPlaceFastestLeft + applymovement LOCALID_GROUDON, Common_Movement_WalkInPlaceFastestRight waitmovement 0 delay 60 waitse playmoncry SPECIES_KYOGRE, 2 - applymovement 10, SootopolisCity_Movement_KyogreAttack - applymovement 9, SootopolisCity_Movement_GroudonDefend + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreAttack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonDefend waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 1 @ horizontal pan @@ -335,13 +353,13 @@ SootopolisCity_EventScript_LegendariesSceneFromDive:: @ 81E5A82 setvar VAR_0x8007, 5 @ shake delay special ShakeCamera waitstate - applymovement 10, SootopolisCity_Movement_KyogreMoveBack - applymovement 9, SootopolisCity_Movement_GroudonMoveBack + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreMoveBack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonMoveBack waitmovement 0 waitse playmoncry SPECIES_GROUDON, 2 - applymovement 10, SootopolisCity_Movement_GroudonAttack - applymovement 9, SootopolisCity_Movement_KyogreDefend + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_GroudonAttack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_KyogreDefend waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 1 @ horizontal pan @@ -349,13 +367,13 @@ SootopolisCity_EventScript_LegendariesSceneFromDive:: @ 81E5A82 setvar VAR_0x8007, 5 @ shake delay special ShakeCamera waitstate - applymovement 10, SootopolisCity_Movement_KyogreMoveBack - applymovement 9, SootopolisCity_Movement_GroudonMoveBack + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreMoveBack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonMoveBack waitmovement 0 waitse playmoncry SPECIES_KYOGRE, 2 - applymovement 10, SootopolisCity_Movement_KyogreAttack - applymovement 9, SootopolisCity_Movement_GroudonDefend + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreAttack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonDefend waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 1 @ horizontal pan @@ -363,12 +381,12 @@ SootopolisCity_EventScript_LegendariesSceneFromDive:: @ 81E5A82 setvar VAR_0x8007, 5 @ shake delay special ShakeCamera waitstate - applymovement 10, SootopolisCity_Movement_KyogreMoveBack - applymovement 9, SootopolisCity_Movement_GroudonMoveBack + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreMoveBack + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonMoveBack waitmovement 0 special SpawnCameraObject - applymovement 10, SootopolisCity_Movement_KyogreIdle - applymovement 9, SootopolisCity_Movement_GroudonIdle + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreIdle + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonIdle applymovement OBJ_EVENT_ID_CAMERA, SootopolisCity_Movement_PanBackToDive waitmovement 0 special RemoveCameraObject @@ -507,9 +525,9 @@ SootopolisCity_EventScript_RayquazaSceneFromPokeCenter:: @ 81E5C1E delay 60 fadescreenspeed FADE_TO_BLACK, 8 call SootopolisCity_EventScript_SetRoughWater - removeobject 9 - removeobject 10 - addobject 11 + removeobject LOCALID_GROUDON + removeobject LOCALID_KYOGRE + addobject LOCALID_RAYQUAZA setvar VAR_0x8004, 1 special Script_DoRayquazaScene waitstate @@ -536,9 +554,9 @@ SootopolisCity_EventScript_RayquazaSceneFromPokeCenter:: @ 81E5C1E waitmoncry setweather WEATHER_NONE doweather - applymovement 11, SootopolisCity_Movement_RayquazaFlyOff + applymovement LOCALID_RAYQUAZA, SootopolisCity_Movement_RayquazaFlyOff waitmovement 0 - removeobject 11 + removeobject LOCALID_RAYQUAZA special WaitWeather waitstate clearflag FLAG_SYS_WEATHER_CTRL @@ -560,9 +578,9 @@ SootopolisCity_EventScript_RayquazaSceneFromDive:: @ 81E5CCE delay 60 fadescreenspeed FADE_TO_BLACK, 8 call SootopolisCity_EventScript_SetRoughWater - removeobject 9 - removeobject 10 - addobject 11 + removeobject LOCALID_GROUDON + removeobject LOCALID_KYOGRE + addobject LOCALID_RAYQUAZA setvar VAR_0x8004, 1 special Script_DoRayquazaScene waitstate @@ -589,9 +607,9 @@ SootopolisCity_EventScript_RayquazaSceneFromDive:: @ 81E5CCE waitmoncry setweather WEATHER_NONE doweather - applymovement 11, SootopolisCity_Movement_RayquazaFlyOff + applymovement LOCALID_RAYQUAZA, SootopolisCity_Movement_RayquazaFlyOff waitmovement 0 - removeobject 11 + removeobject LOCALID_RAYQUAZA special WaitWeather waitstate clearflag FLAG_SYS_WEATHER_CTRL @@ -735,7 +753,7 @@ SootopolisCity_EventScript_Kiri:: @ 81E5ED8 goto_if_eq SootopolisCity_EventScript_KiriRayquaza msgbox SootopolisCity_Text_BigPokemonFighting, MSGBOX_DEFAULT closemessage - applymovement 3, Common_Movement_FaceOriginalDirection + applymovement LOCALID_KIRI, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -798,13 +816,13 @@ SootopolisCity_EventScript_KiriLikeSeasonBornIn:: @ 81E5FD8 SootopolisCity_EventScript_Woman2:: @ 81E5FE2 lockall - applymovement 2, Common_Movement_FacePlayer + applymovement LOCALID_WOMAN_2, Common_Movement_FacePlayer waitmovement 0 compare VAR_SOOTOPOLIS_CITY_STATE, 5 goto_if_eq SootopolisCity_EventScript_Woman2Rayquaza msgbox SootopolisCity_Text_WeatherWentWild, MSGBOX_DEFAULT closemessage - applymovement 2, Common_Movement_FaceOriginalDirection + applymovement LOCALID_WOMAN_2, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end @@ -844,7 +862,7 @@ SootopolisCity_EventScript_Woman1:: @ 81E6038 SootopolisCity_EventScript_Woman1Legendaries:: @ 81E6065 msgbox SootopolisCity_Text_GiganticPokemonFight, MSGBOX_DEFAULT closemessage - applymovement 8, Common_Movement_FaceOriginalDirection + applymovement LOCALID_WOMAN_1, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -861,7 +879,7 @@ SootopolisCity_EventScript_Woman1Rayquaza:: @ 81E6084 SootopolisCity_EventScript_NinjaBoy:: @ 81E608E lockall - applymovement 4, Common_Movement_FacePlayer + applymovement LOCALID_NINJA_BOY, Common_Movement_FacePlayer waitmovement 0 compare VAR_SOOTOPOLIS_CITY_STATE, 5 goto_if_eq SootopolisCity_EventScript_NinjaBoyRayquaza @@ -871,7 +889,7 @@ SootopolisCity_EventScript_NinjaBoy:: @ 81E608E goto_if_le SootopolisCity_EventScript_NinjaBoyNormal msgbox SootopolisCity_Text_ThisIsWicked, MSGBOX_DEFAULT closemessage - applymovement 4, Common_Movement_FaceOriginalDirection + applymovement LOCALID_NINJA_BOY, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -888,7 +906,7 @@ SootopolisCity_EventScript_NinjaBoyRayquaza:: @ 81E60D9 SootopolisCity_EventScript_Boy1:: @ 81E60E3 lockall - applymovement 5, Common_Movement_FacePlayer + applymovement LOCALID_BOY_1, Common_Movement_FacePlayer waitmovement 0 compare VAR_SOOTOPOLIS_CITY_STATE, 5 goto_if_eq SootopolisCity_EventScript_Boy1Rayquaza @@ -899,7 +917,7 @@ SootopolisCity_EventScript_Boy1:: @ 81E60E3 goto_if_le SootopolisCity_EventScript_Boy1Normal msgbox SootopolisCity_Text_GiantPokemonSuddenlyAppeared, MSGBOX_DEFAULT closemessage - applymovement 5, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BOY_1, Common_Movement_FaceOriginalDirection waitmovement 0 release end @@ -933,7 +951,7 @@ EventScript_ClosedSootopolisDoor:: @ 81E615D SootopolisCity_EventScript_Steven:: @ 81E6166 lockall - applymovement 7, Common_Movement_FacePlayer + applymovement LOCALID_STEVEN, Common_Movement_FacePlayer waitmovement 0 call_if_unset FLAG_STEVEN_GUIDES_TO_CAVE_OF_ORIGIN, SootopolisCity_EventScript_StevenLeadPlayerCaveOfOrigin compare VAR_SOOTOPOLIS_CITY_STATE, 2 @@ -971,13 +989,13 @@ SootopolisCity_EventScript_StevenLeadPlayerCaveOfOrigin:: @ 81E61CC call_if_eq SootopolisCity_EventScript_StartWalkToCaveOfOriginNorth msgbox SootopolisCity_Text_DoesThisMakeYourFearPokemon, MSGBOX_DEFAULT closemessage - applymovement 7, SootopolisCity_Movement_StevenWalkToCaveOfOrigin + applymovement LOCALID_STEVEN, SootopolisCity_Movement_StevenWalkToCaveOfOrigin applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_Movement_PlayerWalkToCaveOfOrigin waitmovement 0 delay 120 - applymovement 1, SootopolisCity_Movement_ExpertMoveAside + applymovement LOCALID_EXPERT, SootopolisCity_Movement_ExpertMoveAside waitmovement 0 - applymovement 7, SootopolisCity_Movement_StevenArriveCaveEntrance + applymovement LOCALID_STEVEN, SootopolisCity_Movement_StevenArriveCaveEntrance applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_Movement_PlayerArriveCaveEntrance waitmovement 0 msgbox SootopolisCity_Text_HereWereAreHelpWallace, MSGBOX_DEFAULT @@ -990,13 +1008,13 @@ SootopolisCity_EventScript_StevenLeadPlayerCaveOfOrigin:: @ 81E61CC end SootopolisCity_EventScript_StartWalkToCaveOfOriginWest:: @ 81E6243 - applymovement 7, SootopolisCity_Movement_StevenStartWalkToCaveOfOrigin + applymovement LOCALID_STEVEN, SootopolisCity_Movement_StevenStartWalkToCaveOfOrigin applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_Movement_PlayerStartWalkToCaveOfOriginWest waitmovement 0 return SootopolisCity_EventScript_StartWalkToCaveOfOriginNorth:: @ 81E6255 - applymovement 7, SootopolisCity_Movement_StevenStartWalkToCaveOfOrigin + applymovement LOCALID_STEVEN, SootopolisCity_Movement_StevenStartWalkToCaveOfOrigin applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_Movement_PlayerStartWalkToCaveOfOriginNorth waitmovement 0 return @@ -1267,13 +1285,13 @@ SootopolisCity_Movement_PlayerEnterCaveOfOrigin: @ 81E635A SootopolisCity_EventScript_Boy2:: @ 81E635D lockall - applymovement 15, Common_Movement_FacePlayer + applymovement LOCALID_BOY_2, Common_Movement_FacePlayer waitmovement 0 compare VAR_SOOTOPOLIS_CITY_STATE, 5 goto_if_eq SootopolisCity_EventScript_Boy2Rayquaza msgbox SootopolisCity_Text_TwoPokemonArentAngry, MSGBOX_DEFAULT closemessage - applymovement 15, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BOY_2, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end @@ -1290,17 +1308,17 @@ SootopolisCity_EventScript_BlackBelt:: @ 81E6393 goto_if_eq SootopolisCity_EventScript_BlackBeltRayquaza msgbox SootopolisCity_Text_GoRedAndBlueMon, MSGBOX_DEFAULT closemessage - applymovement 14, Common_Movement_FacePlayer + applymovement LOCALID_BLACK_BELT, Common_Movement_FacePlayer waitmovement 0 msgbox SootopolisCity_Text_DoYouKnowMonNames, MSGBOX_DEFAULT closemessage - applymovement 14, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BLACK_BELT, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end SootopolisCity_EventScript_BlackBeltRayquaza:: @ 81E63C7 - applymovement 14, Common_Movement_FacePlayer + applymovement LOCALID_BLACK_BELT, Common_Movement_FacePlayer waitmovement 0 msgbox SootopolisCity_Text_GreenOneSettlesThings, MSGBOX_DEFAULT releaseall @@ -1308,13 +1326,13 @@ SootopolisCity_EventScript_BlackBeltRayquaza:: @ 81E63C7 SootopolisCity_EventScript_Girl:: @ 81E63DB lockall - applymovement 13, Common_Movement_FacePlayer + applymovement LOCALID_GIRL, Common_Movement_FacePlayer waitmovement 0 compare VAR_SOOTOPOLIS_CITY_STATE, 5 goto_if_eq SootopolisCity_EventScript_GirlRayquaza msgbox SootopolisCity_Text_SootopolisWillBeWrecked, MSGBOX_DEFAULT closemessage - applymovement 13, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GIRL, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end @@ -1327,13 +1345,13 @@ SootopolisCity_EventScript_GirlRayquaza:: @ 81E6406 SootopolisCity_EventScript_Maniac:: @ 81E6411 lockall - applymovement 12, Common_Movement_FacePlayer + applymovement LOCALID_MANIAC, Common_Movement_FacePlayer waitmovement 0 compare VAR_SOOTOPOLIS_CITY_STATE, 5 goto_if_eq SootopolisCity_EventScript_ManiacRayquaza msgbox SootopolisCity_Text_SeeingLegendWithOwnEyes, MSGBOX_DEFAULT closemessage - applymovement 12, Common_Movement_FaceOriginalDirection + applymovement LOCALID_MANIAC, Common_Movement_FaceOriginalDirection waitmovement 0 releaseall end @@ -1370,16 +1388,16 @@ SootopolisCity_EventScript_GiveWaterfall:: @ 81E646F end SootopolisCity_EventScript_WallaceMoveFromGym:: @ 81E64B2 - applymovement 18, SootopolisCity_Movement_WallaceMoveFromGym + applymovement LOCALID_WALLACE, SootopolisCity_Movement_WallaceMoveFromGym waitmovement 0 - copyobjectxytoperm 18 + copyobjectxytoperm LOCALID_WALLACE setvar VAR_SOOTOPOLIS_WALLACE_STATE, 1 return SootopolisCity_EventScript_WallaceMoveFromGymWest:: @ 81E64C5 - applymovement 18, SootopolisCity_Movement_WallaceMoveFromGymWest + applymovement LOCALID_WALLACE, SootopolisCity_Movement_WallaceMoveFromGymWest waitmovement 0 - copyobjectxytoperm 18 + copyobjectxytoperm LOCALID_WALLACE setvar VAR_SOOTOPOLIS_WALLACE_STATE, 2 return diff --git a/data/maps/SootopolisCity_Gym_1F/scripts.inc b/data/maps/SootopolisCity_Gym_1F/scripts.inc index afb4845b3..66588ba08 100644 --- a/data/maps/SootopolisCity_Gym_1F/scripts.inc +++ b/data/maps/SootopolisCity_Gym_1F/scripts.inc @@ -121,7 +121,7 @@ SootopolisCity_Gym_1F_EventScript_JuanDefeated:: @ 8224F82 SootopolisCity_Gym_1F_EventScript_GiveWaterPulse:: @ 8224FD4 giveitem ITEM_TM03 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_BagIsFull msgbox SootopolisCity_Gym_1F_Text_ExplainWaterPulse, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM03 @@ -129,7 +129,7 @@ SootopolisCity_Gym_1F_EventScript_GiveWaterPulse:: @ 8224FD4 SootopolisCity_Gym_1F_EventScript_GiveWaterPulse2:: @ 8224FF7 giveitem ITEM_TM03 - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull msgbox SootopolisCity_Gym_1F_Text_ExplainWaterPulse, MSGBOX_DEFAULT setflag FLAG_RECEIVED_TM03 diff --git a/data/maps/SootopolisCity_MysteryEventsHouse_1F/scripts.inc b/data/maps/SootopolisCity_MysteryEventsHouse_1F/scripts.inc index 96a28f2dd..30a755a0f 100644 --- a/data/maps/SootopolisCity_MysteryEventsHouse_1F/scripts.inc +++ b/data/maps/SootopolisCity_MysteryEventsHouse_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_OLD_MAN, 1 + SootopolisCity_MysteryEventsHouse_1F_MapScripts:: @ 8227953 map_script MAP_SCRIPT_ON_TRANSITION, SootopolisCity_MysteryEventsHouse_1F_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, SootopolisCity_MysteryEventsHouse_1F_OnFrame @@ -13,14 +15,14 @@ SootopolisCity_MysteryEventsHouse_1F_OnTransition: @ 822795E SootopolisCity_MysteryEventsHouse_1F_EventScript_SetTrainerVisitingLayout:: @ 822797D setvar VAR_TEMP_1, 1 - setobjectxyperm 1, 3, 2 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_OLD_MAN, 3, 2 + setobjectmovementtype LOCALID_OLD_MAN, MOVEMENT_TYPE_FACE_DOWN setmaplayoutindex LAYOUT_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F_STAIRS_UNBLOCKED return SootopolisCity_MysteryEventsHouse_1F_EventScript_MoveOldManToDoor:: @ 8227991 - setobjectxyperm 1, 2, 2 - setobjectmovementtype 1, MOVEMENT_TYPE_FACE_RIGHT + setobjectxyperm LOCALID_OLD_MAN, 2, 2 + setobjectmovementtype LOCALID_OLD_MAN, MOVEMENT_TYPE_FACE_RIGHT return SootopolisCity_MysteryEventsHouse_1F_OnFrame: @ 822799D @@ -33,9 +35,9 @@ SootopolisCity_MysteryEventsHouse_1F_EventScript_OldManCommentOnBattle:: @ 82279 lockall applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_MysteryEventsHouse_1F_Movement_PlayerExitStairs waitmovement 0 - applymovement 1, SootopolisCity_MysteryEventsHouse_1F_Movement_OldManWalkBehindPlayer + applymovement LOCALID_OLD_MAN, SootopolisCity_MysteryEventsHouse_1F_Movement_OldManWalkBehindPlayer waitmovement 0 - copyobjectxytoperm 1 + copyobjectxytoperm LOCALID_OLD_MAN applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 compare VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE, 1 diff --git a/data/maps/SootopolisCity_MysteryEventsHouse_B1F/scripts.inc b/data/maps/SootopolisCity_MysteryEventsHouse_B1F/scripts.inc index 8ba872465..992cef5a3 100644 --- a/data/maps/SootopolisCity_MysteryEventsHouse_B1F/scripts.inc +++ b/data/maps/SootopolisCity_MysteryEventsHouse_B1F/scripts.inc @@ -22,11 +22,11 @@ SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleVisitingTrainer:: @ 8227 setvar VAR_0x8005, 0 special DoSpecialTrainerBattle waitstate - compare VAR_RESULT, 3 + compare VAR_RESULT, B_OUTCOME_DREW call_if_eq SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleTie - compare VAR_RESULT, 1 + compare VAR_RESULT, B_OUTCOME_WON call_if_eq SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleWon - compare VAR_RESULT, 2 + compare VAR_RESULT, B_OUTCOME_LOST call_if_eq SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleLost closemessage special HealPlayerParty diff --git a/data/maps/SootopolisCity_PokemonCenter_1F/scripts.inc b/data/maps/SootopolisCity_PokemonCenter_1F/scripts.inc index d8ff4e7f6..712fd166b 100644 --- a/data/maps/SootopolisCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/SootopolisCity_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + SootopolisCity_PokemonCenter_1F_MapScripts:: @ 82264F1 map_script MAP_SCRIPT_ON_TRANSITION, SootopolisCity_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -7,9 +9,8 @@ SootopolisCity_PokemonCenter_1F_OnTransition: @ 82264FC setrespawn HEAL_LOCATION_SOOTOPOLIS_CITY end -@ VAR_0x800B is the Nurse's object event id SootopolisCity_PokemonCenter_1F_EventScript_Nurse:: @ 8226500 - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/SouthernIsland_Exterior/scripts.inc b/data/maps/SouthernIsland_Exterior/scripts.inc index e47cbc8f1..1ba417120 100644 --- a/data/maps/SouthernIsland_Exterior/scripts.inc +++ b/data/maps/SouthernIsland_Exterior/scripts.inc @@ -1,3 +1,6 @@ +.set LOCALID_SAILOR, 1 +.set LOCALID_SS_TIDAL, 2 + SouthernIsland_Exterior_MapScripts:: @ 82429C8 map_script MAP_SCRIPT_ON_TRANSITION, SouthernIsland_Exterior_OnTransition .byte 0 @@ -17,8 +20,8 @@ SouthernIsland_Exterior_EventScript_Sailor:: @ 82429D2 applymovement VAR_LAST_TALKED, Common_Movement_WalkInPlaceFastestDown waitmovement 0 delay 30 - hideobjectat 1, MAP_SOUTHERN_ISLAND_EXTERIOR - setvar VAR_0x8004, 2 + hideobjectat LOCALID_SAILOR, MAP_SOUTHERN_ISLAND_EXTERIOR + setvar VAR_0x8004, LOCALID_SS_TIDAL call Common_EventScript_FerryDepartIsland warp MAP_LILYCOVE_CITY_HARBOR, 255, 8, 11 waitstate diff --git a/data/maps/SouthernIsland_Interior/scripts.inc b/data/maps/SouthernIsland_Interior/scripts.inc index 486f00029..0dd8cc303 100644 --- a/data/maps/SouthernIsland_Interior/scripts.inc +++ b/data/maps/SouthernIsland_Interior/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_LATI, 2 + SouthernIsland_Interior_MapScripts:: @ 8242A45 map_script MAP_SCRIPT_ON_RESUME, SouthernIsland_Interior_OnResume map_script MAP_SCRIPT_ON_TRANSITION, SouthernIsland_Interior_OnTransition @@ -11,7 +13,7 @@ SouthernIsland_Interior_EventScript_TryRemoveLati:: @ 8242A5A specialvar VAR_RESULT, GetBattleOutcome compare VAR_RESULT, B_OUTCOME_CAUGHT goto_if_ne Common_EventScript_NopReturn - removeobject 2 + removeobject LOCALID_LATI return SouthernIsland_Interior_OnTransition: @ 8242A6E @@ -69,14 +71,14 @@ SouthernIsland_Interior_EventScript_Lati:: @ 8242AD0 playmoncry VAR_TEMP_4, 0 delay 30 waitmoncry - addobject 2 + addobject LOCALID_LATI delay 30 applymovement OBJ_EVENT_ID_CAMERA, SouthernIsland_Interior_Movement_CameraPanDown - applymovement 2, SouthernIsland_Interior_Movement_LatiApproach + applymovement LOCALID_LATI, SouthernIsland_Interior_Movement_LatiApproach waitmovement 0 delay 50 special RemoveCameraObject - setvar VAR_LAST_TALKED, 2 + setvar VAR_LAST_TALKED, LOCALID_LATI compare VAR_ROAMER_POKEMON, 0 call_if_eq SouthernIsland_Interior_EventScript_SetLatiosBattleVars compare VAR_ROAMER_POKEMON, 0 diff --git a/data/maps/TerraCave_End/scripts.inc b/data/maps/TerraCave_End/scripts.inc index 46af23e87..9683ca607 100644 --- a/data/maps/TerraCave_End/scripts.inc +++ b/data/maps/TerraCave_End/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_GROUDON, 1 + TerraCave_End_MapScripts:: @ 823B0B0 map_script MAP_SCRIPT_ON_RESUME, TerraCave_End_OnResume map_script MAP_SCRIPT_ON_TRANSITION, TerraCave_End_OnTransition @@ -11,7 +13,7 @@ TerraCave_End_EventScript_TryRemoveGroudon:: @ 823B0C5 specialvar VAR_RESULT, GetBattleOutcome compare VAR_RESULT, B_OUTCOME_CAUGHT goto_if_ne Common_EventScript_NopReturn - removeobject 1 + removeobject LOCALID_GROUDON return TerraCave_End_OnTransition: @ 823B0D9 @@ -27,13 +29,13 @@ TerraCave_End_EventScript_Groudon:: @ 823B0EC lockall applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceUp waitmovement 0 - applymovement 1, TerraCave_End_Movement_GroudonApproach + applymovement LOCALID_GROUDON, TerraCave_End_Movement_GroudonApproach waitmovement 0 waitse playmoncry SPECIES_GROUDON, 2 delay 40 waitmoncry - setvar VAR_LAST_TALKED, 1 + setvar VAR_LAST_TALKED, LOCALID_GROUDON setwildbattle SPECIES_GROUDON, 70, ITEM_NONE setflag FLAG_SYS_CTRL_OBJ_DELETE special BattleSetup_StartLegendaryBattle diff --git a/data/maps/TrainerHill_Elevator/scripts.inc b/data/maps/TrainerHill_Elevator/scripts.inc index c31056ad3..2b3400418 100644 --- a/data/maps/TrainerHill_Elevator/scripts.inc +++ b/data/maps/TrainerHill_Elevator/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + TrainerHill_Elevator_MapScripts:: @ 826934F map_script MAP_SCRIPT_ON_FRAME_TABLE, TrainerHill_Elevator_OnFrame .byte 0 @@ -20,14 +22,14 @@ TrainerHill_Elevator_EventScript_ExitToRoof:: @ 8269360 TrainerHill_Elevator_EventScript_EnterElevator:: @ 8269375 applymovement OBJ_EVENT_ID_PLAYER, TrainerHill_Elevator_Movement_PlayerApproachAttendant waitmovement 0 - applymovement 1, TrainerHill_Elevator_Movement_AttendantFacePlayer + applymovement LOCALID_ATTENDANT, TrainerHill_Elevator_Movement_AttendantFacePlayer waitmovement 0 lockall msgbox TrainerHill_Elevator_Text_ReturnToReception, MSGBOX_YESNO compare VAR_RESULT, NO goto_if_eq TrainerHill_Elevator_EventScript_ExitToRoof releaseall - applymovement 1, TrainerHill_Elevator_Movement_AttendantFaceDown + applymovement LOCALID_ATTENDANT, TrainerHill_Elevator_Movement_AttendantFaceDown waitmovement 0 applymovement OBJ_EVENT_ID_PLAYER, TrainerHill_Elevator_Movement_PlayerMoveToCenterOfElevator waitmovement 0 diff --git a/data/maps/TrainerHill_Entrance/scripts.inc b/data/maps/TrainerHill_Entrance/scripts.inc index b3bec46b0..077709053 100644 --- a/data/maps/TrainerHill_Entrance/scripts.inc +++ b/data/maps/TrainerHill_Entrance/scripts.inc @@ -1,3 +1,8 @@ +.set LOCALID_ATTENDANT, 1 +.set LOCALID_NURSE, 2 +.set LOCALID_GIRL, 4 +.set LOCALID_MAN, 5 + TrainerHill_Entrance_MapScripts:: @ 82680AC map_script MAP_SCRIPT_ON_RESUME, TrainerHill_Entrance_OnResume map_script MAP_SCRIPT_ON_RETURN_TO_FIELD, TrainerHill_Entrance_OnReturn @@ -36,10 +41,10 @@ TrainerHill_Entrance_EventScript_PlayerDontFaceAttendant:: @ 826811A end TrainerHill_Entrance_OnReturn: @ 826811B - addobject 2 - addobject 1 - addobject 5 - addobject 4 + addobject LOCALID_NURSE + addobject LOCALID_ATTENDANT + addobject LOCALID_MAN + addobject LOCALID_GIRL end TrainerHill_Entrance_OnLoad: @ 8268128 @@ -99,7 +104,7 @@ TrainerHill_Entrance_EventScript_EndExitChallenge:: @ 82681EE end TrainerHill_Entrance_EventScript_Nurse:: @ 82681EF - setvar VAR_0x800B, 2 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/UnionRoom/scripts.inc b/data/maps/UnionRoom/scripts.inc index 5a478970d..f25e7acb6 100644 --- a/data/maps/UnionRoom/scripts.inc +++ b/data/maps/UnionRoom/scripts.inc @@ -1,3 +1,12 @@ +.set LOCALID_UR_PLAYER_4, 2 +.set LOCALID_UR_PLAYER_8, 3 +.set LOCALID_UR_PLAYER_7, 4 +.set LOCALID_UR_PLAYER_6, 5 +.set LOCALID_UR_PLAYER_5, 6 +.set LOCALID_UR_PLAYER_3, 7 +.set LOCALID_UR_PLAYER_2, 8 +.set LOCALID_UR_PLAYER_1, 9 + UnionRoom_MapScripts:: @ 823D1A6 map_script MAP_SCRIPT_ON_RESUME, UnionRoom_OnResume map_script MAP_SCRIPT_ON_TRANSITION, UnionRoom_OnTransition @@ -12,14 +21,14 @@ UnionRoom_OnResume: @ 823D1B1 setflag FLAG_HIDE_UNION_ROOM_PLAYER_6 setflag FLAG_HIDE_UNION_ROOM_PLAYER_7 setflag FLAG_HIDE_UNION_ROOM_PLAYER_8 - removeobject 9 - removeobject 8 - removeobject 7 - removeobject 2 - removeobject 6 - removeobject 5 - removeobject 4 - removeobject 3 + removeobject LOCALID_UR_PLAYER_1 + removeobject LOCALID_UR_PLAYER_2 + removeobject LOCALID_UR_PLAYER_3 + removeobject LOCALID_UR_PLAYER_4 + removeobject LOCALID_UR_PLAYER_5 + removeobject LOCALID_UR_PLAYER_6 + removeobject LOCALID_UR_PLAYER_7 + removeobject LOCALID_UR_PLAYER_8 special RunUnionRoom end diff --git a/data/maps/VerdanturfTown/scripts.inc b/data/maps/VerdanturfTown/scripts.inc index 2f075346c..a419c3319 100644 --- a/data/maps/VerdanturfTown/scripts.inc +++ b/data/maps/VerdanturfTown/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_TWIN, 2 + VerdanturfTown_MapScripts:: @ 81EB566 map_script MAP_SCRIPT_ON_TRANSITION, VerdanturfTown_OnTransition .byte 0 @@ -12,14 +14,14 @@ VerdanturfTown_EventScript_Twin:: @ 81EB575 faceplayer goto_if_set FLAG_RUSTURF_TUNNEL_OPENED, VerdanturfTown_EventScript_TwinTunnelOpen msgbox VerdanturfTown_Text_ManTryingToDigTunnel, MSGBOX_DEFAULT - applymovement 2, Common_Movement_FaceOriginalDirection + applymovement LOCALID_TWIN, Common_Movement_FaceOriginalDirection waitmovement 0 release end VerdanturfTown_EventScript_TwinTunnelOpen:: @ 81EB594 msgbox VerdanturfTown_Text_ManDugTunnelForLove, MSGBOX_DEFAULT - applymovement 2, Common_Movement_FaceOriginalDirection + applymovement LOCALID_TWIN, Common_Movement_FaceOriginalDirection waitmovement 0 release end diff --git a/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc b/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc index 0e79fe8df..86b5f3ec1 100644 --- a/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc +++ b/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc @@ -1,3 +1,7 @@ +.set LOCALID_PLAYER, 1 +.set LOCALID_OPPONENT, 2 +.set LOCALID_ATTENDANT, 3 + VerdanturfTown_BattleTentBattleRoom_MapScripts:: @ 82022FA map_script MAP_SCRIPT_ON_TRANSITION, VerdanturfTown_BattleTentBattleRoom_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, VerdanturfTown_BattleTentBattleRoom_OnFrame @@ -35,16 +39,16 @@ VerdanturfTown_BattleTentBattleRoom_OnFrame: @ 820233E .2byte 0 VerdanturfTown_BattleTentBattleRoom_EventScript_EnterRoom:: @ 8202348 - showobjectat 1, MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM - applymovement 1, VerdanturfTown_BattleTentBattleRoom_Movement_PlayerEnter + showobjectat LOCALID_PLAYER, MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM + applymovement LOCALID_PLAYER, VerdanturfTown_BattleTentBattleRoom_Movement_PlayerEnter waitmovement 0 frontier_get FRONTIER_DATA_BATTLE_NUM compare VAR_RESULT, 0 goto_if_ne VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge VerdanturfTown_BattleTentBattleRoom_EventScript_NextOpponentEnter:: @ 820236F tower_setopponent - addobject 2 - applymovement 2, VerdanturfTown_BattleTentBattleRoom_Movement_OpponentEnter + addobject LOCALID_OPPONENT + applymovement LOCALID_OPPONENT, VerdanturfTown_BattleTentBattleRoom_Movement_OpponentEnter waitmovement 0 battletent_getopponentintro msgbox gStringVar4, MSGBOX_DEFAULT @@ -64,11 +68,11 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_DefeatedOpponent:: @ 82023C8 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT switch VAR_RESULT case 3, VerdanturfTown_BattleTentBattleRoom_EventScript_WarpToLobbyWon - applymovement 2, VerdanturfTown_BattleTentBattleRoom_Movement_OpponentExit + applymovement LOCALID_OPPONENT, VerdanturfTown_BattleTentBattleRoom_Movement_OpponentExit waitmovement 0 - removeobject 2 - applymovement 3, Common_Movement_WalkInPlaceFastestDown - applymovement 1, Common_Movement_WalkInPlaceFastestUp + removeobject LOCALID_OPPONENT + applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFastestDown + applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFastestUp waitmovement 0 msgbox BattleFrontier_BattlePalaceBattleRoom_Text_LetMeRestoreYourMons, MSGBOX_DEFAULT special LoadPlayerParty @@ -107,8 +111,8 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_AskRetireChallenge:: @ 82024B8 case MULTI_B_PRESSED, VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge VerdanturfTown_BattleTentBattleRoom_EventScript_ContinueChallenge:: @ 82024EA - applymovement 3, Common_Movement_WalkInPlaceFastestRight - applymovement 1, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFastestRight + applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFastestRight waitmovement 0 closemessage goto VerdanturfTown_BattleTentBattleRoom_EventScript_NextOpponentEnter @@ -134,11 +138,11 @@ VerdanturfTown_BattleTentBattleRoom_OnWarp: @ 8202541 .2byte 0 VerdanturfTown_BattleTentBattleRoom_EventScript_SetUpObjects:: @ 820254B - hideobjectat 1, MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM + hideobjectat LOCALID_PLAYER, MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM call VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfx setvar VAR_TEMP_1, 1 applymovement OBJ_EVENT_ID_PLAYER, VerdanturfTown_BattleTentBattleRoom_Movement_SetInvisible - removeobject 2 + removeobject LOCALID_OPPONENT end VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent:: @ 8202565 diff --git a/data/maps/VerdanturfTown_BattleTentCorridor/scripts.inc b/data/maps/VerdanturfTown_BattleTentCorridor/scripts.inc index b1dedf1a1..24d047a2a 100644 --- a/data/maps/VerdanturfTown_BattleTentCorridor/scripts.inc +++ b/data/maps/VerdanturfTown_BattleTentCorridor/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + VerdanturfTown_BattleTentCorridor_MapScripts:: @ 820208A map_script MAP_SCRIPT_ON_FRAME_TABLE, VerdanturfTown_BattleTentCorridor_OnFrame .byte 0 @@ -9,12 +11,12 @@ VerdanturfTown_BattleTentCorridor_OnFrame: @ 8202090 VerdanturfTown_BattleTentCorridor_EventScript_EnterCorridor:: @ 820209A lockall setvar VAR_TEMP_0, 1 - applymovement 1, VerdanturfTown_BattleTentCorridor_Movement_WalkToDoor + applymovement LOCALID_ATTENDANT, VerdanturfTown_BattleTentCorridor_Movement_WalkToDoor applymovement OBJ_EVENT_ID_PLAYER, VerdanturfTown_BattleTentCorridor_Movement_WalkToDoor waitmovement 0 opendoor 2, 1 waitdooranim - applymovement 1, VerdanturfTown_BattleTentCorridor_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT, VerdanturfTown_BattleTentCorridor_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, VerdanturfTown_BattleTentCorridor_Movement_PlayerEnterDoor waitmovement 0 closedoor 2, 1 diff --git a/data/maps/VerdanturfTown_BattleTentLobby/scripts.inc b/data/maps/VerdanturfTown_BattleTentLobby/scripts.inc index 4685f0571..7a3aa605c 100644 --- a/data/maps/VerdanturfTown_BattleTentLobby/scripts.inc +++ b/data/maps/VerdanturfTown_BattleTentLobby/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_ATTENDANT, 1 + VerdanturfTown_BattleTentLobby_MapScripts:: @ 82016D0 map_script MAP_SCRIPT_ON_FRAME_TABLE, VerdanturfTown_BattleTentLobby_OnFrame map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, VerdanturfTown_BattleTentLobby_OnWarp @@ -195,12 +197,12 @@ VerdanturfTown_BattleTentLobby_EventScript_EndCancelChallenge:: @ 8201A3F end VerdanturfTown_BattleTentLobby_EventScript_WalkToDoor:: @ 8201A41 - applymovement 1, VerdanturfTown_BattleTentLobby_Movement_WalkToDoor + applymovement LOCALID_ATTENDANT, VerdanturfTown_BattleTentLobby_Movement_WalkToDoor applymovement OBJ_EVENT_ID_PLAYER, VerdanturfTown_BattleTentLobby_Movement_WalkToDoor waitmovement 0 opendoor 6, 1 waitdooranim - applymovement 1, VerdanturfTown_BattleTentLobby_Movement_AttendantEnterDoor + applymovement LOCALID_ATTENDANT, VerdanturfTown_BattleTentLobby_Movement_AttendantEnterDoor applymovement OBJ_EVENT_ID_PLAYER, VerdanturfTown_BattleTentLobby_Movement_PlayerEnterDoor waitmovement 0 closedoor 6, 1 diff --git a/data/maps/VerdanturfTown_PokemonCenter_1F/scripts.inc b/data/maps/VerdanturfTown_PokemonCenter_1F/scripts.inc index 040e69a16..f59d40456 100644 --- a/data/maps/VerdanturfTown_PokemonCenter_1F/scripts.inc +++ b/data/maps/VerdanturfTown_PokemonCenter_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_NURSE, 1 + VerdanturfTown_PokemonCenter_1F_MapScripts:: @ 8202726 map_script MAP_SCRIPT_ON_TRANSITION, VerdanturfTown_PokemonCenter_1F_OnTransition map_script MAP_SCRIPT_ON_RESUME, CableClub_OnResume @@ -8,9 +10,8 @@ VerdanturfTown_PokemonCenter_1F_OnTransition: @ 8202731 call Common_EventScript_UpdateBrineyLocation end -@ VAR_0x800B is the Nurse's object event id VerdanturfTown_PokemonCenter_1F_EventScript_Nurse:: @ 820273A - setvar VAR_0x800B, 1 + setvar VAR_0x800B, LOCALID_NURSE call Common_EventScript_PkmnCenterNurse waitmessage waitbuttonpress diff --git a/data/maps/VictoryRoad_1F/scripts.inc b/data/maps/VictoryRoad_1F/scripts.inc index cfd443aec..f7668d4a5 100644 --- a/data/maps/VictoryRoad_1F/scripts.inc +++ b/data/maps/VictoryRoad_1F/scripts.inc @@ -1,3 +1,5 @@ +.set LOCALID_WALLY_ENTRANCE, 4 + VictoryRoad_1F_MapScripts:: @ 8235D7A map_script MAP_SCRIPT_ON_TRANSITION, VictoryRoad_1F_OnTransition .byte 0 @@ -10,20 +12,20 @@ VictoryRoad_1F_OnTransition: @ 8235D80 end VictoryRoad_1F_EventScript_SetEntranceWallyPos1:: @ 8235D97 - setobjectxyperm 4, 2, 24 - setobjectmovementtype 4, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_WALLY_ENTRANCE, 2, 24 + setobjectmovementtype LOCALID_WALLY_ENTRANCE, MOVEMENT_TYPE_FACE_DOWN return VictoryRoad_1F_EventScript_SetEntranceWallyPos2:: @ 8235DA3 - setobjectxyperm 4, 3, 24 - setobjectmovementtype 4, MOVEMENT_TYPE_FACE_DOWN + setobjectxyperm LOCALID_WALLY_ENTRANCE, 3, 24 + setobjectmovementtype LOCALID_WALLY_ENTRANCE, MOVEMENT_TYPE_FACE_DOWN return VictoryRoad_1F_EventScript_WallyBattleTrigger1:: @ 8235DAF lockall setvar VAR_0x8008, 1 - addobject 4 - applymovement 4, VictoryRoad_1F_Movement_WallyApproachPlayer1 + addobject LOCALID_WALLY_ENTRANCE + applymovement LOCALID_WALLY_ENTRANCE, VictoryRoad_1F_Movement_WallyApproachPlayer1 waitmovement 0 goto VictoryRoad_1F_EventScript_WallyEntranceBattle end @@ -31,8 +33,8 @@ VictoryRoad_1F_EventScript_WallyBattleTrigger1:: @ 8235DAF VictoryRoad_1F_EventScript_WallyBattleTrigger2:: @ 8235DC8 lockall setvar VAR_0x8008, 2 - addobject 4 - applymovement 4, VictoryRoad_1F_Movement_WallyApproachPlayer2 + addobject LOCALID_WALLY_ENTRANCE + applymovement LOCALID_WALLY_ENTRANCE, VictoryRoad_1F_Movement_WallyApproachPlayer2 waitmovement 0 goto VictoryRoad_1F_EventScript_WallyEntranceBattle end @@ -44,7 +46,7 @@ VictoryRoad_1F_EventScript_WallyEntranceBattle:: @ 8235DE1 trainerbattle_no_intro TRAINER_WALLY_VR_1, VictoryRoad_1F_Text_WallyEntranceDefeat msgbox VictoryRoad_1F_Text_WallyPostEntranceBattle, MSGBOX_DEFAULT clearflag FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY - copyobjectxytoperm 4 + copyobjectxytoperm LOCALID_WALLY_ENTRANCE setflag FLAG_DEFEATED_WALLY_VICTORY_ROAD copyvar VAR_VICTORY_ROAD_1F_STATE, VAR_0x8008 releaseall diff --git a/data/scripts/apprentice.inc b/data/scripts/apprentice.inc index b3ae904a0..f5fa3aeeb 100644 --- a/data/scripts/apprentice.inc +++ b/data/scripts/apprentice.inc @@ -1,3 +1,5 @@ +.set LOCALID_APPRENTICE, 6 + BattleFrontier_BattleTowerLobby_EventScript_Apprentice:: @ 82B688D lock faceplayer @@ -225,7 +227,7 @@ Apprentice_EventScript_LeaveNorth: @ 82B6E54 apprentice_shouldleave compare VAR_0x8004, FALSE @ Always TRUE here goto_if_eq Apprentice_EventScript_DontMove - applymovement 6, Apprentice_Movement_LeaveNorth + applymovement LOCALID_APPRENTICE, Apprentice_Movement_LeaveNorth waitmovement 0 end @@ -233,7 +235,7 @@ Apprentice_EventScript_Leave: @ 82B6E72 apprentice_shouldleave compare VAR_0x8004, FALSE @ Always TRUE here goto_if_eq Apprentice_EventScript_DontMove - applymovement 6, Apprentice_Movement_Leave + applymovement LOCALID_APPRENTICE, Apprentice_Movement_Leave waitmovement 0 end diff --git a/data/scripts/battle_pike.inc b/data/scripts/battle_pike.inc index 83cc6ec61..67eb19011 100644 --- a/data/scripts/battle_pike.inc +++ b/data/scripts/battle_pike.inc @@ -1,3 +1,4 @@ +@ Note: LOCALIDs shared with BattleFrontier_BattlePikeRoomNormal BattleFrontier_BattlePikeRoomNormal_MapScripts_2C3E1B: @ 82C3E1B map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattlePikeRoom_OnTransition map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleFrontier_BattlePikeRoom_OnWarp @@ -17,28 +18,28 @@ BattleFrontier_BattlePikeRoom_OnTransition: @ 82C3E25 end BattleFrontier_BattlePikeRoomNormal_EventScript_SetDoubleBattleObjPos:: @ 82C3E93 - setobjectxyperm 1, 2, 5 - setobjectxyperm 2, 6, 5 + setobjectxyperm LOCALID_OBJ_0, 2, 5 + setobjectxyperm LOCALID_OBJ_1, 6, 5 end BattleFrontier_BattlePikeRoomNormal_EventScript_SetTwoObjectRoomPos:: @ 82C3EA2 - setobjectxyperm 1, 4, 4 - setobjectxyperm 2, 3, 4 + setobjectxyperm LOCALID_OBJ_0, 4, 4 + setobjectxyperm LOCALID_OBJ_1, 3, 4 end BattleFrontier_BattlePikeRoomNormal_EventScript_SetOneObjectRoomPos:: @ 82C3EB1 - setobjectxyperm 1, 4, 4 - setobjectxyperm 2, 0, 0 + setobjectxyperm LOCALID_OBJ_0, 4, 4 + setobjectxyperm LOCALID_OBJ_1, 0, 0 end BattleFrontier_BattlePikeRoomNormal_EventScript_SetNPCRoomObjPos:: @ 82C3EC0 - setobjectxyperm 1, 5, 5 - setobjectxyperm 2, 0, 0 + setobjectxyperm LOCALID_OBJ_0, 5, 5 + setobjectxyperm LOCALID_OBJ_1, 0, 0 end BattleFrontier_BattlePikeRoomNormal_EventScript_SetBrainRoomObjPos:: @ 82C3ECF - setobjectxyperm 1, 4, 3 - setobjectxyperm 2, 4, 4 + setobjectxyperm LOCALID_OBJ_0, 4, 3 + setobjectxyperm LOCALID_OBJ_1, 4, 4 end BattleFrontier_BattlePikeRoom_OnWarp: @ 82C3EDE @@ -57,7 +58,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_InitRoomObjects:: @ 82C3EE8 goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_InitTwoObjectRoom compare VAR_RESULT, PIKE_ROOM_BRAIN goto_if_eq BattleFrontier_BattlePikeRoomNormal_EventScript_InitBrainRoomObjects - hideobjectat 2, MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL + hideobjectat LOCALID_OBJ_1, MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL setvar VAR_TEMP_4, 1 turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH end @@ -70,7 +71,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_InitTwoObjectRoom:: @ 82C3F35 BattleFrontier_BattlePikeRoomNormal_EventScript_InitBrainRoomObjects:: @ 82C3F3F setvar VAR_TEMP_4, 1 turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH - hideobjectat 1, MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL @ Pike Queen hidden initially + hideobjectat LOCALID_OBJ_0, MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL @ Pike Queen hidden initially end BattleFrontier_BattlePikeThreePathRoom_EventScript_LeftRoomWarp:: @ 82C3F4E diff --git a/data/scripts/berry_blender.inc b/data/scripts/berry_blender.inc index 28c3d6de7..d98add74d 100644 --- a/data/scripts/berry_blender.inc +++ b/data/scripts/berry_blender.inc @@ -1,3 +1,11 @@ +@ Note: local IDs shared with scripts.inc for LilycoveCity_ContestLobby +.set LOCALID_MAN, 3 +.set LOCALID_BOY, 9 +.set LOCALID_TWIN, 10 +.set LOCALID_POKEFAN_F, 15 +.set LOCALID_EXPERT_M, 16 +.set LOCALID_GIRL, 17 + BerryBlender_Text_WantToMakePokeblocks: @ 8292DEE .string "Oh? Did you want to make some {POKEBLOCK}S\n" .string "with this old-timer?$" @@ -236,7 +244,7 @@ BerryBlender_EventScript_BerryBlender1:: @ 8293C3E lockall goto_if_unset FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER, BerryBlender_EventScript_BlendMasterPresent setvar VAR_0x8009, 1 - applymovement 16, BerryBlender_Movement_BlendLeaderWalkInPlace + applymovement LOCALID_EXPERT_M, BerryBlender_Movement_BlendLeaderWalkInPlace waitmovement 0 msgbox BerryBlender_Text_WantToMakePokeblocks, MSGBOX_YESNO compare VAR_RESULT, YES @@ -321,8 +329,8 @@ BerryBlender_EventScript_Blender1NoCase: @ 8293D43 BerryBlender_EventScript_BerryBlender2:: @ 8293D4D lockall setvar VAR_0x8009, 2 - applymovement 10, Common_Movement_FaceOriginalDirection - applymovement 3, BerryBlender_Movement_BlendLeaderWalkInPlace + applymovement LOCALID_TWIN, Common_Movement_FaceOriginalDirection + applymovement LOCALID_MAN, BerryBlender_Movement_BlendLeaderWalkInPlace waitmovement 0 msgbox BerryBlender_Text_WantToBlendPokeblocksWithUs, MSGBOX_YESNO compare VAR_RESULT, YES @@ -384,10 +392,10 @@ BerryBlender_EventScript_Blender2NoCase: @ 8293E14 BerryBlender_EventScript_BerryBlender3:: @ 8293E1E lockall - setvar VAR_0x8008, 15 + setvar VAR_0x8008, LOCALID_POKEFAN_F setvar VAR_0x8009, 3 - applymovement 9, Common_Movement_FaceOriginalDirection - applymovement 17, Common_Movement_FaceOriginalDirection + applymovement LOCALID_BOY, Common_Movement_FaceOriginalDirection + applymovement LOCALID_GIRL, Common_Movement_FaceOriginalDirection applymovement VAR_0x8008, BerryBlender_Movement_BlendLeaderWalkInPlace waitmovement 0 msgbox BerryBlender_Text_LookGoodAtBlendingJoinUs, MSGBOX_YESNO @@ -630,9 +638,9 @@ BerryBlender_EventScript_FourPlayerLink: @ 8294139 BerryBlender_EventScript_DoLinkBerryBlending: @ 8294147 setvar VAR_0x8004, 0 fadescreen FADE_TO_BLACK - removeobject 240 - removeobject 239 - removeobject 238 + removeobject 240 @ Unclear where these local IDs come from, + removeobject 239 @ but presumably they'd be the 4 link players + removeobject 238 removeobject 237 special DoBerryBlending waitstate diff --git a/data/scripts/contest_hall.inc b/data/scripts/contest_hall.inc index 48fd2e293..c21488502 100644 --- a/data/scripts/contest_hall.inc +++ b/data/scripts/contest_hall.inc @@ -1,3 +1,19 @@ +.set LOCALID_MC, 1 +.set LOCALID_JUDGE, 2 +.set LOCALID_CONTESTANT_1, 3 +.set LOCALID_CONTESTANT_2, 4 +.set LOCALID_CONTESTANT_3, 5 +.set LOCALID_AUDIENCE_1, 6 +.set LOCALID_AUDIENCE_3, 7 +.set LOCALID_AUDIENCE_4, 8 +.set LOCALID_AUDIENCE_5, 9 +.set LOCALID_AUDIENCE_6, 10 +.set LOCALID_AUDIENCE_7, 11 +.set LOCALID_AUDIENCE_2, 12 +.set LOCALID_POKEBALL, 13 +.set LOCALID_CONTESTANT_4, 14 +.set LOCALID_ARTIST, 15 + @ Either ends or returns to EventScript_ContestReceptionist after submitting a contest entry LilycoveCity_ContestLobby_EventScript_SpeakToContestReceptionist:: @ 8279CC5 lock @@ -193,9 +209,9 @@ ContestHall_EventScript_DoContest:: @ 8279F97 special LinkContestTryShowWirelessIndicator setvar VAR_0x8006, 0 lockall - applymovement 14, ContestHall_Movement_Player4FaceUp + applymovement LOCALID_CONTESTANT_4, ContestHall_Movement_Player4FaceUp waitmovement 0 - applymovement 1, ContestHall_Movement_MCWalkDown + applymovement LOCALID_MC, ContestHall_Movement_MCWalkDown waitmovement 0 releaseall call ContestHall_EventScript_TryWaitForLink @@ -271,7 +287,7 @@ ContestHall_EventScript_ContestGettingStarted:: @ 827A097 bufferstdstring 2, VAR_0x8009 call ContestHall_EventScript_GettingStarted lockall - applymovement 1, ContestHall_Movement_MCBackUp + applymovement LOCALID_MC, ContestHall_Movement_MCBackUp waitmovement 0 releaseall return @@ -341,37 +357,37 @@ ContestHall_EventScript_ContestantWalkToCenter:: @ 827A149 ContestHall_EventScript_Player1WalkToCenter:: @ 827A176 call ContestHall_EventScript_TryWaitForLink lockall - applymovement 3, ContestHall_Movement_Player1WalkToCenter + applymovement LOCALID_CONTESTANT_1, ContestHall_Movement_Player1WalkToCenter waitmovement 0 releaseall - setvar VAR_0x800B, 3 + setvar VAR_0x800B, LOCALID_CONTESTANT_1 return ContestHall_EventScript_Player2WalkToCenter:: @ 827A18D call ContestHall_EventScript_TryWaitForLink lockall - applymovement 4, ContestHall_Movement_Player2WalkToCenter + applymovement LOCALID_CONTESTANT_2, ContestHall_Movement_Player2WalkToCenter waitmovement 0 releaseall - setvar VAR_0x800B, 4 + setvar VAR_0x800B, LOCALID_CONTESTANT_2 return ContestHall_EventScript_Player3WalkToCenter:: @ 827A1A4 call ContestHall_EventScript_TryWaitForLink lockall - applymovement 5, ContestHall_Movement_Player3WalkToCenter + applymovement LOCALID_CONTESTANT_3, ContestHall_Movement_Player3WalkToCenter waitmovement 0 releaseall - setvar VAR_0x800B, 5 + setvar VAR_0x800B, LOCALID_CONTESTANT_3 return ContestHall_EventScript_Player4WalkToCenter:: @ 827A1BB call ContestHall_EventScript_TryWaitForLink lockall - applymovement 14, ContestHall_Movement_Player4WalkToCenter + applymovement LOCALID_CONTESTANT_4, ContestHall_Movement_Player4WalkToCenter waitmovement 0 releaseall - setvar VAR_0x800B, 14 + setvar VAR_0x800B, LOCALID_CONTESTANT_4 return ContestHall_EventScript_ShowContestMonPic:: @ 827A1D2 @@ -384,7 +400,7 @@ ContestHall_EventScript_ShowContestMonPic:: @ 827A1D2 releaseall call ContestHall_EventScript_TryWaitForLink call ContestHall_EventScript_CheckIfContestWithRSPlayer - addobject 13 @ Place Poke Ball down + addobject LOCALID_POKEBALL playse SE_DANSA lockall applymovement VAR_0x800B, ContestHall_Movement_ContestantDelay32 @@ -414,13 +430,13 @@ ContestHall_EventScript_AudienceVote:: @ 827A230 playse SE_W227B waitmessage call ContestHall_EventScript_AudienceLookAround - applymovement 1, ContestHall_Movement_MCFaceJudge2 + applymovement LOCALID_MC, ContestHall_Movement_MCFaceJudge2 waitmovement 0 - applymovement 2, ContestHall_Movement_JudgeFaceMC + applymovement LOCALID_JUDGE, ContestHall_Movement_JudgeFaceMC waitmovement 0 delay 20 - applymovement 1, ContestHall_Movement_FaceContestants - applymovement 2, ContestHall_Movement_FaceContestants + applymovement LOCALID_MC, ContestHall_Movement_FaceContestants + applymovement LOCALID_JUDGE, ContestHall_Movement_FaceContestants waitmovement 0 return @@ -463,25 +479,25 @@ ContestHall_EventScript_VotingUnderWayLink:: @ 827A2CA ContestHall_EventScript_AudienceReactToContestant:: @ 827A2D5 call ContestHall_EventScript_TryWaitForLink - applymovement 1, ContestHall_Movement_AudienceMemberLookLeft + applymovement LOCALID_MC, ContestHall_Movement_AudienceMemberLookLeft waitmovement 0 playse SE_W227B call ContestHall_EventScript_VObjectAudienceLookAround - applymovement 9, ContestHall_Movement_AudienceMemberLookRight - applymovement 12, ContestHall_Movement_AudienceMemberLookDown - applymovement 7, ContestHall_Movement_AudienceMemberLookRight + applymovement LOCALID_AUDIENCE_5, ContestHall_Movement_AudienceMemberLookRight + applymovement LOCALID_AUDIENCE_2, ContestHall_Movement_AudienceMemberLookDown + applymovement LOCALID_AUDIENCE_3, ContestHall_Movement_AudienceMemberLookRight waitmovement 0 - applymovement 1, ContestHall_Movement_AudienceMemberLookRight + applymovement LOCALID_MC, ContestHall_Movement_AudienceMemberLookRight waitmovement 0 - applymovement 10, ContestHall_Movement_AudienceMemberLookLeft - applymovement 11, ContestHall_Movement_AudienceMemberLookDown - applymovement 6, ContestHall_Movement_AudienceMemberLookUp - applymovement 8, ContestHall_Movement_AudienceMemberLookLeft + applymovement LOCALID_AUDIENCE_6, ContestHall_Movement_AudienceMemberLookLeft + applymovement LOCALID_AUDIENCE_7, ContestHall_Movement_AudienceMemberLookDown + applymovement LOCALID_AUDIENCE_1, ContestHall_Movement_AudienceMemberLookUp + applymovement LOCALID_AUDIENCE_4, ContestHall_Movement_AudienceMemberLookLeft waitmovement 0 - applymovement 1, ContestHall_Movement_MCLookAtJudge + applymovement LOCALID_MC, ContestHall_Movement_MCLookAtJudge waitmovement 0 - applymovement 1, ContestHall_Movement_MCWalkInPlaceDown - applymovement 2, ContestHall_Movement_JudgeLookAtMC + applymovement LOCALID_MC, ContestHall_Movement_MCWalkInPlaceDown + applymovement LOCALID_JUDGE, ContestHall_Movement_JudgeLookAtMC waitmovement 0 releaseall call ContestHall_EventScript_TryWaitForLink @@ -683,7 +699,7 @@ ContestHall_EventScript_Set8Hearts:: @ 827A654 ContestHall_EventScript_TryDisplayHeartAudienceMember1:: @ 827A65A compare VAR_TEMP_1, 1 goto_if_eq ContestHall_EventScript_AudienceMember1AlreadyEmoted - applymovement 6, ContestHall_Movement_Heart + applymovement LOCALID_AUDIENCE_1, ContestHall_Movement_Heart playse SE_PIN delay 14 setvar VAR_TEMP_1, 1 @@ -696,7 +712,7 @@ ContestHall_EventScript_AudienceMember1AlreadyEmoted:: @ 827A67D ContestHall_EventScript_TryDisplayHeartAudienceMember2:: @ 827A67E compare VAR_TEMP_2, 1 goto_if_eq ContestHall_EventScript_AudienceMember2AlreadyEmoted - applymovement 12, ContestHall_Movement_Heart + applymovement LOCALID_AUDIENCE_2, ContestHall_Movement_Heart playse SE_PIN delay 14 setvar VAR_TEMP_2, 1 @@ -709,7 +725,7 @@ ContestHall_EventScript_AudienceMember2AlreadyEmoted:: @ 827A6A1 ContestHall_EventScript_TryDisplayHeartAudienceMember3:: @ 827A6A2 compare VAR_TEMP_3, 1 goto_if_eq ContestHall_EventScript_AudienceMember3AlreadyEmoted - applymovement 7, ContestHall_Movement_Heart + applymovement LOCALID_AUDIENCE_3, ContestHall_Movement_Heart playse SE_PIN delay 14 setvar VAR_TEMP_3, 1 @@ -722,7 +738,7 @@ ContestHall_EventScript_AudienceMember3AlreadyEmoted:: @ 827A6C5 ContestHall_EventScript_TryDisplayHeartAudienceMember4:: @ 827A6C6 compare VAR_TEMP_4, 1 goto_if_eq ContestHall_EventScript_Audience4MemberAlreadyEmoted - applymovement 8, ContestHall_Movement_Heart + applymovement LOCALID_AUDIENCE_4, ContestHall_Movement_Heart playse SE_PIN delay 14 setvar VAR_TEMP_4, 1 @@ -735,7 +751,7 @@ ContestHall_EventScript_Audience4MemberAlreadyEmoted:: @ 827A6E9 ContestHall_EventScript_TryDisplayHeartAudienceMember5:: @ 827A6EA compare VAR_TEMP_5, 1 goto_if_eq ContestHall_EventScript_AudienceMember5AlreadyEmoted - applymovement 9, ContestHall_Movement_Heart + applymovement LOCALID_AUDIENCE_5, ContestHall_Movement_Heart playse SE_PIN delay 14 setvar VAR_TEMP_5, 1 @@ -748,7 +764,7 @@ ContestHall_EventScript_AudienceMember5AlreadyEmoted:: @ 827A70D ContestHall_EventScript_TryDisplayHeartAudienceMember6:: @ 827A70E compare VAR_TEMP_6, 1 goto_if_eq ContestHall_EventScript_AudienceMember6AlreadyEmoted - applymovement 10, ContestHall_Movement_Heart + applymovement LOCALID_AUDIENCE_6, ContestHall_Movement_Heart playse SE_PIN delay 14 setvar VAR_TEMP_6, 1 @@ -761,7 +777,7 @@ ContestHall_EventScript_AudienceMember6AlreadyEmoted:: @ 827A731 ContestHall_EventScript_TryDisplayHeartAudienceMember7:: @ 827A732 compare VAR_TEMP_7, 1 goto_if_eq ContestHall_EventScript_AudienceMember7AlreadyEmoted - applymovement 11, ContestHall_Movement_Heart + applymovement LOCALID_AUDIENCE_7, ContestHall_Movement_Heart playse SE_PIN delay 14 setvar VAR_TEMP_7, 1 @@ -774,7 +790,7 @@ ContestHall_EventScript_AudienceMember7AlreadyEmoted:: @ 827A755 ContestHall_EventScript_TryDisplayHeartAudienceMember8:: @ 827A756 compare VAR_TEMP_8, 1 goto_if_eq ContestHall_EventScript_AudienceMember8AlreadyEmoted - applymovement 15, ContestHall_Movement_Heart + applymovement LOCALID_ARTIST, ContestHall_Movement_Heart playse SE_PIN delay 14 setvar VAR_TEMP_8, 1 @@ -787,7 +803,7 @@ ContestHall_EventScript_AudienceMember8AlreadyEmoted:: @ 827A779 ContestHall_EventScript_ContestantReturn:: @ 827A77A closemessage release - removeobject 13 @ Poke Ball + removeobject LOCALID_POKEBALL special HideContestEntryMonPic call ContestHall_EventScript_TryWaitForLink switch VAR_0x8006 @@ -831,13 +847,13 @@ ContestHall_EventScript_Player4WalkBack:: @ 827A7EF ContestHall_EventScript_DoContestAppeals:: @ 827A801 lockall - applymovement 1, ContestHall_Movement_FaceContestants2 + applymovement LOCALID_MC, ContestHall_Movement_FaceContestants2 waitmovement 0 call ContestHall_EventScript_TryWaitForLink call ContestHall_EventScript_LetsAppeal waitmessage - applymovement 1, ContestHall_Movement_WalkStageLeft - applymovement 2, ContestHall_Movement_WalkStageRight + applymovement LOCALID_MC, ContestHall_Movement_WalkStageLeft + applymovement LOCALID_JUDGE, ContestHall_Movement_WalkStageRight waitmovement 0 releaseall call ContestHall_EventScript_TryWaitForLink @@ -847,8 +863,8 @@ ContestHall_EventScript_DoContestAppeals:: @ 827A801 special LinkContestTryShowWirelessIndicator setvar VAR_TEMP_9, 0 lockall - applymovement 1, ContestHall_Movement_WalkStageRight - applymovement 2, ContestHall_Movement_WalkStageLeft + applymovement LOCALID_MC, ContestHall_Movement_WalkStageRight + applymovement LOCALID_JUDGE, ContestHall_Movement_WalkStageLeft waitmovement 0 releaseall return @@ -886,13 +902,13 @@ ContestHall_EventScript_ContestResults:: @ 827A8A5 call ContestHall_EventScript_TryWaitForLink call ContestHall_EventScript_ThankYouForAppeals call ContestHall_EventScript_TryWaitForLink - applymovement 1, ContestHall_Movement_MCFaceJudge + applymovement LOCALID_MC, ContestHall_Movement_MCFaceJudge waitmovement 0 call ContestHall_EventScript_JudgeLooksReady call ContestHall_EventScript_TryWaitForLink call ContestHall_EventScript_WeWillDeclareWinner call ContestHall_EventScript_TryWaitForLink - applymovement 1, ContestHall_Movement_FaceContestants + applymovement LOCALID_MC, ContestHall_Movement_FaceContestants waitmovement 0 closemessage releaseall @@ -965,19 +981,19 @@ ContestHall_EventScript_GetWinnerObjEventId:: @ 827A987 return ContestHall_EventScript_GetPlayer1ObjEventId:: @ 827A9BC - setvar VAR_TEMP_3, 3 + setvar VAR_TEMP_3, LOCALID_CONTESTANT_1 return ContestHall_EventScript_GetPlayer2ObjEventId:: @ 827A9C2 - setvar VAR_TEMP_3, 4 + setvar VAR_TEMP_3, LOCALID_CONTESTANT_2 return ContestHall_EventScript_GetPlayer3ObjEventId:: @ 827A9C8 - setvar VAR_TEMP_3, 5 + setvar VAR_TEMP_3, LOCALID_CONTESTANT_3 return ContestHall_EventScript_GetPlayer4ObjEventId:: @ 827A9CE - setvar VAR_TEMP_3, 14 + setvar VAR_TEMP_3, LOCALID_CONTESTANT_4 return ContestHall_EventScript_CongratulateWinner:: @ 827A9D4 @@ -1009,14 +1025,14 @@ ContestHall_EventScript_AudienceLookAround:: @ 827AA1B lockall compare VAR_CONTEST_TYPE, CONTEST_TYPE_NPC_NORMAL call_if_gt ContestHall_EventScript_VObjectAudienceLookAround - applymovement 9, ContestHall_Movement_AudienceMemberLookRight - applymovement 12, ContestHall_Movement_AudienceMemberLookDown - applymovement 7, ContestHall_Movement_AudienceMemberLookRight + applymovement LOCALID_AUDIENCE_5, ContestHall_Movement_AudienceMemberLookRight + applymovement LOCALID_AUDIENCE_2, ContestHall_Movement_AudienceMemberLookDown + applymovement LOCALID_AUDIENCE_3, ContestHall_Movement_AudienceMemberLookRight delay 30 - applymovement 10, ContestHall_Movement_AudienceMemberLookLeft - applymovement 11, ContestHall_Movement_AudienceMemberLookDown - applymovement 6, ContestHall_Movement_AudienceMemberLookUp - applymovement 8, ContestHall_Movement_AudienceMemberLookLeft + applymovement LOCALID_AUDIENCE_6, ContestHall_Movement_AudienceMemberLookLeft + applymovement LOCALID_AUDIENCE_7, ContestHall_Movement_AudienceMemberLookDown + applymovement LOCALID_AUDIENCE_1, ContestHall_Movement_AudienceMemberLookUp + applymovement LOCALID_AUDIENCE_4, ContestHall_Movement_AudienceMemberLookLeft compare VAR_TEMP_1, 4 goto_if_ne ContestHall_EventScript_AudienceLookAround delay 30 diff --git a/data/scripts/day_care.inc b/data/scripts/day_care.inc index 6506897ee..87995581f 100644 --- a/data/scripts/day_care.inc +++ b/data/scripts/day_care.inc @@ -1,3 +1,5 @@ +.set LOCALID_DAYCARE_LADY, 1 + Route117_EventScript_DaycareMan:: @ 8291C18 lock faceplayer @@ -211,7 +213,7 @@ Route117_PokemonDayCare_EventScript_CheckEnoughMoney:: @ 8291EC8 end Route117_PokemonDayCare_EventScript_RetrieveMon:: @ 8291EE2 - applymovement 1, Route117_PokemonDayCare_Movement_RetrieveDaycareMon + applymovement LOCALID_DAYCARE_LADY, Route117_PokemonDayCare_Movement_RetrieveDaycareMon waitmovement 0 specialvar VAR_RESULT, TakePokemonFromDaycare special SubtractMoneyFromVar0x8005 diff --git a/data/scripts/gabby_and_ty.inc b/data/scripts/gabby_and_ty.inc index dfe8780e7..84cd315f7 100644 --- a/data/scripts/gabby_and_ty.inc +++ b/data/scripts/gabby_and_ty.inc @@ -13,6 +13,7 @@ EventScript_UnusedRet:: @ 828CCC6 @ Gabby and Ty always move to the same spots for the first 5 battles @ From the 6th battle onwards, they move randomly between locations 6-8 +@ Note: The local IDs of Gabby and Ty are hard-coded in GabbyAndTySetScriptVarsToObjectEventLocalIds GabbyAndTy_EventScript_UpdateLocation:: @ 828CCC7 cleartrainerflag TRAINER_GABBY_AND_TY_6 specialvar VAR_RESULT, GabbyAndTyGetBattleNum diff --git a/data/scripts/lilycove_lady.inc b/data/scripts/lilycove_lady.inc index bdd670031..7f629e5db 100644 --- a/data/scripts/lilycove_lady.inc +++ b/data/scripts/lilycove_lady.inc @@ -1,3 +1,6 @@ +.set LOCALID_LILYCOVE_LADY, 4 +.set LOCALID_LADYS_MON, 5 + LilycoveCity_PokemonCenter_1F_EventScript_LilycoveLady:: @ 82A836B special Script_GetLilycoveLadyId switch VAR_RESULT @@ -444,10 +447,10 @@ LilycoveCity_PokemonCenter_1F_EventScript_GivePokeblock:: @ 82A88F6 @ VAR_0x8004 here is the return value from GivePokeblockToContestLady LilycoveCity_PokemonCenter_1F_EventScript_FeedPokeblock:: @ 82A890A - applymovement 4, LilycoveCity_PokemonCenter_1F_Movement_LadyFaceMon + applymovement LOCALID_LILYCOVE_LADY, LilycoveCity_PokemonCenter_1F_Movement_LadyFaceMon waitmovement 0 delay 60 - applymovement 5, LilycoveCity_PokemonCenter_1F_Movement_MonFaceLady + applymovement LOCALID_LADYS_MON, LilycoveCity_PokemonCenter_1F_Movement_MonFaceLady waitmovement 0 delay 60 waitse @@ -461,11 +464,11 @@ LilycoveCity_PokemonCenter_1F_EventScript_FeedPokeblock:: @ 82A890A @ VAR_0x8004 here is the return value from GivePokeblockToContestLady LilycoveCity_PokemonCenter_1F_EventScript_MonEnjoyPokeblock:: @ 82A893F - applymovement 5, LilycoveCity_PokemonCenter_1F_Movement_MonJump + applymovement LOCALID_LADYS_MON, LilycoveCity_PokemonCenter_1F_Movement_MonJump waitmovement 0 delay 60 LilycoveCity_PokemonCenter_1F_EventScript_FinishFeedPokeblock:: @ 82A894C - applymovement 4, LilycoveCity_PokemonCenter_1F_Movement_LadyFacePlayer + applymovement LOCALID_LILYCOVE_LADY, LilycoveCity_PokemonCenter_1F_Movement_LadyFacePlayer waitmovement 0 delay 60 compare VAR_0x8004, 0 diff --git a/data/scripts/new_game.inc b/data/scripts/new_game.inc index 74fff4aea..3c68dfa13 100644 --- a/data/scripts/new_game.inc +++ b/data/scripts/new_game.inc @@ -195,7 +195,7 @@ EventScript_ResetAllMapFlags:: @ 82715DE setflag FLAG_HIDE_MAUVILLE_CITY_SCOTT setflag FLAG_HIDE_CHAMPIONS_ROOM_RIVAL setflag FLAG_HIDE_CHAMPIONS_ROOM_BIRCH - setflag FLAG_HIDE_ROUTE_110_RIVAL_2 + setflag FLAG_HIDE_ROUTE_110_RIVAL_ON_BIKE setflag FLAG_HIDE_ROUTE_119_RIVAL_ON_BIKE setflag FLAG_HIDE_ROUTE_104_RIVAL setflag FLAG_HIDE_LILCOVE_MOTEL_GAME_DESIGNERS diff --git a/data/scripts/players_house.inc b/data/scripts/players_house.inc index b6ab10300..440f47a6a 100644 --- a/data/scripts/players_house.inc +++ b/data/scripts/players_house.inc @@ -1,3 +1,8 @@ +@ Local IDs are the same for both players houses +.set LOCALID_MOM, 1 +.set LOCALID_DAD, 5 +.set LOCALID_MOM_2F, 14 + PlayersHouse_2F_EventScript_BlockStairsUntilClockIsSet:: @ 82926FE setvar VAR_LITTLEROOT_INTRO_STATE, 5 return @@ -74,7 +79,7 @@ PlayersHouse_2F_EventScript_WallClock:: @ 8292799 end PlayersHouse_2F_EventScript_MomComesUpstairsMale:: @ 82927DF - setvar VAR_0x8008, 14 + setvar VAR_0x8008, LOCALID_MOM_2F addobject VAR_0x8008 applymovement VAR_0x8008, PlayersHouse_2F_Movement_MomEntersMale waitmovement 0 @@ -87,7 +92,7 @@ PlayersHouse_2F_EventScript_MomComesUpstairsMale:: @ 82927DF return PlayersHouse_2F_EventScript_MomComesUpstairsFemale:: @ 829280F - setvar VAR_0x8008, 14 + setvar VAR_0x8008, LOCALID_MOM_2F addobject VAR_0x8008 applymovement VAR_0x8008, PlayersHouse_2F_Movement_MomEntersFemale waitmovement 0 @@ -514,14 +519,14 @@ PlayersHouse_1F_EventScript_AirLatiBroadcast:: @ 8292C72 PlayersHouse_1F_EventScript_SetUpObjectEventVarsMale:: @ 8292C76 setvar VAR_0x8008, MALE - setvar VAR_0x8009, 5 @ Dad object event ID - setvar VAR_0x800A, 1 @ Mom object event ID + setvar VAR_0x8009, LOCALID_DAD + setvar VAR_0x800A, LOCALID_MOM return PlayersHouse_1F_EventScript_SetUpObjectEventVarsFemale:: @ 8292C86 setvar VAR_0x8008, FEMALE - setvar VAR_0x8009, 5 @ Dad object event ID - setvar VAR_0x800A, 1 @ Mom object event ID + setvar VAR_0x8009, LOCALID_DAD + setvar VAR_0x800A, LOCALID_MOM return PlayersHouse_1F_EventScript_DadApproachPlayerMale:: @ 8292C96 diff --git a/data/scripts/secret_base.inc b/data/scripts/secret_base.inc index b5c3251b5..0de890aa6 100644 --- a/data/scripts/secret_base.inc +++ b/data/scripts/secret_base.inc @@ -308,7 +308,7 @@ SecretBase_EventScript_PutAwayDecorationLoop:: @ 8275D39 compare VAR_0x8005, 0 goto_if_eq SecretBase_EventScript_PutAwayDecorationLoop removeobject VAR_0x8006 - setflag 0x8005 @ UB: GF likely meant setvar here; setflag 0x8005 is out of bounds + setflag VAR_0x8005 @ UB: GF likely meant setvar here; setflag 0x8005 is out of bounds goto SecretBase_EventScript_PutAwayDecorationLoop end diff --git a/graphics/battle_transitions/frontier_brain.bin b/graphics/battle_transitions/frontier_logo.bin Binary files differindex 968b6eaca..968b6eaca 100644 --- a/graphics/battle_transitions/frontier_brain.bin +++ b/graphics/battle_transitions/frontier_logo.bin diff --git a/graphics/battle_transitions/frontier_brain.png b/graphics/battle_transitions/frontier_logo.png Binary files differindex 25af2e3ab..25af2e3ab 100644 --- a/graphics/battle_transitions/frontier_brain.png +++ b/graphics/battle_transitions/frontier_logo.png diff --git a/graphics/battle_transitions/frontier_transition.bin b/graphics/battle_transitions/frontier_logo_center.bin Binary files differindex 7b9d2af28..7b9d2af28 100644 --- a/graphics/battle_transitions/frontier_transition.bin +++ b/graphics/battle_transitions/frontier_logo_center.bin diff --git a/graphics/battle_transitions/frontier_transition.png b/graphics/battle_transitions/frontier_logo_center.png Binary files differindex 05ea84f2c..05ea84f2c 100644 --- a/graphics/battle_transitions/frontier_transition.png +++ b/graphics/battle_transitions/frontier_logo_center.png diff --git a/graphics/battle_transitions/frontier_transition_circles.png b/graphics/battle_transitions/frontier_logo_circles.png Binary files differindex 50e44e40c..50e44e40c 100644 --- a/graphics/battle_transitions/frontier_transition_circles.png +++ b/graphics/battle_transitions/frontier_logo_circles.png diff --git a/graphics/misc/birch_ballarrow.png b/graphics/misc/pokeball_selection.png Binary files differindex d2f0a3d97..d2f0a3d97 100644 --- a/graphics/misc/birch_ballarrow.png +++ b/graphics/misc/pokeball_selection.png diff --git a/graphics/misc/birch_circle.png b/graphics/misc/starter_circle.png Binary files differindex 3501dfec4..3501dfec4 100644 --- a/graphics/misc/birch_circle.png +++ b/graphics/misc/starter_circle.png diff --git a/graphics_file_rules.mk b/graphics_file_rules.mk index d56dec32c..42fe82155 100644 --- a/graphics_file_rules.mk +++ b/graphics_file_rules.mk @@ -684,7 +684,7 @@ $(OBJEVENTGFXDIR)/pics/effects/unknown_4F6D38/0.4bpp: %.4bpp: %.png $(INTERFACEGFXDIR)/selector_outline.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 8 -$(BATTRANSGFXDIR)/frontier_transition.4bpp: %.4bpp: %.png +$(BATTRANSGFXDIR)/frontier_logo_center.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 43 diff --git a/include/battle.h b/include/battle.h index b377dc23c..7da040188 100644 --- a/include/battle.h +++ b/include/battle.h @@ -390,7 +390,7 @@ struct BattleStruct u8 expGetterBattlerId; u8 unused_5; u8 field_91; // related to gAbsentBattlerFlags, possibly absent flags turn ago? - u8 field_92; // battle palace related + u8 palaceFlags; // First 4 bits are "is < 50% HP and not asleep" for each battler, last 4 bits are selected moves to pass to AI u8 field_93; // related to choosing pokemon? u8 wallyBattleState; u8 wallyMovesState; diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index 142ac1f7b..ee3676463 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -1,6 +1,8 @@ #ifndef GUARD_BATTLE_SCRIPT_COMMANDS_H #define GUARD_BATTLE_SCRIPT_COMMANDS_H +#include "constants/pokemon.h" + #define WINDOW_CLEAR 0x1 #define WINDOW_x80 0x80 @@ -16,6 +18,6 @@ void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags); bool8 UproarWakeUpCheck(u8 battlerId); extern void (* const gBattleScriptingCommandsTable[])(void); -extern const u8 gUnknown_0831C494[][4]; +extern const u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4]; #endif // GUARD_BATTLE_SCRIPT_COMMANDS_H diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 75abaae3c..706d41097 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -205,7 +205,7 @@ extern const u8 BattleScript_BerryStatRaiseEnd2[]; extern const u8 BattleScript_BerryFocusEnergyEnd2[]; extern const u8 BattleScript_ActionSelectionItemsCantBeUsed[]; extern const u8 BattleScript_ArenaTurnBeginning[]; -extern const u8 BattleScript_82DB881[]; +extern const u8 BattleScript_PalacePrintFlavorText[]; extern const u8 BattleScript_ArenaDoJudgment[]; extern const u8 BattleScript_82DAA0B[]; extern const u8 BattleScript_AskIfWantsToForfeitMatch[]; diff --git a/include/battle_setup.h b/include/battle_setup.h index e88995778..7fa0457a8 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -28,7 +28,7 @@ void BattleSetup_StartLegendaryBattle(void); void StartGroudonKyogreBattle(void); void StartRegiBattle(void); u8 BattleSetup_GetTerrainId(void); -u8 sub_80B100C(s32 arg0); +u8 GetSpecialBattleTransition(s32 arg0); void ChooseStarter(void); void ResetTrainerOpponentIds(void); void SetMapVarsToTrainer(void); diff --git a/include/battle_transition.h b/include/battle_transition.h index b2e5efdc9..a33032fb4 100644 --- a/include/battle_transition.h +++ b/include/battle_transition.h @@ -24,49 +24,49 @@ enum // TRANSITION_MUGSHOT // credits for the names go to Dyskinesia, Tetrable and Farore // names are naturally subject to change -#define B_TRANSITION_BLUR 0 -#define B_TRANSITION_SWIRL 1 -#define B_TRANSITION_SHUFFLE 2 -#define B_TRANSITION_BIG_POKEBALL 3 -#define B_TRANSITION_POKEBALLS_TRAIL 4 -#define B_TRANSITION_CLOCKWISE_BLACKFADE 5 -#define B_TRANSITION_RIPPLE 6 -#define B_TRANSITION_WAVE 7 -#define B_TRANSITION_SLICE 8 -#define B_TRANSITION_WHITEFADE 9 -#define B_TRANSITION_GRID_SQUARES 10 -#define B_TRANSITION_SHARDS 11 -#define B_TRANSITION_SIDNEY 12 -#define B_TRANSITION_PHOEBE 13 -#define B_TRANSITION_GLACIA 14 -#define B_TRANSITION_DRAKE 15 -#define B_TRANSITION_CHAMPION 16 +#define B_TRANSITION_BLUR 0 +#define B_TRANSITION_SWIRL 1 +#define B_TRANSITION_SHUFFLE 2 +#define B_TRANSITION_BIG_POKEBALL 3 +#define B_TRANSITION_POKEBALLS_TRAIL 4 +#define B_TRANSITION_CLOCKWISE_BLACKFADE 5 +#define B_TRANSITION_RIPPLE 6 +#define B_TRANSITION_WAVE 7 +#define B_TRANSITION_SLICE 8 +#define B_TRANSITION_WHITEFADE 9 +#define B_TRANSITION_GRID_SQUARES 10 +#define B_TRANSITION_SHARDS 11 +#define B_TRANSITION_SIDNEY 12 +#define B_TRANSITION_PHOEBE 13 +#define B_TRANSITION_GLACIA 14 +#define B_TRANSITION_DRAKE 15 +#define B_TRANSITION_CHAMPION 16 // added in Emerald -#define B_TRANSITION_AQUA 17 -#define B_TRANSITION_MAGMA 18 -#define B_TRANSITION_REGICE 19 -#define B_TRANSITION_REGISTEEL 20 -#define B_TRANSITION_REGIROCK 21 -#define B_TRANSITION_KYOGRE 22 -#define B_TRANSITION_GROUDON 23 -#define B_TRANSITION_RAYQUAZA 24 -#define B_TRANSITION_SHRED_SPLIT 25 -#define B_TRANSITION_BLACKHOLE1 26 -#define B_TRANSITION_BLACKHOLE2 27 -#define B_TRANSITION_RECTANGULAR_SPIRAL 28 -#define B_TRANSITION_29 29 -#define B_TRANSITION_30 30 -#define B_TRANSITION_31 31 -#define B_TRANSITION_32 32 -#define B_TRANSITION_33 33 -#define B_TRANSITION_34 34 -#define B_TRANSITION_35 35 -#define B_TRANSITION_36 36 -#define B_TRANSITION_37 37 -#define B_TRANSITION_38 38 -#define B_TRANSITION_39 39 -#define B_TRANSITION_40 40 -#define B_TRANSITION_41 41 -#define B_TRANSITION_COUNT 42 +#define B_TRANSITION_AQUA 17 +#define B_TRANSITION_MAGMA 18 +#define B_TRANSITION_REGICE 19 +#define B_TRANSITION_REGISTEEL 20 +#define B_TRANSITION_REGIROCK 21 +#define B_TRANSITION_KYOGRE 22 +#define B_TRANSITION_GROUDON 23 +#define B_TRANSITION_RAYQUAZA 24 +#define B_TRANSITION_SHRED_SPLIT 25 +#define B_TRANSITION_BLACKHOLE1 26 +#define B_TRANSITION_BLACKHOLE2 27 +#define B_TRANSITION_RECTANGULAR_SPIRAL 28 +#define B_TRANSITION_FRONTIER_LOGO_WIGGLE 29 +#define B_TRANSITION_FRONTIER_LOGO_WAVE 30 +#define B_TRANSITION_FRONTIER_SQUARES 31 +#define B_TRANSITION_FRONTIER_SQUARES_SCROLL 32 +#define B_TRANSITION_FRONTIER_SQUARES_SPIRAL 33 +#define B_TRANSITION_FRONTIER_CIRCLES_MEET 34 +#define B_TRANSITION_FRONTIER_CIRCLES_CROSS 35 +#define B_TRANSITION_FRONTIER_CIRCLES_ASYMMETRIC_SPIRAL 36 +#define B_TRANSITION_FRONTIER_CIRCLES_SYMMETRIC_SPIRAL 37 +#define B_TRANSITION_FRONTIER_CIRCLES_MEET_IN_SEQ 38 +#define B_TRANSITION_FRONTIER_CIRCLES_CROSS_IN_SEQ 39 +#define B_TRANSITION_FRONTIER_CIRCLES_ASYMMETRIC_SPIRAL_IN_SEQ 40 +#define B_TRANSITION_FRONTIER_CIRCLES_SYMMETRIC_SPIRAL_IN_SEQ 41 +#define B_TRANSITION_COUNT 42 #endif // GUARD_BATTLE_TRANSITION_H diff --git a/include/battle_transition_frontier.h b/include/battle_transition_frontier.h new file mode 100644 index 000000000..8813fe81e --- /dev/null +++ b/include/battle_transition_frontier.h @@ -0,0 +1,13 @@ +#ifndef GUARD_BATTLE_TRANSITION_FRONTIER_H +#define GUARD_BATTLE_TRANSITION_FRONTIER_H + +void Phase2Task_FrontierCirclesMeet(u8 taskId); +void Phase2Task_FrontierCirclesCross(u8 taskId); +void Phase2Task_FrontierCirclesAsymmetricSpiral(u8 taskId); +void Phase2Task_FrontierCirclesSymmetricSpiral(u8 taskId); +void Phase2Task_FrontierCirclesMeetInSeq(u8 taskId); +void Phase2Task_FrontierCirclesCrossInSeq(u8 taskId); +void Phase2Task_FrontierCirclesAsymmetricSpiralInSeq(u8 taskId); +void Phase2Task_FrontierCirclesSymmetricSpiralInSeq(u8 taskId); + +#endif // GUARD_BATTLE_TRANSITION_FRONTIER_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 346d5d9ea..8b860e384 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -37,146 +37,156 @@ #define B_SIDE_PLAYER 0 #define B_SIDE_OPPONENT 1 -#define B_FLANK_LEFT 0 +#define B_FLANK_LEFT 0 #define B_FLANK_RIGHT 1 #define BIT_SIDE 1 #define BIT_FLANK 2 // Battle Type Flags -#define BATTLE_TYPE_DOUBLE 0x0001 -#define BATTLE_TYPE_LINK 0x0002 -#define BATTLE_TYPE_IS_MASTER 0x0004 // In not-link battles, it's always set. -#define BATTLE_TYPE_TRAINER 0x0008 -#define BATTLE_TYPE_FIRST_BATTLE 0x0010 -#define BATTLE_TYPE_20 0x0020 -#define BATTLE_TYPE_MULTI 0x0040 -#define BATTLE_TYPE_SAFARI 0x0080 -#define BATTLE_TYPE_BATTLE_TOWER 0x0100 -#define BATTLE_TYPE_WALLY_TUTORIAL 0x0200 -#define BATTLE_TYPE_ROAMER 0x0400 -#define BATTLE_TYPE_EREADER_TRAINER 0x0800 -#define BATTLE_TYPE_KYOGRE_GROUDON 0x1000 -#define BATTLE_TYPE_LEGENDARY 0x2000 -#define BATTLE_TYPE_REGI 0x4000 -#define BATTLE_TYPE_TWO_OPPONENTS 0x8000 -#define BATTLE_TYPE_DOME 0x10000 -#define BATTLE_TYPE_PALACE 0x20000 -#define BATTLE_TYPE_ARENA 0x40000 -#define BATTLE_TYPE_FACTORY 0x80000 -#define BATTLE_TYPE_PIKE 0x100000 -#define BATTLE_TYPE_PYRAMID 0x200000 -#define BATTLE_TYPE_INGAME_PARTNER 0x400000 -#define BATTLE_TYPE_x800000 0x800000 -#define BATTLE_TYPE_RECORDED 0x1000000 -#define BATTLE_TYPE_x2000000 0x2000000 -#define BATTLE_TYPE_TRAINER_HILL 0x4000000 -#define BATTLE_TYPE_SECRET_BASE 0x8000000 -#define BATTLE_TYPE_GROUDON 0x10000000 -#define BATTLE_TYPE_KYOGRE 0x20000000 -#define BATTLE_TYPE_RAYQUAZA 0x40000000 -#define BATTLE_TYPE_x80000000 0x80000000 +#define BATTLE_TYPE_DOUBLE (1 << 0) +#define BATTLE_TYPE_LINK (1 << 1) +#define BATTLE_TYPE_IS_MASTER (1 << 2) // In not-link battles, it's always set. +#define BATTLE_TYPE_TRAINER (1 << 3) +#define BATTLE_TYPE_FIRST_BATTLE (1 << 4) +#define BATTLE_TYPE_20 (1 << 5) +#define BATTLE_TYPE_MULTI (1 << 6) +#define BATTLE_TYPE_SAFARI (1 << 7) +#define BATTLE_TYPE_BATTLE_TOWER (1 << 8) +#define BATTLE_TYPE_WALLY_TUTORIAL (1 << 9) +#define BATTLE_TYPE_ROAMER (1 << 10) +#define BATTLE_TYPE_EREADER_TRAINER (1 << 11) +#define BATTLE_TYPE_KYOGRE_GROUDON (1 << 12) +#define BATTLE_TYPE_LEGENDARY (1 << 13) +#define BATTLE_TYPE_REGI (1 << 14) +#define BATTLE_TYPE_TWO_OPPONENTS (1 << 15) +#define BATTLE_TYPE_DOME (1 << 16) +#define BATTLE_TYPE_PALACE (1 << 17) +#define BATTLE_TYPE_ARENA (1 << 18) +#define BATTLE_TYPE_FACTORY (1 << 19) +#define BATTLE_TYPE_PIKE (1 << 20) +#define BATTLE_TYPE_PYRAMID (1 << 21) +#define BATTLE_TYPE_INGAME_PARTNER (1 << 22) +#define BATTLE_TYPE_x800000 (1 << 23) +#define BATTLE_TYPE_RECORDED (1 << 24) +#define BATTLE_TYPE_x2000000 (1 << 25) +#define BATTLE_TYPE_TRAINER_HILL (1 << 26) +#define BATTLE_TYPE_SECRET_BASE (1 << 27) +#define BATTLE_TYPE_GROUDON (1 << 28) +#define BATTLE_TYPE_KYOGRE (1 << 29) +#define BATTLE_TYPE_RAYQUAZA (1 << 30) +#define BATTLE_TYPE_x80000000 (1 << 31) #define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID) #define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE) // Battle Outcome defines -#define B_OUTCOME_WON 0x1 -#define B_OUTCOME_LOST 0x2 -#define B_OUTCOME_DREW 0x3 -#define B_OUTCOME_RAN 0x4 -#define B_OUTCOME_PLAYER_TELEPORTED 0x5 -#define B_OUTCOME_MON_FLED 0x6 -#define B_OUTCOME_CAUGHT 0x7 -#define B_OUTCOME_NO_SAFARI_BALLS 0x8 -#define B_OUTCOME_FORFEITED 0x9 -#define B_OUTCOME_MON_TELEPORTED 0xA -#define B_OUTCOME_LINK_BATTLE_RAN 0x80 +#define B_OUTCOME_WON 1 +#define B_OUTCOME_LOST 2 +#define B_OUTCOME_DREW 3 +#define B_OUTCOME_RAN 4 +#define B_OUTCOME_PLAYER_TELEPORTED 5 +#define B_OUTCOME_MON_FLED 6 +#define B_OUTCOME_CAUGHT 7 +#define B_OUTCOME_NO_SAFARI_BALLS 8 +#define B_OUTCOME_FORFEITED 9 +#define B_OUTCOME_MON_TELEPORTED 10 +#define B_OUTCOME_LINK_BATTLE_RAN (1 << 7) // 128 // Non-volatile status conditions // These persist remain outside of battle and after switching out -#define STATUS1_NONE 0x0 -#define STATUS1_SLEEP 0x7 -#define STATUS1_POISON 0x8 -#define STATUS1_BURN 0x10 -#define STATUS1_FREEZE 0x20 -#define STATUS1_PARALYSIS 0x40 -#define STATUS1_TOXIC_POISON 0x80 -#define STATUS1_TOXIC_COUNTER 0xF00 +#define STATUS1_NONE 0 +#define STATUS1_SLEEP (1 << 0 | 1 << 1 | 1 << 2) // First 3 bits (Number of turns to sleep) +#define STATUS1_SLEEP_TURN(num) ((num) << 0) // Just for readability (or if rearranging statuses) +#define STATUS1_POISON (1 << 3) +#define STATUS1_BURN (1 << 4) +#define STATUS1_FREEZE (1 << 5) +#define STATUS1_PARALYSIS (1 << 6) +#define STATUS1_TOXIC_POISON (1 << 7) +#define STATUS1_TOXIC_COUNTER (1 << 8 | 1 << 9 | 1 << 10 | 1 << 11) +#define STATUS1_TOXIC_TURN(num) ((num) << 8) #define STATUS1_PSN_ANY (STATUS1_POISON | STATUS1_TOXIC_POISON) #define STATUS1_ANY (STATUS1_SLEEP | STATUS1_POISON | STATUS1_BURN | STATUS1_FREEZE | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON) // Volatile status ailments // These are removed after exiting the battle or switching out -#define STATUS2_CONFUSION 0x00000007 -#define STATUS2_FLINCHED 0x00000008 -#define STATUS2_UPROAR 0x00000070 -#define STATUS2_BIDE 0x00000300 // two bits 0x100, 0x200 -#define STATUS2_LOCK_CONFUSE 0x00000C00 -#define STATUS2_MULTIPLETURNS 0x00001000 -#define STATUS2_WRAPPED 0x0000E000 -#define STATUS2_INFATUATION 0x000F0000 // 4 bits, one for every battler +#define STATUS2_CONFUSION (1 << 0 | 1 << 1 | 1 << 2) +#define STATUS2_CONFUSION_TURN(num) ((num) << 0) +#define STATUS2_FLINCHED (1 << 3) +#define STATUS2_UPROAR (1 << 4 | 1 << 5 | 1 << 6) +#define STATUS2_UPROAR_TURN(num) ((num) << 4) +#define STATUS2_UNUSED (1 << 7) +#define STATUS2_BIDE (1 << 8 | 1 << 9) +#define STATUS2_BIDE_TURN(num) (((num) << 8) & STATUS2_BIDE) +#define STATUS2_LOCK_CONFUSE (1 << 10 | 1 << 11) // e.g. Thrash +#define STATUS2_LOCK_CONFUSE_TURN(num)((num) << 10) +#define STATUS2_MULTIPLETURNS (1 << 12) +#define STATUS2_WRAPPED (1 << 13 | 1 << 14 | 1 << 15) +#define STATUS2_WRAPPED_TURN(num) ((num) << 13) +#define STATUS2_INFATUATION (1 << 16 | 1 << 17 | 1 << 18 | 1 << 19) // 4 bits, one for every battler #define STATUS2_INFATUATED_WITH(battler) (gBitTable[battler] << 16) -#define STATUS2_FOCUS_ENERGY 0x00100000 -#define STATUS2_TRANSFORMED 0x00200000 -#define STATUS2_RECHARGE 0x00400000 -#define STATUS2_RAGE 0x00800000 -#define STATUS2_SUBSTITUTE 0x01000000 -#define STATUS2_DESTINY_BOND 0x02000000 -#define STATUS2_ESCAPE_PREVENTION 0x04000000 -#define STATUS2_NIGHTMARE 0x08000000 -#define STATUS2_CURSED 0x10000000 -#define STATUS2_FORESIGHT 0x20000000 -#define STATUS2_DEFENSE_CURL 0x40000000 -#define STATUS2_TORMENT 0x80000000 +#define STATUS2_FOCUS_ENERGY (1 << 20) +#define STATUS2_TRANSFORMED (1 << 21) +#define STATUS2_RECHARGE (1 << 22) +#define STATUS2_RAGE (1 << 23) +#define STATUS2_SUBSTITUTE (1 << 24) +#define STATUS2_DESTINY_BOND (1 << 25) +#define STATUS2_ESCAPE_PREVENTION (1 << 26) +#define STATUS2_NIGHTMARE (1 << 27) +#define STATUS2_CURSED (1 << 28) +#define STATUS2_FORESIGHT (1 << 29) +#define STATUS2_DEFENSE_CURL (1 << 30) +#define STATUS2_TORMENT (1 << 31) // Seems like per-battler statuses. Not quite sure how to categorize these -#define STATUS3_LEECHSEED_BATTLER 0x3 -#define STATUS3_LEECHSEED 0x4 -#define STATUS3_ALWAYS_HITS 0x18 // two bits -#define STATUS3_PERISH_SONG 0x20 -#define STATUS3_ON_AIR 0x40 -#define STATUS3_UNDERGROUND 0x80 -#define STATUS3_MINIMIZED 0x100 -#define STATUS3_ROOTED 0x400 -#define STATUS3_CHARGED_UP 0x200 -#define STATUS3_YAWN 0x1800 // two bits -#define STATUS3_IMPRISONED_OTHERS 0x2000 -#define STATUS3_GRUDGE 0x4000 -#define STATUS3_CANT_SCORE_A_CRIT 0x8000 -#define STATUS3_MUDSPORT 0x10000 -#define STATUS3_WATERSPORT 0x20000 -#define STATUS3_UNDERWATER 0x40000 -#define STATUS3_INTIMIDATE_POKES 0x80000 -#define STATUS3_TRACE 0x100000 +#define STATUS3_LEECHSEED_BATTLER (1 << 0 | 1 << 1) // The battler to receive HP from Leech Seed +#define STATUS3_LEECHSEED (1 << 2) +#define STATUS3_ALWAYS_HITS (1 << 3 | 1 << 4) +#define STATUS3_ALWAYS_HITS_TURN(num) (((num) << 3) & STATUS3_ALWAYS_HITS) // "Always Hits" is set as a 2 turn timer, i.e. next turn is the last turn when it's active +#define STATUS3_PERISH_SONG (1 << 5) +#define STATUS3_ON_AIR (1 << 6) +#define STATUS3_UNDERGROUND (1 << 7) +#define STATUS3_MINIMIZED (1 << 8) +#define STATUS3_CHARGED_UP (1 << 9) +#define STATUS3_ROOTED (1 << 10) +#define STATUS3_YAWN (1 << 11 | 1 << 12) // Number of turns to sleep +#define STATUS3_YAWN_TURN(num) (((num) << 11) & STATUS3_YAWN) +#define STATUS3_IMPRISONED_OTHERS (1 << 13) +#define STATUS3_GRUDGE (1 << 14) +#define STATUS3_CANT_SCORE_A_CRIT (1 << 15) +#define STATUS3_MUDSPORT (1 << 16) +#define STATUS3_WATERSPORT (1 << 17) +#define STATUS3_UNDERWATER (1 << 18) +#define STATUS3_INTIMIDATE_POKES (1 << 19) +#define STATUS3_TRACE (1 << 20) #define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER) // Not really sure what a "hitmarker" is. -#define HITMARKER_x10 0x00000010 -#define HITMARKER_x20 0x00000020 -#define HITMARKER_DESTINYBOND 0x00000040 -#define HITMARKER_NO_ANIMATIONS 0x00000080 -#define HITMARKER_IGNORE_SUBSTITUTE 0x00000100 -#define HITMARKER_NO_ATTACKSTRING 0x00000200 -#define HITMARKER_ATTACKSTRING_PRINTED 0x00000400 -#define HITMARKER_NO_PPDEDUCT 0x00000800 -#define HITMARKER_SWAP_ATTACKER_TARGET 0x00001000 -#define HITMARKER_IGNORE_SAFEGUARD 0x00002000 -#define HITMARKER_SYNCHRONISE_EFFECT 0x00004000 -#define HITMARKER_RUN 0x00008000 -#define HITMARKER_IGNORE_ON_AIR 0x00010000 -#define HITMARKER_IGNORE_UNDERGROUND 0x00020000 -#define HITMARKER_IGNORE_UNDERWATER 0x00040000 -#define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000 -#define HITMARKER_x100000 0x00100000 -#define HITMARKER_x200000 0x00200000 -#define HITMARKER_x400000 0x00400000 -#define HITMARKER_x800000 0x00800000 -#define HITMARKER_GRUDGE 0x01000000 -#define HITMARKER_OBEYS 0x02000000 -#define HITMARKER_x4000000 0x04000000 -#define HITMARKER_CHARGING 0x08000000 -#define HITMARKER_FAINTED(battler) (gBitTable[battler] << 0x1C) -#define HITMARKER_UNK(battler) (0x10000000 << battler) +#define HITMARKER_x10 (1 << 4) +#define HITMARKER_x20 (1 << 5) +#define HITMARKER_DESTINYBOND (1 << 6) +#define HITMARKER_NO_ANIMATIONS (1 << 7) +#define HITMARKER_IGNORE_SUBSTITUTE (1 << 8) +#define HITMARKER_NO_ATTACKSTRING (1 << 9) +#define HITMARKER_ATTACKSTRING_PRINTED (1 << 10) +#define HITMARKER_NO_PPDEDUCT (1 << 11) +#define HITMARKER_SWAP_ATTACKER_TARGET (1 << 12) +#define HITMARKER_IGNORE_SAFEGUARD (1 << 13) +#define HITMARKER_SYNCHRONISE_EFFECT (1 << 14) +#define HITMARKER_RUN (1 << 15) +#define HITMARKER_IGNORE_ON_AIR (1 << 16) +#define HITMARKER_IGNORE_UNDERGROUND (1 << 17) +#define HITMARKER_IGNORE_UNDERWATER (1 << 18) +#define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19) +#define HITMARKER_x100000 (1 << 20) +#define HITMARKER_x200000 (1 << 21) +#define HITMARKER_x400000 (1 << 22) +#define HITMARKER_x800000 (1 << 23) +#define HITMARKER_GRUDGE (1 << 24) +#define HITMARKER_OBEYS (1 << 25) +#define HITMARKER_x4000000 (1 << 26) +#define HITMARKER_CHARGING (1 << 27) +#define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28) +#define HITMARKER_FAINTED2(battler) (1 << (28 + battler)) // Per-side statuses that affect an entire party #define SIDE_STATUS_REFLECT (1 << 0) @@ -215,71 +225,70 @@ #define WEATHER_ANY (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY) // Move Effects -#define MOVE_EFFECT_SLEEP 0x1 -#define MOVE_EFFECT_POISON 0x2 -#define MOVE_EFFECT_BURN 0x3 -#define MOVE_EFFECT_FREEZE 0x4 -#define MOVE_EFFECT_PARALYSIS 0x5 -#define MOVE_EFFECT_TOXIC 0x6 -#define MOVE_EFFECT_CONFUSION 0x7 -#define MOVE_EFFECT_FLINCH 0x8 -#define MOVE_EFFECT_TRI_ATTACK 0x9 -#define MOVE_EFFECT_UPROAR 0xA -#define MOVE_EFFECT_PAYDAY 0xB -#define MOVE_EFFECT_CHARGING 0xC -#define MOVE_EFFECT_WRAP 0xD -#define MOVE_EFFECT_RECOIL_25 0xE -#define MOVE_EFFECT_ATK_PLUS_1 0xF -#define MOVE_EFFECT_DEF_PLUS_1 0x10 -#define MOVE_EFFECT_SPD_PLUS_1 0x11 -#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12 -#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13 -#define MOVE_EFFECT_ACC_PLUS_1 0x14 -#define MOVE_EFFECT_EVS_PLUS_1 0x15 -#define MOVE_EFFECT_ATK_MINUS_1 0x16 -#define MOVE_EFFECT_DEF_MINUS_1 0x17 -#define MOVE_EFFECT_SPD_MINUS_1 0x18 -#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19 -#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A -#define MOVE_EFFECT_ACC_MINUS_1 0x1B -#define MOVE_EFFECT_EVS_MINUS_1 0x1C -#define MOVE_EFFECT_RECHARGE 0x1D -#define MOVE_EFFECT_RAGE 0x1E -#define MOVE_EFFECT_STEAL_ITEM 0x1F -#define MOVE_EFFECT_PREVENT_ESCAPE 0x20 -#define MOVE_EFFECT_NIGHTMARE 0x21 -#define MOVE_EFFECT_ALL_STATS_UP 0x22 -#define MOVE_EFFECT_RAPIDSPIN 0x23 -#define MOVE_EFFECT_REMOVE_PARALYSIS 0x24 -#define MOVE_EFFECT_ATK_DEF_DOWN 0x25 -#define MOVE_EFFECT_RECOIL_33 0x26 -#define MOVE_EFFECT_ATK_PLUS_2 0x27 -#define MOVE_EFFECT_DEF_PLUS_2 0x28 -#define MOVE_EFFECT_SPD_PLUS_2 0x29 -#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A -#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B -#define MOVE_EFFECT_ACC_PLUS_2 0x2C -#define MOVE_EFFECT_EVS_PLUS_2 0x2D -#define MOVE_EFFECT_ATK_MINUS_2 0x2E -#define MOVE_EFFECT_DEF_MINUS_2 0x2F -#define MOVE_EFFECT_SPD_MINUS_2 0x30 -#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31 -#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32 -#define MOVE_EFFECT_ACC_MINUS_2 0x33 -#define MOVE_EFFECT_EVS_MINUS_2 0x34 -#define MOVE_EFFECT_THRASH 0x35 -#define MOVE_EFFECT_KNOCK_OFF 0x36 -#define MOVE_EFFECT_NOTHING_37 0x37 -#define MOVE_EFFECT_NOTHING_38 0x38 -#define MOVE_EFFECT_NOTHING_39 0x39 -#define MOVE_EFFECT_NOTHING_3A 0x3A -#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B -#define MOVE_EFFECT_NOTHING_3C 0x3C -#define MOVE_EFFECT_NOTHING_3D 0x3D -#define MOVE_EFFECT_NOTHING_3E 0x3E -#define MOVE_EFFECT_NOTHING_3F 0x3F -#define MOVE_EFFECT_AFFECTS_USER 0x40 -#define MOVE_EFFECT_CERTAIN 0x80 +#define MOVE_EFFECT_SLEEP 1 +#define MOVE_EFFECT_POISON 2 +#define MOVE_EFFECT_BURN 3 +#define MOVE_EFFECT_FREEZE 4 +#define MOVE_EFFECT_PARALYSIS 5 +#define MOVE_EFFECT_TOXIC 6 +#define PRIMARY_STATUS_MOVE_EFFECT MOVE_EFFECT_TOXIC // All above move effects apply primary status +#define MOVE_EFFECT_CONFUSION 7 +#define MOVE_EFFECT_FLINCH 8 +#define MOVE_EFFECT_TRI_ATTACK 9 +#define MOVE_EFFECT_UPROAR 10 +#define MOVE_EFFECT_PAYDAY 11 +#define MOVE_EFFECT_CHARGING 12 +#define MOVE_EFFECT_WRAP 13 +#define MOVE_EFFECT_RECOIL_25 14 +#define MOVE_EFFECT_ATK_PLUS_1 15 +#define MOVE_EFFECT_DEF_PLUS_1 16 +#define MOVE_EFFECT_SPD_PLUS_1 17 +#define MOVE_EFFECT_SP_ATK_PLUS_1 18 +#define MOVE_EFFECT_SP_DEF_PLUS_1 19 +#define MOVE_EFFECT_ACC_PLUS_1 20 +#define MOVE_EFFECT_EVS_PLUS_1 21 +#define MOVE_EFFECT_ATK_MINUS_1 22 +#define MOVE_EFFECT_DEF_MINUS_1 23 +#define MOVE_EFFECT_SPD_MINUS_1 24 +#define MOVE_EFFECT_SP_ATK_MINUS_1 25 +#define MOVE_EFFECT_SP_DEF_MINUS_1 26 +#define MOVE_EFFECT_ACC_MINUS_1 27 +#define MOVE_EFFECT_EVS_MINUS_1 28 +#define MOVE_EFFECT_RECHARGE 29 +#define MOVE_EFFECT_RAGE 30 +#define MOVE_EFFECT_STEAL_ITEM 31 +#define MOVE_EFFECT_PREVENT_ESCAPE 32 +#define MOVE_EFFECT_NIGHTMARE 33 +#define MOVE_EFFECT_ALL_STATS_UP 34 +#define MOVE_EFFECT_RAPIDSPIN 35 +#define MOVE_EFFECT_REMOVE_PARALYSIS 36 +#define MOVE_EFFECT_ATK_DEF_DOWN 37 +#define MOVE_EFFECT_RECOIL_33 38 +#define MOVE_EFFECT_ATK_PLUS_2 39 +#define MOVE_EFFECT_DEF_PLUS_2 40 +#define MOVE_EFFECT_SPD_PLUS_2 41 +#define MOVE_EFFECT_SP_ATK_PLUS_2 42 +#define MOVE_EFFECT_SP_DEF_PLUS_2 43 +#define MOVE_EFFECT_ACC_PLUS_2 44 +#define MOVE_EFFECT_EVS_PLUS_2 45 +#define MOVE_EFFECT_ATK_MINUS_2 46 +#define MOVE_EFFECT_DEF_MINUS_2 47 +#define MOVE_EFFECT_SPD_MINUS_2 48 +#define MOVE_EFFECT_SP_ATK_MINUS_2 49 +#define MOVE_EFFECT_SP_DEF_MINUS_2 50 +#define MOVE_EFFECT_ACC_MINUS_2 51 +#define MOVE_EFFECT_EVS_MINUS_2 52 +#define MOVE_EFFECT_THRASH 53 +#define MOVE_EFFECT_KNOCK_OFF 54 +#define MOVE_EFFECT_NOTHING_37 55 +#define MOVE_EFFECT_NOTHING_38 56 +#define MOVE_EFFECT_NOTHING_39 57 +#define MOVE_EFFECT_NOTHING_3A 58 +#define MOVE_EFFECT_SP_ATK_TWO_DOWN 59 +#define NUM_MOVE_EFFECTS 60 + +#define MOVE_EFFECT_AFFECTS_USER (1 << 6) // 64 +#define MOVE_EFFECT_CERTAIN (1 << 7) // 128 // Battle terrain defines for gBattleTerrain. #define BATTLE_TERRAIN_GRASS 0 diff --git a/include/constants/battle_palace.h b/include/constants/battle_palace.h index db9855101..851655089 100644 --- a/include/constants/battle_palace.h +++ b/include/constants/battle_palace.h @@ -16,4 +16,14 @@ #define PALACE_DATA_WIN_STREAK 1 #define PALACE_DATA_WIN_STREAK_ACTIVE 2 +// Pokemon in Battle Palace have a move "group" type preference depending on nature +#define PALACE_MOVE_GROUP_ATTACK 0 +#define PALACE_MOVE_GROUP_DEFENSE 1 +#define PALACE_MOVE_GROUP_SUPPORT 2 + +// In palace doubles battles pokemon have a target preference depending on nature +#define PALACE_TARGET_STRONGER 0 +#define PALACE_TARGET_WEAKER 1 +#define PALACE_TARGET_RANDOM 2 + #endif //GUARD_CONSTANTS_BATTLE_PALACE_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index dfcf79128..9372377c4 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -66,8 +66,10 @@ #define VARIOUS_SET_MAGIC_COAT_TARGET 1 #define VARIOUS_IS_RUNNING_IMPOSSIBLE 2 #define VARIOUS_GET_MOVE_TARGET 3 +#define VARIOUS_GET_BATTLER_FAINTED 4 #define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5 #define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6 +#define VARIOUS_PALACE_FLAVOR_TEXT 8 #define VARIOUS_ARENA_JUDGMENT_WINDOW 9 #define VARIOUS_ARENA_OPPONENT_MON_LOST 10 #define VARIOUS_ARENA_PLAYER_MON_LOST 11 diff --git a/include/constants/flags.h b/include/constants/flags.h index a9c7abae1..e1a88283a 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -961,10 +961,10 @@ #define FLAG_HIDE_MT_PYRE_SUMMIT_ARCHIE 0x394 #define FLAG_HIDE_MT_PYRE_SUMMIT_TEAM_AQUA 0x395 #define FLAG_HIDE_BATTLE_TOWER_REPORTER 0x396 -#define FLAG_HIDE_ROUTE_110_RIVAL_1 0x397 +#define FLAG_HIDE_ROUTE_110_RIVAL 0x397 #define FLAG_HIDE_CHAMPIONS_ROOM_RIVAL 0x398 #define FLAG_HIDE_CHAMPIONS_ROOM_BIRCH 0x399 -#define FLAG_HIDE_ROUTE_110_RIVAL_2 0x39A +#define FLAG_HIDE_ROUTE_110_RIVAL_ON_BIKE 0x39A #define FLAG_HIDE_ROUTE_119_RIVAL_ON_BIKE 0x39B #define FLAG_HIDE_AQUA_HIDEOUT_GRUNTS 0x39C #define FLAG_HIDE_LILCOVE_MOTEL_GAME_DESIGNERS 0x39D diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index b5c60f64d..0d8fc6a57 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -69,6 +69,7 @@ #define NATURE_SASSY 22 #define NATURE_CAREFUL 23 #define NATURE_QUIRKY 24 +#define NUM_NATURES 25 // Pokemon Stats #define STAT_HP 0 @@ -80,7 +81,7 @@ #define STAT_ACC 6 // Only in battles. #define STAT_EVASION 7 // Only in battles. -#define NUM_EV_STATS NUM_STATS - 1 // excludes HP +#define NUM_NATURE_STATS NUM_STATS - 1 // excludes HP #define NUM_BATTLE_STATS NUM_STATS + 2 // includes Accuracy and Evasion // Shiny odds diff --git a/include/libgcnmultiboot.h b/include/libgcnmultiboot.h index 7d347df05..4a6262d8f 100644 --- a/include/libgcnmultiboot.h +++ b/include/libgcnmultiboot.h @@ -1,4 +1,4 @@ -#ifndef GUARD_LIBGCMMULTIBOOT_H +#ifndef GUARD_LIBGCNMULTIBOOT_H #define GUARD_LIBGCNMULTIBOOT_H struct GcmbStruct diff --git a/include/pokeblock.h b/include/pokeblock.h index 6dd07b689..0d413a810 100644 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -1,6 +1,9 @@ #ifndef GUARD_POKEBLOCK_H #define GUARD_POKEBLOCK_H +#include "constants/berry.h" +#include "constants/pokemon.h" + #define GFX_TAG_POKEBLOCK 14818 #define GFX_TAG_POKEBLOCK_CASE 14800 @@ -43,7 +46,7 @@ void ChooseMonToGivePokeblock(struct Pokeblock *pokeblock, void (*callback)(void void CB2_PreparePokeblockFeedScene(void); // pokeblock -extern const s8 gPokeblockFlavorCompatibilityTable[]; +extern const s8 gPokeblockFlavorCompatibilityTable[NUM_NATURES * FLAVOR_COUNT]; extern const u8 *const gPokeblockNames[]; extern const struct CompressedSpriteSheet gPokeblockCase_SpriteSheet; extern const struct CompressedSpritePalette gPokeblockCase_SpritePal; diff --git a/include/starter_choose.h b/include/starter_choose.h index 535e272b7..7a4f6e967 100644 --- a/include/starter_choose.h +++ b/include/starter_choose.h @@ -5,6 +5,7 @@ extern const u16 gBirchBagGrassPal[2][16]; extern const u32 gBirchBagTilemap[]; extern const u32 gBirchGrassTilemap[]; extern const u32 gBirchHelpGfx[]; +extern const u32 gPokeballSelection_Gfx[]; u16 GetStarterPokemon(u16 chosenStarterId); void CB2_ChooseStarter(void); diff --git a/include/strings.h b/include/strings.h index 67b238422..702392efa 100644 --- a/include/strings.h +++ b/include/strings.h @@ -374,6 +374,9 @@ extern const u8 gText_DefaultNameTerra[]; extern const u8 gText_DefaultNameLucy[]; extern const u8 gText_DefaultNameHalie[]; +extern const u8 gText_BirchInTrouble[]; +extern const u8 gText_ConfirmStarterChoice[]; + // mystery event menu text extern const u8 gText_EventSafelyLoaded[]; extern const u8 gText_LoadErrorEndingSession[]; diff --git a/include/unk_transition.h b/include/unk_transition.h deleted file mode 100644 index a9caac419..000000000 --- a/include/unk_transition.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef GUARD_UNK_TRANSITION_H -#define GUARD_UNK_TRANSITION_H - -void Phase2Task_34(u8 taskId); -void Phase2Task_35(u8 taskId); -void Phase2Task_36(u8 taskId); -void Phase2Task_37(u8 taskId); -void Phase2Task_38(u8 taskId); -void Phase2Task_39(u8 taskId); -void Phase2Task_40(u8 taskId); -void Phase2Task_41(u8 taskId); - -#endif // GUARD_UNK_TRANSITION_H diff --git a/ld_script.txt b/ld_script.txt index 4fe9c4aa0..f3e418c08 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -331,7 +331,7 @@ SECTIONS { src/walda_phrase.o(.text); src/contest_link_util.o(.text); src/gym_leader_rematch.o(.text); - src/unk_transition.o(.text); + src/battle_transition_frontier.o(.text); src/international_string_util.o(.text); } =0 @@ -685,7 +685,7 @@ SECTIONS { src/rayquaza_scene.o(.rodata); src/walda_phrase.o(.rodata); src/gym_leader_rematch.o(.rodata); - src/unk_transition.o(.rodata); + src/battle_transition_frontier.o(.rodata); src/text_input_strings.o(.rodata); data/fonts.o(.rodata); src/mystery_event_msg.o(.rodata); diff --git a/libagbsyscall/libagbsyscall.s b/libagbsyscall/libagbsyscall.s index 893235e32..00c40d08e 100644 --- a/libagbsyscall/libagbsyscall.s +++ b/libagbsyscall/libagbsyscall.s @@ -55,8 +55,8 @@ .ifdef L_IntrWait thumb_func_start IntrWait IntrWait: - mov r2, #0 - swi 4 + movs r2, #0 + svc #4 bx lr thumb_func_end IntrWait .endif @@ -64,7 +64,7 @@ IntrWait: .ifdef L_RegisterRamReset thumb_func_start RegisterRamReset RegisterRamReset: - swi 1 + svc #1 bx lr thumb_func_end RegisterRamReset .endif @@ -72,7 +72,7 @@ RegisterRamReset: .ifdef L_Sqrt thumb_func_start Sqrt Sqrt: - swi 8 + svc #8 bx lr thumb_func_end Sqrt .endif @@ -80,7 +80,7 @@ Sqrt: .ifdef L_MusicPlayerOpen thumb_func_start MusicPlayerOpen MusicPlayerOpen: - swi 32 + svc #32 bx lr thumb_func_end MusicPlayerOpen .endif @@ -88,8 +88,8 @@ MusicPlayerOpen: .ifdef L_SoundBiasReset thumb_func_start SoundBiasReset SoundBiasReset: - mov r0, #0 - swi 25 + movs r0, #0 + svc #25 bx lr thumb_func_end SoundBiasReset .endif @@ -97,7 +97,7 @@ SoundBiasReset: .ifdef L_SoundDriverVSyncOn thumb_func_start SoundDriverVSyncOn SoundDriverVSyncOn: - swi 41 + svc #41 bx lr thumb_func_end SoundDriverVSyncOn .endif @@ -105,7 +105,7 @@ SoundDriverVSyncOn: .ifdef L_Mod thumb_func_start Mod Mod: - swi 6 + svc #6 mov r0, r1 bx lr thumb_func_end Mod @@ -114,8 +114,8 @@ Mod: .ifdef L_VBlankIntrWait thumb_func_start VBlankIntrWait VBlankIntrWait: - mov r2, #0 - swi 5 + movs r2, #0 + svc #5 bx lr thumb_func_end VBlankIntrWait .endif @@ -123,7 +123,7 @@ VBlankIntrWait: .ifdef L_MusicPlayerStart thumb_func_start MusicPlayerStart MusicPlayerStart: - swi 33 + svc #33 bx lr thumb_func_end MusicPlayerStart .endif @@ -131,7 +131,7 @@ MusicPlayerStart: .ifdef L_SoundDriverVSyncOff thumb_func_start SoundDriverVSyncOff SoundDriverVSyncOff: - swi 40 + svc #40 bx lr thumb_func_end SoundDriverVSyncOff .endif @@ -139,34 +139,34 @@ SoundDriverVSyncOff: .ifdef L_HuffUnComp thumb_func_start HuffUnComp HuffUnComp: - swi 19 + svc #19 bx lr thumb_func_end HuffUnComp .endif .ifdef L_SoftResetExram - thumb_func_start SoftResetExram + arm_func_start SoftResetExram SoftResetExram: ldr r3, =REG_IME - mov r2, #0 + movs r2, #0 strb r2, [r3, #0] ldr r3, =SOFT_RESET_DIRECT_BUF - mov r2, #1 + movs r2, #1 strb r2, [r3, #0] - sub r3, #SOFT_RESET_DIRECT_BUF - 0x3007f00 + subs r3, #SOFT_RESET_DIRECT_BUF - 0x3007f00 mov sp, r3 - mov r2, #RESET_EX_WRAM_FLAG - bic r0, r2 - swi 1 - swi 0 + movs r2, #RESET_EX_WRAM_FLAG + bics r0, r2 + svc #1 + svc #0 .pool - thumb_func_end SoftResetExram + arm_func_end SoftResetExram .endif .ifdef L_MusicPlayerFadeOut thumb_func_start MusicPlayerFadeOut MusicPlayerFadeOut: - swi 36 + svc #36 bx lr thumb_func_end MusicPlayerFadeOut .endif @@ -174,7 +174,7 @@ MusicPlayerFadeOut: .ifdef L_LZ77UnCompWram thumb_func_start LZ77UnCompWram LZ77UnCompWram: - swi 17 + svc #17 bx lr thumb_func_end LZ77UnCompWram .endif @@ -182,7 +182,7 @@ LZ77UnCompWram: .ifdef L_SoundDriverMain thumb_func_start SoundDriverMain SoundDriverMain: - swi 28 + svc #28 bx lr thumb_func_end SoundDriverMain .endif @@ -190,7 +190,7 @@ SoundDriverMain: .ifdef L_SoundBiasChange thumb_func_start SoundBiasChange SoundBiasChange: - swi 25 + svc #25 bx lr thumb_func_end SoundBiasChange .endif @@ -198,7 +198,7 @@ SoundBiasChange: .ifdef L_LZ77UnCompVram thumb_func_start LZ77UnCompVram LZ77UnCompVram: - swi 18 + svc #18 bx lr thumb_func_end LZ77UnCompVram .endif @@ -206,7 +206,7 @@ LZ77UnCompVram: .ifdef L_ArcTan2 thumb_func_start ArcTan2 ArcTan2: - swi 10 + svc #10 bx lr thumb_func_end ArcTan2 .endif @@ -214,7 +214,7 @@ ArcTan2: .ifdef L_MusicPlayerStop thumb_func_start MusicPlayerStop MusicPlayerStop: - swi 34 + svc #34 bx lr thumb_func_end MusicPlayerStop .endif @@ -222,7 +222,7 @@ MusicPlayerStop: .ifdef L_DivArm thumb_func_start DivArm DivArm: - swi 7 + svc #7 bx lr thumb_func_end DivArm .endif @@ -230,7 +230,7 @@ DivArm: .ifdef L_ModArm thumb_func_start ModArm ModArm: - swi 7 + svc #7 mov r0, r1 bx lr thumb_func_end ModArm @@ -239,7 +239,7 @@ ModArm: .ifdef L_SoundDriverVSync thumb_func_start SoundDriverVSync SoundDriverVSync: - swi 29 + svc #29 bx lr thumb_func_end SoundDriverVSync .endif @@ -247,7 +247,7 @@ SoundDriverVSync: .ifdef L_SoundDriverInit thumb_func_start SoundDriverInit SoundDriverInit: - swi 26 + svc #26 bx lr thumb_func_end SoundDriverInit .endif @@ -255,7 +255,7 @@ SoundDriverInit: .ifdef L_BgAffineSet thumb_func_start BgAffineSet BgAffineSet: - swi 14 + svc #14 bx lr thumb_func_end BgAffineSet .endif @@ -263,7 +263,7 @@ BgAffineSet: .ifdef L_Diff8bitUnFilterWram thumb_func_start Diff8bitUnFilterWram Diff8bitUnFilterWram: - swi 22 + svc #22 bx lr thumb_func_end Diff8bitUnFilterWram .endif @@ -272,7 +272,7 @@ Diff8bitUnFilterWram: thumb_func_start MultiBoot MultiBoot: mov r1, #1 - swi 37 + svc #37 bx lr thumb_func_end MultiBoot .endif @@ -280,7 +280,7 @@ MultiBoot: .ifdef L_MidiKey2Freq thumb_func_start MidiKey2Freq MidiKey2Freq: - swi 31 + svc #31 bx lr thumb_func_end MidiKey2Freq .endif @@ -288,7 +288,7 @@ MidiKey2Freq: .ifdef L_Div thumb_func_start Div Div: - swi 6 + svc #6 bx lr thumb_func_end Div .endif @@ -296,7 +296,7 @@ Div: .ifdef L_Diff8bitUnFilterVram thumb_func_start Diff8bitUnFilterVram Diff8bitUnFilterVram: - swi 23 + svc #23 bx lr thumb_func_end Diff8bitUnFilterVram .endif @@ -304,7 +304,7 @@ Diff8bitUnFilterVram: .ifdef L_ArcTan thumb_func_start ArcTan ArcTan: - swi 9 + svc #9 bx lr thumb_func_end ArcTan .endif @@ -312,7 +312,7 @@ ArcTan: .ifdef L_ObjAffineSet thumb_func_start ObjAffineSet ObjAffineSet: - swi 15 + svc #15 bx lr thumb_func_end ObjAffineSet .endif @@ -321,15 +321,15 @@ ObjAffineSet: thumb_func_start SoftResetRom SoftResetRom: ldr r3, =REG_IME - mov r2, #0 + movs r2, #0 strb r2, [r3, #0] ldr r3, =SOFT_RESET_DIRECT_BUF - mov r2, #0 + movs r2, #0 strb r2, [r3, #0] sub r3, #SOFT_RESET_DIRECT_BUF - 0x3007f00 mov sp, r3 - swi 1 - swi 0 + svc #1 + svc #0 .pool thumb_func_end SoftResetRom .endif @@ -337,7 +337,7 @@ SoftResetRom: .ifdef L_SoundDriverMode thumb_func_start SoundDriverMode SoundDriverMode: - swi 27 + svc #27 bx lr thumb_func_end SoundDriverMode .endif @@ -345,7 +345,7 @@ SoundDriverMode: .ifdef L_RLUnCompWram thumb_func_start RLUnCompWram RLUnCompWram: - swi 20 + svc #20 bx lr thumb_func_end RLUnCompWram .endif @@ -353,7 +353,7 @@ RLUnCompWram: .ifdef L_BitUnPack thumb_func_start BitUnPack BitUnPack: - swi 16 + svc #16 bx lr thumb_func_end BitUnPack .endif @@ -361,7 +361,7 @@ BitUnPack: .ifdef L_SoundChannelClear thumb_func_start SoundChannelClear SoundChannelClear: - swi 30 + svc #30 bx lr thumb_func_end SoundChannelClear .endif @@ -369,7 +369,7 @@ SoundChannelClear: .ifdef L_CpuFastSet thumb_func_start CpuFastSet CpuFastSet: - swi 12 + svc #12 bx lr thumb_func_end CpuFastSet .endif @@ -377,7 +377,7 @@ CpuFastSet: .ifdef L_CpuSet thumb_func_start CpuSet CpuSet: - swi 11 + svc #11 bx lr thumb_func_end CpuSet .endif @@ -385,7 +385,7 @@ CpuSet: .ifdef L_Diff16bitUnFilter thumb_func_start Diff16bitUnFilter Diff16bitUnFilter: - swi 24 + svc #24 bx lr thumb_func_end Diff16bitUnFilter .endif @@ -393,8 +393,8 @@ Diff16bitUnFilter: .ifdef L_SoundBiasSet thumb_func_start SoundBiasSet SoundBiasSet: - mov r0, #1 - swi 25 + movs r0, #1 + svc #25 bx lr thumb_func_end SoundBiasSet .endif @@ -402,7 +402,7 @@ SoundBiasSet: .ifdef L_MusicPlayerContinue thumb_func_start MusicPlayerContinue MusicPlayerContinue: - swi 35 + svc #35 bx lr thumb_func_end MusicPlayerContinue .endif @@ -411,12 +411,12 @@ MusicPlayerContinue: thumb_func_start SoftReset SoftReset: ldr r3, =REG_IME - mov r2, #0 + movs r2, #0 strb r2, [r3, #0] ldr r1, =0x3007f00 mov sp, r1 - swi 1 - swi 0 + svc #1 + svc #0 .pool thumb_func_end SoftReset .endif @@ -424,7 +424,7 @@ SoftReset: .ifdef L_RLUnCompVram thumb_func_start RLUnCompVram RLUnCompVram: - swi 21 + svc #21 bx lr thumb_func_end RLUnCompVram .endif diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index c9a6a6606..748e4729a 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -471,9 +471,9 @@ static u8 ChooseMoveOrAction_Doubles(void) else { if (gBattleTypeFlags & BATTLE_TYPE_PALACE) - BattleAI_SetupAIData(gBattleStruct->field_92 >> 4); + BattleAI_SetupAIData(gBattleStruct->palaceFlags >> 4); else - BattleAI_SetupAIData(0xF); + BattleAI_SetupAIData((1 << MAX_MON_MOVES) - 1); gBattlerTarget = i; diff --git a/src/battle_anim_smokescreen.c b/src/battle_anim_smokescreen.c index a8c043e67..4120dda72 100644 --- a/src/battle_anim_smokescreen.c +++ b/src/battle_anim_smokescreen.c @@ -6,39 +6,40 @@ #include "sprite.h" #include "util.h" #include "constants/pokemon.h" +#include "constants/battle_palace.h" static void SmokescreenImpact_Callback(struct Sprite *); static void SpriteCB_DestroySprite(struct Sprite *sprite); // The below data for smokescreen starts and ends with some data that belongs to battle_gfx_sfx_util.c -const u8 gUnknown_0831C604[] = -{ - [NATURE_HARDY] = 0, - [NATURE_LONELY] = 0, - [NATURE_BRAVE] = 1, - [NATURE_ADAMANT] = 0, - [NATURE_NAUGHTY] = 1, - [NATURE_BOLD] = 1, - [NATURE_DOCILE] = 2, - [NATURE_RELAXED] = 0, - [NATURE_IMPISH] = 0, - [NATURE_LAX] = 0, - [NATURE_TIMID] = 1, - [NATURE_HASTY] = 1, - [NATURE_SERIOUS] = 1, - [NATURE_JOLLY] = 0, - [NATURE_NAIVE] = 2, - [NATURE_MODEST] = 1, - [NATURE_MILD] = 0, - [NATURE_QUIET] = 1, - [NATURE_BASHFUL] = 1, - [NATURE_RASH] = 0, - [NATURE_CALM] = 0, - [NATURE_GENTLE] = 0, - [NATURE_SASSY] = 1, - [NATURE_CAREFUL] = 1, - [NATURE_QUIRKY] = 0, +const u8 gBattlePalaceNatureToMoveTarget[NUM_NATURES] = +{ + [NATURE_HARDY] = PALACE_TARGET_STRONGER, + [NATURE_LONELY] = PALACE_TARGET_STRONGER, + [NATURE_BRAVE] = PALACE_TARGET_WEAKER, + [NATURE_ADAMANT] = PALACE_TARGET_STRONGER, + [NATURE_NAUGHTY] = PALACE_TARGET_WEAKER, + [NATURE_BOLD] = PALACE_TARGET_WEAKER, + [NATURE_DOCILE] = PALACE_TARGET_RANDOM, + [NATURE_RELAXED] = PALACE_TARGET_STRONGER, + [NATURE_IMPISH] = PALACE_TARGET_STRONGER, + [NATURE_LAX] = PALACE_TARGET_STRONGER, + [NATURE_TIMID] = PALACE_TARGET_WEAKER, + [NATURE_HASTY] = PALACE_TARGET_WEAKER, + [NATURE_SERIOUS] = PALACE_TARGET_WEAKER, + [NATURE_JOLLY] = PALACE_TARGET_STRONGER, + [NATURE_NAIVE] = PALACE_TARGET_RANDOM, + [NATURE_MODEST] = PALACE_TARGET_WEAKER, + [NATURE_MILD] = PALACE_TARGET_STRONGER, + [NATURE_QUIET] = PALACE_TARGET_WEAKER, + [NATURE_BASHFUL] = PALACE_TARGET_WEAKER, + [NATURE_RASH] = PALACE_TARGET_STRONGER, + [NATURE_CALM] = PALACE_TARGET_STRONGER, + [NATURE_GENTLE] = PALACE_TARGET_STRONGER, + [NATURE_SASSY] = PALACE_TARGET_WEAKER, + [NATURE_CAREFUL] = PALACE_TARGET_WEAKER, + [NATURE_QUIRKY] = PALACE_TARGET_STRONGER, }; static const struct CompressedSpriteSheet sSmokescreenImpactSpriteSheet = diff --git a/src/battle_dome.c b/src/battle_dome.c index 6f3d111ba..151bfc927 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -4692,7 +4692,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) allocatedArray[NUM_STATS] += allocatedArray[STAT_HP]; // Add the EVs with the nature modifier for this mon and and track number of negative natures - for (j = 0; j < NUM_EV_STATS; j++) + for (j = 0; j < NUM_NATURE_STATS; j++) { if (trainerId == TRAINER_FRONTIER_BRAIN) nature = GetFrontierBrainMonNature(i); @@ -4706,7 +4706,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) else if (gNatureStatTable[nature][j] < 0) { allocatedArray[j + NUM_STATS + 1] += (allocatedArray[j + 1] * 90) / 100; - allocatedArray[j + NUM_STATS + NUM_EV_STATS + 2]++; + allocatedArray[j + NUM_STATS + NUM_NATURE_STATS + 2]++; } else { @@ -4742,7 +4742,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) } allocatedArray[NUM_STATS] += allocatedArray[STAT_HP]; - for (j = 0; j < NUM_EV_STATS; j++) + for (j = 0; j < NUM_NATURE_STATS; j++) { nature = gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].nature; if (gNatureStatTable[nature][j] > 0) @@ -4752,7 +4752,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) else if (gNatureStatTable[nature][j] < 0) { allocatedArray[j + NUM_STATS + 1] += (allocatedArray[j + 1] * 90) / 100; - allocatedArray[j + NUM_STATS + NUM_EV_STATS + 2]++; + allocatedArray[j + NUM_STATS + NUM_NATURE_STATS + 2]++; } else { diff --git a/src/battle_factory.c b/src/battle_factory.c index 913b1b1a0..940e71f7d 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -39,7 +39,7 @@ static void GenerateInitialRentalMons(void); static void GetOpponentMostCommonMonType(void); static void GetOpponentBattleStyle(void); static void RestorePlayerPartyHeldItems(void); -static u16 GetMonSetId(u8 lvlMode, u8 challengeNum, bool8 arg2); +static u16 GetFactoryMonId(u8 lvlMode, u8 challengeNum, bool8 arg2); static u8 GetMoveBattleStyle(u16 move); // Const rom data. @@ -159,24 +159,27 @@ static const u8 sFixedIVTable[][2] = {31, 31}, }; -static const u16 sMonsToChooseFrom[][2] = -{ - {0x006e, 0x00c7}, - {0x00a2, 0x010a}, - {0x010b, 0x0173}, - {0x0174, 0x01d3}, - {0x01d4, 0x0233}, - {0x0234, 0x0293}, - {0x0294, 0x02f3}, - {0x0174, 0x0351}, - {0x0174, 0x01d3}, - {0x01d4, 0x0233}, - {0x0234, 0x0293}, - {0x0294, 0x02f3}, - {0x0174, 0x0371}, - {0x0174, 0x0371}, - {0x0174, 0x0371}, - {0x0174, 0x0371}, +static const u16 sInitialRentalMonRanges[][2] = +{ + // Level 50 + {FRONTIER_MON_GRIMER, FRONTIER_MON_FURRET_1}, // 110 - 199 + {FRONTIER_MON_DELCATTY_1, FRONTIER_MON_CLOYSTER_1}, // 162 - 266 + {FRONTIER_MON_DELCATTY_2, FRONTIER_MON_CLOYSTER_2}, // 267 - 371 + {FRONTIER_MON_DUGTRIO_1, FRONTIER_MON_SLAKING_1}, // 372 - 467 + {FRONTIER_MON_DUGTRIO_2, FRONTIER_MON_SLAKING_2}, // 468 - 563 + {FRONTIER_MON_DUGTRIO_3, FRONTIER_MON_SLAKING_3}, // 564 - 659 + {FRONTIER_MON_DUGTRIO_4, FRONTIER_MON_SLAKING_4}, // 660 - 755 + {FRONTIER_MON_DUGTRIO_1, FRONTIER_MONS_HIGH_TIER}, // 372 - 849 + + // Open level + {FRONTIER_MON_DUGTRIO_1, FRONTIER_MON_SLAKING_1}, // 372 - 467 + {FRONTIER_MON_DUGTRIO_2, FRONTIER_MON_SLAKING_2}, // 468 - 563 + {FRONTIER_MON_DUGTRIO_3, FRONTIER_MON_SLAKING_3}, // 564 - 659 + {FRONTIER_MON_DUGTRIO_4, FRONTIER_MON_SLAKING_4}, // 660 - 755 + {FRONTIER_MON_DUGTRIO_1, NUM_FRONTIER_MONS - 1}, // 372 - 881 + {FRONTIER_MON_DUGTRIO_1, NUM_FRONTIER_MONS - 1}, // 372 - 881 + {FRONTIER_MON_DUGTRIO_1, NUM_FRONTIER_MONS - 1}, // 372 - 881 + {FRONTIER_MON_DUGTRIO_1, NUM_FRONTIER_MONS - 1}, // 372 - 881 }; // code @@ -320,24 +323,24 @@ static void GenerateOpponentMons(void) i = 0; while (i != FRONTIER_PARTY_SIZE) { - u16 monSetId = GetMonSetId(lvlMode, challengeNum, FALSE); - if (gFacilityTrainerMons[monSetId].species == SPECIES_UNOWN) + u16 monId = GetFactoryMonId(lvlMode, challengeNum, FALSE); + if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) continue; for (j = 0; j < 6; j++) { - if (gFacilityTrainerMons[monSetId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) + if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) break; } if (j != 6) continue; - if (lvlMode == FRONTIER_LVL_50 && monSetId > FRONTIER_MONS_HIGH_TIER) + if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER) continue; for (k = firstMonId; k < firstMonId + i; k++) { - if (species[k] == gFacilityTrainerMons[monSetId].species) + if (species[k] == gFacilityTrainerMons[monId].species) break; } if (k != firstMonId + i) @@ -345,15 +348,15 @@ static void GenerateOpponentMons(void) for (k = firstMonId; k < firstMonId + i; k++) { - if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]) + if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) break; } if (k != firstMonId + i) continue; - species[i] = gFacilityTrainerMons[monSetId].species; - heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]; - gUnknown_03006298[i] = monSetId; + species[i] = gFacilityTrainerMons[monId].species; + heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]; + gUnknown_03006298[i] = monId; i++; } } @@ -388,7 +391,7 @@ static void SetPlayerAndOpponentParties(void) int count = 0; u8 bits = 0; u8 monLevel; - u16 monSetId; + u16 monId; u16 evs; u8 ivs; u8 friendship; @@ -412,17 +415,17 @@ static void SetPlayerAndOpponentParties(void) ZeroPlayerPartyMons(); for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { - monSetId = gSaveBlock2Ptr->frontier.rentalMons[i].monId; + monId = gSaveBlock2Ptr->frontier.rentalMons[i].monId; ivs = gSaveBlock2Ptr->frontier.rentalMons[i].ivs; CreateMon(&gPlayerParty[i], - gFacilityTrainerMons[monSetId].species, + gFacilityTrainerMons[monId].species, monLevel, ivs, TRUE, gSaveBlock2Ptr->frontier.rentalMons[i].personality, OT_ID_PLAYER_ID, 0); count = 0; - bits = gFacilityTrainerMons[monSetId].evSpread; + bits = gFacilityTrainerMons[monId].evSpread; for (j = 0; j < NUM_STATS; bits >>= 1, j++) { if (bits & 1) @@ -433,16 +436,16 @@ static void SetPlayerAndOpponentParties(void) bits = 1; for (j = 0; j < NUM_STATS; bits <<= 1, j++) { - if (gFacilityTrainerMons[monSetId].evSpread & bits) + if (gFacilityTrainerMons[monId].evSpread & bits) SetMonData(&gPlayerParty[i], MON_DATA_HP_EV + j, &evs); } CalculateMonStats(&gPlayerParty[i]); friendship = 0; for (k = 0; k < MAX_MON_MOVES; k++) - SetMonMoveAvoidReturn(&gPlayerParty[i], gFacilityTrainerMons[monSetId].moves[k], k); + SetMonMoveAvoidReturn(&gPlayerParty[i], gFacilityTrainerMons[monId].moves[k], k); SetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP, &friendship); - SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); SetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM, &gSaveBlock2Ptr->frontier.rentalMons[i].abilityNum); } } @@ -453,17 +456,17 @@ static void SetPlayerAndOpponentParties(void) case 2: for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { - monSetId = gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId; + monId = gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId; ivs = gSaveBlock2Ptr->frontier.rentalMons[i + 3].ivs; CreateMon(&gEnemyParty[i], - gFacilityTrainerMons[monSetId].species, + gFacilityTrainerMons[monId].species, monLevel, ivs, TRUE, gSaveBlock2Ptr->frontier.rentalMons[i + 3].personality, OT_ID_PLAYER_ID, 0); count = 0; - bits = gFacilityTrainerMons[monSetId].evSpread; + bits = gFacilityTrainerMons[monId].evSpread; for (j = 0; j < NUM_STATS; bits >>= 1, j++) { if (bits & 1) @@ -474,14 +477,14 @@ static void SetPlayerAndOpponentParties(void) bits = 1; for (j = 0; j < NUM_STATS; bits <<= 1, j++) { - if (gFacilityTrainerMons[monSetId].evSpread & bits) + if (gFacilityTrainerMons[monId].evSpread & bits) SetMonData(&gEnemyParty[i], MON_DATA_HP_EV + j, &evs); } CalculateMonStats(&gEnemyParty[i]); for (k = 0; k < MAX_MON_MOVES; k++) - SetMonMoveAvoidReturn(&gEnemyParty[i], gFacilityTrainerMons[monSetId].moves[k], k); - SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); + SetMonMoveAvoidReturn(&gEnemyParty[i], gFacilityTrainerMons[monId].moves[k], k); + SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); SetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM, &gSaveBlock2Ptr->frontier.rentalMons[i + 3].abilityNum); } break; @@ -497,8 +500,8 @@ static void GenerateInitialRentalMons(void) u8 challengeNum; u8 factoryLvlMode; u8 factoryBattleMode; - u8 var_40; - u16 monSetId; + u8 rentalRank; + u16 monId; u16 currSpecies; u16 species[PARTY_SIZE]; u16 monIds[PARTY_SIZE]; @@ -530,30 +533,30 @@ static void GenerateInitialRentalMons(void) factoryLvlMode = FRONTIER_LVL_50; firstMonId = 0; } - var_40 = GetNumPastRentalsRank(factoryBattleMode, factoryLvlMode); + rentalRank = GetNumPastRentalsRank(factoryBattleMode, factoryLvlMode); currSpecies = SPECIES_NONE; i = 0; while (i != PARTY_SIZE) { - if (i < var_40) - monSetId = GetMonSetId(factoryLvlMode, challengeNum, TRUE); + if (i < rentalRank) // The more times the player has rented, the more initial rentals are generated from a better set of pokemon + monId = GetFactoryMonId(factoryLvlMode, challengeNum, TRUE); else - monSetId = GetMonSetId(factoryLvlMode, challengeNum, FALSE); + monId = GetFactoryMonId(factoryLvlMode, challengeNum, FALSE); - if (gFacilityTrainerMons[monSetId].species == SPECIES_UNOWN) + if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) continue; // Cannot have two pokemon of the same species. for (j = firstMonId; j < firstMonId + i; j++) { - u16 monId = monIds[j]; - if (monId == monSetId) + u16 existingMonId = monIds[j]; + if (existingMonId == monId) break; - if (species[j] == gFacilityTrainerMons[monSetId].species) + if (species[j] == gFacilityTrainerMons[monId].species) { if (currSpecies == SPECIES_NONE) - currSpecies = gFacilityTrainerMons[monSetId].species; + currSpecies = gFacilityTrainerMons[monId].species; else break; } @@ -564,9 +567,9 @@ static void GenerateInitialRentalMons(void) // Cannot have two same held items. for (j = firstMonId; j < firstMonId + i; j++) { - if (heldItems[j] != 0 && heldItems[j] == gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]) + if (heldItems[j] != 0 && heldItems[j] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) { - if (gFacilityTrainerMons[monSetId].species == currSpecies) + if (gFacilityTrainerMons[monId].species == currSpecies) currSpecies = SPECIES_NONE; break; } @@ -574,10 +577,10 @@ static void GenerateInitialRentalMons(void) if (j != firstMonId + i) continue; - gSaveBlock2Ptr->frontier.rentalMons[i].monId = monSetId; - species[i] = gFacilityTrainerMons[monSetId].species; - heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]; - monIds[i] = monSetId; + gSaveBlock2Ptr->frontier.rentalMons[i].monId = monId; + species[i] = gFacilityTrainerMons[monId].species; + heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]; + monIds[i] = monId; i++; } } @@ -629,10 +632,10 @@ static void GetOpponentBattleStyle(void) for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { - u16 monSetId = gUnknown_03006298[i]; + u16 monId = gUnknown_03006298[i]; for (j = 0; j < MAX_MON_MOVES; j++) { - u8 battleStyle = GetMoveBattleStyle(gFacilityTrainerMons[monSetId].moves[j]); + u8 battleStyle = GetMoveBattleStyle(gFacilityTrainerMons[monId].moves[j]); stylePoints[battleStyle]++; } } @@ -724,16 +727,16 @@ void FillFactoryBrainParty(void) while (i != FRONTIER_PARTY_SIZE) { - u16 monSetId = GetMonSetId(lvlMode, challengeNum, FALSE); + u16 monId = GetFactoryMonId(lvlMode, challengeNum, FALSE); - if (gFacilityTrainerMons[monSetId].species == SPECIES_UNOWN) + if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) continue; - if (monLevel == 50 && monSetId > FRONTIER_MONS_HIGH_TIER) + if (monLevel == 50 && monId > FRONTIER_MONS_HIGH_TIER) continue; for (j = 0; j < 6; j++) { - if (monSetId == gSaveBlock2Ptr->frontier.rentalMons[j].monId) + if (monId == gSaveBlock2Ptr->frontier.rentalMons[j].monId) break; } if (j != 6) @@ -741,7 +744,7 @@ void FillFactoryBrainParty(void) for (k = 0; k < i; k++) { - if (species[k] == gFacilityTrainerMons[monSetId].species) + if (species[k] == gFacilityTrainerMons[monId].species) break; } if (k != i) @@ -749,35 +752,35 @@ void FillFactoryBrainParty(void) for (k = 0; k < i; k++) { - if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]) + if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) break; } if (k != i) continue; - species[i] = gFacilityTrainerMons[monSetId].species; - heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]; + species[i] = gFacilityTrainerMons[monId].species; + heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]; CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i], - gFacilityTrainerMons[monSetId].species, + gFacilityTrainerMons[monId].species, monLevel, - gFacilityTrainerMons[monSetId].nature, + gFacilityTrainerMons[monId].nature, fixedIV, - gFacilityTrainerMons[monSetId].evSpread, + gFacilityTrainerMons[monId].evSpread, otId); friendship = 0; for (k = 0; k < MAX_MON_MOVES; k++) - SetMonMoveAvoidReturn(&gEnemyParty[i], gFacilityTrainerMons[monSetId].moves[k], k); + SetMonMoveAvoidReturn(&gEnemyParty[i], gFacilityTrainerMons[monId].moves[k], k); SetMonData(&gEnemyParty[i], MON_DATA_FRIENDSHIP, &friendship); - SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); + SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); i++; } } -static u16 GetMonSetId(u8 lvlMode, u8 challengeNum, bool8 arg2) +static u16 GetFactoryMonId(u8 lvlMode, u8 challengeNum, bool8 useBetterRange) { - u16 range, monSetId; - u16 adder; + u16 numMons, monId; + u16 adder; // Used to skip past early mons for open level if (lvlMode == FRONTIER_LVL_50) adder = 0; @@ -786,30 +789,31 @@ static u16 GetMonSetId(u8 lvlMode, u8 challengeNum, bool8 arg2) if (challengeNum < 7) { - if (arg2) + if (useBetterRange) { - range = (sMonsToChooseFrom[adder + challengeNum + 1][1] - sMonsToChooseFrom[adder + challengeNum + 1][0]) + 1; - monSetId = Random() % range; - monSetId += sMonsToChooseFrom[adder + challengeNum + 1][0]; + numMons = (sInitialRentalMonRanges[adder + challengeNum + 1][1] - sInitialRentalMonRanges[adder + challengeNum + 1][0]) + 1; + monId = Random() % numMons; + monId += sInitialRentalMonRanges[adder + challengeNum + 1][0]; } else { - range = (sMonsToChooseFrom[adder + challengeNum][1] - sMonsToChooseFrom[adder + challengeNum][0]) + 1; - monSetId = Random() % range; - monSetId += sMonsToChooseFrom[adder + challengeNum][0]; + numMons = (sInitialRentalMonRanges[adder + challengeNum][1] - sInitialRentalMonRanges[adder + challengeNum][0]) + 1; + monId = Random() % numMons; + monId += sInitialRentalMonRanges[adder + challengeNum][0]; } } else { - u16 num = challengeNum; - if (num != 7) - num = 7; - range = (sMonsToChooseFrom[adder + num][1] - sMonsToChooseFrom[adder + num][0]) + 1; - monSetId = Random() % range; - monSetId += sMonsToChooseFrom[adder + num][0]; + u16 challenge = challengeNum; + if (challenge != 7) + challenge = 7; // why bother assigning it above at all + + numMons = (sInitialRentalMonRanges[adder + challenge][1] - sInitialRentalMonRanges[adder + challenge][0]) + 1; + monId = Random() % numMons; + monId += sInitialRentalMonRanges[adder + challenge][0]; } - return monSetId; + return monId; } u8 GetNumPastRentalsRank(u8 battleMode, u8 lvlMode) diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index de2f3a10c..388881a1c 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -24,6 +24,7 @@ #include "pokedex.h" #include "util.h" #include "trainer_pokemon_sprites.h" +#include "starter_choose.h" #include "constants/battle_frontier.h" #include "constants/songs.h" #include "constants/rgb.h" @@ -57,7 +58,7 @@ struct FactorySelecteableMon { - u16 monSetId; + u16 monId; u16 spriteId; u8 selectedId; // 0 - not selected, 1 - first pokemon, 2 - second pokemon, 3 - third pokemon struct Pokemon monData; @@ -132,8 +133,6 @@ struct FactorySwapMonsStruct bool8 unk30; }; -extern const u32 gUnknown_085B18AC[]; - // This file's functions. static void sub_819A44C(struct Sprite *sprite); static void CB2_InitSelectScreen(void); @@ -168,7 +167,7 @@ static u8 sub_819BC9C(void); static u8 Select_OptionSummary(void); static u8 Select_OptionOthers(void); static u8 Select_OptionRentDeselect(void); -static bool32 Select_AreSpeciesValid(u16 monSetId); +static bool32 Select_AreSpeciesValid(u16 monId); static void Swap_DestroyAllSprites(void); static void Swap_ShowYesNoOptions(void); static void sub_819E8EC(void); @@ -263,7 +262,7 @@ static const struct SpriteSheet gUnknown_086103BC[] = static const struct CompressedSpriteSheet gUnknown_086103E4[] = { - {gUnknown_085B18AC, 0x800, TAG_TILE_64}, + {gPokeballSelection_Gfx, 0x800, TAG_TILE_64}, {}, }; @@ -616,7 +615,7 @@ static const struct SpriteSheet gUnknown_08610650[] = static const struct CompressedSpriteSheet gUnknown_086106A0[] = { - {gUnknown_085B18AC, 0x800, TAG_TILE_64}, + {gPokeballSelection_Gfx, 0x800, TAG_TILE_64}, {}, }; @@ -1665,7 +1664,7 @@ static void CreateFrontierFactorySelectableMons(u8 firstMonId) u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; - u8 var_28 = 0; + u8 rentalRank = 0; gFacilityTrainerMons = gBattleFrontierMons; if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) @@ -1673,29 +1672,29 @@ static void CreateFrontierFactorySelectableMons(u8 firstMonId) else level = 50; - var_28 = GetNumPastRentalsRank(battleMode, lvlMode); + rentalRank = GetNumPastRentalsRank(battleMode, lvlMode); otId = T1_READ_32(gSaveBlock2Ptr->playerTrainerId); for (i = 0; i < SELECTABLE_MONS_COUNT; i++) { - u16 monSetId = gSaveBlock2Ptr->frontier.rentalMons[i].monId; - sFactorySelectScreen->mons[i + firstMonId].monSetId = monSetId; - if (i < var_28) + u16 monId = gSaveBlock2Ptr->frontier.rentalMons[i].monId; + sFactorySelectScreen->mons[i + firstMonId].monId = monId; + if (i < rentalRank) ivs = GetFactoryMonFixedIV(challengeNum + 1, 0); else ivs = GetFactoryMonFixedIV(challengeNum, 0); CreateMonWithEVSpreadNatureOTID(&sFactorySelectScreen->mons[i + firstMonId].monData, - gFacilityTrainerMons[monSetId].species, + gFacilityTrainerMons[monId].species, level, - gFacilityTrainerMons[monSetId].nature, + gFacilityTrainerMons[monId].nature, ivs, - gFacilityTrainerMons[monSetId].evSpread, + gFacilityTrainerMons[monId].evSpread, otId); happiness = 0; for (j = 0; j < MAX_MON_MOVES; j++) - SetMonMoveAvoidReturn(&sFactorySelectScreen->mons[i + firstMonId].monData, gFacilityTrainerMons[monSetId].moves[j], j); + SetMonMoveAvoidReturn(&sFactorySelectScreen->mons[i + firstMonId].monData, gFacilityTrainerMons[monId].moves[j], j); SetMonData(&sFactorySelectScreen->mons[i + firstMonId].monData, MON_DATA_FRIENDSHIP, &happiness); - SetMonData(&sFactorySelectScreen->mons[i + firstMonId].monData, MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); + SetMonData(&sFactorySelectScreen->mons[i + firstMonId].monData, MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); } } @@ -1712,20 +1711,20 @@ static void CreateTentFactorySelectableMons(u8 firstMonId) for (i = 0; i < SELECTABLE_MONS_COUNT; i++) { - u16 monSetId = gSaveBlock2Ptr->frontier.rentalMons[i].monId; - sFactorySelectScreen->mons[i + firstMonId].monSetId = monSetId; + u16 monId = gSaveBlock2Ptr->frontier.rentalMons[i].monId; + sFactorySelectScreen->mons[i + firstMonId].monId = monId; CreateMonWithEVSpreadNatureOTID(&sFactorySelectScreen->mons[i + firstMonId].monData, - gFacilityTrainerMons[monSetId].species, + gFacilityTrainerMons[monId].species, level, - gFacilityTrainerMons[monSetId].nature, + gFacilityTrainerMons[monId].nature, ivs, - gFacilityTrainerMons[monSetId].evSpread, + gFacilityTrainerMons[monId].evSpread, otId); happiness = 0; for (j = 0; j < MAX_MON_MOVES; j++) - SetMonMoveAvoidReturn(&sFactorySelectScreen->mons[i + firstMonId].monData, gFacilityTrainerMons[monSetId].moves[j], j); + SetMonMoveAvoidReturn(&sFactorySelectScreen->mons[i + firstMonId].monData, gFacilityTrainerMons[monId].moves[j], j); SetMonData(&sFactorySelectScreen->mons[i + firstMonId].monData, MON_DATA_FRIENDSHIP, &happiness); - SetMonData(&sFactorySelectScreen->mons[i + firstMonId].monData, MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); + SetMonData(&sFactorySelectScreen->mons[i + firstMonId].monData, MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); } } @@ -1740,7 +1739,7 @@ static void Select_CopyMonsToPlayerParty(void) if (sFactorySelectScreen->mons[j].selectedId == i + 1) { gPlayerParty[i] = sFactorySelectScreen->mons[j].monData; - gSaveBlock2Ptr->frontier.rentalMons[i].monId = sFactorySelectScreen->mons[j].monSetId; + gSaveBlock2Ptr->frontier.rentalMons[i].monId = sFactorySelectScreen->mons[j].monId; gSaveBlock2Ptr->frontier.rentalMons[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[i].abilityNum = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ABILITY_NUM, NULL); gSaveBlock2Ptr->frontier.rentalMons[i].ivs = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ATK_IV, NULL); @@ -1871,8 +1870,8 @@ static u8 Select_RunMenuOptionFunc(void) static u8 Select_OptionRentDeselect(void) { u8 selectedId = sFactorySelectScreen->mons[sFactorySelectScreen->cursorPos].selectedId; - u16 monSetId = sFactorySelectScreen->mons[sFactorySelectScreen->cursorPos].monSetId; - if (selectedId == 0 && !Select_AreSpeciesValid(monSetId)) + u16 monId = sFactorySelectScreen->mons[sFactorySelectScreen->cursorPos].monId; + if (selectedId == 0 && !Select_AreSpeciesValid(monId)) { Select_PrintCantSelectSameMon(); sub_819B958(3); @@ -2160,10 +2159,10 @@ static void Select_SetWinRegs(s16 mWin0H, s16 nWin0H, s16 mWin0V, s16 nWin0V) SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_CLR | WINOUT_WIN01_OBJ); } -static bool32 Select_AreSpeciesValid(u16 monSetId) +static bool32 Select_AreSpeciesValid(u16 monId) { u8 i, j; - u32 species = gFacilityTrainerMons[monSetId].species; + u32 species = gFacilityTrainerMons[monId].species; u8 selectState = sFactorySelectScreen->selectingMonsState; for (i = 1; i < selectState; i++) @@ -2172,7 +2171,7 @@ static bool32 Select_AreSpeciesValid(u16 monSetId) { if (sFactorySelectScreen->mons[j].selectedId == i) { - if (gFacilityTrainerMons[sFactorySelectScreen->mons[j].monSetId].species == species) + if (gFacilityTrainerMons[sFactorySelectScreen->mons[j].monId].species == species) return FALSE; break; diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 50001cebe..54fc88f24 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -24,20 +24,21 @@ #include "contest.h" #include "constants/songs.h" #include "constants/rgb.h" +#include "constants/battle_palace.h" extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE2; extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern const u8 gUnknown_0831C604[]; +extern const u8 gBattlePalaceNatureToMoveTarget[]; extern const u8 * const gBattleAnims_General[]; extern const u8 * const gBattleAnims_Special[]; extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; // this file's functions -static u8 sub_805D4A8(u16 move); -static u16 BattlePalaceGetTargetRetValue(void); +static u8 GetBattlePalaceMoveGroup(u16 move); +static u16 GetBattlePalaceTarget(void); static void sub_805D7EC(struct Sprite *sprite); static bool8 ShouldAnimBeDoneRegardlessOfSubsitute(u8 animId); static void Task_ClearBitWhenBattleTableAnimDone(u8 taskId); @@ -108,6 +109,7 @@ void FreeBattleSpritesData(void) FREE_AND_SET_NULL(gBattleSpritesDataPtr); } +// Pokemon chooses move to use in Battle Palace rather than player u16 ChooseMoveAndTargetInBattlePalace(void) { s32 i, var1, var2; @@ -116,60 +118,88 @@ u16 ChooseMoveAndTargetInBattlePalace(void) u8 unusableMovesBits = CheckMoveLimitations(gActiveBattler, 0, 0xFF); s32 percent = Random() % 100; - i = (gBattleStruct->field_92 & gBitTable[gActiveBattler]) ? 2 : 0; - var2 = i; - var1 = i + 2; - - for (; i < var1; i++) + // Heavy variable re-use here makes this hard to read without defines + // Possibly just optimization? might still match with additional vars + #define maxGroupNum var1 + #define minGroupNum var2 + #define selectedGroup percent + #define selectedMoves var2 + #define moveTarget var1 + #define validMoveFlags var1 + #define numValidMoveGroups var2 + #define validMoveGroup var2 + + // If battler is < 50% HP and not asleep, use second set of move group likelihoods + // otherwise use first set + i = (gBattleStruct->palaceFlags & gBitTable[gActiveBattler]) ? 2 : 0; + minGroupNum = i; + + maxGroupNum = i + 2; // + 2 because there are two percentages per set of likelihoods + + // Each nature has a different percent chance to select a move from one of 3 move groups + // If percent is less than 1st check, use move from "Attack" group + // If percent is less than 2nd check, use move from "Defense" group + // Otherwise use move from "Support" group + for (; i < maxGroupNum; i++) { - if (gUnknown_0831C494[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)][i] > percent) + if (gBattlePalaceNatureToMoveGroupLikelihood[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)][i] > percent) break; } + selectedGroup = i - minGroupNum; + if (i == maxGroupNum) + selectedGroup = PALACE_MOVE_GROUP_SUPPORT; - percent = i - var2; - if (i == var1) - percent = 2; - - for (var2 = 0, i = 0; i < MAX_MON_MOVES; i++) + // Flag moves that match selected group, to be passed to AI + for (selectedMoves = 0, i = 0; i < MAX_MON_MOVES; i++) { if (moveInfo->moves[i] == MOVE_NONE) break; - if (percent == sub_805D4A8(moveInfo->moves[i]) && moveInfo->currentPp[i] != 0) - var2 |= gBitTable[i]; + if (selectedGroup == GetBattlePalaceMoveGroup(moveInfo->moves[i]) && moveInfo->currentPp[i] != 0) + selectedMoves |= gBitTable[i]; } - if (var2 != 0) + // Pass selected moves to AI, pick one + if (selectedMoves != 0) { - gBattleStruct->field_92 &= 0xF; - gBattleStruct->field_92 |= (var2 << 4); - BattleAI_SetupAIData(var2); + gBattleStruct->palaceFlags &= 0xF; + gBattleStruct->palaceFlags |= (selectedMoves << 4); + BattleAI_SetupAIData(selectedMoves); chosenMoveId = BattleAI_ChooseMoveOrAction(); } + // If no moves matched the selected group, pick a new move from groups the pokemon has + // In this case the AI is not checked again, so the choice may be worse + // If a move is chosen this way, there's a 50% chance that it will be unable to use it anyway if (chosenMoveId == -1) { if (unusableMovesBits != 0xF) { - var1 = 0, var2 = 0; + validMoveFlags = 0, numValidMoveGroups = 0; for (i = 0; i < MAX_MON_MOVES; i++) { - if (sub_805D4A8(moveInfo->moves[i]) == 0 && !(gBitTable[i] & unusableMovesBits)) - var1 += 0x1; - if (sub_805D4A8(moveInfo->moves[i]) == 1 && !(gBitTable[i] & unusableMovesBits)) - var1 += 0x10; - if (sub_805D4A8(moveInfo->moves[i]) == 2 && !(gBitTable[i] & unusableMovesBits)) - var1 += 0x100; + // validMoveFlags is used here as a bitfield for which moves can be used for each move group type + // first 4 bits are for attack (1 for each move), then 4 bits for defense, and 4 for support + if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_ATTACK && !(gBitTable[i] & unusableMovesBits)) + validMoveFlags += (1 << 0); + if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_DEFENSE && !(gBitTable[i] & unusableMovesBits)) + validMoveFlags += (1 << 4); + if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_SUPPORT && !(gBitTable[i] & unusableMovesBits)) + validMoveFlags += (1 << 8); } - if ((var1 & 0xF) > 1) - var2++; - if ((var1 & 0xF0) > 0x1F) - var2++; - if ((var1 & 0xF0) > 0x1FF) - var2++; - - if (var2 > 1 || var2 == 0) + // Count the move groups the pokemon has + if ((validMoveFlags & 0xF) > 1) + numValidMoveGroups++; + if ((validMoveFlags & 0xF0) > 0x1F) + numValidMoveGroups++; + if ((validMoveFlags & 0xF0) > 0x1FF) + numValidMoveGroups++; + + + // If more than 1 possible move group, or no possible move groups + // then choose move randomly + if (numValidMoveGroups > 1 || numValidMoveGroups == 0) { do { @@ -178,32 +208,35 @@ u16 ChooseMoveAndTargetInBattlePalace(void) chosenMoveId = i; } while (chosenMoveId == -1); } + // Otherwise randomly choose move of only available move group else { - if ((var1 & 0xF) > 1) - var2 = 0; - if ((var1 & 0xF0) > 0x1F) - var2 = 1; - if ((var1 & 0xF0) > 0x1FF) - var2 = 2; + if ((validMoveFlags & 0xF) > 1) + validMoveGroup = PALACE_MOVE_GROUP_ATTACK; + if ((validMoveFlags & 0xF0) > 0x1F) + validMoveGroup = PALACE_MOVE_GROUP_DEFENSE; + if ((validMoveFlags & 0xF0) > 0x1FF) + validMoveGroup = PALACE_MOVE_GROUP_SUPPORT; do { i = Random() % MAX_MON_MOVES; - if (!(gBitTable[i] & unusableMovesBits) && var2 == sub_805D4A8(moveInfo->moves[i])) + if (!(gBitTable[i] & unusableMovesBits) && validMoveGroup == GetBattlePalaceMoveGroup(moveInfo->moves[i])) chosenMoveId = i; } while (chosenMoveId == -1); } + // If a move was selected (and in this case was not from the Nature-chosen group) + // then there's a 50% chance it won't be used anyway if (Random() % 100 > 49) { - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; return 0; } } else { - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; return 0; } } @@ -211,26 +244,35 @@ u16 ChooseMoveAndTargetInBattlePalace(void) if (moveInfo->moves[chosenMoveId] == MOVE_CURSE) { if (moveInfo->monType1 != TYPE_GHOST && moveInfo->monType2 != TYPE_GHOST) - var1 = MOVE_TARGET_USER; + moveTarget = MOVE_TARGET_USER; else - var1 = MOVE_TARGET_SELECTED; + moveTarget = MOVE_TARGET_SELECTED; } else { - var1 = gBattleMoves[moveInfo->moves[chosenMoveId]].target; + moveTarget = gBattleMoves[moveInfo->moves[chosenMoveId]].target; } - if (var1 & MOVE_TARGET_USER) + if (moveTarget & MOVE_TARGET_USER) chosenMoveId |= (gActiveBattler << 8); - else if (var1 == MOVE_TARGET_SELECTED) - chosenMoveId |= (BattlePalaceGetTargetRetValue()); + else if (moveTarget == MOVE_TARGET_SELECTED) + chosenMoveId |= GetBattlePalaceTarget(); else chosenMoveId |= (GetBattlerAtPosition((GetBattlerPosition(gActiveBattler) & BIT_SIDE) ^ BIT_SIDE) << 8); return chosenMoveId; } -static u8 sub_805D4A8(u16 move) +#undef maxGroupNum +#undef minGroupNum +#undef selectedGroup +#undef selectedMoves +#undef moveTarget +#undef validMoveFlags +#undef numValidMoveGroups +#undef validMoveGroup + +static u8 GetBattlePalaceMoveGroup(u16 move) { switch (gBattleMoves[move].target) { @@ -240,21 +282,21 @@ static u8 sub_805D4A8(u16 move) case MOVE_TARGET_BOTH: case MOVE_TARGET_FOES_AND_ALLY: if (gBattleMoves[move].power == 0) - return 2; + return PALACE_MOVE_GROUP_SUPPORT; else - return 0; + return PALACE_MOVE_GROUP_ATTACK; break; case MOVE_TARGET_DEPENDS: case MOVE_TARGET_OPPONENTS_FIELD: - return 2; + return PALACE_MOVE_GROUP_SUPPORT; case MOVE_TARGET_USER: - return 1; + return PALACE_MOVE_GROUP_DEFENSE; default: - return 0; + return PALACE_MOVE_GROUP_ATTACK; } } -static u16 BattlePalaceGetTargetRetValue(void) +static u16 GetBattlePalaceTarget(void) { if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { @@ -274,19 +316,19 @@ static u16 BattlePalaceGetTargetRetValue(void) if (gBattleMons[opposing1].hp == gBattleMons[opposing2].hp) return (((gActiveBattler & BIT_SIDE) ^ BIT_SIDE) + (Random() & 2)) << 8; - switch (gUnknown_0831C604[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)]) + switch (gBattlePalaceNatureToMoveTarget[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)]) { - case 0: + case PALACE_TARGET_STRONGER: if (gBattleMons[opposing1].hp > gBattleMons[opposing2].hp) return opposing1 << 8; else return opposing2 << 8; - case 1: + case PALACE_TARGET_WEAKER: if (gBattleMons[opposing1].hp < gBattleMons[opposing2].hp) return opposing1 << 8; else return opposing2 << 8; - case 2: + case PALACE_TARGET_RANDOM: return (((gActiveBattler & BIT_SIDE) ^ BIT_SIDE) + (Random() & 2)) << 8; } } diff --git a/src/battle_main.c b/src/battle_main.c index 42f0fb2ad..1d8aeab53 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3112,7 +3112,7 @@ static void BattleStartClearSetData(void) } gBattleStruct->givenExpMons = 0; - gBattleStruct->field_92 = 0; + gBattleStruct->palaceFlags = 0; gRandomTurnNumber = Random(); @@ -3159,7 +3159,7 @@ void SwitchInClearSetData(void) && (gDisableStructs[i].battlerWithSureHit == gActiveBattler)) { gStatuses3[i] &= ~(STATUS3_ALWAYS_HITS); - gStatuses3[i] |= 0x10; + gStatuses3[i] |= STATUS3_ALWAYS_HITS_TURN(2); } } } @@ -3214,7 +3214,7 @@ void SwitchInClearSetData(void) *(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; *(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - gBattleStruct->field_92 &= ~(gBitTable[gActiveBattler]); + gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); for (i = 0; i < gBattlersCount; i++) { @@ -3309,7 +3309,7 @@ void FaintClearSetData(void) *(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; *(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - gBattleStruct->field_92 &= ~(gBitTable[gActiveBattler]); + gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); for (i = 0; i < gBattlersCount; i++) { @@ -4052,7 +4052,7 @@ void BattleTurnPassed(void) gRandomTurnNumber = Random(); if (gBattleTypeFlags & BATTLE_TYPE_PALACE) - BattleScriptExecute(BattleScript_82DB881); + BattleScriptExecute(BattleScript_PalacePrintFlavorText); else if (gBattleTypeFlags & BATTLE_TYPE_ARENA && gBattleStruct->arenaTurnCounter == 0) BattleScriptExecute(BattleScript_ArenaTurnBeginning); } diff --git a/src/battle_message.c b/src/battle_message.c index 693058e2f..2a0ba4ded 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -312,23 +312,23 @@ static const u8 sText_StatsWontIncrease2[] = _("{B_ATK_NAME_WITH_PREFIX}'s stats static const u8 sText_StatsWontDecrease2[] = _("{B_DEF_NAME_WITH_PREFIX}'s stats won't\ngo any lower!"); static const u8 sText_CriticalHit[] = _("A critical hit!"); static const u8 sText_OneHitKO[] = _("It's a one-hit KO!"); -static const u8 sText_123Poof[] = _("{PAUSE 32}1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p"); +static const u8 sText_123Poof[] = _("{PAUSE 32}1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE SE_KON}Poof!\p"); static const u8 sText_AndEllipsis[] = _("And…\p"); static const u8 sText_HMMovesCantBeForgotten[] = _("HM moves can't be\nforgotten now.\p"); static const u8 sText_NotVeryEffective[] = _("It's not very effective…"); static const u8 sText_SuperEffective[] = _("It's super effective!"); -static const u8 sText_GotAwaySafely[] = _("{PLAY_SE 0x0011}Got away safely!\p"); -static const u8 sText_PkmnFledUsingIts[] = _("{PLAY_SE 0x0011}{B_ATK_NAME_WITH_PREFIX} fled\nusing its {B_LAST_ITEM}!\p"); -static const u8 sText_PkmnFledUsing[] = _("{PLAY_SE 0x0011}{B_ATK_NAME_WITH_PREFIX} fled\nusing {B_ATK_ABILITY}!\p"); -static const u8 sText_WildPkmnFled[] = _("{PLAY_SE 0x0011}Wild {B_BUFF1} fled!"); +static const u8 sText_GotAwaySafely[] = _("{PLAY_SE SE_NIGERU}Got away safely!\p"); +static const u8 sText_PkmnFledUsingIts[] = _("{PLAY_SE SE_NIGERU}{B_ATK_NAME_WITH_PREFIX} fled\nusing its {B_LAST_ITEM}!\p"); +static const u8 sText_PkmnFledUsing[] = _("{PLAY_SE SE_NIGERU}{B_ATK_NAME_WITH_PREFIX} fled\nusing {B_ATK_ABILITY}!\p"); +static const u8 sText_WildPkmnFled[] = _("{PLAY_SE SE_NIGERU}Wild {B_BUFF1} fled!"); static const u8 sText_PlayerDefeatedLinkTrainer[] = _("Player defeated\n{B_LINK_OPPONENT1_NAME}!"); static const u8 sText_TwoLinkTrainersDefeated[] = _("Player beat {B_LINK_OPPONENT1_NAME}\nand {B_LINK_OPPONENT2_NAME}!"); static const u8 sText_PlayerLostAgainstLinkTrainer[] = _("Player lost against\n{B_LINK_OPPONENT1_NAME}!"); static const u8 sText_PlayerLostToTwo[] = _("Player lost to {B_LINK_OPPONENT1_NAME}\nand {B_LINK_OPPONENT2_NAME}!"); static const u8 sText_PlayerBattledToDrawLinkTrainer[] = _("Player battled to a draw against\n{B_LINK_OPPONENT1_NAME}!"); static const u8 sText_PlayerBattledToDrawVsTwo[] = _("Player battled to a draw against\n{B_LINK_OPPONENT1_NAME} and {B_LINK_OPPONENT2_NAME}!"); -static const u8 sText_WildFled[] = _("{PLAY_SE 0x0011}{B_LINK_OPPONENT1_NAME} fled!"); -static const u8 sText_TwoWildFled[] = _("{PLAY_SE 0x0011}{B_LINK_OPPONENT1_NAME} and\n{B_LINK_OPPONENT2_NAME} fled!"); +static const u8 sText_WildFled[] = _("{PLAY_SE SE_NIGERU}{B_LINK_OPPONENT1_NAME} fled!"); +static const u8 sText_TwoWildFled[] = _("{PLAY_SE SE_NIGERU}{B_LINK_OPPONENT1_NAME} and\n{B_LINK_OPPONENT2_NAME} fled!"); static const u8 sText_NoRunningFromTrainers[] = _("No! There's no running\nfrom a TRAINER battle!\p"); static const u8 sText_CantEscape[] = _("Can't escape!\p"); static const u8 sText_DontLeaveBirch[] = _("PROF. BIRCH: Don't leave me like this!\p"); @@ -378,7 +378,7 @@ static const u8 sText_PkmnCuriousAboutX[] = _("{B_OPPONENT_MON1_NAME} is curious static const u8 sText_PkmnEnthralledByX[] = _("{B_OPPONENT_MON1_NAME} is enthralled by\nthe {B_BUFF1}!"); static const u8 sText_PkmnIgnoredX[] = _("{B_OPPONENT_MON1_NAME} completely ignored\nthe {B_BUFF1}!"); static const u8 sText_ThrewPokeblockAtPkmn[] = _("{B_PLAYER_NAME} threw a {POKEBLOCK}\nat the {B_OPPONENT_MON1_NAME}!"); -static const u8 sText_OutOfSafariBalls[] = _("{PLAY_SE 0x0049}ANNOUNCER: You're out of\nSAFARI BALLS! Game over!\p"); +static const u8 sText_OutOfSafariBalls[] = _("{PLAY_SE SE_PINPON}ANNOUNCER: You're out of\nSAFARI BALLS! Game over!\p"); static const u8 sText_OpponentMon1Appeared[] = _("{B_OPPONENT_MON1_NAME} appeared!\p"); static const u8 sText_WildPkmnAppeared[] = _("Wild {B_OPPONENT_MON1_NAME} appeared!\p"); static const u8 sText_WildPkmnAppeared2[] = _("Wild {B_OPPONENT_MON1_NAME} appeared!\p"); @@ -1267,10 +1267,12 @@ static const u8 sText_PkmnGettingIntoPosition[] = _("{B_SCR_ACTIVE_NAME_WITH_PRE static const u8 sText_PkmnBeganGrowlingDeeply[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} began growling deeply!"); static const u8 sText_PkmnEagerForMore[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is eager for more!"); -const u16 gStringIds_85CCF0A[] = +const u16 gBattlePalaceFlavorTextTable[] = { - STRINGID_GLINTAPPEARSINEYE, STRINGID_PKMNGETTINGINTOPOSITION, - STRINGID_PKMNBEGANGROWLINGDEEPLY, STRINGID_PKMNEAGERFORMORE + STRINGID_GLINTAPPEARSINEYE, + STRINGID_PKMNGETTINGINTOPOSITION, + STRINGID_PKMNBEGANGROWLINGDEEPLY, + STRINGID_PKMNEAGERFORMORE }; static const u8 sText_RefIfNothingIsDecided[] = _("REFEREE: If nothing is decided in\n3 turns, we will go to judging!"); @@ -1303,7 +1305,7 @@ static const u8 sText_QuestionForfeitMatch[] = _("Would you like to forfeit the static const u8 sText_ForfeitedMatch[] = _("{B_PLAYER_NAME} forfeited the match!"); static const u8 sText_Trainer1WinText[] = _("{B_TRAINER1_WIN_TEXT}"); static const u8 sText_Trainer2WinText[] = _("{B_TRAINER2_WIN_TEXT}"); -static const u8 sText_Trainer1Fled[] = _( "{PLAY_SE 0x0011}{B_TRAINER1_CLASS} {B_TRAINER1_NAME} fled!"); +static const u8 sText_Trainer1Fled[] = _( "{PLAY_SE SE_NIGERU}{B_TRAINER1_CLASS} {B_TRAINER1_NAME} fled!"); static const u8 sText_PlayerLostAgainstTrainer1[] = _("Player lost against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!"); static const u8 sText_PlayerBattledToDrawTrainer1[] = _("Player battled to a draw against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!"); const u8 gText_RecordBattleToPass[] = _("Would you like to record your battle\non your FRONTIER PASS?"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 84f2b1f4d..4e0e087b6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -606,111 +606,66 @@ static const struct StatFractions sAccuracyStageRatios[] = // The chance is 1/N for each stage. static const u16 sCriticalHitChance[] = {16, 8, 4, 3, 2}; -static const u32 sStatusFlagsForMoveEffects[] = -{ - 0x00000000, - STATUS1_SLEEP, - STATUS1_POISON, - STATUS1_BURN, - STATUS1_FREEZE, - STATUS1_PARALYSIS, - STATUS1_TOXIC_POISON, - STATUS2_CONFUSION, - STATUS2_FLINCHED, - 0x00000000, - STATUS2_UPROAR, - 0x00000000, - STATUS2_MULTIPLETURNS, - STATUS2_WRAPPED, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - STATUS2_RECHARGE, - 0x00000000, - 0x00000000, - STATUS2_ESCAPE_PREVENTION, - STATUS2_NIGHTMARE, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - STATUS2_LOCK_CONFUSE, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000 +static const u32 sStatusFlagsForMoveEffects[NUM_MOVE_EFFECTS] = +{ + [MOVE_EFFECT_SLEEP] = STATUS1_SLEEP, + [MOVE_EFFECT_POISON] = STATUS1_POISON, + [MOVE_EFFECT_BURN] = STATUS1_BURN, + [MOVE_EFFECT_FREEZE] = STATUS1_FREEZE, + [MOVE_EFFECT_PARALYSIS] = STATUS1_PARALYSIS, + [MOVE_EFFECT_TOXIC] = STATUS1_TOXIC_POISON, + [MOVE_EFFECT_CONFUSION] = STATUS2_CONFUSION, + [MOVE_EFFECT_FLINCH] = STATUS2_FLINCHED, + [MOVE_EFFECT_UPROAR] = STATUS2_UPROAR, + [MOVE_EFFECT_CHARGING] = STATUS2_MULTIPLETURNS, + [MOVE_EFFECT_WRAP] = STATUS2_WRAPPED, + [MOVE_EFFECT_RECHARGE] = STATUS2_RECHARGE, + [MOVE_EFFECT_PREVENT_ESCAPE] = STATUS2_ESCAPE_PREVENTION, + [MOVE_EFFECT_NIGHTMARE] = STATUS2_NIGHTMARE, + [MOVE_EFFECT_THRASH] = STATUS2_LOCK_CONFUSE, }; static const u8* const sMoveEffectBS_Ptrs[] = { - [0] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SLEEP] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_POISON] = BattleScript_MoveEffectPoison, - [MOVE_EFFECT_BURN] = BattleScript_MoveEffectBurn, - [MOVE_EFFECT_FREEZE] = BattleScript_MoveEffectFreeze, - [MOVE_EFFECT_PARALYSIS] = BattleScript_MoveEffectParalysis, - [MOVE_EFFECT_TOXIC] = BattleScript_MoveEffectToxic, - [MOVE_EFFECT_CONFUSION] = BattleScript_MoveEffectConfusion, - [MOVE_EFFECT_FLINCH] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_TRI_ATTACK] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_UPROAR] = BattleScript_MoveEffectUproar, - [MOVE_EFFECT_PAYDAY] = BattleScript_MoveEffectPayDay, - [MOVE_EFFECT_CHARGING] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_WRAP] = BattleScript_MoveEffectWrap, - [MOVE_EFFECT_RECOIL_25] = BattleScript_MoveEffectRecoil, - [MOVE_EFFECT_ATK_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_DEF_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SPD_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SP_ATK_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SP_DEF_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ACC_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_EVS_PLUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ATK_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_DEF_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SPD_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SP_ATK_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_SP_DEF_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ACC_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_EVS_MINUS_1] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_RECHARGE] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_RAGE] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_STEAL_ITEM] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_PREVENT_ESCAPE] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_NIGHTMARE] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ALL_STATS_UP] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_RAPIDSPIN] = BattleScript_MoveEffectSleep, + [0] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_SLEEP] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_POISON] = BattleScript_MoveEffectPoison, + [MOVE_EFFECT_BURN] = BattleScript_MoveEffectBurn, + [MOVE_EFFECT_FREEZE] = BattleScript_MoveEffectFreeze, + [MOVE_EFFECT_PARALYSIS] = BattleScript_MoveEffectParalysis, + [MOVE_EFFECT_TOXIC] = BattleScript_MoveEffectToxic, + [MOVE_EFFECT_CONFUSION] = BattleScript_MoveEffectConfusion, + [MOVE_EFFECT_FLINCH] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_TRI_ATTACK] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_UPROAR] = BattleScript_MoveEffectUproar, + [MOVE_EFFECT_PAYDAY] = BattleScript_MoveEffectPayDay, + [MOVE_EFFECT_CHARGING] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_WRAP] = BattleScript_MoveEffectWrap, + [MOVE_EFFECT_RECOIL_25] = BattleScript_MoveEffectRecoil, + [MOVE_EFFECT_ATK_PLUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_DEF_PLUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_SPD_PLUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_SP_ATK_PLUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_SP_DEF_PLUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_ACC_PLUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_EVS_PLUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_ATK_MINUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_DEF_MINUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_SPD_MINUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_SP_ATK_MINUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_SP_DEF_MINUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_ACC_MINUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_EVS_MINUS_1] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_RECHARGE] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_RAGE] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_STEAL_ITEM] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_PREVENT_ESCAPE] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_NIGHTMARE] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_ALL_STATS_UP] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_RAPIDSPIN] = BattleScript_MoveEffectSleep, [MOVE_EFFECT_REMOVE_PARALYSIS] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_ATK_DEF_DOWN] = BattleScript_MoveEffectSleep, - [MOVE_EFFECT_RECOIL_33] = BattleScript_MoveEffectRecoil, + [MOVE_EFFECT_ATK_DEF_DOWN] = BattleScript_MoveEffectSleep, + [MOVE_EFFECT_RECOIL_33] = BattleScript_MoveEffectRecoil, }; static const struct WindowTemplate sUnusedWinTemplate = {0, 1, 3, 7, 0xF, 0x1F, 0x3F}; @@ -797,16 +752,16 @@ static const u8 sFlailHpScaleToPowerTable[] = static const u16 sNaturePowerMoves[] = { - MOVE_STUN_SPORE, - MOVE_RAZOR_LEAF, - MOVE_EARTHQUAKE, - MOVE_HYDRO_PUMP, - MOVE_SURF, - MOVE_BUBBLE_BEAM, - MOVE_ROCK_SLIDE, - MOVE_SHADOW_BALL, - MOVE_SWIFT, - MOVE_SWIFT + [BATTLE_TERRAIN_GRASS] = MOVE_STUN_SPORE, + [BATTLE_TERRAIN_LONG_GRASS] = MOVE_RAZOR_LEAF, + [BATTLE_TERRAIN_SAND] = MOVE_EARTHQUAKE, + [BATTLE_TERRAIN_UNDERWATER] = MOVE_HYDRO_PUMP, + [BATTLE_TERRAIN_WATER] = MOVE_SURF, + [BATTLE_TERRAIN_POND] = MOVE_BUBBLE_BEAM, + [BATTLE_TERRAIN_MOUNTAIN] = MOVE_ROCK_SLIDE, + [BATTLE_TERRAIN_CAVE] = MOVE_SHADOW_BALL, + [BATTLE_TERRAIN_BUILDING] = MOVE_SWIFT, + [BATTLE_TERRAIN_PLAIN] = MOVE_SWIFT }; // format: min. weight (hectograms), base power @@ -864,58 +819,92 @@ static const u8 sPickupProbabilities[] = static const u8 sTerrainToType[] = { - TYPE_GRASS, // tall grass - TYPE_GRASS, // long grass - TYPE_GROUND, // sand - TYPE_WATER, // underwater - TYPE_WATER, // water - TYPE_WATER, // pond water - TYPE_ROCK, // rock - TYPE_ROCK, // cave - TYPE_NORMAL, // building - TYPE_NORMAL, // plain + [BATTLE_TERRAIN_GRASS] = TYPE_GRASS, + [BATTLE_TERRAIN_LONG_GRASS] = TYPE_GRASS, + [BATTLE_TERRAIN_SAND] = TYPE_GROUND, + [BATTLE_TERRAIN_UNDERWATER] = TYPE_WATER, + [BATTLE_TERRAIN_WATER] = TYPE_WATER, + [BATTLE_TERRAIN_POND] = TYPE_WATER, + [BATTLE_TERRAIN_MOUNTAIN] = TYPE_ROCK, + [BATTLE_TERRAIN_CAVE] = TYPE_ROCK, + [BATTLE_TERRAIN_BUILDING] = TYPE_NORMAL, + [BATTLE_TERRAIN_PLAIN] = TYPE_NORMAL, }; +// - ITEM_ULTRA_BALL skips Master Ball and ITEM_NONE static const u8 sBallCatchBonuses[] = { - 20, 15, 10, 15 // Ultra, Great, Poke, Safari + [ITEM_ULTRA_BALL - ITEM_ULTRA_BALL] = 20, + [ITEM_GREAT_BALL - ITEM_ULTRA_BALL] = 15, + [ITEM_POKE_BALL - ITEM_ULTRA_BALL] = 10, + [ITEM_SAFARI_BALL - ITEM_ULTRA_BALL] = 15 }; -const ALIGNED(4) u8 gUnknown_0831C494[][4] = -{ - {0x3d, 0x44, 0x3d, 0x44}, - {0x14, 0x2d, 0x54, 0x5c}, - {0x46, 0x55, 0x20, 0x5c}, - {0x26, 0x45, 0x46, 0x55}, - {0x14, 0x5a, 0x46, 0x5c}, - {0x1e, 0x32, 0x20, 0x5a}, - {0x38, 0x4e, 0x38, 0x4e}, - {0x19, 0x28, 0x4b, 0x5a}, - {0x45, 0x4b, 0x1c, 0x53}, - {0x23, 0x2d, 0x1d, 0x23}, - {0x3e, 0x48, 0x1e, 0x32}, - {0x3a, 0x5f, 0x58, 0x5e}, - {0x22, 0x2d, 0x1d, 0x28}, - {0x23, 0x28, 0x23, 0x5f}, - {0x38, 0x4e, 0x38, 0x4e}, - {0x23, 0x50, 0x22, 0x5e}, - {0x2c, 0x5e, 0x22, 0x28}, - {0x38, 0x4e, 0x38, 0x4e}, - {0x1e, 0x58, 0x1e, 0x58}, - {0x1e, 0x2b, 0x1b, 0x21}, - {0x28, 0x5a, 0x19, 0x57}, - {0x12, 0x58, 0x5a, 0x5f}, - {0x58, 0x5e, 0x16, 0x2a}, - {0x2a, 0x5c, 0x2a, 0x2f}, - {0x38, 0x4e, 0x38, 0x4e} +// In Battle Palace, moves are chosen based on the pokemons nature rather than by the player +// Moves are grouped into "Attack", "Defense", or "Support" (see PALACE_MOVE_GROUP_*) +// Each nature has a certain percent chance of selecting a move from a particular group +// and a separate percent chance for each group when below 50% HP +// The table below doesn't list percentages for Support because you can subtract the other two +// Support percentages are listed in comments off to the side instead +#define PALACE_STYLE(atk, def, atkLow, defLow) {atk, atk + def, atkLow, atkLow + defLow} + +const ALIGNED(4) u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4] = +{ + [NATURE_HARDY] = PALACE_STYLE(61, 7, 61, 7), // 32% support >= 50% HP, 32% support < 50% HP + [NATURE_LONELY] = PALACE_STYLE(20, 25, 84, 8), // 55%, 8% + [NATURE_BRAVE] = PALACE_STYLE(70, 15, 32, 60), // 15%, 8% + [NATURE_ADAMANT] = PALACE_STYLE(38, 31, 70, 15), // 31%, 15% + [NATURE_NAUGHTY] = PALACE_STYLE(20, 70, 70, 22), // 10%, 8% + [NATURE_BOLD] = PALACE_STYLE(30, 20, 32, 58), // 50%, 10% + [NATURE_DOCILE] = PALACE_STYLE(56, 22, 56, 22), // 22%, 22% + [NATURE_RELAXED] = PALACE_STYLE(25, 15, 75, 15), // 60%, 10% + [NATURE_IMPISH] = PALACE_STYLE(69, 6, 28, 55), // 25%, 17% + [NATURE_LAX] = PALACE_STYLE(35, 10, 29, 6), // 55%, 65% + [NATURE_TIMID] = PALACE_STYLE(62, 10, 30, 20), // 28%, 50% + [NATURE_HASTY] = PALACE_STYLE(58, 37, 88, 6), // 5%, 6% + [NATURE_SERIOUS] = PALACE_STYLE(34, 11, 29, 11), // 55%, 60% + [NATURE_JOLLY] = PALACE_STYLE(35, 5, 35, 60), // 60%, 5% + [NATURE_NAIVE] = PALACE_STYLE(56, 22, 56, 22), // 22%, 22% + [NATURE_MODEST] = PALACE_STYLE(35, 45, 34, 60), // 20%, 6% + [NATURE_MILD] = PALACE_STYLE(44, 50, 34, 6), // 6%, 60% + [NATURE_QUIET] = PALACE_STYLE(56, 22, 56, 22), // 22%, 22% + [NATURE_BASHFUL] = PALACE_STYLE(30, 58, 30, 58), // 12%, 12% + [NATURE_RASH] = PALACE_STYLE(30, 13, 27, 6), // 57%, 67% + [NATURE_CALM] = PALACE_STYLE(40, 50, 25, 62), // 10%, 13% + [NATURE_GENTLE] = PALACE_STYLE(18, 70, 90, 5), // 12%, 5% + [NATURE_SASSY] = PALACE_STYLE(88, 6, 22, 20), // 6%, 58% + [NATURE_CAREFUL] = PALACE_STYLE(42, 50, 42, 5), // 8%, 53% + [NATURE_QUIRKY] = PALACE_STYLE(56, 22, 56, 22) // 22%, 22% }; -static const u8 sUnknown_0831C4F8[] = -{ - 0x03, 0x00, 0x01, 0x00, 0x00, 0x01, 0x03, 0x00, - 0x01, 0x02, 0x02, 0x00, 0x03, 0x01, 0x03, 0x01, - 0x02, 0x03, 0x03, 0x02, 0x01, 0x00, 0x02, 0x02, - 0x03, 0x00, 0x00, 0x00 +// Indices into gBattlePalaceFlavorTextTable +static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] = +{ + [NATURE_HARDY] = 3, + [NATURE_LONELY] = 0, + [NATURE_BRAVE] = 1, + [NATURE_ADAMANT] = 0, + [NATURE_NAUGHTY] = 0, + [NATURE_BOLD] = 1, + [NATURE_DOCILE] = 3, + [NATURE_RELAXED] = 0, + [NATURE_IMPISH] = 1, + [NATURE_LAX] = 2, + [NATURE_TIMID] = 2, + [NATURE_HASTY] = 0, + [NATURE_SERIOUS] = 3, + [NATURE_JOLLY] = 1, + [NATURE_NAIVE] = 3, + [NATURE_MODEST] = 1, + [NATURE_MILD] = 2, + [NATURE_QUIET] = 3, + [NATURE_BASHFUL] = 3, + [NATURE_RASH] = 2, + [NATURE_CALM] = 1, + [NATURE_GENTLE] = 0, + [NATURE_SASSY] = 2, + [NATURE_CAREFUL] = 2, + [NATURE_QUIRKY] = 3, }; static void Cmd_attackcanceler(void) @@ -2245,7 +2234,7 @@ void SetMoveEffect(bool8 primary, u8 certain) if (gBattleMons[gEffectBattler].status2 & STATUS2_SUBSTITUTE && affectsUser != MOVE_EFFECT_AFFECTS_USER) INCREMENT_RESET_RETURN - if (gBattleCommunication[MOVE_EFFECT_BYTE] <= 6) // status change + if (gBattleCommunication[MOVE_EFFECT_BYTE] <= PRIMARY_STATUS_MOVE_EFFECT) { switch (sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]) { @@ -2453,7 +2442,7 @@ void SetMoveEffect(bool8 primary, u8 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); if (sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]] == STATUS1_SLEEP) - gBattleMons[gEffectBattler].status1 |= ((Random() & 3) + 2); + gBattleMons[gEffectBattler].status1 |= STATUS1_SLEEP_TURN((Random() & 3) + 2); // 2-5 turns else gBattleMons[gEffectBattler].status1 |= sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]; @@ -2513,7 +2502,7 @@ void SetMoveEffect(bool8 primary, u8 certain) } else { - gBattleMons[gEffectBattler].status2 |= (((Random()) % 0x4)) + 2; + gBattleMons[gEffectBattler].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2); // 2-5 turns BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; @@ -2546,7 +2535,7 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gEffectBattler] = gCurrentMove; - gBattleMons[gEffectBattler].status2 |= ((Random() & 3) + 2) << 4; + gBattleMons[gEffectBattler].status2 |= STATUS2_UPROAR_TURN((Random() & 3) + 2); // 2-5 turns BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; @@ -2591,7 +2580,7 @@ void SetMoveEffect(bool8 primary, u8 certain) } else { - gBattleMons[gEffectBattler].status2 |= ((Random() & 3) + 3) << 0xD; + gBattleMons[gEffectBattler].status2 |= STATUS2_WRAPPED_TURN((Random() & 3) + 3); // 3-6 turns *(gBattleStruct->wrappedMove + gEffectBattler * 2 + 0) = gCurrentMove; *(gBattleStruct->wrappedMove + gEffectBattler * 2 + 1) = gCurrentMove >> 8; @@ -2834,7 +2823,7 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gEffectBattler] = gCurrentMove; - gBattleMons[gEffectBattler].status2 |= (((Random() & 1) + 2) << 0xA); + gBattleMons[gEffectBattler].status2 |= STATUS2_LOCK_CONFUSE_TURN((Random() & 1) + 2); // thrash for 2-3 turns } break; case MOVE_EFFECT_KNOCK_OFF: @@ -2929,7 +2918,7 @@ static void Cmd_clearstatusfromeffect(void) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - if (gBattleCommunication[MOVE_EFFECT_BYTE] <= MOVE_EFFECT_TOXIC) + if (gBattleCommunication[MOVE_EFFECT_BYTE] <= PRIMARY_STATUS_MOVE_EFFECT) gBattleMons[gActiveBattler].status1 &= (~sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]); else gBattleMons[gActiveBattler].status2 &= (~sStatusFlagsForMoveEffects[gBattleCommunication[MOVE_EFFECT_BYTE]]); @@ -3482,7 +3471,7 @@ static void Cmd_getexp(void) else { gBattleStruct->expGetterMonId++; - if (gBattleStruct->expGetterMonId <= 5) + if (gBattleStruct->expGetterMonId < PARTY_SIZE) gBattleScripting.getexpState = 2; // loop again else gBattleScripting.getexpState = 6; // we're done @@ -3552,13 +3541,13 @@ static void Cmd_unknown_24(void) // Impossible to decompile loops. for (foundPlayer = 0, i = 0; i < gBattlersCount; i += 2) { - if (HITMARKER_UNK(i) & gHitMarker && !gSpecialStatuses[i].flag40) + if (HITMARKER_FAINTED2(i) & gHitMarker && !gSpecialStatuses[i].flag40) foundPlayer++; } for (foundOpponent = 0, i = 1; i < gBattlersCount; i += 2) { - if (HITMARKER_UNK(i) & gHitMarker && !gSpecialStatuses[i].flag40) + if (HITMARKER_FAINTED2(i) & gHitMarker && !gSpecialStatuses[i].flag40) foundOpponent++; } @@ -4914,10 +4903,12 @@ static void Cmd_switchindataupdate(void) SwitchInClearSetData(); - if (gBattleTypeFlags & BATTLE_TYPE_PALACE && gBattleMons[gActiveBattler].maxHP / 2 >= gBattleMons[gActiveBattler].hp - && gBattleMons[gActiveBattler].hp != 0 && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)) + if (gBattleTypeFlags & BATTLE_TYPE_PALACE + && gBattleMons[gActiveBattler].maxHP / 2 >= gBattleMons[gActiveBattler].hp + && gBattleMons[gActiveBattler].hp != 0 + && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)) { - gBattleStruct->field_92 |= gBitTable[gActiveBattler]; + gBattleStruct->palaceFlags |= gBitTable[gActiveBattler]; } gBattleScripting.battler = gActiveBattler; @@ -5101,7 +5092,7 @@ static void Cmd_jumpifcantswitch(void) break; } - if (i == 6) + if (i == PARTY_SIZE) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); else gBattlescriptCurrInstr += 6; @@ -6588,11 +6579,11 @@ static void Cmd_various(void) case VARIOUS_GET_MOVE_TARGET: gBattlerTarget = GetMoveTarget(gCurrentMove, 0); break; - case 4: + case VARIOUS_GET_BATTLER_FAINTED: if (gHitMarker & HITMARKER_FAINTED(gActiveBattler)) - gBattleCommunication[0] = 1; + gBattleCommunication[0] = TRUE; else - gBattleCommunication[0] = 0; + gBattleCommunication[0] = FALSE; break; case VARIOUS_RESET_INTIMIDATE_TRACE_BITS: gSpecialStatuses[gActiveBattler].intimidatedMon = 0; @@ -6628,17 +6619,19 @@ static void Cmd_various(void) gHitMarker &= ~(HITMARKER_x400000); } break; - case 8: - gBattleCommunication[0] = 0; + case VARIOUS_PALACE_FLAVOR_TEXT: + // Try and print end-of-turn Battle Palace flavor text (e.g. "A glint appears in mon's eyes") + gBattleCommunication[0] = FALSE; // whether or not msg should be printed gBattleScripting.battler = gActiveBattler = gBattleCommunication[1]; - if (!(gBattleStruct->field_92 & gBitTable[gActiveBattler]) + + if (!(gBattleStruct->palaceFlags & gBitTable[gActiveBattler]) && gBattleMons[gActiveBattler].maxHP / 2 >= gBattleMons[gActiveBattler].hp && gBattleMons[gActiveBattler].hp != 0 && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)) { - gBattleStruct->field_92 |= gBitTable[gActiveBattler]; - gBattleCommunication[0] = 1; - gBattleCommunication[MULTISTRING_CHOOSER] = sUnknown_0831C4F8[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)]; + gBattleStruct->palaceFlags |= gBitTable[gActiveBattler]; + gBattleCommunication[0] = TRUE; + gBattleCommunication[MULTISTRING_CHOOSER] = sBattlePalaceNatureToFlavorTextId[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)]; } break; case VARIOUS_ARENA_JUDGMENT_WINDOW: @@ -7368,7 +7361,7 @@ static void Cmd_setbide(void) gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gBattlerAttacker] = gCurrentMove; gTakenDmg[gBattlerAttacker] = 0; - gBattleMons[gBattlerAttacker].status2 |= (STATUS2_BIDE - 0x100); // 2 turns + gBattleMons[gBattlerAttacker].status2 |= STATUS2_BIDE_TURN(2); gBattlescriptCurrInstr++; } @@ -8326,7 +8319,7 @@ static void Cmd_settypetorandomresistance(void) // conversion 2 static void Cmd_setalwayshitflag(void) { gStatuses3[gBattlerTarget] &= ~(STATUS3_ALWAYS_HITS); - gStatuses3[gBattlerTarget] |= 0x10; + gStatuses3[gBattlerTarget] |= STATUS3_ALWAYS_HITS_TURN(2); gDisableStructs[gBattlerTarget].battlerWithSureHit = gBattlerAttacker; gBattlescriptCurrInstr++; } @@ -9145,7 +9138,7 @@ static void Cmd_trydobeatup(void) else { u8 beforeLoop = gBattleCommunication[0]; - for (;gBattleCommunication[0] < 6; gBattleCommunication[0]++) + for (;gBattleCommunication[0] < PARTY_SIZE; gBattleCommunication[0]++) { if (GetMonData(&party[gBattleCommunication[0]], MON_DATA_HP) && GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2) @@ -9153,7 +9146,7 @@ static void Cmd_trydobeatup(void) && !GetMonData(&party[gBattleCommunication[0]], MON_DATA_STATUS)) break; } - if (gBattleCommunication[0] < 6) + if (gBattleCommunication[0] < PARTY_SIZE) { PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattleCommunication[0]) @@ -9520,7 +9513,7 @@ static void Cmd_setyawn(void) } else { - gStatuses3[gBattlerTarget] |= 0x1000; + gStatuses3[gBattlerTarget] |= STATUS3_YAWN_TURN(2); gBattlescriptCurrInstr += 5; } } @@ -9654,7 +9647,7 @@ static void Cmd_assistattackselect(void) else party = gPlayerParty; - for (monId = 0; monId < 6; monId++) + for (monId = 0; monId < PARTY_SIZE; monId++) { if (monId == gBattlerPartyIndexes[gBattlerAttacker]) continue; @@ -9865,7 +9858,7 @@ static void Cmd_pickup(void) if (lvlDivBy10 > 9) lvlDivBy10 = 9; - for (j = 0; j < 9; j++) + for (j = 0; j < (int)ARRAY_COUNT(sPickupProbabilities); j++) { if (sPickupProbabilities[j] > rand) { @@ -10134,7 +10127,7 @@ static void Cmd_handleballthrow(void) } } else - ballMultiplier = sBallCatchBonuses[gLastUsedItem - 2]; + ballMultiplier = sBallCatchBonuses[gLastUsedItem - ITEM_ULTRA_BALL]; odds = (catchRate * ballMultiplier / 10) * (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2) @@ -10436,7 +10429,7 @@ static void Cmd_trygivecaughtmonnick(void) } break; case 4: - if (CalculatePlayerPartyCount() == 6) + if (CalculatePlayerPartyCount() == PARTY_SIZE) gBattlescriptCurrInstr += 5; else gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); diff --git a/src/battle_setup.c b/src/battle_setup.c index 40e36d302..36fce2081 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -124,28 +124,43 @@ static const u8 sBattleTransitionTable_Trainer[][2] = {B_TRANSITION_SWIRL, B_TRANSITION_RIPPLE}, // Water }; -static const u8 sUnknown_0854FE98[] = -{ - B_TRANSITION_29, B_TRANSITION_30, B_TRANSITION_31, B_TRANSITION_32, - B_TRANSITION_34, B_TRANSITION_35, B_TRANSITION_36, B_TRANSITION_37, - B_TRANSITION_38, B_TRANSITION_39, B_TRANSITION_40, B_TRANSITION_41 +// Battle Frontier (excluding Pyramid and Dome, which have their own tables below) +static const u8 sBattleTransitionTable_BattleFrontier[] = +{ + B_TRANSITION_FRONTIER_LOGO_WIGGLE, + B_TRANSITION_FRONTIER_LOGO_WAVE, + B_TRANSITION_FRONTIER_SQUARES, + B_TRANSITION_FRONTIER_SQUARES_SCROLL, + B_TRANSITION_FRONTIER_CIRCLES_MEET, + B_TRANSITION_FRONTIER_CIRCLES_CROSS, + B_TRANSITION_FRONTIER_CIRCLES_ASYMMETRIC_SPIRAL, + B_TRANSITION_FRONTIER_CIRCLES_SYMMETRIC_SPIRAL, + B_TRANSITION_FRONTIER_CIRCLES_MEET_IN_SEQ, + B_TRANSITION_FRONTIER_CIRCLES_CROSS_IN_SEQ, + B_TRANSITION_FRONTIER_CIRCLES_ASYMMETRIC_SPIRAL_IN_SEQ, + B_TRANSITION_FRONTIER_CIRCLES_SYMMETRIC_SPIRAL_IN_SEQ }; -static const u8 sUnknown_0854FEA4[] = +static const u8 sBattleTransitionTable_BattlePyramid[] = { - B_TRANSITION_31, B_TRANSITION_32, B_TRANSITION_33 + B_TRANSITION_FRONTIER_SQUARES, + B_TRANSITION_FRONTIER_SQUARES_SCROLL, + B_TRANSITION_FRONTIER_SQUARES_SPIRAL }; -static const u8 sUnknown_0854FEA7[] = +static const u8 sBattleTransitionTable_BattleDome[] = { - B_TRANSITION_29, B_TRANSITION_31, B_TRANSITION_32, B_TRANSITION_33 + B_TRANSITION_FRONTIER_LOGO_WIGGLE, + B_TRANSITION_FRONTIER_SQUARES, + B_TRANSITION_FRONTIER_SQUARES_SCROLL, + B_TRANSITION_FRONTIER_SQUARES_SPIRAL }; static const struct TrainerBattleParameter sOrdinaryBattleParams[] = { {&sTrainerBattleMode, TRAINER_PARAM_LOAD_VAL_8BIT}, {&gTrainerBattleOpponent_A, TRAINER_PARAM_LOAD_VAL_16BIT}, - {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, + {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, {&sTrainerAIntroSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerADefeatSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerVictorySpeech, TRAINER_PARAM_CLEAR_VAL_32BIT}, @@ -158,7 +173,7 @@ static const struct TrainerBattleParameter sContinueScriptBattleParams[] = { {&sTrainerBattleMode, TRAINER_PARAM_LOAD_VAL_8BIT}, {&gTrainerBattleOpponent_A, TRAINER_PARAM_LOAD_VAL_16BIT}, - {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, + {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, {&sTrainerAIntroSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerADefeatSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerVictorySpeech, TRAINER_PARAM_CLEAR_VAL_32BIT}, @@ -171,7 +186,7 @@ static const struct TrainerBattleParameter sDoubleBattleParams[] = { {&sTrainerBattleMode, TRAINER_PARAM_LOAD_VAL_8BIT}, {&gTrainerBattleOpponent_A, TRAINER_PARAM_LOAD_VAL_16BIT}, - {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, + {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, {&sTrainerAIntroSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerADefeatSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerVictorySpeech, TRAINER_PARAM_CLEAR_VAL_32BIT}, @@ -184,7 +199,7 @@ static const struct TrainerBattleParameter sOrdinaryNoIntroBattleParams[] = { {&sTrainerBattleMode, TRAINER_PARAM_LOAD_VAL_8BIT}, {&gTrainerBattleOpponent_A, TRAINER_PARAM_LOAD_VAL_16BIT}, - {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, + {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, {&sTrainerAIntroSpeech, TRAINER_PARAM_CLEAR_VAL_32BIT}, {&sTrainerADefeatSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerVictorySpeech, TRAINER_PARAM_CLEAR_VAL_32BIT}, @@ -197,7 +212,7 @@ static const struct TrainerBattleParameter sContinueScriptDoubleBattleParams[] = { {&sTrainerBattleMode, TRAINER_PARAM_LOAD_VAL_8BIT}, {&gTrainerBattleOpponent_A, TRAINER_PARAM_LOAD_VAL_16BIT}, - {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, + {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, {&sTrainerAIntroSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerADefeatSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerVictorySpeech, TRAINER_PARAM_CLEAR_VAL_32BIT}, @@ -210,7 +225,7 @@ static const struct TrainerBattleParameter sTrainerBOrdinaryBattleParams[] = { {&sTrainerBattleMode, TRAINER_PARAM_LOAD_VAL_8BIT}, {&gTrainerBattleOpponent_B, TRAINER_PARAM_LOAD_VAL_16BIT}, - {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, + {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, {&sTrainerBIntroSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerBDefeatSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerVictorySpeech, TRAINER_PARAM_CLEAR_VAL_32BIT}, @@ -223,7 +238,7 @@ static const struct TrainerBattleParameter sTrainerBContinueScriptBattleParams[] { {&sTrainerBattleMode, TRAINER_PARAM_LOAD_VAL_8BIT}, {&gTrainerBattleOpponent_B, TRAINER_PARAM_LOAD_VAL_16BIT}, - {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, + {&sTrainerObjectEventLocalId, TRAINER_PARAM_LOAD_VAL_16BIT}, {&sTrainerBIntroSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerBDefeatSpeech, TRAINER_PARAM_LOAD_VAL_32BIT}, {&sTrainerVictorySpeech, TRAINER_PARAM_CLEAR_VAL_32BIT}, @@ -234,7 +249,7 @@ static const struct TrainerBattleParameter sTrainerBContinueScriptBattleParams[] #define REMATCH(trainer1, trainer2, trainer3, trainer4, trainer5, map) \ { \ - .trainerIds = {trainer1, trainer2, trainer3, trainer4, trainer5}, \ + .trainerIds = {trainer1, trainer2, trainer3, trainer4, trainer5}, \ .mapGroup = MAP_GROUP(map), \ .mapNum = MAP_NUM(map), \ } @@ -449,9 +464,9 @@ static void DoTrainerBattle(void) static void sub_80B0828(void) { if (InBattlePyramid()) - CreateBattleStartTask(sub_80B100C(10), 0); + CreateBattleStartTask(GetSpecialBattleTransition(10), 0); else - CreateBattleStartTask(sub_80B100C(11), 0); + CreateBattleStartTask(GetSpecialBattleTransition(11), 0); IncrementGameStat(GAME_STAT_TOTAL_BATTLES); IncrementGameStat(GAME_STAT_TRAINER_BATTLES); @@ -839,7 +854,17 @@ static u8 GetTrainerBattleTransition(void) return sBattleTransitionTable_Trainer[transitionType][1]; } -u8 sub_80B100C(s32 arg0) +// 0: Battle Tower +// 3: Battle Dome +// 4: Battle Palace +// 5: Battle Arena +// 6: Battle Factory +// 7: Battle Pike +// 10: Battle Pyramid +// 11: Trainer Hill +// 12: Secret Base +// 13: E-Reader +u8 GetSpecialBattleTransition(s32 id) { u16 var; u8 enemyLevel = GetMonData(&gEnemyParty[0], MON_DATA_LEVEL); @@ -847,43 +872,43 @@ u8 sub_80B100C(s32 arg0) if (enemyLevel < playerLevel) { - switch (arg0) + switch (id) { case 11: case 12: case 13: return B_TRANSITION_POKEBALLS_TRAIL; case 10: - return sUnknown_0854FEA4[Random() % ARRAY_COUNT(sUnknown_0854FEA4)]; + return sBattleTransitionTable_BattlePyramid[Random() % ARRAY_COUNT(sBattleTransitionTable_BattlePyramid)]; case 3: - return sUnknown_0854FEA7[Random() % ARRAY_COUNT(sUnknown_0854FEA7)]; + return sBattleTransitionTable_BattleDome[Random() % ARRAY_COUNT(sBattleTransitionTable_BattleDome)]; } if (VarGet(VAR_FRONTIER_BATTLE_MODE) != FRONTIER_MODE_LINK_MULTIS) - return sUnknown_0854FE98[Random() % ARRAY_COUNT(sUnknown_0854FE98)]; + return sBattleTransitionTable_BattleFrontier[Random() % ARRAY_COUNT(sBattleTransitionTable_BattleFrontier)]; } else { - switch (arg0) + switch (id) { case 11: case 12: case 13: return B_TRANSITION_BIG_POKEBALL; case 10: - return sUnknown_0854FEA4[Random() % ARRAY_COUNT(sUnknown_0854FEA4)]; + return sBattleTransitionTable_BattlePyramid[Random() % ARRAY_COUNT(sBattleTransitionTable_BattlePyramid)]; case 3: - return sUnknown_0854FEA7[Random() % ARRAY_COUNT(sUnknown_0854FEA7)]; + return sBattleTransitionTable_BattleDome[Random() % ARRAY_COUNT(sBattleTransitionTable_BattleDome)]; } if (VarGet(VAR_FRONTIER_BATTLE_MODE) != FRONTIER_MODE_LINK_MULTIS) - return sUnknown_0854FE98[Random() % ARRAY_COUNT(sUnknown_0854FE98)]; + return sBattleTransitionTable_BattleFrontier[Random() % ARRAY_COUNT(sBattleTransitionTable_BattleFrontier)]; } var = gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum * 2 + 0] + gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum * 2 + 1]; - return sUnknown_0854FE98[var % ARRAY_COUNT(sUnknown_0854FE98)]; + return sBattleTransitionTable_BattleFrontier[var % ARRAY_COUNT(sBattleTransitionTable_BattleFrontier)]; } void ChooseStarter(void) diff --git a/src/battle_tower.c b/src/battle_tower.c index 4695d9aa0..8fcea1123 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2028,7 +2028,7 @@ void DoSpecialTrainerBattle(void) } CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(0)); + BattleTransition_StartOnField(GetSpecialBattleTransition(0)); break; case SPECIAL_BATTLE_SECRET_BASE: for (i = 0; i < PARTY_SIZE; i++) @@ -2038,7 +2038,7 @@ void DoSpecialTrainerBattle(void) } CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(12)); + BattleTransition_StartOnField(GetSpecialBattleTransition(12)); break; case SPECIAL_BATTLE_EREADER: ZeroEnemyPartyMons(); @@ -2048,7 +2048,7 @@ void DoSpecialTrainerBattle(void) gTrainerBattleOpponent_A = 0; CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(13)); + BattleTransition_StartOnField(GetSpecialBattleTransition(13)); break; case SPECIAL_BATTLE_DOME: gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOME; @@ -2058,7 +2058,7 @@ void DoSpecialTrainerBattle(void) FillFrontierTrainerParty(DOME_BATTLE_PARTY_SIZE); CreateTask(Task_StartBattleAfterTransition, 1); sub_806E694(0); - BattleTransition_StartOnField(sub_80B100C(3)); + BattleTransition_StartOnField(GetSpecialBattleTransition(3)); break; case SPECIAL_BATTLE_PALACE: gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_PALACE; @@ -2070,7 +2070,7 @@ void DoSpecialTrainerBattle(void) FillTentTrainerParty(FRONTIER_PARTY_SIZE); CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(4)); + BattleTransition_StartOnField(GetSpecialBattleTransition(4)); break; case SPECIAL_BATTLE_ARENA: gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_ARENA; @@ -2080,7 +2080,7 @@ void DoSpecialTrainerBattle(void) FillTentTrainerParty(FRONTIER_PARTY_SIZE); CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(5)); + BattleTransition_StartOnField(GetSpecialBattleTransition(5)); break; case SPECIAL_BATTLE_FACTORY: gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_FACTORY; @@ -2089,28 +2089,28 @@ void DoSpecialTrainerBattle(void) FillFactoryTrainerParty(); CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(6)); + BattleTransition_StartOnField(GetSpecialBattleTransition(6)); break; case SPECIAL_BATTLE_PIKE_SINGLE: gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_BATTLE_TOWER; FillFrontierTrainerParty(FRONTIER_PARTY_SIZE); CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(7)); + BattleTransition_StartOnField(GetSpecialBattleTransition(7)); break; case SPECIAL_BATTLE_PYRAMID: gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_PYRAMID; FillFrontierTrainerParty(FRONTIER_PARTY_SIZE); CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(10)); + BattleTransition_StartOnField(GetSpecialBattleTransition(10)); break; case SPECIAL_BATTLE_PIKE_DOUBLE: gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS; FillFrontierTrainersParties(1); CreateTask(Task_StartBattleAfterTransition, 1); PlayMapChosenOrBattleBGM(0); - BattleTransition_StartOnField(sub_80B100C(7)); + BattleTransition_StartOnField(GetSpecialBattleTransition(7)); break; case SPECIAL_BATTLE_STEVEN: gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER; diff --git a/src/battle_transition.c b/src/battle_transition.c index 8655c9e0e..2ffa28645 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1,6 +1,7 @@ #include "global.h" #include "battle.h" #include "battle_transition.h" +#include "battle_transition_frontier.h" #include "bg.h" #include "decompress.h" #include "event_object_movement.h" @@ -18,7 +19,6 @@ #include "sprite.h" #include "task.h" #include "trig.h" -#include "unk_transition.h" #include "util.h" #include "constants/field_effects.h" #include "constants/songs.h" @@ -93,11 +93,11 @@ static void Phase2Task_ShredSplit(u8 taskId); static void Phase2Task_Blackhole1(u8 taskId); static void Phase2Task_Blackhole2(u8 taskId); static void Phase2Task_RectangularSpiral(u8 taskId); -static void Phase2Task_29(u8 taskId); -static void Phase2Task_30(u8 taskId); -static void Phase2Task_31(u8 taskId); -static void Phase2Task_32(u8 taskId); -static void Phase2Task_33(u8 taskId); +static void Phase2Task_FrontierLogoWiggle(u8 taskId); +static void Phase2Task_FrontierLogoWave(u8 taskId); +static void Phase2Task_FrontierSquares(u8 taskId); +static void Phase2Task_FrontierSquaresScroll(u8 taskId); +static void Phase2Task_FrontierSquaresSpiral(u8 taskId); static void VBlankCB_BattleTransition(void); static void VBlankCB_Phase2_Swirl(void); static void HBlankCB_Phase2_Swirl(void); @@ -192,12 +192,12 @@ static bool8 Phase2_Blackhole2_Func2(struct Task *task); static bool8 Phase2_RectangularSpiral_Func1(struct Task *task); static bool8 Phase2_RectangularSpiral_Func2(struct Task *task); static bool8 Phase2_RectangularSpiral_Func3(struct Task *task); -static bool8 Phase2_29_Func1(struct Task *task); -static bool8 Phase2_29_Func2(struct Task *task); -static bool8 Phase2_30_Func1(struct Task *task); -static bool8 Phase2_30_Func2(struct Task *task); -static bool8 Phase2_30_Func3(struct Task *task); -static bool8 Phase2_30_Func4(struct Task *task); +static bool8 Phase2_FrontierLogoWiggle_Func1(struct Task *task); +static bool8 Phase2_FrontierLogoWiggle_Func2(struct Task *task); +static bool8 Phase2_FrontierLogoWave_Func1(struct Task *task); +static bool8 Phase2_FrontierLogoWave_Func2(struct Task *task); +static bool8 Phase2_FrontierLogoWave_Func3(struct Task *task); +static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task); static bool8 Phase2_Rayquaza_Func3(struct Task *task); static bool8 Phase2_Rayquaza_Func4(struct Task *task); static bool8 Phase2_Rayquaza_Func5(struct Task *task); @@ -205,19 +205,19 @@ static bool8 Phase2_Rayquaza_Func6(struct Task *task); static bool8 Phase2_Rayquaza_Func7(struct Task *task); static bool8 Phase2_Rayquaza_Func8(struct Task *task); static bool8 Phase2_Rayquaza_Func9(struct Task *task); -static bool8 Phase2_31_Func1(struct Task *task); -static bool8 Phase2_31_Func2(struct Task *task); -static bool8 Phase2_31_Func3(struct Task *task); -static bool8 Phase2_31_33_Func5(struct Task *task); -static bool8 Phase2_33_Func1(struct Task *task); -static bool8 Phase2_33_Func2(struct Task *task); -static bool8 Phase2_33_Func3(struct Task *task); -static bool8 Phase2_33_Func4(struct Task *task); -static bool8 Phase2_32_Func1(struct Task *task); -static bool8 Phase2_32_Func2(struct Task *task); -static bool8 Phase2_32_Func3(struct Task *task); -static bool8 Phase2_32_Func4(struct Task *task); -static bool8 Phase2_32_Func5(struct Task *task); +static bool8 Phase2_FrontierSquares_Func1(struct Task *task); +static bool8 Phase2_FrontierSquares_Func2(struct Task *task); +static bool8 Phase2_FrontierSquares_Func3(struct Task *task); +static bool8 Phase2_FrontierSquares_End(struct Task *task); +static bool8 Phase2_FrontierSquaresSpiral_Func1(struct Task *task); +static bool8 Phase2_FrontierSquaresSpiral_Func2(struct Task *task); +static bool8 Phase2_FrontierSquaresSpiral_Func3(struct Task *task); +static bool8 Phase2_FrontierSquaresSpiral_Func4(struct Task *task); +static bool8 Phase2_FrontierSquaresScroll_Func1(struct Task *task); +static bool8 Phase2_FrontierSquaresScroll_Func2(struct Task *task); +static bool8 Phase2_FrontierSquaresScroll_Func3(struct Task *task); +static bool8 Phase2_FrontierSquaresScroll_Func4(struct Task *task); +static bool8 Phase2_FrontierSquaresScroll_Func5(struct Task *task); static bool8 Phase2_Mugshot_Func1(struct Task *task); static bool8 Phase2_Mugshot_Func2(struct Task *task); static bool8 Phase2_Mugshot_Func3(struct Task *task); @@ -302,15 +302,15 @@ static const u16 sGroudon2_Palette[] = INCBIN_U16("graphics/battle_transitions/g static const u16 sRayquaza_Palette[] = INCBIN_U16("graphics/battle_transitions/rayquaza.gbapal"); static const u32 sRayquaza_Tileset[] = INCBIN_U32("graphics/battle_transitions/rayquaza.4bpp"); static const u32 sRayquaza_Tilemap[] = INCBIN_U32("graphics/battle_transitions/rayquaza.bin"); -static const u16 gUnknown_085C7BE0[] = INCBIN_U16("graphics/battle_transitions/frontier_brain.gbapal"); -static const u32 gUnknown_085C7C00[] = INCBIN_U32("graphics/battle_transitions/frontier_brain.4bpp.lz"); -static const u32 gUnknown_085C828C[] = INCBIN_U32("graphics/battle_transitions/frontier_brain.bin.lz"); -static const u16 gUnknown_085C8578[] = INCBIN_U16("graphics/battle_transitions/frontier_squares_blanktiles.gbapal"); -static const u32 gUnknown_085C8598[] = INCBIN_U32("graphics/battle_transitions/frontier_square_1.4bpp.lz"); -static const u32 gUnknown_085C86F4[] = INCBIN_U32("graphics/battle_transitions/frontier_square_2.4bpp.lz"); -static const u32 gUnknown_085C87F4[] = INCBIN_U32("graphics/battle_transitions/frontier_square_3.4bpp.lz"); -static const u32 gUnknown_085C88A4[] = INCBIN_U32("graphics/battle_transitions/frontier_square_4.4bpp.lz"); -static const u32 gUnknown_085C8928[] = INCBIN_U32("graphics/battle_transitions/frontier_squares.bin"); +static const u16 sFrontierLogo_Palette[] = INCBIN_U16("graphics/battle_transitions/frontier_logo.gbapal"); +static const u32 sFrontierLogo_Tileset[] = INCBIN_U32("graphics/battle_transitions/frontier_logo.4bpp.lz"); +static const u32 sFrontierLogo_Tilemap[] = INCBIN_U32("graphics/battle_transitions/frontier_logo.bin.lz"); +static const u16 sFrontierSquares_Palette[] = INCBIN_U16("graphics/battle_transitions/frontier_squares_blanktiles.gbapal"); +static const u32 sFrontierSquares_FilledBg_Tileset[] = INCBIN_U32("graphics/battle_transitions/frontier_square_1.4bpp.lz"); +static const u32 sFrontierSquares_EmptyBg_Tileset[] = INCBIN_U32("graphics/battle_transitions/frontier_square_2.4bpp.lz"); +static const u32 sFrontierSquares_Shrink1_Tileset[] = INCBIN_U32("graphics/battle_transitions/frontier_square_3.4bpp.lz"); +static const u32 sFrontierSquares_Shrink2_Tileset[] = INCBIN_U32("graphics/battle_transitions/frontier_square_4.4bpp.lz"); +static const u32 sFrontierSquares_Tilemap[] = INCBIN_U32("graphics/battle_transitions/frontier_squares.bin"); static const TaskFunc sPhase1_Tasks[B_TRANSITION_COUNT] = { @@ -348,19 +348,19 @@ static const TaskFunc sPhase2_Tasks[B_TRANSITION_COUNT] = [B_TRANSITION_BLACKHOLE1] = Phase2Task_Blackhole1, [B_TRANSITION_BLACKHOLE2] = Phase2Task_Blackhole2, [B_TRANSITION_RECTANGULAR_SPIRAL] = Phase2Task_RectangularSpiral, - [B_TRANSITION_29] = Phase2Task_29, - [B_TRANSITION_30] = Phase2Task_30, - [B_TRANSITION_31] = Phase2Task_31, - [B_TRANSITION_32] = Phase2Task_32, - [B_TRANSITION_33] = Phase2Task_33, - [B_TRANSITION_34] = Phase2Task_34, - [B_TRANSITION_35] = Phase2Task_35, - [B_TRANSITION_36] = Phase2Task_36, - [B_TRANSITION_37] = Phase2Task_37, - [B_TRANSITION_38] = Phase2Task_38, - [B_TRANSITION_39] = Phase2Task_39, - [B_TRANSITION_40] = Phase2Task_40, - [B_TRANSITION_41] = Phase2Task_41, + [B_TRANSITION_FRONTIER_LOGO_WIGGLE] = Phase2Task_FrontierLogoWiggle, + [B_TRANSITION_FRONTIER_LOGO_WAVE] = Phase2Task_FrontierLogoWave, + [B_TRANSITION_FRONTIER_SQUARES] = Phase2Task_FrontierSquares, + [B_TRANSITION_FRONTIER_SQUARES_SCROLL] = Phase2Task_FrontierSquaresScroll, + [B_TRANSITION_FRONTIER_SQUARES_SPIRAL] = Phase2Task_FrontierSquaresSpiral, + [B_TRANSITION_FRONTIER_CIRCLES_MEET] = Phase2Task_FrontierCirclesMeet, + [B_TRANSITION_FRONTIER_CIRCLES_CROSS] = Phase2Task_FrontierCirclesCross, + [B_TRANSITION_FRONTIER_CIRCLES_ASYMMETRIC_SPIRAL] = Phase2Task_FrontierCirclesAsymmetricSpiral, + [B_TRANSITION_FRONTIER_CIRCLES_SYMMETRIC_SPIRAL] = Phase2Task_FrontierCirclesSymmetricSpiral, + [B_TRANSITION_FRONTIER_CIRCLES_MEET_IN_SEQ] = Phase2Task_FrontierCirclesMeetInSeq, + [B_TRANSITION_FRONTIER_CIRCLES_CROSS_IN_SEQ] = Phase2Task_FrontierCirclesCrossInSeq, + [B_TRANSITION_FRONTIER_CIRCLES_ASYMMETRIC_SPIRAL_IN_SEQ] = Phase2Task_FrontierCirclesAsymmetricSpiralInSeq, + [B_TRANSITION_FRONTIER_CIRCLES_SYMMETRIC_SPIRAL_IN_SEQ] = Phase2Task_FrontierCirclesSymmetricSpiralInSeq, }; static const TransitionStateFunc sMainTransitionPhases[] = @@ -850,48 +850,48 @@ static const struct SpritePalette sSpritePalette_UnusedTrainer = {sUnusedTrainer static const u16 sBigPokeball_Tilemap[] = INCBIN_U16("graphics/battle_transitions/big_pokeball_map.bin"); static const u16 sMugshotsTilemap[] = INCBIN_U16("graphics/battle_transitions/elite_four_bg_map.bin"); -static const TransitionStateFunc sPhase2_29_Funcs[] = +static const TransitionStateFunc sPhase2_FrontierLogoWiggle_Funcs[] = { - Phase2_29_Func1, - Phase2_29_Func2, + Phase2_FrontierLogoWiggle_Func1, + Phase2_FrontierLogoWiggle_Func2, Phase2_BigPokeball_Func3, Phase2_BigPokeball_Func4, Phase2_BigPokeball_Func5, Phase2_BigPokeball_Func6 }; -static const TransitionStateFunc sPhase2_30_Funcs[] = +static const TransitionStateFunc sPhase2_FrontierLogoWave_Funcs[] = { - Phase2_30_Func1, - Phase2_30_Func2, - Phase2_30_Func3, - Phase2_30_Func4 + Phase2_FrontierLogoWave_Func1, + Phase2_FrontierLogoWave_Func2, + Phase2_FrontierLogoWave_Func3, + Phase2_FrontierLogoWave_Func4 }; -static const TransitionStateFunc sPhase2_31_Funcs[] = +static const TransitionStateFunc sPhase2_FrontierSquares_Funcs[] = { - Phase2_31_Func1, - Phase2_31_Func2, - Phase2_31_Func3, - Phase2_31_33_Func5 + Phase2_FrontierSquares_Func1, + Phase2_FrontierSquares_Func2, + Phase2_FrontierSquares_Func3, + Phase2_FrontierSquares_End }; -static const TransitionStateFunc sPhase2_33_Funcs[] = +static const TransitionStateFunc sPhase2_FrontierSquaresSpiral_Funcs[] = { - Phase2_33_Func1, - Phase2_33_Func2, - Phase2_33_Func3, - Phase2_33_Func4, - Phase2_31_33_Func5 + Phase2_FrontierSquaresSpiral_Func1, + Phase2_FrontierSquaresSpiral_Func2, + Phase2_FrontierSquaresSpiral_Func3, + Phase2_FrontierSquaresSpiral_Func4, + Phase2_FrontierSquares_End }; -static const TransitionStateFunc sPhase2_32_Funcs[] = +static const TransitionStateFunc sPhase2_FrontierSquaresScroll_Funcs[] = { - Phase2_32_Func1, - Phase2_32_Func2, - Phase2_32_Func3, - Phase2_32_Func4, - Phase2_32_Func5 + Phase2_FrontierSquaresScroll_Func1, + Phase2_FrontierSquaresScroll_Func2, + Phase2_FrontierSquaresScroll_Func3, + Phase2_FrontierSquaresScroll_Func4, + Phase2_FrontierSquaresScroll_Func5 }; static const u8 gUnknown_085C9A30[] = {0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x1b, 0x14, 0x0d, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x07, 0x0e, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x13, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x10, 0x11, 0x12}; @@ -3850,43 +3850,43 @@ static bool8 sub_814A228(s16 *data, bool8 a1, bool8 a2) #define tData6 data[6] #define tData7 data[7] -static bool8 Phase2_29_Func1(struct Task *task) +static bool8 Phase2_FrontierLogoWiggle_Func1(struct Task *task) { u16 *tilemap, *tileset; sub_814669C(task); GetBg0TilesDst(&tilemap, &tileset); CpuFill16(0, tilemap, 0x800); - LZ77UnCompVram(gUnknown_085C7C00, tileset); - LoadPalette(gUnknown_085C7BE0, 0xF0, 0x20); + LZ77UnCompVram(sFrontierLogo_Tileset, tileset); + LoadPalette(sFrontierLogo_Palette, 0xF0, 0x20); task->tState++; return FALSE; } -static bool8 Phase2_29_Func2(struct Task *task) +static bool8 Phase2_FrontierLogoWiggle_Func2(struct Task *task) { u16 *tilemap, *tileset; GetBg0TilesDst(&tilemap, &tileset); - LZ77UnCompVram(gUnknown_085C828C, tilemap); + LZ77UnCompVram(sFrontierLogo_Tilemap, tilemap); sub_8149F98(gScanlineEffectRegBuffers[0], 0, task->tData4, 0x84, task->tData5, 160); task->tState++; return TRUE; } -static void Phase2Task_29(u8 taskId) +static void Phase2Task_FrontierLogoWiggle(u8 taskId) { - while (sPhase2_29_Funcs[gTasks[taskId].tState](&gTasks[taskId])); + while (sPhase2_FrontierLogoWiggle_Funcs[gTasks[taskId].tState](&gTasks[taskId])); } -static void Phase2Task_30(u8 taskId) +static void Phase2Task_FrontierLogoWave(u8 taskId) { - while (sPhase2_30_Funcs[gTasks[taskId].tState](&gTasks[taskId])); + while (sPhase2_FrontierLogoWave_Funcs[gTasks[taskId].tState](&gTasks[taskId])); } -static bool8 Phase2_30_Func1(struct Task *task) +static bool8 Phase2_FrontierLogoWave_Func1(struct Task *task) { u16 *tilemap, *tileset; @@ -3904,26 +3904,26 @@ static bool8 Phase2_30_Func1(struct Task *task) REG_BLDALPHA = sTransitionStructPtr->BLDALPHA; GetBg0TilesDst(&tilemap, &tileset); CpuFill16(0, tilemap, 0x800); - LZ77UnCompVram(gUnknown_085C7C00, tileset); - LoadPalette(gUnknown_085C7BE0, 0xF0, 0x20); + LZ77UnCompVram(sFrontierLogo_Tileset, tileset); + LoadPalette(sFrontierLogo_Palette, 0xF0, 0x20); sTransitionStructPtr->field_16 = 0; task->tState++; return FALSE; } -static bool8 Phase2_30_Func2(struct Task *task) +static bool8 Phase2_FrontierLogoWave_Func2(struct Task *task) { u16 *tilemap, *tileset; GetBg0TilesDst(&tilemap, &tileset); - LZ77UnCompVram(gUnknown_085C828C, tilemap); + LZ77UnCompVram(sFrontierLogo_Tilemap, tilemap); task->tState++; return TRUE; } -static bool8 Phase2_30_Func3(struct Task *task) +static bool8 Phase2_FrontierLogoWave_Func3(struct Task *task) { u8 i; @@ -3940,7 +3940,7 @@ static bool8 Phase2_30_Func3(struct Task *task) return TRUE; } -static bool8 Phase2_30_Func4(struct Task *task) +static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task) { u8 i; u16 var6, amplitude, var8; @@ -3985,7 +3985,7 @@ static bool8 Phase2_30_Func4(struct Task *task) } if (task->tData4 != 0 && !gPaletteFade.active) - DestroyTask(FindTaskIdByFunc(Phase2Task_30)); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierLogoWave)); task->tData7 -= 17; sTransitionStructPtr->VBlank_DMA++; @@ -4008,33 +4008,33 @@ static void HBlankCB_Phase2_30(void) REG_BG0VOFS = var; } -static void Phase2Task_31(u8 taskId) +static void Phase2Task_FrontierSquares(u8 taskId) { - while (sPhase2_31_Funcs[gTasks[taskId].tState](&gTasks[taskId])); + while (sPhase2_FrontierSquares_Funcs[gTasks[taskId].tState](&gTasks[taskId])); } -static void Phase2Task_33(u8 taskId) +static void Phase2Task_FrontierSquaresSpiral(u8 taskId) { - while (sPhase2_33_Funcs[gTasks[taskId].tState](&gTasks[taskId])); + while (sPhase2_FrontierSquaresSpiral_Funcs[gTasks[taskId].tState](&gTasks[taskId])); } -static void Phase2Task_32(u8 taskId) +static void Phase2Task_FrontierSquaresScroll(u8 taskId) { - while (sPhase2_32_Funcs[gTasks[taskId].tState](&gTasks[taskId])); + while (sPhase2_FrontierSquaresScroll_Funcs[gTasks[taskId].tState](&gTasks[taskId])); } -static bool8 Phase2_31_Func1(struct Task *task) +static bool8 Phase2_FrontierSquares_Func1(struct Task *task) { u16 *tilemap, *tileset; GetBg0TilesDst(&tilemap, &tileset); - LZ77UnCompVram(gUnknown_085C8598, tileset); + LZ77UnCompVram(sFrontierSquares_FilledBg_Tileset, tileset); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); FillBgTilemapBufferRect(0, 1, 0, 0, 1, 0x20, 0xF); FillBgTilemapBufferRect(0, 1, 0x1D, 0, 1, 0x20, 0xF); CopyBgTilemapBufferToVram(0); - LoadPalette(gUnknown_085C8578, 0xF0, 0x20); + LoadPalette(sFrontierSquares_Palette, 0xF0, 0x20); task->tData2 = 1; task->tData3 = 0; @@ -4045,9 +4045,9 @@ static bool8 Phase2_31_Func1(struct Task *task) return FALSE; } -static bool8 Phase2_31_Func2(struct Task *task) +static bool8 Phase2_FrontierSquares_Func2(struct Task *task) { - CopyRectToBgTilemapBufferRect(0, gUnknown_085C8928, 0, 0, 4, 4, task->tData2, task->tData3, 4, 4, 0xF, 0, 0); + CopyRectToBgTilemapBufferRect(0, sFrontierSquares_Tilemap, 0, 0, 4, 4, task->tData2, task->tData3, 4, 4, 0xF, 0, 0); CopyBgTilemapBufferToVram(0); task->tData2 += 4; @@ -4063,7 +4063,7 @@ static bool8 Phase2_31_Func2(struct Task *task) return FALSE; } -static bool8 Phase2_31_Func3(struct Task *task) +static bool8 Phase2_FrontierSquares_Func3(struct Task *task) { u8 i; u16 *tilemap, *tileset; @@ -4082,13 +4082,13 @@ static bool8 Phase2_31_Func3(struct Task *task) break; case 1: BlendPalettes(0xFFFF7FFF, 0x10, 0); - LZ77UnCompVram(gUnknown_085C86F4, tileset); + LZ77UnCompVram(sFrontierSquares_EmptyBg_Tileset, tileset); break; case 2: - LZ77UnCompVram(gUnknown_085C87F4, tileset); + LZ77UnCompVram(sFrontierSquares_Shrink1_Tileset, tileset); break; case 3: - LZ77UnCompVram(gUnknown_085C88A4, tileset); + LZ77UnCompVram(sFrontierSquares_Shrink2_Tileset, tileset); break; default: FillBgTilemapBufferRect_Palette0(0, 1, 0, 0, 0x20, 0x20); @@ -4104,19 +4104,19 @@ static bool8 Phase2_31_Func3(struct Task *task) return FALSE; } -static bool8 Phase2_33_Func1(struct Task *task) +static bool8 Phase2_FrontierSquaresSpiral_Func1(struct Task *task) { u16 *tilemap, *tileset; GetBg0TilesDst(&tilemap, &tileset); - LZ77UnCompVram(gUnknown_085C8598, tileset); + LZ77UnCompVram(sFrontierSquares_FilledBg_Tileset, tileset); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); FillBgTilemapBufferRect(0, 1, 0, 0, 1, 0x20, 0xF); FillBgTilemapBufferRect(0, 1, 0x1D, 0, 1, 0x20, 0xF); CopyBgTilemapBufferToVram(0); - LoadPalette(gUnknown_085C8578, 0xE0, 0x20); - LoadPalette(gUnknown_085C8578, 0xF0, 0x20); + LoadPalette(sFrontierSquares_Palette, 0xE0, 0x20); + LoadPalette(sFrontierSquares_Palette, 0xF0, 0x20); BlendPalette(0xE0, 0x10, 8, 0); task->tData2 = 34; @@ -4126,12 +4126,12 @@ static bool8 Phase2_33_Func1(struct Task *task) return FALSE; } -static bool8 Phase2_33_Func2(struct Task *task) +static bool8 Phase2_FrontierSquaresSpiral_Func2(struct Task *task) { u8 var = gUnknown_085C9A30[task->tData2]; u8 varMod = var % 7; u8 varDiv = var / 7; - CopyRectToBgTilemapBufferRect(0, &gUnknown_085C8928, 0, 0, 4, 4, 4 * varMod + 1, 4 * varDiv, 4, 4, 0xF, 0, 0); + CopyRectToBgTilemapBufferRect(0, &sFrontierSquares_Tilemap, 0, 0, 4, 4, 4 * varMod + 1, 4 * varDiv, 4, 4, 0xF, 0, 0); CopyBgTilemapBufferToVram(0); if (--task->tData2 < 0) @@ -4139,7 +4139,7 @@ static bool8 Phase2_33_Func2(struct Task *task) return FALSE; } -static bool8 Phase2_33_Func3(struct Task *task) +static bool8 Phase2_FrontierSquaresSpiral_Func3(struct Task *task) { BlendPalette(0xE0, 0x10, 3, 0); BlendPalettes(0xFFFF3FFF, 0x10, 0); @@ -4151,13 +4151,13 @@ static bool8 Phase2_33_Func3(struct Task *task) return FALSE; } -static bool8 Phase2_33_Func4(struct Task *task) +static bool8 Phase2_FrontierSquaresSpiral_Func4(struct Task *task) { if ((task->tData3 ^= 1)) { CopyRectToBgTilemapBufferRect( 0, - gUnknown_085C8928, + sFrontierSquares_Tilemap, 0, 0, 4, @@ -4194,7 +4194,7 @@ static bool8 Phase2_33_Func4(struct Task *task) return FALSE; } -static bool8 Phase2_31_33_Func5(struct Task *task) +static bool8 Phase2_FrontierSquares_End(struct Task *task) { FillBgTilemapBufferRect_Palette0(0, 1, 0, 0, 0x20, 0x20); CopyBgTilemapBufferToVram(0); @@ -4219,16 +4219,16 @@ static void sub_814ABE4(u8 taskId) } } -static bool8 Phase2_32_Func1(struct Task *task) +static bool8 Phase2_FrontierSquaresScroll_Func1(struct Task *task) { u8 taskId = 0; u16 *tilemap, *tileset; GetBg0TilesDst(&tilemap, &tileset); - LZ77UnCompVram(gUnknown_085C8598, tileset); + LZ77UnCompVram(sFrontierSquares_FilledBg_Tileset, tileset); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); CopyBgTilemapBufferToVram(0); - LoadPalette(gUnknown_085C8578, 0xF0, 0x20); + LoadPalette(sFrontierSquares_Palette, 0xF0, 0x20); gBattle_BG0_X = 0; gBattle_BG0_Y = 0; @@ -4261,7 +4261,7 @@ static bool8 Phase2_32_Func1(struct Task *task) return FALSE; } -static bool8 Phase2_32_Func2(struct Task *task) +static bool8 Phase2_FrontierSquaresScroll_Func2(struct Task *task) { u8 var = gUnknown_085C9A53[task->tData2]; u8 varDiv = var / 8; @@ -4269,7 +4269,7 @@ static bool8 Phase2_32_Func2(struct Task *task) CopyRectToBgTilemapBufferRect( 0, - &gUnknown_085C8928, + &sFrontierSquares_Tilemap, 0, 0, 4, @@ -4288,7 +4288,7 @@ static bool8 Phase2_32_Func2(struct Task *task) return 0; } -static bool8 Phase2_32_Func3(struct Task *task) +static bool8 Phase2_FrontierSquaresScroll_Func3(struct Task *task) { BlendPalettes(0xFFFF7FFF, 0x10, 0); @@ -4298,7 +4298,7 @@ static bool8 Phase2_32_Func3(struct Task *task) return FALSE; } -static bool8 Phase2_32_Func4(struct Task *task) +static bool8 Phase2_FrontierSquaresScroll_Func4(struct Task *task) { u8 var = gUnknown_085C9A53[task->tData2]; u8 varDiv = var / 8; @@ -4320,7 +4320,7 @@ static bool8 Phase2_32_Func4(struct Task *task) #undef tSub32_Y_delta #undef tSub32_Bool -static bool8 Phase2_32_Func5(struct Task *task) +static bool8 Phase2_FrontierSquaresScroll_Func5(struct Task *task) { gBattle_BG0_X = 0; gBattle_BG0_Y = 0; diff --git a/src/battle_transition_frontier.c b/src/battle_transition_frontier.c new file mode 100644 index 000000000..931de5e44 --- /dev/null +++ b/src/battle_transition_frontier.c @@ -0,0 +1,650 @@ +#include "global.h" +#include "sprite.h" +#include "decompress.h" +#include "battle_transition_frontier.h" +#include "battle_transition.h" +#include "task.h" +#include "palette.h" +#include "trig.h" +#include "bg.h" +#include "gpu_regs.h" +#include "constants/rgb.h" + +/* + There are 3 "categories" of Battle Frontier transition + 1. The full logo is used (B_TRANSITION_FRONTIER_LOGO_*) + 2. Small squares with the logo on it are used (B_TRANSITION_FRONTIER_SQUARES_*) + 3. The balls that make up the logo come together to form the full logo (B_TRANSITION_FRONTIER_CIRCLES_*) + + This file handles category 3. Functions for the other two are handled in battle_transition.c +*/ + +typedef bool8 (*TransitionStateFunc)(struct Task *task); + +// this file's functions +static void SpriteCB_LogoCircleSlide(struct Sprite *sprite); +static void SpriteCB_LogoCircleSpiral(struct Sprite *sprite); +static bool8 WaitForLogoCirclesAnim(struct Task *task); +static bool8 FadeInCenterLogoCircle(struct Task *task); +static bool8 Circles_Init(struct Task *task); +static bool8 CirclesMeet_CreateSprites(struct Task *task); +static bool8 CirclesMeet_End(struct Task *task); +static bool8 CirclesCross_CreateSprites(struct Task *task); +static bool8 CirclesCross_End(struct Task *task); +static bool8 CirclesAsymmetricSpiral_CreateSprites(struct Task *task); +static bool8 CirclesAsymmetricSpiral_End(struct Task *task); +static bool8 CirclesSymmetricSpiral_CreateSprites(struct Task *task); +static bool8 CirclesSymmetricSpiral_End(struct Task *task); +static bool8 CirclesMeetInSeq_CreateSprites(struct Task *task); +static bool8 CirclesMeetInSeq_End(struct Task *task); +static bool8 CirclesCrossInSeq_CreateSprites(struct Task *task); +static bool8 CirclesCrossInSeq_End(struct Task *task); +static bool8 CirclesAsymmetricSpiralInSeq_CreateSprites(struct Task *task); +static bool8 CirclesAsymmetricSpiralInSeq_End(struct Task *task); +static bool8 CirclesSymmetricSpiralInSeq_CreateSprites(struct Task *task); +static bool8 CirclesSymmetricSpiralInSeq_End(struct Task *task); + +#define PALTAG_LOGO_CIRCLES 0x2E90 + +// const rom data +static const u32 sLogoCenter_Gfx[] = INCBIN_U32("graphics/battle_transitions/frontier_logo_center.4bpp.lz"); +static const u32 sLogoCenter_Tilemap[] = INCBIN_U32("graphics/battle_transitions/frontier_logo_center.bin"); +static const u32 sLogoCircles_Gfx[] = INCBIN_U32("graphics/battle_transitions/frontier_logo_circles.4bpp.lz"); +static const u16 sLogo_Pal[] = INCBIN_U16("graphics/battle_transitions/frontier_logo_circles.gbapal"); + +// Unused Empty data. +static const u8 sFiller[0x1C0] = {0}; + +static const struct OamData sOamData_LogoCircles = +{ + .y = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .mosaic = 0, + .bpp = ST_OAM_4BPP, + .shape = SPRITE_SHAPE(64x64), + .x = 0, + .matrixNum = 0, + .size = SPRITE_SIZE(64x64), + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct CompressedSpriteSheet sSpriteSheet_LogoCircles = +{ + .data = sLogoCircles_Gfx, + .size = 0x1800, + .tag = PALTAG_LOGO_CIRCLES +}; + +static const struct SpritePalette sSpritePalette_LogoCircles = +{ + .data = sLogo_Pal, + .tag = PALTAG_LOGO_CIRCLES +}; + +static const union AnimCmd sAnim_LogoCircle_Top[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END +}; + +static const union AnimCmd sAnim_LogoCircle_Left[] = +{ + ANIMCMD_FRAME(64, 1), + ANIMCMD_END +}; + +static const union AnimCmd sAnim_LogoCircle_Right[] = +{ + ANIMCMD_FRAME(128, 1), + ANIMCMD_END +}; + +static const union AnimCmd *const sAnimTable_LogoCircles[] = +{ + sAnim_LogoCircle_Top, + sAnim_LogoCircle_Left, + sAnim_LogoCircle_Right +}; + +static const struct SpriteTemplate sSpriteTemplate_LogoCircles = +{ + .tileTag = PALTAG_LOGO_CIRCLES, + .paletteTag = PALTAG_LOGO_CIRCLES, + .oam = &sOamData_LogoCircles, + .anims = sAnimTable_LogoCircles, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const TransitionStateFunc sPhase2_FrontierCirclesMeet_Funcs[] = +{ + Circles_Init, + CirclesMeet_CreateSprites, + WaitForLogoCirclesAnim, + FadeInCenterLogoCircle, + CirclesMeet_End +}; + +static const TransitionStateFunc sPhase2_FrontierCirclesCross_Funcs[] = +{ + Circles_Init, + CirclesCross_CreateSprites, + WaitForLogoCirclesAnim, + FadeInCenterLogoCircle, + CirclesCross_End +}; + +static const TransitionStateFunc sPhase2_FrontierCirclesAsymmetricSpiral_Funcs[] = +{ + Circles_Init, + CirclesAsymmetricSpiral_CreateSprites, + WaitForLogoCirclesAnim, + FadeInCenterLogoCircle, + CirclesAsymmetricSpiral_End +}; + +static const TransitionStateFunc sPhase2_FrontierCirclesSymmetricSpiral_Funcs[] = +{ + Circles_Init, + CirclesSymmetricSpiral_CreateSprites, + WaitForLogoCirclesAnim, + FadeInCenterLogoCircle, + CirclesSymmetricSpiral_End +}; + +static const TransitionStateFunc sPhase2_FrontierCirclesMeetInSeq_Funcs[] = +{ + Circles_Init, + CirclesMeetInSeq_CreateSprites, + WaitForLogoCirclesAnim, + FadeInCenterLogoCircle, + CirclesMeetInSeq_End +}; + +static const TransitionStateFunc sPhase2_FrontierCirclesCrossInSeq_Funcs[] = +{ + Circles_Init, + CirclesCrossInSeq_CreateSprites, + WaitForLogoCirclesAnim, + FadeInCenterLogoCircle, + CirclesCrossInSeq_End +}; + +static const TransitionStateFunc sPhase2_FrontierCirclesAsymmetricSpiralInSeq_Funcs[] = +{ + Circles_Init, + CirclesAsymmetricSpiralInSeq_CreateSprites, + WaitForLogoCirclesAnim, + FadeInCenterLogoCircle, + CirclesAsymmetricSpiralInSeq_End +}; + +static const TransitionStateFunc sPhase2_FrontierCirclesSymmetricSpiralInSeq_Funcs[] = +{ + Circles_Init, + CirclesSymmetricSpiralInSeq_CreateSprites, + WaitForLogoCirclesAnim, + FadeInCenterLogoCircle, + CirclesSymmetricSpiralInSeq_End +}; + +// code +static void LoadLogoGfx(void) +{ + u16 *dst1, *dst2; + + GetBg0TilesDst(&dst1, &dst2); + LZ77UnCompVram(sLogoCenter_Gfx, dst2); + LZ77UnCompVram(sLogoCenter_Tilemap, dst1); + LoadPalette(sLogo_Pal, 0xF0, 0x20); + LoadCompressedSpriteSheet(&sSpriteSheet_LogoCircles); + LoadSpritePalette(&sSpritePalette_LogoCircles); +} + +static u8 CreateSlidingLogoCircleSprite(s16 x, s16 y, u8 arg2, u8 arg3, s8 arg4, s8 arg5, u8 spriteAnimNum) +{ + u8 spriteId = CreateSprite(&sSpriteTemplate_LogoCircles, x, y, 0); + + switch (spriteAnimNum) + { + case 0: + gSprites[spriteId].data[0] = 120; + gSprites[spriteId].data[1] = 45; + break; + case 1: + gSprites[spriteId].data[0] = 89; + gSprites[spriteId].data[1] = 97; + break; + case 2: + gSprites[spriteId].data[0] = 151; + gSprites[spriteId].data[1] = 97; + break; + } + + gSprites[spriteId].data[2] = arg4; + gSprites[spriteId].data[3] = arg5; + gSprites[spriteId].data[6] = arg2; + gSprites[spriteId].data[7] = arg3; + gSprites[spriteId].data[4] = 0; + gSprites[spriteId].data[5] = 0; + + StartSpriteAnim(&gSprites[spriteId], spriteAnimNum); + gSprites[spriteId].callback = SpriteCB_LogoCircleSlide; + + return spriteId; +} + +static void SpriteCB_LogoCircleSlide(struct Sprite *sprite) +{ + s16 *data = sprite->data; + + if (sprite->pos1.x == data[0] && sprite->pos1.y == data[1]) + { + sprite->callback = SpriteCallbackDummy; + } + else + { + if (data[4] == data[6]) + { + sprite->pos1.x += data[2]; + data[4] = 0; + } + else + { + data[4]++; + } + + if (data[5] == data[7]) + { + sprite->pos1.y += data[3]; + data[5] = 0; + } + else + { + data[5]++; + } + } +} + +static u8 CreateSpiralingLogoCircleSprite(s16 x, s16 y, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, u8 spriteAnimNum) +{ + u8 spriteId = CreateSprite(&sSpriteTemplate_LogoCircles, x, y, 0); + + switch (spriteAnimNum) + { + case 0: + gSprites[spriteId].data[0] = 120; + gSprites[spriteId].data[1] = 45; + break; + case 1: + gSprites[spriteId].data[0] = 89; + gSprites[spriteId].data[1] = 97; + break; + case 2: + gSprites[spriteId].data[0] = 151; + gSprites[spriteId].data[1] = 97; + break; + } + + gSprites[spriteId].data[2] = arg2; + gSprites[spriteId].data[3] = arg3; + gSprites[spriteId].data[4] = arg4; + gSprites[spriteId].data[5] = arg5; + gSprites[spriteId].data[6] = arg6; + + StartSpriteAnim(&gSprites[spriteId], spriteAnimNum); + gSprites[spriteId].callback = SpriteCB_LogoCircleSpiral; + + return spriteId; +} + +static void SpriteCB_LogoCircleSpiral(struct Sprite *sprite) +{ + sprite->pos2.x = (Sin2(sprite->data[2]) * sprite->data[4]) >> 12; // div by 4096 + sprite->pos2.y = (Cos2(sprite->data[2]) * sprite->data[4]) >> 12; // div by 4096 + + sprite->data[2] = (sprite->data[2] + sprite->data[3]) % 360; + + if (sprite->data[4] != sprite->data[5]) + sprite->data[4] += sprite->data[6]; + else + sprite->callback = SpriteCallbackDummy; +} + +#define tState data[0] + +static void DestroyLogoCirclesGfx(struct Task *task) +{ + FreeSpriteTilesByTag(PALTAG_LOGO_CIRCLES); + FreeSpritePaletteByTag(PALTAG_LOGO_CIRCLES); + + DestroySprite(&gSprites[task->data[4]]); + DestroySprite(&gSprites[task->data[5]]); + DestroySprite(&gSprites[task->data[6]]); +} + +static bool8 IsLogoCirclesAnimFinished(struct Task *task) +{ + if (gSprites[task->data[4]].callback == SpriteCallbackDummy + && gSprites[task->data[5]].callback == SpriteCallbackDummy + && gSprites[task->data[6]].callback == SpriteCallbackDummy) + return TRUE; + else + return FALSE; +} + +static bool8 Circles_Init(struct Task *task) +{ + if (task->data[1] == 0) + { + ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); + ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON); + ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG0_ON); + + task->data[1]++; + return FALSE; + } + else + { + LoadLogoGfx(); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgY(0, 0x500, 2); + + task->data[1] = 0; + task->tState++; + return TRUE; + } +} + +static bool8 FadeInCenterLogoCircle(struct Task *task) +{ + if (task->data[2] == 0) + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG0_ON); + + if (task->data[2] == 16) + { + if (task->data[3] == 31) + { + BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_BLACK); + task->tState++; + } + else + { + task->data[3]++; + } + } + else + { + u16 blnd; + + task->data[2]++; + blnd = task->data[2]; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(blnd, 16 - blnd)); + } + + return FALSE; +} + +static bool8 WaitForLogoCirclesAnim(struct Task *task) +{ + if (IsLogoCirclesAnimFinished(task) == TRUE) + task->tState++; + + return FALSE; +} + +void Phase2Task_FrontierCirclesMeet(u8 taskId) +{ + while (sPhase2_FrontierCirclesMeet_Funcs[gTasks[taskId].tState](&gTasks[taskId])); +} + +static bool8 CirclesMeet_CreateSprites(struct Task *task) +{ + task->data[4] = CreateSlidingLogoCircleSprite(120, -51, 0, 0, 0, 2, 0); + task->data[5] = CreateSlidingLogoCircleSprite(-7, 193, 0, 0, 2, -2, 1); + task->data[6] = CreateSlidingLogoCircleSprite(247, 193, 0, 0, -2, -2, 2); + + task->tState++; + return FALSE; +} + +static bool8 CirclesMeet_End(struct Task *task) +{ + if (!gPaletteFade.active) + { + DestroyLogoCirclesGfx(task); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesMeet)); + } + + return FALSE; +} + +void Phase2Task_FrontierCirclesCross(u8 taskId) +{ + while (sPhase2_FrontierCirclesCross_Funcs[gTasks[taskId].tState](&gTasks[taskId])); +} + +static bool8 CirclesCross_CreateSprites(struct Task *task) +{ + task->data[4] = CreateSlidingLogoCircleSprite(120, 197, 0, 0, 0, -4, 0); + task->data[5] = CreateSlidingLogoCircleSprite(241, 59, 0, 1, -4, 2, 1); + task->data[6] = CreateSlidingLogoCircleSprite(-1, 59, 0, 1, 4, 2, 2); + + task->tState++; + return FALSE; +} + +static bool8 CirclesCross_End(struct Task *task) +{ + if (!gPaletteFade.active) + { + DestroyLogoCirclesGfx(task); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesCross)); + } + + return FALSE; +} + +void Phase2Task_FrontierCirclesAsymmetricSpiral(u8 taskId) +{ + while (sPhase2_FrontierCirclesAsymmetricSpiral_Funcs[gTasks[taskId].tState](&gTasks[taskId])); +} + +static bool8 CirclesAsymmetricSpiral_CreateSprites(struct Task *task) +{ + task->data[4] = CreateSpiralingLogoCircleSprite(120, 45, 12, 4, 128, 0, -4, 0); + task->data[5] = CreateSpiralingLogoCircleSprite(89, 97, 252, 4, 128, 0, -4, 1); + task->data[6] = CreateSpiralingLogoCircleSprite(151, 97, 132, 4, 128, 0, -4, 2); + + task->tState++; + return FALSE; +} + +static bool8 CirclesAsymmetricSpiral_End(struct Task *task) +{ + if (!gPaletteFade.active) + { + DestroyLogoCirclesGfx(task); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesAsymmetricSpiral)); + } + + return FALSE; +} + +void Phase2Task_FrontierCirclesSymmetricSpiral(u8 taskId) +{ + while (sPhase2_FrontierCirclesSymmetricSpiral_Funcs[gTasks[taskId].tState](&gTasks[taskId])); +} + +static bool8 CirclesSymmetricSpiral_CreateSprites(struct Task *task) +{ + task->data[4] = CreateSpiralingLogoCircleSprite(120, 80, 284, 8, 131, 35, -3, 0); + task->data[5] = CreateSpiralingLogoCircleSprite(120, 80, 44, 8, 131, 35, -3, 1); + task->data[6] = CreateSpiralingLogoCircleSprite(121, 80, 164, 8, 131, 35, -3, 2); + + task->tState++; + return FALSE; +} + +static bool8 CirclesSymmetricSpiral_End(struct Task *task) +{ + if (!gPaletteFade.active) + { + DestroyLogoCirclesGfx(task); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesSymmetricSpiral)); + } + + return FALSE; +} + +void Phase2Task_FrontierCirclesMeetInSeq(u8 taskId) +{ + while (sPhase2_FrontierCirclesMeetInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId])); +} + +static bool8 CirclesMeetInSeq_CreateSprites(struct Task *task) +{ + if (task->data[1] == 0) + { + task->data[4] = CreateSlidingLogoCircleSprite(120, -51, 0, 0, 0, 4, 0); + } + else if (task->data[1] == 16) + { + task->data[5] = CreateSlidingLogoCircleSprite(-7, 193, 0, 0, 4, -4, 1); + } + else if (task->data[1] == 32) + { + task->data[6] = CreateSlidingLogoCircleSprite(247, 193, 0, 0, -4, -4, 2); + task->tState++; + } + + task->data[1]++; + return FALSE; +} + +static bool8 CirclesMeetInSeq_End(struct Task *task) +{ + if (!gPaletteFade.active) + { + DestroyLogoCirclesGfx(task); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesMeetInSeq)); + } + + return FALSE; +} + +void Phase2Task_FrontierCirclesCrossInSeq(u8 taskId) +{ + while (sPhase2_FrontierCirclesCrossInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId])); +} + +static bool8 CirclesCrossInSeq_CreateSprites(struct Task *task) +{ + if (task->data[1] == 0) + { + task->data[4] = CreateSlidingLogoCircleSprite(120, 197, 0, 0, 0, -8, 0); + } + else if (task->data[1] == 16) + { + task->data[5] = CreateSlidingLogoCircleSprite(241, 78, 0, 0, -8, 1, 1); + } + else if (task->data[1] == 32) + { + task->data[6] = CreateSlidingLogoCircleSprite(-1, 78, 0, 0, 8, 1, 2); + task->tState++; + } + + task->data[1]++; + return FALSE; +} + +static bool8 CirclesCrossInSeq_End(struct Task *task) +{ + if (!gPaletteFade.active) + { + DestroyLogoCirclesGfx(task); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesCrossInSeq)); + } + + return FALSE; +} + +void Phase2Task_FrontierCirclesAsymmetricSpiralInSeq(u8 taskId) +{ + while (sPhase2_FrontierCirclesAsymmetricSpiralInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId])); +} + +static bool8 CirclesAsymmetricSpiralInSeq_CreateSprites(struct Task *task) +{ + if (task->data[1] == 0) + { + task->data[4] = CreateSpiralingLogoCircleSprite(120, 45, 12, 4, 128, 0, -4, 0); + } + else if (task->data[1] == 16) + { + task->data[5] = CreateSpiralingLogoCircleSprite(89, 97, 252, 4, 128, 0, -4, 1); + } + else if (task->data[1] == 32) + { + task->data[6] = CreateSpiralingLogoCircleSprite(151, 97, 132, 4, 128, 0, -4, 2); + task->tState++; + } + + task->data[1]++; + return FALSE; +} + +static bool8 CirclesAsymmetricSpiralInSeq_End(struct Task *task) +{ + if (!gPaletteFade.active) + { + DestroyLogoCirclesGfx(task); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesAsymmetricSpiralInSeq)); + } + + return FALSE; +} + +void Phase2Task_FrontierCirclesSymmetricSpiralInSeq(u8 taskId) +{ + while (sPhase2_FrontierCirclesSymmetricSpiralInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId])); +} + +static bool8 CirclesSymmetricSpiralInSeq_CreateSprites(struct Task *task) +{ + if (task->data[1] == 0) + { + task->data[4] = CreateSpiralingLogoCircleSprite(120, 80, 284, 8, 131, 35, -3, 0); + } + else if (task->data[1] == 16) + { + task->data[5] = CreateSpiralingLogoCircleSprite(120, 80, 44, 8, 131, 35, -3, 1); + } + else if (task->data[1] == 32) + { + task->data[6] = CreateSpiralingLogoCircleSprite(121, 80, 164, 8, 131, 35, -3, 2); + task->tState++; + } + + task->data[1]++; + return FALSE; +} + +static bool8 CirclesSymmetricSpiralInSeq_End(struct Task *task) +{ + if (!gPaletteFade.active) + { + DestroyLogoCirclesGfx(task); + DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesSymmetricSpiralInSeq)); + } + + return FALSE; +} diff --git a/src/battle_util.c b/src/battle_util.c index da3d50648..9cc2252b6 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -864,9 +864,9 @@ u8 DoBattlerEndTurnEffects(void) gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 16; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; - if ((gBattleMons[gActiveBattler].status1 & 0xF00) != 0xF00) // not 16 turns - gBattleMons[gActiveBattler].status1 += 0x100; - gBattleMoveDamage *= (gBattleMons[gActiveBattler].status1 & 0xF00) >> 8; + if ((gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_COUNTER) != STATUS1_TOXIC_TURN(15)) // not 16 turns + gBattleMons[gActiveBattler].status1 += STATUS1_TOXIC_TURN(1); + gBattleMoveDamage *= (gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_COUNTER) >> 8; BattleScriptExecute(BattleScript_PoisonTurnDmg); effect++; } @@ -917,7 +917,7 @@ u8 DoBattlerEndTurnEffects(void) case ENDTURN_WRAP: // wrap if ((gBattleMons[gActiveBattler].status2 & STATUS2_WRAPPED) && gBattleMons[gActiveBattler].hp != 0) { - gBattleMons[gActiveBattler].status2 -= 0x2000; + gBattleMons[gActiveBattler].status2 -= STATUS2_WRAPPED_TURN(1); if (gBattleMons[gActiveBattler].status2 & STATUS2_WRAPPED) // damaged by wrap { // This is the only way I could get this array access to match. @@ -973,7 +973,7 @@ u8 DoBattlerEndTurnEffects(void) else { gBattlerAttacker = gActiveBattler; - gBattleMons[gActiveBattler].status2 -= 0x10; // uproar timer goes down + gBattleMons[gActiveBattler].status2 -= STATUS2_UPROAR_TURN(1); if (WasUnableToUseMove(gActiveBattler)) { CancelMultiTurnMoves(gActiveBattler); @@ -999,7 +999,7 @@ u8 DoBattlerEndTurnEffects(void) case ENDTURN_THRASH: // thrash if (gBattleMons[gActiveBattler].status2 & STATUS2_LOCK_CONFUSE) { - gBattleMons[gActiveBattler].status2 -= 0x400; + gBattleMons[gActiveBattler].status2 -= STATUS2_LOCK_CONFUSE_TURN(1); if (WasUnableToUseMove(gActiveBattler)) CancelMultiTurnMoves(gActiveBattler); else if (!(gBattleMons[gActiveBattler].status2 & STATUS2_LOCK_CONFUSE) @@ -1062,7 +1062,7 @@ u8 DoBattlerEndTurnEffects(void) break; case ENDTURN_LOCK_ON: // lock-on decrement if (gStatuses3[gActiveBattler] & STATUS3_ALWAYS_HITS) - gStatuses3[gActiveBattler] -= 0x8; + gStatuses3[gActiveBattler] -= STATUS3_ALWAYS_HITS_TURN(1); gBattleStruct->turnEffectsTracker++; break; case ENDTURN_CHARGE: // charge @@ -1078,13 +1078,13 @@ u8 DoBattlerEndTurnEffects(void) case ENDTURN_YAWN: // yawn if (gStatuses3[gActiveBattler] & STATUS3_YAWN) { - gStatuses3[gActiveBattler] -= 0x800; + gStatuses3[gActiveBattler] -= STATUS3_YAWN_TURN(1); if (!(gStatuses3[gActiveBattler] & STATUS3_YAWN) && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY) && gBattleMons[gActiveBattler].ability != ABILITY_VITAL_SPIRIT && gBattleMons[gActiveBattler].ability != ABILITY_INSOMNIA && !UproarWakeUpCheck(gActiveBattler)) { CancelMultiTurnMoves(gActiveBattler); - gBattleMons[gActiveBattler].status1 |= (Random() & 3) + 2; + gBattleMons[gActiveBattler].status1 |= STATUS1_SLEEP_TURN((Random() & 3) + 2); // 2-5 turns of sleep BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); gEffectBattler = gActiveBattler; @@ -1478,7 +1478,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_CONFUSED: // confusion if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION) { - gBattleMons[gBattlerAttacker].status2--; + gBattleMons[gBattlerAttacker].status2 -= STATUS2_CONFUSION_TURN(1); if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION) { if (Random() & 1) @@ -1540,7 +1540,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_BIDE: // bide if (gBattleMons[gBattlerAttacker].status2 & STATUS2_BIDE) { - gBattleMons[gBattlerAttacker].status2 -= 0x100; + gBattleMons[gBattlerAttacker].status2 -= STATUS2_BIDE_TURN(1); if (gBattleMons[gBattlerAttacker].status2 & STATUS2_BIDE) { gBattlescriptCurrInstr = BattleScript_BideStoringEnergy; diff --git a/src/crt0.s b/src/crt0.s index 3ab711713..cb7c93a6b 100644 --- a/src/crt0.s +++ b/src/crt0.s @@ -82,10 +82,10 @@ GPIOPortReadEnable: @ 80000C8 .align 2, 0 .global Init Init: @ 8000204 - mov r0, PSR_IRQ_MODE + mov r0, #PSR_IRQ_MODE msr cpsr_cf, r0 ldr sp, sp_irq - mov r0, PSR_SYS_MODE + mov r0, #PSR_SYS_MODE msr cpsr_cf, r0 ldr sp, sp_sys ldr r1, =INTR_VECTOR @@ -106,91 +106,91 @@ sp_irq: .word IWRAM_END - 0x60 .align 2, 0 .global IntrMain IntrMain: @ 8000248 - mov r3, REG_BASE - add r3, r3, 0x200 - ldr r2, [r3, OFFSET_REG_IE - 0x200] - ldrh r1, [r3, OFFSET_REG_IME - 0x200] + mov r3, #REG_BASE + add r3, r3, #OFFSET_REG_IE + ldr r2, [r3] + ldrh r1, [r3, #OFFSET_REG_IME - 0x200] mrs r0, spsr - stmdb sp!, {r0-r3,lr} - mov r0, 0 - strh r0, [r3, OFFSET_REG_IME - 0x200] - and r1, r2, r2, lsr 16 - mov r12, 0 - ands r0, r1, INTR_FLAG_VCOUNT + stmfd sp!, {r0-r3,lr} + mov r0, #0 + strh r0, [r3, #OFFSET_REG_IME - 0x200] + and r1, r2, r2, lsr #16 + mov r12, #0 + ands r0, r1, #INTR_FLAG_VCOUNT bne IntrMain_FoundIntr add r12, r12, 0x4 mov r0, 0x1 - strh r0, [r3, OFFSET_REG_IME - 0x200] - ands r0, r1, INTR_FLAG_SERIAL + strh r0, [r3, #OFFSET_REG_IME - 0x200] + ands r0, r1, #INTR_FLAG_SERIAL bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_TIMER3 + ands r0, r1, #INTR_FLAG_TIMER3 bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_HBLANK + ands r0, r1, #INTR_FLAG_HBLANK bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_VBLANK + ands r0, r1, #INTR_FLAG_VBLANK bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_TIMER0 + ands r0, r1, #INTR_FLAG_TIMER0 bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_TIMER1 + ands r0, r1, #INTR_FLAG_TIMER1 bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_TIMER2 + ands r0, r1, #INTR_FLAG_TIMER2 bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_DMA0 + ands r0, r1, #INTR_FLAG_DMA0 bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_DMA1 + ands r0, r1, #INTR_FLAG_DMA1 bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_DMA2 + ands r0, r1, #INTR_FLAG_DMA2 bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_DMA3 + ands r0, r1, #INTR_FLAG_DMA3 bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_KEYPAD + ands r0, r1, #INTR_FLAG_KEYPAD bne IntrMain_FoundIntr add r12, r12, 0x4 - ands r0, r1, INTR_FLAG_GAMEPAK - strbne r0, [r3, OFFSET_REG_SOUNDCNT_X - 0x200] + ands r0, r1, #INTR_FLAG_GAMEPAK + strbne r0, [r3, #REG_SOUNDCNT_X - REG_IE] bne . @ spin IntrMain_FoundIntr: - strh r0, [r3, OFFSET_REG_IF - 0x200] + strh r0, [r3, #OFFSET_REG_IF - 0x200] bic r2, r2, r0 ldr r0, =gSTWIStatus ldr r0, [r0] ldrb r0, [r0, 0xA] mov r1, 0x8 - mov r0, r1, lsl r0 - orr r0, r0, INTR_FLAG_GAMEPAK - orr r1, r0, INTR_FLAG_SERIAL | INTR_FLAG_TIMER3 | INTR_FLAG_VCOUNT | INTR_FLAG_HBLANK + lsl r0, r1, r0 + orr r0, r0, #INTR_FLAG_GAMEPAK + orr r1, r0, #INTR_FLAG_SERIAL | INTR_FLAG_TIMER3 | INTR_FLAG_VCOUNT | INTR_FLAG_HBLANK and r1, r1, r2 - strh r1, [r3, OFFSET_REG_IE - 0x200] + strh r1, [r3, #OFFSET_REG_IE - 0x200] mrs r3, cpsr - bic r3, r3, PSR_I_BIT | PSR_F_BIT | PSR_MODE_MASK - orr r3, r3, PSR_SYS_MODE + bic r3, r3, #PSR_I_BIT | PSR_F_BIT | PSR_MODE_MASK + orr r3, r3, #PSR_SYS_MODE msr cpsr_cf, r3 ldr r1, =gIntrTable add r1, r1, r12 ldr r0, [r1] - stmdb sp!, {lr} + stmfd sp!, {lr} adr lr, IntrMain_RetAddr bx r0 IntrMain_RetAddr: - ldmia sp!, {lr} + ldmfd sp!, {lr} mrs r3, cpsr - bic r3, r3, PSR_I_BIT | PSR_F_BIT | PSR_MODE_MASK - orr r3, r3, PSR_I_BIT | PSR_IRQ_MODE + bic r3, r3, #PSR_I_BIT | PSR_F_BIT | PSR_MODE_MASK + orr r3, r3, #PSR_I_BIT | PSR_IRQ_MODE msr cpsr_cf, r3 ldmia sp!, {r0-r3,lr} - strh r2, [r3, OFFSET_REG_IE - 0x200] - strh r1, [r3, OFFSET_REG_IME - 0x200] + strh r2, [r3, #OFFSET_REG_IE - 0x200] + strh r1, [r3, #OFFSET_REG_IME - 0x200] msr spsr_cf, r0 bx lr diff --git a/src/data/text/nature_names.h b/src/data/text/nature_names.h index d0d217d9b..601898445 100644 --- a/src/data/text/nature_names.h +++ b/src/data/text/nature_names.h @@ -24,7 +24,7 @@ static const u8 sSassyNatureName[] = _("SASSY"); static const u8 sCarefulNatureName[] = _("CAREFUL"); static const u8 sQuirkyNatureName[] = _("QUIRKY"); -const u8 *const gNatureNamePointers[] = +const u8 *const gNatureNamePointers[NUM_NATURES] = { [NATURE_HARDY] = sHardyNatureName, [NATURE_LONELY] = sLonelyNatureName, diff --git a/src/field_specials.c b/src/field_specials.c index f9b8a7bd0..98643b26e 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -2854,7 +2854,7 @@ void SetBattleTowerLinkPlayerGfx(void) void ShowNatureGirlMessage(void) { - static const u8 *const sNatureGirlMessages[] = { + static const u8 *const sNatureGirlMessages[NUM_NATURES] = { [NATURE_HARDY] = BattleFrontier_Lounge5_Text_NatureGirlHardy, [NATURE_LONELY] = BattleFrontier_Lounge5_Text_NatureGirlLonely, [NATURE_BRAVE] = BattleFrontier_Lounge5_Text_NatureGirlBrave, @@ -3687,7 +3687,7 @@ void Unused_SetWeatherSunny(void) SetCurrentAndNextWeather(WEATHER_SUNNY); } -// Always returns 1 +// All mart employees have a local id of 1, so function always returns 1 u32 GetMartEmployeeObjectEventId(void) { static const u8 sPokeMarts[][3] = diff --git a/src/libgcnmultiboot.s b/src/libgcnmultiboot.s index 0e418e51f..dbf70ccf8 100644 --- a/src/libgcnmultiboot.s +++ b/src/libgcnmultiboot.s @@ -22,7 +22,7 @@ GameCubeMultiBoot_Hash: @ 82DED70 movs r2, 0x20 GameCubeMultiBoot_Hash_Loop: - lsrs r3, 1 + lsrs r3, #1 bcc GameCubeMultiBoot_Hash_SkipEor eors r3, r4 @@ -37,8 +37,8 @@ GameCubeMultiBoot_Hash_SkipEor: thumb_func_start GameCubeMultiBoot_Main @ void GameCubeMultiBoot_Main(struct GameCubeMultiBoot *mb); GameCubeMultiBoot_Main: @ 82DED84 - ldr r1, [r0, GCMB_STRUCT_SERIAL_INTR_HANDLER] - cmp r1, 0 + ldr r1, [r0, #GCMB_STRUCT_SERIAL_INTR_HANDLER] + cmp r1, #0 beq _082DEDAA ldrb r1, [r0, 0x1] adds r1, 0x1 @@ -47,30 +47,30 @@ GameCubeMultiBoot_Main: @ 82DED84 cmp r1, 0x2 beq _082DEDF4 ldr r3, pool_InterruptRegs - ldrh r2, [r3, OFFSET_REG_IME - 0x200] + ldrh r2, [r3, #OFFSET_REG_IME - 0x200] movs r1, 0 - strh r1, [r3, OFFSET_REG_IME - 0x200] + strh r1, [r3, #OFFSET_REG_IME - 0x200] ldrb r1, [r0] cmp r1, 0xA bgt _082DEDA8 adds r1, 0x1 strb r1, [r0] _082DEDA8: - strh r2, [r3, OFFSET_REG_IME - 0x200] + strh r2, [r3, #OFFSET_REG_IME - 0x200] _082DEDAA: bcs GameCubeMultiBoot_Init ldrb r1, [r0, 0x2] cmp r1, 0 bne _082DEDF6 - ldr r1, [r0, GCMB_STRUCT_CUR_DEST_PTR] - ldr r2, [r0, GCMB_STRUCT_BASE_DEST_PTR] + ldr r1, [r0, #GCMB_STRUCT_CUR_DEST_PTR] + ldr r2, [r0, #GCMB_STRUCT_BASE_DEST_PTR] subs r1, r2 beq _082DEE76 cmp r1, 0xA0 bcc _082DEE76 push {r4-r6} movs r1, 0x98 - adds r2, ROM_HEADER_NINTENDO_LOGO_OFFSET + adds r2, #ROM_HEADER_NINTENDO_LOGO_OFFSET ldr r4, pool_NintendoLogo _082DEDC6: ldm r2!, {r5} @@ -82,8 +82,8 @@ _082DEDC6: ldm r2!, {r5} ldm r4!, {r6} eors r5, r6 - lsrs r5, 8 - str r2, [r0, GCMB_STRUCT_BASE_DEST_PTR] + lsrs r5, #8 + str r2, [r0, #GCMB_STRUCT_BASE_DEST_PTR] _082DEDDC: pop {r4-r6} bne GameCubeMultiBoot_Init @@ -100,11 +100,11 @@ _082DEDDC: _082DEDF4: bx lr _082DEDF6: - ldr r1, [r0, GCMB_STRUCT_CUR_DEST_PTR] + ldr r1, [r0, #GCMB_STRUCT_CUR_DEST_PTR] mov r12, r1 ldr r3, [r0, 0x18] push {r4-r7} - ldr r4, [r0, GCMB_STRUCT_BASE_DEST_PTR] + ldr r4, [r0, #GCMB_STRUCT_BASE_DEST_PTR] ldr r5, pool_Kawa ldr r6, [r0, 0x14] ldr r7, pool_HashVal @@ -118,7 +118,7 @@ _082DEE06: eors r3, r1 movs r2, 0x20 _082DEE16: - lsrs r3, 1 + lsrs r3, #1 bcc _082DEE1C eors r3, r7 _082DEE1C: @@ -128,22 +128,22 @@ _082DEE1C: adds r6, 0x1 b _082DEE06 _082DEE26: - str r4, [r0, GCMB_STRUCT_BASE_DEST_PTR] + str r4, [r0, #GCMB_STRUCT_BASE_DEST_PTR] str r6, [r0, 0x14] pop {r4-r7} str r3, [r0, 0x18] ldrh r1, [r0, 0x12] - cmp r1, 0 + cmp r1, #0 bne _082DEE76 - ldr r1, [r0, GCMB_STRUCT_CUR_DEST_PTR] - ldr r2, [r0, GCMB_STRUCT_BASE_DEST_PTR] + ldr r1, [r0, #GCMB_STRUCT_CUR_DEST_PTR] + ldr r2, [r0, #GCMB_STRUCT_BASE_DEST_PTR] cmp r1, r2 bne _082DEE76 ldr r1, [r0, 0xC] - cmp r1, 0 + cmp r1, #0 beq _082DEE60 ldrh r1, [r0, 0x10] - cmp r1, 0 + cmp r1, #0 beq _082DEDF4 mov r12, lr movs r1, 0xBB @@ -159,11 +159,11 @@ _082DEE26: _082DEE60: mov r12, lr ldrb r1, [r0, 0x3] - lsls r1, 24 + lsls r1, #24 subs r1, 0x1 str r1, [r0, 0xC] bl GameCubeMultiBoot_Hash - lsls r3, 8 + lsls r3, #8 adds r3, 0xFF str r3, [r0, 0x1C] bx r12 @@ -186,8 +186,8 @@ GameCubeMultiBoot_ExecuteProgram: @ 82DEE84 cmp r1, 0x2 bne GameCubeMultiBoot_ExecuteProgram_Fail ldr r3, pool_InterruptRegs - movs r1, 0 - strh r1, [r3, OFFSET_REG_IME - 0x200] + movs r1, #0 + strh r1, [r3, #OFFSET_REG_IME - 0x200] ldr r1, pool_MultiBootLoadAddr adds r1, 0xC0 bx r1 @@ -201,25 +201,25 @@ GameCubeMultiBoot_Init: @ 82DEE98 ldr r3, pool_InterruptRegs @ Save IME register. - ldrh r2, [r3, OFFSET_REG_IME - 0x200] + ldrh r2, [r3, #OFFSET_REG_IME - 0x200] @ Disable interrupts. movs r1, 0 - strh r1, [r3, OFFSET_REG_IME - 0x200] + strh r1, [r3, #OFFSET_REG_IME - 0x200] @ Set the handler to the "Stop" routine. @ Unless the first command that is received is a device reset command, the @ "Stop" routine will be executed and no further commands will be processed. adr r3, GcMbIntrHandler_Stop - str r3, [r0, GCMB_STRUCT_SERIAL_INTR_HANDLER] + str r3, [r0, #GCMB_STRUCT_SERIAL_INTR_HANDLER] ldrb r3, [r0, 0x3] push {r3} ldrb r3, [r0, 0x1] push {r0,r3} - adds r3, r0, 0 - adds r3, GCMB_STRUCT_BASE_DEST_PTR + adds r3, r0, #0 + adds r3, #GCMB_STRUCT_BASE_DEST_PTR @ clear all but the last 3 fields of the struct GameCubeMultiBoot_Init_ClearStructLoop: @@ -261,7 +261,7 @@ GameCubeMultiBoot_Init_ClearStructLoop: strh r1, [r3, OFFSET_REG_IE - 0x200] @ Restore IME register. - strh r2, [r3, OFFSET_REG_IME - 0x200] + strh r2, [r3, #OFFSET_REG_IME - 0x200] bx lr thumb_func_end GameCubeMultiBoot_Init @@ -275,11 +275,11 @@ GameCubeMultiBoot_HandleSerialInterrupt: @ 82DEEE2 ldrh r1, [r3, OFFSET_REG_JOYCNT - 0x120] strh r1, [r3, OFFSET_REG_JOYCNT - 0x120] - movs r2, 0 + movs r2, #0 strb r2, [r0] - ldr r2, [r0, GCMB_STRUCT_SERIAL_INTR_HANDLER] - cmp r2, 0 + ldr r2, [r0, #GCMB_STRUCT_SERIAL_INTR_HANDLER] + cmp r2, #0 beq GameCubeMultiBoot_HandleSerialInterruptDone lsrs r1, 1 @ was a device reset command received? @@ -297,7 +297,7 @@ GcMbIntrHandler_Stop: strh r2, [r3, OFFSET_REG_JOYSTAT - 0x120] GameCubeMultiBoot_SetInterruptHandler: - str r2, [r0, GCMB_STRUCT_SERIAL_INTR_HANDLER] + str r2, [r0, #GCMB_STRUCT_SERIAL_INTR_HANDLER] GameCubeMultiBoot_ReadVCount: ldr r3, pool_RegDispstat @@ -319,8 +319,8 @@ GameCubeMultiBoot_BeginHandshake: cmp r1, 0 bne GcMbIntrHandler_Stop ldr r1, pool_MultiBootLoadAddr - str r1, [r0, GCMB_STRUCT_BASE_DEST_PTR] - str r1, [r0, GCMB_STRUCT_CUR_DEST_PTR] + str r1, [r0, #GCMB_STRUCT_BASE_DEST_PTR] + str r1, [r0, #GCMB_STRUCT_CUR_DEST_PTR] adr r2, GcMbIntrHandler_CheckGameCodeSent b GameCubeMultiBoot_SetInterruptHandler @@ -417,8 +417,8 @@ _082DEF94: _082DEFA6: bne GcMbIntrHandler_Stop ldr r1, pool_MultiBootLoadAddr - str r1, [r0, GCMB_STRUCT_BASE_DEST_PTR] - str r1, [r0, GCMB_STRUCT_CUR_DEST_PTR] + str r1, [r0, #GCMB_STRUCT_BASE_DEST_PTR] + str r1, [r0, #GCMB_STRUCT_CUR_DEST_PTR] adr r2, GcMbIntrHandler_82DEFB4 b GameCubeMultiBoot_SetInterruptHandler @@ -427,7 +427,7 @@ _082DEFA6: GcMbIntrHandler_82DEFB4: @ 82DEFB4 lsrs r1, 1 @ is receive complete? bcc GcMbIntrHandler_Stop @ branch if not - ldr r2, [r0, GCMB_STRUCT_CUR_DEST_PTR] + ldr r2, [r0, #GCMB_STRUCT_CUR_DEST_PTR] movs r1, 0x4 ands r1, r2 adds r1, 0x8 @@ -435,7 +435,7 @@ GcMbIntrHandler_82DEFB4: @ 82DEFB4 strh r1, [r3, OFFSET_REG_JOYSTAT - 0x120] ldr r1, [r3, OFFSET_REG_JOY_RECV - 0x120] stm r2!, {r1} - str r2, [r0, GCMB_STRUCT_CUR_DEST_PTR] + str r2, [r0, #GCMB_STRUCT_CUR_DEST_PTR] ldrh r1, [r0, 0x12] subs r1, 0x1 strh r1, [r0, 0x12] @@ -500,11 +500,11 @@ GameCubeMultiBoot_Quit: @ 82DF012 ldr r3, pool_InterruptRegs @ Save IME register. - ldrh r2, [r3, OFFSET_REG_IME - 0x200] + ldrh r2, [r3, #OFFSET_REG_IME - 0x200] @ Disable interrupts. movs r1, 0 - strh r1, [r3, OFFSET_REG_IME - 0x200] + strh r1, [r3, #OFFSET_REG_IME - 0x200] ldr r3, pool_SerialRegs @@ -528,7 +528,7 @@ GameCubeMultiBoot_Quit: @ 82DF012 strh r1, [r3, OFFSET_REG_IE - 0x200] @ Restore IME register. - strh r2, [r3, OFFSET_REG_IME - 0x200] + strh r2, [r3, #OFFSET_REG_IME - 0x200] bx lr thumb_func_end GameCubeMultiBoot_Quit diff --git a/src/pokeblock.c b/src/pokeblock.c index 9be3ad24d..f654e0782 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -117,7 +117,7 @@ EWRAM_DATA static struct PokeblockSavedData sSavedPokeblockData = {0}; EWRAM_DATA static struct PokeblockMenuStruct *sPokeblockMenu = NULL; // const rom data -const s8 gPokeblockFlavorCompatibilityTable[] = +const s8 gPokeblockFlavorCompatibilityTable[NUM_NATURES * FLAVOR_COUNT] = { // Cool, Beauty, Cute, Smart, Tough 0, 0, 0, 0, 0, // Hardy @@ -1386,7 +1386,7 @@ s16 PokeblockGetGain(u8 nature, const struct Pokeblock *pokeblock) { curGain = GetPokeblockData(pokeblock, flavor + PBLOCK_SPICY); if (curGain > 0) - totalGain += curGain * gPokeblockFlavorCompatibilityTable[5 * nature + flavor]; + totalGain += curGain * gPokeblockFlavorCompatibilityTable[FLAVOR_COUNT * nature + flavor]; } return totalGain; diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 72e54ae4c..e15a005e6 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -84,7 +84,7 @@ EWRAM_DATA static struct PokeblockFeedStruct *sPokeblockFeed = NULL; EWRAM_DATA static struct CompressedSpritePalette sPokeblockSpritePal = {0}; // const rom data -static const u8 sNatureToMonPokeblockAnim[][2] = +static const u8 sNatureToMonPokeblockAnim[NUM_NATURES][2] = { [NATURE_HARDY] = { 0, 0 }, [NATURE_LONELY] = { 3, 0 }, diff --git a/src/pokemon.c b/src/pokemon.c index 329240f99..80e93c568 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1349,7 +1349,7 @@ const struct SpindaSpot gSpindaSpotGraphics[] = #include "data/pokemon/item_effects.h" -const s8 gNatureStatTable[][NUM_EV_STATS] = +const s8 gNatureStatTable[NUM_NATURES][NUM_NATURE_STATS] = { // Atk Def Spd Sp.Atk Sp.Def { 0, 0, 0, 0, 0}, // Hardy @@ -5372,12 +5372,12 @@ u8 *UseStatIncreaseItem(u16 itemId) u8 GetNature(struct Pokemon *mon) { - return GetMonData(mon, MON_DATA_PERSONALITY, 0) % 25; + return GetMonData(mon, MON_DATA_PERSONALITY, 0) % NUM_NATURES; } u8 GetNatureFromPersonality(u32 personality) { - return personality % 25; + return personality % NUM_NATURES; } u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem) @@ -5747,7 +5747,7 @@ u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex) { // Dont modify HP, Accuracy, or Evasion by nature - if (statIndex <= STAT_HP || statIndex > NUM_EV_STATS) + if (statIndex <= STAT_HP || statIndex > NUM_NATURE_STATS) { // Should just be "return n", but it wouldn't match without this. u16 retVal = n; @@ -5836,7 +5836,7 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies) u16 totalEVs = 0; u16 heldItem; u8 holdEffect; - int i; + int i, multiplier; for (i = 0; i < NUM_STATS; i++) { @@ -5846,43 +5846,37 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies) for (i = 0; i < NUM_STATS; i++) { - u8 hasHadPokerus; - int multiplier; - if (totalEVs >= MAX_TOTAL_EVS) break; - - hasHadPokerus = CheckPartyHasHadPokerus(mon, 0); - - if (hasHadPokerus) + + if (CheckPartyHasHadPokerus(mon, 0)) multiplier = 2; else multiplier = 1; switch (i) { - case 0: + case STAT_HP: evIncrease = gBaseStats[defeatedSpecies].evYield_HP * multiplier; break; - case 1: + case STAT_ATK: evIncrease = gBaseStats[defeatedSpecies].evYield_Attack * multiplier; break; - case 2: + case STAT_DEF: evIncrease = gBaseStats[defeatedSpecies].evYield_Defense * multiplier; break; - case 3: + case STAT_SPEED: evIncrease = gBaseStats[defeatedSpecies].evYield_Speed * multiplier; break; - case 4: + case STAT_SPATK: evIncrease = gBaseStats[defeatedSpecies].evYield_SpAttack * multiplier; break; - case 5: + case STAT_SPDEF: evIncrease = gBaseStats[defeatedSpecies].evYield_SpDefense * multiplier; break; } heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0); - if (heldItem == ITEM_ENIGMA_BERRY) { if (gMain.inBattle) @@ -6410,13 +6404,13 @@ bool8 IsMonSpriteNotFlipped(u16 species) s8 GetMonFlavorRelation(struct Pokemon *mon, u8 flavor) { u8 nature = GetNature(mon); - return gPokeblockFlavorCompatibilityTable[nature * 5 + flavor]; + return gPokeblockFlavorCompatibilityTable[nature * FLAVOR_COUNT + flavor]; } s8 GetFlavorRelationByPersonality(u32 personality, u8 flavor) { u8 nature = GetNatureFromPersonality(personality); - return gPokeblockFlavorCompatibilityTable[nature * 5 + flavor]; + return gPokeblockFlavorCompatibilityTable[nature * FLAVOR_COUNT + flavor]; } bool8 IsTradedMon(struct Pokemon *mon) diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 1c07b0962..a388be39a 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -783,7 +783,7 @@ static const u8 sBackAnimationIds[] = 0x94, 0x95, 0x96, // 0x19 }; -static const u8 sBackAnimNatureModTable[] = +static const u8 sBackAnimNatureModTable[NUM_NATURES] = { [NATURE_HARDY] = 0x00, [NATURE_LONELY] = 0x02, diff --git a/src/starter_choose.c b/src/starter_choose.c index b919a8a17..2585f3408 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -14,6 +14,7 @@ #include "sound.h" #include "sprite.h" #include "starter_choose.h" +#include "strings.h" #include "task.h" #include "text.h" #include "text_window.h" @@ -27,54 +28,45 @@ #define STARTER_MON_COUNT 3 // Position of the sprite of the selected starter Pokemon -#define STARTER_PKMN_POS_X 120 +#define STARTER_PKMN_POS_X (DISPLAY_WIDTH / 2) #define STARTER_PKMN_POS_Y 64 -// text -extern const u8 gText_BirchInTrouble[]; -extern const u8 gText_ConfirmStarterChoice[]; - -// this file's functions -static void MainCallback2_StarterChoose(void); -static void sub_8134604(void); -static void Task_StarterChoose1(u8 taskId); -static void Task_StarterChoose2(u8 taskId); -static void Task_StarterChoose3(u8 taskId); -static void Task_StarterChoose4(u8 taskId); -static void Task_StarterChoose5(u8 taskId); -static void Task_StarterChoose6(u8 taskId); +#define TAG_POKEBALL_SELECT 0x1000 +#define TAG_STARTER_CIRCLE 0x1001 + +static void CB2_StarterChoose(void); +static void ClearStarterLabel(void); +static void Task_StarterChoose(u8 taskId); +static void Task_HandleStarterChooseInput(u8 taskId); +static void Task_WaitForStarterSprite(u8 taskId); +static void Task_AskConfirmStarter(u8 taskId); +static void Task_HandleConfirmStarterInput(u8 taskId); +static void Task_DeclineStarter(u8 taskId); static void Task_MoveStarterChooseCursor(u8 taskId); -static void sub_8134668(u8 taskId); +static void Task_CreateStarterLabel(u8 taskId); static void CreateStarterPokemonLabel(u8 selection); static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y); -void sub_81346DC(struct Sprite *sprite); -void sub_813473C(struct Sprite *sprite); -void StarterPokemonSpriteCallback(struct Sprite *sprite); +static void SpriteCB_SelectionHand(struct Sprite *sprite); +static void SpriteCB_Pokeball(struct Sprite *sprite); +static void SpriteCB_StarterPokemon(struct Sprite *sprite); -static u16 sStarterChooseWindowId; +static u16 sStarterLabelWindowId; -// .rodata const u16 gBirchBagGrassPal[][16] = { INCBIN_U16("graphics/misc/birch_bag.gbapal"), INCBIN_U16("graphics/misc/birch_grass.gbapal"), }; -const u16 gBirchBallarrow_Pal[] = INCBIN_U16("graphics/misc/birch_ballarrow.gbapal"); - -const u16 gBirchCircle_Pal[] = INCBIN_U16("graphics/misc/birch_circle.gbapal"); - +static const u16 sPokeballSelection_Pal[] = INCBIN_U16("graphics/misc/pokeball_selection.gbapal"); +static const u16 sStarterCircle_Pal[] = INCBIN_U16("graphics/misc/starter_circle.gbapal"); const u32 gBirchBagTilemap[] = INCBIN_U32("graphics/misc/birch_bag_map.bin.lz"); - const u32 gBirchGrassTilemap[] = INCBIN_U32("graphics/misc/birch_grass_map.bin.lz"); +const u32 gBirchHelpGfx[] = INCBIN_U32("graphics/misc/birch_help.4bpp.lz"); // Birch bag and grass combined +const u32 gPokeballSelection_Gfx[] = INCBIN_U32("graphics/misc/pokeball_selection.4bpp.lz"); +static const u32 sStarterCircle_Gfx[] = INCBIN_U32("graphics/misc/starter_circle.4bpp.lz"); -const u32 gBirchHelpGfx[] = INCBIN_U32("graphics/misc/birch_help.4bpp.lz"); - -const u32 gUnknown_085B18AC[] = INCBIN_U32("graphics/misc/birch_ballarrow.4bpp.lz"); - -const u32 gUnknown_085B1BCC[] = INCBIN_U32("graphics/misc/birch_circle.4bpp.lz"); - -static const struct WindowTemplate gUnknown_085B1DCC[] = +static const struct WindowTemplate sWindowTemplates[] = { { .bg = 0, @@ -88,7 +80,7 @@ static const struct WindowTemplate gUnknown_085B1DCC[] = DUMMY_WIN_TEMPLATE, }; -static const struct WindowTemplate gUnknown_085B1DDC = +static const struct WindowTemplate sWindowTemplate_ConfirmStarter = { .bg = 0, .tilemapLeft = 24, @@ -99,7 +91,7 @@ static const struct WindowTemplate gUnknown_085B1DDC = .baseBlock = 0x0260 }; -static const struct WindowTemplate gUnknown_085B1DE4 = +static const struct WindowTemplate sWindowTemplate_StarterLabel = { .bg = 0, .tilemapLeft = 0, @@ -117,7 +109,7 @@ static const u8 sPokeballCoords[STARTER_MON_COUNT][2] = {180, 64}, }; -static const u8 sStarterLabelCoords[][2] = +static const u8 sStarterLabelCoords[STARTER_MON_COUNT][2] = { {0, 9}, {16, 10}, @@ -131,7 +123,7 @@ static const u16 sStarterMon[STARTER_MON_COUNT] = SPECIES_MUDKIP, }; -static const struct BgTemplate gUnknown_085B1E00[3] = +static const struct BgTemplate sBgTemplates[3] = { { .bg = 0, @@ -164,7 +156,7 @@ static const struct BgTemplate gUnknown_085B1E00[3] = static const u8 sTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY}; -static const struct OamData gOamData_85B1E10 = +static const struct OamData sOam_Hand = { .y = 160, .affineMode = ST_OAM_AFFINE_OFF, @@ -181,7 +173,7 @@ static const struct OamData gOamData_85B1E10 = .affineParam = 0, }; -static const struct OamData gOamData_85B1E18 = +static const struct OamData sOam_Pokeball = { .y = 160, .affineMode = ST_OAM_AFFINE_OFF, @@ -198,7 +190,7 @@ static const struct OamData gOamData_85B1E18 = .affineParam = 0, }; -static const struct OamData gOamData_85B1E20 = +static const struct OamData sOam_StarterCircle = { .y = 160, .affineMode = ST_OAM_AFFINE_DOUBLE, @@ -222,19 +214,19 @@ static const u8 sCursorCoords[][2] = {180, 32}, }; -static const union AnimCmd gSpriteAnim_85B1E30[] = +static const union AnimCmd sAnim_Hand[] = { ANIMCMD_FRAME(48, 30), ANIMCMD_END, }; -static const union AnimCmd gSpriteAnim_85B1E38[] = +static const union AnimCmd sAnim_Pokeball_Still[] = { ANIMCMD_FRAME(0, 30), ANIMCMD_END, }; -static const union AnimCmd gSpriteAnim_85B1E40[] = +static const union AnimCmd sAnim_Pokeball_Moving[] = { ANIMCMD_FRAME(16, 4), ANIMCMD_FRAME(0, 4), @@ -256,109 +248,109 @@ static const union AnimCmd gSpriteAnim_85B1E40[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd gSpriteAnim_85B1E88[] = +static const union AnimCmd sAnim_StarterCircle[] = { ANIMCMD_FRAME(0, 8), ANIMCMD_END, }; -static const union AnimCmd * const gSpriteAnimTable_85B1E90[] = +static const union AnimCmd * const sAnims_Hand[] = { - gSpriteAnim_85B1E30, + sAnim_Hand, }; -static const union AnimCmd * const gSpriteAnimTable_85B1E94[] = +static const union AnimCmd * const sAnims_Pokeball[] = { - gSpriteAnim_85B1E38, - gSpriteAnim_85B1E40, + sAnim_Pokeball_Still, + sAnim_Pokeball_Moving, }; -static const union AnimCmd * const gSpriteAnimTable_85B1E9C[] = +static const union AnimCmd * const sAnims_StarterCircle[] = { - gSpriteAnim_85B1E88, + sAnim_StarterCircle, }; -static const union AffineAnimCmd gSpriteAffineAnim_85B1EA0[] = +static const union AffineAnimCmd sAffineAnim_StarterPokemon[] = { AFFINEANIMCMD_FRAME(16, 16, 0, 0), AFFINEANIMCMD_FRAME(16, 16, 0, 15), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd gSpriteAffineAnim_85B1EB8[] = +static const union AffineAnimCmd sAffineAnim_StarterCircle[] = { AFFINEANIMCMD_FRAME(20, 20, 0, 0), AFFINEANIMCMD_FRAME(20, 20, 0, 15), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd * const gUnknown_085B1ED0 = {gSpriteAffineAnim_85B1EA0}; -static const union AffineAnimCmd * const gSpriteAffineAnimTable_85B1ED4[] = {gSpriteAffineAnim_85B1EB8}; +static const union AffineAnimCmd * const sAffineAnims_StarterPokemon = {sAffineAnim_StarterPokemon}; +static const union AffineAnimCmd * const sAffineAnims_StarterCircle[] = {sAffineAnim_StarterCircle}; -static const struct CompressedSpriteSheet gUnknown_085B1ED8[] = +static const struct CompressedSpriteSheet sSpriteSheet_PokeballSelect[] = { { - .data = gUnknown_085B18AC, + .data = gPokeballSelection_Gfx, .size = 0x0800, - .tag = 0x1000 + .tag = TAG_POKEBALL_SELECT }, {} }; -static const struct CompressedSpriteSheet gUnknown_085B1EE8[] = +static const struct CompressedSpriteSheet sSpriteSheet_StarterCircle[] = { { - .data = gUnknown_085B1BCC, + .data = sStarterCircle_Gfx, .size = 0x0800, - .tag = 0x1001 + .tag = TAG_STARTER_CIRCLE }, {} }; -static const struct SpritePalette gUnknown_085B1EF8[] = +static const struct SpritePalette sSpritePalettes_StarterChoose[] = { { - .data = gBirchBallarrow_Pal, - .tag = 0x1000 + .data = sPokeballSelection_Pal, + .tag = TAG_POKEBALL_SELECT }, { - .data = gBirchCircle_Pal, - .tag = 0x1001 + .data = sStarterCircle_Pal, + .tag = TAG_STARTER_CIRCLE }, {}, }; static const struct SpriteTemplate sSpriteTemplate_Hand = { - .tileTag = 0x1000, - .paletteTag = 0x1000, - .oam = &gOamData_85B1E10, - .anims = gSpriteAnimTable_85B1E90, + .tileTag = TAG_POKEBALL_SELECT, + .paletteTag = TAG_POKEBALL_SELECT, + .oam = &sOam_Hand, + .anims = sAnims_Hand, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81346DC + .callback = SpriteCB_SelectionHand }; -static const struct SpriteTemplate sSpriteTemplate_PokeBall = +static const struct SpriteTemplate sSpriteTemplate_Pokeball = { - .tileTag = 0x1000, - .paletteTag = 0x1000, - .oam = &gOamData_85B1E18, - .anims = gSpriteAnimTable_85B1E94, + .tileTag = TAG_POKEBALL_SELECT, + .paletteTag = TAG_POKEBALL_SELECT, + .oam = &sOam_Pokeball, + .anims = sAnims_Pokeball, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_813473C + .callback = SpriteCB_Pokeball }; -static const struct SpriteTemplate gUnknown_085B1F40 = +static const struct SpriteTemplate sSpriteTemplate_StarterCircle = { - .tileTag = 0x1001, - .paletteTag = 0x1001, - .oam = &gOamData_85B1E20, - .anims = gSpriteAnimTable_85B1E9C, + .tileTag = TAG_STARTER_CIRCLE, + .paletteTag = TAG_STARTER_CIRCLE, + .oam = &sOam_StarterCircle, + .anims = sAnims_StarterCircle, .images = NULL, - .affineAnims = gSpriteAffineAnimTable_85B1ED4, - .callback = StarterPokemonSpriteCallback + .affineAnims = sAffineAnims_StarterCircle, + .callback = SpriteCB_StarterPokemon }; // .text @@ -376,10 +368,15 @@ static void VblankCB_StarterChoose(void) TransferPlttBuffer(); } +// Data for Task_StarterChoose #define tStarterSelection data[0] #define tPkmnSpriteId data[1] #define tCircleSpriteId data[2] +// Data for sSpriteTemplate_Pokeball +#define sTaskId data[0] +#define sBallId data[1] + void CB2_ChooseStarter(void) { u16 savedIme; @@ -412,8 +409,8 @@ void CB2_ChooseStarter(void) LZ77UnCompVram(gBirchGrassTilemap, (void *)(BG_SCREEN_ADDR(7))); ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(0, gUnknown_085B1E00, ARRAY_COUNT(gUnknown_085B1E00)); - InitWindows(gUnknown_085B1DCC); + InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); + InitWindows(sWindowTemplates); DeactivateAllTextPrinters(); LoadUserWindowBorderGfx(0, 0x2A8, 0xD0); @@ -427,17 +424,17 @@ void CB2_ChooseStarter(void) LoadPalette(GetOverworldTextboxPalettePtr(), 0xE0, 0x20); LoadPalette(gBirchBagGrassPal, 0, 0x40); - LoadCompressedSpriteSheet(&gUnknown_085B1ED8[0]); - LoadCompressedSpriteSheet(&gUnknown_085B1EE8[0]); - LoadSpritePalettes(gUnknown_085B1EF8); + LoadCompressedSpriteSheet(&sSpriteSheet_PokeballSelect[0]); + LoadCompressedSpriteSheet(&sSpriteSheet_StarterCircle[0]); + LoadSpritePalettes(sSpritePalettes_StarterChoose); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); EnableInterrupts(DISPSTAT_VBLANK); SetVBlankCallback(VblankCB_StarterChoose); - SetMainCallback2(MainCallback2_StarterChoose); + SetMainCallback2(CB2_StarterChoose); - SetGpuReg(REG_OFFSET_WININ, 0x3F); - SetGpuReg(REG_OFFSET_WINOUT, 0x1F); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ); SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_TGT1_BG3 | BLDCNT_TGT1_OBJ | BLDCNT_TGT1_BD | BLDCNT_EFFECT_DARKEN); @@ -449,7 +446,7 @@ void CB2_ChooseStarter(void) ShowBg(2); ShowBg(3); - taskId = CreateTask(Task_StarterChoose1, 0); + taskId = CreateTask(Task_StarterChoose, 0); gTasks[taskId].tStarterSelection = 1; // Create hand sprite @@ -457,22 +454,22 @@ void CB2_ChooseStarter(void) gSprites[spriteId].data[0] = taskId; // Create three Pokeball sprites - spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[0][0], sPokeballCoords[0][1], 2); - gSprites[spriteId].data[0] = taskId; - gSprites[spriteId].data[1] = 0; + spriteId = CreateSprite(&sSpriteTemplate_Pokeball, sPokeballCoords[0][0], sPokeballCoords[0][1], 2); + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sBallId = 0; - spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[1][0], sPokeballCoords[1][1], 2); - gSprites[spriteId].data[0] = taskId; - gSprites[spriteId].data[1] = 1; + spriteId = CreateSprite(&sSpriteTemplate_Pokeball, sPokeballCoords[1][0], sPokeballCoords[1][1], 2); + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sBallId = 1; - spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[2][0], sPokeballCoords[2][1], 2); - gSprites[spriteId].data[0] = taskId; - gSprites[spriteId].data[1] = 2; + spriteId = CreateSprite(&sSpriteTemplate_Pokeball, sPokeballCoords[2][0], sPokeballCoords[2][1], 2); + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sBallId = 2; - sStarterChooseWindowId = 0xFF; + sStarterLabelWindowId = 0xFF; } -static void MainCallback2_StarterChoose(void) +static void CB2_StarterChoose(void) { RunTasks(); AnimateSprites(); @@ -481,71 +478,71 @@ static void MainCallback2_StarterChoose(void) UpdatePaletteFade(); } -static void Task_StarterChoose1(u8 taskId) +static void Task_StarterChoose(u8 taskId) { CreateStarterPokemonLabel(gTasks[taskId].tStarterSelection); DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x2A8, 0xD); AddTextPrinterParameterized(0, 1, gText_BirchInTrouble, 0, 1, 0, NULL); PutWindowTilemap(0); ScheduleBgCopyTilemapToVram(0); - gTasks[taskId].func = Task_StarterChoose2; + gTasks[taskId].func = Task_HandleStarterChooseInput; } -static void Task_StarterChoose2(u8 taskId) +static void Task_HandleStarterChooseInput(u8 taskId) { u8 selection = gTasks[taskId].tStarterSelection; - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { u8 spriteId; - sub_8134604(); + ClearStarterLabel(); // Create white circle background - spriteId = CreateSprite(&gUnknown_085B1F40, sPokeballCoords[selection][0], sPokeballCoords[selection][1], 1); + spriteId = CreateSprite(&sSpriteTemplate_StarterCircle, sPokeballCoords[selection][0], sPokeballCoords[selection][1], 1); gTasks[taskId].tCircleSpriteId = spriteId; // Create Pokemon sprite spriteId = CreatePokemonFrontSprite(GetStarterPokemon(gTasks[taskId].tStarterSelection), sPokeballCoords[selection][0], sPokeballCoords[selection][1]); - gSprites[spriteId].affineAnims = &gUnknown_085B1ED0; - gSprites[spriteId].callback = StarterPokemonSpriteCallback; + gSprites[spriteId].affineAnims = &sAffineAnims_StarterPokemon; + gSprites[spriteId].callback = SpriteCB_StarterPokemon; gTasks[taskId].tPkmnSpriteId = spriteId; - gTasks[taskId].func = Task_StarterChoose3; + gTasks[taskId].func = Task_WaitForStarterSprite; } - else if ((gMain.newKeys & DPAD_LEFT) && selection > 0) + else if (JOY_NEW(DPAD_LEFT) && selection > 0) { gTasks[taskId].tStarterSelection--; gTasks[taskId].func = Task_MoveStarterChooseCursor; } - else if ((gMain.newKeys & DPAD_RIGHT) && selection < (STARTER_MON_COUNT - 1)) + else if (JOY_NEW(DPAD_RIGHT) && selection < STARTER_MON_COUNT - 1) { gTasks[taskId].tStarterSelection++; gTasks[taskId].func = Task_MoveStarterChooseCursor; } } -static void Task_StarterChoose3(u8 taskId) +static void Task_WaitForStarterSprite(u8 taskId) { if (gSprites[gTasks[taskId].tCircleSpriteId].affineAnimEnded && - gSprites[gTasks[taskId].tCircleSpriteId].pos1.x == STARTER_PKMN_POS_X && - gSprites[gTasks[taskId].tCircleSpriteId].pos1.y == STARTER_PKMN_POS_Y) + gSprites[gTasks[taskId].tCircleSpriteId].pos1.x == STARTER_PKMN_POS_X && + gSprites[gTasks[taskId].tCircleSpriteId].pos1.y == STARTER_PKMN_POS_Y) { - gTasks[taskId].func = Task_StarterChoose4; + gTasks[taskId].func = Task_AskConfirmStarter; } } -static void Task_StarterChoose4(u8 taskId) +static void Task_AskConfirmStarter(u8 taskId) { PlayCry1(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0); FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized(0, 1, gText_ConfirmStarterChoice, 0, 1, 0, NULL); ScheduleBgCopyTilemapToVram(0); - CreateYesNoMenu(&gUnknown_085B1DDC, 0x2A8, 0xD, 0); - gTasks[taskId].func = Task_StarterChoose5; + CreateYesNoMenu(&sWindowTemplate_ConfirmStarter, 0x2A8, 0xD, 0); + gTasks[taskId].func = Task_HandleConfirmStarterInput; } -static void Task_StarterChoose5(u8 taskId) +static void Task_HandleConfirmStarterInput(u8 taskId) { u8 spriteId; @@ -558,7 +555,7 @@ static void Task_StarterChoose5(u8 taskId) SetMainCallback2(gMain.savedCallback); break; case 1: // NO - case -1: // B button + case MENU_B_PRESSED: PlaySE(SE_SELECT); spriteId = gTasks[taskId].tPkmnSpriteId; FreeOamMatrix(gSprites[spriteId].oam.matrixNum); @@ -567,14 +564,14 @@ static void Task_StarterChoose5(u8 taskId) spriteId = gTasks[taskId].tCircleSpriteId; FreeOamMatrix(gSprites[spriteId].oam.matrixNum); DestroySprite(&gSprites[spriteId]); - gTasks[taskId].func = Task_StarterChoose6; + gTasks[taskId].func = Task_DeclineStarter; break; } } -static void Task_StarterChoose6(u8 taskId) +static void Task_DeclineStarter(u8 taskId) { - gTasks[taskId].func = Task_StarterChoose1; + gTasks[taskId].func = Task_StarterChoose; } static void CreateStarterPokemonLabel(u8 selection) @@ -589,20 +586,20 @@ static void CreateStarterPokemonLabel(u8 selection) CopyMonCategoryText(SpeciesToNationalPokedexNum(species), categoryText); speciesName = gSpeciesNames[species]; - winTemplate = gUnknown_085B1DE4; + winTemplate = sWindowTemplate_StarterLabel; winTemplate.tilemapLeft = sStarterLabelCoords[selection][0]; winTemplate.tilemapTop = sStarterLabelCoords[selection][1]; - sStarterChooseWindowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(sStarterChooseWindowId, PIXEL_FILL(0)); + sStarterLabelWindowId = AddWindow(&winTemplate); + FillWindowPixelBuffer(sStarterLabelWindowId, PIXEL_FILL(0)); width = GetStringCenterAlignXOffset(7, categoryText, 0x68); - AddTextPrinterParameterized3(sStarterChooseWindowId, 7, width, 1, sTextColors, 0, categoryText); + AddTextPrinterParameterized3(sStarterLabelWindowId, 7, width, 1, sTextColors, 0, categoryText); width = GetStringCenterAlignXOffset(1, speciesName, 0x68); - AddTextPrinterParameterized3(sStarterChooseWindowId, 1, width, 0x11, sTextColors, 0, speciesName); + AddTextPrinterParameterized3(sStarterLabelWindowId, 1, width, 17, sTextColors, 0, speciesName); - PutWindowTilemap(sStarterChooseWindowId); + PutWindowTilemap(sStarterLabelWindowId); ScheduleBgCopyTilemapToVram(0); labelLeft = sStarterLabelCoords[selection][0] * 8 - 4; @@ -613,12 +610,12 @@ static void CreateStarterPokemonLabel(u8 selection) SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(labelTop, labelBottom)); } -static void sub_8134604(void) +static void ClearStarterLabel(void) { - FillWindowPixelBuffer(sStarterChooseWindowId, PIXEL_FILL(0)); - ClearWindowTilemap(sStarterChooseWindowId); - RemoveWindow(sStarterChooseWindowId); - sStarterChooseWindowId = 0xFF; + FillWindowPixelBuffer(sStarterLabelWindowId, PIXEL_FILL(0)); + ClearWindowTilemap(sStarterLabelWindowId); + RemoveWindow(sStarterLabelWindowId); + sStarterLabelWindowId = 0xFF; SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0V, 0); ScheduleBgCopyTilemapToVram(0); @@ -626,14 +623,14 @@ static void sub_8134604(void) static void Task_MoveStarterChooseCursor(u8 taskId) { - sub_8134604(); - gTasks[taskId].func = sub_8134668; + ClearStarterLabel(); + gTasks[taskId].func = Task_CreateStarterLabel; } -static void sub_8134668(u8 taskId) +static void Task_CreateStarterLabel(u8 taskId) { CreateStarterPokemonLabel(gTasks[taskId].tStarterSelection); - gTasks[taskId].func = Task_StarterChoose2; + gTasks[taskId].func = Task_HandleStarterChooseInput; } static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y) @@ -645,25 +642,27 @@ static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y) return spriteId; } -void sub_81346DC(struct Sprite *sprite) +static void SpriteCB_SelectionHand(struct Sprite *sprite) { + // Float up and down above selected pokeball sprite->pos1.x = sCursorCoords[gTasks[sprite->data[0]].tStarterSelection][0]; sprite->pos1.y = sCursorCoords[gTasks[sprite->data[0]].tStarterSelection][1]; sprite->pos2.y = Sin(sprite->data[1], 8); sprite->data[1] = (u8)(sprite->data[1]) + 4; } -void sub_813473C(struct Sprite *sprite) +static void SpriteCB_Pokeball(struct Sprite *sprite) { - if (gTasks[sprite->data[0]].tStarterSelection == sprite->data[1]) + // Animate pokeball if currently selected + if (gTasks[sprite->sTaskId].tStarterSelection == sprite->sBallId) StartSpriteAnimIfDifferent(sprite, 1); else StartSpriteAnimIfDifferent(sprite, 0); } -void StarterPokemonSpriteCallback(struct Sprite *sprite) +static void SpriteCB_StarterPokemon(struct Sprite *sprite) { - //Move sprite to upper center of screen + // Move sprite to upper center of screen if (sprite->pos1.x > STARTER_PKMN_POS_X) sprite->pos1.x -= 4; if (sprite->pos1.x < STARTER_PKMN_POS_X) diff --git a/src/strings.c b/src/strings.c index 324e6098a..2ea06c1ad 100644 --- a/src/strings.c +++ b/src/strings.c @@ -402,7 +402,7 @@ const u8 gText_PkmnNeedsToReplaceMove[] = _("{STR_VAR_1} wants to learn the\nmov const u8 gText_StopLearningMove2[] = _("Stop trying to teach\n{STR_VAR_2}?"); const u8 gText_MoveNotLearned[] = _("{STR_VAR_1} did not learn the\nmove {STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); const u8 gText_WhichMoveToForget[] = _("Which move should be forgotten?{PAUSE_UNTIL_PRESS}"); -const u8 gText_12PoofForgotMove[] = _("1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p{STR_VAR_1} forgot how to\nuse {STR_VAR_2}.\pAnd…{PAUSE_UNTIL_PRESS}"); +const u8 gText_12PoofForgotMove[] = _("1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE SE_KON}Poof!\p{STR_VAR_1} forgot how to\nuse {STR_VAR_2}.\pAnd…{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnAlreadyKnows[] = _("{STR_VAR_1} already knows\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnHPRestoredByVar2[] = _("{STR_VAR_1}'s HP was restored\nby {STR_VAR_2} point(s).{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnCuredOfPoison[] = _("{STR_VAR_1} was cured of its\npoisoning.{PAUSE_UNTIL_PRESS}"); @@ -1745,7 +1745,7 @@ const u8 gText_MoveRelearnerTeachMoveConfirm[] = _("Teach {STR_VAR_2}?"); const u8 gText_MoveRelearnerPkmnLearnedMove[] = _("{STR_VAR_1} learned\n{STR_VAR_2}!"); const u8 gText_MoveRelearnerPkmnTryingToLearnMove[] = _("{STR_VAR_1} is trying to learn\n{STR_VAR_2}.\pBut {STR_VAR_1} can't learn more\nthan four moves.\pDelete an older move to make\nroom for {STR_VAR_2}?"); const u8 gText_MoveRelearnerStopTryingToTeachMove[] = _("Stop trying to teach\n{STR_VAR_2}?"); -const u8 gText_MoveRelearnerAndPoof[] = _("{PAUSE 32}1, {PAUSE 15}2, and {PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE 0x0038}Poof!\p"); +const u8 gText_MoveRelearnerAndPoof[] = _("{PAUSE 32}1, {PAUSE 15}2, and {PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE SE_KON}Poof!\p"); const u8 gText_MoveRelearnerPkmnForgotMoveAndLearnedNew[] = _("{STR_VAR_1} forgot {STR_VAR_3}.\pAnd…\p{STR_VAR_1} learned {STR_VAR_2}."); const u8 gText_MoveRelearnedPkmnDidNotLearnMove[] = _("{STR_VAR_1} did not learn the\nmove {STR_VAR_2}."); // Unused const u8 gText_MoveRelearnerGiveUp[] = _("Give up trying to teach a new\nmove to {STR_VAR_1}?"); diff --git a/src/unk_transition.c b/src/unk_transition.c deleted file mode 100644 index dff165bc9..000000000 --- a/src/unk_transition.c +++ /dev/null @@ -1,639 +0,0 @@ -#include "global.h" -#include "sprite.h" -#include "decompress.h" -#include "unk_transition.h" -#include "battle_transition.h" -#include "task.h" -#include "palette.h" -#include "trig.h" -#include "bg.h" -#include "gpu_regs.h" -#include "constants/rgb.h" - -typedef bool8 (*TransitionStateFunc)(struct Task *task); - -// this file's functions -static void sub_81DA848(struct Sprite *sprite); -static void sub_81DA9BC(struct Sprite *sprite); -static bool8 sub_81DAACC(struct Task *task); -static bool8 sub_81DAC14(struct Task *task); -static bool8 sub_81DABBC(struct Task *task); -static bool8 sub_81DAB4C(struct Task *task); -static bool8 sub_81DAC80(struct Task *task); -static bool8 sub_81DACEC(struct Task *task); -static bool8 sub_81DAD58(struct Task *task); -static bool8 sub_81DADC4(struct Task *task); -static bool8 sub_81DAE44(struct Task *task); -static bool8 sub_81DAEB0(struct Task *task); -static bool8 sub_81DAF34(struct Task *task); -static bool8 sub_81DAFA0(struct Task *task); -static bool8 sub_81DB02C(struct Task *task); -static bool8 sub_81DB098(struct Task *task); -static bool8 sub_81DB124(struct Task *task); -static bool8 sub_81DB190(struct Task *task); -static bool8 sub_81DB224(struct Task *task); -static bool8 sub_81DB290(struct Task *task); -static bool8 sub_81DB328(struct Task *task); - -// const rom data -static const u32 gUnknown_0862AD54[] = INCBIN_U32("graphics/battle_transitions/frontier_transition.4bpp.lz"); -static const u32 gUnknown_0862AF30[] = INCBIN_U32("graphics/battle_transitions/frontier_transition.bin"); -static const u32 gUnknown_0862B0DC[] = INCBIN_U32("graphics/battle_transitions/frontier_transition_circles.4bpp.lz"); -static const u16 gUnknown_0862B53C[] = INCBIN_U16("graphics/battle_transitions/frontier_transition.gbapal"); - -// Unused Empty data. -static const u8 sFiller[0x1C0] = {0}; - -static const struct OamData sOamData_862B71C = -{ - .y = 0, - .affineMode = ST_OAM_AFFINE_OFF, - .objMode = ST_OAM_OBJ_NORMAL, - .mosaic = 0, - .bpp = ST_OAM_4BPP, - .shape = SPRITE_SHAPE(64x64), - .x = 0, - .matrixNum = 0, - .size = SPRITE_SIZE(64x64), - .tileNum = 0, - .priority = 1, - .paletteNum = 0, - .affineParam = 0 -}; - -static const struct CompressedSpriteSheet sUnknown_0862B724 = -{ - .data = gUnknown_0862B0DC, - .size = 0x1800, - .tag = 11920 -}; - -static const struct SpritePalette sUnknown_0862B72C = -{ - .data = gUnknown_0862B53C, - .tag = 11920 -}; - -static const union AnimCmd sSpriteAnim_862B734[] = -{ - ANIMCMD_FRAME(0, 1), - ANIMCMD_END -}; - -static const union AnimCmd sSpriteAnim_862B73C[] = -{ - ANIMCMD_FRAME(64, 1), - ANIMCMD_END -}; - -static const union AnimCmd sSpriteAnim_862B744[] = -{ - ANIMCMD_FRAME(128, 1), - ANIMCMD_END -}; - -static const union AnimCmd *const sSpriteAnimTable_862B74C[] = -{ - sSpriteAnim_862B734, - sSpriteAnim_862B73C, - sSpriteAnim_862B744 -}; - -static const struct SpriteTemplate sUnknown_0862B758 = -{ - .tileTag = 11920, - .paletteTag = 11920, - .oam = &sOamData_862B71C, - .anims = sSpriteAnimTable_862B74C, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = SpriteCallbackDummy, -}; - -static const TransitionStateFunc sPhase2_34_Funcs[] = -{ - sub_81DAACC, - sub_81DAC14, - sub_81DABBC, - sub_81DAB4C, - sub_81DAC80 -}; - -static const TransitionStateFunc sPhase2_35_Funcs[] = -{ - sub_81DAACC, - sub_81DACEC, - sub_81DABBC, - sub_81DAB4C, - sub_81DAD58 -}; - -static const TransitionStateFunc sPhase2_36_Funcs[] = -{ - sub_81DAACC, - sub_81DADC4, - sub_81DABBC, - sub_81DAB4C, - sub_81DAE44 -}; - -static const TransitionStateFunc sPhase2_37_Funcs[] = -{ - sub_81DAACC, - sub_81DAEB0, - sub_81DABBC, - sub_81DAB4C, - sub_81DAF34 -}; - -static const TransitionStateFunc sPhase2_38_Funcs[] = -{ - sub_81DAACC, - sub_81DAFA0, - sub_81DABBC, - sub_81DAB4C, - sub_81DB02C -}; - -static const TransitionStateFunc sPhase2_39_Funcs[] = -{ - sub_81DAACC, - sub_81DB098, - sub_81DABBC, - sub_81DAB4C, - sub_81DB124 -}; - -static const TransitionStateFunc sPhase2_40_Funcs[] = -{ - sub_81DAACC, - sub_81DB190, - sub_81DABBC, - sub_81DAB4C, - sub_81DB224 -}; - -static const TransitionStateFunc sPhase2_41_Funcs[] = -{ - sub_81DAACC, - sub_81DB290, - sub_81DABBC, - sub_81DAB4C, - sub_81DB328 -}; - -// code -static void sub_81DA700(void) -{ - u16 *dst1, *dst2; - - GetBg0TilesDst(&dst1, &dst2); - LZ77UnCompVram(gUnknown_0862AD54, dst2); - LZ77UnCompVram(gUnknown_0862AF30, dst1); - LoadPalette(gUnknown_0862B53C, 0xF0, 0x20); - LoadCompressedSpriteSheet(&sUnknown_0862B724); - LoadSpritePalette(&sUnknown_0862B72C); -} - -static u8 sub_81DA74C(s16 x, s16 y, u8 arg2, u8 arg3, s8 arg4, s8 arg5, u8 spriteAnimNum) -{ - u8 spriteId = CreateSprite(&sUnknown_0862B758, x, y, 0); - - switch (spriteAnimNum) - { - case 0: - gSprites[spriteId].data[0] = 120; - gSprites[spriteId].data[1] = 45; - break; - case 1: - gSprites[spriteId].data[0] = 89; - gSprites[spriteId].data[1] = 97; - break; - case 2: - gSprites[spriteId].data[0] = 151; - gSprites[spriteId].data[1] = 97; - break; - } - - gSprites[spriteId].data[2] = arg4; - gSprites[spriteId].data[3] = arg5; - gSprites[spriteId].data[6] = arg2; - gSprites[spriteId].data[7] = arg3; - gSprites[spriteId].data[4] = 0; - gSprites[spriteId].data[5] = 0; - - StartSpriteAnim(&gSprites[spriteId], spriteAnimNum); - gSprites[spriteId].callback = sub_81DA848; - - return spriteId; -} - -static void sub_81DA848(struct Sprite *sprite) -{ - s16 *data = sprite->data; - - if (sprite->pos1.x == data[0] && sprite->pos1.y == data[1]) - { - sprite->callback = SpriteCallbackDummy; - } - else - { - if (data[4] == data[6]) - { - sprite->pos1.x += data[2]; - data[4] = 0; - } - else - { - data[4]++; - } - - if (data[5] == data[7]) - { - sprite->pos1.y += data[3]; - data[5] = 0; - } - else - { - data[5]++; - } - } -} - -static u8 sub_81DA8BC(s16 x, s16 y, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, u8 spriteAnimNum) -{ - u8 spriteId = CreateSprite(&sUnknown_0862B758, x, y, 0); - - switch (spriteAnimNum) - { - case 0: - gSprites[spriteId].data[0] = 120; - gSprites[spriteId].data[1] = 45; - break; - case 1: - gSprites[spriteId].data[0] = 89; - gSprites[spriteId].data[1] = 97; - break; - case 2: - gSprites[spriteId].data[0] = 151; - gSprites[spriteId].data[1] = 97; - break; - } - - gSprites[spriteId].data[2] = arg2; - gSprites[spriteId].data[3] = arg3; - gSprites[spriteId].data[4] = arg4; - gSprites[spriteId].data[5] = arg5; - gSprites[spriteId].data[6] = arg6; - - StartSpriteAnim(&gSprites[spriteId], spriteAnimNum); - gSprites[spriteId].callback = sub_81DA9BC; - - return spriteId; -} - -static void sub_81DA9BC(struct Sprite *sprite) -{ - sprite->pos2.x = (Sin2(sprite->data[2]) * sprite->data[4]) >> 12; // div by 4096 - sprite->pos2.y = (Cos2(sprite->data[2]) * sprite->data[4]) >> 12; // div by 4096 - - sprite->data[2] = (sprite->data[2] + sprite->data[3]) % 360; - - if (sprite->data[4] != sprite->data[5]) - sprite->data[4] += sprite->data[6]; - else - sprite->callback = SpriteCallbackDummy; -} - -#define tState data[0] - -static void sub_81DAA20(struct Task *task) -{ - FreeSpriteTilesByTag(11920); - FreeSpritePaletteByTag(11920); - - DestroySprite(&gSprites[task->data[4]]); - DestroySprite(&gSprites[task->data[5]]); - DestroySprite(&gSprites[task->data[6]]); -} - -static bool8 sub_81DAA74(struct Task *task) -{ - if (gSprites[task->data[4]].callback == SpriteCallbackDummy - && gSprites[task->data[5]].callback == SpriteCallbackDummy - && gSprites[task->data[6]].callback == SpriteCallbackDummy) - return TRUE; - else - return FALSE; -} - -static bool8 sub_81DAACC(struct Task *task) -{ - if (task->data[1] == 0) - { - ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); - ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON); - ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG0_ON); - - task->data[1]++; - return FALSE; - } - else - { - sub_81DA700(); - SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); - SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgY(0, 0x500, 2); - - task->data[1] = 0; - task->tState++; - return TRUE; - } -} - -static bool8 sub_81DAB4C(struct Task *task) -{ - if (task->data[2] == 0) - SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG0_ON); - - if (task->data[2] == 16) - { - if (task->data[3] == 31) - { - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_BLACK); - task->tState++; - } - else - { - task->data[3]++; - } - } - else - { - u16 blnd; - - task->data[2]++; - blnd = task->data[2]; - SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(blnd, 16 - blnd)); - } - - return FALSE; -} - -static bool8 sub_81DABBC(struct Task *task) -{ - if (sub_81DAA74(task) == TRUE) - task->tState++; - - return FALSE; -} - -void Phase2Task_34(u8 taskId) -{ - while (sPhase2_34_Funcs[gTasks[taskId].tState](&gTasks[taskId])); -} - -static bool8 sub_81DAC14(struct Task *task) -{ - task->data[4] = sub_81DA74C(120, -51, 0, 0, 0, 2, 0); - task->data[5] = sub_81DA74C(-7, 193, 0, 0, 2, -2, 1); - task->data[6] = sub_81DA74C(247, 193, 0, 0, -2, -2, 2); - - task->tState++; - return FALSE; -} - -static bool8 sub_81DAC80(struct Task *task) -{ - if (!gPaletteFade.active) - { - sub_81DAA20(task); - DestroyTask(FindTaskIdByFunc(Phase2Task_34)); - } - - return FALSE; -} - -void Phase2Task_35(u8 taskId) -{ - while (sPhase2_35_Funcs[gTasks[taskId].tState](&gTasks[taskId])); -} - -static bool8 sub_81DACEC(struct Task *task) -{ - task->data[4] = sub_81DA74C(120, 197, 0, 0, 0, -4, 0); - task->data[5] = sub_81DA74C(241, 59, 0, 1, -4, 2, 1); - task->data[6] = sub_81DA74C(-1, 59, 0, 1, 4, 2, 2); - - task->tState++; - return FALSE; -} - -static bool8 sub_81DAD58(struct Task *task) -{ - if (!gPaletteFade.active) - { - sub_81DAA20(task); - DestroyTask(FindTaskIdByFunc(Phase2Task_35)); - } - - return FALSE; -} - -void Phase2Task_36(u8 taskId) -{ - while (sPhase2_36_Funcs[gTasks[taskId].tState](&gTasks[taskId])); -} - -static bool8 sub_81DADC4(struct Task *task) -{ - task->data[4] = sub_81DA8BC(120, 45, 12, 4, 128, 0, -4, 0); - task->data[5] = sub_81DA8BC(89, 97, 252, 4, 128, 0, -4, 1); - task->data[6] = sub_81DA8BC(151, 97, 132, 4, 128, 0, -4, 2); - - task->tState++; - return FALSE; -} - -static bool8 sub_81DAE44(struct Task *task) -{ - if (!gPaletteFade.active) - { - sub_81DAA20(task); - DestroyTask(FindTaskIdByFunc(Phase2Task_36)); - } - - return FALSE; -} - -void Phase2Task_37(u8 taskId) -{ - while (sPhase2_37_Funcs[gTasks[taskId].tState](&gTasks[taskId])); -} - -static bool8 sub_81DAEB0(struct Task *task) -{ - task->data[4] = sub_81DA8BC(120, 80, 284, 8, 131, 35, -3, 0); - task->data[5] = sub_81DA8BC(120, 80, 44, 8, 131, 35, -3, 1); - task->data[6] = sub_81DA8BC(121, 80, 164, 8, 131, 35, -3, 2); - - task->tState++; - return FALSE; -} - -static bool8 sub_81DAF34(struct Task *task) -{ - if (!gPaletteFade.active) - { - sub_81DAA20(task); - DestroyTask(FindTaskIdByFunc(Phase2Task_37)); - } - - return FALSE; -} - -void Phase2Task_38(u8 taskId) -{ - while (sPhase2_38_Funcs[gTasks[taskId].tState](&gTasks[taskId])); -} - -static bool8 sub_81DAFA0(struct Task *task) -{ - if (task->data[1] == 0) - { - task->data[4] = sub_81DA74C(120, -51, 0, 0, 0, 4, 0); - } - else if (task->data[1] == 16) - { - task->data[5] = sub_81DA74C(-7, 193, 0, 0, 4, -4, 1); - } - else if (task->data[1] == 32) - { - task->data[6] = sub_81DA74C(247, 193, 0, 0, -4, -4, 2); - task->tState++; - } - - task->data[1]++; - return FALSE; -} - -static bool8 sub_81DB02C(struct Task *task) -{ - if (!gPaletteFade.active) - { - sub_81DAA20(task); - DestroyTask(FindTaskIdByFunc(Phase2Task_38)); - } - - return FALSE; -} - -void Phase2Task_39(u8 taskId) -{ - while (sPhase2_39_Funcs[gTasks[taskId].tState](&gTasks[taskId])); -} - -static bool8 sub_81DB098(struct Task *task) -{ - if (task->data[1] == 0) - { - task->data[4] = sub_81DA74C(120, 197, 0, 0, 0, -8, 0); - } - else if (task->data[1] == 16) - { - task->data[5] = sub_81DA74C(241, 78, 0, 0, -8, 1, 1); - } - else if (task->data[1] == 32) - { - task->data[6] = sub_81DA74C(-1, 78, 0, 0, 8, 1, 2); - task->tState++; - } - - task->data[1]++; - return FALSE; -} - -static bool8 sub_81DB124(struct Task *task) -{ - if (!gPaletteFade.active) - { - sub_81DAA20(task); - DestroyTask(FindTaskIdByFunc(Phase2Task_39)); - } - - return FALSE; -} - -void Phase2Task_40(u8 taskId) -{ - while (sPhase2_40_Funcs[gTasks[taskId].tState](&gTasks[taskId])); -} - -static bool8 sub_81DB190(struct Task *task) -{ - if (task->data[1] == 0) - { - task->data[4] = sub_81DA8BC(120, 45, 12, 4, 128, 0, -4, 0); - } - else if (task->data[1] == 16) - { - task->data[5] = sub_81DA8BC(89, 97, 252, 4, 128, 0, -4, 1); - } - else if (task->data[1] == 32) - { - task->data[6] = sub_81DA8BC(151, 97, 132, 4, 128, 0, -4, 2); - task->tState++; - } - - task->data[1]++; - return FALSE; -} - -static bool8 sub_81DB224(struct Task *task) -{ - if (!gPaletteFade.active) - { - sub_81DAA20(task); - DestroyTask(FindTaskIdByFunc(Phase2Task_40)); - } - - return FALSE; -} - -void Phase2Task_41(u8 taskId) -{ - while (sPhase2_41_Funcs[gTasks[taskId].tState](&gTasks[taskId])); -} - -static bool8 sub_81DB290(struct Task *task) -{ - if (task->data[1] == 0) - { - task->data[4] = sub_81DA8BC(120, 80, 284, 8, 131, 35, -3, 0); - } - else if (task->data[1] == 16) - { - task->data[5] = sub_81DA8BC(120, 80, 44, 8, 131, 35, -3, 1); - } - else if (task->data[1] == 32) - { - task->data[6] = sub_81DA8BC(121, 80, 164, 8, 131, 35, -3, 2); - task->tState++; - } - - task->data[1]++; - return FALSE; -} - -static bool8 sub_81DB328(struct Task *task) -{ - if (!gPaletteFade.active) - { - sub_81DAA20(task); - DestroyTask(FindTaskIdByFunc(Phase2Task_41)); - } - - return FALSE; -} diff --git a/src/wild_encounter.c b/src/wild_encounter.c index e486cd2f8..492a10101 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -296,29 +296,27 @@ static u8 PickWildMonNature(void) u8 i; u8 j; struct Pokeblock *safariPokeblock; - u8 natures[25]; + u8 natures[NUM_NATURES]; if (GetSafariZoneFlag() == TRUE && Random() % 100 < 80) { safariPokeblock = SafariZoneGetActivePokeblock(); if (safariPokeblock != NULL) { - for (i = 0; i < 25; i++) + for (i = 0; i < NUM_NATURES; i++) natures[i] = i; - for (i = 0; i < 24; i++) + for (i = 0; i < NUM_NATURES - 1; i++) { - for (j = i + 1; j < 25; j++) + for (j = i + 1; j < NUM_NATURES; j++) { if (Random() & 1) { - u8 temp = natures[i]; - - natures[i] = natures[j]; - natures[j] = temp; + u8 temp; + SWAP(natures[i], natures[j], temp); } } } - for (i = 0; i < 25; i++) + for (i = 0; i < NUM_NATURES; i++) { if (PokeblockGetGain(natures[i], safariPokeblock) > 0) return natures[i]; @@ -330,11 +328,11 @@ static u8 PickWildMonNature(void) && GetMonAbility(&gPlayerParty[0]) == ABILITY_SYNCHRONIZE && Random() % 2 == 0) { - return GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY) % 25; + return GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY) % NUM_NATURES; } // random nature - return Random() % 25; + return Random() % NUM_NATURES; } static void CreateWildMon(u16 species, u8 level) |