pokered/scripts/gary.asm

299 lines
5.4 KiB
NASM
Raw Normal View History

2014-05-18 18:19:10 +00:00
GaryScript: ; 75f1d (1d:5f1d)
call EnableAutoTextBoxDrawing
ld hl, GaryScriptPointers
2015-08-31 02:38:41 +00:00
ld a, [wGaryCurScript]
2014-05-18 18:19:10 +00:00
jp CallFunctionInTable
ResetGaryScript: ; 75f29 (1d:5f29)
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
GaryScriptPointers: ; 75f31 (1d:5f31)
dw GaryScript0
dw GaryScript1
dw GaryScript2
dw GaryScript3
dw GaryScript4
dw GaryScript5
dw GaryScript6
dw GaryScript7
dw GaryScript8
dw GaryScript9
dw GaryScript10
GaryScript0: ; 75f47 (1d:5f47)
ret
GaryScript1: ; 75f48 (1d:5f48)
ld a, $ff
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
ld hl, wSimulatedJoypadStatesEnd
ld de, GaryEntrance_RLEMovement
2014-05-18 18:19:10 +00:00
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
2014-05-18 18:19:10 +00:00
ld a, $2
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
GaryEntrance_RLEMovement: ; 75f63 (1d:5f63)
db D_UP,1
db D_RIGHT,1
db D_UP,3
2014-05-18 18:19:10 +00:00
db $ff
GaryScript2: ; 75f6a (1d:5f6a)
ld a, [wSimulatedJoypadStatesIndex]
2014-05-18 18:19:10 +00:00
and a
ret nz
call Delay3
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-08-31 02:38:41 +00:00
ld hl, wOptions
res 7, [hl] ; Turn on battle animations to make the battle feel more epic.
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
call Delay3
ld hl, wd72d
2014-05-18 18:19:10 +00:00
set 6, [hl]
set 7, [hl]
ld hl, GaryDefeatedText
ld de, GaryVictoryText
2014-09-14 18:29:18 +00:00
call SaveEndBattleTextPointers
ld a, OPP_SONY3
2015-08-31 02:38:41 +00:00
ld [wCurOpponent], a
2014-05-18 18:19:10 +00:00
; select which team to use during the encounter
2015-08-31 02:38:41 +00:00
ld a, [wRivalStarter]
2014-05-21 12:48:30 +00:00
cp STARTER2
jr nz, .NotStarter2
2014-05-18 18:19:10 +00:00
ld a, $1
jr .saveTrainerId
.NotStarter2
2014-05-21 12:48:30 +00:00
cp STARTER3
jr nz, .NotStarter3
2014-05-18 18:19:10 +00:00
ld a, $2
jr .saveTrainerId
.NotStarter3
2014-05-18 18:19:10 +00:00
ld a, $3
.saveTrainerId
2015-08-31 02:38:41 +00:00
ld [wTrainerNo], a
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $3
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
GaryScript3: ; 75fbb (1d:5fbb)
2015-08-31 02:38:41 +00:00
ld a, [wIsInBattle]
2014-05-18 18:19:10 +00:00
cp $ff
jp z, ResetGaryScript
call UpdateSprites
2015-07-21 17:36:03 +00:00
SetEvent EVENT_BEAT_CHAMPION_RIVAL
2014-05-18 18:19:10 +00:00
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call GaryScript_760c8
ld a, $1
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
2014-05-18 18:19:10 +00:00
call SetSpriteMovementBytesToFF
ld a, $4
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
GaryScript4: ; 75fe4 (1d:5fe4)
callba Music_Cities1AlternateTempo
2014-05-18 18:19:10 +00:00
ld a, $2
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call GaryScript_760c8
ld a, $2
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
2014-05-18 18:19:10 +00:00
call SetSpriteMovementBytesToFF
ld de, OakEntranceAfterVictoryMovement
2014-05-18 18:19:10 +00:00
ld a, $2
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
2014-05-18 18:19:10 +00:00
call MoveSprite
ld a, HS_CHAMPIONS_ROOM_OAK
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef ShowObject
2014-05-18 18:19:10 +00:00
ld a, $5
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
OakEntranceAfterVictoryMovement: ; 76014 (1d:6014)
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db $FF
2014-05-18 18:19:10 +00:00
GaryScript5: ; 7601a (1d:601a)
ld a, [wd730]
2014-05-18 18:19:10 +00:00
bit 0, a
ret nz
2015-07-20 00:52:26 +00:00
ld a, PLAYER_DIR_LEFT
ld [wPlayerMovingDirection], a
2014-05-18 18:19:10 +00:00
ld a, $1
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT
2015-07-18 15:17:29 +00:00
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
2014-05-18 18:19:10 +00:00
ld a, $2
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
2015-07-18 15:17:29 +00:00
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
2014-05-18 18:19:10 +00:00
ld a, $3
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call GaryScript_760c8
ld a, $6
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
GaryScript6: ; 76047 (1d:6047)
ld a, $2
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_RIGHT
2015-07-18 15:17:29 +00:00
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
2014-05-18 18:19:10 +00:00
ld a, $4
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call GaryScript_760c8
ld a, $7
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
GaryScript7: ; 7605f (1d:605f)
ld a, $2
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
2015-07-18 15:17:29 +00:00
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
2014-05-18 18:19:10 +00:00
ld a, $5
2015-07-18 15:17:29 +00:00
ld [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call GaryScript_760c8
ld de, OakExitGaryRoomMovement
2014-05-18 18:19:10 +00:00
ld a, $2
2015-07-18 15:17:29 +00:00
ld [H_SPRITEINDEX], a
2014-05-18 18:19:10 +00:00
call MoveSprite
ld a, $8
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
OakExitGaryRoomMovement: ; 76080 (1d:6080)
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db $FF
2014-05-18 18:19:10 +00:00
GaryScript8: ; 76083 (1d:6083)
ld a, [wd730]
2014-05-18 18:19:10 +00:00
bit 0, a
ret nz
ld a, HS_CHAMPIONS_ROOM_OAK
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef HideObject
2014-05-18 18:19:10 +00:00
ld a, $9
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
GaryScript9: ; 76099 (1d:6099)
ld a, $ff
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
ld hl, wSimulatedJoypadStatesEnd
ld de, WalkToHallOfFame_RLEMovment
2014-05-18 18:19:10 +00:00
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
2014-05-18 18:19:10 +00:00
ld a, $a
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
WalkToHallOfFame_RLEMovment: ; 760b4 (1d:60b4)
db D_UP,4
db D_LEFT,1
2014-05-18 18:19:10 +00:00
db $ff
GaryScript10: ; 760b9 (1d:60b9)
ld a, [wSimulatedJoypadStatesIndex]
2014-05-18 18:19:10 +00:00
and a
ret nz
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wGaryCurScript], a
2014-05-18 18:19:10 +00:00
ret
GaryScript_760c8: ; 760c8 (1d:60c8)
2014-05-18 18:19:10 +00:00
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
ld a, $ff
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ret
GaryTextPointers: ; 760d6 (1d:60d6)
dw GaryText1
dw GaryText2
dw GaryText3
dw GaryText4
dw GaryText5
GaryText1: ; 760e0 (1d:60e0)
2015-07-03 19:58:50 +00:00
TX_ASM
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_BEAT_CHAMPION_RIVAL
ld hl, GaryChampionIntroText
jr z, .printText
2014-05-18 18:19:10 +00:00
ld hl, GaryText_76103
.printText
2014-05-18 18:19:10 +00:00
call PrintText
jp TextScriptEnd
GaryChampionIntroText: ; 760f4 (1d:60f4)
TX_FAR _GaryChampionIntroText
2014-05-18 18:19:10 +00:00
db "@"
GaryDefeatedText: ; 760f9 (1d:60f9)
TX_FAR _GaryDefeatedText
2014-05-18 18:19:10 +00:00
db "@"
GaryVictoryText: ; 760fe (1d:60fe)
TX_FAR _GaryVictoryText
2014-05-18 18:19:10 +00:00
db "@"
GaryText_76103: ; 76103 (1d:6103)
TX_FAR _GaryText_76103
db "@"
GaryText2: ; 76108 (1d:6108)
TX_FAR _GaryText2
db "@"
GaryText3: ; 7610d (1d:610d)
2015-07-03 19:58:50 +00:00
TX_ASM
2015-08-31 02:38:41 +00:00
ld a, [wPlayerStarter]
ld [wd11e], a
2014-05-18 18:19:10 +00:00
call GetMonName
ld hl, GaryText_76120
call PrintText
jp TextScriptEnd
GaryText_76120: ; 76120 (1d:6120)
TX_FAR _GaryText_76120
db "@"
GaryText4: ; 76125 (1d:6125)
TX_FAR _GaryText_76125
db "@"
GaryText5: ; 7612a (1d:612a)
TX_FAR _GaryText_7612a
db "@"