Subversion Repositories nw_plus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 h266 1
/*
2
--------------------------------------------------------------------------------
3
Duke: Nuclear Winter
4
By Joris Weimar
5
© 1997 Simply Silly Software
6
--------------------------------------------------------------------------------
7
Duke: Nuclear Winter Plus
8
By Hendricks266
9
--------------------------------------------------------------------------------
10
*/
11
 
12
state checkcommhitstate
13
 
14
  ifhitweapon
15
  {
16
    guts JIBS6 2
17
 
18
    ifdead
19
    {
20
      ifwasweapon FREEZEBLAST
21
      {
22
        sound SOMETHINGFROZE
23
        spritepal 1
24
        move 0
25
        action ACOMMFROZEN
26
        strength 0
27
        state icesmoke
28
        break
29
      }
30
      else
31
        ifwasweapon GROWSPARK
32
      {
33
        sound ACTOR_GROWING
34
        ai AICOMMGROW
35
        break
36
      }
37
 
38
      addkills 1 state specialdeath
39
 
40
      ifwasweapon RADIUSEXPLOSION
41
      {
42
        spawn BLOODPOOL
43
        sound SQUISHED
44
        state standard_jibs
45
        killit
46
      }
47
      else
48
        ifwasweapon RPG
49
      {
50
        sound SQUISHED
51
        spawn BLOODPOOL
52
        state standard_jibs
53
        killit
54
      }
55
 
56
      sound COMM_DYING
57
      ai AICOMMDYING
58
    }
59
    else
60
    {
61
      soundonce COMM_PAIN
62
      ifwasweapon SHRINKSPARK
63
      {
64
        sound ACTOR_SHRINKING
65
        ai AICOMMSHRUNK
66
      }
67
      else
68
        ifwasweapon GROWSPARK
69
          sound EXPANDERHIT
70
      else
71
        ifrnd 24
72
          ai AICOMMABOUTTOSHOOT
73
    }
74
  }
75
ends
76
 
77
state commshootbot
78
 
79
state calczdist
80
ldist xydist THISACTOR target
81
ifvare xydist 0 setvar xydist 1
82
 
83
ifvarand monstflags 32
84
{
85
	mulvar zdist 768
86
	divvarvar zdist xydist
87
	setprojectile[ELECTROPROJ].workslike 36866
88
	ezshoot zdist ELECTROPROJ
89
	setthisprojectile[RETURN].extra 50
90
	ifvarand monstflags 8
91
	{
92
		ezshoot zdist ELECTROPROJ
93
		setthisprojectile[RETURN].extra 50
94
	}
95
	setprojectile[ELECTROPROJ].workslike 32770
96
}
97
ifvarand monstflags 16
98
{
99
	eshoot FIREBALLPROJ 
100
	ifvarand monstflags 8 
101
	{
102
		setthisprojectile[RETURN].pal 13
103
		setthisprojectile[RETURN].extra 64
104
	}
105
} 
106
else
107
{
108
	mulvar zdist 644
109
	divvarvar zdist xydist
110
	ezshoot zdist FREEZEBLAST // NOAIM
111
	ifvarand monstflags 8 setactor[RETURN].extra 100
112
	setactor[RETURN].ang sprite[THISACTOR].ang
113
 
114
}
115
 
116
 
117
resetactioncount
118
 
119
ends
120
 
121
state commshooting
122
 
123
ifvarn target -1 { state commshootbot break }
124
 
125
ifvarand monstflags 32
126
{
127
	eshoot ELECTROPROJ
128
	setthisprojectile[RETURN].extra 50
129
	ifvarand monstflags 8
130
	{
131
		eshoot ELECTROPROJ
132
		setthisprojectile[RETURN].extra 50
133
	}
134
} else
135
ifvarand monstflags 16
136
{
137
	eshoot FIREBALLPROJ 
138
	ifvarand monstflags 8 
139
	{
140
		setthisprojectile[RETURN].pal 13
141
		setthisprojectile[RETURN].extra 64
142
	}
143
} 
144
else
145
{
146
	shoot FREEZEBLAST
147
	ifvarand monstflags 8 shoot FREEZEBLAST
148
}
149
 
