Subversion Repositories vaca_plus

Rev

Rev 1 | Go to most recent revision | Details | Compare with Previous | 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
25 h266 40
move DRAGONBACK  -500 0
1 h266 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
 
25 h266 100
 
1 h266 101
state dragondeathanglecode
25 h266 102
      ifvare temp3 -1
1 h266 103
        {
25 h266 104
          getactor[THISACTOR].htang temp // get the angle of the projectile that hit the dragon
105
          ifvarg temp 1024 subvar temp 1024 else addvar temp 1024 // turn the angle around to face the projectile
106
 
107
          setvar temp2 0
108
          randvar temp2 128 // randomizes the angle within a certain logical range, since the bullet holes are facing the player
109
          ifrnd 128 addvarvar temp temp2 else subvarvar temp temp2
110
 
111
          getactor[THISACTOR].ang temp3 // pass this along to EVENT_ANIMATESPRITES
112
 
113
          setactor[THISACTOR].ang temp // sets the angle, just in time for movement
1 h266 114
        }
115
ends
116
 
117
state DRAGONBOUNCESTATESEE
118
  ifbulletnear ai AIDRAGONFLEE
119
 
120
  ifai AIDRAGONBOUNCESEE
121
    {
122
    ifactioncount 2
123
      {
124
      sound DRAGONROAM
125
      ai AIDRAGONBOUNCESEE2
126
      }
127
    }
128
    else ifactioncount 3 ai AIDRAGONBOUNCESEE
129
 
130
  ifpdistl 6000
131
    {
132
    ifrnd 5
133
      ifp palive
134
        ai AIDRAGONSHOOT
135
   }
136
 
137
  ifcansee nullop else ai AIDRAGONBOUNCE
138
ends
139
 
140
state DRAGONBOUNCESTATE
141
  ifai AIDRAGONBOUNCE
142
    {
143
      ifactioncount 2
144
        {
145
          sound DRAGONROAM
146
          ai AIDRAGONBOUNCE2
147
        }
148
    }
149
  else
150
    {
151
      ifactioncount 3 ai AIDRAGONBOUNCE
152
    }
153
 
154
  ifcansee 
155
    ifrnd 64
156
      ifcanshoottarget
157
        {
158
          ifp palive ai AIDRAGONSHOOT
159
          else ai AIDRAGONBOUNCESEE
160
        }
161
ends
162
 
163
 
164
state DRAGONSHOOTSTATE
165
      ifcount 8 nullop
166
 else ifcount 7
167
        {
168
          shoot RPG
169
          sound DRAGONSHOOTING
170
        }
171
 
172
 ifactioncount 2
173
   {
174
     ifrnd 100
175
       {
25 h266 176
         ifcansee nullop else ai AIDRAGONBOUNCESEE // This line should make the dragon smarter.
1 h266 177
         resetcount
178
         resetactioncount
179
       }
180
     else
181
       {
182
         ai AIDRAGONBOUNCESEE
183
         resetcount
184
         resetactioncount
185
       }
186
   }
187
ends
188
 
189
state DRAGONHITSTATE
190
   ifdead
191
     {
192
       state random_wall_jibs
193
 
194
       ifwasweapon GROWSPARK
195
         {
196
           sound ACTOR_GROWING
197
           ai AIDRAGONGROW
198
           break
199
         }
200
 
201
      ifwasweapon FREEZEBLAST
202
        {
203
          sound SOMETHINGFROZE
204
          spritepal 1
205
          move 0
206
          action DRAGONFROZEN
207
          strength 0
208
          break
209
        }
210
       addkills 1
211
 
212
      ifwasweapon RADIUSEXPLOSION
213
        {
214
          sound SQUISHED
215
          state dragon_jibs
216
          killit
217
        }
218
 else ifwasweapon RPG
219
        {
220
          sound SQUISHED
221
          state dragon_jibs
222
          killit
223
        }
224
      else
225
        {
25 h266 226
          state dragondeathanglecode
1 h266 227
          ai AIDRAGONDYING
228
        }
229
 
230
      sound BALLEXPLODE
231
     }
232
   else
233
     {
234
       sound DRAGONPAIN
235
       state random_wall_jibs
236
       debris SCRAP3 5
237
 
238
       ifwasweapon SHRINKSPARK
239
         {
240
           sound ACTOR_SHRINKING
241
           ai AIDRAGONSHRUNK
242
         }
243
  else ifwasweapon GROWSPARK sound EXPANDERHIT
244
  else ifrnd 64 ifai AIDRAGONSHOOT nullop else ai AIDRAGONSHOOT
245
     }
246
ends
247
 
248
state DRAGONFLEESTATE
249
  ifai AIDRAGONFLEE
250
    {
251
      ifactioncount 2
252
        {
253
          sound DRAGONROAM
254
          ai AIDRAGONFLEE2
255
        }
256
    }
257
  else
258
    {
259
      ifactioncount 3 ai AIDRAGONFLEE
260
    }
261
 
262
  ifrnd 15 ai AIDRAGONBOUNCE
263
ends
264
 
