Rev 25 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | h266 | 1 | /* |
2 | -------------------------------------------------------------------------------- |
||
3 | Duke Caribbean: Life's A Beach |
||
4 | By Joris Weimar |
||
5 | © 1997 Sunstorm Interactive |
||
6 | -------------------------------------------------------------------------------- |
||
7 | Duke Caribbean: Life's A Beach Plus |
||
8 | By Hendricks266 |
||
9 | -------------------------------------------------------------------------------- |
||
10 | // CON Files for the 'Duke Carribean Add-on' by SunStorm Interactive |
||
11 | // |
||
12 | // Actor - DRAGON - Sprite #3585 |
||
13 | // |
||
14 | // --- Resources --- |
||
15 | // |
||
16 | // Sounds: |
||
17 | // Dragon Dying Sound - DRAGDIE.WAV |
||
18 | // Dragon Hurt Sound - DRAGHURT.WAV |
||
19 | // Dragon Roam Sound - DRAGROAM.WAV |
||
20 | // Dragon Wake-up Sound - DRAGRECO.WAV |
||
21 | // |
||
22 | // Art: |
||
23 | // 5 * 5 frame(s) - Dragon Bouncing Animation |
||
24 | // 6 * 1 frame(s) - Dragon Dying Animation |
||
25 | // 5 * 2 frame(s) - Dragon Firing Animation |
||
26 | */ |
||
27 | |||
28 | action DRAGONBOUNCE 0 2 5 1 20 |
||
29 | action DRAGONBOUNCE2 10 3 5 1 20 |
||
30 | action DRAGONSHOOT 31 2 5 1 40 |
||
31 | action DRAGONSHRUNK 0 5 5 1 30 |
||
32 | action DRAGONGROW 0 1 5 |
||
33 | action DRAGONFROZEN 31 1 5 1 |
||
34 | action DRAGONDEAD 30 1 1 |
||
35 | action DRAGONDYING 25 6 1 1 12 |
||
36 | |||
37 | move DRAGONSPEED 60 0 |
||
38 | move DRAGONFLEE 300 0 |
||
39 | move DRAGONSTOPPED |
||
40 | move DRAGONBACK -250 0 |
||
41 | move DRAGONSHRUNKSPEED 50 0 |
||
42 | |||
43 | ai AIDRAGONFLEE DRAGONBOUNCE DRAGONFLEE fleeenemy randomangle |
||
44 | ai AIDRAGONBOUNCESEE DRAGONBOUNCE DRAGONSPEED seekplayer |
||
45 | ai AIDRAGONBOUNCE DRAGONBOUNCE DRAGONSPEED faceplayer |
||
46 | |||
47 | ai AIDRAGONFLEE2 DRAGONBOUNCE2 DRAGONFLEE fleeenemy randomangle |
||
48 | ai AIDRAGONBOUNCESEE2 DRAGONBOUNCE2 DRAGONSPEED faceplayerslow |
||
49 | ai AIDRAGONBOUNCE2 DRAGONBOUNCE2 DRAGONSPEED faceplayer |
||
50 | |||
51 | ai AIDRAGONSHOOT DRAGONSHOOT DRAGONSTOPPED faceplayer |
||
52 | ai AIDRAGONSHRUNK DRAGONBOUNCE DRAGONSHRUNKSPEED fleeenemy randomangle |
||
53 | ai AIDRAGONGROW DRAGONGROW DRAGONSPEED faceplayer |
||
54 | ai AIDRAGONDYING DRAGONDYING DRAGONBACK |
||
55 | // faceplayer |
||
56 | |||
57 | state dragon_jibs |
||
58 | state scrap3_colorchange |
||
59 | debris SCRAP1 20 |
||
60 | debris SCRAP2 22 |
||
61 | debris SCRAP3 22 |
||
62 | debris SCRAP4 22 |
||
63 | debris SCRAP5 22 |
||
64 | getlastpal |
||
65 | spritepal 0 |
||
66 | state standard_jibs |
||
67 | getlastpal |
||
68 | ends |
||
69 | |||
70 | state dragongrowstate |
||
71 | ifcount 32 |
||
72 | { |
||
73 | state scrap3_colorchange |
||
74 | debris SCRAP1 20 |
||
75 | debris SCRAP2 22 |
||
76 | debris SCRAP3 22 |
||
77 | debris SCRAP4 22 |
||
78 | debris SCRAP5 22 |
||
79 | getlastpal |
||
80 | spritepal 0 |
||
81 | guts JIBS4 24 |
||
82 | guts JIBS6 28 |
||
83 | getlastpal |
||
84 | addkills 1 |
||
85 | sound SQUISHED |
||
86 | sound PIPEBOMB_EXPLODE |
||
87 | sound BALLEXPLODE |
||
88 | hitradius 2048 60 70 80 90 |
||
89 | spawn BLOODPOOL |
||
90 | spawn EXPLOSION2 |
||
91 | killit |
||
92 | } |
||
93 | else |
||
94 | { |
||
95 | sizeto 84 100 |
||
96 | break |
||
97 | } |
||
98 | ends |
||
99 | |||
100 | state dragondeathanglecode |
||
101 | ifvare temp3 0 |
||
102 | { |
||
103 | getplayer[THISACTOR].i temp // gets the player's ID |
||
104 | getactor[temp].x x2 |
||
105 | getactor[temp].y y2 |
||
106 | getactor[THISACTOR].x x |
||
107 | getactor[THISACTOR].y y // gets the coordinates of the player and dragon |
||
108 | subvarvar x2 x |
||
109 | subvarvar y2 y |
||
110 | getangle temp2 x2 y2 // calculates the angle to face the player |
||
111 | setvar temp 0 |
||
112 | randvar temp 256 // randomizes the angle within a certain logical range, since the bullet holes are facing the player |
||
113 | ifrnd 128 addvarvar temp2 temp else subvarvar temp2 temp |
||
114 | setactor[THISACTOR].ang temp2 // sets the angle, just in time for movement |
||
115 | setvar temp3 1 |
||
116 | } |
||
117 | ends |
||
118 | |||
119 | state DRAGONBOUNCESTATESEE |
||
120 | ifbulletnear ai AIDRAGONFLEE |
||
121 | |||
122 | ifai AIDRAGONBOUNCESEE |
||
123 | { |
||
124 | ifactioncount 2 |
||
125 | { |
||
126 | sound DRAGONROAM |
||
127 | ai AIDRAGONBOUNCESEE2 |
||
128 | } |
||
129 | } |
||
130 | else ifactioncount 3 ai AIDRAGONBOUNCESEE |
||
131 | |||
132 | ifpdistl 6000 |
||
133 | { |
||
134 | ifrnd 5 |
||
135 | ifp palive |
||
136 | ai AIDRAGONSHOOT |
||
137 | } |
||
138 | |||
139 | ifcansee nullop else ai AIDRAGONBOUNCE |
||
140 | ends |
||
141 | |||
142 | state DRAGONBOUNCESTATE |
||
143 | ifai AIDRAGONBOUNCE |
||
144 | { |
||
145 | ifactioncount 2 |
||
146 | { |
||
147 | sound DRAGONROAM |
||
148 | ai AIDRAGONBOUNCE2 |
||
149 | } |
||
150 | } |
||
151 | else |
||
152 | { |
||
153 | ifactioncount 3 ai AIDRAGONBOUNCE |
||
154 | } |
||
155 | |||
156 | ifcansee |
||
157 | ifrnd 64 |
||
158 | ifcanshoottarget |
||
159 | { |
||
160 | ifp palive ai AIDRAGONSHOOT |
||
161 | else ai AIDRAGONBOUNCESEE |
||
162 | } |
||
163 | ends |
||
164 | |||
165 | |||
166 | state DRAGONSHOOTSTATE |
||
167 | ifcount 8 nullop |
||
168 | else ifcount 7 |
||
169 | { |
||
170 | shoot RPG |
||
171 | sound DRAGONSHOOTING |
||
172 | } |
||
173 | |||
174 | ifactioncount 2 |
||
175 | { |
||
176 | ifrnd 100 |
||
177 | { |
||
178 | resetcount |
||
179 | resetactioncount |
||
180 | } |
||
181 | else |
||
182 | { |
||
183 | ai AIDRAGONBOUNCESEE |
||
184 | resetcount |
||
185 | resetactioncount |
||
186 | } |
||
187 | } |
||
188 | ends |
||
189 | |||
190 | state DRAGONHITSTATE |
||
191 | ifdead |
||
192 | { |
||
193 | state random_wall_jibs |
||
194 | |||
195 | ifwasweapon GROWSPARK |
||
196 | { |
||
197 | sound ACTOR_GROWING |
||
198 | ai AIDRAGONGROW |
||
199 | break |
||
200 | } |
||
201 | |||
202 | ifwasweapon FREEZEBLAST |
||
203 | { |
||
204 | sound SOMETHINGFROZE |
||
205 | spritepal 1 |
||
206 | move 0 |
||
207 | action DRAGONFROZEN |
||
208 | strength 0 |
||
209 | break |
||
210 | } |
||
211 | addkills 1 |
||
212 | |||
213 | ifwasweapon RADIUSEXPLOSION |
||
214 | { |
||
215 | sound SQUISHED |
||
216 | state dragon_jibs |
||
217 | killit |
||
218 | } |
||
219 | else ifwasweapon RPG |
||
220 | { |
||
221 | sound SQUISHED |
||
222 | state dragon_jibs |
||
223 | killit |
||
224 | } |
||
225 | else |
||
226 | { |
||
227 | ai AIDRAGONDYING |
||
228 | state dragondeathanglecode |
||
229 | } |
||
230 | |||
231 | sound BALLEXPLODE |
||
232 | } |
||
233 | else |
||
234 | { |
||
235 | sound DRAGONPAIN |
||
236 | state random_wall_jibs |
||
237 | debris SCRAP3 5 |
||
238 | |||
239 | ifwasweapon SHRINKSPARK |
||
240 | { |
||
241 | sound ACTOR_SHRINKING |
||
242 | ai AIDRAGONSHRUNK |
||
243 | } |
||
244 | else ifwasweapon GROWSPARK sound EXPANDERHIT |
||
245 | else ifrnd 64 ifai AIDRAGONSHOOT nullop else ai AIDRAGONSHOOT |
||
246 | } |
||
247 | ends |
||
248 | |||
249 | state DRAGONFLEESTATE |
||
250 | ifai AIDRAGONFLEE |
||
251 | { |
||
252 | ifactioncount 2 |
||
253 | { |
||
254 | sound DRAGONROAM |
||
255 | ai AIDRAGONFLEE2 |
||
256 | } |
||
257 | } |
||
258 | else |
||
259 | { |
||
260 | ifactioncount 3 ai AIDRAGONFLEE |
||
261 | } |
||
262 | |||
263 | ifrnd 15 ai AIDRAGONBOUNCE |
||
264 | ends |
||
265 | |||
266 | state DRAGONSHRINKSTATE |
||
267 | ifcount SHRUNKDONECOUNT ai AIDRAGONBOUNCE |
||
268 | else |
||
269 | ifcount SHRUNKCOUNT |
||
270 | sizeto 42 50 |
||
271 | else |
||
272 | state genericshrunkcode |
||
273 | ends |
||
274 | |||
275 | |||
276 | state DRAGONDYINGSTATE |
||
277 | ifactioncount 6 |
||
278 | { |
||
279 | state rf |
||
280 | iffloordistl 8 sound THUD |
||
281 | action DRAGONDEAD |
||
282 | move DRAGONSTOPPED |
||
283 | break |
||
284 | } |
||
285 | else move DRAGONBACK |
||
286 | // Note: Because of the way actioncounts work, "ifactioncount" really asks if it is at that value or greater. |
||
287 | // That's why we have to put bigger ones first, with "else" statements. |
||
288 | ends |
||
289 | |||
290 | useractor enemy DRAGON DRAGONSTRENGTH DRAGONBOUNCE |
||
291 | fall |
||
292 | cstator 257 |
||
293 | |||
294 | state checksquished |
||
295 | |||
296 | ifaction DRAGONDEAD |
||
297 | { |
||
298 | cstat 0 |
||
299 | ifrespawn |
||
300 | ifcount RESPAWNACTORTIME |
||
301 | { |
||
302 | spawn TRANSPORTERSTAR |
||
303 | cstat 257 |
||
304 | strength DRAGONSTRENGTH |
||
305 | ai AIDRAGONBOUNCE |
||
306 | } |
||
307 | else |
||
308 | { |
||
309 | strength 0 |
||
310 | ifhitweapon |
||
311 | ifwasweapon RADIUSEXPLOSION |
||
312 | { |
||
313 | sound BALLEXPLODE |
||
314 | state dragon_jibs |
||
315 | killit |
||
316 | } |
||
317 | break |
||
318 | } |
||
319 | } |
||
320 | else ifaction DRAGONFROZEN |
||
321 | { |
||
322 | // setactor[THISACTOR].mdflags 2 |
||
323 | ifcount THAWTIME |
||
324 | { |
||
325 | ai AIDRAGONBOUNCE |
||
326 | getlastpal |
||
327 | } |
||
328 | else ifcount FROZENDRIPTIME ifrnd 8 spawn WATERDRIP |
||
329 | |||
330 | ifhitweapon |
||
331 | { |
||
332 | ifwasweapon FREEZEBLAST |
||
333 | { |
||
334 | strength 0 |
||
335 | break |
||
336 | } |
||
337 | addkills 1 |
||
338 | |||
339 | lotsofglass 30 |
||
340 | ifrnd 84 spawn BLOODPOOL |
||
341 | sound GLASS_BREAKING |
||
342 | killit |
||
343 | } |
||
344 | ifp pfacing |
||
345 | ifpdistl FROZENQUICKKICKDIST |
||
346 | pkick |
||
347 | break |
||
348 | } |
||
349 | |||
350 | ifai AIDRAGONDYING |
||
351 | { |
||
352 | state DRAGONDYINGSTATE |
||
353 | break |
||
354 | } |
||
355 | |||
356 | ifhitweapon state DRAGONHITSTATE |
||
357 | |||
358 | ifai 0 ai AIDRAGONBOUNCE |
||
359 | |||
360 | ifai AIDRAGONGROW state dragongrowstate |
||
361 | else ifai AIDRAGONSHRUNK state DRAGONSHRINKSTATE |
||
362 | else |
||
363 | { |
||
364 | sizeat 42 50 |
||
365 | ifai AIDRAGONBOUNCESEE state DRAGONBOUNCESTATESEE |
||
366 | else ifai AIDRAGONBOUNCE state DRAGONBOUNCESTATE |
||
367 | else ifai AIDRAGONSHOOT state DRAGONSHOOTSTATE |
||
368 | else ifai AIDRAGONFLEE state DRAGONFLEESTATE |
||
369 | else ifai AIDRAGONFLEE2 state DRAGONFLEESTATE |
||
370 | else ifai AIDRAGONBOUNCESEE2 state DRAGONBOUNCESTATESEE |
||
371 | else ifai AIDRAGONBOUNCE2 state DRAGONBOUNCESTATE |
||
372 | } |
||
373 | enda |
||
374 | |||
375 | useractor notenemy DRAGONDEATH 0 |
||
376 | addvar temp 1 |
||
377 | ifvare temp 26 |
||
378 | { |
||
379 | setvar temp 0 |
||
380 | getactor[THISACTOR].x x |
||
381 | subvar x 1536 |
||
382 | setactor[THISACTOR].x x |
||
383 | sizeat 42 50 |
||
384 | state random_wall_jibs |
||
385 | sound BALLEXPLODE |
||
386 | cactor DRAGON |
||
387 | state dragondeathanglecode |
||
388 | ai AIDRAGONDYING |
||
389 | } |
||
390 | enda |