quake2ts 0.0.282 → 0.0.283
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/client/dist/browser/index.global.js +13 -13
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/game/dist/browser/index.global.js +3 -3
- package/packages/game/dist/browser/index.global.js.map +1 -1
- package/packages/game/dist/cjs/index.cjs +427 -0
- package/packages/game/dist/cjs/index.cjs.map +1 -1
- package/packages/game/dist/esm/index.js +427 -0
- package/packages/game/dist/esm/index.js.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/game/dist/types/entities/index.d.ts +1 -1
- package/packages/game/dist/types/entities/index.d.ts.map +1 -1
- package/packages/game/dist/types/entities/monsters/arachnid.d.ts +5 -0
- package/packages/game/dist/types/entities/monsters/arachnid.d.ts.map +1 -0
- package/packages/game/dist/types/entities/monsters/common.d.ts +8 -1
- package/packages/game/dist/types/entities/monsters/common.d.ts.map +1 -1
- package/packages/game/dist/types/entities/monsters/index.d.ts.map +1 -1
|
@@ -16335,6 +16335,432 @@ function registerFixbotSpawns(registry) {
|
|
|
16335
16335
|
registry.register("monster_fixbot", SP_monster_fixbot);
|
|
16336
16336
|
}
|
|
16337
16337
|
|
|
16338
|
+
// src/entities/monsters/arachnid.ts
|
|
16339
|
+
init_esm();
|
|
16340
|
+
|
|
16341
|
+
// src/entities/monsters/common.ts
|
|
16342
|
+
init_esm();
|
|
16343
|
+
var MONSTER_TICK26 = 0.1;
|
|
16344
|
+
function generic_ai_stand(self, dist, context) {
|
|
16345
|
+
ai_stand(self, MONSTER_TICK26, context);
|
|
16346
|
+
}
|
|
16347
|
+
function generic_ai_walk(self, dist, context) {
|
|
16348
|
+
ai_walk(self, dist, MONSTER_TICK26, context);
|
|
16349
|
+
}
|
|
16350
|
+
function generic_ai_run(self, dist, context) {
|
|
16351
|
+
ai_run(self, dist, MONSTER_TICK26, context);
|
|
16352
|
+
}
|
|
16353
|
+
var generic_stand_frames = Array.from({ length: 1 }, () => ({
|
|
16354
|
+
ai: generic_ai_stand,
|
|
16355
|
+
dist: 0
|
|
16356
|
+
}));
|
|
16357
|
+
var generic_walk_frames = Array.from({ length: 1 }, () => ({
|
|
16358
|
+
ai: generic_ai_walk,
|
|
16359
|
+
dist: 5
|
|
16360
|
+
}));
|
|
16361
|
+
var generic_run_frames = Array.from({ length: 1 }, () => ({
|
|
16362
|
+
ai: generic_ai_run,
|
|
16363
|
+
dist: 10
|
|
16364
|
+
}));
|
|
16365
|
+
function M_SetAnimation3(self, move, context) {
|
|
16366
|
+
self.monsterinfo.current_move = move;
|
|
16367
|
+
}
|
|
16368
|
+
function M_ShouldReactToPain(self) {
|
|
16369
|
+
return true;
|
|
16370
|
+
}
|
|
16371
|
+
function M_CheckGib(self, context) {
|
|
16372
|
+
const gibHealth = self.gib_health ?? -40;
|
|
16373
|
+
return self.health < gibHealth;
|
|
16374
|
+
}
|
|
16375
|
+
function M_AllowSpawn(self, context) {
|
|
16376
|
+
return true;
|
|
16377
|
+
}
|
|
16378
|
+
function walkmonster_start(self, context) {
|
|
16379
|
+
self.think = monster_think;
|
|
16380
|
+
self.nextthink = context.timeSeconds + MONSTER_TICK26;
|
|
16381
|
+
}
|
|
16382
|
+
function M_ProjectFlashSource(self, offset, forward, right) {
|
|
16383
|
+
const start = addVec3(self.origin, scaleVec3(forward, offset.x));
|
|
16384
|
+
const start2 = addVec3(start, scaleVec3(right, offset.y));
|
|
16385
|
+
const start3 = addVec3(start2, { x: 0, y: 0, z: offset.z });
|
|
16386
|
+
return start3;
|
|
16387
|
+
}
|
|
16388
|
+
|
|
16389
|
+
// src/entities/monsters/arachnid.ts
|
|
16390
|
+
var FRAME_rails1 = 0;
|
|
16391
|
+
var FRAME_rails4 = 3;
|
|
16392
|
+
var FRAME_rails8 = 7;
|
|
16393
|
+
var FRAME_rails11 = 10;
|
|
16394
|
+
var FRAME_death1 = 11;
|
|
16395
|
+
var FRAME_death20 = 30;
|
|
16396
|
+
var FRAME_melee_atk1 = 31;
|
|
16397
|
+
var FRAME_melee_atk12 = 42;
|
|
16398
|
+
var FRAME_pain11 = 43;
|
|
16399
|
+
var FRAME_pain15 = 47;
|
|
16400
|
+
var FRAME_idle1 = 48;
|
|
16401
|
+
var FRAME_idle13 = 60;
|
|
16402
|
+
var FRAME_walk12 = 61;
|
|
16403
|
+
var FRAME_walk10 = 70;
|
|
16404
|
+
var FRAME_pain21 = 76;
|
|
16405
|
+
var FRAME_pain26 = 81;
|
|
16406
|
+
var FRAME_rails_up1 = 98;
|
|
16407
|
+
var FRAME_rails_up7 = 104;
|
|
16408
|
+
var FRAME_rails_up11 = 108;
|
|
16409
|
+
var FRAME_rails_up16 = 113;
|
|
16410
|
+
var MODEL_SCALE = 1;
|
|
16411
|
+
var MELEE_DISTANCE5 = 64;
|
|
16412
|
+
var MONSTER_TICK27 = 0.1;
|
|
16413
|
+
var CHAN_WEAPON = 1;
|
|
16414
|
+
var CHAN_VOICE = 2;
|
|
16415
|
+
var CHAN_BODY = 4;
|
|
16416
|
+
var ATTN_NORM2 = 1;
|
|
16417
|
+
var ATTN_IDLE = 2;
|
|
16418
|
+
var MZ2_ARACHNID_RAIL1 = 20;
|
|
16419
|
+
var MZ2_ARACHNID_RAIL2 = 21;
|
|
16420
|
+
var MZ2_ARACHNID_RAIL_UP1 = 22;
|
|
16421
|
+
var MZ2_ARACHNID_RAIL_UP2 = 23;
|
|
16422
|
+
var sound_pain;
|
|
16423
|
+
var sound_death;
|
|
16424
|
+
var sound_sight;
|
|
16425
|
+
var sound_step;
|
|
16426
|
+
var sound_charge;
|
|
16427
|
+
var sound_melee;
|
|
16428
|
+
var sound_melee_hit;
|
|
16429
|
+
function monster_ai_stand23(self, dist, context) {
|
|
16430
|
+
ai_stand(self, MONSTER_TICK27, context);
|
|
16431
|
+
}
|
|
16432
|
+
function monster_ai_walk22(self, dist, context) {
|
|
16433
|
+
ai_walk(self, dist, MONSTER_TICK27, context);
|
|
16434
|
+
}
|
|
16435
|
+
function monster_ai_run23(self, dist, context) {
|
|
16436
|
+
ai_run(self, dist, MONSTER_TICK27, context);
|
|
16437
|
+
}
|
|
16438
|
+
function monster_ai_charge24(self, dist, context) {
|
|
16439
|
+
ai_charge(self, dist, MONSTER_TICK27, context);
|
|
16440
|
+
}
|
|
16441
|
+
function monster_ai_move23(self, dist, context) {
|
|
16442
|
+
ai_move(self, dist);
|
|
16443
|
+
}
|
|
16444
|
+
var arachnid_frames_stand = [
|
|
16445
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16446
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16447
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16448
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16449
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16450
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16451
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16452
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16453
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16454
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16455
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16456
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16457
|
+
{ ai: monster_ai_stand23, dist: 0 }
|
|
16458
|
+
];
|
|
16459
|
+
var arachnid_move_stand = {
|
|
16460
|
+
firstframe: FRAME_idle1,
|
|
16461
|
+
lastframe: FRAME_idle13,
|
|
16462
|
+
frames: arachnid_frames_stand,
|
|
16463
|
+
endfunc: null
|
|
16464
|
+
};
|
|
16465
|
+
function arachnid_stand(self, context) {
|
|
16466
|
+
M_SetAnimation3(self, arachnid_move_stand, context);
|
|
16467
|
+
}
|
|
16468
|
+
function arachnid_footstep(self, context) {
|
|
16469
|
+
context.engine.sound?.(self, CHAN_BODY, sound_step, 0.5, ATTN_IDLE, 0);
|
|
16470
|
+
}
|
|
16471
|
+
var arachnid_frames_walk = [
|
|
16472
|
+
{ ai: monster_ai_walk22, dist: 8, think: arachnid_footstep },
|
|
16473
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16474
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16475
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16476
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16477
|
+
{ ai: monster_ai_walk22, dist: 8, think: arachnid_footstep },
|
|
16478
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16479
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16480
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16481
|
+
{ ai: monster_ai_walk22, dist: 8 }
|
|
16482
|
+
];
|
|
16483
|
+
var arachnid_move_walk = {
|
|
16484
|
+
firstframe: FRAME_walk12,
|
|
16485
|
+
lastframe: FRAME_walk10,
|
|
16486
|
+
frames: arachnid_frames_walk,
|
|
16487
|
+
endfunc: null
|
|
16488
|
+
};
|
|
16489
|
+
function arachnid_walk(self, context) {
|
|
16490
|
+
M_SetAnimation3(self, arachnid_move_walk, context);
|
|
16491
|
+
}
|
|
16492
|
+
var arachnid_frames_run = [
|
|
16493
|
+
{ ai: monster_ai_run23, dist: 8, think: arachnid_footstep },
|
|
16494
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16495
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16496
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16497
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16498
|
+
{ ai: monster_ai_run23, dist: 8, think: arachnid_footstep },
|
|
16499
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16500
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16501
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16502
|
+
{ ai: monster_ai_run23, dist: 8 }
|
|
16503
|
+
];
|
|
16504
|
+
var arachnid_move_run = {
|
|
16505
|
+
firstframe: FRAME_walk12,
|
|
16506
|
+
lastframe: FRAME_walk10,
|
|
16507
|
+
frames: arachnid_frames_run,
|
|
16508
|
+
endfunc: null
|
|
16509
|
+
};
|
|
16510
|
+
function arachnid_run(self, context) {
|
|
16511
|
+
M_SetAnimation3(self, arachnid_move_run, context);
|
|
16512
|
+
}
|
|
16513
|
+
var arachnid_frames_pain1 = [
|
|
16514
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16515
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16516
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16517
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16518
|
+
{ ai: monster_ai_move23, dist: 0 }
|
|
16519
|
+
];
|
|
16520
|
+
var arachnid_move_pain1 = {
|
|
16521
|
+
firstframe: FRAME_pain11,
|
|
16522
|
+
lastframe: FRAME_pain15,
|
|
16523
|
+
frames: arachnid_frames_pain1,
|
|
16524
|
+
endfunc: arachnid_run
|
|
16525
|
+
};
|
|
16526
|
+
var arachnid_frames_pain2 = [
|
|
16527
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16528
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16529
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16530
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16531
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16532
|
+
{ ai: monster_ai_move23, dist: 0 }
|
|
16533
|
+
];
|
|
16534
|
+
var arachnid_move_pain2 = {
|
|
16535
|
+
firstframe: FRAME_pain21,
|
|
16536
|
+
lastframe: FRAME_pain26,
|
|
16537
|
+
frames: arachnid_frames_pain2,
|
|
16538
|
+
endfunc: arachnid_run
|
|
16539
|
+
};
|
|
16540
|
+
function arachnid_pain(self, other, kick, damage, context) {
|
|
16541
|
+
if (self.health < self.max_health / 2) {
|
|
16542
|
+
self.skin = 1;
|
|
16543
|
+
}
|
|
16544
|
+
if (context.timeSeconds < self.pain_debounce_time) {
|
|
16545
|
+
return;
|
|
16546
|
+
}
|
|
16547
|
+
self.pain_debounce_time = context.timeSeconds + 3;
|
|
16548
|
+
context.engine.sound?.(self, CHAN_VOICE, sound_pain, 1, ATTN_NORM2, 0);
|
|
16549
|
+
if (!M_ShouldReactToPain(self)) {
|
|
16550
|
+
return;
|
|
16551
|
+
}
|
|
16552
|
+
if (Math.random() < 0.5) {
|
|
16553
|
+
M_SetAnimation3(self, arachnid_move_pain1, context);
|
|
16554
|
+
} else {
|
|
16555
|
+
M_SetAnimation3(self, arachnid_move_pain2, context);
|
|
16556
|
+
}
|
|
16557
|
+
}
|
|
16558
|
+
function arachnid_charge_rail(self, context) {
|
|
16559
|
+
if (!self.enemy || !self.enemy.inUse) {
|
|
16560
|
+
return;
|
|
16561
|
+
}
|
|
16562
|
+
context.engine.sound?.(self, CHAN_WEAPON, sound_charge, 1, ATTN_NORM2, 0);
|
|
16563
|
+
self.pos1 = { ...self.enemy.origin };
|
|
16564
|
+
self.pos1 = { ...self.pos1, z: self.pos1.z + self.enemy.viewheight };
|
|
16565
|
+
}
|
|
16566
|
+
function arachnid_rail(self, context) {
|
|
16567
|
+
let id;
|
|
16568
|
+
switch (self.frame) {
|
|
16569
|
+
case FRAME_rails4:
|
|
16570
|
+
default:
|
|
16571
|
+
id = MZ2_ARACHNID_RAIL1;
|
|
16572
|
+
break;
|
|
16573
|
+
case FRAME_rails8:
|
|
16574
|
+
id = MZ2_ARACHNID_RAIL2;
|
|
16575
|
+
break;
|
|
16576
|
+
case FRAME_rails_up7:
|
|
16577
|
+
id = MZ2_ARACHNID_RAIL_UP1;
|
|
16578
|
+
break;
|
|
16579
|
+
case FRAME_rails_up11:
|
|
16580
|
+
id = MZ2_ARACHNID_RAIL_UP2;
|
|
16581
|
+
break;
|
|
16582
|
+
}
|
|
16583
|
+
const { forward, right } = angleVectors(self.angles);
|
|
16584
|
+
const start = M_ProjectFlashSource(self, { x: 0, y: 0, z: 0 }, forward, right);
|
|
16585
|
+
const dir = subtractVec3(self.pos1, start);
|
|
16586
|
+
normalizeVec3(dir);
|
|
16587
|
+
monster_fire_railgun(self, start, dir, 35, 100, id, context);
|
|
16588
|
+
}
|
|
16589
|
+
var arachnid_frames_attack1 = [
|
|
16590
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_charge_rail },
|
|
16591
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16592
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16593
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_rail },
|
|
16594
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_charge_rail },
|
|
16595
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16596
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16597
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_rail },
|
|
16598
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16599
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16600
|
+
{ ai: monster_ai_charge24, dist: 0 }
|
|
16601
|
+
];
|
|
16602
|
+
var arachnid_attack1 = {
|
|
16603
|
+
firstframe: FRAME_rails1,
|
|
16604
|
+
lastframe: FRAME_rails11,
|
|
16605
|
+
frames: arachnid_frames_attack1,
|
|
16606
|
+
endfunc: arachnid_run
|
|
16607
|
+
};
|
|
16608
|
+
var arachnid_frames_attack_up1 = [
|
|
16609
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16610
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16611
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16612
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_charge_rail },
|
|
16613
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16614
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16615
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_rail },
|
|
16616
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_charge_rail },
|
|
16617
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16618
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16619
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_rail },
|
|
16620
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16621
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16622
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16623
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16624
|
+
{ ai: monster_ai_charge24, dist: 0 }
|
|
16625
|
+
];
|
|
16626
|
+
var arachnid_attack_up1 = {
|
|
16627
|
+
firstframe: FRAME_rails_up1,
|
|
16628
|
+
lastframe: FRAME_rails_up16,
|
|
16629
|
+
frames: arachnid_frames_attack_up1,
|
|
16630
|
+
endfunc: arachnid_run
|
|
16631
|
+
};
|
|
16632
|
+
function arachnid_melee_charge(self, context) {
|
|
16633
|
+
context.engine.sound?.(self, CHAN_WEAPON, sound_melee, 1, ATTN_NORM2, 0);
|
|
16634
|
+
}
|
|
16635
|
+
function arachnid_melee_hit(self, context) {
|
|
16636
|
+
if (!monster_fire_hit(self, { x: MELEE_DISTANCE5, y: 0, z: 0 }, 15, 50, context)) {
|
|
16637
|
+
}
|
|
16638
|
+
}
|
|
16639
|
+
var arachnid_frames_melee = [
|
|
16640
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16641
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16642
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16643
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_melee_charge },
|
|
16644
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16645
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_melee_hit },
|
|
16646
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16647
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16648
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_melee_charge },
|
|
16649
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16650
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_melee_hit },
|
|
16651
|
+
{ ai: monster_ai_charge24, dist: 0 }
|
|
16652
|
+
];
|
|
16653
|
+
var arachnid_melee = {
|
|
16654
|
+
firstframe: FRAME_melee_atk1,
|
|
16655
|
+
lastframe: FRAME_melee_atk12,
|
|
16656
|
+
frames: arachnid_frames_melee,
|
|
16657
|
+
endfunc: arachnid_run
|
|
16658
|
+
};
|
|
16659
|
+
function arachnid_attack(self, context) {
|
|
16660
|
+
if (!self.enemy || !self.enemy.inUse) {
|
|
16661
|
+
return;
|
|
16662
|
+
}
|
|
16663
|
+
const range = rangeTo(self, self.enemy);
|
|
16664
|
+
if (range < MELEE_DISTANCE5) {
|
|
16665
|
+
M_SetAnimation3(self, arachnid_melee, context);
|
|
16666
|
+
} else if (self.enemy.origin.z - self.origin.z > 150) {
|
|
16667
|
+
M_SetAnimation3(self, arachnid_attack_up1, context);
|
|
16668
|
+
} else {
|
|
16669
|
+
M_SetAnimation3(self, arachnid_attack1, context);
|
|
16670
|
+
}
|
|
16671
|
+
}
|
|
16672
|
+
function arachnid_dead(self, context) {
|
|
16673
|
+
self.mins = { x: -16, y: -16, z: -24 };
|
|
16674
|
+
self.maxs = { x: 16, y: 16, z: -8 };
|
|
16675
|
+
self.movetype = 7 /* Toss */;
|
|
16676
|
+
self.svflags |= 536870912;
|
|
16677
|
+
self.nextthink = 0;
|
|
16678
|
+
context.linkentity(self);
|
|
16679
|
+
}
|
|
16680
|
+
var arachnid_frames_death1 = [
|
|
16681
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16682
|
+
{ ai: monster_ai_move23, dist: -1.23 },
|
|
16683
|
+
{ ai: monster_ai_move23, dist: -1.23 },
|
|
16684
|
+
{ ai: monster_ai_move23, dist: -1.23 },
|
|
16685
|
+
{ ai: monster_ai_move23, dist: -1.23 },
|
|
16686
|
+
{ ai: monster_ai_move23, dist: -1.64 },
|
|
16687
|
+
{ ai: monster_ai_move23, dist: -1.64 },
|
|
16688
|
+
{ ai: monster_ai_move23, dist: -2.45 },
|
|
16689
|
+
{ ai: monster_ai_move23, dist: -8.63 },
|
|
16690
|
+
{ ai: monster_ai_move23, dist: -4 },
|
|
16691
|
+
{ ai: monster_ai_move23, dist: -4.5 },
|
|
16692
|
+
{ ai: monster_ai_move23, dist: -6.8 },
|
|
16693
|
+
{ ai: monster_ai_move23, dist: -8 },
|
|
16694
|
+
{ ai: monster_ai_move23, dist: -5.4 },
|
|
16695
|
+
{ ai: monster_ai_move23, dist: -3.4 },
|
|
16696
|
+
{ ai: monster_ai_move23, dist: -1.9 },
|
|
16697
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16698
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16699
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16700
|
+
{ ai: monster_ai_move23, dist: 0 }
|
|
16701
|
+
];
|
|
16702
|
+
var arachnid_move_death = {
|
|
16703
|
+
firstframe: FRAME_death1,
|
|
16704
|
+
lastframe: FRAME_death20,
|
|
16705
|
+
frames: arachnid_frames_death1,
|
|
16706
|
+
endfunc: arachnid_dead
|
|
16707
|
+
};
|
|
16708
|
+
function arachnid_die(self, inflictor, attacker, damage, point, mod, context) {
|
|
16709
|
+
if (M_CheckGib(self, context)) {
|
|
16710
|
+
context.engine.sound?.(self, CHAN_VOICE, "misc/udeath.wav", 1, ATTN_NORM2, 0);
|
|
16711
|
+
throwGibs(context, self.origin, damage);
|
|
16712
|
+
self.deadflag = 2 /* Dead */;
|
|
16713
|
+
return;
|
|
16714
|
+
}
|
|
16715
|
+
if (self.deadflag === 2 /* Dead */) {
|
|
16716
|
+
return;
|
|
16717
|
+
}
|
|
16718
|
+
context.engine.sound?.(self, CHAN_VOICE, sound_death, 1, ATTN_NORM2, 0);
|
|
16719
|
+
self.deadflag = 2 /* Dead */;
|
|
16720
|
+
self.takedamage = true;
|
|
16721
|
+
M_SetAnimation3(self, arachnid_move_death, context);
|
|
16722
|
+
}
|
|
16723
|
+
function SP_monster_arachnid(self, context) {
|
|
16724
|
+
if (!M_AllowSpawn(self, context)) {
|
|
16725
|
+
context.free(self);
|
|
16726
|
+
return;
|
|
16727
|
+
}
|
|
16728
|
+
self.classname = "monster_arachnid";
|
|
16729
|
+
sound_step = "insane/insane11.wav";
|
|
16730
|
+
sound_charge = "gladiator/railgun.wav";
|
|
16731
|
+
sound_melee = "gladiator/melee3.wav";
|
|
16732
|
+
sound_melee_hit = "gladiator/melee2.wav";
|
|
16733
|
+
sound_pain = "arachnid/pain.wav";
|
|
16734
|
+
sound_death = "arachnid/death.wav";
|
|
16735
|
+
sound_sight = "arachnid/sight.wav";
|
|
16736
|
+
self.model = "models/monsters/arachnid/tris.md2";
|
|
16737
|
+
self.mins = { x: -48, y: -48, z: -20 };
|
|
16738
|
+
self.maxs = { x: 48, y: 48, z: 48 };
|
|
16739
|
+
self.movetype = 5 /* Step */;
|
|
16740
|
+
self.solid = 2 /* BoundingBox */;
|
|
16741
|
+
self.health = 1e3;
|
|
16742
|
+
self.max_health = 1e3;
|
|
16743
|
+
self.mass = 450;
|
|
16744
|
+
self.pain = (e, o, k, d) => arachnid_pain(e, o, k, d, context);
|
|
16745
|
+
self.die = (e, i, a, d, p, m3) => arachnid_die(e, i, a, d, p, m3, context);
|
|
16746
|
+
self.monsterinfo = {
|
|
16747
|
+
...self.monsterinfo,
|
|
16748
|
+
stand: arachnid_stand,
|
|
16749
|
+
walk: arachnid_walk,
|
|
16750
|
+
run: arachnid_run,
|
|
16751
|
+
attack: arachnid_attack,
|
|
16752
|
+
sight: (e, o) => context.engine.sound?.(e, CHAN_VOICE, sound_sight, 1, ATTN_NORM2, 0),
|
|
16753
|
+
scale: MODEL_SCALE,
|
|
16754
|
+
aiflags: self.monsterinfo?.aiflags || 0
|
|
16755
|
+
};
|
|
16756
|
+
context.linkentity(self);
|
|
16757
|
+
M_SetAnimation3(self, arachnid_move_stand, context);
|
|
16758
|
+
walkmonster_start(self, context);
|
|
16759
|
+
}
|
|
16760
|
+
function registerArachnidSpawns(registry) {
|
|
16761
|
+
registry.register("monster_arachnid", SP_monster_arachnid);
|
|
16762
|
+
}
|
|
16763
|
+
|
|
16338
16764
|
// src/entities/monsters/index.ts
|
|
16339
16765
|
function registerMonsterSpawns2(registry) {
|
|
16340
16766
|
registerMonsterSpawns(registry);
|
|
@@ -16363,6 +16789,7 @@ function registerMonsterSpawns2(registry) {
|
|
|
16363
16789
|
registerActorSpawns(registry);
|
|
16364
16790
|
registerGekkSpawns(registry);
|
|
16365
16791
|
registerFixbotSpawns(registry);
|
|
16792
|
+
registerArachnidSpawns(registry);
|
|
16366
16793
|
}
|
|
16367
16794
|
|
|
16368
16795
|
// src/entities/worldspawn.ts
|