150
 
151
resetactioncount
152
 
153
ends
154
 
155
actor COMMANDERSTAYPUT COMMANDERSTRENGTH
156
  cactor COMMANDER
157
  ai AICOMMABOUTTOSHOOT
158
enda
159
 
160
state commspinbotstate
161
 
162
getactor[target].x mx
163
getactor[target].y my
164
getactor[target].z mz
165
getactor[THISACTOR].x x
166
getactor[THISACTOR].y y
167
getactor[THISACTOR].z z
168
subvarvar mx x
169
subvarvar my y
170
getangle angvar mx my
171
 
172
cos xvel angvar
173
sin yvel angvar
174
shiftvarr xvel 7
175
shiftvarr yvel 7
176
subvarvar z mz 
177
ifvarg z 2048
178
setvar zvel -512 else
179
ifvarl z -2048 setvar zvel 512
180
movesprite THISACTOR xvel yvel zvel CLIPMASK0 RETURN
181
 
182
    soundonce COMM_SPIN
183
    ifcount 16
184
    {
185
      ifvarl xydist 1280
186
      {
187
	    setvar temp CAPTSPINNINGPLAYER
188
        ifvarand monstflags 8 mulvar temp -2 else mulvar temp -1
189
        setactor[target].htextra temp
190
        setactor[target].htpicnum RPG
191
        setactor[target].htowner THISACTOR
192
        //sound DUKE_GRUNT
193
        resetcount
194
      }
195
      else
196
        ifvarg xydist 2300
197
          ai AICOMMWAIT
198
    }
199
    ifactioncount 52
200
      ai AICOMMWAIT
201
    ifnotmoving
202
      ifrnd 32
203
        operate
204
 
205
ends
206
 
207
state commspinstate
208
 
209
getplayer[THISACTOR].posx mx
210
getplayer[THISACTOR].posy my
211
getactor[THISACTOR].x x
212
getactor[THISACTOR].y y
213
subvarvar mx x
214
subvarvar my y
215
getangle angvar mx my
216
 
217
cos xvel angvar
218
sin yvel angvar
219
shiftvarr xvel 7
220
shiftvarr yvel 7
221
setvar zvel 0
222
movesprite THISACTOR xvel yvel zvel CLIPMASK0 RETURN 
223
 
224
    soundonce COMM_SPIN
225
    ifcount 16
226
    {
227
      ifpdistl 1280 ifvarg canshootplayer 0
228
      {
229
        addphealth CAPTSPINNINGPLAYER
230
        ifvarand monstflags 8 addphealth CAPTSPINNINGPLAYER
231
        sound DUKE_GRUNT
232
        palfrom 32 16 
233
        resetcount
234
      }
235
      else
236
        ifpdistg 2300
237
          ai AICOMMWAIT
238
    }
239
    ifactioncount 52
240
      ai AICOMMWAIT
241
    ifnotmoving
242
      ifrnd 32
243
        operate
244
 
245
ends
246
 
247
state commfrisbeestate
248
 
249
setvar weapcount -1
250
ifcount 6
251
{
252
	ifcount 7 nullop else
253
	{
254
		getplayer[THISACTOR].posx mx
255
		getplayer[THISACTOR].posy my
256
		getactor[THISACTOR].x x
257
		getactor[THISACTOR].y y
258
		subvarvar mx x
259
		subvarvar my y
260
		getangle peractor5 mx my
261
	}
262
 
263
	cos xvel peractor5
264
	sin yvel peractor5
265
	shiftvarr xvel 5
266
	shiftvarr yvel 5
267
	setvar zvel 0
268
	movesprite THISACTOR xvel yvel zvel CLIPMASK0 RETURN
269
	ifvarn RETURN 0
270
	{
271
		addvar RETURN 16384
272
        ifvarl RETURN 16384
273
        ifvarg RETURN -1 // hit a sprite
274
        {
275
	        getactor[RETURN].picnum picnum
276
	        getactorvar[RETURN].monstatus temp
277
	        ifvare picnum APLAYER sound SQUISHED else
278
	        ifvare temp 1 sound SQUISHED
279
	        setactor[RETURN].htpicnum RPG
280
	        setactor[RETURN].htextra 100
281
	        setactor[RETURN].htowner THISACTOR
282
	        setactor[RETURN].htang peractor5
283
	        sound COMM_ATTACK
284
 
285
        }
286
        ai AICOMMWAIT
287
        setvar weapcount 0
288
    }
289
}
290
 
