24 Aug 2007

This commit is contained in:
g-cont 2007-08-24 00:00:00 +04:00 committed by Alibek Omarov
parent 18ae3c0d12
commit dfd352011a
111 changed files with 2078 additions and 63067 deletions

View File

@ -2,21 +2,17 @@
// FIXME
//==================================================
render.dll
1. Избавиться от pcx совсем
2. избавиться от LightImageScale
engine.dll
1.
1. убить остатки .md2
platform.dll
1. íàó÷èòü rad ñóììèðîâàòü öâåòà â dxt
server.dll
1. убрать все энтити, оставить минимум, необходимый для работы
client.dll
1. создать базовую версию библиотеки OK
2. разработать интерфейсы взаимодействия
1. разработать интерфейсы взаимодействия
//==================================================
// òî, ÷òî óæå ãîòîâî

View File

@ -6,6 +6,15 @@
--------------------Configuration: editor - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\Temp\RSP1F64.bat" with contents
[
@echo off
copy \XASH3D\src_main\!source\temp\editor\!release\editor.dll "D:\Xash3D\bin\editor.dll"
]
Creating command line "C:\Temp\RSP1F64.bat"
<h3>Output Window</h3>
Performing Custom Build Step on \XASH3D\src_main\!source\temp\editor\!release\editor.dll
‘ª®¯¨à®¢ ­® ä ©«®¢: 1.

View File

@ -868,25 +868,8 @@ void CL_AddPacketEntities (frame_t *frame)
effects |= EF_COLOR_SHELL;
renderfx |= RF_SHELL_BLUE;
}
//======
// PMM
if (effects & EF_DOUBLE)
{
effects &= ~EF_DOUBLE;
effects |= EF_COLOR_SHELL;
renderfx |= RF_SHELL_DOUBLE;
}
if (effects & EF_HALF_DAMAGE)
{
effects &= ~EF_HALF_DAMAGE;
effects |= EF_COLOR_SHELL;
renderfx |= RF_SHELL_HALF_DAM;
}
// pmm
//======
//copy state to renderer
ent.prev.frame = cent->prev.frame;
ent.backlerp = 1.0 - cl.lerpfrac;
ent.alpha = s1->alpha;
@ -1017,11 +1000,6 @@ void CL_AddPacketEntities (frame_t *frame)
V_AddLight (ent.origin, 225, 1.0, 0.1, 0.1);
else if (effects & EF_FLAG2)
V_AddLight (ent.origin, 225, 0.1, 0.1, 1.0);
else if (effects & EF_TAGTRAIL) //PGM
V_AddLight (ent.origin, 225, 1.0, 1.0, 0.0); //PGM
else if (effects & EF_TRACKERTRAIL) //PGM
V_AddLight (ent.origin, 225, -1.0, -1.0, -1.0); //PGM
continue;
}
@ -1042,17 +1020,6 @@ void CL_AddPacketEntities (frame_t *frame)
ent.alpha = 0.6;
}
if (effects & EF_SPHERETRANS)
{
ent.flags |= RF_TRANSLUCENT;
// PMM - *sigh* yet more EF overloading
if (effects & EF_TRACKERTRAIL)
ent.alpha = 0.6;
else
ent.alpha = 0.3;
}
//pmm
// add to refresh list
V_AddEntity (&ent);
@ -1106,26 +1073,12 @@ void CL_AddPacketEntities (frame_t *frame)
// EF_BLASTER | EF_TRACKER is a special case for EF_BLASTER2... Cheese!
else if (effects & EF_BLASTER)
{
// CL_BlasterTrail (cent->lerp_origin, ent.origin);
//PGM
if (effects & EF_TRACKER) // lame... problematic?
{
CL_BlasterTrail2 (cent->lerp_origin, ent.origin);
V_AddLight (ent.origin, 200, 0, 1, 0);
}
else
{
CL_BlasterTrail (cent->lerp_origin, ent.origin);
V_AddLight (ent.origin, 200, 1, 1, 0);
}
//PGM
CL_BlasterTrail (cent->lerp_origin, ent.origin);
V_AddLight (ent.origin, 200, 1, 1, 0);
}
else if (effects & EF_HYPERBLASTER)
{
if (effects & EF_TRACKER) // PGM overloaded for blaster2.
V_AddLight (ent.origin, 200, 0, 1, 0); // PGM
else // PGM
V_AddLight (ent.origin, 200, 1, 1, 0);
V_AddLight (ent.origin, 200, 1, 1, 0);
}
else if (effects & EF_GIB)
{
@ -1172,60 +1125,7 @@ void CL_AddPacketEntities (frame_t *frame)
CL_FlagTrail (cent->lerp_origin, ent.origin, 115);
V_AddLight (ent.origin, 225, 0.1, 0.1, 1);
}
//======
//ROGUE
else if (effects & EF_TAGTRAIL)
{
CL_TagTrail (cent->lerp_origin, ent.origin, 220);
V_AddLight (ent.origin, 225, 1.0, 1.0, 0.0);
}
else if (effects & EF_TRACKERTRAIL)
{
if (effects & EF_TRACKER)
{
float intensity;
intensity = 50 + (500 * (sin(cl.time/500.0) + 1.0));
V_AddLight (ent.origin, intensity, -1.0, -1.0, -1.0);
}
else
{
CL_Tracker_Shell (cent->lerp_origin);
V_AddLight (ent.origin, 155, -1.0, -1.0, -1.0);
}
}
else if (effects & EF_TRACKER)
{
CL_TrackerTrail (cent->lerp_origin, ent.origin, 0);
V_AddLight (ent.origin, 200, -1, -1, -1);
}
// RAFAEL
else if (effects & EF_GREENGIB)
{
CL_DiminishingTrail (cent->lerp_origin, ent.origin, cent, effects);
}
// RAFAEL
else if (effects & EF_IONRIPPER)
{
CL_IonripperTrail (cent->lerp_origin, ent.origin);
V_AddLight (ent.origin, 100, 1, 0.5, 0.5);
}
// RAFAEL
else if (effects & EF_BLUEHYPERBLASTER)
{
V_AddLight (ent.origin, 200, 0, 0, 1);
}
// RAFAEL
else if (effects & EF_PLASMA)
{
if (effects & EF_ANIM_ALLFAST)
{
CL_BlasterTrail (cent->lerp_origin, ent.origin);
}
V_AddLight (ent.origin, 130, 1, 0.5, 0.5);
}
}
VectorCopy (ent.origin, cent->lerp_origin);
}
}

View File

@ -373,50 +373,6 @@ void CL_ParseMuzzleFlash (void)
dl->color[0] = 1;dl->color[1] = 0.5; dl->color[2] = 0.5;
S_StartSound (NULL, i, CHAN_WEAPON, S_RegisterSound("weapons/rippfire.wav"), volume, ATTN_NORM, 0);
break;
// ======================
// PGM
case MZ_ETF_RIFLE:
dl->color[0] = 0.9;dl->color[1] = 0.7;dl->color[2] = 0;
S_StartSound (NULL, i, CHAN_WEAPON, S_RegisterSound("weapons/nail1.wav"), volume, ATTN_NORM, 0);
break;
case MZ_SHOTGUN2:
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
S_StartSound (NULL, i, CHAN_WEAPON, S_RegisterSound("weapons/shotg2.wav"), volume, ATTN_NORM, 0);
break;
case MZ_HEATBEAM:
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
dl->die = cl.time + 100;
// S_StartSound (NULL, i, CHAN_WEAPON, S_RegisterSound("weapons/bfg__l1a.wav"), volume, ATTN_NORM, 0);
break;
case MZ_BLASTER2:
dl->color[0] = 0;dl->color[1] = 1;dl->color[2] = 0;
// FIXME - different sound for blaster2 ??
S_StartSound (NULL, i, CHAN_WEAPON, S_RegisterSound("weapons/blastf1a.wav"), volume, ATTN_NORM, 0);
break;
case MZ_TRACKER:
// negative flashes handled the same in gl/soft until CL_AddDLights
dl->color[0] = -1;dl->color[1] = -1;dl->color[2] = -1;
S_StartSound (NULL, i, CHAN_WEAPON, S_RegisterSound("weapons/disint2.wav"), volume, ATTN_NORM, 0);
break;
case MZ_NUKE1:
dl->color[0] = 1;dl->color[1] = 0;dl->color[2] = 0;
dl->die = cl.time + 100;
break;
case MZ_NUKE2:
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
dl->die = cl.time + 100;
break;
case MZ_NUKE4:
dl->color[0] = 0;dl->color[1] = 0;dl->color[2] = 1;
dl->die = cl.time + 100;
break;
case MZ_NUKE8:
dl->color[0] = 0;dl->color[1] = 1;dl->color[2] = 1;
dl->die = cl.time + 100;
break;
// PGM
// ======================
}
}
@ -443,9 +399,9 @@ void CL_ParseMuzzleFlash2 (void)
// locate the origin
AngleVectors (cl_entities[ent].current.angles, forward, right, NULL);
origin[0] = cl_entities[ent].current.origin[0] + forward[0] * monster_flash_offset[flash_number][0] + right[0] * monster_flash_offset[flash_number][1];
origin[1] = cl_entities[ent].current.origin[1] + forward[1] * monster_flash_offset[flash_number][0] + right[1] * monster_flash_offset[flash_number][1];
origin[2] = cl_entities[ent].current.origin[2] + forward[2] * monster_flash_offset[flash_number][0] + right[2] * monster_flash_offset[flash_number][1] + monster_flash_offset[flash_number][2];
origin[0] = cl_entities[ent].current.origin[0] + forward[0] + right[0];
origin[1] = cl_entities[ent].current.origin[1] + forward[1] + right[1];
origin[2] = cl_entities[ent].current.origin[2] + forward[2] + right[2];
dl = CL_AllocDlight (ent);
VectorCopy (origin, dl->origin);
@ -509,7 +465,6 @@ void CL_ParseMuzzleFlash2 (void)
case MZ2_SUPERTANK_MACHINEGUN_4:
case MZ2_SUPERTANK_MACHINEGUN_5:
case MZ2_SUPERTANK_MACHINEGUN_6:
case MZ2_TURRET_MACHINEGUN: // PGM
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
CL_ParticleEffect (origin, vec3_origin, 0, 40);
@ -522,8 +477,6 @@ void CL_ParseMuzzleFlash2 (void)
case MZ2_BOSS2_MACHINEGUN_L3:
case MZ2_BOSS2_MACHINEGUN_L4:
case MZ2_BOSS2_MACHINEGUN_L5:
case MZ2_CARRIER_MACHINEGUN_L1: // PMM
case MZ2_CARRIER_MACHINEGUN_L2: // PMM
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
CL_ParticleEffect (origin, vec3_origin, 0, 40);
@ -539,7 +492,6 @@ void CL_ParseMuzzleFlash2 (void)
case MZ2_SOLDIER_BLASTER_6:
case MZ2_SOLDIER_BLASTER_7:
case MZ2_SOLDIER_BLASTER_8:
case MZ2_TURRET_BLASTER: // PGM
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
S_StartSound (NULL, ent, CHAN_WEAPON, S_RegisterSound("soldier/solatck2.wav"), 1, ATTN_NORM, 0);
break;
@ -612,7 +564,6 @@ void CL_ParseMuzzleFlash2 (void)
break;
case MZ2_CHICK_ROCKET_1:
case MZ2_TURRET_ROCKET: // PGM
dl->color[0] = 1;dl->color[1] = 0.5;dl->color[2] = 0.2;
S_StartSound (NULL, ent, CHAN_WEAPON, S_RegisterSound("chick/chkatck2.wav"), 1, ATTN_NORM, 0);
break;
@ -631,10 +582,6 @@ void CL_ParseMuzzleFlash2 (void)
case MZ2_BOSS2_ROCKET_2:
case MZ2_BOSS2_ROCKET_3:
case MZ2_BOSS2_ROCKET_4:
case MZ2_CARRIER_ROCKET_1:
// case MZ2_CARRIER_ROCKET_2:
// case MZ2_CARRIER_ROCKET_3:
// case MZ2_CARRIER_ROCKET_4:
dl->color[0] = 1;dl->color[1] = 0.5;dl->color[2] = 0.2;
S_StartSound (NULL, ent, CHAN_WEAPON, S_RegisterSound("tank/rocket.wav"), 1, ATTN_NORM, 0);
break;
@ -648,157 +595,8 @@ void CL_ParseMuzzleFlash2 (void)
break;
case MZ2_GLADIATOR_RAILGUN_1:
// PMM
case MZ2_CARRIER_RAILGUN:
case MZ2_WIDOW_RAIL:
// pmm
dl->color[0] = 0.5;dl->color[1] = 0.5;dl->color[2] = 1.0;
break;
// --- Xian's shit starts ---
case MZ2_MAKRON_BFG:
dl->color[0] = 0.5;dl->color[1] = 1 ;dl->color[2] = 0.5;
//S_StartSound (NULL, ent, CHAN_WEAPON, S_RegisterSound("makron/bfg_fire.wav"), 1, ATTN_NORM, 0);
break;
case MZ2_MAKRON_BLASTER_1:
case MZ2_MAKRON_BLASTER_2:
case MZ2_MAKRON_BLASTER_3:
case MZ2_MAKRON_BLASTER_4:
case MZ2_MAKRON_BLASTER_5:
case MZ2_MAKRON_BLASTER_6:
case MZ2_MAKRON_BLASTER_7:
case MZ2_MAKRON_BLASTER_8:
case MZ2_MAKRON_BLASTER_9:
case MZ2_MAKRON_BLASTER_10:
case MZ2_MAKRON_BLASTER_11:
case MZ2_MAKRON_BLASTER_12:
case MZ2_MAKRON_BLASTER_13:
case MZ2_MAKRON_BLASTER_14:
case MZ2_MAKRON_BLASTER_15:
case MZ2_MAKRON_BLASTER_16:
case MZ2_MAKRON_BLASTER_17:
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
S_StartSound (NULL, ent, CHAN_WEAPON, S_RegisterSound("makron/blaster.wav"), 1, ATTN_NORM, 0);
break;
case MZ2_JORG_MACHINEGUN_L1:
case MZ2_JORG_MACHINEGUN_L2:
case MZ2_JORG_MACHINEGUN_L3:
case MZ2_JORG_MACHINEGUN_L4:
case MZ2_JORG_MACHINEGUN_L5:
case MZ2_JORG_MACHINEGUN_L6:
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
CL_ParticleEffect (origin, vec3_origin, 0, 40);
CL_SmokeAndFlash(origin);
S_StartSound (NULL, ent, CHAN_WEAPON, S_RegisterSound("boss3/xfire.wav"), 1, ATTN_NORM, 0);
break;
case MZ2_JORG_MACHINEGUN_R1:
case MZ2_JORG_MACHINEGUN_R2:
case MZ2_JORG_MACHINEGUN_R3:
case MZ2_JORG_MACHINEGUN_R4:
case MZ2_JORG_MACHINEGUN_R5:
case MZ2_JORG_MACHINEGUN_R6:
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
CL_ParticleEffect (origin, vec3_origin, 0, 40);
CL_SmokeAndFlash(origin);
break;
case MZ2_JORG_BFG_1:
dl->color[0] = 0.5;dl->color[1] = 1 ;dl->color[2] = 0.5;
break;
case MZ2_BOSS2_MACHINEGUN_R1:
case MZ2_BOSS2_MACHINEGUN_R2:
case MZ2_BOSS2_MACHINEGUN_R3:
case MZ2_BOSS2_MACHINEGUN_R4:
case MZ2_BOSS2_MACHINEGUN_R5:
case MZ2_CARRIER_MACHINEGUN_R1: // PMM
case MZ2_CARRIER_MACHINEGUN_R2: // PMM
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
CL_ParticleEffect (origin, vec3_origin, 0, 40);
CL_SmokeAndFlash(origin);
break;
// ======
// ROGUE
case MZ2_STALKER_BLASTER:
case MZ2_DAEDALUS_BLASTER:
case MZ2_MEDIC_BLASTER_2:
case MZ2_WIDOW_BLASTER:
case MZ2_WIDOW_BLASTER_SWEEP1:
case MZ2_WIDOW_BLASTER_SWEEP2:
case MZ2_WIDOW_BLASTER_SWEEP3:
case MZ2_WIDOW_BLASTER_SWEEP4:
case MZ2_WIDOW_BLASTER_SWEEP5:
case MZ2_WIDOW_BLASTER_SWEEP6:
case MZ2_WIDOW_BLASTER_SWEEP7:
case MZ2_WIDOW_BLASTER_SWEEP8:
case MZ2_WIDOW_BLASTER_SWEEP9:
case MZ2_WIDOW_BLASTER_100:
case MZ2_WIDOW_BLASTER_90:
case MZ2_WIDOW_BLASTER_80:
case MZ2_WIDOW_BLASTER_70:
case MZ2_WIDOW_BLASTER_60:
case MZ2_WIDOW_BLASTER_50:
case MZ2_WIDOW_BLASTER_40:
case MZ2_WIDOW_BLASTER_30:
case MZ2_WIDOW_BLASTER_20:
case MZ2_WIDOW_BLASTER_10:
case MZ2_WIDOW_BLASTER_0:
case MZ2_WIDOW_BLASTER_10L:
case MZ2_WIDOW_BLASTER_20L:
case MZ2_WIDOW_BLASTER_30L:
case MZ2_WIDOW_BLASTER_40L:
case MZ2_WIDOW_BLASTER_50L:
case MZ2_WIDOW_BLASTER_60L:
case MZ2_WIDOW_BLASTER_70L:
case MZ2_WIDOW_RUN_1:
case MZ2_WIDOW_RUN_2:
case MZ2_WIDOW_RUN_3:
case MZ2_WIDOW_RUN_4:
case MZ2_WIDOW_RUN_5:
case MZ2_WIDOW_RUN_6:
case MZ2_WIDOW_RUN_7:
case MZ2_WIDOW_RUN_8:
dl->color[0] = 0;dl->color[1] = 1;dl->color[2] = 0;
S_StartSound (NULL, ent, CHAN_WEAPON, S_RegisterSound("tank/tnkatck3.wav"), 1, ATTN_NORM, 0);
break;
case MZ2_WIDOW_DISRUPTOR:
dl->color[0] = -1;dl->color[1] = -1;dl->color[2] = -1;
S_StartSound (NULL, ent, CHAN_WEAPON, S_RegisterSound("weapons/disint2.wav"), 1, ATTN_NORM, 0);
break;
case MZ2_WIDOW_PLASMABEAM:
case MZ2_WIDOW2_BEAMER_1:
case MZ2_WIDOW2_BEAMER_2:
case MZ2_WIDOW2_BEAMER_3:
case MZ2_WIDOW2_BEAMER_4:
case MZ2_WIDOW2_BEAMER_5:
case MZ2_WIDOW2_BEAM_SWEEP_1:
case MZ2_WIDOW2_BEAM_SWEEP_2:
case MZ2_WIDOW2_BEAM_SWEEP_3:
case MZ2_WIDOW2_BEAM_SWEEP_4:
case MZ2_WIDOW2_BEAM_SWEEP_5:
case MZ2_WIDOW2_BEAM_SWEEP_6:
case MZ2_WIDOW2_BEAM_SWEEP_7:
case MZ2_WIDOW2_BEAM_SWEEP_8:
case MZ2_WIDOW2_BEAM_SWEEP_9:
case MZ2_WIDOW2_BEAM_SWEEP_10:
case MZ2_WIDOW2_BEAM_SWEEP_11:
dl->radius = 300 + (rand()&100);
dl->color[0] = 1;dl->color[1] = 1;dl->color[2] = 0;
dl->die = cl.time + 200;
break;
// ROGUE
// ======
// --- Xian's shit ends ---
}
}

View File

@ -775,53 +775,6 @@ void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int m
}
}
void CL_ParticleSteamEffect2 (cl_sustain_t *self)
//vec3_t org, vec3_t dir, int color, int count, int magnitude)
{
int i, j;
cparticle_t *p;
float d;
vec3_t r, u;
vec3_t dir;
// vectoangles2 (dir, angle_dir);
// AngleVectors (angle_dir, f, r, u);
VectorCopy (self->dir, dir);
MakeNormalVectors (dir, r, u);
for (i=0 ; i<self->count ; i++)
{
if (!free_particles)
return;
p = free_particles;
free_particles = p->next;
p->next = active_particles;
active_particles = p;
p->time = cl.time;
p->color = self->color + (rand()&7);
for (j=0 ; j<3 ; j++)
{
p->org[j] = self->org[j] + self->magnitude*0.1*crand();
// p->vel[j] = dir[j]*magnitude;
}
VectorScale (dir, self->magnitude, p->vel);
d = crand()*self->magnitude/3;
VectorMA (p->vel, d, r, p->vel);
d = crand()*self->magnitude/3;
VectorMA (p->vel, d, u, p->vel);
p->accel[0] = p->accel[1] = 0;
p->accel[2] = -PARTICLE_GRAVITY/2;
p->alpha = 1.0;
p->alphavel = -1.0 / (0.5 + frand()*0.3);
}
self->nextthink += self->thinkinterval;
}
/*
===============
CL_TrackerTrail
@ -944,78 +897,6 @@ void CL_MonsterPlasma_Shell(vec3_t origin)
}
}
void CL_Widowbeamout (cl_sustain_t *self)
{
vec3_t dir;
int i;
cparticle_t *p;
static int colortable[4] = {2*8,13*8,21*8,18*8};
float ratio;
ratio = 1.0 - (((float)self->endtime - (float)cl.time)/2100.0);
for(i=0;i<300;i++)
{
if (!free_particles)
return;
p = free_particles;
free_particles = p->next;
p->next = active_particles;
active_particles = p;
VectorClear (p->accel);
p->time = cl.time;
p->alpha = 1.0;
p->alphavel = INSTANT_PARTICLE;
p->color = colortable[rand()&3];
dir[0] = crand();
dir[1] = crand();
dir[2] = crand();
VectorNormalize(dir);
VectorMA(self->org, (45.0 * ratio), dir, p->org);
// VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))), dir, p->org);
}
}
void CL_Nukeblast (cl_sustain_t *self)
{
vec3_t dir;
int i;
cparticle_t *p;
static int colortable[4] = {110, 112, 114, 116};
float ratio;
ratio = 1.0 - (((float)self->endtime - (float)cl.time)/1000.0);
for(i=0;i<700;i++)
{
if (!free_particles)
return;
p = free_particles;
free_particles = p->next;
p->next = active_particles;
active_particles = p;
VectorClear (p->accel);
p->time = cl.time;
p->alpha = 1.0;
p->alphavel = INSTANT_PARTICLE;
p->color = colortable[rand()&3];
dir[0] = crand();
dir[1] = crand();
dir[2] = crand();
VectorNormalize(dir);
VectorMA(self->org, (200.0 * ratio), dir, p->org);
// VectorMA(origin, 10*(((rand () & 0x7fff) / ((float)0x7fff))), dir, p->org);
}
}
void CL_WidowSplash (vec3_t org)
{
static int colortable[4] = {2*8,13*8,21*8,18*8};

View File

@ -67,14 +67,6 @@ typedef struct
} laser_t;
laser_t cl_lasers[MAX_LASERS];
//ROGUE
cl_sustain_t cl_sustains[MAX_SUSTAINS];
//ROGUE
//PGM
extern void CL_TeleportParticles (vec3_t org);
//PGM
void CL_BlasterParticles (vec3_t org, vec3_t dir);
void CL_ExplosionParticles (vec3_t org);
void CL_BFGExplosionParticles (vec3_t org);
@ -105,13 +97,6 @@ model_t *cl_mod_explo4;
model_t *cl_mod_bfg_explo;
model_t *cl_mod_plasmaexplo;
//ROGUE
struct sfx_s *cl_sfx_lightning;
struct sfx_s *cl_sfx_disrexp;
model_t *cl_mod_lightning;
model_t *cl_mod_explo4_big;
//ROGUE
/*
=================
CL_RegisterTEntSounds
@ -123,7 +108,6 @@ void CL_RegisterTEntSounds (void)
char name[MAX_QPATH];
// PMM - version stuff
// Msg ("%s\n", ROGUE_VERSION_STRING);
// PMM
cl_sfx_ric1 = S_RegisterSound ("world/ric1.wav");
cl_sfx_ric2 = S_RegisterSound ("world/ric2.wav");
@ -148,15 +132,6 @@ void CL_RegisterTEntSounds (void)
sprintf (name, "player/step%i.wav", i+1);
cl_sfx_footsteps[i] = S_RegisterSound (name);
}
//PGM
cl_sfx_lightning = S_RegisterSound ("weapons/tesla.wav");
cl_sfx_disrexp = S_RegisterSound ("weapons/disrupthit.wav");
// version stuff
// sprintf (name, "weapons/sound%d.wav", ROGUE_VERSION_ID);
// if (name[0] == 'w')
// name[0] = 'W';
//PGM
}
/*
@ -178,9 +153,6 @@ void CL_RegisterTEntModels (void)
re->RegisterPic ("a_bullets");
re->RegisterPic ("i_health");
re->RegisterPic ("a_grenades");
cl_mod_explo4_big = re->RegisterModel ("sprites/s_explo3.spr");
cl_mod_lightning = re->RegisterModel ("sprites/lgtning.spr");
}
/*
@ -193,11 +165,6 @@ void CL_ClearTEnts (void)
memset (cl_beams, 0, sizeof(cl_beams));
memset (cl_explosions, 0, sizeof(cl_explosions));
memset (cl_lasers, 0, sizeof(cl_lasers));
//ROGUE
memset (cl_playerbeams, 0, sizeof(cl_playerbeams));
memset (cl_sustains, 0, sizeof(cl_sustains));
//ROGUE
}
/*
@ -378,61 +345,6 @@ int CL_ParseBeam2 (model_t *model)
return ent;
}
// ROGUE
/*
=================
CL_ParsePlayerBeam
- adds to the cl_playerbeam array instead of the cl_beams array
=================
*/
int CL_ParsePlayerBeam (model_t *model)
{
int ent;
vec3_t start, end, offset;
beam_t *b;
int i;
ent = MSG_ReadShort (&net_message);
MSG_ReadPos (&net_message, start);
MSG_ReadPos (&net_message, end);
MSG_ReadPos (&net_message, offset);
// override any beam with the same entity
// PMM - For player beams, we only want one per player (entity) so..
for (i=0, b=cl_playerbeams ; i< MAX_BEAMS ; i++, b++)
{
if (b->entity == ent)
{
b->entity = ent;
b->model = model;
b->endtime = cl.time + 200;
VectorCopy (start, b->start);
VectorCopy (end, b->end);
VectorCopy (offset, b->offset);
return ent;
}
}
// find a free beam
for (i=0, b=cl_playerbeams ; i< MAX_BEAMS ; i++, b++)
{
if (!b->model || b->endtime < cl.time)
{
b->entity = ent;
b->model = model;
b->endtime = cl.time + 100; // PMM - this needs to be 100 to prevent multiple heatbeams
VectorCopy (start, b->start);
VectorCopy (end, b->end);
VectorCopy (offset, b->offset);
return ent;
}
}
Msg ("beam list overflow!\n");
return ent;
}
//rogue
/*
=================
CL_ParseLightning
@ -518,138 +430,6 @@ void CL_ParseLaser (int colors)
}
}
//=============
//ROGUE
void CL_ParseSteam (void)
{
vec3_t pos, dir;
int id, i;
int r;
int cnt;
int color;
int magnitude;
cl_sustain_t *s, *free_sustain;
id = MSG_ReadShort (&net_message); // an id of -1 is an instant effect
if (id != -1) // sustains
{
// Msg ("Sustain effect id %d\n", id);
free_sustain = NULL;
for (i=0, s=cl_sustains; i<MAX_SUSTAINS; i++, s++)
{
if (s->id == 0)
{
free_sustain = s;
break;
}
}
if (free_sustain)
{
s->id = id;
s->count = MSG_ReadByte (&net_message);
MSG_ReadPos (&net_message, s->org);
MSG_ReadDir (&net_message, s->dir);
r = MSG_ReadByte (&net_message);
s->color = r & 0xff;
s->magnitude = MSG_ReadShort (&net_message);
s->endtime = cl.time + MSG_ReadLong (&net_message);
s->think = CL_ParticleSteamEffect2;
s->thinkinterval = 100;
s->nextthink = cl.time;
}
else
{
// Msg ("No free sustains!\n");
// FIXME - read the stuff anyway
cnt = MSG_ReadByte (&net_message);
MSG_ReadPos (&net_message, pos);
MSG_ReadDir (&net_message, dir);
r = MSG_ReadByte (&net_message);
magnitude = MSG_ReadShort (&net_message);
magnitude = MSG_ReadLong (&net_message); // really interval
}
}
else // instant
{
cnt = MSG_ReadByte (&net_message);
MSG_ReadPos (&net_message, pos);
MSG_ReadDir (&net_message, dir);
r = MSG_ReadByte (&net_message);
magnitude = MSG_ReadShort (&net_message);
color = r & 0xff;
CL_ParticleSteamEffect (pos, dir, color, cnt, magnitude);
// S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
}
}
void CL_ParseWidow (void)
{
vec3_t pos;
int id, i;
cl_sustain_t *s, *free_sustain;
id = MSG_ReadShort (&net_message);
free_sustain = NULL;
for (i=0, s=cl_sustains; i<MAX_SUSTAINS; i++, s++)
{
if (s->id == 0)
{
free_sustain = s;
break;
}
}
if (free_sustain)
{
s->id = id;
MSG_ReadPos (&net_message, s->org);
s->endtime = cl.time + 2100;
s->think = CL_Widowbeamout;
s->thinkinterval = 1;
s->nextthink = cl.time;
}
else // no free sustains
{
// FIXME - read the stuff anyway
MSG_ReadPos (&net_message, pos);
}
}
void CL_ParseNuke (void)
{
vec3_t pos;
int i;
cl_sustain_t *s, *free_sustain;
free_sustain = NULL;
for (i=0, s=cl_sustains; i<MAX_SUSTAINS; i++, s++)
{
if (s->id == 0)
{
free_sustain = s;
break;
}
}
if (free_sustain)
{
s->id = 21000;
MSG_ReadPos (&net_message, s->org);
s->endtime = cl.time + 1000;
s->think = CL_Nukeblast;
s->thinkinterval = 1;
s->nextthink = cl.time;
}
else // no free sustains
{
// FIXME - read the stuff anyway
MSG_ReadPos (&net_message, pos);
}
}
//ROGUE
//=============
/*
=================
CL_ParseTEnt
@ -666,7 +446,6 @@ void CL_ParseTEnt (void)
int color;
int r;
int ent;
int magnitude;
type = MSG_ReadByte (&net_message);
@ -843,10 +622,8 @@ void CL_ParseTEnt (void)
break;
case TE_EXPLOSION1:
case TE_EXPLOSION1_BIG: // PMM
case TE_ROCKET_EXPLOSION:
case TE_ROCKET_EXPLOSION_WATER:
case TE_EXPLOSION1_NP: // PMM
MSG_ReadPos (&net_message, pos);
ex = CL_AllocExplosion ();
@ -859,13 +636,10 @@ void CL_ParseTEnt (void)
ex->lightcolor[1] = 0.5;
ex->lightcolor[2] = 0.5;
ex->ent.angles[1] = rand() % 360;
if (type != TE_EXPLOSION1_BIG) // PMM
ex->ent.model = cl_mod_explo4; // PMM
else ex->ent.model = cl_mod_explo4_big;
ex->ent.model = cl_mod_explo4; // PMM
ex->baseframe = 0;
ex->frames = 8;
if ((type != TE_EXPLOSION1_BIG) && (type != TE_EXPLOSION1_NP)) // PMM
CL_ExplosionParticles (pos); // PMM
CL_ExplosionParticles (pos); // PMM
if (type == TE_ROCKET_EXPLOSION_WATER)
S_StartSound (pos, 0, 0, cl_sfx_watrexp, 1, ATTN_NORM, 0);
else
@ -947,71 +721,10 @@ void CL_ParseTEnt (void)
CL_ParticleEffect2 (pos, dir, 0xdf, 30);
break;
// RAFAEL
case TE_TUNNEL_SPARKS:
cnt = MSG_ReadByte (&net_message);
MSG_ReadPos (&net_message, pos);
MSG_ReadDir (&net_message, dir);
color = MSG_ReadByte (&net_message);
CL_ParticleEffect3 (pos, dir, color, cnt);
break;
//=============
//PGM
// PMM -following code integrated for flechette (different color)
case TE_BLASTER2: // green blaster hitting wall
case TE_FLECHETTE: // flechette
MSG_ReadPos (&net_message, pos);
MSG_ReadDir (&net_message, dir);
// PMM
if (type == TE_BLASTER2)
CL_BlasterParticles2 (pos, dir, 0xd0);
else
CL_BlasterParticles2 (pos, dir, 0x6f); // 75
ex = CL_AllocExplosion ();
VectorCopy (pos, ex->ent.origin);
ex->ent.angles[0] = acos(dir[2])/M_PI*180;
// PMM - fixed to correct for pitch of 0
if (dir[0])
ex->ent.angles[1] = atan2(dir[1], dir[0])/M_PI*180;
else if (dir[1] > 0)
ex->ent.angles[1] = 90;
else if (dir[1] < 0)
ex->ent.angles[1] = 270;
else
ex->ent.angles[1] = 0;
ex->type = ex_misc;
ex->ent.flags = RF_FULLBRIGHT|RF_TRANSLUCENT;
// PMM
if (type == TE_BLASTER2)
ex->ent.skinnum = 1;
else // flechette
ex->ent.skinnum = 2;
ex->start = cl.frame.servertime - 100;
ex->light = 150;
// PMM
if (type == TE_BLASTER2)
ex->lightcolor[1] = 1;
else // flechette
{
ex->lightcolor[0] = 0.19;
ex->lightcolor[1] = 0.41;
ex->lightcolor[2] = 0.75;
}
ex->ent.model = cl_mod_explode;
ex->frames = 4;
S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
break;
case TE_LIGHTNING:
ent = CL_ParseLightning (cl_mod_lightning);
S_StartSound (NULL, ent, CHAN_WEAPON, cl_sfx_lightning, 1, ATTN_NORM, 0);
case TE_FLASHLIGHT:
MSG_ReadPos(&net_message, pos);
ent = MSG_ReadShort(&net_message);
CL_Flashlight(ent, pos);
break;
case TE_DEBUGTRAIL:
@ -1020,138 +733,14 @@ void CL_ParseTEnt (void)
CL_DebugTrail (pos, pos2);
break;
case TE_PLAIN_EXPLOSION:
// RAFAEL
case TE_TUNNEL_SPARKS:
cnt = MSG_ReadByte (&net_message);
MSG_ReadPos (&net_message, pos);
ex = CL_AllocExplosion ();
VectorCopy (pos, ex->ent.origin);
ex->type = ex_poly;
ex->ent.flags = RF_FULLBRIGHT;
ex->start = cl.frame.servertime - 100;
ex->light = 350;
ex->lightcolor[0] = 1.0;
ex->lightcolor[1] = 0.5;
ex->lightcolor[2] = 0.5;
ex->ent.angles[1] = rand() % 360;
ex->ent.model = cl_mod_explo4;
ex->baseframe = 0;
ex->frames = 6;
if (type == TE_ROCKET_EXPLOSION_WATER)
S_StartSound (pos, 0, 0, cl_sfx_watrexp, 1, ATTN_NORM, 0);
else
S_StartSound (pos, 0, 0, cl_sfx_rockexp, 1, ATTN_NORM, 0);
break;
case TE_FLASHLIGHT:
MSG_ReadPos(&net_message, pos);
ent = MSG_ReadShort(&net_message);
CL_Flashlight(ent, pos);
break;
case TE_FORCEWALL:
MSG_ReadPos(&net_message, pos);
MSG_ReadPos(&net_message, pos2);
MSG_ReadDir (&net_message, dir);
color = MSG_ReadByte (&net_message);
CL_ForceWall(pos, pos2, color);
CL_ParticleEffect3 (pos, dir, color, cnt);
break;
case TE_HEATBEAM:
break;
case TE_MONSTER_HEATBEAM:
break;
case TE_HEATBEAM_SPARKS:
// cnt = MSG_ReadByte (&net_message);
cnt = 50;
MSG_ReadPos (&net_message, pos);
MSG_ReadDir (&net_message, dir);
// r = MSG_ReadByte (&net_message);
// magnitude = MSG_ReadShort (&net_message);
r = 8;
magnitude = 60;
color = r & 0xff;
CL_ParticleSteamEffect (pos, dir, color, cnt, magnitude);
S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
break;
case TE_HEATBEAM_STEAM:
// cnt = MSG_ReadByte (&net_message);
cnt = 20;
MSG_ReadPos (&net_message, pos);
MSG_ReadDir (&net_message, dir);
// r = MSG_ReadByte (&net_message);
// magnitude = MSG_ReadShort (&net_message);
// color = r & 0xff;
color = 0xe0;
magnitude = 60;
CL_ParticleSteamEffect (pos, dir, color, cnt, magnitude);
S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
break;
case TE_STEAM:
CL_ParseSteam();
break;
case TE_BUBBLETRAIL2:
// cnt = MSG_ReadByte (&net_message);
cnt = 8;
MSG_ReadPos (&net_message, pos);
MSG_ReadPos (&net_message, pos2);
CL_BubbleTrail2 (pos, pos2, cnt);
S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
break;
case TE_MOREBLOOD:
MSG_ReadPos (&net_message, pos);
MSG_ReadDir (&net_message, dir);
CL_ParticleEffect (pos, dir, 0xe8, 250);
break;
case TE_CHAINFIST_SMOKE:
dir[0]=0; dir[1]=0; dir[2]=1;
MSG_ReadPos(&net_message, pos);
CL_ParticleSmokeEffect (pos, dir, 0, 20, 20);
break;
case TE_ELECTRIC_SPARKS:
MSG_ReadPos (&net_message, pos);
MSG_ReadDir (&net_message, dir);
// CL_ParticleEffect (pos, dir, 109, 40);
CL_ParticleEffect (pos, dir, 0x75, 40);
//FIXME : replace or remove this sound
S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
break;
case TE_TRACKER_EXPLOSION:
MSG_ReadPos (&net_message, pos);
CL_ColorFlash (pos, 0, 150, -1, -1, -1);
CL_ColorExplosionParticles (pos, 0, 1);
// CL_Tracker_Explode (pos);
S_StartSound (pos, 0, 0, cl_sfx_disrexp, 1, ATTN_NORM, 0);
break;
case TE_TELEPORT_EFFECT:
case TE_DBALL_GOAL:
MSG_ReadPos (&net_message, pos);
CL_TeleportParticles (pos);
break;
case TE_WIDOWBEAMOUT:
CL_ParseWidow ();
break;
case TE_NUKEBLAST:
CL_ParseNuke ();
break;
case TE_WIDOWSPLASH:
MSG_ReadPos (&net_message, pos);
CL_WidowSplash (pos);
break;
//PGM
//==============
default:
Com_Error (ERR_DROP, "CL_ParseTEnt: bad type");
}
@ -1221,214 +810,18 @@ void CL_AddBeams (void)
d = VectorNormalize(dist);
memset (&ent, 0, sizeof(ent));
if (b->model == cl_mod_lightning)
{
model_length = 35.0;
d-= 20.0; // correction so it doesn't end in middle of tesla
}
else
{
model_length = 30.0;
}
model_length = 30.0;
steps = ceil(d/model_length);
len = (d-model_length)/(steps-1);
// PMM - special case for lightning model .. if the real length is shorter than the model,
// flip it around & draw it from the end to the start. This prevents the model from going
// through the tesla mine (instead it goes through the target)
if ((b->model == cl_mod_lightning) && (d <= model_length))
{
// Msg ("special case\n");
VectorCopy (b->end, ent.origin);
// offset to push beam outside of tesla model (negative because dist is from end to start
// for this beam)
// for (j=0 ; j<3 ; j++)
// ent.origin[j] -= dist[j]*10.0;
ent.model = b->model;
ent.flags = RF_FULLBRIGHT;
ent.angles[0] = pitch;
ent.angles[1] = yaw;
ent.angles[2] = rand()%360;
V_AddEntity (&ent);
return;
}
while (d > 0)
{
VectorCopy (org, ent.origin);
ent.model = b->model;
if (b->model == cl_mod_lightning)
{
ent.flags = RF_FULLBRIGHT;
ent.angles[0] = -pitch;
ent.angles[1] = yaw + 180.0;
ent.angles[2] = rand()%360;
}
else
{
ent.angles[0] = pitch;
ent.angles[1] = yaw;
ent.angles[2] = rand()%360;
}
// Msg("B: %d -> %d\n", b->entity, b->dest_entity);
V_AddEntity (&ent);
for (j=0 ; j<3 ; j++)
org[j] += dist[j]*len;
d -= model_length;
}
}
}
/*
// Msg ("Endpoint: %f %f %f\n", b->end[0], b->end[1], b->end[2]);
// Msg ("Pred View Angles: %f %f %f\n", cl.predicted_angles[0], cl.predicted_angles[1], cl.predicted_angles[2]);
// Msg ("Act View Angles: %f %f %f\n", cl.refdef.viewangles[0], cl.refdef.viewangles[1], cl.refdef.viewangles[2]);
// VectorCopy (cl.predicted_origin, b->start);
// b->start[2] += 22; // adjust for view height
// if (fabs(cl.refdef.vieworg[2] - b->start[2]) >= 10) {
// b->start[2] = cl.refdef.vieworg[2];
// }
// Msg ("Time: %d %d %f\n", cl.time, cls.realtime, cls.frametime);
*/
extern cvar_t *hand;
/*
=================
ROGUE - draw player locked beams
CL_AddPlayerBeams
=================
*/
void CL_AddPlayerBeams (void)
{
int i,j;
beam_t *b;
vec3_t dist, org;
float d;
entity_t ent;
float yaw, pitch;
float forward;
float len, steps;
float model_length;
float hand_multiplier;
//PMM
if (hand)
{
if (hand->value == 2)
hand_multiplier = 0;
else if (hand->value == 1)
hand_multiplier = -1;
else
hand_multiplier = 1;
}
else
{
hand_multiplier = 1;
}
//PMM
// update beams
for (i=0, b=cl_playerbeams ; i< MAX_BEAMS ; i++, b++)
{
if (!b->model || b->endtime < cl.time)
continue;
// if coming from the player, update the start position
if (b->entity == cl.playernum+1) // entity 0 is the world
{
VectorCopy (cl.refdef.vieworg, b->start);
b->start[2] -= 22; // adjust for view height
}
VectorAdd (b->start, b->offset, org);
// calculate pitch and yaw
VectorSubtract (b->end, org, dist);
if (dist[1] == 0 && dist[0] == 0)
{
yaw = 0;
if (dist[2] > 0)
pitch = 90;
else
pitch = 270;
}
else
{
// PMM - fixed to correct for pitch of 0
if (dist[0])
yaw = (atan2(dist[1], dist[0]) * 180 / M_PI);
else if (dist[1] > 0)
yaw = 90;
else
yaw = 270;
if (yaw < 0)
yaw += 360;
forward = sqrt (dist[0]*dist[0] + dist[1]*dist[1]);
pitch = (atan2(dist[2], forward) * -180.0 / M_PI);
if (pitch < 0)
pitch += 360.0;
}
// add new entities for the beams
d = VectorNormalize(dist);
memset (&ent, 0, sizeof(ent));
if (b->model == cl_mod_lightning)
{
model_length = 35.0;
d-= 20.0; // correction so it doesn't end in middle of tesla
}
else
{
model_length = 30.0;
}
steps = ceil(d/model_length);
len = (d-model_length)/(steps-1);
// PMM - special case for lightning model .. if the real length is shorter than the model,
// flip it around & draw it from the end to the start. This prevents the model from going
// through the tesla mine (instead it goes through the target)
if ((b->model == cl_mod_lightning) && (d <= model_length))
{
// Msg ("special case\n");
VectorCopy (b->end, ent.origin);
// offset to push beam outside of tesla model (negative because dist is from end to start
// for this beam)
// for (j=0 ; j<3 ; j++)
// ent.origin[j] -= dist[j]*10.0;
ent.model = b->model;
ent.flags = RF_FULLBRIGHT;
ent.angles[0] = pitch;
ent.angles[1] = yaw;
ent.angles[2] = rand()%360;
V_AddEntity (&ent);
return;
}
while (d > 0)
{
VectorCopy (org, ent.origin);
ent.model = b->model;
if (b->model == cl_mod_lightning)
{
ent.flags = RF_FULLBRIGHT;
ent.angles[0] = -pitch;
ent.angles[1] = yaw + 180.0;
ent.angles[2] = rand()%360;
}
else
{
ent.angles[0] = pitch;
ent.angles[1] = yaw;
ent.angles[2] = rand()%360;
}
// Msg("B: %d -> %d\n", b->entity, b->dest_entity);
V_AddEntity (&ent);
for (j=0 ; j<3 ; j++)
@ -1558,25 +951,6 @@ void CL_AddLasers (void)
}
}
/* PMM - CL_Sustains */
void CL_ProcessSustain ()
{
cl_sustain_t *s;
int i;
for (i=0, s=cl_sustains; i< MAX_SUSTAINS; i++, s++)
{
if (s->id)
if ((s->endtime >= cl.time) && (cl.time >= s->nextthink))
{
// Msg ("think %d %d %d\n", cl.time, s->nextthink, s->thinkinterval);
s->think (s);
}
else if (s->endtime < cl.time)
s->id = 0;
}
}
/*
=================
CL_AddTEnts
@ -1585,10 +959,6 @@ CL_AddTEnts
void CL_AddTEnts (void)
{
CL_AddBeams ();
// PMM - draw plasma beams
CL_AddPlayerBeams ();
CL_AddExplosions ();
CL_AddLasers ();
// PMM - set up sustain
CL_ProcessSustain();
}

View File

@ -314,25 +314,6 @@ bool CL_CheckOrDownloadFile (char *filename);
void CL_AddNetgraph (void);
//ROGUE
typedef struct cl_sustain
{
int id;
int type;
int endtime;
int nextthink;
int thinkinterval;
vec3_t org;
vec3_t dir;
int color;
int count;
int magnitude;
void (*think)(struct cl_sustain *self);
} cl_sustain_t;
#define MAX_SUSTAINS 32
void CL_ParticleSteamEffect2(cl_sustain_t *self);
void CL_TeleporterParticles (entity_state_t *ent);
void CL_ParticleEffect (vec3_t org, vec3_t dir, int color, int count);
void CL_ParticleEffect2 (vec3_t org, vec3_t dir, int color, int count);
@ -400,8 +381,6 @@ void CL_Tracker_Shell(vec3_t origin);
void CL_MonsterPlasma_Shell(vec3_t origin);
void CL_ColorExplosionParticles (vec3_t org, int color, int run);
void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude);
void CL_Widowbeamout (cl_sustain_t *self);
void CL_Nukeblast (cl_sustain_t *self);
void CL_WidowSplash (vec3_t org);
// PGM
// ========

View File

@ -1596,121 +1596,6 @@ static const char *xatcredits[] =
0
};
static const char *roguecredits[] =
{
"+QUAKE II MISSION PACK 2: GROUND ZERO",
"+BY",
"+ROGUE ENTERTAINMENT, INC.",
"",
"+PRODUCED BY",
"Jim Molinets",
"",
"+PROGRAMMING",
"Peter Mack",
"Patrick Magruder",
"",
"+LEVEL DESIGN",
"Jim Molinets",
"Cameron Lamprecht",
"Berenger Fish",
"Robert Selitto",
"Steve Tietze",
"Steve Thoms",
"",
"+ART DIRECTION",
"Rich Fleider",
"",
"+ART",
"Rich Fleider",
"Steve Maines",
"Won Choi",
"",
"+ANIMATION SEQUENCES",
"Creat Studios",
"Steve Maines",
"",
"+ADDITIONAL LEVEL DESIGN",
"Rich Fleider",
"Steve Maines",
"Peter Mack",
"",
"+SOUND",
"James Grunke",
"",
"+GROUND ZERO THEME",
"+AND",
"+MUSIC BY",
"Sonic Mayhem",
"",
"+VWEP MODELS",
"Brent \"Hentai\" Dill",
"",
"",
"",
"+SPECIAL THANKS",
"+TO",
"+OUR FRIENDS AT ID SOFTWARE",
"",
"John Carmack",
"John Cash",
"Brian Hook",
"Adrian Carmack",
"Kevin Cloud",
"Paul Steed",
"Tim Willits",
"Christian Antkow",
"Paul Jaquays",
"Brandon James",
"Todd Hollenshead",
"Barrett (Bear) Alexander",
"Katherine Anna Kang",
"Donna Jackson",
"Dave \"Zoid\" Kirsch",
"",
"",
"",
"+THANKS TO ACTIVISION",
"+IN PARTICULAR:",
"",
"Marty Stratton",
"Henk Hartong",
"Mitch Lasky",
"Steve Rosenthal",
"Steve Elwell",
"",
"+AND THE GAME TESTERS",
"",
"The Ranger Clan",
"Dave \"Zoid\" Kirsch",
"Nihilistic Software",
"Robert Duffy",
"",
"And Countless Others",
"",
"",
"",
"Quake II Mission Pack 2: Ground Zero",
"(tm) (C)1998 Id Software, Inc. All",
"Rights Reserved. Developed by Rogue",
"Entertainment, Inc. for Id Software,",
"Inc. Distributed by Activision Inc.",
"under license. Quake(R) is a",
"registered trademark of Id Software,",
"Inc. Quake II Mission Pack 2: Ground",
"Zero(tm), Quake II(tm), the Id",
"Software name, the \"Q II\"(tm) logo",
"and id(tm) logo are trademarks of Id",
"Software, Inc. Activision(R) is a",
"registered trademark of Activision,",
"Inc. Rogue(R) is a registered",
"trademark of Rogue Entertainment,",
"Inc. All other trademarks and trade",
"names are properties of their",
"respective owners.",
0
};
void M_Credits_MenuDraw( void )
{
int i, y;
@ -2354,44 +2239,10 @@ void StartServerActionFunc( void *self )
Cvar_SetValue ("timelimit", ClampCvar( 0, timelimit, timelimit ) );
Cvar_SetValue ("fraglimit", ClampCvar( 0, fraglimit, fraglimit ) );
Cvar_Set("hostname", s_hostname_field.buffer );
// Cvar_SetValue ("deathmatch", !s_rules_box.curvalue );
// Cvar_SetValue ("coop", s_rules_box.curvalue );
//PGM
if(s_rules_box.curvalue < 2)
{
Cvar_SetValue ("deathmatch", !s_rules_box.curvalue );
Cvar_SetValue ("coop", s_rules_box.curvalue );
Cvar_SetValue ("gamerules", 0 );
}
else
{
Cvar_SetValue ("deathmatch", 1 ); // deathmatch is always true for rogue games, right?
Cvar_SetValue ("coop", 0 ); // FIXME - this might need to depend on which game we're running
Cvar_SetValue ("gamerules", s_rules_box.curvalue );
}
//PGM
Cvar_SetValue ("deathmatch", !s_rules_box.curvalue );
Cvar_SetValue ("coop", s_rules_box.curvalue );
spot = NULL;
if (s_rules_box.curvalue == 1) // PGM
{
if(strcasecmp(startmap, "bunk1") == 0)
spot = "start";
else if(strcasecmp(startmap, "mintro") == 0)
spot = "start";
else if(strcasecmp(startmap, "fact1") == 0)
spot = "start";
else if(strcasecmp(startmap, "power1") == 0)
spot = "pstart";
else if(strcasecmp(startmap, "biggun") == 0)
spot = "bstart";
else if(strcasecmp(startmap, "hangar1") == 0)
spot = "unitstart";
else if(strcasecmp(startmap, "city1") == 0)
spot = "unitstart";
else if(strcasecmp(startmap, "boss1") == 0)
spot = "bosstart";
}
if (spot)
{
@ -2746,13 +2597,6 @@ static menulist_s s_infinite_ammo_box;
static menulist_s s_fixed_fov_box;
static menulist_s s_quad_drop_box;
//ROGUE
static menulist_s s_no_mines_box;
static menulist_s s_no_nukes_box;
static menulist_s s_stack_double_box;
static menulist_s s_no_spheres_box;
//ROGUE
static void DMFlagCallback( void *self )
{
menulist_s *f = ( menulist_s * ) self;

View File

@ -202,10 +202,6 @@ SOURCE=.\common\keys.c
# End Source File
# Begin Source File
SOURCE=..\server\m_flash.c
# End Source File
# Begin Source File
SOURCE=.\common\md4.c
# End Source File
# Begin Source File

View File

@ -1397,7 +1397,7 @@ loading and unpack to rgba any known image
rgbdata_t *FS_LoadImage(const char *filename, char *buffer, int buffsize )
{
imageformat_t *format;
char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
char *suf[6] = {"ft", "bk", "rt", "lf", "up", "dn"};
char path[128], loadname[128], texname[128];
int i, filesize = 0;
byte *f;

View File

@ -98,25 +98,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define RF_SHELL_RED 1024
#define RF_SHELL_GREEN 2048
#define RF_SHELL_BLUE 4096
//ROGUE
#define RF_IR_VISIBLE 0x00008000 // 32768
#define RF_SHELL_DOUBLE 0x00010000 // 65536
#define RF_SHELL_HALF_DAM 0x00020000
#define RF_USE_DISGUISE 0x00040000
//ROGUE
//lazarus
#define RF_VAMPIRE 0x00080000 // 524288
// player_state_t->refdef flags
#define RDF_UNDERWATER 1 // warp the screen as apropriate
#define RDF_NOWORLDMODEL 2 // used for player configuration screen
//ROGUE
#define RDF_NOWORLDMODEL 2 // used for player configuration screen
#define RDF_IRGOGGLES 4
#define RDF_UVGOGGLES 8
//ROGUE
#define RDF_BLOOM 32
#define RDF_PAIN 64
@ -412,15 +406,6 @@ typedef struct
#define EF_PLASMA 0x01000000
#define EF_TRAP 0x02000000
//ROGUE
#define EF_TRACKER 0x04000000
#define EF_DOUBLE 0x08000000
#define EF_SPHERETRANS 0x10000000
#define EF_TAGTRAIL 0x20000000
#define EF_HALF_DAMAGE 0x40000000
#define EF_TRACKERTRAIL 0x80000000
//ROGUE
//
// muzzle flashes / player effects
//
@ -446,19 +431,6 @@ typedef struct
#define MZ_PHALANX 18
#define MZ_SILENCED 128 // bit flag ORed with one of the above numbers
//ROGUE
#define MZ_ETF_RIFLE 30
#define MZ_UNUSED 31
#define MZ_SHOTGUN2 32
#define MZ_HEATBEAM 33
#define MZ_BLASTER2 34
#define MZ_TRACKER 35
#define MZ_NUKE1 36
#define MZ_NUKE2 37
#define MZ_NUKE4 38
#define MZ_NUKE8 39
//ROGUE
//
// monster muzzle flashes
//
@ -615,83 +587,6 @@ typedef struct
#define MZ2_BOSS2_MACHINEGUN_R4 136
#define MZ2_BOSS2_MACHINEGUN_R5 137
//ROGUE
#define MZ2_CARRIER_MACHINEGUN_L1 138
#define MZ2_CARRIER_MACHINEGUN_R1 139
#define MZ2_CARRIER_GRENADE 140
#define MZ2_TURRET_MACHINEGUN 141
#define MZ2_TURRET_ROCKET 142
#define MZ2_TURRET_BLASTER 143
#define MZ2_STALKER_BLASTER 144
#define MZ2_DAEDALUS_BLASTER 145
#define MZ2_MEDIC_BLASTER_2 146
#define MZ2_CARRIER_RAILGUN 147
#define MZ2_WIDOW_DISRUPTOR 148
#define MZ2_WIDOW_BLASTER 149
#define MZ2_WIDOW_RAIL 150
#define MZ2_WIDOW_PLASMABEAM 151 // PMM - not used
#define MZ2_CARRIER_MACHINEGUN_L2 152
#define MZ2_CARRIER_MACHINEGUN_R2 153
#define MZ2_WIDOW_RAIL_LEFT 154
#define MZ2_WIDOW_RAIL_RIGHT 155
#define MZ2_WIDOW_BLASTER_SWEEP1 156
#define MZ2_WIDOW_BLASTER_SWEEP2 157
#define MZ2_WIDOW_BLASTER_SWEEP3 158
#define MZ2_WIDOW_BLASTER_SWEEP4 159
#define MZ2_WIDOW_BLASTER_SWEEP5 160
#define MZ2_WIDOW_BLASTER_SWEEP6 161
#define MZ2_WIDOW_BLASTER_SWEEP7 162
#define MZ2_WIDOW_BLASTER_SWEEP8 163
#define MZ2_WIDOW_BLASTER_SWEEP9 164
#define MZ2_WIDOW_BLASTER_100 165
#define MZ2_WIDOW_BLASTER_90 166
#define MZ2_WIDOW_BLASTER_80 167
#define MZ2_WIDOW_BLASTER_70 168
#define MZ2_WIDOW_BLASTER_60 169
#define MZ2_WIDOW_BLASTER_50 170
#define MZ2_WIDOW_BLASTER_40 171
#define MZ2_WIDOW_BLASTER_30 172
#define MZ2_WIDOW_BLASTER_20 173
#define MZ2_WIDOW_BLASTER_10 174
#define MZ2_WIDOW_BLASTER_0 175
#define MZ2_WIDOW_BLASTER_10L 176
#define MZ2_WIDOW_BLASTER_20L 177
#define MZ2_WIDOW_BLASTER_30L 178
#define MZ2_WIDOW_BLASTER_40L 179
#define MZ2_WIDOW_BLASTER_50L 180
#define MZ2_WIDOW_BLASTER_60L 181
#define MZ2_WIDOW_BLASTER_70L 182
#define MZ2_WIDOW_RUN_1 183
#define MZ2_WIDOW_RUN_2 184
#define MZ2_WIDOW_RUN_3 185
#define MZ2_WIDOW_RUN_4 186
#define MZ2_WIDOW_RUN_5 187
#define MZ2_WIDOW_RUN_6 188
#define MZ2_WIDOW_RUN_7 189
#define MZ2_WIDOW_RUN_8 190
#define MZ2_CARRIER_ROCKET_1 191
#define MZ2_CARRIER_ROCKET_2 192
#define MZ2_CARRIER_ROCKET_3 193
#define MZ2_CARRIER_ROCKET_4 194
#define MZ2_WIDOW2_BEAMER_1 195
#define MZ2_WIDOW2_BEAMER_2 196
#define MZ2_WIDOW2_BEAMER_3 197
#define MZ2_WIDOW2_BEAMER_4 198
#define MZ2_WIDOW2_BEAMER_5 199
#define MZ2_WIDOW2_BEAM_SWEEP_1 200
#define MZ2_WIDOW2_BEAM_SWEEP_2 201
#define MZ2_WIDOW2_BEAM_SWEEP_3 202
#define MZ2_WIDOW2_BEAM_SWEEP_4 203
#define MZ2_WIDOW2_BEAM_SWEEP_5 204
#define MZ2_WIDOW2_BEAM_SWEEP_6 205
#define MZ2_WIDOW2_BEAM_SWEEP_7 206
#define MZ2_WIDOW2_BEAM_SWEEP_8 207
#define MZ2_WIDOW2_BEAM_SWEEP_9 208
#define MZ2_WIDOW2_BEAM_SWEEP_10 209
#define MZ2_WIDOW2_BEAM_SWEEP_11 210
// ROGUE
extern vec3_t monster_flash_offset [];
@ -733,34 +628,8 @@ typedef enum
TE_BLUEHYPERBLASTER,
TE_PLASMA_EXPLOSION,
TE_TUNNEL_SPARKS,
//ROGUE
TE_BLASTER2,
TE_RAILTRAIL2,
TE_FLAME,
TE_LIGHTNING,
TE_DEBUGTRAIL,
TE_PLAIN_EXPLOSION,
TE_FLASHLIGHT,
TE_FORCEWALL,
TE_HEATBEAM,
TE_MONSTER_HEATBEAM,
TE_STEAM,
TE_BUBBLETRAIL2,
TE_MOREBLOOD,
TE_HEATBEAM_SPARKS,
TE_HEATBEAM_STEAM,
TE_CHAINFIST_SMOKE,
TE_ELECTRIC_SPARKS,
TE_TRACKER_EXPLOSION,
TE_TELEPORT_EFFECT,
TE_DBALL_GOAL,
TE_WIDOWBEAMOUT,
TE_NUKEBLAST,
TE_WIDOWSPLASH,
TE_EXPLOSION1_BIG,
TE_EXPLOSION1_NP,
TE_FLECHETTE
//ROGUE
TE_DEBUGTRAIL,
} temp_event_t;
#define SPLASH_UNKNOWN 0
@ -838,46 +707,6 @@ typedef enum
// RAFAEL
#define DF_QUADFIRE_DROP 0x00010000 // 65536
//ROGUE
#define DF_NO_MINES 0x00020000
#define DF_NO_STACK_DOUBLE 0x00040000
#define DF_NO_NUKES 0x00080000
#define DF_NO_SPHERES 0x00100000
//ROGUE
/*
ROGUE - VERSIONS
1234 08/13/1998 Activision
1235 08/14/1998 Id Software
1236 08/15/1998 Steve Tietze
1237 08/15/1998 Phil Dobranski
1238 08/15/1998 John Sheley
1239 08/17/1998 Barrett Alexander
1230 08/17/1998 Brandon Fish
1245 08/17/1998 Don MacAskill
1246 08/17/1998 David "Zoid" Kirsch
1247 08/17/1998 Manu Smith
1248 08/17/1998 Geoff Scully
1249 08/17/1998 Andy Van Fossen
1240 08/20/1998 Activision Build 2
1256 08/20/1998 Ranger Clan
1257 08/20/1998 Ensemble Studios
1258 08/21/1998 Robert Duffy
1259 08/21/1998 Stephen Seachord
1250 08/21/1998 Stephen Heaslip
1267 08/21/1998 Samir Sandesara
1268 08/21/1998 Oliver Wyman
1269 08/21/1998 Steven Marchegiano
1260 08/21/1998 Build #2 for Nihilistic
1278 08/21/1998 Build #2 for Ensemble
9999 08/20/1998 Internal Use
*/
#define ROGUE_VERSION_ID 1278
#define ROGUE_VERSION_STRING "08/21/1998 Beta 2 for Ensemble"
// ROGUE
/*
==========================================================

View File

@ -9,11 +9,6 @@
#define SVF_NOCLIENT 0x00000001 // don't send entity to clients, even if it has effects
#define SVF_DEADMONSTER 0x00000002 // treat as CONTENTS_DEADMONSTER for collision
#define SVF_MONSTER 0x00000004 // treat as CONTENTS_MONSTER for collision
//ROGUE -- added for things that are damageable, but not monsters
#define SVF_DAMAGEABLE 0x00000008
#define SVF_TRIGGER_CAMOWNER 0x00000010
#define SVF_MUD 0x00000020
//ROGUE end
// edict->solid values

View File

@ -37,12 +37,6 @@
#define SHELL_RG_COLOR 0xDC
#define SHELL_RB_COLOR 0x68
#define SHELL_BG_COLOR 0x78
//ROGUE
#define SHELL_DOUBLE_COLOR 0xDF // 223
#define SHELL_HALF_DAM_COLOR 0x90
#define SHELL_CYAN_COLOR 0x72
//ROGUE
#define SHELL_WHITE_COLOR 0xD7
enum comp_format

View File

@ -163,11 +163,11 @@ typedef enum
it_cubemap,
} imagetype_t;
// texnum supported cubemaps
// 0 = rt or normal image
// texnum cubemap order
// 0 = ft or normal image
// 1 = bk
// 2 = lf
// 3 = ft
// 2 = rt
// 3 = lf
// 4 = up
// 5 = dn

View File

@ -540,7 +540,18 @@ void MakeSkyVec (float s, float t, int axis)
R_DrawSkyBox
==============
*/
int skytexorder[6] = {0,2,1,3,4,5};
int skytexorder[6] = {4, 5, 1, 0, 2, 3}; //var. 1
uint RemapSides[6] =
{
0, // ft
2, // bk
4, // rt
5, // lf
1, // up
3, // dn
};
void R_DrawSkyBox (void)
{
int i;

View File

@ -1587,6 +1587,7 @@ image_t *R_FindImage (char *name, char *buffer, int size, imagetype_t type)
return image;
}
/*
================
R_LoadImage

View File

@ -1,399 +0,0 @@
// g_camera.c (func_monitor)
#include "g_local.h"
void camera_off (edict_t *ent)
{
int i;
if (!ent->client)
return;
if (!ent->client->spycam)
return;
if(ent->client->spycam->viewer == ent)
ent->client->spycam->viewer = NULL;
ent->client->spycam->flags &= ~FL_ROBOT;
if(ent->client->spycam->svflags & SVF_MONSTER)
ent->client->spycam->svflags &= ~SVF_NOCLIENT;
VectorCopy(ent->client->camplayer->s.origin,ent->s.origin);
free(ent->client->camplayer->client);
G_FreeEdict (ent->client->camplayer);
// set angles
ent->movetype = MOVETYPE_WALK;
ent->client->ps.pmove.pm_type = PM_NORMAL;
for (i=0 ; i<3 ; i++)
ent->client->ps.pmove.delta_angles[i] =
ANGLE2SHORT(ent->client->org_viewangles[i] - ent->client->resp.cmd_angles[i]);
VectorCopy(ent->client->org_viewangles, ent->client->resp.cmd_angles);
VectorCopy(ent->client->org_viewangles, ent->s.angles);
VectorCopy(ent->client->org_viewangles, ent->client->ps.viewangles);
VectorCopy(ent->client->org_viewangles, ent->client->v_angle);
ent->client->ps.gunindex = gi.modelindex(ent->client->pers.weapon->view_model);
ent->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
ent->svflags &= ~SVF_NOCLIENT;
ent->clipmask = MASK_PLAYERSOLID;
ent->solid = SOLID_BBOX;
ent->client->camplayer = NULL;
ent->client->spycam = NULL;
gi.linkentity(ent);
// if we were previously in third person view, restore it
if(tpp->value)
Cmd_Chasecam_Toggle (ent);
}
void faker_animate(edict_t *self)
{
if(self->s.frame < 0 || self->s.frame > 39)
{
self->s.frame = 0;
}
else
{
self->s.frame++;
if(self->s.frame > 39)
self->s.frame = 0;
}
self->nextthink = level.time + FRAMETIME;
gi.linkentity(self);
}
void camera_on (edict_t *ent)
{
gclient_t *cl;
edict_t *faker;
edict_t *monster;
edict_t *camera;
int i;
vec3_t forward, left, up;
if (!ent->client)
return;
if (!ent->client->spycam)
return;
// "viewer" can control camera aim (2nd player to come along and use
// camera cannot)
camera = ent->client->spycam;
if(camera->monsterinfo.aiflags & AI_ACTOR)
camera->flags |= FL_ROBOT;
if(!camera->viewer)
camera->viewer = ent;
// save current viewangles and restore them with camera_off
VectorCopy(ent->client->v_angle,ent->client->org_viewangles);
// copy over all important player data to fake player
ent->client->camplayer = G_Spawn();
faker = ent->client->camplayer;
faker->s.frame = ent->s.frame;
VectorCopy (ent->s.origin, faker->s.origin);
VectorCopy (ent->velocity, faker->velocity);
VectorCopy (ent->s.angles, faker->s.angles);
faker->s = ent->s;
faker->takedamage = DAMAGE_AIM;
faker->movetype = MOVETYPE_WALK;
faker->groundentity = ent->groundentity;
faker->viewheight = ent->viewheight;
faker->inuse = true;
faker->classname = "camplayer";
faker->class_id = ENTITY_CAMPLAYER;
faker->mass = ent->mass;
faker->solid = SOLID_BBOX;
faker->deadflag = DEAD_NO;
faker->clipmask = MASK_PLAYERSOLID;
faker->health = ent->health;
faker->light_level = ent->light_level;
faker->think = faker_animate;
faker->nextthink = level.time + FRAMETIME;
VectorCopy(ent->mins,faker->mins);
VectorCopy(ent->maxs,faker->maxs);
// create a client so you can pick up items/be shot/etc while in camera
cl = (gclient_t *) malloc(sizeof(gclient_t));
memset(cl,0,sizeof(gclient_t));
ent->client->camplayer->client = cl;
ent->client->camplayer->target_ent = ent;
gi.linkentity (faker);
AngleVectors(camera->s.angles,forward,left,up);
VectorMA(camera->s.origin, camera->move_origin[0],forward,ent->s.origin);
VectorMA(ent->s.origin, -camera->move_origin[1],left, ent->s.origin);
VectorMA(ent->s.origin, camera->move_origin[2],up, ent->s.origin);
ent->movetype = MOVETYPE_NOCLIP;
ent->clipmask = 0;
ent->solid = SOLID_NOT;
VectorClear(ent->velocity);
ent->client->ps.gunindex = 0;
ent->client->ps.pmove.pm_flags |= PMF_NO_PREDICTION;
ent->svflags |= SVF_NOCLIENT;
// check to see if we're the enemy of any monster. If so, make the
// faker the enemy
for(i=maxclients->value+1, monster=g_edicts+i; i<globals.num_edicts; i++, monster++) {
if(!monster->inuse) continue;
if(!(monster->svflags & SVF_MONSTER)) continue;
if(monster->enemy == ent) {
monster->enemy = faker;
FoundTarget(monster);
}
}
if(ent->client->spycam->viewmessage)
gi.centerprintf(ent,ent->client->spycam->viewmessage);
}
edict_t *G_FindNextCamera (edict_t *camera, edict_t *monitor)
{
edict_t *next;
if(!monitor->target) return NULL;
// If we already have a camera that's a monster, make it visible now
if(camera && (camera->svflags & SVF_MONSTER))
{
camera->svflags &= ~SVF_NOCLIENT;
gi.linkentity(camera);
}
// First, determine if we're going to use the "count" to get the next camera,
// or just scan through the list of entities. If count for the first camera
// in the map is 0, then we'll just use the map order.
next = G_Find(NULL,FOFS(targetname),monitor->target);
if(!next) return NULL;
if(!next->count) {
if(camera) {
next = camera;
next++;
} else
next = g_edicts;
for ( ; next < &g_edicts[globals.num_edicts] ; next++)
{
if (next == camera)
continue;
if (!next->inuse)
continue;
if (next->deadflag == DEAD_DEAD)
continue;
if (!next->targetname)
continue;
// don't select "inactive" cameras
if ((next->class_id == ENTITY_TURRET_BREACH) && (next->spawnflags & 16))
continue;
if (!strcasecmp (next->targetname, monitor->target))
goto found_one;
}
next = g_edicts;
for ( ; next < camera ; next++)
{
if (next == camera)
continue;
if (!next->inuse)
continue;
if (next->deadflag == DEAD_DEAD)
continue;
if (!next->targetname)
continue;
// don't select "inactive" cameras
if ((next->class_id == ENTITY_TURRET_BREACH) && (next->spawnflags & 16))
continue;
if (!strcasecmp (next->targetname, monitor->target))
goto found_one;
}
} else {
int which, start;
if(camera) {
which = camera->count+1;
if(which > monitor->count) which = 1;
}
else
which = 1;
start = which;
next = g_edicts+1;
while(1) {
if(next->targetname) {
if(!strcasecmp(next->targetname,monitor->target)) {
if(next->count == which) {
if(!next->inuse || (next->deadflag == DEAD_DEAD) ||
((next->class_id == ENTITY_TURRET_BREACH) && (next->spawnflags & 16)) )
{
next = g_edicts;
which++;
if(which > monitor->count) which=1;
if(which == start) return NULL;
} else
goto found_one;
}
}
}
if(next == &g_edicts[globals.num_edicts-1]) {
next = g_edicts;
which++;
if(which > monitor->count) which = 1;
if(which == start) return NULL;
}
next++;
}
}
return NULL;
found_one:
if(!(monitor->spawnflags & 32) && (next->svflags & SVF_MONSTER))
next->svflags |= SVF_NOCLIENT;
return next;
}
edict_t *G_FindPrevCamera (edict_t *camera, edict_t *monitor)
{
edict_t *prev;
edict_t *newcamera;
if(!monitor->target) return NULL;
// If we already have a camera that's a monster, make it visible now
if(camera && (camera->svflags & SVF_MONSTER))
{
camera->svflags &= ~SVF_NOCLIENT;
gi.linkentity(camera);
}
// First, determine if we're going to use the "count" to get the next camera,
// or just scan through the list of entities. If count for the first camera
// in the map is 0, then we'll just use the map order.
prev = G_Find(NULL,FOFS(targetname),monitor->target);
if(!prev) return NULL;
if(!prev->count)
{
newcamera = NULL;
for (prev = g_edicts ; prev < &g_edicts[globals.num_edicts] ; prev++)
{
if (prev == camera) {
if(newcamera) goto found_one;
continue;
}
if (!prev->inuse)
continue;
if (prev->deadflag == DEAD_DEAD)
continue;
if (!prev->targetname)
continue;
// don't select "inactive" cameras
if ((prev->class_id == ENTITY_TURRET_BREACH) && (prev->spawnflags & 16))
continue;
if (!strcasecmp (prev->targetname, monitor->target))
newcamera = prev;
}
goto found_one;
}
else
{
int which, start;
if(camera) {
which = camera->count-1;
if(which <= 0) which = monitor->count;
}
else
which = monitor->count;
start = which;
prev = g_edicts+1;
while(1) {
if(prev->targetname) {
if(!strcasecmp(prev->targetname,monitor->target)) {
if(prev->count == which) {
if(!prev->inuse || (prev->deadflag == DEAD_DEAD) ||
((prev->class_id == ENTITY_TURRET_BREACH) && (prev->spawnflags & 16)))
{
prev = g_edicts;
which--;
if(which <= 0) which=monitor->count;
if(which == start) return NULL;
}
else
{
newcamera = prev;
goto found_one;
}
}
}
}
if(prev == &g_edicts[globals.num_edicts-1]) {
prev = g_edicts;
which--;
if(which <= 0) which=monitor->count;
if(which == start) return NULL;
}
prev++;
}
}
found_one:
if(!(monitor->spawnflags & 32) && (newcamera->svflags & SVF_MONSTER))
newcamera->svflags |= SVF_NOCLIENT;
return newcamera;
}
void use_camera (edict_t *self, edict_t *other, edict_t *activator)
{
edict_t *target;
if(!activator->client) return;
if(activator->client->spycam) // already using camera
return;
target = G_FindNextCamera(NULL,self);
if(!target) return;
// if currently in thirdperson, turn that sucker off
if(tpp->value && activator->client->chasetoggle)
Cmd_Chasecam_Toggle (activator);
activator->client->spycam = target;
activator->client->monitor = self;
camera_on(activator);
}
void func_monitor_init (edict_t *self)
{
edict_t *camera;
self->count = 0;
camera = NULL;
while( (camera=G_Find(camera,FOFS(targetname),self->target)) != NULL)
self->count++;
if(!self->count)
self->s.effects = 0; // don't animate a func_monitor that has no cameras
}
void SP_func_monitor (edict_t *self)
{
if( !self->target ) {
gi.dprintf("func_monitor without a target at %s\n",vtos(self->s.origin));
G_FreeEdict(self);
return;
}
self->class_id = ENTITY_FUNC_MONITOR;
if (self->spawnflags & 8)
self->s.effects |= EF_ANIM_ALL;
if (self->spawnflags & 16)
self->s.effects |= EF_ANIM_ALLFAST;
gi.setmodel (self, self->model);
self->movetype = MOVETYPE_NONE;
self->solid = SOLID_BSP;
self->use = use_camera;
self->think = func_monitor_init;
self->nextthink = level.time + 2*FRAMETIME;
gi.linkentity(self);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,908 +0,0 @@
#include "g_local.h"
#include <windows.h>
#define __MSC__
#include <gl/gl.h>
#define GR_FOG_TABLE_SIZE 128
#define GR_FOG_DISABLE 0x0
#define GR_FOG_WITH_TABLE 0x2
typedef signed long GrChromakeyMode_t;
typedef signed long GrFogMode_t;
typedef unsigned long GrColor_t;
typedef unsigned char GrAlpha_t;
typedef unsigned long GrMipMapId_t;
typedef unsigned char GrFog_t;
typedef void (__stdcall *GrProc)();
fog_t gfogs[MAX_FOGS];
fog_t trig_fade_fog;
fog_t fade_fog;
fog_t *pfog;
GrFog_t fogtable[GR_FOG_TABLE_SIZE];
bool fogtable_generated=false;
HMODULE hGlide;
HMODULE hOpenGL;
bool InTriggerFog;
float last_software_frame;
float last_3dfx_frame;
float last_opengl_frame;
int GLModels[3] = {GL_LINEAR, GL_EXP, GL_EXP2};
typedef void (__stdcall *GRBUFFERCLEAR) ( GrColor_t color, GrAlpha_t alpha, unsigned short depth );
typedef void (__stdcall *GRFOGCOLORVALUE) ( GrColor_t value );
typedef void (__stdcall *GRFOGMODE) ( GrFogMode_t mode );
typedef void (__stdcall *GRFOGTABLE) ( GrFog_t fogTable[GR_FOG_TABLE_SIZE] );
typedef void (__stdcall *GUFOGGENERATEEXP) ( GrFog_t fogTable[GR_FOG_TABLE_SIZE], float density );
typedef void (__stdcall *GUFOGGENERATEEXP2) ( GrFog_t fogTable[GR_FOG_TABLE_SIZE], float density );
typedef void (__stdcall *GUFOGGENERATELINEAR) ( GrFog_t fogTable[GR_FOG_TABLE_SIZE], float nearW, float farW );
GRBUFFERCLEAR Glide_grBufferClear;
GRFOGCOLORVALUE Glide_grFogColorValue;
GRFOGMODE Glide_grFogMode;
GRFOGTABLE Glide_grFogTable;
GUFOGGENERATEEXP Glide_guFogGenerateExp;
GUFOGGENERATEEXP2 Glide_guFogGenerateExp2;
GUFOGGENERATELINEAR Glide_guFogGenerateLinear;
typedef void (__stdcall *GRCHROMAKEYMODE) ( GrChromakeyMode_t mode );
typedef void (__stdcall *GRCHROMAKEYVALUE) ( GrColor_t value );
GRCHROMAKEYMODE Glide_grChromakeyMode;
GRCHROMAKEYVALUE Glide_grChromakeyValue;
//typedef void (__stdcall *GRCOLORCOMBINE) ( GrCombineFunction_t function, GrCombineFactor_t factor,
// GrCombineLocal_t local, GrCombineOther_t other,
// FxBool invert );
//typedef void (__stdcall *GRCONSTANTCOLORVALUE) ( GrColor_t value );
//typedef void (__stdcall *GRDRAWPOINT) ( const GrVertex *pt );
//GRCOLORCOMBINE Glide_grColorCombine;
//GRCONSTANTCOLORVALUE Glide_grConstantColorValue;
//GRDRAWPOINT Glide_grDrawPoint;
typedef void (WINAPI *GLCLEARCOLOR) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
typedef void (WINAPI *GLDISABLE) (GLenum cap);
typedef void (WINAPI *GLENABLE) (GLenum cap);
typedef void (WINAPI *GLFOGF) (GLenum pname, GLfloat param);
typedef void (WINAPI *GLFOGFV) (GLenum pname, const GLfloat *params);
typedef void (WINAPI *GLFOGI) (GLenum pname, GLint param);
typedef void (WINAPI *GLHINT) (GLenum target, GLenum mode);
GLCLEARCOLOR GL_glClearColor;
GLDISABLE GL_glDisable;
GLENABLE GL_glEnable;
GLFOGF GL_glFogf;
GLFOGFV GL_glFogfv;
GLFOGI GL_glFogi;
GLHINT GL_glHint;
#define FOG_ON 1
#define FOG_TOGGLE 2
#define FOG_TURNOFF 4
#define FOG_STARTOFF 8
#define COLOR(r,g,b) ((((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16)))
void GlideFogTable();
void fog_fade (edict_t *self);
void Fog_Off()
{
if(deathmatch->value || coop->value)
return;
if(hOpenGL) GL_glDisable (GL_FOG);
}
void Fog_ConsoleFog()
{
// This routine is ONLY called for console fog commands
if(deathmatch->value || coop->value)
return;
if(!level.active_fog) return;
memcpy(&level.fog,&gfogs[0],sizeof(fog_t));
pfog = &level.fog;
// Force sensible values for linear:
if(pfog->Model==0 && pfog->Near==0. && pfog->Far==0.)
{
pfog->Near=64;
pfog->Far=1024;
}
GlideFogTable();
}
void Cmd_Say_f (edict_t *ent, bool team, bool arg0);
void Cmd_Fog_f(edict_t *ent)
{
char *cmd;
char *parm;
fog_t *fog;
fog = &gfogs[0];
cmd = gi.argv(0);
if(gi.argc() < 2)
parm = NULL;
else
parm = gi.argv(1);
if (strcasecmp (cmd, "fog_help") == 0 )
{
gi.dprintf("Fog parameters for console only.\n"
"Use fog_active to see parameters for currently active fog.\n");
gi.dprintf("\nUse \"fog [0/1]\" to turn fog off/on (currently %s)\n"
"Current GL driver is %s\n",(level.active_fog > 0 ? "on" : "off"), gl_driver->string);
gi.dprintf("Fog_Red = red component (0-1)\n"
"Fog_Grn = green component (0-1)\n"
"Fog_Blu = blue component (0-1)\n"
"Fog_Model 0=linear, 1=exponential, 2=exponential squared\n\n"
"Linear parameters:\n"
"Fog_Near = fog start distance (>0 and < Fog_Far)\n"
"Fog_Far = distance where objects are completely obscured\n"
" (<5000 and > Fog_Near)\n"
"Exponential parameters:\n"
"Fog_Density Best results with values < 100\n\n"
"Command without a value will show current setting\n");
}
else if(strcasecmp (cmd, "fog_active") == 0 )
{
if(level.active_fog)
{
gi.dprintf("Active fog:\n"
" Color: %f, %f, %f\n"
" Model: %s\n",
level.fog.Color[0],level.fog.Color[1],level.fog.Color[2],
(level.fog.Model==1 ? "Exp" : (level.fog.Model==2 ? "Exp2" : "Linear")));
if(level.fog.Model)
gi.dprintf("Density: %f\n",level.fog.Density);
else
{
gi.dprintf(" Near: %f\n",level.fog.Near);
gi.dprintf(" Far: %f\n",level.fog.Far);
}
}
else
gi.dprintf("No fogs currently active\n");
}
else if(strcasecmp (cmd, "fog_stuff") == 0 )
{
gi.dprintf("active_fog=%d, last_active_fog=%d\n",level.active_fog,level.last_active_fog);
}
else if(strcasecmp (cmd, "fog") == 0 )
{
if(parm)
{
int on;
on = atoi(parm);
level.active_fog = level.active_target_fog = (on ? 1 : 0);
Fog_ConsoleFog();
}
gi.dprintf("fog is %s\n",(level.active_fog ? "on" : "off"));
}
else if(strcasecmp (cmd, "Fog_Red") == 0 )
{
if(!parm)
gi.dprintf("%s = %f\n",cmd,fog->Color[0]);
else
{
level.active_fog = level.active_target_fog = 1;
fog->Color[0] = max(0.0f,min(1.0f,(float)atof(parm)));
fog->GlideColor[0] = (int)(255 * fog->Color[0]);
Fog_ConsoleFog();
}
}
else if(strcasecmp (cmd, "Fog_Grn") == 0 )
{
if(!parm)
gi.dprintf("%s = %f\n",cmd,fog->Color[1]);
else
{
level.active_fog = level.active_target_fog = 1;
fog->Color[1] = max(0.0f,min(1.0f,(float)atof(parm)));
fog->GlideColor[1] = (int)(255 * fog->Color[1]);
Fog_ConsoleFog();
}
}
else if(strcasecmp (cmd, "Fog_Blu") == 0 )
{
if(!parm)
gi.dprintf("%s = %f\n",cmd,fog->Color[2]);
else
{
level.active_fog = level.active_target_fog = 1;
fog->Color[2] = max(0.0f,min(1.0f,(float)atof(parm)));
fog->GlideColor[2] = (int)(255 * fog->Color[2]);
Fog_ConsoleFog();
}
}
else if(strcasecmp (cmd, "Fog_Near") == 0 )
{
if(!parm)
gi.dprintf("%s = %f\n",cmd,fog->Near);
else
{
level.active_fog = level.active_target_fog = 1;
fog->Near = (float)atof(parm);
Fog_ConsoleFog();
}
}
else if(strcasecmp (cmd, "Fog_Far") == 0 )
{
if(!parm)
gi.dprintf("%s = %f\n",cmd,fog->Far);
else
{
level.active_fog = level.active_target_fog = 1;
fog->Far = (float)atof(parm);
Fog_ConsoleFog();
}
}
else if(strcasecmp (cmd, "Fog_Model") == 0 )
{
if(!parm)
gi.dprintf("%s = %d\n0=Linear\n1=Exp\n2=Exp2\n",cmd,fog->Model);
else
{
level.active_fog = level.active_target_fog = 1;
// fog->Model = max(0,min(2,atoi(parm)));
fog->Model = max(0,min(3,atoi(parm)));
if(fog->Model == 3)
fog->GL_Model = GLModels[2];
else
fog->GL_Model = GLModels[fog->Model];
Fog_ConsoleFog();
}
}
else if(strcasecmp (cmd, "Fog_Density") == 0 )
{
if(!parm)
gi.dprintf("%s = %f\n",cmd,fog->Density);
else
{
level.active_fog = level.active_target_fog = 1;
fog->Density = fog->Density1 = fog->Density2 = (float)atof(parm);
Fog_ConsoleFog();
}
}
else if(strcasecmp (cmd, "Fog_List") == 0 )
{
int i;
gi.dprintf("level.fogs=%d\n",level.fogs);
gi.dprintf("level.trigger_fogs=%d\n",level.trigger_fogs);
for(i=0; i<level.fogs; i++)
{
pfog = &gfogs[i];
gi.dprintf("Fog #%d\n",i+1);
gi.dprintf("Trigger=%s\n",(pfog->Trigger ? "true" : "false"));
gi.dprintf("Model=%d, Near=%g, Far=%g, Density=%g\n",
pfog->Model, pfog->Near, pfog->Far, pfog->Density);
gi.dprintf("Color=%g,%g,%g\n",pfog->Color[0],pfog->Color[1],pfog->Color[2]);
gi.dprintf("Targetname=%s\n",(pfog->ent ? pfog->ent->targetname : "no ent"));
}
}
else
Cmd_Say_f (ent, false, true);
}
/*
void SoftwareFog()
{
edict_t *player = &g_edicts[1];
player->client->fadein = level.framenum - 1;
player->client->fadehold = level.framenum + 2;
player->client->fadeout = 0;
player->client->fadecolor[0] = pfog->Color[0];
player->client->fadecolor[1] = pfog->Color[1];
player->client->fadecolor[2] = pfog->Color[2];
if(pfog->Model == 0)
player->client->fadealpha = pfog->Far/256.;
else if(pfog->Model == 1)
player->client->fadealpha = pfog->Density/30;
else
player->client->fadealpha = pfog->Density/15;
if(player->client->fadealpha > 0.9)
player->client->fadealpha = 0.9;
last_software_frame = level.framenum;
}
*/
void GlideFogTable()
{
int i;
float density;
float w, dw4;
if(!hGlide) return;
if(last_software_frame + 10 > level.framenum) return;
if(last_opengl_frame + 10 > level.framenum) return;
switch(pfog->Model)
{
case 1:
Glide_guFogGenerateExp( fogtable, pfog->Density/10000.f );
break;
case 2:
Glide_guFogGenerateExp2( fogtable, pfog->Density/10000.f );
break;
case 3:
// Home-grown EXP4 model
density = pfog->Density/10000.f;
for(i=0; i<GR_FOG_TABLE_SIZE-1; i++)
{
w = pow(2.0,(float)i/4.0);
dw4 = pow(density*w,4);
fogtable[i] = (GrFog_t)(255. * (1.0 - exp(-dw4)));
}
fogtable[GR_FOG_TABLE_SIZE] = 255;
break;
default:
Glide_guFogGenerateLinear( fogtable, pfog->Near, pfog->Far);
}
fogtable_generated=true;
}
void GlideFog()
{
GrColor_t color;
if(!hGlide) return;
if(last_software_frame + 10 > level.framenum) return;
if(last_opengl_frame + 10 > level.framenum) return;
if(!fogtable_generated) GlideFogTable();
// gi.dprintf("Name=%s, Model=%d, Near=%g, Far=%g, Density=%g, Color=%g,%g,%g\n",
// pfog->ent->targetname, pfog->Model,pfog->Near, pfog->Far, pfog->Density,
// pfog->GlideColor[0],pfog->GlideColor[1],pfog->GlideColor[2]);
Glide_grFogTable( fogtable );
color = COLOR(pfog->GlideColor[0],pfog->GlideColor[1],pfog->GlideColor[2]);
Glide_grBufferClear( color, (unsigned char)0, (unsigned short)0);
Glide_grFogColorValue( color );
Glide_grFogMode( GR_FOG_WITH_TABLE );
last_3dfx_frame = level.framenum;
}
void GLFog()
{
GLfloat fogColor[4];
if(!hOpenGL) return;
fogColor[0] = pfog->Color[0];
fogColor[1] = pfog->Color[1];
fogColor[2] = pfog->Color[2];
fogColor[3] = 1.0;
GL_glEnable (GL_FOG); // turn on fog, otherwise you won't see any
GL_glClearColor ( fogColor[0], fogColor[1], fogColor[2], fogColor[3]); // Clear the background color to the fog color
GL_glFogi (GL_FOG_MODE, pfog->GL_Model);
GL_glFogfv (GL_FOG_COLOR, fogColor);
if(pfog->GL_Model == GL_LINEAR)
{
GL_glFogf (GL_FOG_START, pfog->Near);
GL_glFogf (GL_FOG_END, pfog->Far);
}
else
GL_glFogf (GL_FOG_DENSITY, pfog->Density/10000.f);
GL_glHint (GL_FOG_HINT, GL_NICEST);
last_opengl_frame = level.framenum;
}
void trig_fog_fade (edict_t *self)
{
float frames;
int index;
if(!InTriggerFog)
{
self->nextthink = 0;
return;
}
if(level.framenum <= self->goal_frame)
{
index = self->fog_index-1;
frames = self->goal_frame - level.framenum + 1;
if(trig_fade_fog.Model == 0)
{
trig_fade_fog.Near += (gfogs[index].Near - trig_fade_fog.Near)/frames;
trig_fade_fog.Far += (gfogs[index].Far - trig_fade_fog.Far )/frames;
}
else
{
trig_fade_fog.Density += (gfogs[index].Density - trig_fade_fog.Density) /frames;
trig_fade_fog.Density1 += (gfogs[index].Density1 - trig_fade_fog.Density1)/frames;
trig_fade_fog.Density2 += (gfogs[index].Density2 - trig_fade_fog.Density2)/frames;
}
trig_fade_fog.Color[0] += (gfogs[index].Color[0] - trig_fade_fog.Color[0])/frames;
trig_fade_fog.Color[1] += (gfogs[index].Color[1] - trig_fade_fog.Color[1])/frames;
trig_fade_fog.Color[2] += (gfogs[index].Color[2] - trig_fade_fog.Color[2])/frames;
VectorScale(trig_fade_fog.Color,255,trig_fade_fog.GlideColor);
trig_fade_fog.GL_Model = GLModels[trig_fade_fog.Model];
self->nextthink = level.time + FRAMETIME;
fogtable_generated = false;
gi.linkentity(self);
}
}
void init_trigger_fog_delay (edict_t *self)
{
int i;
int index;
edict_t *e;
index = self->fog_index-1;
// scan for other trigger_fog's that are currently "thinking", iow
// the trigger_fog has a delay and is ramping. If found, stop the ramp for those fogs
for(i=1, e=g_edicts+i; i<globals.num_edicts; i++, e++)
{
if(!e->inuse) continue;
if(e == self) continue;
if(e->think == trig_fog_fade || e->think == fog_fade)
{
e->think = NULL;
e->nextthink = 0;
gi.linkentity(e);
}
}
self->spawnflags |= FOG_ON;
if(!level.active_fog)
{
// Fog isn't currently on
memcpy(&level.fog,&gfogs[index],sizeof(fog_t));
level.fog.Near = 4999.;
level.fog.Far = 5000.;
level.fog.Density = 0.0;
level.fog.Density1 = 0.0;
level.fog.Density2 = 0.0;
}
VectorCopy(self->fog_color,gfogs[index].Color);
VectorScale(self->fog_color,255,gfogs[index].GlideColor);
gfogs[index].Near = self->fog_near;
gfogs[index].Far = self->fog_far;
gfogs[index].Density = self->fog_density;
gfogs[index].Density1 = self->fog_density;
gfogs[index].Density2 = self->density;
self->goal_frame = level.framenum + self->delay*10 + 1;
self->think = trig_fog_fade;
self->nextthink = level.time + FRAMETIME;
memcpy(&trig_fade_fog,&level.fog,sizeof(fog_t));
level.active_fog = self->fog_index;
}
void Fog(vec3_t viewpoint)
{
edict_t *triggerfog;
edict_t *player = &g_edicts[1];
if(deathmatch->value || coop->value)
return;
InTriggerFog = false;
if(level.trigger_fogs)
{
int i;
int trigger;
trigger=0;
for(i=1; i<level.fogs; i++)
{
if(!gfogs[i].Trigger) continue;
if(!gfogs[i].ent->inuse) continue;
if(!(gfogs[i].ent->spawnflags & FOG_ON)) continue;
if(viewpoint[0] < gfogs[i].ent->absmin[0]) continue;
if(viewpoint[0] > gfogs[i].ent->absmax[0]) continue;
if(viewpoint[1] < gfogs[i].ent->absmin[1]) continue;
if(viewpoint[1] > gfogs[i].ent->absmax[1]) continue;
if(viewpoint[2] < gfogs[i].ent->absmin[2]) continue;
if(viewpoint[2] > gfogs[i].ent->absmax[2]) continue;
trigger = i;
break;
}
if(trigger)
{
InTriggerFog = true;
triggerfog = gfogs[trigger].ent;
if(level.last_active_fog != trigger+1)
{
if(triggerfog->delay)
init_trigger_fog_delay(triggerfog);
else
memcpy(&level.fog,&gfogs[trigger],sizeof(fog_t));
level.active_fog = trigger+1;
}
else if(triggerfog->delay)
memcpy(&level.fog,&trig_fade_fog,sizeof(fog_t));
}
else
{
InTriggerFog = false;
level.active_fog = level.active_target_fog;
// if we are just coming out of a trigger_fog, force
// level.fog to last active target_fog values
if(level.active_fog && level.last_active_fog && gfogs[level.last_active_fog-1].Trigger)
{
edict_t *ent = gfogs[level.active_fog-1].ent;
if(ent && (ent->think == fog_fade))
ent->think(ent);
else
memcpy(&level.fog,&gfogs[level.active_fog-1],sizeof(fog_t));
}
}
}
if(!level.active_fog) {
if(level.last_active_fog)
Fog_Off();
level.last_active_fog = 0;
return;
}
pfog = &level.fog;
if(level.last_active_fog != level.active_fog)
fogtable_generated = false;
if((pfog->Density1 != pfog->Density2) && (game.maxclients == 1) && (pfog->Model))
{
float density;
float dp;
vec3_t vp;
AngleVectors(player->client->ps.viewangles,vp,0,0);
dp = DotProduct(pfog->Dir,vp) + 1.0;
density = ((pfog->Density1*dp) + (pfog->Density2*(2.0-dp)))/2.;
if(pfog->Density != density)
{
pfog->Density = density;
fogtable_generated = false;
}
}
// if(!fogtable_generated)
{
if(!strcmp(gl_driver->string,"3dfxgl"))
GlideFog();
else
GLFog();
}
level.last_active_fog = level.active_fog;
}
void Fog_Init()
{
char GL_Lib[64];
hGlide = LoadLibrary("glide2x.dll");
if(hGlide)
{
Glide_grBufferClear = (GRBUFFERCLEAR)GetProcAddress(hGlide,"_grBufferClear@12");
Glide_grFogColorValue = (GRFOGCOLORVALUE)GetProcAddress(hGlide,"_grFogColorValue@4");
Glide_grFogMode = (GRFOGMODE)GetProcAddress(hGlide,"_grFogMode@4");
Glide_grFogTable = (GRFOGTABLE)GetProcAddress(hGlide,"_grFogTable@4");
Glide_guFogGenerateExp = (GUFOGGENERATEEXP)GetProcAddress(hGlide,"_guFogGenerateExp@8");
Glide_guFogGenerateExp2 = (GUFOGGENERATEEXP2)GetProcAddress(hGlide,"_guFogGenerateExp2@8");
Glide_guFogGenerateLinear = (GUFOGGENERATELINEAR)GetProcAddress(hGlide,"_guFogGenerateLinear@12");
Glide_grChromakeyMode = (GRCHROMAKEYMODE)GetProcAddress(hGlide,"_grChromakeyMode@4");
Glide_grChromakeyValue = (GRCHROMAKEYVALUE)GetProcAddress(hGlide,"_grChromakeyValue@4");
// Glide_grColorCombine = (GRCOLORCOMBINE)GetProcAddress(hGlide,"_grColorCombine@20");
// Glide_grConstantColorValue= (GRCONSTANTCOLORVALUE)GetProcAddress(hGlide,"_grConstantColorValue@4");
// Glide_grDrawPoint = (GRDRAWPOINT)GetProcAddress(hGlide,"_grDrawPoint@4");
}
if(gl_driver_fog && strlen(gl_driver_fog->string))
strcpy(GL_Lib,gl_driver_fog->string);
else
strcpy(GL_Lib,"opengl32");
strcat(GL_Lib,".dll");
hOpenGL = LoadLibrary(GL_Lib);
if(hOpenGL)
{
GL_glClearColor = (GLCLEARCOLOR)GetProcAddress(hOpenGL,"glClearColor");
GL_glDisable = (GLDISABLE)GetProcAddress(hOpenGL,"glDisable");
GL_glEnable = (GLENABLE)GetProcAddress(hOpenGL,"glEnable");
GL_glFogf = (GLFOGF)GetProcAddress(hOpenGL,"glFogf");
GL_glFogfv = (GLFOGFV)GetProcAddress(hOpenGL,"glFogfv");
GL_glFogi = (GLFOGI)GetProcAddress(hOpenGL,"glFogi");
GL_glHint = (GLHINT)GetProcAddress(hOpenGL,"glHint");
}
gfogs[0].Color[0] = gfogs[0].Color[1] = gfogs[0].Color[2] = 0.5;
gfogs[0].GlideColor[0] = gfogs[0].GlideColor[1] = gfogs[0].GlideColor[2] = 127.;
gfogs[0].Model = 1;
gfogs[0].GL_Model = GLModels[1];
gfogs[0].Density = 20.;
gfogs[0].Trigger = false;
}
void fog_fade (edict_t *self)
{
float frames;
int index;
if(level.framenum <= self->goal_frame)
{
index = self->fog_index-1;
frames = self->goal_frame - level.framenum + 1;
if(fade_fog.Model == 0)
{
fade_fog.Near += (gfogs[index].Near - fade_fog.Near)/frames;
fade_fog.Far += (gfogs[index].Far - fade_fog.Far )/frames;
}
else
{
fade_fog.Density += (gfogs[index].Density - fade_fog.Density) /frames;
fade_fog.Density1 += (gfogs[index].Density1 - fade_fog.Density1)/frames;
fade_fog.Density2 += (gfogs[index].Density2 - fade_fog.Density2)/frames;
}
fade_fog.Color[0] += (gfogs[index].Color[0] - fade_fog.Color[0])/frames;
fade_fog.Color[1] += (gfogs[index].Color[1] - fade_fog.Color[1])/frames;
fade_fog.Color[2] += (gfogs[index].Color[2] - fade_fog.Color[2])/frames;
VectorScale(fade_fog.Color,255,fade_fog.GlideColor);
fade_fog.GL_Model = GLModels[fade_fog.Model];
self->nextthink = level.time + FRAMETIME;
if(!InTriggerFog)
memcpy(&level.fog,&fade_fog,sizeof(fog_t));
fogtable_generated = false;
gi.linkentity(self);
}
else
{
// if(!(self->spawnflags & FOG_ON))
if(self->spawnflags & FOG_TURNOFF)
level.active_fog = level.active_target_fog = 0;
}
}
void target_fog_use (edict_t *self, edict_t *other, edict_t *activator)
{
int i;
int index;
edict_t *e;
self->count--;
if(!self->count) {
self->think = G_FreeEdict;
self->nextthink = level.time + self->delay + 1;
}
if((self->spawnflags & FOG_ON) && (self->spawnflags & FOG_TOGGLE))
{
self->spawnflags &= ~FOG_ON;
return;
}
else
self->spawnflags |= FOG_ON;
index = self->fog_index-1;
InTriggerFog = false;
// scan for other target_fog's that are currently "thinking", iow
// the target_fog has a delay and is ramping. If found, stop the ramp for those fogs
for(i=1, e=g_edicts+i; i<globals.num_edicts; i++, e++)
{
if(!e->inuse) continue;
if(e->think == fog_fade)
{
e->nextthink = 0;
gi.linkentity(e);
}
}
if(self->spawnflags & FOG_TURNOFF)
{
// Fog is "turn off" only
if( self->delay && level.active_fog )
{
gfogs[index].Far = 5000.0;
gfogs[index].Near = 4999.0;
gfogs[index].Density = 0.0;
gfogs[index].Density1 = 0.0;
gfogs[index].Density2 = 0.0;
VectorCopy(level.fog.Color,gfogs[index].Color);
VectorScale(level.fog.Color,255,gfogs[index].GlideColor);
self->goal_frame = level.framenum + self->delay*10 + 1;
self->think = fog_fade;
self->nextthink = level.time + FRAMETIME;
level.active_fog = level.active_target_fog = self->fog_index;
memcpy(&fade_fog,&level.fog,sizeof(fog_t));
}
else
level.active_fog = level.active_target_fog = 0;
}
else
{
if(self->delay)
{
if(!level.active_fog)
{
// Fog isn't currently on
memcpy(&level.fog,&gfogs[index],sizeof(fog_t));
level.fog.Near = 4999.;
level.fog.Far = 5000.;
level.fog.Density = 0.0;
level.fog.Density1 = 0.0;
level.fog.Density2 = 0.0;
}
VectorCopy(self->fog_color,gfogs[index].Color);
VectorScale(self->fog_color,255,gfogs[index].GlideColor);
gfogs[index].Near = self->fog_near;
gfogs[index].Far = self->fog_far;
gfogs[index].Density = self->fog_density;
gfogs[index].Density1 = self->fog_density;
gfogs[index].Density2 = self->density;
self->goal_frame = level.framenum + self->delay*10 + 1;
self->think = fog_fade;
self->nextthink = level.time + FRAMETIME;
memcpy(&fade_fog,&level.fog,sizeof(fog_t));
} else {
memcpy(&level.fog,&gfogs[index],sizeof(fog_t));
}
level.active_fog = level.active_target_fog = self->fog_index;
}
}
void SP_target_fog (edict_t *self)
{
fog_t *fog;
if( !allow_fog->value )
{
G_FreeEdict(self);
return;
}
if(deathmatch->value || coop->value)
{
G_FreeEdict(self);
return;
}
self->class_id = ENTITY_TARGET_FOG;
if(!level.fogs) level.fogs = 1; // 1st fog reserved for console commands
if(level.fogs >= MAX_FOGS)
{
gi.dprintf("Maximum number of fogs exceeded!\n");
G_FreeEdict(self);
return;
}
if( self->delay < 0.)
self->delay = 0.;
self->fog_index = level.fogs+1;
fog = &gfogs[level.fogs];
fog->Trigger = false;
fog->Model = self->fog_model;
if(fog->Model < 0 || fog->Model > 2) fog->Model = 0;
fog->GL_Model = GLModels[fog->Model];
VectorCopy(self->fog_color,fog->Color);
VectorScale(self->fog_color,255,fog->GlideColor);
if(self->spawnflags & FOG_TURNOFF) {
fog->Near = 4999;
fog->Far = 5000;
fog->Density = 0;
fog->Density1 = 0;
fog->Density2 = 0;
} else {
fog->Near = self->fog_near;
fog->Far = self->fog_far;
fog->Density = self->fog_density;
fog->Density1 = self->fog_density;
if(self->density == 0.)
self->density = self->fog_density;
else if(self->density < 0.)
self->density = 0.;
fog->Density2= self->density;
}
AngleVectors(self->s.angles,fog->Dir,0,0);
fog->ent = self;
level.fogs++;
self->use = target_fog_use;
gi.linkentity(self);
if(self->spawnflags & FOG_ON)
{
self->spawnflags &= ~FOG_ON;
target_fog_use(self,NULL,NULL);
}
}
void trigger_fog_use (edict_t *self, edict_t *other, edict_t *activator)
{
if((self->spawnflags & FOG_ON) && (self->spawnflags & FOG_TOGGLE))
{
self->spawnflags &= ~FOG_ON;
self->count--;
if(!self->count)
{
self->think = G_FreeEdict;
self->nextthink = level.time + FRAMETIME;
}
}
else
{
self->spawnflags |= FOG_ON;
}
}
void SP_trigger_fog (edict_t *self)
{
fog_t *fog;
if( !allow_fog->value )
{
G_FreeEdict(self);
return;
}
if(deathmatch->value || coop->value)
{
G_FreeEdict(self);
return;
}
self->class_id = ENTITY_TRIGGER_FOG;
if(!level.fogs) level.fogs = 1; // 1st fog reserved for console commands
if(level.fogs >= MAX_FOGS)
{
gi.dprintf("Maximum number of fogs exceeded!\n");
G_FreeEdict(self);
return;
}
self->fog_index = level.fogs+1;
fog = &gfogs[level.fogs];
fog->Trigger = true;
fog->Model = self->fog_model;
if(fog->Model < 0 || fog->Model > 2) fog->Model = 0;
fog->GL_Model = GLModels[fog->Model];
VectorCopy(self->fog_color,fog->Color);
VectorScale(self->fog_color,255,fog->GlideColor);
if(self->spawnflags & FOG_TURNOFF) {
fog->Near = 4999;
fog->Far = 5000;
fog->Density = 0;
fog->Density1 = 0;
fog->Density2 = 0;
} else {
fog->Near = self->fog_near;
fog->Far = self->fog_far;
fog->Density = self->fog_density;
fog->Density1 = self->fog_density;
if(self->density == 0.)
self->density = self->fog_density;
else if(self->density < 0.)
self->density = 0.;
fog->Density2= self->density;
}
if(!(self->spawnflags & FOG_STARTOFF))
self->spawnflags |= FOG_ON;
AngleVectors(self->s.angles,fog->Dir,0,0);
VectorClear(self->s.angles);
fog->ent = self;
level.fogs++;
level.trigger_fogs++;
self->movetype = MOVETYPE_NONE;
self->svflags |= SVF_NOCLIENT;
self->solid = SOLID_NOT;
gi.setmodel (self, self->model);
gi.linkentity(self);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,128 +0,0 @@
#include "g_local.h"
//==========================================================
void Lights()
{
if (lights->value)
{
// 0 normal
gi.configstring(CS_LIGHTS+0, "m");
// 1 FLICKER (first variety)
gi.configstring(CS_LIGHTS+1, "mmnmmommommnonmmonqnmmo");
// 2 SLOW STRONG PULSE
gi.configstring(CS_LIGHTS+2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");
// 3 CANDLE (first variety)
gi.configstring(CS_LIGHTS+3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");
// 4 FAST STROBE
gi.configstring(CS_LIGHTS+4, "mamamamamama");
// 5 GENTLE PULSE 1
gi.configstring(CS_LIGHTS+5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");
// 6 FLICKER (second variety)
gi.configstring(CS_LIGHTS+6, "nmonqnmomnmomomno");
// 7 CANDLE (second variety)
gi.configstring(CS_LIGHTS+7, "mmmaaaabcdefgmmmmaaaammmaamm");
// 8 CANDLE (third variety)
gi.configstring(CS_LIGHTS+8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");
// 9 SLOW STROBE (fourth variety)
gi.configstring(CS_LIGHTS+9, "aaaaaaaazzzzzzzz");
// 10 FLUORESCENT FLICKER
gi.configstring(CS_LIGHTS+10, "mmamammmmammamamaaamammma");
// 11 SLOW PULSE NOT FADE TO BLACK
gi.configstring(CS_LIGHTS+11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
}
else
{
// 0 normal
gi.configstring(CS_LIGHTS+0, lightsmin->string);
// 1 FLICKER (first variety)
gi.configstring(CS_LIGHTS+1, lightsmin->string);
// 2 SLOW STRONG PULSE
gi.configstring(CS_LIGHTS+2, lightsmin->string);
// 3 CANDLE (first variety)
gi.configstring(CS_LIGHTS+3, lightsmin->string);
// 4 FAST STROBE
gi.configstring(CS_LIGHTS+4, lightsmin->string);
// 5 GENTLE PULSE 1
gi.configstring(CS_LIGHTS+5, lightsmin->string);
// 6 FLICKER (second variety)
gi.configstring(CS_LIGHTS+6, lightsmin->string);
// 7 CANDLE (second variety)
gi.configstring(CS_LIGHTS+7, lightsmin->string);
// 8 CANDLE (third variety)
gi.configstring(CS_LIGHTS+8, lightsmin->string);
// 9 SLOW STROBE (fourth variety)
gi.configstring(CS_LIGHTS+9, lightsmin->string);
// 10 FLUORESCENT FLICKER
gi.configstring(CS_LIGHTS+10,lightsmin->string);
// 11 SLOW PULSE NOT FADE TO BLACK
gi.configstring(CS_LIGHTS+11,lightsmin->string);
}
}
void ToggleLights()
{
lights->value = !lights->value;
Lights();
}
void target_lightswitch_toggle (edict_t *self)
{
ToggleLights();
self->count--;
if(!self->count) {
self->think = G_FreeEdict;
self->nextthink = level.time + 1;
}
}
void use_target_lightswitch (edict_t *self, edict_t *other, edict_t *activator)
{
self->activator = activator;
if (!self->delay)
{
target_lightswitch_toggle (self);
return;
}
self->think = target_lightswitch_toggle;
self->nextthink = level.time + self->delay;
}
void SP_target_lightswitch (edict_t *self)
{
int i;
edict_t *e;
char lightvalue[2];
self->class_id = ENTITY_TARGET_LIGHTSWITCH;
// ensure this is the only target_lightswitch in the map
for(i=1, e=g_edicts+i; i<globals.num_edicts; i++, e++)
{
if(!e->inuse) continue;
if(!e->classname) continue;
if(e==self) continue;
if(e->class_id == ENTITY_TARGET_LIGHTSWITCH)
{
gi.dprintf("Only one target_lightswitch per map is allowed.\n");
G_FreeEdict(self);
return;
}
}
if(!self->message)
lightvalue[0] = 'a';
else
lightvalue[0] = self->message[0];
lightvalue[1] = 0;
gi.cvar_forceset("lightsmin", lightvalue);
self->use = use_target_lightswitch;
self->svflags = SVF_NOCLIENT;
if(self->spawnflags & 1)
{
self->think = target_lightswitch_toggle;
self->nextthink = level.time + 2*FRAMETIME;
gi.linkentity(self);
}
}

View File

@ -1,264 +0,0 @@
#include "g_local.h"
//=====================================================
void SP_target_lock_digit (edict_t *self)
{
self->class_id = ENTITY_TARGET_LOCK_DIGIT;
self->movetype = MOVETYPE_PUSH;
gi.setmodel (self, self->model);
self->solid = SOLID_BSP;
self->s.frame = 12;
gi.linkentity (self);
}
void target_lock_use (edict_t *self, edict_t *other, edict_t *activator)
{
edict_t *e;
int n;
char current[16];
char *copy_message;
memset(current,0,16);
for (e = self->teammaster; e; e = e->teamchain)
{
if (!e->count)
continue;
n = e->count - 1;
current[n] = '0' + e->s.frame;
}
if(strcmp(current,self->key_message)==0)
{
copy_message = self->message;
self->message = NULL;
G_UseTargets(self,activator);
self->message = copy_message;
}
else
{
if(self->message) gi.centerprintf(activator,self->message);
if(self->pathtarget) {
e = G_Find(NULL,FOFS(targetname),self->pathtarget);
if(e) e->use(e,other,activator);
}
else {
BeepBeep(activator);
}
}
}
void lock_digit_increment (edict_t *digit, edict_t *activator)
{
if(digit->s.frame == 9)
digit->s.frame = 0;
else
digit->s.frame++;
}
void lock_initialize (edict_t *lock)
{
edict_t *e;
int n, l;
int numdigits;
char c;
if(lock->spawnflags & 1 && strlen(game.lock_code) != 0)
{
strcpy(lock->key_message,game.lock_code);
return;
}
// Maximum of 8 digits in combination
l = min(strlen(lock->key_message),8);
numdigits = 0;
for (e = lock->teammaster; e; e = e->teamchain)
{
if (!e->count)
continue;
numdigits = max(numdigits,e->count);
n = e->count - 1;
if (n > l)
{
e->s.frame = 12;
continue;
}
c = lock->key_message[n];
if (c >= '0' && c <= '9')
e->s.frame = c - '0';
else
e->s.frame = 0;
}
// Now generate a random number as the lock combination
srand(time(NULL));
n = random();
n = random();
n = random();
for(n=0; n<numdigits; n++)
lock->key_message[n] = '0' + (int)(random() * 9.99);
lock->key_message[numdigits] = '\0';
strcpy(game.lock_code,lock->key_message);
game.lock_revealed = 0;
}
void SP_target_lock (edict_t *self)
{
if (game.lock_hud && (self->spawnflags & 2))
{
gi.dprintf("Map contains multiple target_locks and HUD is set.\n");
G_FreeEdict(self);
return;
}
self->class_id = ENTITY_TARGET_LOCK;
if (self->spawnflags & 2) game.lock_hud = true;
if (!self->key_message)
self->key_message = "00000000";
self->use = target_lock_use;
self->think = lock_initialize;
self->nextthink = level.time + 1.0;
gi.linkentity(self);
}
//
// target_lock_code reveals the lock combination to the
// target_lock specified in it's target field, or in global
// game data for crosslevel locks
//
void lock_code_use (edict_t *self, edict_t *other, edict_t *activator)
{
int i, L;
char message[64];
if(self->spawnflags & 1)
{
if(!strlen(game.lock_code))
{
gi.dprintf("Lock has not been properly initialized.\n");
return;
}
sprintf(message,"Lock combination is %s",game.lock_code);
Do_Text_Display(activator, 0, message);
L = strlen(game.lock_code);
for(i=0; i<L; i++)
game.lock_revealed |= 1<<i;
}
else
{
edict_t *lock;
lock = G_Find(NULL,FOFS(targetname),self->target);
if(!lock)
gi.dprintf("Target of target_lock_code does not exist\n");
else
{
sprintf(message,"Lock combination is %s",game.lock_code);
Do_Text_Display(activator, 0, message);
L = min(8,strlen(lock->key_message));
for(i=0; i<L; i++)
game.lock_revealed |= 1<<i;
}
}
}
void SP_target_lock_code (edict_t *self)
{
if(!self->target && !(self->spawnflags & 1))
{
gi.dprintf("non-crosslevel target_lock_code w/o target\n");
G_FreeEdict(self);
}
self->class_id = ENTITY_TARGET_LOCK_CODE;
self->use = lock_code_use;
}
void lock_clue_use (edict_t *self, edict_t *other, edict_t *activator)
{
int i, L;
if(self->spawnflags & 1)
{
if(!strlen(game.lock_code))
{
gi.dprintf("Lock has not been properly initialized.\n");
return;
}
L = strlen(game.lock_code);
for(i=0; i<L; i++)
if(self->message[i] != '?') game.lock_revealed |= 1<<i;
}
else
{
edict_t *lock;
lock = G_Find(NULL,FOFS(targetname),self->target);
if(!lock)
gi.dprintf("Target of target_lock_clue does not exist\n");
else
{
L = min(8,strlen(lock->key_message));
for(i=0; i<L; i++)
if(self->message[i] != '?') game.lock_revealed |= 1<<i;
}
}
}
void lock_clue_think(edict_t *self)
{
int n;
int unrevealed_count;
edict_t *e;
if(!self->team)
return;
unrevealed_count = 0;
for (e = self->teammaster; e; e = e->teamchain)
{
if (!e->count)
continue;
n = e->count - 1;
if(game.lock_revealed & 1<<n)
e->s.frame = game.lock_code[n] - '0';
else
{
e->s.frame++; // spin unknown digits
if(e->s.frame > 9) e->s.frame = 0;
unrevealed_count++;
}
}
if(unrevealed_count)
{
self->nextthink = level.time + FRAMETIME;
gi.linkentity(self);
}
}
void lock_clue_initialize(edict_t *self)
{
// Randomize the revealed digits so spinning display doesn't
// show the same numbers across the board.
edict_t *e;
if(self->team)
{
for (e = self->teammaster; e; e = e->teamchain)
{
if (!e->count)
continue;
e->s.frame = (int)(random() * 9.99);
}
}
self->think = lock_clue_think;
self->nextthink = level.time + FRAMETIME;
gi.linkentity(self);
}
void SP_target_lock_clue (edict_t *self)
{
if(!self->target && !(self->spawnflags & 1))
{
gi.dprintf("non-crosslevel target_lock_clue w/o target\n");
G_FreeEdict(self);
}
self->class_id = ENTITY_TARGET_LOCK_CLUE;
self->use = lock_clue_use;
self->think = lock_clue_initialize;
self->nextthink = level.time + 2*FRAMETIME;
gi.linkentity(self);
}

View File

@ -1,232 +0,0 @@
#include "g_local.h"
//
// mappack stuff by mr. ed, modified extensively for Tremor by dwh
//
//Spawns a user defined model, you can specify whether its solid, if so how big the box is, and apply nearly
//any effect to the entity.
//
// PLAYER set this if you want to use a player model
//
// Note : These flags override any frame settings you may have enterered
// ANIM01 cycle between frames 0 and 1 at 2 hz
// ANIM23 cycle between frames 2 and 3 at 2 hz
// ANIM_ALL cycle through all frames at 2hz
// ANIM_ALLFAST cycle through all frames at 10hz
//
// START_OFF Start inactive, when triggered display the model
// TOGGLE Start active, when triggered become inactive
// NO_MODEL Don't use a model. Usefull for placeing particle effects and
// dynamic lights on their own
//
// "usermodel" = The model to load (models/ is already coded)
// "startframe" = The starting frame : default 0
// "userframes" = The number of frames you want to display after startframe
// "solidstate" = 1 : SOLID_NOT - not solid at all
// 2 : SOLID_BBOX - solid and affected by gravity
// 3 : NO DROP - solid but not affected by gravity
// 4 : SOLID_NOT, but affect by gravity
//
// NOTE : if you want the model to be solid then you must enter vector values into the following fields :
// "bleft" = the point that is at the bottom left of the models bounding box in a model editor
// "tright" = the point that is at the top left of the models bounding box in a model editor
//
#define TOGGLE 2
#define PLAYER_MODEL 8
#define NO_MODEL 16
#define ANIM_ONCE 32
void model_spawn_use (edict_t *self, edict_t *other, edict_t *activator);
void modelspawn_think (edict_t *self)
{
self->s.frame++;
if (self->s.frame >= self->framenumbers)
{
self->s.frame = self->startframe;
if(self->spawnflags & ANIM_ONCE)
{
model_spawn_use(self,world,world);
return;
}
}
self->nextthink = level.time + FRAMETIME;
gi.linkentity(self);
}
void model_spawn_use (edict_t *self, edict_t *other, edict_t *activator)
{
if (self->delay) //we started off
{
self->svflags &= ~SVF_NOCLIENT;
self->delay = 0;
if(self->framenumbers > 1)
{
self->think = modelspawn_think;
self->nextthink = level.time + FRAMETIME;
}
self->s.sound = self->noise_index;
}
else //we started active
{
self->svflags |= SVF_NOCLIENT;
self->delay = 1;
self->use = model_spawn_use;
self->think = NULL;
self->nextthink = 0;
self->s.sound = 0;
}
}
void model_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
edict_t *e, *next;
e = self->movewith_next;
while(e) {
next = e->movewith_next;
if(e->solid == SOLID_NOT) {
e->nextthink = 0;
G_FreeEdict(e);
} else
BecomeExplosion1 (e);
e = next;
}
BecomeExplosion1(self);
}
#define ANIM_MASK (EF_ANIM01|EF_ANIM23|EF_ANIM_ALL|EF_ANIM_ALLFAST)
void SP_model_spawn (edict_t *ent)
{
char modelname[256];
//paranoia checks
if ((!ent->usermodel) && !(ent->spawnflags & NO_MODEL) && !(ent->spawnflags & PLAYER_MODEL))
{
gi.dprintf("%s without a model at %s\n", ent->classname, vtos(ent->s.origin));
G_FreeEdict(ent);
return;
}
ent->class_id = ENTITY_MODEL_SPAWN;
switch (ent->solidstate)
{
case 1 : ent->solid = SOLID_NOT; ent->movetype = MOVETYPE_NONE; break;
case 2 : ent->solid = SOLID_BBOX; ent->movetype = MOVETYPE_TOSS; break;
case 3 : ent->solid = SOLID_BBOX; ent->movetype = MOVETYPE_NONE; break;
case 4 : ent->solid = SOLID_NOT; ent->movetype = MOVETYPE_TOSS; break;
default: ent->solid = SOLID_NOT; ent->movetype = MOVETYPE_NONE; break;
}
if (ent->solid != SOLID_NOT ) {
if (ent->health > 0) {
ent->die = model_die;
ent->takedamage = DAMAGE_YES;
}
}
switch (ent->style)
{
case 1 : ent->s.effects |= EF_ANIM01; break;
case 2 : ent->s.effects |= EF_ANIM23; break;
case 3 : ent->s.effects |= EF_ANIM_ALL; break;
case 4 : ent->s.effects |= EF_ANIM_ALLFAST; break;
}
// DWH: Rather than use one value (renderfx) we use the
// actual values for effects and renderfx. All may
// be combined.
ent->s.effects |= ent->effects;
ent->s.renderfx |= ent->renderfx;
if (ent->startframe < 0)
ent->startframe = 0;
if (!ent->framenumbers)
ent->framenumbers = 1;
// Change framenumbers to last frame to play
ent->framenumbers += ent->startframe;
if (ent->bleft)
{
VectorCopy (ent->bleft, ent->mins);
}
else
{
if (ent->solid != SOLID_NOT)
{
gi.dprintf("%s solid with no bleft vector at %s\n", ent->classname, vtos(ent->s.origin));
ent->solid = SOLID_NOT;
}
}
if (ent->tright)
{
VectorCopy (ent->tright, ent->maxs);
}
else
{
if (ent->solid != SOLID_NOT)
{
gi.dprintf("%s solid with no tright vector at %s\n", ent->classname, vtos(ent->s.origin));
ent->solid = SOLID_NOT;
}
}
// if(ent->movewith && (ent->solid == SOLID_BBOX))
if(ent->movewith)
ent->movetype = MOVETYPE_PUSH;
if (ent->solid != SOLID_NOT)
ent->clipmask = CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_MONSTERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER;
if (ent->spawnflags & NO_MODEL)
{ // For rendering effects to work, we MUST use a model
ent->s.modelindex = gi.modelindex ("sprites/point.spr");
ent->movetype = MOVETYPE_NOCLIP;
}
else
{
if (ent->spawnflags & PLAYER_MODEL) {
if(!ent->usermodel || !strlen(ent->usermodel))
ent->s.modelindex = MAX_MODELS-1;
else
{
if(strstr(ent->usermodel,"tris.md2"))
sprintf(modelname,"players/%s", ent->usermodel);
else
sprintf(modelname,"players/%s/tris.md2", ent->usermodel);
ent->s.modelindex = gi.modelindex(modelname);
}
}
else
{
if(strstr(ent->usermodel,".spr"))
sprintf(modelname, "sprites/%s", ent->usermodel);
else
sprintf(modelname, "models/%s", ent->usermodel);
ent->s.modelindex = gi.modelindex (modelname);
}
ent->s.frame = ent->startframe;
}
if (st.noise)
ent->noise_index = gi.soundindex (st.noise);
ent->s.sound = ent->noise_index;
if (ent->spawnflags & ANIM_ONCE)
ent->spawnflags |= TOGGLE;
if (ent->spawnflags & TOGGLE)
{
ent->delay = 0;
ent->use = model_spawn_use;
}
if(!(ent->s.effects & ANIM_MASK) && (ent->framenumbers > 1))
{
ent->think = modelspawn_think;
ent->nextthink = level.time + 2*FRAMETIME;
}
gi.linkentity (ent);
}

View File

@ -1,136 +0,0 @@
#include "g_local.h"
void func_train_find (edict_t *self);
void SP_model_spawn (edict_t *ent);
void train_blocked (edict_t *self, edict_t *other);
void train_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
void train_use (edict_t *self, edict_t *other, edict_t *activator);
#define TRAIN_START_ON 1
#define TRAIN_TOGGLE 2
#define TRAIN_BLOCK_STOPS 4
#define PLAYER_MODEL 8
#define NO_MODEL 16
#define MTRAIN_ROTATE 32
#define MTRAIN_ROTATE_CONSTANT 64
#define TRAIN_SMOOTH 128
void model_train_animator(edict_t *animator)
{
edict_t *train;
train = animator->owner;
if(!train || !train->inuse)
{
G_FreeEdict(animator);
return;
}
if(train->class_id != ENTITY_MODEL_TRAIN)
{
G_FreeEdict(animator);
return;
}
animator->nextthink = level.time + FRAMETIME;
if(VectorLength(train->velocity) == 0)
return;
train->s.frame++;
if (train->s.frame >= train->framenumbers)
train->s.frame = train->startframe;
gi.linkentity(train);
}
void SP_model_train (edict_t *self)
{
SP_model_spawn (self);
self->class_id = ENTITY_MODEL_TRAIN;
// Reset s.sound, which SP_model_spawn may have turned on
self->moveinfo.sound_middle = self->s.sound;
self->s.sound = 0;
if(!self->inuse) return;
// Reset some things from SP_model_spawn
self->delay = 0;
self->think = NULL;
self->nextthink = 0;
if (self->health)
{
self->die = train_die;
self->takedamage = DAMAGE_YES;
}
if(self->framenumbers > self->startframe+1)
{
edict_t *animator;
animator = G_Spawn();
animator->owner = self;
animator->think = model_train_animator;
animator->nextthink = level.time + FRAMETIME;
}
self->s.frame = self->startframe;
self->movetype = MOVETYPE_PUSH;
// Really gross stuff here... translate model_spawn spawnflags
// to func_train spawnflags. PLAYER_MODEL and NO_MODEL have
// already been checked in SP_model_spawn and are never re-used,
// so it's OK to overwrite those.
if(self->spawnflags & MTRAIN_ROTATE)
{
self->spawnflags &= ~MTRAIN_ROTATE;
self->spawnflags |= TRAIN_ROTATE;
}
if(self->spawnflags & MTRAIN_ROTATE_CONSTANT)
{
self->spawnflags &= ~MTRAIN_ROTATE_CONSTANT;
self->spawnflags |= TRAIN_ROTATE_CONSTANT;
}
if( (self->spawnflags & (TRAIN_ROTATE | TRAIN_ROTATE_CONSTANT)) == (TRAIN_ROTATE | TRAIN_ROTATE_CONSTANT))
{
self->spawnflags &= ~(TRAIN_ROTATE | TRAIN_ROTATE_CONSTANT);
self->spawnflags |= TRAIN_SPLINE;
}
if(self->style == 3)
self->spawnflags |= TRAIN_ANIMATE; // 32
if(self->style == 4)
self->spawnflags |= TRAIN_ANIMATE_FAST; // 64
// TRAIN_SMOOTH forces trains to go directly to Move_Done from
// Move_Final rather than slowing down (if necessary) for one
// frame.
if (self->spawnflags & TRAIN_SMOOTH)
self->smooth_movement = true;
else
self->smooth_movement = false;
self->blocked = train_blocked;
if (self->spawnflags & TRAIN_BLOCK_STOPS)
self->dmg = 0;
else
{
if (!self->dmg)
self->dmg = 100;
}
if (!self->speed)
self->speed = 100;
self->moveinfo.speed = self->speed;
self->moveinfo.accel = self->moveinfo.decel = self->moveinfo.speed;
self->use = train_use;
gi.linkentity (self);
if (self->target)
{
// start trains on the second frame, to make sure their targets have had
// a chance to spawn
self->nextthink = level.time + FRAMETIME;
self->think = func_train_find;
}
else
{
gi.dprintf ("model_train without a target at %s\n", vtos(self->absmin));
}
}

View File

@ -1,601 +0,0 @@
#include "g_local.h"
//====================================================================
/* FUNC_PENDULUM
SF 1 = START_ON
2 = STOP_AT_TOP
8 = SLOW (internal use only, used to slow a pendulum to a stop after
being blocked)
16= STOPPING (internal use only, set when a STOP_AT_TOP pendulum is triggered off)
radius = length of pendulum, used for motion equation (not impact)
distance = total arc that pendulum moves through, must be < 360
move_origin = vector from origin to c.g. of pendulum, used for impact
mass = mass of pendulum, used for knockback of func_pushables (not players/monsters)
*/
#define SF_PENDULUM_STARTON 1
#define SF_PENDULUM_STOP_AT_TOP 2
#define SF_PENDULUM_SLOW 8
#define SF_PENDULUM_STOPPING 16
void box_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
void pendulum_blocked (edict_t *self, edict_t *other)
{
trace_t trace;
vec3_t angles;
vec3_t forward, left, up;
vec3_t dir;
vec3_t f1, l1, u1;
vec3_t point;
vec3_t origin;
vec3_t new_velocity;
vec3_t new_origin;
float speed;
int damage;
// Since this routine is called in response to being blocked,
// the current s.angles is for the LAST frame, not the proposed
// angles for the current frame. Since we're basically overriding
// normal physics here, go ahead and move to new location. This
// means that later on we have to move blocker NOW rather than
// relying on its velocity to get it out of the way.
// BUT... trouble is doing this with players ends up giving
// goofy direction in some cases. For players/monsters, use old
// angles but STILL move 'em out of the way immediately
if(other->client || (other->svflags & SVF_MONSTER))
{
VectorCopy(self->s.angles,angles);
}
else
{
VectorMA(self->s.angles,FRAMETIME,self->avelocity,angles);
}
AngleVectors(angles,forward,left,up);
speed = fabs(self->avelocity[ROLL]) * M_PI / 180. * self->radius;
if( (level.time > self->touch_debounce_time) && (speed > 200) )
{
damage = (int)( self->dmg * (speed-200)/100 );
self->touch_debounce_time = level.time + 0.5;
}
else
damage = 0;
VectorAdd(other->s.origin,other->origin_offset,origin);
VectorCopy(left,dir);
if(self->avelocity[ROLL] > 0)
VectorNegate(dir,dir);
VectorScale(forward,self->move_origin[0],f1);
VectorScale(left,-self->move_origin[1],l1);
VectorScale(up,self->move_origin[2],u1);
VectorAdd(self->s.origin,f1,point);
VectorAdd(point,l1,point);
VectorAdd(point,u1,point);
VectorSubtract(origin,point,point);
VectorNormalize(point);
if(other->client || (other->svflags & SVF_MONSTER))
{
if((point[2] < -0.7) && other->groundentity)
{
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, DAMAGE_NO_PROTECTION, MOD_CRUSH);
return;
}
dir[2] = max(1.0,fabs(dir[2]));
VectorNormalize(dir);
// Normal kickback takes too long to take effect and allows embedment. Move
// the blocker NOW.
// Give a minimum speed so we can get the poor fool out of the way
speed = max(100,speed);
VectorScale(dir,speed,new_velocity);
VectorMA(other->s.origin,FRAMETIME,new_velocity,new_origin);
other->solid = SOLID_NOT;
gi.linkentity(other);
trace = gi.trace(other->s.origin,other->mins,other->maxs,new_origin,self,other->clipmask);
VectorCopy(trace.endpos,other->s.origin);
VectorCopy(new_velocity,other->velocity);
other->solid = SOLID_BBOX;
gi.linkentity(other);
T_Damage (other, self, self, dir, other->s.origin, vec3_origin, damage, 0, 0, MOD_CRUSH);
}
else if(other->solid == SOLID_BSP)
{
// Other is most likely a func_pushable, since almost all other bmodels aren't
// clipped to MOVETYPE_PUSH
vec3_t org, mins, maxs;
vec3_t vn2;
bool block;
float e=self->attenuation; // coefficient of restitution
float m=(float)(other->mass)/(float)(self->mass);
float v11 = speed;
float v21; // Initial speed of other in the impact direction
float v12, v22;
float new_rspeed;
float sgor, time, wave;
if(v11 >= 100)
gi.sound (self, 0, self->noise_index, 1, 1, 0);
// If other is on the ground, push it UP regardless of dir
if(other->groundentity)
dir[2] = max(1.0,fabs(dir[2]));
VectorNormalize(dir);
// If pendulum hits crate from above and crate is on the ground,
// destroy the crate. This may not be realistic, but there's really
// no other way since if we stop the pendulum we'd then have to
// continously monitor whether the crate moved away or not.
if((point[2] < -0.7) && (other->velocity[2] == 0))
{
box_die (other, self, self, 100000, point);
return;
}
if(e > 0)
{
v21 = VectorLength(other->velocity);
if(v21 > 0)
{
VectorCopy(other->velocity,vn2);
VectorNormalize(vn2);
v21 *= DotProduct(dir,vn2);
}
v22 = ( e*(v11-v21) + v11 + m*v21 ) / (1.0 + m);
v12 = v22 + e*(v21-v11);
// gi.dprintf("v11=%g, v21=%g, v12=%g, v22=%g\n",v11,v21,v12,v22);
// gi.dprintf("av[ROLL]=%g, roll=%g\n",self->avelocity[ROLL],angles[ROLL]);
}
else
{
v12 = v11;
if(other->mass > self->mass)
{
block = true;
VectorClear(self->avelocity);
gi.linkentity(self);
goto deadstop;
}
else
v22 = v11 * (float)self->mass/(float)other->mass;
}
VectorScale(dir,v22,new_velocity);
if(v12 < 0)
{
// Reverse rotation.
new_rspeed = fabs(v12) / (M_PI / 180. * self->radius);
if(self->avelocity[ROLL] > 0)
self->avelocity[ROLL] = -new_rspeed;
else
self->avelocity[ROLL] = new_rspeed;
}
else
{
// Continuing to move in same direction, though slower.
new_rspeed = v12 / (M_PI / 180. * self->radius);
if(self->avelocity[ROLL] > 0)
self->avelocity[ROLL] = new_rspeed;
else
self->avelocity[ROLL] = -new_rspeed;
}
sgor = sqrt( (float)sv_gravity->value / self->radius );
wave = fabs( self->avelocity[ROLL] / (angles[ROLL] * sgor) );
wave = atan(wave);
if(self->avelocity[ROLL] >= 0)
{
if(angles[ROLL] > 0)
wave = M_PI - wave;
}
else
{
if(angles[ROLL] > 0)
wave = M_PI + wave;
else
wave = 2*M_PI - wave;
}
time = wave/sgor;
self->startframe = level.framenum - time*10.;
self->moveinfo.start_angles[ROLL] = -fabs(angles[ROLL] / cos(wave));
// Now we know the new pendulum velocity and crate velocity, *assuming*
// nothing else is in the way. Now check to see if crate hits anything
// else.
VectorAdd(other->s.origin,other->origin_offset,org);
VectorMA(org,FRAMETIME,new_velocity,new_origin);
// Temporarily make crate nonsolid so we can ignore pendulum in our trace
// (rather than crate)
other->solid = SOLID_NOT;
gi.linkentity(other);
VectorSubtract(other->mins,other->origin_offset,mins);
VectorSubtract(other->maxs,other->origin_offset,maxs);
trace = gi.trace (org, mins, maxs, new_origin, self, other->clipmask);
// restore solidity of crate
other->solid = SOLID_BSP;
if(trace.startsolid)
{
// Things are completely fouled up. Nuke other and go away.
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
if (other)
BecomeExplosion1 (other);
return;
}
else if(trace.fraction < 1.0)
{
vec3_t vec;
float dist;
VectorSubtract(trace.endpos,org,vec);
dist = VectorLength(vec);
if( (trace.ent->client) || (trace.ent->flags & SVF_MONSTER))
{
float delta=FRAMETIME*VectorLength(new_velocity);
// If a player or monster is in the way of the crate, AND
// the pendulum speed is > 100, throw 'em out of the way.
// If pendulum tangential speed is < 100, give up.
if(speed < 100)
block = true;
else
{
if(dist < delta)
{
VectorScale(new_velocity,1.25,trace.ent->velocity);
VectorMA(trace.ent->s.origin,FRAMETIME,trace.ent->velocity,trace.ent->s.origin);
gi.linkentity(trace.ent);
}
block = false;
}
}
else
{
if(dist < speed*FRAMETIME)
{
block = true;
VectorScale(vec,10.,other->velocity);
VectorMA(other->s.origin,FRAMETIME,other->velocity,other->s.origin);
}
else
block = false;
}
}
else
block = false;
if(!block)
{
VectorCopy(new_velocity,other->velocity);
VectorMA(other->s.origin,FRAMETIME,other->velocity,other->s.origin);
}
gi.linkentity(other);
// Final checks:
// 1) If pendulum after-impact speed is < 100, that's too damn slow.
// Lie and say it's blocked
// 2) If not blocked, in its new position test for intersection
// of crate and pendulum. If they intersect, then most likely pendulum is
// moving VERY slowly and we need to reverse direction NOW to prevent
// embedment.
if(!block)
{
if(fabs(v12) < 100)
block = true;
else
{
VectorAdd(other->s.origin,other->origin_offset,org);
trace = gi.trace(org,mins,maxs,org,other,MASK_SOLID);
if(trace.startsolid)
block = true;
}
}
deadstop:
T_Damage (other, self, self, dir, other->s.origin, vec3_origin, damage, 0, 0, MOD_CRUSH);
if( block )
{
// Then this sucker will still be in the way. Reverse rotation, slow, or stop
if(fabs(angles[ROLL]) > 2)
{
if(abs(angles[ROLL]) < 10)
self->spawnflags |= SF_PENDULUM_SLOW;
self->moveinfo.start_angles[ROLL] = angles[ROLL];
VectorClear(self->avelocity);
self->startframe = 0;
}
else
{
self->spawnflags &= ~SF_PENDULUM_STARTON;
self->moveinfo.start_angles[ROLL] = 0;
VectorClear(self->s.angles);
VectorClear(self->avelocity);
}
gi.linkentity(self);
}
else if((fabs(self->avelocity[ROLL]) < 10) && (fabs(self->s.angles[ROLL]) < 10))
{
self->spawnflags |= SF_PENDULUM_SLOW;
self->moveinfo.start_angles[ROLL] = angles[ROLL];
VectorClear(self->avelocity);
self->startframe = 0;
}
}
else
{
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
// if it's still there, nuke it
if (other)
BecomeExplosion1 (other);
}
}
void pendulum_rotate (edict_t *self)
{
float this_angle;
float wave;
float sgor;
if(!(self->spawnflags & SF_PENDULUM_STARTON))
return;
if(self->spawnflags & SF_PENDULUM_SLOW)
{
if(self->startframe == 0)
{
// Then we just started moving again after being blocked
self->avelocity[ROLL] = -self->s.angles[ROLL];
self->startframe = level.framenum;
}
else
{
float next_angle;
next_angle = self->s.angles[ROLL] + self->avelocity[ROLL]*FRAMETIME;
if( (next_angle >= 0 && self->s.angles[ROLL] < 0) ||
(next_angle <= 0 && self->s.angles[ROLL] > 0) )
{
VectorClear(self->s.angles);
VectorClear(self->avelocity);
gi.linkentity(self);
return;
}
}
self->nextthink = level.time + FRAMETIME;
}
else
{
float old_velocity = self->avelocity[ROLL];
if(!self->startframe)
self->startframe = level.framenum;
sgor = sqrt( (float)sv_gravity->value / self->radius );
wave = sgor * (level.framenum - self->startframe) * 0.1;
this_angle = self->moveinfo.start_angles[ROLL] * cos(wave);
self->avelocity[ROLL] = -self->moveinfo.start_angles[ROLL] * sgor * sin(wave);
if( (self->spawnflags & SF_PENDULUM_STOPPING) && (cos(wave) > 0.0))
{
if( ((old_velocity > 0) && (self->avelocity[ROLL] <= 0)) ||
((old_velocity < 0) && (self->avelocity[ROLL] >= 0)) )
{
self->spawnflags &= ~SF_PENDULUM_STARTON;
VectorClear(self->avelocity);
self->nextthink = 0;
gi.linkentity(self);
return;
}
}
self->s.angles[ROLL] = this_angle;
self->nextthink = level.time + FRAMETIME;
}
gi.linkentity(self);
}
void pendulum_use (edict_t *self, edict_t *other, edict_t *activator)
{
if(self->spawnflags & SF_PENDULUM_STARTON)
{
if(self->spawnflags & SF_PENDULUM_STOP_AT_TOP)
{
self->spawnflags |= SF_PENDULUM_STOPPING;
}
else
{
VectorClear(self->avelocity);
self->spawnflags &= ~SF_PENDULUM_STARTON;
gi.linkentity(self);
}
}
else
{
self->spawnflags |= SF_PENDULUM_STARTON;
self->spawnflags &= ~SF_PENDULUM_STOPPING;
self->think = pendulum_rotate;
if(self->delay > 0)
{
float delay;
delay = self->delay * 2.0 * M_PI * sqrt(self->radius/(float)sv_gravity->value);
delay = 0.1 * (int)(10*delay);
self->nextthink = level.time + delay;
self->startframe = level.framenum + delay*10;
if(!(self->spawnflags & SF_PENDULUM_STOP_AT_TOP))
self->delay = 0;
}
else
{
if(self->s.angles[ROLL] == self->moveinfo.start_angles[ROLL])
self->startframe = level.framenum;
else
{
float t;
t = acos (self->s.angles[ROLL] / self->moveinfo.start_angles[ROLL]);
t /= sqrt((float)sv_gravity->value / self->radius);
self->startframe = level.framenum - t*10;
}
self->think(self);
}
}
}
void pendulum_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
// Mostly copied from func_explosive_explode. We can't use that function because
// the origin is a bit different.
vec3_t origin;
vec3_t forward, left, up;
vec3_t chunkorigin;
vec3_t size;
int count;
int mass;
// Particles originate from business end of pendulum
AngleVectors(self->s.angles,forward,left,up);
VectorScale(forward,self->move_origin[0],forward);
VectorScale(left,-self->move_origin[1],left);
VectorScale(up,self->move_origin[2],up);
VectorAdd(self->s.origin,forward,origin);
VectorAdd(origin,left,origin);
VectorAdd(origin,up,origin);
self->mass *= 2;
self->takedamage = DAMAGE_NO;
VectorSubtract (origin, self->enemy->s.origin, self->velocity);
VectorNormalize (self->velocity);
VectorScale (self->velocity, 150, self->velocity);
// start chunks towards the center
VectorSet(size, 0, 0, 0);
VectorScale (size, 0.5, size);
mass = self->mass;
if (!mass)
mass = 75;
// big chunks
if (mass >= 100)
{
count = mass / 100;
if (count > 8)
count = 8;
while(count--)
{
chunkorigin[0] = origin[0] + crandom() * size[0];
chunkorigin[1] = origin[1] + crandom() * size[1];
chunkorigin[2] = origin[2] + crandom() * size[2];
ThrowDebris (self, "models/objects/debris1/tris.md2", 1, chunkorigin, 0, 0);
}
}
// small chunks
count = mass / 25;
if (count > 16)
count = 16;
while(count--)
{
chunkorigin[0] = origin[0] + crandom() * size[0];
chunkorigin[1] = origin[1] + crandom() * size[1];
chunkorigin[2] = origin[2] + crandom() * size[2];
ThrowDebris (self, "models/objects/debris2/tris.md2", 2, chunkorigin, 0, 0);
}
G_FreeEdict (self);
}
void SP_func_pendulum (edict_t *ent)
{
float max_speed;
ent->class_id = ENTITY_FUNC_PENDULUM;
ent->solid = SOLID_BSP;
ent->movetype = MOVETYPE_PENDULUM;
if(!st.distance)
ent->moveinfo.distance = 90;
else
ent->moveinfo.distance = st.distance;
if(st.noise)
ent->noise_index = gi.soundindex(st.noise);
else
ent->noise_index = gi.soundindex("world/land.wav");
if(ent->moveinfo.distance >= 360)
{
gi.dprintf("func_pendulum distance must be < 360\n");
ent->moveinfo.distance = 359.;
}
if (!ent->speed)
ent->speed = 100;
if (!ent->radius)
ent->radius = 100;
if (!ent->mass)
ent->mass = 200;
if (st.phase > 0)
ent->delay = st.phase;
else
ent->delay = 0;
if(ent->delay > 1.0)
ent->delay -= (int)(ent->delay);
// Coefficient of restitution - default = 0.5, must be <= 1.0
if(ent->attenuation == 0.0)
ent->attenuation = 0.5;
else if(ent->attenuation > 1.0)
ent->attenuation = 1.0;
if (!ent->dmg)
ent->dmg = 5;
// This is the damage delivered by the pendulum at max speed. Convert to
// a damage scale used in our damage equation.
max_speed = ent->moveinfo.distance/2 * M_PI / 180. * sqrt((float)sv_gravity->value * ent->radius );
if(max_speed <= 200.)
ent->dmg = 0;
else
{
float dmg;
dmg = (float)(ent->dmg) * 100. / (max_speed - 200.);
ent->dmg = (int)(dmg - 0.5) + 1;
}
if(ent->health > 0)
{
ent->die = pendulum_die;
ent->takedamage = DAMAGE_YES;
}
ent->blocked = pendulum_blocked;
// ent->touch = pendulum_touch;
if(!ent->accel)
ent->accel = 1;
else if (ent->accel > ent->speed)
ent->accel = ent->speed;
if(!ent->decel)
ent->decel = 1;
else if (ent->decel > ent->speed)
ent->decel = ent->speed;
gi.setmodel (ent, ent->model);
ent->s.angles[ROLL] = ent->moveinfo.distance/2;
ent->moveinfo.start_angles[ROLL] = ent->s.angles[ROLL];
if(ent->spawnflags & SF_PENDULUM_STARTON)
{
ent->think = pendulum_rotate;
ent->nextthink = level.time + FRAMETIME;
}
else
{
ent->use = pendulum_use;
}
gi.linkentity (ent);
}

View File

@ -1,493 +0,0 @@
#include "g_local.h"
/* Func_reflect is adopted from psychospaz' original floor reflection code. See
psychospaz' stuff at http://modscape.telefragged.com
Chief differences:
1) The obvious - reflections work in 6 directions, not just the floor.
2) Uses a new entity rather than automatically doing reflections based on surface
or content properties of the floor.
3) Most TE_ effects are reflected, in addition to entities. This requires calls to
the appropriate ReflectXXXXX routine in several places scattered around the code.
4) Roll angle is correct.
You can have up to 16 func_reflects in one map. To increase that number change
MAX_MIRRORS below. The only reason to use a static limit is that the func_reflect
entity addresses get copied to g_mirror, which makes searching for func_reflects
much easier.
*/
#define MAX_MIRRORS 16
edict_t *g_mirror[MAX_MIRRORS];
#define SF_REFLECT_OFF 1
#define SF_REFLECT_TOGGLE 2
void ReflectExplosion (int type, vec3_t origin)
{
int m;
edict_t *mirror;
vec3_t org;
if(!level.num_reflectors)
return;
for(m=0; m<level.num_reflectors; m++)
{
mirror = g_mirror[m];
if(!mirror->inuse)
continue;
if(mirror->spawnflags & SF_REFLECT_OFF)
continue;
// Don't reflect explosions (other than BFG) from floor or ceiling,
// 'cuz there's no way to do it right
if((mirror->style <= 1) && (type != TE_BFG_EXPLOSION) && (type != TE_BFG_BIGEXPLOSION))
continue;
VectorCopy(origin,org);
switch(mirror->style)
{
case 0: org[2] = 2*mirror->absmax[2] - origin[2] + mirror->moveinfo.distance - 2; break;
case 1: org[2] = 2*mirror->absmin[2] - origin[2] - mirror->moveinfo.distance + 2; break;
case 2: org[0] = 2*mirror->absmin[0] - origin[0] + mirror->moveinfo.distance + 2; break;
case 3: org[0] = 2*mirror->absmax[0] - origin[0] - mirror->moveinfo.distance - 2; break;
case 4: org[1] = 2*mirror->absmin[1] - origin[1] + mirror->moveinfo.distance + 2; break;
case 5: org[1] = 2*mirror->absmax[1] - origin[1] - mirror->moveinfo.distance - 2; break;
}
if(org[0] < mirror->absmin[0]) continue;
if(org[0] > mirror->absmax[0]) continue;
if(org[1] < mirror->absmin[1]) continue;
if(org[1] > mirror->absmax[1]) continue;
if(org[2] < mirror->absmin[2]) continue;
if(org[2] > mirror->absmax[2]) continue;
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (type);
WRITE_COORD (org);
MESSAGE_SEND (MSG_PHS, org, NULL);
}
}
void ReflectTrail (int type, vec3_t start, vec3_t end)
{
int m;
edict_t *mirror;
vec3_t p1, p2;
if(!level.num_reflectors)
return;
for(m=0; m<level.num_reflectors; m++)
{
mirror = g_mirror[m];
if(!mirror->inuse)
continue;
if(mirror->spawnflags & SF_REFLECT_OFF)
continue;
VectorCopy(start,p1);
VectorCopy(end, p2);
switch(mirror->style)
{
case 0:
p1[2] = 2*mirror->absmax[2] - start[2] + mirror->moveinfo.distance + 2;
p2[2] = 2*mirror->absmax[2] - end[2] + mirror->moveinfo.distance + 2;
break;
case 1:
p1[2] = 2*mirror->absmin[2] - start[2] - mirror->moveinfo.distance - 2;
p2[2] = 2*mirror->absmin[2] - end[2] - mirror->moveinfo.distance - 2;
break;
case 2:
p1[0] = 2*mirror->absmin[0] - start[0] + mirror->moveinfo.distance + 2;
p2[0] = 2*mirror->absmin[0] - end[0] + mirror->moveinfo.distance + 2;
break;
case 3:
p1[0] = 2*mirror->absmax[0] - start[0] - mirror->moveinfo.distance - 2;
p2[0] = 2*mirror->absmax[0] - end[0] - mirror->moveinfo.distance - 2;
break;
case 4:
p1[1] = 2*mirror->absmin[1] - start[1] + mirror->moveinfo.distance + 2;
p2[1] = 2*mirror->absmin[1] - end[1] + mirror->moveinfo.distance + 2;
break;
case 5:
p1[1] = 2*mirror->absmax[1] - start[1] - mirror->moveinfo.distance - 2;
p2[1] = 2*mirror->absmax[1] - end[1] - mirror->moveinfo.distance - 2;
break;
}
if(p1[0] < mirror->absmin[0]) continue;
if(p1[0] > mirror->absmax[0]) continue;
if(p1[1] < mirror->absmin[1]) continue;
if(p1[1] > mirror->absmax[1]) continue;
if(p1[2] < mirror->absmin[2]) continue;
if(p1[2] > mirror->absmax[2]) continue;
// If p1 is within func_reflect, we assume p2 is also. If map is constructed
// properly this should always be true.
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (type);
WRITE_COORD (p1);
WRITE_COORD (p2);
MESSAGE_SEND (MSG_PHS, p1, NULL);
}
}
void ReflectSteam (vec3_t origin,vec3_t movedir,int count,int sounds,int speed, int wait, int nextid)
{
int m;
edict_t *mirror;
vec3_t org, dir;
if(!level.num_reflectors)
return;
for(m=0; m<level.num_reflectors; m++)
{
mirror = g_mirror[m];
if(!mirror->inuse)
continue;
if(mirror->spawnflags & SF_REFLECT_OFF)
continue;
VectorCopy(origin,org);
VectorCopy(movedir,dir);
switch(mirror->style)
{
case 0:
org[2] = 2*mirror->absmax[2] - origin[2] + mirror->moveinfo.distance + 2;
dir[2] = -dir[2];
break;
case 1:
org[2] = 2*mirror->absmin[2] - origin[2] - mirror->moveinfo.distance - 2;
dir[2] = -dir[2];
break;
case 2:
org[0] = 2*mirror->absmin[0] - origin[0] + mirror->moveinfo.distance + 2;
dir[0] = -dir[0];
break;
case 3:
org[0] = 2*mirror->absmax[0] - origin[0] - mirror->moveinfo.distance - 2;
dir[0] = -dir[0];
break;
case 4:
org[1] = 2*mirror->absmin[1] - origin[1] + mirror->moveinfo.distance + 2;
dir[1] = -dir[1];
break;
case 5:
org[1] = 2*mirror->absmax[1] - origin[1] - mirror->moveinfo.distance - 2;
dir[1] = -dir[1];
break;
}
if(org[0] < mirror->absmin[0]) continue;
if(org[0] > mirror->absmax[0]) continue;
if(org[1] < mirror->absmin[1]) continue;
if(org[1] > mirror->absmax[1]) continue;
if(org[2] < mirror->absmin[2]) continue;
if(org[2] > mirror->absmax[2]) continue;
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (TE_STEAM);
WRITE_SHORT (nextid);
WRITE_BYTE (count);
WRITE_COORD (org);
WRITE_DIR (dir);
WRITE_BYTE (sounds&0xff);
WRITE_SHORT (speed);
WRITE_LONG (wait);
MESSAGE_SEND (MSG_PHS, org, NULL);
}
}
void ReflectSparks (int type,vec3_t origin,vec3_t movedir)
{
int m;
edict_t *mirror;
vec3_t org, dir;
if(!level.num_reflectors)
return;
for(m=0; m<level.num_reflectors; m++)
{
mirror = g_mirror[m];
if(!mirror->inuse)
continue;
if(mirror->spawnflags & SF_REFLECT_OFF)
continue;
// Don't reflect in floor or ceiling because sparks are affected by
// gravity
if(mirror->style <= 1)
continue;
VectorCopy(origin,org);
VectorCopy(movedir,dir);
switch(mirror->style)
{
case 0:
org[2] = 2*mirror->absmax[2] - origin[2] + mirror->moveinfo.distance + 2;
dir[2] = -dir[2];
break;
case 1:
org[2] = 2*mirror->absmin[2] - origin[2] - mirror->moveinfo.distance - 2;
dir[2] = -dir[2];
break;
case 2:
org[0] = 2*mirror->absmin[0] - origin[0] + mirror->moveinfo.distance + 2;
dir[0] = -dir[0];
break;
case 3:
org[0] = 2*mirror->absmax[0] - origin[0] - mirror->moveinfo.distance - 2;
dir[0] = -dir[0];
break;
case 4:
org[1] = 2*mirror->absmin[1] - origin[1] + mirror->moveinfo.distance + 2;
dir[1] = -dir[1];
break;
case 5:
org[1] = 2*mirror->absmax[1] - origin[1] - mirror->moveinfo.distance - 2;
dir[1] = -dir[1];
break;
}
if(org[0] < mirror->absmin[0]) continue;
if(org[0] > mirror->absmax[0]) continue;
if(org[1] < mirror->absmin[1]) continue;
if(org[1] > mirror->absmax[1]) continue;
if(org[2] < mirror->absmin[2]) continue;
if(org[2] > mirror->absmax[2]) continue;
MESSAGE_BEGIN(svc_temp_entity);
WRITE_BYTE(type);
WRITE_COORD(org);
if(type != TE_CHAINFIST_SMOKE)
{
WRITE_DIR(dir);
}
MESSAGE_SEND(MSG_PHS, org, NULL);
}
}
void DeleteReflection (edict_t *ent, int index)
{
edict_t *r;
if(index < 0)
{
int i;
for(i=0; i<6; i++)
{
r = ent->reflection[i];
if(r)
{
if(r->client)
free(r->client);
memset (r, 0, sizeof(*r));
r->classname = "freed";
r->freetime = level.time;
r->inuse = false;
}
ent->reflection[i] = NULL;
}
}
else
{
r = ent->reflection[index];
if(r)
{
if(r->client)
free(r->client);
memset (r, 0, sizeof(*r));
r->classname = "freed";
r->freetime = level.time;
r->inuse = false;
ent->reflection[index] = NULL;
}
}
}
void AddReflection (edict_t *ent)
{
gclient_t *cl;
edict_t *mirror;
float roll;
int i, m;
bool is_reflected;
vec3_t forward;
vec3_t org, oldorg;
for(i=0; i<6; i++)
{
is_reflected = false;
for(m=0; m<level.num_reflectors && !is_reflected; m++)
{
mirror = g_mirror[m];
if(!mirror->inuse)
continue;
if(mirror->spawnflags & SF_REFLECT_OFF)
continue;
if(mirror->style != i)
continue;
VectorCopy(ent->s.origin,org);
switch(i)
{
case 0: org[2] = 2*mirror->absmax[2] - ent->s.origin[2] - mirror->moveinfo.distance - 2; break;
case 1: org[2] = 2*mirror->absmin[2] - ent->s.origin[2] + mirror->moveinfo.distance + 2; break;
case 2: org[0] = 2*mirror->absmin[0] - ent->s.origin[0] + mirror->moveinfo.distance + 2; break;
case 3: org[0] = 2*mirror->absmax[0] - ent->s.origin[0] - mirror->moveinfo.distance - 2; break;
case 4: org[1] = 2*mirror->absmin[1] - ent->s.origin[1] + mirror->moveinfo.distance + 2; break;
case 5: org[1] = 2*mirror->absmax[1] - ent->s.origin[1] - mirror->moveinfo.distance - 2; break;
}
if(org[0] < mirror->absmin[0]) continue;
if(org[0] > mirror->absmax[0]) continue;
if(org[1] < mirror->absmin[1]) continue;
if(org[1] > mirror->absmax[1]) continue;
if(org[2] < mirror->absmin[2]) continue;
if(org[2] > mirror->absmax[2]) continue;
is_reflected = true;
}
if(is_reflected)
{
if (!ent->reflection[i])
{
ent->reflection[i] = G_Spawn();
ent->reflection[i]->owner = ent;
ent->reflection[i]->activator = mirror;
if(ent->s.effects & EF_ROTATE)
{
ent->s.effects &= ~EF_ROTATE;
gi.linkentity(ent);
}
ent->reflection[i]->movetype = MOVETYPE_NONE;
ent->reflection[i]->solid = SOLID_NOT;
ent->reflection[i]->classname = "reflection";
ent->reflection[i]->flags = FL_REFLECT;
ent->reflection[i]->takedamage = DAMAGE_NO;
}
if (ent->client && !ent->reflection[i]->client)
{
cl = (gclient_t *)malloc(sizeof(gclient_t));
ent->reflection[i]->client = cl;
}
if (ent->client && ent->reflection[i]->client)
{
// Lazarus: Hmm.. this crashes when loading saved game.
// Not sure what use pers is anyhow?
// ent->reflection[i]->client->pers = ent->client->pers;
ent->reflection[i]->s = ent->s;
}
ent->reflection[i]->s.number = ent->reflection[i] - g_edicts;
ent->reflection[i]->s.modelindex = ent->s.modelindex;
ent->reflection[i]->s.weaponmodel = ent->s.weaponmodel;
ent->reflection[i]->s.body = ent->s.body;
ent->reflection[i]->s.sequence = ent->s.sequence;
ent->reflection[i]->s.skin = ent->s.skin;
ent->reflection[i]->s.frame = ent->s.frame;
ent->reflection[i]->s.renderfx = ent->s.renderfx;
ent->reflection[i]->s.effects = ent->s.effects;
ent->reflection[i]->s.renderfx &= ~RF_IR_VISIBLE;
VectorCopy (ent->s.angles, ent->reflection[i]->s.angles);
switch(i)
{
case 0:
case 1:
ent->reflection[i]->s.angles[PITCH]+=180;
ent->reflection[i]->s.angles[YAW] +=180;
ent->reflection[i]->s.angles[ROLL] =360-ent->reflection[i]->s.angles[ROLL];
break;
case 2:
case 3:
AngleVectors(ent->reflection[i]->s.angles,forward,NULL,NULL);
roll = ent->reflection[i]->s.angles[ROLL];
forward[0] = -forward[0];
vectoangles(forward,ent->reflection[i]->s.angles);
if((ent->s.angles[PITCH] > 90) && (ent->s.angles[PITCH] < 270))
{
ent->reflection[i]->s.angles[YAW] += 180;
ent->reflection[i]->s.angles[PITCH] = 180-ent->reflection[i]->s.angles[PITCH];
}
ent->reflection[i]->s.angles[ROLL] = 360-roll;
break;
case 4:
case 5:
AngleVectors(ent->reflection[i]->s.angles,forward,NULL,NULL);
roll = ent->reflection[i]->s.angles[ROLL];
forward[1] = -forward[1];
vectoangles(forward,ent->reflection[i]->s.angles);
if((ent->s.angles[PITCH] > 90) && (ent->s.angles[PITCH] < 270))
{
ent->reflection[i]->s.angles[YAW] += 180;
ent->reflection[i]->s.angles[PITCH] = 180-ent->reflection[i]->s.angles[PITCH];
}
ent->reflection[i]->s.angles[ROLL] = 360-roll;
}
// Move player floor reflections down an additional bit so that their
// feet don't poke through the floor when looking down.
if(ent->client && i==0)
org[2] -= 4;
VectorCopy (ent->reflection[i]->s.origin,oldorg);
VectorCopy (org, ent->reflection[i]->s.origin);
if(ent->s.renderfx & RF_BEAM)
{
vec3_t delta;
VectorSubtract(ent->reflection[i]->s.origin,ent->s.origin,delta);
VectorAdd(ent->s.old_origin,delta,ent->reflection[i]->s.old_origin);
}
else
{
// VectorCopy(oldorg, ent->reflection[i]->s.old_origin);
VectorCopy(org,ent->reflection[i]->s.old_origin);
}
gi.linkentity (ent->reflection[i]);
}
else if (ent->reflection[i])
{
DeleteReflection(ent,i);
}
}
}
void use_func_reflect (edict_t *self, edict_t *other, edict_t *activator)
{
if (self->spawnflags & SF_REFLECT_OFF)
{
// was off, turn it on
self->spawnflags &= ~SF_REFLECT_OFF;
}
else
{
// was on, turn it off
self->spawnflags |= SF_REFLECT_OFF;
}
if (!(self->spawnflags & SF_REFLECT_TOGGLE))
self->use = NULL;
}
void SP_func_reflect (edict_t *self)
{
if(level.num_reflectors >= MAX_MIRRORS)
{
gi.dprintf("Max number of func_reflect's (%d) exceeded.\n",MAX_MIRRORS);
G_FreeEdict(self);
return;
}
self->class_id = ENTITY_FUNC_REFLECT;
gi.setmodel (self, self->model);
self->svflags = SVF_NOCLIENT;
g_mirror[level.num_reflectors] = self;
if(!st.lip)
st.lip = 2;
self->moveinfo.distance = st.lip;
self->use = use_func_reflect;
level.num_reflectors++;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,307 +0,0 @@
#include "g_local.h"
bool has_valid_enemy (edict_t *self);
void HuntTarget (edict_t *self);
edict_t *SpawnThing()
{
edict_t *thing;
thing = G_Spawn();
thing->classname = TagMalloc(6,TAG_LEVEL);
strcpy(thing->classname,"thing");
return thing;
}
void thing_restore_leader (edict_t *self)
{
edict_t *monster;
monster = self->target_ent;
if(!monster || !monster->inuse)
{
G_FreeEdict(self);
return;
}
if(monster->monsterinfo.old_leader && monster->monsterinfo.old_leader->inuse)
{
if(VectorCompare(monster->monsterinfo.old_leader->s.origin,self->move_origin))
{
self->nextthink = level.time + 0.5;
return;
}
monster->monsterinfo.leader = monster->monsterinfo.old_leader;
monster->monsterinfo.old_leader = NULL;
monster->movetarget = monster->goalentity = monster->monsterinfo.leader;
}
else
{
monster->monsterinfo.aiflags &= ~AI_FOLLOW_LEADER;
}
monster->vehicle = NULL;
monster->monsterinfo.aiflags &= ~(AI_CHASE_THING | AI_SEEK_COVER | AI_EVADE_GRENADE);
gi.linkentity(monster);
G_FreeEdict(self);
}
void thing_think (edict_t *self)
{
vec3_t vec;
vec_t dist;
edict_t *monster;
monster = self->target_ent;
if(level.time <= self->touch_debounce_time)
{
if(monster && monster->inuse)
{
if(monster->movetarget == self)
{
if(monster->health > 0)
{
if(monster->monsterinfo.aiflags & AI_SEEK_ENEMY)
{
if(monster->enemy && monster->enemy->inuse)
{
if(visible(monster,monster->enemy))
{
monster->monsterinfo.aiflags &= ~(AI_CHASE_THING | AI_SEEK_ENEMY);
monster->movetarget = monster->goalentity = monster->enemy;
VectorSubtract (monster->enemy->s.origin, monster->s.origin, vec);
monster->ideal_yaw = vectoyaw(vec);
G_FreeEdict(self);
return;
}
}
}
VectorSubtract(monster->s.origin,self->s.origin,vec);
vec[2] = 0;
dist = VectorLength(vec);
if(dist >= monster->size[0])
{
self->nextthink = level.time + FRAMETIME;
return;
}
}
}
}
}
if(!monster || !monster->inuse || (monster->health <= 0))
{
G_FreeEdict(self);
return;
}
if(monster->goalentity == self)
monster->goalentity = NULL;
if(monster->movetarget == self)
monster->movetarget = NULL;
if(monster->monsterinfo.aiflags & AI_FOLLOW_LEADER)
{
monster->monsterinfo.leader = NULL;
if(monster->monsterinfo.old_leader && monster->monsterinfo.old_leader->inuse)
{
monster->monsterinfo.pausetime = level.time + 2;
monster->monsterinfo.stand(monster);
VectorCopy(monster->monsterinfo.old_leader->s.origin,self->move_origin);
self->nextthink = level.time + 2;
self->think = thing_restore_leader;
gi.linkentity(monster);
return;
}
else
{
monster->monsterinfo.aiflags &= ~AI_FOLLOW_LEADER;
}
}
if(monster->monsterinfo.aiflags & AI_CHICKEN)
{
monster->monsterinfo.stand(monster);
monster->monsterinfo.aiflags |= AI_STAND_GROUND;
monster->monsterinfo.pausetime = level.time + 100000;
}
monster->vehicle = NULL;
monster->monsterinfo.aiflags &= ~(AI_CHASE_THING | AI_SEEK_COVER | AI_EVADE_GRENADE | AI_SEEK_ENEMY);
G_FreeEdict(self);
if (has_valid_enemy(monster))
{
monster->monsterinfo.pausetime = 0;
monster->monsterinfo.aiflags &= ~(AI_STAND_GROUND | AI_TEMP_STAND_GROUND);
monster->goalentity = monster->enemy;
if (visible(monster, monster->enemy))
{
FoundTarget (monster);
return;
}
HuntTarget (monster);
return;
}
monster->enemy = NULL;
monster->monsterinfo.pausetime = level.time + 100000000;
monster->monsterinfo.stand (monster);
}
void thing_think_pause(edict_t *self)
{
edict_t *monster;
if(level.time > self->touch_debounce_time)
{
thing_think(self);
return;
}
monster = self->target_ent;
if(!monster || !monster->inuse)
{
G_FreeEdict(self);
return;
}
if(has_valid_enemy(monster))
{
vec3_t dir;
vec3_t angles;
if(visible(monster->enemy,monster))
{
self->touch_debounce_time = 0;
thing_think(self);
return;
}
VectorSubtract(monster->enemy->s.origin,monster->s.origin,dir);
VectorNormalize(dir);
vectoangles(dir,angles);
monster->ideal_yaw = angles[YAW];
M_ChangeYaw(monster);
}
self->nextthink = level.time + FRAMETIME;
}
void thing_grenade_boom (edict_t *self)
{
edict_t *monster;
monster = self->target_ent;
G_FreeEdict(self);
if(!monster || !monster->inuse || (monster->health <= 0))
return;
monster->monsterinfo.aiflags &= ~(AI_CHASE_THING | AI_EVADE_GRENADE | AI_STAND_GROUND);
monster->monsterinfo.pausetime = 0;
if(monster->enemy)
monster->monsterinfo.run(monster);
}
void thing_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
if(self->target_ent != other)
return;
if(other->health <= 0)
{
G_FreeEdict(self);
return;
}
self->touch = NULL;
if( self->target_ent->monsterinfo.aiflags & AI_SEEK_COVER )
{
edict_t *monster;
// For monster/actor seeking cover after firing,
// pause a random bit before resuming attack
self->touch_debounce_time = level.time + random()*6.;
monster = self->target_ent;
monster->monsterinfo.stand(monster);
monster->monsterinfo.pausetime = self->touch_debounce_time;
self->think = thing_think_pause;
self->think(self);
return;
}
if( self->target_ent->monsterinfo.aiflags & AI_EVADE_GRENADE )
{
edict_t *grenade = other->next_grenade;
if(other->goalentity == self)
other->goalentity = NULL;
if(other->movetarget == self)
other->movetarget = NULL;
other->vehicle = NULL;
if(grenade)
{
// make sure this is still a grenade
if(grenade->inuse)
{
if((grenade->class_id != ENTITY_GRENADE) && (grenade->class_id != ENTITY_HANDGRENADE))
other->next_grenade = grenade = NULL;
}
else
other->next_grenade = grenade = NULL;
}
if(grenade)
{
if(self->touch_debounce_time > level.time)
{
other->monsterinfo.pausetime = self->touch_debounce_time + 0.1;
other->monsterinfo.aiflags |= AI_STAND_GROUND;
other->monsterinfo.stand(other);
}
else
other->monsterinfo.pausetime = 0;
other->enemy = grenade->owner;
if (has_valid_enemy(other))
{
other->goalentity = other->enemy;
if (visible(other, other->enemy))
FoundTarget (other);
else
HuntTarget (other);
}
else
{
other->enemy = NULL;
other->monsterinfo.stand (other);
}
if(other->monsterinfo.pausetime > 0)
{
self->think = thing_grenade_boom;
self->nextthink = other->monsterinfo.pausetime;
return;
}
other->monsterinfo.aiflags &= ~(AI_CHASE_THING | AI_EVADE_GRENADE);
}
else if (has_valid_enemy(other))
{
other->monsterinfo.aiflags &= ~(AI_CHASE_THING | AI_EVADE_GRENADE);
other->goalentity = other->enemy;
if (visible(other, other->enemy))
FoundTarget (other);
else
HuntTarget (other);
}
else
{
other->enemy = NULL;
other->monsterinfo.pausetime = level.time + 100000000;
other->monsterinfo.aiflags &= ~(AI_CHASE_THING | AI_EVADE_GRENADE);
other->monsterinfo.stand (other);
}
G_FreeEdict(self);
return;
}
self->touch_debounce_time = 0;
thing_think(self);
}
void SP_thing (edict_t *self)
{
self->class_id = ENTITY_THING;
self->solid = SOLID_TRIGGER;
VectorSet(self->mins,-4,-4,-4);
VectorSet(self->maxs, 4, 4, 4);
self->movetype = MOVETYPE_NONE;
self->monsterinfo.aiflags |= AI_GOOD_GUY;
self->svflags |= SVF_MONSTER;
self->health = 1000;
self->takedamage = DAMAGE_NO;
if(developer->value) {
gi.setmodel (self, "models/items/c_head/tris.md2");
self->s.effects |= EF_BLASTER;
}
self->touch = thing_touch;
self->think = thing_think;
self->nextthink = level.time + 2;
gi.linkentity(self);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,457 +0,0 @@
#include "g_local.h"
#define RFAST -3
#define RMEDIUM -2
#define RSLOW -1
#define STOP 0
#define SLOW 1
#define MEDIUM 2
#define FAST 3
#define VEHICLE_BLOCK_STOPS 4
void func_vehicle_explode (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
vec3_t origin;
vec3_t chunkorigin;
vec3_t size;
int count;
int mass;
if(self->deathtarget)
{
self->target = self->deathtarget;
G_UseTargets (self, attacker);
}
// bmodel origins are (0 0 0), we need to adjust that here
VectorScale (self->size, 0.5, size);
VectorAdd (self->absmin, size, origin);
VectorCopy (origin, self->s.origin);
self->takedamage = DAMAGE_NO;
if (self->dmg)
T_RadiusDamage (self, attacker, self->dmg, NULL, self->dmg+40, MOD_EXPLOSIVE, -0.5);
VectorSubtract (self->s.origin, inflictor->s.origin, self->velocity);
VectorNormalize (self->velocity);
VectorScale (self->velocity, 150, self->velocity);
// start chunks towards the center
VectorScale (size, 0.5, size);
mass = self->mass;
// big chunks
if (mass >= 100)
{
count = mass / 100;
if (count > 8)
count = 8;
while(count--)
{
chunkorigin[0] = origin[0] + crandom() * size[0];
chunkorigin[1] = origin[1] + crandom() * size[1];
chunkorigin[2] = origin[2] + crandom() * size[2];
ThrowDebris (self, "models/objects/debris1/tris.md2", 1, chunkorigin, 0, 0);
}
}
// small chunks
count = mass / 25;
if (count > 16)
count = 16;
while(count--)
{
chunkorigin[0] = origin[0] + crandom() * size[0];
chunkorigin[1] = origin[1] + crandom() * size[1];
chunkorigin[2] = origin[2] + crandom() * size[2];
ThrowDebris (self, "models/objects/debris2/tris.md2", 2, chunkorigin, 0, 0);
}
if (self->dmg)
BecomeExplosion1 (self);
else
G_FreeEdict (self);
}
void vehicle_blocked (edict_t *self, edict_t *other)
{
edict_t *attacker;
if((self->spawnflags & VEHICLE_BLOCK_STOPS) || (other == world))
{
VectorClear(self->velocity);
VectorClear(self->avelocity);
self->moveinfo.current_speed = 0;
gi.linkentity(self);
return;
}
if (other->takedamage)
{
if (self->teammaster->owner)
attacker = self->teammaster->owner;
else
attacker = self->owner;
T_Damage (other, self, attacker, vec3_origin, other->s.origin, vec3_origin, self->teammaster->dmg, 10, 0, MOD_CRUSH);
}
else
{
VectorClear(self->velocity);
VectorClear(self->avelocity);
self->moveinfo.current_speed = 0;
self->moveinfo.state = STOP;
gi.linkentity(self);
}
if (!(other->svflags & SVF_MONSTER) && (!other->client))
{
T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
if (other)
BecomeExplosion1 (other);
return;
}
}
// Not needed, because collisions are effectively prevented by the vehicle physics in
// g_phys.c.
void vehicle_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
vec3_t dir, v;
vec3_t new_origin, new_velocity;
vec_t points;
vec_t vspeed, mspeed;
vec_t knockback;
vec3_t end;
trace_t tr;
if (other == world || (self->spawnflags & VEHICLE_BLOCK_STOPS) )
{
VectorClear(self->velocity);
VectorClear(self->avelocity);
self->moveinfo.current_speed = 0;
gi.linkentity(self);
}
if (!self->owner) return; // if vehicle isn't being driven, it can't hurt anybody
if (other == self->owner) return; // can't hurt the driver
if (other->takedamage == DAMAGE_NO) return;
// we damage func_explosives elsewhere. About all that's left to hurt are
// players and monsters
if (!other->client && !(other->svflags & SVF_MONSTER)) return;
vspeed = VectorLength(self->velocity);
if(!vspeed) return;
VectorSubtract(other->s.origin,self->s.origin,dir);
dir[2] = 0;
VectorNormalize(dir);
VectorCopy(self->velocity,v);
VectorNormalize(v);
// damage and knockback are proportional to square of velocity * mass of vehicle.
// Lessee... with a mass=2000 vehicle traveling 400 units/sec, give 100 points
// damage and a velocity of 160 to a 200 mass monster.
vspeed *= DotProduct(dir,v);
mspeed = VectorLength(other->velocity) * DotProduct(dir,v);
vspeed -= mspeed;
if(vspeed <= 0.) return;
// for speed < 200, don't do damage but move monster
if(vspeed < 200) {
if(other->mass > self->mass) vspeed *= self->mass/other->mass;
VectorMA(other->velocity,vspeed,dir,new_velocity);
VectorMA(other->s.origin,FRAMETIME,new_velocity,new_origin);
new_origin[2] += 2;
// if the move would place the monster in a solid, make him go splat
VectorCopy(new_origin,end);
end[2] -= 1;
tr = gi.trace(new_origin,other->mins,other->maxs,end,self,CONTENTS_SOLID);
if(tr.startsolid)
// splat
T_Damage (other, self, self->owner, dir, self->s.origin, vec3_origin,
other->health - other->gib_health + 1, 0, 0, MOD_VEHICLE);
else
{
// go ahead and move the bastard
VectorCopy(new_velocity,other->velocity);
VectorCopy(new_origin,other->s.origin);
gi.linkentity(other);
}
return;
}
if (other->damage_debounce_time > level.time) return;
other->damage_debounce_time = level.time + 0.2;
points = 100. * (self->mass/2000 * vspeed*vspeed/160000);
// knockback takes too long to take effect. If we can move him w/o throwing him
// into a solid, do so NOW
dir[2] = 0.2; // make knockback slightly upward
VectorMA(other->velocity,vspeed,dir,new_velocity);
VectorMA(other->s.origin,FRAMETIME,new_velocity,new_origin);
if(gi.pointcontents(new_origin) & CONTENTS_SOLID)
knockback = (160./500.) * 200. * (self->mass/2000 * vspeed*vspeed/160000);
else {
knockback = 0;
VectorCopy(new_velocity,other->velocity);
VectorCopy(new_origin, other->s.origin);
}
T_Damage (other, self, self->owner, dir, self->s.origin, vec3_origin,
(int)points, (int)knockback, 0, MOD_VEHICLE);
gi.linkentity(other);
}
void vehicle_disengage (edict_t *vehicle)
{
edict_t *driver;
vec3_t forward, left, f1, l1;
driver = vehicle->owner;
if(!driver) return;
AngleVectors(vehicle->s.angles, forward, left, NULL);
VectorCopy(vehicle->velocity,driver->velocity);
VectorScale(forward,vehicle->move_origin[0],f1);
VectorScale(left,-vehicle->move_origin[1],l1);
VectorAdd(vehicle->s.origin,f1,driver->s.origin);
VectorAdd(driver->s.origin,l1,driver->s.origin);
driver->s.origin[2] += vehicle->move_origin[2];
driver->vehicle = NULL;
driver->client->vehicle_framenum = level.framenum;
driver->movetype = MOVETYPE_WALK;
driver->gravity = 1;
// turn ON client side prediction for this player
driver->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
vehicle->s.sound = 0;
gi.linkentity (driver);
vehicle->owner = NULL;
}
void vehicle_think (edict_t *self)
{
float aspeed, speed, newspeed;
vec3_t forward, left, f1, l1, v;
self->nextthink = level.time + FRAMETIME;
VectorCopy(self->oldvelocity,v);
v[2] = 0;
speed = VectorLength(v);
if(speed > 0)
self->s.effects |= EF_ANIM_ALL;
else
self->s.effects &= ~EF_ANIM_ALL;
AngleVectors(self->s.angles, forward, left, NULL);
if(DotProduct(forward,self->oldvelocity) < 0) speed = -speed;
self->moveinfo.current_speed = speed;
if (self->owner)
{
// ... then we have a driver
if (self->owner->health <= 0)
{
vehicle_disengage(self);
return;
}
if (self->owner->client->use)
{
// if he's pressing the use key, and he didn't just
// get on or off, disengage
if(level.framenum - self->owner->client->vehicle_framenum > 2)
{
VectorCopy(self->velocity,self->oldvelocity);
vehicle_disengage(self);
return;
}
}
if (self->owner->client->ucmd.forwardmove != 0 && level.time > self->moveinfo.wait)
{
if(self->owner->client->ucmd.forwardmove > 0)
{
if(self->moveinfo.state < FAST)
{
self->moveinfo.state++;
self->moveinfo.next_speed = self->moveinfo.state * self->speed/3;
self->moveinfo.wait = level.time + FRAMETIME;
}
}
else
{
if(self->moveinfo.state > RFAST)
{
self->moveinfo.state--;
self->moveinfo.next_speed = self->moveinfo.state * self->speed/3;
self->moveinfo.wait = level.time + FRAMETIME;
}
}
}
if(self->moveinfo.current_speed < self->moveinfo.next_speed)
{
speed = self->moveinfo.current_speed + self->accel/10;
if(speed > self->moveinfo.next_speed) speed = self->moveinfo.next_speed;
}
else if(self->moveinfo.current_speed > self->moveinfo.next_speed)
{
speed = self->moveinfo.current_speed - self->decel/10;
if(speed < self->moveinfo.next_speed) speed = self->moveinfo.next_speed;
}
VectorScale(forward,speed,self->velocity);
if (self->owner->client->ucmd.sidemove != 0 && speed != 0 )
{
aspeed = 180.*speed/(M_PI*self->radius);
if(self->owner->client->ucmd.sidemove > 0) aspeed = -aspeed;
self->avelocity[1] = aspeed;
}
else
self->avelocity[1] = 0;
if(speed != 0)
self->s.sound = self->noise_index;
else
self->s.sound = self->noise_index2;
gi.linkentity(self);
// Copy velocities and set position of driver
VectorCopy(self->velocity,self->owner->velocity);
VectorScale(forward,self->move_origin[0],f1);
VectorScale(left,-self->move_origin[1],l1);
VectorAdd(self->s.origin,f1,self->owner->s.origin);
VectorAdd(self->owner->s.origin,l1,self->owner->s.origin);
self->owner->s.origin[2] += self->move_origin[2];
// If moving, turn driver
if(speed != 0)
{
float yaw;
yaw = self->avelocity[1]*FRAMETIME;
self->owner->s.angles[YAW] += yaw;
self->owner->client->ps.pmove.delta_angles[YAW] += ANGLE2SHORT(yaw);
self->owner->client->ps.pmove.pm_type = PM_FREEZE;
}
VectorCopy(self->velocity,self->oldvelocity);
gi.linkentity(self->owner);
}
else
{
int i;
edict_t *ent;
vec3_t dir, drive;
//
// No driver
//
// if vehicle has stopped, drop it to ground.
// otherwise slow it down
if(speed==0)
{
if(!self->groundentity)
SV_AddGravity (self);
}
else
{
// no driver... slow to an eventual stop in no more than 5 sec.
self->moveinfo.next_speed = 0;
self->moveinfo.state = STOP;
if(speed > 0)
newspeed = max(0.,speed - self->speed/50);
else
newspeed = min(0.,speed + self->speed/50);
VectorScale(forward,newspeed,self->velocity);
VectorScale(self->avelocity,newspeed/speed,self->avelocity);
VectorCopy(self->velocity,self->oldvelocity);
gi.linkentity(self);
}
// check if a player has mounted the vehicle
// first get driving position
VectorScale(forward,self->move_origin[0],f1);
VectorScale(left,-self->move_origin[1],l1);
VectorAdd(self->s.origin,f1,drive);
VectorAdd(drive,l1,drive);
drive[2] += self->move_origin[2];
// find a player
for (i=1, ent=&g_edicts[1] ; i<=maxclients->value ; i++, ent++) {
if (!ent->inuse) continue;
if (ent->movetype == MOVETYPE_NOCLIP) continue;
if (!ent->client->use) continue;
if (level.framenum - ent->client->vehicle_framenum <= 2) continue;
// determine distance from vehicle "move_origin"
VectorSubtract(drive,ent->s.origin,dir);
if (fabs(dir[2]) < 64)
dir[2] = 0;
if (VectorLength(dir) < 16) {
ent->client->vehicle_framenum = level.framenum;
// player has taken control of vehicle
// move vehicle up slightly to avoid roundoff collisions
self->s.origin[2] += 1;
gi.linkentity(self);
if(self->message)
gi.centerprintf(ent,self->message);
self->owner = ent;
ent->movetype = MOVETYPE_PUSH;
ent->gravity = 0;
ent->vehicle = self;
// turn off client side prediction for this player
ent->client->ps.pmove.pm_flags |= PMF_NO_PREDICTION;
// force a good driving position
VectorCopy(drive,self->owner->s.origin);
gi.linkentity(ent);
// vehicle idle noise
self->s.sound = self->noise_index2;
// reset wait time so we can start accelerating
self->moveinfo.wait = 0;
}
}
}
if(self->movewith_next && (self->movewith_next->movewith_ent == self))
set_child_movement(self);
}
void turn_vehicle (edict_t *self)
{
self->s.angles[YAW] = self->ideal_yaw;
gi.linkentity(self);
self->prethink = NULL;
}
void SP_func_vehicle (edict_t *self)
{
self->class_id = ENTITY_FUNC_VEHICLE;
self->ideal_yaw = self->s.angles[YAW];
VectorClear (self->s.angles);
self->solid = SOLID_BSP;
gi.setmodel (self, self->model);
self->movetype = MOVETYPE_VEHICLE;
if (!self->speed)
self->speed = 200;
if (!self->accel)
self->accel = self->speed; // accelerates to full speed in 1 second (approximate).
if (!self->decel)
self->decel = self->accel;
if (!self->mass)
self->mass = 2000;
if (!self->radius)
self->radius = 256;
self->blocked = vehicle_blocked;
self->touch = vehicle_touch;
self->think = vehicle_think;
self->nextthink = level.time + FRAMETIME;
self->noise_index = gi.soundindex("engine/engine.wav");
self->noise_index2 = gi.soundindex("engine/idle.wav");
VectorClear(self->velocity);
VectorClear(self->avelocity);
self->moveinfo.current_speed = 0;
self->moveinfo.state = STOP;
gi.linkentity (self);
VectorCopy(self->size,self->org_size);
if (self->ideal_yaw != 0)
self->prethink = turn_vehicle;
if (self->health) {
self->die = func_vehicle_explode;
self->takedamage = DAMAGE_YES;
} else
self->takedamage = DAMAGE_NO;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,97 +0,0 @@
#include "g_local.h"
#ifdef WESQ2
void SP_misc_tank(edict_t *self)
{
gi.modelindex ("models/objects/debris1/tris.md2");
gi.modelindex ("models/objects/debris2/tris.md2");
gi.modelindex ("models/objects/debris3/tris.md2");
self->solid = SOLID_BBOX;
self->movetype = MOVETYPE_NONE;
if(!self->mass)
self->mass = 50;
if(!self->health)
self->health = 10;
if(!self->dmg)
self->dmg = 20;
self->die = barrel_delay;
self->takedamage = DAMAGE_YES;
self->think = M_droptofloor;
self->nextthink = level.time + 2 * FRAMETIME;
gi.linkentity (self);
}
void SP_misc_tank1 (edict_t *self)
{
self->model = "models/objects/tank1/tris.md2";
self->s.modelindex = gi.modelindex (self->model);
VectorSet (self->mins, -16, -16, 0);
VectorSet (self->maxs, 16, 16, 62);
SP_misc_tank(self);
}
void SP_misc_tank2 (edict_t *self)
{
self->model = "models/objects/tank2/tris.md2";
self->s.modelindex = gi.modelindex (self->model);
VectorSet (self->mins, -48, -48, 0);
VectorSet (self->maxs, 48, 48, 185);
SP_misc_tank(self);
}
void SP_misc_ladder (edict_t *self)
{
self->model = "models/objects/ladder/tris.md2";
self->s.modelindex = gi.modelindex (self->model);
VectorSet (self->mins,-16,-16, 0);
VectorSet (self->maxs, 16, 16,192);
self->solid = SOLID_BBOX;
self->movetype = MOVETYPE_NONE;
self->think = M_droptofloor;
self->nextthink= level.time + 2 * FRAMETIME;
self->clipmask = MASK_PLAYERSOLID | CONTENTS_LADDER;
gi.linkentity(self);
}
void bomb_think (edict_t *self)
{
vec3_t spark_origin;
vec3_t movedir;
VectorCopy(self->s.origin,spark_origin);
spark_origin[2] += 16;
VectorSet(movedir,0,0,1);
gi.WriteByte (svc_temp_entity);
gi.WriteByte (TE_SPARKS);
gi.WritePosition (spark_origin);
gi.WriteDir (movedir);
gi.multicast (self->s.origin, MULTICAST_PVS);
self->nextthink = level.time + FRAMETIME;
}
void SP_misc_bomb(edict_t *self)
{
gi.modelindex ("models/objects/debris1/tris.md2");
gi.modelindex ("models/objects/debris2/tris.md2");
gi.modelindex ("models/objects/debris3/tris.md2");
self->model = "models/objects/boom/tris.md2";
self->s.modelindex = gi.modelindex (self->model);
VectorSet (self->mins, -12, -12, -12);
VectorSet (self->maxs, 12, 12, 14);
self->solid = SOLID_BBOX;
self->movetype = MOVETYPE_NONE;
if(!self->health)
self->health = 10;
if(!self->dmg)
self->dmg = 20;
self->die = barrel_delay;
self->takedamage = DAMAGE_YES;
self->think = bomb_think;
self->nextthink = level.time + 2*FRAMETIME;
gi.linkentity (self);
}
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,8 +22,6 @@
#include "ref_system.h"
#include "ref_server.h"
#include "p_menu.h"
#include "p_text.h"
#define JETPACK_MOD
// the "gameversion" client command will print this plus compile date
#define GAMEVERSION "xash"
@ -89,9 +87,6 @@ network messaging manager
//==================================================================
// Lazarus: When visibility is reduced below this level, aiming accuracy suffers:
#define FOG_CANSEEGOOD 0.12
// view pitching times
#define DAMAGE_TIME 0.5
#define FALL_TIME 0.3
@ -119,7 +114,6 @@ network messaging manager
#define FL_NO_KNOCKBACK 0x00000800
#define FL_POWER_ARMOR 0x00001000 // power armor (if any) is active
#define FL_BOB 0x00002000 // Lazarus: Used for bobbing water
#define FL_TURRET_OWNER 0x00004000 // Lazarus: player on turret and controlling it
#define FL_TRACKTRAIN 0x00008000
#define FL_DISGUISED 0x00020000 // entity is in disguise, monsters will not recognize.
@ -128,7 +122,6 @@ network messaging manager
#define FL_REVERSIBLE 0x00080000 // Lazarus: used for reversible func_door_rotating
#define FL_REVOLVING 0x00100000 // Lazarus revolving door
#define FL_ROBOT 0x00200000 // Player-controlled robot or monster. Relax yaw constraints
#define FL_REFLECT 0x00400000 // Reflection entity
#define FL_RESPAWN 0x80000000 // used for item respawning
@ -190,13 +183,6 @@ typedef enum
#define AI_COMBAT_POINT 0x00001000
#define AI_MEDIC 0x00002000
#define AI_RESURRECTING 0x00004000
//ROGUE (Lazarus: Eliminate many inapplicable Rogue AI flags to make room for more)
#define AI_TARGET_ANGER 0x00008000
#define AI_HINT_PATH 0x00010000
#define AI_BLOCKED 0x00020000 // used by blocked_checkattack: set to say I'm attacking while blocked
// (prevents run-attacks)
//ROGUE
// Lazarus:
#define AI_ACTOR 0x00040000 // Is this a misc_actor?
#define AI_FOLLOW_LEADER 0x00080000 // misc_actor only
#define AI_TWO_GUNS 0x00100000 // misc_actor only - nothing to do with AI really,
@ -207,7 +193,6 @@ typedef enum
#define AI_FREEFORALL 0x00400000 // Set by target_monsterbattle, lets dmgteam monsters
// attack monsters on opposion dmgteam
#define AI_RANGE_PAUSE 0x00800000
#define AI_CHASE_THING 0x01000000
#define AI_SEEK_COVER 0x02000000
#define AI_CHICKEN 0x04000000
#define AI_MEDIC_PATROL 0x08000000
@ -363,23 +348,6 @@ typedef struct
bool autosaved;
} game_locals_t;
struct fog_s
{
bool Trigger;
int Model;
float Near;
float Far;
float Density;
float Density1;
float Density2;
vec3_t Dir;
int GL_Model;
vec3_t Color;
vec3_t GlideColor;
edict_t *ent;
};
typedef struct fog_s fog_t;
//
// this structure is cleared as each map is entered
// it is read/written to the level.sav file for savegames
@ -425,18 +393,6 @@ typedef struct
int power_cubes; // ugly necessity for coop
// ROGUE
edict_t *disguise_violator;
int disguise_violation_framenum;
// ROGUE
// Lazarus
int fogs;
int trigger_fogs;
int active_target_fog;
int active_fog;
int last_active_fog;
fog_t fog;
int flashlight_cost; // cost/10 seconds for flashlight
int mud_puddles;
int num_3D_sounds;
@ -444,7 +400,6 @@ typedef struct
bool freeze;
int freezeframes;
int next_skill;
int num_reflectors;
} level_locals_t;
@ -562,40 +517,6 @@ typedef struct
int power_armor_type;
int power_armor_power;
//ROGUE
bool (*blocked)(edict_t *self, float dist);
float last_hint_time; // last time the monster checked for hintpaths.
edict_t *goal_hint; // which hint_path we're trying to get to
int medicTries;
edict_t *badMedic1, *badMedic2; // these medics have declared this monster "unhealable"
edict_t *healer; // this is who is healing this monster
void (*duck)(edict_t *self, float eta);
void (*unduck)(edict_t *self);
void (*sidestep)(edict_t *self);
// while abort_duck would be nice, only monsters which duck but don't sidestep would use it .. only the brain
// not really worth it. sidestep is an implied abort_duck
// void (*abort_duck)(edict_t *self);
float base_height;
float next_duck_time;
float duck_wait_time;
edict_t *last_player_enemy;
// blindfire stuff .. the boolean says whether the monster will do it, and blind_fire_time is the timing
// (set in the monster) of the next shot
bool blindfire; // will the monster blindfire?
float blind_fire_delay;
vec3_t blind_fire_target;
// used by the spawners to not spawn too much and keep track of #s of monsters spawned
int monster_slots;
int monster_used;
edict_t *commander;
// powerup timers, used by widow, our friend
float quad_framenum;
float invincible_framenum;
float double_framenum;
edict_t *leader;
edict_t *old_leader;
//ROGUE
//Lazarus
float min_range; // Monsters stop chasing enemy at this distance
float max_range; // Monsters won't notice or attack targets farther than this
float ideal_range[2]; // Ideal low and high range from target, weapon-specific
@ -605,17 +526,10 @@ typedef struct
float rangetime;
int chicken_framenum;
int pathdir; // Up/down a hint_path chain flag for medic
float visibility; // Ratio of visibility (it's a fog thang)
float visibility; // Ratio of visibility
//end Lazarus
} monsterinfo_t;
// ROGUE
// this determines how long to wait after a duck to duck again. this needs to be longer than
// the time after the monster_duck_up in all of the animation sequences
#define DUCK_INTERVAL 0.5
// ROGUE
extern game_locals_t game;
extern level_locals_t level;
extern game_import_t gi;
@ -735,7 +649,6 @@ extern cvar_t *actorjump;
extern cvar_t *actorscram;
extern cvar_t *alert_sounds;
extern cvar_t *allow_download;
extern cvar_t *allow_fog; // Set to 0 for no fog
extern cvar_t *bounce_bounce;
extern cvar_t *bounce_minv;
extern cvar_t *cd_loopcount;
@ -743,14 +656,10 @@ extern cvar_t *cl_gun;
extern cvar_t *corpse_fade;
extern cvar_t *corpse_fadetime;
extern cvar_t *crosshair;
extern cvar_t *crossh;
extern cvar_t *developer;
extern cvar_t *fmod_nomusic;
extern cvar_t *footstep_sounds;
extern cvar_t *fov;
extern cvar_t *gl_clear;
extern cvar_t *gl_driver;
extern cvar_t *gl_driver_fog; // Name of dll to load for Default OpenGL mode
extern cvar_t *gl_driver;
extern cvar_t *hand;
extern cvar_t *jetpack_weenie;
extern cvar_t *joy_pitchsensitivity;
@ -764,12 +673,9 @@ extern cvar_t *lazarus_joyp;
extern cvar_t *lazarus_joyy;
extern cvar_t *lazarus_pitch;
extern cvar_t *lazarus_yaw;
extern cvar_t *lights;
extern cvar_t *lightsmin;
extern cvar_t *m_pitch;
extern cvar_t *m_yaw;
extern cvar_t *monsterjump;
extern cvar_t *packet_fmod_playback;
extern cvar_t *player_vampire;
extern cvar_t *readout;
extern cvar_t *rocket_strafe;
@ -777,8 +683,6 @@ extern cvar_t *rotate_distance;
extern cvar_t *s_primary;
extern cvar_t *shift_distance;
extern cvar_t *sv_maxgibs;
extern cvar_t *tpp; // third person perspective
extern cvar_t *tpp_auto;
extern cvar_t *turn_rider;
extern cvar_t *zoomrate;
extern cvar_t *zoomsnap;
@ -867,23 +771,6 @@ int range (edict_t *self, edict_t *other);
bool visible (edict_t *self, edict_t *other);
bool ai_chicken (edict_t *ent, edict_t *badguy);
//
// g_camera.c
//
void use_camera(edict_t *ent, edict_t *other, edict_t *activator);
void camera_on(edict_t *ent);
void camera_off(edict_t *ent);
void faker_animate(edict_t *self);
edict_t *G_FindNextCamera (edict_t *camera, edict_t *monitor);
edict_t *G_FindPrevCamera (edict_t *camera, edict_t *monitor);
//
// g_chase.c
//
void UpdateChaseCam(edict_t *ent);
void ChaseNext(edict_t *ent);
void ChasePrev(edict_t *ent);
void GetChaseTarget(edict_t *ent);
//
// g_combat.c
//
bool OnSameTeam (edict_t *ent1, edict_t *ent2);
@ -891,11 +778,6 @@ bool CanDamage (edict_t *targ, edict_t *inflictor);
void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, vec3_t point, vec3_t normal, int damage, int knockback, int dflags, int mod);
void T_RadiusDamage (edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod, double dmg_slope);
void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
//ROGUE
//void T_RadiusNukeDamage (edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod);
//void T_RadiusClassDamage (edict_t *inflictor, edict_t *attacker, float damage, char *ignoreClass, float radius, int mod);
void cleanupHealTarget (edict_t *ent);
//ROGUE
// damage flags
#define DAMAGE_RADIUS 0x00000001 // damage was indirect
@ -918,43 +800,7 @@ void cleanupHealTarget (edict_t *ent);
void Cmd_Help_f (edict_t *ent);
void Cmd_Score_f (edict_t *ent);
void Use_Flashlight(edict_t *ent,gitem_t *item);
void SetSensitivities(edict_t *ent,bool reset);
void ShiftItem(edict_t *ent, int direction);
//
// g_crane.c
//
void G_FindCraneParts();
void crane_control_action(edict_t *crane, edict_t *activator, vec3_t point);
void Moving_Speaker_Think(edict_t *ent);
//
// g_fog.c
//
#define MAX_FOGS 16
extern fog_t gfogs[MAX_FOGS];
void Cmd_Fog_f(edict_t *ent);
void Fog_Init();
void Fog(vec3_t viewpoint);
void Fog_Off();
void Fog_SetFogParms();
//
// g_func.c
//
#define TRAIN_START_ON 1
#define TRAIN_TOGGLE 2
#define TRAIN_BLOCK_STOPS 4
#define TRAIN_ROTATE 8
#define TRAIN_ROTATE_CONSTANT 16
#define TRAIN_ROTATE_MASK (TRAIN_ROTATE | TRAIN_ROTATE_CONSTANT)
#define TRAIN_ANIMATE 32
#define TRAIN_ANIMATE_FAST 64
#define TRAIN_SMOOTH 128
#define TRAIN_SPLINE 4096
bool box_walkmove (edict_t *ent, float yaw, float dist);
void button_use (edict_t *self, edict_t *other, edict_t *activator);
void trainbutton_use (edict_t *self, edict_t *other, edict_t *activator);
void movewith_init (edict_t *self);
void set_child_movement(edict_t *self);
void ClientCommand (edict_t *ent);
//
// g_items.c
//
@ -974,26 +820,6 @@ int PowerArmorType (edict_t *ent);
gitem_t *GetItemByIndex (int index);
bool Add_Ammo (edict_t *ent, gitem_t *item, int count);
void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf);
#ifdef JETPACK_MOD
void Use_Jet (edict_t *ent, gitem_t *item);
//
// g_jetpack.c
//
void Jet_ApplyJet( edict_t *ent, usercmd_t *ucmd );
bool Jet_AvoidGround( edict_t *ent );
void Jet_BecomeExplosion( edict_t *ent, int damage );
#endif
//
// g_lights.c
//
void Lights();
void ToggleLights();
//
// g_lock.c
//
void lock_digit_increment (edict_t *digit, edict_t *activator);
//
// g_main.c
//
@ -1048,6 +874,7 @@ void M_FlyCheck (edict_t *self);
void M_FliesOff (edict_t *self);
void M_FliesOn (edict_t *self);
void M_CheckGround (edict_t *ent);
bool M_walkmove (edict_t *ent, float yaw, float dist);
bool M_SetDeath (edict_t *ent,mmove_t **moves);
int PatchMonsterModel (char *model);
//
@ -1060,31 +887,6 @@ int PatchPlayerModels (char *modelname);
void SV_AddGravity (edict_t *ent);
void G_RunEntity (edict_t *ent);
//
// g_reflect.c
//
void AddReflection (edict_t *ent);
void DeleteReflection (edict_t *ent, int index);
void ReflectExplosion (int type, vec3_t origin);
void ReflectSparks (int type, vec3_t origin, vec3_t movedir);
void ReflectSteam (vec3_t origin,vec3_t movedir,int count,int sounds,int speed, int wait, int nextid);
void ReflectTrail (int type, vec3_t start, vec3_t end);
//
// g_sound.c (interface to FMOD)
//
bool FMOD_IsPlaying(edict_t *ent);
void FMOD_Shutdown();
void FMOD_Stop();
void FMOD_StopSound(edict_t *ent, bool free);
int FMOD_PlaySound(edict_t *ent);
void FMOD_UpdateListenerPos();
void FMOD_UpdateSpeakerPos(edict_t *speaker);
bool FMOD_Init();
void FootStep(edict_t *ent);
void PlayFootstep(edict_t *ent, footstep_t index);
extern bool qFMOD_Footsteps;
void target_playback_delayed_restart (edict_t *ent);
void target_playback_delayed_start (edict_t *ent);
//
// g_spawn.c
//
void ED_CallSpawn (edict_t *ent);
@ -1102,15 +904,6 @@ bool SV_FilterPacket (char *from);
//
edict_t *SpawnThing();
//
// g_tracktrain.c
//
void tracktrain_disengage (edict_t *train);
//
// g_turret.c
//
void turret_breach_fire(edict_t *ent);
void turret_disengage (edict_t *ent);
//
// g_trigger.c
//
typedef struct
@ -1148,80 +941,6 @@ float AtLeast(float x, float dx);
edict_t *LookingAt(edict_t *ent, int filter, vec3_t endpos, float *range);
void GameDirRelativePath(char *filename, char *output);
void G_UseTarget (edict_t *ent, edict_t *activator, edict_t *target);
//ROGUE
void G_ProjectSource2 (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t up, vec3_t result);
float vectoyaw2 (vec3_t vec);
void vectoangles2 (vec3_t vec, vec3_t angles);
edict_t *findradius2 (edict_t *from, vec3_t org, float rad);
//ROGUE
//
// g_weapon.c
//
void ThrowDebris (edict_t *self, char *modelname, float speed, vec3_t origin, int skin, int effects);
bool fire_hit (edict_t *self, vec3_t aim, int damage, int kick);
void fire_bullet (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int mod);
void fire_shotgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int mod);
void fire_blaster (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, bool hyper);
void fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius);
void fire_grenade2 (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius, bool held);
void fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage, edict_t *home_target);
void fire_rail (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick);
void fire_bfg (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius);
bool AimGrenade (edict_t *launcher, vec3_t start, vec3_t target, vec_t speed, vec3_t aim);
void Grenade_Evade (edict_t *monster);
//
// m_actor.c
//
void actor_attack (edict_t *actor);
void actor_files ();
void actor_fire (edict_t *actor);
void actor_jump (edict_t *actor);
void actor_moveit (edict_t *player, edict_t *actor);
void actor_run (edict_t *actor);
void actor_run_back (edict_t *actor);
void actor_salute (edict_t *actor);
void actor_stand (edict_t *actor);
void actor_walk (edict_t *actor);
void actor_walk_back (edict_t *actor);
mmove_t actor_move_crouch;
mmove_t actor_move_crouchwalk;
mmove_t actor_move_crouchwalk_back;
mmove_t actor_move_run;
mmove_t actor_move_run_back;
mmove_t actor_move_run_bad;
mmove_t actor_move_stand;
mmove_t actor_move_walk;
mmove_t actor_move_walk_back;
//
// m_medic.c
//
#define MEDIC_MIN_DISTANCE 32
#define MEDIC_MAX_HEAL_DISTANCE 400
#define MEDIC_TRY_TIME 10.0
void abortHeal (edict_t *ent,bool mark);
void medic_NextPatrolPoint(edict_t *ent,edict_t *hintpath);
edict_t *medic_FindDeadMonster (edict_t *ent);
void medic_StopPatrolling(edict_t *ent);
//
// m_move.c
//
bool M_CheckBottom (edict_t *ent);
bool M_walkmove (edict_t *ent, float yaw, float dist);
void M_MoveToGoal (edict_t *ent, float dist);
void M_ChangeYaw (edict_t *ent);
// tpp
//
// p_chase.c
//
#define OPTION_OFF 0
#define OPTION_BACKGROUND 1
void CheckChasecam_Viewent (edict_t *ent);
void Cmd_Chasecam_Toggle (edict_t *ent);
void ChasecamRemove (edict_t *ent, int opt);
void ChasecamStart (edict_t *ent);
// end tpp
//
// p_client.c
//
@ -1240,23 +959,9 @@ void ClientBeginServerFrame (edict_t *ent);
void MoveClientToIntermission (edict_t *client);
void G_SetStats (edict_t *ent);
void G_SetSpectatorStats (edict_t *ent);
void G_CheckChaseStats (edict_t *ent);
void ValidateSelectedItem (edict_t *ent);
void DeathmatchScoreboardMessage (edict_t *client, edict_t *killer);
//
// p_text.c
//
void Do_Text_Display(edict_t *activator, int flags, char *message);
//
// p_trail.c
//
void PlayerTrail_Init (void);
void PlayerTrail_Add (vec3_t spot);
void PlayerTrail_New (vec3_t spot);
edict_t *PlayerTrail_PickFirst (edict_t *self);
edict_t *PlayerTrail_PickNext (edict_t *self);
edict_t *PlayerTrail_LastSpot (void);
//
// p_view.c
//
void ClientEndServerFrame (edict_t *ent);
@ -1267,36 +972,6 @@ void PlayerNoise(edict_t *who, vec3_t where, int type);
void P_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result);
void kick_attack (edict_t *ent);
// ROGUE
//
// g_newai.c
//
#define MAX_HINT_CHAINS 100
extern int hint_paths_present;
extern edict_t *hint_path_start[MAX_HINT_CHAINS];
extern int num_hint_paths;
bool blocked_checkshot (edict_t *self, float shotChance);
bool blocked_checkplat (edict_t *self, float dist);
bool blocked_checkjump (edict_t *self, float dist, float maxDown, float maxUp);
bool blocked_checknewenemy (edict_t *self);
bool monsterlost_checkhint (edict_t *self);
bool inback (edict_t *self, edict_t *other);
float realrange (edict_t *self, edict_t *other);
edict_t *SpawnBadArea(vec3_t mins, vec3_t maxs, float lifespan, edict_t *owner);
edict_t *CheckForBadArea(edict_t *ent);
void InitHintPaths (void);
void PredictAim (edict_t *target, vec3_t start, float bolt_speed, bool eye_height, float offset, vec3_t aimdir, vec3_t aimpoint);
bool below (edict_t *self, edict_t *other);
void drawbbox (edict_t *self);
bool has_valid_enemy (edict_t *self);
void hintpath_stop (edict_t *self);
edict_t * PickCoopTarget (edict_t *self);
int CountPlayers (void);
void monster_jump_start (edict_t *self);
bool monster_jump_finished (edict_t *self);
// END ROGUE
//============================================================================
// client_t->anim_priority
@ -1349,9 +1024,6 @@ typedef struct
int helpchanged;
bool spectator; // client is a spectator
// tpp
int chasetoggle;
// end tpp
bool spawn_landmark;
bool spawn_levelchange;
vec3_t spawn_offset;
@ -1374,9 +1046,6 @@ typedef struct
vec3_t cmd_angles; // angles sent over in the last command
bool spectator; // client is a spectator
// tpp
int chasetoggle;
// end tpp
} client_respawn_t;
// this structure is cleared on each PutClientInServer(),
@ -1463,20 +1132,8 @@ struct gclient_s
float respawn_time; // can respawn when time > this
edict_t *chase_target; // player we are chasing
bool update_chase; // need to update chase info?
usercmd_t ucmd; // Lazarus: Copied for convenience in ClientThink
// tpp
int chasetoggle;
edict_t *chasecam;
edict_t *oldplayer;
int use; // indicates whether +use key is pressed
int zoom;
int delayedstart;
// end tpp
// TREMOR func_pushable stuff
float maxvelocity; // Used when pushing func_pushable
edict_t *push;
@ -1489,7 +1146,6 @@ struct gclient_s
bool inmenu; // in menu
int menutimer;
pmenuhnd_t *menu; // current menu
texthnd_t *textdisplay; // currently displayed text
char *whatsit;
// security camera
@ -1530,17 +1186,6 @@ struct gclient_s
int jumping; // 0 or 1, used for jumpkick
edict_t *homing_rocket; // used to limit firing frequency
#ifdef JETPACK_MOD
bool jetpack;
float jetpack_framenum;
float jetpack_nextthink;
bool jetpack_thrusting;
bool jetpack_infinite;
float jetpack_start_thrust;
float jetpack_last_thrust;
float jetpack_activation;
float jetpack_roll;
#endif
};
#define NUM_ACTOR_SOUNDS 13
@ -1722,11 +1367,6 @@ struct edict_s
// various Lazarus additions follow:
edict_t *turret; // player-controlled turret
edict_t *child; // "real" infantry guy, child of remote turret_driver
vec_t base_radius; // Lazarus: used to project "viewpoint" of TRACK turret
// out past base
//ed - for the sprite/model spawner
char *usermodel;
int startframe;
@ -1740,12 +1380,6 @@ struct edict_s
vec3_t bleft;
vec3_t tright;
// tpp
int chasedist1;
int chasedist2;
edict_t *crosshair;
// end tpp
// item identification
char *datafile;
@ -1786,31 +1420,9 @@ struct edict_s
float radius;
vec3_t org_size; // Initial size of the vehicle bounding box,
vec3_t fog_color;
int fog_model;
float fog_near;
float fog_far;
float fog_density;
int fog_index;
int fogclip; // only used by worldspawn to indicate whether gl_clear
// should be forced to a good value for fog obscuration
// of HOM
edict_t *movewith_next;
char *movewith;
edict_t *movewith_ent;
vec3_t movewith_offset;
vec3_t parent_attach_angles;
bool do_not_rotate;
// monster AI
char *dmgteam;
// turret
char *destroytarget;
char *viewmessage;
char *followtarget;
// spycam
edict_t *viewer;
@ -1867,10 +1479,6 @@ struct edict_s
edict_t *next_grenade; // Used to build a list of active grenades
edict_t *prev_grenade;
// FMOD
int *stream; // Actually a FSOUND_STREAM * or FMUSIC_MODULE *
int channel;
// gib type - specifies folder where gib models are found.
int gib_type;
int blood_type;
@ -1879,29 +1487,6 @@ struct edict_s
// actor muzzle flash
edict_t *flash;
// Psychospaz reflections
edict_t *reflection[6];
//=========
//ROGUE
int plat2flags;
// vec3_t offset; used by Lazarus
vec3_t gravityVector;
edict_t *bad_area;
edict_t *hint_chain;
edict_t *monster_hint_chain;
edict_t *target_hint_chain;
int hint_chain_id;
// FIXME - debug help!
float lastMoveTime;
//ROGUE
//=========
#ifdef WESQ2
int my_spawn;
#endif
};
#define LOOKAT_NOBRUSHMODELS 1
@ -1917,38 +1502,4 @@ struct edict_s
#define FLASHLIGHT_MOD
#define FLASHLIGHT_USE POWERUP_NEW_ENT
#define FLASHLIGHT_DRAIN 60
#define FLASHLIGHT_ITEM "Cells"
#ifdef WESQ2
// tunnel code stuff
#define MAX_SPAWNED_ITEMS 100
extern int NumSpawnedItems;
typedef struct {
char classname[64];
vec3_t origin;
vec_t angle;
} SPAWNED_ITEM;
extern SPAWNED_ITEM SpawnedItem[MAX_SPAWNED_ITEMS];
typedef struct {
vec3_t loc;
float pressure;
float temperature;
} PRESSURE_TEMP;
typedef struct {
vec3_t loc;
float weight;
float delay;
} EXPLOSIVE;
extern int gNumTargets;
extern int gNumCharges;
extern float gTargetSpacing;
extern PRESSURE_TEMP *PT;
extern EXPLOSIVE *TNT;
extern vec3_t gWorld;
#define DAMAGE_PER_POUND 5
#endif
#define FLASHLIGHT_ITEM "Cells"

View File

@ -62,7 +62,6 @@ cvar_t *actorjump;
cvar_t *actorscram;
cvar_t *alert_sounds;
cvar_t *allow_download;
cvar_t *allow_fog; // Set to 0 for no fog
cvar_t *bounce_bounce;
cvar_t *bounce_minv;
cvar_t *cd_loopcount;
@ -71,12 +70,10 @@ cvar_t *corpse_fade;
cvar_t *corpse_fadetime;
cvar_t *crosshair;
cvar_t *developer;
cvar_t *fmod_nomusic;
cvar_t *footstep_sounds;
cvar_t *fov;
cvar_t *gl_clear;
cvar_t *gl_driver;
cvar_t *gl_driver_fog;
cvar_t *hand;
cvar_t *jetpack_weenie;
cvar_t *joy_pitchsensitivity;
@ -90,12 +87,9 @@ cvar_t *lazarus_joyp;
cvar_t *lazarus_joyy;
cvar_t *lazarus_pitch;
cvar_t *lazarus_yaw;
cvar_t *lights;
cvar_t *lightsmin;
cvar_t *m_pitch;
cvar_t *m_yaw;
cvar_t *monsterjump;
cvar_t *packet_fmod_playback;
cvar_t *player_vampire;
cvar_t *readout;
cvar_t *rocket_strafe;
@ -113,7 +107,6 @@ bool ClientConnect (edict_t *ent, char *userinfo);
void ClientUserinfoChanged (edict_t *ent, char *userinfo);
void ClientDisconnect (edict_t *ent);
void ClientBegin (edict_t *ent);
void ClientCommand (edict_t *ent);
void RunEntity (edict_t *ent);
void WriteLump (dsavehdr_t *hdr, file_t *f, int lumpnum, bool autosave);
void ReadLump (byte *base, lump_t *l, int lumpnum);
@ -131,10 +124,6 @@ void ShutdownGame (void)
gi.cvar_forceset("cd_loopcount", va("%d",lazarus_cd_loop->value));
gi.cvar_forceset("gl_clear", va("%d", lazarus_gl_clear->value));
}
// Lazarus: Turn off fog if it's on
if(!dedicated->value) Fog_Off();
// and shut down FMOD
FMOD_Shutdown();
//free main memory pools
Mem_FreePool(&zone_level);
@ -205,9 +194,6 @@ game_export_t DLLEXPORT *ServerAPI (game_import_t *import)
globals.edict_size = sizeof(edict_t);
gl_driver = gi.cvar ("gl_driver", "", 0);
gl_driver_fog = gi.cvar ("gl_driver_fog", "opengl32", CVAR_NOSET | CVAR_ARCHIVE);
Fog_Init();
developer = gi.cvar("developer", "0", CVAR_SERVERINFO);
readout = gi.cvar("readout", "0", CVAR_SERVERINFO);
@ -243,38 +229,6 @@ void ClientEndServerFrames (void)
continue;
ClientEndServerFrame (ent);
}
//reflection stuff -- modified from psychospaz' original code
if (level.num_reflectors)
{
ent = &g_edicts[0];
for (i=0 ; i<globals.num_edicts ; i++, ent++) //pointers, not as slow as you think
{
if (!ent->inuse)
continue;
if (!ent->s.modelindex)
continue;
// if (ent->s.effects & EF_ROTATE)
// continue;
if (ent->flags & FL_REFLECT)
continue;
if (!ent->client && (ent->svflags & SVF_NOCLIENT))
continue;
if (ent->client && !ent->client->chasetoggle && (ent->svflags & SVF_NOCLIENT))
continue;
if (ent->svflags&SVF_MONSTER && ent->solid!=SOLID_BBOX)
continue;
if ( (ent->solid == SOLID_BSP) && (ent->movetype != MOVETYPE_PUSHABLE))
continue;
if (ent->client && ent->client->resp.spectator)
continue;
if (ent->client && player_vampire->value)
continue;
if (ent->s.renderfx & RF_VAMPIRE)
continue;
AddReflection(ent);
}
}
}
/*
@ -479,11 +433,7 @@ void G_RunFrame (void)
level.time = level.framenum*FRAMETIME;
// choose a client for monsters to target this frame
AI_SetSightClient ();
// exit intermissions
if (level.exitintermission)
{
ExitLevel ();
@ -523,10 +473,6 @@ void G_RunFrame (void)
G_RunEntity (ent);
}
// FMOD stuff:
if ( (level.num_3D_sounds > 0) && (game.maxclients == 1))
FMOD_UpdateListenerPos();
// see if it is time to end a deathmatch
CheckDMRules ();

View File

@ -17,13 +17,12 @@ int lastgibframe=0;
void FadeThink(edict_t *ent)
{
ent->count++;
if (ent->count==2)
if (ent->count == 2)
{
G_FreeEdict(ent);
return;
}
ent->s.effects |= EF_SPHERETRANS;
ent->nextthink=level.time+0.5;
ent->nextthink=level.time + 0.5;
gi.linkentity(ent);
}
void FadeDieThink (edict_t *ent)
@ -280,8 +279,6 @@ void ThrowHead (edict_t *self, char *gibname, int damage, int type)
VectorClear (self->mins);
VectorClear (self->maxs);
DeleteReflection(self,-1);
strcpy(modelname,gibname);
p = strstr(modelname,"models/objects/gibs/");
if(p && self->gib_type)
@ -335,19 +332,6 @@ void ThrowHead (edict_t *self, char *gibname, int damage, int type)
self->think = FadeDieThink;
self->nextthink = level.time + 8 + random()*10;
// Lazarus: If head owner was part of a movewith chain,
// remove from the chain and repair the chain
// if necessary
if(self->movewith) {
edict_t *e;
edict_t *parent=NULL;
int i;
for(i=1; i<globals.num_edicts && !parent; i++) {
e = g_edicts + i;
if(e->movewith_next == self) parent=e;
}
if(parent) parent->movewith_next = self->movewith_next;
}
gi.linkentity (self);
}
@ -497,9 +481,6 @@ void BecomeExplosion1 (edict_t *self)
WRITE_COORD (self->s.origin);
MESSAGE_SEND (MSG_PVS, self->s.origin, NULL);
if (level.num_reflectors)
ReflectExplosion (TE_EXPLOSION1, self->s.origin);
G_FreeEdict (self);
}
@ -511,9 +492,6 @@ void BecomeExplosion2 (edict_t *self)
WRITE_COORD (self->s.origin);
MESSAGE_SEND (MSG_PVS, self->s.origin, NULL);
if (level.num_reflectors)
ReflectExplosion (TE_EXPLOSION2, self->s.origin);
G_FreeEdict (self);
}
@ -621,7 +599,6 @@ Makes this the target of a monster and it will head here
when first activated before going after the activator. If
hold is selected, it will stay here.
*/
void tracktrain_drive(edict_t *train, edict_t *other);
void point_combat_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
edict_t *activator;
@ -664,30 +641,20 @@ void point_combat_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
if (self->pathtarget)
{
if (self->spawnflags & 2)
{
edict_t *train;
train = G_PickTarget(self->pathtarget);
if(train)
tracktrain_drive(train,other);
}
else
{
char *savetarget;
char *savetarget;
savetarget = self->target;
self->target = self->pathtarget;
if (other->enemy && other->enemy->client)
activator = other->enemy;
else if (other->oldenemy && other->oldenemy->client)
activator = other->oldenemy;
else if (other->activator && other->activator->client)
activator = other->activator;
else
activator = other;
G_UseTargets (self, activator);
self->target = savetarget;
}
savetarget = self->target;
self->target = self->pathtarget;
if (other->enemy && other->enemy->client)
activator = other->enemy;
else if (other->oldenemy && other->oldenemy->client)
activator = other->oldenemy;
else if (other->activator && other->activator->client)
activator = other->activator;
else
activator = other;
G_UseTargets (self, activator);
self->target = savetarget;
}
}
@ -1048,7 +1015,7 @@ void func_explosive_explode (edict_t *self)
switch(self->gib_type)
{
case GIB_METAL: ThrowDebris (self, "models/gibs/metal.mdl", 2, chunkorigin, r, 0); break;
case GIB_GLASS: ThrowDebris (self, "models/gibs/glass.mdl", 2, chunkorigin, r, EF_SPHERETRANS); break;
case GIB_GLASS: ThrowDebris (self, "models/gibs/glass.mdl", 2, chunkorigin, r, 0); break;
case GIB_BARREL: ThrowDebris (self, "models/gibs/barrelgib.mdl", 2, chunkorigin, r, 0); break;
case GIB_CRATE: ThrowDebris (self, "models/gibs/wood.mdl", 2, chunkorigin, r, 0); break;
case GIB_ROCK: ThrowDebris (self, "models/gibs/rock.mdl", 2, chunkorigin, r, 0); break;
@ -1676,7 +1643,6 @@ void misc_deadsoldier_flieson(edict_t *self)
self->s.sound = gi.soundindex ("infantry/inflies1.wav");
}
int PatchDeadSoldier ();
void SP_misc_deadsoldier (edict_t *ent)
{
if (deathmatch->value)
@ -1718,120 +1684,10 @@ void SP_misc_deadsoldier (edict_t *ent)
ent->die = misc_deadsoldier_die;
ent->monsterinfo.aiflags |= AI_GOOD_GUY;
if(ent->style)
{
PatchDeadSoldier();
ent->s.skin = ent->style;
}
ent->common_name = "Dead Marine";
gi.linkentity (ent);
}
/*QUAKED misc_viper (1 .5 0) (-16 -16 0) (16 16 32)
This is the Viper for the flyby bombing.
It is trigger_spawned, so you must have something use it for it to show up.
There must be a path for it to follow once it is activated.
"speed" How fast the Viper should fly
*/
extern void train_use (edict_t *self, edict_t *other, edict_t *activator);
extern void func_train_find (edict_t *self);
void viper_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point )
{
edict_t *e, *next;
if(self->deathtarget)
{
self->target = self->deathtarget;
G_UseTargets (self, attacker);
}
e = self->movewith_next;
while(e) {
next = e->movewith_next;
if(e->solid == SOLID_NOT) {
e->nextthink = 0;
G_FreeEdict(e);
} else
BecomeExplosion1 (e);
e = next;
}
self->enemy = inflictor;
self->activator = attacker;
func_explosive_explode (self);
}
void misc_viper_use (edict_t *self, edict_t *other, edict_t *activator)
{
self->svflags &= ~SVF_NOCLIENT;
self->use = train_use;
train_use (self, other, activator);
}
void SP_misc_viper (edict_t *ent)
{
if (!ent->target)
{
gi.dprintf ("misc_viper without a target at %s\n", vtos(ent->absmin));
G_FreeEdict (ent);
return;
}
ent->class_id = ENTITY_MISC_VIPER;
if (!ent->speed)
ent->speed = 300;
ent->movetype = MOVETYPE_PUSH;
ent->s.modelindex = gi.modelindex ("models/ships/viper/tris.md2");
// Lazarus - allow ship to be destroyed if positive health value
if(ent->health > 0)
{
ent->solid = SOLID_BBOX;
VectorSet (ent->mins, -32, -24, -12);
VectorSet (ent->maxs, 32, 24, 16);
ent->takedamage = DAMAGE_YES;
ent->die = viper_die;
if(!ent->dmg)
ent->dmg = 200;
if(!ent->mass)
ent->mass = 800;
}
else
{
ent->solid = SOLID_NOT;
VectorSet (ent->mins, -16, -16, 0);
VectorSet (ent->maxs, 16, 16, 32);
}
// Lazarus - TRAIN_SMOOTH forces trains to go directly to Move_Done from
// Move_Final rather than slowing down (if necessary) for one
// frame.
if (ent->spawnflags & TRAIN_SMOOTH)
ent->smooth_movement = true;
else
ent->smooth_movement = false;
ent->think = func_train_find;
ent->nextthink = level.time + FRAMETIME;
if(ent->spawnflags & TRAIN_START_ON)
ent->use = train_use;
else
{
ent->use = misc_viper_use;
ent->svflags |= SVF_NOCLIENT;
}
ent->moveinfo.accel = ent->moveinfo.decel = ent->moveinfo.speed = ent->speed;
ent->common_name = "Viper";
gi.linkentity (ent);
}
/*QUAKED misc_bigviper (1 .5 0) (-176 -120 -24) (176 120 72)
This is a large stationary viper as seen in Paul's intro
*/
@ -1870,9 +1726,6 @@ void misc_viper_bomb_touch (edict_t *self, edict_t *other, cplane_t *plane, csur
WRITE_COORD (self->s.origin);
MESSAGE_SEND (MSG_PVS, self->s.origin, NULL);
if (level.num_reflectors)
ReflectExplosion (TE_EXPLOSION2, self->s.origin);
self->svflags |= SVF_NOCLIENT;
self->solid = SOLID_NOT;
self->use = misc_viper_bomb_use;
@ -1994,85 +1847,6 @@ void SP_misc_viper_bomb (edict_t *self)
gi.linkentity (self);
}
/*QUAKED misc_strogg_ship (1 .5 0) (-16 -16 0) (16 16 32)
This is a Storgg ship for the flybys.
It is trigger_spawned, so you must have something use it for it to show up.
There must be a path for it to follow once it is activated.
"speed" How fast it should fly
*/
extern void train_use (edict_t *self, edict_t *other, edict_t *activator);
extern void func_train_find (edict_t *self);
void misc_strogg_ship_use (edict_t *self, edict_t *other, edict_t *activator)
{
self->svflags &= ~SVF_NOCLIENT;
self->use = train_use;
train_use (self, other, activator);
}
void SP_misc_strogg_ship (edict_t *ent)
{
if (!ent->target)
{
gi.dprintf ("%s without a target at %s\n", ent->classname, vtos(ent->absmin));
G_FreeEdict (ent);
return;
}
ent->class_id = ENTITY_MISC_STROGG_SHIP;
if (!ent->speed)
ent->speed = 300;
ent->movetype = MOVETYPE_PUSH;
ent->s.modelindex = gi.modelindex ("models/ships/strogg1/tris.md2");
// Lazarus - allow ship to be destroyed if positive health value
if(ent->health > 0)
{
ent->solid = SOLID_BBOX;
VectorSet (ent->mins, -58, -60, -40);
VectorSet (ent->maxs, 72, 60, 38);
ent->takedamage = DAMAGE_YES;
ent->die = viper_die;
if(!ent->dmg)
ent->dmg = 200;
if(!ent->mass)
ent->mass = 1200;
}
else
{
ent->solid = SOLID_NOT;
VectorSet (ent->mins, -16, -16, 0);
VectorSet (ent->maxs, 16, 16, 32);
}
// Lazarus - TRAIN_SMOOTH forces trains to go directly to Move_Done from
// Move_Final rather than slowing down (if necessary) for one
// frame.
if (ent->spawnflags & TRAIN_SMOOTH)
ent->smooth_movement = true;
else
ent->smooth_movement = false;
ent->think = func_train_find;
ent->nextthink = level.time + FRAMETIME;
if(ent->spawnflags & TRAIN_START_ON)
ent->use = train_use;
else
{
ent->use = misc_strogg_ship_use;
ent->svflags |= SVF_NOCLIENT;
}
ent->moveinfo.accel = ent->moveinfo.decel = ent->moveinfo.speed = ent->speed;
ent->common_name = "Strogg Ship";
gi.linkentity (ent);
}
/*QUAKED misc_satellite_dish (1 .5 0) (-64 -64 0) (64 64 128)
*/
@ -2452,9 +2226,35 @@ void SP_func_clock (edict_t *self)
trigger_transition with same name as teleporter can be used to
teleport multiple non-player entities
================================================================== */
bool HasSpawnFunction(edict_t *ent)
{
spawn_t *s;
gitem_t *item;
int i;
if(!ent->classname)
return false;
// check item spawn functions
for (i=0,item=itemlist ; i<game.num_items ; i++,item++)
{
if (!item->classname)
continue;
if (!strcmp(item->classname, ent->classname))
return true;
}
// check normal spawn functions
for (s=spawns ; s->name ; s++)
{
if (!strcmp(s->name, ent->classname))
return true;
}
return false;
}
void teleport_transition_ents (edict_t *transition, edict_t *teleporter, edict_t *destination)
{
extern entlist_t DoNotMove;
entlist_t DoNotMove;
int i, j;
int total=0;
bool nogo=false;
@ -2480,7 +2280,6 @@ void teleport_transition_ents (edict_t *transition, edict_t *teleporter, edict_t
// Pass up owned entities not owned by the player on this pass...
// get 'em next pass so we'll know whether owner is in our list
if(ent->owner && !ent->owner->client) continue;
if(ent->movewith) continue;
if(ent->solid == SOLID_BSP) continue;
if((ent->solid == SOLID_TRIGGER) && !FindItemByClassname(ent->classname)) continue;
// Do not under any circumstances move these entities:
@ -2527,7 +2326,6 @@ void teleport_transition_ents (edict_t *transition, edict_t *teleporter, edict_t
if(!ent->inuse) continue;
if(!ent->owner) continue;
if(ent->owner->client) continue;
if(ent->movewith) continue;
if(ent->solid == SOLID_BSP) continue;
if((ent->solid == SOLID_TRIGGER) && !FindItemByClassname(ent->classname)) continue;
// Do not under any circumstances move these entities:
@ -2667,13 +2465,6 @@ void teleporter_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_
vec3_t origin;
VectorMA(self->mins,0.5,self->size,origin);
if(!(self->spawnflags & 16))
{
MESSAGE_BEGIN(svc_temp_entity);
WRITE_BYTE(TE_TELEPORT_EFFECT);
WRITE_COORD(origin);
MESSAGE_SEND(MSG_PHS, origin, NULL);
}
gi.positioned_sound(origin,self,CHAN_AUTO,self->noise_index,1,1,0);
}
other->s.event = EV_PLAYER_TELEPORT;
@ -2802,8 +2593,6 @@ void SP_misc_teleporter (edict_t *ent)
trig->solid = SOLID_TRIGGER;
trig->target = ent->target;
trig->owner = ent;
// Lazarus
trig->movewith = ent->movewith;
VectorCopy (ent->s.origin, trig->s.origin);
VectorSet (trig->mins, -8, -8, 8);
VectorSet (trig->maxs, 8, 8, 24);
@ -2898,10 +2687,7 @@ void SP_misc_light (edict_t *self)
{
self->class_id = ENTITY_MISC_LIGHT;
self->use = misc_light_use;
if(self->movewith)
self->movetype = MOVETYPE_PUSH;
else
self->movetype = MOVETYPE_NONE;
self->movetype = MOVETYPE_NONE;
self->think = misc_light_think;
if (!(self->spawnflags & START_OFF))
self->nextthink = level.time + 2*FRAMETIME;
@ -2927,20 +2713,13 @@ TARGET_PRECIPITATION
void drop_add_to_chain(edict_t *drop)
{
edict_t *owner = drop->owner;
edict_t *parent;
if(!owner || !owner->inuse || !(owner->spawnflags & SF_WEATHER_STARTON))
{
G_FreeEdict(drop);
return;
}
parent = owner;
while(parent->child)
parent = parent->child;
parent->child = drop;
drop->child = NULL;
drop->svflags |= SVF_NOCLIENT;
drop->s.effects &= ~EF_SPHERETRANS;
drop->s.renderfx &= ~RF_TRANSLUCENT;
VectorClear(drop->velocity);
VectorClear(drop->avelocity);
@ -2965,7 +2744,6 @@ void leaf_fade2(edict_t *ent)
ent->count++;
if (ent->count == 1)
{
ent->s.effects |= EF_SPHERETRANS;
ent->nextthink=level.time+0.5;
gi.linkentity(ent);
}
@ -3006,40 +2784,29 @@ void spawn_precipitation(edict_t *self, vec3_t org, vec3_t dir, float speed)
{
edict_t *drop;
if(self->child)
drop = G_Spawn();
if(self->style == STYLE_WEATHER_BIGRAIN)
drop->s.modelindex = gi.modelindex ("models/objects/drop/heavy.md2");
else if(self->style == STYLE_WEATHER_SNOW)
drop->s.modelindex = gi.modelindex ("models/objects/snow/tris.md2");
else if(self->style == STYLE_WEATHER_LEAF)
{
// Then we already have a currently unused, invisible drop available
drop = self->child;
self->child = drop->child;
drop->child = NULL;
drop->svflags &= ~SVF_NOCLIENT;
drop->groundentity = NULL;
}
else
{
drop = G_Spawn();
if(self->style == STYLE_WEATHER_BIGRAIN)
drop->s.modelindex = gi.modelindex ("models/objects/drop/heavy.md2");
else if(self->style == STYLE_WEATHER_SNOW)
drop->s.modelindex = gi.modelindex ("models/objects/snow/tris.md2");
else if(self->style == STYLE_WEATHER_LEAF)
{
float r=random();
if(r < 0.33)
drop->s.modelindex = gi.modelindex ("models/objects/leaf1/tris.md2");
else if(r < 0.66)
drop->s.modelindex = gi.modelindex ("models/objects/leaf2/tris.md2");
else
drop->s.modelindex = gi.modelindex ("models/objects/leaf3/tris.md2");
VectorSet(drop->mins,-1,-1,-1);
VectorSet(drop->maxs, 1, 1, 1);
}
else if(self->style == STYLE_WEATHER_USER)
drop->s.modelindex = gi.modelindex(self->usermodel);
float r=random();
if(r < 0.33)
drop->s.modelindex = gi.modelindex ("models/objects/leaf1/tris.md2");
else if(r < 0.66)
drop->s.modelindex = gi.modelindex ("models/objects/leaf2/tris.md2");
else
drop->s.modelindex = gi.modelindex ("models/objects/drop/tris.md2");
drop->classname = "rain drop";
drop->s.modelindex = gi.modelindex ("models/objects/leaf3/tris.md2");
VectorSet(drop->mins,-1,-1,-1);
VectorSet(drop->maxs, 1, 1, 1);
}
else if(self->style == STYLE_WEATHER_USER)
drop->s.modelindex = gi.modelindex(self->usermodel);
else
drop->s.modelindex = gi.modelindex ("models/objects/drop/tris.md2");
drop->classname = "rain drop";
if(self->gravity > 0. || self->attenuation > 0 )
drop->movetype = MOVETYPE_DEBRIS;
else
@ -3087,7 +2854,6 @@ void spawn_precipitation(edict_t *self, vec3_t org, vec3_t dir, float speed)
}
else
{
drop->s.effects |= EF_SPHERETRANS;
drop->avelocity[YAW] = self->yaw_speed;
}
if(self->spawnflags & SF_WEATHER_START_FADE)
@ -3169,18 +2935,6 @@ void target_precipitation_use (edict_t *ent, edict_t *other, edict_t *activator)
// already on; turn it off
ent->nextthink = 0;
ent->spawnflags &= ~SF_WEATHER_STARTON;
if(ent->child)
{
edict_t *child, *parent;
child = ent->child;
ent->child = NULL;
while(child)
{
parent = child;
child = parent->child;
G_FreeEdict(parent);
}
}
}
else
{
@ -3377,18 +3131,6 @@ void target_fountain_use (edict_t *ent, edict_t *other, edict_t *activator)
// already on; turn it off
ent->nextthink = 0;
ent->spawnflags &= ~SF_WEATHER_STARTON;
if(ent->child)
{
edict_t *child, *parent;
child = ent->child;
ent->child = NULL;
while(child)
{
parent = child;
child = parent->child;
G_FreeEdict(parent);
}
}
}
else
{
@ -3477,110 +3219,6 @@ void SP_target_fountain (edict_t *ent)
gi.linkentity (ent);
}
//
/*=============================================================================
MISC_DEADSOLDIER MODEL PATCH
==============================================================================*/
#define NUM_SKINS 16
#define MAX_SKINNAME 64
#define DEADSOLDIER_MODEL "models/deadbods/dude/tris.md2"
#include <direct.h>
#include "pak.h"
int PatchDeadSoldier ()
{
cvar_t *gamedir;
char skins[NUM_SKINS][MAX_SKINNAME]; // skin entries
char outfilename[MAX_OSPATH];
int j;
file_t *infile;
file_t *outfile;
dmdl_t model; // model header
byte *data; // model data
int datasize; // model data size (bytes)
int newoffset; // model data offset (after skins)
// get game (moddir) name
gamedir = gi.cvar("game", "", 0);
if (!*gamedir->string) return 0; // we're in baseq2
if (gi.Fs.FileExists(DEADSOLDIER_MODEL))
return 0;
for (j = 0; j < NUM_SKINS; j++)
memset (skins[j], 0, MAX_SKINNAME);
sprintf (skins[0], "models/deadbods/dude/dead1.pcx");
sprintf (skins[1], "players/male/cipher.pcx");
sprintf (skins[2], "players/male/claymore.pcx");
sprintf (skins[3], "players/male/flak.pcx");
sprintf (skins[4], "players/male/grunt.pcx");
sprintf (skins[5], "players/male/howitzer.pcx");
sprintf (skins[6], "players/male/major.pcx");
sprintf (skins[7], "players/male/nightops.pcx");
sprintf (skins[8], "players/male/pointman.pcx");
sprintf (skins[9], "players/male/psycho.pcx");
sprintf (skins[10], "players/male/rampage.pcx");
sprintf (skins[11], "players/male/razor.pcx");
sprintf (skins[12], "players/male/recon.pcx");
sprintf (skins[13], "players/male/scout.pcx");
sprintf (skins[14], "players/male/sniper.pcx");
sprintf (skins[15], "players/male/viper.pcx");
// load original model
if ( !(infile = gi.Fs.Open (DEADSOLDIER_MODEL, "rb")) )
{
gi.dprintf("PatchDeadSoldier: Could not find %s\n",DEADSOLDIER_MODEL);
return 0;
}
else
{
gi.Fs.Read (infile, &model, sizeof (dmdl_t));
datasize = model.ofs_end - model.ofs_skins;
if ( !(data = malloc (datasize)) ) // make sure freed locally
{
gi.dprintf ("PatchMonsterModel: Could not allocate memory for model\n");
return 0;
}
gi.Fs.Read (infile, data, sizeof (byte) * datasize);
gi.Fs.Close (infile);
}
// update model info
model.num_skins = NUM_SKINS;
// Already had 1 skin, so new offset doesn't include that one
newoffset = (model.num_skins-1) * MAX_SKINNAME;
model.ofs_st += newoffset;
model.ofs_tris += newoffset;
model.ofs_frames += newoffset;
model.ofs_glcmds += newoffset;
model.ofs_end += newoffset;
if (!(outfile = gi.Fs.Open (DEADSOLDIER_MODEL, "wb")) )
{
// file couldn't be created for some other reason
gi.dprintf ("PatchDeadSoldier: Could not save %s\n", outfilename);
free (data);
return 0;
}
gi.Fs.Write (outfile, &model, sizeof (dmdl_t));
gi.Fs.Write (outfile, skins, sizeof (char)*(model.num_skins*MAX_SKINNAME));
data += MAX_SKINNAME;
gi.Fs.Write (outfile, data, sizeof (byte)*datasize);
gi.Fs.Close (outfile);
gi.dprintf ("PatchDeadSoldier: Saved %s\n", outfilename);
free (data);
return 1;
}
void PrecacheDebris(int type)
{

View File

@ -23,6 +23,534 @@ solid_edge items only clip against bsp models.
*/
#define STEPSIZE 18
/*
=============
M_CheckBottom
Returns false if any part of the bottom of the entity is off an edge that
is not a staircase.
=============
*/
int c_yes, c_no;
bool M_CheckBottom (edict_t *ent)
{
vec3_t mins, maxs, start, stop;
trace_t trace;
int x, y;
float mid, bottom;
VectorAdd (ent->s.origin, ent->mins, mins);
VectorAdd (ent->s.origin, ent->maxs, maxs);
// if all of the points under the corners are solid world, don't bother
// with the tougher checks
// the corners must be within 16 of the midpoint
start[2] = mins[2] - 1;
for (x=0 ; x<=1 ; x++)
for (y=0 ; y<=1 ; y++)
{
start[0] = x ? maxs[0] : mins[0];
start[1] = y ? maxs[1] : mins[1];
if (gi.pointcontents (start) != CONTENTS_SOLID)
goto realcheck;
}
c_yes++;
return true; // we got out easy
realcheck:
c_no++;
//
// check it for real...
//
start[2] = mins[2];
// the midpoint must be within 16 of the bottom
start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
stop[2] = start[2] - 2*STEPSIZE;
trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
if (trace.fraction == 1.0)
return false;
mid = bottom = trace.endpos[2];
// the corners must be within 16 of the midpoint
for (x=0 ; x<=1 ; x++)
for (y=0 ; y<=1 ; y++)
{
start[0] = stop[0] = x ? maxs[0] : mins[0];
start[1] = stop[1] = y ? maxs[1] : mins[1];
trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
bottom = trace.endpos[2];
if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE)
return false;
}
c_yes++;
return true;
}
/*
=============
SV_movestep
Called by monster program code.
The move will be adjusted for slopes and stairs, but if the move isn't
possible, no move is done, false is returned, and
pr_global_struct->trace_normal is set to the normal of the blocking wall
=============
*/
//FIXME since we need to test end position contents here, can we avoid doing
//it again later in catagorize position?
bool SV_movestep (edict_t *ent, vec3_t move, bool relink)
{
float dz;
vec3_t oldorg, neworg, end;
trace_t trace;
int i;
float stepsize;
float jumpheight;
vec3_t test;
int contents;
bool canjump;
float d1, d2;
int jump; // 1=jump up, -1=jump down
vec3_t forward, up;
vec3_t dir;
vec_t dist;
edict_t *target;
// try the move
VectorCopy (ent->s.origin, oldorg);
VectorAdd (ent->s.origin, move, neworg);
AngleVectors(ent->s.angles,forward,NULL,up);
if(ent->enemy)
target = ent->enemy;
else if(ent->movetarget)
target = ent->movetarget;
else
target = NULL;
// flying monsters don't step up
if ( ent->flags & (FL_SWIM | FL_FLY) )
{
// try one move with vertical motion, then one without
for (i=0 ; i<2 ; i++)
{
VectorAdd (ent->s.origin, move, neworg);
if (i == 0 && ent->enemy)
{
if (!ent->goalentity)
ent->goalentity = ent->enemy;
dz = ent->s.origin[2] - ent->goalentity->s.origin[2];
if (ent->goalentity->client)
{
if (dz > 40)
neworg[2] -= 8;
if (!((ent->flags & FL_SWIM) && (ent->waterlevel < 2)))
if (dz < 30)
neworg[2] += 8;
}
else
{
if (dz > 8)
neworg[2] -= 8;
else if (dz > 0)
neworg[2] -= dz;
else if (dz < -8)
neworg[2] += 8;
else
neworg[2] += dz;
}
}
trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, neworg, ent, MASK_MONSTERSOLID);
// fly monsters don't enter water voluntarily
if (ent->flags & FL_FLY)
{
if (!ent->waterlevel)
{
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
test[2] = trace.endpos[2] + ent->mins[2] + 1;
contents = gi.pointcontents(test);
if (contents & MASK_WATER)
return false;
}
}
// swim monsters don't exit water voluntarily
if (ent->flags & FL_SWIM)
{
if (ent->waterlevel < 2)
{
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
test[2] = trace.endpos[2] + ent->mins[2] + 1;
contents = gi.pointcontents(test);
if (!(contents & MASK_WATER))
return false;
}
}
if (trace.fraction == 1)
{
VectorCopy (trace.endpos, ent->s.origin);
if (relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
return true;
}
if (!ent->enemy)
break;
}
return false;
}
// push down from a step height above the wished position
if (!(ent->monsterinfo.aiflags & AI_NOSTEP))
stepsize = STEPSIZE;
else
stepsize = 1;
neworg[2] += stepsize;
VectorCopy (neworg, end);
end[2] -= stepsize*2;
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
// Determine whether monster is capable of and/or should jump
jump = 0;
if((ent->monsterinfo.jump) && !(ent->monsterinfo.aiflags & AI_DUCKED))
{
// Don't jump if path is blocked by monster or player. Otherwise,
// monster might attempt to jump OVER the monster/player, which
// ends up looking a bit goofy. Also don't jump if the monster's
// movement isn't deliberate (target=NULL)
if(trace.ent && (trace.ent->client || (trace.ent->svflags & SVF_MONSTER)))
canjump = false;
else if(target)
{
// Never jump unless it places monster closer to his goal
vec3_t dir;
VectorSubtract(target->s.origin, oldorg, dir);
d1 = VectorLength(dir);
VectorSubtract(target->s.origin, trace.endpos, dir);
d2 = VectorLength(dir);
if(d2 < d1)
canjump = true;
else
canjump = false;
}
else
canjump = false;
}
else
canjump = false;
if (trace.allsolid)
{
if(canjump && (ent->monsterinfo.jumpup > 0))
{
neworg[2] += ent->monsterinfo.jumpup - stepsize;
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
if (!trace.allsolid && !trace.startsolid && trace.fraction > 0 && (trace.plane.normal[2] > 0.9))
{
if(!trace.ent || (!trace.ent->client && !(trace.ent->svflags & SVF_MONSTER) && !(trace.ent->svflags & SVF_DEADMONSTER)))
{
// Good plane to jump on. Make sure monster is more or less facing
// the obstacle to avoid cutting-corners jumps
trace_t tr;
vec3_t p2;
VectorMA(ent->s.origin,1024,forward,p2);
tr = gi.trace(ent->s.origin,ent->mins,ent->maxs,p2,ent,MASK_MONSTERSOLID);
if(DotProduct(tr.plane.normal,forward) < -0.95)
{
jump = 1;
jumpheight = trace.endpos[2] - ent->s.origin[2];
}
else
return false;
}
}
else
return false;
}
else
return false;
}
if (trace.startsolid)
{
neworg[2] -= stepsize;
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
if (trace.allsolid || trace.startsolid)
return false;
}
// don't go in to water
// Lazarus: misc_actors don't go swimming, but wading is fine
if (ent->monsterinfo.aiflags & AI_ACTOR)
{
// First check for lava/slime under feet - but only if we're not already in
// a liquid
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
if (ent->waterlevel == 0)
{
test[2] = trace.endpos[2] + ent->mins[2] + 1;
contents = gi.pointcontents(test);
if (contents & (CONTENTS_LAVA | CONTENTS_SLIME))
return false;
}
test[2] = trace.endpos[2] + ent->viewheight - 1;
contents = gi.pointcontents(test);
if (contents & MASK_WATER)
return false;
}
else if (ent->waterlevel == 0)
{
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
test[2] = trace.endpos[2] + ent->mins[2] + 1;
contents = gi.pointcontents(test);
if (contents & MASK_WATER)
return false;
}
// Lazarus: Don't intentionally walk into lasers.
dist = VectorLength(move);
if(dist > 0.)
{
edict_t *e;
trace_t laser_trace;
vec_t delta;
vec3_t laser_mins, laser_maxs;
vec3_t laser_start, laser_end;
vec3_t monster_mins, monster_maxs;
for(i=game.maxclients+1; i<globals.num_edicts; i++)
{
e = &g_edicts[i];
if(!e->inuse)
continue;
if(!e->classname)
continue;
if(e->class_id != ENTITY_TARGET_LASER)
continue;
if(e->svflags & SVF_NOCLIENT)
continue;
if( (e->style == 2) || (e->style == 3))
continue;
if(!gi.inPVS(ent->s.origin,e->s.origin))
continue;
// Check to see if monster is ALREADY in the path of this laser.
// If so, allow the move so he can get out.
VectorMA(e->s.origin,2048,e->movedir,laser_end);
laser_trace = gi.trace(e->s.origin,NULL,NULL,laser_end,NULL,CONTENTS_SOLID|CONTENTS_MONSTER);
if(laser_trace.ent == ent)
continue;
VectorCopy(laser_trace.endpos,laser_end);
laser_mins[0] = min(e->s.origin[0],laser_end[0]);
laser_mins[1] = min(e->s.origin[1],laser_end[1]);
laser_mins[2] = min(e->s.origin[2],laser_end[2]);
laser_maxs[0] = max(e->s.origin[0],laser_end[0]);
laser_maxs[1] = max(e->s.origin[1],laser_end[1]);
laser_maxs[2] = max(e->s.origin[2],laser_end[2]);
monster_mins[0] = min(oldorg[0],trace.endpos[0]) + ent->mins[0];
monster_mins[1] = min(oldorg[1],trace.endpos[1]) + ent->mins[1];
monster_mins[2] = min(oldorg[2],trace.endpos[2]) + ent->mins[2];
monster_maxs[0] = max(oldorg[0],trace.endpos[0]) + ent->maxs[0];
monster_maxs[1] = max(oldorg[1],trace.endpos[1]) + ent->maxs[1];
monster_maxs[2] = max(oldorg[2],trace.endpos[2]) + ent->maxs[2];
if( monster_maxs[0] < laser_mins[0] ) continue;
if( monster_maxs[1] < laser_mins[1] ) continue;
if( monster_maxs[2] < laser_mins[2] ) continue;
if( monster_mins[0] > laser_maxs[0] ) continue;
if( monster_mins[1] > laser_maxs[1] ) continue;
if( monster_mins[2] > laser_maxs[2] ) continue;
// If we arrive here, some part of the bounding box surrounding
// monster's total movement intersects laser bounding box.
// If laser is parallel to x, y, or z, we definitely
// know this move will put monster in path of laser
if ( (e->movedir[0] == 1.) || (e->movedir[1] == 1.) || (e->movedir[2] == 1.))
return false;
// Shift psuedo laser towards monster's current position up to
// the total distance he's proposing moving.
delta = min(16,dist);
VectorCopy(move,dir);
VectorNormalize(dir);
while(delta < dist+15.875)
{
if(delta > dist) delta = dist;
VectorMA(e->s.origin, -delta,dir,laser_start);
VectorMA(e->s.old_origin,-delta,dir,laser_end);
laser_trace = gi.trace(laser_start,NULL,NULL,laser_end,world,CONTENTS_SOLID|CONTENTS_MONSTER);
if(laser_trace.ent == ent)
return false;
delta += 16;
}
}
}
if ((trace.fraction == 1) && !jump && canjump && (ent->monsterinfo.jumpdn > 0))
{
end[2] = oldorg[2] + move[2] - ent->monsterinfo.jumpdn;
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID | MASK_WATER);
if(trace.fraction < 1 && (trace.plane.normal[2] > 0.9) && (trace.contents & MASK_SOLID) && (neworg[2] - 16 > trace.endpos[2]))
{
if(!trace.ent || (!trace.ent->client && !(trace.ent->svflags & SVF_MONSTER) && !(trace.ent->svflags & SVF_DEADMONSTER)))
jump = -1;
}
}
if ((trace.fraction == 1) && !jump)
{
// if monster had the ground pulled out, go ahead and fall
if ( ent->flags & FL_PARTIALGROUND )
{
VectorAdd (ent->s.origin, move, ent->s.origin);
if (relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
ent->groundentity = NULL;
return true;
}
return false; // walked off an edge
}
// check point traces down for dangling corners
VectorCopy (trace.endpos, ent->s.origin);
if(!jump)
{
bool skip = false;
// if monster CAN jump down, and a position just a bit forward would be
// a good jump-down spot, allow (briefly) !M_CheckBottom
if (canjump && target && (target->s.origin[2] < ent->s.origin[2]) && (ent->monsterinfo.jumpdn > 0))
{
vec3_t p1, p2;
trace_t tr;
VectorMA(oldorg,48,forward,p1);
tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, p1, ent, MASK_MONSTERSOLID);
if(tr.fraction == 1)
{
p2[0] = p1[0];
p2[1] = p1[1];
p2[2] = p1[2] - ent->monsterinfo.jumpdn;
tr = gi.trace(p1,ent->mins,ent->maxs,p2,ent,MASK_MONSTERSOLID | MASK_WATER);
if(tr.fraction < 1 && (tr.plane.normal[2] > 0.9) && (tr.contents & MASK_SOLID) && (p1[2] - 16 > tr.endpos[2]))
{
if(!tr.ent || (!tr.ent->client && !(tr.ent->svflags & SVF_MONSTER) && !(tr.ent->svflags & SVF_DEADMONSTER)))
{
VectorSubtract(target->s.origin, tr.endpos, dir);
d2 = VectorLength(dir);
if(d2 < d1)
skip = true;
}
}
}
}
if (!skip)
{
if (!M_CheckBottom (ent))
{
if ( ent->flags & FL_PARTIALGROUND )
{ // entity had floor mostly pulled out from underneath it
// and is trying to correct
if (relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
return true;
}
VectorCopy (oldorg, ent->s.origin);
return false;
}
}
}
if ( ent->flags & FL_PARTIALGROUND )
{
ent->flags &= ~FL_PARTIALGROUND;
}
ent->groundentity = trace.ent;
if(trace.ent)
ent->groundentity_linkcount = trace.ent->linkcount;
// the move is ok
if(jump)
{
VectorScale(move, 10, ent->velocity);
if(jump > 0)
{
ent->monsterinfo.jump(ent);
ent->velocity[2] = 2.5*jumpheight + 80;
}
else
{
ent->velocity[2] = max(ent->velocity[2],100);
if(oldorg[2] - ent->s.origin[2] > 48)
ent->s.origin[2] = oldorg[2] + ent->velocity[2]*FRAMETIME;
}
if(relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
}
else if (relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
return true;
}
/*
===============
M_walkmove
===============
*/
bool M_walkmove (edict_t *ent, float yaw, float dist)
{
vec3_t move;
if (!ent->groundentity && !(ent->flags & (FL_FLY|FL_SWIM)))
return false;
yaw = yaw*M_PI*2 / 360;
move[0] = cos(yaw)*dist;
move[1] = sin(yaw)*dist;
move[2] = 0;
return SV_movestep(ent, move, true);
}
//
//=================
// other_FallingDamage
@ -1120,15 +1648,6 @@ bool SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
if (check->groundentity != pusher)
check->groundentity = NULL;
// Lazarus - don't block movewith trains with a rider - they may end up
// being stuck, but that beats a small pitch or roll causing
// blocked trains/gibbed monsters
if (check->movewith_ent == pusher)
{
gi.linkentity (check);
continue;
}
block = SV_TestEntityPosition (check);
if (block && (pusher->flags & FL_TRACKTRAIN) && (check->client || (check->svflags & SVF_MONSTER)) && (check->groundentity == pusher) )
@ -1873,7 +2392,8 @@ void SV_Physics_Step (edict_t *ent)
if (!(ent->health <= 0.0 && !M_CheckBottom(ent))) {
vel = ent->velocity;
speed = sqrt(vel[0]*vel[0] +vel[1]*vel[1]);
if (speed) {
if (speed)
{
friction = sv_friction;
control = speed < sv_stopspeed ? sv_stopspeed : speed;
@ -2038,14 +2558,7 @@ int SV_VehicleMove (edict_t *ent, float time, int mask)
for (i=0 ; i<3 ; i++)
end[i] = origin[i] + time_left * ent->velocity[i];
retry:
trace = gi.trace (start, mins, maxs, end, ignore, mask);
if(trace.ent && (trace.ent->movewith_ent == ent) )
{
ignore = trace.ent;
VectorCopy(trace.endpos,start);
goto retry;
}
if (trace.allsolid)
{
@ -2533,6 +3046,57 @@ void SV_Physics_Conveyor(edict_t *ent)
}
}
void M_CheckGround (edict_t *ent)
{
vec3_t point;
trace_t trace;
if (level.time < ent->gravity_debounce_time)
return;
if (ent->flags & (FL_SWIM|FL_FLY))
return;
if (ent->velocity[2] > 100)
{
ent->groundentity = NULL;
return;
}
// if the hull point one-quarter unit down is solid the entity is on ground
point[0] = ent->s.origin[0];
point[1] = ent->s.origin[1];
point[2] = ent->s.origin[2] - 0.25;
trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, point, ent, MASK_MONSTERSOLID);
// check steepness
if ( trace.plane.normal[2] < 0.7 && !trace.startsolid)
{
ent->groundentity = NULL;
return;
}
// Lazarus: The following 2 lines were in the original code and commented out
// by id. However, the effect of this is that a player walking over
// a dead monster who is laying on a brush model will cause the
// dead monster to drop through the brush model. This change *may*
// have other consequences, though, so watch out for this.
ent->groundentity = trace.ent;
ent->groundentity_linkcount = trace.ent->linkcount;
// if (!trace.startsolid && !trace.allsolid)
// VectorCopy (trace.endpos, ent->s.origin);
if (!trace.startsolid && !trace.allsolid)
{
VectorCopy (trace.endpos, ent->s.origin);
ent->groundentity = trace.ent;
ent->groundentity_linkcount = trace.ent->linkcount;
// ent->velocity[2] = 0; Lazarus: what if the groundentity is moving?
ent->velocity[2] = trace.ent->velocity[2];
}
}
/*
================
G_RunEntity

View File

@ -101,18 +101,14 @@ field_t fields[] =
{"maxpitch", STOFS(maxpitch), F_FLOAT, FFL_SPAWNTEMP},
{"nextmap", STOFS(nextmap), F_LSTRING, FFL_SPAWNTEMP},
// Lazarus additions
{"actor_current_weapon", FOFS(actor_current_weapon), F_INT},
{"aiflags", FOFS(monsterinfo.aiflags), F_INT},
{"alpha", FOFS(alpha), F_FLOAT},
{"axis", FOFS(axis), F_INT},
{"base_radius", FOFS(base_radius), F_FLOAT},
{"bleft", FOFS(bleft), F_VECTOR},
{"blood_type", FOFS(blood_type), F_INT},
{"bob", FOFS(bob), F_FLOAT},
{"bobframe", FOFS(bobframe), F_INT},
{"busy", FOFS(busy), F_INT},
{"child", FOFS(child), F_EDICT},
{"class_id", FOFS(class_id), F_INT},
{"color", FOFS(color), F_VECTOR},
{"crane_beam", FOFS(crane_beam), F_EDICT, FFL_NOSPAWN},
@ -129,21 +125,12 @@ field_t fields[] =
{"datafile", FOFS(datafile), F_LSTRING},
{"deadflag", FOFS(deadflag), F_INT},
{"density", FOFS(density), F_FLOAT},
{"destroytarget", FOFS(destroytarget), F_LSTRING},
{"dmgteam", FOFS(dmgteam), F_LSTRING},
{"do_not_rotate", FOFS(do_not_rotate), F_INT},
{"duration", FOFS(duration), F_FLOAT},
{"effects", FOFS(effects), F_INT},
{"fadein", FOFS(fadein), F_FLOAT},
{"fadeout", FOFS(fadeout), F_FLOAT},
{"flies", FOFS(monsterinfo.flies), F_FLOAT},
{"fog_color", FOFS(fog_color), F_VECTOR},
{"fog_density", FOFS(fog_density), F_FLOAT},
{"fog_far", FOFS(fog_far), F_FLOAT},
{"fog_model", FOFS(fog_model), F_INT},
{"fog_near", FOFS(fog_near), F_FLOAT},
{"fogclip", FOFS(fogclip), F_INT},
{"followtarget", FOFS(followtarget), F_LSTRING},
{"frame", FOFS(s.frame), F_INT},
{"framenumbers", FOFS(framenumbers), F_INT},
{"gib_health", FOFS(gib_health), F_INT},
@ -158,10 +145,6 @@ field_t fields[] =
{"max_health", FOFS(max_health), F_INT},
{"max_range", FOFS(monsterinfo.max_range), F_FLOAT},
{"moreflags", FOFS(moreflags), F_INT},
{"movewith", FOFS(movewith), F_LSTRING},
{"movewith_ent", FOFS(movewith_ent), F_EDICT},
{"movewith_next", FOFS(movewith_next), F_EDICT},
{"movewith_offset", FOFS(movewith_offset), F_VECTOR},
{"move_to", FOFS(move_to), F_LSTRING},
{"muzzle", FOFS(muzzle), F_VECTOR},
{"muzzle2", FOFS(muzzle2), F_VECTOR},
@ -173,7 +156,6 @@ field_t fields[] =
{"org_mins", FOFS(org_mins), F_VECTOR},
{"org_size", FOFS(org_size), F_VECTOR},
{"owner_id", FOFS(owner_id), F_INT},
{"parent_attach_angles", FOFS(parent_attach_angles), F_VECTOR},
{"pitch_speed", FOFS(pitch_speed), F_FLOAT},
{"powerarmor", FOFS(powerarmor), F_INT},
{"prev_grenade", FOFS(prev_grenade), F_EDICT, FFL_NOSPAWN},
@ -192,30 +174,12 @@ field_t fields[] =
{"target2", FOFS(target2), F_LSTRING},
{"tright", FOFS(tright), F_VECTOR},
{"turn_rider", FOFS(turn_rider), F_INT},
{"turret", FOFS(turret), F_EDICT},
{"usermodel", FOFS(usermodel), F_LSTRING},
{"vehicle", FOFS(vehicle), F_EDICT, FFL_NOSPAWN},
{"viewer", FOFS(viewer), F_EDICT},
{"viewheight", FOFS(viewheight), F_INT},
{"viewmessage", FOFS(viewmessage), F_LSTRING},
{"yaw_speed", FOFS(yaw_speed), F_FLOAT},
// ROGUE
{"bad_area", FOFS(bad_area), F_EDICT},
// while the hint_path stuff could be reassembled on the fly, no reason to be different
{"hint_chain", FOFS(hint_chain), F_EDICT},
{"monster_hint_chain", FOFS(monster_hint_chain), F_EDICT},
{"target_hint_chain", FOFS(target_hint_chain), F_EDICT},
//
{"goal_hint", FOFS(monsterinfo.goal_hint), F_EDICT},
{"badMedic1", FOFS(monsterinfo.badMedic1), F_EDICT},
{"badMedic2", FOFS(monsterinfo.badMedic2), F_EDICT},
{"last_player_enemy", FOFS(monsterinfo.last_player_enemy), F_EDICT},
{"commander", FOFS(monsterinfo.commander), F_EDICT},
{"blocked", FOFS(monsterinfo.blocked), F_MMOVE, FFL_NOSPAWN},
{"duck", FOFS(monsterinfo.duck), F_MMOVE, FFL_NOSPAWN},
{"unduck", FOFS(monsterinfo.unduck), F_MMOVE, FFL_NOSPAWN},
{"sidestep", FOFS(monsterinfo.sidestep), F_MMOVE, FFL_NOSPAWN},
{0, 0, 0, 0}
};
@ -229,10 +193,6 @@ field_t levelfields[] =
{"sound_entity", LLOFS(sound_entity), F_EDICT},
{"sound2_entity", LLOFS(sound2_entity), F_EDICT},
// ROGUE
{"disguise_violator", LLOFS(disguise_violator), F_EDICT},
// ROGUE
{NULL, 0, F_INT}
};
@ -241,8 +201,6 @@ field_t clientfields[] =
{"pers.weapon", CLOFS(pers.weapon), F_ITEM},
{"pers.lastweapon", CLOFS(pers.lastweapon), F_ITEM},
{"newweapon", CLOFS(newweapon), F_ITEM},
{"chasecam", CLOFS(chasecam), F_EDICT},
{"oldplayer", CLOFS(oldplayer), F_EDICT},
{NULL, 0, F_INT}
};
@ -256,7 +214,6 @@ only happens when a new game is started or a save game
is loaded.
============
*/
void ReadTextureSurfaceAssignments();
void InitGame (void)
{
gi.dprintf ("====== Init %s ======\n\n", GameTitle );
@ -316,31 +273,21 @@ void InitGame (void)
// dm map list
sv_maplist = gi.cvar ("sv_maplist", "", 0);
// Lazarus
actorchicken = gi.cvar("actorchicken", "1", CVAR_SERVERINFO|CVAR_LATCH);
actorjump = gi.cvar("actorjump", "1", CVAR_SERVERINFO|CVAR_LATCH);
actorscram = gi.cvar("actorscram", "1", CVAR_SERVERINFO|CVAR_LATCH);
alert_sounds = gi.cvar("alert_sounds", "0", CVAR_SERVERINFO|CVAR_LATCH);
allow_fog = gi.cvar ("allow_fog", "1", CVAR_ARCHIVE);
cd_loopcount = gi.cvar("cd_loopcount","4",0);
cl_gun = gi.cvar("cl_gun", "1", 0);
corpse_fade = gi.cvar("corpse_fade", "0", CVAR_SERVERINFO|CVAR_LATCH);
corpse_fadetime = gi.cvar("corpse_fadetime", "20", 0);
crosshair = gi.cvar("crosshair", "1", 0);
fmod_nomusic = gi.cvar("fmod_nomusic", "0", CVAR_ARCHIVE);
footstep_sounds = gi.cvar("footstep_sounds", "0", CVAR_SERVERINFO|CVAR_LATCH);
fov = gi.cvar("fov", "90", 0);
hand = gi.cvar("hand", "0", 0);
jetpack_weenie = gi.cvar("jetpack_weenie", "0", CVAR_SERVERINFO);
joy_pitchsensitivity = gi.cvar("joy_pitchsensitivity", "1", 0);
joy_yawsensitivity = gi.cvar("joy_yawsensitivity", "-1", 0);
jump_kick = gi.cvar("jump_kick", "0", CVAR_SERVERINFO|CVAR_LATCH);
lights = gi.cvar("lights", "1", 0);
lightsmin = gi.cvar("lightsmin", "a", CVAR_SERVERINFO);
m_pitch = gi.cvar("m_pitch", "0.022", 0);
m_yaw = gi.cvar("m_yaw", "0.022", 0);
monsterjump = gi.cvar("monsterjump", "1", CVAR_SERVERINFO|CVAR_LATCH);
packet_fmod_playback = gi.cvar("packet_fmod_playback", "0", CVAR_SERVERINFO);
player_vampire = gi.cvar("player_vampire", "0", CVAR_SERVERINFO|CVAR_LATCH);
rocket_strafe = gi.cvar("rocket_strafe", "0", 0);
s_primary = gi.cvar("s_primary", "0", 0);
@ -394,9 +341,6 @@ void InitGame (void)
}
}
tpp = gi.cvar ("tpp", "0", CVAR_ARCHIVE);
tpp_auto = gi.cvar ("tpp_auto", "1", 0);
crossh = gi.cvar ("crossh", "1", 0);
allow_download = gi.cvar("allow_download", "0", 0);
// If this is an SP game and "readout" is not set, force allow_download off
@ -425,9 +369,6 @@ void InitGame (void)
game.maxclients = maxclients->value;
game.clients = TagMalloc (game.maxclients * sizeof(game.clients[0]), TAG_GAME);
globals.num_edicts = game.maxclients+1;
if(footstep_sounds->value)
ReadTextureSurfaceAssignments();
}
//=========================================================
@ -839,32 +780,8 @@ void WriteLevel (vfile_t *f)
{
ent = &g_edicts[i];
if (!ent->inuse) continue;
if (ent->class_id == ENTITY_TARGET_PLAYBACK)
{
edict_t e;
memcpy(&e, ent, sizeof(edict_t));
if(FMOD_IsPlaying(ent))
{
e.think = target_playback_delayed_restart;
e.nextthink = level.time + 1.0;
// A misuse of groundentity_linkcount, but
// maybe nobody is watching.
e.groundentity_linkcount = g_edicts[1].linkcount;
}
else
{
e.think = NULL;
e.nextthink = 0;
}
e.stream = NULL;
gi.VFs.Write (f, &i, sizeof(i));
WriteEdict (f, &e);
}
else
{
gi.VFs.Write (f, &i, sizeof(i));
WriteEdict (f, ent);
}
gi.VFs.Write (f, &i, sizeof(i));
WriteEdict (f, ent);
}
i = -1;
gi.VFs.Write (f, &i, sizeof(i));
@ -887,7 +804,6 @@ calling ReadLevel.
No clients are connected yet.
=================
*/
void LoadTransitionEnts();
void ReadLevel (vfile_t *f)
{
int entnum;
@ -959,13 +875,6 @@ void ReadLevel (vfile_t *f)
if (ent->class_id == ENTITY_TARGET_CROSSLEVEL_TARGET)
ent->nextthink = level.time + ent->delay;
}
// DWH: Load transition entities
if(game.transition_ents)
{
LoadTransitionEnts();
actor_files();
}
}
void WriteLump (dsavehdr_t *hdr, file_t *f, int lumpnum, bool autosave)

753
server/g_spawn.c Normal file
View File

@ -0,0 +1,753 @@
#include "g_local.h"
void SP_info_player_start (edict_t *ent);
void SP_info_player_deathmatch (edict_t *ent);
void SP_info_player_coop (edict_t *ent);
void SP_info_player_intermission (edict_t *ent);
void SP_worldspawn (edict_t *ent);
void SP_misc_explobox (edict_t *self);
spawn_t spawns[] =
{
{"info_player_start", SP_info_player_start},
{"info_player_deathmatch", SP_info_player_deathmatch},
{"info_player_coop", SP_info_player_coop},
{"info_player_intermission", SP_info_player_intermission},
{"misc_explobox", SP_misc_explobox},
{"worldspawn", SP_worldspawn},
{NULL, NULL}
};
/*
===============
ED_CallSpawn
Finds the spawn function for the entity and calls it
===============
*/
void ED_CallSpawn (edict_t *ent)
{
spawn_t *s;
gitem_t *item;
int i;
// Lazarus: if this fails, edict is freed.
if (!ent->classname)
{
gi.dprintf ("ED_CallSpawn: NULL classname\n");
G_FreeEdict(ent);
return;
}
// check item spawn functions
for (i=0,item=itemlist ; i<game.num_items ; i++,item++)
{
if (!item->classname)
continue;
if (!strcmp(item->classname, ent->classname))
{ // found it
SpawnItem (ent, item);
return;
}
}
// check normal spawn functions
for (s=spawns ; s->name ; s++)
{
if (!strcmp(s->name, ent->classname))
{ // found it
s->spawn (ent);
return;
}
}
gi.dprintf ("%s doesn't have a spawn function\n", ent->classname);
G_FreeEdict(ent);
}
/*
=============
ED_NewString
=============
*/
char *ED_NewString (char *string)
{
char *newb, *new_p;
int i,l;
l = strlen(string) + 1;
newb = TagMalloc (l, TAG_LEVEL);
new_p = newb;
for (i=0 ; i< l ; i++)
{
if (string[i] == '\\' && i < l-1)
{
i++;
if (string[i] == 'n')
*new_p++ = '\n';
else
*new_p++ = '\\';
}
else
*new_p++ = string[i];
}
return newb;
}
/*
===============
ED_ParseField
Takes a key/value pair and sets the binary values
in an edict
===============
*/
void ED_ParseField (char *key, char *value, edict_t *ent)
{
field_t *f;
byte *b;
float v;
vec3_t vec;
for (f=fields ; f->name ; f++)
{
if (!(f->flags & FFL_NOSPAWN) && !strcasecmp(f->name, key))
{ // found it
if (f->flags & FFL_SPAWNTEMP)
b = (byte *)&st;
else
b = (byte *)ent;
switch (f->type)
{
case F_LSTRING:
*(char **)(b+f->ofs) = ED_NewString (value);
break;
case F_VECTOR:
sscanf (value, "%f %f %f", &vec[0], &vec[1], &vec[2]);
((float *)(b+f->ofs))[0] = vec[0];
((float *)(b+f->ofs))[1] = vec[1];
((float *)(b+f->ofs))[2] = vec[2];
break;
case F_INT:
*(int *)(b+f->ofs) = atoi(value);
break;
case F_FLOAT:
*(float *)(b+f->ofs) = atof(value);
break;
case F_ANGLEHACK:
v = atof(value);
((float *)(b+f->ofs))[0] = 0;
((float *)(b+f->ofs))[1] = v;
((float *)(b+f->ofs))[2] = 0;
break;
case F_IGNORE:
break;
}
return;
}
}
gi.dprintf ("%s is not a field\n", key);
}
/*
====================
ED_ParseEdict
Parses an edict out of the given string, returning the new position
ed should be a properly initialized empty edict.
====================
*/
char *ED_ParseEdict (char *data, edict_t *ent)
{
bool init;
char keyname[256];
char *com_token;
init = false;
memset (&st, 0, sizeof(st));
// go through all the dictionary pairs
while (1)
{
// parse key
com_token = COM_Parse (&data);
if (com_token[0] == '}') break;
if (!data) gi.error ("ED_ParseEntity: EOF without closing brace");
strncpy (keyname, com_token, sizeof(keyname)-1);
// parse value
com_token = COM_Parse (&data);
if (!data) gi.error ("ED_ParseEntity: EOF without closing brace");
if (com_token[0] == '}')
gi.error ("ED_ParseEntity: closing brace without data");
init = true;
// keynames with a leading underscore are used for utility comments,
// and are immediately discarded by quake
if (keyname[0] == '_') continue;
ED_ParseField (keyname, com_token, ent);
}
if (!init) memset (ent, 0, sizeof(*ent));
return data;
}
/*
================
G_FindTeams
Chain together all entities with a matching team field.
All but the first will have the FL_TEAMSLAVE flag set.
All but the last will have the teamchain field set to the next one
================
*/
void G_FindTeams (void)
{
edict_t *e, *e2, *chain;
int i, j;
int c, c2;
c = 0;
c2 = 0;
for (i=1, e=g_edicts+i ; i < globals.num_edicts ; i++,e++)
{
if (!e->inuse)
continue;
if (!e->team)
continue;
if (e->flags & FL_TEAMSLAVE)
continue;
// Lazarus: some entities may have psuedo-teams that shouldn't be handled here
if (e->class_id == ENTITY_TARGET_CHANGE)
continue;
if (e->class_id == ENTITY_TARGET_CLONE)
continue;
chain = e;
e->teammaster = e;
c++;
c2++;
for (j=i+1, e2=e+1 ; j < globals.num_edicts ; j++,e2++)
{
if (!e2->inuse)
continue;
if (!e2->team)
continue;
if (e2->flags & FL_TEAMSLAVE)
continue;
if (!strcmp(e->team, e2->team))
{
c2++;
chain->teamchain = e2;
e2->teammaster = e;
chain = e2;
e2->flags |= FL_TEAMSLAVE;
}
}
}
if(level.time < 2)
gi.dprintf ("%i teams with %i entities\n", c, c2);
}
/*
==============
SpawnEntities
Creates a server's entity / program execution context by
parsing textual entity definitions out of an ent file.
==============
*/
void SpawnEntities (char *mapname, char *entities, char *spawnpoint)
{
edict_t *ent;
int inhibit;
char *com_token;
int i;
float skill_level;
extern int max_modelindex;
extern int max_soundindex;
if(developer->value)
gi.dprintf("====== SpawnEntities ========\n");
skill_level = floor (skill->value);
if (skill_level < 0)
skill_level = 0;
if (skill_level > 3)
skill_level = 3;
if (skill->value != skill_level)
gi.cvar_forceset("skill", va("%f", skill_level));
SaveClientData ();
FreeTags (TAG_LEVEL);
memset (&level, 0, sizeof(level));
memset (g_edicts, 0, game.maxentities * sizeof (g_edicts[0]));
// Lazarus: these are used to track model and sound indices
// in g_main.c:
max_modelindex = 0;
max_soundindex = 0;
strncpy (level.mapname, mapname, sizeof(level.mapname)-1);
strncpy (game.spawnpoint, spawnpoint, sizeof(game.spawnpoint)-1);
// set client fields on player ents
for (i=0 ; i<game.maxclients ; i++)
g_edicts[i+1].client = game.clients + i;
ent = NULL;
inhibit = 0;
// parse ents
while (1)
{
// parse the opening brace
com_token = COM_Parse (&entities);
if (!entities)
break;
if (com_token[0] != '{')
gi.error ("ED_LoadFromFile: found %s when expecting {",com_token);
if (!ent)
ent = g_edicts;
else
ent = G_Spawn ();
entities = ED_ParseEdict (entities, ent);
// yet another map hack
if (!strcasecmp(level.mapname, "command") && !strcasecmp(ent->classname, "trigger_once") && !strcasecmp(ent->model, "*27"))
ent->spawnflags &= ~SPAWNFLAG_NOT_HARD;
// remove things (except the world) from different skill levels or deathmatch
if (ent != g_edicts)
{
if (deathmatch->value)
{
if ( ent->spawnflags & SPAWNFLAG_NOT_DEATHMATCH )
{
G_FreeEdict (ent);
inhibit++;
continue;
}
}
else
{
if (((skill->value == 0) && (ent->spawnflags & SPAWNFLAG_NOT_EASY)) ||
((skill->value == 1) && (ent->spawnflags & SPAWNFLAG_NOT_MEDIUM)) ||
(((skill->value == 2) || (skill->value == 3)) && (ent->spawnflags & SPAWNFLAG_NOT_HARD))
)
{
G_FreeEdict (ent);
inhibit++;
continue;
}
}
ent->spawnflags &= ~(SPAWNFLAG_NOT_EASY|SPAWNFLAG_NOT_MEDIUM|SPAWNFLAG_NOT_HARD|SPAWNFLAG_NOT_DEATHMATCH);
}
ED_CallSpawn (ent);
ent->s.renderfx |= RF_IR_VISIBLE; //PGM
}
gi.dprintf ("%i entities inhibited\n", inhibit);
G_FindTeams ();
// Get origin offsets (mainly for brush models w/o origin brushes)
for (i=1, ent=g_edicts+i ; i < globals.num_edicts ; i++,ent++)
{
VectorAdd(ent->absmin,ent->absmax,ent->origin_offset);
VectorScale(ent->origin_offset,0.5,ent->origin_offset);
VectorSubtract(ent->origin_offset,ent->s.origin,ent->origin_offset);
}
}
//===================================================================
#if 0
// cursor positioning
xl <value>
xr <value>
yb <value>
yt <value>
xv <value>
yv <value>
// drawing
statpic <name>
pic <stat>
num <fieldwidth> <stat>
string <stat>
// control
if <stat>
ifeq <stat> <value>
ifbit <stat> <value>
endif
#endif
char *single_statusbar =
"yb -24 "
// health
"xv 0 "
"hnum "
"xv 50 "
"pic 0 "
// ammo
"if 2 "
"{ xv 100 "
"anum "
"xv 150 "
"pic 2 "
"} "
// armor
"if 4 "
"{ xv 200 "
"rnum "
"xv 250 "
"pic 4 "
"} "
// selected item
"if 6 "
"{ xv 296 "
"pic 6 "
"} "
"yb -50 "
// picked up item
"if 7 "
"{ xv 0 "
"pic 7 "
"xv 26 "
"yb -42 "
"stat_string 8 "
"yb -50 "
"} "
// timer (was xv 262)
"if 9 "
"{ xv 230 "
"num 4 10 "
"xv 296 "
"pic 9 "
"} "
// help / weapon icon
"if 11 "
"{ xv 148 "
"pic 11 "
"} "
// vehicle speed
"if 22 "
"{ yb -90 "
"xv 128 "
"pic 22 "
"} "
// zoom
"if 23 "
"{ yv 0 "
"xv 0 "
"pic 23 "
"} "
;
char *dm_statusbar =
"yb -24 "
// health
"xv 0 "
"hnum "
"xv 50 "
"pic 0 "
// ammo
"if 2 "
"{ xv 100 "
"anum "
"xv 150 "
"pic 2 "
"} "
// armor
"if 4 "
"{ xv 200 "
"rnum "
"xv 250 "
"pic 4 "
"} "
// selected item
"if 6 "
"{ xv 296 "
"pic 6 "
"} "
"yb -50 "
// picked up item
"if 7 "
"{ xv 0 "
"pic 7 "
"xv 26 "
"yb -42 "
"stat_string 8 "
"yb -50 "
"} "
// timer
"if 9 "
"{ xv 230 "
"num 4 10 "
"xv 296 "
"pic 9 "
"} "
// help / weapon icon
"if 11 "
"{ xv 148 "
"pic 11 "
"} "
// frags
"xr -50 "
"yt 2 "
"num 3 14 "
// spectator
"if 17 "
"{ xv 0 "
"yb -58 "
"string2 \"SPECTATOR MODE\" "
"} "
// chase camera
"if 16 "
"{ xv 0 "
"yb -68 "
"string \"Chasing\" "
"xv 64 "
"stat_string 16 "
"} "
// vehicle speed
"if 22 "
"{ yb -90 "
"xv 128 "
"pic 22 "
"} "
;
/*QUAKED worldspawn (0 0 0) ?
Only used for the world.
"skyname" environment map name
"skyaxis" vector axis for rotating sky
"skyrotate" speed of rotation in degrees/second
"sounds" music cd track number
"gravity" 800 is default gravity
"message" text to print at user logon
*/
//void SetChromakey();
void SP_worldspawn (edict_t *ent)
{
ent->class_id = ENTITY_WORLDSPAWN;
ent->movetype = MOVETYPE_PUSH;
ent->solid = SOLID_BSP;
ent->inuse = true; // since the world doesn't use G_Spawn()
ent->s.modelindex = 1; // world model is always index 1
//---------------
// reserve some spots for dead player bodies for coop / deathmatch
InitBodyQue ();
// set configstrings for items
SetItemNames ();
if (st.nextmap)
strcpy (level.nextmap, st.nextmap);
// make some data visible to the server
if (ent->message && ent->message[0])
{
gi.configstring (CS_NAME, ent->message);
strncpy (level.level_name, ent->message, sizeof(level.level_name));
}
else
strncpy (level.level_name, level.mapname, sizeof(level.level_name));
if (st.sky && st.sky[0])
gi.configstring (CS_SKY, st.sky);
else
gi.configstring (CS_SKY, "sky");
gi.configstring (CS_SKYROTATE, va("%f", st.skyrotate) );
gi.configstring (CS_SKYAXIS, va("%f %f %f",
st.skyaxis[0], st.skyaxis[1], st.skyaxis[2]) );
gi.configstring (CS_CDTRACK, va("%i", ent->sounds) );
gi.configstring (CS_MAXCLIENTS, va("%i", (int)(maxclients->value) ) );
// status bar program
if (deathmatch->value)
gi.configstring (CS_STATUSBAR, dm_statusbar);
else
gi.configstring (CS_STATUSBAR, single_statusbar);
//---------------
// help icon for statusbar
gi.imageindex ("i_help");
level.pic_health = gi.imageindex ("i_health");
gi.imageindex ("help");
gi.imageindex ("field_3");
if (!st.gravity)
gi.cvar_set("sv_gravity", "800");
else
gi.cvar_set("sv_gravity", st.gravity);
snd_fry = gi.soundindex ("player/fry.wav"); // standing in lava / slime
PrecacheItem (FindItem ("Blaster"));
gi.soundindex ("player/lava1.wav");
gi.soundindex ("player/lava2.wav");
gi.soundindex ("misc/pc_up.wav");
gi.soundindex ("misc/talk1.wav");
gi.soundindex ("misc/udeath.wav");
// gibs
gi.soundindex ("items/respawn1.wav");
// sexed sounds
gi.soundindex ("*death1.wav");
gi.soundindex ("*death2.wav");
gi.soundindex ("*death3.wav");
gi.soundindex ("*death4.wav");
gi.soundindex ("*fall1.wav");
gi.soundindex ("*fall2.wav");
gi.soundindex ("*gurp1.wav"); // drowning damage
gi.soundindex ("*gurp2.wav");
gi.soundindex ("*jump1.wav"); // player jump
gi.soundindex ("*pain25_1.wav");
gi.soundindex ("*pain25_2.wav");
gi.soundindex ("*pain50_1.wav");
gi.soundindex ("*pain50_2.wav");
gi.soundindex ("*pain75_1.wav");
gi.soundindex ("*pain75_2.wav");
gi.soundindex ("*pain100_1.wav");
gi.soundindex ("*pain100_2.wav");
gi.modelindex ("#w_blaster.md2");
gi.soundindex ("player/gasp1.wav"); // gasping for air
gi.soundindex ("player/gasp2.wav"); // head breaking surface, not gasping
gi.soundindex ("player/watr_in.wav"); // feet hitting water
gi.soundindex ("player/watr_out.wav"); // feet leaving water
gi.soundindex ("player/watr_un.wav"); // head going underwater
gi.soundindex ("player/u_breath1.wav");
gi.soundindex ("player/u_breath2.wav");
gi.soundindex ("items/pkup.wav"); // bonus item pickup
gi.soundindex ("world/land.wav"); // landing thud
gi.soundindex ("misc/h2ohit1.wav"); // landing splash
gi.soundindex ("items/damage.wav");
gi.soundindex ("items/protect.wav");
gi.soundindex ("items/protect4.wav");
gi.soundindex ("weapons/noammo.wav");
gi.soundindex ("infantry/inflies1.wav");
sm_meat_index = gi.modelindex ("models/objects/gibs/sm_meat/tris.md2");
gi.modelindex ("models/objects/gibs/arm/tris.md2");
gi.modelindex ("models/objects/gibs/bone/tris.md2");
gi.modelindex ("models/objects/gibs/bone2/tris.md2");
gi.modelindex ("models/objects/gibs/chest/tris.md2");
gi.modelindex ("models/objects/gibs/skull/tris.md2");
gi.modelindex ("models/objects/gibs/head2/tris.md2");
gi.soundindex ("mud/mud_in2.wav");
gi.soundindex ("mud/mud_out1.wav");
gi.soundindex ("mud/mud_un1.wav");
gi.soundindex ("mud/wade_mud1.wav");
gi.soundindex ("mud/wade_mud2.wav");
// FMOD 3D sound attenuation:
if(ent->attenuation <= 0.)
ent->attenuation = 1.0;
// FMOD 3D sound Doppler shift:
if(st.shift > 0)
ent->moveinfo.distance = st.shift;
else if(st.shift < 0)
ent->moveinfo.distance = 0.0;
else
ent->moveinfo.distance = 1.0;
// cvar overrides for effects flags:
if(alert_sounds->value)
world->effects |= FX_WORLDSPAWN_ALERTSOUNDS;
if(corpse_fade->value)
world->effects |= FX_WORLDSPAWN_CORPSEFADE;
if(jump_kick->value)
world->effects |= FX_WORLDSPAWN_JUMPKICK;
}
int nohud = 0;
void Hud_On()
{
if (deathmatch->value) gi.configstring (CS_STATUSBAR, dm_statusbar);
else gi.configstring (CS_STATUSBAR, single_statusbar);
nohud = 0;
}
void Hud_Off()
{
gi.configstring (CS_STATUSBAR, NULL);
nohud = 1;
}
void Cmd_ToggleHud ()
{
if (deathmatch->value) return;
if (nohud) Hud_On();
else Hud_Off();
}

View File

@ -109,7 +109,6 @@ findradius2
Returns entities that have origins within a spherical area
ROGUE - tweaks for performance for tesla specific code
only returns entities that can be damaged
only returns entities that are SVF_DAMAGEABLE
@ -134,8 +133,6 @@ edict_t *findradius2 (edict_t *from, vec3_t org, float rad)
continue;
if (!from->takedamage)
continue;
if (!(from->svflags & SVF_DAMAGEABLE))
continue;
for (j=0 ; j<3 ; j++)
eorg[j] = org[j] - (from->s.origin[j] + (from->mins[j] + from->maxs[j])*0.5);
if (VectorLength(eorg) > rad)
@ -579,18 +576,6 @@ void G_FreeEdict (edict_t *ed)
{
// Lazarus - if part of a movewith chain, remove from
// the chain and repair broken links
if(ed->movewith) {
edict_t *e;
edict_t *parent=NULL;
int i;
for(i=1; i<globals.num_edicts && !parent; i++) {
e = g_edicts + i;
if(e->movewith_next == ed) parent=e;
}
if(parent) parent->movewith_next = ed->movewith_next;
}
gi.unlinkentity (ed); // unlink from world
// Lazarus: In SP we no longer reserve slots for bodyque's
@ -616,10 +601,6 @@ void G_FreeEdict (edict_t *ed)
ed->flash->inuse = false;
}
// Lazarus: reflections
if (!(ed->flags & FL_REFLECT))
DeleteReflection(ed,-1);
memset (ed, 0, sizeof(*ed));
ed->classname = "freed";
ed->freetime = level.time;
@ -657,8 +638,6 @@ void G_TouchTriggers (edict_t *ent)
continue;
if (!hit->touch)
continue;
if (ent->client && ent->client->spycam && !(hit->svflags & SVF_TRIGGER_CAMOWNER))
continue;
hit->touch (hit, ent, NULL, NULL);
}
}
@ -799,13 +778,7 @@ edict_t *LookingAt(edict_t *ent, int filter, vec3_t endpos, float *range)
return NULL;
}
VectorClear(end);
if(ent->client->chasetoggle)
{
AngleVectors(ent->client->v_angle, forward, NULL, NULL);
VectorCopy(ent->client->chasecam->s.origin,start);
ignore = ent->client->chasecam;
}
else if(ent->client->spycam)
if(ent->client->spycam)
{
AngleVectors(ent->client->ps.viewangles, forward, NULL, NULL);
VectorCopy(ent->s.origin,start);
@ -1000,4 +973,428 @@ void G_UseTarget (edict_t *ent, edict_t *activator, edict_t *target)
return;
}
}
}
/*
=============
visible
returns 1 if the entity is visible to self, even if not infront ()
=============
*/
bool visible (edict_t *self, edict_t *other)
{
vec3_t spot1;
vec3_t spot2;
trace_t trace;
VectorCopy (self->s.origin, spot1);
spot1[2] += self->viewheight;
VectorCopy (other->s.origin, spot2);
spot2[2] += other->viewheight;
trace = gi.trace (spot1, vec3_origin, vec3_origin, spot2, self, MASK_OPAQUE);
// Lazarus: Take fog into account for monsters
if ( (trace.fraction == 1.0) || (trace.ent == other))
{
self->monsterinfo.visibility = 1.0;
return true;
}
return false;
}
/*
=============
infront
returns 1 if the entity is in front (in sight) of self
=============
*/
bool infront (edict_t *self, edict_t *other)
{
vec3_t vec;
float dot;
vec3_t forward;
AngleVectors (self->s.angles, forward, NULL, NULL);
VectorSubtract (other->s.origin, self->s.origin, vec);
VectorNormalize (vec);
dot = DotProduct (vec, forward);
if (dot > 0.3)
return true;
return false;
}
void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_t dir, vec3_t point, vec3_t normal, int damage, int knockback, int dflags, int mod)
{
gclient_t *client;
int take;
int save;
int te_sparks;
edict_t *attacker;
edict_t *targ;
targ = in_targ;
if (!targ || !targ->inuse)
return;
if (!targ->takedamage)
return;
if (!in_attacker)
attacker = world;
else
attacker = in_attacker;
// If targ is a fake player for the real player viewing camera, get that player
// out of the camera and do the damage to him
if (targ->class_id == ENTITY_CAMPLAYER) {
if(targ->target_ent && targ->target_ent->client && targ->target_ent->client->spycam)
{
if(attacker->enemy == targ)
{
attacker->enemy = targ->target_ent;
attacker->goalentity = NULL;
attacker->movetarget = NULL;
}
targ = targ->target_ent;
if(attacker->svflags & SVF_MONSTER)
{
if(attacker->spawnflags & SF_MONSTER_GOODGUY)
{
if(attacker->enemy == targ)
{
attacker->enemy = NULL;
attacker->monsterinfo.aiflags &= ~AI_FOLLOW_LEADER;
attacker->monsterinfo.attack_finished = 0;
attacker->monsterinfo.pausetime = level.time + 100000000;
if(attacker->monsterinfo.stand)
attacker->monsterinfo.stand(attacker);
}
}
}
}
else
return; // don't damage target_monitor camplayer
}
// friendly fire avoidance
// if enabled you can't hurt teammates (but you can hurt yourself)
// knockback still occurs
if ((targ != attacker) && ((deathmatch->value && ((int)(dmflags->value) & (DF_MODELTEAMS | DF_SKINTEAMS))) || coop->value))
{
if (OnSameTeam (targ, attacker))
{
if ((int)(dmflags->value) & DF_NO_FRIENDLY_FIRE)
damage = 0;
else
mod |= MOD_FRIENDLY_FIRE;
}
}
meansOfDeath = mod;
// easy mode takes half damage
if (skill->value == 0 && deathmatch->value == 0 && targ->client)
{
damage *= 0.5;
if (!damage)
damage = 1;
}
client = targ->client;
if (dflags & DAMAGE_BULLET)
te_sparks = TE_BULLET_SPARKS;
else
te_sparks = TE_SPARKS;
VectorNormalize(dir);
// bonus damage for suprising a monster
if (!(dflags & DAMAGE_RADIUS) && (targ->svflags & SVF_MONSTER) && (attacker->client) && (!targ->enemy) && (targ->health > 0))
damage *= 2;
if (targ->flags & FL_NO_KNOCKBACK)
knockback = 0;
// Lazarus: If monster is currently chasing a "thing" and mod is a laser,
// ignore knockback to give poor guy a chance to vamoose.
if (targ->movetarget && (targ->movetarget->class_id == ENTITY_THING) && (mod == MOD_TARGET_LASER))
knockback = 0;
// figure momentum add
if (!(dflags & DAMAGE_NO_KNOCKBACK))
{
// Lazarus: Added MOVETYPE_TOSS to no knockback (pickup items and dead bodies)
if ((knockback) && (targ->movetype != MOVETYPE_NONE) && (targ->movetype != MOVETYPE_BOUNCE) && (targ->movetype != MOVETYPE_PUSH) && (targ->movetype != MOVETYPE_STOP) && (targ->movetype != MOVETYPE_TOSS))
{
vec3_t kvel;
float mass;
if (targ->mass < 50)
mass = 50;
else
mass = targ->mass;
if (targ->client && attacker == targ)
{
VectorScale (dir, 1600.0 * (float)knockback / mass, kvel); // the rocket jump hack...
}
else
{
VectorScale (dir, 500.0 * (float)knockback / mass, kvel);
}
VectorAdd (targ->velocity, kvel, targ->velocity);
}
}
take = damage;
save = 0;
// check for invincibility
if ((client && client->invincible_framenum > level.framenum ) && !(dflags & DAMAGE_NO_PROTECTION))
{
if (targ->pain_debounce_time < level.time)
{
gi.sound(targ, CHAN_ITEM, gi.soundindex("items/protect4.wav"), 1, ATTN_NORM, 0);
targ->pain_debounce_time = level.time + 2;
}
take = 0;
save = damage;
}
// do the damage
if (take)
{
if(targ->client)
{
if(in_targ != targ)
{
// Then player has taken the place of whatever was originally
// damaged, as in switching from func_monitor usage. Limit
// damage so that player isn't killed, and make him temporarily
// invincible
targ->health = max(2,targ->health - take);
targ->client->invincible_framenum = level.framenum+2;
targ->pain_debounce_time = max(targ->pain_debounce_time,level.time+0.3);
}
else if(level.framenum - targ->client->startframe > 30)
targ->health = targ->health - take;
else if(targ->health > 10)
targ->health = max(10,targ->health - take);
}
else
{
// Lazarus: For func_explosive target, check spawnflags and, if needed,
// damage type
if(targ->class_id == ENTITY_FUNC_EXPLOSIVE)
{
bool good_damage = true;
if(targ->spawnflags & 8) // explosion only
{
good_damage = false;
if(mod == MOD_GRENADE) good_damage = true;
if(mod == MOD_G_SPLASH) good_damage = true;
if(mod == MOD_ROCKET) good_damage = true;
if(mod == MOD_R_SPLASH) good_damage = true;
if(mod == MOD_BFG_BLAST) good_damage = true;
if(mod == MOD_HANDGRENADE) good_damage = true;
if(mod == MOD_HG_SPLASH) good_damage = true;
if(mod == MOD_EXPLOSIVE) good_damage = true;
if(mod == MOD_BARREL) good_damage = true;
if(mod == MOD_BOMB) good_damage = true;
}
if(!good_damage) return;
}
targ->health = targ->health - take;
}
if (targ->health <= 0)
{
if ((targ->svflags & SVF_MONSTER) || (client))
targ->flags |= FL_NO_KNOCKBACK;
Killed (targ, inflictor, attacker, take, point);
return;
}
}
if (client)
{
if (!(targ->flags & FL_GODMODE) && (take))
targ->pain (targ, attacker, knockback, take);
}
else if (take)
{
if (targ->pain)
targ->pain (targ, attacker, knockback, take);
}
// add to the damage inflicted on a player this frame
// the total will be turned into screen blends and view angle kicks
// at the end of the frame
if (client)
{
client->damage_parmor += 10;
client->damage_armor += 10;
client->damage_blood += take;
client->damage_knockback += knockback;
VectorCopy (point, client->damage_from);
}
}
/*
============
T_RadiusDamage
Lazarus adds dmg_slope to alter the radius damage equation. (Standard Q2 = -0.5)
============
*/
void T_RadiusDamage (edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod, double dmg_slope)
{
float points;
edict_t *ent = NULL;
vec3_t v;
vec3_t dir;
while ((ent = findradius(ent, inflictor->s.origin, radius)) != NULL)
{
if (ent == ignore)
continue;
if (!ent->takedamage)
continue;
VectorAdd (ent->mins, ent->maxs, v);
VectorMA (ent->s.origin, 0.5, v, v);
VectorSubtract (inflictor->s.origin, v, v);
points = damage + dmg_slope * VectorLength (v);
if (ent == attacker)
points = points * 0.5;
if (points > 0)
{
if (CanDamage (ent, inflictor))
{
VectorSubtract (ent->s.origin, inflictor->s.origin, dir);
T_Damage (ent, inflictor, attacker, dir, inflictor->s.origin, vec3_origin, (int)points, (int)points, DAMAGE_RADIUS, mod);
}
}
}
}
/*
============
Killed
============
*/
void misc_deadsoldier_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
if (targ->health < -999) targ->health = -999;
targ->enemy = attacker;
if ((targ->svflags & SVF_MONSTER) && (targ->deadflag != DEAD_DEAD))
{
if (!(targ->monsterinfo.aiflags & AI_GOOD_GUY) )
{
level.killed_monsters++;
if (coop->value && attacker->client)
attacker->client->resp.score++;
// medics won't heal monsters that they kill themselves
if (attacker->class_id == ENTITY_MONSTER_MEDIC)
targ->owner = attacker;
}
}
if (targ->movetype == MOVETYPE_PUSH || targ->movetype == MOVETYPE_STOP || targ->movetype == MOVETYPE_NONE)
{ // doors, triggers, etc
targ->die (targ, inflictor, attacker, damage, point);
return;
}
if (inflictor->movetype == MOVETYPE_PUSH)
{
// Lazarus - Die function won't gib NO_GIB monsters... blow 'em up
if((targ->die != misc_deadsoldier_die) && (targ->spawnflags & SF_MONSTER_NOGIB))
{
BecomeExplosion1(targ);
return;
}
}
targ->die (targ, inflictor, attacker, damage, point);
}
/*
============
CanDamage
Returns true if the inflictor can directly damage the target. Used for
explosions and melee attacks.
============
*/
bool CanDamage (edict_t *targ, edict_t *inflictor)
{
vec3_t dest;
trace_t trace;
// bmodels need special checking because their origin is 0,0,0
if (targ->movetype == MOVETYPE_PUSH)
{
VectorAdd (targ->absmin, targ->absmax, dest);
VectorScale (dest, 0.5, dest);
trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
if (trace.fraction == 1.0)
return true;
if (trace.ent == targ)
return true;
return false;
}
trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, targ->s.origin, inflictor, MASK_SOLID);
if (trace.fraction == 1.0 || trace.ent == targ)
return true;
// Lazarus: This is kinda cheesy, but avoids doing goofy things in a map to make this work. If a LOS
// from inflictor to targ is blocked by a func_tracktrain, AND the targ is riding/driving
// the tracktrain, go ahead and hurt him.
if(trace.ent && (trace.ent->flags & FL_TRACKTRAIN) && ((trace.ent->owner == targ) || (targ->groundentity == trace.ent)) )
return true;
VectorCopy (targ->s.origin, dest);
dest[0] += 15.0;
dest[1] += 15.0;
trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
if (trace.fraction == 1.0 || trace.ent == targ)
return true;
VectorCopy (targ->s.origin, dest);
dest[0] += 15.0;
dest[1] -= 15.0;
trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
if (trace.fraction == 1.0 || trace.ent == targ)
return true;
VectorCopy (targ->s.origin, dest);
dest[0] -= 15.0;
dest[1] += 15.0;
trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
if (trace.fraction == 1.0 || trace.ent == targ)
return true;
VectorCopy (targ->s.origin, dest);
dest[0] -= 15.0;
dest[1] -= 15.0;
trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
if (trace.fraction == 1.0 || trace.ent == targ)
return true;
return false;
}

View File

@ -1,802 +0,0 @@
//==========================================================================================
// FMOD Main header file. Copyright (c), FireLight Multimedia 1999-2001.
//==========================================================================================
#ifndef _FMOD_H_
#define _FMOD_H_
//===============================================================================================
// DEFINITIONS
//===============================================================================================
#if defined(__GNUC__) && defined(WIN32)
#define _cdecl
#endif /* defined(__GNUC__) && defined(WIN32) */
#if defined(PLATFORM_LINUX)
#define _cdecl
#define _stdcall
#define __cdecl
#define __stdcall
#define __declspec(x)
#define __PS __attribute__((packed)) /* gcc packed */
#else
#define __PS /*dummy*/
#endif
#define F_API _stdcall
#ifdef DLL_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#ifdef __LCC__
#define DLL_API F_API
#else
#define DLL_API
#endif // __LCC__
#endif //DLL_EXPORTS
#define FMOD_VERSION 3.31f
// fmod defined types
typedef struct FSOUND_MATERIAL FSOUND_MATERIAL;
typedef struct FSOUND_GEOMLIST FSOUND_GEOMLIST;
typedef struct FSOUND_SAMPLE FSOUND_SAMPLE;
typedef struct FSOUND_STREAM FSOUND_STREAM;
typedef struct FSOUND_DSPUNIT FSOUND_DSPUNIT;
typedef struct FMUSIC_MODULE FMUSIC_MODULE;
// callback types
typedef signed char (_cdecl *FSOUND_STREAMCALLBACK) (FSOUND_STREAM *stream, void *buff, int len, int param);
typedef void * (_cdecl *FSOUND_DSPCALLBACK) (void *originalbuffer, void *newbuffer, int length, int param);
typedef void (_cdecl *FMUSIC_CALLBACK) (FMUSIC_MODULE *mod, unsigned char param);
/*
[ENUM]
[
[DESCRIPTION]
On failure of commands in FMOD, use FSOUND_GetError to attain what happened.
[SEE_ALSO]
FSOUND_GetError
]
*/
enum FMOD_ERRORS
{
FMOD_ERR_NONE, // No errors
FMOD_ERR_BUSY, // Cannot call this command after FSOUND_Init. Call FSOUND_Close first.
FMOD_ERR_UNINITIALIZED, // This command failed because FSOUND_Init was not called
FMOD_ERR_INIT, // Error initializing output device.
FMOD_ERR_ALLOCATED, // Error initializing output device, but more specifically, the output device is already in use and cannot be reused.
FMOD_ERR_PLAY, // Playing the sound failed.
FMOD_ERR_OUTPUT_FORMAT, // Soundcard does not support the features needed for this soundsystem (16bit stereo output)
FMOD_ERR_COOPERATIVELEVEL, // Error setting cooperative level for hardware.
FMOD_ERR_CREATEBUFFER, // Error creating hardware sound buffer.
FMOD_ERR_FILE_NOTFOUND, // File not found
FMOD_ERR_FILE_FORMAT, // Unknown file format
FMOD_ERR_FILE_BAD, // Error loading file
FMOD_ERR_MEMORY, // Not enough memory
FMOD_ERR_VERSION, // The version number of this file format is not supported
FMOD_ERR_INVALID_PARAM, // An invalid parameter was passed to this function
FMOD_ERR_NO_EAX, // Tried to use an EAX command on a non EAX enabled channel or output.
FMOD_ERR_NO_EAX2, // Tried to use an advanced EAX2 command on a non EAX2 enabled channel or output.
FMOD_ERR_CHANNEL_ALLOC, // Failed to allocate a new channel
FMOD_ERR_RECORD, // Recording is not supported on this machine
FMOD_ERR_MEDIAPLAYER, // Windows Media Player not installed so cant play wma or use internet streaming.
};
/*
[ENUM]
[
[DESCRIPTION]
These output types are used with FSOUND_SetOutput, to choose which output driver to use.
FSOUND_OUTPUT_A3D will cause FSOUND_Init to FAIL if you have not got a vortex
based A3D card. The suggestion for this is to immediately try and reinitialize FMOD with
FSOUND_OUTPUT_DSOUND, and if this fails, try initializing FMOD with FSOUND_OUTPUT_WAVEOUT.
FSOUND_OUTPUT_DSOUND will not support hardware 3d acceleration if the sound card driver
does not support DirectX 6 Voice Manager Extensions.
[SEE_ALSO]
FSOUND_SetOutput
FSOUND_GetOutput
]
*/
enum FSOUND_OUTPUTTYPES
{
FSOUND_OUTPUT_NOSOUND, // NoSound driver, all calls to this succeed but do nothing.
FSOUND_OUTPUT_WINMM, // Windows Multimedia driver.
FSOUND_OUTPUT_DSOUND, // DirectSound driver. You need this to get EAX or EAX2 support.
FSOUND_OUTPUT_A3D, // A3D driver. You need this to get geometry support.
FSOUND_OUTPUT_OSS, // Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers.
FSOUND_OUTPUT_ESD, // Linux/Unix ESD (Enlightment Sound Daemon) driver.
FSOUND_OUTPUT_ALSA // Linux Alsa driver.
};
/*
[ENUM]
[
[DESCRIPTION]
These mixer types are used with FSOUND_SetMixer, to choose which mixer to use, or to act
upon for other reasons using FSOUND_GetMixer.
[SEE_ALSO]
FSOUND_SetMixer
FSOUND_GetMixer
]
*/
enum FSOUND_MIXERTYPES
{
FSOUND_MIXER_AUTODETECT, // Enables autodetection of the fastest mixer based on your cpu.
FSOUND_MIXER_BLENDMODE, // Enables the standard non mmx, blendmode mixer.
FSOUND_MIXER_MMXP5, // Enables the mmx, pentium optimized blendmode mixer.
FSOUND_MIXER_MMXP6, // Enables the mmx, ppro/p2/p3 optimized mixer.
FSOUND_MIXER_QUALITY_AUTODETECT,// Enables autodetection of the fastest quality mixer based on your cpu.
FSOUND_MIXER_QUALITY_FPU, // Enables the interpolating/volume ramping FPU mixer.
FSOUND_MIXER_QUALITY_MMXP5, // Enables the interpolating/volume ramping p5 MMX mixer.
FSOUND_MIXER_QUALITY_MMXP6, // Enables the interpolating/volume ramping ppro/p2/p3+ MMX mixer.
};
/*
[ENUM]
[
[DESCRIPTION]
These definitions describe the type of song being played.
[SEE_ALSO]
FMUSIC_GetType
]
*/
enum FMUSIC_TYPES
{
FMUSIC_TYPE_NONE,
FMUSIC_TYPE_MOD, // Protracker / Fasttracker
FMUSIC_TYPE_S3M, // ScreamTracker 3
FMUSIC_TYPE_XM, // FastTracker 2
FMUSIC_TYPE_IT, // Impulse Tracker.
FMUSIC_TYPE_MIDI, // MIDI file
};
/*
[DEFINE_START]
[
[NAME]
FSOUND_DSP_PRIORITIES
[DESCRIPTION]
These default priorities are
[SEE_ALSO]
FSOUND_DSP_Create
FSOUND_DSP_SetPriority
]
*/
#define FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT 0 // DSP CLEAR unit - done first
#define FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT 100 // DSP SFX unit - done second
#define FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT 200 // DSP MUSIC unit - done third
#define FSOUND_DSP_DEFAULTPRIORITY_USER 300 // User priority, use this as reference
#define FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT 1000 // DSP CLIP AND COPY unit - last
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_CAPS
[DESCRIPTION]
Driver description bitfields. Use FSOUND_Driver_GetCaps to determine if a driver enumerated
has the settings you are after. The enumerated driver depends on the output mode, see
FSOUND_OUTPUTTYPES
[SEE_ALSO]
FSOUND_GetDriverCaps
FSOUND_OUTPUTTYPES
]
*/
#define FSOUND_CAPS_HARDWARE 0x1 // This driver supports hardware accelerated 3d sound.
#define FSOUND_CAPS_EAX 0x2 // This driver supports EAX reverb
#define FSOUND_CAPS_GEOMETRY_OCCLUSIONS 0x4 // This driver supports (A3D) geometry occlusions
#define FSOUND_CAPS_GEOMETRY_REFLECTIONS 0x8 // This driver supports (A3D) geometry reflections
#define FSOUND_CAPS_EAX2 0x10 // This driver supports EAX2/A3D3 reverb
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_MODES
[DESCRIPTION]
Sample description bitfields, OR them together for loading and describing samples.
]
*/
#define FSOUND_LOOP_OFF 0x00000001 // For non looping samples.
#define FSOUND_LOOP_NORMAL 0x00000002 // For forward looping samples.
#define FSOUND_LOOP_BIDI 0x00000004 // For bidirectional looping samples. (no effect if in hardware).
#define FSOUND_8BITS 0x00000008 // For 8 bit samples.
#define FSOUND_16BITS 0x00000010 // For 16 bit samples.
#define FSOUND_MONO 0x00000020 // For mono samples.
#define FSOUND_STEREO 0x00000040 // For stereo samples.
#define FSOUND_UNSIGNED 0x00000080 // For source data containing unsigned samples.
#define FSOUND_SIGNED 0x00000100 // For source data containing signed data.
#define FSOUND_DELTA 0x00000200 // For source data stored as delta values.
#define FSOUND_IT214 0x00000400 // For source data stored using IT214 compression.
#define FSOUND_IT215 0x00000800 // For source data stored using IT215 compression.
#define FSOUND_HW3D 0x00001000 // Attempts to make samples use 3d hardware acceleration. (if the card supports it)
#define FSOUND_2D 0x00002000 // Ignores any 3d processing. overrides FSOUND_HW3D. Located in software.
#define FSOUND_STREAMABLE 0x00004000 // For a streamable sound where you feed the data to it. If you dont supply this sound may come out corrupted. (only affects a3d output)
#define FSOUND_LOADMEMORY 0x00008000 // 'name' will be interpreted as a pointer to data for streaming and samples.
#define FSOUND_LOADRAW 0x00010000 // For will ignore file format and treat as raw pcm.
#define FSOUND_MPEGACCURATE 0x00020000 // For FSOUND_Stream_OpenFile - for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime. WARNING, see FSOUNDStream_OpenFile for inital opening time performance issues.
// Default sample type. Loop off, 8bit mono, signed, not hardware accelerated.
// Some API functions ignore 8bits and mono, as it may be an mpeg/wav/etc which has its format predetermined.
#define FSOUND_NORMAL (FSOUND_LOOP_OFF | FSOUND_8BITS | FSOUND_MONO)
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_CDPLAYMODES
[DESCRIPTION]
Playback method for a CD Audio track, using FSOUND_CD_Play
[SEE_ALSO]
FSOUND_CD_Play
]
*/
#define FSOUND_CD_PLAYCONTINUOUS 0 // Starts from the current track and plays to end of CD.
#define FSOUND_CD_PLAYONCE 1 // Plays the specified track then stops.
#define FSOUND_CD_PLAYLOOPED 2 // Plays the specified track looped, forever until stopped manually.
#define FSOUND_CD_PLAYRANDOM 3 // Plays tracks in random order
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_CHANNELSAMPLEMODE
[DESCRIPTION]
Miscellaneous values for FMOD functions.
[SEE_ALSO]
FSOUND_PlaySound
FSOUND_PlaySound3DAttrib
FSOUND_Sample_Alloc
FSOUND_Sample_Load
FSOUND_SetPan
]
*/
#define FSOUND_FREE -1 // value to play on any free channel, or to allocate a sample in a free sample slot.
#define FSOUND_UNMANAGED -2 // value to allocate a sample that is NOT managed by FSOUND or placed in a sample slot.
#define FSOUND_ALL -3 // for a channel index , this flag will affect ALL channels available! Not supported by every function.
#define FSOUND_STEREOPAN -1 // value for FSOUND_SetPan so that stereo sounds are not played at half volume. See FSOUND_SetPan for more on this.
// [DEFINE_END]
/*
[ENUM]
[
[DESCRIPTION]
These are environment types defined for use with the FSOUND_Reverb API.
[SEE_ALSO]
FSOUND_Reverb_SetEnvironment
FSOUND_Reverb_SetEnvironmentAdvanced
]
*/
enum FSOUND_REVERB_ENVIRONMENTS
{
FSOUND_ENVIRONMENT_GENERIC,
FSOUND_ENVIRONMENT_PADDEDCELL,
FSOUND_ENVIRONMENT_ROOM,
FSOUND_ENVIRONMENT_BATHROOM,
FSOUND_ENVIRONMENT_LIVINGROOM,
FSOUND_ENVIRONMENT_STONEROOM,
FSOUND_ENVIRONMENT_AUDITORIUM,
FSOUND_ENVIRONMENT_CONCERTHALL,
FSOUND_ENVIRONMENT_CAVE,
FSOUND_ENVIRONMENT_ARENA,
FSOUND_ENVIRONMENT_HANGAR,
FSOUND_ENVIRONMENT_CARPETEDHALLWAY,
FSOUND_ENVIRONMENT_HALLWAY,
FSOUND_ENVIRONMENT_STONECORRIDOR,
FSOUND_ENVIRONMENT_ALLEY,
FSOUND_ENVIRONMENT_FOREST,
FSOUND_ENVIRONMENT_CITY,
FSOUND_ENVIRONMENT_MOUNTAINS,
FSOUND_ENVIRONMENT_QUARRY,
FSOUND_ENVIRONMENT_PLAIN,
FSOUND_ENVIRONMENT_PARKINGLOT,
FSOUND_ENVIRONMENT_SEWERPIPE,
FSOUND_ENVIRONMENT_UNDERWATER,
FSOUND_ENVIRONMENT_DRUGGED,
FSOUND_ENVIRONMENT_DIZZY,
FSOUND_ENVIRONMENT_PSYCHOTIC,
FSOUND_ENVIRONMENT_COUNT
};
/*
[DEFINE_START]
[
[NAME]
FSOUND_REVERBMIX_USEDISTANCE
[DESCRIPTION]
Used with FSOUND_Reverb_SetMix, this setting allows reverb to attenuate based on distance from the listener.
Instead of hard coding a value with FSOUND_Reverb_SetMix, this value can be used instead, for a more natural
reverb dropoff.
[SEE_ALSO]
FSOUND_Reverb_SetMix
]
*/
#define FSOUND_REVERBMIX_USEDISTANCE -1.0f // used with FSOUND_Reverb_SetMix to scale reverb by distance
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_REVERB_IGNOREPARAM
[DESCRIPTION]
Used with FSOUND_Reverb_SetEnvironment and FSOUND_Reverb_SetEnvironmentAdvanced, this can
be placed in the place of a specific parameter for the reverb setting. It allows you to
not set any parameters except the ones you are interested in .. and example would be this.
FSOUND_Reverb_SetEnvironment(FSOUND_REVERB_IGNOREPARAM,
FSOUND_REVERB_IGNOREPARAM,
FSOUND_REVERB_IGNOREPARAM,
0.0f);
This means env, vol and decay are left alone, but 'damp' is set to 0.
[SEE_ALSO]
FSOUND_Reverb_SetEnvironment
FSOUND_Reverb_SetEnvironmentAdvanced
]
*/
#define FSOUND_REVERB_IGNOREPARAM -9999999 // used with FSOUND_Reverb_SetEnvironmentAdvanced to ignore certain parameters by choice.
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_REVERB_PRESETS
[DESCRIPTION]
A set of predefined environment PARAMETERS, created by Creative Labs
These can be placed directly into the FSOUND_Reverb_SetEnvironment call
[SEE_ALSO]
FSOUND_Reverb_SetEnvironment
]
*/
#define FSOUND_PRESET_OFF FSOUND_ENVIRONMENT_GENERIC,0.0f,0.0f,0.0f
#define FSOUND_PRESET_GENERIC FSOUND_ENVIRONMENT_GENERIC,0.5f,1.493f,0.5f
#define FSOUND_PRESET_PADDEDCELL FSOUND_ENVIRONMENT_PADDEDCELL,0.25f,0.1f,0.0f
#define FSOUND_PRESET_ROOM FSOUND_ENVIRONMENT_ROOM,0.417f,0.4f,0.666f
#define FSOUND_PRESET_BATHROOM FSOUND_ENVIRONMENT_BATHROOM,0.653f,1.499f,0.166f
#define FSOUND_PRESET_LIVINGROOM FSOUND_ENVIRONMENT_LIVINGROOM,0.208f,0.478f,0.0f
#define FSOUND_PRESET_STONEROOM FSOUND_ENVIRONMENT_STONEROOM,0.5f,2.309f,0.888f
#define FSOUND_PRESET_AUDITORIUM FSOUND_ENVIRONMENT_AUDITORIUM,0.403f,4.279f,0.5f
#define FSOUND_PRESET_CONCERTHALL FSOUND_ENVIRONMENT_CONCERTHALL,0.5f,3.961f,0.5f
#define FSOUND_PRESET_CAVE FSOUND_ENVIRONMENT_CAVE,0.5f,2.886f,1.304f
#define FSOUND_PRESET_ARENA FSOUND_ENVIRONMENT_ARENA,0.361f,7.284f,0.332f
#define FSOUND_PRESET_HANGAR FSOUND_ENVIRONMENT_HANGAR,0.5f,10.0f,0.3f
#define FSOUND_PRESET_CARPETEDHALLWAY FSOUND_ENVIRONMENT_CARPETEDHALLWAY,0.153f,0.259f,2.0f
#define FSOUND_PRESET_HALLWAY FSOUND_ENVIRONMENT_HALLWAY,0.361f,1.493f,0.0f
#define FSOUND_PRESET_STONECORRIDOR FSOUND_ENVIRONMENT_STONECORRIDOR,0.444f,2.697f,0.638f
#define FSOUND_PRESET_ALLEY FSOUND_ENVIRONMENT_ALLEY,0.25f,1.752f,0.776f
#define FSOUND_PRESET_FOREST FSOUND_ENVIRONMENT_FOREST,0.111f,3.145f,0.472f
#define FSOUND_PRESET_CITY FSOUND_ENVIRONMENT_CITY,0.111f,2.767f,0.224f
#define FSOUND_PRESET_MOUNTAINS FSOUND_ENVIRONMENT_MOUNTAINS,0.194f,7.841f,0.472f
#define FSOUND_PRESET_QUARRY FSOUND_ENVIRONMENT_QUARRY,1.0f,1.499f,0.5f
#define FSOUND_PRESET_PLAIN FSOUND_ENVIRONMENT_PLAIN,0.097f,2.767f,0.224f
#define FSOUND_PRESET_PARKINGLOT FSOUND_ENVIRONMENT_PARKINGLOT,0.208f,1.652f,1.5f
#define FSOUND_PRESET_SEWERPIPE FSOUND_ENVIRONMENT_SEWERPIPE,0.652f,2.886f,0.25f
#define FSOUND_PRESET_UNDERWATER FSOUND_ENVIRONMENT_UNDERWATER,1.0f,1.499f,0.0f
#define FSOUND_PRESET_DRUGGED FSOUND_ENVIRONMENT_DRUGGED,0.875f, 8.392f,1.388f
#define FSOUND_PRESET_DIZZY FSOUND_ENVIRONMENT_DIZZY,0.139f,17.234f,0.666f
#define FSOUND_PRESET_PSYCHOTIC FSOUND_ENVIRONMENT_PSYCHOTIC,0.486f,7.563f,0.806f
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_GEOMETRY_MODES
[DESCRIPTION]
Geometry flags, used as the mode flag in FSOUND_Geometry_AddPolygon
[SEE_ALSO]
FSOUND_Geometry_AddPolygon
]
*/
#define FSOUND_GEOMETRY_NORMAL 0x0 // Default geometry type. Occluding polygon
#define FSOUND_GEOMETRY_REFLECTIVE 0x01 // This polygon is reflective
#define FSOUND_GEOMETRY_OPENING 0x02 // Overlays a transparency over the previous polygon. The 'openingfactor' value supplied is copied internally.
#define FSOUND_GEOMETRY_OPENING_REFERENCE 0x04 // Overlays a transparency over the previous polygon. The 'openingfactor' supplied is pointed to (for access when building a list)
// [DEFINE_END]
/*
[DEFINE_START]
[
[NAME]
FSOUND_INIT_FLAGS
[DESCRIPTION]
Initialization flags. Use them with FSOUND_Init in the flags parameter to change various behaviour.
[SEE_ALSO]
FSOUND_Init
]
*/
#define FSOUND_INIT_USEDEFAULTMIDISYNTH 0x01 // Causes MIDI playback to force software decoding.
// [DEFINE_END]
//===============================================================================================
// FUNCTION PROTOTYPES
//===============================================================================================
/* Lazarus: We use GetProcAddress to resolve FMOD references, so these aren't needed (and
cause conflicts if we try to use the same names.
#ifdef __cplusplus
extern "C" {
#endif
// ==================================
// Initialization / Global functions.
// ==================================
// *Pre* FSOUND_Init functions. These can't be called after FSOUND_Init is
// called (they will fail). They set up FMOD system functionality.
DLL_API signed char F_API FSOUND_SetOutput(int outputtype);
DLL_API signed char F_API FSOUND_SetDriver(int driver);
DLL_API signed char F_API FSOUND_SetMixer(int mixer);
DLL_API signed char F_API FSOUND_SetBufferSize(int len_ms);
DLL_API signed char F_API FSOUND_SetHWND(void *hwnd);
DLL_API signed char F_API FSOUND_SetMinHardwareChannels(int min);
DLL_API signed char F_API FSOUND_SetMaxHardwareChannels(int max);
// Main initialization / closedown functions.
// Note : Use FSOUND_INIT_USEDEFAULTMIDISYNTH with FSOUND_Init for software override with MIDI playback.
DLL_API signed char F_API FSOUND_Init(int mixrate, int maxsoftwarechannels, unsigned int flags);
DLL_API void F_API FSOUND_Close();
// Runtime
DLL_API void F_API FSOUND_SetSFXMasterVolume(int volume);
DLL_API void F_API FSOUND_SetPanSeperation(float pansep);
// System information.
DLL_API int F_API FSOUND_GetError();
DLL_API float F_API FSOUND_GetVersion();
DLL_API int F_API FSOUND_GetOutput();
DLL_API int F_API FSOUND_GetDriver();
DLL_API int F_API FSOUND_GetMixer();
DLL_API int F_API FSOUND_GetNumDrivers();
DLL_API signed char * F_API FSOUND_GetDriverName(int id);
DLL_API signed char F_API FSOUND_GetDriverCaps(int id, unsigned int *caps);
DLL_API int F_API FSOUND_GetOutputRate();
DLL_API int F_API FSOUND_GetMaxChannels();
DLL_API int F_API FSOUND_GetMaxSamples();
DLL_API int F_API FSOUND_GetSFXMasterVolume();
DLL_API int F_API FSOUND_GetNumHardwareChannels();
DLL_API int F_API FSOUND_GetChannelsPlaying();
DLL_API float F_API FSOUND_GetCPUUsage();
// ===================================
// Sample management / load functions.
// ===================================
// Note : Use FSOUND_LOADMEMORY flag with FSOUND_Sample_Load to load from memory.
// Use FSOUND_LOADRAW flag with FSOUND_Sample_Load to treat as as raw pcm data.
// Sample creation and management functions
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Load(int index, const char *name, unsigned int mode, int memlength);
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Alloc(int index, int length, unsigned int mode, int deffreq, int defvol, int defpan, int defpri);
DLL_API void F_API FSOUND_Sample_Free(FSOUND_SAMPLE *sptr);
DLL_API signed char F_API FSOUND_Sample_Upload(FSOUND_SAMPLE *sptr, void *srcdata, unsigned int mode);
DLL_API signed char F_API FSOUND_Sample_Lock(FSOUND_SAMPLE *sptr, int offset, int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
DLL_API signed char F_API FSOUND_Sample_Unlock(FSOUND_SAMPLE *sptr, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
// Sample control functions
DLL_API signed char F_API FSOUND_Sample_SetLoopMode(FSOUND_SAMPLE *sptr, unsigned int loopmode);
DLL_API signed char F_API FSOUND_Sample_SetLoopPoints(FSOUND_SAMPLE *sptr, int loopstart, int loopend);
DLL_API signed char F_API FSOUND_Sample_SetDefaults(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri);
DLL_API signed char F_API FSOUND_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min, float max);
// Sample information
DLL_API FSOUND_SAMPLE * F_API FSOUND_Sample_Get(int sampno);
DLL_API char * F_API FSOUND_Sample_GetName(FSOUND_SAMPLE *sptr);
DLL_API unsigned int F_API FSOUND_Sample_GetLength(FSOUND_SAMPLE *sptr);
DLL_API signed char F_API FSOUND_Sample_GetLoopPoints(FSOUND_SAMPLE *sptr, int *loopstart, int *loopend);
DLL_API signed char F_API FSOUND_Sample_GetDefaults(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri);
DLL_API unsigned int F_API FSOUND_Sample_GetMode(FSOUND_SAMPLE *sptr);
// ============================
// Channel control functions.
// ============================
// Playing and stopping sounds.
DLL_API int F_API FSOUND_PlaySound(int channel, FSOUND_SAMPLE *sptr);
DLL_API int F_API FSOUND_PlaySound3DAttrib(int channel, FSOUND_SAMPLE *sptr, int freq, int vol, int pan, float *pos, float *vel);
DLL_API signed char F_API FSOUND_StopSound(int channel);
// Functions to control playback of a channel.
DLL_API signed char F_API FSOUND_SetFrequency(int channel, int freq);
DLL_API signed char F_API FSOUND_SetVolume(int channel, int vol);
DLL_API signed char F_API FSOUND_SetVolumeAbsolute(int channel, int vol);
DLL_API signed char F_API FSOUND_SetPan(int channel, int pan);
DLL_API signed char F_API FSOUND_SetSurround(int channel, signed char surround);
DLL_API signed char F_API FSOUND_SetMute(int channel, signed char mute);
DLL_API signed char F_API FSOUND_SetPriority(int channel, int priority);
DLL_API signed char F_API FSOUND_SetReserved(int channel, signed char reserved);
DLL_API signed char F_API FSOUND_SetPaused(int channel, signed char paused);
DLL_API signed char F_API FSOUND_SetLoopMode(int channel, unsigned int loopmode);
// Channel information
DLL_API signed char F_API FSOUND_IsPlaying(int channel);
DLL_API int F_API FSOUND_GetFrequency(int channel);
DLL_API int F_API FSOUND_GetVolume(int channel);
DLL_API int F_API FSOUND_GetPan(int channel);
DLL_API signed char F_API FSOUND_GetSurround(int channel);
DLL_API signed char F_API FSOUND_GetMute(int channel);
DLL_API int F_API FSOUND_GetPriority(int channel);
DLL_API signed char F_API FSOUND_GetReserved(int channel);
DLL_API signed char F_API FSOUND_GetPaused(int channel);
DLL_API unsigned int F_API FSOUND_GetCurrentPosition(int channel);
DLL_API FSOUND_SAMPLE * F_API FSOUND_GetCurrentSample(int channel);
DLL_API float F_API FSOUND_GetCurrentVU(int channel);
// ===================
// 3D sound functions.
// ===================
// see also FSOUND_PlaySound3DAttrib (above)
// see also FSOUND_Sample_SetMinMaxDistance (above)
DLL_API void F_API FSOUND_3D_Update();
DLL_API signed char F_API FSOUND_3D_SetAttributes(int channel, float *pos, float *vel);
DLL_API signed char F_API FSOUND_3D_GetAttributes(int channel, float *pos, float *vel);
DLL_API void F_API FSOUND_3D_Listener_SetAttributes(float *pos, float *vel, float fx, float fy, float fz, float tx, float ty, float tz);
DLL_API void F_API FSOUND_3D_Listener_GetAttributes(float *pos, float *vel, float *fx, float *fy, float *fz, float *tx, float *ty, float *tz);
DLL_API void F_API FSOUND_3D_Listener_SetDopplerFactor(float scale);
DLL_API void F_API FSOUND_3D_Listener_SetDistanceFactor(float scale);
DLL_API void F_API FSOUND_3D_Listener_SetRolloffFactor(float scale);
// =========================
// File Streaming functions.
// =========================
// Note : Use FSOUND_LOADMEMORY flag with FSOUND_Stream_OpenFile to stream from memory.
// Use FSOUND_LOADRAW flag with FSOUND_Stream_OpenFile to treat stream as raw pcm data.
// Use FSOUND_MPEGACCURATE flag with FSOUND_Stream_OpenFile to open mpegs in 'accurate mode' for seeking etc.
DLL_API FSOUND_STREAM * F_API FSOUND_Stream_OpenFile(const char *filename, unsigned int mode, int memlength);
DLL_API FSOUND_STREAM * F_API FSOUND_Stream_Create(FSOUND_STREAMCALLBACK callback, int length, unsigned int mode, int samplerate, int userdata);
DLL_API int F_API FSOUND_Stream_Play(int channel, FSOUND_STREAM *stream);
DLL_API int F_API FSOUND_Stream_Play3DAttrib(int channel, FSOUND_STREAM *stream, int freq, int vol, int pan, float *pos, float *vel);
DLL_API signed char F_API FSOUND_Stream_Stop(FSOUND_STREAM *stream);
DLL_API signed char F_API FSOUND_Stream_Close(FSOUND_STREAM *stream);
DLL_API signed char F_API FSOUND_Stream_SetEndCallback(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, int userdata);
DLL_API signed char F_API FSOUND_Stream_SetSynchCallback(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, int userdata);
DLL_API FSOUND_SAMPLE * F_API FSOUND_Stream_GetSample(FSOUND_STREAM *stream);
DLL_API FSOUND_DSPUNIT *F_API FSOUND_Stream_CreateDSP(FSOUND_STREAM *stream, FSOUND_DSPCALLBACK callback, int priority, int param);
DLL_API signed char F_API FSOUND_Stream_SetPaused(FSOUND_STREAM *stream, signed char paused);
DLL_API signed char F_API FSOUND_Stream_GetPaused(FSOUND_STREAM *stream);
DLL_API signed char F_API FSOUND_Stream_SetPosition(FSOUND_STREAM *stream, int position);
DLL_API int F_API FSOUND_Stream_GetPosition(FSOUND_STREAM *stream);
DLL_API signed char F_API FSOUND_Stream_SetTime(FSOUND_STREAM *stream, int ms);
DLL_API int F_API FSOUND_Stream_GetTime(FSOUND_STREAM *stream);
DLL_API int F_API FSOUND_Stream_GetLength(FSOUND_STREAM *stream);
DLL_API int F_API FSOUND_Stream_GetLengthMs(FSOUND_STREAM *stream);
// ===================
// CD audio functions.
// ===================
DLL_API signed char F_API FSOUND_CD_Play(int track);
DLL_API void F_API FSOUND_CD_SetPlayMode(signed char mode);
DLL_API signed char F_API FSOUND_CD_Stop();
DLL_API signed char F_API FSOUND_CD_SetPaused(signed char paused);
DLL_API signed char F_API FSOUND_CD_SetVolume(int volume);
DLL_API signed char F_API FSOUND_CD_Eject();
DLL_API signed char F_API FSOUND_CD_GetPaused();
DLL_API int F_API FSOUND_CD_GetTrack();
DLL_API int F_API FSOUND_CD_GetNumTracks();
DLL_API int F_API FSOUND_CD_GetVolume();
DLL_API int F_API FSOUND_CD_GetTrackLength(int track);
DLL_API int F_API FSOUND_CD_GetTrackTime();
// ==============
// DSP functions.
// ==============
// DSP Unit control and information functions.
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_Create(FSOUND_DSPCALLBACK callback, int priority, int param);
DLL_API void F_API FSOUND_DSP_Free(FSOUND_DSPUNIT *unit);
DLL_API void F_API FSOUND_DSP_SetPriority(FSOUND_DSPUNIT *unit, int priority);
DLL_API int F_API FSOUND_DSP_GetPriority(FSOUND_DSPUNIT *unit);
DLL_API void F_API FSOUND_DSP_SetActive(FSOUND_DSPUNIT *unit, signed char active);
DLL_API signed char F_API FSOUND_DSP_GetActive(FSOUND_DSPUNIT *unit);
// Functions to get hold of FSOUND 'system DSP unit' handles.
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetClearUnit();
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetSFXUnit();
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetMusicUnit();
DLL_API FSOUND_DSPUNIT *F_API FSOUND_DSP_GetClipAndCopyUnit();
// misc DSP functions
DLL_API signed char F_API FSOUND_DSP_MixBuffers(void *destbuffer, void *srcbuffer, int len, int freq, int vol, int pan, unsigned int mode);
DLL_API void F_API FSOUND_DSP_ClearMixBuffer();
DLL_API int F_API FSOUND_DSP_GetBufferLength();
// =============================================
// Geometry functions. (NOT SUPPORTED IN LINUX)
// =============================================
// scene/polygon functions
DLL_API signed char F_API FSOUND_Geometry_AddPolygon(float *p1, float *p2, float *p3, float *p4, float *normal, unsigned int mode, float *openingfactor);
DLL_API int F_API FSOUND_Geometry_AddList(FSOUND_GEOMLIST *geomlist);
// polygon list functions
DLL_API FSOUND_GEOMLIST * F_API FSOUND_Geometry_List_Create(signed char boundingvolume);
DLL_API signed char F_API FSOUND_Geometry_List_Free(FSOUND_GEOMLIST *geomlist);
DLL_API signed char F_API FSOUND_Geometry_List_Begin(FSOUND_GEOMLIST *geomlist);
DLL_API signed char F_API FSOUND_Geometry_List_End(FSOUND_GEOMLIST *geomlist);
// material functions
DLL_API FSOUND_MATERIAL * F_API FSOUND_Geometry_Material_Create();
DLL_API signed char F_API FSOUND_Geometry_Material_Free(FSOUND_MATERIAL *material);
DLL_API signed char F_API FSOUND_Geometry_Material_SetAttributes(FSOUND_MATERIAL *material, float reflectancegain, float reflectancefreq, float transmittancegain, float transmittancefreq);
DLL_API signed char F_API FSOUND_Geometry_Material_GetAttributes(FSOUND_MATERIAL *material, float *reflectancegain, float *reflectancefreq, float *transmittancegain, float *transmittancefreq);
DLL_API signed char F_API FSOUND_Geometry_Material_Set(FSOUND_MATERIAL *material);
// ========================================================================
// Reverb functions. (eax, eax2, a3d 3.0 reverb) (NOT SUPPORTED IN LINUX)
// ========================================================================
// eax1, eax2, a3d 3.0 (use FSOUND_REVERB_PRESETS if you like), (eax2 support through emulation/parameter conversion)
DLL_API signed char F_API FSOUND_Reverb_SetEnvironment(int env, float vol, float decay, float damp);
// eax2, a3d 3.0 only, does not work on eax1
DLL_API signed char F_API FSOUND_Reverb_SetEnvironmentAdvanced(
int env,
int Room, // [-10000, 0] default: -10000 mB or use FSOUND_REVERB_IGNOREPARAM
int RoomHF, // [-10000, 0] default: 0 mB or use FSOUND_REVERB_IGNOREPARAM
float RoomRolloffFactor, // [0.0, 10.0] default: 0.0 or use FSOUND_REVERB_IGNOREPARAM
float DecayTime, // [0.1, 20.0] default: 1.0 s or use FSOUND_REVERB_IGNOREPARAM
float DecayHFRatio, // [0.1, 2.0] default: 0.5 or use FSOUND_REVERB_IGNOREPARAM
int Reflections, // [-10000, 1000] default: -10000 mB or use FSOUND_REVERB_IGNOREPARAM
float ReflectionsDelay, // [0.0, 0.3] default: 0.02 s or use FSOUND_REVERB_IGNOREPARAM
int Reverb, // [-10000, 2000] default: -10000 mB or use FSOUND_REVERB_IGNOREPARAM
float ReverbDelay, // [0.0, 0.1] default: 0.04 s or use FSOUND_REVERB_IGNOREPARAM
float EnvironmentSize, // [0.0, 100.0] default: 100.0 % or use FSOUND_REVERB_IGNOREPARAM
float EnvironmentDiffusion, // [0.0, 100.0] default: 100.0 % or use FSOUND_REVERB_IGNOREPARAM
float AirAbsorptionHF); // [20.0, 20000.0] default: 5000.0 Hz or use FSOUND_REVERB_IGNOREPARAM
DLL_API signed char F_API FSOUND_Reverb_SetMix(int channel, float mix);
// information functions
DLL_API signed char F_API FSOUND_Reverb_GetEnvironment(int *env, float *vol, float *decay, float *damp);
DLL_API signed char F_API FSOUND_Reverb_GetEnvironmentAdvanced(
int *env,
int *Room,
int *RoomHF,
float *RoomRolloffFactor,
float *DecayTime,
float *DecayHFRatio,
int *Reflections,
float *ReflectionsDelay,
int *Reverb,
float *ReverbDelay,
float *EnvironmentSize,
float *EnvironmentDiffusion,
float *AirAbsorptionHF);
DLL_API signed char F_API FSOUND_Reverb_GetMix(int channel, float *mix);
// =============================================
// Recording functions (NOT SUPPORTED IN LINUX)
// =============================================
// recording initialization functions
DLL_API signed char F_API FSOUND_Record_SetDriver(int outputtype);
DLL_API int F_API FSOUND_Record_GetNumDrivers();
DLL_API signed char * F_API FSOUND_Record_GetDriverName(int id);
DLL_API int F_API FSOUND_Record_GetDriver();
// recording functionality. Only one recording session will work at a time
DLL_API signed char F_API FSOUND_Record_StartSample(FSOUND_SAMPLE *sptr, signed char loop);// record to sample
DLL_API signed char F_API FSOUND_Record_Stop(); // stop recording
DLL_API int F_API FSOUND_Record_GetPosition(); // offset in sample, or wav file
// =========================
// File system override
// =========================
DLL_API void F_API FSOUND_File_SetCallbacks(unsigned int (_cdecl *OpenCallback)(const char *name),
void (_cdecl *CloseCallback)(unsigned int handle),
int (_cdecl *ReadCallback)(void *buffer, int size, unsigned int handle),
int (_cdecl *SeekCallback)(unsigned int handle, int pos, signed char mode),
int (_cdecl *TellCallback)(unsigned int handle));
// =============================================================================================
// FMUSIC API
// =============================================================================================
// Song management / playback functions.
DLL_API FMUSIC_MODULE * F_API FMUSIC_LoadSong(const char *name);
DLL_API FMUSIC_MODULE * F_API FMUSIC_LoadSongMemory(void *data, int length);
DLL_API signed char F_API FMUSIC_FreeSong(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_PlaySong(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_StopSong(FMUSIC_MODULE *mod);
DLL_API void F_API FMUSIC_StopAllSongs();
DLL_API signed char F_API FMUSIC_SetZxxCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback);
DLL_API signed char F_API FMUSIC_SetRowCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int rowstep);
DLL_API signed char F_API FMUSIC_SetOrderCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int orderstep);
DLL_API signed char F_API FMUSIC_SetInstCallback(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int instrument);
DLL_API signed char F_API FMUSIC_SetSample(FMUSIC_MODULE *mod, int sampno, FSOUND_SAMPLE *sptr);
DLL_API signed char F_API FMUSIC_OptimizeChannels(FMUSIC_MODULE *mod, int maxchannels, int minvolume);
// Runtime song functions.
DLL_API signed char F_API FMUSIC_SetReverb(signed char reverb); // MIDI only.
DLL_API signed char F_API FMUSIC_SetOrder(FMUSIC_MODULE *mod, int order);
DLL_API signed char F_API FMUSIC_SetPaused(FMUSIC_MODULE *mod, signed char pause);
DLL_API signed char F_API FMUSIC_SetMasterVolume(FMUSIC_MODULE *mod, int volume);
DLL_API signed char F_API FMUSIC_SetPanSeperation(FMUSIC_MODULE *mod, float pansep);
// Static song information functions.
DLL_API char * F_API FMUSIC_GetName(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_GetType(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumOrders(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumPatterns(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumInstruments(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumSamples(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetNumChannels(FMUSIC_MODULE *mod);
DLL_API FSOUND_SAMPLE * F_API FMUSIC_GetSample(FMUSIC_MODULE *mod, int sampno);
DLL_API int F_API FMUSIC_GetPatternLength(FMUSIC_MODULE *mod, int orderno);
// Runtime song information.
DLL_API signed char F_API FMUSIC_IsFinished(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_IsPlaying(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetMasterVolume(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetGlobalVolume(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetOrder(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetPattern(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetSpeed(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetBPM(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetRow(FMUSIC_MODULE *mod);
DLL_API signed char F_API FMUSIC_GetPaused(FMUSIC_MODULE *mod);
DLL_API int F_API FMUSIC_GetTime(FMUSIC_MODULE *mod);
#ifdef __cplusplus
}
#endif
*/
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,156 +0,0 @@
#include "g_local.h"
void UpdateChaseCam(edict_t *ent)
{
vec3_t o, ownerv, goal;
edict_t *targ;
vec3_t forward, right;
trace_t trace;
int i;
vec3_t oldgoal;
vec3_t angles;
// is our chase target gone?
if (!ent->client->chase_target->inuse
|| ent->client->chase_target->client->resp.spectator) {
edict_t *old = ent->client->chase_target;
ChaseNext(ent);
if (ent->client->chase_target == old) {
ent->client->chase_target = NULL;
ent->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
return;
}
}
targ = ent->client->chase_target;
VectorCopy(targ->s.origin, ownerv);
VectorCopy(ent->s.origin, oldgoal);
ownerv[2] += targ->viewheight;
VectorCopy(targ->client->v_angle, angles);
if (angles[PITCH] > 56)
angles[PITCH] = 56;
AngleVectors (angles, forward, right, NULL);
VectorNormalize(forward);
VectorMA(ownerv, -30, forward, o);
if (o[2] < targ->s.origin[2] + 20)
o[2] = targ->s.origin[2] + 20;
// jump animation lifts
if (!targ->groundentity)
o[2] += 16;
trace = gi.trace(ownerv, vec3_origin, vec3_origin, o, targ, MASK_SOLID);
VectorCopy(trace.endpos, goal);
VectorMA(goal, 2, forward, goal);
// pad for floors and ceilings
VectorCopy(goal, o);
o[2] += 6;
trace = gi.trace(goal, vec3_origin, vec3_origin, o, targ, MASK_SOLID);
if (trace.fraction < 1) {
VectorCopy(trace.endpos, goal);
goal[2] -= 6;
}
VectorCopy(goal, o);
o[2] -= 6;
trace = gi.trace(goal, vec3_origin, vec3_origin, o, targ, MASK_SOLID);
if (trace.fraction < 1) {
VectorCopy(trace.endpos, goal);
goal[2] += 6;
}
if (targ->deadflag)
ent->client->ps.pmove.pm_type = PM_DEAD;
else
ent->client->ps.pmove.pm_type = PM_FREEZE;
VectorCopy(goal, ent->s.origin);
for (i=0 ; i<3 ; i++)
ent->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(targ->client->v_angle[i] - ent->client->resp.cmd_angles[i]);
if (targ->deadflag) {
ent->client->ps.viewangles[ROLL] = 40;
ent->client->ps.viewangles[PITCH] = -15;
ent->client->ps.viewangles[YAW] = targ->client->killer_yaw;
} else {
VectorCopy(targ->client->v_angle, ent->client->ps.viewangles);
VectorCopy(targ->client->v_angle, ent->client->v_angle);
}
ent->viewheight = 0;
ent->client->ps.pmove.pm_flags |= PMF_NO_PREDICTION;
gi.linkentity(ent);
}
void ChaseNext(edict_t *ent)
{
int i;
edict_t *e;
if (!ent->client->chase_target)
return;
i = ent->client->chase_target - g_edicts;
do {
i++;
if (i > maxclients->value)
i = 1;
e = g_edicts + i;
if (!e->inuse)
continue;
if (!e->client->resp.spectator)
break;
} while (e != ent->client->chase_target);
ent->client->chase_target = e;
ent->client->update_chase = true;
}
void ChasePrev(edict_t *ent)
{
int i;
edict_t *e;
if (!ent->client->chase_target)
return;
i = ent->client->chase_target - g_edicts;
do {
i--;
if (i < 1)
i = maxclients->value;
e = g_edicts + i;
if (!e->inuse)
continue;
if (!e->client->resp.spectator)
break;
} while (e != ent->client->chase_target);
ent->client->chase_target = e;
ent->client->update_chase = true;
}
void GetChaseTarget(edict_t *ent)
{
int i;
edict_t *other;
for (i = 1; i <= maxclients->value; i++) {
other = g_edicts + i;
if (other->inuse && !other->client->resp.spectator) {
ent->client->chase_target = other;
ent->client->update_chase = true;
UpdateChaseCam(ent);
return;
}
}
gi.centerprintf(ent, "No other players to chase.");
}

File diff suppressed because it is too large Load Diff

View File

@ -1,229 +0,0 @@
#include "g_local.h"
#ifdef JETPACK_MOD
/*we get silly velocity-effects when we are on ground and try to
accelerate, so lift us a little bit if possible*/
bool Jet_AvoidGround( edict_t *ent )
{
vec3_t new_origin;
trace_t trace;
bool success;
/*Check if there is enough room above us before we change origin[2]*/
new_origin[0] = ent->s.origin[0];
new_origin[1] = ent->s.origin[1];
new_origin[2] = ent->s.origin[2] + 0.5;
trace = gi.trace( ent->s.origin, ent->mins, ent->maxs, new_origin, ent, MASK_PLAYERSOLID );
if ( success=(trace.plane.normal[2]==0) )
/*no ceiling?*/
ent->s.origin[2] += 0.5;
/*then make sure off ground*/
return success;
}
/*If a player dies with activated jetpack this function will be called
and produces a little explosion*/
void Jet_BecomeExplosion( edict_t *ent, int damage )
{
MESSAGE_BEGIN( svc_temp_entity );
WRITE_BYTE( TE_EXPLOSION1 ); // TE_EXPLOSION2 is possible too
WRITE_COORD( ent->s.origin );
MESSAGE_SEND( MSG_PVS, ent->s.origin, NULL );
gi.sound( ent, CHAN_BODY, gi.soundindex("misc/udeath.wav"), 1, ATTN_NORM, 0 );
if (level.num_reflectors)
ReflectExplosion (TE_EXPLOSION1, ent->s.origin);
// Lazarus: NO! This is taken care of already in player_die
/*throw some gib*/
/* for ( n=0; n<4; n++ )
ThrowGib( ent, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC );
ThrowClientHead( ent, damage ); */
ent->takedamage = DAMAGE_NO;
}
/*The lifting effect is done through changing the origin, it
gives the best results. Of course its a little dangerous because
if we dont take care, we can move into solid*/
void Jet_ApplyLifting( edict_t *ent )
{
float delta;
vec3_t new_origin;
trace_t trace;
int time = 24;
/*must be >0, time/10 = time in sec for a complete cycle (up/down)*/
float amplitude = 2.0;
/*calculate the z-distance to lift in this step*/
delta = sin( (float)((level.framenum%time)*(360/time))/180*M_PI ) * amplitude;
delta = (float)((int)(delta*8))/8; /*round to multiples of 0.125*/
VectorCopy( ent->s.origin, new_origin );
new_origin[2] += delta;
if( VectorLength(ent->velocity) == 0 )
{
/*i dont know the reason yet, but there is some floating so we
have to compensate that here (only if there is no velocity left)*/
new_origin[0] -= 0.125;
new_origin[1] -= 0.125;
new_origin[2] -= 0.125;
}
/*before we change origin, its important to check that we dont go
into solid*/
trace = gi.trace( ent->s.origin, ent->mins, ent->maxs, new_origin, ent, MASK_MONSTERSOLID );
if ( trace.plane.normal[2] == 0 )
VectorCopy( new_origin, ent->s.origin );
}
/*This function applys some sparks to your jetpack*/
void Jet_ApplySparks ( edict_t *ent )
{
vec3_t forward, right;
vec3_t pack_pos, jet_vector;
AngleVectors(ent->client->v_angle, forward, right, NULL);
VectorScale (forward, -8, pack_pos);
VectorAdd (pack_pos, ent->s.origin, pack_pos);
pack_pos[2] += 6;
VectorScale (forward, -50, jet_vector);
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (TE_SPARKS);
WRITE_COORD (pack_pos);
WRITE_DIR (jet_vector);
MESSAGE_SEND (MSG_PVS, pack_pos, NULL);
if(level.num_reflectors)
ReflectSparks(TE_SPARKS,pack_pos,jet_vector);
}
/*Now for the main movement code. The steering is a lot like in water, that
means your viewing direction is your moving direction. You have three
direction Boosters: the big Main Booster and the smaller up-down and
left-right Boosters.
There are only 2 adds to the code of the first tutorial: the jetpack_nextthink
and the rolling.
The other modifications results in the use of the built-in quake functions,
there is no change in moving behavior (reinventing the wheel is a lot of
"fun" and a BIG waste of time ;-))*/
void Jet_ApplyJet( edict_t *ent, usercmd_t *ucmd )
{
float direction;
float scale;
vec3_t acc;
vec3_t forward, right;
/*clear gravity so we dont have to compensate it with the Boosters*/
ent->client->ps.pmove.gravity = 0;
/*calculate the direction vectors dependent on viewing direction
(length of the vectors forward/right is always 1, the coordinates of
the vectors are values of how much youre looking in a specific direction
[if youre looking up to the top, the x/y values are nearly 0 the
z value is nearly 1])*/
AngleVectors( ent->client->v_angle, forward, right, NULL );
/*Run jet only 10 times a second so movement doesn't depend on fps
because ClientThink is called as often as possible
(fps<10 still is a problem ?)*/
if ( ent->client->jetpack_nextthink <= level.framenum )
{
ent->client->jetpack_nextthink = level.framenum + 1;
/*clear acceleration-vector*/
VectorClear( acc );
/*if we are moving forward or backward add MainBooster acceleration
(60)*/
if ( ucmd->forwardmove )
{
/*are we accelerating backward or forward?*/
direction = (ucmd->forwardmove<0) ? -1.0 : 1.0;
/*add the acceleration for each direction*/
if(jetpack_weenie->value)
{
acc[0] += forward[0] * direction * 60;
acc[1] += forward[1] * direction * 60;
acc[2] += forward[2] * direction * 60;
}
else
{
acc[0] += forward[0] * direction * 120;
acc[1] += forward[1] * direction * 120;
}
}
/*if we sidestep add Left-Right-Booster acceleration (40)*/
if ( ucmd->sidemove )
{ /*are we accelerating left or right*/
direction = (ucmd->sidemove<0) ? -1.0 : 1.0;
/*add only to x and y acceleration*/
if(jetpack_weenie->value)
scale = direction * 40;
else
scale = direction * 80;
acc[0] += right[0] * scale;
acc[1] += right[1] * scale;
}
/*if we crouch or jump add Up-Down-Booster acceleration (30)*/
if ( ucmd->upmove )
{
if(jetpack_weenie->value)
scale = 30;
else
scale = 45;
acc[2] += ucmd->upmove > 0 ? scale : -scale;
}
/*now apply some friction dependent on velocity (higher velocity results
in higher friction), without acceleration this will reduce the velocity
to 0 in a few steps*/
ent->velocity[0] *= 0.83;
ent->velocity[1] *= 0.83;
ent->velocity[2] *= 0.86;
/*then accelerate with the calculated values. If the new acceleration for
a direction is smaller than an earlier, the friction will reduce the speed
in that direction to the new value in a few steps, so if youre flying
curves or around corners youre floating a little bit in the old direction*/
VectorAdd( ent->velocity, acc, ent->velocity );
/*round velocitys (is this necessary?)*/
ent->velocity[0] = (float)((int)(ent->velocity[0]*8))/8;
ent->velocity[1] = (float)((int)(ent->velocity[1]*8))/8;
ent->velocity[2] = (float)((int)(ent->velocity[2]*8))/8;
/*Bound X and Y velocity so that friction and acceleration dont need to be
synced on maxvelocitys*/
if(jetpack_weenie->value)
{
if(ent->velocity[0] > 300) ent->velocity[0] = 300;
if(ent->velocity[0] < -300) ent->velocity[0] = -300;
if(ent->velocity[1] > 300) ent->velocity[1] = 300;
if(ent->velocity[1] < -300) ent->velocity[1] = -300;
}
else
{
if(ent->velocity[0] > 1000) ent->velocity[0] = 1000;
if(ent->velocity[0] < -1000) ent->velocity[0] = -1000;
if(ent->velocity[1] > 1000) ent->velocity[1] = 1000;
if(ent->velocity[1] < -1000) ent->velocity[1] = -1000;
}
/*add some gentle up and down when idle (not accelerating)*/
if( (VectorLength(acc) == 0) && (!ent->groundentity))
Jet_ApplyLifting( ent );
} //if ( ent->client->jetpack_nextthink...
/*add rolling when we fly curves or boost left/right*/
if((bob_roll->value > 0) && (jetpack_weenie->value || !ent->groundentity))
{
ent->client->kick_angles[ROLL] = -DotProduct( ent->velocity, right ) * ent->client->jetpack_roll;
if(ucmd->sidemove)
ent->client->jetpack_roll = min(0.02,ent->client->jetpack_roll + 0.002);
else
ent->client->jetpack_roll = max(0.00,ent->client->jetpack_roll - 0.002);
}
else
ent->client->jetpack_roll = 0;
/*last but not least add some smoke*/
Jet_ApplySparks( ent );
// gi.dprintf("%5g %5g %5g\n",ent->velocity[0],ent->velocity[1],ent->velocity[2]);
}
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,469 +0,0 @@
// m_flash.c
#include "g_local.h"
// this file is included in both the game dll and quake2,
// the game needs it to source shot locations, the client
// needs it to position muzzle flashes
vec3_t monster_flash_offset [] =
{
// flash 0 is not used
0.0, 0.0, 0.0,
// MZ2_TANK_BLASTER_1 1
20.7, -18.5, 28.7,
// MZ2_TANK_BLASTER_2 2
16.6, -21.5, 30.1,
// MZ2_TANK_BLASTER_3 3
11.8, -23.9, 32.1,
// MZ2_TANK_MACHINEGUN_1 4
22.9, -0.7, 25.3,
// MZ2_TANK_MACHINEGUN_2 5
22.2, 6.2, 22.3,
// MZ2_TANK_MACHINEGUN_3 6
19.4, 13.1, 18.6,
// MZ2_TANK_MACHINEGUN_4 7
19.4, 18.8, 18.6,
// MZ2_TANK_MACHINEGUN_5 8
17.9, 25.0, 18.6,
// MZ2_TANK_MACHINEGUN_6 9
14.1, 30.5, 20.6,
// MZ2_TANK_MACHINEGUN_7 10
9.3, 35.3, 22.1,
// MZ2_TANK_MACHINEGUN_8 11
4.7, 38.4, 22.1,
// MZ2_TANK_MACHINEGUN_9 12
-1.1, 40.4, 24.1,
// MZ2_TANK_MACHINEGUN_10 13
-6.5, 41.2, 24.1,
// MZ2_TANK_MACHINEGUN_11 14
3.2, 40.1, 24.7,
// MZ2_TANK_MACHINEGUN_12 15
11.7, 36.7, 26.0,
// MZ2_TANK_MACHINEGUN_13 16
18.9, 31.3, 26.0,
// MZ2_TANK_MACHINEGUN_14 17
24.4, 24.4, 26.4,
// MZ2_TANK_MACHINEGUN_15 18
27.1, 17.1, 27.2,
// MZ2_TANK_MACHINEGUN_16 19
28.5, 9.1, 28.0,
// MZ2_TANK_MACHINEGUN_17 20
27.1, 2.2, 28.0,
// MZ2_TANK_MACHINEGUN_18 21
24.9, -2.8, 28.0,
// MZ2_TANK_MACHINEGUN_19 22
21.6, -7.0, 26.4,
// MZ2_TANK_ROCKET_1 23
6.2, 29.1, 49.1,
// MZ2_TANK_ROCKET_2 24
6.9, 23.8, 49.1,
// MZ2_TANK_ROCKET_3 25
8.3, 17.8, 49.5,
// MZ2_INFANTRY_MACHINEGUN_1 26
26.6, 7.1, 13.1,
// MZ2_INFANTRY_MACHINEGUN_2 27
18.2, 7.5, 15.4,
// MZ2_INFANTRY_MACHINEGUN_3 28
17.2, 10.3, 17.9,
// MZ2_INFANTRY_MACHINEGUN_4 29
17.0, 12.8, 20.1,
// MZ2_INFANTRY_MACHINEGUN_5 30
15.1, 14.1, 21.8,
// MZ2_INFANTRY_MACHINEGUN_6 31
11.8, 17.2, 23.1,
// MZ2_INFANTRY_MACHINEGUN_7 32
11.4, 20.2, 21.0,
// MZ2_INFANTRY_MACHINEGUN_8 33
9.0, 23.0, 18.9,
// MZ2_INFANTRY_MACHINEGUN_9 34
13.9, 18.6, 17.7,
// MZ2_INFANTRY_MACHINEGUN_10 35
15.4, 15.6, 15.8,
// MZ2_INFANTRY_MACHINEGUN_11 36
10.2, 15.2, 25.1,
// MZ2_INFANTRY_MACHINEGUN_12 37
-1.9, 15.1, 28.2,
// MZ2_INFANTRY_MACHINEGUN_13 38
-12.4, 13.0, 20.2,
// MZ2_SOLDIER_BLASTER_1 39
10.6 * 1.2, 7.7 * 1.2, 7.8 * 1.2,
// MZ2_SOLDIER_BLASTER_2 40
21.1 * 1.2, 3.6 * 1.2, 19.0 * 1.2,
// MZ2_SOLDIER_SHOTGUN_1 41
10.6 * 1.2, 7.7 * 1.2, 7.8 * 1.2,
// MZ2_SOLDIER_SHOTGUN_2 42
21.1 * 1.2, 3.6 * 1.2, 19.0 * 1.2,
// MZ2_SOLDIER_MACHINEGUN_1 43
10.6 * 1.2, 7.7 * 1.2, 7.8 * 1.2,
// MZ2_SOLDIER_MACHINEGUN_2 44
21.1 * 1.2, 3.6 * 1.2, 19.0 * 1.2,
// MZ2_GUNNER_MACHINEGUN_1 45
30.1 * 1.15, 3.9 * 1.15, 19.6 * 1.15,
// MZ2_GUNNER_MACHINEGUN_2 46
29.1 * 1.15, 2.5 * 1.15, 20.7 * 1.15,
// MZ2_GUNNER_MACHINEGUN_3 47
28.2 * 1.15, 2.5 * 1.15, 22.2 * 1.15,
// MZ2_GUNNER_MACHINEGUN_4 48
28.2 * 1.15, 3.6 * 1.15, 22.0 * 1.15,
// MZ2_GUNNER_MACHINEGUN_5 49
26.9 * 1.15, 2.0 * 1.15, 23.4 * 1.15,
// MZ2_GUNNER_MACHINEGUN_6 50
26.5 * 1.15, 0.6 * 1.15, 20.8 * 1.15,
// MZ2_GUNNER_MACHINEGUN_7 51
26.9 * 1.15, 0.5 * 1.15, 21.5 * 1.15,
// MZ2_GUNNER_MACHINEGUN_8 52
29.0 * 1.15, 2.4 * 1.15, 19.5 * 1.15,
// MZ2_GUNNER_GRENADE_1 53
4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15,
// MZ2_GUNNER_GRENADE_2 54
4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15,
// MZ2_GUNNER_GRENADE_3 55
4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15,
// MZ2_GUNNER_GRENADE_4 56
4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15,
// MZ2_CHICK_ROCKET_1 57
// -24.8, -9.0, 39.0,
24.8, -9.0, 39.0, // PGM - this was incorrect in Q2
// MZ2_FLYER_BLASTER_1 58
12.1, 13.4, -14.5,
// MZ2_FLYER_BLASTER_2 59
12.1, -7.4, -14.5,
// MZ2_MEDIC_BLASTER_1 60
12.1, 5.4, 16.5,
// MZ2_GLADIATOR_RAILGUN_1 61
30.0, 18.0, 28.0,
// MZ2_HOVER_BLASTER_1 62
32.5, -0.8, 10.0,
// MZ2_ACTOR_MACHINEGUN_1 63
18.4, 7.4, 9.6,
// MZ2_SUPERTANK_MACHINEGUN_1 64
30.0, 30.0, 88.5,
// MZ2_SUPERTANK_MACHINEGUN_2 65
30.0, 30.0, 88.5,
// MZ2_SUPERTANK_MACHINEGUN_3 66
30.0, 30.0, 88.5,
// MZ2_SUPERTANK_MACHINEGUN_4 67
30.0, 30.0, 88.5,
// MZ2_SUPERTANK_MACHINEGUN_5 68
30.0, 30.0, 88.5,
// MZ2_SUPERTANK_MACHINEGUN_6 69
30.0, 30.0, 88.5,
// MZ2_SUPERTANK_ROCKET_1 70
16.0, -22.5, 91.2,
// MZ2_SUPERTANK_ROCKET_2 71
16.0, -33.4, 86.7,
// MZ2_SUPERTANK_ROCKET_3 72
16.0, -42.8, 83.3,
// --- Start Xian Stuff ---
// MZ2_BOSS2_MACHINEGUN_L1 73
32, -40, 70,
// MZ2_BOSS2_MACHINEGUN_L2 74
32, -40, 70,
// MZ2_BOSS2_MACHINEGUN_L3 75
32, -40, 70,
// MZ2_BOSS2_MACHINEGUN_L4 76
32, -40, 70,
// MZ2_BOSS2_MACHINEGUN_L5 77
32, -40, 70,
// --- End Xian Stuff
// MZ2_BOSS2_ROCKET_1 78
22.0, 16.0, 10.0,
// MZ2_BOSS2_ROCKET_2 79
22.0, 8.0, 10.0,
// MZ2_BOSS2_ROCKET_3 80
22.0, -8.0, 10.0,
// MZ2_BOSS2_ROCKET_4 81
22.0, -16.0, 10.0,
// MZ2_FLOAT_BLASTER_1 82
32.5, -0.8, 10,
// MZ2_SOLDIER_BLASTER_3 83
20.8 * 1.2, 10.1 * 1.2, -2.7 * 1.2,
// MZ2_SOLDIER_SHOTGUN_3 84
20.8 * 1.2, 10.1 * 1.2, -2.7 * 1.2,
// MZ2_SOLDIER_MACHINEGUN_3 85
20.8 * 1.2, 10.1 * 1.2, -2.7 * 1.2,
// MZ2_SOLDIER_BLASTER_4 86
7.6 * 1.2, 9.3 * 1.2, 0.8 * 1.2,
// MZ2_SOLDIER_SHOTGUN_4 87
7.6 * 1.2, 9.3 * 1.2, 0.8 * 1.2,
// MZ2_SOLDIER_MACHINEGUN_4 88
7.6 * 1.2, 9.3 * 1.2, 0.8 * 1.2,
// MZ2_SOLDIER_BLASTER_5 89
30.5 * 1.2, 9.9 * 1.2, -18.7 * 1.2,
// MZ2_SOLDIER_SHOTGUN_5 90
30.5 * 1.2, 9.9 * 1.2, -18.7 * 1.2,
// MZ2_SOLDIER_MACHINEGUN_5 91
30.5 * 1.2, 9.9 * 1.2, -18.7 * 1.2,
// MZ2_SOLDIER_BLASTER_6 92
27.6 * 1.2, 3.4 * 1.2, -10.4 * 1.2,
// MZ2_SOLDIER_SHOTGUN_6 93
27.6 * 1.2, 3.4 * 1.2, -10.4 * 1.2,
// MZ2_SOLDIER_MACHINEGUN_6 94
27.6 * 1.2, 3.4 * 1.2, -10.4 * 1.2,
// MZ2_SOLDIER_BLASTER_7 95
28.9 * 1.2, 4.6 * 1.2, -8.1 * 1.2,
// MZ2_SOLDIER_SHOTGUN_7 96
28.9 * 1.2, 4.6 * 1.2, -8.1 * 1.2,
// MZ2_SOLDIER_MACHINEGUN_7 97
28.9 * 1.2, 4.6 * 1.2, -8.1 * 1.2,
// MZ2_SOLDIER_BLASTER_8 98
// 34.5 * 1.2, 9.6 * 1.2, 6.1 * 1.2,
31.5 * 1.2, 9.6 * 1.2, 10.1 * 1.2,
// MZ2_SOLDIER_SHOTGUN_8 99
34.5 * 1.2, 9.6 * 1.2, 6.1 * 1.2,
// MZ2_SOLDIER_MACHINEGUN_8 100
34.5 * 1.2, 9.6 * 1.2, 6.1 * 1.2,
// --- Xian shit below ---
// MZ2_MAKRON_BFG 101
17, -19.5, 62.9,
// MZ2_MAKRON_BLASTER_1 102
-3.6, -24.1, 59.5,
// MZ2_MAKRON_BLASTER_2 103
-1.6, -19.3, 59.5,
// MZ2_MAKRON_BLASTER_3 104
-0.1, -14.4, 59.5,
// MZ2_MAKRON_BLASTER_4 105
2.0, -7.6, 59.5,
// MZ2_MAKRON_BLASTER_5 106
3.4, 1.3, 59.5,
// MZ2_MAKRON_BLASTER_6 107
3.7, 11.1, 59.5,
// MZ2_MAKRON_BLASTER_7 108
-0.3, 22.3, 59.5,
// MZ2_MAKRON_BLASTER_8 109
-6, 33, 59.5,
// MZ2_MAKRON_BLASTER_9 110
-9.3, 36.4, 59.5,
// MZ2_MAKRON_BLASTER_10 111
-7, 35, 59.5,
// MZ2_MAKRON_BLASTER_11 112
-2.1, 29, 59.5,
// MZ2_MAKRON_BLASTER_12 113
3.9, 17.3, 59.5,
// MZ2_MAKRON_BLASTER_13 114
6.1, 5.8, 59.5,
// MZ2_MAKRON_BLASTER_14 115
5.9, -4.4, 59.5,
// MZ2_MAKRON_BLASTER_15 116
4.2, -14.1, 59.5,
// MZ2_MAKRON_BLASTER_16 117
2.4, -18.8, 59.5,
// MZ2_MAKRON_BLASTER_17 118
-1.8, -25.5, 59.5,
// MZ2_MAKRON_RAILGUN_1 119
-17.3, 7.8, 72.4,
// MZ2_JORG_MACHINEGUN_L1 120
78.5, -47.1, 96,
// MZ2_JORG_MACHINEGUN_L2 121
78.5, -47.1, 96,
// MZ2_JORG_MACHINEGUN_L3 122
78.5, -47.1, 96,
// MZ2_JORG_MACHINEGUN_L4 123
78.5, -47.1, 96,
// MZ2_JORG_MACHINEGUN_L5 124
78.5, -47.1, 96,
// MZ2_JORG_MACHINEGUN_L6 125
78.5, -47.1, 96,
// MZ2_JORG_MACHINEGUN_R1 126
78.5, 46.7, 96,
// MZ2_JORG_MACHINEGUN_R2 127
78.5, 46.7, 96,
// MZ2_JORG_MACHINEGUN_R3 128
78.5, 46.7, 96,
// MZ2_JORG_MACHINEGUN_R4 129
78.5, 46.7, 96,
// MZ2_JORG_MACHINEGUN_R5 130
78.5, 46.7, 96,
// MZ2_JORG_MACHINEGUN_R6 131
78.5, 46.7, 96,
// MZ2_JORG_BFG_1 132
6.3, -9, 111.2,
// MZ2_BOSS2_MACHINEGUN_R1 73
32, 40, 70,
// MZ2_BOSS2_MACHINEGUN_R2 74
32, 40, 70,
// MZ2_BOSS2_MACHINEGUN_R3 75
32, 40, 70,
// MZ2_BOSS2_MACHINEGUN_R4 76
32, 40, 70,
// MZ2_BOSS2_MACHINEGUN_R5 77
32, 40, 70,
// --- End Xian Shit ---
// ROGUE
// note that the above really ends at 137
// carrier machineguns
// MZ2_CARRIER_MACHINEGUN_L1
56, -32, 32,
// MZ2_CARRIER_MACHINEGUN_R1
56, 32, 32,
// MZ2_CARRIER_GRENADE
42, 24, 50,
// MZ2_TURRET_MACHINEGUN 141
16, 0, 0,
// MZ2_TURRET_ROCKET 142
16, 0, 0,
// MZ2_TURRET_BLASTER 143
16, 0, 0,
// MZ2_STALKER_BLASTER 144
24, 0, 6,
// MZ2_DAEDALUS_BLASTER 145
32.5, -0.8, 10.0,
// MZ2_MEDIC_BLASTER_2 146
12.1, 5.4, 16.5,
// MZ2_CARRIER_RAILGUN 147
32, 0, 6,
// MZ2_WIDOW_DISRUPTOR 148
57.72, 14.50, 88.81,
// MZ2_WIDOW_BLASTER 149
56, 32, 32,
// MZ2_WIDOW_RAIL 150
62, -20, 84,
// MZ2_WIDOW_PLASMABEAM 151 // PMM - not used!
32, 0, 6,
// MZ2_CARRIER_MACHINEGUN_L2 152
61, -32, 12,
// MZ2_CARRIER_MACHINEGUN_R2 153
61, 32, 12,
// MZ2_WIDOW_RAIL_LEFT 154
17, -62, 91,
// MZ2_WIDOW_RAIL_RIGHT 155
68, 12, 86,
// MZ2_WIDOW_BLASTER_SWEEP1 156 pmm - the sweeps need to be in sequential order
47.5, 56, 89,
// MZ2_WIDOW_BLASTER_SWEEP2 157
54, 52, 91,
// MZ2_WIDOW_BLASTER_SWEEP3 158
58, 40, 91,
// MZ2_WIDOW_BLASTER_SWEEP4 159
68, 30, 88,
// MZ2_WIDOW_BLASTER_SWEEP5 160
74, 20, 88,
// MZ2_WIDOW_BLASTER_SWEEP6 161
73, 11, 87,
// MZ2_WIDOW_BLASTER_SWEEP7 162
73, 3, 87,
// MZ2_WIDOW_BLASTER_SWEEP8 163
70, -12, 87,
// MZ2_WIDOW_BLASTER_SWEEP9 164
67, -20, 90,
// MZ2_WIDOW_BLASTER_100 165
-20, 76, 90,
// MZ2_WIDOW_BLASTER_90 166
-8, 74, 90,
// MZ2_WIDOW_BLASTER_80 167
0, 72, 90,
// MZ2_WIDOW_BLASTER_70 168 d06
10, 71, 89,
// MZ2_WIDOW_BLASTER_60 169 d07
23, 70, 87,
// MZ2_WIDOW_BLASTER_50 170 d08
32, 64, 85,
// MZ2_WIDOW_BLASTER_40 171
40, 58, 84,
// MZ2_WIDOW_BLASTER_30 172 d10
48, 50, 83,
// MZ2_WIDOW_BLASTER_20 173
54, 42, 82,
// MZ2_WIDOW_BLASTER_10 174 d12
56, 34, 82,
// MZ2_WIDOW_BLASTER_0 175
58, 26, 82,
// MZ2_WIDOW_BLASTER_10L 176 d14
60, 16, 82,
// MZ2_WIDOW_BLASTER_20L 177
59, 6, 81,
// MZ2_WIDOW_BLASTER_30L 178 d16
58, -2, 80,
// MZ2_WIDOW_BLASTER_40L 179
57, -10, 79,
// MZ2_WIDOW_BLASTER_50L 180 d18
54, -18, 78,
// MZ2_WIDOW_BLASTER_60L 181
42, -32, 80,
// MZ2_WIDOW_BLASTER_70L 182 d20
36, -40, 78,
// MZ2_WIDOW_RUN_1 183
68.4, 10.88, 82.08,
// MZ2_WIDOW_RUN_2 184
68.51, 8.64, 85.14,
// MZ2_WIDOW_RUN_3 185
68.66, 6.38, 88.78,
// MZ2_WIDOW_RUN_4 186
68.73, 5.1, 84.47,
// MZ2_WIDOW_RUN_5 187
68.82, 4.79, 80.52,
// MZ2_WIDOW_RUN_6 188
68.77, 6.11, 85.37,
// MZ2_WIDOW_RUN_7 189
68.67, 7.99, 90.24,
// MZ2_WIDOW_RUN_8 190
68.55, 9.54, 87.36,
// MZ2_CARRIER_ROCKET_1 191
0, 0, -5,
// MZ2_CARRIER_ROCKET_2 192
0, 0, -5,
// MZ2_CARRIER_ROCKET_3 193
0, 0, -5,
// MZ2_CARRIER_ROCKET_4 194
0, 0, -5,
// MZ2_WIDOW2_BEAMER_1 195
// 72.13, -17.63, 93.77,
69.00, -17.63, 93.77,
// MZ2_WIDOW2_BEAMER_2 196
// 71.46, -17.08, 89.82,
69.00, -17.08, 89.82,
// MZ2_WIDOW2_BEAMER_3 197
// 71.47, -18.40, 90.70,
69.00, -18.40, 90.70,
// MZ2_WIDOW2_BEAMER_4 198
// 71.96, -18.34, 94.32,
69.00, -18.34, 94.32,
// MZ2_WIDOW2_BEAMER_5 199
// 72.25, -18.30, 97.98,
69.00, -18.30, 97.98,
// MZ2_WIDOW2_BEAM_SWEEP_1 200
45.04, -59.02, 92.24,
// MZ2_WIDOW2_BEAM_SWEEP_2 201
50.68, -54.70, 91.96,
// MZ2_WIDOW2_BEAM_SWEEP_3 202
56.57, -47.72, 91.65,
// MZ2_WIDOW2_BEAM_SWEEP_4 203
61.75, -38.75, 91.38,
// MZ2_WIDOW2_BEAM_SWEEP_5 204
65.55, -28.76, 91.24,
// MZ2_WIDOW2_BEAM_SWEEP_6 205
67.79, -18.90, 91.22,
// MZ2_WIDOW2_BEAM_SWEEP_7 206
68.60, -9.52, 91.23,
// MZ2_WIDOW2_BEAM_SWEEP_8 207
68.08, 0.18, 91.32,
// MZ2_WIDOW2_BEAM_SWEEP_9 208
66.14, 9.79, 91.44,
// MZ2_WIDOW2_BEAM_SWEEP_10 209
62.77, 18.91, 91.65,
// MZ2_WIDOW2_BEAM_SWEEP_11 210
58.29, 27.11, 92.00,
// end of table
0.0, 0.0, 0.0
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,234 +0,0 @@
//ed - weapon protos
void actorBlaster (edict_t *self);
void actorShotgun (edict_t *self);
void actorSuperShotgun (edict_t *self);
void actorMachineGun (edict_t *self);
void actorChaingun (edict_t *self);
void actorGrenadeLauncher (edict_t *self);
void actorRocket (edict_t *self);
void actorHyperblaster (edict_t *self);
void actorRailGun (edict_t *self);
void actorBFG (edict_t *self);
// Generated by ModelEd
#define FRAME_stand01 0
#define FRAME_stand02 1
#define FRAME_stand03 2
#define FRAME_stand04 3
#define FRAME_stand05 4
#define FRAME_stand06 5
#define FRAME_stand07 6
#define FRAME_stand08 7
#define FRAME_stand09 8
#define FRAME_stand10 9
#define FRAME_stand11 10
#define FRAME_stand12 11
#define FRAME_stand13 12
#define FRAME_stand14 13
#define FRAME_stand15 14
#define FRAME_stand16 15
#define FRAME_stand17 16
#define FRAME_stand18 17
#define FRAME_stand19 18
#define FRAME_stand20 19
#define FRAME_stand21 20
#define FRAME_stand22 21
#define FRAME_stand23 22
#define FRAME_stand24 23
#define FRAME_stand25 24
#define FRAME_stand26 25
#define FRAME_stand27 26
#define FRAME_stand28 27
#define FRAME_stand29 28
#define FRAME_stand30 29
#define FRAME_stand31 30
#define FRAME_stand32 31
#define FRAME_stand33 32
#define FRAME_stand34 33
#define FRAME_stand35 34
#define FRAME_stand36 35
#define FRAME_stand37 36
#define FRAME_stand38 37
#define FRAME_stand39 38
#define FRAME_stand40 39
#define FRAME_run1 40
#define FRAME_run2 41
#define FRAME_run3 42
#define FRAME_run4 43
#define FRAME_run5 44
#define FRAME_run6 45
#define FRAME_attack1 46
#define FRAME_attack2 47
#define FRAME_attack3 48
#define FRAME_attack4 49
#define FRAME_attack5 50
#define FRAME_attack6 51
#define FRAME_attack7 52
#define FRAME_attack8 53
#define FRAME_pain101 54
#define FRAME_pain102 55
#define FRAME_pain103 56
#define FRAME_pain104 57
#define FRAME_pain201 58
#define FRAME_pain202 59
#define FRAME_pain203 60
#define FRAME_pain204 61
#define FRAME_pain301 62
#define FRAME_pain302 63
#define FRAME_pain303 64
#define FRAME_pain304 65
#define FRAME_jump1 66
#define FRAME_jump2 67
#define FRAME_jump3 68
#define FRAME_jump4 69
#define FRAME_jump5 70
#define FRAME_jump6 71
#define FRAME_flip01 72
#define FRAME_flip02 73
#define FRAME_flip03 74
#define FRAME_flip04 75
#define FRAME_flip05 76
#define FRAME_flip06 77
#define FRAME_flip07 78
#define FRAME_flip08 79
#define FRAME_flip09 80
#define FRAME_flip10 81
#define FRAME_flip11 82
#define FRAME_flip12 83
#define FRAME_salute01 84
#define FRAME_salute02 85
#define FRAME_salute03 86
#define FRAME_salute04 87
#define FRAME_salute05 88
#define FRAME_salute06 89
#define FRAME_salute07 90
#define FRAME_salute08 91
#define FRAME_salute09 92
#define FRAME_salute10 93
#define FRAME_salute11 94
#define FRAME_taunt01 95
#define FRAME_taunt02 96
#define FRAME_taunt03 97
#define FRAME_taunt04 98
#define FRAME_taunt05 99
#define FRAME_taunt06 100
#define FRAME_taunt07 101
#define FRAME_taunt08 102
#define FRAME_taunt09 103
#define FRAME_taunt10 104
#define FRAME_taunt11 105
#define FRAME_taunt12 106
#define FRAME_taunt13 107
#define FRAME_taunt14 108
#define FRAME_taunt15 109
#define FRAME_taunt16 110
#define FRAME_taunt17 111
#define FRAME_wave01 112
#define FRAME_wave02 113
#define FRAME_wave03 114
#define FRAME_wave04 115
#define FRAME_wave05 116
#define FRAME_wave06 117
#define FRAME_wave07 118
#define FRAME_wave08 119
#define FRAME_wave09 120
#define FRAME_wave10 121
#define FRAME_wave11 122
#define FRAME_point01 123
#define FRAME_point02 124
#define FRAME_point03 125
#define FRAME_point04 126
#define FRAME_point05 127
#define FRAME_point06 128
#define FRAME_point07 129
#define FRAME_point08 130
#define FRAME_point09 131
#define FRAME_point10 132
#define FRAME_point11 133
#define FRAME_point12 134
#define FRAME_crstnd01 135
#define FRAME_crstnd02 136
#define FRAME_crstnd03 137
#define FRAME_crstnd04 138
#define FRAME_crstnd05 139
#define FRAME_crstnd06 140
#define FRAME_crstnd07 141
#define FRAME_crstnd08 142
#define FRAME_crstnd09 143
#define FRAME_crstnd10 144
#define FRAME_crstnd11 145
#define FRAME_crstnd12 146
#define FRAME_crstnd13 147
#define FRAME_crstnd14 148
#define FRAME_crstnd15 149
#define FRAME_crstnd16 150
#define FRAME_crstnd17 151
#define FRAME_crstnd18 152
#define FRAME_crstnd19 153
#define FRAME_crwalk1 154
#define FRAME_crwalk2 155
#define FRAME_crwalk3 156
#define FRAME_crwalk4 157
#define FRAME_crwalk5 158
#define FRAME_crwalk6 159
#define FRAME_crattak1 160
#define FRAME_crattak2 161
#define FRAME_crattak3 162
#define FRAME_crattak4 163
#define FRAME_crattak5 164
#define FRAME_crattak6 165
#define FRAME_crattak7 166
#define FRAME_crattak8 167
#define FRAME_crattak9 168
#define FRAME_crpain1 169
#define FRAME_crpain2 170
#define FRAME_crpain3 171
#define FRAME_crpain4 172
#define FRAME_crdeath1 173
#define FRAME_crdeath2 174
#define FRAME_crdeath3 175
#define FRAME_crdeath4 176
#define FRAME_crdeath5 177
#define FRAME_death101 178
#define FRAME_death102 179
#define FRAME_death103 180
#define FRAME_death104 181
#define FRAME_death105 182
#define FRAME_death106 183
#define FRAME_death201 184
#define FRAME_death202 185
#define FRAME_death203 186
#define FRAME_death204 187
#define FRAME_death205 188
#define FRAME_death206 189
#define FRAME_death301 190
#define FRAME_death302 191
#define FRAME_death303 192
#define FRAME_death304 193
#define FRAME_death305 194
#define FRAME_death306 195
#define FRAME_death307 196
#define FRAME_death308 197
#define MODEL_SCALE 1.000000

View File

@ -1,734 +0,0 @@
#include "g_local.h"
#include "m_actor.h"
void muzzleflash_think(edict_t *flash)
{
if(level.time >= flash->wait)
{
flash->svflags |= SVF_NOCLIENT;
flash->s.effects &= ~EF_HYPERBLASTER;
}
else
{
flash->svflags &= ~SVF_NOCLIENT;
if(flash->s.frame ^= 1)
flash->s.effects |= EF_HYPERBLASTER;
else
flash->s.effects &= ~EF_HYPERBLASTER;
flash->nextthink = level.time + FRAMETIME;
}
gi.linkentity(flash);
}
void TraceAimPoint(vec3_t start,vec3_t target)
{
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (TE_DEBUGTRAIL);
WRITE_COORD (start);
WRITE_COORD (target);
MESSAGE_SEND (MSG_ALL, start, NULL);
}
void ActorTarget(edict_t *self, vec3_t target)
{
float accuracy;
float dist;
float tf;
vec3_t v;
if(!self->enemy) {
VectorClear(target);
return;
}
if(self->monsterinfo.aiflags & AI_GOOD_GUY)
accuracy = 5.0 - skill->value;
else
accuracy = skill->value + 2.0;
if (self->enemy->health > 0)
{
int weapon;
trace_t tr;
vec3_t start;
bool can_see=false;
VectorCopy(self->s.origin,start);
start[2] += self->viewheight;
VectorMA (self->enemy->s.origin, -0.2, self->enemy->velocity, target);
weapon = self->actor_weapon[self->actor_current_weapon];
if(weapon == 7 && (rand() & 1))
{
// Fire rockets at feet half the time
target[2] += self->enemy->mins[2] + 1;
tr = gi.trace(start,NULL,NULL,target,self,MASK_SHOT);
if(tr.ent == self->enemy)
can_see=true;
else
target[2] -= self->enemy->mins[2] + 1;
}
if(!can_see)
{
// Fire at origin if origin can be seen
tr = gi.trace(start,NULL,NULL,target,self,MASK_SHOT);
if(tr.ent == self->enemy)
can_see = true;
}
// Otherwise fire at eyeballs
if(!can_see)
target[2] += self->enemy->viewheight;
}
else
{
// For dead targets, fire at center of bounding box (point entities)
// or origin (brush models)
if(self->enemy->solid == SOLID_BBOX)
VectorMA(self->enemy->absmin,0.5,self->enemy->size,target);
else
VectorAdd(self->enemy->s.origin,self->enemy->origin_offset,target);
}
if(accuracy == 5.0)
return;
VectorSubtract(target,self->s.origin,v);
dist = VectorLength(v);
tf = (dist < 256) ? dist/2 : 256;
tf *= (float) (5.0 - accuracy) / 25.0;
VectorAdd(target, tv(crandom() * tf, crandom() * tf, crandom() * tf * 0.2), target);
}
//Blaster
void actorBlaster (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
int damage;
if(!self->enemy || !self->enemy->inuse)
return;
AngleVectors (self->s.angles, forward, right, up);
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
damage = 5;
else
damage = 10;
monster_fire_blaster (self, start, forward, damage, 600, MZ2_SOLDIER_BLASTER_2, EF_BLASTER);
if(developer->value)
TraceAimPoint(start,target);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
G_ProjectSource2(self->s.origin,self->muzzle2,forward,right,up,start);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
monster_fire_blaster (self, start, forward, damage, 600, MZ2_SOLDIER_BLASTER_2, EF_BLASTER);
}
}
//Shotgun
void actorShotgun (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
if(!self->enemy || !self->enemy->inuse)
return;
AngleVectors (self->s.angles, forward, right, up);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
if(self->framenumbers % 2)
G_ProjectSource2(self->s.origin, self->muzzle2, forward, right, up, start);
else
G_ProjectSource2(self->s.origin, self->muzzle, forward, right, up, start);
self->framenumbers++;
}
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
fire_shotgun (self, start, forward, 4, 8, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SHOTGUN_COUNT, MOD_SHOTGUN);
MESSAGE_BEGIN(svc_temp_entity);
WRITE_BYTE(TE_CHAINFIST_SMOKE);
WRITE_COORD(start);
MESSAGE_SEND(MSG_PVS, start, NULL);
gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex("weapons/shotgf1b.wav"),1,ATTN_NORM,0);
if(self->flash)
{
VectorCopy(start,self->flash->s.origin);
self->flash->s.frame = 0;
self->flash->think = muzzleflash_think;
self->flash->wait = level.time + FRAMETIME;
self->flash->think(self->flash);
}
if(developer->value)
{
if (!(self->monsterinfo.aiflags & AI_TWO_GUNS) || (self->framenumbers % 2))
TraceAimPoint(start,target);
}
}
//Super Shotgun
void actorSuperShotgun (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
vec3_t angles;
if(!self->enemy || !self->enemy->inuse)
return;
AngleVectors (self->s.angles, forward, right, up);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
if(self->framenumbers % 2)
G_ProjectSource2 (self->s.origin, self->muzzle2, forward, right, up, start);
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
self->framenumbers++;
}
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
vectoangles(forward,angles);
angles[YAW] -= 5;
AngleVectors(angles,forward,NULL,NULL);
fire_shotgun (self, start, forward, 6, 12, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT/2, MOD_SSHOTGUN);
angles[YAW] += 10;
AngleVectors(angles,forward,NULL,NULL);
fire_shotgun (self, start, forward, 6, 12, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT/2, MOD_SSHOTGUN);
MESSAGE_BEGIN(svc_temp_entity);
WRITE_BYTE(TE_CHAINFIST_SMOKE);
WRITE_COORD(start);
MESSAGE_SEND(MSG_PVS, start, NULL);
gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex("weapons/sshotf1b.wav"),1,ATTN_NORM,0);
if(self->flash)
{
VectorCopy(start,self->flash->s.origin);
self->flash->s.frame = 0;
self->flash->think = muzzleflash_think;
self->flash->wait = level.time + FRAMETIME;
self->flash->think(self->flash);
}
if(developer->value)
{
if (!(self->monsterinfo.aiflags & AI_TWO_GUNS) || (self->framenumbers % 2))
TraceAimPoint(start,target);
}
}
// Machinegun
void actorMachineGun (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
int damage;
if(!self->enemy || !self->enemy->inuse) {
self->monsterinfo.pausetime = 0;
return;
}
AngleVectors (self->s.angles, forward, right, up);
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
damage = 2;
else
damage = 4;
fire_bullet (self, start, forward, damage, 2, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MOD_MACHINEGUN);
MESSAGE_BEGIN(svc_temp_entity);
WRITE_BYTE(TE_CHAINFIST_SMOKE);
WRITE_COORD(start);
MESSAGE_SEND(MSG_PVS, start, NULL);
gi.positioned_sound(start,self,CHAN_WEAPON, gi.soundindex(va("weapons/machgf%db.wav",self->actor_gunframe % 5 + 1)),1,ATTN_NORM,0);
if(self->flash)
{
VectorCopy(start,self->flash->s.origin);
self->flash->think = muzzleflash_think;
self->flash->wait = level.time + FRAMETIME;
self->flash->think(self->flash);
}
if(developer->value)
TraceAimPoint(start,target);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
G_ProjectSource2 (self->s.origin, self->muzzle2, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
fire_bullet (self, start, forward, damage, 2, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MOD_MACHINEGUN);
MESSAGE_BEGIN(svc_temp_entity);
WRITE_BYTE(TE_CHAINFIST_SMOKE);
WRITE_COORD(start);
MESSAGE_SEND(MSG_PVS, start, NULL);
}
}
// Chaingun
void actorChaingun (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
int i;
int shots;
int damage;
if(!self->enemy || !self->enemy->inuse)
self->monsterinfo.pausetime = 0;
if(level.time >= self->monsterinfo.pausetime) {
self->s.sound = 0;
gi.sound(self,CHAN_AUTO,gi.soundindex("weapons/chngnd1a.wav"),1,ATTN_IDLE,0);
return;
}
if(self->actor_gunframe == 0)
gi.sound(self, CHAN_AUTO, gi.soundindex("weapons/chngnu1a.wav"), 1, ATTN_IDLE, 0);
if(self->actor_gunframe == 21 && level.time < self->monsterinfo.pausetime)
self->actor_gunframe = 15;
else
self->actor_gunframe++;
self->s.sound = gi.soundindex("weapons/chngnl1a.wav");
if(self->actor_gunframe <= 9)
shots = 1;
else if(self->actor_gunframe <= 14)
shots = 2;
else
shots = 3;
AngleVectors (self->s.angles, forward, right, up);
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
damage = 2;
else
damage = 4;
for(i=0; i<shots; i++)
fire_bullet (self, start, forward, damage, 2, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MOD_CHAINGUN);
MESSAGE_BEGIN(svc_temp_entity);
WRITE_BYTE(TE_CHAINFIST_SMOKE);
WRITE_COORD(start);
MESSAGE_SEND(MSG_PVS, start, NULL);
gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex(va("weapons/machgf%db.wav",self->actor_gunframe % 5 + 1)),1,ATTN_NORM,0);
if(self->flash)
{
VectorCopy(start,self->flash->s.origin);
self->flash->think = muzzleflash_think;
self->flash->wait = level.time + FRAMETIME;
self->flash->think(self->flash);
}
if(developer->value)
TraceAimPoint(start,target);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
G_ProjectSource2 (self->s.origin, self->muzzle2, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
for(i=0; i<shots; i++)
fire_bullet (self, start, forward, damage, 2, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MOD_CHAINGUN);
MESSAGE_BEGIN(svc_temp_entity);
WRITE_BYTE(TE_CHAINFIST_SMOKE);
WRITE_COORD(start);
MESSAGE_SEND(MSG_PVS, start, NULL);
}
}
// Grenade Launcher
// DWH: Pretty much a straight copy from Lazarus gunner code
#define GRENADE_VELOCITY 632.4555320337
#define GRENADE_VELOCITY_SQUARED 400000
void actorGrenadeLauncher (edict_t *self)
{
vec3_t start,target;
vec3_t forward, right, up;
vec3_t aim;
vec3_t dist;
vec_t monster_speed;
if(!self->enemy || !self->enemy->inuse)
return;
AngleVectors (self->s.angles, forward, right, up);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
if(self->framenumbers % 2)
G_ProjectSource2 (self->s.origin, self->muzzle2, forward, right, up, start);
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
self->framenumbers++;
}
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
if(self->enemy->absmin[2] <= self->absmax[2])
target[2] += self->enemy->mins[2] - self->enemy->viewheight;
VectorSubtract(target, start, aim);
// lead target... 20, 35, 50, 65 chance of leading
if( random() < (0.2 + skill->value * 0.15) )
{
float dist;
float time;
dist = VectorLength (aim);
time = dist/GRENADE_VELOCITY; // Not correct, but better than nothin'
VectorMA(target, time, self->enemy->velocity, target);
VectorSubtract(target, start, aim);
}
VectorCopy(aim,forward);
VectorNormalize (aim);
if(aim[2] < 1.0) {
float cosa, t, x, vx, y;
float drop;
float last_error, last_up, v_error;
int i;
VectorCopy(forward,target); // save target point
// horizontal distance to target
x = sqrt( forward[0]*forward[0] + forward[1]*forward[1]);
cosa = sqrt(aim[0]*aim[0] + aim[1]*aim[1]);
// constant horizontal velocity (since grenades don't have drag)
vx = GRENADE_VELOCITY * cosa;
// time to reach target x
t = x/vx;
// in that time, grenade will drop this much:
drop = 0.5*sv_gravity->value*t*(t+FRAMETIME);
forward[2] = target[2] + drop;
// this is a good first cut, but incorrect since angle now changes, so
// horizontal speed changes
VectorCopy(forward,aim);
VectorNormalize(aim);
cosa = sqrt(aim[0]*aim[0] + aim[1]*aim[1]);
vx = GRENADE_VELOCITY * cosa;
t = x/vx;
y = GRENADE_VELOCITY*aim[2]*t - 0.5*sv_gravity->value*t*(t+FRAMETIME);
v_error = target[2]-y;
last_error = 2*v_error;
for(i=0; i<10 && fabs(v_error) > 4 && fabs(v_error) < fabs(last_error); i++) {
drop = 0.5*sv_gravity->value*t*(t+FRAMETIME);
forward[2] = target[2] + drop;
VectorCopy(forward,aim);
VectorNormalize(aim);
cosa = sqrt(aim[0]*aim[0] + aim[1]*aim[1]);
vx = GRENADE_VELOCITY * cosa;
t = x/vx;
y = GRENADE_VELOCITY*aim[2]*t - 0.5*sv_gravity->value*t*(t+FRAMETIME);
v_error = target[2]-y;
// If error is increasing... we can't get there from here and
// probably shouldn't be here in the first place. Too late now...
// use last aim vector and shoot.
if(fabs(v_error) < fabs(last_error))
last_up = forward[2];
}
if(fabs(v_error) > fabs(last_error)) {
forward[2] = last_up;
VectorCopy(forward,aim);
VectorNormalize(aim);
}
// Sanity check... if gunner is at the same elevation or a bit above the
// target entity, check to make sure he won't bounce grenades off the
// top of a doorway. If he WOULD do that, then figure out the max elevation
// angle that will get the grenade through the door, and hope we get a
// good bounce.
if( (self->s.origin[2] - self->enemy->s.origin[2] < 160) &&
(self->s.origin[2] - self->enemy->s.origin[2] > -16) ) {
trace_t tr;
VectorAdd(start,forward,target);
tr = gi.trace(start,vec3_origin,vec3_origin,target,self,MASK_SOLID);
if(tr.fraction < 1.0) {
// OK... the aim vector hit a solid, but would the grenade actually hit?
int contents;
cosa = sqrt(aim[0]*aim[0] + aim[1]*aim[1]);
vx = GRENADE_VELOCITY * cosa;
VectorSubtract(tr.endpos,start,dist);
dist[2] = 0;
x = VectorLength(dist);
t = x/vx;
drop = 0.5*sv_gravity->value*t*(t+FRAMETIME);
tr.endpos[2] -= drop;
// move just a bit in the aim direction
tr.endpos[0] += aim[0];
tr.endpos[1] += aim[1];
contents = gi.pointcontents(tr.endpos);
while((contents & MASK_SOLID) && (target[2] > self->enemy->s.origin[2])) {
target[2] -= 8.0;
VectorSubtract(target,start,forward);
VectorCopy(forward,aim);
VectorNormalize(aim);
tr = gi.trace(start,vec3_origin,vec3_origin,target,self,MASK_SOLID);
if(tr.fraction < 1.0) {
cosa = sqrt(aim[0]*aim[0] + aim[1]*aim[1]);
vx = GRENADE_VELOCITY * cosa;
VectorSubtract(tr.endpos,start,dist);
dist[2] = 0;
x = VectorLength(dist);
t = x/vx;
drop = 0.5*sv_gravity->value*t*(t+FRAMETIME);
tr.endpos[2] -= drop;
tr.endpos[0] += aim[0];
tr.endpos[1] += aim[1];
contents = gi.pointcontents(tr.endpos);
}
// drop aim point another bit for insurance
target[2] -= 8;
VectorSubtract(target,start,forward);
VectorCopy(forward,aim);
VectorNormalize(aim);
}
}
}
}
// DWH - take into account (sort of) Lazarus feature of adding shooter's velocity to
// grenade velocity
monster_speed = VectorLength(self->velocity);
if(monster_speed > 0) {
vec3_t v1;
vec_t delta;
VectorCopy(self->velocity,v1);
VectorNormalize(v1);
delta = -monster_speed/GRENADE_VELOCITY;
VectorMA(aim,delta,v1,aim);
VectorNormalize(aim);
}
fire_grenade (self, start, aim, 50, GRENADE_VELOCITY, 2.5, 90);
gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex("weapons/grenlf1a.wav"),1,ATTN_NORM,0);
if(developer->value)
{
if (!(self->monsterinfo.aiflags & AI_TWO_GUNS) || (self->framenumbers % 2))
TraceAimPoint(start,target);
}
}
// Rocket Launcher
void actorRocket (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
int damage = 80;
if(!self->enemy || !self->enemy->inuse)
return;
AngleVectors (self->s.angles, forward, right, up);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
if(self->framenumbers % 2)
G_ProjectSource2 (self->s.origin, self->muzzle2, forward, right, up, start);
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
self->framenumbers++;
}
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
fire_rocket (self, start, forward, damage, 550, damage+20, damage,
( (self->spawnflags & SF_MONSTER_SPECIAL) ? self->enemy : NULL) );
gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex("weapons/rocklf1a.wav"),1,ATTN_NORM,0);
if(developer->value)
{
if (!(self->monsterinfo.aiflags & AI_TWO_GUNS) || (self->framenumbers % 2))
TraceAimPoint(start,target);
}
}
void actorHyperblaster (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
int damage;
int effect;
if(!self->enemy || !self->enemy->inuse) {
self->monsterinfo.pausetime = 0;
self->s.sound = 0;
return;
}
self->s.sound = gi.soundindex("weapons/hyprbl1a.wav");
if (level.time >= self->monsterinfo.pausetime)
{
self->actor_gunframe++;
}
else
{
AngleVectors (self->s.angles, forward, right, up);
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
if ((random() * 3) < 1)
effect = EF_HYPERBLASTER;
else
effect = 0;
gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex("weapons/hyprbf1a.wav"),1,ATTN_NORM,0);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
damage = 8;
else
damage = 15;
fire_blaster (self, start, forward, damage, 1000, effect, true);
if(developer->value)
TraceAimPoint(start,target);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
G_ProjectSource2 (self->s.origin, self->muzzle2, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
if ((random() * 3) < 1)
effect = EF_HYPERBLASTER;
else
effect = 0;
fire_blaster (self, start, forward, damage, 1000, effect, true);
}
self->actor_gunframe++;
if (self->actor_gunframe == 12)
self->actor_gunframe = 6;
}
if (self->actor_gunframe == 12)
{
gi.sound(self, CHAN_AUTO, gi.soundindex("weapons/hyprbd1a.wav"), 1, ATTN_NORM, 0);
self->s.sound = 0;
}
}
// Railgun
void actorRailGun (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
if(!self->enemy || !self->enemy->inuse)
return;
AngleVectors (self->s.angles, forward, right, up);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
if(self->framenumbers % 2)
G_ProjectSource2 (self->s.origin, self->muzzle2, forward, right, up, start);
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
self->framenumbers++;
}
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
fire_rail (self, start, forward, 80, 100); // Do slightly less damage
gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex("weapons/railgf1a.wav"),1,ATTN_NORM,0);
if(developer->value)
{
if (!(self->monsterinfo.aiflags & AI_TWO_GUNS) || (self->framenumbers % 2))
TraceAimPoint(start,target);
}
}
void actorBFG (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right, up;
if(!self->enemy || !self->enemy->inuse) {
self->monsterinfo.pausetime = 0;
return;
}
if(self->actor_gunframe == 0)
gi.positioned_sound(self->s.origin,self,CHAN_WEAPON,gi.soundindex("weapons/bfg__f1y.wav"),1,ATTN_NORM,0);
if(self->actor_gunframe == 10)
{
AngleVectors (self->s.angles, forward, right, up);
if(self->monsterinfo.aiflags & AI_TWO_GUNS)
{
if(self->framenumbers % 2)
G_ProjectSource2 (self->s.origin, self->muzzle2, forward, right, up, start);
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
self->framenumbers++;
}
else
G_ProjectSource2 (self->s.origin, self->muzzle, forward, right, up, start);
ActorTarget(self,target);
VectorSubtract (target, start, forward);
VectorNormalize (forward);
fire_bfg (self, start, forward, 500, 300, 1000);
self->endtime = level.time + 1;
if(developer->value)
{
if (!(self->monsterinfo.aiflags & AI_TWO_GUNS) || (self->framenumbers % 2))
TraceAimPoint(start,target);
}
}
self->actor_gunframe++;
}

View File

@ -1,502 +0,0 @@
/*
==============================================================================
BERSERK
==============================================================================
*/
#include "g_local.h"
#include "m_berserk.h"
static int sound_pain;
static int sound_die;
static int sound_idle;
static int sound_punch;
static int sound_sight;
static int sound_search;
void berserk_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void berserk_search (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
void berserk_fidget (edict_t *self);
mframe_t berserk_frames_stand [] =
{
ai_stand, 0, berserk_fidget,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t berserk_move_stand = {FRAME_stand1, FRAME_stand5, berserk_frames_stand, NULL};
void berserk_stand (edict_t *self)
{
self->monsterinfo.currentmove = &berserk_move_stand;
}
mframe_t berserk_frames_stand_fidget [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t berserk_move_stand_fidget = {FRAME_standb1, FRAME_standb20, berserk_frames_stand_fidget, berserk_stand};
void berserk_fidget (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
return;
if (random() > 0.15)
return;
self->monsterinfo.currentmove = &berserk_move_stand_fidget;
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_WEAPON, sound_idle, 1, ATTN_IDLE, 0);
}
mframe_t berserk_frames_walk [] =
{
ai_walk, 9.1, NULL,
ai_walk, 6.3, NULL,
ai_walk, 4.9, NULL,
ai_walk, 6.7, NULL,
ai_walk, 6.0, NULL,
ai_walk, 8.2, NULL,
ai_walk, 7.2, NULL,
ai_walk, 6.1, NULL,
ai_walk, 4.9, NULL,
ai_walk, 4.7, NULL,
ai_walk, 4.7, NULL,
ai_walk, 4.8, NULL
};
mmove_t berserk_move_walk = {FRAME_walkc1, FRAME_walkc11, berserk_frames_walk, NULL};
void berserk_walk (edict_t *self)
{
self->monsterinfo.currentmove = &berserk_move_walk;
}
/*
*****************************
SKIPPED THIS FOR NOW!
*****************************
Running -> Arm raised in air
void() berserk_runb1 =[ $r_att1 , berserk_runb2 ] {ai_run(21);};
void() berserk_runb2 =[ $r_att2 , berserk_runb3 ] {ai_run(11);};
void() berserk_runb3 =[ $r_att3 , berserk_runb4 ] {ai_run(21);};
void() berserk_runb4 =[ $r_att4 , berserk_runb5 ] {ai_run(25);};
void() berserk_runb5 =[ $r_att5 , berserk_runb6 ] {ai_run(18);};
void() berserk_runb6 =[ $r_att6 , berserk_runb7 ] {ai_run(19);};
// running with arm in air : start loop
void() berserk_runb7 =[ $r_att7 , berserk_runb8 ] {ai_run(21);};
void() berserk_runb8 =[ $r_att8 , berserk_runb9 ] {ai_run(11);};
void() berserk_runb9 =[ $r_att9 , berserk_runb10 ] {ai_run(21);};
void() berserk_runb10 =[ $r_att10 , berserk_runb11 ] {ai_run(25);};
void() berserk_runb11 =[ $r_att11 , berserk_runb12 ] {ai_run(18);};
void() berserk_runb12 =[ $r_att12 , berserk_runb7 ] {ai_run(19);};
// running with arm in air : end loop
*/
mframe_t berserk_frames_run1 [] =
{
ai_run, 21, NULL,
ai_run, 11, NULL,
ai_run, 21, NULL,
ai_run, 25, NULL,
ai_run, 18, NULL,
ai_run, 19, NULL
};
mmove_t berserk_move_run1 = {FRAME_run1, FRAME_run6, berserk_frames_run1, NULL};
void berserk_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &berserk_move_stand;
else
self->monsterinfo.currentmove = &berserk_move_run1;
}
void berserk_attack_spike (edict_t *self)
{
static vec3_t aim = {MELEE_DISTANCE, 0, -24};
fire_hit (self, aim, (15 + (rand() % 6)), 400); // Faster attack -- upwards and backwards
}
void berserk_swing (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_punch, 1, ATTN_NORM, 0);
}
mframe_t berserk_frames_attack_spike [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, berserk_swing,
ai_charge, 0, berserk_attack_spike,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t berserk_move_attack_spike = {FRAME_att_c1, FRAME_att_c8, berserk_frames_attack_spike, berserk_run};
void berserk_attack_club (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->mins[0], -4);
fire_hit (self, aim, (5 + (rand() % 6)), 400); // Slower attack
}
mframe_t berserk_frames_attack_club [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, berserk_swing,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, berserk_attack_club,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t berserk_move_attack_club = {FRAME_att_c9, FRAME_att_c20, berserk_frames_attack_club, berserk_run};
void berserk_strike (edict_t *self)
{
//FIXME play impact sound
}
mframe_t berserk_frames_attack_strike [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, berserk_swing,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, berserk_strike,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 9.7, NULL,
ai_move, 13.6, NULL
};
mmove_t berserk_move_attack_strike = {FRAME_att_c21, FRAME_att_c34, berserk_frames_attack_strike, berserk_run};
void berserk_melee (edict_t *self)
{
if ((rand() % 2) == 0)
self->monsterinfo.currentmove = &berserk_move_attack_spike;
else
self->monsterinfo.currentmove = &berserk_move_attack_club;
}
/*
void() berserk_atke1 =[ $r_attb1, berserk_atke2 ] {ai_run(9);};
void() berserk_atke2 =[ $r_attb2, berserk_atke3 ] {ai_run(6);};
void() berserk_atke3 =[ $r_attb3, berserk_atke4 ] {ai_run(18.4);};
void() berserk_atke4 =[ $r_attb4, berserk_atke5 ] {ai_run(25);};
void() berserk_atke5 =[ $r_attb5, berserk_atke6 ] {ai_run(14);};
void() berserk_atke6 =[ $r_attb6, berserk_atke7 ] {ai_run(20);};
void() berserk_atke7 =[ $r_attb7, berserk_atke8 ] {ai_run(8.5);};
void() berserk_atke8 =[ $r_attb8, berserk_atke9 ] {ai_run(3);};
void() berserk_atke9 =[ $r_attb9, berserk_atke10 ] {ai_run(17.5);};
void() berserk_atke10 =[ $r_attb10, berserk_atke11 ] {ai_run(17);};
void() berserk_atke11 =[ $r_attb11, berserk_atke12 ] {ai_run(9);};
void() berserk_atke12 =[ $r_attb12, berserk_atke13 ] {ai_run(25);};
void() berserk_atke13 =[ $r_attb13, berserk_atke14 ] {ai_run(3.7);};
void() berserk_atke14 =[ $r_attb14, berserk_atke15 ] {ai_run(2.6);};
void() berserk_atke15 =[ $r_attb15, berserk_atke16 ] {ai_run(19);};
void() berserk_atke16 =[ $r_attb16, berserk_atke17 ] {ai_run(25);};
void() berserk_atke17 =[ $r_attb17, berserk_atke18 ] {ai_run(19.6);};
void() berserk_atke18 =[ $r_attb18, berserk_run1 ] {ai_run(7.8);};
*/
mframe_t berserk_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t berserk_move_pain1 = {FRAME_painc1, FRAME_painc4, berserk_frames_pain1, berserk_run};
mframe_t berserk_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t berserk_move_pain2 = {FRAME_painb1, FRAME_painb20, berserk_frames_pain2, berserk_run};
void berserk_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
gi.sound (self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0);
if (skill->value == 3)
return; // no pain anims in nightmare
if ((damage < 20) || (random() < 0.5))
self->monsterinfo.currentmove = &berserk_move_pain1;
else
self->monsterinfo.currentmove = &berserk_move_pain2;
}
void berserk_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t berserk_frames_death1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t berserk_move_death1 = {FRAME_death1, FRAME_death13, berserk_frames_death1, berserk_dead};
mframe_t berserk_frames_death2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t berserk_move_death2 = {FRAME_deathc1, FRAME_deathc8, berserk_frames_death2, berserk_dead};
void berserk_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
if (damage >= 50)
self->monsterinfo.currentmove = &berserk_move_death1;
else
self->monsterinfo.currentmove = &berserk_move_death2;
}
//===========
//Jump
mframe_t berserk_frames_jump [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t berserk_move_jump = { FRAME_run1, FRAME_run6, berserk_frames_jump, berserk_run };
void berserk_jump (edict_t *self)
{
self->monsterinfo.currentmove = &berserk_move_jump;
}
/*QUAKED monster_berserk (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_berserk (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_BERSERK;
self->spawnflags |= SF_MONSTER_KNOWS_MIRRORS;
// pre-caches
sound_pain = gi.soundindex ("berserk/berpain2.wav");
sound_die = gi.soundindex ("berserk/berdeth2.wav");
sound_idle = gi.soundindex ("berserk/beridle1.wav");
sound_punch = gi.soundindex ("berserk/attack.wav");
sound_search = gi.soundindex ("berserk/bersrch1.wav");
sound_sight = gi.soundindex ("berserk/sight.wav");
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/berserk/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex("models/monsters/berserk/tris.md2");
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, 32);
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 240;
if(!self->gib_health)
self->gib_health = -60;
if(!self->mass)
self->mass = 250;
self->pain = berserk_pain;
self->die = berserk_die;
self->monsterinfo.stand = berserk_stand;
self->monsterinfo.walk = berserk_walk;
self->monsterinfo.run = berserk_run;
self->monsterinfo.dodge = NULL;
self->monsterinfo.attack = NULL;
self->monsterinfo.melee = berserk_melee;
self->monsterinfo.sight = berserk_sight;
self->monsterinfo.search = berserk_search;
if(monsterjump->value)
{
self->monsterinfo.jump = berserk_jump;
self->monsterinfo.jumpup = 48;
self->monsterinfo.jumpdn = 160;
}
self->monsterinfo.currentmove = &berserk_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&berserk_move_death1,
&berserk_move_death2,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->monsterinfo.scale = MODEL_SCALE;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.20;
self->common_name = "Berserker";
gi.linkentity (self);
walkmonster_start (self);
}

View File

@ -1,250 +0,0 @@
// G:\quake2\baseq2\models/monsters/berserk
// This file generated by ModelGen - Do NOT Modify
#define FRAME_stand1 0
#define FRAME_stand2 1
#define FRAME_stand3 2
#define FRAME_stand4 3
#define FRAME_stand5 4
#define FRAME_standb1 5
#define FRAME_standb2 6
#define FRAME_standb3 7
#define FRAME_standb4 8
#define FRAME_standb5 9
#define FRAME_standb6 10
#define FRAME_standb7 11
#define FRAME_standb8 12
#define FRAME_standb9 13
#define FRAME_standb10 14
#define FRAME_standb11 15
#define FRAME_standb12 16
#define FRAME_standb13 17
#define FRAME_standb14 18
#define FRAME_standb15 19
#define FRAME_standb16 20
#define FRAME_standb17 21
#define FRAME_standb18 22
#define FRAME_standb19 23
#define FRAME_standb20 24
#define FRAME_walkc1 25
#define FRAME_walkc2 26
#define FRAME_walkc3 27
#define FRAME_walkc4 28
#define FRAME_walkc5 29
#define FRAME_walkc6 30
#define FRAME_walkc7 31
#define FRAME_walkc8 32
#define FRAME_walkc9 33
#define FRAME_walkc10 34
#define FRAME_walkc11 35
#define FRAME_run1 36
#define FRAME_run2 37
#define FRAME_run3 38
#define FRAME_run4 39
#define FRAME_run5 40
#define FRAME_run6 41
#define FRAME_att_a1 42
#define FRAME_att_a2 43
#define FRAME_att_a3 44
#define FRAME_att_a4 45
#define FRAME_att_a5 46
#define FRAME_att_a6 47
#define FRAME_att_a7 48
#define FRAME_att_a8 49
#define FRAME_att_a9 50
#define FRAME_att_a10 51
#define FRAME_att_a11 52
#define FRAME_att_a12 53
#define FRAME_att_a13 54
#define FRAME_att_b1 55
#define FRAME_att_b2 56
#define FRAME_att_b3 57
#define FRAME_att_b4 58
#define FRAME_att_b5 59
#define FRAME_att_b6 60
#define FRAME_att_b7 61
#define FRAME_att_b8 62
#define FRAME_att_b9 63
#define FRAME_att_b10 64
#define FRAME_att_b11 65
#define FRAME_att_b12 66
#define FRAME_att_b13 67
#define FRAME_att_b14 68
#define FRAME_att_b15 69
#define FRAME_att_b16 70
#define FRAME_att_b17 71
#define FRAME_att_b18 72
#define FRAME_att_b19 73
#define FRAME_att_b20 74
#define FRAME_att_b21 75
#define FRAME_att_c1 76
#define FRAME_att_c2 77
#define FRAME_att_c3 78
#define FRAME_att_c4 79
#define FRAME_att_c5 80
#define FRAME_att_c6 81
#define FRAME_att_c7 82
#define FRAME_att_c8 83
#define FRAME_att_c9 84
#define FRAME_att_c10 85
#define FRAME_att_c11 86
#define FRAME_att_c12 87
#define FRAME_att_c13 88
#define FRAME_att_c14 89
#define FRAME_att_c15 90
#define FRAME_att_c16 91
#define FRAME_att_c17 92
#define FRAME_att_c18 93
#define FRAME_att_c19 94
#define FRAME_att_c20 95
#define FRAME_att_c21 96
#define FRAME_att_c22 97
#define FRAME_att_c23 98
#define FRAME_att_c24 99
#define FRAME_att_c25 100
#define FRAME_att_c26 101
#define FRAME_att_c27 102
#define FRAME_att_c28 103
#define FRAME_att_c29 104
#define FRAME_att_c30 105
#define FRAME_att_c31 106
#define FRAME_att_c32 107
#define FRAME_att_c33 108
#define FRAME_att_c34 109
#define FRAME_r_att1 110
#define FRAME_r_att2 111
#define FRAME_r_att3 112
#define FRAME_r_att4 113
#define FRAME_r_att5 114
#define FRAME_r_att6 115
#define FRAME_r_att7 116
#define FRAME_r_att8 117
#define FRAME_r_att9 118
#define FRAME_r_att10 119
#define FRAME_r_att11 120
#define FRAME_r_att12 121
#define FRAME_r_att13 122
#define FRAME_r_att14 123
#define FRAME_r_att15 124
#define FRAME_r_att16 125
#define FRAME_r_att17 126
#define FRAME_r_att18 127
#define FRAME_r_attb1 128
#define FRAME_r_attb2 129
#define FRAME_r_attb3 130
#define FRAME_r_attb4 131
#define FRAME_r_attb5 132
#define FRAME_r_attb6 133
#define FRAME_r_attb7 134
#define FRAME_r_attb8 135
#define FRAME_r_attb9 136
#define FRAME_r_attb10 137
#define FRAME_r_attb11 138
#define FRAME_r_attb12 139
#define FRAME_r_attb13 140
#define FRAME_r_attb14 141
#define FRAME_r_attb15 142
#define FRAME_r_attb16 143
#define FRAME_r_attb17 144
#define FRAME_r_attb18 145
#define FRAME_slam1 146
#define FRAME_slam2 147
#define FRAME_slam3 148
#define FRAME_slam4 149
#define FRAME_slam5 150
#define FRAME_slam6 151
#define FRAME_slam7 152
#define FRAME_slam8 153
#define FRAME_slam9 154
#define FRAME_slam10 155
#define FRAME_slam11 156
#define FRAME_slam12 157
#define FRAME_slam13 158
#define FRAME_slam14 159
#define FRAME_slam15 160
#define FRAME_slam16 161
#define FRAME_slam17 162
#define FRAME_slam18 163
#define FRAME_slam19 164
#define FRAME_slam20 165
#define FRAME_slam21 166
#define FRAME_slam22 167
#define FRAME_slam23 168
#define FRAME_duck1 169
#define FRAME_duck2 170
#define FRAME_duck3 171
#define FRAME_duck4 172
#define FRAME_duck5 173
#define FRAME_duck6 174
#define FRAME_duck7 175
#define FRAME_duck8 176
#define FRAME_duck9 177
#define FRAME_duck10 178
#define FRAME_fall1 179
#define FRAME_fall2 180
#define FRAME_fall3 181
#define FRAME_fall4 182
#define FRAME_fall5 183
#define FRAME_fall6 184
#define FRAME_fall7 185
#define FRAME_fall8 186
#define FRAME_fall9 187
#define FRAME_fall10 188
#define FRAME_fall11 189
#define FRAME_fall12 190
#define FRAME_fall13 191
#define FRAME_fall14 192
#define FRAME_fall15 193
#define FRAME_fall16 194
#define FRAME_fall17 195
#define FRAME_fall18 196
#define FRAME_fall19 197
#define FRAME_fall20 198
#define FRAME_painc1 199
#define FRAME_painc2 200
#define FRAME_painc3 201
#define FRAME_painc4 202
#define FRAME_painb1 203
#define FRAME_painb2 204
#define FRAME_painb3 205
#define FRAME_painb4 206
#define FRAME_painb5 207
#define FRAME_painb6 208
#define FRAME_painb7 209
#define FRAME_painb8 210
#define FRAME_painb9 211
#define FRAME_painb10 212
#define FRAME_painb11 213
#define FRAME_painb12 214
#define FRAME_painb13 215
#define FRAME_painb14 216
#define FRAME_painb15 217
#define FRAME_painb16 218
#define FRAME_painb17 219
#define FRAME_painb18 220
#define FRAME_painb19 221
#define FRAME_painb20 222
#define FRAME_death1 223
#define FRAME_death2 224
#define FRAME_death3 225
#define FRAME_death4 226
#define FRAME_death5 227
#define FRAME_death6 228
#define FRAME_death7 229
#define FRAME_death8 230
#define FRAME_death9 231
#define FRAME_death10 232
#define FRAME_death11 233
#define FRAME_death12 234
#define FRAME_death13 235
#define FRAME_deathc1 236
#define FRAME_deathc2 237
#define FRAME_deathc3 238
#define FRAME_deathc4 239
#define FRAME_deathc5 240
#define FRAME_deathc6 241
#define FRAME_deathc7 242
#define FRAME_deathc8 243
#define MODEL_SCALE 1.000000

View File

@ -1,704 +0,0 @@
/*
==============================================================================
boss2
==============================================================================
*/
#include "g_local.h"
#include "m_boss2.h"
void BossExplode (edict_t *self);
bool infront (edict_t *self, edict_t *other);
static int sound_pain1;
static int sound_pain2;
static int sound_pain3;
static int sound_death;
static int sound_search1;
void boss2_search (edict_t *self)
{
if (random() < 0.5)
gi.sound (self, CHAN_VOICE, sound_search1, 1, ATTN_NONE, 0);
}
void boss2_run (edict_t *self);
void boss2_stand (edict_t *self);
void boss2_dead (edict_t *self);
void boss2_attack (edict_t *self);
void boss2_attack_mg (edict_t *self);
void boss2_reattack_mg (edict_t *self);
void boss2_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
void Boss2Rocket (edict_t *self)
{
vec3_t forward, right;
vec3_t start;
vec3_t dir;
vec3_t vec;
int rocketSpeed;
if((self->spawnflags & SF_MONSTER_SPECIAL))
rocketSpeed = 400; // Lazarus: Homing rockets are tougher if slow
else
rocketSpeed = 500 + (100 * skill->value); // PGM rock & roll.... :)
AngleVectors (self->s.angles, forward, right, NULL);
VectorCopy (self->enemy->s.origin, vec);
vec[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
//1
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_BOSS2_ROCKET_1], forward, right, start);
VectorSubtract (vec, start, dir);
VectorNormalize (dir);
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_BOSS2_ROCKET_1,
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
//2
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_BOSS2_ROCKET_2], forward, right, start);
VectorSubtract (vec, start, dir);
VectorNormalize (dir);
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_BOSS2_ROCKET_2,
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
//3
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_BOSS2_ROCKET_3], forward, right, start);
VectorSubtract (vec, start, dir);
VectorNormalize (dir);
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_BOSS2_ROCKET_3,
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
//4
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_BOSS2_ROCKET_4], forward, right, start);
VectorSubtract (vec, start, dir);
VectorNormalize (dir);
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_BOSS2_ROCKET_4,
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
}
void boss2_firebullet_right (edict_t *self)
{
vec3_t forward, right, target;
vec3_t start;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_BOSS2_MACHINEGUN_R1], forward, right, start);
VectorMA (self->enemy->s.origin, -0.2, self->enemy->velocity, target);
target[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
target[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (target, start, forward);
VectorNormalize (forward);
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_BOSS2_MACHINEGUN_R1);
}
void boss2_firebullet_left (edict_t *self)
{
vec3_t forward, right, target;
vec3_t start;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_BOSS2_MACHINEGUN_L1], forward, right, start);
VectorMA (self->enemy->s.origin, -0.2, self->enemy->velocity, target);
target[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
target[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (target, start, forward);
VectorNormalize (forward);
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_BOSS2_MACHINEGUN_L1);
}
void Boss2MachineGun (edict_t *self)
{
boss2_firebullet_left(self);
boss2_firebullet_right(self);
}
mframe_t boss2_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t boss2_move_stand = {FRAME_stand30, FRAME_stand50, boss2_frames_stand, NULL};
mframe_t boss2_frames_fidget [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t boss2_move_fidget = {FRAME_stand1, FRAME_stand30, boss2_frames_fidget, NULL};
mframe_t boss2_frames_walk [] =
{
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL
};
mmove_t boss2_move_walk = {FRAME_walk1, FRAME_walk20, boss2_frames_walk, NULL};
mframe_t boss2_frames_run [] =
{
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL
};
mmove_t boss2_move_run = {FRAME_walk1, FRAME_walk20, boss2_frames_run, NULL};
mframe_t boss2_frames_attack_pre_mg [] =
{
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, boss2_attack_mg
};
mmove_t boss2_move_attack_pre_mg = {FRAME_attack1, FRAME_attack9, boss2_frames_attack_pre_mg, NULL};
// Loop this
mframe_t boss2_frames_attack_mg [] =
{
ai_charge, 1, Boss2MachineGun,
ai_charge, 1, Boss2MachineGun,
ai_charge, 1, Boss2MachineGun,
ai_charge, 1, Boss2MachineGun,
ai_charge, 1, Boss2MachineGun,
ai_charge, 1, boss2_reattack_mg
};
mmove_t boss2_move_attack_mg = {FRAME_attack10, FRAME_attack15, boss2_frames_attack_mg, NULL};
mframe_t boss2_frames_attack_post_mg [] =
{
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL
};
mmove_t boss2_move_attack_post_mg = {FRAME_attack16, FRAME_attack19, boss2_frames_attack_post_mg, boss2_run};
mframe_t boss2_frames_attack_rocket [] =
{
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_move, -20, Boss2Rocket,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL
};
mmove_t boss2_move_attack_rocket = {FRAME_attack20, FRAME_attack40, boss2_frames_attack_rocket, boss2_run};
mframe_t boss2_frames_pain_heavy [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t boss2_move_pain_heavy = {FRAME_pain2, FRAME_pain19, boss2_frames_pain_heavy, boss2_run};
mframe_t boss2_frames_pain_light [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t boss2_move_pain_light = {FRAME_pain20, FRAME_pain23, boss2_frames_pain_light, boss2_run};
mframe_t boss2_frames_death [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, BossExplode
};
mmove_t boss2_move_death = {FRAME_death2, FRAME_death50, boss2_frames_death, boss2_dead};
void boss2_stand (edict_t *self)
{
self->monsterinfo.currentmove = &boss2_move_stand;
}
void boss2_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &boss2_move_stand;
else
self->monsterinfo.currentmove = &boss2_move_run;
}
void boss2_walk (edict_t *self)
{
self->monsterinfo.currentmove = &boss2_move_walk;
}
void boss2_attack (edict_t *self)
{
vec3_t vec;
float range;
VectorSubtract (self->enemy->s.origin, self->s.origin, vec);
range = VectorLength (vec);
if (range <= 125)
{
self->monsterinfo.currentmove = &boss2_move_attack_pre_mg;
}
else
{
if (random() <= 0.6)
self->monsterinfo.currentmove = &boss2_move_attack_pre_mg;
else
self->monsterinfo.currentmove = &boss2_move_attack_rocket;
}
}
void boss2_attack_mg (edict_t *self)
{
self->monsterinfo.currentmove = &boss2_move_attack_mg;
}
void boss2_reattack_mg (edict_t *self)
{
if ( infront(self, self->enemy) )
if (random() <= 0.7)
self->monsterinfo.currentmove = &boss2_move_attack_mg;
else
self->monsterinfo.currentmove = &boss2_move_attack_post_mg;
else
self->monsterinfo.currentmove = &boss2_move_attack_post_mg;
}
void boss2_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
// American wanted these at no attenuation
if (damage < 10)
{
gi.sound (self, CHAN_VOICE, sound_pain3, 1, ATTN_NONE, 0);
self->monsterinfo.currentmove = &boss2_move_pain_light;
}
else if (damage < 30)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NONE, 0);
self->monsterinfo.currentmove = &boss2_move_pain_light;
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NONE, 0);
self->monsterinfo.currentmove = &boss2_move_pain_heavy;
}
}
void boss2_dead (edict_t *self)
{
VectorSet (self->mins, -56, -56, 0);
VectorSet (self->maxs, 56, 56, 80);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
}
void boss2_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NONE, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_NO;
self->count = 0;
self->monsterinfo.currentmove = &boss2_move_death;
#if 0
int n;
self->s.sound = 0;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->monsterinfo.currentmove = &boss2_move_death;
#endif
}
bool Boss2_CheckAttack (edict_t *self)
{
vec3_t spot1, spot2;
vec3_t temp;
float chance;
trace_t tr;
bool enemy_infront;
int enemy_range;
float enemy_yaw;
if (self->enemy->health > 0)
{
// see if any entities are in the way of the shot
VectorCopy (self->s.origin, spot1);
spot1[2] += self->viewheight;
VectorCopy (self->enemy->s.origin, spot2);
spot2[2] += self->enemy->viewheight;
tr = gi.trace (spot1, NULL, NULL, spot2, self, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_SLIME|CONTENTS_LAVA);
// do we have a clear shot?
if (tr.ent != self->enemy)
return false;
}
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp);
self->ideal_yaw = enemy_yaw;
// melee attack
if (enemy_range == RANGE_MELEE)
{
if (self->monsterinfo.melee)
self->monsterinfo.attack_state = AS_MELEE;
else
self->monsterinfo.attack_state = AS_MISSILE;
return true;
}
// missile attack
if (!self->monsterinfo.attack)
return false;
if (level.time < self->monsterinfo.attack_finished)
return false;
if (enemy_range == RANGE_FAR)
return false;
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
chance = 0.4;
}
else if (enemy_range == RANGE_MELEE)
{
chance = 0.8;
}
else if (enemy_range == RANGE_NEAR)
{
chance = 0.8;
}
else if (enemy_range == RANGE_MID)
{
chance = 0.8;
}
else
{
return false;
}
if (random () < chance)
{
self->monsterinfo.attack_state = AS_MISSILE;
self->monsterinfo.attack_finished = level.time + 2*random();
return true;
}
if (self->flags & FL_FLY)
{
if (random() < 0.3)
self->monsterinfo.attack_state = AS_SLIDING;
else
self->monsterinfo.attack_state = AS_STRAIGHT;
}
return false;
}
/*QUAKED monster_boss2 (1 .5 0) (-56 -56 0) (56 56 80) Ambush Trigger_Spawn Sight
*/
void SP_monster_boss2 (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_BOSS2;
// Lazarus: special purpose skins
if ( (self->spawnflags & SF_MONSTER_SPECIAL) && self->style )
{
PatchMonsterModel("models/monsters/boss2/tris.md2");
self->s.skin = self->style * 2;
}
sound_pain1 = gi.soundindex ("bosshovr/bhvpain1.wav");
sound_pain2 = gi.soundindex ("bosshovr/bhvpain2.wav");
sound_pain3 = gi.soundindex ("bosshovr/bhvpain3.wav");
sound_death = gi.soundindex ("bosshovr/bhvdeth1.wav");
sound_search1 = gi.soundindex ("bosshovr/bhvunqv1.wav");
self->s.sound = gi.soundindex ("bosshovr/bhvengn1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/boss2/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/boss2/tris.md2");
VectorSet (self->mins, -56, -56, 0);
VectorSet (self->maxs, 56, 56, 80);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 2000;
if(!self->gib_health)
self->gib_health = -200;
if(!self->mass)
self->mass = 1000;
self->flags |= FL_IMMUNE_LASER;
self->pain = boss2_pain;
self->die = boss2_die;
self->monsterinfo.stand = boss2_stand;
self->monsterinfo.walk = boss2_walk;
self->monsterinfo.run = boss2_run;
self->monsterinfo.attack = boss2_attack;
self->monsterinfo.search = boss2_search;
self->monsterinfo.checkattack = Boss2_CheckAttack;
gi.linkentity (self);
self->monsterinfo.currentmove = &boss2_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&boss2_move_death,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->monsterinfo.scale = MODEL_SCALE;
// Lazarus power armor
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
self->common_name = "Flying Boss";
flymonster_start (self);
}

View File

@ -1,187 +0,0 @@
// G:\quake2\baseq2\models/monsters/boss2
// This file generated by ModelGen - Do NOT Modify
#define FRAME_stand30 0
#define FRAME_stand31 1
#define FRAME_stand32 2
#define FRAME_stand33 3
#define FRAME_stand34 4
#define FRAME_stand35 5
#define FRAME_stand36 6
#define FRAME_stand37 7
#define FRAME_stand38 8
#define FRAME_stand39 9
#define FRAME_stand40 10
#define FRAME_stand41 11
#define FRAME_stand42 12
#define FRAME_stand43 13
#define FRAME_stand44 14
#define FRAME_stand45 15
#define FRAME_stand46 16
#define FRAME_stand47 17
#define FRAME_stand48 18
#define FRAME_stand49 19
#define FRAME_stand50 20
#define FRAME_stand1 21
#define FRAME_stand2 22
#define FRAME_stand3 23
#define FRAME_stand4 24
#define FRAME_stand5 25
#define FRAME_stand6 26
#define FRAME_stand7 27
#define FRAME_stand8 28
#define FRAME_stand9 29
#define FRAME_stand10 30
#define FRAME_stand11 31
#define FRAME_stand12 32
#define FRAME_stand13 33
#define FRAME_stand14 34
#define FRAME_stand15 35
#define FRAME_stand16 36
#define FRAME_stand17 37
#define FRAME_stand18 38
#define FRAME_stand19 39
#define FRAME_stand20 40
#define FRAME_stand21 41
#define FRAME_stand22 42
#define FRAME_stand23 43
#define FRAME_stand24 44
#define FRAME_stand25 45
#define FRAME_stand26 46
#define FRAME_stand27 47
#define FRAME_stand28 48
#define FRAME_stand29 49
#define FRAME_walk1 50
#define FRAME_walk2 51
#define FRAME_walk3 52
#define FRAME_walk4 53
#define FRAME_walk5 54
#define FRAME_walk6 55
#define FRAME_walk7 56
#define FRAME_walk8 57
#define FRAME_walk9 58
#define FRAME_walk10 59
#define FRAME_walk11 60
#define FRAME_walk12 61
#define FRAME_walk13 62
#define FRAME_walk14 63
#define FRAME_walk15 64
#define FRAME_walk16 65
#define FRAME_walk17 66
#define FRAME_walk18 67
#define FRAME_walk19 68
#define FRAME_walk20 69
#define FRAME_attack1 70
#define FRAME_attack2 71
#define FRAME_attack3 72
#define FRAME_attack4 73
#define FRAME_attack5 74
#define FRAME_attack6 75
#define FRAME_attack7 76
#define FRAME_attack8 77
#define FRAME_attack9 78
#define FRAME_attack10 79
#define FRAME_attack11 80
#define FRAME_attack12 81
#define FRAME_attack13 82
#define FRAME_attack14 83
#define FRAME_attack15 84
#define FRAME_attack16 85
#define FRAME_attack17 86
#define FRAME_attack18 87
#define FRAME_attack19 88
#define FRAME_attack20 89
#define FRAME_attack21 90
#define FRAME_attack22 91
#define FRAME_attack23 92
#define FRAME_attack24 93
#define FRAME_attack25 94
#define FRAME_attack26 95
#define FRAME_attack27 96
#define FRAME_attack28 97
#define FRAME_attack29 98
#define FRAME_attack30 99
#define FRAME_attack31 100
#define FRAME_attack32 101
#define FRAME_attack33 102
#define FRAME_attack34 103
#define FRAME_attack35 104
#define FRAME_attack36 105
#define FRAME_attack37 106
#define FRAME_attack38 107
#define FRAME_attack39 108
#define FRAME_attack40 109
#define FRAME_pain2 110
#define FRAME_pain3 111
#define FRAME_pain4 112
#define FRAME_pain5 113
#define FRAME_pain6 114
#define FRAME_pain7 115
#define FRAME_pain8 116
#define FRAME_pain9 117
#define FRAME_pain10 118
#define FRAME_pain11 119
#define FRAME_pain12 120
#define FRAME_pain13 121
#define FRAME_pain14 122
#define FRAME_pain15 123
#define FRAME_pain16 124
#define FRAME_pain17 125
#define FRAME_pain18 126
#define FRAME_pain19 127
#define FRAME_pain20 128
#define FRAME_pain21 129
#define FRAME_pain22 130
#define FRAME_pain23 131
#define FRAME_death2 132
#define FRAME_death3 133
#define FRAME_death4 134
#define FRAME_death5 135
#define FRAME_death6 136
#define FRAME_death7 137
#define FRAME_death8 138
#define FRAME_death9 139
#define FRAME_death10 140
#define FRAME_death11 141
#define FRAME_death12 142
#define FRAME_death13 143
#define FRAME_death14 144
#define FRAME_death15 145
#define FRAME_death16 146
#define FRAME_death17 147
#define FRAME_death18 148
#define FRAME_death19 149
#define FRAME_death20 150
#define FRAME_death21 151
#define FRAME_death22 152
#define FRAME_death23 153
#define FRAME_death24 154
#define FRAME_death25 155
#define FRAME_death26 156
#define FRAME_death27 157
#define FRAME_death28 158
#define FRAME_death29 159
#define FRAME_death30 160
#define FRAME_death31 161
#define FRAME_death32 162
#define FRAME_death33 163
#define FRAME_death34 164
#define FRAME_death35 165
#define FRAME_death36 166
#define FRAME_death37 167
#define FRAME_death38 168
#define FRAME_death39 169
#define FRAME_death40 170
#define FRAME_death41 171
#define FRAME_death42 172
#define FRAME_death43 173
#define FRAME_death44 174
#define FRAME_death45 175
#define FRAME_death46 176
#define FRAME_death47 177
#define FRAME_death48 178
#define FRAME_death49 179
#define FRAME_death50 180
#define MODEL_SCALE 1.000000

View File

@ -1,58 +0,0 @@
/*
==============================================================================
boss3
==============================================================================
*/
#include "g_local.h"
#include "m_boss32.h"
void Use_Boss3 (edict_t *ent, edict_t *other, edict_t *activator)
{
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (TE_BOSSTPORT);
WRITE_COORD (ent->s.origin);
MESSAGE_SEND (MSG_PVS, ent->s.origin, NULL);
G_FreeEdict (ent);
}
void Think_Boss3Stand (edict_t *ent)
{
if (ent->s.frame == FRAME_stand260)
ent->s.frame = FRAME_stand201;
else
ent->s.frame++;
ent->nextthink = level.time + FRAMETIME;
}
/*QUAKED monster_boss3_stand (1 .5 0) (-32 -32 0) (32 32 90)
Just stands and cycles in one place until targeted, then teleports away.
*/
void SP_monster_boss3_stand (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_BOSS3_STAND;
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
self->model = "models/monsters/boss3/rider/tris.md2";
self->s.modelindex = gi.modelindex (self->model);
self->s.frame = FRAME_stand201;
gi.soundindex ("misc/bigtele.wav");
VectorSet (self->mins, -32, -32, 0);
VectorSet (self->maxs, 32, 32, 90);
self->use = Use_Boss3;
self->think = Think_Boss3Stand;
self->nextthink = level.time + FRAMETIME;
gi.linkentity (self);
}

View File

@ -1,775 +0,0 @@
/*
==============================================================================
jorg
==============================================================================
*/
#include "g_local.h"
#include "m_boss31.h"
extern SP_monster_makron (edict_t *self);
bool visible (edict_t *self, edict_t *other);
static int sound_pain1;
static int sound_pain2;
static int sound_pain3;
static int sound_idle;
static int sound_death;
static int sound_search1;
static int sound_search2;
static int sound_search3;
static int sound_attack1;
static int sound_attack2;
static int sound_firegun;
static int sound_step_left;
static int sound_step_right;
static int sound_death_hit;
void BossExplode (edict_t *self);
void MakronToss (edict_t *self);
void jorg_search (edict_t *self)
{
float r;
r = random();
if (r <= 0.3)
gi.sound (self, CHAN_VOICE, sound_search1, 1, ATTN_NORM, 0);
else if (r <= 0.6)
gi.sound (self, CHAN_VOICE, sound_search2, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_search3, 1, ATTN_NORM, 0);
}
void jorg_dead (edict_t *self);
void jorgBFG (edict_t *self);
void jorgMachineGun (edict_t *self);
void jorg_firebullet (edict_t *self);
void jorg_reattack1(edict_t *self);
void jorg_attack1(edict_t *self);
void jorg_idle(edict_t *self);
void jorg_step_left(edict_t *self);
void jorg_step_right(edict_t *self);
void jorg_death_hit(edict_t *self);
//
// stand
//
mframe_t jorg_frames_stand []=
{
ai_stand, 0, jorg_idle,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 10
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 20
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 30
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 19, NULL,
ai_stand, 11, jorg_step_left,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 6, NULL,
ai_stand, 9, jorg_step_right,
ai_stand, 0, NULL, // 40
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, -2, NULL,
ai_stand, -17, jorg_step_left,
ai_stand, 0, NULL,
ai_stand, -12, NULL, // 50
ai_stand, -14, jorg_step_right // 51
};
mmove_t jorg_move_stand = {FRAME_stand01, FRAME_stand51, jorg_frames_stand, NULL};
void jorg_idle (edict_t *self)
{
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_NORM,0);
}
void jorg_death_hit (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_death_hit, 1, ATTN_NORM,0);
}
void jorg_step_left (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_step_left, 1, ATTN_NORM,0);
}
void jorg_step_right (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_step_right, 1, ATTN_NORM,0);
}
void jorg_stand (edict_t *self)
{
self->monsterinfo.currentmove = &jorg_move_stand;
}
mframe_t jorg_frames_run [] =
{
ai_run, 17, jorg_step_left,
ai_run, 0, NULL,
ai_run, 0, NULL,
ai_run, 0, NULL,
ai_run, 12, NULL,
ai_run, 8, NULL,
ai_run, 10, NULL,
ai_run, 33, jorg_step_right,
ai_run, 0, NULL,
ai_run, 0, NULL,
ai_run, 0, NULL,
ai_run, 9, NULL,
ai_run, 9, NULL,
ai_run, 9, NULL
};
mmove_t jorg_move_run = {FRAME_walk06, FRAME_walk19, jorg_frames_run, NULL};
//
// walk
//
mframe_t jorg_frames_start_walk [] =
{
ai_walk, 5, NULL,
ai_walk, 6, NULL,
ai_walk, 7, NULL,
ai_walk, 9, NULL,
ai_walk, 15, NULL
};
mmove_t jorg_move_start_walk = {FRAME_walk01, FRAME_walk05, jorg_frames_start_walk, NULL};
mframe_t jorg_frames_walk [] =
{
ai_walk, 17, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 12, NULL,
ai_walk, 8, NULL,
ai_walk, 10, NULL,
ai_walk, 33, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 9, NULL,
ai_walk, 9, NULL,
ai_walk, 9, NULL
};
mmove_t jorg_move_walk = {FRAME_walk06, FRAME_walk19, jorg_frames_walk, NULL};
mframe_t jorg_frames_end_walk [] =
{
ai_walk, 11, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 8, NULL,
ai_walk, -8, NULL
};
mmove_t jorg_move_end_walk = {FRAME_walk20, FRAME_walk25, jorg_frames_end_walk, NULL};
void jorg_walk (edict_t *self)
{
self->monsterinfo.currentmove = &jorg_move_walk;
}
void jorg_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &jorg_move_stand;
else
self->monsterinfo.currentmove = &jorg_move_run;
}
mframe_t jorg_frames_pain3 [] =
{
ai_move, -28, NULL,
ai_move, -6, NULL,
ai_move, -3, jorg_step_left,
ai_move, -9, NULL,
ai_move, 0, jorg_step_right,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -7, NULL,
ai_move, 1, NULL,
ai_move, -11, NULL,
ai_move, -4, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 10, NULL,
ai_move, 11, NULL,
ai_move, 0, NULL,
ai_move, 10, NULL,
ai_move, 3, NULL,
ai_move, 10, NULL,
ai_move, 7, jorg_step_left,
ai_move, 17, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, jorg_step_right
};
mmove_t jorg_move_pain3 = {FRAME_pain301, FRAME_pain325, jorg_frames_pain3, jorg_run};
mframe_t jorg_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t jorg_move_pain2 = {FRAME_pain201, FRAME_pain203, jorg_frames_pain2, jorg_run};
mframe_t jorg_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t jorg_move_pain1 = {FRAME_pain101, FRAME_pain103, jorg_frames_pain1, jorg_run};
mframe_t jorg_frames_death1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 10
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 20
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 30
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 40
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, MakronToss,
ai_move, 0, BossExplode // 50
};
mmove_t jorg_move_death = {FRAME_death01, FRAME_death50, jorg_frames_death1, jorg_dead};
mframe_t jorg_frames_attack2 []=
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, jorgBFG,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t jorg_move_attack2 = {FRAME_attak201, FRAME_attak213, jorg_frames_attack2, jorg_run};
mframe_t jorg_frames_start_attack1 [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t jorg_move_start_attack1 = {FRAME_attak101, FRAME_attak108, jorg_frames_start_attack1, jorg_attack1};
mframe_t jorg_frames_attack1[]=
{
ai_charge, 0, jorg_firebullet,
ai_charge, 0, jorg_firebullet,
ai_charge, 0, jorg_firebullet,
ai_charge, 0, jorg_firebullet,
ai_charge, 0, jorg_firebullet,
ai_charge, 0, jorg_firebullet
};
mmove_t jorg_move_attack1 = {FRAME_attak109, FRAME_attak114, jorg_frames_attack1, jorg_reattack1};
mframe_t jorg_frames_end_attack1[]=
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t jorg_move_end_attack1 = {FRAME_attak115, FRAME_attak118, jorg_frames_end_attack1, jorg_run};
void jorg_reattack1(edict_t *self)
{
if (visible(self, self->enemy))
if (random() < 0.9)
self->monsterinfo.currentmove = &jorg_move_attack1;
else
{
self->s.sound = 0;
self->monsterinfo.currentmove = &jorg_move_end_attack1;
}
else
{
self->s.sound = 0;
self->monsterinfo.currentmove = &jorg_move_end_attack1;
}
}
void jorg_attack1(edict_t *self)
{
self->monsterinfo.currentmove = &jorg_move_attack1;
}
void jorg_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
self->s.sound = 0;
if (level.time < self->pain_debounce_time)
return;
// Lessen the chance of him going into his pain frames if he takes little damage
if (damage <= 40)
if (random()<=0.6)
return;
/*
If he's entering his attack1 or using attack1, lessen the chance of him
going into pain
*/
if ( (self->s.frame >= FRAME_attak101) && (self->s.frame <= FRAME_attak108) )
if (random() <= 0.005)
return;
if ( (self->s.frame >= FRAME_attak109) && (self->s.frame <= FRAME_attak114) )
if (random() <= 0.00005)
return;
if ( (self->s.frame >= FRAME_attak201) && (self->s.frame <= FRAME_attak208) )
if (random() <= 0.005)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
if (damage <= 50)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM,0);
self->monsterinfo.currentmove = &jorg_move_pain1;
}
else if (damage <= 100)
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM,0);
self->monsterinfo.currentmove = &jorg_move_pain2;
}
else
{
if (random() <= 0.3)
{
gi.sound (self, CHAN_VOICE, sound_pain3, 1, ATTN_NORM,0);
self->monsterinfo.currentmove = &jorg_move_pain3;
}
}
};
void jorgBFG (edict_t *self)
{
vec3_t forward, right;
vec3_t start;
vec3_t dir;
vec3_t vec;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_JORG_BFG_1], forward, right, start);
VectorCopy (self->enemy->s.origin, vec);
vec[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (vec, start, dir);
VectorNormalize (dir);
gi.sound (self, CHAN_VOICE, sound_attack2, 1, ATTN_NORM, 0);
/*void monster_fire_bfg (edict_t *self,
vec3_t start,
vec3_t aimdir,
int damage,
int speed,
int kick,
float damage_radius,
int flashtype)*/
monster_fire_bfg (self, start, dir, 50, 300, 100, 200, MZ2_JORG_BFG_1);
}
void jorg_firebullet_right (edict_t *self)
{
vec3_t forward, right, target;
vec3_t start;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_JORG_MACHINEGUN_R1], forward, right, start);
VectorMA (self->enemy->s.origin, -0.2, self->enemy->velocity, target);
target[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
target[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (target, start, forward);
VectorNormalize (forward);
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_JORG_MACHINEGUN_R1);
}
void jorg_firebullet_left (edict_t *self)
{
vec3_t forward, right, target;
vec3_t start;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_JORG_MACHINEGUN_L1], forward, right, start);
VectorMA (self->enemy->s.origin, -0.2, self->enemy->velocity, target);
target[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
target[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (target, start, forward);
VectorNormalize (forward);
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_JORG_MACHINEGUN_L1);
}
void jorg_firebullet (edict_t *self)
{
jorg_firebullet_left(self);
jorg_firebullet_right(self);
};
void jorg_attack(edict_t *self)
{
vec3_t vec;
float range;
VectorSubtract (self->enemy->s.origin, self->s.origin, vec);
range = VectorLength (vec);
if (random() <= 0.75)
{
gi.sound (self, CHAN_VOICE, sound_attack1, 1, ATTN_NORM,0);
self->s.sound = gi.soundindex ("boss3/w_loop.wav");
self->monsterinfo.currentmove = &jorg_move_start_attack1;
}
else
{
gi.sound (self, CHAN_VOICE, sound_attack2, 1, ATTN_NORM,0);
self->monsterinfo.currentmove = &jorg_move_attack2;
}
}
void jorg_dead (edict_t *self)
{
#if 0
edict_t *tempent;
/*
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
*/
// Jorg is on weaponmodel. Do not clear him.
VectorSet (self->mins, -60, -60, 0);
VectorSet (self->maxs, 60, 60, 72);
self->movetype = MOVETYPE_TOSS;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
tempent = G_Spawn();
VectorCopy (self->s.origin, tempent->s.origin);
VectorCopy (self->s.angles, tempent->s.angles);
tempent->killtarget = self->killtarget;
tempent->target = self->target;
tempent->activator = self->enemy;
self->killtarget = 0;
self->target = 0;
SP_monster_makron (tempent);
#endif
}
void jorg_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_NO;
self->s.sound = 0;
self->count = 0;
self->monsterinfo.currentmove = &jorg_move_death;
}
bool Jorg_CheckAttack (edict_t *self)
{
vec3_t spot1, spot2;
vec3_t temp;
float chance;
trace_t tr;
bool enemy_infront;
int enemy_range;
float enemy_yaw;
if (self->enemy->health > 0)
{
// see if any entities are in the way of the shot
VectorCopy (self->s.origin, spot1);
spot1[2] += self->viewheight;
VectorCopy (self->enemy->s.origin, spot2);
spot2[2] += self->enemy->viewheight;
tr = gi.trace (spot1, NULL, NULL, spot2, self, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_SLIME|CONTENTS_LAVA);
// do we have a clear shot?
if (tr.ent != self->enemy)
return false;
}
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp);
self->ideal_yaw = enemy_yaw;
// melee attack
if (enemy_range == RANGE_MELEE)
{
if (self->monsterinfo.melee)
self->monsterinfo.attack_state = AS_MELEE;
else
self->monsterinfo.attack_state = AS_MISSILE;
return true;
}
// missile attack
if (!self->monsterinfo.attack)
return false;
if (level.time < self->monsterinfo.attack_finished)
return false;
if (enemy_range == RANGE_FAR)
return false;
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
chance = 0.4;
}
else if (enemy_range == RANGE_MELEE)
{
chance = 0.8;
}
else if (enemy_range == RANGE_NEAR)
{
chance = 0.4;
}
else if (enemy_range == RANGE_MID)
{
chance = 0.2;
}
else
{
return false;
}
if (random () < chance)
{
self->monsterinfo.attack_state = AS_MISSILE;
self->monsterinfo.attack_finished = level.time + 2*random();
return true;
}
if (self->flags & FL_FLY)
{
if (random() < 0.3)
self->monsterinfo.attack_state = AS_SLIDING;
else
self->monsterinfo.attack_state = AS_STRAIGHT;
}
return false;
}
void MakronPrecache (void);
/*QUAKED monster_jorg (1 .5 0) (-80 -80 0) (90 90 140) Ambush Trigger_Spawn Sight
*/
void SP_monster_jorg (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_JORG;
sound_pain1 = gi.soundindex ("boss3/bs3pain1.wav");
sound_pain2 = gi.soundindex ("boss3/bs3pain2.wav");
sound_pain3 = gi.soundindex ("boss3/bs3pain3.wav");
sound_death = gi.soundindex ("boss3/bs3deth1.wav");
sound_attack1 = gi.soundindex ("boss3/bs3atck1.wav");
sound_attack2 = gi.soundindex ("boss3/bs3atck2.wav");
sound_search1 = gi.soundindex ("boss3/bs3srch1.wav");
sound_search2 = gi.soundindex ("boss3/bs3srch2.wav");
sound_search3 = gi.soundindex ("boss3/bs3srch3.wav");
sound_idle = gi.soundindex ("boss3/bs3idle1.wav");
sound_step_left = gi.soundindex ("boss3/step1.wav");
sound_step_right = gi.soundindex ("boss3/step2.wav");
sound_firegun = gi.soundindex ("boss3/xfire.wav");
sound_death_hit = gi.soundindex ("boss3/d_hit.wav");
MakronPrecache ();
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
self->s.modelindex = gi.modelindex ("models/monsters/boss3/rider/tris.md2");
self->s.weaponmodel = gi.modelindex ("models/monsters/boss3/jorg/tris.md2");
VectorSet (self->mins, -80, -80, 0);
VectorSet (self->maxs, 80, 80, 140);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 3000;
if(!self->gib_health)
self->gib_health = -2000;
if(!self->mass)
self->mass = 1000;
self->pain = jorg_pain;
self->die = jorg_die;
self->monsterinfo.stand = jorg_stand;
self->monsterinfo.walk = jorg_walk;
self->monsterinfo.run = jorg_run;
self->monsterinfo.dodge = NULL;
self->monsterinfo.attack = jorg_attack;
self->monsterinfo.search = jorg_search;
self->monsterinfo.melee = NULL;
self->monsterinfo.sight = NULL;
self->monsterinfo.checkattack = Jorg_CheckAttack;
gi.linkentity (self);
self->monsterinfo.currentmove = &jorg_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&jorg_move_death,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->monsterinfo.scale = MODEL_SCALE;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
self->common_name = "Jorg";
walkmonster_start(self);
}

View File

@ -1,194 +0,0 @@
// G:\quake2\baseq2\models/monsters/boss3/jorg
// This file generated by ModelGen - Do NOT Modify
#define FRAME_attak101 0
#define FRAME_attak102 1
#define FRAME_attak103 2
#define FRAME_attak104 3
#define FRAME_attak105 4
#define FRAME_attak106 5
#define FRAME_attak107 6
#define FRAME_attak108 7
#define FRAME_attak109 8
#define FRAME_attak110 9
#define FRAME_attak111 10
#define FRAME_attak112 11
#define FRAME_attak113 12
#define FRAME_attak114 13
#define FRAME_attak115 14
#define FRAME_attak116 15
#define FRAME_attak117 16
#define FRAME_attak118 17
#define FRAME_attak201 18
#define FRAME_attak202 19
#define FRAME_attak203 20
#define FRAME_attak204 21
#define FRAME_attak205 22
#define FRAME_attak206 23
#define FRAME_attak207 24
#define FRAME_attak208 25
#define FRAME_attak209 26
#define FRAME_attak210 27
#define FRAME_attak211 28
#define FRAME_attak212 29
#define FRAME_attak213 30
#define FRAME_death01 31
#define FRAME_death02 32
#define FRAME_death03 33
#define FRAME_death04 34
#define FRAME_death05 35
#define FRAME_death06 36
#define FRAME_death07 37
#define FRAME_death08 38
#define FRAME_death09 39
#define FRAME_death10 40
#define FRAME_death11 41
#define FRAME_death12 42
#define FRAME_death13 43
#define FRAME_death14 44
#define FRAME_death15 45
#define FRAME_death16 46
#define FRAME_death17 47
#define FRAME_death18 48
#define FRAME_death19 49
#define FRAME_death20 50
#define FRAME_death21 51
#define FRAME_death22 52
#define FRAME_death23 53
#define FRAME_death24 54
#define FRAME_death25 55
#define FRAME_death26 56
#define FRAME_death27 57
#define FRAME_death28 58
#define FRAME_death29 59
#define FRAME_death30 60
#define FRAME_death31 61
#define FRAME_death32 62
#define FRAME_death33 63
#define FRAME_death34 64
#define FRAME_death35 65
#define FRAME_death36 66
#define FRAME_death37 67
#define FRAME_death38 68
#define FRAME_death39 69
#define FRAME_death40 70
#define FRAME_death41 71
#define FRAME_death42 72
#define FRAME_death43 73
#define FRAME_death44 74
#define FRAME_death45 75
#define FRAME_death46 76
#define FRAME_death47 77
#define FRAME_death48 78
#define FRAME_death49 79
#define FRAME_death50 80
#define FRAME_pain101 81
#define FRAME_pain102 82
#define FRAME_pain103 83
#define FRAME_pain201 84
#define FRAME_pain202 85
#define FRAME_pain203 86
#define FRAME_pain301 87
#define FRAME_pain302 88
#define FRAME_pain303 89
#define FRAME_pain304 90
#define FRAME_pain305 91
#define FRAME_pain306 92
#define FRAME_pain307 93
#define FRAME_pain308 94
#define FRAME_pain309 95
#define FRAME_pain310 96
#define FRAME_pain311 97
#define FRAME_pain312 98
#define FRAME_pain313 99
#define FRAME_pain314 100
#define FRAME_pain315 101
#define FRAME_pain316 102
#define FRAME_pain317 103
#define FRAME_pain318 104
#define FRAME_pain319 105
#define FRAME_pain320 106
#define FRAME_pain321 107
#define FRAME_pain322 108
#define FRAME_pain323 109
#define FRAME_pain324 110
#define FRAME_pain325 111
#define FRAME_stand01 112
#define FRAME_stand02 113
#define FRAME_stand03 114
#define FRAME_stand04 115
#define FRAME_stand05 116
#define FRAME_stand06 117
#define FRAME_stand07 118
#define FRAME_stand08 119
#define FRAME_stand09 120
#define FRAME_stand10 121
#define FRAME_stand11 122
#define FRAME_stand12 123
#define FRAME_stand13 124
#define FRAME_stand14 125
#define FRAME_stand15 126
#define FRAME_stand16 127
#define FRAME_stand17 128
#define FRAME_stand18 129
#define FRAME_stand19 130
#define FRAME_stand20 131
#define FRAME_stand21 132
#define FRAME_stand22 133
#define FRAME_stand23 134
#define FRAME_stand24 135
#define FRAME_stand25 136
#define FRAME_stand26 137
#define FRAME_stand27 138
#define FRAME_stand28 139
#define FRAME_stand29 140
#define FRAME_stand30 141
#define FRAME_stand31 142
#define FRAME_stand32 143
#define FRAME_stand33 144
#define FRAME_stand34 145
#define FRAME_stand35 146
#define FRAME_stand36 147
#define FRAME_stand37 148
#define FRAME_stand38 149
#define FRAME_stand39 150
#define FRAME_stand40 151
#define FRAME_stand41 152
#define FRAME_stand42 153
#define FRAME_stand43 154
#define FRAME_stand44 155
#define FRAME_stand45 156
#define FRAME_stand46 157
#define FRAME_stand47 158
#define FRAME_stand48 159
#define FRAME_stand49 160
#define FRAME_stand50 161
#define FRAME_stand51 162
#define FRAME_walk01 163
#define FRAME_walk02 164
#define FRAME_walk03 165
#define FRAME_walk04 166
#define FRAME_walk05 167
#define FRAME_walk06 168
#define FRAME_walk07 169
#define FRAME_walk08 170
#define FRAME_walk09 171
#define FRAME_walk10 172
#define FRAME_walk11 173
#define FRAME_walk12 174
#define FRAME_walk13 175
#define FRAME_walk14 176
#define FRAME_walk15 177
#define FRAME_walk16 178
#define FRAME_walk17 179
#define FRAME_walk18 180
#define FRAME_walk19 181
#define FRAME_walk20 182
#define FRAME_walk21 183
#define FRAME_walk22 184
#define FRAME_walk23 185
#define FRAME_walk24 186
#define FRAME_walk25 187
#define MODEL_SCALE 1.000000

View File

@ -1,953 +0,0 @@
/*
==============================================================================
Makron -- Final Boss
==============================================================================
*/
#include "g_local.h"
#include "m_boss32.h"
bool visible (edict_t *self, edict_t *other);
void MakronRailgun (edict_t *self);
void MakronSaveloc (edict_t *self);
void MakronHyperblaster (edict_t *self);
void makron_step_left (edict_t *self);
void makron_step_right (edict_t *self);
void makronBFG (edict_t *self);
void makron_dead (edict_t *self);
static int sound_pain4;
static int sound_pain5;
static int sound_pain6;
static int sound_death;
static int sound_step_left;
static int sound_step_right;
static int sound_attack_bfg;
static int sound_brainsplorch;
static int sound_prerailgun;
static int sound_popup;
static int sound_taunt1;
static int sound_taunt2;
static int sound_taunt3;
static int sound_hit;
void makron_taunt (edict_t *self)
{
float r;
r=random();
if (r <= 0.3)
gi.sound (self, CHAN_AUTO, sound_taunt1, 1, ATTN_NONE, 0);
else if (r <= 0.6)
gi.sound (self, CHAN_AUTO, sound_taunt2, 1, ATTN_NONE, 0);
else
gi.sound (self, CHAN_AUTO, sound_taunt3, 1, ATTN_NONE, 0);
}
//
// stand
//
mframe_t makron_frames_stand []=
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 10
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 20
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 30
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 40
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 50
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL // 60
};
mmove_t makron_move_stand = {FRAME_stand201, FRAME_stand260, makron_frames_stand, NULL};
void makron_stand (edict_t *self)
{
self->monsterinfo.currentmove = &makron_move_stand;
}
mframe_t makron_frames_run [] =
{
ai_run, 3, makron_step_left,
ai_run, 12, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, makron_step_right,
ai_run, 6, NULL,
ai_run, 12, NULL,
ai_run, 9, NULL,
ai_run, 6, NULL,
ai_run, 12, NULL
};
mmove_t makron_move_run = {FRAME_walk204, FRAME_walk213, makron_frames_run, NULL};
void makron_hit (edict_t *self)
{
gi.sound (self, CHAN_AUTO, sound_hit, 1, ATTN_NONE,0);
}
void makron_popup (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_popup, 1, ATTN_NONE,0);
}
void makron_step_left (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_step_left, 1, ATTN_NORM,0);
}
void makron_step_right (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_step_right, 1, ATTN_NORM,0);
}
void makron_brainsplorch (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_brainsplorch, 1, ATTN_NORM,0);
}
void makron_prerailgun (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_prerailgun, 1, ATTN_NORM,0);
}
mframe_t makron_frames_walk [] =
{
ai_walk, 3, makron_step_left,
ai_walk, 12, NULL,
ai_walk, 8, NULL,
ai_walk, 8, NULL,
ai_walk, 8, makron_step_right,
ai_walk, 6, NULL,
ai_walk, 12, NULL,
ai_walk, 9, NULL,
ai_walk, 6, NULL,
ai_walk, 12, NULL
};
mmove_t makron_move_walk = {FRAME_walk204, FRAME_walk213, makron_frames_run, NULL};
void makron_walk (edict_t *self)
{
self->monsterinfo.currentmove = &makron_move_walk;
}
void makron_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &makron_move_stand;
else
self->monsterinfo.currentmove = &makron_move_run;
}
mframe_t makron_frames_pain6 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 10
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, makron_popup,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 20
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, makron_taunt,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t makron_move_pain6 = {FRAME_pain601, FRAME_pain627, makron_frames_pain6, makron_run};
mframe_t makron_frames_pain5 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t makron_move_pain5 = {FRAME_pain501, FRAME_pain504, makron_frames_pain5, makron_run};
mframe_t makron_frames_pain4 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t makron_move_pain4 = {FRAME_pain401, FRAME_pain404, makron_frames_pain4, makron_run};
mframe_t makron_frames_death2 [] =
{
ai_move, -15, NULL,
ai_move, 3, NULL,
ai_move, -12, NULL,
ai_move, 0, makron_step_left,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 10
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 11, NULL,
ai_move, 12, NULL,
ai_move, 11, makron_step_right,
ai_move, 0, NULL,
ai_move, 0, NULL, // 20
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 30
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 5, NULL,
ai_move, 7, NULL,
ai_move, 6, makron_step_left,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, 2, NULL, // 40
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 50
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -6, NULL,
ai_move, -4, NULL,
ai_move, -6, makron_step_right,
ai_move, -4, NULL,
ai_move, -4, makron_step_left,
ai_move, 0, NULL,
ai_move, 0, NULL, // 60
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -2, NULL,
ai_move, -5, NULL,
ai_move, -3, makron_step_right,
ai_move, -8, NULL,
ai_move, -3, makron_step_left,
ai_move, -7, NULL,
ai_move, -4, NULL,
ai_move, -4, makron_step_right, // 70
ai_move, -6, NULL,
ai_move, -7, NULL,
ai_move, 0, makron_step_left,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 80
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL, // 90
ai_move, 27, makron_hit,
ai_move, 26, NULL,
ai_move, 0, makron_brainsplorch,
ai_move, 0, NULL,
ai_move, 0, NULL // 95
};
mmove_t makron_move_death2 = {FRAME_death201, FRAME_death295, makron_frames_death2, makron_dead};
mframe_t makron_frames_death3 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t makron_move_death3 = {FRAME_death301, FRAME_death320, makron_frames_death3, NULL};
mframe_t makron_frames_sight [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t makron_move_sight= {FRAME_active01, FRAME_active13, makron_frames_sight, makron_run};
void makronBFG (edict_t *self)
{
vec3_t forward, right;
vec3_t start;
vec3_t dir;
vec3_t vec;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_MAKRON_BFG], forward, right, start);
VectorCopy (self->enemy->s.origin, vec);
vec[2] += self->enemy->viewheight;
VectorSubtract (vec, start, dir);
VectorNormalize (dir);
gi.sound (self, CHAN_VOICE, sound_attack_bfg, 1, ATTN_NORM, 0);
monster_fire_bfg (self, start, dir, 50, 300, 100, 300, MZ2_MAKRON_BFG);
}
mframe_t makron_frames_attack3 []=
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, makronBFG, // FIXME: BFG Attack here
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t makron_move_attack3 = {FRAME_attak301, FRAME_attak308, makron_frames_attack3, makron_run};
mframe_t makron_frames_attack4[]=
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, MakronHyperblaster, // fire
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t makron_move_attack4 = {FRAME_attak401, FRAME_attak426, makron_frames_attack4, makron_run};
mframe_t makron_frames_attack5[]=
{
ai_charge, 0, makron_prerailgun,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, MakronSaveloc,
ai_move, 0, MakronRailgun, // Fire railgun
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t makron_move_attack5 = {FRAME_attak501, FRAME_attak516, makron_frames_attack5, makron_run};
void MakronSaveloc (edict_t *self)
{
VectorCopy (self->enemy->s.origin, self->pos1); //save for aiming the shot
self->pos1[2] += self->enemy->viewheight;
};
// FIXME: He's not firing from the proper Z
void MakronRailgun (edict_t *self)
{
vec3_t start;
vec3_t dir;
vec3_t forward, right;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_MAKRON_RAILGUN_1], forward, right, start);
// calc direction to where we targted
VectorSubtract (self->pos1, start, dir);
VectorNormalize (dir);
monster_fire_railgun (self, start, dir, 50, 100, MZ2_MAKRON_RAILGUN_1);
}
// FIXME: This is all wrong. He's not firing at the proper angles.
void MakronHyperblaster (edict_t *self)
{
vec3_t dir;
vec3_t vec;
vec3_t start;
vec3_t forward, right;
int flash_number;
flash_number = MZ2_MAKRON_BLASTER_1 + (self->s.frame - FRAME_attak405);
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
if (self->enemy)
{
VectorCopy (self->enemy->s.origin, vec);
vec[2] += self->enemy->viewheight;
VectorSubtract (vec, start, vec);
vectoangles (vec, vec);
dir[0] = vec[0];
}
else
{
dir[0] = 0;
}
if (self->s.frame <= FRAME_attak413)
dir[1] = self->s.angles[1] - 10 * (self->s.frame - FRAME_attak413);
else
dir[1] = self->s.angles[1] + 10 * (self->s.frame - FRAME_attak421);
dir[2] = 0;
AngleVectors (dir, forward, NULL, NULL);
monster_fire_blaster (self, start, forward, 15, 1000, MZ2_MAKRON_BLASTER_1, EF_BLASTER);
}
void makron_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
// Lessen the chance of him going into his pain frames
if (damage <=25)
if (random()<0.2)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
if (damage <= 40)
{
gi.sound (self, CHAN_VOICE, sound_pain4, 1, ATTN_NONE,0);
self->monsterinfo.currentmove = &makron_move_pain4;
}
else if (damage <= 110)
{
gi.sound (self, CHAN_VOICE, sound_pain5, 1, ATTN_NONE,0);
self->monsterinfo.currentmove = &makron_move_pain5;
}
else
{
if (damage <= 150)
if (random() <= 0.45)
{
gi.sound (self, CHAN_VOICE, sound_pain6, 1, ATTN_NONE,0);
self->monsterinfo.currentmove = &makron_move_pain6;
}
else
if (random() <= 0.35)
{
gi.sound (self, CHAN_VOICE, sound_pain6, 1, ATTN_NONE,0);
self->monsterinfo.currentmove = &makron_move_pain6;
}
}
};
void makron_sight(edict_t *self, edict_t *other)
{
self->monsterinfo.currentmove = &makron_move_sight;
};
void makron_attack(edict_t *self)
{
vec3_t vec;
float range;
float r;
r = random();
VectorSubtract (self->enemy->s.origin, self->s.origin, vec);
range = VectorLength (vec);
if (r <= 0.3)
self->monsterinfo.currentmove = &makron_move_attack3;
else if (r <= 0.6)
self->monsterinfo.currentmove = &makron_move_attack4;
else
self->monsterinfo.currentmove = &makron_move_attack5;
}
/*
---
Makron Torso. This needs to be spawned in
---
*/
void makron_torso_think (edict_t *self)
{
if (++self->s.frame < 365)
self->nextthink = level.time + FRAMETIME;
else
{
self->s.frame = 346;
self->nextthink = level.time + FRAMETIME;
}
}
void makron_torso_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
for (n= 0; n < 1 /*4*/; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_metal/tris.md2", damage, GIB_METALLIC);
G_FreeEdict(self);
return;
}
}
void makron_torso (edict_t *ent)
{
// ent->movetype = MOVETYPE_NONE;
// ent->solid = SOLID_NOT;
// VectorSet (ent->mins, -8, -8, 0);
// VectorSet (ent->maxs, 8, 8, 8);
// Lazarus changes to make makron torso gibbable
ent->movetype = MOVETYPE_NONE;
ent->solid = SOLID_BBOX;
ent->svflags = SVF_DEADMONSTER;
VectorSet (ent->mins, -32, -32, 0);
VectorSet (ent->maxs, 32, 32, 32);
ent->health = -1;
ent->gib_health = -900;
ent->die = makron_torso_die;
ent->takedamage = DAMAGE_YES;
ent->deadflag = DEAD_DEAD;
ent->s.frame = 346;
ent->s.modelindex = gi.modelindex ("models/monsters/boss3/rider/tris.md2");
ent->think = makron_torso_think;
ent->nextthink = level.time + 2 * FRAMETIME;
ent->s.sound = gi.soundindex ("makron/spine.wav");
gi.linkentity (ent);
}
//
// death
//
void makron_dead (edict_t *self)
{
// Lazarus - this is way too big
// VectorSet (self->mins, -60, -60, 0);
// VectorSet (self->maxs, 60, 60, 72);
VectorSet (self->mins, -48, -48, 0);
VectorSet (self->maxs, 48, 48, 32);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
}
void makron_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
edict_t *tempent;
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
self->s.sound = 0;
// check for gib
if (self->health <= self->gib_health&& !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 1 /*4*/; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_metal/tris.md2", damage, GIB_METALLIC);
ThrowHead (self, "models/objects/gibs/gear/tris.md2", damage, GIB_METALLIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NONE, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
tempent = G_Spawn();
VectorCopy (self->s.origin, tempent->s.origin);
VectorCopy (self->s.angles, tempent->s.angles);
tempent->s.origin[1] -= 84;
makron_torso (tempent);
self->monsterinfo.currentmove = &makron_move_death2;
}
bool Makron_CheckAttack (edict_t *self)
{
vec3_t spot1, spot2;
vec3_t temp;
float chance;
trace_t tr;
bool enemy_infront;
int enemy_range;
float enemy_yaw;
if (self->enemy->health > 0)
{
// see if any entities are in the way of the shot
VectorCopy (self->s.origin, spot1);
spot1[2] += self->viewheight;
VectorCopy (self->enemy->s.origin, spot2);
spot2[2] += self->enemy->viewheight;
tr = gi.trace (spot1, NULL, NULL, spot2, self, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_SLIME|CONTENTS_LAVA);
// do we have a clear shot?
if (tr.ent != self->enemy)
return false;
}
enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp);
self->ideal_yaw = enemy_yaw;
// melee attack
if (enemy_range == RANGE_MELEE)
{
if (self->monsterinfo.melee)
self->monsterinfo.attack_state = AS_MELEE;
else
self->monsterinfo.attack_state = AS_MISSILE;
return true;
}
// missile attack
if (!self->monsterinfo.attack)
return false;
if (level.time < self->monsterinfo.attack_finished)
return false;
if (enemy_range == RANGE_FAR)
return false;
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
chance = 0.4;
}
else if (enemy_range == RANGE_MELEE)
{
chance = 0.8;
}
else if (enemy_range == RANGE_NEAR)
{
chance = 0.4;
}
else if (enemy_range == RANGE_MID)
{
chance = 0.2;
}
else
{
return false;
}
if (random () < chance)
{
self->monsterinfo.attack_state = AS_MISSILE;
self->monsterinfo.attack_finished = level.time + 2*random();
return true;
}
if (self->flags & FL_FLY)
{
if (random() < 0.3)
self->monsterinfo.attack_state = AS_SLIDING;
else
self->monsterinfo.attack_state = AS_STRAIGHT;
}
return false;
}
//
// monster_makron
//
void MakronPrecache (void)
{
sound_pain4 = gi.soundindex ("makron/pain3.wav");
sound_pain5 = gi.soundindex ("makron/pain2.wav");
sound_pain6 = gi.soundindex ("makron/pain1.wav");
sound_death = gi.soundindex ("makron/death.wav");
sound_step_left = gi.soundindex ("makron/step1.wav");
sound_step_right = gi.soundindex ("makron/step2.wav");
sound_attack_bfg = gi.soundindex ("makron/bfg_fire.wav");
sound_brainsplorch = gi.soundindex ("makron/brain1.wav");
sound_prerailgun = gi.soundindex ("makron/rail_up.wav");
sound_popup = gi.soundindex ("makron/popup.wav");
sound_taunt1 = gi.soundindex ("makron/voice4.wav");
sound_taunt2 = gi.soundindex ("makron/voice3.wav");
sound_taunt3 = gi.soundindex ("makron/voice.wav");
sound_hit = gi.soundindex ("makron/bhit.wav");
gi.modelindex ("models/monsters/boss3/rider/tris.md2");
}
/*QUAKED monster_makron (1 .5 0) (-30 -30 0) (30 30 90) Ambush Trigger_Spawn Sight
*/
void SP_monster_makron (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_MAKRON;
MakronPrecache ();
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
self->s.modelindex = gi.modelindex ("models/monsters/boss3/rider/tris.md2");
VectorSet (self->mins, -30, -30, 0);
VectorSet (self->maxs, 30, 30, 90);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 3000;
// Lazarus: get around Killed's prevention of health dropping below -999
// if(!self->gib_health)
// self->gib_health = -2000;
self->gib_health = -900;
if(!self->mass)
self->mass = 500;
self->pain = makron_pain;
self->die = makron_die;
self->monsterinfo.stand = makron_stand;
self->monsterinfo.walk = makron_walk;
self->monsterinfo.run = makron_run;
self->monsterinfo.dodge = NULL;
self->monsterinfo.attack = makron_attack;
self->monsterinfo.melee = NULL;
self->monsterinfo.sight = makron_sight;
self->monsterinfo.checkattack = Makron_CheckAttack;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
gi.linkentity (self);
self->monsterinfo.currentmove = &makron_move_sight;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&makron_move_death2,
&makron_move_death3,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start(self);
}
/*
=================
MakronSpawn
=================
*/
void MakronSpawn (edict_t *self)
{
vec3_t vec;
edict_t *player;
SP_monster_makron (self);
// jump at player
player = level.sight_client;
if (!player)
return;
VectorSubtract (player->s.origin, self->s.origin, vec);
self->s.angles[YAW] = vectoyaw(vec);
VectorNormalize (vec);
VectorMA (vec3_origin, 400, vec, self->velocity);
self->velocity[2] = 200;
self->groundentity = NULL;
}
/*
=================
MakronToss
Jorg is just about dead, so set up to launch Makron out
=================
*/
void MakronToss (edict_t *self)
{
edict_t *ent;
ent = G_Spawn ();
ent->nextthink = level.time + 0.8;
ent->think = MakronSpawn;
ent->target = self->target;
ent->health = self->health2;
ent->mass = self->mass2;
ent->common_name = "Makron";
VectorCopy (self->s.origin, ent->s.origin);
}

View File

@ -1,497 +0,0 @@
// G:\quake2\baseq2\models/monsters/boss3/rider
// This file generated by ModelGen - Do NOT Modify
#define FRAME_attak101 0
#define FRAME_attak102 1
#define FRAME_attak103 2
#define FRAME_attak104 3
#define FRAME_attak105 4
#define FRAME_attak106 5
#define FRAME_attak107 6
#define FRAME_attak108 7
#define FRAME_attak109 8
#define FRAME_attak110 9
#define FRAME_attak111 10
#define FRAME_attak112 11
#define FRAME_attak113 12
#define FRAME_attak114 13
#define FRAME_attak115 14
#define FRAME_attak116 15
#define FRAME_attak117 16
#define FRAME_attak118 17
#define FRAME_attak201 18
#define FRAME_attak202 19
#define FRAME_attak203 20
#define FRAME_attak204 21
#define FRAME_attak205 22
#define FRAME_attak206 23
#define FRAME_attak207 24
#define FRAME_attak208 25
#define FRAME_attak209 26
#define FRAME_attak210 27
#define FRAME_attak211 28
#define FRAME_attak212 29
#define FRAME_attak213 30
#define FRAME_death01 31
#define FRAME_death02 32
#define FRAME_death03 33
#define FRAME_death04 34
#define FRAME_death05 35
#define FRAME_death06 36
#define FRAME_death07 37
#define FRAME_death08 38
#define FRAME_death09 39
#define FRAME_death10 40
#define FRAME_death11 41
#define FRAME_death12 42
#define FRAME_death13 43
#define FRAME_death14 44
#define FRAME_death15 45
#define FRAME_death16 46
#define FRAME_death17 47
#define FRAME_death18 48
#define FRAME_death19 49
#define FRAME_death20 50
#define FRAME_death21 51
#define FRAME_death22 52
#define FRAME_death23 53
#define FRAME_death24 54
#define FRAME_death25 55
#define FRAME_death26 56
#define FRAME_death27 57
#define FRAME_death28 58
#define FRAME_death29 59
#define FRAME_death30 60
#define FRAME_death31 61
#define FRAME_death32 62
#define FRAME_death33 63
#define FRAME_death34 64
#define FRAME_death35 65
#define FRAME_death36 66
#define FRAME_death37 67
#define FRAME_death38 68
#define FRAME_death39 69
#define FRAME_death40 70
#define FRAME_death41 71
#define FRAME_death42 72
#define FRAME_death43 73
#define FRAME_death44 74
#define FRAME_death45 75
#define FRAME_death46 76
#define FRAME_death47 77
#define FRAME_death48 78
#define FRAME_death49 79
#define FRAME_death50 80
#define FRAME_pain101 81
#define FRAME_pain102 82
#define FRAME_pain103 83
#define FRAME_pain201 84
#define FRAME_pain202 85
#define FRAME_pain203 86
#define FRAME_pain301 87
#define FRAME_pain302 88
#define FRAME_pain303 89
#define FRAME_pain304 90
#define FRAME_pain305 91
#define FRAME_pain306 92
#define FRAME_pain307 93
#define FRAME_pain308 94
#define FRAME_pain309 95
#define FRAME_pain310 96
#define FRAME_pain311 97
#define FRAME_pain312 98
#define FRAME_pain313 99
#define FRAME_pain314 100
#define FRAME_pain315 101
#define FRAME_pain316 102
#define FRAME_pain317 103
#define FRAME_pain318 104
#define FRAME_pain319 105
#define FRAME_pain320 106
#define FRAME_pain321 107
#define FRAME_pain322 108
#define FRAME_pain323 109
#define FRAME_pain324 110
#define FRAME_pain325 111
#define FRAME_stand01 112
#define FRAME_stand02 113
#define FRAME_stand03 114
#define FRAME_stand04 115
#define FRAME_stand05 116
#define FRAME_stand06 117
#define FRAME_stand07 118
#define FRAME_stand08 119
#define FRAME_stand09 120
#define FRAME_stand10 121
#define FRAME_stand11 122
#define FRAME_stand12 123
#define FRAME_stand13 124
#define FRAME_stand14 125
#define FRAME_stand15 126
#define FRAME_stand16 127
#define FRAME_stand17 128
#define FRAME_stand18 129
#define FRAME_stand19 130
#define FRAME_stand20 131
#define FRAME_stand21 132
#define FRAME_stand22 133
#define FRAME_stand23 134
#define FRAME_stand24 135
#define FRAME_stand25 136
#define FRAME_stand26 137
#define FRAME_stand27 138
#define FRAME_stand28 139
#define FRAME_stand29 140
#define FRAME_stand30 141
#define FRAME_stand31 142
#define FRAME_stand32 143
#define FRAME_stand33 144
#define FRAME_stand34 145
#define FRAME_stand35 146
#define FRAME_stand36 147
#define FRAME_stand37 148
#define FRAME_stand38 149
#define FRAME_stand39 150
#define FRAME_stand40 151
#define FRAME_stand41 152
#define FRAME_stand42 153
#define FRAME_stand43 154
#define FRAME_stand44 155
#define FRAME_stand45 156
#define FRAME_stand46 157
#define FRAME_stand47 158
#define FRAME_stand48 159
#define FRAME_stand49 160
#define FRAME_stand50 161
#define FRAME_stand51 162
#define FRAME_walk01 163
#define FRAME_walk02 164
#define FRAME_walk03 165
#define FRAME_walk04 166
#define FRAME_walk05 167
#define FRAME_walk06 168
#define FRAME_walk07 169
#define FRAME_walk08 170
#define FRAME_walk09 171
#define FRAME_walk10 172
#define FRAME_walk11 173
#define FRAME_walk12 174
#define FRAME_walk13 175
#define FRAME_walk14 176
#define FRAME_walk15 177
#define FRAME_walk16 178
#define FRAME_walk17 179
#define FRAME_walk18 180
#define FRAME_walk19 181
#define FRAME_walk20 182
#define FRAME_walk21 183
#define FRAME_walk22 184
#define FRAME_walk23 185
#define FRAME_walk24 186
#define FRAME_walk25 187
#define FRAME_active01 188
#define FRAME_active02 189
#define FRAME_active03 190
#define FRAME_active04 191
#define FRAME_active05 192
#define FRAME_active06 193
#define FRAME_active07 194
#define FRAME_active08 195
#define FRAME_active09 196
#define FRAME_active10 197
#define FRAME_active11 198
#define FRAME_active12 199
#define FRAME_active13 200
#define FRAME_attak301 201
#define FRAME_attak302 202
#define FRAME_attak303 203
#define FRAME_attak304 204
#define FRAME_attak305 205
#define FRAME_attak306 206
#define FRAME_attak307 207
#define FRAME_attak308 208
#define FRAME_attak401 209
#define FRAME_attak402 210
#define FRAME_attak403 211
#define FRAME_attak404 212
#define FRAME_attak405 213
#define FRAME_attak406 214
#define FRAME_attak407 215
#define FRAME_attak408 216
#define FRAME_attak409 217
#define FRAME_attak410 218
#define FRAME_attak411 219
#define FRAME_attak412 220
#define FRAME_attak413 221
#define FRAME_attak414 222
#define FRAME_attak415 223
#define FRAME_attak416 224
#define FRAME_attak417 225
#define FRAME_attak418 226
#define FRAME_attak419 227
#define FRAME_attak420 228
#define FRAME_attak421 229
#define FRAME_attak422 230
#define FRAME_attak423 231
#define FRAME_attak424 232
#define FRAME_attak425 233
#define FRAME_attak426 234
#define FRAME_attak501 235
#define FRAME_attak502 236
#define FRAME_attak503 237
#define FRAME_attak504 238
#define FRAME_attak505 239
#define FRAME_attak506 240
#define FRAME_attak507 241
#define FRAME_attak508 242
#define FRAME_attak509 243
#define FRAME_attak510 244
#define FRAME_attak511 245
#define FRAME_attak512 246
#define FRAME_attak513 247
#define FRAME_attak514 248
#define FRAME_attak515 249
#define FRAME_attak516 250
#define FRAME_death201 251
#define FRAME_death202 252
#define FRAME_death203 253
#define FRAME_death204 254
#define FRAME_death205 255
#define FRAME_death206 256
#define FRAME_death207 257
#define FRAME_death208 258
#define FRAME_death209 259
#define FRAME_death210 260
#define FRAME_death211 261
#define FRAME_death212 262
#define FRAME_death213 263
#define FRAME_death214 264
#define FRAME_death215 265
#define FRAME_death216 266
#define FRAME_death217 267
#define FRAME_death218 268
#define FRAME_death219 269
#define FRAME_death220 270
#define FRAME_death221 271
#define FRAME_death222 272
#define FRAME_death223 273
#define FRAME_death224 274
#define FRAME_death225 275
#define FRAME_death226 276
#define FRAME_death227 277
#define FRAME_death228 278
#define FRAME_death229 279
#define FRAME_death230 280
#define FRAME_death231 281
#define FRAME_death232 282
#define FRAME_death233 283
#define FRAME_death234 284
#define FRAME_death235 285
#define FRAME_death236 286
#define FRAME_death237 287
#define FRAME_death238 288
#define FRAME_death239 289
#define FRAME_death240 290
#define FRAME_death241 291
#define FRAME_death242 292
#define FRAME_death243 293
#define FRAME_death244 294
#define FRAME_death245 295
#define FRAME_death246 296
#define FRAME_death247 297
#define FRAME_death248 298
#define FRAME_death249 299
#define FRAME_death250 300
#define FRAME_death251 301
#define FRAME_death252 302
#define FRAME_death253 303
#define FRAME_death254 304
#define FRAME_death255 305
#define FRAME_death256 306
#define FRAME_death257 307
#define FRAME_death258 308
#define FRAME_death259 309
#define FRAME_death260 310
#define FRAME_death261 311
#define FRAME_death262 312
#define FRAME_death263 313
#define FRAME_death264 314
#define FRAME_death265 315
#define FRAME_death266 316
#define FRAME_death267 317
#define FRAME_death268 318
#define FRAME_death269 319
#define FRAME_death270 320
#define FRAME_death271 321
#define FRAME_death272 322
#define FRAME_death273 323
#define FRAME_death274 324
#define FRAME_death275 325
#define FRAME_death276 326
#define FRAME_death277 327
#define FRAME_death278 328
#define FRAME_death279 329
#define FRAME_death280 330
#define FRAME_death281 331
#define FRAME_death282 332
#define FRAME_death283 333
#define FRAME_death284 334
#define FRAME_death285 335
#define FRAME_death286 336
#define FRAME_death287 337
#define FRAME_death288 338
#define FRAME_death289 339
#define FRAME_death290 340
#define FRAME_death291 341
#define FRAME_death292 342
#define FRAME_death293 343
#define FRAME_death294 344
#define FRAME_death295 345
#define FRAME_death301 346
#define FRAME_death302 347
#define FRAME_death303 348
#define FRAME_death304 349
#define FRAME_death305 350
#define FRAME_death306 351
#define FRAME_death307 352
#define FRAME_death308 353
#define FRAME_death309 354
#define FRAME_death310 355
#define FRAME_death311 356
#define FRAME_death312 357
#define FRAME_death313 358
#define FRAME_death314 359
#define FRAME_death315 360
#define FRAME_death316 361
#define FRAME_death317 362
#define FRAME_death318 363
#define FRAME_death319 364
#define FRAME_death320 365
#define FRAME_jump01 366
#define FRAME_jump02 367
#define FRAME_jump03 368
#define FRAME_jump04 369
#define FRAME_jump05 370
#define FRAME_jump06 371
#define FRAME_jump07 372
#define FRAME_jump08 373
#define FRAME_jump09 374
#define FRAME_jump10 375
#define FRAME_jump11 376
#define FRAME_jump12 377
#define FRAME_jump13 378
#define FRAME_pain401 379
#define FRAME_pain402 380
#define FRAME_pain403 381
#define FRAME_pain404 382
#define FRAME_pain501 383
#define FRAME_pain502 384
#define FRAME_pain503 385
#define FRAME_pain504 386
#define FRAME_pain601 387
#define FRAME_pain602 388
#define FRAME_pain603 389
#define FRAME_pain604 390
#define FRAME_pain605 391
#define FRAME_pain606 392
#define FRAME_pain607 393
#define FRAME_pain608 394
#define FRAME_pain609 395
#define FRAME_pain610 396
#define FRAME_pain611 397
#define FRAME_pain612 398
#define FRAME_pain613 399
#define FRAME_pain614 400
#define FRAME_pain615 401
#define FRAME_pain616 402
#define FRAME_pain617 403
#define FRAME_pain618 404
#define FRAME_pain619 405
#define FRAME_pain620 406
#define FRAME_pain621 407
#define FRAME_pain622 408
#define FRAME_pain623 409
#define FRAME_pain624 410
#define FRAME_pain625 411
#define FRAME_pain626 412
#define FRAME_pain627 413
#define FRAME_stand201 414
#define FRAME_stand202 415
#define FRAME_stand203 416
#define FRAME_stand204 417
#define FRAME_stand205 418
#define FRAME_stand206 419
#define FRAME_stand207 420
#define FRAME_stand208 421
#define FRAME_stand209 422
#define FRAME_stand210 423
#define FRAME_stand211 424
#define FRAME_stand212 425
#define FRAME_stand213 426
#define FRAME_stand214 427
#define FRAME_stand215 428
#define FRAME_stand216 429
#define FRAME_stand217 430
#define FRAME_stand218 431
#define FRAME_stand219 432
#define FRAME_stand220 433
#define FRAME_stand221 434
#define FRAME_stand222 435
#define FRAME_stand223 436
#define FRAME_stand224 437
#define FRAME_stand225 438
#define FRAME_stand226 439
#define FRAME_stand227 440
#define FRAME_stand228 441
#define FRAME_stand229 442
#define FRAME_stand230 443
#define FRAME_stand231 444
#define FRAME_stand232 445
#define FRAME_stand233 446
#define FRAME_stand234 447
#define FRAME_stand235 448
#define FRAME_stand236 449
#define FRAME_stand237 450
#define FRAME_stand238 451
#define FRAME_stand239 452
#define FRAME_stand240 453
#define FRAME_stand241 454
#define FRAME_stand242 455
#define FRAME_stand243 456
#define FRAME_stand244 457
#define FRAME_stand245 458
#define FRAME_stand246 459
#define FRAME_stand247 460
#define FRAME_stand248 461
#define FRAME_stand249 462
#define FRAME_stand250 463
#define FRAME_stand251 464
#define FRAME_stand252 465
#define FRAME_stand253 466
#define FRAME_stand254 467
#define FRAME_stand255 468
#define FRAME_stand256 469
#define FRAME_stand257 470
#define FRAME_stand258 471
#define FRAME_stand259 472
#define FRAME_stand260 473
#define FRAME_walk201 474
#define FRAME_walk202 475
#define FRAME_walk203 476
#define FRAME_walk204 477
#define FRAME_walk205 478
#define FRAME_walk206 479
#define FRAME_walk207 480
#define FRAME_walk208 481
#define FRAME_walk209 482
#define FRAME_walk210 483
#define FRAME_walk211 484
#define FRAME_walk212 485
#define FRAME_walk213 486
#define FRAME_walk214 487
#define FRAME_walk215 488
#define FRAME_walk216 489
#define FRAME_walk217 490
#define MODEL_SCALE 1.000000

View File

@ -1,689 +0,0 @@
/*
==============================================================================
brain
==============================================================================
*/
#include "g_local.h"
#include "m_brain.h"
static int sound_chest_open;
static int sound_tentacles_extend;
static int sound_tentacles_retract;
static int sound_death;
static int sound_idle1;
static int sound_idle2;
static int sound_idle3;
static int sound_pain1;
static int sound_pain2;
static int sound_sight;
static int sound_search;
static int sound_melee1;
static int sound_melee2;
static int sound_melee3;
void brain_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void brain_search (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
void brain_run (edict_t *self);
void brain_dead (edict_t *self);
//
// STAND
//
mframe_t brain_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t brain_move_stand = {FRAME_stand01, FRAME_stand30, brain_frames_stand, NULL};
void brain_stand (edict_t *self)
{
self->monsterinfo.currentmove = &brain_move_stand;
}
//
// IDLE
//
mframe_t brain_frames_idle [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t brain_move_idle = {FRAME_stand31, FRAME_stand60, brain_frames_idle, brain_stand};
void brain_idle (edict_t *self)
{
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_AUTO, sound_idle3, 1, ATTN_IDLE, 0);
self->monsterinfo.currentmove = &brain_move_idle;
}
//
// WALK
//
mframe_t brain_frames_walk1 [] =
{
ai_walk, 7, NULL,
ai_walk, 2, NULL,
ai_walk, 3, NULL,
ai_walk, 3, NULL,
ai_walk, 1, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 9, NULL,
ai_walk, -4, NULL,
ai_walk, -1, NULL,
ai_walk, 2, NULL
};
mmove_t brain_move_walk1 = {FRAME_walk101, FRAME_walk111, brain_frames_walk1, NULL};
// walk2 is FUBAR, do not use
#if 0
void brain_walk2_cycle (edict_t *self)
{
if (random() > 0.1)
self->monsterinfo.nextframe = FRAME_walk220;
}
mframe_t brain_frames_walk2 [] =
{
ai_walk, 3, NULL,
ai_walk, -2, NULL,
ai_walk, -4, NULL,
ai_walk, -3, NULL,
ai_walk, 0, NULL,
ai_walk, 1, NULL,
ai_walk, 12, NULL,
ai_walk, 0, NULL,
ai_walk, -3, NULL,
ai_walk, 0, NULL,
ai_walk, -2, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 1, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 10, NULL, // Cycle Start
ai_walk, -1, NULL,
ai_walk, 7, NULL,
ai_walk, 0, NULL,
ai_walk, 3, NULL,
ai_walk, -3, NULL,
ai_walk, 2, NULL,
ai_walk, 4, NULL,
ai_walk, -3, NULL,
ai_walk, 2, NULL,
ai_walk, 0, NULL,
ai_walk, 4, brain_walk2_cycle,
ai_walk, -1, NULL,
ai_walk, -1, NULL,
ai_walk, -8, NULL,
ai_walk, 0, NULL,
ai_walk, 1, NULL,
ai_walk, 5, NULL,
ai_walk, 2, NULL,
ai_walk, -1, NULL,
ai_walk, -5, NULL
};
mmove_t brain_move_walk2 = {FRAME_walk201, FRAME_walk240, brain_frames_walk2, NULL};
#endif
void brain_walk (edict_t *self)
{
// if (random() <= 0.5)
self->monsterinfo.currentmove = &brain_move_walk1;
// else
// self->monsterinfo.currentmove = &brain_move_walk2;
}
mframe_t brain_frames_defense [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t brain_move_defense = {FRAME_defens01, FRAME_defens08, brain_frames_defense, NULL};
mframe_t brain_frames_pain3 [] =
{
ai_move, -2, NULL,
ai_move, 2, NULL,
ai_move, 1, NULL,
ai_move, 3, NULL,
ai_move, 0, NULL,
ai_move, -4, NULL
};
mmove_t brain_move_pain3 = {FRAME_pain301, FRAME_pain306, brain_frames_pain3, brain_run};
mframe_t brain_frames_pain2 [] =
{
ai_move, -2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 3, NULL,
ai_move, 1, NULL,
ai_move, -2, NULL
};
mmove_t brain_move_pain2 = {FRAME_pain201, FRAME_pain208, brain_frames_pain2, brain_run};
mframe_t brain_frames_pain1 [] =
{
ai_move, -6, NULL,
ai_move, -2, NULL,
ai_move, -6, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 1, NULL,
ai_move, 7, NULL,
ai_move, 0, NULL,
ai_move, 3, NULL,
ai_move, -1, NULL
};
mmove_t brain_move_pain1 = {FRAME_pain101, FRAME_pain121, brain_frames_pain1, brain_run};
//
// DUCK
//
void brain_duck_down (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_DUCKED)
return;
self->monsterinfo.aiflags |= AI_DUCKED;
self->maxs[2] -= 32;
self->takedamage = DAMAGE_YES;
gi.linkentity (self);
}
void brain_duck_hold (edict_t *self)
{
if (level.time >= self->monsterinfo.pausetime)
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
else
self->monsterinfo.aiflags |= AI_HOLD_FRAME;
}
void brain_duck_up (edict_t *self)
{
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
gi.linkentity (self);
}
mframe_t brain_frames_duck [] =
{
ai_move, 0, NULL,
ai_move, -2, brain_duck_down,
ai_move, 17, brain_duck_hold,
ai_move, -3, NULL,
ai_move, -1, brain_duck_up,
ai_move, -5, NULL,
ai_move, -6, NULL,
ai_move, -6, NULL
};
mmove_t brain_move_duck = {FRAME_duck01, FRAME_duck08, brain_frames_duck, brain_run};
void brain_dodge (edict_t *self, edict_t *attacker, float eta)
{
if (random() > 0.25)
return;
if (!self->enemy)
self->enemy = attacker;
self->monsterinfo.pausetime = level.time + eta + 0.5;
self->monsterinfo.currentmove = &brain_move_duck;
}
mframe_t brain_frames_death2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 9, NULL,
ai_move, 0, NULL
};
mmove_t brain_move_death2 = {FRAME_death201, FRAME_death205, brain_frames_death2, brain_dead};
mframe_t brain_frames_death1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -2, NULL,
ai_move, 9, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t brain_move_death1 = {FRAME_death101, FRAME_death118, brain_frames_death1, brain_dead};
//
// MELEE
//
void brain_swing_right (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_melee1, 1, ATTN_NORM, 0);
}
void brain_hit_right (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->maxs[0], 8);
if (fire_hit (self, aim, (15 + (rand() %5)), 40))
gi.sound (self, CHAN_WEAPON, sound_melee3, 1, ATTN_NORM, 0);
}
void brain_swing_left (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_melee2, 1, ATTN_NORM, 0);
}
void brain_hit_left (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->mins[0], 8);
if (fire_hit (self, aim, (15 + (rand() %5)), 40))
gi.sound (self, CHAN_WEAPON, sound_melee3, 1, ATTN_NORM, 0);
}
mframe_t brain_frames_attack1 [] =
{
ai_charge, 8, NULL,
ai_charge, 3, NULL,
ai_charge, 5, NULL,
ai_charge, 0, NULL,
ai_charge, -3, brain_swing_right,
ai_charge, 0, NULL,
ai_charge, -5, NULL,
ai_charge, -7, brain_hit_right,
ai_charge, 0, NULL,
ai_charge, 6, brain_swing_left,
ai_charge, 1, NULL,
ai_charge, 2, brain_hit_left,
ai_charge, -3, NULL,
ai_charge, 6, NULL,
ai_charge, -1, NULL,
ai_charge, -3, NULL,
ai_charge, 2, NULL,
ai_charge, -11,NULL
};
mmove_t brain_move_attack1 = {FRAME_attak101, FRAME_attak118, brain_frames_attack1, brain_run};
void brain_chest_open (edict_t *self)
{
self->spawnflags &= ~65536;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
gi.sound (self, CHAN_BODY, sound_chest_open, 1, ATTN_NORM, 0);
}
void brain_tentacle_attack (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, 0, 8);
if (fire_hit (self, aim, (10 + (rand() %5)), -600) && skill->value > 0)
self->spawnflags |= 65536;
gi.sound (self, CHAN_WEAPON, sound_tentacles_retract, 1, ATTN_NORM, 0);
}
void brain_chest_closed (edict_t *self)
{
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
if (self->spawnflags & 65536)
{
self->spawnflags &= ~65536;
self->monsterinfo.currentmove = &brain_move_attack1;
}
}
mframe_t brain_frames_attack2 [] =
{
ai_charge, 5, NULL,
ai_charge, -4, NULL,
ai_charge, -4, NULL,
ai_charge, -3, NULL,
ai_charge, 0, brain_chest_open,
ai_charge, 0, NULL,
ai_charge, 13, brain_tentacle_attack,
ai_charge, 0, NULL,
ai_charge, 2, NULL,
ai_charge, 0, NULL,
ai_charge, -9, brain_chest_closed,
ai_charge, 0, NULL,
ai_charge, 4, NULL,
ai_charge, 3, NULL,
ai_charge, 2, NULL,
ai_charge, -3, NULL,
ai_charge, -6, NULL
};
mmove_t brain_move_attack2 = {FRAME_attak201, FRAME_attak217, brain_frames_attack2, brain_run};
void brain_melee(edict_t *self)
{
if (random() <= 0.5)
self->monsterinfo.currentmove = &brain_move_attack1;
else
self->monsterinfo.currentmove = &brain_move_attack2;
}
//
// RUN
//
mframe_t brain_frames_run [] =
{
ai_run, 9, NULL,
ai_run, 2, NULL,
ai_run, 3, NULL,
ai_run, 3, NULL,
ai_run, 1, NULL,
ai_run, 0, NULL,
ai_run, 0, NULL,
ai_run, 10, NULL,
ai_run, -4, NULL,
ai_run, -1, NULL,
ai_run, 2, NULL
};
mmove_t brain_move_run = {FRAME_walk101, FRAME_walk111, brain_frames_run, NULL};
void brain_run (edict_t *self)
{
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &brain_move_stand;
else
self->monsterinfo.currentmove = &brain_move_run;
}
void brain_pain (edict_t *self, edict_t *other, float kick, int damage)
{
float r;
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
r = random();
if (r < 0.33)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &brain_move_pain1;
}
else if (r < 0.66)
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &brain_move_pain2;
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &brain_move_pain3;
}
}
void brain_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
void brain_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->s.effects = 0;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
if (random() <= 0.5)
self->monsterinfo.currentmove = &brain_move_death1;
else
self->monsterinfo.currentmove = &brain_move_death2;
}
/*QUAKED monster_brain (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_brain (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_BRAIN;
sound_chest_open = gi.soundindex ("brain/brnatck1.wav");
sound_tentacles_extend = gi.soundindex ("brain/brnatck2.wav");
sound_tentacles_retract = gi.soundindex ("brain/brnatck3.wav");
sound_death = gi.soundindex ("brain/brndeth1.wav");
sound_idle1 = gi.soundindex ("brain/brnidle1.wav");
sound_idle2 = gi.soundindex ("brain/brnidle2.wav");
sound_idle3 = gi.soundindex ("brain/brnlens1.wav");
sound_pain1 = gi.soundindex ("brain/brnpain1.wav");
sound_pain2 = gi.soundindex ("brain/brnpain2.wav");
sound_sight = gi.soundindex ("brain/brnsght1.wav");
sound_search = gi.soundindex ("brain/brnsrch1.wav");
sound_melee1 = gi.soundindex ("brain/melee1.wav");
sound_melee2 = gi.soundindex ("brain/melee2.wav");
sound_melee3 = gi.soundindex ("brain/melee3.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/brain/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/brain/tris.md2");
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, 32);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 300;
if(!self->gib_health)
self->gib_health = -150;
if(!self->mass)
self->mass = 400;
self->pain = brain_pain;
self->die = brain_die;
self->monsterinfo.stand = brain_stand;
self->monsterinfo.walk = brain_walk;
self->monsterinfo.run = brain_run;
self->monsterinfo.dodge = brain_dodge;
// self->monsterinfo.attack = brain_attack;
self->monsterinfo.melee = brain_melee;
self->monsterinfo.sight = brain_sight;
self->monsterinfo.search = brain_search;
self->monsterinfo.idle = brain_idle;
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
self->monsterinfo.power_armor_power = 100;
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.10;
self->common_name = "Brains";
gi.linkentity (self);
self->monsterinfo.currentmove = &brain_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&brain_move_death1,
&brain_move_death2,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start (self);
}

View File

@ -1,228 +0,0 @@
// G:\quake2\baseq2\models/monsters/brain
// This file generated by ModelGen - Do NOT Modify
#define FRAME_walk101 0
#define FRAME_walk102 1
#define FRAME_walk103 2
#define FRAME_walk104 3
#define FRAME_walk105 4
#define FRAME_walk106 5
#define FRAME_walk107 6
#define FRAME_walk108 7
#define FRAME_walk109 8
#define FRAME_walk110 9
#define FRAME_walk111 10
#define FRAME_walk112 11
#define FRAME_walk113 12
#define FRAME_walk201 13
#define FRAME_walk202 14
#define FRAME_walk203 15
#define FRAME_walk204 16
#define FRAME_walk205 17
#define FRAME_walk206 18
#define FRAME_walk207 19
#define FRAME_walk208 20
#define FRAME_walk209 21
#define FRAME_walk210 22
#define FRAME_walk211 23
#define FRAME_walk212 24
#define FRAME_walk213 25
#define FRAME_walk214 26
#define FRAME_walk215 27
#define FRAME_walk216 28
#define FRAME_walk217 29
#define FRAME_walk218 30
#define FRAME_walk219 31
#define FRAME_walk220 32
#define FRAME_walk221 33
#define FRAME_walk222 34
#define FRAME_walk223 35
#define FRAME_walk224 36
#define FRAME_walk225 37
#define FRAME_walk226 38
#define FRAME_walk227 39
#define FRAME_walk228 40
#define FRAME_walk229 41
#define FRAME_walk230 42
#define FRAME_walk231 43
#define FRAME_walk232 44
#define FRAME_walk233 45
#define FRAME_walk234 46
#define FRAME_walk235 47
#define FRAME_walk236 48
#define FRAME_walk237 49
#define FRAME_walk238 50
#define FRAME_walk239 51
#define FRAME_walk240 52
#define FRAME_attak101 53
#define FRAME_attak102 54
#define FRAME_attak103 55
#define FRAME_attak104 56
#define FRAME_attak105 57
#define FRAME_attak106 58
#define FRAME_attak107 59
#define FRAME_attak108 60
#define FRAME_attak109 61
#define FRAME_attak110 62
#define FRAME_attak111 63
#define FRAME_attak112 64
#define FRAME_attak113 65
#define FRAME_attak114 66
#define FRAME_attak115 67
#define FRAME_attak116 68
#define FRAME_attak117 69
#define FRAME_attak118 70
#define FRAME_attak201 71
#define FRAME_attak202 72
#define FRAME_attak203 73
#define FRAME_attak204 74
#define FRAME_attak205 75
#define FRAME_attak206 76
#define FRAME_attak207 77
#define FRAME_attak208 78
#define FRAME_attak209 79
#define FRAME_attak210 80
#define FRAME_attak211 81
#define FRAME_attak212 82
#define FRAME_attak213 83
#define FRAME_attak214 84
#define FRAME_attak215 85
#define FRAME_attak216 86
#define FRAME_attak217 87
#define FRAME_pain101 88
#define FRAME_pain102 89
#define FRAME_pain103 90
#define FRAME_pain104 91
#define FRAME_pain105 92
#define FRAME_pain106 93
#define FRAME_pain107 94
#define FRAME_pain108 95
#define FRAME_pain109 96
#define FRAME_pain110 97
#define FRAME_pain111 98
#define FRAME_pain112 99
#define FRAME_pain113 100
#define FRAME_pain114 101
#define FRAME_pain115 102
#define FRAME_pain116 103
#define FRAME_pain117 104
#define FRAME_pain118 105
#define FRAME_pain119 106
#define FRAME_pain120 107
#define FRAME_pain121 108
#define FRAME_pain201 109
#define FRAME_pain202 110
#define FRAME_pain203 111
#define FRAME_pain204 112
#define FRAME_pain205 113
#define FRAME_pain206 114
#define FRAME_pain207 115
#define FRAME_pain208 116
#define FRAME_pain301 117
#define FRAME_pain302 118
#define FRAME_pain303 119
#define FRAME_pain304 120
#define FRAME_pain305 121
#define FRAME_pain306 122
#define FRAME_death101 123
#define FRAME_death102 124
#define FRAME_death103 125
#define FRAME_death104 126
#define FRAME_death105 127
#define FRAME_death106 128
#define FRAME_death107 129
#define FRAME_death108 130
#define FRAME_death109 131
#define FRAME_death110 132
#define FRAME_death111 133
#define FRAME_death112 134
#define FRAME_death113 135
#define FRAME_death114 136
#define FRAME_death115 137
#define FRAME_death116 138
#define FRAME_death117 139
#define FRAME_death118 140
#define FRAME_death201 141
#define FRAME_death202 142
#define FRAME_death203 143
#define FRAME_death204 144
#define FRAME_death205 145
#define FRAME_duck01 146
#define FRAME_duck02 147
#define FRAME_duck03 148
#define FRAME_duck04 149
#define FRAME_duck05 150
#define FRAME_duck06 151
#define FRAME_duck07 152
#define FRAME_duck08 153
#define FRAME_defens01 154
#define FRAME_defens02 155
#define FRAME_defens03 156
#define FRAME_defens04 157
#define FRAME_defens05 158
#define FRAME_defens06 159
#define FRAME_defens07 160
#define FRAME_defens08 161
#define FRAME_stand01 162
#define FRAME_stand02 163
#define FRAME_stand03 164
#define FRAME_stand04 165
#define FRAME_stand05 166
#define FRAME_stand06 167
#define FRAME_stand07 168
#define FRAME_stand08 169
#define FRAME_stand09 170
#define FRAME_stand10 171
#define FRAME_stand11 172
#define FRAME_stand12 173
#define FRAME_stand13 174
#define FRAME_stand14 175
#define FRAME_stand15 176
#define FRAME_stand16 177
#define FRAME_stand17 178
#define FRAME_stand18 179
#define FRAME_stand19 180
#define FRAME_stand20 181
#define FRAME_stand21 182
#define FRAME_stand22 183
#define FRAME_stand23 184
#define FRAME_stand24 185
#define FRAME_stand25 186
#define FRAME_stand26 187
#define FRAME_stand27 188
#define FRAME_stand28 189
#define FRAME_stand29 190
#define FRAME_stand30 191
#define FRAME_stand31 192
#define FRAME_stand32 193
#define FRAME_stand33 194
#define FRAME_stand34 195
#define FRAME_stand35 196
#define FRAME_stand36 197
#define FRAME_stand37 198
#define FRAME_stand38 199
#define FRAME_stand39 200
#define FRAME_stand40 201
#define FRAME_stand41 202
#define FRAME_stand42 203
#define FRAME_stand43 204
#define FRAME_stand44 205
#define FRAME_stand45 206
#define FRAME_stand46 207
#define FRAME_stand47 208
#define FRAME_stand48 209
#define FRAME_stand49 210
#define FRAME_stand50 211
#define FRAME_stand51 212
#define FRAME_stand52 213
#define FRAME_stand53 214
#define FRAME_stand54 215
#define FRAME_stand55 216
#define FRAME_stand56 217
#define FRAME_stand57 218
#define FRAME_stand58 219
#define FRAME_stand59 220
#define FRAME_stand60 221
#define MODEL_SCALE 1.000000

View File

@ -1,782 +0,0 @@
/*
==============================================================================
chick
==============================================================================
*/
#include "g_local.h"
#include "m_chick.h"
bool visible (edict_t *self, edict_t *other);
void chick_stand (edict_t *self);
void chick_run (edict_t *self);
void chick_reslash(edict_t *self);
void chick_rerocket(edict_t *self);
void chick_attack1(edict_t *self);
static int sound_missile_prelaunch;
static int sound_missile_launch;
static int sound_melee_swing;
static int sound_melee_hit;
static int sound_missile_reload;
static int sound_death1;
static int sound_death2;
static int sound_fall_down;
static int sound_idle1;
static int sound_idle2;
static int sound_pain1;
static int sound_pain2;
static int sound_pain3;
static int sound_sight;
static int sound_search;
void ChickMoan (edict_t *self)
{
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
{
if (random() < 0.5)
gi.sound (self, CHAN_VOICE, sound_idle1, 1, ATTN_IDLE, 0);
else
gi.sound (self, CHAN_VOICE, sound_idle2, 1, ATTN_IDLE, 0);
}
}
mframe_t chick_frames_fidget [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, ChickMoan,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t chick_move_fidget = {FRAME_stand201, FRAME_stand230, chick_frames_fidget, chick_stand};
void chick_fidget (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
return;
if (random() <= 0.3)
self->monsterinfo.currentmove = &chick_move_fidget;
}
mframe_t chick_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, chick_fidget,
};
mmove_t chick_move_stand = {FRAME_stand101, FRAME_stand130, chick_frames_stand, NULL};
void chick_stand (edict_t *self)
{
self->monsterinfo.currentmove = &chick_move_stand;
}
mframe_t chick_frames_start_run [] =
{
ai_run, 1, NULL,
ai_run, 0, NULL,
ai_run, 0, NULL,
ai_run, -1, NULL,
ai_run, -1, NULL,
ai_run, 0, NULL,
ai_run, 1, NULL,
ai_run, 3, NULL,
ai_run, 6, NULL,
ai_run, 3, NULL
};
mmove_t chick_move_start_run = {FRAME_walk01, FRAME_walk10, chick_frames_start_run, chick_run};
mframe_t chick_frames_run [] =
{
ai_run, 6, NULL,
ai_run, 8, NULL,
ai_run, 13, NULL,
ai_run, 5, NULL,
ai_run, 7, NULL,
ai_run, 4, NULL,
ai_run, 11, NULL,
ai_run, 5, NULL,
ai_run, 9, NULL,
ai_run, 7, NULL
};
mmove_t chick_move_run = {FRAME_walk11, FRAME_walk20, chick_frames_run, NULL};
mframe_t chick_frames_walk [] =
{
ai_walk, 6, NULL,
ai_walk, 8, NULL,
ai_walk, 13, NULL,
ai_walk, 5, NULL,
ai_walk, 7, NULL,
ai_walk, 4, NULL,
ai_walk, 11, NULL,
ai_walk, 5, NULL,
ai_walk, 9, NULL,
ai_walk, 7, NULL
};
mmove_t chick_move_walk = {FRAME_walk11, FRAME_walk20, chick_frames_walk, NULL};
void chick_walk (edict_t *self)
{
self->monsterinfo.currentmove = &chick_move_walk;
}
void chick_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &chick_move_stand;
return;
}
if (self->monsterinfo.currentmove == &chick_move_walk ||
self->monsterinfo.currentmove == &chick_move_start_run)
{
self->monsterinfo.currentmove = &chick_move_run;
}
else
{
self->monsterinfo.currentmove = &chick_move_start_run;
}
}
mframe_t chick_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t chick_move_pain1 = {FRAME_pain101, FRAME_pain105, chick_frames_pain1, chick_run};
mframe_t chick_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t chick_move_pain2 = {FRAME_pain201, FRAME_pain205, chick_frames_pain2, chick_run};
mframe_t chick_frames_pain3 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -6, NULL,
ai_move, 3, NULL,
ai_move, 11, NULL,
ai_move, 3, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 4, NULL,
ai_move, 1, NULL,
ai_move, 0, NULL,
ai_move, -3, NULL,
ai_move, -4, NULL,
ai_move, 5, NULL,
ai_move, 7, NULL,
ai_move, -2, NULL,
ai_move, 3, NULL,
ai_move, -5, NULL,
ai_move, -2, NULL,
ai_move, -8, NULL,
ai_move, 2, NULL
};
mmove_t chick_move_pain3 = {FRAME_pain301, FRAME_pain321, chick_frames_pain3, chick_run};
void chick_pain (edict_t *self, edict_t *other, float kick, int damage)
{
float r;
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
r = random();
if (r < 0.33)
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
else if (r < 0.66)
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_pain3, 1, ATTN_NORM, 0);
if (skill->value == 3)
return; // no pain anims in nightmare
if (damage <= 10)
self->monsterinfo.currentmove = &chick_move_pain1;
else if (damage <= 25)
self->monsterinfo.currentmove = &chick_move_pain2;
else
self->monsterinfo.currentmove = &chick_move_pain3;
}
void chick_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, 0);
VectorSet (self->maxs, 16, 16, 16);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t chick_frames_death2 [] =
{
ai_move, -6, NULL,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, -5, NULL,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, -2, NULL,
ai_move, 1, NULL,
ai_move, 10, NULL,
ai_move, 2, NULL,
ai_move, 3, NULL,
ai_move, 1, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 3, NULL,
ai_move, 3, NULL,
ai_move, 1, NULL,
ai_move, -3, NULL,
ai_move, -5, NULL,
ai_move, 4, NULL,
ai_move, 15, NULL,
ai_move, 14, NULL,
ai_move, 1, NULL
};
mmove_t chick_move_death2 = {FRAME_death201, FRAME_death223, chick_frames_death2, chick_dead};
mframe_t chick_frames_death1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -7, NULL,
ai_move, 4, NULL,
ai_move, 11, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t chick_move_death1 = {FRAME_death101, FRAME_death112, chick_frames_death1, chick_dead};
void chick_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
n = rand() % 2;
if (n == 0)
{
self->monsterinfo.currentmove = &chick_move_death1;
gi.sound (self, CHAN_VOICE, sound_death1, 1, ATTN_NORM, 0);
}
else
{
self->monsterinfo.currentmove = &chick_move_death2;
gi.sound (self, CHAN_VOICE, sound_death2, 1, ATTN_NORM, 0);
}
}
void chick_duck_down (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_DUCKED)
return;
self->monsterinfo.aiflags |= AI_DUCKED;
self->maxs[2] -= 32;
self->takedamage = DAMAGE_YES;
self->monsterinfo.pausetime = level.time + 1;
gi.linkentity (self);
}
void chick_duck_hold (edict_t *self)
{
if (level.time >= self->monsterinfo.pausetime)
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
else
self->monsterinfo.aiflags |= AI_HOLD_FRAME;
}
void chick_duck_up (edict_t *self)
{
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
gi.linkentity (self);
}
mframe_t chick_frames_duck [] =
{
ai_move, 0, chick_duck_down,
ai_move, 1, NULL,
ai_move, 4, chick_duck_hold,
ai_move, -4, NULL,
ai_move, -5, chick_duck_up,
ai_move, 3, NULL,
ai_move, 1, NULL
};
mmove_t chick_move_duck = {FRAME_duck01, FRAME_duck07, chick_frames_duck, chick_run};
void chick_dodge (edict_t *self, edict_t *attacker, float eta)
{
if (random() > 0.25)
return;
if (!self->enemy)
self->enemy = attacker;
self->monsterinfo.currentmove = &chick_move_duck;
}
void ChickSlash (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->mins[0], 10);
gi.sound (self, CHAN_WEAPON, sound_melee_swing, 1, ATTN_NORM, 0);
fire_hit (self, aim, (10 + (rand() %6)), 100);
}
void ChickRocket (edict_t *self)
{
// DWH: Added skill level-dependent rocket speed, leading target, suicide prevention,
// target elevation dependent target location, and homing rockets
trace_t trace;
vec3_t forward, right;
vec3_t start;
vec3_t dir;
vec3_t vec;
int rocketSpeed;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_CHICK_ROCKET_1], forward, right, start);
if((self->spawnflags & SF_MONSTER_SPECIAL))
rocketSpeed = 400; // DWH: Homing rockets are tougher if slow
else
rocketSpeed = 500 + (100 * skill->value); // PGM rock & roll.... :)
if(visible(self,self->enemy))
{
VectorCopy (self->enemy->s.origin, vec);
if(!(self->enemy->flags & FL_REFLECT))
{
if(random() < 0.66 || (start[2] < self->enemy->absmin[2]))
vec[2] += self->enemy->viewheight;
else
vec[2] = self->enemy->absmin[2];
}
VectorSubtract (vec, start, dir);
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
// lead target, but not if using homers
// 20, 35, 50, 65 chance of leading
// DWH: Switched this around from Rogue code... it led target more often
// for Easy, which seemed backwards
if( (random() < (0.2 + skill->value * 0.15) ) && !(self->spawnflags & SF_MONSTER_SPECIAL))
{
float dist;
float time;
dist = VectorLength (dir);
time = dist/rocketSpeed;
VectorMA(vec, time, self->enemy->velocity, vec);
VectorSubtract(vec, start, dir);
}
}
else
{
// Fire at feet of last known position
VectorCopy(self->monsterinfo.last_sighting,vec);
vec[2] += self->enemy->mins[2];
VectorSubtract(vec,start,dir);
}
VectorNormalize(dir);
if(self->enemy->flags & FL_REFLECT)
{
// If forcing chick to shoot at reflection, go ahead
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_CHICK_ROCKET_1,
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
}
else
{
// paranoia, make sure we're not shooting a target right next to us
trace = gi.trace(start, vec3_origin, vec3_origin, vec, self, MASK_SHOT);
if(trace.ent == self->enemy || trace.ent == world)
{
VectorSubtract(trace.endpos,start,vec);
if(VectorLength(vec) > MELEE_DISTANCE)
{
if(trace.fraction > 0.5 || (trace.ent && trace.ent->client))
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_CHICK_ROCKET_1,
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
}
}
}
}
void Chick_PreAttack1 (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_missile_prelaunch, 1, ATTN_NORM, 0);
}
void ChickReload (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_missile_reload, 1, ATTN_NORM, 0);
}
void chick_skip_frames (edict_t *self)
{
if(skill->value >= 1)
{
if(self->s.frame == FRAME_attak102)
self->s.frame = FRAME_attak103;
if(self->s.frame == FRAME_attak105)
self->s.frame = FRAME_attak106;
}
if(skill->value > 1)
if(self->s.frame == FRAME_attak109)
self->s.frame = FRAME_attak112;
}
mframe_t chick_frames_start_attack1 [] =
{
ai_charge, 0, Chick_PreAttack1,
ai_charge, 0, chick_skip_frames,
ai_charge, 0, chick_skip_frames,
ai_charge, 4, chick_skip_frames,
ai_charge, 0, chick_skip_frames,
ai_charge, -3, chick_skip_frames,
ai_charge, 3, chick_skip_frames,
ai_charge, 5, chick_skip_frames,
ai_charge, 7, chick_skip_frames,
ai_charge, 0, chick_skip_frames,
ai_charge, 0, chick_skip_frames,
ai_charge, 0, chick_skip_frames,
ai_charge, 0, chick_attack1
};
mmove_t chick_move_start_attack1 = {FRAME_attak101, FRAME_attak113, chick_frames_start_attack1, NULL};
mframe_t chick_frames_attack1 [] =
{
ai_charge, 19, ChickRocket,
ai_charge, -6, NULL,
ai_charge, -5, NULL,
ai_charge, -2, NULL,
ai_charge, -7, NULL,
ai_charge, 0, NULL,
ai_charge, 1, NULL,
ai_charge, 10, ChickReload,
ai_charge, 4, NULL,
ai_charge, 5, NULL,
ai_charge, 6, NULL,
ai_charge, 6, NULL,
ai_charge, 4, NULL,
ai_charge, 3, chick_rerocket
};
mmove_t chick_move_attack1 = {FRAME_attak114, FRAME_attak127, chick_frames_attack1, NULL};
mframe_t chick_frames_end_attack1 [] =
{
ai_charge, -3, NULL,
ai_charge, 0, NULL,
ai_charge, -6, NULL,
ai_charge, -4, NULL,
ai_charge, -2, NULL
};
mmove_t chick_move_end_attack1 = {FRAME_attak128, FRAME_attak132, chick_frames_end_attack1, chick_run};
void chick_rerocket(edict_t *self)
{
if (self->enemy->health > 0)
{
if (range (self, self->enemy) > RANGE_MELEE)
if ( visible (self, self->enemy) )
if (random() <= 0.6)
{
self->monsterinfo.currentmove = &chick_move_attack1;
return;
}
}
self->monsterinfo.currentmove = &chick_move_end_attack1;
}
void chick_attack1(edict_t *self)
{
self->monsterinfo.currentmove = &chick_move_attack1;
}
mframe_t chick_frames_slash [] =
{
ai_charge, 1, NULL,
ai_charge, 7, ChickSlash,
ai_charge, -7, NULL,
ai_charge, 1, NULL,
ai_charge, -1, NULL,
ai_charge, 1, NULL,
ai_charge, 0, NULL,
ai_charge, 1, NULL,
ai_charge, -2, chick_reslash
};
mmove_t chick_move_slash = {FRAME_attak204, FRAME_attak212, chick_frames_slash, NULL};
mframe_t chick_frames_end_slash [] =
{
ai_charge, -6, NULL,
ai_charge, -1, NULL,
ai_charge, -6, NULL,
ai_charge, 0, NULL
};
mmove_t chick_move_end_slash = {FRAME_attak213, FRAME_attak216, chick_frames_end_slash, chick_run};
void chick_reslash(edict_t *self)
{
if (self->enemy->health > 0)
{
if (range (self, self->enemy) == RANGE_MELEE)
if (random() <= 0.9)
{
self->monsterinfo.currentmove = &chick_move_slash;
return;
}
else
{
self->monsterinfo.currentmove = &chick_move_end_slash;
return;
}
}
self->monsterinfo.currentmove = &chick_move_end_slash;
}
void chick_slash(edict_t *self)
{
self->monsterinfo.currentmove = &chick_move_slash;
}
mframe_t chick_frames_start_slash [] =
{
ai_charge, 1, NULL,
ai_charge, 8, NULL,
ai_charge, 3, NULL
};
mmove_t chick_move_start_slash = {FRAME_attak201, FRAME_attak203, chick_frames_start_slash, chick_slash};
void chick_melee(edict_t *self)
{
self->monsterinfo.currentmove = &chick_move_start_slash;
}
void chick_attack(edict_t *self)
{
self->monsterinfo.currentmove = &chick_move_start_attack1;
}
void chick_sight(edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
/*QUAKED monster_chick (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_chick (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_CHICK;
sound_missile_prelaunch = gi.soundindex ("chick/chkatck1.wav");
sound_missile_launch = gi.soundindex ("chick/chkatck2.wav");
sound_melee_swing = gi.soundindex ("chick/chkatck3.wav");
sound_melee_hit = gi.soundindex ("chick/chkatck4.wav");
sound_missile_reload = gi.soundindex ("chick/chkatck5.wav");
sound_death1 = gi.soundindex ("chick/chkdeth1.wav");
sound_death2 = gi.soundindex ("chick/chkdeth2.wav");
sound_fall_down = gi.soundindex ("chick/chkfall1.wav");
sound_idle1 = gi.soundindex ("chick/chkidle1.wav");
sound_idle2 = gi.soundindex ("chick/chkidle2.wav");
sound_pain1 = gi.soundindex ("chick/chkpain1.wav");
sound_pain2 = gi.soundindex ("chick/chkpain2.wav");
sound_pain3 = gi.soundindex ("chick/chkpain3.wav");
sound_sight = gi.soundindex ("chick/chksght1.wav");
sound_search = gi.soundindex ("chick/chksrch1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/bitch/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/bitch/tris.md2");
VectorSet (self->mins, -16, -16, 0);
VectorSet (self->maxs, 16, 16, 56);
// DWH: mapper-configurable health
if(!self->health)
self->health = 175;
if(!self->gib_health)
self->gib_health = -70;
if(!self->mass)
self->mass = 200;
self->pain = chick_pain;
self->die = chick_die;
self->monsterinfo.stand = chick_stand;
self->monsterinfo.walk = chick_walk;
self->monsterinfo.run = chick_run;
self->monsterinfo.dodge = chick_dodge;
self->monsterinfo.attack = chick_attack;
self->monsterinfo.melee = chick_melee;
self->monsterinfo.sight = chick_sight;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.40;
self->common_name = "Iron Maiden";
gi.linkentity (self);
self->monsterinfo.currentmove = &chick_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&chick_move_death1,
&chick_move_death2,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start (self);
}

View File

@ -1,294 +0,0 @@
// G:\quake2\baseq2\models/monsters/bitch
// This file generated by qdata - Do NOT Modify
#define FRAME_attak101 0
#define FRAME_attak102 1
#define FRAME_attak103 2
#define FRAME_attak104 3
#define FRAME_attak105 4
#define FRAME_attak106 5
#define FRAME_attak107 6
#define FRAME_attak108 7
#define FRAME_attak109 8
#define FRAME_attak110 9
#define FRAME_attak111 10
#define FRAME_attak112 11
#define FRAME_attak113 12
#define FRAME_attak114 13
#define FRAME_attak115 14
#define FRAME_attak116 15
#define FRAME_attak117 16
#define FRAME_attak118 17
#define FRAME_attak119 18
#define FRAME_attak120 19
#define FRAME_attak121 20
#define FRAME_attak122 21
#define FRAME_attak123 22
#define FRAME_attak124 23
#define FRAME_attak125 24
#define FRAME_attak126 25
#define FRAME_attak127 26
#define FRAME_attak128 27
#define FRAME_attak129 28
#define FRAME_attak130 29
#define FRAME_attak131 30
#define FRAME_attak132 31
#define FRAME_attak201 32
#define FRAME_attak202 33
#define FRAME_attak203 34
#define FRAME_attak204 35
#define FRAME_attak205 36
#define FRAME_attak206 37
#define FRAME_attak207 38
#define FRAME_attak208 39
#define FRAME_attak209 40
#define FRAME_attak210 41
#define FRAME_attak211 42
#define FRAME_attak212 43
#define FRAME_attak213 44
#define FRAME_attak214 45
#define FRAME_attak215 46
#define FRAME_attak216 47
#define FRAME_death101 48
#define FRAME_death102 49
#define FRAME_death103 50
#define FRAME_death104 51
#define FRAME_death105 52
#define FRAME_death106 53
#define FRAME_death107 54
#define FRAME_death108 55
#define FRAME_death109 56
#define FRAME_death110 57
#define FRAME_death111 58
#define FRAME_death112 59
#define FRAME_death201 60
#define FRAME_death202 61
#define FRAME_death203 62
#define FRAME_death204 63
#define FRAME_death205 64
#define FRAME_death206 65
#define FRAME_death207 66
#define FRAME_death208 67
#define FRAME_death209 68
#define FRAME_death210 69
#define FRAME_death211 70
#define FRAME_death212 71
#define FRAME_death213 72
#define FRAME_death214 73
#define FRAME_death215 74
#define FRAME_death216 75
#define FRAME_death217 76
#define FRAME_death218 77
#define FRAME_death219 78
#define FRAME_death220 79
#define FRAME_death221 80
#define FRAME_death222 81
#define FRAME_death223 82
#define FRAME_duck01 83
#define FRAME_duck02 84
#define FRAME_duck03 85
#define FRAME_duck04 86
#define FRAME_duck05 87
#define FRAME_duck06 88
#define FRAME_duck07 89
#define FRAME_pain101 90
#define FRAME_pain102 91
#define FRAME_pain103 92
#define FRAME_pain104 93
#define FRAME_pain105 94
#define FRAME_pain201 95
#define FRAME_pain202 96
#define FRAME_pain203 97
#define FRAME_pain204 98
#define FRAME_pain205 99
#define FRAME_pain301 100
#define FRAME_pain302 101
#define FRAME_pain303 102
#define FRAME_pain304 103
#define FRAME_pain305 104
#define FRAME_pain306 105
#define FRAME_pain307 106
#define FRAME_pain308 107
#define FRAME_pain309 108
#define FRAME_pain310 109
#define FRAME_pain311 110
#define FRAME_pain312 111
#define FRAME_pain313 112
#define FRAME_pain314 113
#define FRAME_pain315 114
#define FRAME_pain316 115
#define FRAME_pain317 116
#define FRAME_pain318 117
#define FRAME_pain319 118
#define FRAME_pain320 119
#define FRAME_pain321 120
#define FRAME_stand101 121
#define FRAME_stand102 122
#define FRAME_stand103 123
#define FRAME_stand104 124
#define FRAME_stand105 125
#define FRAME_stand106 126
#define FRAME_stand107 127
#define FRAME_stand108 128
#define FRAME_stand109 129
#define FRAME_stand110 130
#define FRAME_stand111 131
#define FRAME_stand112 132
#define FRAME_stand113 133
#define FRAME_stand114 134
#define FRAME_stand115 135
#define FRAME_stand116 136
#define FRAME_stand117 137
#define FRAME_stand118 138
#define FRAME_stand119 139
#define FRAME_stand120 140
#define FRAME_stand121 141
#define FRAME_stand122 142
#define FRAME_stand123 143
#define FRAME_stand124 144
#define FRAME_stand125 145
#define FRAME_stand126 146
#define FRAME_stand127 147
#define FRAME_stand128 148
#define FRAME_stand129 149
#define FRAME_stand130 150
#define FRAME_stand201 151
#define FRAME_stand202 152
#define FRAME_stand203 153
#define FRAME_stand204 154
#define FRAME_stand205 155
#define FRAME_stand206 156
#define FRAME_stand207 157
#define FRAME_stand208 158
#define FRAME_stand209 159
#define FRAME_stand210 160
#define FRAME_stand211 161
#define FRAME_stand212 162
#define FRAME_stand213 163
#define FRAME_stand214 164
#define FRAME_stand215 165
#define FRAME_stand216 166
#define FRAME_stand217 167
#define FRAME_stand218 168
#define FRAME_stand219 169
#define FRAME_stand220 170
#define FRAME_stand221 171
#define FRAME_stand222 172
#define FRAME_stand223 173
#define FRAME_stand224 174
#define FRAME_stand225 175
#define FRAME_stand226 176
#define FRAME_stand227 177
#define FRAME_stand228 178
#define FRAME_stand229 179
#define FRAME_stand230 180
#define FRAME_walk01 181
#define FRAME_walk02 182
#define FRAME_walk03 183
#define FRAME_walk04 184
#define FRAME_walk05 185
#define FRAME_walk06 186
#define FRAME_walk07 187
#define FRAME_walk08 188
#define FRAME_walk09 189
#define FRAME_walk10 190
#define FRAME_walk11 191
#define FRAME_walk12 192
#define FRAME_walk13 193
#define FRAME_walk14 194
#define FRAME_walk15 195
#define FRAME_walk16 196
#define FRAME_walk17 197
#define FRAME_walk18 198
#define FRAME_walk19 199
#define FRAME_walk20 200
#define FRAME_walk21 201
#define FRAME_walk22 202
#define FRAME_walk23 203
#define FRAME_walk24 204
#define FRAME_walk25 205
#define FRAME_walk26 206
#define FRAME_walk27 207
#define FRAME_recln201 208
#define FRAME_recln202 209
#define FRAME_recln203 210
#define FRAME_recln204 211
#define FRAME_recln205 212
#define FRAME_recln206 213
#define FRAME_recln207 214
#define FRAME_recln208 215
#define FRAME_recln209 216
#define FRAME_recln210 217
#define FRAME_recln211 218
#define FRAME_recln212 219
#define FRAME_recln213 220
#define FRAME_recln214 221
#define FRAME_recln215 222
#define FRAME_recln216 223
#define FRAME_recln217 224
#define FRAME_recln218 225
#define FRAME_recln219 226
#define FRAME_recln220 227
#define FRAME_recln221 228
#define FRAME_recln222 229
#define FRAME_recln223 230
#define FRAME_recln224 231
#define FRAME_recln225 232
#define FRAME_recln226 233
#define FRAME_recln227 234
#define FRAME_recln228 235
#define FRAME_recln229 236
#define FRAME_recln230 237
#define FRAME_recln231 238
#define FRAME_recln232 239
#define FRAME_recln233 240
#define FRAME_recln234 241
#define FRAME_recln235 242
#define FRAME_recln236 243
#define FRAME_recln237 244
#define FRAME_recln238 245
#define FRAME_recln239 246
#define FRAME_recln240 247
#define FRAME_recln101 248
#define FRAME_recln102 249
#define FRAME_recln103 250
#define FRAME_recln104 251
#define FRAME_recln105 252
#define FRAME_recln106 253
#define FRAME_recln107 254
#define FRAME_recln108 255
#define FRAME_recln109 256
#define FRAME_recln110 257
#define FRAME_recln111 258
#define FRAME_recln112 259
#define FRAME_recln113 260
#define FRAME_recln114 261
#define FRAME_recln115 262
#define FRAME_recln116 263
#define FRAME_recln117 264
#define FRAME_recln118 265
#define FRAME_recln119 266
#define FRAME_recln120 267
#define FRAME_recln121 268
#define FRAME_recln122 269
#define FRAME_recln123 270
#define FRAME_recln124 271
#define FRAME_recln125 272
#define FRAME_recln126 273
#define FRAME_recln127 274
#define FRAME_recln128 275
#define FRAME_recln129 276
#define FRAME_recln130 277
#define FRAME_recln131 278
#define FRAME_recln132 279
#define FRAME_recln133 280
#define FRAME_recln134 281
#define FRAME_recln135 282
#define FRAME_recln136 283
#define FRAME_recln137 284
#define FRAME_recln138 285
#define FRAME_recln139 286
#define FRAME_recln140 287
#define MODEL_SCALE 1.000000

View File

@ -1,416 +0,0 @@
/*
==============================================================================
FLIPPER
==============================================================================
*/
#include "g_local.h"
#include "m_flipper.h"
static int sound_chomp;
static int sound_attack;
static int sound_pain1;
static int sound_pain2;
static int sound_death;
static int sound_idle;
static int sound_search;
static int sound_sight;
void flipper_stand (edict_t *self);
mframe_t flipper_frames_stand [] =
{
ai_stand, 0, NULL
};
mmove_t flipper_move_stand = {FRAME_flphor01, FRAME_flphor01, flipper_frames_stand, NULL};
void flipper_stand (edict_t *self)
{
self->monsterinfo.currentmove = &flipper_move_stand;
}
#define FLIPPER_RUN_SPEED 24
mframe_t flipper_frames_run [] =
{
ai_run, FLIPPER_RUN_SPEED, NULL, // 6
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL, // 10
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL, // 20
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL,
ai_run, FLIPPER_RUN_SPEED, NULL // 29
};
mmove_t flipper_move_run_loop = {FRAME_flpver06, FRAME_flpver29, flipper_frames_run, NULL};
void flipper_run_loop (edict_t *self)
{
self->monsterinfo.currentmove = &flipper_move_run_loop;
}
mframe_t flipper_frames_run_start [] =
{
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL
};
mmove_t flipper_move_run_start = {FRAME_flpver01, FRAME_flpver06, flipper_frames_run_start, flipper_run_loop};
void flipper_run (edict_t *self)
{
self->monsterinfo.currentmove = &flipper_move_run_start;
}
/* Standard Swimming */
mframe_t flipper_frames_walk [] =
{
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL
};
mmove_t flipper_move_walk = {FRAME_flphor01, FRAME_flphor24, flipper_frames_walk, NULL};
void flipper_walk (edict_t *self)
{
self->monsterinfo.currentmove = &flipper_move_walk;
}
mframe_t flipper_frames_start_run [] =
{
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, NULL,
ai_run, 8, flipper_run
};
mmove_t flipper_move_start_run = {FRAME_flphor01, FRAME_flphor05, flipper_frames_start_run, NULL};
void flipper_start_run (edict_t *self)
{
self->monsterinfo.currentmove = &flipper_move_start_run;
}
mframe_t flipper_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flipper_move_pain2 = {FRAME_flppn101, FRAME_flppn105, flipper_frames_pain2, flipper_run};
mframe_t flipper_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flipper_move_pain1 = {FRAME_flppn201, FRAME_flppn205, flipper_frames_pain1, flipper_run};
void flipper_bite (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, 0, 0);
fire_hit (self, aim, 5, 0);
}
void flipper_preattack (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_chomp, 1, ATTN_NORM, 0);
}
mframe_t flipper_frames_attack [] =
{
ai_charge, 0, flipper_preattack,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, flipper_bite,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, flipper_bite,
ai_charge, 0, NULL
};
mmove_t flipper_move_attack = {FRAME_flpbit01, FRAME_flpbit20, flipper_frames_attack, flipper_run};
void flipper_melee(edict_t *self)
{
self->monsterinfo.currentmove = &flipper_move_attack;
}
void flipper_pain (edict_t *self, edict_t *other, float kick, int damage)
{
int n;
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
n = (rand() + 1) % 2;
if (n == 0)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &flipper_move_pain1;
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &flipper_move_pain2;
}
}
void flipper_dead (edict_t *self)
{
// VectorSet (self->mins, -16, -16, -24);
// VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t flipper_frames_death [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flipper_move_death = {FRAME_flpdth01, FRAME_flpdth56, flipper_frames_death, flipper_dead};
void flipper_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void flipper_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->monsterinfo.currentmove = &flipper_move_death;
}
/*QUAKED monster_flipper (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_flipper (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_FLIPPER;
self->spawnflags |= SF_MONSTER_KNOWS_MIRRORS;
sound_pain1 = gi.soundindex ("flipper/flppain1.wav");
sound_pain2 = gi.soundindex ("flipper/flppain2.wav");
sound_death = gi.soundindex ("flipper/flpdeth1.wav");
sound_chomp = gi.soundindex ("flipper/flpatck1.wav");
sound_attack = gi.soundindex ("flipper/flpatck2.wav");
sound_idle = gi.soundindex ("flipper/flpidle1.wav");
sound_search = gi.soundindex ("flipper/flpsrch1.wav");
sound_sight = gi.soundindex ("flipper/flpsght1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/flipper/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/flipper/tris.md2");
VectorSet (self->mins, -16, -16, 0);
VectorSet (self->maxs, 16, 16, 32);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 50;
if(!self->gib_health)
self->gib_health = -30;
if(!self->mass)
self->mass = 100;
self->pain = flipper_pain;
self->die = flipper_die;
self->monsterinfo.stand = flipper_stand;
self->monsterinfo.walk = flipper_walk;
self->monsterinfo.run = flipper_start_run;
self->monsterinfo.melee = flipper_melee;
self->monsterinfo.sight = flipper_sight;
gi.linkentity (self);
self->monsterinfo.currentmove = &flipper_move_stand;
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.90;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&flipper_move_death,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->common_name = "Barracuda Shark";
self->monsterinfo.scale = MODEL_SCALE;
swimmonster_start (self);
}

View File

@ -1,166 +0,0 @@
// G:\quake2\baseq2\models/monsters/flipper
// This file generated by ModelGen - Do NOT Modify
#define FRAME_flpbit01 0
#define FRAME_flpbit02 1
#define FRAME_flpbit03 2
#define FRAME_flpbit04 3
#define FRAME_flpbit05 4
#define FRAME_flpbit06 5
#define FRAME_flpbit07 6
#define FRAME_flpbit08 7
#define FRAME_flpbit09 8
#define FRAME_flpbit10 9
#define FRAME_flpbit11 10
#define FRAME_flpbit12 11
#define FRAME_flpbit13 12
#define FRAME_flpbit14 13
#define FRAME_flpbit15 14
#define FRAME_flpbit16 15
#define FRAME_flpbit17 16
#define FRAME_flpbit18 17
#define FRAME_flpbit19 18
#define FRAME_flpbit20 19
#define FRAME_flptal01 20
#define FRAME_flptal02 21
#define FRAME_flptal03 22
#define FRAME_flptal04 23
#define FRAME_flptal05 24
#define FRAME_flptal06 25
#define FRAME_flptal07 26
#define FRAME_flptal08 27
#define FRAME_flptal09 28
#define FRAME_flptal10 29
#define FRAME_flptal11 30
#define FRAME_flptal12 31
#define FRAME_flptal13 32
#define FRAME_flptal14 33
#define FRAME_flptal15 34
#define FRAME_flptal16 35
#define FRAME_flptal17 36
#define FRAME_flptal18 37
#define FRAME_flptal19 38
#define FRAME_flptal20 39
#define FRAME_flptal21 40
#define FRAME_flphor01 41
#define FRAME_flphor02 42
#define FRAME_flphor03 43
#define FRAME_flphor04 44
#define FRAME_flphor05 45
#define FRAME_flphor06 46
#define FRAME_flphor07 47
#define FRAME_flphor08 48
#define FRAME_flphor09 49
#define FRAME_flphor10 50
#define FRAME_flphor11 51
#define FRAME_flphor12 52
#define FRAME_flphor13 53
#define FRAME_flphor14 54
#define FRAME_flphor15 55
#define FRAME_flphor16 56
#define FRAME_flphor17 57
#define FRAME_flphor18 58
#define FRAME_flphor19 59
#define FRAME_flphor20 60
#define FRAME_flphor21 61
#define FRAME_flphor22 62
#define FRAME_flphor23 63
#define FRAME_flphor24 64
#define FRAME_flpver01 65
#define FRAME_flpver02 66
#define FRAME_flpver03 67
#define FRAME_flpver04 68
#define FRAME_flpver05 69
#define FRAME_flpver06 70
#define FRAME_flpver07 71
#define FRAME_flpver08 72
#define FRAME_flpver09 73
#define FRAME_flpver10 74
#define FRAME_flpver11 75
#define FRAME_flpver12 76
#define FRAME_flpver13 77
#define FRAME_flpver14 78
#define FRAME_flpver15 79
#define FRAME_flpver16 80
#define FRAME_flpver17 81
#define FRAME_flpver18 82
#define FRAME_flpver19 83
#define FRAME_flpver20 84
#define FRAME_flpver21 85
#define FRAME_flpver22 86
#define FRAME_flpver23 87
#define FRAME_flpver24 88
#define FRAME_flpver25 89
#define FRAME_flpver26 90
#define FRAME_flpver27 91
#define FRAME_flpver28 92
#define FRAME_flpver29 93
#define FRAME_flppn101 94
#define FRAME_flppn102 95
#define FRAME_flppn103 96
#define FRAME_flppn104 97
#define FRAME_flppn105 98
#define FRAME_flppn201 99
#define FRAME_flppn202 100
#define FRAME_flppn203 101
#define FRAME_flppn204 102
#define FRAME_flppn205 103
#define FRAME_flpdth01 104
#define FRAME_flpdth02 105
#define FRAME_flpdth03 106
#define FRAME_flpdth04 107
#define FRAME_flpdth05 108
#define FRAME_flpdth06 109
#define FRAME_flpdth07 110
#define FRAME_flpdth08 111
#define FRAME_flpdth09 112
#define FRAME_flpdth10 113
#define FRAME_flpdth11 114
#define FRAME_flpdth12 115
#define FRAME_flpdth13 116
#define FRAME_flpdth14 117
#define FRAME_flpdth15 118
#define FRAME_flpdth16 119
#define FRAME_flpdth17 120
#define FRAME_flpdth18 121
#define FRAME_flpdth19 122
#define FRAME_flpdth20 123
#define FRAME_flpdth21 124
#define FRAME_flpdth22 125
#define FRAME_flpdth23 126
#define FRAME_flpdth24 127
#define FRAME_flpdth25 128
#define FRAME_flpdth26 129
#define FRAME_flpdth27 130
#define FRAME_flpdth28 131
#define FRAME_flpdth29 132
#define FRAME_flpdth30 133
#define FRAME_flpdth31 134
#define FRAME_flpdth32 135
#define FRAME_flpdth33 136
#define FRAME_flpdth34 137
#define FRAME_flpdth35 138
#define FRAME_flpdth36 139
#define FRAME_flpdth37 140
#define FRAME_flpdth38 141
#define FRAME_flpdth39 142
#define FRAME_flpdth40 143
#define FRAME_flpdth41 144
#define FRAME_flpdth42 145
#define FRAME_flpdth43 146
#define FRAME_flpdth44 147
#define FRAME_flpdth45 148
#define FRAME_flpdth46 149
#define FRAME_flpdth47 150
#define FRAME_flpdth48 151
#define FRAME_flpdth49 152
#define FRAME_flpdth50 153
#define FRAME_flpdth51 154
#define FRAME_flpdth52 155
#define FRAME_flpdth53 156
#define FRAME_flpdth54 157
#define FRAME_flpdth55 158
#define FRAME_flpdth56 159
#define MODEL_SCALE 1.000000

View File

@ -1,683 +0,0 @@
/*
==============================================================================
floater
==============================================================================
*/
#include "g_local.h"
#include "m_float.h"
static int sound_attack2;
static int sound_attack3;
static int sound_death1;
static int sound_idle;
static int sound_pain1;
static int sound_pain2;
static int sound_sight;
void floater_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void floater_idle (edict_t *self)
{
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
//void floater_stand1 (edict_t *self);
void floater_dead (edict_t *self);
void floater_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
void floater_run (edict_t *self);
void floater_wham (edict_t *self);
void floater_zap (edict_t *self);
void floater_fire_blaster (edict_t *self)
{
vec3_t start;
vec3_t forward, right;
vec3_t end;
vec3_t dir;
int effect;
if ((self->s.frame == FRAME_attak104) || (self->s.frame == FRAME_attak107))
effect = EF_HYPERBLASTER;
else
effect = 0;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_FLOAT_BLASTER_1], forward, right, start);
VectorCopy (self->enemy->s.origin, end);
end[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
end[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
end[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
end[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (end, start, dir);
monster_fire_blaster (self, start, dir, 1, 1000, MZ2_FLOAT_BLASTER_1, effect);
}
mframe_t floater_frames_stand1 [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t floater_move_stand1 = {FRAME_stand101, FRAME_stand152, floater_frames_stand1, NULL};
mframe_t floater_frames_stand2 [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t floater_move_stand2 = {FRAME_stand201, FRAME_stand252, floater_frames_stand2, NULL};
void floater_stand (edict_t *self)
{
if (random() <= 0.5)
self->monsterinfo.currentmove = &floater_move_stand1;
else
self->monsterinfo.currentmove = &floater_move_stand2;
}
mframe_t floater_frames_activate [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t floater_move_activate = {FRAME_actvat01, FRAME_actvat31, floater_frames_activate, NULL};
mframe_t floater_frames_attack1 [] =
{
ai_charge, 0, NULL, // Blaster attack
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, floater_fire_blaster, // BOOM (0, -25.8, 32.5) -- LOOP Starts
ai_charge, 0, floater_fire_blaster,
ai_charge, 0, floater_fire_blaster,
ai_charge, 0, floater_fire_blaster,
ai_charge, 0, floater_fire_blaster,
ai_charge, 0, floater_fire_blaster,
ai_charge, 0, floater_fire_blaster,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL // -- LOOP Ends
};
mmove_t floater_move_attack1 = {FRAME_attak101, FRAME_attak114, floater_frames_attack1, floater_run};
mframe_t floater_frames_attack2 [] =
{
ai_charge, 0, NULL, // Claws
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, floater_wham, // WHAM (0, -45, 29.6) -- LOOP Starts
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL, // -- LOOP Ends
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t floater_move_attack2 = {FRAME_attak201, FRAME_attak225, floater_frames_attack2, floater_run};
mframe_t floater_frames_attack3 [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, floater_zap, // -- LOOP Starts
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL, // -- LOOP Ends
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t floater_move_attack3 = {FRAME_attak301, FRAME_attak334, floater_frames_attack3, floater_run};
mframe_t floater_frames_death [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t floater_move_death = {FRAME_death01, FRAME_death13, floater_frames_death, floater_dead};
mframe_t floater_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t floater_move_pain1 = {FRAME_pain101, FRAME_pain107, floater_frames_pain1, floater_run};
mframe_t floater_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t floater_move_pain2 = {FRAME_pain201, FRAME_pain208, floater_frames_pain2, floater_run};
mframe_t floater_frames_pain3 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t floater_move_pain3 = {FRAME_pain301, FRAME_pain312, floater_frames_pain3, floater_run};
mframe_t floater_frames_walk [] =
{
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL
};
mmove_t floater_move_walk = {FRAME_stand101, FRAME_stand152, floater_frames_walk, NULL};
mframe_t floater_frames_run [] =
{
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL,
ai_run, 13, NULL
};
mmove_t floater_move_run = {FRAME_stand101, FRAME_stand152, floater_frames_run, NULL};
void floater_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &floater_move_stand1;
else
self->monsterinfo.currentmove = &floater_move_run;
}
void floater_walk (edict_t *self)
{
self->monsterinfo.currentmove = &floater_move_walk;
}
void floater_wham (edict_t *self)
{
static vec3_t aim = {MELEE_DISTANCE, 0, 0};
gi.sound (self, CHAN_WEAPON, sound_attack3, 1, ATTN_NORM, 0);
fire_hit (self, aim, 5 + rand() % 6, -50);
}
void floater_zap (edict_t *self)
{
vec3_t forward, right;
vec3_t origin;
vec3_t dir;
vec3_t offset;
VectorSubtract (self->enemy->s.origin, self->s.origin, dir);
AngleVectors (self->s.angles, forward, right, NULL);
//FIXME use a flash and replace these two lines with the commented one
VectorSet (offset, 18.5, -0.9, 10);
G_ProjectSource (self->s.origin, offset, forward, right, origin);
// G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, origin);
gi.sound (self, CHAN_WEAPON, sound_attack2, 1, ATTN_NORM, 0);
//FIXME use the flash, Luke
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (TE_SPLASH);
WRITE_BYTE (32);
WRITE_COORD (origin);
WRITE_DIR (dir);
WRITE_BYTE (1); //sparks
MESSAGE_SEND (MSG_PVS, origin, NULL);
T_Damage (self->enemy, self, self, dir, self->enemy->s.origin, vec3_origin, 5 + rand() % 6, -10, DAMAGE_ENERGY, MOD_UNKNOWN);
}
void floater_attack(edict_t *self)
{
self->monsterinfo.currentmove = &floater_move_attack1;
}
void floater_melee(edict_t *self)
{
if (random() < 0.5)
self->monsterinfo.currentmove = &floater_move_attack3;
else
self->monsterinfo.currentmove = &floater_move_attack2;
}
void floater_pain (edict_t *self, edict_t *other, float kick, int damage)
{
int n;
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
n = (rand() + 1) % 3;
if (n == 0)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &floater_move_pain1;
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &floater_move_pain2;
}
}
void floater_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
}
void floater_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
gi.sound (self, CHAN_VOICE, sound_death1, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
/*QUAKED monster_floater (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_floater (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_FLOATER;
sound_attack2 = gi.soundindex ("floater/fltatck2.wav");
sound_attack3 = gi.soundindex ("floater/fltatck3.wav");
sound_death1 = gi.soundindex ("floater/fltdeth1.wav");
sound_idle = gi.soundindex ("floater/fltidle1.wav");
sound_pain1 = gi.soundindex ("floater/fltpain1.wav");
sound_pain2 = gi.soundindex ("floater/fltpain2.wav");
sound_sight = gi.soundindex ("floater/fltsght1.wav");
gi.soundindex ("floater/fltatck1.wav");
self->s.sound = gi.soundindex ("floater/fltsrch1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/float/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/float/tris.md2");
VectorSet (self->mins, -24, -24, -24);
VectorSet (self->maxs, 24, 24, 32);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 200;
if(!self->gib_health)
self->gib_health = -80;
if(!self->mass)
self->mass = 300;
self->pain = floater_pain;
self->die = floater_die;
self->monsterinfo.stand = floater_stand;
self->monsterinfo.walk = floater_walk;
self->monsterinfo.run = floater_run;
// self->monsterinfo.dodge = floater_dodge;
self->monsterinfo.attack = floater_attack;
self->monsterinfo.melee = floater_melee;
self->monsterinfo.sight = floater_sight;
self->monsterinfo.idle = floater_idle;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
self->common_name = "Technician";
gi.linkentity (self);
if(self->health < 0)
{
mmove_t *deathmoves[] = {&floater_move_death,
NULL};
if(!M_SetDeath(self,(mmove_t **)&deathmoves))
self->monsterinfo.currentmove = &floater_move_stand1;
}
else
{
if (random() <= 0.5)
self->monsterinfo.currentmove = &floater_move_stand1;
else
self->monsterinfo.currentmove = &floater_move_stand2;
}
self->monsterinfo.scale = MODEL_SCALE;
flymonster_start (self);
}

View File

@ -1,254 +0,0 @@
// G:\quake2\baseq2\models/monsters/float
// This file generated by ModelGen - Do NOT Modify
#define FRAME_actvat01 0
#define FRAME_actvat02 1
#define FRAME_actvat03 2
#define FRAME_actvat04 3
#define FRAME_actvat05 4
#define FRAME_actvat06 5
#define FRAME_actvat07 6
#define FRAME_actvat08 7
#define FRAME_actvat09 8
#define FRAME_actvat10 9
#define FRAME_actvat11 10
#define FRAME_actvat12 11
#define FRAME_actvat13 12
#define FRAME_actvat14 13
#define FRAME_actvat15 14
#define FRAME_actvat16 15
#define FRAME_actvat17 16
#define FRAME_actvat18 17
#define FRAME_actvat19 18
#define FRAME_actvat20 19
#define FRAME_actvat21 20
#define FRAME_actvat22 21
#define FRAME_actvat23 22
#define FRAME_actvat24 23
#define FRAME_actvat25 24
#define FRAME_actvat26 25
#define FRAME_actvat27 26
#define FRAME_actvat28 27
#define FRAME_actvat29 28
#define FRAME_actvat30 29
#define FRAME_actvat31 30
#define FRAME_attak101 31
#define FRAME_attak102 32
#define FRAME_attak103 33
#define FRAME_attak104 34
#define FRAME_attak105 35
#define FRAME_attak106 36
#define FRAME_attak107 37
#define FRAME_attak108 38
#define FRAME_attak109 39
#define FRAME_attak110 40
#define FRAME_attak111 41
#define FRAME_attak112 42
#define FRAME_attak113 43
#define FRAME_attak114 44
#define FRAME_attak201 45
#define FRAME_attak202 46
#define FRAME_attak203 47
#define FRAME_attak204 48
#define FRAME_attak205 49
#define FRAME_attak206 50
#define FRAME_attak207 51
#define FRAME_attak208 52
#define FRAME_attak209 53
#define FRAME_attak210 54
#define FRAME_attak211 55
#define FRAME_attak212 56
#define FRAME_attak213 57
#define FRAME_attak214 58
#define FRAME_attak215 59
#define FRAME_attak216 60
#define FRAME_attak217 61
#define FRAME_attak218 62
#define FRAME_attak219 63
#define FRAME_attak220 64
#define FRAME_attak221 65
#define FRAME_attak222 66
#define FRAME_attak223 67
#define FRAME_attak224 68
#define FRAME_attak225 69
#define FRAME_attak301 70
#define FRAME_attak302 71
#define FRAME_attak303 72
#define FRAME_attak304 73
#define FRAME_attak305 74
#define FRAME_attak306 75
#define FRAME_attak307 76
#define FRAME_attak308 77
#define FRAME_attak309 78
#define FRAME_attak310 79
#define FRAME_attak311 80
#define FRAME_attak312 81
#define FRAME_attak313 82
#define FRAME_attak314 83
#define FRAME_attak315 84
#define FRAME_attak316 85
#define FRAME_attak317 86
#define FRAME_attak318 87
#define FRAME_attak319 88
#define FRAME_attak320 89
#define FRAME_attak321 90
#define FRAME_attak322 91
#define FRAME_attak323 92
#define FRAME_attak324 93
#define FRAME_attak325 94
#define FRAME_attak326 95
#define FRAME_attak327 96
#define FRAME_attak328 97
#define FRAME_attak329 98
#define FRAME_attak330 99
#define FRAME_attak331 100
#define FRAME_attak332 101
#define FRAME_attak333 102
#define FRAME_attak334 103
#define FRAME_death01 104
#define FRAME_death02 105
#define FRAME_death03 106
#define FRAME_death04 107
#define FRAME_death05 108
#define FRAME_death06 109
#define FRAME_death07 110
#define FRAME_death08 111
#define FRAME_death09 112
#define FRAME_death10 113
#define FRAME_death11 114
#define FRAME_death12 115
#define FRAME_death13 116
#define FRAME_pain101 117
#define FRAME_pain102 118
#define FRAME_pain103 119
#define FRAME_pain104 120
#define FRAME_pain105 121
#define FRAME_pain106 122
#define FRAME_pain107 123
#define FRAME_pain201 124
#define FRAME_pain202 125
#define FRAME_pain203 126
#define FRAME_pain204 127
#define FRAME_pain205 128
#define FRAME_pain206 129
#define FRAME_pain207 130
#define FRAME_pain208 131
#define FRAME_pain301 132
#define FRAME_pain302 133
#define FRAME_pain303 134
#define FRAME_pain304 135
#define FRAME_pain305 136
#define FRAME_pain306 137
#define FRAME_pain307 138
#define FRAME_pain308 139
#define FRAME_pain309 140
#define FRAME_pain310 141
#define FRAME_pain311 142
#define FRAME_pain312 143
#define FRAME_stand101 144
#define FRAME_stand102 145
#define FRAME_stand103 146
#define FRAME_stand104 147
#define FRAME_stand105 148
#define FRAME_stand106 149
#define FRAME_stand107 150
#define FRAME_stand108 151
#define FRAME_stand109 152
#define FRAME_stand110 153
#define FRAME_stand111 154
#define FRAME_stand112 155
#define FRAME_stand113 156
#define FRAME_stand114 157
#define FRAME_stand115 158
#define FRAME_stand116 159
#define FRAME_stand117 160
#define FRAME_stand118 161
#define FRAME_stand119 162
#define FRAME_stand120 163
#define FRAME_stand121 164
#define FRAME_stand122 165
#define FRAME_stand123 166
#define FRAME_stand124 167
#define FRAME_stand125 168
#define FRAME_stand126 169
#define FRAME_stand127 170
#define FRAME_stand128 171
#define FRAME_stand129 172
#define FRAME_stand130 173
#define FRAME_stand131 174
#define FRAME_stand132 175
#define FRAME_stand133 176
#define FRAME_stand134 177
#define FRAME_stand135 178
#define FRAME_stand136 179
#define FRAME_stand137 180
#define FRAME_stand138 181
#define FRAME_stand139 182
#define FRAME_stand140 183
#define FRAME_stand141 184
#define FRAME_stand142 185
#define FRAME_stand143 186
#define FRAME_stand144 187
#define FRAME_stand145 188
#define FRAME_stand146 189
#define FRAME_stand147 190
#define FRAME_stand148 191
#define FRAME_stand149 192
#define FRAME_stand150 193
#define FRAME_stand151 194
#define FRAME_stand152 195
#define FRAME_stand201 196
#define FRAME_stand202 197
#define FRAME_stand203 198
#define FRAME_stand204 199
#define FRAME_stand205 200
#define FRAME_stand206 201
#define FRAME_stand207 202
#define FRAME_stand208 203
#define FRAME_stand209 204
#define FRAME_stand210 205
#define FRAME_stand211 206
#define FRAME_stand212 207
#define FRAME_stand213 208
#define FRAME_stand214 209
#define FRAME_stand215 210
#define FRAME_stand216 211
#define FRAME_stand217 212
#define FRAME_stand218 213
#define FRAME_stand219 214
#define FRAME_stand220 215
#define FRAME_stand221 216
#define FRAME_stand222 217
#define FRAME_stand223 218
#define FRAME_stand224 219
#define FRAME_stand225 220
#define FRAME_stand226 221
#define FRAME_stand227 222
#define FRAME_stand228 223
#define FRAME_stand229 224
#define FRAME_stand230 225
#define FRAME_stand231 226
#define FRAME_stand232 227
#define FRAME_stand233 228
#define FRAME_stand234 229
#define FRAME_stand235 230
#define FRAME_stand236 231
#define FRAME_stand237 232
#define FRAME_stand238 233
#define FRAME_stand239 234
#define FRAME_stand240 235
#define FRAME_stand241 236
#define FRAME_stand242 237
#define FRAME_stand243 238
#define FRAME_stand244 239
#define FRAME_stand245 240
#define FRAME_stand246 241
#define FRAME_stand247 242
#define FRAME_stand248 243
#define FRAME_stand249 244
#define FRAME_stand250 245
#define FRAME_stand251 246
#define FRAME_stand252 247
#define MODEL_SCALE 1.000000

View File

@ -1,633 +0,0 @@
/*
==============================================================================
flyer
==============================================================================
*/
#include "g_local.h"
#include "m_flyer.h"
bool visible (edict_t *self, edict_t *other);
static int nextmove; // Used for start/stop frames
static int sound_sight;
static int sound_idle;
static int sound_pain1;
static int sound_pain2;
static int sound_slash;
static int sound_sproing;
static int sound_die;
void flyer_check_melee(edict_t *self);
void flyer_loop_melee (edict_t *self);
void flyer_melee (edict_t *self);
void flyer_setstart (edict_t *self);
void flyer_stand (edict_t *self);
void flyer_nextmove (edict_t *self);
void flyer_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void flyer_idle (edict_t *self)
{
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void flyer_pop_blades (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_sproing, 1, ATTN_NORM, 0);
}
mframe_t flyer_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t flyer_move_stand = {FRAME_stand01, FRAME_stand45, flyer_frames_stand, NULL};
mframe_t flyer_frames_walk [] =
{
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL
};
mmove_t flyer_move_walk = {FRAME_stand01, FRAME_stand45, flyer_frames_walk, NULL};
mframe_t flyer_frames_run [] =
{
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL
};
mmove_t flyer_move_run = {FRAME_stand01, FRAME_stand45, flyer_frames_run, NULL};
void flyer_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &flyer_move_stand;
else
self->monsterinfo.currentmove = &flyer_move_run;
}
void flyer_walk (edict_t *self)
{
self->monsterinfo.currentmove = &flyer_move_walk;
}
void flyer_stand (edict_t *self)
{
self->monsterinfo.currentmove = &flyer_move_stand;
}
mframe_t flyer_frames_start [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, flyer_nextmove
};
mmove_t flyer_move_start = {FRAME_start01, FRAME_start06, flyer_frames_start, NULL};
mframe_t flyer_frames_stop [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, flyer_nextmove
};
mmove_t flyer_move_stop = {FRAME_stop01, FRAME_stop07, flyer_frames_stop, NULL};
void flyer_stop (edict_t *self)
{
self->monsterinfo.currentmove = &flyer_move_stop;
}
void flyer_start (edict_t *self)
{
self->monsterinfo.currentmove = &flyer_move_start;
}
mframe_t flyer_frames_rollright [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flyer_move_rollright = {FRAME_rollr01, FRAME_rollr09, flyer_frames_rollright, NULL};
mframe_t flyer_frames_rollleft [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flyer_move_rollleft = {FRAME_rollf01, FRAME_rollf09, flyer_frames_rollleft, NULL};
mframe_t flyer_frames_pain3 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flyer_move_pain3 = {FRAME_pain301, FRAME_pain304, flyer_frames_pain3, flyer_run};
mframe_t flyer_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flyer_move_pain2 = {FRAME_pain201, FRAME_pain204, flyer_frames_pain2, flyer_run};
mframe_t flyer_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flyer_move_pain1 = {FRAME_pain101, FRAME_pain109, flyer_frames_pain1, flyer_run};
mframe_t flyer_frames_defense [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // Hold this frame
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flyer_move_defense = {FRAME_defens01, FRAME_defens06, flyer_frames_defense, NULL};
mframe_t flyer_frames_bankright [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flyer_move_bankright = {FRAME_bankr01, FRAME_bankr07, flyer_frames_bankright, NULL};
mframe_t flyer_frames_bankleft [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t flyer_move_bankleft = {FRAME_bankl01, FRAME_bankl07, flyer_frames_bankleft, NULL};
void flyer_fire (edict_t *self, int flash_number)
{
vec3_t start;
vec3_t forward, right;
vec3_t end;
vec3_t dir;
int effect;
if ((self->s.frame == FRAME_attak204) || (self->s.frame == FRAME_attak207) || (self->s.frame == FRAME_attak210))
effect = EF_HYPERBLASTER;
else
effect = 0;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
VectorCopy (self->enemy->s.origin, end);
end[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
end[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
end[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
end[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (end, start, dir);
monster_fire_blaster (self, start, dir, 1, 1000, flash_number, effect);
}
void flyer_fireleft (edict_t *self)
{
flyer_fire (self, MZ2_FLYER_BLASTER_1);
}
void flyer_fireright (edict_t *self)
{
flyer_fire (self, MZ2_FLYER_BLASTER_2);
}
mframe_t flyer_frames_attack2 [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, -10, flyer_fireleft, // left gun
ai_charge, -10, flyer_fireright, // right gun
ai_charge, -10, flyer_fireleft, // left gun
ai_charge, -10, flyer_fireright, // right gun
ai_charge, -10, flyer_fireleft, // left gun
ai_charge, -10, flyer_fireright, // right gun
ai_charge, -10, flyer_fireleft, // left gun
ai_charge, -10, flyer_fireright, // right gun
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t flyer_move_attack2 = {FRAME_attak201, FRAME_attak217, flyer_frames_attack2, flyer_run};
void flyer_slash_left (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->mins[0], 0);
fire_hit (self, aim, 5, 0);
gi.sound (self, CHAN_WEAPON, sound_slash, 1, ATTN_NORM, 0);
}
void flyer_slash_right (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->maxs[0], 0);
fire_hit (self, aim, 5, 0);
gi.sound (self, CHAN_WEAPON, sound_slash, 1, ATTN_NORM, 0);
}
mframe_t flyer_frames_start_melee [] =
{
ai_charge, 0, flyer_pop_blades,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t flyer_move_start_melee = {FRAME_attak101, FRAME_attak106, flyer_frames_start_melee, flyer_loop_melee};
mframe_t flyer_frames_end_melee [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t flyer_move_end_melee = {FRAME_attak119, FRAME_attak121, flyer_frames_end_melee, flyer_run};
mframe_t flyer_frames_loop_melee [] =
{
ai_charge, 0, NULL, // Loop Start
ai_charge, 0, NULL,
ai_charge, 0, flyer_slash_left, // Left Wing Strike
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, flyer_slash_right, // Right Wing Strike
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL // Loop Ends
};
mmove_t flyer_move_loop_melee = {FRAME_attak107, FRAME_attak118, flyer_frames_loop_melee, flyer_check_melee};
void flyer_loop_melee (edict_t *self)
{
/* if (random() <= 0.5)
self->monsterinfo.currentmove = &flyer_move_attack1;
else */
self->monsterinfo.currentmove = &flyer_move_loop_melee;
}
void flyer_attack (edict_t *self)
{
/* if (random() <= 0.5)
self->monsterinfo.currentmove = &flyer_move_attack1;
else */
self->monsterinfo.currentmove = &flyer_move_attack2;
}
void flyer_setstart (edict_t *self)
{
nextmove = ACTION_run;
self->monsterinfo.currentmove = &flyer_move_start;
}
void flyer_nextmove (edict_t *self)
{
if (nextmove == ACTION_attack1)
self->monsterinfo.currentmove = &flyer_move_start_melee;
else if (nextmove == ACTION_attack2)
self->monsterinfo.currentmove = &flyer_move_attack2;
else if (nextmove == ACTION_run)
self->monsterinfo.currentmove = &flyer_move_run;
}
void flyer_melee (edict_t *self)
{
// flyer.nextmove = ACTION_attack1;
// self->monsterinfo.currentmove = &flyer_move_stop;
self->monsterinfo.currentmove = &flyer_move_start_melee;
}
void flyer_check_melee(edict_t *self)
{
if (range (self, self->enemy) == RANGE_MELEE)
if (random() <= 0.8)
self->monsterinfo.currentmove = &flyer_move_loop_melee;
else
self->monsterinfo.currentmove = &flyer_move_end_melee;
else
self->monsterinfo.currentmove = &flyer_move_end_melee;
}
void flyer_pain (edict_t *self, edict_t *other, float kick, int damage)
{
int n;
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
n = rand() % 3;
if (n == 0)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &flyer_move_pain1;
}
else if (n == 1)
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &flyer_move_pain2;
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &flyer_move_pain3;
}
}
void flyer_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
/*QUAKED monster_flyer (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_flyer (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_FLYER;
// fix a map bug in jail5.bsp
if (!strcasecmp(level.mapname, "jail5") && (self->s.origin[2] == -104))
{
self->targetname = self->target;
self->target = NULL;
}
sound_sight = gi.soundindex ("flyer/flysght1.wav");
sound_idle = gi.soundindex ("flyer/flysrch1.wav");
sound_pain1 = gi.soundindex ("flyer/flypain1.wav");
sound_pain2 = gi.soundindex ("flyer/flypain2.wav");
sound_slash = gi.soundindex ("flyer/flyatck2.wav");
sound_sproing = gi.soundindex ("flyer/flyatck1.wav");
sound_die = gi.soundindex ("flyer/flydeth1.wav");
gi.soundindex ("flyer/flyatck3.wav");
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/flyer/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/flyer/tris.md2");
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, 32);
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
self->s.sound = gi.soundindex ("flyer/flyidle1.wav");
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 50;
if(!self->mass)
self->mass = 50;
self->pain = flyer_pain;
self->die = flyer_die;
self->monsterinfo.stand = flyer_stand;
self->monsterinfo.walk = flyer_walk;
self->monsterinfo.run = flyer_run;
self->monsterinfo.attack = flyer_attack;
self->monsterinfo.melee = flyer_melee;
self->monsterinfo.sight = flyer_sight;
self->monsterinfo.idle = flyer_idle;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
self->common_name = "Flyer";
gi.linkentity (self);
self->monsterinfo.currentmove = &flyer_move_stand;
self->monsterinfo.scale = MODEL_SCALE;
flymonster_start (self);
}

View File

@ -1,163 +0,0 @@
// G:\quake2\baseq2\models/monsters/flyer
// This file generated by ModelGen - Do NOT Modify
#define ACTION_nothing 0
#define ACTION_attack1 1
#define ACTION_attack2 2
#define ACTION_run 3
#define ACTION_walk 4
#define FRAME_start01 0
#define FRAME_start02 1
#define FRAME_start03 2
#define FRAME_start04 3
#define FRAME_start05 4
#define FRAME_start06 5
#define FRAME_stop01 6
#define FRAME_stop02 7
#define FRAME_stop03 8
#define FRAME_stop04 9
#define FRAME_stop05 10
#define FRAME_stop06 11
#define FRAME_stop07 12
#define FRAME_stand01 13
#define FRAME_stand02 14
#define FRAME_stand03 15
#define FRAME_stand04 16
#define FRAME_stand05 17
#define FRAME_stand06 18
#define FRAME_stand07 19
#define FRAME_stand08 20
#define FRAME_stand09 21
#define FRAME_stand10 22
#define FRAME_stand11 23
#define FRAME_stand12 24
#define FRAME_stand13 25
#define FRAME_stand14 26
#define FRAME_stand15 27
#define FRAME_stand16 28
#define FRAME_stand17 29
#define FRAME_stand18 30
#define FRAME_stand19 31
#define FRAME_stand20 32
#define FRAME_stand21 33
#define FRAME_stand22 34
#define FRAME_stand23 35
#define FRAME_stand24 36
#define FRAME_stand25 37
#define FRAME_stand26 38
#define FRAME_stand27 39
#define FRAME_stand28 40
#define FRAME_stand29 41
#define FRAME_stand30 42
#define FRAME_stand31 43
#define FRAME_stand32 44
#define FRAME_stand33 45
#define FRAME_stand34 46
#define FRAME_stand35 47
#define FRAME_stand36 48
#define FRAME_stand37 49
#define FRAME_stand38 50
#define FRAME_stand39 51
#define FRAME_stand40 52
#define FRAME_stand41 53
#define FRAME_stand42 54
#define FRAME_stand43 55
#define FRAME_stand44 56
#define FRAME_stand45 57
#define FRAME_attak101 58
#define FRAME_attak102 59
#define FRAME_attak103 60
#define FRAME_attak104 61
#define FRAME_attak105 62
#define FRAME_attak106 63
#define FRAME_attak107 64
#define FRAME_attak108 65
#define FRAME_attak109 66
#define FRAME_attak110 67
#define FRAME_attak111 68
#define FRAME_attak112 69
#define FRAME_attak113 70
#define FRAME_attak114 71
#define FRAME_attak115 72
#define FRAME_attak116 73
#define FRAME_attak117 74
#define FRAME_attak118 75
#define FRAME_attak119 76
#define FRAME_attak120 77
#define FRAME_attak121 78
#define FRAME_attak201 79
#define FRAME_attak202 80
#define FRAME_attak203 81
#define FRAME_attak204 82
#define FRAME_attak205 83
#define FRAME_attak206 84
#define FRAME_attak207 85
#define FRAME_attak208 86
#define FRAME_attak209 87
#define FRAME_attak210 88
#define FRAME_attak211 89
#define FRAME_attak212 90
#define FRAME_attak213 91
#define FRAME_attak214 92
#define FRAME_attak215 93
#define FRAME_attak216 94
#define FRAME_attak217 95
#define FRAME_bankl01 96
#define FRAME_bankl02 97
#define FRAME_bankl03 98
#define FRAME_bankl04 99
#define FRAME_bankl05 100
#define FRAME_bankl06 101
#define FRAME_bankl07 102
#define FRAME_bankr01 103
#define FRAME_bankr02 104
#define FRAME_bankr03 105
#define FRAME_bankr04 106
#define FRAME_bankr05 107
#define FRAME_bankr06 108
#define FRAME_bankr07 109
#define FRAME_rollf01 110
#define FRAME_rollf02 111
#define FRAME_rollf03 112
#define FRAME_rollf04 113
#define FRAME_rollf05 114
#define FRAME_rollf06 115
#define FRAME_rollf07 116
#define FRAME_rollf08 117
#define FRAME_rollf09 118
#define FRAME_rollr01 119
#define FRAME_rollr02 120
#define FRAME_rollr03 121
#define FRAME_rollr04 122
#define FRAME_rollr05 123
#define FRAME_rollr06 124
#define FRAME_rollr07 125
#define FRAME_rollr08 126
#define FRAME_rollr09 127
#define FRAME_defens01 128
#define FRAME_defens02 129
#define FRAME_defens03 130
#define FRAME_defens04 131
#define FRAME_defens05 132
#define FRAME_defens06 133
#define FRAME_pain101 134
#define FRAME_pain102 135
#define FRAME_pain103 136
#define FRAME_pain104 137
#define FRAME_pain105 138
#define FRAME_pain106 139
#define FRAME_pain107 140
#define FRAME_pain108 141
#define FRAME_pain109 142
#define FRAME_pain201 143
#define FRAME_pain202 144
#define FRAME_pain203 145
#define FRAME_pain204 146
#define FRAME_pain301 147
#define FRAME_pain302 148
#define FRAME_pain303 149
#define FRAME_pain304 150
#define MODEL_SCALE 1.000000

View File

@ -1,434 +0,0 @@
/*
==============================================================================
GLADIATOR
==============================================================================
*/
#include "g_local.h"
#include "m_gladiator.h"
static int sound_pain1;
static int sound_pain2;
static int sound_die;
static int sound_gun;
static int sound_cleaver_swing;
static int sound_cleaver_hit;
static int sound_cleaver_miss;
static int sound_idle;
static int sound_search;
static int sound_sight;
void gladiator_idle (edict_t *self)
{
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void gladiator_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void gladiator_search (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
void gladiator_cleaver_swing (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_cleaver_swing, 1, ATTN_NORM, 0);
}
mframe_t gladiator_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t gladiator_move_stand = {FRAME_stand1, FRAME_stand7, gladiator_frames_stand, NULL};
void gladiator_stand (edict_t *self)
{
self->monsterinfo.currentmove = &gladiator_move_stand;
}
mframe_t gladiator_frames_walk [] =
{
ai_walk, 15, NULL,
ai_walk, 7, NULL,
ai_walk, 6, NULL,
ai_walk, 5, NULL,
ai_walk, 2, NULL,
ai_walk, 0, NULL,
ai_walk, 2, NULL,
ai_walk, 8, NULL,
ai_walk, 12, NULL,
ai_walk, 8, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 2, NULL,
ai_walk, 2, NULL,
ai_walk, 1, NULL,
ai_walk, 8, NULL
};
mmove_t gladiator_move_walk = {FRAME_walk1, FRAME_walk16, gladiator_frames_walk, NULL};
void gladiator_walk (edict_t *self)
{
self->monsterinfo.currentmove = &gladiator_move_walk;
}
mframe_t gladiator_frames_run [] =
{
ai_run, 23, NULL,
ai_run, 14, NULL,
ai_run, 14, NULL,
ai_run, 21, NULL,
ai_run, 12, NULL,
ai_run, 13, NULL
};
mmove_t gladiator_move_run = {FRAME_run1, FRAME_run6, gladiator_frames_run, NULL};
void gladiator_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &gladiator_move_stand;
else
self->monsterinfo.currentmove = &gladiator_move_run;
}
void GaldiatorMelee (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->mins[0], -4);
if (fire_hit (self, aim, (20 + (rand() %5)), 300))
gi.sound (self, CHAN_AUTO, sound_cleaver_hit, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_AUTO, sound_cleaver_miss, 1, ATTN_NORM, 0);
}
mframe_t gladiator_frames_attack_melee [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, gladiator_cleaver_swing,
ai_charge, 0, NULL,
ai_charge, 0, GaldiatorMelee,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, gladiator_cleaver_swing,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, GaldiatorMelee,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t gladiator_move_attack_melee = {FRAME_melee1, FRAME_melee17, gladiator_frames_attack_melee, gladiator_run};
void gladiator_melee(edict_t *self)
{
self->monsterinfo.currentmove = &gladiator_move_attack_melee;
}
void GladiatorGun (edict_t *self)
{
vec3_t start;
vec3_t dir;
vec3_t forward, right;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_GLADIATOR_RAILGUN_1], forward, right, start);
// calc direction to where we targeted
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
self->pos1[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
self->pos1[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
self->pos1[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (self->pos1, start, dir);
VectorNormalize (dir);
monster_fire_railgun (self, start, dir, 50, 100, MZ2_GLADIATOR_RAILGUN_1);
}
mframe_t gladiator_frames_attack_gun [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, GladiatorGun,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t gladiator_move_attack_gun = {FRAME_attack1, FRAME_attack9, gladiator_frames_attack_gun, gladiator_run};
void gladiator_attack(edict_t *self)
{
/* Lazarus: What the hell is this? Why give the play a safe zone at all???
float range;
vec3_t v;
// a small safe zone
VectorSubtract (self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
if (range <= (MELEE_DISTANCE + 32))
return;
*/
// charge up the railgun
gi.sound (self, CHAN_WEAPON, sound_gun, 1, ATTN_NORM, 0);
VectorCopy (self->enemy->s.origin, self->pos1); //save for aiming the shot
self->pos1[2] += self->enemy->viewheight;
self->monsterinfo.currentmove = &gladiator_move_attack_gun;
}
mframe_t gladiator_frames_pain [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t gladiator_move_pain = {FRAME_pain1, FRAME_pain6, gladiator_frames_pain, gladiator_run};
mframe_t gladiator_frames_pain_air [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t gladiator_move_pain_air = {FRAME_painup1, FRAME_painup7, gladiator_frames_pain_air, gladiator_run};
void gladiator_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
{
if ((self->velocity[2] > 100) && (self->monsterinfo.currentmove == &gladiator_move_pain))
self->monsterinfo.currentmove = &gladiator_move_pain_air;
return;
}
self->pain_debounce_time = level.time + 3;
if (random() < 0.5)
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
if (skill->value == 3)
return; // no pain anims in nightmare
if (self->velocity[2] > 100)
self->monsterinfo.currentmove = &gladiator_move_pain_air;
else
self->monsterinfo.currentmove = &gladiator_move_pain;
}
void gladiator_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t gladiator_frames_death [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t gladiator_move_death = {FRAME_death1, FRAME_death22, gladiator_frames_death, gladiator_dead};
void gladiator_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->monsterinfo.currentmove = &gladiator_move_death;
}
//===========
//PGM
bool gladiator_blocked (edict_t *self, float dist)
{
if(blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
return true;
if(blocked_checkplat (self, dist))
return true;
return false;
}
//PGM
//===========
/*QUAKED monster_gladiator (1 .5 0) (-32 -32 -24) (32 32 64) Ambush Trigger_Spawn Sight
*/
void SP_monster_gladiator (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_GLADIATOR;
sound_pain1 = gi.soundindex ("gladiator/pain.wav");
sound_pain2 = gi.soundindex ("gladiator/gldpain2.wav");
sound_die = gi.soundindex ("gladiator/glddeth2.wav");
sound_gun = gi.soundindex ("gladiator/railgun.wav");
sound_cleaver_swing = gi.soundindex ("gladiator/melee1.wav");
sound_cleaver_hit = gi.soundindex ("gladiator/melee2.wav");
sound_cleaver_miss = gi.soundindex ("gladiator/melee3.wav");
sound_idle = gi.soundindex ("gladiator/gldidle1.wav");
sound_search = gi.soundindex ("gladiator/gldsrch1.wav");
sound_sight = gi.soundindex ("gladiator/sight.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/gladiatr/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/gladiatr/tris.md2");
VectorSet (self->mins, -32, -32, -24);
// Lazarus: Why so tall?
// VectorSet (self->maxs, 32, 32, 64);
VectorSet (self->maxs, 32, 32, 48);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 400;
if(!self->gib_health)
self->gib_health = -175;
if(!self->mass)
self->mass = 400;
self->pain = gladiator_pain;
self->die = gladiator_die;
self->monsterinfo.stand = gladiator_stand;
self->monsterinfo.walk = gladiator_walk;
self->monsterinfo.run = gladiator_run;
self->monsterinfo.dodge = NULL;
self->monsterinfo.attack = gladiator_attack;
self->monsterinfo.melee = gladiator_melee;
self->monsterinfo.sight = gladiator_sight;
self->monsterinfo.idle = gladiator_idle;
self->monsterinfo.search = gladiator_search;
self->monsterinfo.blocked = gladiator_blocked; // PGM
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.05;
gi.linkentity (self);
self->monsterinfo.currentmove = &gladiator_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&gladiator_move_death,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->common_name = "Gladiator";
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start (self);
}

View File

@ -1,96 +0,0 @@
// G:\quake2\baseq2\models/monsters/gladiatr
// This file generated by ModelGen - Do NOT Modify
#define FRAME_stand1 0
#define FRAME_stand2 1
#define FRAME_stand3 2
#define FRAME_stand4 3
#define FRAME_stand5 4
#define FRAME_stand6 5
#define FRAME_stand7 6
#define FRAME_walk1 7
#define FRAME_walk2 8
#define FRAME_walk3 9
#define FRAME_walk4 10
#define FRAME_walk5 11
#define FRAME_walk6 12
#define FRAME_walk7 13
#define FRAME_walk8 14
#define FRAME_walk9 15
#define FRAME_walk10 16
#define FRAME_walk11 17
#define FRAME_walk12 18
#define FRAME_walk13 19
#define FRAME_walk14 20
#define FRAME_walk15 21
#define FRAME_walk16 22
#define FRAME_run1 23
#define FRAME_run2 24
#define FRAME_run3 25
#define FRAME_run4 26
#define FRAME_run5 27
#define FRAME_run6 28
#define FRAME_melee1 29
#define FRAME_melee2 30
#define FRAME_melee3 31
#define FRAME_melee4 32
#define FRAME_melee5 33
#define FRAME_melee6 34
#define FRAME_melee7 35
#define FRAME_melee8 36
#define FRAME_melee9 37
#define FRAME_melee10 38
#define FRAME_melee11 39
#define FRAME_melee12 40
#define FRAME_melee13 41
#define FRAME_melee14 42
#define FRAME_melee15 43
#define FRAME_melee16 44
#define FRAME_melee17 45
#define FRAME_attack1 46
#define FRAME_attack2 47
#define FRAME_attack3 48
#define FRAME_attack4 49
#define FRAME_attack5 50
#define FRAME_attack6 51
#define FRAME_attack7 52
#define FRAME_attack8 53
#define FRAME_attack9 54
#define FRAME_pain1 55
#define FRAME_pain2 56
#define FRAME_pain3 57
#define FRAME_pain4 58
#define FRAME_pain5 59
#define FRAME_pain6 60
#define FRAME_death1 61
#define FRAME_death2 62
#define FRAME_death3 63
#define FRAME_death4 64
#define FRAME_death5 65
#define FRAME_death6 66
#define FRAME_death7 67
#define FRAME_death8 68
#define FRAME_death9 69
#define FRAME_death10 70
#define FRAME_death11 71
#define FRAME_death12 72
#define FRAME_death13 73
#define FRAME_death14 74
#define FRAME_death15 75
#define FRAME_death16 76
#define FRAME_death17 77
#define FRAME_death18 78
#define FRAME_death19 79
#define FRAME_death20 80
#define FRAME_death21 81
#define FRAME_death22 82
#define FRAME_painup1 83
#define FRAME_painup2 84
#define FRAME_painup3 85
#define FRAME_painup4 86
#define FRAME_painup5 87
#define FRAME_painup6 88
#define FRAME_painup7 89
#define MODEL_SCALE 1.000000

View File

@ -1,813 +0,0 @@
/*
==============================================================================
GUNNER
==============================================================================
*/
#include "g_local.h"
#include "m_gunner.h"
static int sound_pain;
static int sound_pain2;
static int sound_death;
static int sound_idle;
static int sound_open;
static int sound_search;
static int sound_sight;
// NOTE: Original gunner grenade velocity was 600 units/sec, but then
// fire_grenade added 200 units/sec in a direction perpendicular
// to the aim direction. We've removed that from fire_grenade
// (for the gunner, not for players) since the gunner now shoots
// smarter, and adjusted things so that the initial velocity out
// of the barrel is the same.
#define GRENADE_VELOCITY 632.4555320337
#define GRENADE_VELOCITY_SQUARED 400000
void gunner_idlesound (edict_t *self)
{
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void gunner_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void gunner_search (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
bool visible (edict_t *self, edict_t *other);
void GunnerGrenade (edict_t *self);
void GunnerFire (edict_t *self);
void gunner_fire_chain(edict_t *self);
void gunner_refire_chain(edict_t *self);
void gunner_stand (edict_t *self);
mframe_t gunner_frames_fidget [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, gunner_idlesound,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t gunner_move_fidget = {FRAME_stand31, FRAME_stand70, gunner_frames_fidget, gunner_stand};
void gunner_fidget (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
return;
if (random() <= 0.05)
self->monsterinfo.currentmove = &gunner_move_fidget;
}
mframe_t gunner_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, gunner_fidget,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, gunner_fidget,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, gunner_fidget
};
mmove_t gunner_move_stand = {FRAME_stand01, FRAME_stand30, gunner_frames_stand, NULL};
void gunner_stand (edict_t *self)
{
self->monsterinfo.currentmove = &gunner_move_stand;
}
mframe_t gunner_frames_walk [] =
{
ai_walk, 0, NULL,
ai_walk, 3, NULL,
ai_walk, 4, NULL,
ai_walk, 5, NULL,
ai_walk, 7, NULL,
ai_walk, 2, NULL,
ai_walk, 6, NULL,
ai_walk, 4, NULL,
ai_walk, 2, NULL,
ai_walk, 7, NULL,
ai_walk, 5, NULL,
ai_walk, 7, NULL,
ai_walk, 4, NULL
};
mmove_t gunner_move_walk = {FRAME_walk07, FRAME_walk19, gunner_frames_walk, NULL};
void gunner_walk (edict_t *self)
{
self->monsterinfo.currentmove = &gunner_move_walk;
}
mframe_t gunner_frames_run [] =
{
ai_run, 26, NULL,
ai_run, 9, NULL,
ai_run, 9, NULL,
ai_run, 9, NULL,
ai_run, 15, NULL,
ai_run, 10, NULL,
ai_run, 13, NULL,
ai_run, 6, NULL
};
mmove_t gunner_move_run = {FRAME_run01, FRAME_run08, gunner_frames_run, NULL};
void gunner_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &gunner_move_stand;
else
self->monsterinfo.currentmove = &gunner_move_run;
}
mframe_t gunner_frames_runandshoot [] =
{
ai_run, 32, NULL,
ai_run, 15, NULL,
ai_run, 10, NULL,
ai_run, 18, NULL,
ai_run, 8, NULL,
ai_run, 20, NULL
};
mmove_t gunner_move_runandshoot = {FRAME_runs01, FRAME_runs06, gunner_frames_runandshoot, NULL};
void gunner_runandshoot (edict_t *self)
{
self->monsterinfo.currentmove = &gunner_move_runandshoot;
}
mframe_t gunner_frames_pain3 [] =
{
ai_move, -3, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, 0, NULL,
ai_move, 1, NULL
};
mmove_t gunner_move_pain3 = {FRAME_pain301, FRAME_pain305, gunner_frames_pain3, gunner_run};
mframe_t gunner_frames_pain2 [] =
{
ai_move, -2, NULL,
ai_move, 11, NULL,
ai_move, 6, NULL,
ai_move, 2, NULL,
ai_move, -1, NULL,
ai_move, -7, NULL,
ai_move, -2, NULL,
ai_move, -7, NULL
};
mmove_t gunner_move_pain2 = {FRAME_pain201, FRAME_pain208, gunner_frames_pain2, gunner_run};
mframe_t gunner_frames_pain1 [] =
{
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, -5, NULL,
ai_move, 3, NULL,
ai_move, -1, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, 2, NULL,
ai_move, 1, NULL,
ai_move, 0, NULL,
ai_move, -2, NULL,
ai_move, -2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t gunner_move_pain1 = {FRAME_pain101, FRAME_pain118, gunner_frames_pain1, gunner_run};
void gunner_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (rand()&1)
gi.sound (self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
if (skill->value == 3)
return; // no pain anims in nightmare
if (damage <= 10)
self->monsterinfo.currentmove = &gunner_move_pain3;
else if (damage <= 25)
self->monsterinfo.currentmove = &gunner_move_pain2;
else
self->monsterinfo.currentmove = &gunner_move_pain1;
}
void gunner_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t gunner_frames_death [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -7, NULL,
ai_move, -3, NULL,
ai_move, -5, NULL,
ai_move, 8, NULL,
ai_move, 6, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t gunner_move_death = {FRAME_death01, FRAME_death11, gunner_frames_death, gunner_dead};
void gunner_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->monsterinfo.currentmove = &gunner_move_death;
}
bool gunner_grenade_check(edict_t *self)
{
vec3_t start;
vec3_t forward, right;
vec3_t target;
trace_t tr;
vec3_t dir;
vec3_t vhorz;
float horz,vertmax;
if(!self->enemy)
return false;
// if the player is above my head, use machinegun.
// if(self->absmax[2] <= self->enemy->absmin[2])
// return false;
// Lazarus: We can do better than that... see below
// check to see that we can trace to the player before we start
// tossing grenades around.
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_GUNNER_GRENADE_1], forward, right, start);
// see if we're too close
VectorSubtract (self->enemy->s.origin, self->s.origin, dir);
if (VectorLength(dir) < 100)
return false;
// Lazarus: Max vertical distance - this is approximate and conservative
VectorCopy(dir,vhorz);
vhorz[2] = 0;
horz = VectorLength(vhorz);
vertmax = (GRENADE_VELOCITY_SQUARED)/(2*sv_gravity->value) -
0.5*sv_gravity->value*horz*horz/GRENADE_VELOCITY_SQUARED;
if(dir[2] > vertmax)
return false;
// Lazarus: Make sure there's a more-or-less clear flight path to target
// Rogue checked target origin, but if target is above gunner then the trace
// would almost always hit the platform the target was standing on
VectorCopy(self->enemy->s.origin,target);
target[2] = self->enemy->absmax[2];
tr = gi.trace(start, vec3_origin, vec3_origin, target, self, MASK_SHOT);
if(tr.ent == self->enemy || tr.fraction == 1)
return true;
// Repeat for feet... in case we're looking down at a target standing under,
// for example, a short doorway
target[2] = self->enemy->absmin[2];
tr = gi.trace(start, vec3_origin, vec3_origin, target, self, MASK_SHOT);
if(tr.ent == self->enemy || tr.fraction == 1)
return true;
return false;
}
void gunner_duck_down (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_DUCKED)
return;
self->monsterinfo.aiflags |= AI_DUCKED;
if (skill->value >= 2)
{
// Lazarus: Added check for goodness of grenade firing
if (random() > 0.5 && gunner_grenade_check(self))
GunnerGrenade (self);
}
self->maxs[2] -= 32;
self->takedamage = DAMAGE_YES;
self->monsterinfo.pausetime = level.time + 1;
gi.linkentity (self);
}
void gunner_duck_hold (edict_t *self)
{
if (level.time >= self->monsterinfo.pausetime)
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
else
self->monsterinfo.aiflags |= AI_HOLD_FRAME;
}
void gunner_duck_up (edict_t *self)
{
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
gi.linkentity (self);
}
mframe_t gunner_frames_duck [] =
{
ai_move, 1, gunner_duck_down,
ai_move, 1, NULL,
ai_move, 1, gunner_duck_hold,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, -1, NULL,
ai_move, 0, gunner_duck_up,
ai_move, -1, NULL
};
mmove_t gunner_move_duck = {FRAME_duck01, FRAME_duck08, gunner_frames_duck, gunner_run};
void gunner_dodge (edict_t *self, edict_t *attacker, float eta)
{
if (random() > 0.25)
return;
if (!self->enemy)
self->enemy = attacker;
self->monsterinfo.currentmove = &gunner_move_duck;
}
void gunner_opengun (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_open, 1, ATTN_IDLE, 0);
}
void GunnerFire (edict_t *self)
{
vec3_t start;
vec3_t forward, right;
vec3_t target;
vec3_t aim;
int flash_number;
flash_number = MZ2_GUNNER_MACHINEGUN_1 + (self->s.frame - FRAME_attak216);
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
// project enemy back a bit and target there
VectorCopy (self->enemy->s.origin, target);
VectorMA (target, -0.2, self->enemy->velocity, target);
target[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
target[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (target, start, aim);
VectorNormalize (aim);
monster_fire_bullet (self, start, aim, 3, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number);
}
void GunnerGrenade (edict_t *self)
{
vec3_t start,target;
vec3_t forward, right, up;
vec3_t aim;
vec_t monster_speed;
int flash_number;
if(!self->enemy || !self->enemy->inuse)
return;
if (self->s.frame == FRAME_attak105)
flash_number = MZ2_GUNNER_GRENADE_1;
else if (self->s.frame == FRAME_attak108)
{
if(skill->value == 0)
return;
flash_number = MZ2_GUNNER_GRENADE_2;
}
else if (self->s.frame == FRAME_attak111)
flash_number = MZ2_GUNNER_GRENADE_3;
else // (self->s.frame == FRAME_attak114)
{
if(skill->value < 2)
return;
flash_number = MZ2_GUNNER_GRENADE_4;
}
AngleVectors (self->s.angles, forward, right, up);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
// Lazarus - Improved gunner's grenade-aiming ability quite a bit
// VectorCopy (forward, aim);
// aim at enemy's feet if he's at same elevation or lower. otherwise aim at origin
VectorCopy(self->enemy->s.origin,target);
if(self->enemy->absmin[2] <= self->absmax[2]) target[2] = self->enemy->absmin[2];
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
target[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
// Lazarus - skill level-dependent accuracy
/* if(skill->value < 2)
{
float dist;
VectorSubtract(target, start, aim);
dist = VectorLength (aim);
dist = min(dist,512);
target[0] += crandom() * dist/8 * (2 - skill->value);
target[1] += crandom() * dist/8 * (2 - skill->value);
} */
// lead target... 20, 35, 50, 65 chance of leading
if( random() < (0.2 + skill->value * 0.15) )
{
float dist;
float time;
VectorSubtract(target, start, aim);
dist = VectorLength (aim);
time = dist/GRENADE_VELOCITY; // Not correct, but better than nothin'
VectorMA(target, time, self->enemy->velocity, target);
}
AimGrenade (self, start, target, GRENADE_VELOCITY, aim);
// Lazarus - take into account (sort of) feature of adding shooter's velocity to
// grenade velocity
monster_speed = VectorLength(self->velocity);
if(monster_speed > 0) {
vec3_t v1;
vec_t delta;
VectorCopy(self->velocity,v1);
VectorNormalize(v1);
delta = -monster_speed/GRENADE_VELOCITY;
VectorMA(aim,delta,v1,aim);
VectorNormalize(aim);
}
monster_fire_grenade (self, start, aim, 50, GRENADE_VELOCITY, flash_number);
}
mframe_t gunner_frames_attack_chain [] =
{
/*
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
*/
ai_charge, 0, gunner_opengun,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t gunner_move_attack_chain = {FRAME_attak209, FRAME_attak215, gunner_frames_attack_chain, gunner_fire_chain};
mframe_t gunner_frames_fire_chain [] =
{
ai_charge, 0, GunnerFire,
ai_charge, 0, GunnerFire,
ai_charge, 0, GunnerFire,
ai_charge, 0, GunnerFire,
ai_charge, 0, GunnerFire,
ai_charge, 0, GunnerFire,
ai_charge, 0, GunnerFire,
ai_charge, 0, GunnerFire
};
mmove_t gunner_move_fire_chain = {FRAME_attak216, FRAME_attak223, gunner_frames_fire_chain, gunner_refire_chain};
mframe_t gunner_frames_endfire_chain [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t gunner_move_endfire_chain = {FRAME_attak224, FRAME_attak230, gunner_frames_endfire_chain, gunner_run};
mframe_t gunner_frames_attack_grenade [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, GunnerGrenade,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, GunnerGrenade,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, GunnerGrenade,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, GunnerGrenade,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t gunner_move_attack_grenade = {FRAME_attak101, FRAME_attak121, gunner_frames_attack_grenade, gunner_run};
void gunner_attack(edict_t *self)
{
if (range (self, self->enemy) == RANGE_MELEE)
{
self->monsterinfo.currentmove = &gunner_move_attack_chain;
}
else
{
// Lazarus: Added bit of logic to check whether grenades are good to fire,
// and made it more likely to fire grenades on harder skill levels
if (random() <= (0.5 + 0.05*skill->value) && gunner_grenade_check(self) )
self->monsterinfo.currentmove = &gunner_move_attack_grenade;
else
self->monsterinfo.currentmove = &gunner_move_attack_chain;
}
}
void gunner_fire_chain(edict_t *self)
{
self->monsterinfo.currentmove = &gunner_move_fire_chain;
}
void gunner_refire_chain(edict_t *self)
{
if (self->enemy->health > 0)
if ( visible (self, self->enemy) )
if (random() <= 0.5)
{
self->monsterinfo.currentmove = &gunner_move_fire_chain;
return;
}
self->monsterinfo.currentmove = &gunner_move_endfire_chain;
}
mframe_t gunner_frames_jump [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t gunner_move_jump = { FRAME_run01, FRAME_run08, gunner_frames_jump, gunner_run };
void gunner_jump (edict_t *self)
{
self->monsterinfo.currentmove = &gunner_move_jump;
}
/*QUAKED monster_gunner (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_gunner (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_GUNNER;
sound_death = gi.soundindex ("gunner/death1.wav");
sound_pain = gi.soundindex ("gunner/gunpain2.wav");
sound_pain2 = gi.soundindex ("gunner/gunpain1.wav");
sound_idle = gi.soundindex ("gunner/gunidle1.wav");
sound_open = gi.soundindex ("gunner/gunatck1.wav");
sound_search = gi.soundindex ("gunner/gunsrch1.wav");
sound_sight = gi.soundindex ("gunner/sight1.wav");
if(monsterjump->value)
{
self->monsterinfo.jump = gunner_jump;
self->monsterinfo.jumpup = 48;
self->monsterinfo.jumpdn = 64;
}
gi.soundindex ("gunner/gunatck2.wav");
gi.soundindex ("gunner/gunatck3.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/gunner/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/gunner/tris.md2");
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, 32);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 175;
if(!self->gib_health)
self->gib_health = -70;
if(!self->mass)
self->mass = 200;
self->pain = gunner_pain;
self->die = gunner_die;
self->monsterinfo.stand = gunner_stand;
self->monsterinfo.walk = gunner_walk;
self->monsterinfo.run = gunner_run;
self->monsterinfo.dodge = gunner_dodge;
self->monsterinfo.attack = gunner_attack;
self->monsterinfo.melee = NULL;
self->monsterinfo.sight = gunner_sight;
self->monsterinfo.search = gunner_search;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.30;
// Lazarus - use move_origin for grenade aiming
VectorCopy(monster_flash_offset[MZ2_GUNNER_GRENADE_1],self->move_origin);
gi.linkentity (self);
self->monsterinfo.currentmove = &gunner_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&gunner_move_death,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->common_name = "Gunner";
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start (self);
}

View File

@ -1,215 +0,0 @@
// G:\quake2\baseq2\models/gunner
// This file generated by ModelGen - Do NOT Modify
#define FRAME_stand01 0
#define FRAME_stand02 1
#define FRAME_stand03 2
#define FRAME_stand04 3
#define FRAME_stand05 4
#define FRAME_stand06 5
#define FRAME_stand07 6
#define FRAME_stand08 7
#define FRAME_stand09 8
#define FRAME_stand10 9
#define FRAME_stand11 10
#define FRAME_stand12 11
#define FRAME_stand13 12
#define FRAME_stand14 13
#define FRAME_stand15 14
#define FRAME_stand16 15
#define FRAME_stand17 16
#define FRAME_stand18 17
#define FRAME_stand19 18
#define FRAME_stand20 19
#define FRAME_stand21 20
#define FRAME_stand22 21
#define FRAME_stand23 22
#define FRAME_stand24 23
#define FRAME_stand25 24
#define FRAME_stand26 25
#define FRAME_stand27 26
#define FRAME_stand28 27
#define FRAME_stand29 28
#define FRAME_stand30 29
#define FRAME_stand31 30
#define FRAME_stand32 31
#define FRAME_stand33 32
#define FRAME_stand34 33
#define FRAME_stand35 34
#define FRAME_stand36 35
#define FRAME_stand37 36
#define FRAME_stand38 37
#define FRAME_stand39 38
#define FRAME_stand40 39
#define FRAME_stand41 40
#define FRAME_stand42 41
#define FRAME_stand43 42
#define FRAME_stand44 43
#define FRAME_stand45 44
#define FRAME_stand46 45
#define FRAME_stand47 46
#define FRAME_stand48 47
#define FRAME_stand49 48
#define FRAME_stand50 49
#define FRAME_stand51 50
#define FRAME_stand52 51
#define FRAME_stand53 52
#define FRAME_stand54 53
#define FRAME_stand55 54
#define FRAME_stand56 55
#define FRAME_stand57 56
#define FRAME_stand58 57
#define FRAME_stand59 58
#define FRAME_stand60 59
#define FRAME_stand61 60
#define FRAME_stand62 61
#define FRAME_stand63 62
#define FRAME_stand64 63
#define FRAME_stand65 64
#define FRAME_stand66 65
#define FRAME_stand67 66
#define FRAME_stand68 67
#define FRAME_stand69 68
#define FRAME_stand70 69
#define FRAME_walk01 70
#define FRAME_walk02 71
#define FRAME_walk03 72
#define FRAME_walk04 73
#define FRAME_walk05 74
#define FRAME_walk06 75
#define FRAME_walk07 76
#define FRAME_walk08 77
#define FRAME_walk09 78
#define FRAME_walk10 79
#define FRAME_walk11 80
#define FRAME_walk12 81
#define FRAME_walk13 82
#define FRAME_walk14 83
#define FRAME_walk15 84
#define FRAME_walk16 85
#define FRAME_walk17 86
#define FRAME_walk18 87
#define FRAME_walk19 88
#define FRAME_walk20 89
#define FRAME_walk21 90
#define FRAME_walk22 91
#define FRAME_walk23 92
#define FRAME_walk24 93
#define FRAME_run01 94
#define FRAME_run02 95
#define FRAME_run03 96
#define FRAME_run04 97
#define FRAME_run05 98
#define FRAME_run06 99
#define FRAME_run07 100
#define FRAME_run08 101
#define FRAME_runs01 102
#define FRAME_runs02 103
#define FRAME_runs03 104
#define FRAME_runs04 105
#define FRAME_runs05 106
#define FRAME_runs06 107
#define FRAME_attak101 108
#define FRAME_attak102 109
#define FRAME_attak103 110
#define FRAME_attak104 111
#define FRAME_attak105 112
#define FRAME_attak106 113
#define FRAME_attak107 114
#define FRAME_attak108 115
#define FRAME_attak109 116
#define FRAME_attak110 117
#define FRAME_attak111 118
#define FRAME_attak112 119
#define FRAME_attak113 120
#define FRAME_attak114 121
#define FRAME_attak115 122
#define FRAME_attak116 123
#define FRAME_attak117 124
#define FRAME_attak118 125
#define FRAME_attak119 126
#define FRAME_attak120 127
#define FRAME_attak121 128
#define FRAME_attak201 129
#define FRAME_attak202 130
#define FRAME_attak203 131
#define FRAME_attak204 132
#define FRAME_attak205 133
#define FRAME_attak206 134
#define FRAME_attak207 135
#define FRAME_attak208 136
#define FRAME_attak209 137
#define FRAME_attak210 138
#define FRAME_attak211 139
#define FRAME_attak212 140
#define FRAME_attak213 141
#define FRAME_attak214 142
#define FRAME_attak215 143
#define FRAME_attak216 144
#define FRAME_attak217 145
#define FRAME_attak218 146
#define FRAME_attak219 147
#define FRAME_attak220 148
#define FRAME_attak221 149
#define FRAME_attak222 150
#define FRAME_attak223 151
#define FRAME_attak224 152
#define FRAME_attak225 153
#define FRAME_attak226 154
#define FRAME_attak227 155
#define FRAME_attak228 156
#define FRAME_attak229 157
#define FRAME_attak230 158
#define FRAME_pain101 159
#define FRAME_pain102 160
#define FRAME_pain103 161
#define FRAME_pain104 162
#define FRAME_pain105 163
#define FRAME_pain106 164
#define FRAME_pain107 165
#define FRAME_pain108 166
#define FRAME_pain109 167
#define FRAME_pain110 168
#define FRAME_pain111 169
#define FRAME_pain112 170
#define FRAME_pain113 171
#define FRAME_pain114 172
#define FRAME_pain115 173
#define FRAME_pain116 174
#define FRAME_pain117 175
#define FRAME_pain118 176
#define FRAME_pain201 177
#define FRAME_pain202 178
#define FRAME_pain203 179
#define FRAME_pain204 180
#define FRAME_pain205 181
#define FRAME_pain206 182
#define FRAME_pain207 183
#define FRAME_pain208 184
#define FRAME_pain301 185
#define FRAME_pain302 186
#define FRAME_pain303 187
#define FRAME_pain304 188
#define FRAME_pain305 189
#define FRAME_death01 190
#define FRAME_death02 191
#define FRAME_death03 192
#define FRAME_death04 193
#define FRAME_death05 194
#define FRAME_death06 195
#define FRAME_death07 196
#define FRAME_death08 197
#define FRAME_death09 198
#define FRAME_death10 199
#define FRAME_death11 200
#define FRAME_duck01 201
#define FRAME_duck02 202
#define FRAME_duck03 203
#define FRAME_duck04 204
#define FRAME_duck05 205
#define FRAME_duck06 206
#define FRAME_duck07 207
#define FRAME_duck08 208
#define MODEL_SCALE 1.150000

View File

@ -1,634 +0,0 @@
/*
==============================================================================
hover
==============================================================================
*/
#include "g_local.h"
#include "m_hover.h"
bool visible (edict_t *self, edict_t *other);
static int sound_pain1;
static int sound_pain2;
static int sound_death1;
static int sound_death2;
static int sound_sight;
static int sound_search1;
static int sound_search2;
void hover_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void hover_search (edict_t *self)
{
if (random() < 0.5)
gi.sound (self, CHAN_VOICE, sound_search1, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_search2, 1, ATTN_NORM, 0);
}
void hover_run (edict_t *self);
void hover_stand (edict_t *self);
void hover_dead (edict_t *self);
void hover_attack (edict_t *self);
void hover_reattack (edict_t *self);
void hover_fire_blaster (edict_t *self);
void hover_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
mframe_t hover_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t hover_move_stand = {FRAME_stand01, FRAME_stand30, hover_frames_stand, NULL};
mframe_t hover_frames_stop1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t hover_move_stop1 = {FRAME_stop101, FRAME_stop109, hover_frames_stop1, NULL};
mframe_t hover_frames_stop2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t hover_move_stop2 = {FRAME_stop201, FRAME_stop208, hover_frames_stop2, NULL};
mframe_t hover_frames_takeoff [] =
{
ai_move, 0, NULL,
ai_move, -2, NULL,
ai_move, 5, NULL,
ai_move, -1, NULL,
ai_move, 1, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, -1, NULL,
ai_move, -1, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 2, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, -6, NULL,
ai_move, -9, NULL,
ai_move, 1, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 2, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 3, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL
};
mmove_t hover_move_takeoff = {FRAME_takeof01, FRAME_takeof30, hover_frames_takeoff, NULL};
mframe_t hover_frames_pain3 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t hover_move_pain3 = {FRAME_pain301, FRAME_pain309, hover_frames_pain3, hover_run};
mframe_t hover_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t hover_move_pain2 = {FRAME_pain201, FRAME_pain212, hover_frames_pain2, hover_run};
mframe_t hover_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, -8, NULL,
ai_move, -4, NULL,
ai_move, -6, NULL,
ai_move, -4, NULL,
ai_move, -3, NULL,
ai_move, 1, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 3, NULL,
ai_move, 1, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 3, NULL,
ai_move, 2, NULL,
ai_move, 7, NULL,
ai_move, 1, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 5, NULL,
ai_move, 3, NULL,
ai_move, 4, NULL
};
mmove_t hover_move_pain1 = {FRAME_pain101, FRAME_pain128, hover_frames_pain1, hover_run};
mframe_t hover_frames_land [] =
{
ai_move, 0, NULL
};
mmove_t hover_move_land = {FRAME_land01, FRAME_land01, hover_frames_land, NULL};
mframe_t hover_frames_forward [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t hover_move_forward = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_forward, NULL};
mframe_t hover_frames_walk [] =
{
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL
};
mmove_t hover_move_walk = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_walk, NULL};
mframe_t hover_frames_run [] =
{
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL,
ai_run, 10, NULL
};
mmove_t hover_move_run = {FRAME_forwrd01, FRAME_forwrd35, hover_frames_run, NULL};
mframe_t hover_frames_death1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -10,NULL,
ai_move, 3, NULL,
ai_move, 5, NULL,
ai_move, 4, NULL,
ai_move, 7, NULL
};
mmove_t hover_move_death1 = {FRAME_death101, FRAME_death111, hover_frames_death1, hover_dead};
mframe_t hover_frames_backward [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t hover_move_backward = {FRAME_backwd01, FRAME_backwd24, hover_frames_backward, NULL};
mframe_t hover_frames_start_attack [] =
{
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL
};
mmove_t hover_move_start_attack = {FRAME_attak101, FRAME_attak103, hover_frames_start_attack, hover_attack};
mframe_t hover_frames_attack1 [] =
{
ai_charge, -10, hover_fire_blaster,
ai_charge, -10, hover_fire_blaster,
ai_charge, 0, hover_reattack,
};
mmove_t hover_move_attack1 = {FRAME_attak104, FRAME_attak106, hover_frames_attack1, NULL};
mframe_t hover_frames_end_attack [] =
{
ai_charge, 1, NULL,
ai_charge, 1, NULL
};
mmove_t hover_move_end_attack = {FRAME_attak107, FRAME_attak108, hover_frames_end_attack, hover_run};
void hover_reattack (edict_t *self)
{
if (self->enemy->health > 0 )
if (visible (self, self->enemy) )
if (random() <= 0.6)
{
self->monsterinfo.currentmove = &hover_move_attack1;
return;
}
self->monsterinfo.currentmove = &hover_move_end_attack;
}
void hover_fire_blaster (edict_t *self)
{
vec3_t start;
vec3_t forward, right;
vec3_t end;
vec3_t dir;
int effect;
if (self->s.frame == FRAME_attak104)
effect = EF_HYPERBLASTER;
else
effect = 0;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_HOVER_BLASTER_1], forward, right, start);
VectorCopy (self->enemy->s.origin, end);
end[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
end[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
end[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
end[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (end, start, dir);
monster_fire_blaster (self, start, dir, 1, 1000, MZ2_HOVER_BLASTER_1, effect);
}
void hover_stand (edict_t *self)
{
self->monsterinfo.currentmove = &hover_move_stand;
}
void hover_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &hover_move_stand;
else
self->monsterinfo.currentmove = &hover_move_run;
}
void hover_walk (edict_t *self)
{
self->monsterinfo.currentmove = &hover_move_walk;
}
void hover_start_attack (edict_t *self)
{
self->monsterinfo.currentmove = &hover_move_start_attack;
}
void hover_attack(edict_t *self)
{
self->monsterinfo.currentmove = &hover_move_attack1;
}
void hover_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
if (damage <= 25)
{
if (random() < 0.5)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &hover_move_pain3;
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &hover_move_pain2;
}
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &hover_move_pain1;
}
}
void hover_deadthink (edict_t *self)
{
if (!self->groundentity && level.time < self->timestamp)
{
self->nextthink = level.time + FRAMETIME;
return;
}
BecomeExplosion1(self);
}
void hover_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->think = hover_deadthink;
self->nextthink = level.time + FRAMETIME;
self->timestamp = level.time + 15;
gi.linkentity (self);
}
void hover_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
if (random() < 0.5)
gi.sound (self, CHAN_VOICE, sound_death1, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_death2, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->monsterinfo.currentmove = &hover_move_death1;
}
/*QUAKED monster_hover (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_hover (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_HOVER;
sound_pain1 = gi.soundindex ("hover/hovpain1.wav");
sound_pain2 = gi.soundindex ("hover/hovpain2.wav");
sound_death1 = gi.soundindex ("hover/hovdeth1.wav");
sound_death2 = gi.soundindex ("hover/hovdeth2.wav");
sound_sight = gi.soundindex ("hover/hovsght1.wav");
sound_search1 = gi.soundindex ("hover/hovsrch1.wav");
sound_search2 = gi.soundindex ("hover/hovsrch2.wav");
gi.soundindex ("hover/hovatck1.wav");
self->s.sound = gi.soundindex ("hover/hovidle1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/hover/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex("models/monsters/hover/tris.md2");
VectorSet (self->mins, -24, -24, -24);
VectorSet (self->maxs, 24, 24, 32);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 240;
if(!self->gib_health)
self->gib_health = -100;
if(!self->mass)
self->mass = 150;
self->pain = hover_pain;
self->die = hover_die;
self->monsterinfo.stand = hover_stand;
self->monsterinfo.walk = hover_walk;
self->monsterinfo.run = hover_run;
// self->monsterinfo.dodge = hover_dodge;
self->monsterinfo.attack = hover_start_attack;
self->monsterinfo.sight = hover_sight;
self->monsterinfo.search = hover_search;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
gi.linkentity (self);
self->monsterinfo.currentmove = &hover_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&hover_move_death1,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->common_name = "Icarus";
self->monsterinfo.scale = MODEL_SCALE;
flymonster_start (self);
}

View File

@ -1,211 +0,0 @@
// G:\quake2\baseq2\models/monsters/hover
// This file generated by ModelGen - Do NOT Modify
#define FRAME_stand01 0
#define FRAME_stand02 1
#define FRAME_stand03 2
#define FRAME_stand04 3
#define FRAME_stand05 4
#define FRAME_stand06 5
#define FRAME_stand07 6
#define FRAME_stand08 7
#define FRAME_stand09 8
#define FRAME_stand10 9
#define FRAME_stand11 10
#define FRAME_stand12 11
#define FRAME_stand13 12
#define FRAME_stand14 13
#define FRAME_stand15 14
#define FRAME_stand16 15
#define FRAME_stand17 16
#define FRAME_stand18 17
#define FRAME_stand19 18
#define FRAME_stand20 19
#define FRAME_stand21 20
#define FRAME_stand22 21
#define FRAME_stand23 22
#define FRAME_stand24 23
#define FRAME_stand25 24
#define FRAME_stand26 25
#define FRAME_stand27 26
#define FRAME_stand28 27
#define FRAME_stand29 28
#define FRAME_stand30 29
#define FRAME_forwrd01 30
#define FRAME_forwrd02 31
#define FRAME_forwrd03 32
#define FRAME_forwrd04 33
#define FRAME_forwrd05 34
#define FRAME_forwrd06 35
#define FRAME_forwrd07 36
#define FRAME_forwrd08 37
#define FRAME_forwrd09 38
#define FRAME_forwrd10 39
#define FRAME_forwrd11 40
#define FRAME_forwrd12 41
#define FRAME_forwrd13 42
#define FRAME_forwrd14 43
#define FRAME_forwrd15 44
#define FRAME_forwrd16 45
#define FRAME_forwrd17 46
#define FRAME_forwrd18 47
#define FRAME_forwrd19 48
#define FRAME_forwrd20 49
#define FRAME_forwrd21 50
#define FRAME_forwrd22 51
#define FRAME_forwrd23 52
#define FRAME_forwrd24 53
#define FRAME_forwrd25 54
#define FRAME_forwrd26 55
#define FRAME_forwrd27 56
#define FRAME_forwrd28 57
#define FRAME_forwrd29 58
#define FRAME_forwrd30 59
#define FRAME_forwrd31 60
#define FRAME_forwrd32 61
#define FRAME_forwrd33 62
#define FRAME_forwrd34 63
#define FRAME_forwrd35 64
#define FRAME_stop101 65
#define FRAME_stop102 66
#define FRAME_stop103 67
#define FRAME_stop104 68
#define FRAME_stop105 69
#define FRAME_stop106 70
#define FRAME_stop107 71
#define FRAME_stop108 72
#define FRAME_stop109 73
#define FRAME_stop201 74
#define FRAME_stop202 75
#define FRAME_stop203 76
#define FRAME_stop204 77
#define FRAME_stop205 78
#define FRAME_stop206 79
#define FRAME_stop207 80
#define FRAME_stop208 81
#define FRAME_takeof01 82
#define FRAME_takeof02 83
#define FRAME_takeof03 84
#define FRAME_takeof04 85
#define FRAME_takeof05 86
#define FRAME_takeof06 87
#define FRAME_takeof07 88
#define FRAME_takeof08 89
#define FRAME_takeof09 90
#define FRAME_takeof10 91
#define FRAME_takeof11 92
#define FRAME_takeof12 93
#define FRAME_takeof13 94
#define FRAME_takeof14 95
#define FRAME_takeof15 96
#define FRAME_takeof16 97
#define FRAME_takeof17 98
#define FRAME_takeof18 99
#define FRAME_takeof19 100
#define FRAME_takeof20 101
#define FRAME_takeof21 102
#define FRAME_takeof22 103
#define FRAME_takeof23 104
#define FRAME_takeof24 105
#define FRAME_takeof25 106
#define FRAME_takeof26 107
#define FRAME_takeof27 108
#define FRAME_takeof28 109
#define FRAME_takeof29 110
#define FRAME_takeof30 111
#define FRAME_land01 112
#define FRAME_pain101 113
#define FRAME_pain102 114
#define FRAME_pain103 115
#define FRAME_pain104 116
#define FRAME_pain105 117
#define FRAME_pain106 118
#define FRAME_pain107 119
#define FRAME_pain108 120
#define FRAME_pain109 121
#define FRAME_pain110 122
#define FRAME_pain111 123
#define FRAME_pain112 124
#define FRAME_pain113 125
#define FRAME_pain114 126
#define FRAME_pain115 127
#define FRAME_pain116 128
#define FRAME_pain117 129
#define FRAME_pain118 130
#define FRAME_pain119 131
#define FRAME_pain120 132
#define FRAME_pain121 133
#define FRAME_pain122 134
#define FRAME_pain123 135
#define FRAME_pain124 136
#define FRAME_pain125 137
#define FRAME_pain126 138
#define FRAME_pain127 139
#define FRAME_pain128 140
#define FRAME_pain201 141
#define FRAME_pain202 142
#define FRAME_pain203 143
#define FRAME_pain204 144
#define FRAME_pain205 145
#define FRAME_pain206 146
#define FRAME_pain207 147
#define FRAME_pain208 148
#define FRAME_pain209 149
#define FRAME_pain210 150
#define FRAME_pain211 151
#define FRAME_pain212 152
#define FRAME_pain301 153
#define FRAME_pain302 154
#define FRAME_pain303 155
#define FRAME_pain304 156
#define FRAME_pain305 157
#define FRAME_pain306 158
#define FRAME_pain307 159
#define FRAME_pain308 160
#define FRAME_pain309 161
#define FRAME_death101 162
#define FRAME_death102 163
#define FRAME_death103 164
#define FRAME_death104 165
#define FRAME_death105 166
#define FRAME_death106 167
#define FRAME_death107 168
#define FRAME_death108 169
#define FRAME_death109 170
#define FRAME_death110 171
#define FRAME_death111 172
#define FRAME_backwd01 173
#define FRAME_backwd02 174
#define FRAME_backwd03 175
#define FRAME_backwd04 176
#define FRAME_backwd05 177
#define FRAME_backwd06 178
#define FRAME_backwd07 179
#define FRAME_backwd08 180
#define FRAME_backwd09 181
#define FRAME_backwd10 182
#define FRAME_backwd11 183
#define FRAME_backwd12 184
#define FRAME_backwd13 185
#define FRAME_backwd14 186
#define FRAME_backwd15 187
#define FRAME_backwd16 188
#define FRAME_backwd17 189
#define FRAME_backwd18 190
#define FRAME_backwd19 191
#define FRAME_backwd20 192
#define FRAME_backwd21 193
#define FRAME_backwd22 194
#define FRAME_backwd23 195
#define FRAME_backwd24 196
#define FRAME_attak101 197
#define FRAME_attak102 198
#define FRAME_attak103 199
#define FRAME_attak104 200
#define FRAME_attak105 201
#define FRAME_attak106 202
#define FRAME_attak107 203
#define FRAME_attak108 204
#define MODEL_SCALE 1.000000

View File

@ -1,666 +0,0 @@
/*
==============================================================================
INFANTRY
==============================================================================
*/
#include "g_local.h"
#include "m_infantry.h"
void InfantryMachineGun (edict_t *self);
static int sound_pain1;
static int sound_pain2;
static int sound_die1;
static int sound_die2;
static int sound_gunshot;
static int sound_weapon_cock;
static int sound_punch_swing;
static int sound_punch_hit;
static int sound_sight;
static int sound_search;
static int sound_idle;
mframe_t infantry_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t infantry_move_stand = {FRAME_stand50, FRAME_stand71, infantry_frames_stand, NULL};
void infantry_stand (edict_t *self)
{
self->monsterinfo.currentmove = &infantry_move_stand;
}
mframe_t infantry_frames_fidget [] =
{
ai_stand, 1, NULL,
ai_stand, 0, NULL,
ai_stand, 1, NULL,
ai_stand, 3, NULL,
ai_stand, 6, NULL,
ai_stand, 3, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 1, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 1, NULL,
ai_stand, 0, NULL,
ai_stand, -1, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 1, NULL,
ai_stand, 0, NULL,
ai_stand, -2, NULL,
ai_stand, 1, NULL,
ai_stand, 1, NULL,
ai_stand, 1, NULL,
ai_stand, -1, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, -1, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, -1, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 1, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, -1, NULL,
ai_stand, -1, NULL,
ai_stand, 0, NULL,
ai_stand, -3, NULL,
ai_stand, -2, NULL,
ai_stand, -3, NULL,
ai_stand, -3, NULL,
ai_stand, -2, NULL
};
mmove_t infantry_move_fidget = {FRAME_stand01, FRAME_stand49, infantry_frames_fidget, infantry_stand};
void infantry_fidget (edict_t *self)
{
self->monsterinfo.currentmove = &infantry_move_fidget;
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
mframe_t infantry_frames_walk [] =
{
ai_walk, 5, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 5, NULL,
ai_walk, 4, NULL,
ai_walk, 5, NULL,
ai_walk, 6, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 5, NULL
};
mmove_t infantry_move_walk = {FRAME_walk03, FRAME_walk14, infantry_frames_walk, NULL};
void infantry_walk (edict_t *self)
{
self->monsterinfo.currentmove = &infantry_move_walk;
}
mframe_t infantry_frames_run [] =
{
ai_run, 10, NULL,
ai_run, 20, NULL,
ai_run, 5, NULL,
ai_run, 7, NULL,
ai_run, 30, NULL,
ai_run, 35, NULL,
ai_run, 2, NULL,
ai_run, 6, NULL
};
mmove_t infantry_move_run = {FRAME_run01, FRAME_run08, infantry_frames_run, NULL};
void infantry_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &infantry_move_stand;
else
self->monsterinfo.currentmove = &infantry_move_run;
}
mframe_t infantry_frames_pain1 [] =
{
ai_move, -3, NULL,
ai_move, -2, NULL,
ai_move, -1, NULL,
ai_move, -2, NULL,
ai_move, -1, NULL,
ai_move, 1, NULL,
ai_move, -1, NULL,
ai_move, 1, NULL,
ai_move, 6, NULL,
ai_move, 2, NULL
};
mmove_t infantry_move_pain1 = {FRAME_pain101, FRAME_pain110, infantry_frames_pain1, infantry_run};
mframe_t infantry_frames_pain2 [] =
{
ai_move, -3, NULL,
ai_move, -3, NULL,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, -2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 5, NULL,
ai_move, 2, NULL
};
mmove_t infantry_move_pain2 = {FRAME_pain201, FRAME_pain210, infantry_frames_pain2, infantry_run};
void infantry_pain (edict_t *self, edict_t *other, float kick, int damage)
{
int n;
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
n = rand() % 2;
if (n == 0)
{
self->monsterinfo.currentmove = &infantry_move_pain1;
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
}
else
{
self->monsterinfo.currentmove = &infantry_move_pain2;
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
}
}
vec3_t aimangles[] =
{
0.0, 5.0, 0.0,
10.0, 15.0, 0.0,
20.0, 25.0, 0.0,
25.0, 35.0, 0.0,
30.0, 40.0, 0.0,
30.0, 45.0, 0.0,
25.0, 50.0, 0.0,
20.0, 40.0, 0.0,
15.0, 35.0, 0.0,
40.0, 35.0, 0.0,
70.0, 35.0, 0.0,
90.0, 35.0, 0.0
};
void InfantryMachineGun (edict_t *self)
{
vec3_t start, target;
vec3_t forward, right;
vec3_t vec;
int flash_number;
if (self->s.frame == FRAME_attak111)
{
flash_number = MZ2_INFANTRY_MACHINEGUN_1;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
if (self->enemy && self->enemy->inuse)
{
VectorMA (self->enemy->s.origin, -0.2, self->enemy->velocity, target);
target[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
target[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
target[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (target, start, forward);
VectorNormalize (forward);
}
else
{
AngleVectors (self->s.angles, forward, right, NULL);
}
}
else
{
flash_number = MZ2_INFANTRY_MACHINEGUN_2 + (self->s.frame - FRAME_death211);
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
VectorSubtract (self->s.angles, aimangles[flash_number-MZ2_INFANTRY_MACHINEGUN_2], vec);
AngleVectors (vec, forward, NULL, NULL);
}
monster_fire_bullet (self, start, forward, 3, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number);
}
void infantry_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_BODY, sound_sight, 1, ATTN_NORM, 0);
}
void infantry_dead (edict_t *self)
{
// Lazarus: Stupid... if flies aren't set by M_FlyCheck, monster_think
// will cause us to come back here over and over and over
// until flies ARE set or monster is gibbed.
// This line fixes that:
self->nextthink = 0;
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t infantry_frames_death1 [] =
{
ai_move, -4, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, -4, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, 3, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, -2, NULL,
ai_move, 2, NULL,
ai_move, 2, NULL,
ai_move, 9, NULL,
ai_move, 9, NULL,
ai_move, 5, NULL,
ai_move, -3, NULL,
ai_move, -3, NULL
};
mmove_t infantry_move_death1 = {FRAME_death101, FRAME_death120, infantry_frames_death1, infantry_dead};
// Off with his head
mframe_t infantry_frames_death2 [] =
{
ai_move, 0, NULL,
ai_move, 1, NULL,
ai_move, 5, NULL,
ai_move, -1, NULL,
ai_move, 0, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, 4, NULL,
ai_move, 3, NULL,
ai_move, 0, NULL,
ai_move, -2, InfantryMachineGun,
ai_move, -2, InfantryMachineGun,
ai_move, -3, InfantryMachineGun,
ai_move, -1, InfantryMachineGun,
ai_move, -2, InfantryMachineGun,
ai_move, 0, InfantryMachineGun,
ai_move, 2, InfantryMachineGun,
ai_move, 2, InfantryMachineGun,
ai_move, 3, InfantryMachineGun,
ai_move, -10, InfantryMachineGun,
ai_move, -7, InfantryMachineGun,
ai_move, -8, InfantryMachineGun,
ai_move, -6, NULL,
ai_move, 4, NULL,
ai_move, 0, NULL
};
mmove_t infantry_move_death2 = {FRAME_death201, FRAME_death225, infantry_frames_death2, infantry_dead};
mframe_t infantry_frames_death3 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -6, NULL,
ai_move, -11, NULL,
ai_move, -3, NULL,
ai_move, -11, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t infantry_move_death3 = {FRAME_death301, FRAME_death309, infantry_frames_death3, infantry_dead};
void infantry_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
n = rand() % 3;
if (n == 0)
{
self->monsterinfo.currentmove = &infantry_move_death1;
gi.sound (self, CHAN_VOICE, sound_die2, 1, ATTN_NORM, 0);
}
else if (n == 1)
{
self->monsterinfo.currentmove = &infantry_move_death2;
gi.sound (self, CHAN_VOICE, sound_die1, 1, ATTN_NORM, 0);
}
else
{
self->monsterinfo.currentmove = &infantry_move_death3;
gi.sound (self, CHAN_VOICE, sound_die2, 1, ATTN_NORM, 0);
}
}
void infantry_duck_down (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_DUCKED)
return;
self->monsterinfo.aiflags |= AI_DUCKED;
self->maxs[2] -= 32;
self->takedamage = DAMAGE_YES;
self->monsterinfo.pausetime = level.time + 1;
gi.linkentity (self);
}
void infantry_duck_hold (edict_t *self)
{
if (level.time >= self->monsterinfo.pausetime)
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
else
self->monsterinfo.aiflags |= AI_HOLD_FRAME;
}
void infantry_duck_up (edict_t *self)
{
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
gi.linkentity (self);
}
mframe_t infantry_frames_duck [] =
{
ai_move, -2, infantry_duck_down,
ai_move, -5, infantry_duck_hold,
ai_move, 3, NULL,
ai_move, 4, infantry_duck_up,
ai_move, 0, NULL
};
mmove_t infantry_move_duck = {FRAME_duck01, FRAME_duck05, infantry_frames_duck, infantry_run};
void infantry_dodge (edict_t *self, edict_t *attacker, float eta)
{
if (random() > 0.25)
return;
if (!self->enemy)
self->enemy = attacker;
self->monsterinfo.currentmove = &infantry_move_duck;
}
void infantry_cock_gun (edict_t *self)
{
int n;
gi.sound (self, CHAN_WEAPON, sound_weapon_cock, 1, ATTN_NORM, 0);
n = (rand() & 15) + 3 + 7;
self->monsterinfo.pausetime = level.time + n * FRAMETIME;
}
void infantry_fire (edict_t *self)
{
InfantryMachineGun (self);
if (level.time >= self->monsterinfo.pausetime)
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
else
self->monsterinfo.aiflags |= AI_HOLD_FRAME;
}
mframe_t infantry_frames_attack1 [] =
{
ai_charge, 4, NULL,
ai_charge, -1, NULL,
ai_charge, -1, NULL,
ai_charge, 0, infantry_cock_gun,
ai_charge, -1, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 2, NULL,
ai_charge, -2, NULL,
ai_charge, -3, NULL,
ai_charge, 1, infantry_fire,
ai_charge, 5, NULL,
ai_charge, -1, NULL,
ai_charge, -2, NULL,
ai_charge, -3, NULL
};
mmove_t infantry_move_attack1 = {FRAME_attak101, FRAME_attak115, infantry_frames_attack1, infantry_run};
void infantry_swing (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_punch_swing, 1, ATTN_NORM, 0);
}
void infantry_smack (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, 0, 0);
if (fire_hit (self, aim, (5 + (rand() % 5)), 50))
gi.sound (self, CHAN_WEAPON, sound_punch_hit, 1, ATTN_NORM, 0);
}
mframe_t infantry_frames_attack2 [] =
{
ai_charge, 3, NULL,
ai_charge, 6, NULL,
ai_charge, 0, infantry_swing,
ai_charge, 8, NULL,
ai_charge, 5, NULL,
ai_charge, 8, infantry_smack,
ai_charge, 6, NULL,
ai_charge, 3, NULL,
};
mmove_t infantry_move_attack2 = {FRAME_attak201, FRAME_attak208, infantry_frames_attack2, infantry_run};
void infantry_attack(edict_t *self)
{
if (range (self, self->enemy) == RANGE_MELEE)
self->monsterinfo.currentmove = &infantry_move_attack2;
else
self->monsterinfo.currentmove = &infantry_move_attack1;
}
//Jump
mframe_t infantry_frames_jump [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t infantry_move_jump = { FRAME_run01, FRAME_run08, infantry_frames_jump, infantry_run };
void infantry_jump (edict_t *self)
{
self->monsterinfo.currentmove = &infantry_move_jump;
}
/*QUAKED monster_infantry (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_infantry (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_INFANTRY;
sound_pain1 = gi.soundindex ("infantry/infpain1.wav");
sound_pain2 = gi.soundindex ("infantry/infpain2.wav");
sound_die1 = gi.soundindex ("infantry/infdeth1.wav");
sound_die2 = gi.soundindex ("infantry/infdeth2.wav");
sound_gunshot = gi.soundindex ("infantry/infatck1.wav");
sound_weapon_cock = gi.soundindex ("infantry/infatck3.wav");
sound_punch_swing = gi.soundindex ("infantry/infatck2.wav");
sound_punch_hit = gi.soundindex ("infantry/melee2.wav");
sound_sight = gi.soundindex ("infantry/infsght1.wav");
sound_search = gi.soundindex ("infantry/infsrch1.wav");
sound_idle = gi.soundindex ("infantry/infidle1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/infantry/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex("models/monsters/infantry/tris.md2");
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, 32);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 100;
if(!self->gib_health)
self->gib_health = -40;
if(!self->mass)
self->mass = 200;
self->pain = infantry_pain;
self->die = infantry_die;
self->monsterinfo.stand = infantry_stand;
self->monsterinfo.walk = infantry_walk;
self->monsterinfo.run = infantry_run;
self->monsterinfo.dodge = infantry_dodge;
self->monsterinfo.attack = infantry_attack;
self->monsterinfo.melee = NULL;
self->monsterinfo.sight = infantry_sight;
self->monsterinfo.idle = infantry_fidget;
if(monsterjump->value)
{
self->monsterinfo.jump = infantry_jump;
self->monsterinfo.jumpup = 48;
self->monsterinfo.jumpdn = 160;
}
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.40;
gi.linkentity (self);
self->monsterinfo.currentmove = &infantry_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&infantry_move_death1,
&infantry_move_death2,
&infantry_move_death3,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->common_name = "Enforcer";
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start (self);
}

View File

@ -1,213 +0,0 @@
// G:\quake2\baseq2\models/monsters/infantry
// This file generated by ModelGen - Do NOT Modify
#define FRAME_gun02 0
#define FRAME_stand01 1
#define FRAME_stand02 2
#define FRAME_stand03 3
#define FRAME_stand04 4
#define FRAME_stand05 5
#define FRAME_stand06 6
#define FRAME_stand07 7
#define FRAME_stand08 8
#define FRAME_stand09 9
#define FRAME_stand10 10
#define FRAME_stand11 11
#define FRAME_stand12 12
#define FRAME_stand13 13
#define FRAME_stand14 14
#define FRAME_stand15 15
#define FRAME_stand16 16
#define FRAME_stand17 17
#define FRAME_stand18 18
#define FRAME_stand19 19
#define FRAME_stand20 20
#define FRAME_stand21 21
#define FRAME_stand22 22
#define FRAME_stand23 23
#define FRAME_stand24 24
#define FRAME_stand25 25
#define FRAME_stand26 26
#define FRAME_stand27 27
#define FRAME_stand28 28
#define FRAME_stand29 29
#define FRAME_stand30 30
#define FRAME_stand31 31
#define FRAME_stand32 32
#define FRAME_stand33 33
#define FRAME_stand34 34
#define FRAME_stand35 35
#define FRAME_stand36 36
#define FRAME_stand37 37
#define FRAME_stand38 38
#define FRAME_stand39 39
#define FRAME_stand40 40
#define FRAME_stand41 41
#define FRAME_stand42 42
#define FRAME_stand43 43
#define FRAME_stand44 44
#define FRAME_stand45 45
#define FRAME_stand46 46
#define FRAME_stand47 47
#define FRAME_stand48 48
#define FRAME_stand49 49
#define FRAME_stand50 50
#define FRAME_stand51 51
#define FRAME_stand52 52
#define FRAME_stand53 53
#define FRAME_stand54 54
#define FRAME_stand55 55
#define FRAME_stand56 56
#define FRAME_stand57 57
#define FRAME_stand58 58
#define FRAME_stand59 59
#define FRAME_stand60 60
#define FRAME_stand61 61
#define FRAME_stand62 62
#define FRAME_stand63 63
#define FRAME_stand64 64
#define FRAME_stand65 65
#define FRAME_stand66 66
#define FRAME_stand67 67
#define FRAME_stand68 68
#define FRAME_stand69 69
#define FRAME_stand70 70
#define FRAME_stand71 71
#define FRAME_walk01 72
#define FRAME_walk02 73
#define FRAME_walk03 74
#define FRAME_walk04 75
#define FRAME_walk05 76
#define FRAME_walk06 77
#define FRAME_walk07 78
#define FRAME_walk08 79
#define FRAME_walk09 80
#define FRAME_walk10 81
#define FRAME_walk11 82
#define FRAME_walk12 83
#define FRAME_walk13 84
#define FRAME_walk14 85
#define FRAME_walk15 86
#define FRAME_walk16 87
#define FRAME_walk17 88
#define FRAME_walk18 89
#define FRAME_walk19 90
#define FRAME_walk20 91
#define FRAME_run01 92
#define FRAME_run02 93
#define FRAME_run03 94
#define FRAME_run04 95
#define FRAME_run05 96
#define FRAME_run06 97
#define FRAME_run07 98
#define FRAME_run08 99
#define FRAME_pain101 100
#define FRAME_pain102 101
#define FRAME_pain103 102
#define FRAME_pain104 103
#define FRAME_pain105 104
#define FRAME_pain106 105
#define FRAME_pain107 106
#define FRAME_pain108 107
#define FRAME_pain109 108
#define FRAME_pain110 109
#define FRAME_pain201 110
#define FRAME_pain202 111
#define FRAME_pain203 112
#define FRAME_pain204 113
#define FRAME_pain205 114
#define FRAME_pain206 115
#define FRAME_pain207 116
#define FRAME_pain208 117
#define FRAME_pain209 118
#define FRAME_pain210 119
#define FRAME_duck01 120
#define FRAME_duck02 121
#define FRAME_duck03 122
#define FRAME_duck04 123
#define FRAME_duck05 124
#define FRAME_death101 125
#define FRAME_death102 126
#define FRAME_death103 127
#define FRAME_death104 128
#define FRAME_death105 129
#define FRAME_death106 130
#define FRAME_death107 131
#define FRAME_death108 132
#define FRAME_death109 133
#define FRAME_death110 134
#define FRAME_death111 135
#define FRAME_death112 136
#define FRAME_death113 137
#define FRAME_death114 138
#define FRAME_death115 139
#define FRAME_death116 140
#define FRAME_death117 141
#define FRAME_death118 142
#define FRAME_death119 143
#define FRAME_death120 144
#define FRAME_death201 145
#define FRAME_death202 146
#define FRAME_death203 147
#define FRAME_death204 148
#define FRAME_death205 149
#define FRAME_death206 150
#define FRAME_death207 151
#define FRAME_death208 152
#define FRAME_death209 153
#define FRAME_death210 154
#define FRAME_death211 155
#define FRAME_death212 156
#define FRAME_death213 157
#define FRAME_death214 158
#define FRAME_death215 159
#define FRAME_death216 160
#define FRAME_death217 161
#define FRAME_death218 162
#define FRAME_death219 163
#define FRAME_death220 164
#define FRAME_death221 165
#define FRAME_death222 166
#define FRAME_death223 167
#define FRAME_death224 168
#define FRAME_death225 169
#define FRAME_death301 170
#define FRAME_death302 171
#define FRAME_death303 172
#define FRAME_death304 173
#define FRAME_death305 174
#define FRAME_death306 175
#define FRAME_death307 176
#define FRAME_death308 177
#define FRAME_death309 178
#define FRAME_block01 179
#define FRAME_block02 180
#define FRAME_block03 181
#define FRAME_block04 182
#define FRAME_block05 183
#define FRAME_attak101 184
#define FRAME_attak102 185
#define FRAME_attak103 186
#define FRAME_attak104 187
#define FRAME_attak105 188
#define FRAME_attak106 189
#define FRAME_attak107 190
#define FRAME_attak108 191
#define FRAME_attak109 192
#define FRAME_attak110 193
#define FRAME_attak111 194
#define FRAME_attak112 195
#define FRAME_attak113 196
#define FRAME_attak114 197
#define FRAME_attak115 198
#define FRAME_attak201 199
#define FRAME_attak202 200
#define FRAME_attak203 201
#define FRAME_attak204 202
#define FRAME_attak205 203
#define FRAME_attak206 204
#define FRAME_attak207 205
#define FRAME_attak208 206
#define MODEL_SCALE 1.000000

View File

@ -1,690 +0,0 @@
/*
==============================================================================
insane
==============================================================================
*/
#include "g_local.h"
#include "m_insane.h"
static int sound_fist;
static int sound_shake;
static int sound_moan;
static int sound_scream[8];
void insane_fist (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_fist, 1, ATTN_IDLE, 0);
}
void insane_shake (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_shake, 1, ATTN_IDLE, 0);
}
void insane_moan (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_moan, 1, ATTN_IDLE, 0);
}
void insane_scream (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_scream[rand()%8], 1, ATTN_IDLE, 0);
}
void insane_stand (edict_t *self);
void insane_dead (edict_t *self);
void insane_cross (edict_t *self);
void insane_walk (edict_t *self);
void insane_run (edict_t *self);
void insane_checkdown (edict_t *self);
void insane_checkup (edict_t *self);
void insane_onground (edict_t *self);
mframe_t insane_frames_stand_normal [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, insane_checkdown
};
mmove_t insane_move_stand_normal = {FRAME_stand60, FRAME_stand65, insane_frames_stand_normal, insane_stand};
mframe_t insane_frames_stand_insane [] =
{
ai_stand, 0, insane_shake,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, insane_checkdown
};
mmove_t insane_move_stand_insane = {FRAME_stand65, FRAME_stand94, insane_frames_stand_insane, insane_stand};
mframe_t insane_frames_uptodown [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, insane_moan,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 2.7, NULL,
ai_move, 4.1, NULL,
ai_move, 6, NULL,
ai_move, 7.6, NULL,
ai_move, 3.6, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, insane_fist,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, insane_fist,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t insane_move_uptodown = {FRAME_stand1, FRAME_stand40, insane_frames_uptodown, insane_onground};
mframe_t insane_frames_downtoup [] =
{
ai_move, -0.7, NULL, // 41
ai_move, -1.2, NULL, // 42
ai_move, -1.5, NULL, // 43
ai_move, -4.5, NULL, // 44
ai_move, -3.5, NULL, // 45
ai_move, -0.2, NULL, // 46
ai_move, 0, NULL, // 47
ai_move, -1.3, NULL, // 48
ai_move, -3, NULL, // 49
ai_move, -2, NULL, // 50
ai_move, 0, NULL, // 51
ai_move, 0, NULL, // 52
ai_move, 0, NULL, // 53
ai_move, -3.3, NULL, // 54
ai_move, -1.6, NULL, // 55
ai_move, -0.3, NULL, // 56
ai_move, 0, NULL, // 57
ai_move, 0, NULL, // 58
ai_move, 0, NULL // 59
};
mmove_t insane_move_downtoup = {FRAME_stand41, FRAME_stand59, insane_frames_downtoup, insane_stand};
mframe_t insane_frames_jumpdown [] =
{
ai_move, 0.2, NULL,
ai_move, 11.5, NULL,
ai_move, 5.1, NULL,
ai_move, 7.1, NULL,
ai_move, 0, NULL
};
mmove_t insane_move_jumpdown = {FRAME_stand96, FRAME_stand100, insane_frames_jumpdown, insane_onground};
mframe_t insane_frames_down [] =
{
ai_move, 0, NULL, // 100
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 110
ai_move, -1.7, NULL,
ai_move, -1.6, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, insane_fist,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 120
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 130
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, insane_moan,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 140
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL, // 150
ai_move, 0.5, NULL,
ai_move, 0, NULL,
ai_move, -0.2, insane_scream,
ai_move, 0, NULL,
ai_move, 0.2, NULL,
ai_move, 0.4, NULL,
ai_move, 0.6, NULL,
ai_move, 0.8, NULL,
ai_move, 0.7, NULL,
ai_move, 0, insane_checkup // 160
};
mmove_t insane_move_down = {FRAME_stand100, FRAME_stand160, insane_frames_down, insane_onground};
mframe_t insane_frames_walk_normal [] =
{
ai_walk, 0, insane_scream,
ai_walk, 2.5, NULL,
ai_walk, 3.5, NULL,
ai_walk, 1.7, NULL,
ai_walk, 2.3, NULL,
ai_walk, 2.4, NULL,
ai_walk, 2.2, NULL,
ai_walk, 4.2, NULL,
ai_walk, 5.6, NULL,
ai_walk, 3.3, NULL,
ai_walk, 2.4, NULL,
ai_walk, 0.9, NULL,
ai_walk, 0, NULL
};
mmove_t insane_move_walk_normal = {FRAME_walk27, FRAME_walk39, insane_frames_walk_normal, insane_walk};
mmove_t insane_move_run_normal = {FRAME_walk27, FRAME_walk39, insane_frames_walk_normal, insane_run};
mframe_t insane_frames_walk_insane [] =
{
ai_walk, 0, insane_scream, // walk 1
ai_walk, 3.4, NULL, // walk 2
ai_walk, 3.6, NULL, // 3
ai_walk, 2.9, NULL, // 4
ai_walk, 2.2, NULL, // 5
ai_walk, 2.6, NULL, // 6
ai_walk, 0, NULL, // 7
ai_walk, 0.7, NULL, // 8
ai_walk, 4.8, NULL, // 9
ai_walk, 5.3, NULL, // 10
ai_walk, 1.1, NULL, // 11
ai_walk, 2, NULL, // 12
ai_walk, 0.5, NULL, // 13
ai_walk, 0, NULL, // 14
ai_walk, 0, NULL, // 15
ai_walk, 4.9, NULL, // 16
ai_walk, 6.7, NULL, // 17
ai_walk, 3.8, NULL, // 18
ai_walk, 2, NULL, // 19
ai_walk, 0.2, NULL, // 20
ai_walk, 0, NULL, // 21
ai_walk, 3.4, NULL, // 22
ai_walk, 6.4, NULL, // 23
ai_walk, 5, NULL, // 24
ai_walk, 1.8, NULL, // 25
ai_walk, 0, NULL // 26
};
mmove_t insane_move_walk_insane = {FRAME_walk1, FRAME_walk26, insane_frames_walk_insane, insane_walk};
mmove_t insane_move_run_insane = {FRAME_walk1, FRAME_walk26, insane_frames_walk_insane, insane_run};
mframe_t insane_frames_stand_pain [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t insane_move_stand_pain = {FRAME_st_pain2, FRAME_st_pain12, insane_frames_stand_pain, insane_run};
mframe_t insane_frames_stand_death [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t insane_move_stand_death = {FRAME_st_death2, FRAME_st_death18, insane_frames_stand_death, insane_dead};
mframe_t insane_frames_crawl [] =
{
ai_walk, 0, insane_scream,
ai_walk, 1.5, NULL,
ai_walk, 2.1, NULL,
ai_walk, 3.6, NULL,
ai_walk, 2, NULL,
ai_walk, 0.9, NULL,
ai_walk, 3, NULL,
ai_walk, 3.4, NULL,
ai_walk, 2.4, NULL
};
mmove_t insane_move_crawl = {FRAME_crawl1, FRAME_crawl9, insane_frames_crawl, NULL};
mmove_t insane_move_runcrawl = {FRAME_crawl1, FRAME_crawl9, insane_frames_crawl, NULL};
mframe_t insane_frames_crawl_pain [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t insane_move_crawl_pain = {FRAME_cr_pain2, FRAME_cr_pain10, insane_frames_crawl_pain, insane_run};
mframe_t insane_frames_crawl_death [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t insane_move_crawl_death = {FRAME_cr_death10, FRAME_cr_death16, insane_frames_crawl_death, insane_dead};
mframe_t insane_frames_cross [] =
{
ai_move, 0, insane_moan,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t insane_move_cross = {FRAME_cross1, FRAME_cross15, insane_frames_cross, insane_cross};
mframe_t insane_frames_struggle_cross [] =
{
ai_move, 0, insane_scream,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t insane_move_struggle_cross = {FRAME_cross16, FRAME_cross30, insane_frames_struggle_cross, insane_cross};
void insane_cross (edict_t *self)
{
if (random() < 0.8)
self->monsterinfo.currentmove = &insane_move_cross;
else
self->monsterinfo.currentmove = &insane_move_struggle_cross;
}
void insane_walk (edict_t *self)
{
if ( self->spawnflags & 16 ) // Hold Ground?
if (self->s.frame == FRAME_cr_pain10)
{
self->monsterinfo.currentmove = &insane_move_down;
return;
}
if (self->spawnflags & 4)
self->monsterinfo.currentmove = &insane_move_crawl;
else
if (random() <= 0.5)
self->monsterinfo.currentmove = &insane_move_walk_normal;
else
self->monsterinfo.currentmove = &insane_move_walk_insane;
}
void insane_run (edict_t *self)
{
if ( self->spawnflags & 16 ) // Hold Ground?
if (self->s.frame == FRAME_cr_pain10)
{
self->monsterinfo.currentmove = &insane_move_down;
return;
}
if (self->spawnflags & 4) // Crawling?
self->monsterinfo.currentmove = &insane_move_runcrawl;
else
if (random() <= 0.5) // Else, mix it up
self->monsterinfo.currentmove = &insane_move_run_normal;
else
self->monsterinfo.currentmove = &insane_move_run_insane;
}
void insane_pain (edict_t *self, edict_t *other, float kick, int damage)
{
int l,r;
// if (self->health < (self->max_health / 2))
// self->s.skin = 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
r = 1 + (rand()&1);
if (self->health < 25)
l = 25;
else if (self->health < 50)
l = 50;
else if (self->health < 75)
l = 75;
else
l = 100;
gi.sound (self, CHAN_VOICE, gi.soundindex (va("player/male/pain%i_%i.wav", l, r)), 1, ATTN_IDLE, 0);
if (skill->value == 3)
return; // no pain anims in nightmare
// Don't go into pain frames if crucified.
if (self->spawnflags & 8)
{
self->monsterinfo.currentmove = &insane_move_struggle_cross;
return;
}
if ( ((self->s.frame >= FRAME_crawl1) && (self->s.frame <= FRAME_crawl9)) || ((self->s.frame >= FRAME_stand99) && (self->s.frame <= FRAME_stand160)) )
{
self->monsterinfo.currentmove = &insane_move_crawl_pain;
}
else
self->monsterinfo.currentmove = &insane_move_stand_pain;
}
void insane_onground (edict_t *self)
{
self->monsterinfo.currentmove = &insane_move_down;
}
void insane_checkdown (edict_t *self)
{
// if ( (self->s.frame == FRAME_stand94) || (self->s.frame == FRAME_stand65) )
if (self->spawnflags & 32) // Always stand
return;
if (random() < 0.3)
if (random() < 0.5)
self->monsterinfo.currentmove = &insane_move_uptodown;
else
self->monsterinfo.currentmove = &insane_move_jumpdown;
}
void insane_checkup (edict_t *self)
{
// If Hold_Ground and Crawl are set
if ( (self->spawnflags & 4) && (self->spawnflags & 16) )
return;
if (random() < 0.5)
self->monsterinfo.currentmove = &insane_move_downtoup;
}
void insane_stand (edict_t *self)
{
if (self->spawnflags & 8) // If crucified
{
self->monsterinfo.currentmove = &insane_move_cross;
self->monsterinfo.aiflags |= AI_STAND_GROUND;
}
// If Hold_Ground and Crawl are set
else if ( (self->spawnflags & 4) && (self->spawnflags & 16) )
self->monsterinfo.currentmove = &insane_move_down;
else
if (random() < 0.5)
self->monsterinfo.currentmove = &insane_move_stand_normal;
else
self->monsterinfo.currentmove = &insane_move_stand_insane;
}
void insane_dead (edict_t *self)
{
if (self->spawnflags & 8)
{
self->flags |= FL_FLY;
}
else
{
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
}
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck(self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
void insane_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_IDLE, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
gi.sound (self, CHAN_VOICE, gi.soundindex(va("player/male/death%i.wav", (rand()%4)+1)), 1, ATTN_IDLE, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
if (self->spawnflags & 8)
{
insane_dead (self);
}
else
{
if ( ((self->s.frame >= FRAME_crawl1) && (self->s.frame <= FRAME_crawl9)) || ((self->s.frame >= FRAME_stand99) && (self->s.frame <= FRAME_stand160)) )
self->monsterinfo.currentmove = &insane_move_crawl_death;
else
self->monsterinfo.currentmove = &insane_move_stand_death;
}
}
/*QUAKED misc_insane (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn CRAWL CRUCIFIED STAND_GROUND ALWAYS_STAND
*/
void SP_misc_insane (edict_t *self)
{
// static int skin = 0; //@@
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MISC_INSANE;
sound_fist = gi.soundindex ("insane/insane11.wav");
sound_shake = gi.soundindex ("insane/insane5.wav");
sound_moan = gi.soundindex ("insane/insane7.wav");
sound_scream[0] = gi.soundindex ("insane/insane1.wav");
sound_scream[1] = gi.soundindex ("insane/insane2.wav");
sound_scream[2] = gi.soundindex ("insane/insane3.wav");
sound_scream[3] = gi.soundindex ("insane/insane4.wav");
sound_scream[4] = gi.soundindex ("insane/insane6.wav");
sound_scream[5] = gi.soundindex ("insane/insane8.wav");
sound_scream[6] = gi.soundindex ("insane/insane9.wav");
sound_scream[7] = gi.soundindex ("insane/insane10.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
self->s.modelindex = gi.modelindex("models/monsters/insane/tris.md2");
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, 32);
if(!self->health)
self->health = 100;
if(!self->gib_health)
self->gib_health = -50;
if(!self->mass)
self->mass = 300;
self->pain = insane_pain;
self->die = insane_die;
self->monsterinfo.stand = insane_stand;
self->monsterinfo.walk = insane_walk;
self->monsterinfo.run = insane_run;
self->monsterinfo.dodge = NULL;
self->monsterinfo.attack = NULL;
self->monsterinfo.melee = NULL;
self->monsterinfo.sight = NULL;
self->monsterinfo.aiflags |= AI_GOOD_GUY;
self->common_name = "Insane Marine";
//@@
// self->s.skin = skin;
// skin++;
// if (skin > 12)
// skin = 0;
gi.linkentity (self);
if (self->spawnflags & 16) // Stand Ground
self->monsterinfo.aiflags |= AI_STAND_GROUND;
self->monsterinfo.currentmove = &insane_move_stand_normal;
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.30;
self->monsterinfo.scale = MODEL_SCALE;
if (self->spawnflags & 8) // Crucified ?
{
VectorSet (self->mins, -16, 0, 0);
VectorSet (self->maxs, 16, 8, 32);
self->flags |= FL_NO_KNOCKBACK;
flymonster_start (self);
}
else
{
walkmonster_start (self);
self->s.skin = rand()%3;
}
}

View File

@ -1,288 +0,0 @@
// G:\quake2\baseq2\models/monsters/insane
// This file generated by ModelGen - Do NOT Modify
#define FRAME_stand1 0
#define FRAME_stand2 1
#define FRAME_stand3 2
#define FRAME_stand4 3
#define FRAME_stand5 4
#define FRAME_stand6 5
#define FRAME_stand7 6
#define FRAME_stand8 7
#define FRAME_stand9 8
#define FRAME_stand10 9
#define FRAME_stand11 10
#define FRAME_stand12 11
#define FRAME_stand13 12
#define FRAME_stand14 13
#define FRAME_stand15 14
#define FRAME_stand16 15
#define FRAME_stand17 16
#define FRAME_stand18 17
#define FRAME_stand19 18
#define FRAME_stand20 19
#define FRAME_stand21 20
#define FRAME_stand22 21
#define FRAME_stand23 22
#define FRAME_stand24 23
#define FRAME_stand25 24
#define FRAME_stand26 25
#define FRAME_stand27 26
#define FRAME_stand28 27
#define FRAME_stand29 28
#define FRAME_stand30 29
#define FRAME_stand31 30
#define FRAME_stand32 31
#define FRAME_stand33 32
#define FRAME_stand34 33
#define FRAME_stand35 34
#define FRAME_stand36 35
#define FRAME_stand37 36
#define FRAME_stand38 37
#define FRAME_stand39 38
#define FRAME_stand40 39
#define FRAME_stand41 40
#define FRAME_stand42 41
#define FRAME_stand43 42
#define FRAME_stand44 43
#define FRAME_stand45 44
#define FRAME_stand46 45
#define FRAME_stand47 46
#define FRAME_stand48 47
#define FRAME_stand49 48
#define FRAME_stand50 49
#define FRAME_stand51 50
#define FRAME_stand52 51
#define FRAME_stand53 52
#define FRAME_stand54 53
#define FRAME_stand55 54
#define FRAME_stand56 55
#define FRAME_stand57 56
#define FRAME_stand58 57
#define FRAME_stand59 58
#define FRAME_stand60 59
#define FRAME_stand61 60
#define FRAME_stand62 61
#define FRAME_stand63 62
#define FRAME_stand64 63
#define FRAME_stand65 64
#define FRAME_stand66 65
#define FRAME_stand67 66
#define FRAME_stand68 67
#define FRAME_stand69 68
#define FRAME_stand70 69
#define FRAME_stand71 70
#define FRAME_stand72 71
#define FRAME_stand73 72
#define FRAME_stand74 73
#define FRAME_stand75 74
#define FRAME_stand76 75
#define FRAME_stand77 76
#define FRAME_stand78 77
#define FRAME_stand79 78
#define FRAME_stand80 79
#define FRAME_stand81 80
#define FRAME_stand82 81
#define FRAME_stand83 82
#define FRAME_stand84 83
#define FRAME_stand85 84
#define FRAME_stand86 85
#define FRAME_stand87 86
#define FRAME_stand88 87
#define FRAME_stand89 88
#define FRAME_stand90 89
#define FRAME_stand91 90
#define FRAME_stand92 91
#define FRAME_stand93 92
#define FRAME_stand94 93
#define FRAME_stand95 94
#define FRAME_stand96 95
#define FRAME_stand97 96
#define FRAME_stand98 97
#define FRAME_stand99 98
#define FRAME_stand100 99
#define FRAME_stand101 100
#define FRAME_stand102 101
#define FRAME_stand103 102
#define FRAME_stand104 103
#define FRAME_stand105 104
#define FRAME_stand106 105
#define FRAME_stand107 106
#define FRAME_stand108 107
#define FRAME_stand109 108
#define FRAME_stand110 109
#define FRAME_stand111 110
#define FRAME_stand112 111
#define FRAME_stand113 112
#define FRAME_stand114 113
#define FRAME_stand115 114
#define FRAME_stand116 115
#define FRAME_stand117 116
#define FRAME_stand118 117
#define FRAME_stand119 118
#define FRAME_stand120 119
#define FRAME_stand121 120
#define FRAME_stand122 121
#define FRAME_stand123 122
#define FRAME_stand124 123
#define FRAME_stand125 124
#define FRAME_stand126 125
#define FRAME_stand127 126
#define FRAME_stand128 127
#define FRAME_stand129 128
#define FRAME_stand130 129
#define FRAME_stand131 130
#define FRAME_stand132 131
#define FRAME_stand133 132
#define FRAME_stand134 133
#define FRAME_stand135 134
#define FRAME_stand136 135
#define FRAME_stand137 136
#define FRAME_stand138 137
#define FRAME_stand139 138
#define FRAME_stand140 139
#define FRAME_stand141 140
#define FRAME_stand142 141
#define FRAME_stand143 142
#define FRAME_stand144 143
#define FRAME_stand145 144
#define FRAME_stand146 145
#define FRAME_stand147 146
#define FRAME_stand148 147
#define FRAME_stand149 148
#define FRAME_stand150 149
#define FRAME_stand151 150
#define FRAME_stand152 151
#define FRAME_stand153 152
#define FRAME_stand154 153
#define FRAME_stand155 154
#define FRAME_stand156 155
#define FRAME_stand157 156
#define FRAME_stand158 157
#define FRAME_stand159 158
#define FRAME_stand160 159
#define FRAME_walk27 160
#define FRAME_walk28 161
#define FRAME_walk29 162
#define FRAME_walk30 163
#define FRAME_walk31 164
#define FRAME_walk32 165
#define FRAME_walk33 166
#define FRAME_walk34 167
#define FRAME_walk35 168
#define FRAME_walk36 169
#define FRAME_walk37 170
#define FRAME_walk38 171
#define FRAME_walk39 172
#define FRAME_walk1 173
#define FRAME_walk2 174
#define FRAME_walk3 175
#define FRAME_walk4 176
#define FRAME_walk5 177
#define FRAME_walk6 178
#define FRAME_walk7 179
#define FRAME_walk8 180
#define FRAME_walk9 181
#define FRAME_walk10 182
#define FRAME_walk11 183
#define FRAME_walk12 184
#define FRAME_walk13 185
#define FRAME_walk14 186
#define FRAME_walk15 187
#define FRAME_walk16 188
#define FRAME_walk17 189
#define FRAME_walk18 190
#define FRAME_walk19 191
#define FRAME_walk20 192
#define FRAME_walk21 193
#define FRAME_walk22 194
#define FRAME_walk23 195
#define FRAME_walk24 196
#define FRAME_walk25 197
#define FRAME_walk26 198
#define FRAME_st_pain2 199
#define FRAME_st_pain3 200
#define FRAME_st_pain4 201
#define FRAME_st_pain5 202
#define FRAME_st_pain6 203
#define FRAME_st_pain7 204
#define FRAME_st_pain8 205
#define FRAME_st_pain9 206
#define FRAME_st_pain10 207
#define FRAME_st_pain11 208
#define FRAME_st_pain12 209
#define FRAME_st_death2 210
#define FRAME_st_death3 211
#define FRAME_st_death4 212
#define FRAME_st_death5 213
#define FRAME_st_death6 214
#define FRAME_st_death7 215
#define FRAME_st_death8 216
#define FRAME_st_death9 217
#define FRAME_st_death10 218
#define FRAME_st_death11 219
#define FRAME_st_death12 220
#define FRAME_st_death13 221
#define FRAME_st_death14 222
#define FRAME_st_death15 223
#define FRAME_st_death16 224
#define FRAME_st_death17 225
#define FRAME_st_death18 226
#define FRAME_crawl1 227
#define FRAME_crawl2 228
#define FRAME_crawl3 229
#define FRAME_crawl4 230
#define FRAME_crawl5 231
#define FRAME_crawl6 232
#define FRAME_crawl7 233
#define FRAME_crawl8 234
#define FRAME_crawl9 235
#define FRAME_cr_pain2 236
#define FRAME_cr_pain3 237
#define FRAME_cr_pain4 238
#define FRAME_cr_pain5 239
#define FRAME_cr_pain6 240
#define FRAME_cr_pain7 241
#define FRAME_cr_pain8 242
#define FRAME_cr_pain9 243
#define FRAME_cr_pain10 244
#define FRAME_cr_death10 245
#define FRAME_cr_death11 246
#define FRAME_cr_death12 247
#define FRAME_cr_death13 248
#define FRAME_cr_death14 249
#define FRAME_cr_death15 250
#define FRAME_cr_death16 251
#define FRAME_cross1 252
#define FRAME_cross2 253
#define FRAME_cross3 254
#define FRAME_cross4 255
#define FRAME_cross5 256
#define FRAME_cross6 257
#define FRAME_cross7 258
#define FRAME_cross8 259
#define FRAME_cross9 260
#define FRAME_cross10 261
#define FRAME_cross11 262
#define FRAME_cross12 263
#define FRAME_cross13 264
#define FRAME_cross14 265
#define FRAME_cross15 266
#define FRAME_cross16 267
#define FRAME_cross17 268
#define FRAME_cross18 269
#define FRAME_cross19 270
#define FRAME_cross20 271
#define FRAME_cross21 272
#define FRAME_cross22 273
#define FRAME_cross23 274
#define FRAME_cross24 275
#define FRAME_cross25 276
#define FRAME_cross26 277
#define FRAME_cross27 278
#define FRAME_cross28 279
#define FRAME_cross29 280
#define FRAME_cross30 281
#define MODEL_SCALE 1.000000

File diff suppressed because it is too large Load Diff

View File

@ -1,243 +0,0 @@
// G:\quake2\baseq2\models/monsters/medic
// This file generated by ModelGen - Do NOT Modify
#define FRAME_walk1 0
#define FRAME_walk2 1
#define FRAME_walk3 2
#define FRAME_walk4 3
#define FRAME_walk5 4
#define FRAME_walk6 5
#define FRAME_walk7 6
#define FRAME_walk8 7
#define FRAME_walk9 8
#define FRAME_walk10 9
#define FRAME_walk11 10
#define FRAME_walk12 11
#define FRAME_wait1 12
#define FRAME_wait2 13
#define FRAME_wait3 14
#define FRAME_wait4 15
#define FRAME_wait5 16
#define FRAME_wait6 17
#define FRAME_wait7 18
#define FRAME_wait8 19
#define FRAME_wait9 20
#define FRAME_wait10 21
#define FRAME_wait11 22
#define FRAME_wait12 23
#define FRAME_wait13 24
#define FRAME_wait14 25
#define FRAME_wait15 26
#define FRAME_wait16 27
#define FRAME_wait17 28
#define FRAME_wait18 29
#define FRAME_wait19 30
#define FRAME_wait20 31
#define FRAME_wait21 32
#define FRAME_wait22 33
#define FRAME_wait23 34
#define FRAME_wait24 35
#define FRAME_wait25 36
#define FRAME_wait26 37
#define FRAME_wait27 38
#define FRAME_wait28 39
#define FRAME_wait29 40
#define FRAME_wait30 41
#define FRAME_wait31 42
#define FRAME_wait32 43
#define FRAME_wait33 44
#define FRAME_wait34 45
#define FRAME_wait35 46
#define FRAME_wait36 47
#define FRAME_wait37 48
#define FRAME_wait38 49
#define FRAME_wait39 50
#define FRAME_wait40 51
#define FRAME_wait41 52
#define FRAME_wait42 53
#define FRAME_wait43 54
#define FRAME_wait44 55
#define FRAME_wait45 56
#define FRAME_wait46 57
#define FRAME_wait47 58
#define FRAME_wait48 59
#define FRAME_wait49 60
#define FRAME_wait50 61
#define FRAME_wait51 62
#define FRAME_wait52 63
#define FRAME_wait53 64
#define FRAME_wait54 65
#define FRAME_wait55 66
#define FRAME_wait56 67
#define FRAME_wait57 68
#define FRAME_wait58 69
#define FRAME_wait59 70
#define FRAME_wait60 71
#define FRAME_wait61 72
#define FRAME_wait62 73
#define FRAME_wait63 74
#define FRAME_wait64 75
#define FRAME_wait65 76
#define FRAME_wait66 77
#define FRAME_wait67 78
#define FRAME_wait68 79
#define FRAME_wait69 80
#define FRAME_wait70 81
#define FRAME_wait71 82
#define FRAME_wait72 83
#define FRAME_wait73 84
#define FRAME_wait74 85
#define FRAME_wait75 86
#define FRAME_wait76 87
#define FRAME_wait77 88
#define FRAME_wait78 89
#define FRAME_wait79 90
#define FRAME_wait80 91
#define FRAME_wait81 92
#define FRAME_wait82 93
#define FRAME_wait83 94
#define FRAME_wait84 95
#define FRAME_wait85 96
#define FRAME_wait86 97
#define FRAME_wait87 98
#define FRAME_wait88 99
#define FRAME_wait89 100
#define FRAME_wait90 101
#define FRAME_run1 102
#define FRAME_run2 103
#define FRAME_run3 104
#define FRAME_run4 105
#define FRAME_run5 106
#define FRAME_run6 107
#define FRAME_paina1 108
#define FRAME_paina2 109
#define FRAME_paina3 110
#define FRAME_paina4 111
#define FRAME_paina5 112
#define FRAME_paina6 113
#define FRAME_paina7 114
#define FRAME_paina8 115
#define FRAME_painb1 116
#define FRAME_painb2 117
#define FRAME_painb3 118
#define FRAME_painb4 119
#define FRAME_painb5 120
#define FRAME_painb6 121
#define FRAME_painb7 122
#define FRAME_painb8 123
#define FRAME_painb9 124
#define FRAME_painb10 125
#define FRAME_painb11 126
#define FRAME_painb12 127
#define FRAME_painb13 128
#define FRAME_painb14 129
#define FRAME_painb15 130
#define FRAME_duck1 131
#define FRAME_duck2 132
#define FRAME_duck3 133
#define FRAME_duck4 134
#define FRAME_duck5 135
#define FRAME_duck6 136
#define FRAME_duck7 137
#define FRAME_duck8 138
#define FRAME_duck9 139
#define FRAME_duck10 140
#define FRAME_duck11 141
#define FRAME_duck12 142
#define FRAME_duck13 143
#define FRAME_duck14 144
#define FRAME_duck15 145
#define FRAME_duck16 146
#define FRAME_death1 147
#define FRAME_death2 148
#define FRAME_death3 149
#define FRAME_death4 150
#define FRAME_death5 151
#define FRAME_death6 152
#define FRAME_death7 153
#define FRAME_death8 154
#define FRAME_death9 155
#define FRAME_death10 156
#define FRAME_death11 157
#define FRAME_death12 158
#define FRAME_death13 159
#define FRAME_death14 160
#define FRAME_death15 161
#define FRAME_death16 162
#define FRAME_death17 163
#define FRAME_death18 164
#define FRAME_death19 165
#define FRAME_death20 166
#define FRAME_death21 167
#define FRAME_death22 168
#define FRAME_death23 169
#define FRAME_death24 170
#define FRAME_death25 171
#define FRAME_death26 172
#define FRAME_death27 173
#define FRAME_death28 174
#define FRAME_death29 175
#define FRAME_death30 176
#define FRAME_attack1 177
#define FRAME_attack2 178
#define FRAME_attack3 179
#define FRAME_attack4 180
#define FRAME_attack5 181
#define FRAME_attack6 182
#define FRAME_attack7 183
#define FRAME_attack8 184
#define FRAME_attack9 185
#define FRAME_attack10 186
#define FRAME_attack11 187
#define FRAME_attack12 188
#define FRAME_attack13 189
#define FRAME_attack14 190
#define FRAME_attack15 191
#define FRAME_attack16 192
#define FRAME_attack17 193
#define FRAME_attack18 194
#define FRAME_attack19 195
#define FRAME_attack20 196
#define FRAME_attack21 197
#define FRAME_attack22 198
#define FRAME_attack23 199
#define FRAME_attack24 200
#define FRAME_attack25 201
#define FRAME_attack26 202
#define FRAME_attack27 203
#define FRAME_attack28 204
#define FRAME_attack29 205
#define FRAME_attack30 206
#define FRAME_attack31 207
#define FRAME_attack32 208
#define FRAME_attack33 209
#define FRAME_attack34 210
#define FRAME_attack35 211
#define FRAME_attack36 212
#define FRAME_attack37 213
#define FRAME_attack38 214
#define FRAME_attack39 215
#define FRAME_attack40 216
#define FRAME_attack41 217
#define FRAME_attack42 218
#define FRAME_attack43 219
#define FRAME_attack44 220
#define FRAME_attack45 221
#define FRAME_attack46 222
#define FRAME_attack47 223
#define FRAME_attack48 224
#define FRAME_attack49 225
#define FRAME_attack50 226
#define FRAME_attack51 227
#define FRAME_attack52 228
#define FRAME_attack53 229
#define FRAME_attack54 230
#define FRAME_attack55 231
#define FRAME_attack56 232
#define FRAME_attack57 233
#define FRAME_attack58 234
#define FRAME_attack59 235
#define FRAME_attack60 236
#define MODEL_SCALE 1.000000

View File

@ -1,896 +0,0 @@
// m_move.c -- monster movement
#include "g_local.h"
#define STEPSIZE 18
/*
=============
M_CheckBottom
Returns false if any part of the bottom of the entity is off an edge that
is not a staircase.
=============
*/
int c_yes, c_no;
bool M_CheckBottom (edict_t *ent)
{
vec3_t mins, maxs, start, stop;
trace_t trace;
int x, y;
float mid, bottom;
VectorAdd (ent->s.origin, ent->mins, mins);
VectorAdd (ent->s.origin, ent->maxs, maxs);
// if all of the points under the corners are solid world, don't bother
// with the tougher checks
// the corners must be within 16 of the midpoint
start[2] = mins[2] - 1;
for (x=0 ; x<=1 ; x++)
for (y=0 ; y<=1 ; y++)
{
start[0] = x ? maxs[0] : mins[0];
start[1] = y ? maxs[1] : mins[1];
if (gi.pointcontents (start) != CONTENTS_SOLID)
goto realcheck;
}
c_yes++;
return true; // we got out easy
realcheck:
c_no++;
//
// check it for real...
//
start[2] = mins[2];
// the midpoint must be within 16 of the bottom
start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
stop[2] = start[2] - 2*STEPSIZE;
trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
if (trace.fraction == 1.0)
return false;
mid = bottom = trace.endpos[2];
// the corners must be within 16 of the midpoint
for (x=0 ; x<=1 ; x++)
for (y=0 ; y<=1 ; y++)
{
start[0] = stop[0] = x ? maxs[0] : mins[0];
start[1] = stop[1] = y ? maxs[1] : mins[1];
trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
bottom = trace.endpos[2];
if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE)
return false;
}
c_yes++;
return true;
}
/*
=============
SV_movestep
Called by monster program code.
The move will be adjusted for slopes and stairs, but if the move isn't
possible, no move is done, false is returned, and
pr_global_struct->trace_normal is set to the normal of the blocking wall
=============
*/
//FIXME since we need to test end position contents here, can we avoid doing
//it again later in catagorize position?
bool SV_movestep (edict_t *ent, vec3_t move, bool relink)
{
float dz;
vec3_t oldorg, neworg, end;
trace_t trace;
int i;
float stepsize;
float jumpheight;
vec3_t test;
int contents;
bool canjump;
float d1, d2;
int jump; // 1=jump up, -1=jump down
vec3_t forward, up;
vec3_t dir;
vec_t dist;
vec_t g1, g2;
edict_t *grenade;
edict_t *target;
// try the move
VectorCopy (ent->s.origin, oldorg);
VectorAdd (ent->s.origin, move, neworg);
AngleVectors(ent->s.angles,forward,NULL,up);
if(ent->enemy)
target = ent->enemy;
else if(ent->movetarget)
target = ent->movetarget;
else
target = NULL;
// flying monsters don't step up
if ( ent->flags & (FL_SWIM | FL_FLY) )
{
// try one move with vertical motion, then one without
for (i=0 ; i<2 ; i++)
{
VectorAdd (ent->s.origin, move, neworg);
if (i == 0 && ent->enemy)
{
if (!ent->goalentity)
ent->goalentity = ent->enemy;
dz = ent->s.origin[2] - ent->goalentity->s.origin[2];
if (ent->goalentity->client)
{
if (dz > 40)
neworg[2] -= 8;
if (!((ent->flags & FL_SWIM) && (ent->waterlevel < 2)))
if (dz < 30)
neworg[2] += 8;
}
else
{
if (dz > 8)
neworg[2] -= 8;
else if (dz > 0)
neworg[2] -= dz;
else if (dz < -8)
neworg[2] += 8;
else
neworg[2] += dz;
}
}
trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, neworg, ent, MASK_MONSTERSOLID);
// fly monsters don't enter water voluntarily
if (ent->flags & FL_FLY)
{
if (!ent->waterlevel)
{
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
test[2] = trace.endpos[2] + ent->mins[2] + 1;
contents = gi.pointcontents(test);
if (contents & MASK_WATER)
return false;
}
}
// swim monsters don't exit water voluntarily
if (ent->flags & FL_SWIM)
{
if (ent->waterlevel < 2)
{
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
test[2] = trace.endpos[2] + ent->mins[2] + 1;
contents = gi.pointcontents(test);
if (!(contents & MASK_WATER))
return false;
}
}
if (trace.fraction == 1)
{
VectorCopy (trace.endpos, ent->s.origin);
if (relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
return true;
}
if (!ent->enemy)
break;
}
return false;
}
// push down from a step height above the wished position
if (!(ent->monsterinfo.aiflags & AI_NOSTEP))
stepsize = STEPSIZE;
else
stepsize = 1;
neworg[2] += stepsize;
VectorCopy (neworg, end);
end[2] -= stepsize*2;
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
// Determine whether monster is capable of and/or should jump
jump = 0;
if((ent->monsterinfo.jump) && !(ent->monsterinfo.aiflags & AI_DUCKED))
{
// Don't jump if path is blocked by monster or player. Otherwise,
// monster might attempt to jump OVER the monster/player, which
// ends up looking a bit goofy. Also don't jump if the monster's
// movement isn't deliberate (target=NULL)
if(trace.ent && (trace.ent->client || (trace.ent->svflags & SVF_MONSTER)))
canjump = false;
else if(target)
{
// Never jump unless it places monster closer to his goal
vec3_t dir;
VectorSubtract(target->s.origin, oldorg, dir);
d1 = VectorLength(dir);
VectorSubtract(target->s.origin, trace.endpos, dir);
d2 = VectorLength(dir);
if(d2 < d1)
canjump = true;
else
canjump = false;
}
else
canjump = false;
}
else
canjump = false;
if (trace.allsolid)
{
if(canjump && (ent->monsterinfo.jumpup > 0))
{
neworg[2] += ent->monsterinfo.jumpup - stepsize;
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
if (!trace.allsolid && !trace.startsolid && trace.fraction > 0 && (trace.plane.normal[2] > 0.9))
{
if(!trace.ent || (!trace.ent->client && !(trace.ent->svflags & SVF_MONSTER) && !(trace.ent->svflags & SVF_DEADMONSTER)))
{
// Good plane to jump on. Make sure monster is more or less facing
// the obstacle to avoid cutting-corners jumps
trace_t tr;
vec3_t p2;
VectorMA(ent->s.origin,1024,forward,p2);
tr = gi.trace(ent->s.origin,ent->mins,ent->maxs,p2,ent,MASK_MONSTERSOLID);
if(DotProduct(tr.plane.normal,forward) < -0.95)
{
jump = 1;
jumpheight = trace.endpos[2] - ent->s.origin[2];
}
else
return false;
}
}
else
return false;
}
else
return false;
}
if (trace.startsolid)
{
neworg[2] -= stepsize;
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
if (trace.allsolid || trace.startsolid)
return false;
}
// don't go in to water
// Lazarus: misc_actors don't go swimming, but wading is fine
if (ent->monsterinfo.aiflags & AI_ACTOR)
{
// First check for lava/slime under feet - but only if we're not already in
// a liquid
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
if (ent->waterlevel == 0)
{
test[2] = trace.endpos[2] + ent->mins[2] + 1;
contents = gi.pointcontents(test);
if (contents & (CONTENTS_LAVA | CONTENTS_SLIME))
return false;
}
test[2] = trace.endpos[2] + ent->viewheight - 1;
contents = gi.pointcontents(test);
if (contents & MASK_WATER)
return false;
}
else if (ent->waterlevel == 0)
{
test[0] = trace.endpos[0];
test[1] = trace.endpos[1];
test[2] = trace.endpos[2] + ent->mins[2] + 1;
contents = gi.pointcontents(test);
if (contents & MASK_WATER)
return false;
}
// Lazarus: Don't intentionally move closer to a grenade,
// but don't perform this check if we're already evading some
// other problem (maybe even this grenade)
if(!(ent->monsterinfo.aiflags & AI_CHASE_THING))
{
grenade = NULL;
while( (grenade=findradius(grenade,neworg,128)) != NULL)
{
if(!grenade->inuse)
continue;
if(!grenade->classname)
continue;
if((grenade->class_id == ENTITY_GRENADE) || (grenade->class_id == ENTITY_HANDGRENADE))
{
VectorSubtract(grenade->s.origin,oldorg,dir);
g1 = VectorLength(dir);
VectorSubtract(grenade->s.origin,neworg,dir);
g2 = VectorLength(dir);
if(g2 < g1)
return false;
}
}
}
// Lazarus: Don't intentionally walk into lasers.
dist = VectorLength(move);
if(dist > 0.)
{
edict_t *e;
trace_t laser_trace;
vec_t delta;
vec3_t laser_mins, laser_maxs;
vec3_t laser_start, laser_end;
vec3_t monster_mins, monster_maxs;
for(i=game.maxclients+1; i<globals.num_edicts; i++)
{
e = &g_edicts[i];
if(!e->inuse)
continue;
if(!e->classname)
continue;
if(e->class_id != ENTITY_TARGET_LASER)
continue;
if(e->svflags & SVF_NOCLIENT)
continue;
if( (e->style == 2) || (e->style == 3))
continue;
if(!gi.inPVS(ent->s.origin,e->s.origin))
continue;
// Check to see if monster is ALREADY in the path of this laser.
// If so, allow the move so he can get out.
VectorMA(e->s.origin,2048,e->movedir,laser_end);
laser_trace = gi.trace(e->s.origin,NULL,NULL,laser_end,NULL,CONTENTS_SOLID|CONTENTS_MONSTER);
if(laser_trace.ent == ent)
continue;
VectorCopy(laser_trace.endpos,laser_end);
laser_mins[0] = min(e->s.origin[0],laser_end[0]);
laser_mins[1] = min(e->s.origin[1],laser_end[1]);
laser_mins[2] = min(e->s.origin[2],laser_end[2]);
laser_maxs[0] = max(e->s.origin[0],laser_end[0]);
laser_maxs[1] = max(e->s.origin[1],laser_end[1]);
laser_maxs[2] = max(e->s.origin[2],laser_end[2]);
monster_mins[0] = min(oldorg[0],trace.endpos[0]) + ent->mins[0];
monster_mins[1] = min(oldorg[1],trace.endpos[1]) + ent->mins[1];
monster_mins[2] = min(oldorg[2],trace.endpos[2]) + ent->mins[2];
monster_maxs[0] = max(oldorg[0],trace.endpos[0]) + ent->maxs[0];
monster_maxs[1] = max(oldorg[1],trace.endpos[1]) + ent->maxs[1];
monster_maxs[2] = max(oldorg[2],trace.endpos[2]) + ent->maxs[2];
if( monster_maxs[0] < laser_mins[0] ) continue;
if( monster_maxs[1] < laser_mins[1] ) continue;
if( monster_maxs[2] < laser_mins[2] ) continue;
if( monster_mins[0] > laser_maxs[0] ) continue;
if( monster_mins[1] > laser_maxs[1] ) continue;
if( monster_mins[2] > laser_maxs[2] ) continue;
// If we arrive here, some part of the bounding box surrounding
// monster's total movement intersects laser bounding box.
// If laser is parallel to x, y, or z, we definitely
// know this move will put monster in path of laser
if ( (e->movedir[0] == 1.) || (e->movedir[1] == 1.) || (e->movedir[2] == 1.))
return false;
// Shift psuedo laser towards monster's current position up to
// the total distance he's proposing moving.
delta = min(16,dist);
VectorCopy(move,dir);
VectorNormalize(dir);
while(delta < dist+15.875)
{
if(delta > dist) delta = dist;
VectorMA(e->s.origin, -delta,dir,laser_start);
VectorMA(e->s.old_origin,-delta,dir,laser_end);
laser_trace = gi.trace(laser_start,NULL,NULL,laser_end,world,CONTENTS_SOLID|CONTENTS_MONSTER);
if(laser_trace.ent == ent)
return false;
delta += 16;
}
}
}
if ((trace.fraction == 1) && !jump && canjump && (ent->monsterinfo.jumpdn > 0))
{
end[2] = oldorg[2] + move[2] - ent->monsterinfo.jumpdn;
trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID | MASK_WATER);
if(trace.fraction < 1 && (trace.plane.normal[2] > 0.9) && (trace.contents & MASK_SOLID) && (neworg[2] - 16 > trace.endpos[2]))
{
if(!trace.ent || (!trace.ent->client && !(trace.ent->svflags & SVF_MONSTER) && !(trace.ent->svflags & SVF_DEADMONSTER)))
jump = -1;
}
}
if ((trace.fraction == 1) && !jump)
{
// if monster had the ground pulled out, go ahead and fall
if ( ent->flags & FL_PARTIALGROUND )
{
VectorAdd (ent->s.origin, move, ent->s.origin);
if (relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
ent->groundentity = NULL;
return true;
}
return false; // walked off an edge
}
// check point traces down for dangling corners
VectorCopy (trace.endpos, ent->s.origin);
if(!jump)
{
bool skip = false;
// if monster CAN jump down, and a position just a bit forward would be
// a good jump-down spot, allow (briefly) !M_CheckBottom
if (canjump && target && (target->s.origin[2] < ent->s.origin[2]) && (ent->monsterinfo.jumpdn > 0))
{
vec3_t p1, p2;
trace_t tr;
VectorMA(oldorg,48,forward,p1);
tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, p1, ent, MASK_MONSTERSOLID);
if(tr.fraction == 1)
{
p2[0] = p1[0];
p2[1] = p1[1];
p2[2] = p1[2] - ent->monsterinfo.jumpdn;
tr = gi.trace(p1,ent->mins,ent->maxs,p2,ent,MASK_MONSTERSOLID | MASK_WATER);
if(tr.fraction < 1 && (tr.plane.normal[2] > 0.9) && (tr.contents & MASK_SOLID) && (p1[2] - 16 > tr.endpos[2]))
{
if(!tr.ent || (!tr.ent->client && !(tr.ent->svflags & SVF_MONSTER) && !(tr.ent->svflags & SVF_DEADMONSTER)))
{
VectorSubtract(target->s.origin, tr.endpos, dir);
d2 = VectorLength(dir);
if(d2 < d1)
skip = true;
}
}
}
}
if (!skip)
{
if (!M_CheckBottom (ent))
{
if ( ent->flags & FL_PARTIALGROUND )
{ // entity had floor mostly pulled out from underneath it
// and is trying to correct
if (relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
return true;
}
VectorCopy (oldorg, ent->s.origin);
return false;
}
}
}
if ( ent->flags & FL_PARTIALGROUND )
{
ent->flags &= ~FL_PARTIALGROUND;
}
ent->groundentity = trace.ent;
if(trace.ent)
ent->groundentity_linkcount = trace.ent->linkcount;
// the move is ok
if(jump)
{
VectorScale(move, 10, ent->velocity);
if(jump > 0)
{
ent->monsterinfo.jump(ent);
ent->velocity[2] = 2.5*jumpheight + 80;
}
else
{
ent->velocity[2] = max(ent->velocity[2],100);
if(oldorg[2] - ent->s.origin[2] > 48)
ent->s.origin[2] = oldorg[2] + ent->velocity[2]*FRAMETIME;
}
if(relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
}
else if (relink)
{
gi.linkentity (ent);
G_TouchTriggers (ent);
}
return true;
}
//============================================================================
/*
===============
M_ChangeYaw
===============
*/
void M_ChangeYaw (edict_t *ent)
{
float ideal;
float current;
float move;
float speed;
current = anglemod(ent->s.angles[YAW]);
ideal = ent->ideal_yaw;
if (current == ideal)
return;
move = ideal - current;
speed = ent->yaw_speed;
if (ideal > current)
{
if (move >= 180)
move = move - 360;
}
else
{
if (move <= -180)
move = move + 360;
}
if (move > 0)
{
if (move > speed)
move = speed;
}
else
{
if (move < -speed)
move = -speed;
}
ent->s.angles[YAW] = anglemod (current + move);
}
/*
======================
SV_StepDirection
Turns to the movement direction, and walks the current distance if
facing it.
======================
*/
bool SV_StepDirection (edict_t *ent, float yaw, float dist)
{
vec3_t move, oldorigin;
float delta;
ent->ideal_yaw = yaw;
M_ChangeYaw (ent);
yaw = yaw*M_PI*2 / 360;
move[0] = cos(yaw)*dist;
move[1] = sin(yaw)*dist;
move[2] = 0;
VectorCopy (ent->s.origin, oldorigin);
if (SV_movestep (ent, move, false))
{
delta = ent->s.angles[YAW] - ent->ideal_yaw;
if (delta > 45 && delta < 315)
{ // not turned far enough, so don't take the step
VectorCopy (oldorigin, ent->s.origin);
}
gi.linkentity (ent);
G_TouchTriggers (ent);
return true;
}
gi.linkentity (ent);
G_TouchTriggers (ent);
return false;
}
/*
======================
SV_FixCheckBottom
======================
*/
void SV_FixCheckBottom (edict_t *ent)
{
ent->flags |= FL_PARTIALGROUND;
}
/*
================
SV_NewChaseDir
================
*/
#define DI_NODIR -1
void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist)
{
float deltax,deltay;
float d[3];
float tdir, olddir, turnaround;
//FIXME: how did we get here with no enemy
if (!enemy)
return;
if(actor->flags & FL_ROBOT)
olddir = anglemod( (int)(actor->ideal_yaw+0.5) );
else
olddir = anglemod( (int)(actor->ideal_yaw/45)*45 );
turnaround = anglemod(olddir - 180);
deltax = enemy->s.origin[0] - actor->s.origin[0];
deltay = enemy->s.origin[1] - actor->s.origin[1];
if(actor->flags & FL_ROBOT)
{
d[1] = d[2] = olddir;
}
else
{
if (deltax>10)
d[1]= 0;
else if (deltax<-10)
d[1]= 180;
else
d[1]= DI_NODIR;
if (deltay<-10)
d[2]= 270;
else if (deltay>10)
d[2]= 90;
else
d[2]= DI_NODIR;
}
// try direct route
if (d[1] != DI_NODIR && d[2] != DI_NODIR)
{
if(actor->flags & FL_ROBOT)
tdir = d[1];
else
{
if (d[1] == 0)
tdir = d[2] == 90 ? 45 : 315;
else
tdir = d[2] == 90 ? 135 : 215;
}
if (tdir != turnaround && SV_StepDirection(actor, tdir, dist))
return;
}
// Robots give up if direct path doesn't work
if(actor->flags & FL_ROBOT)
{
actor->ideal_yaw = olddir; // can't move
if (!M_CheckBottom (actor))
SV_FixCheckBottom (actor);
}
// try other directions
if ( ((rand()&3) & 1) || abs(deltay)>abs(deltax))
{
tdir=d[1];
d[1]=d[2];
d[2]=tdir;
}
if (d[1]!=DI_NODIR && d[1]!=turnaround
&& SV_StepDirection(actor, d[1], dist))
return;
if (d[2]!=DI_NODIR && d[2]!=turnaround
&& SV_StepDirection(actor, d[2], dist))
return;
//ROGUE
if(actor->monsterinfo.blocked)
{
if ((actor->inuse) && (actor->health > 0))
{
if((actor->monsterinfo.blocked)(actor, dist))
return;
}
}
//ROGUE
/* there is no direct path to the player, so pick another direction */
if (olddir!=DI_NODIR && SV_StepDirection(actor, olddir, dist))
return;
if (rand()&1) /*randomly determine direction of search*/
{
for (tdir=0 ; tdir<=315 ; tdir += 45)
if (tdir!=turnaround && SV_StepDirection(actor, tdir, dist) )
return;
}
else
{
for (tdir=315 ; tdir >=0 ; tdir -= 45)
if (tdir!=turnaround && SV_StepDirection(actor, tdir, dist) )
return;
}
if (turnaround != DI_NODIR && SV_StepDirection(actor, turnaround, dist) )
return;
actor->ideal_yaw = olddir; // can't move
// if a bridge was pulled out from underneath a monster, it may not have
// a valid standing position at all
if (!M_CheckBottom (actor))
SV_FixCheckBottom (actor);
}
/*
======================
SV_CloseEnough
======================
*/
bool SV_CloseEnough (edict_t *ent, edict_t *goal, float dist)
{
int i;
for (i=0 ; i<3 ; i++)
{
if (goal->absmin[i] > ent->absmax[i] + dist)
return false;
if (goal->absmax[i] < ent->absmin[i] - dist)
return false;
}
return true;
}
/*
======================
M_MoveToGoal
======================
*/
mmove_t actor_move_run;
mmove_t actor_move_stand;
mmove_t actor_move_walk;
void M_MoveToGoal (edict_t *ent, float dist)
{
edict_t *goal;
goal = ent->goalentity;
if (!ent->groundentity && !(ent->flags & (FL_FLY|FL_SWIM)))
return;
// Lazarus range checks
if (!(ent->monsterinfo.aiflags & (AI_CHASE_THING | AI_CHICKEN)))
{
if (ent->enemy && (ent->monsterinfo.min_range > 0) && ((goal==ent->enemy) || !goal) ) {
float dist;
dist = realrange(ent,ent->enemy);
if(dist < ent->monsterinfo.min_range)
{
ent->monsterinfo.aiflags |= (AI_STAND_GROUND | AI_RANGE_PAUSE);
ent->monsterinfo.rangetime = level.time + 0.5;
ent->monsterinfo.stand(ent);
return;
}
}
if ((ent->enemy) && (level.time > ent->monsterinfo.rangetime + 0.5) && ((goal==ent->enemy) || !goal) )
{
float dist;
dist = realrange(ent,ent->enemy);
if((dist < ent->monsterinfo.ideal_range[0]) && (rand() & 3))
{
ent->monsterinfo.aiflags |= (AI_STAND_GROUND | AI_RANGE_PAUSE);
ent->monsterinfo.rangetime = level.time + 1.0;
ent->monsterinfo.stand(ent);
return;
}
if((dist < ent->monsterinfo.ideal_range[1]) && (dist > ent->monsterinfo.ideal_range[0]) && (rand() & 1))
{
ent->monsterinfo.aiflags |= (AI_STAND_GROUND | AI_RANGE_PAUSE);
ent->monsterinfo.rangetime = level.time + 0.2;
ent->monsterinfo.stand(ent);
return;
}
}
}
if( (ent->monsterinfo.aiflags & AI_FOLLOW_LEADER) &&
(ent->movetarget) &&
(ent->movetarget->inuse) &&
(ent->movetarget->health > 0) ) {
if(ent->enemy)
ent->monsterinfo.currentmove = &actor_move_run;
else
{
float R;
R = realrange(ent,ent->movetarget);
if(R > ACTOR_FOLLOW_RUN_RANGE)
ent->monsterinfo.currentmove = &actor_move_run;
else if(R < ACTOR_FOLLOW_STAND_RANGE && ent->movetarget->client) {
ent->monsterinfo.pausetime = level.time + 0.5;
ent->monsterinfo.currentmove = &actor_move_stand;
return;
}
else
ent->monsterinfo.currentmove = &actor_move_walk;
}
}
// If the next step hits the enemy, return immediately. Don't do this for
// AI_CHASE_THING, since we want monster to actually touch or pass through
// "thing"
if (ent->enemy && !(ent->monsterinfo.aiflags & AI_CHASE_THING) && SV_CloseEnough (ent, ent->enemy, dist) )
return;
// bump around...
if ( (rand()&3)==1 || !SV_StepDirection (ent, ent->ideal_yaw, dist))
{
if (ent->inuse)
SV_NewChaseDir (ent, goal, dist);
}
}
/*
===============
M_walkmove
===============
*/
bool M_walkmove (edict_t *ent, float yaw, float dist)
{
vec3_t move;
if (!ent->groundentity && !(ent->flags & (FL_FLY|FL_SWIM)))
return false;
yaw = yaw*M_PI*2 / 360;
move[0] = cos(yaw)*dist;
move[1] = sin(yaw)*dist;
move[2] = 0;
return SV_movestep(ent, move, true);
}

View File

@ -1,719 +0,0 @@
/*
==============================================================================
mutant
==============================================================================
*/
#include "g_local.h"
#include "m_mutant.h"
static int sound_swing;
static int sound_hit;
static int sound_hit2;
static int sound_death;
static int sound_idle;
static int sound_pain1;
static int sound_pain2;
static int sound_sight;
static int sound_search;
static int sound_step1;
static int sound_step2;
static int sound_step3;
static int sound_thud;
//
// SOUNDS
//
void mutant_step (edict_t *self)
{
int n;
n = (rand() + 1) % 3;
if (n == 0)
gi.sound (self, CHAN_VOICE, sound_step1, 1, ATTN_NORM, 0);
else if (n == 1)
gi.sound (self, CHAN_VOICE, sound_step2, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_step3, 1, ATTN_NORM, 0);
}
void mutant_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void mutant_search (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
void mutant_swing (edict_t *self)
{
gi.sound (self, CHAN_VOICE, sound_swing, 1, ATTN_NORM, 0);
}
//
// STAND
//
mframe_t mutant_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 10
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 20
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 30
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 40
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // 50
ai_stand, 0, NULL
};
mmove_t mutant_move_stand = {FRAME_stand101, FRAME_stand151, mutant_frames_stand, NULL};
void mutant_stand (edict_t *self)
{
self->monsterinfo.currentmove = &mutant_move_stand;
}
//
// IDLE
//
void mutant_idle_loop (edict_t *self)
{
if (random() < 0.75)
self->monsterinfo.nextframe = FRAME_stand155;
}
mframe_t mutant_frames_idle [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL, // scratch loop start
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, mutant_idle_loop, // scratch loop end
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t mutant_move_idle = {FRAME_stand152, FRAME_stand164, mutant_frames_idle, mutant_stand};
void mutant_idle (edict_t *self)
{
self->monsterinfo.currentmove = &mutant_move_idle;
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
//
// WALK
//
void mutant_walk (edict_t *self);
mframe_t mutant_frames_walk [] =
{
ai_walk, 3, NULL,
ai_walk, 1, NULL,
ai_walk, 5, NULL,
ai_walk, 10, NULL,
ai_walk, 13, NULL,
ai_walk, 10, NULL,
ai_walk, 0, NULL,
ai_walk, 5, NULL,
ai_walk, 6, NULL,
ai_walk, 16, NULL,
ai_walk, 15, NULL,
ai_walk, 6, NULL
};
mmove_t mutant_move_walk = {FRAME_walk05, FRAME_walk16, mutant_frames_walk, NULL};
void mutant_walk_loop (edict_t *self)
{
self->monsterinfo.currentmove = &mutant_move_walk;
}
mframe_t mutant_frames_start_walk [] =
{
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, -2, NULL,
ai_walk, 1, NULL
};
mmove_t mutant_move_start_walk = {FRAME_walk01, FRAME_walk04, mutant_frames_start_walk, mutant_walk_loop};
void mutant_walk (edict_t *self)
{
self->monsterinfo.currentmove = &mutant_move_start_walk;
}
//
// RUN
//
mframe_t mutant_frames_run [] =
{
ai_run, 40, NULL,
ai_run, 40, mutant_step,
ai_run, 24, NULL,
ai_run, 5, mutant_step,
ai_run, 17, NULL,
ai_run, 10, NULL
};
mmove_t mutant_move_run = {FRAME_run03, FRAME_run08, mutant_frames_run, NULL};
void mutant_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &mutant_move_stand;
else
self->monsterinfo.currentmove = &mutant_move_run;
}
//
// MELEE
//
void mutant_hit_left (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->mins[0], 8);
if (fire_hit (self, aim, (10 + (rand() %5)), 100))
gi.sound (self, CHAN_WEAPON, sound_hit, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_WEAPON, sound_swing, 1, ATTN_NORM, 0);
}
void mutant_hit_right (edict_t *self)
{
vec3_t aim;
VectorSet (aim, MELEE_DISTANCE, self->maxs[0], 8);
if (fire_hit (self, aim, (10 + (rand() %5)), 100))
gi.sound (self, CHAN_WEAPON, sound_hit2, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_WEAPON, sound_swing, 1, ATTN_NORM, 0);
}
void mutant_check_refire (edict_t *self)
{
if (!self->enemy || !self->enemy->inuse || self->enemy->health <= 0)
return;
if ( ((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE) )
self->monsterinfo.nextframe = FRAME_attack09;
}
mframe_t mutant_frames_attack [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, mutant_hit_left,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, mutant_hit_right,
ai_charge, 0, mutant_check_refire
};
mmove_t mutant_move_attack = {FRAME_attack09, FRAME_attack15, mutant_frames_attack, mutant_run};
void mutant_melee (edict_t *self)
{
self->monsterinfo.currentmove = &mutant_move_attack;
}
//
// ATTACK
//
void mutant_jump_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
if (self->health <= 0)
{
self->touch = NULL;
return;
}
if (other->takedamage)
{
if (VectorLength(self->velocity) > 400)
{
vec3_t point;
vec3_t normal;
int damage;
VectorCopy (self->velocity, normal);
VectorNormalize(normal);
VectorMA (self->s.origin, self->maxs[0], normal, point);
damage = 40 + 10 * random();
T_Damage (other, self, self, self->velocity, point, normal, damage, damage, 0, MOD_UNKNOWN);
}
}
if (!M_CheckBottom (self))
{
if (self->groundentity)
{
self->monsterinfo.nextframe = FRAME_attack02;
self->touch = NULL;
}
return;
}
self->touch = NULL;
}
void mutant_jump_takeoff (edict_t *self)
{
vec3_t forward;
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
AngleVectors (self->s.angles, forward, NULL, NULL);
self->s.origin[2] += 1;
VectorScale (forward, 600, self->velocity);
self->velocity[2] = 250;
self->groundentity = NULL;
self->monsterinfo.aiflags |= AI_DUCKED;
self->monsterinfo.attack_finished = level.time + 3;
self->touch = mutant_jump_touch;
}
void mutant_check_landing (edict_t *self)
{
if (self->groundentity)
{
gi.sound (self, CHAN_WEAPON, sound_thud, 1, ATTN_NORM, 0);
self->monsterinfo.attack_finished = 0;
self->monsterinfo.aiflags &= ~AI_DUCKED;
return;
}
if (level.time > self->monsterinfo.attack_finished)
self->monsterinfo.nextframe = FRAME_attack02;
else
self->monsterinfo.nextframe = FRAME_attack05;
}
mframe_t mutant_frames_jump [] =
{
ai_charge, 0, NULL,
ai_charge, 17, NULL,
ai_charge, 15, mutant_jump_takeoff,
ai_charge, 15, NULL,
ai_charge, 15, mutant_check_landing,
ai_charge, 0, NULL,
ai_charge, 3, NULL,
ai_charge, 0, NULL
};
mmove_t mutant_move_jump = {FRAME_attack01, FRAME_attack08, mutant_frames_jump, mutant_run};
void mutant_jump (edict_t *self)
{
self->monsterinfo.currentmove = &mutant_move_jump;
}
//
// CHECKATTACK
//
bool mutant_check_melee (edict_t *self)
{
if (range (self, self->enemy) == RANGE_MELEE)
return true;
return false;
}
bool mutant_check_jump (edict_t *self)
{
vec3_t v;
float distance;
vec_t speed=0;
if (monsterjump->value)
{
if (self->absmin[2] > (self->enemy->absmin[2] + 0.75 * self->enemy->size[2]) +
self->monsterinfo.jumpdn )
return false;
if (self->absmax[2] < (self->enemy->absmin[2] + 0.25 * self->enemy->size[2]) -
self->monsterinfo.jumpup )
return false;
if (self->absmax[2] < (self->enemy->absmin[2] + 0.25 * self->enemy->size[2]))
speed = max(self->velocity[2],200);
}
else
{
if (self->absmin[2] > (self->enemy->absmin[2] + 0.75 * self->enemy->size[2]))
return false;
if (self->absmax[2] < (self->enemy->absmin[2] + 0.25 * self->enemy->size[2]))
return false;
}
v[0] = self->s.origin[0] - self->enemy->s.origin[0];
v[1] = self->s.origin[1] - self->enemy->s.origin[1];
v[2] = 0;
distance = VectorLength(v);
if (distance < 100)
return false;
if (distance > 100)
{
if (random() < 0.9)
return false;
}
if(speed)
self->velocity[2] = speed;
return true;
}
bool mutant_checkattack (edict_t *self)
{
if (!self->enemy || self->enemy->health <= 0)
return false;
if (mutant_check_melee(self))
{
self->monsterinfo.attack_state = AS_MELEE;
return true;
}
if (mutant_check_jump(self))
{
self->monsterinfo.attack_state = AS_MISSILE;
// FIXME play a jump sound here
return true;
}
return false;
}
//
// PAIN
//
mframe_t mutant_frames_pain1 [] =
{
ai_move, 4, NULL,
ai_move, -3, NULL,
ai_move, -8, NULL,
ai_move, 2, NULL,
ai_move, 5, NULL
};
mmove_t mutant_move_pain1 = {FRAME_pain101, FRAME_pain105, mutant_frames_pain1, mutant_run};
mframe_t mutant_frames_pain2 [] =
{
ai_move, -24,NULL,
ai_move, 11, NULL,
ai_move, 5, NULL,
ai_move, -2, NULL,
ai_move, 6, NULL,
ai_move, 4, NULL
};
mmove_t mutant_move_pain2 = {FRAME_pain201, FRAME_pain206, mutant_frames_pain2, mutant_run};
mframe_t mutant_frames_pain3 [] =
{
ai_move, -22,NULL,
ai_move, 3, NULL,
ai_move, 3, NULL,
ai_move, 2, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, 6, NULL,
ai_move, 3, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 1, NULL
};
mmove_t mutant_move_pain3 = {FRAME_pain301, FRAME_pain311, mutant_frames_pain3, mutant_run};
void mutant_pain (edict_t *self, edict_t *other, float kick, int damage)
{
float r;
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
r = random();
if (r < 0.33)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &mutant_move_pain1;
}
else if (r < 0.66)
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &mutant_move_pain2;
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &mutant_move_pain3;
}
}
//
// DEATH
//
void mutant_dead (edict_t *self)
{
// Lazarus: Stupid... if flies aren't set by M_FlyCheck, monster_think
// will cause us to come back here over and over and over
// until flies ARE set or monster is gibbed.
// This line fixes that:
self->nextthink = 0;
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t mutant_frames_death1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t mutant_move_death1 = {FRAME_death101, FRAME_death109, mutant_frames_death1, mutant_dead};
mframe_t mutant_frames_death2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t mutant_move_death2 = {FRAME_death201, FRAME_death210, mutant_frames_death2, mutant_dead};
void mutant_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->s.skin = 1;
if (random() < 0.5)
self->monsterinfo.currentmove = &mutant_move_death1;
else
self->monsterinfo.currentmove = &mutant_move_death2;
}
mframe_t mutant_frames_fake_jump [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t mutant_move_fake_jump = {FRAME_run03, FRAME_run08, mutant_frames_fake_jump, mutant_run};
void mutant_fake_jump (edict_t *self)
{
self->monsterinfo.currentmove = &mutant_move_fake_jump;
}
//
// SPAWN
//
/*QUAKED monster_mutant (1 .5 0) (-32 -32 -24) (32 32 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_mutant (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_MUTANT;
self->spawnflags |= SF_MONSTER_KNOWS_MIRRORS;
sound_swing = gi.soundindex ("mutant/mutatck1.wav");
sound_hit = gi.soundindex ("mutant/mutatck2.wav");
sound_hit2 = gi.soundindex ("mutant/mutatck3.wav");
sound_death = gi.soundindex ("mutant/mutdeth1.wav");
sound_idle = gi.soundindex ("mutant/mutidle1.wav");
sound_pain1 = gi.soundindex ("mutant/mutpain1.wav");
sound_pain2 = gi.soundindex ("mutant/mutpain2.wav");
sound_sight = gi.soundindex ("mutant/mutsght1.wav");
sound_search = gi.soundindex ("mutant/mutsrch1.wav");
sound_step1 = gi.soundindex ("mutant/step1.wav");
sound_step2 = gi.soundindex ("mutant/step2.wav");
sound_step3 = gi.soundindex ("mutant/step3.wav");
sound_thud = gi.soundindex ("mutant/thud1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/mutant/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/mutant/tris.md2");
VectorSet (self->mins, -32, -32, -24);
VectorSet (self->maxs, 32, 32, 48);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 300;
if(!self->gib_health)
self->gib_health = -120;
if(!self->mass)
self->mass = 300;
self->pain = mutant_pain;
self->die = mutant_die;
self->monsterinfo.stand = mutant_stand;
self->monsterinfo.walk = mutant_walk;
self->monsterinfo.run = mutant_run;
self->monsterinfo.dodge = NULL;
self->monsterinfo.attack = mutant_jump;
self->monsterinfo.melee = mutant_melee;
self->monsterinfo.sight = mutant_sight;
self->monsterinfo.search = mutant_search;
self->monsterinfo.idle = mutant_idle;
self->monsterinfo.checkattack = mutant_checkattack;
if(monsterjump->value)
{
self->monsterinfo.jump = mutant_fake_jump;
self->monsterinfo.jumpup = 96;
self->monsterinfo.jumpdn = 160;
}
gi.linkentity (self);
self->monsterinfo.currentmove = &mutant_move_stand;
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.90;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&mutant_move_death1,
&mutant_move_death2,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->common_name = "Mutant";
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start (self);
}

View File

@ -1,155 +0,0 @@
// G:\quake2\baseq2\models/monsters/mutant
// This file generated by ModelGen - Do NOT Modify
#define FRAME_attack01 0
#define FRAME_attack02 1
#define FRAME_attack03 2
#define FRAME_attack04 3
#define FRAME_attack05 4
#define FRAME_attack06 5
#define FRAME_attack07 6
#define FRAME_attack08 7
#define FRAME_attack09 8
#define FRAME_attack10 9
#define FRAME_attack11 10
#define FRAME_attack12 11
#define FRAME_attack13 12
#define FRAME_attack14 13
#define FRAME_attack15 14
#define FRAME_death101 15
#define FRAME_death102 16
#define FRAME_death103 17
#define FRAME_death104 18
#define FRAME_death105 19
#define FRAME_death106 20
#define FRAME_death107 21
#define FRAME_death108 22
#define FRAME_death109 23
#define FRAME_death201 24
#define FRAME_death202 25
#define FRAME_death203 26
#define FRAME_death204 27
#define FRAME_death205 28
#define FRAME_death206 29
#define FRAME_death207 30
#define FRAME_death208 31
#define FRAME_death209 32
#define FRAME_death210 33
#define FRAME_pain101 34
#define FRAME_pain102 35
#define FRAME_pain103 36
#define FRAME_pain104 37
#define FRAME_pain105 38
#define FRAME_pain201 39
#define FRAME_pain202 40
#define FRAME_pain203 41
#define FRAME_pain204 42
#define FRAME_pain205 43
#define FRAME_pain206 44
#define FRAME_pain301 45
#define FRAME_pain302 46
#define FRAME_pain303 47
#define FRAME_pain304 48
#define FRAME_pain305 49
#define FRAME_pain306 50
#define FRAME_pain307 51
#define FRAME_pain308 52
#define FRAME_pain309 53
#define FRAME_pain310 54
#define FRAME_pain311 55
#define FRAME_run03 56
#define FRAME_run04 57
#define FRAME_run05 58
#define FRAME_run06 59
#define FRAME_run07 60
#define FRAME_run08 61
#define FRAME_stand101 62
#define FRAME_stand102 63
#define FRAME_stand103 64
#define FRAME_stand104 65
#define FRAME_stand105 66
#define FRAME_stand106 67
#define FRAME_stand107 68
#define FRAME_stand108 69
#define FRAME_stand109 70
#define FRAME_stand110 71
#define FRAME_stand111 72
#define FRAME_stand112 73
#define FRAME_stand113 74
#define FRAME_stand114 75
#define FRAME_stand115 76
#define FRAME_stand116 77
#define FRAME_stand117 78
#define FRAME_stand118 79
#define FRAME_stand119 80
#define FRAME_stand120 81
#define FRAME_stand121 82
#define FRAME_stand122 83
#define FRAME_stand123 84
#define FRAME_stand124 85
#define FRAME_stand125 86
#define FRAME_stand126 87
#define FRAME_stand127 88
#define FRAME_stand128 89
#define FRAME_stand129 90
#define FRAME_stand130 91
#define FRAME_stand131 92
#define FRAME_stand132 93
#define FRAME_stand133 94
#define FRAME_stand134 95
#define FRAME_stand135 96
#define FRAME_stand136 97
#define FRAME_stand137 98
#define FRAME_stand138 99
#define FRAME_stand139 100
#define FRAME_stand140 101
#define FRAME_stand141 102
#define FRAME_stand142 103
#define FRAME_stand143 104
#define FRAME_stand144 105
#define FRAME_stand145 106
#define FRAME_stand146 107
#define FRAME_stand147 108
#define FRAME_stand148 109
#define FRAME_stand149 110
#define FRAME_stand150 111
#define FRAME_stand151 112
#define FRAME_stand152 113
#define FRAME_stand153 114
#define FRAME_stand154 115
#define FRAME_stand155 116
#define FRAME_stand156 117
#define FRAME_stand157 118
#define FRAME_stand158 119
#define FRAME_stand159 120
#define FRAME_stand160 121
#define FRAME_stand161 122
#define FRAME_stand162 123
#define FRAME_stand163 124
#define FRAME_stand164 125
#define FRAME_walk01 126
#define FRAME_walk02 127
#define FRAME_walk03 128
#define FRAME_walk04 129
#define FRAME_walk05 130
#define FRAME_walk06 131
#define FRAME_walk07 132
#define FRAME_walk08 133
#define FRAME_walk09 134
#define FRAME_walk10 135
#define FRAME_walk11 136
#define FRAME_walk12 137
#define FRAME_walk13 138
#define FRAME_walk14 139
#define FRAME_walk15 140
#define FRAME_walk16 141
#define FRAME_walk17 142
#define FRAME_walk18 143
#define FRAME_walk19 144
#define FRAME_walk20 145
#define FRAME_walk21 146
#define FRAME_walk22 147
#define FRAME_walk23 148
#define MODEL_SCALE 1.000000

View File

@ -1,600 +0,0 @@
/*
==============================================================================
parasite
==============================================================================
*/
#include "g_local.h"
#include "m_parasite.h"
static int sound_pain1;
static int sound_pain2;
static int sound_die;
static int sound_launch;
static int sound_impact;
static int sound_suck;
static int sound_reelin;
static int sound_sight;
static int sound_tap;
static int sound_scratch;
static int sound_search;
void parasite_stand (edict_t *self);
void parasite_start_run (edict_t *self);
void parasite_run (edict_t *self);
void parasite_walk (edict_t *self);
void parasite_start_walk (edict_t *self);
void parasite_end_fidget (edict_t *self);
void parasite_do_fidget (edict_t *self);
void parasite_refidget (edict_t *self);
void parasite_launch (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_launch, 1, ATTN_NORM, 0);
}
void parasite_reel_in (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_reelin, 1, ATTN_NORM, 0);
}
void parasite_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_WEAPON, sound_sight, 1, ATTN_NORM, 0);
}
void parasite_tap (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_tap, 1, ATTN_IDLE, 0);
}
void parasite_scratch (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_scratch, 1, ATTN_IDLE, 0);
}
void parasite_search (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_search, 1, ATTN_IDLE, 0);
}
mframe_t parasite_frames_start_fidget [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t parasite_move_start_fidget = {FRAME_stand18, FRAME_stand21, parasite_frames_start_fidget, parasite_do_fidget};
mframe_t parasite_frames_fidget [] =
{
ai_stand, 0, parasite_scratch,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, parasite_scratch,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t parasite_move_fidget = {FRAME_stand22, FRAME_stand27, parasite_frames_fidget, parasite_refidget};
mframe_t parasite_frames_end_fidget [] =
{
ai_stand, 0, parasite_scratch,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t parasite_move_end_fidget = {FRAME_stand28, FRAME_stand35, parasite_frames_end_fidget, parasite_stand};
void parasite_end_fidget (edict_t *self)
{
self->monsterinfo.currentmove = &parasite_move_end_fidget;
}
void parasite_do_fidget (edict_t *self)
{
self->monsterinfo.currentmove = &parasite_move_fidget;
}
void parasite_refidget (edict_t *self)
{
if (random() <= 0.8)
self->monsterinfo.currentmove = &parasite_move_fidget;
else
self->monsterinfo.currentmove = &parasite_move_end_fidget;
}
void parasite_idle (edict_t *self)
{
self->monsterinfo.currentmove = &parasite_move_start_fidget;
}
mframe_t parasite_frames_stand [] =
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, parasite_tap,
ai_stand, 0, NULL,
ai_stand, 0, parasite_tap,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, parasite_tap,
ai_stand, 0, NULL,
ai_stand, 0, parasite_tap,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, parasite_tap,
ai_stand, 0, NULL,
ai_stand, 0, parasite_tap
};
mmove_t parasite_move_stand = {FRAME_stand01, FRAME_stand17, parasite_frames_stand, parasite_stand};
void parasite_stand (edict_t *self)
{
self->monsterinfo.currentmove = &parasite_move_stand;
}
mframe_t parasite_frames_run [] =
{
ai_run, 30, NULL,
ai_run, 30, NULL,
ai_run, 22, NULL,
ai_run, 19, NULL,
ai_run, 24, NULL,
ai_run, 28, NULL,
ai_run, 25, NULL
};
mmove_t parasite_move_run = {FRAME_run03, FRAME_run09, parasite_frames_run, NULL};
mframe_t parasite_frames_start_run [] =
{
ai_run, 0, NULL,
ai_run, 30, NULL,
};
mmove_t parasite_move_start_run = {FRAME_run01, FRAME_run02, parasite_frames_start_run, parasite_run};
mframe_t parasite_frames_stop_run [] =
{
ai_run, 20, NULL,
ai_run, 20, NULL,
ai_run, 12, NULL,
ai_run, 10, NULL,
ai_run, 0, NULL,
ai_run, 0, NULL
};
mmove_t parasite_move_stop_run = {FRAME_run10, FRAME_run15, parasite_frames_stop_run, NULL};
void parasite_start_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &parasite_move_stand;
else
self->monsterinfo.currentmove = &parasite_move_start_run;
}
void parasite_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &parasite_move_stand;
else
self->monsterinfo.currentmove = &parasite_move_run;
}
mframe_t parasite_frames_walk [] =
{
ai_walk, 30, NULL,
ai_walk, 30, NULL,
ai_walk, 22, NULL,
ai_walk, 19, NULL,
ai_walk, 24, NULL,
ai_walk, 28, NULL,
ai_walk, 25, NULL
};
mmove_t parasite_move_walk = {FRAME_run03, FRAME_run09, parasite_frames_walk, parasite_walk};
mframe_t parasite_frames_start_walk [] =
{
ai_walk, 0, NULL,
ai_walk, 30, parasite_walk
};
mmove_t parasite_move_start_walk = {FRAME_run01, FRAME_run02, parasite_frames_start_walk, NULL};
mframe_t parasite_frames_stop_walk [] =
{
ai_walk, 20, NULL,
ai_walk, 20, NULL,
ai_walk, 12, NULL,
ai_walk, 10, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL
};
mmove_t parasite_move_stop_walk = {FRAME_run10, FRAME_run15, parasite_frames_stop_walk, NULL};
void parasite_start_walk (edict_t *self)
{
self->monsterinfo.currentmove = &parasite_move_start_walk;
}
void parasite_walk (edict_t *self)
{
self->monsterinfo.currentmove = &parasite_move_walk;
}
mframe_t parasite_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 6, NULL,
ai_move, 16, NULL,
ai_move, -6, NULL,
ai_move, -7, NULL,
ai_move, 0, NULL
};
mmove_t parasite_move_pain1 = {FRAME_pain101, FRAME_pain111, parasite_frames_pain1, parasite_start_run};
void parasite_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
if (random() < 0.5)
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
self->monsterinfo.currentmove = &parasite_move_pain1;
}
//static bool parasite_drain_attack_ok (vec3_t start, vec3_t end)
bool parasite_drain_attack_ok (vec3_t start, vec3_t end)
{
vec3_t dir, angles;
// check for max distance
VectorSubtract (start, end, dir);
if (VectorLength(dir) > 256)
return false;
// check for min/max pitch
vectoangles (dir, angles);
if (angles[0] < -180)
angles[0] += 360;
if (fabs(angles[0]) > 30)
return false;
return true;
}
void parasite_drain_attack (edict_t *self)
{
vec3_t offset, start, f, r, end, dir;
trace_t tr;
int damage;
AngleVectors (self->s.angles, f, r, NULL);
VectorSet (offset, 24, 0, 6);
G_ProjectSource (self->s.origin, offset, f, r, start);
VectorCopy (self->enemy->s.origin, end);
if (!parasite_drain_attack_ok(start, end))
{
end[2] = self->enemy->s.origin[2] + self->enemy->maxs[2] - 8;
if (!parasite_drain_attack_ok(start, end))
{
end[2] = self->enemy->s.origin[2] + self->enemy->mins[2] + 8;
if (!parasite_drain_attack_ok(start, end))
return;
}
}
VectorCopy (self->enemy->s.origin, end);
// Lazarus: Original code can foul up if parasite is near and facing a solid.
// "start" may be embedded in the solid, since it is outside the parasite's
// bbox. In this case cable will appear to go through a solid.
// tr = gi.trace (start, NULL, NULL, end, self, MASK_SHOT);
VectorCopy (self->s.origin,offset);
offset[2] += 6;
tr = gi.trace (offset, NULL, NULL, end, self, MASK_SHOT);
// end Lazarus fix
if (tr.ent != self->enemy)
return;
if (self->s.frame == FRAME_drain03)
{
damage = 5;
gi.sound (self->enemy, CHAN_AUTO, sound_impact, 1, ATTN_NORM, 0);
}
else
{
if (self->s.frame == FRAME_drain04)
gi.sound (self, CHAN_WEAPON, sound_suck, 1, ATTN_NORM, 0);
damage = 2;
}
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (TE_PARASITE_ATTACK);
WRITE_SHORT (self - g_edicts);
WRITE_COORD (start);
WRITE_COORD (end);
MESSAGE_SEND (MSG_PVS, self->s.origin, NULL);
VectorSubtract (start, end, dir);
T_Damage (self->enemy, self, self, dir, self->enemy->s.origin, vec3_origin, damage, 0, DAMAGE_NO_KNOCKBACK, MOD_UNKNOWN);
}
mframe_t parasite_frames_drain [] =
{
ai_charge, 0, parasite_launch,
ai_charge, 0, NULL,
ai_charge, 15, parasite_drain_attack, // Target hits
ai_charge, 0, parasite_drain_attack, // drain
ai_charge, 0, parasite_drain_attack, // drain
ai_charge, 0, parasite_drain_attack, // drain
ai_charge, 0, parasite_drain_attack, // drain
ai_charge, -2, parasite_drain_attack, // drain
ai_charge, -2, parasite_drain_attack, // drain
ai_charge, -3, parasite_drain_attack, // drain
ai_charge, -2, parasite_drain_attack, // drain
ai_charge, 0, parasite_drain_attack, // drain
ai_charge, -1, parasite_drain_attack, // drain
ai_charge, 0, parasite_reel_in, // let go
ai_charge, -2, NULL,
ai_charge, -2, NULL,
ai_charge, -3, NULL,
ai_charge, 0, NULL
};
mmove_t parasite_move_drain = {FRAME_drain01, FRAME_drain18, parasite_frames_drain, parasite_start_run};
mframe_t parasite_frames_break [] =
{
ai_charge, 0, NULL,
ai_charge, -3, NULL,
ai_charge, 1, NULL,
ai_charge, 2, NULL,
ai_charge, -3, NULL,
ai_charge, 1, NULL,
ai_charge, 1, NULL,
ai_charge, 3, NULL,
ai_charge, 0, NULL,
ai_charge, -18, NULL,
ai_charge, 3, NULL,
ai_charge, 9, NULL,
ai_charge, 6, NULL,
ai_charge, 0, NULL,
ai_charge, -18, NULL,
ai_charge, 0, NULL,
ai_charge, 8, NULL,
ai_charge, 9, NULL,
ai_charge, 0, NULL,
ai_charge, -18, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL, // airborne
ai_charge, 0, NULL, // airborne
ai_charge, 0, NULL, // slides
ai_charge, 0, NULL, // slides
ai_charge, 0, NULL, // slides
ai_charge, 0, NULL, // slides
ai_charge, 4, NULL,
ai_charge, 11, NULL,
ai_charge, -2, NULL,
ai_charge, -5, NULL,
ai_charge, 1, NULL
};
mmove_t parasite_move_break = {FRAME_break01, FRAME_break32, parasite_frames_break, parasite_start_run};
/*
===
Break Stuff Ends
===
*/
void parasite_attack (edict_t *self)
{
// if (random() <= 0.2)
// self->monsterinfo.currentmove = &parasite_move_break;
// else
self->monsterinfo.currentmove = &parasite_move_drain;
}
/*
===
Death Stuff Starts
===
*/
void parasite_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t parasite_frames_death [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t parasite_move_death = {FRAME_death101, FRAME_death107, parasite_frames_death, parasite_dead};
void parasite_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->monsterinfo.currentmove = &parasite_move_death;
}
/*
===
End Death Stuff
===
*/
mframe_t parasite_frames_jump [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t parasite_move_jump = { FRAME_run01, FRAME_run08, parasite_frames_jump, parasite_run };
void parasite_jump (edict_t *self)
{
self->monsterinfo.currentmove = &parasite_move_jump;
}
/*QUAKED monster_parasite (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
*/
void SP_monster_parasite (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_PARASITE;
sound_pain1 = gi.soundindex ("parasite/parpain1.wav");
sound_pain2 = gi.soundindex ("parasite/parpain2.wav");
sound_die = gi.soundindex ("parasite/pardeth1.wav");
sound_launch = gi.soundindex("parasite/paratck1.wav");
sound_impact = gi.soundindex("parasite/paratck2.wav");
sound_suck = gi.soundindex("parasite/paratck3.wav");
sound_reelin = gi.soundindex("parasite/paratck4.wav");
sound_sight = gi.soundindex("parasite/parsght1.wav");
sound_tap = gi.soundindex("parasite/paridle1.wav");
sound_scratch = gi.soundindex("parasite/paridle2.wav");
sound_search = gi.soundindex("parasite/parsrch1.wav");
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/parasite/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/parasite/tris.md2");
VectorSet (self->mins, -16, -16, -24);
VectorSet (self->maxs, 16, 16, 24);
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 175;
if(!self->gib_health)
self->gib_health = -50;
if(!self->mass)
self->mass = 250;
self->pain = parasite_pain;
self->die = parasite_die;
self->monsterinfo.stand = parasite_stand;
self->monsterinfo.walk = parasite_start_walk;
self->monsterinfo.run = parasite_start_run;
self->monsterinfo.attack = parasite_attack;
self->monsterinfo.sight = parasite_sight;
self->monsterinfo.idle = parasite_idle;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.35;
if(monsterjump->value)
{
self->monsterinfo.jump = parasite_jump;
self->monsterinfo.jumpup = 32;
self->monsterinfo.jumpdn = 160;
}
gi.linkentity (self);
self->monsterinfo.currentmove = &parasite_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&parasite_move_death,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->common_name = "Parasite";
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start (self);
}

View File

@ -1,124 +0,0 @@
// G:\quake2\baseq2\models/monsters/parasite
// This file generated by ModelGen - Do NOT Modify
#define FRAME_break01 0
#define FRAME_break02 1
#define FRAME_break03 2
#define FRAME_break04 3
#define FRAME_break05 4
#define FRAME_break06 5
#define FRAME_break07 6
#define FRAME_break08 7
#define FRAME_break09 8
#define FRAME_break10 9
#define FRAME_break11 10
#define FRAME_break12 11
#define FRAME_break13 12
#define FRAME_break14 13
#define FRAME_break15 14
#define FRAME_break16 15
#define FRAME_break17 16
#define FRAME_break18 17
#define FRAME_break19 18
#define FRAME_break20 19
#define FRAME_break21 20
#define FRAME_break22 21
#define FRAME_break23 22
#define FRAME_break24 23
#define FRAME_break25 24
#define FRAME_break26 25
#define FRAME_break27 26
#define FRAME_break28 27
#define FRAME_break29 28
#define FRAME_break30 29
#define FRAME_break31 30
#define FRAME_break32 31
#define FRAME_death101 32
#define FRAME_death102 33
#define FRAME_death103 34
#define FRAME_death104 35
#define FRAME_death105 36
#define FRAME_death106 37
#define FRAME_death107 38
#define FRAME_drain01 39
#define FRAME_drain02 40
#define FRAME_drain03 41
#define FRAME_drain04 42
#define FRAME_drain05 43
#define FRAME_drain06 44
#define FRAME_drain07 45
#define FRAME_drain08 46
#define FRAME_drain09 47
#define FRAME_drain10 48
#define FRAME_drain11 49
#define FRAME_drain12 50
#define FRAME_drain13 51
#define FRAME_drain14 52
#define FRAME_drain15 53
#define FRAME_drain16 54
#define FRAME_drain17 55
#define FRAME_drain18 56
#define FRAME_pain101 57
#define FRAME_pain102 58
#define FRAME_pain103 59
#define FRAME_pain104 60
#define FRAME_pain105 61
#define FRAME_pain106 62
#define FRAME_pain107 63
#define FRAME_pain108 64
#define FRAME_pain109 65
#define FRAME_pain110 66
#define FRAME_pain111 67
#define FRAME_run01 68
#define FRAME_run02 69
#define FRAME_run03 70
#define FRAME_run04 71
#define FRAME_run05 72
#define FRAME_run06 73
#define FRAME_run07 74
#define FRAME_run08 75
#define FRAME_run09 76
#define FRAME_run10 77
#define FRAME_run11 78
#define FRAME_run12 79
#define FRAME_run13 80
#define FRAME_run14 81
#define FRAME_run15 82
#define FRAME_stand01 83
#define FRAME_stand02 84
#define FRAME_stand03 85
#define FRAME_stand04 86
#define FRAME_stand05 87
#define FRAME_stand06 88
#define FRAME_stand07 89
#define FRAME_stand08 90
#define FRAME_stand09 91
#define FRAME_stand10 92
#define FRAME_stand11 93
#define FRAME_stand12 94
#define FRAME_stand13 95
#define FRAME_stand14 96
#define FRAME_stand15 97
#define FRAME_stand16 98
#define FRAME_stand17 99
#define FRAME_stand18 100
#define FRAME_stand19 101
#define FRAME_stand20 102
#define FRAME_stand21 103
#define FRAME_stand22 104
#define FRAME_stand23 105
#define FRAME_stand24 106
#define FRAME_stand25 107
#define FRAME_stand26 108
#define FRAME_stand27 109
#define FRAME_stand28 110
#define FRAME_stand29 111
#define FRAME_stand30 112
#define FRAME_stand31 113
#define FRAME_stand32 114
#define FRAME_stand33 115
#define FRAME_stand34 116
#define FRAME_stand35 117
#define MODEL_SCALE 1.000000

View File

@ -1,66 +0,0 @@
// G:\quake2\baseq2\models/monsters/boss3/rider
// This file generated by ModelGen - Do NOT Modify
#define FRAME_stand201 0
#define FRAME_stand202 1
#define FRAME_stand203 2
#define FRAME_stand204 3
#define FRAME_stand205 4
#define FRAME_stand206 5
#define FRAME_stand207 6
#define FRAME_stand208 7
#define FRAME_stand209 8
#define FRAME_stand210 9
#define FRAME_stand211 10
#define FRAME_stand212 11
#define FRAME_stand213 12
#define FRAME_stand214 13
#define FRAME_stand215 14
#define FRAME_stand216 15
#define FRAME_stand217 16
#define FRAME_stand218 17
#define FRAME_stand219 18
#define FRAME_stand220 19
#define FRAME_stand221 20
#define FRAME_stand222 21
#define FRAME_stand223 22
#define FRAME_stand224 23
#define FRAME_stand225 24
#define FRAME_stand226 25
#define FRAME_stand227 26
#define FRAME_stand228 27
#define FRAME_stand229 28
#define FRAME_stand230 29
#define FRAME_stand231 30
#define FRAME_stand232 31
#define FRAME_stand233 32
#define FRAME_stand234 33
#define FRAME_stand235 34
#define FRAME_stand236 35
#define FRAME_stand237 36
#define FRAME_stand238 37
#define FRAME_stand239 38
#define FRAME_stand240 39
#define FRAME_stand241 40
#define FRAME_stand242 41
#define FRAME_stand243 42
#define FRAME_stand244 43
#define FRAME_stand245 44
#define FRAME_stand246 45
#define FRAME_stand247 46
#define FRAME_stand248 47
#define FRAME_stand249 48
#define FRAME_stand250 49
#define FRAME_stand251 50
#define FRAME_stand252 51
#define FRAME_stand253 52
#define FRAME_stand254 53
#define FRAME_stand255 54
#define FRAME_stand256 55
#define FRAME_stand257 56
#define FRAME_stand258 57
#define FRAME_stand259 58
#define FRAME_stand260 59
#define MODEL_SCALE 1.000000

File diff suppressed because it is too large Load Diff

View File

@ -1,481 +0,0 @@
// G:\quake2\baseq2\models/monsters/soldier
// This file generated by ModelGen - Do NOT Modify
#define FRAME_attak101 0
#define FRAME_attak102 1
#define FRAME_attak103 2
#define FRAME_attak104 3
#define FRAME_attak105 4
#define FRAME_attak106 5
#define FRAME_attak107 6
#define FRAME_attak108 7
#define FRAME_attak109 8
#define FRAME_attak110 9
#define FRAME_attak111 10
#define FRAME_attak112 11
#define FRAME_attak201 12
#define FRAME_attak202 13
#define FRAME_attak203 14
#define FRAME_attak204 15
#define FRAME_attak205 16
#define FRAME_attak206 17
#define FRAME_attak207 18
#define FRAME_attak208 19
#define FRAME_attak209 20
#define FRAME_attak210 21
#define FRAME_attak211 22
#define FRAME_attak212 23
#define FRAME_attak213 24
#define FRAME_attak214 25
#define FRAME_attak215 26
#define FRAME_attak216 27
#define FRAME_attak217 28
#define FRAME_attak218 29
#define FRAME_attak301 30
#define FRAME_attak302 31
#define FRAME_attak303 32
#define FRAME_attak304 33
#define FRAME_attak305 34
#define FRAME_attak306 35
#define FRAME_attak307 36
#define FRAME_attak308 37
#define FRAME_attak309 38
#define FRAME_attak401 39
#define FRAME_attak402 40
#define FRAME_attak403 41
#define FRAME_attak404 42
#define FRAME_attak405 43
#define FRAME_attak406 44
#define FRAME_duck01 45
#define FRAME_duck02 46
#define FRAME_duck03 47
#define FRAME_duck04 48
#define FRAME_duck05 49
#define FRAME_pain101 50
#define FRAME_pain102 51
#define FRAME_pain103 52
#define FRAME_pain104 53
#define FRAME_pain105 54
#define FRAME_pain201 55
#define FRAME_pain202 56
#define FRAME_pain203 57
#define FRAME_pain204 58
#define FRAME_pain205 59
#define FRAME_pain206 60
#define FRAME_pain207 61
#define FRAME_pain301 62
#define FRAME_pain302 63
#define FRAME_pain303 64
#define FRAME_pain304 65
#define FRAME_pain305 66
#define FRAME_pain306 67
#define FRAME_pain307 68
#define FRAME_pain308 69
#define FRAME_pain309 70
#define FRAME_pain310 71
#define FRAME_pain311 72
#define FRAME_pain312 73
#define FRAME_pain313 74
#define FRAME_pain314 75
#define FRAME_pain315 76
#define FRAME_pain316 77
#define FRAME_pain317 78
#define FRAME_pain318 79
#define FRAME_pain401 80
#define FRAME_pain402 81
#define FRAME_pain403 82
#define FRAME_pain404 83
#define FRAME_pain405 84
#define FRAME_pain406 85
#define FRAME_pain407 86
#define FRAME_pain408 87
#define FRAME_pain409 88
#define FRAME_pain410 89
#define FRAME_pain411 90
#define FRAME_pain412 91
#define FRAME_pain413 92
#define FRAME_pain414 93
#define FRAME_pain415 94
#define FRAME_pain416 95
#define FRAME_pain417 96
#define FRAME_run01 97
#define FRAME_run02 98
#define FRAME_run03 99
#define FRAME_run04 100
#define FRAME_run05 101
#define FRAME_run06 102
#define FRAME_run07 103
#define FRAME_run08 104
#define FRAME_run09 105
#define FRAME_run10 106
#define FRAME_run11 107
#define FRAME_run12 108
#define FRAME_runs01 109
#define FRAME_runs02 110
#define FRAME_runs03 111
#define FRAME_runs04 112
#define FRAME_runs05 113
#define FRAME_runs06 114
#define FRAME_runs07 115
#define FRAME_runs08 116
#define FRAME_runs09 117
#define FRAME_runs10 118
#define FRAME_runs11 119
#define FRAME_runs12 120
#define FRAME_runs13 121
#define FRAME_runs14 122
#define FRAME_runs15 123
#define FRAME_runs16 124
#define FRAME_runs17 125
#define FRAME_runs18 126
#define FRAME_runt01 127
#define FRAME_runt02 128
#define FRAME_runt03 129
#define FRAME_runt04 130
#define FRAME_runt05 131
#define FRAME_runt06 132
#define FRAME_runt07 133
#define FRAME_runt08 134
#define FRAME_runt09 135
#define FRAME_runt10 136
#define FRAME_runt11 137
#define FRAME_runt12 138
#define FRAME_runt13 139
#define FRAME_runt14 140
#define FRAME_runt15 141
#define FRAME_runt16 142
#define FRAME_runt17 143
#define FRAME_runt18 144
#define FRAME_runt19 145
#define FRAME_stand101 146
#define FRAME_stand102 147
#define FRAME_stand103 148
#define FRAME_stand104 149
#define FRAME_stand105 150
#define FRAME_stand106 151
#define FRAME_stand107 152
#define FRAME_stand108 153
#define FRAME_stand109 154
#define FRAME_stand110 155
#define FRAME_stand111 156
#define FRAME_stand112 157
#define FRAME_stand113 158
#define FRAME_stand114 159
#define FRAME_stand115 160
#define FRAME_stand116 161
#define FRAME_stand117 162
#define FRAME_stand118 163
#define FRAME_stand119 164
#define FRAME_stand120 165
#define FRAME_stand121 166
#define FRAME_stand122 167
#define FRAME_stand123 168
#define FRAME_stand124 169
#define FRAME_stand125 170
#define FRAME_stand126 171
#define FRAME_stand127 172
#define FRAME_stand128 173
#define FRAME_stand129 174
#define FRAME_stand130 175
#define FRAME_stand301 176
#define FRAME_stand302 177
#define FRAME_stand303 178
#define FRAME_stand304 179
#define FRAME_stand305 180
#define FRAME_stand306 181
#define FRAME_stand307 182
#define FRAME_stand308 183
#define FRAME_stand309 184
#define FRAME_stand310 185
#define FRAME_stand311 186
#define FRAME_stand312 187
#define FRAME_stand313 188
#define FRAME_stand314 189
#define FRAME_stand315 190
#define FRAME_stand316 191
#define FRAME_stand317 192
#define FRAME_stand318 193
#define FRAME_stand319 194
#define FRAME_stand320 195
#define FRAME_stand321 196
#define FRAME_stand322 197
#define FRAME_stand323 198
#define FRAME_stand324 199
#define FRAME_stand325 200
#define FRAME_stand326 201
#define FRAME_stand327 202
#define FRAME_stand328 203
#define FRAME_stand329 204
#define FRAME_stand330 205
#define FRAME_stand331 206
#define FRAME_stand332 207
#define FRAME_stand333 208
#define FRAME_stand334 209
#define FRAME_stand335 210
#define FRAME_stand336 211
#define FRAME_stand337 212
#define FRAME_stand338 213
#define FRAME_stand339 214
#define FRAME_walk101 215
#define FRAME_walk102 216
#define FRAME_walk103 217
#define FRAME_walk104 218
#define FRAME_walk105 219
#define FRAME_walk106 220
#define FRAME_walk107 221
#define FRAME_walk108 222
#define FRAME_walk109 223
#define FRAME_walk110 224
#define FRAME_walk111 225
#define FRAME_walk112 226
#define FRAME_walk113 227
#define FRAME_walk114 228
#define FRAME_walk115 229
#define FRAME_walk116 230
#define FRAME_walk117 231
#define FRAME_walk118 232
#define FRAME_walk119 233
#define FRAME_walk120 234
#define FRAME_walk121 235
#define FRAME_walk122 236
#define FRAME_walk123 237
#define FRAME_walk124 238
#define FRAME_walk125 239
#define FRAME_walk126 240
#define FRAME_walk127 241
#define FRAME_walk128 242
#define FRAME_walk129 243
#define FRAME_walk130 244
#define FRAME_walk131 245
#define FRAME_walk132 246
#define FRAME_walk133 247
#define FRAME_walk201 248
#define FRAME_walk202 249
#define FRAME_walk203 250
#define FRAME_walk204 251
#define FRAME_walk205 252
#define FRAME_walk206 253
#define FRAME_walk207 254
#define FRAME_walk208 255
#define FRAME_walk209 256
#define FRAME_walk210 257
#define FRAME_walk211 258
#define FRAME_walk212 259
#define FRAME_walk213 260
#define FRAME_walk214 261
#define FRAME_walk215 262
#define FRAME_walk216 263
#define FRAME_walk217 264
#define FRAME_walk218 265
#define FRAME_walk219 266
#define FRAME_walk220 267
#define FRAME_walk221 268
#define FRAME_walk222 269
#define FRAME_walk223 270
#define FRAME_walk224 271
#define FRAME_death101 272
#define FRAME_death102 273
#define FRAME_death103 274
#define FRAME_death104 275
#define FRAME_death105 276
#define FRAME_death106 277
#define FRAME_death107 278
#define FRAME_death108 279
#define FRAME_death109 280
#define FRAME_death110 281
#define FRAME_death111 282
#define FRAME_death112 283
#define FRAME_death113 284
#define FRAME_death114 285
#define FRAME_death115 286
#define FRAME_death116 287
#define FRAME_death117 288
#define FRAME_death118 289
#define FRAME_death119 290
#define FRAME_death120 291
#define FRAME_death121 292
#define FRAME_death122 293
#define FRAME_death123 294
#define FRAME_death124 295
#define FRAME_death125 296
#define FRAME_death126 297
#define FRAME_death127 298
#define FRAME_death128 299
#define FRAME_death129 300
#define FRAME_death130 301
#define FRAME_death131 302
#define FRAME_death132 303
#define FRAME_death133 304
#define FRAME_death134 305
#define FRAME_death135 306
#define FRAME_death136 307
#define FRAME_death201 308
#define FRAME_death202 309
#define FRAME_death203 310
#define FRAME_death204 311
#define FRAME_death205 312
#define FRAME_death206 313
#define FRAME_death207 314
#define FRAME_death208 315
#define FRAME_death209 316
#define FRAME_death210 317
#define FRAME_death211 318
#define FRAME_death212 319
#define FRAME_death213 320
#define FRAME_death214 321
#define FRAME_death215 322
#define FRAME_death216 323
#define FRAME_death217 324
#define FRAME_death218 325
#define FRAME_death219 326
#define FRAME_death220 327
#define FRAME_death221 328
#define FRAME_death222 329
#define FRAME_death223 330
#define FRAME_death224 331
#define FRAME_death225 332
#define FRAME_death226 333
#define FRAME_death227 334
#define FRAME_death228 335
#define FRAME_death229 336
#define FRAME_death230 337
#define FRAME_death231 338
#define FRAME_death232 339
#define FRAME_death233 340
#define FRAME_death234 341
#define FRAME_death235 342
#define FRAME_death301 343
#define FRAME_death302 344
#define FRAME_death303 345
#define FRAME_death304 346
#define FRAME_death305 347
#define FRAME_death306 348
#define FRAME_death307 349
#define FRAME_death308 350
#define FRAME_death309 351
#define FRAME_death310 352
#define FRAME_death311 353
#define FRAME_death312 354
#define FRAME_death313 355
#define FRAME_death314 356
#define FRAME_death315 357
#define FRAME_death316 358
#define FRAME_death317 359
#define FRAME_death318 360
#define FRAME_death319 361
#define FRAME_death320 362
#define FRAME_death321 363
#define FRAME_death322 364
#define FRAME_death323 365
#define FRAME_death324 366
#define FRAME_death325 367
#define FRAME_death326 368
#define FRAME_death327 369
#define FRAME_death328 370
#define FRAME_death329 371
#define FRAME_death330 372
#define FRAME_death331 373
#define FRAME_death332 374
#define FRAME_death333 375
#define FRAME_death334 376
#define FRAME_death335 377
#define FRAME_death336 378
#define FRAME_death337 379
#define FRAME_death338 380
#define FRAME_death339 381
#define FRAME_death340 382
#define FRAME_death341 383
#define FRAME_death342 384
#define FRAME_death343 385
#define FRAME_death344 386
#define FRAME_death345 387
#define FRAME_death401 388
#define FRAME_death402 389
#define FRAME_death403 390
#define FRAME_death404 391
#define FRAME_death405 392
#define FRAME_death406 393
#define FRAME_death407 394
#define FRAME_death408 395
#define FRAME_death409 396
#define FRAME_death410 397
#define FRAME_death411 398
#define FRAME_death412 399
#define FRAME_death413 400
#define FRAME_death414 401
#define FRAME_death415 402
#define FRAME_death416 403
#define FRAME_death417 404
#define FRAME_death418 405
#define FRAME_death419 406
#define FRAME_death420 407
#define FRAME_death421 408
#define FRAME_death422 409
#define FRAME_death423 410
#define FRAME_death424 411
#define FRAME_death425 412
#define FRAME_death426 413
#define FRAME_death427 414
#define FRAME_death428 415
#define FRAME_death429 416
#define FRAME_death430 417
#define FRAME_death431 418
#define FRAME_death432 419
#define FRAME_death433 420
#define FRAME_death434 421
#define FRAME_death435 422
#define FRAME_death436 423
#define FRAME_death437 424
#define FRAME_death438 425
#define FRAME_death439 426
#define FRAME_death440 427
#define FRAME_death441 428
#define FRAME_death442 429
#define FRAME_death443 430
#define FRAME_death444 431
#define FRAME_death445 432
#define FRAME_death446 433
#define FRAME_death447 434
#define FRAME_death448 435
#define FRAME_death449 436
#define FRAME_death450 437
#define FRAME_death451 438
#define FRAME_death452 439
#define FRAME_death453 440
#define FRAME_death501 441
#define FRAME_death502 442
#define FRAME_death503 443
#define FRAME_death504 444
#define FRAME_death505 445
#define FRAME_death506 446
#define FRAME_death507 447
#define FRAME_death508 448
#define FRAME_death509 449
#define FRAME_death510 450
#define FRAME_death511 451
#define FRAME_death512 452
#define FRAME_death513 453
#define FRAME_death514 454
#define FRAME_death515 455
#define FRAME_death516 456
#define FRAME_death517 457
#define FRAME_death518 458
#define FRAME_death519 459
#define FRAME_death520 460
#define FRAME_death521 461
#define FRAME_death522 462
#define FRAME_death523 463
#define FRAME_death524 464
#define FRAME_death601 465
#define FRAME_death602 466
#define FRAME_death603 467
#define FRAME_death604 468
#define FRAME_death605 469
#define FRAME_death606 470
#define FRAME_death607 471
#define FRAME_death608 472
#define FRAME_death609 473
#define FRAME_death610 474
#define MODEL_SCALE 1.200000

View File

@ -1,758 +0,0 @@
/*
==============================================================================
SUPERTANK
==============================================================================
*/
#include "g_local.h"
#include "m_supertank.h"
bool visible (edict_t *self, edict_t *other);
static int sound_pain1;
static int sound_pain2;
static int sound_pain3;
static int sound_death;
static int sound_search1;
static int sound_search2;
static int tread_sound;
void BossExplode (edict_t *self);
void TreadSound (edict_t *self)
{
gi.sound (self, CHAN_VOICE, tread_sound, 1, ATTN_NORM, 0);
}
void supertank_search (edict_t *self)
{
if (random() < 0.5)
gi.sound (self, CHAN_VOICE, sound_search1, 1, ATTN_NORM, 0);
else
gi.sound (self, CHAN_VOICE, sound_search2, 1, ATTN_NORM, 0);
}
void supertank_dead (edict_t *self);
void supertankRocket (edict_t *self);
void supertankMachineGun (edict_t *self);
void supertank_reattack1(edict_t *self);
//
// stand
//
mframe_t supertank_frames_stand []=
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t supertank_move_stand = {FRAME_stand_1, FRAME_stand_60, supertank_frames_stand, NULL};
void supertank_stand (edict_t *self)
{
self->monsterinfo.currentmove = &supertank_move_stand;
}
mframe_t supertank_frames_run [] =
{
ai_run, 12, TreadSound,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL,
ai_run, 12, NULL
};
mmove_t supertank_move_run = {FRAME_forwrd_1, FRAME_forwrd_18, supertank_frames_run, NULL};
//
// walk
//
mframe_t supertank_frames_forward [] =
{
ai_walk, 4, TreadSound,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL,
ai_walk, 4, NULL
};
mmove_t supertank_move_forward = {FRAME_forwrd_1, FRAME_forwrd_18, supertank_frames_forward, NULL};
void supertank_forward (edict_t *self)
{
self->monsterinfo.currentmove = &supertank_move_forward;
}
void supertank_walk (edict_t *self)
{
self->monsterinfo.currentmove = &supertank_move_forward;
}
void supertank_run (edict_t *self)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
self->monsterinfo.currentmove = &supertank_move_stand;
else
self->monsterinfo.currentmove = &supertank_move_run;
}
mframe_t supertank_frames_turn_right [] =
{
ai_move, 0, TreadSound,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_turn_right = {FRAME_right_1, FRAME_right_18, supertank_frames_turn_right, supertank_run};
mframe_t supertank_frames_turn_left [] =
{
ai_move, 0, TreadSound,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_turn_left = {FRAME_left_1, FRAME_left_18, supertank_frames_turn_left, supertank_run};
mframe_t supertank_frames_pain3 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_pain3 = {FRAME_pain3_9, FRAME_pain3_12, supertank_frames_pain3, supertank_run};
mframe_t supertank_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_pain2 = {FRAME_pain2_5, FRAME_pain2_8, supertank_frames_pain2, supertank_run};
mframe_t supertank_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_pain1 = {FRAME_pain1_1, FRAME_pain1_4, supertank_frames_pain1, supertank_run};
mframe_t supertank_frames_death1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, BossExplode
};
mmove_t supertank_move_death = {FRAME_death_1, FRAME_death_24, supertank_frames_death1, supertank_dead};
mframe_t supertank_frames_backward[] =
{
ai_walk, 0, TreadSound,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL,
ai_walk, 0, NULL
};
mmove_t supertank_move_backward = {FRAME_backwd_1, FRAME_backwd_18, supertank_frames_backward, NULL};
mframe_t supertank_frames_attack4[]=
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_attack4 = {FRAME_attak4_1, FRAME_attak4_6, supertank_frames_attack4, supertank_run};
mframe_t supertank_frames_attack3[]=
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_attack3 = {FRAME_attak3_1, FRAME_attak3_27, supertank_frames_attack3, supertank_run};
mframe_t supertank_frames_attack2[]=
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, supertankRocket,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, supertankRocket,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, supertankRocket,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_attack2 = {FRAME_attak2_1, FRAME_attak2_27, supertank_frames_attack2, supertank_run};
mframe_t supertank_frames_attack1[]=
{
ai_charge, 0, supertankMachineGun,
ai_charge, 0, supertankMachineGun,
ai_charge, 0, supertankMachineGun,
ai_charge, 0, supertankMachineGun,
ai_charge, 0, supertankMachineGun,
ai_charge, 0, supertankMachineGun,
};
mmove_t supertank_move_attack1 = {FRAME_attak1_1, FRAME_attak1_6, supertank_frames_attack1, supertank_reattack1};
mframe_t supertank_frames_end_attack1[]=
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t supertank_move_end_attack1 = {FRAME_attak1_7, FRAME_attak1_20, supertank_frames_end_attack1, supertank_run};
void supertank_reattack1(edict_t *self)
{
if (visible(self, self->enemy))
if (random() < 0.9)
self->monsterinfo.currentmove = &supertank_move_attack1;
else
self->monsterinfo.currentmove = &supertank_move_end_attack1;
else
self->monsterinfo.currentmove = &supertank_move_end_attack1;
}
void supertank_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (level.time < self->pain_debounce_time)
return;
// Lessen the chance of him going into his pain frames
if (damage <=25)
if (random()<0.2)
return;
// Don't go into pain if he's firing his rockets
if (skill->value >= 2)
if ( (self->s.frame >= FRAME_attak2_1) && (self->s.frame <= FRAME_attak2_14) )
return;
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
return; // no pain anims in nightmare
if (damage <= 10)
{
gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM,0);
self->monsterinfo.currentmove = &supertank_move_pain1;
}
else if (damage <= 25)
{
gi.sound (self, CHAN_VOICE, sound_pain3, 1, ATTN_NORM,0);
self->monsterinfo.currentmove = &supertank_move_pain2;
}
else
{
gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM,0);
self->monsterinfo.currentmove = &supertank_move_pain3;
}
};
void supertankRocket (edict_t *self)
{
vec3_t forward, right;
vec3_t start;
vec3_t dir;
vec3_t vec;
int flash_number;
int rocketSpeed;
if((self->spawnflags & SF_MONSTER_SPECIAL))
rocketSpeed = 400; // DWH: Homing rockets are tougher if slow
else
rocketSpeed = 500 + (100 * skill->value); // PGM rock & roll.... :)
if (self->s.frame == FRAME_attak2_8)
flash_number = MZ2_SUPERTANK_ROCKET_1;
else if (self->s.frame == FRAME_attak2_11)
flash_number = MZ2_SUPERTANK_ROCKET_2;
else // (self->s.frame == FRAME_attak2_14)
flash_number = MZ2_SUPERTANK_ROCKET_3;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
VectorCopy (self->enemy->s.origin, vec);
vec[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (vec, start, dir);
VectorNormalize (dir);
monster_fire_rocket (self, start, dir, 50, rocketSpeed, flash_number,
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
}
void supertankMachineGun (edict_t *self)
{
vec3_t dir;
vec3_t vec;
vec3_t start;
vec3_t forward, right;
int flash_number;
flash_number = MZ2_SUPERTANK_MACHINEGUN_1 + (self->s.frame - FRAME_attak1_1);
//FIXME!!!
dir[0] = 0;
dir[1] = self->s.angles[1];
dir[2] = 0;
AngleVectors (dir, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
if (self->enemy)
{
VectorCopy (self->enemy->s.origin, vec);
VectorMA (vec, 0, self->enemy->velocity, vec);
vec[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (vec, start, forward);
VectorNormalize (forward);
}
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number);
}
void supertank_attack(edict_t *self)
{
vec3_t vec;
float range;
//float r;
VectorSubtract (self->enemy->s.origin, self->s.origin, vec);
range = VectorLength (vec);
//r = random();
// Attack 1 == Chaingun
// Attack 2 == Rocket Launcher
if (range <= 160)
{
self->monsterinfo.currentmove = &supertank_move_attack1;
}
else
{ // fire rockets more often at distance
if (random() < 0.3)
self->monsterinfo.currentmove = &supertank_move_attack1;
else
self->monsterinfo.currentmove = &supertank_move_attack2;
}
}
//
// death
//
void supertank_dead (edict_t *self)
{
VectorSet (self->mins, -60, -60, 0);
VectorSet (self->maxs, 60, 60, 72);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
}
void BossExplode (edict_t *self)
{
vec3_t org;
int n;
self->think = BossExplode;
VectorCopy (self->s.origin, org);
org[2] += 24 + (rand()&15);
switch (self->count++)
{
case 0:
org[0] -= 24;
org[1] -= 24;
break;
case 1:
org[0] += 24;
org[1] += 24;
break;
case 2:
org[0] += 24;
org[1] -= 24;
break;
case 3:
org[0] -= 24;
org[1] += 24;
break;
case 4:
org[0] -= 48;
org[1] -= 48;
break;
case 5:
org[0] += 48;
org[1] += 48;
break;
case 6:
org[0] -= 48;
org[1] += 48;
break;
case 7:
org[0] += 48;
org[1] -= 48;
break;
case 8:
self->s.sound = 0;
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", 500, GIB_ORGANIC);
for (n= 0; n < 8; n++)
ThrowGib (self, "models/objects/gibs/sm_metal/tris.md2", 500, GIB_METALLIC);
ThrowGib (self, "models/objects/gibs/chest/tris.md2", 500, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/gear/tris.md2", 500, GIB_METALLIC);
self->deadflag = DEAD_DEAD;
return;
}
MESSAGE_BEGIN (svc_temp_entity);
WRITE_BYTE (TE_EXPLOSION1);
WRITE_COORD (org);
MESSAGE_SEND (MSG_PVS, self->s.origin, NULL);
if (level.num_reflectors)
ReflectExplosion (TE_EXPLOSION1, self->s.origin);
self->nextthink = level.time + 0.1;
}
void supertank_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_NO;
self->count = 0;
self->monsterinfo.currentmove = &supertank_move_death;
}
//
// monster_supertank
//
/*QUAKED monster_supertank (1 .5 0) (-64 -64 0) (64 64 72) Ambush Trigger_Spawn Sight
*/
void SP_monster_supertank (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_SUPERTANK;
// Lazarus: special purpose skins
if ( (self->spawnflags & SF_MONSTER_SPECIAL) && self->style )
{
PatchMonsterModel("models/monsters/boss1/tris.md2");
self->s.skin = self->style * 2;
}
sound_pain1 = gi.soundindex ("bosstank/btkpain1.wav");
sound_pain2 = gi.soundindex ("bosstank/btkpain2.wav");
sound_pain3 = gi.soundindex ("bosstank/btkpain3.wav");
sound_death = gi.soundindex ("bosstank/btkdeth1.wav");
sound_search1 = gi.soundindex ("bosstank/btkunqv1.wav");
sound_search2 = gi.soundindex ("bosstank/btkunqv2.wav");
// self->s.sound = gi.soundindex ("bosstank/btkengn1.wav");
tread_sound = gi.soundindex ("bosstank/btkengn1.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
// Lazarus: special purpose skins
if ( self->style )
{
PatchMonsterModel("models/monsters/boss1/tris.md2");
self->s.skin = self->style * 2;
}
self->s.modelindex = gi.modelindex ("models/monsters/boss1/tris.md2");
VectorSet (self->mins, -64, -64, 0);
VectorSet (self->maxs, 64, 64, 112);
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 1500;
if(!self->gib_health)
self->gib_health = -500;
if(!self->mass)
self->mass = 800;
self->pain = supertank_pain;
self->die = supertank_die;
self->monsterinfo.stand = supertank_stand;
self->monsterinfo.walk = supertank_walk;
self->monsterinfo.run = supertank_run;
self->monsterinfo.dodge = NULL;
self->monsterinfo.attack = supertank_attack;
self->monsterinfo.search = supertank_search;
self->monsterinfo.melee = NULL;
self->monsterinfo.sight = NULL;
// Lazarus
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
gi.linkentity (self);
self->monsterinfo.currentmove = &supertank_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&supertank_move_death,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->common_name = "Supertank";
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start(self);
}

View File

@ -1,260 +0,0 @@
// G:\quake2\baseq2\models/monsters/boss1/backup
// This file generated by ModelGen - Do NOT Modify
#define FRAME_attak1_1 0
#define FRAME_attak1_2 1
#define FRAME_attak1_3 2
#define FRAME_attak1_4 3
#define FRAME_attak1_5 4
#define FRAME_attak1_6 5
#define FRAME_attak1_7 6
#define FRAME_attak1_8 7
#define FRAME_attak1_9 8
#define FRAME_attak1_10 9
#define FRAME_attak1_11 10
#define FRAME_attak1_12 11
#define FRAME_attak1_13 12
#define FRAME_attak1_14 13
#define FRAME_attak1_15 14
#define FRAME_attak1_16 15
#define FRAME_attak1_17 16
#define FRAME_attak1_18 17
#define FRAME_attak1_19 18
#define FRAME_attak1_20 19
#define FRAME_attak2_1 20
#define FRAME_attak2_2 21
#define FRAME_attak2_3 22
#define FRAME_attak2_4 23
#define FRAME_attak2_5 24
#define FRAME_attak2_6 25
#define FRAME_attak2_7 26
#define FRAME_attak2_8 27
#define FRAME_attak2_9 28
#define FRAME_attak2_10 29
#define FRAME_attak2_11 30
#define FRAME_attak2_12 31
#define FRAME_attak2_13 32
#define FRAME_attak2_14 33
#define FRAME_attak2_15 34
#define FRAME_attak2_16 35
#define FRAME_attak2_17 36
#define FRAME_attak2_18 37
#define FRAME_attak2_19 38
#define FRAME_attak2_20 39
#define FRAME_attak2_21 40
#define FRAME_attak2_22 41
#define FRAME_attak2_23 42
#define FRAME_attak2_24 43
#define FRAME_attak2_25 44
#define FRAME_attak2_26 45
#define FRAME_attak2_27 46
#define FRAME_attak3_1 47
#define FRAME_attak3_2 48
#define FRAME_attak3_3 49
#define FRAME_attak3_4 50
#define FRAME_attak3_5 51
#define FRAME_attak3_6 52
#define FRAME_attak3_7 53
#define FRAME_attak3_8 54
#define FRAME_attak3_9 55
#define FRAME_attak3_10 56
#define FRAME_attak3_11 57
#define FRAME_attak3_12 58
#define FRAME_attak3_13 59
#define FRAME_attak3_14 60
#define FRAME_attak3_15 61
#define FRAME_attak3_16 62
#define FRAME_attak3_17 63
#define FRAME_attak3_18 64
#define FRAME_attak3_19 65
#define FRAME_attak3_20 66
#define FRAME_attak3_21 67
#define FRAME_attak3_22 68
#define FRAME_attak3_23 69
#define FRAME_attak3_24 70
#define FRAME_attak3_25 71
#define FRAME_attak3_26 72
#define FRAME_attak3_27 73
#define FRAME_attak4_1 74
#define FRAME_attak4_2 75
#define FRAME_attak4_3 76
#define FRAME_attak4_4 77
#define FRAME_attak4_5 78
#define FRAME_attak4_6 79
#define FRAME_backwd_1 80
#define FRAME_backwd_2 81
#define FRAME_backwd_3 82
#define FRAME_backwd_4 83
#define FRAME_backwd_5 84
#define FRAME_backwd_6 85
#define FRAME_backwd_7 86
#define FRAME_backwd_8 87
#define FRAME_backwd_9 88
#define FRAME_backwd_10 89
#define FRAME_backwd_11 90
#define FRAME_backwd_12 91
#define FRAME_backwd_13 92
#define FRAME_backwd_14 93
#define FRAME_backwd_15 94
#define FRAME_backwd_16 95
#define FRAME_backwd_17 96
#define FRAME_backwd_18 97
#define FRAME_death_1 98
#define FRAME_death_2 99
#define FRAME_death_3 100
#define FRAME_death_4 101
#define FRAME_death_5 102
#define FRAME_death_6 103
#define FRAME_death_7 104
#define FRAME_death_8 105
#define FRAME_death_9 106
#define FRAME_death_10 107
#define FRAME_death_11 108
#define FRAME_death_12 109
#define FRAME_death_13 110
#define FRAME_death_14 111
#define FRAME_death_15 112
#define FRAME_death_16 113
#define FRAME_death_17 114
#define FRAME_death_18 115
#define FRAME_death_19 116
#define FRAME_death_20 117
#define FRAME_death_21 118
#define FRAME_death_22 119
#define FRAME_death_23 120
#define FRAME_death_24 121
#define FRAME_death_31 122
#define FRAME_death_32 123
#define FRAME_death_33 124
#define FRAME_death_45 125
#define FRAME_death_46 126
#define FRAME_death_47 127
#define FRAME_forwrd_1 128
#define FRAME_forwrd_2 129
#define FRAME_forwrd_3 130
#define FRAME_forwrd_4 131
#define FRAME_forwrd_5 132
#define FRAME_forwrd_6 133
#define FRAME_forwrd_7 134
#define FRAME_forwrd_8 135
#define FRAME_forwrd_9 136
#define FRAME_forwrd_10 137
#define FRAME_forwrd_11 138
#define FRAME_forwrd_12 139
#define FRAME_forwrd_13 140
#define FRAME_forwrd_14 141
#define FRAME_forwrd_15 142
#define FRAME_forwrd_16 143
#define FRAME_forwrd_17 144
#define FRAME_forwrd_18 145
#define FRAME_left_1 146
#define FRAME_left_2 147
#define FRAME_left_3 148
#define FRAME_left_4 149
#define FRAME_left_5 150
#define FRAME_left_6 151
#define FRAME_left_7 152
#define FRAME_left_8 153
#define FRAME_left_9 154
#define FRAME_left_10 155
#define FRAME_left_11 156
#define FRAME_left_12 157
#define FRAME_left_13 158
#define FRAME_left_14 159
#define FRAME_left_15 160
#define FRAME_left_16 161
#define FRAME_left_17 162
#define FRAME_left_18 163
#define FRAME_pain1_1 164
#define FRAME_pain1_2 165
#define FRAME_pain1_3 166
#define FRAME_pain1_4 167
#define FRAME_pain2_5 168
#define FRAME_pain2_6 169
#define FRAME_pain2_7 170
#define FRAME_pain2_8 171
#define FRAME_pain3_9 172
#define FRAME_pain3_10 173
#define FRAME_pain3_11 174
#define FRAME_pain3_12 175
#define FRAME_right_1 176
#define FRAME_right_2 177
#define FRAME_right_3 178
#define FRAME_right_4 179
#define FRAME_right_5 180
#define FRAME_right_6 181
#define FRAME_right_7 182
#define FRAME_right_8 183
#define FRAME_right_9 184
#define FRAME_right_10 185
#define FRAME_right_11 186
#define FRAME_right_12 187
#define FRAME_right_13 188
#define FRAME_right_14 189
#define FRAME_right_15 190
#define FRAME_right_16 191
#define FRAME_right_17 192
#define FRAME_right_18 193
#define FRAME_stand_1 194
#define FRAME_stand_2 195
#define FRAME_stand_3 196
#define FRAME_stand_4 197
#define FRAME_stand_5 198
#define FRAME_stand_6 199
#define FRAME_stand_7 200
#define FRAME_stand_8 201
#define FRAME_stand_9 202
#define FRAME_stand_10 203
#define FRAME_stand_11 204
#define FRAME_stand_12 205
#define FRAME_stand_13 206
#define FRAME_stand_14 207
#define FRAME_stand_15 208
#define FRAME_stand_16 209
#define FRAME_stand_17 210
#define FRAME_stand_18 211
#define FRAME_stand_19 212
#define FRAME_stand_20 213
#define FRAME_stand_21 214
#define FRAME_stand_22 215
#define FRAME_stand_23 216
#define FRAME_stand_24 217
#define FRAME_stand_25 218
#define FRAME_stand_26 219
#define FRAME_stand_27 220
#define FRAME_stand_28 221
#define FRAME_stand_29 222
#define FRAME_stand_30 223
#define FRAME_stand_31 224
#define FRAME_stand_32 225
#define FRAME_stand_33 226
#define FRAME_stand_34 227
#define FRAME_stand_35 228
#define FRAME_stand_36 229
#define FRAME_stand_37 230
#define FRAME_stand_38 231
#define FRAME_stand_39 232
#define FRAME_stand_40 233
#define FRAME_stand_41 234
#define FRAME_stand_42 235
#define FRAME_stand_43 236
#define FRAME_stand_44 237
#define FRAME_stand_45 238
#define FRAME_stand_46 239
#define FRAME_stand_47 240
#define FRAME_stand_48 241
#define FRAME_stand_49 242
#define FRAME_stand_50 243
#define FRAME_stand_51 244
#define FRAME_stand_52 245
#define FRAME_stand_53 246
#define FRAME_stand_54 247
#define FRAME_stand_55 248
#define FRAME_stand_56 249
#define FRAME_stand_57 250
#define FRAME_stand_58 251
#define FRAME_stand_59 252
#define FRAME_stand_60 253
#define MODEL_SCALE 1.000000

View File

@ -1,956 +0,0 @@
/*
==============================================================================
TANK
==============================================================================
*/
#include "g_local.h"
#include "m_tank.h"
void tank_refire_rocket (edict_t *self);
void tank_doattack_rocket (edict_t *self);
void tank_reattack_blaster (edict_t *self);
static int sound_thud;
static int sound_pain;
static int sound_idle;
static int sound_die;
static int sound_step;
static int sound_sight;
static int sound_windup;
static int sound_strike;
//
// misc
//
void tank_sight (edict_t *self, edict_t *other)
{
gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void tank_footstep (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
void tank_thud (edict_t *self)
{
gi.sound (self, CHAN_BODY, sound_thud, 1, ATTN_NORM, 0);
}
void tank_windup (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_windup, 1, ATTN_NORM, 0);
}
void tank_idle (edict_t *self)
{
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
//
// stand
//
mframe_t tank_frames_stand []=
{
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL,
ai_stand, 0, NULL
};
mmove_t tank_move_stand = {FRAME_stand01, FRAME_stand30, tank_frames_stand, NULL};
void tank_stand (edict_t *self)
{
self->monsterinfo.currentmove = &tank_move_stand;
}
//
// walk
//
void tank_walk (edict_t *self);
mframe_t tank_frames_start_walk [] =
{
ai_walk, 0, NULL,
ai_walk, 6, NULL,
ai_walk, 6, NULL,
ai_walk, 11, tank_footstep
};
mmove_t tank_move_start_walk = {FRAME_walk01, FRAME_walk04, tank_frames_start_walk, tank_walk};
mframe_t tank_frames_walk [] =
{
ai_walk, 4, NULL,
ai_walk, 5, NULL,
ai_walk, 3, NULL,
ai_walk, 2, NULL,
ai_walk, 5, NULL,
ai_walk, 5, NULL,
ai_walk, 4, NULL,
ai_walk, 4, tank_footstep,
ai_walk, 3, NULL,
ai_walk, 5, NULL,
ai_walk, 4, NULL,
ai_walk, 5, NULL,
ai_walk, 7, NULL,
ai_walk, 7, NULL,
ai_walk, 6, NULL,
ai_walk, 6, tank_footstep
};
mmove_t tank_move_walk = {FRAME_walk05, FRAME_walk20, tank_frames_walk, NULL};
mframe_t tank_frames_stop_walk [] =
{
ai_walk, 3, NULL,
ai_walk, 3, NULL,
ai_walk, 2, NULL,
ai_walk, 2, NULL,
ai_walk, 4, tank_footstep
};
mmove_t tank_move_stop_walk = {FRAME_walk21, FRAME_walk25, tank_frames_stop_walk, tank_stand};
void tank_walk (edict_t *self)
{
self->monsterinfo.currentmove = &tank_move_walk;
}
//
// run
//
void tank_run (edict_t *self);
mframe_t tank_frames_start_run [] =
{
ai_run, 0, NULL,
ai_run, 6, NULL,
ai_run, 6, NULL,
ai_run, 11, tank_footstep
};
mmove_t tank_move_start_run = {FRAME_walk01, FRAME_walk04, tank_frames_start_run, tank_run};
mframe_t tank_frames_run [] =
{
ai_run, 4, NULL,
ai_run, 5, NULL,
ai_run, 3, NULL,
ai_run, 2, NULL,
ai_run, 5, NULL,
ai_run, 5, NULL,
ai_run, 4, NULL,
ai_run, 4, tank_footstep,
ai_run, 3, NULL,
ai_run, 5, NULL,
ai_run, 4, NULL,
ai_run, 5, NULL,
ai_run, 7, NULL,
ai_run, 7, NULL,
ai_run, 6, NULL,
ai_run, 6, tank_footstep
};
mmove_t tank_move_run = {FRAME_walk05, FRAME_walk20, tank_frames_run, NULL};
mframe_t tank_frames_stop_run [] =
{
ai_run, 3, NULL,
ai_run, 3, NULL,
ai_run, 2, NULL,
ai_run, 2, NULL,
ai_run, 4, tank_footstep
};
mmove_t tank_move_stop_run = {FRAME_walk21, FRAME_walk25, tank_frames_stop_run, tank_walk};
void tank_run (edict_t *self)
{
if (self->enemy && self->enemy->client)
self->monsterinfo.aiflags |= AI_BRUTAL;
else
self->monsterinfo.aiflags &= ~AI_BRUTAL;
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &tank_move_stand;
return;
}
if (self->monsterinfo.currentmove == &tank_move_walk ||
self->monsterinfo.currentmove == &tank_move_start_run)
{
self->monsterinfo.currentmove = &tank_move_run;
}
else
{
self->monsterinfo.currentmove = &tank_move_start_run;
}
}
//
// pain
//
mframe_t tank_frames_pain1 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t tank_move_pain1 = {FRAME_pain101, FRAME_pain104, tank_frames_pain1, tank_run};
mframe_t tank_frames_pain2 [] =
{
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t tank_move_pain2 = {FRAME_pain201, FRAME_pain205, tank_frames_pain2, tank_run};
mframe_t tank_frames_pain3 [] =
{
ai_move, -7, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 3, NULL,
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, tank_footstep
};
mmove_t tank_move_pain3 = {FRAME_pain301, FRAME_pain316, tank_frames_pain3, tank_run};
void tank_pain (edict_t *self, edict_t *other, float kick, int damage)
{
if (self->health < (self->max_health / 2))
self->s.skin |= 1;
if (damage <= 10)
return;
if (level.time < self->pain_debounce_time)
return;
if (damage <= 30)
if (random() > 0.2)
return;
// If hard or nightmare, don't go into pain while attacking
if ( skill->value >= 2)
{
if ( (self->s.frame >= FRAME_attak301) && (self->s.frame <= FRAME_attak330) )
return;
if ( (self->s.frame >= FRAME_attak101) && (self->s.frame <= FRAME_attak116) )
return;
}
self->pain_debounce_time = level.time + 3;
gi.sound (self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0);
if (skill->value == 3)
return; // no pain anims in nightmare
if (damage <= 30)
self->monsterinfo.currentmove = &tank_move_pain1;
else if (damage <= 60)
self->monsterinfo.currentmove = &tank_move_pain2;
else
self->monsterinfo.currentmove = &tank_move_pain3;
};
//
// attacks
//
void TankBlaster (edict_t *self)
{
vec3_t forward, right;
vec3_t start;
vec3_t end;
vec3_t dir;
int flash_number;
if(!self->enemy || !self->enemy->inuse)
return;
if (self->s.frame == FRAME_attak110)
flash_number = MZ2_TANK_BLASTER_1;
else if (self->s.frame == FRAME_attak113)
flash_number = MZ2_TANK_BLASTER_2;
else // (self->s.frame == FRAME_attak116)
flash_number = MZ2_TANK_BLASTER_3;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
VectorCopy (self->enemy->s.origin, end);
end[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
end[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
end[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
end[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (end, start, dir);
monster_fire_blaster (self, start, dir, 30, 800, flash_number, EF_BLASTER);
}
void TankStrike (edict_t *self)
{
gi.sound (self, CHAN_WEAPON, sound_strike, 1, ATTN_NORM, 0);
}
void TankRocket (edict_t *self)
{
trace_t trace;
vec3_t forward, right;
vec3_t start;
vec3_t dir;
vec3_t vec;
int flash_number;
// Lazarus: Added Rogue's skill level-dependent rocket speed
int rocketSpeed;
if(!self->enemy || !self->enemy->inuse) //PGM
return; //PGM
if (self->s.frame == FRAME_attak324)
flash_number = MZ2_TANK_ROCKET_1;
else if (self->s.frame == FRAME_attak327)
flash_number = MZ2_TANK_ROCKET_2;
else // (self->s.frame == FRAME_attak330)
flash_number = MZ2_TANK_ROCKET_3;
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
if((self->spawnflags & SF_MONSTER_SPECIAL))
rocketSpeed = 400; // Lazarus: Homing rockets are tougher if slow
else
rocketSpeed = 500 + (100 * skill->value); // PGM rock & roll.... :)
/* VectorCopy (self->enemy->s.origin, vec);
vec[2] += self->enemy->viewheight;
VectorSubtract (vec, start, dir);
VectorNormalize (dir); */
// Lazarus: Added Rogue stuff and homers
VectorCopy (self->enemy->s.origin, vec);
if(random() < 0.66 || (start[2] < self->enemy->absmin[2]))
{
// gi.dprintf("normal shot\n");
vec[2] += self->enemy->viewheight;
}
else
{
// gi.dprintf("shooting at feet!\n");
vec[2] = self->enemy->absmin[2];
}
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (vec, start, dir);
// lead target, but not if using homers
// 20, 35, 50, 65 chance of leading
// Lazarus: Switched this around from Rogue code... it led target more often
// for Easy, which seemed backwards
if( (random() < (0.2 + skill->value * 0.15) ) && !(self->spawnflags & SF_MONSTER_SPECIAL))
{
float dist;
float time;
dist = VectorLength (dir);
time = dist/rocketSpeed;
VectorMA(vec, time, self->enemy->velocity, vec);
VectorSubtract(vec, start, dir);
}
VectorNormalize(dir);
// paranoia, make sure we're not shooting a target right next to us
trace = gi.trace(start, vec3_origin, vec3_origin, vec, self, MASK_SHOT);
if(trace.ent == self->enemy || trace.ent == world)
{
if(trace.fraction > 0.5 || (trace.ent && trace.ent->client))
monster_fire_rocket (self, start, dir, 50, rocketSpeed, flash_number,
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
}
}
void TankMachineGun (edict_t *self)
{
vec3_t dir;
vec3_t vec;
vec3_t start;
vec3_t forward, right;
int flash_number;
if(!self->enemy || !self->enemy->inuse) //PGM
return; //PGM
flash_number = MZ2_TANK_MACHINEGUN_1 + (self->s.frame - FRAME_attak406);
AngleVectors (self->s.angles, forward, right, NULL);
G_ProjectSource (self->s.origin, monster_flash_offset[flash_number], forward, right, start);
if (self->enemy)
{
VectorCopy (self->enemy->s.origin, vec);
vec[2] += self->enemy->viewheight;
// Lazarus fog reduction of accuracy
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
{
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
vec[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
}
VectorSubtract (vec, start, vec);
vectoangles (vec, vec);
dir[0] = vec[0];
}
else
{
dir[0] = 0;
}
if (self->s.frame <= FRAME_attak415)
dir[1] = self->s.angles[1] - 8 * (self->s.frame - FRAME_attak411);
else
dir[1] = self->s.angles[1] + 8 * (self->s.frame - FRAME_attak419);
dir[2] = 0;
AngleVectors (dir, forward, NULL, NULL);
monster_fire_bullet (self, start, forward, 20, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number);
}
mframe_t tank_frames_attack_blast [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, -1, NULL,
ai_charge, -2, NULL,
ai_charge, -1, NULL,
ai_charge, -1, NULL,
ai_charge, 0, NULL,
ai_charge, 0, TankBlaster, // 10
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, TankBlaster,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, TankBlaster // 16
};
mmove_t tank_move_attack_blast = {FRAME_attak101, FRAME_attak116, tank_frames_attack_blast, tank_reattack_blaster};
mframe_t tank_frames_reattack_blast [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, TankBlaster,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, TankBlaster // 16
};
mmove_t tank_move_reattack_blast = {FRAME_attak111, FRAME_attak116, tank_frames_reattack_blast, tank_reattack_blaster};
mframe_t tank_frames_attack_post_blast [] =
{
ai_move, 0, NULL, // 17
ai_move, 0, NULL,
ai_move, 2, NULL,
ai_move, 3, NULL,
ai_move, 2, NULL,
ai_move, -2, tank_footstep // 22
};
mmove_t tank_move_attack_post_blast = {FRAME_attak117, FRAME_attak122, tank_frames_attack_post_blast, tank_run};
void tank_reattack_blaster (edict_t *self)
{
if (skill->value >= 2)
if (visible (self, self->enemy))
if (self->enemy->health > 0)
if (random() <= 0.6)
{
self->monsterinfo.currentmove = &tank_move_reattack_blast;
return;
}
self->monsterinfo.currentmove = &tank_move_attack_post_blast;
}
void tank_poststrike (edict_t *self)
{
self->enemy = NULL;
tank_run (self);
}
mframe_t tank_frames_attack_strike [] =
{
ai_move, 3, NULL,
ai_move, 2, NULL,
ai_move, 2, NULL,
ai_move, 1, NULL,
ai_move, 6, NULL,
ai_move, 7, NULL,
ai_move, 9, tank_footstep,
ai_move, 2, NULL,
ai_move, 1, NULL,
ai_move, 2, NULL,
ai_move, 2, tank_footstep,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -2, NULL,
ai_move, -2, NULL,
ai_move, 0, tank_windup,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, TankStrike,
ai_move, 0, NULL,
ai_move, -1, NULL,
ai_move, -1, NULL,
ai_move, -1, NULL,
ai_move, -1, NULL,
ai_move, -1, NULL,
ai_move, -3, NULL,
ai_move, -10, NULL,
ai_move, -10, NULL,
ai_move, -2, NULL,
ai_move, -3, NULL,
ai_move, -2, tank_footstep
};
mmove_t tank_move_attack_strike = {FRAME_attak201, FRAME_attak238, tank_frames_attack_strike, tank_poststrike};
mframe_t tank_frames_attack_pre_rocket [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL, // 10
ai_charge, 0, NULL,
ai_charge, 1, NULL,
ai_charge, 2, NULL,
ai_charge, 7, NULL,
ai_charge, 7, NULL,
ai_charge, 7, tank_footstep,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL, // 20
ai_charge, -3, NULL
};
mmove_t tank_move_attack_pre_rocket = {FRAME_attak301, FRAME_attak321, tank_frames_attack_pre_rocket, tank_doattack_rocket};
mframe_t tank_frames_attack_fire_rocket [] =
{
ai_charge, -3, NULL, // Loop Start 22
ai_charge, 0, NULL,
ai_charge, 0, TankRocket, // 24
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, TankRocket,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, -1, TankRocket // 30 Loop End
};
mmove_t tank_move_attack_fire_rocket = {FRAME_attak322, FRAME_attak330, tank_frames_attack_fire_rocket, tank_refire_rocket};
mframe_t tank_frames_attack_post_rocket [] =
{
ai_charge, 0, NULL, // 31
ai_charge, -1, NULL,
ai_charge, -1, NULL,
ai_charge, 0, NULL,
ai_charge, 2, NULL,
ai_charge, 3, NULL,
ai_charge, 4, NULL,
ai_charge, 2, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL, // 40
ai_charge, 0, NULL,
ai_charge, -9, NULL,
ai_charge, -8, NULL,
ai_charge, -7, NULL,
ai_charge, -1, NULL,
ai_charge, -1, tank_footstep,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL, // 50
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t tank_move_attack_post_rocket = {FRAME_attak331, FRAME_attak353, tank_frames_attack_post_rocket, tank_run};
mframe_t tank_frames_attack_chain [] =
{
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
NULL, 0, TankMachineGun,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL,
ai_charge, 0, NULL
};
mmove_t tank_move_attack_chain = {FRAME_attak401, FRAME_attak429, tank_frames_attack_chain, tank_run};
void tank_refire_rocket (edict_t *self)
{
// Only on hard or nightmare
if ( skill->value >= 2 )
if (self->enemy->health > 0)
if (visible(self, self->enemy) )
if (random() <= 0.4)
{
self->monsterinfo.currentmove = &tank_move_attack_fire_rocket;
return;
}
self->monsterinfo.currentmove = &tank_move_attack_post_rocket;
}
void tank_doattack_rocket (edict_t *self)
{
self->monsterinfo.currentmove = &tank_move_attack_fire_rocket;
}
void tank_attack(edict_t *self)
{
vec3_t vec;
float range;
float r;
// PMM
if (!self->enemy || !self->enemy->inuse)
return;
if (self->enemy->health < 0)
{
self->monsterinfo.currentmove = &tank_move_attack_strike;
self->monsterinfo.aiflags &= ~AI_BRUTAL;
return;
}
VectorSubtract (self->enemy->s.origin, self->s.origin, vec);
range = VectorLength (vec);
r = random();
if (range <= 125)
{
if (r < 0.4)
self->monsterinfo.currentmove = &tank_move_attack_chain;
else
self->monsterinfo.currentmove = &tank_move_attack_blast;
}
else if (range <= 250)
{
if (r < 0.5)
self->monsterinfo.currentmove = &tank_move_attack_chain;
else
self->monsterinfo.currentmove = &tank_move_attack_blast;
}
else
{
if (r < 0.33)
self->monsterinfo.currentmove = &tank_move_attack_chain;
else if (r < 0.66)
{
self->monsterinfo.currentmove = &tank_move_attack_pre_rocket;
self->pain_debounce_time = level.time + 5.0; // no pain for a while
}
else
self->monsterinfo.currentmove = &tank_move_attack_blast;
}
}
//
// death
//
void tank_dead (edict_t *self)
{
VectorSet (self->mins, -16, -16, -16);
VectorSet (self->maxs, 16, 16, -0);
self->movetype = MOVETYPE_TOSS;
self->svflags |= SVF_DEADMONSTER;
self->nextthink = 0;
gi.linkentity (self);
M_FlyCheck (self);
// Lazarus monster fade
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
{
self->think=FadeDieSink;
self->nextthink=level.time+corpse_fadetime->value;
}
}
mframe_t tank_frames_death1 [] =
{
ai_move, -7, NULL,
ai_move, -2, NULL,
ai_move, -2, NULL,
ai_move, 1, NULL,
ai_move, 3, NULL,
ai_move, 6, NULL,
ai_move, 1, NULL,
ai_move, 1, NULL,
ai_move, 2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -2, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -3, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, -4, NULL,
ai_move, -6, NULL,
ai_move, -4, NULL,
ai_move, -5, NULL,
ai_move, -7, NULL,
ai_move, -15, tank_thud,
ai_move, -5, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL,
ai_move, 0, NULL
};
mmove_t tank_move_death = {FRAME_death101, FRAME_death132, tank_frames_death1, tank_dead};
void tank_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
// check for gib
if (self->health <= self->gib_health && !(self->spawnflags & SF_MONSTER_NOGIB))
{
gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
for (n= 0; n < 1 /*4*/; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_metal/tris.md2", damage, GIB_METALLIC);
ThrowGib (self, "models/objects/gibs/chest/tris.md2", damage, GIB_ORGANIC);
ThrowHead (self, "models/objects/gibs/gear/tris.md2", damage, GIB_METALLIC);
self->deadflag = DEAD_DEAD;
return;
}
if (self->deadflag == DEAD_DEAD)
return;
// regular death
gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_YES;
self->monsterinfo.currentmove = &tank_move_death;
}
//
// monster_tank
//
/*QUAKED monster_tank (1 .5 0) (-32 -32 -16) (32 32 72) Ambush Trigger_Spawn Sight
*/
/*QUAKED monster_tank_commander (1 .5 0) (-32 -32 -16) (32 32 72) Ambush Trigger_Spawn Sight
*/
void SP_monster_tank (edict_t *self)
{
if (deathmatch->value)
{
G_FreeEdict (self);
return;
}
self->class_id = ENTITY_MONSTER_TANK;
// Lazarus: special purpose skins
if (strcmp(self->classname, "monster_tank_commander") == 0)
self->s.skin = 2;
if ( self->style )
{
PatchMonsterModel("models/monsters/tank/tris.md2");
self->s.skin += self->style * 4;
}
self->s.modelindex = gi.modelindex ("models/monsters/tank/tris.md2");
VectorSet (self->mins, -32, -32, -16);
VectorSet (self->maxs, 32, 32, 72);
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;
sound_pain = gi.soundindex ("tank/tnkpain2.wav");
sound_thud = gi.soundindex ("tank/tnkdeth2.wav");
sound_idle = gi.soundindex ("tank/tnkidle1.wav");
sound_die = gi.soundindex ("tank/death.wav");
sound_step = gi.soundindex ("tank/step.wav");
sound_windup = gi.soundindex ("tank/tnkatck4.wav");
sound_strike = gi.soundindex ("tank/tnkatck5.wav");
sound_sight = gi.soundindex ("tank/sight1.wav");
gi.soundindex ("tank/tnkatck1.wav");
gi.soundindex ("tank/tnkatk2a.wav");
gi.soundindex ("tank/tnkatk2b.wav");
gi.soundindex ("tank/tnkatk2c.wav");
gi.soundindex ("tank/tnkatk2d.wav");
gi.soundindex ("tank/tnkatk2e.wav");
gi.soundindex ("tank/tnkatck3.wav");
if (strcmp(self->classname, "monster_tank_commander") == 0)
{
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 1000;
if(!self->gib_health)
self->gib_health = -225;
self->common_name = "Tank Commander";
}
else
{
// Lazarus: mapper-configurable health
if(!self->health)
self->health = 750;
if(!self->gib_health)
self->gib_health = -200;
self->common_name = "Tank";
}
if(!self->mass)
self->mass = 500;
self->pain = tank_pain;
self->die = tank_die;
self->monsterinfo.stand = tank_stand;
self->monsterinfo.walk = tank_walk;
self->monsterinfo.run = tank_run;
self->monsterinfo.dodge = NULL;
self->monsterinfo.attack = tank_attack;
self->monsterinfo.melee = NULL;
self->monsterinfo.sight = tank_sight;
self->monsterinfo.idle = tank_idle;
// Lazarus power armor
if(self->powerarmor) {
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = self->powerarmor;
}
if(!self->monsterinfo.flies)
self->monsterinfo.flies = 0.05;
gi.linkentity (self);
self->monsterinfo.currentmove = &tank_move_stand;
if(self->health < 0)
{
mmove_t *deathmoves[] = {&tank_move_death,
NULL};
M_SetDeath(self,(mmove_t **)&deathmoves);
}
self->monsterinfo.scale = MODEL_SCALE;
walkmonster_start(self);
}

Some files were not shown because too many files have changed in this diff Show More