quake2ts 0.0.281 → 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/cjs/index.cjs +46 -10
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +45 -10
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/client/dist/types/index.d.ts +10 -0
- package/packages/client/dist/types/index.d.ts.map +1 -1
- package/packages/engine/dist/browser/index.global.js +1 -1
- package/packages/engine/dist/browser/index.global.js.map +1 -1
- package/packages/engine/dist/cjs/index.cjs +3 -0
- package/packages/engine/dist/cjs/index.cjs.map +1 -1
- package/packages/engine/dist/esm/index.js +3 -0
- package/packages/engine/dist/esm/index.js.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/demo/playback.d.ts +1 -0
- package/packages/engine/dist/types/demo/playback.d.ts.map +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
|
@@ -16176,6 +16176,432 @@ function registerFixbotSpawns(registry) {
|
|
|
16176
16176
|
registry.register("monster_fixbot", SP_monster_fixbot);
|
|
16177
16177
|
}
|
|
16178
16178
|
|
|
16179
|
+
// src/entities/monsters/arachnid.ts
|
|
16180
|
+
init_esm();
|
|
16181
|
+
|
|
16182
|
+
// src/entities/monsters/common.ts
|
|
16183
|
+
init_esm();
|
|
16184
|
+
var MONSTER_TICK26 = 0.1;
|
|
16185
|
+
function generic_ai_stand(self, dist, context) {
|
|
16186
|
+
ai_stand(self, MONSTER_TICK26, context);
|
|
16187
|
+
}
|
|
16188
|
+
function generic_ai_walk(self, dist, context) {
|
|
16189
|
+
ai_walk(self, dist, MONSTER_TICK26, context);
|
|
16190
|
+
}
|
|
16191
|
+
function generic_ai_run(self, dist, context) {
|
|
16192
|
+
ai_run(self, dist, MONSTER_TICK26, context);
|
|
16193
|
+
}
|
|
16194
|
+
var generic_stand_frames = Array.from({ length: 1 }, () => ({
|
|
16195
|
+
ai: generic_ai_stand,
|
|
16196
|
+
dist: 0
|
|
16197
|
+
}));
|
|
16198
|
+
var generic_walk_frames = Array.from({ length: 1 }, () => ({
|
|
16199
|
+
ai: generic_ai_walk,
|
|
16200
|
+
dist: 5
|
|
16201
|
+
}));
|
|
16202
|
+
var generic_run_frames = Array.from({ length: 1 }, () => ({
|
|
16203
|
+
ai: generic_ai_run,
|
|
16204
|
+
dist: 10
|
|
16205
|
+
}));
|
|
16206
|
+
function M_SetAnimation3(self, move, context) {
|
|
16207
|
+
self.monsterinfo.current_move = move;
|
|
16208
|
+
}
|
|
16209
|
+
function M_ShouldReactToPain(self) {
|
|
16210
|
+
return true;
|
|
16211
|
+
}
|
|
16212
|
+
function M_CheckGib(self, context) {
|
|
16213
|
+
const gibHealth = self.gib_health ?? -40;
|
|
16214
|
+
return self.health < gibHealth;
|
|
16215
|
+
}
|
|
16216
|
+
function M_AllowSpawn(self, context) {
|
|
16217
|
+
return true;
|
|
16218
|
+
}
|
|
16219
|
+
function walkmonster_start(self, context) {
|
|
16220
|
+
self.think = monster_think;
|
|
16221
|
+
self.nextthink = context.timeSeconds + MONSTER_TICK26;
|
|
16222
|
+
}
|
|
16223
|
+
function M_ProjectFlashSource(self, offset, forward, right) {
|
|
16224
|
+
const start = addVec3(self.origin, scaleVec3(forward, offset.x));
|
|
16225
|
+
const start2 = addVec3(start, scaleVec3(right, offset.y));
|
|
16226
|
+
const start3 = addVec3(start2, { x: 0, y: 0, z: offset.z });
|
|
16227
|
+
return start3;
|
|
16228
|
+
}
|
|
16229
|
+
|
|
16230
|
+
// src/entities/monsters/arachnid.ts
|
|
16231
|
+
var FRAME_rails1 = 0;
|
|
16232
|
+
var FRAME_rails4 = 3;
|
|
16233
|
+
var FRAME_rails8 = 7;
|
|
16234
|
+
var FRAME_rails11 = 10;
|
|
16235
|
+
var FRAME_death1 = 11;
|
|
16236
|
+
var FRAME_death20 = 30;
|
|
16237
|
+
var FRAME_melee_atk1 = 31;
|
|
16238
|
+
var FRAME_melee_atk12 = 42;
|
|
16239
|
+
var FRAME_pain11 = 43;
|
|
16240
|
+
var FRAME_pain15 = 47;
|
|
16241
|
+
var FRAME_idle1 = 48;
|
|
16242
|
+
var FRAME_idle13 = 60;
|
|
16243
|
+
var FRAME_walk12 = 61;
|
|
16244
|
+
var FRAME_walk10 = 70;
|
|
16245
|
+
var FRAME_pain21 = 76;
|
|
16246
|
+
var FRAME_pain26 = 81;
|
|
16247
|
+
var FRAME_rails_up1 = 98;
|
|
16248
|
+
var FRAME_rails_up7 = 104;
|
|
16249
|
+
var FRAME_rails_up11 = 108;
|
|
16250
|
+
var FRAME_rails_up16 = 113;
|
|
16251
|
+
var MODEL_SCALE = 1;
|
|
16252
|
+
var MELEE_DISTANCE5 = 64;
|
|
16253
|
+
var MONSTER_TICK27 = 0.1;
|
|
16254
|
+
var CHAN_WEAPON = 1;
|
|
16255
|
+
var CHAN_VOICE = 2;
|
|
16256
|
+
var CHAN_BODY = 4;
|
|
16257
|
+
var ATTN_NORM2 = 1;
|
|
16258
|
+
var ATTN_IDLE = 2;
|
|
16259
|
+
var MZ2_ARACHNID_RAIL1 = 20;
|
|
16260
|
+
var MZ2_ARACHNID_RAIL2 = 21;
|
|
16261
|
+
var MZ2_ARACHNID_RAIL_UP1 = 22;
|
|
16262
|
+
var MZ2_ARACHNID_RAIL_UP2 = 23;
|
|
16263
|
+
var sound_pain;
|
|
16264
|
+
var sound_death;
|
|
16265
|
+
var sound_sight;
|
|
16266
|
+
var sound_step;
|
|
16267
|
+
var sound_charge;
|
|
16268
|
+
var sound_melee;
|
|
16269
|
+
var sound_melee_hit;
|
|
16270
|
+
function monster_ai_stand23(self, dist, context) {
|
|
16271
|
+
ai_stand(self, MONSTER_TICK27, context);
|
|
16272
|
+
}
|
|
16273
|
+
function monster_ai_walk22(self, dist, context) {
|
|
16274
|
+
ai_walk(self, dist, MONSTER_TICK27, context);
|
|
16275
|
+
}
|
|
16276
|
+
function monster_ai_run23(self, dist, context) {
|
|
16277
|
+
ai_run(self, dist, MONSTER_TICK27, context);
|
|
16278
|
+
}
|
|
16279
|
+
function monster_ai_charge24(self, dist, context) {
|
|
16280
|
+
ai_charge(self, dist, MONSTER_TICK27, context);
|
|
16281
|
+
}
|
|
16282
|
+
function monster_ai_move23(self, dist, context) {
|
|
16283
|
+
ai_move(self, dist);
|
|
16284
|
+
}
|
|
16285
|
+
var arachnid_frames_stand = [
|
|
16286
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16287
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16288
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16289
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16290
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16291
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16292
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16293
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16294
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16295
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16296
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16297
|
+
{ ai: monster_ai_stand23, dist: 0 },
|
|
16298
|
+
{ ai: monster_ai_stand23, dist: 0 }
|
|
16299
|
+
];
|
|
16300
|
+
var arachnid_move_stand = {
|
|
16301
|
+
firstframe: FRAME_idle1,
|
|
16302
|
+
lastframe: FRAME_idle13,
|
|
16303
|
+
frames: arachnid_frames_stand,
|
|
16304
|
+
endfunc: null
|
|
16305
|
+
};
|
|
16306
|
+
function arachnid_stand(self, context) {
|
|
16307
|
+
M_SetAnimation3(self, arachnid_move_stand, context);
|
|
16308
|
+
}
|
|
16309
|
+
function arachnid_footstep(self, context) {
|
|
16310
|
+
context.engine.sound?.(self, CHAN_BODY, sound_step, 0.5, ATTN_IDLE, 0);
|
|
16311
|
+
}
|
|
16312
|
+
var arachnid_frames_walk = [
|
|
16313
|
+
{ ai: monster_ai_walk22, dist: 8, think: arachnid_footstep },
|
|
16314
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16315
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16316
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16317
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16318
|
+
{ ai: monster_ai_walk22, dist: 8, think: arachnid_footstep },
|
|
16319
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16320
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16321
|
+
{ ai: monster_ai_walk22, dist: 8 },
|
|
16322
|
+
{ ai: monster_ai_walk22, dist: 8 }
|
|
16323
|
+
];
|
|
16324
|
+
var arachnid_move_walk = {
|
|
16325
|
+
firstframe: FRAME_walk12,
|
|
16326
|
+
lastframe: FRAME_walk10,
|
|
16327
|
+
frames: arachnid_frames_walk,
|
|
16328
|
+
endfunc: null
|
|
16329
|
+
};
|
|
16330
|
+
function arachnid_walk(self, context) {
|
|
16331
|
+
M_SetAnimation3(self, arachnid_move_walk, context);
|
|
16332
|
+
}
|
|
16333
|
+
var arachnid_frames_run = [
|
|
16334
|
+
{ ai: monster_ai_run23, dist: 8, think: arachnid_footstep },
|
|
16335
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16336
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16337
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16338
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16339
|
+
{ ai: monster_ai_run23, dist: 8, think: arachnid_footstep },
|
|
16340
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16341
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16342
|
+
{ ai: monster_ai_run23, dist: 8 },
|
|
16343
|
+
{ ai: monster_ai_run23, dist: 8 }
|
|
16344
|
+
];
|
|
16345
|
+
var arachnid_move_run = {
|
|
16346
|
+
firstframe: FRAME_walk12,
|
|
16347
|
+
lastframe: FRAME_walk10,
|
|
16348
|
+
frames: arachnid_frames_run,
|
|
16349
|
+
endfunc: null
|
|
16350
|
+
};
|
|
16351
|
+
function arachnid_run(self, context) {
|
|
16352
|
+
M_SetAnimation3(self, arachnid_move_run, context);
|
|
16353
|
+
}
|
|
16354
|
+
var arachnid_frames_pain1 = [
|
|
16355
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16356
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16357
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16358
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16359
|
+
{ ai: monster_ai_move23, dist: 0 }
|
|
16360
|
+
];
|
|
16361
|
+
var arachnid_move_pain1 = {
|
|
16362
|
+
firstframe: FRAME_pain11,
|
|
16363
|
+
lastframe: FRAME_pain15,
|
|
16364
|
+
frames: arachnid_frames_pain1,
|
|
16365
|
+
endfunc: arachnid_run
|
|
16366
|
+
};
|
|
16367
|
+
var arachnid_frames_pain2 = [
|
|
16368
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16369
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16370
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16371
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16372
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16373
|
+
{ ai: monster_ai_move23, dist: 0 }
|
|
16374
|
+
];
|
|
16375
|
+
var arachnid_move_pain2 = {
|
|
16376
|
+
firstframe: FRAME_pain21,
|
|
16377
|
+
lastframe: FRAME_pain26,
|
|
16378
|
+
frames: arachnid_frames_pain2,
|
|
16379
|
+
endfunc: arachnid_run
|
|
16380
|
+
};
|
|
16381
|
+
function arachnid_pain(self, other, kick, damage, context) {
|
|
16382
|
+
if (self.health < self.max_health / 2) {
|
|
16383
|
+
self.skin = 1;
|
|
16384
|
+
}
|
|
16385
|
+
if (context.timeSeconds < self.pain_debounce_time) {
|
|
16386
|
+
return;
|
|
16387
|
+
}
|
|
16388
|
+
self.pain_debounce_time = context.timeSeconds + 3;
|
|
16389
|
+
context.engine.sound?.(self, CHAN_VOICE, sound_pain, 1, ATTN_NORM2, 0);
|
|
16390
|
+
if (!M_ShouldReactToPain(self)) {
|
|
16391
|
+
return;
|
|
16392
|
+
}
|
|
16393
|
+
if (Math.random() < 0.5) {
|
|
16394
|
+
M_SetAnimation3(self, arachnid_move_pain1, context);
|
|
16395
|
+
} else {
|
|
16396
|
+
M_SetAnimation3(self, arachnid_move_pain2, context);
|
|
16397
|
+
}
|
|
16398
|
+
}
|
|
16399
|
+
function arachnid_charge_rail(self, context) {
|
|
16400
|
+
if (!self.enemy || !self.enemy.inUse) {
|
|
16401
|
+
return;
|
|
16402
|
+
}
|
|
16403
|
+
context.engine.sound?.(self, CHAN_WEAPON, sound_charge, 1, ATTN_NORM2, 0);
|
|
16404
|
+
self.pos1 = { ...self.enemy.origin };
|
|
16405
|
+
self.pos1 = { ...self.pos1, z: self.pos1.z + self.enemy.viewheight };
|
|
16406
|
+
}
|
|
16407
|
+
function arachnid_rail(self, context) {
|
|
16408
|
+
let id;
|
|
16409
|
+
switch (self.frame) {
|
|
16410
|
+
case FRAME_rails4:
|
|
16411
|
+
default:
|
|
16412
|
+
id = MZ2_ARACHNID_RAIL1;
|
|
16413
|
+
break;
|
|
16414
|
+
case FRAME_rails8:
|
|
16415
|
+
id = MZ2_ARACHNID_RAIL2;
|
|
16416
|
+
break;
|
|
16417
|
+
case FRAME_rails_up7:
|
|
16418
|
+
id = MZ2_ARACHNID_RAIL_UP1;
|
|
16419
|
+
break;
|
|
16420
|
+
case FRAME_rails_up11:
|
|
16421
|
+
id = MZ2_ARACHNID_RAIL_UP2;
|
|
16422
|
+
break;
|
|
16423
|
+
}
|
|
16424
|
+
const { forward, right } = angleVectors(self.angles);
|
|
16425
|
+
const start = M_ProjectFlashSource(self, { x: 0, y: 0, z: 0 }, forward, right);
|
|
16426
|
+
const dir = subtractVec3(self.pos1, start);
|
|
16427
|
+
normalizeVec3(dir);
|
|
16428
|
+
monster_fire_railgun(self, start, dir, 35, 100, id, context);
|
|
16429
|
+
}
|
|
16430
|
+
var arachnid_frames_attack1 = [
|
|
16431
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_charge_rail },
|
|
16432
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16433
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16434
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_rail },
|
|
16435
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_charge_rail },
|
|
16436
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16437
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16438
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_rail },
|
|
16439
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16440
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16441
|
+
{ ai: monster_ai_charge24, dist: 0 }
|
|
16442
|
+
];
|
|
16443
|
+
var arachnid_attack1 = {
|
|
16444
|
+
firstframe: FRAME_rails1,
|
|
16445
|
+
lastframe: FRAME_rails11,
|
|
16446
|
+
frames: arachnid_frames_attack1,
|
|
16447
|
+
endfunc: arachnid_run
|
|
16448
|
+
};
|
|
16449
|
+
var arachnid_frames_attack_up1 = [
|
|
16450
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16451
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16452
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16453
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_charge_rail },
|
|
16454
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16455
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16456
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_rail },
|
|
16457
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_charge_rail },
|
|
16458
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16459
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16460
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_rail },
|
|
16461
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16462
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16463
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16464
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16465
|
+
{ ai: monster_ai_charge24, dist: 0 }
|
|
16466
|
+
];
|
|
16467
|
+
var arachnid_attack_up1 = {
|
|
16468
|
+
firstframe: FRAME_rails_up1,
|
|
16469
|
+
lastframe: FRAME_rails_up16,
|
|
16470
|
+
frames: arachnid_frames_attack_up1,
|
|
16471
|
+
endfunc: arachnid_run
|
|
16472
|
+
};
|
|
16473
|
+
function arachnid_melee_charge(self, context) {
|
|
16474
|
+
context.engine.sound?.(self, CHAN_WEAPON, sound_melee, 1, ATTN_NORM2, 0);
|
|
16475
|
+
}
|
|
16476
|
+
function arachnid_melee_hit(self, context) {
|
|
16477
|
+
if (!monster_fire_hit(self, { x: MELEE_DISTANCE5, y: 0, z: 0 }, 15, 50, context)) {
|
|
16478
|
+
}
|
|
16479
|
+
}
|
|
16480
|
+
var arachnid_frames_melee = [
|
|
16481
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16482
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16483
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16484
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_melee_charge },
|
|
16485
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16486
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_melee_hit },
|
|
16487
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16488
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16489
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_melee_charge },
|
|
16490
|
+
{ ai: monster_ai_charge24, dist: 0 },
|
|
16491
|
+
{ ai: monster_ai_charge24, dist: 0, think: arachnid_melee_hit },
|
|
16492
|
+
{ ai: monster_ai_charge24, dist: 0 }
|
|
16493
|
+
];
|
|
16494
|
+
var arachnid_melee = {
|
|
16495
|
+
firstframe: FRAME_melee_atk1,
|
|
16496
|
+
lastframe: FRAME_melee_atk12,
|
|
16497
|
+
frames: arachnid_frames_melee,
|
|
16498
|
+
endfunc: arachnid_run
|
|
16499
|
+
};
|
|
16500
|
+
function arachnid_attack(self, context) {
|
|
16501
|
+
if (!self.enemy || !self.enemy.inUse) {
|
|
16502
|
+
return;
|
|
16503
|
+
}
|
|
16504
|
+
const range = rangeTo(self, self.enemy);
|
|
16505
|
+
if (range < MELEE_DISTANCE5) {
|
|
16506
|
+
M_SetAnimation3(self, arachnid_melee, context);
|
|
16507
|
+
} else if (self.enemy.origin.z - self.origin.z > 150) {
|
|
16508
|
+
M_SetAnimation3(self, arachnid_attack_up1, context);
|
|
16509
|
+
} else {
|
|
16510
|
+
M_SetAnimation3(self, arachnid_attack1, context);
|
|
16511
|
+
}
|
|
16512
|
+
}
|
|
16513
|
+
function arachnid_dead(self, context) {
|
|
16514
|
+
self.mins = { x: -16, y: -16, z: -24 };
|
|
16515
|
+
self.maxs = { x: 16, y: 16, z: -8 };
|
|
16516
|
+
self.movetype = 7 /* Toss */;
|
|
16517
|
+
self.svflags |= 536870912;
|
|
16518
|
+
self.nextthink = 0;
|
|
16519
|
+
context.linkentity(self);
|
|
16520
|
+
}
|
|
16521
|
+
var arachnid_frames_death1 = [
|
|
16522
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16523
|
+
{ ai: monster_ai_move23, dist: -1.23 },
|
|
16524
|
+
{ ai: monster_ai_move23, dist: -1.23 },
|
|
16525
|
+
{ ai: monster_ai_move23, dist: -1.23 },
|
|
16526
|
+
{ ai: monster_ai_move23, dist: -1.23 },
|
|
16527
|
+
{ ai: monster_ai_move23, dist: -1.64 },
|
|
16528
|
+
{ ai: monster_ai_move23, dist: -1.64 },
|
|
16529
|
+
{ ai: monster_ai_move23, dist: -2.45 },
|
|
16530
|
+
{ ai: monster_ai_move23, dist: -8.63 },
|
|
16531
|
+
{ ai: monster_ai_move23, dist: -4 },
|
|
16532
|
+
{ ai: monster_ai_move23, dist: -4.5 },
|
|
16533
|
+
{ ai: monster_ai_move23, dist: -6.8 },
|
|
16534
|
+
{ ai: monster_ai_move23, dist: -8 },
|
|
16535
|
+
{ ai: monster_ai_move23, dist: -5.4 },
|
|
16536
|
+
{ ai: monster_ai_move23, dist: -3.4 },
|
|
16537
|
+
{ ai: monster_ai_move23, dist: -1.9 },
|
|
16538
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16539
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16540
|
+
{ ai: monster_ai_move23, dist: 0 },
|
|
16541
|
+
{ ai: monster_ai_move23, dist: 0 }
|
|
16542
|
+
];
|
|
16543
|
+
var arachnid_move_death = {
|
|
16544
|
+
firstframe: FRAME_death1,
|
|
16545
|
+
lastframe: FRAME_death20,
|
|
16546
|
+
frames: arachnid_frames_death1,
|
|
16547
|
+
endfunc: arachnid_dead
|
|
16548
|
+
};
|
|
16549
|
+
function arachnid_die(self, inflictor, attacker, damage, point, mod, context) {
|
|
16550
|
+
if (M_CheckGib(self, context)) {
|
|
16551
|
+
context.engine.sound?.(self, CHAN_VOICE, "misc/udeath.wav", 1, ATTN_NORM2, 0);
|
|
16552
|
+
throwGibs(context, self.origin, damage);
|
|
16553
|
+
self.deadflag = 2 /* Dead */;
|
|
16554
|
+
return;
|
|
16555
|
+
}
|
|
16556
|
+
if (self.deadflag === 2 /* Dead */) {
|
|
16557
|
+
return;
|
|
16558
|
+
}
|
|
16559
|
+
context.engine.sound?.(self, CHAN_VOICE, sound_death, 1, ATTN_NORM2, 0);
|
|
16560
|
+
self.deadflag = 2 /* Dead */;
|
|
16561
|
+
self.takedamage = true;
|
|
16562
|
+
M_SetAnimation3(self, arachnid_move_death, context);
|
|
16563
|
+
}
|
|
16564
|
+
function SP_monster_arachnid(self, context) {
|
|
16565
|
+
if (!M_AllowSpawn(self, context)) {
|
|
16566
|
+
context.free(self);
|
|
16567
|
+
return;
|
|
16568
|
+
}
|
|
16569
|
+
self.classname = "monster_arachnid";
|
|
16570
|
+
sound_step = "insane/insane11.wav";
|
|
16571
|
+
sound_charge = "gladiator/railgun.wav";
|
|
16572
|
+
sound_melee = "gladiator/melee3.wav";
|
|
16573
|
+
sound_melee_hit = "gladiator/melee2.wav";
|
|
16574
|
+
sound_pain = "arachnid/pain.wav";
|
|
16575
|
+
sound_death = "arachnid/death.wav";
|
|
16576
|
+
sound_sight = "arachnid/sight.wav";
|
|
16577
|
+
self.model = "models/monsters/arachnid/tris.md2";
|
|
16578
|
+
self.mins = { x: -48, y: -48, z: -20 };
|
|
16579
|
+
self.maxs = { x: 48, y: 48, z: 48 };
|
|
16580
|
+
self.movetype = 5 /* Step */;
|
|
16581
|
+
self.solid = 2 /* BoundingBox */;
|
|
16582
|
+
self.health = 1e3;
|
|
16583
|
+
self.max_health = 1e3;
|
|
16584
|
+
self.mass = 450;
|
|
16585
|
+
self.pain = (e, o, k, d) => arachnid_pain(e, o, k, d, context);
|
|
16586
|
+
self.die = (e, i, a, d, p, m3) => arachnid_die(e, i, a, d, p, m3, context);
|
|
16587
|
+
self.monsterinfo = {
|
|
16588
|
+
...self.monsterinfo,
|
|
16589
|
+
stand: arachnid_stand,
|
|
16590
|
+
walk: arachnid_walk,
|
|
16591
|
+
run: arachnid_run,
|
|
16592
|
+
attack: arachnid_attack,
|
|
16593
|
+
sight: (e, o) => context.engine.sound?.(e, CHAN_VOICE, sound_sight, 1, ATTN_NORM2, 0),
|
|
16594
|
+
scale: MODEL_SCALE,
|
|
16595
|
+
aiflags: self.monsterinfo?.aiflags || 0
|
|
16596
|
+
};
|
|
16597
|
+
context.linkentity(self);
|
|
16598
|
+
M_SetAnimation3(self, arachnid_move_stand, context);
|
|
16599
|
+
walkmonster_start(self, context);
|
|
16600
|
+
}
|
|
16601
|
+
function registerArachnidSpawns(registry) {
|
|
16602
|
+
registry.register("monster_arachnid", SP_monster_arachnid);
|
|
16603
|
+
}
|
|
16604
|
+
|
|
16179
16605
|
// src/entities/monsters/index.ts
|
|
16180
16606
|
function registerMonsterSpawns2(registry) {
|
|
16181
16607
|
registerMonsterSpawns(registry);
|
|
@@ -16204,6 +16630,7 @@ function registerMonsterSpawns2(registry) {
|
|
|
16204
16630
|
registerActorSpawns(registry);
|
|
16205
16631
|
registerGekkSpawns(registry);
|
|
16206
16632
|
registerFixbotSpawns(registry);
|
|
16633
|
+
registerArachnidSpawns(registry);
|
|
16207
16634
|
}
|
|
16208
16635
|
|
|
16209
16636
|
// src/entities/worldspawn.ts
|