291
    soundonce COMM_SPIN
292
 
293
      ifpdistl 1280
294
      ifvarg canseeplayer 0
295
      {
296
        addphealth -1
297
        ifvarand monstflags 8 addphealth -1
298
        sound DUKE_GRUNT
299
        palfrom 32 16 
300
      }
301
 
302
 
303
    ifactioncount 52
304
    {
305
      ai AICOMMWAIT
306
      setvar weapcount 0
307
    }
308
ends
309
 
310
actor COMMANDER COMMANDERSTRENGTH
311
 
312
ifvarn target -1
313
{
314
	getactor[THISACTOR].z z
315
	getactor[target].z mz
316
}
317
 
318
  state checksquished
319
  state monsterai
320
  ifaction ACOMMFROZEN
321
  {
322
    fall
323
 
324
    ifcount THAWTIME
325
    {
326
      getlastpal
327
      ai AICOMMWAIT
328
    }
329
    else
330
      ifcount FROZENDRIPTIME
331
    {
332
      ifactioncount 26
333
      {
334
        spawn WATERDRIP
335
        resetactioncount
336
      }
337
    }
338
 
339
    ifhitweapon
340
    {
341
      ifwasweapon FREEZEBLAST
342
      {
343
        strength 0
344
        break
345
      }
346
      addkills 1 state specialdeath
347
 
348
      ifrnd 84
349
        spawn BLOODPOOL
350
      lotsofglass 30
351
      state standard_jibs
352
      sound GLASS_BREAKING
353
      killit
354
    }
355
    ifp pfacing
356
      ifpdistl FROZENQUICKKICKDIST
357
      ifvare superkicking 0
358
        pkick
359
    break
360
  }
361
  ifai 0
362
    ai AICOMMSHOOT
363
  else
364
    ifai AICOMMWAIT
365
  {
366
    ifcount 20
367
    {
368
	  ifvarn target -1
369
	  {
370
		  ifrnd 96
371
	            ai AICOMMGET
372
	          else
373
	            ai AICOMMABOUTTOSHOOT
374
	  }
375
	  else
376
	  {
377
		  ifvarand monstflags 2048
378
		  {
379
			  ifvarg targetlock 0
380
			  {
381
				ifrnd 96
382
	              ai AICOMMGET
383
	            else ifvare playerally 0
384
	              ai AICOMMABOUTTOSHOOT
385
	          }
386
	          else
387
	             ai AICOMMGET
388
	      }
389
	      else
390
 
391
	      ifvarg canseeplayer 0
392
	      {
393
	        ifvarg canshootplayer 0
394
	        {
395
	          ifrnd 96
396
	            ai AICOMMGET
397
	          else ifvare playerally 0
398
	            ai AICOMMABOUTTOSHOOT
399
	        }
400
	      }
401
	      else
402
	        ai AICOMMGET
403
      }
404
    }
405
  }
406
  else
407
    ifai AICOMMABOUTTOSHOOT
408
  {
409
	ifvare target -1 ifvarn playerally 0 { ai AICOMMGET break }
410
    ifactioncount 2
411
    {
412
	  ifvarn target -1 ai AICOMMSHOOT else
413
      ifvarg canseeplayer 0 ifvare playerally 0
414
        ai AICOMMSHOOT
415
      else
416
      {
417
        ai AICOMMGET
418
        break
419
      }
420
    }
421
    ifrnd 32 soundonce COMM_ATTACK
422
  }
