diff options
author | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-08-30 17:55:02 -0400 |
---|---|---|
committer | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-08-30 17:55:02 -0400 |
commit | d2ed7674f499b1fd6c4059da40b8b42c6bf96995 (patch) | |
tree | f581489b522fc647477d7b36dee072d553c44fd1 /scripts/lance.asm | |
parent | 3394d8320f35f524231aa13bd9cae34e22246a6d (diff) | |
parent | 1a987d1e1ab96ca9553d4253c72858057332a03a (diff) |
Merge branch 'master' of https://github.com/iimarckus/pokered
Doesn't build.
Diffstat (limited to 'scripts/lance.asm')
-rwxr-xr-x | scripts/lance.asm | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/scripts/lance.asm b/scripts/lance.asm index f2523098..e2c43614 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -13,8 +13,7 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) bit 5, [hl] res 5, [hl] ret z - ld a, [wd866] - bit 7, a + CheckEvent EVENT_LANCES_ROOM_LOCK_DOOR jr nz, .asm_5a2da ld a, $31 ld b, $32 @@ -25,13 +24,13 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) LanceScript_5a2de: ; 5a2de (16:62de) push bc - ld [wd09f], a - ld bc, $602 + ld [wNewTileBlockID], a + lb bc, 6, 2 call LanceScript_5a2f0 pop bc ld a, b - ld [wd09f], a - ld bc, $603 + ld [wNewTileBlockID], a + lb bc, 6, 3 LanceScript_5a2f0: ; 5a2f0 (16:62f0) predef_jump ReplaceTileBlock @@ -52,30 +51,27 @@ LanceScript4: ; 5a304 (16:6304) ret LanceScript0: ; 5a305 (16:6305) - ld a, [wd866] - bit 6, a + CheckEvent EVENT_BEAT_LANCE ret nz ld hl, CoordsData_5a33e call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a ld [hJoyHeld], a - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wCoordIndex] cp $3 jr nc, .asm_5a325 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [hSpriteIndexOrTextID], a jp DisplayTextID .asm_5a325 cp $5 jr z, LanceScript_5a35b - ld hl, wd866 - bit 7, [hl] - set 7, [hl] + CheckAndSetEvent EVENT_LANCES_ROOM_LOCK_DOOR ret nz ld hl, wd126 set 5, [hl] - ld a, (SFX_02_57 - SFX_Headers_02) / 3 + ld a, SFX_GO_INSIDE call PlaySound jp LanceScript_5a2c4 @@ -89,11 +85,11 @@ CoordsData_5a33e: ; 5a33e (16:633e) LanceScript2: ; 5a349 (16:6349) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, LanceScript_5a2f5 ld a, $1 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [hSpriteIndexOrTextID], a jp DisplayTextID LanceScript_5a35b: ; 5a35b (16:635b) @@ -111,10 +107,10 @@ LanceScript_5a35b: ; 5a35b (16:635b) ret RLEList_5a379: ; 5a379 (16:6379) - db $40, $0C - db $20, $0C - db $80, $07 - db $20, $06 + db D_UP, $0C + db D_LEFT, $0C + db D_DOWN, $07 + db D_LEFT, $06 db $FF LanceScript3: ; 5a382 (16:6382) @@ -133,18 +129,18 @@ LanceTextPointers: ; 5a395 (16:6395) LanceTrainerHeaders: ; 5a397 (16:6397) LanceTrainerHeader0: ; 5a397 (16:6397) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_LANCES_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd866 ; flag's byte - dw LanceBeforeBattleText ; 0x63ae TextBeforeBattle - dw LanceAfterBattleText ; 0x63b8 TextAfterBattle - dw LanceEndBattleText ; 0x63b3 TextEndBattle - dw LanceEndBattleText ; 0x63b3 TextEndBattle + dwEventFlagAddress EVENT_BEAT_LANCES_ROOM_TRAINER_0 + dw LanceBeforeBattleText ; TextBeforeBattle + dw LanceAfterBattleText ; TextAfterBattle + dw LanceEndBattleText ; TextEndBattle + dw LanceEndBattleText ; TextEndBattle db $ff LanceText1: ; 5a3a4 (16:63a4) - db $08 ; asm + TX_ASM ld hl, LanceTrainerHeader0 call TalkToTrainer jp TextScriptEnd @@ -159,7 +155,6 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText - db $8 - ld hl, wd866 - set 6, [hl] + TX_ASM + SetEvent EVENT_BEAT_LANCE jp TextScriptEnd |