265
state DRAGONSHRINKSTATE
266
  ifcount SHRUNKDONECOUNT ai AIDRAGONBOUNCE
267
  else
268
    ifcount SHRUNKCOUNT
269
      sizeto 42 50
270
  else
271
    state genericshrunkcode
272
ends
273
 
274
 
275
state DRAGONDYINGSTATE
276
  ifactioncount 6
277
    {
278
      state rf
279
      iffloordistl 8 sound THUD
280
      action DRAGONDEAD
281
      move DRAGONSTOPPED
282
      break
283
    }
284
  else move DRAGONBACK
285
// Note: Because of the way actioncounts work, "ifactioncount" really asks if it is at that value or greater.
286
//       That's why we have to put bigger ones first, with "else" statements.
287
ends
288
 
289
useractor enemy DRAGON DRAGONSTRENGTH DRAGONBOUNCE
25 h266 290
  fall
291
  cstator 257
292
  setactor[THISACTOR].mdflags 16
1 h266 293
 
25 h266 294
  ifai 0
295
  {
296
    setvar temp3 -1
297
    ai AIDRAGONBOUNCE
298
  }
299
 
1 h266 300
   state checksquished
301
 
302
      ifaction DRAGONDEAD
303
        {
304
          cstat 0
305
          ifrespawn
306
            ifcount RESPAWNACTORTIME
307
              {
308
                spawn TRANSPORTERSTAR
309
                cstat 257
310
                strength DRAGONSTRENGTH
25 h266 311
                setvar temp3 -1
1 h266 312
                ai AIDRAGONBOUNCE
313
              }
314
            else
315
              {
316
                strength 0
317
                ifhitweapon
318
   	          ifwasweapon RADIUSEXPLOSION
319
   	            {
320
   	              sound BALLEXPLODE
321
                      state dragon_jibs
322
                      killit
323
                    }
324
                break
325
              }
326
        }
327
 else ifaction DRAGONFROZEN
328
        {
329
         // setactor[THISACTOR].mdflags 2
330
          ifcount THAWTIME
331
            {
332
              ai AIDRAGONBOUNCE
333
              getlastpal
334
            }
335
     else ifcount FROZENDRIPTIME ifrnd 8 spawn WATERDRIP
336
 
337
          ifhitweapon
338
            {
339
              ifwasweapon FREEZEBLAST
340
                {
341
                  strength 0
342
                  break
343
                }
344
              addkills 1
345
 
346
              lotsofglass 30
347
              ifrnd 84 spawn BLOODPOOL
348
              sound GLASS_BREAKING
349
              killit
350
            }
351
          ifp pfacing
352
            ifpdistl FROZENQUICKKICKDIST
353
              pkick
354
          break
355
        }
356
 
357
     ifai AIDRAGONDYING
358
       {
359
         state DRAGONDYINGSTATE
360
         break
361
       }
362
 
25 h266 363
  ifhitweapon
364
    state DRAGONHITSTATE
1 h266 365
 
366
      ifai AIDRAGONGROW state dragongrowstate
367
 else ifai AIDRAGONSHRUNK state DRAGONSHRINKSTATE
368
 else
369
  {
370
    sizeat 42 50
371
      ifai AIDRAGONBOUNCESEE state DRAGONBOUNCESTATESEE
372
 else ifai AIDRAGONBOUNCE state DRAGONBOUNCESTATE
373
 else ifai AIDRAGONSHOOT state DRAGONSHOOTSTATE
374
 else ifai AIDRAGONFLEE state DRAGONFLEESTATE
375
 else ifai AIDRAGONFLEE2 state DRAGONFLEESTATE
376
 else ifai AIDRAGONBOUNCESEE2 state DRAGONBOUNCESTATESEE
377
 else ifai AIDRAGONBOUNCE2 state DRAGONBOUNCESTATE
378
  }
379
enda
380
 
381
useractor notenemy DRAGONDEATH 0
25 h266 382
  setvar temp3 -1
383
  setactor[THISACTOR].mdflags 16
384
 
1 h266 385
  addvar temp 1
25 h266 386
  ifvare temp 1
387
  {
388
    getplayer[THISACTOR].i temp2 // get the player's ID
389
 
390
    // get the coordinates of the player and dragon
391
    getactor[temp2].x x2
392
    getactor[temp2].y y2
393
    getactor[THISACTOR].x x
394
    getactor[THISACTOR].y y 
395
 
396
    subvarvar x2 x
397
    subvarvar y2 y
398
    getangle y x2 y2 // calculates the angle to face the player
399
 
400
    setactor[THISACTOR].htang y
401
  }
1 h266 402
  ifvare temp 26
25 h266 403
  {
404
    setvar temp 0
405
    getactor[THISACTOR].x x
406
    subvar x 1536
407
    setactor[THISACTOR].x x
408
    sizeat 42 50
409
    state random_wall_jibs
410
    sound BALLEXPLODE
411
    cactor DRAGON
412
    state dragondeathanglecode
413
    ai AIDRAGONDYING
414
  }
1 h266 415
enda