From fcab935a0f449246380480613ac0896e0b90a0d8 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 20 Jul 2015 18:32:02 -0700 Subject: enumerate events --- scripts/lance.asm | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'scripts/lance.asm') diff --git a/scripts/lance.asm b/scripts/lance.asm index 80780cd1..9d3a2f99 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_8FF jr nz, .asm_5a2da ld a, $31 ld b, $32 @@ -52,8 +51,7 @@ LanceScript4: ; 5a304 (16:6304) ret LanceScript0: ; 5a305 (16:6305) - ld a, [wd866] - bit 6, a + CheckEvent EVENT_8FE ret nz ld hl, CoordsData_5a33e call ArePlayerCoordsInArray @@ -69,9 +67,7 @@ LanceScript0: ; 5a305 (16:6305) .asm_5a325 cp $5 jr z, LanceScript_5a35b - ld hl, wd866 - bit 7, [hl] - set 7, [hl] + CheckAndSetEvent EVENT_8FF ret nz ld hl, wd126 set 5, [hl] @@ -133,9 +129,9 @@ 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 + dwEventFlagAddress EVENT_BEAT_LANCES_ROOM_TRAINER_0 dw LanceBeforeBattleText ; TextBeforeBattle dw LanceAfterBattleText ; TextAfterBattle dw LanceEndBattleText ; TextEndBattle @@ -160,6 +156,5 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText TX_ASM - ld hl, wd866 - set 6, [hl] + SetEvent EVENT_8FE jp TextScriptEnd -- cgit v1.2.3 From 73171bfff573fa8900563319c014f3e626db6b3e Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 10:36:03 -0700 Subject: named most of the used events --- scripts/lance.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/lance.asm') diff --git a/scripts/lance.asm b/scripts/lance.asm index 9d3a2f99..4d0072be 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -13,7 +13,7 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_8FF + CheckEvent EVENT_LANCES_ROOM_LOCK_DOOR jr nz, .asm_5a2da ld a, $31 ld b, $32 @@ -51,7 +51,7 @@ LanceScript4: ; 5a304 (16:6304) ret LanceScript0: ; 5a305 (16:6305) - CheckEvent EVENT_8FE + CheckEvent EVENT_BEAT_LANCE ret nz ld hl, CoordsData_5a33e call ArePlayerCoordsInArray @@ -67,7 +67,7 @@ LanceScript0: ; 5a305 (16:6305) .asm_5a325 cp $5 jr z, LanceScript_5a35b - CheckAndSetEvent EVENT_8FF + CheckAndSetEvent EVENT_LANCES_ROOM_LOCK_DOOR ret nz ld hl, wd126 set 5, [hl] @@ -156,5 +156,5 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText TX_ASM - SetEvent EVENT_8FE + SetEvent EVENT_BEAT_LANCE jp TextScriptEnd -- cgit v1.2.3