summaryrefslogtreecommitdiff
path: root/scripts/fuchsiagym.asm
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-08-30 17:55:02 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-08-30 17:55:02 -0400
commitd2ed7674f499b1fd6c4059da40b8b42c6bf96995 (patch)
treef581489b522fc647477d7b36dee072d553c44fd1 /scripts/fuchsiagym.asm
parent3394d8320f35f524231aa13bd9cae34e22246a6d (diff)
parent1a987d1e1ab96ca9553d4253c72858057332a03a (diff)
Merge branch 'master' of https://github.com/iimarckus/pokered
Doesn't build.
Diffstat (limited to 'scripts/fuchsiagym.asm')
-rwxr-xr-xscripts/fuchsiagym.asm174
1 files changed, 84 insertions, 90 deletions
diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm
index 43d977d7..3ec89256 100755
--- a/scripts/fuchsiagym.asm
+++ b/scripts/fuchsiagym.asm
@@ -37,40 +37,36 @@ FuchsiaGymScriptPointers: ; 75482 (1d:5482)
dw FuchsiaGymScript3
FuchsiaGymScript3: ; 7548a (1d:548a)
- ld a, [W_ISINBATTLE] ; W_ISINBATTLE
+ ld a, [W_ISINBATTLE]
cp $ff
jp z, FuchsiaGymScript_75477
ld a, $f0
ld [wJoyIgnore], a
FuchsiaGymScript3_75497: ; 75497 (1d:5497)
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
- ld hl, wd792
- set 1, [hl]
- ld bc, (TM_06 << 8) | 1
+ SetEvent EVENT_BEAT_KOGA
+ lb bc, TM_06, 1
call GiveItem
jr nc, .BagFull
ld a, $a
- ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
- ld hl, wd792
- set 0, [hl]
+ SetEvent EVENT_GOT_TM06
jr .asm_754c0
.BagFull
ld a, $b
- ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_754c0
ld hl, W_OBTAINEDBADGES
set 4, [hl]
- ld hl, wd72a
+ ld hl, wBeatGymFlags
set 4, [hl]
; deactivate gym trainers
- ld a, [wd792]
- or %11111100
- ld [wd792], a
+ SetEventRange EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, EVENT_BEAT_FUCHSIA_GYM_TRAINER_6
jp FuchsiaGymScript_75477
@@ -89,111 +85,110 @@ FuchsiaGymTextPointers: ; 754d5 (1d:54d5)
FuchsiaGymTrainerHeaders: ; 754eb (1d:54eb)
FuchsiaGymTrainerHeader0: ; 754eb (1d:54eb)
- db $2 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_0
db ($2 << 4) ; trainer's view range
- dw wd792 ; flag's byte
- dw FuchsiaGymBattleText1 ; 0x55ae TextBeforeBattle
- dw FuchsiaGymAfterBattleText1 ; 0x55b8 TextAfterBattle
- dw FuchsiaGymEndBattleText1 ; 0x55b3 TextEndBattle
- dw FuchsiaGymEndBattleText1 ; 0x55b3 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_0
+ dw FuchsiaGymBattleText1 ; TextBeforeBattle
+ dw FuchsiaGymAfterBattleText1 ; TextAfterBattle
+ dw FuchsiaGymEndBattleText1 ; TextEndBattle
+ dw FuchsiaGymEndBattleText1 ; TextEndBattle
FuchsiaGymTrainerHeader2: ; 754f7 (1d:54f7)
- db $3 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_2
db ($2 << 4) ; trainer's view range
- dw wd792 ; flag's byte
- dw FuchsiaGymBattleText2 ; 0x55c7 TextBeforeBattle
- dw FuchsiaGymAfterBattleText2 ; 0x55d1 TextAfterBattle
- dw FuchsiaGymEndBattleText2 ; 0x55cc TextEndBattle
- dw FuchsiaGymEndBattleText2 ; 0x55cc TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_2
+ dw FuchsiaGymBattleText2 ; TextBeforeBattle
+ dw FuchsiaGymAfterBattleText2 ; TextAfterBattle
+ dw FuchsiaGymEndBattleText2 ; TextEndBattle
+ dw FuchsiaGymEndBattleText2 ; TextEndBattle
FuchsiaGymTrainerHeader3: ; 75503 (1d:5503)
- db $4 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_3
db ($4 << 4) ; trainer's view range
- dw wd792 ; flag's byte
- dw FuchsiaGymBattleText3 ; 0x55e0 TextBeforeBattle
- dw FuchsiaGymAfterBattleText3 ; 0x55ea TextAfterBattle
- dw FuchsiaGymEndBattleText3 ; 0x55e5 TextEndBattle
- dw FuchsiaGymEndBattleText3 ; 0x55e5 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_3
+ dw FuchsiaGymBattleText3 ; TextBeforeBattle
+ dw FuchsiaGymAfterBattleText3 ; TextAfterBattle
+ dw FuchsiaGymEndBattleText3 ; TextEndBattle
+ dw FuchsiaGymEndBattleText3 ; TextEndBattle
FuchsiaGymTrainerHeader4: ; 7550f (1d:550f)
- db $5 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_4
db ($2 << 4) ; trainer's view range
- dw wd792 ; flag's byte
- dw FuchsiaGymBattleText4 ; 0x55f9 TextBeforeBattle
- dw FuchsiaGymAfterBattleText4 ; 0x5603 TextAfterBattle
- dw FuchsiaGymEndBattleText4 ; 0x55fe TextEndBattle
- dw FuchsiaGymEndBattleText4 ; 0x55fe TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_4
+ dw FuchsiaGymBattleText4 ; TextBeforeBattle
+ dw FuchsiaGymAfterBattleText4 ; TextAfterBattle
+ dw FuchsiaGymEndBattleText4 ; TextEndBattle
+ dw FuchsiaGymEndBattleText4 ; TextEndBattle
FuchsiaGymTrainerHeader5: ; 7551b (1d:551b)
- db $6 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
db ($2 << 4) ; trainer's view range
- dw wd792 ; flag's byte
- dw FuchsiaGymBattleText5 ; 0x5612 TextBeforeBattle
- dw FuchsiaGymAfterBattleText5 ; 0x561c TextAfterBattle
- dw FuchsiaGymEndBattleText5 ; 0x5617 TextEndBattle
- dw FuchsiaGymEndBattleText5 ; 0x5617 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
+ dw FuchsiaGymBattleText5 ; TextBeforeBattle
+ dw FuchsiaGymAfterBattleText5 ; TextAfterBattle
+ dw FuchsiaGymEndBattleText5 ; TextEndBattle
+ dw FuchsiaGymEndBattleText5 ; TextEndBattle
FuchsiaGymTrainerHeader6: ; 75527 (1d:5527)
- db $7 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_6
db ($2 << 4) ; trainer's view range
- dw wd792 ; flag's byte
- dw FuchsiaGymBattleText6 ; 0x562b TextBeforeBattle
- dw FuchsiaGymAfterBattleText6 ; 0x5635 TextAfterBattle
- dw FuchsiaGymEndBattleText6 ; 0x5630 TextEndBattle
- dw FuchsiaGymEndBattleText6 ; 0x5630 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_6
+ dw FuchsiaGymBattleText6 ; TextBeforeBattle
+ dw FuchsiaGymAfterBattleText6 ; TextAfterBattle
+ dw FuchsiaGymEndBattleText6 ; TextEndBattle
+ dw FuchsiaGymEndBattleText6 ; TextEndBattle
db $ff
FuchsiaGymText1: ; 75534 (1d:5534)
- db $08 ; asm
- ld a, [wd792]
- bit 1, a
- jr z, .asm_181b6 ; 0x7553a
- bit 0, a
- jr nz, .asm_adc3b ; 0x7553e
+ TX_ASM
+ CheckEvent EVENT_BEAT_KOGA
+ jr z, .asm_181b6
+ CheckEventReuseA EVENT_GOT_TM06
+ jr nz, .asm_adc3b
call z, FuchsiaGymScript3_75497
call DisableWaitingAfterTextDisplay
- jr .asm_e84c6 ; 0x75546
-.asm_adc3b ; 0x75548
- ld hl, UnnamedText_7558b
+ jr .asm_e84c6
+.asm_adc3b
+ ld hl, KogaExplainToxicText
call PrintText
- jr .asm_e84c6 ; 0x7554e
-.asm_181b6 ; 0x75550
- ld hl, UnnamedText_75581
+ jr .asm_e84c6
+.asm_181b6
+ ld hl, KogaBeforeBattleText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, UnnamedText_75586
- ld de, UnnamedText_75586
+ ld hl, KogaAfterBattleText
+ ld de, KogaAfterBattleText
call SaveEndBattleTextPointers
- ldh a, [$8c]
+ ld a, [H_SPRITEINDEX]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $5
ld [W_GYMLEADERNO], a
xor a
- ldh [$b4], a
+ ld [hJoyHeld], a
ld a, $3
ld [W_FUCHSIAGYMCURSCRIPT], a
-.asm_e84c6 ; 0x7557e
+.asm_e84c6
jp TextScriptEnd
-UnnamedText_75581: ; 75581 (1d:5581)
- TX_FAR _UnnamedText_75581
+KogaBeforeBattleText: ; 75581 (1d:5581)
+ TX_FAR _KogaBeforeBattleText
db "@"
-UnnamedText_75586: ; 75586 (1d:5586)
- TX_FAR _UnnamedText_75586
+KogaAfterBattleText: ; 75586 (1d:5586)
+ TX_FAR _KogaAfterBattleText
db "@"
-UnnamedText_7558b: ; 7558b (1d:558b)
- TX_FAR _UnnamedText_7558b
+KogaExplainToxicText: ; 7558b (1d:558b)
+ TX_FAR _KogaExplainToxicText
db "@"
FuchsiaGymText9: ; 75590 (1d:5590)
- TX_FAR _UnnamedText_75590
+ TX_FAR _FuchsiaGymText9
db "@"
FuchsiaGymText10: ; 75595 (1d:5595)
@@ -209,7 +204,7 @@ FuchsiaGymText11: ; 7559f (1d:559f)
db "@"
FuchsiaGymText2: ; 755a4 (1d:55a4)
- db $08 ; asm
+ TX_ASM
ld hl, FuchsiaGymTrainerHeader0
call TalkToTrainer
jp TextScriptEnd
@@ -227,7 +222,7 @@ FuchsiaGymAfterBattleText1: ; 755b8 (1d:55b8)
db "@"
FuchsiaGymText3: ; 755bd (1d:55bd)
- db $08 ; asm
+ TX_ASM
ld hl, FuchsiaGymTrainerHeader2
call TalkToTrainer
jp TextScriptEnd
@@ -245,7 +240,7 @@ FuchsiaGymAfterBattleText2: ; 755d1 (1d:55d1)
db "@"
FuchsiaGymText4: ; 755d6 (1d:55d6)
- db $08 ; asm
+ TX_ASM
ld hl, FuchsiaGymTrainerHeader3
call TalkToTrainer
jp TextScriptEnd
@@ -263,7 +258,7 @@ FuchsiaGymAfterBattleText3: ; 755ea (1d:55ea)
db "@"
FuchsiaGymText5: ; 755ef (1d:55ef)
- db $08 ; asm
+ TX_ASM
ld hl, FuchsiaGymTrainerHeader4
call TalkToTrainer
jp TextScriptEnd
@@ -281,7 +276,7 @@ FuchsiaGymAfterBattleText4: ; 75603 (1d:5603)
db "@"
FuchsiaGymText6: ; 75608 (1d:5608)
- db $08 ; asm
+ TX_ASM
ld hl, FuchsiaGymTrainerHeader5
call TalkToTrainer
jp TextScriptEnd
@@ -299,7 +294,7 @@ FuchsiaGymAfterBattleText5: ; 7561c (1d:561c)
db "@"
FuchsiaGymText7: ; 75621 (1d:5621)
- db $08 ; asm
+ TX_ASM
ld hl, FuchsiaGymTrainerHeader6
call TalkToTrainer
jp TextScriptEnd
@@ -317,20 +312,19 @@ FuchsiaGymAfterBattleText6: ; 75635 (1d:5635)
db "@"
FuchsiaGymText8: ; 7563a (1d:563a)
- db $08 ; asm
- ld a, [wd792]
- bit 1, a
- ld hl, UnnamedText_75653
- jr nz, .asm_50671 ; 0x75643
- ld hl, UnnamedText_7564e
-.asm_50671 ; 0x75648
+ TX_ASM
+ CheckEvent EVENT_BEAT_KOGA
+ ld hl, FuchsiaGymText_75653
+ jr nz, .asm_50671
+ ld hl, FuchsiaGymText_7564e
+.asm_50671
call PrintText
jp TextScriptEnd
-UnnamedText_7564e: ; 7564e (1d:564e)
- TX_FAR _UnnamedText_7564e
+FuchsiaGymText_7564e: ; 7564e (1d:564e)
+ TX_FAR _FuchsiaGymText_7564e
db "@"
-UnnamedText_75653: ; 75653 (1d:5653)
- TX_FAR _UnnamedText_75653
+FuchsiaGymText_75653: ; 75653 (1d:5653)
+ TX_FAR _FuchsiaGymText_75653
db "@"