summaryrefslogtreecommitdiff
path: root/scripts/silphco7.asm
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2015-07-20 18:32:02 -0700
committerYamaArashi <shadow962@live.com>2015-07-20 18:32:26 -0700
commitfcab935a0f449246380480613ac0896e0b90a0d8 (patch)
tree60391cf3fa91cc8173d13cc9fd75c050d9898e0c /scripts/silphco7.asm
parent13e28b0ece7c7888cba792cc6f7219b384213427 (diff)
enumerate events
Diffstat (limited to 'scripts/silphco7.asm')
-rwxr-xr-xscripts/silphco7.asm53
1 files changed, 23 insertions, 30 deletions
diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm
index 78d6e0d7..64c79c3a 100755
--- a/scripts/silphco7.asm
+++ b/scripts/silphco7.asm
@@ -16,8 +16,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77)
ld hl, DataTable_51bc1
call SilphCo7Text_51bc8
call SilphCo7Text_51bf4
- ld a, [wd830]
- bit 4, a
+ CheckEvent EVENT_74C
jr nz, .asm_51b9e
push af
ld a, $54
@@ -82,21 +81,21 @@ SilphCo7Text_51bc8: ; 51bc8 (14:5bc8)
ret
SilphCo7Text_51bf4: ; 51bf4 (14:5bf4)
- ld hl, wd830
+ EventFlagAddress hl, EVENT_74C
ld a, [$ffe0]
and a
ret z
cp $1
- jr nz, .asm_51c02
- set 4, [hl]
+ jr nz, .next1
+ SetEventReuseHL EVENT_74C
ret
-.asm_51c02
+.next1
cp $2
- jr nz, .asm_51c09
- set 5, [hl]
+ jr nz, .next2
+ SetEventAfterBranchReuseHL EVENT_74D, EVENT_74C
ret
-.asm_51c09
- set 6, [hl]
+.next2
+ SetEventAfterBranchReuseHL EVENT_74E, EVENT_74C
ret
SilphCo7Text_51c0c: ; 51c0c (14:5c0c)
@@ -117,8 +116,7 @@ SilphCo7ScriptPointers: ; 51c17 (14:5c17)
dw SilphCo7Script5
SilphCo7Script0: ; 51c23 (14:5c23)
- ld a, [wd82f]
- bit 0, a
+ CheckEvent EVENT_740
jp nz, CheckFightingMapTrainers
ld hl, CoordsData_51c78
call ArePlayerCoordsInArray
@@ -207,8 +205,7 @@ SilphCo7Script4: ; 51cc8 (14:5cc8)
jp z, SilphCo7Text_51c0c
ld a, $f0
ld [wJoyIgnore], a
- ld hl, wd82f
- set 0, [hl]
+ SetEvent EVENT_740
ld a, PLAYER_DIR_DOWN
ld [wPlayerMovingDirection], a
ld a, $9
@@ -281,36 +278,36 @@ SilphCo7TextPointers: ; 51d3f (14:5d3f)
SilphCo7TrainerHeaders: ; 51d5d (14:5d5d)
SilphCo7TrainerHeader0: ; 51d5d (14:5d5d)
- db $5 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_0
db ($2 << 4) ; trainer's view range
- dw wd82f ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_0
dw SilphCo7BattleText1 ; TextBeforeBattle
dw SilphCo7AfterBattleText1 ; TextAfterBattle
dw SilphCo7EndBattleText1 ; TextEndBattle
dw SilphCo7EndBattleText1 ; TextEndBattle
SilphCo7TrainerHeader2: ; 51d69 (14:5d69)
- db $6 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_2
db ($3 << 4) ; trainer's view range
- dw wd82f ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_2
dw SilphCo7BattleText2 ; TextBeforeBattle
dw SilphCo7AfterBattleText2 ; TextAfterBattle
dw SilphCo7EndBattleText2 ; TextEndBattle
dw SilphCo7EndBattleText2 ; TextEndBattle
SilphCo7TrainerHeader3: ; 51d75 (14:5d75)
- db $7 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_3
db ($3 << 4) ; trainer's view range
- dw wd82f ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_3
dw SilphCo7BattleText3 ; TextBeforeBattle
dw SilphCo7AfterBattleText3 ; TextAfterBattle
dw SilphCo7EndBattleText3 ; TextEndBattle
dw SilphCo7EndBattleText3 ; TextEndBattle
SilphCo7TrainerHeader4: ; 51d81 (14:5d81)
- db $8 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_4, 1
db ($4 << 4) ; trainer's view range
- dw wd82f ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_4, 1
dw SilphCo7BattleText4 ; TextBeforeBattle
dw SilphCo7AfterBattleText4 ; TextAfterBattle
dw SilphCo7EndBattleText4 ; TextEndBattle
@@ -324,8 +321,7 @@ SilphCo7Text1:
ld a, [wd72e]
bit 0, a ; got lapras?
jr z, .givelapras
- ld a, [wd838]
- bit 7, a ; saved silph?
+ CheckEvent EVENT_78F
jr nz, .savedsilph
ld hl, .LaprasGuyText
call PrintText
@@ -369,8 +365,7 @@ SilphCo7Text1:
SilphCo7Text2:
TX_ASM
- ld a, [wd838]
- bit 7, a ; saved silph?
+ CheckEvent EVENT_78F
jr nz, .savedsilph
ld hl, .rockettext
call PrintText
@@ -391,8 +386,7 @@ SilphCo7Text2:
SilphCo7Text3:
TX_ASM
- ld a, [wd838]
- bit 7, a ; saved silph?
+ CheckEvent EVENT_78F
jr nz, .savedsilph
ld hl, .rockettext
call PrintText
@@ -413,8 +407,7 @@ SilphCo7Text3:
SilphCo7Text4:
TX_ASM
- ld a, [wd838]
- bit 7, a ; saved silph?
+ CheckEvent EVENT_78F
jr nz, .savedsilph
ld hl, .rockettext
call PrintText