/[projet1]/users/chema/TINE/missions/mission10.s
Defence Force logotype

Contents of /users/chema/TINE/missions/mission10.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 369 - (show annotations)
Mon Jul 26 11:15:13 2010 UTC (9 years, 10 months ago) by Chema
File size: 6698 byte(s)
Solved problems with mission10.s and other issues with missions stated in todolist.txt

Missions checked, but more tweaks can be done (todolist.txt)
1
2 ;; Mission 10. Follow Constrictor trail!
3
4
5 .(
6 // Jump table to mission functions
7 // These are kind of event handlers
8 // OnPlayerXXX. The idea is patching these with the necessary jumps. If returns C=1 it means
9 // that text is to be plotted to screen (brief or debrief).
10
11 OnPlayerLaunch
12 clc
13 rts
14 .byt 00
15 OnPlayerDock
16 jmp LaunchMission
17 OnPlayerHyper
18 clc
19 rts
20 .byt 00
21 OnExplodeShip
22 jmp CheckSuccess
23 OnDockedShip
24 clc
25 rts
26 .byt 00
27 OnHyperShip
28 clc
29 rts
30 .byt 00
31 OnEnteringSystem
32 jmp CheckConstrictor
33 OnNewEncounter
34 jmp SuccessMsg
35
36 // OnScoopObject return with carry =1 if it has handled the scooping, so the main program
37 // avoids doing so.
38
39 OnScoopObject
40 clc
41 rts
42 .byt 00
43
44 // OnGameLoaded, called whenever the game has been loaded from disk, for initializing things...
45 OnGameLoaded
46 jmp SetMissionText
47
48 // Some public variables
49 NeedsDiskLoad .byt 0 ; Will be set to $ff when a new mission needs to be loaded from disk
50 MissionSummary .word str_Summary
51 MissionCargo .byt 0 ; Cargo for this mission
52 AvoidOtherShips .byt 0 ; If not zero, no other ships are created
53
54 // Local variables
55 idConstrictor .byt 0
56
57 CheckSuccess
58 .(
59 lda _mission
60 cmp #THISMISSION+2
61 bne no
62 cpx idConstrictor
63 bne no
64 yes
65 inc _mission
66 +no
67 clc
68 rts
69 .)
70
71 POS1
72 .word -4000
73 .word 4000
74 .word -4000
75
76
77 CheckConstrictor
78 .(
79
80 lda _galaxynum
81 cmp #5
82 bne no
83
84 lda _currentplanet
85 cmp #111
86 bne no
87
88 lda #<POS1
89 ldx #>POS1
90
91 sta tmp0
92 stx tmp0+1
93
94 lda #(SHIP_CONSTRICTOR)
95 jsr IndAddSpaceObject
96 cpx #0
97 beq end
98
99 lda #$81
100 sta _target,x
101
102 lda #(HAS_ECM)
103 jsr IndSetShipEquip
104
105 lda #(IS_AICONTROLED|FLG_PIRATE|FLG_BOLD)
106 sta _ai_state,x
107
108 lda #FLG_HARD
109 sta _flags,x
110
111 ; Should add missiles here
112 lda #%10
113 ora _missiles,x
114 sta _missiles,x
115
116 inc _mission
117 stx idConstrictor
118 end
119 clc
120 rts
121 .)
122
123 str_rumlo4 .byt <str_Summary0,<str_Summary1,<str_Summary2
124 str_rumhi4 .byt >str_Summary0,>str_Summary1,>str_Summary2
125 str_rumlo5 .byt <str_Summary9,<str_Summary4,<str_Summary5,<str_Summary6,<str_Summary7,<str_Summary8
126 str_rumhi5 .byt >str_Summary9,>str_Summary4,>str_Summary5,>str_Summary6,>str_Summary7,>str_Summary8
127 pnum4 .byt 114,13,29
128 pnum5 .byt 29,18,186,222,183,111
129
130 SetMissionText
131 .(
132 lda _galaxynum
133 cmp #4
134 bne gal5
135 .(
136 ldx #2
137 lda _currentplanet
138 loop
139 cmp pnum4,x
140 beq found
141 dex
142 bpl loop
143 clc
144 rts
145 found
146 lda str_rumlo4,x
147 sta MissionSummary
148 lda str_rumhi4,x
149 sta MissionSummary+1
150 clc
151 rts
152 .)
153 gal5
154 .(
155 ldx #5
156 lda _currentplanet
157 loop
158 cmp pnum5,x
159 beq found
160 dex
161 bpl loop
162 ; Not found
163 jmp hint
164 found
165 lda str_rumlo5,x
166 sta MissionSummary
167 lda str_rumhi5,x
168 sta MissionSummary+1
169 clc
170 rts
171 .)
172
173 .)
174
175 hint
176 .(
177 jsr IndRnd
178 cmp #20
179 bcs dontdoit
180 doit
181 lda #<str_Summary3
182 sta MissionSummary
183 lda #>str_Summary3
184 sta MissionSummary+1
185 dontdoit
186 clc
187 rts
188 .)
189
190
191 LaunchMission
192 .(
193 lda _mission
194 ; If state is zero, see if launch
195 ; If state is one just set the text for status screen
196 ; If state is three then sucess!
197 cmp #THISMISSION
198 beq dolaunch
199 cmp #THISMISSION+3
200 beq SuccessMsg
201 bcs nothing
202 jmp SetMissionText
203 nothing
204 clc
205 rts
206 dolaunch
207 ; Launch randomly if not at Aingeon and in galaxy 4
208 ; Galaxy must be 4
209 lda _galaxynum
210 cmp #4
211 bne nothing
212
213 lda _currentplanet
214 cmp #114
215 beq nothing
216
217 jsr IndRnd
218 cmp #50
219 bcs nothing
220
221 ; Launch
222 inc _mission
223
224 ; Prepare brief message
225 lda #<str_MissionBrief
226 sta TXTPTRLO
227 lda #>str_MissionBrief
228 sta TXTPTRHI
229 sec
230 rts
231 .)
232
233 SuccessMsg
234 .(
235 lda _mission
236 cmp #THISMISSION+3
237 beq doit
238 clc
239 rts
240 doit
241 lda #NEXTMISSION
242 sta _mission
243
244 lda _score
245 clc
246 adc #$10
247 sta _score
248 bcc nocarry
249 inc _score+1
250 nocarry
251
252 lda _equip+1
253 ora #EQ_EXTRAFUEL
254 sta _equip+1
255
256 lda #<str_MissionDebrief
257 sta TXTPTRLO
258 lda #>str_MissionDebrief
259 sta TXTPTRHI
260
261 dec NeedsDiskLoad
262 sec
263 rts
264 .)
265
266
267
268 str_MissionBrief
269 .asc "Greetings Commander, I am Admiral
270 .byt 13
271 .asc "Curruthers again. We found the"
272 .byt 13
273 .asc "traitor. He was the intel liaison"
274 .byt 13
275 #ifdef 0
276 .asc "with Zantor's group. We have"
277 .byt 13
278 .asc "examined the computer logs and"
279 .byt 13
280 .asc "security data, and have enough"
281 .byt 13
282 .asc "evidence against him. But he fled"
283 .byt 13
284 #else
285 .asc "with Zantor's group, but he fled"
286 .byt 13
287 #endif
288 .asc "away before we could capture him."
289 .byt 11
290 .asc "He stole a prorotype for a new"
291 .byt 13
292 .asc "ship, the Constrictor, from our"
293 .byt 13
294 .asc "ship yard in Aingeon. Seek and"
295 .byt 13
296 .asc "destroy this ship. You are cautioned"
297 .byt 13
298 .asc "that only Military Lasers will get"
299 .byt 13
300 .asc "through its experimental shields."
301 .byt 13
302 .asc "Good luck."
303 .byt 0
304
305 str_MissionDebrief
306 .asc "There will always be a place for you"
307 .byt 13
308 .asc "in Her Majesty's Space Navy."
309 .byt 13
310 .byt 13
311 ; .asc "And maybe sooner than you think..."
312 ; .byt 13
313 .asc "Accept this fuel optimizer unit"
314 .byt 13
315 .asc "as a present."
316 .byt 0
317
318
319 str_Summary0
320 .byt 2
321 .asc "The Constrictor was last seen at"
322 .byt 13
323 .byt 2
324 .asc "Mavelege, commander."
325 .byt 0
326
327 str_Summary1
328 .byt 2
329 .asc "A strange looking ship left here a"
330 .byt 13
331 .byt 2
332 .asc "while back. Looked bound for Veteerza."
333 .byt 0
334
335 str_Summary2
336 .byt 2
337 .asc "Yep, an unusual new ship just"
338 .byt 13
339 .byt 2
340 .asc "jumped to galaxy 5."
341 .byt 0
342
343
344 str_Summary3
345 .byt 2
346 .asc "I hear a weird looking ship was"
347 .byt 13
348 .byt 2
349 .asc "seen at Intedi."
350 .byt 0
351
352 str_Summary4
353 .byt 2
354 .asc "This strange ship dehyped here and"
355 .byt 13
356 .byt 2
357 .asc "jumped again. I heard it went to"
358 .byt 13
359 .byt 2
360 .asc "Rainte."
361 .byt 0
362
363 str_Summary5
364 .byt 2
365 .asc "Rogue ship went for me at Veedri."
366 .byt 13
367 .byt 2
368 .asc "My lasers didn't even scratch"
369 .byt 13
370 .byt 2
371 .asc "its hull..."
372 .byt 0
373
374 str_Summary6
375 .byt 2
376 .asc "Oh dear me yes. A frightful rogue"
377 .byt 13
378 .byt 2
379 .asc "shot lots of those beastly pirates"
380 .byt 13
381 .byt 2
382 .asc "and went to Rabeer."
383 .byt 0
384
385 str_Summary7
386 .byt 2
387 .asc "You can tackle the vicious scoundrel"
388 .byt 13
389 .byt 2
390 .asc "if you like. He's at Beatza."
391 .byt 0
392
393 str_Summary8
394 .byt 2
395 .asc "There's a real deadly pirate"
396 .byt 13
397 .byt 2
398 .asc "out there!"
399 .byt 0
400
401 str_Summary9
402 .byt 2
403 .asc "The ship entered this galaxy here."
404 .byt 0
405
406
407 str_Summary
408 .byt 2
409 .asc "Current mission:"
410 .byt 13
411 .byt 2
412 .asc "Go to Naval yard at Aingeon and"
413 .byt 13
414 .byt 2
415 .asc "pursue the Constrictor."
416 .byt 0
417 .)
418
419

  ViewVC Help
Powered by ViewVC 1.1.26