423
  else
424
    ifai AICOMMSHOOT
425
  {
426
	ifvare target -1 ifvarn playerally 0 { ai AICOMMGET break }
427
	setvar temp 0
428
	ifvarn target -1 setvar temp 1
429
	ifvarand monstflags 2048
430
	ifvare playerally 0
431
	{
432
		ifangdiffl 512 
433
		{ 
434
			ai AICOMMFRISBEE 
435
			break 
436
		} 
437
		else ifvarg targetlock 0 setvar temp 1 
438
	} else
439
	ifvarg canshootplayer 0 setvar temp 1
440
    ifvare temp 1
441
    {
442
      ifcount 24
443
        ifrnd 16
444
          ai AICOMMWAIT
445
      ifactioncount 2
446
      {
447
	    state commshooting
448
      }
449
    }
450
    else
451
      ai AICOMMGET
452
  }
453
  else
454
    ifai AICOMMSHRUNK
455
  {
456
    ifcount SHRUNKDONECOUNT
457
      ai AICOMMGET
458
    else
459
      ifcount SHRUNKCOUNT
460
        sizeto 48 40
461
    else
462
      state genericshrunkcode
463
  }
464
  else
465
    ifai AICOMMGROW
466
      state genericgrowcode
467
  else
468
    ifai AICOMMGET
469
  {
470
	ifvarn playerally 0 ifvare target -1 ifpdistl 1280 { ai AICOMMWAIT break }
471
    ifnotmoving
472
      ifrnd 4
473
        operate
474
    ifvare playerally 0
475
    ifpdistl 1280
476
      ifp palive
477
    {
478
      sound COMM_SPIN
479
      ai AICOMMSPIN
480
      break
481
    }
482
    ifvarn target -1
483
      ifvarl xydist 1280
484
    {
485
	  sound COMM_SPIN
486
	  ai AICOMMSPIN
487
	  break
488
    }
489
 
490
    ifvarg canseeplayer 0
491
    {
492
	  setvar temp 0
493
	  ifp phigher setvar temp 1
494
	  ifvarn target -1
495
	  ifvarvarg z mz setvar temp 1
496
 
497
      ifvare temp 1
498
        move COMMGETUPVELS getv geth faceplayer
499
      else
500
        move COMMGETVELS getv geth faceplayer
501
    }
502
    ifactioncount 8
503
      ifrnd 2
504
        ai AICOMMABOUTTOSHOOT
505
  }
506
  else
507
    ifai AICOMMSPIN
508
  {
509
	ifvarn target -1 state commspinbotstate else
510
	state commspinstate
511
  }
512
  else ifai AICOMMFRISBEE state commfrisbeestate
513
 
514
  ifai AICOMMDYING
515
  {
516
    fall
517
    strength 0
518
 
519
    ifhitweapon
520
      ifwasweapon RADIUSEXPLOSION
521
    {
522
      sound SQUISHED
523
      spawn BLOODPOOL
524
      state standard_jibs
525
      killit
526
    }
527
 
528
    ifaction ACOMMDYING
529
      ifactioncount 8
530
    {
531
      iffloordistl 8
532
        sound THUD
533
      cstat 0
534
      action ANULLACTION
535
      //action ACOMMDEAD
536
      move 0
537
      cactor COMMANDERCORPSE
538
    }
539
  }
540
  else
541
  {
542
    ifrnd 2
543
      soundonce COMM_ROAM
544
    state checkcommhitstate
545
  }
546
enda
547
 
548
 
549
 
550
 
551
useractor enemy TANK TANKSTRENGTH fall
552
  state monsterai
553
  ifaction 0
554
  {
555
   // sizeat 60 60
556
    action ATANKWAIT
557
    cstat 257
558
    clipdist 100
559
  }
560
  else
561
    ifaction ATANKSPIN
