1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
|
/*
* Copyright (C) 1997-2001 Id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
// Created on 11.11.2003 by RST.
// $Id: M_Actor.java,v 1.4 2005-11-20 22:18:33 salomo Exp $
package jake2.game.monsters;
import jake2.Defines;
import jake2.game.*;
import jake2.game.EntDieAdapter;
import jake2.game.EntPainAdapter;
import jake2.game.EntThinkAdapter;
import jake2.game.EntTouchAdapter;
import jake2.game.EntUseAdapter;
import jake2.game.GameAI;
import jake2.game.GameBase;
import jake2.game.GameUtil;
import jake2.game.Monster;
import jake2.game.cplane_t;
import jake2.game.csurface_t;
import jake2.game.edict_t;
import jake2.game.mframe_t;
import jake2.game.mmove_t;
import jake2.util.Lib;
import jake2.util.Math3D;
public class M_Actor {
// This file generated by ModelGen - Do NOT Modify
public final static int FRAME_attak01 = 0;
public final static int FRAME_attak02 = 1;
public final static int FRAME_attak03 = 2;
public final static int FRAME_attak04 = 3;
public final static int FRAME_death101 = 4;
public final static int FRAME_death102 = 5;
public final static int FRAME_death103 = 6;
public final static int FRAME_death104 = 7;
public final static int FRAME_death105 = 8;
public final static int FRAME_death106 = 9;
public final static int FRAME_death107 = 10;
public final static int FRAME_death201 = 11;
public final static int FRAME_death202 = 12;
public final static int FRAME_death203 = 13;
public final static int FRAME_death204 = 14;
public final static int FRAME_death205 = 15;
public final static int FRAME_death206 = 16;
public final static int FRAME_death207 = 17;
public final static int FRAME_death208 = 18;
public final static int FRAME_death209 = 19;
public final static int FRAME_death210 = 20;
public final static int FRAME_death211 = 21;
public final static int FRAME_death212 = 22;
public final static int FRAME_death213 = 23;
public final static int FRAME_death301 = 24;
public final static int FRAME_death302 = 25;
public final static int FRAME_death303 = 26;
public final static int FRAME_death304 = 27;
public final static int FRAME_death305 = 28;
public final static int FRAME_death306 = 29;
public final static int FRAME_death307 = 30;
public final static int FRAME_death308 = 31;
public final static int FRAME_death309 = 32;
public final static int FRAME_death310 = 33;
public final static int FRAME_death311 = 34;
public final static int FRAME_death312 = 35;
public final static int FRAME_death313 = 36;
public final static int FRAME_death314 = 37;
public final static int FRAME_death315 = 38;
public final static int FRAME_flip01 = 39;
public final static int FRAME_flip02 = 40;
public final static int FRAME_flip03 = 41;
public final static int FRAME_flip04 = 42;
public final static int FRAME_flip05 = 43;
public final static int FRAME_flip06 = 44;
public final static int FRAME_flip07 = 45;
public final static int FRAME_flip08 = 46;
public final static int FRAME_flip09 = 47;
public final static int FRAME_flip10 = 48;
public final static int FRAME_flip11 = 49;
public final static int FRAME_flip12 = 50;
public final static int FRAME_flip13 = 51;
public final static int FRAME_flip14 = 52;
public final static int FRAME_grenad01 = 53;
public final static int FRAME_grenad02 = 54;
public final static int FRAME_grenad03 = 55;
public final static int FRAME_grenad04 = 56;
public final static int FRAME_grenad05 = 57;
public final static int FRAME_grenad06 = 58;
public final static int FRAME_grenad07 = 59;
public final static int FRAME_grenad08 = 60;
public final static int FRAME_grenad09 = 61;
public final static int FRAME_grenad10 = 62;
public final static int FRAME_grenad11 = 63;
public final static int FRAME_grenad12 = 64;
public final static int FRAME_grenad13 = 65;
public final static int FRAME_grenad14 = 66;
public final static int FRAME_grenad15 = 67;
public final static int FRAME_jump01 = 68;
public final static int FRAME_jump02 = 69;
public final static int FRAME_jump03 = 70;
public final static int FRAME_jump04 = 71;
public final static int FRAME_jump05 = 72;
public final static int FRAME_jump06 = 73;
public final static int FRAME_pain101 = 74;
public final static int FRAME_pain102 = 75;
public final static int FRAME_pain103 = 76;
public final static int FRAME_pain201 = 77;
public final static int FRAME_pain202 = 78;
public final static int FRAME_pain203 = 79;
public final static int FRAME_pain301 = 80;
public final static int FRAME_pain302 = 81;
public final static int FRAME_pain303 = 82;
public final static int FRAME_push01 = 83;
public final static int FRAME_push02 = 84;
public final static int FRAME_push03 = 85;
public final static int FRAME_push04 = 86;
public final static int FRAME_push05 = 87;
public final static int FRAME_push06 = 88;
public final static int FRAME_push07 = 89;
public final static int FRAME_push08 = 90;
public final static int FRAME_push09 = 91;
public final static int FRAME_run01 = 92;
public final static int FRAME_run02 = 93;
public final static int FRAME_run03 = 94;
public final static int FRAME_run04 = 95;
public final static int FRAME_run05 = 96;
public final static int FRAME_run06 = 97;
public final static int FRAME_run07 = 98;
public final static int FRAME_run08 = 99;
public final static int FRAME_run09 = 100;
public final static int FRAME_run10 = 101;
public final static int FRAME_run11 = 102;
public final static int FRAME_run12 = 103;
public final static int FRAME_runs01 = 104;
public final static int FRAME_runs02 = 105;
public final static int FRAME_runs03 = 106;
public final static int FRAME_runs04 = 107;
public final static int FRAME_runs05 = 108;
public final static int FRAME_runs06 = 109;
public final static int FRAME_runs07 = 110;
public final static int FRAME_runs08 = 111;
public final static int FRAME_runs09 = 112;
public final static int FRAME_runs10 = 113;
public final static int FRAME_runs11 = 114;
public final static int FRAME_runs12 = 115;
public final static int FRAME_salute01 = 116;
public final static int FRAME_salute02 = 117;
public final static int FRAME_salute03 = 118;
public final static int FRAME_salute04 = 119;
public final static int FRAME_salute05 = 120;
public final static int FRAME_salute06 = 121;
public final static int FRAME_salute07 = 122;
public final static int FRAME_salute08 = 123;
public final static int FRAME_salute09 = 124;
public final static int FRAME_salute10 = 125;
public final static int FRAME_salute11 = 126;
public final static int FRAME_salute12 = 127;
public final static int FRAME_stand101 = 128;
public final static int FRAME_stand102 = 129;
public final static int FRAME_stand103 = 130;
public final static int FRAME_stand104 = 131;
public final static int FRAME_stand105 = 132;
public final static int FRAME_stand106 = 133;
public final static int FRAME_stand107 = 134;
public final static int FRAME_stand108 = 135;
public final static int FRAME_stand109 = 136;
public final static int FRAME_stand110 = 137;
public final static int FRAME_stand111 = 138;
public final static int FRAME_stand112 = 139;
public final static int FRAME_stand113 = 140;
public final static int FRAME_stand114 = 141;
public final static int FRAME_stand115 = 142;
public final static int FRAME_stand116 = 143;
public final static int FRAME_stand117 = 144;
public final static int FRAME_stand118 = 145;
public final static int FRAME_stand119 = 146;
public final static int FRAME_stand120 = 147;
public final static int FRAME_stand121 = 148;
public final static int FRAME_stand122 = 149;
public final static int FRAME_stand123 = 150;
public final static int FRAME_stand124 = 151;
public final static int FRAME_stand125 = 152;
public final static int FRAME_stand126 = 153;
public final static int FRAME_stand127 = 154;
public final static int FRAME_stand128 = 155;
public final static int FRAME_stand129 = 156;
public final static int FRAME_stand130 = 157;
public final static int FRAME_stand131 = 158;
public final static int FRAME_stand132 = 159;
public final static int FRAME_stand133 = 160;
public final static int FRAME_stand134 = 161;
public final static int FRAME_stand135 = 162;
public final static int FRAME_stand136 = 163;
public final static int FRAME_stand137 = 164;
public final static int FRAME_stand138 = 165;
public final static int FRAME_stand139 = 166;
public final static int FRAME_stand140 = 167;
public final static int FRAME_stand201 = 168;
public final static int FRAME_stand202 = 169;
public final static int FRAME_stand203 = 170;
public final static int FRAME_stand204 = 171;
public final static int FRAME_stand205 = 172;
public final static int FRAME_stand206 = 173;
public final static int FRAME_stand207 = 174;
public final static int FRAME_stand208 = 175;
public final static int FRAME_stand209 = 176;
public final static int FRAME_stand210 = 177;
public final static int FRAME_stand211 = 178;
public final static int FRAME_stand212 = 179;
public final static int FRAME_stand213 = 180;
public final static int FRAME_stand214 = 181;
public final static int FRAME_stand215 = 182;
public final static int FRAME_stand216 = 183;
public final static int FRAME_stand217 = 184;
public final static int FRAME_stand218 = 185;
public final static int FRAME_stand219 = 186;
public final static int FRAME_stand220 = 187;
public final static int FRAME_stand221 = 188;
public final static int FRAME_stand222 = 189;
public final static int FRAME_stand223 = 190;
public final static int FRAME_swim01 = 191;
public final static int FRAME_swim02 = 192;
public final static int FRAME_swim03 = 193;
public final static int FRAME_swim04 = 194;
public final static int FRAME_swim05 = 195;
public final static int FRAME_swim06 = 196;
public final static int FRAME_swim07 = 197;
public final static int FRAME_swim08 = 198;
public final static int FRAME_swim09 = 199;
public final static int FRAME_swim10 = 200;
public final static int FRAME_swim11 = 201;
public final static int FRAME_swim12 = 202;
public final static int FRAME_sw_atk01 = 203;
public final static int FRAME_sw_atk02 = 204;
public final static int FRAME_sw_atk03 = 205;
public final static int FRAME_sw_atk04 = 206;
public final static int FRAME_sw_atk05 = 207;
public final static int FRAME_sw_atk06 = 208;
public final static int FRAME_sw_pan01 = 209;
public final static int FRAME_sw_pan02 = 210;
public final static int FRAME_sw_pan03 = 211;
public final static int FRAME_sw_pan04 = 212;
public final static int FRAME_sw_pan05 = 213;
public final static int FRAME_sw_std01 = 214;
public final static int FRAME_sw_std02 = 215;
public final static int FRAME_sw_std03 = 216;
public final static int FRAME_sw_std04 = 217;
public final static int FRAME_sw_std05 = 218;
public final static int FRAME_sw_std06 = 219;
public final static int FRAME_sw_std07 = 220;
public final static int FRAME_sw_std08 = 221;
public final static int FRAME_sw_std09 = 222;
public final static int FRAME_sw_std10 = 223;
public final static int FRAME_sw_std11 = 224;
public final static int FRAME_sw_std12 = 225;
public final static int FRAME_sw_std13 = 226;
public final static int FRAME_sw_std14 = 227;
public final static int FRAME_sw_std15 = 228;
public final static int FRAME_sw_std16 = 229;
public final static int FRAME_sw_std17 = 230;
public final static int FRAME_sw_std18 = 231;
public final static int FRAME_sw_std19 = 232;
public final static int FRAME_sw_std20 = 233;
public final static int FRAME_taunt01 = 234;
public final static int FRAME_taunt02 = 235;
public final static int FRAME_taunt03 = 236;
public final static int FRAME_taunt04 = 237;
public final static int FRAME_taunt05 = 238;
public final static int FRAME_taunt06 = 239;
public final static int FRAME_taunt07 = 240;
public final static int FRAME_taunt08 = 241;
public final static int FRAME_taunt09 = 242;
public final static int FRAME_taunt10 = 243;
public final static int FRAME_taunt11 = 244;
public final static int FRAME_taunt12 = 245;
public final static int FRAME_taunt13 = 246;
public final static int FRAME_taunt14 = 247;
public final static int FRAME_taunt15 = 248;
public final static int FRAME_taunt16 = 249;
public final static int FRAME_taunt17 = 250;
public final static int FRAME_walk01 = 251;
public final static int FRAME_walk02 = 252;
public final static int FRAME_walk03 = 253;
public final static int FRAME_walk04 = 254;
public final static int FRAME_walk05 = 255;
public final static int FRAME_walk06 = 256;
public final static int FRAME_walk07 = 257;
public final static int FRAME_walk08 = 258;
public final static int FRAME_walk09 = 259;
public final static int FRAME_walk10 = 260;
public final static int FRAME_walk11 = 261;
public final static int FRAME_wave01 = 262;
public final static int FRAME_wave02 = 263;
public final static int FRAME_wave03 = 264;
public final static int FRAME_wave04 = 265;
public final static int FRAME_wave05 = 266;
public final static int FRAME_wave06 = 267;
public final static int FRAME_wave07 = 268;
public final static int FRAME_wave08 = 269;
public final static int FRAME_wave09 = 270;
public final static int FRAME_wave10 = 271;
public final static int FRAME_wave11 = 272;
public final static int FRAME_wave12 = 273;
public final static int FRAME_wave13 = 274;
public final static int FRAME_wave14 = 275;
public final static int FRAME_wave15 = 276;
public final static int FRAME_wave16 = 277;
public final static int FRAME_wave17 = 278;
public final static int FRAME_wave18 = 279;
public final static int FRAME_wave19 = 280;
public final static int FRAME_wave20 = 281;
public final static int FRAME_wave21 = 282;
public final static int FRAME_bl_atk01 = 283;
public final static int FRAME_bl_atk02 = 284;
public final static int FRAME_bl_atk03 = 285;
public final static int FRAME_bl_atk04 = 286;
public final static int FRAME_bl_atk05 = 287;
public final static int FRAME_bl_atk06 = 288;
public final static int FRAME_bl_flp01 = 289;
public final static int FRAME_bl_flp02 = 290;
public final static int FRAME_bl_flp13 = 291;
public final static int FRAME_bl_flp14 = 292;
public final static int FRAME_bl_flp15 = 293;
public final static int FRAME_bl_jmp01 = 294;
public final static int FRAME_bl_jmp02 = 295;
public final static int FRAME_bl_jmp03 = 296;
public final static int FRAME_bl_jmp04 = 297;
public final static int FRAME_bl_jmp05 = 298;
public final static int FRAME_bl_jmp06 = 299;
public final static int FRAME_bl_pn101 = 300;
public final static int FRAME_bl_pn102 = 301;
public final static int FRAME_bl_pn103 = 302;
public final static int FRAME_bl_pn201 = 303;
public final static int FRAME_bl_pn202 = 304;
public final static int FRAME_bl_pn203 = 305;
public final static int FRAME_bl_pn301 = 306;
public final static int FRAME_bl_pn302 = 307;
public final static int FRAME_bl_pn303 = 308;
public final static int FRAME_bl_psh08 = 309;
public final static int FRAME_bl_psh09 = 310;
public final static int FRAME_bl_run01 = 311;
public final static int FRAME_bl_run02 = 312;
public final static int FRAME_bl_run03 = 313;
public final static int FRAME_bl_run04 = 314;
public final static int FRAME_bl_run05 = 315;
public final static int FRAME_bl_run06 = 316;
public final static int FRAME_bl_run07 = 317;
public final static int FRAME_bl_run08 = 318;
public final static int FRAME_bl_run09 = 319;
public final static int FRAME_bl_run10 = 320;
public final static int FRAME_bl_run11 = 321;
public final static int FRAME_bl_run12 = 322;
public final static int FRAME_bl_rns03 = 323;
public final static int FRAME_bl_rns04 = 324;
public final static int FRAME_bl_rns05 = 325;
public final static int FRAME_bl_rns06 = 326;
public final static int FRAME_bl_rns07 = 327;
public final static int FRAME_bl_rns08 = 328;
public final static int FRAME_bl_rns09 = 329;
public final static int FRAME_bl_sal10 = 330;
public final static int FRAME_bl_sal11 = 331;
public final static int FRAME_bl_sal12 = 332;
public final static int FRAME_bl_std01 = 333;
public final static int FRAME_bl_std02 = 334;
public final static int FRAME_bl_std03 = 335;
public final static int FRAME_bl_std04 = 336;
public final static int FRAME_bl_std05 = 337;
public final static int FRAME_bl_std06 = 338;
public final static int FRAME_bl_std07 = 339;
public final static int FRAME_bl_std08 = 340;
public final static int FRAME_bl_std09 = 341;
public final static int FRAME_bl_std10 = 342;
public final static int FRAME_bl_std11 = 343;
public final static int FRAME_bl_std12 = 344;
public final static int FRAME_bl_std13 = 345;
public final static int FRAME_bl_std14 = 346;
public final static int FRAME_bl_std15 = 347;
public final static int FRAME_bl_std16 = 348;
public final static int FRAME_bl_std17 = 349;
public final static int FRAME_bl_std18 = 350;
public final static int FRAME_bl_std19 = 351;
public final static int FRAME_bl_std20 = 352;
public final static int FRAME_bl_std21 = 353;
public final static int FRAME_bl_std22 = 354;
public final static int FRAME_bl_std23 = 355;
public final static int FRAME_bl_std24 = 356;
public final static int FRAME_bl_std25 = 357;
public final static int FRAME_bl_std26 = 358;
public final static int FRAME_bl_std27 = 359;
public final static int FRAME_bl_std28 = 360;
public final static int FRAME_bl_std29 = 361;
public final static int FRAME_bl_std30 = 362;
public final static int FRAME_bl_std31 = 363;
public final static int FRAME_bl_std32 = 364;
public final static int FRAME_bl_std33 = 365;
public final static int FRAME_bl_std34 = 366;
public final static int FRAME_bl_std35 = 367;
public final static int FRAME_bl_std36 = 368;
public final static int FRAME_bl_std37 = 369;
public final static int FRAME_bl_std38 = 370;
public final static int FRAME_bl_std39 = 371;
public final static int FRAME_bl_std40 = 372;
public final static int FRAME_bl_swm01 = 373;
public final static int FRAME_bl_swm02 = 374;
public final static int FRAME_bl_swm03 = 375;
public final static int FRAME_bl_swm04 = 376;
public final static int FRAME_bl_swm05 = 377;
public final static int FRAME_bl_swm06 = 378;
public final static int FRAME_bl_swm07 = 379;
public final static int FRAME_bl_swm08 = 380;
public final static int FRAME_bl_swm09 = 381;
public final static int FRAME_bl_swm10 = 382;
public final static int FRAME_bl_swm11 = 383;
public final static int FRAME_bl_swm12 = 384;
public final static int FRAME_bl_swk01 = 385;
public final static int FRAME_bl_swk02 = 386;
public final static int FRAME_bl_swk03 = 387;
public final static int FRAME_bl_swk04 = 388;
public final static int FRAME_bl_swk05 = 389;
public final static int FRAME_bl_swk06 = 390;
public final static int FRAME_bl_swp01 = 391;
public final static int FRAME_bl_swp02 = 392;
public final static int FRAME_bl_swp03 = 393;
public final static int FRAME_bl_swp04 = 394;
public final static int FRAME_bl_swp05 = 395;
public final static int FRAME_bl_sws01 = 396;
public final static int FRAME_bl_sws02 = 397;
public final static int FRAME_bl_sws03 = 398;
public final static int FRAME_bl_sws04 = 399;
public final static int FRAME_bl_sws05 = 400;
public final static int FRAME_bl_sws06 = 401;
public final static int FRAME_bl_sws07 = 402;
public final static int FRAME_bl_sws08 = 403;
public final static int FRAME_bl_sws09 = 404;
public final static int FRAME_bl_sws10 = 405;
public final static int FRAME_bl_sws11 = 406;
public final static int FRAME_bl_sws12 = 407;
public final static int FRAME_bl_sws13 = 408;
public final static int FRAME_bl_sws14 = 409;
public final static int FRAME_bl_tau14 = 410;
public final static int FRAME_bl_tau15 = 411;
public final static int FRAME_bl_tau16 = 412;
public final static int FRAME_bl_tau17 = 413;
public final static int FRAME_bl_wlk01 = 414;
public final static int FRAME_bl_wlk02 = 415;
public final static int FRAME_bl_wlk03 = 416;
public final static int FRAME_bl_wlk04 = 417;
public final static int FRAME_bl_wlk05 = 418;
public final static int FRAME_bl_wlk06 = 419;
public final static int FRAME_bl_wlk07 = 420;
public final static int FRAME_bl_wlk08 = 421;
public final static int FRAME_bl_wlk09 = 422;
public final static int FRAME_bl_wlk10 = 423;
public final static int FRAME_bl_wlk11 = 424;
public final static int FRAME_bl_wav19 = 425;
public final static int FRAME_bl_wav20 = 426;
public final static int FRAME_bl_wav21 = 427;
public final static int FRAME_cr_atk01 = 428;
public final static int FRAME_cr_atk02 = 429;
public final static int FRAME_cr_atk03 = 430;
public final static int FRAME_cr_atk04 = 431;
public final static int FRAME_cr_atk05 = 432;
public final static int FRAME_cr_atk06 = 433;
public final static int FRAME_cr_atk07 = 434;
public final static int FRAME_cr_atk08 = 435;
public final static int FRAME_cr_pan01 = 436;
public final static int FRAME_cr_pan02 = 437;
public final static int FRAME_cr_pan03 = 438;
public final static int FRAME_cr_pan04 = 439;
public final static int FRAME_cr_std01 = 440;
public final static int FRAME_cr_std02 = 441;
public final static int FRAME_cr_std03 = 442;
public final static int FRAME_cr_std04 = 443;
public final static int FRAME_cr_std05 = 444;
public final static int FRAME_cr_std06 = 445;
public final static int FRAME_cr_std07 = 446;
public final static int FRAME_cr_std08 = 447;
public final static int FRAME_cr_wlk01 = 448;
public final static int FRAME_cr_wlk02 = 449;
public final static int FRAME_cr_wlk03 = 450;
public final static int FRAME_cr_wlk04 = 451;
public final static int FRAME_cr_wlk05 = 452;
public final static int FRAME_cr_wlk06 = 453;
public final static int FRAME_cr_wlk07 = 454;
public final static int FRAME_crbl_a01 = 455;
public final static int FRAME_crbl_a02 = 456;
public final static int FRAME_crbl_a03 = 457;
public final static int FRAME_crbl_a04 = 458;
public final static int FRAME_crbl_a05 = 459;
public final static int FRAME_crbl_a06 = 460;
public final static int FRAME_crbl_a07 = 461;
public final static int FRAME_crbl_p01 = 462;
public final static int FRAME_crbl_p02 = 463;
public final static int FRAME_crbl_p03 = 464;
public final static int FRAME_crbl_p04 = 465;
public final static int FRAME_crbl_s01 = 466;
public final static int FRAME_crbl_s02 = 467;
public final static int FRAME_crbl_s03 = 468;
public final static int FRAME_crbl_s04 = 469;
public final static int FRAME_crbl_s05 = 470;
public final static int FRAME_crbl_s06 = 471;
public final static int FRAME_crbl_s07 = 472;
public final static int FRAME_crbl_s08 = 473;
public final static int FRAME_crbl_w01 = 474;
public final static int FRAME_crbl_w02 = 475;
public final static int FRAME_crbl_w03 = 476;
public final static int FRAME_crbl_w04 = 477;
public final static int FRAME_crbl_w05 = 478;
public final static int FRAME_crbl_w06 = 479;
public final static int FRAME_crbl_w07 = 480;
public final static float MODEL_SCALE = 1.000000f;
public final static int MAX_ACTOR_NAMES = 8;
static String actor_names[] = { "Hellrot", "Tokay", "Killme", "Disruptor",
"Adrianator", "Rambear", "Titus", "Bitterman" };
static EntThinkAdapter actor_stand = new EntThinkAdapter() {
public String getID() { return "actor_stand";}
public boolean think(edict_t self) {
self.monsterinfo.currentmove = actor_move_stand;
// randomize on startup
if (GameBase.level.time < 1.0)
self.s.frame = self.monsterinfo.currentmove.firstframe
+ (Lib.rand() % (self.monsterinfo.currentmove.lastframe
- self.monsterinfo.currentmove.firstframe + 1));
return true;
}
};
static mframe_t actor_frames_stand[] = new mframe_t[] {
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null),
new mframe_t(GameAI.ai_stand, 0f, null) };
static mmove_t actor_move_stand = new mmove_t(FRAME_stand101,
FRAME_stand140, actor_frames_stand, null);
static mframe_t actor_frames_walk[] = {
new mframe_t(GameAI.ai_walk, 0, null),
new mframe_t(GameAI.ai_walk, 6, null),
new mframe_t(GameAI.ai_walk, 10, null),
new mframe_t(GameAI.ai_walk, 3, null),
new mframe_t(GameAI.ai_walk, 2, null),
new mframe_t(GameAI.ai_walk, 7, null),
new mframe_t(GameAI.ai_walk, 10, null),
new mframe_t(GameAI.ai_walk, 1, null),
new mframe_t(GameAI.ai_walk, 4, null),
new mframe_t(GameAI.ai_walk, 0, null),
new mframe_t(GameAI.ai_walk, 0, null) };
static mmove_t actor_move_walk = new mmove_t(FRAME_walk01, FRAME_walk08,
actor_frames_walk, null);
static EntThinkAdapter actor_walk = new EntThinkAdapter() {
public String getID() { return "actor_walk";}
public boolean think(edict_t self) {
self.monsterinfo.currentmove = actor_move_walk;
return true;
}
};
static mframe_t actor_frames_run[] = new mframe_t[] {
new mframe_t(GameAI.ai_run, 4, null),
new mframe_t(GameAI.ai_run, 15, null),
new mframe_t(GameAI.ai_run, 15, null),
new mframe_t(GameAI.ai_run, 8, null),
new mframe_t(GameAI.ai_run, 20, null),
new mframe_t(GameAI.ai_run, 15, null),
new mframe_t(GameAI.ai_run, 8, null),
new mframe_t(GameAI.ai_run, 17, null),
new mframe_t(GameAI.ai_run, 12, null),
new mframe_t(GameAI.ai_run, -2, null),
new mframe_t(GameAI.ai_run, -2, null),
new mframe_t(GameAI.ai_run, -1, null) };
static mmove_t actor_move_run = new mmove_t(FRAME_run02, FRAME_run07,
actor_frames_run, null);
static EntThinkAdapter actor_run = new EntThinkAdapter() {
public String getID() { return "actor_run";}
public boolean think(edict_t self) {
if ((GameBase.level.time < self.pain_debounce_time)
&& (self.enemy == null)) {
if (self.movetarget != null)
actor_walk.think(self);
else
actor_stand.think(self);
return true;
}
if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) {
actor_stand.think(self);
return true;
}
self.monsterinfo.currentmove = actor_move_run;
return true;
}
};
static mframe_t actor_frames_pain1[] = new mframe_t[] {
new mframe_t(GameAI.ai_move, -5, null),
new mframe_t(GameAI.ai_move, 4, null),
new mframe_t(GameAI.ai_move, 1, null) };
static mmove_t actor_move_pain1 = new mmove_t(FRAME_pain101, FRAME_pain103,
actor_frames_pain1, actor_run);
static mframe_t actor_frames_pain2[] = new mframe_t[] {
new mframe_t(GameAI.ai_move, -4, null),
new mframe_t(GameAI.ai_move, 4, null),
new mframe_t(GameAI.ai_move, 0, null) };
static mmove_t actor_move_pain2 = new mmove_t(FRAME_pain201, FRAME_pain203,
actor_frames_pain2, actor_run);
static mframe_t actor_frames_pain3[] = new mframe_t[] {
new mframe_t(GameAI.ai_move, -1, null),
new mframe_t(GameAI.ai_move, 1, null),
new mframe_t(GameAI.ai_move, 0, null) };
static mmove_t actor_move_pain3 = new mmove_t(FRAME_pain301, FRAME_pain303,
actor_frames_pain3, actor_run);
static mframe_t actor_frames_flipoff[] = new mframe_t[] {
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null) };
static mmove_t actor_move_flipoff = new mmove_t(FRAME_flip01, FRAME_flip14,
actor_frames_flipoff, actor_run);
static mframe_t actor_frames_taunt[] = new mframe_t[] {
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null),
new mframe_t(GameAI.ai_turn, 0, null) };
static mmove_t actor_move_taunt = new mmove_t(FRAME_taunt01, FRAME_taunt17,
actor_frames_taunt, actor_run);
static String messages[] = { "Watch it", "#$@*&", "Idiot",
"Check your targets" };
static EntPainAdapter actor_pain = new EntPainAdapter() {
public String getID() { return "actor_pain";}
public void pain(edict_t self, edict_t other, float kick, int damage) {
int n;
if (self.health < (self.max_health / 2))
self.s.skinnum = 1;
if (GameBase.level.time < self.pain_debounce_time)
return;
self.pain_debounce_time = GameBase.level.time + 3;
//GameBase.gi.sound (self, CHAN_VOICE, actor.sound_pain, 1,
// ATTN_NORM, 0);
if ((other.client != null) && (Lib.random() < 0.4)) {
float v[] = { 0, 0, 0 };
String name;
Math3D.VectorSubtract(other.s.origin, self.s.origin, v);
self.ideal_yaw = Math3D.vectoyaw(v);
if (Lib.random() < 0.5f)
self.monsterinfo.currentmove = actor_move_flipoff;
else
self.monsterinfo.currentmove = actor_move_taunt;
// FIXME: does the ent-id work out ?
name = actor_names[(self.index) % MAX_ACTOR_NAMES];
GameBase.gi.cprintf(other, Defines.PRINT_CHAT, name + ": "
+ messages[Lib.rand() % 3] + "!\n");
return;
}
n = Lib.rand() % 3;
if (n == 0)
self.monsterinfo.currentmove = actor_move_pain1;
else if (n == 1)
self.monsterinfo.currentmove = actor_move_pain2;
else
self.monsterinfo.currentmove = actor_move_pain3;
}
};
static EntThinkAdapter actor_dead = new EntThinkAdapter() {
public String getID() { return "actor_dead";}
public boolean think(edict_t self) {
Math3D.VectorSet(self.mins, -16, -16, -24);
Math3D.VectorSet(self.maxs, 16, 16, -8);
self.movetype = Defines.MOVETYPE_TOSS;
self.svflags |= Defines.SVF_DEADMONSTER;
self.nextthink = 0;
GameBase.gi.linkentity(self);
return true;
}
};
static mframe_t actor_frames_death1[] = new mframe_t[] {
new mframe_t(GameAI.ai_move, 0, null),
new mframe_t(GameAI.ai_move, 0, null),
new mframe_t(GameAI.ai_move, -13, null),
new mframe_t(GameAI.ai_move, 14, null),
new mframe_t(GameAI.ai_move, 3, null),
new mframe_t(GameAI.ai_move, -2, null),
new mframe_t(GameAI.ai_move, 1, null) };
static mmove_t actor_move_death1 = new mmove_t(FRAME_death101,
FRAME_death107, actor_frames_death1, actor_dead);
static mframe_t actor_frames_death2[] = new mframe_t[] {
new mframe_t(GameAI.ai_move, 0, null),
new mframe_t(GameAI.ai_move, 7, null),
new mframe_t(GameAI.ai_move, -6, null),
new mframe_t(GameAI.ai_move, -5, null),
new mframe_t(GameAI.ai_move, 1, null),
new mframe_t(GameAI.ai_move, 0, null),
new mframe_t(GameAI.ai_move, -1, null),
new mframe_t(GameAI.ai_move, -2, null),
new mframe_t(GameAI.ai_move, -1, null),
new mframe_t(GameAI.ai_move, -9, null),
new mframe_t(GameAI.ai_move, -13, null),
new mframe_t(GameAI.ai_move, -13, null),
new mframe_t(GameAI.ai_move, 0, null) };
static mmove_t actor_move_death2 = new mmove_t(FRAME_death201,
FRAME_death213, actor_frames_death2, actor_dead);
static EntDieAdapter actor_die = new EntDieAdapter() {
public String getID() { return "actor_die";}
public void die(edict_t self, edict_t inflictor, edict_t attacker,
int damage, float[] point) {
int n;
// check for gib
if (self.health <= -80) {
// gi.sound (self, CHAN_VOICE, actor.sound_gib, 1, ATTN_NORM,
// 0);
for (n = 0; n < 2; n++)
GameMisc.ThrowGib(self, "models/objects/gibs/bone/tris.md2",
damage, Defines.GIB_ORGANIC);
for (n = 0; n < 4; n++)
GameMisc.ThrowGib(self,
"models/objects/gibs/sm_meat/tris.md2", damage,
Defines.GIB_ORGANIC);
GameMisc.ThrowHead(self, "models/objects/gibs/head2/tris.md2",
damage, Defines.GIB_ORGANIC);
self.deadflag = Defines.DEAD_DEAD;
return;
}
if (self.deadflag == Defines.DEAD_DEAD)
return;
// regular death
// gi.sound (self, CHAN_VOICE, actor.sound_die, 1, ATTN_NORM, 0);
self.deadflag = Defines.DEAD_DEAD;
self.takedamage = Defines.DAMAGE_YES;
n = Lib.rand() % 2;
if (n == 0)
self.monsterinfo.currentmove = actor_move_death1;
else
self.monsterinfo.currentmove = actor_move_death2;
}
};
static EntThinkAdapter actor_fire = new EntThinkAdapter() {
public String getID() { return "actor_fire";}
public boolean think(edict_t self) {
actorMachineGun(self);
if (GameBase.level.time >= self.monsterinfo.pausetime)
self.monsterinfo.aiflags &= ~Defines.AI_HOLD_FRAME;
else
self.monsterinfo.aiflags |= Defines.AI_HOLD_FRAME;
return true;
}
};
static mframe_t actor_frames_attack[] = new mframe_t[] {
new mframe_t(GameAI.ai_charge, -2, actor_fire),
new mframe_t(GameAI.ai_charge, -2, null),
new mframe_t(GameAI.ai_charge, 3, null),
new mframe_t(GameAI.ai_charge, 2, null) };
static mmove_t actor_move_attack = new mmove_t(FRAME_attak01,
FRAME_attak04, actor_frames_attack, actor_run);
static EntThinkAdapter actor_attack = new EntThinkAdapter() {
public String getID() { return "actor_attack";}
public boolean think(edict_t self) {
int n;
self.monsterinfo.currentmove = actor_move_attack;
n = (Lib.rand() & 15) + 3 + 7;
self.monsterinfo.pausetime = GameBase.level.time + n
* Defines.FRAMETIME;
return true;
}
};
static EntUseAdapter actor_use = new EntUseAdapter() {
public String getID() { return "actor_use";}
public void use(edict_t self, edict_t other, edict_t activator) {
float v[] = { 0, 0, 0 };
self.goalentity = self.movetarget = GameBase
.G_PickTarget(self.target);
if ((null == self.movetarget)
|| (Lib.strcmp(self.movetarget.classname, "target_actor") != 0)) {
GameBase.gi
.dprintf(self.classname + " has bad target "
+ self.target + " at "
+ Lib.vtos(self.s.origin) + "\n");
self.target = null;
self.monsterinfo.pausetime = 100000000;
self.monsterinfo.stand.think(self);
return;
}
Math3D.VectorSubtract(self.goalentity.s.origin, self.s.origin, v);
self.ideal_yaw = self.s.angles[Defines.YAW] = Math3D.vectoyaw(v);
self.monsterinfo.walk.think(self);
self.target = null;
}
};
/*
* QUAKED target_actor (.5 .3 0) (-8 -8 -8) (8 8 8) JUMP SHOOT ATTACK x HOLD
* BRUTAL JUMP jump in set direction upon reaching this target SHOOT take a
* single shot at the pathtarget ATTACK attack pathtarget until it or actor
* is dead
*
* "target" next target_actor "pathtarget" target of any action to be taken
* at this point "wait" amount of time actor should pause at this point
* "message" actor will "say" this to the player
*
* for JUMP only: "speed" speed thrown forward (default 200) "height" speed
* thrown upwards (default 200)
*/
static EntTouchAdapter target_actor_touch = new EntTouchAdapter() {
public String getID() { return "target_actor_touch";}
public void touch(edict_t self, edict_t other, cplane_t plane,
csurface_t surf) {
float v[] = { 0, 0, 0 };
if (other.movetarget != self)
return;
if (other.enemy != null)
return;
other.goalentity = other.movetarget = null;
if (self.message != null) {
int n;
edict_t ent;
for (n = 1; n <= GameBase.game.maxclients; n++) {
ent = GameBase.g_edicts[n];
if (!ent.inuse)
continue;
GameBase.gi.cprintf(ent, Defines.PRINT_CHAT,
actor_names[(other.index) % MAX_ACTOR_NAMES] + ": "
+ self.message + "\n");
}
}
if ((self.spawnflags & 1) != 0) //jump
{
other.velocity[0] = self.movedir[0] * self.speed;
other.velocity[1] = self.movedir[1] * self.speed;
if (other.groundentity != null) {
other.groundentity = null;
other.velocity[2] = self.movedir[2];
GameBase.gi.sound(other, Defines.CHAN_VOICE, GameBase.gi
.soundindex("player/male/jump1.wav"), 1,
Defines.ATTN_NORM, 0);
}
}
if ((self.spawnflags & 2) != 0) //shoot
{
} else if ((self.spawnflags & 4) != 0) //attack
{
other.enemy = GameBase.G_PickTarget(self.pathtarget);
if (other.enemy != null) {
other.goalentity = other.enemy;
if ((self.spawnflags & 32) != 0)
other.monsterinfo.aiflags |= Defines.AI_BRUTAL;
if ((self.spawnflags & 16) != 0) {
other.monsterinfo.aiflags |= Defines.AI_STAND_GROUND;
actor_stand.think(other);
} else {
actor_run.think(other);
}
}
}
if (0 != (self.spawnflags & 6) && (self.pathtarget != null)) {
String savetarget;
savetarget = self.target;
self.target = self.pathtarget;
GameUtil.G_UseTargets(self, other);
self.target = savetarget;
}
other.movetarget = GameBase.G_PickTarget(self.target);
if (other.goalentity == null)
other.goalentity = other.movetarget;
if (null == other.movetarget && null == other.enemy) {
other.monsterinfo.pausetime = GameBase.level.time + 100000000;
other.monsterinfo.stand.think(other);
} else if (other.movetarget == other.goalentity) {
Math3D.VectorSubtract(other.movetarget.s.origin,
other.s.origin, v);
other.ideal_yaw = Math3D.vectoyaw(v);
}
}
};
static void actorMachineGun(edict_t self) {
float start[] = { 0, 0, 0 }, target[] = { 0, 0, 0 };
float forward[] = { 0, 0, 0 }, right[] = { 0, 0, 0 };
Math3D.AngleVectors(self.s.angles, forward, right, null);
Math3D.G_ProjectSource(self.s.origin,
M_Flash.monster_flash_offset[Defines.MZ2_ACTOR_MACHINEGUN_1],
forward, right, start);
if (self.enemy != null) {
if (self.enemy.health > 0) {
Math3D.VectorMA(self.enemy.s.origin, -0.2f,
self.enemy.velocity, target);
target[2] += self.enemy.viewheight;
} else {
Math3D.VectorCopy(self.enemy.absmin, target);
target[2] += (self.enemy.size[2] / 2);
}
Math3D.VectorSubtract(target, start, forward);
Math3D.VectorNormalize(forward);
} else {
Math3D.AngleVectors(self.s.angles, forward, null, null);
}
Monster.monster_fire_bullet(self, start, forward, 3, 4,
Defines.DEFAULT_BULLET_HSPREAD, Defines.DEFAULT_BULLET_VSPREAD,
Defines.MZ2_ACTOR_MACHINEGUN_1);
}
/**
* QUAKED misc_actor (1 .5 0) (-16 -16 -24) (16 16 32)
*/
public static void SP_misc_actor(edict_t self) {
if (GameBase.deathmatch.value != 0) {
GameUtil.G_FreeEdict(self);
return;
}
if (self.targetname != null) {
GameBase.gi.dprintf("untargeted " + self.classname + " at "
+ Lib.vtos(self.s.origin) + "\n");
GameUtil.G_FreeEdict(self);
return;
}
if (self.target != null) {
GameBase.gi.dprintf(self.classname + " with no target at "
+ Lib.vtos(self.s.origin) + "\n");
GameUtil.G_FreeEdict(self);
return;
}
self.movetype = Defines.MOVETYPE_STEP;
self.solid = Defines.SOLID_BBOX;
self.s.modelindex = GameBase.gi.modelindex("players/male/tris.md2");
Math3D.VectorSet(self.mins, -16, -16, -24);
Math3D.VectorSet(self.maxs, 16, 16, 32);
if (0 == self.health)
self.health = 100;
self.mass = 200;
self.pain = actor_pain;
self.die = actor_die;
self.monsterinfo.stand = actor_stand;
self.monsterinfo.walk = actor_walk;
self.monsterinfo.run = actor_run;
self.monsterinfo.attack = actor_attack;
self.monsterinfo.melee = null;
self.monsterinfo.sight = null;
self.monsterinfo.aiflags |= Defines.AI_GOOD_GUY;
GameBase.gi.linkentity(self);
self.monsterinfo.currentmove = actor_move_stand;
self.monsterinfo.scale = MODEL_SCALE;
GameAI.walkmonster_start.think(self);
// actors always start in a dormant state, they *must* be used to get
// going
self.use = actor_use;
}
public static void SP_target_actor(edict_t self) {
if (self.targetname != null)
GameBase.gi.dprintf(self.classname + " with no targetname at "
+ Lib.vtos(self.s.origin) + " \n");
self.solid = Defines.SOLID_TRIGGER;
self.touch = target_actor_touch;
Math3D.VectorSet(self.mins, -8, -8, -8);
Math3D.VectorSet(self.maxs, 8, 8, 8);
self.svflags = Defines.SVF_NOCLIENT;
if ((self.spawnflags & 1) != 0) {
if (0 == self.speed)
self.speed = 200;
if (0 == GameBase.st.height)
GameBase.st.height = 200;
if (self.s.angles[Defines.YAW] == 0)
self.s.angles[Defines.YAW] = 360;
GameBase.G_SetMovedir(self.s.angles, self.movedir);
self.movedir[2] = GameBase.st.height;
}
GameBase.gi.linkentity(self);
}
}
|