forked from gameboyadvancesp/understanding-pokemon-red
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPowerPlant.asm
175 lines (151 loc) · 4.17 KB
/
PowerPlant.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
PowerPlant_Script:
call EnableAutoTextBoxDrawing
ld hl, Voltorb0TrainerHeader
ld de, PowerPlant_ScriptPointers
ld a, [wPowerPlantCurScript]
call ExecuteCurMapScriptInTable
ld [wPowerPlantCurScript], a
ret
PowerPlant_ScriptPointers
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
PowerPlant_TextPointers:
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
dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_0
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
Voltorb1TrainerHeader:
dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_1
db 0 ; view range
dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_1
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
Voltorb2TrainerHeader:
dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_2
db 0 ; view range
dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_2
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
Voltorb3TrainerHeader:
dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_3
db 0 ; view range
dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_3
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
Voltorb4TrainerHeader:
dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_4
db 0 ; view range
dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_4
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
Voltorb5TrainerHeader:
dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_5
db 0 ; view range
dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_5
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
Voltorb6TrainerHeader:
dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_6
db 0 ; view range
dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_6
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
Voltorb7TrainerHeader:
dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1
db 0 ; view range
dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1
dw VoltorbBattleText ; TextBeforeBattle
dw VoltorbBattleText ; TextAfterBattle
dw VoltorbBattleText ; TextEndBattle
dw VoltorbBattleText ; TextEndBattle
ZapdosTrainerHeader:
dbEventFlagBit EVENT_BEAT_ZAPDOS, 1
db 0 ; view range
dwEventFlagAddress EVENT_BEAT_ZAPDOS, 1
dw ZapdosBattleText ; TextBeforeBattle
dw ZapdosBattleText ; TextAfterBattle
dw ZapdosBattleText ; TextEndBattle
dw ZapdosBattleText ; TextEndBattle
db $ff
InitVoltorbBattle:
call TalkToTrainer
ld a, [wCurMapScript]
ld [wPowerPlantCurScript], a
jp TextScriptEnd
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:
TX_FAR _ZapdosBattleText
TX_ASM
ld a, ZAPDOS
call PlayCry
call WaitForSoundToFinish
jp TextScriptEnd