562
  {
563
    soundonce TANK_ROAM
564
 
565
    ifactioncount 20
566
    {
567
	  ifvare target -1 ifvarn playerally 0 nullop else
568
      ifrnd 16
569
        ifvarg canseeplayer 0
570
          ifvarg canshootplayer 0
571
      {
572
        move STOPPED geth
573
        action ATANKSHOOTING
574
        stopsound TANK_ROAM
575
      }
576
    }
577
 
578
    ifrnd 16
579
      move TANKFORWARD seekplayer
580
  }
581
  else
582
    ifaction ATANKSHOOTING
583
  {
584
	ifvarn target -1 state tankshootbot else
585
	{
586
		ifvarn playerally 0 { move 0 action ATANKWAIT break }
587
	    ifactioncount 22
588
	    {
589
	      ifpdistg 8192
590
	      {
591
	        sound BOS1_ATTACK2
592
	        shoot MORTER
593
	        ifvarand monstflags 8 shoot MORTER
594
	      }
595
	      resetcount
596
	      move 0 action ATANKWAIT
597
	    }
598
	    else
599
	      ifactioncount 2
600
	    {
601
	      ifvarg canseeplayer 0
602
	      {
603
	        ifpdistl 16384
604
	        {
605
	          ifrnd 128
606
	          {
607
		        ifvarand monstflags 16
608
		        {
609
			        ifvarand morefx 16
610
			        ifvarn rendmode 0 espawn SHOTSPARK5
611
			        sound PISTOL_LOW
612
			        shoot STARPROJ
613
			        ifvarand monstflags 8 shoot STARPROJ
614
		        } else
615
		        {
616
			        ifvarand morefx 16
617
			        ifvarn rendmode 0 espawn SHOTSPARK5
618
			        addvar position 1 ifvarg position 3 setvar position 0
619
			        setactorvar[RETURN].position position
620
			        ifvare dpsounds YES sound DPCHAINGUNFIRE else
621
		            sound PISTOL_FIRE
622
		            shoot SHOTSPARK1
623
		            ifvarand monstflags 8 shoot SHOTSPARK1
624
	            }
625
	          }
626
	        }
627
	        else
628
	          ifrnd 128
629
	        {
630
		        ifvarand monstflags 16
631
		        {
632
			        sound RPG_SHOOT
633
			        shoot FIREBULLET
634
			        ifvarand monstflags 8 shoot FIREBULLET
635
		        }
636
		        else
637
		        {
638
			      ifvare dpsounds YES sound PRED_ATTACK2 else
639
		          sound PRED_ATTACK
640
		          shoot FIRELASER
641
		          ifvarand monstflags 8 shoot FIRELASER
642
	            }
643
	        }
644
	      }
645
	      else
646
	      {
647
	        move TANKFORWARD seekplayer
648
	        action ATANKSPIN
649
	      }
650
	    }
651
 
652
	    ifrnd 16
653
	    {
654
	      stopsound TANK_ROAM
655
	      move STOPPED faceplayerslow
656
	    }
657
    }
658
  }
659
  else
660
    ifaction ATANKWAIT
661
  {
662
    ifactioncount 32
663
    {
664
      move TANKFORWARD seekplayer
665
      action ATANKSPIN
666
    }
667
  }
668
  else
669
    ifaction ATANKDEAD
670
  {
671
    addkills 1 state specialdeath
672
    hitradius 6144 TOUGH TOUGH TOUGH TOUGH
673
    sound LASERTRIP_EXPLODE
674
    debris SCRAP1 15
675
    spawn EXPLOSION2
676
    ifrnd 128 spawn SNOWMAN
677
    killit
678
  }
679
 
680
  ifhitweapon
681
  {
682
    ifdead
683
      action ATANKDEAD
684
    else
685
    {
686
      debris SCRAP1 1
687
      ifaction ATANKSHOOTING break
688
	  ifvare target -1 ifvarn playerally 0 nullop else
689
      ifrnd 192
690
      {
691
        move STOPPED geth
692
        action ATANKSHOOTING
693
        stopsound TANK_ROAM
694
      }
695
    }
696
  }
697
 
698
enda
699