Subversion Repositories vaca_plus

Rev

Rev 1 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 25
Line 35... Line 35...
35
action DRAGONDYING   25 6 1 1 12
35
action DRAGONDYING   25 6 1 1 12
36
 
36
 
37
move DRAGONSPEED 60 0
37
move DRAGONSPEED 60 0
38
move DRAGONFLEE  300 0
38
move DRAGONFLEE  300 0
39
move DRAGONSTOPPED
39
move DRAGONSTOPPED
40
move DRAGONBACK  -250 0
40
move DRAGONBACK  -500 0
41
move DRAGONSHRUNKSPEED 50 0
41
move DRAGONSHRUNKSPEED 50 0
42
 
42
 
43
ai AIDRAGONFLEE     DRAGONBOUNCE DRAGONFLEE fleeenemy randomangle
43
ai AIDRAGONFLEE     DRAGONBOUNCE DRAGONFLEE fleeenemy randomangle
44
ai AIDRAGONBOUNCESEE  DRAGONBOUNCE DRAGONSPEED seekplayer
44
ai AIDRAGONBOUNCESEE  DRAGONBOUNCE DRAGONSPEED seekplayer
45
ai AIDRAGONBOUNCE  DRAGONBOUNCE DRAGONSPEED faceplayer
45
ai AIDRAGONBOUNCE  DRAGONBOUNCE DRAGONSPEED faceplayer
Line 95... Line 95...
95
    sizeto 84 100
95
    sizeto 84 100
96
    break
96
    break
97
  }
97
  }
98
ends
98
ends
99
 
99
 
-
 
100
 
100
state dragondeathanglecode
101
state dragondeathanglecode
101
      ifvare temp3 0
102
      ifvare temp3 -1
102
        {
103
        {
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
104
          getactor[THISACTOR].htang temp // get the angle of the projectile that hit the dragon
108
          subvarvar x2 x
-
 
109
          subvarvar y2 y
-
 
110
          getangle temp2 x2 y2 // calculates the angle to face the player
105
          ifvarg temp 1024 subvar temp 1024 else addvar temp 1024 // turn the angle around to face the projectile
-
 
106
 
111
          setvar temp 0
107
          setvar temp2 0
112
          randvar temp 256 // randomizes the angle within a certain logical range, since the bullet holes are facing the player
108
          randvar temp2 128 // 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
109
          ifrnd 128 addvarvar temp temp2 else subvarvar temp temp2
-
 
110
 
114
          setactor[THISACTOR].ang temp2 // sets the angle, just in time for movement
111
          getactor[THISACTOR].ang temp3 // pass this along to EVENT_ANIMATESPRITES
-
 
112
 
115
          setvar temp3 1
113
          setactor[THISACTOR].ang temp // sets the angle, just in time for movement
116
        }
114
        }
117
ends
115
ends
118
 
116
 
119
state DRAGONBOUNCESTATESEE
117
state DRAGONBOUNCESTATESEE
120
  ifbulletnear ai AIDRAGONFLEE
118
  ifbulletnear ai AIDRAGONFLEE
Line 173... Line 171...
173
 
171
 
174
 ifactioncount 2
172
 ifactioncount 2
175
   {
173
   {
176
     ifrnd 100
174
     ifrnd 100
177
       {
175
       {
-
 
176
         ifcansee nullop else ai AIDRAGONBOUNCESEE // This line should make the dragon smarter.
178
         resetcount
177
         resetcount
179
         resetactioncount
178
         resetactioncount
180
       }
179
       }
181
     else
180
     else
182
       {
181
       {
Line 222... Line 221...
222
          state dragon_jibs
221
          state dragon_jibs
223
          killit
222
          killit
224
        }
223
        }
225
      else
224
      else
226
        {
225
        {
227
          ai AIDRAGONDYING
-
 
228
          state dragondeathanglecode
226
          state dragondeathanglecode
-
 
227
          ai AIDRAGONDYING
229
        }
228
        }
230
 
229
 
231
      sound BALLEXPLODE
230
      sound BALLEXPLODE
232
     }
231
     }
233
   else
232
   else
Line 288... Line 287...
288
ends
287
ends
289
 
288
 
290
useractor enemy DRAGON DRAGONSTRENGTH DRAGONBOUNCE
289
useractor enemy DRAGON DRAGONSTRENGTH DRAGONBOUNCE
291
   fall
290
  fall
292
   cstator 257
291
  cstator 257
-
 
292
  setactor[THISACTOR].mdflags 16
-
 
293
 
-
 
294
  ifai 0
-
 
295
  {
-
 
296
    setvar temp3 -1
-
 
297
    ai AIDRAGONBOUNCE
-
 
298
  }
293
 
299
 
294
   state checksquished
300
   state checksquished
295
 
301
 
296
      ifaction DRAGONDEAD
302
      ifaction DRAGONDEAD
297
        {
303
        {
Line 300... Line 306...
300
            ifcount RESPAWNACTORTIME
306
            ifcount RESPAWNACTORTIME
301
              {
307
              {
302
                spawn TRANSPORTERSTAR
308
                spawn TRANSPORTERSTAR
303
                cstat 257
309
                cstat 257
304
                strength DRAGONSTRENGTH
310
                strength DRAGONSTRENGTH
-
 
311
                setvar temp3 -1
305
                ai AIDRAGONBOUNCE
312
                ai AIDRAGONBOUNCE
306
              }
313
              }
307
            else
314
            else
308
              {
315
              {
309
                strength 0
316
                strength 0
Line 351... Line 358...
351
       {
358
       {
352
         state DRAGONDYINGSTATE
359
         state DRAGONDYINGSTATE
353
         break
360
         break
354
       }
361
       }
355
 
362
 
356
  ifhitweapon state DRAGONHITSTATE
363
  ifhitweapon
357
 
-
 
358
  ifai 0 ai AIDRAGONBOUNCE
364
    state DRAGONHITSTATE
359
 
365
 
360
      ifai AIDRAGONGROW state dragongrowstate
366
      ifai AIDRAGONGROW state dragongrowstate
361
 else ifai AIDRAGONSHRUNK state DRAGONSHRINKSTATE
367
 else ifai AIDRAGONSHRUNK state DRAGONSHRINKSTATE
362
 else
368
 else
363
  {
369
  {
Line 371... Line 377...
371
 else ifai AIDRAGONBOUNCE2 state DRAGONBOUNCESTATE
377
 else ifai AIDRAGONBOUNCE2 state DRAGONBOUNCESTATE
372
  }
378
  }
373
enda
379
enda
374
 
380
 
375
useractor notenemy DRAGONDEATH 0
381
useractor notenemy DRAGONDEATH 0
-
 
382
  setvar temp3 -1
-
 
383
  setactor[THISACTOR].mdflags 16
-
 
384
 
376
  addvar temp 1
385
  addvar temp 1
-
 
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
  }
377
  ifvare temp 26
402
  ifvare temp 26
378
    {
403
  {
379
      setvar temp 0
404
    setvar temp 0
380
      getactor[THISACTOR].x x
405
    getactor[THISACTOR].x x
381
      subvar x 1536
406
    subvar x 1536