summaryrefslogtreecommitdiff
path: root/scripts/powerplant.asm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/powerplant.asm')
-rwxr-xr-xscripts/powerplant.asm201
1 files changed, 100 insertions, 101 deletions
diff --git a/scripts/powerplant.asm b/scripts/powerplant.asm
index ec4f89b3..5391585d 100755
--- a/scripts/powerplant.asm
+++ b/scripts/powerplant.asm
@@ -1,110 +1,109 @@
-PowerPlantScript: ; 1e2c6 (7:62c6)
+PowerPlantScript:
call EnableAutoTextBoxDrawing
- ld hl, PowerPlantTrainerHeaders
- ld de, PowerPlantScriptPointers
- ld a, [W_POWERPLANTCURSCRIPT]
+ ld hl, Voltorb0TrainerHeader
+ ld de, .ScriptPointers
+ ld a, [wPowerPlantCurScript]
call ExecuteCurMapScriptInTable
- ld [W_POWERPLANTCURSCRIPT], a
+ ld [wPowerPlantCurScript], a
ret
-PowerPlantScriptPointers: ; 1e2d9 (7:62d9)
+.ScriptPointers
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
-PowerPlantTextPointers: ; 1e2df (7:62df)
- dw PowerPlantText1
- dw PowerPlantText2
- dw PowerPlantText3
- dw PowerPlantText4
- dw PowerPlantText5
- dw PowerPlantText6
- dw PowerPlantText7
- dw PowerPlantText8
- dw PowerPlantText9
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
-
-PowerPlantTrainerHeaders: ; 1e2fb (7:62fb)
-PowerPlantTrainerHeader0: ; 1e2fb (7:62fb)
- db 1 ; flag's bit
+PowerPlantTextPointers:
+ dw Voltorb0Text
+ dw Voltorb1Text
+ dw Voltorb2Text
+ dw Voltorb3Text
+ dw Voltorb4Text
+ dw Voltorb5Text
+ dw Voltorb6Text
+ dw Voltorb7Text
+ dw ZapdosText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+
+Voltorb0TrainerHeader:
+ dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_0
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_0
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
-PowerPlantTrainerHeader1: ; 1e307 (7:6307)
- db 2 ; flag's bit
+Voltorb1TrainerHeader:
+ dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_1
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_1
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
-PowerPlantTrainerHeader2: ; 1e313 (7:6313)
- db 3 ; flag's bit
+Voltorb2TrainerHeader:
+ dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_2
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_2
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
-PowerPlantTrainerHeader3: ; 1e31f (7:631f)
- db 4 ; flag's bit
+Voltorb3TrainerHeader:
+ dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_3
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_3
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
-PowerPlantTrainerHeader4: ; 1e32b (7:632b)
- db 5 ; flag's bit
+Voltorb4TrainerHeader:
+ dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_4
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_4
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
-PowerPlantTrainerHeader5: ; 1e337 (7:6337)
- db 6 ; flag's bit
+Voltorb5TrainerHeader:
+ dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_5
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_5
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
-PowerPlantTrainerHeader6: ; 1e343 (7:6343)
- db 7 ; flag's bit
+Voltorb6TrainerHeader:
+ dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_6
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_6
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
-PowerPlantTrainerHeader7: ; 1e34f (7:634f)
- db 8 ; flag's bit
+Voltorb7TrainerHeader:
+ dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
-PowerPlantTrainerHeader8: ; 1e35b (7:635b)
- db 9 ; flag's bit
+ZapdosTrainerHeader:
+ dbEventFlagBit EVENT_BEAT_ZAPDOS, 1
db 0 ; view range
- dw wd7d3 ; flag's byte
+ dwEventFlagAddress EVENT_BEAT_ZAPDOS, 1
dw ZapdosBattleText ; TextBeforeBattle
dw ZapdosBattleText ; TextAfterBattle
dw ZapdosBattleText ; TextEndBattle
@@ -112,64 +111,64 @@ PowerPlantTrainerHeader8: ; 1e35b (7:635b)
db $ff
-asm_234cc: ; 1e368 (7:6368)
+InitVoltorbBattle:
call TalkToTrainer
- ld a, [W_CURMAPSCRIPT]
- ld [W_POWERPLANTCURSCRIPT], a
+ ld a, [wCurMapScript]
+ ld [wPowerPlantCurScript], a
jp TextScriptEnd
-PowerPlantText1: ; 1e374 (7:6374)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader0 ; $62fb
- jr asm_234cc ; 0x1e378 $ee
-
-PowerPlantText2: ; 1e37a (7:637a)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader1 ; $6307
- jr asm_234cc ; 0x1e37e $e8
-
-PowerPlantText3: ; 1e380 (7:6380)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader2 ; $6313
- jr asm_234cc ; 0x1e384 $e2
-
-PowerPlantText4: ; 1e386 (7:6386)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader3 ; $631f
- jr asm_234cc ; 0x1e38a $dc
-
-PowerPlantText5: ; 1e38c (7:638c)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader4 ; $632b
- jr asm_234cc ; 0x1e390 $d6
-
-PowerPlantText6: ; 1e392 (7:6392)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader5 ; $6337
- jr asm_234cc ; 0x1e396 $d0
-
-PowerPlantText7: ; 1e398 (7:6398)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader6 ; $6343
- jr asm_234cc ; 0x1e39c $ca
-
-PowerPlantText8: ; 1e39e (7:639e)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader7 ; $634f
- jr asm_234cc ; 0x1e3a2 $c4
-
-PowerPlantText9: ; 1e3a4 (7:63a4)
- db $8 ; asm
- ld hl, PowerPlantTrainerHeader8 ; $635b
- jr asm_234cc ; 0x1e3a8 $be
-
-VoltorbBattleText: ; 1e3aa (7:63aa)
+Voltorb0Text:
+ TX_ASM
+ ld hl, Voltorb0TrainerHeader
+ jr InitVoltorbBattle
+
+Voltorb1Text:
+ TX_ASM
+ ld hl, Voltorb1TrainerHeader
+ jr InitVoltorbBattle
+
+Voltorb2Text:
+ TX_ASM
+ ld hl, Voltorb2TrainerHeader
+ jr InitVoltorbBattle
+
+Voltorb3Text:
+ TX_ASM
+ ld hl, Voltorb3TrainerHeader
+ jr InitVoltorbBattle
+
+Voltorb4Text:
+ TX_ASM
+ ld hl, Voltorb4TrainerHeader
+ jr InitVoltorbBattle
+
+Voltorb5Text:
+ TX_ASM
+ ld hl, Voltorb5TrainerHeader
+ jr InitVoltorbBattle
+
+Voltorb6Text:
+ TX_ASM
+ ld hl, Voltorb6TrainerHeader
+ jr InitVoltorbBattle
+
+Voltorb7Text:
+ TX_ASM
+ ld hl, Voltorb7TrainerHeader
+ jr InitVoltorbBattle
+
+ZapdosText:
+ TX_ASM
+ ld hl, ZapdosTrainerHeader
+ jr InitVoltorbBattle
+
+VoltorbBattleText:
TX_FAR _VoltorbBattleText
db "@"
-ZapdosBattleText: ; 1e3af (7:63af)
+ZapdosBattleText:
TX_FAR _ZapdosBattleText
- db $8
+ TX_ASM
ld a, ZAPDOS
call PlayCry
call WaitForSoundToFinish