mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-01-31 04:30:39 +00:00
Added LMCTF / LM Escape plasma rifle to missionpack DLL.
Added plasma guards (monster_soldier_plasma_re and monster_soldier_plasma_sp) from LM Escape to missionpack DLL. Added Zaero items/weapons to missionpack DLL. Added support for Zaero doors to missionpack DLL. Fixed crash caused by killtargeting sentien (laser edict not freed) in missionpack DLL. Fixed bug with broken Rogue turrets in missionpack DLL. Fixed crash in g_combat.c->M_ReactToDamage() caused by attacker with NULL classname in missionpack DLL.
This commit is contained in:
parent
37eb683714
commit
0d4e872ce9
49 changed files with 6506 additions and 3816 deletions
|
@ -115,9 +115,9 @@ void ai_stand (edict_t *self, float dist)
|
|||
if (dist)
|
||||
M_walkmove (self, self->s.angles[YAW], dist);
|
||||
|
||||
if(self->monsterinfo.aiflags & AI_FOLLOW_LEADER)
|
||||
if (self->monsterinfo.aiflags & AI_FOLLOW_LEADER)
|
||||
{
|
||||
if(!self->enemy || !self->enemy->inuse)
|
||||
if (!self->enemy || !self->enemy->inuse)
|
||||
{
|
||||
self->movetarget = self->goalentity = self->monsterinfo.leader;
|
||||
self->monsterinfo.aiflags &= ~(AI_STAND_GROUND | AI_TEMP_STAND_GROUND);
|
||||
|
@ -132,7 +132,7 @@ void ai_stand (edict_t *self, float dist)
|
|||
{
|
||||
self->monsterinfo.aiflags &= ~(AI_CHICKEN | AI_STAND_GROUND);
|
||||
self->monsterinfo.pausetime = 0;
|
||||
if(self->enemy)
|
||||
if (self->enemy)
|
||||
FoundTarget(self);
|
||||
}
|
||||
}
|
||||
|
@ -183,9 +183,9 @@ void ai_stand (edict_t *self, float dist)
|
|||
{
|
||||
// Lazarus: Solve problem of monsters pausing at path_corners, taking off in
|
||||
// original direction
|
||||
if(self->enemy && self->enemy->inuse)
|
||||
if (self->enemy && self->enemy->inuse)
|
||||
VectorSubtract (self->enemy->s.origin, self->s.origin, v);
|
||||
else if(self->goalentity)
|
||||
else if (self->goalentity)
|
||||
VectorSubtract (self->goalentity->s.origin, self->s.origin, v);
|
||||
else {
|
||||
self->monsterinfo.pausetime = level.time + random() * 15;
|
||||
|
@ -194,14 +194,14 @@ void ai_stand (edict_t *self, float dist)
|
|||
self->ideal_yaw = vectoyaw (v);
|
||||
|
||||
// Lazarus: Let misc_actors who are following their leader RUN even when not mad
|
||||
if( (self->monsterinfo.aiflags & AI_FOLLOW_LEADER) && (self->movetarget) &&
|
||||
if ( (self->monsterinfo.aiflags & AI_FOLLOW_LEADER) && (self->movetarget) &&
|
||||
(self->movetarget->inuse) )
|
||||
{
|
||||
float R;
|
||||
R = realrange(self,self->movetarget);
|
||||
if(R > ACTOR_FOLLOW_RUN_RANGE)
|
||||
if (R > ACTOR_FOLLOW_RUN_RANGE)
|
||||
self->monsterinfo.run (self);
|
||||
else if(R > ACTOR_FOLLOW_STAND_RANGE || !self->movetarget->client)
|
||||
else if (R > ACTOR_FOLLOW_STAND_RANGE || !self->movetarget->client)
|
||||
self->monsterinfo.walk (self);
|
||||
}
|
||||
else
|
||||
|
@ -211,7 +211,7 @@ void ai_stand (edict_t *self, float dist)
|
|||
|
||||
if (!(self->spawnflags & SF_MONSTER_SIGHT) && (self->monsterinfo.idle) && (level.time > self->monsterinfo.idle_time))
|
||||
{
|
||||
if(self->monsterinfo.aiflags & AI_MEDIC)
|
||||
if (self->monsterinfo.aiflags & AI_MEDIC)
|
||||
abortHeal(self,false, false, false);
|
||||
|
||||
if (self->monsterinfo.idle_time)
|
||||
|
@ -280,11 +280,12 @@ void ai_charge (edict_t *self, float dist)
|
|||
// PMM - made AI_MANUAL_STEERING affect things differently here .. they turn, but
|
||||
// don't set the ideal_yaw
|
||||
|
||||
// Zaero
|
||||
// Zaero add
|
||||
if (self->monsterinfo.aiflags2 & AI2_ONESHOTTARGET)
|
||||
{
|
||||
VectorSubtract (self->monsterinfo.shottarget, self->s.origin, v);
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
// This is put in there so monsters won't move towards the origin after killing
|
||||
// a tesla. This could be problematic, so keep an eye on it.
|
||||
|
@ -427,6 +428,12 @@ qboolean visible (edict_t *self, edict_t *other)
|
|||
vec3_t spot2;
|
||||
trace_t trace;
|
||||
|
||||
// Zaero add
|
||||
// Monsters blinded by flare can't see anything!
|
||||
if (self->monsterinfo.flashTime > 0)
|
||||
return false;
|
||||
// end Zaero
|
||||
|
||||
VectorCopy (self->s.origin, spot1);
|
||||
spot1[2] += self->viewheight;
|
||||
VectorCopy (other->s.origin, spot2);
|
||||
|
@ -585,19 +592,19 @@ void FoundTarget (edict_t *self)
|
|||
level.sight_entity->light_level = 128;
|
||||
|
||||
goodguy = NULL;
|
||||
goodguy = G_Find(NULL,FOFS(dmgteam),"player");
|
||||
while(goodguy)
|
||||
goodguy = G_Find(NULL,FOFS(dmgteam), "player");
|
||||
while (goodguy)
|
||||
{
|
||||
if(goodguy->health > 0)
|
||||
if (goodguy->health > 0)
|
||||
{
|
||||
if(!goodguy->enemy)
|
||||
if (!goodguy->enemy)
|
||||
{
|
||||
if(goodguy->monsterinfo.aiflags & AI_ACTOR)
|
||||
if (goodguy->monsterinfo.aiflags & AI_ACTOR)
|
||||
{
|
||||
// Can he see enemy?
|
||||
// tr = gi.trace(goodguy->s.origin,vec3_origin,vec3_origin,self->enemy->s.origin,goodguy,MASK_OPAQUE);
|
||||
// if(tr.fraction == 1.0)
|
||||
if(gi.inPVS(goodguy->s.origin,self->enemy->s.origin))
|
||||
// if (tr.fraction == 1.0)
|
||||
if (gi.inPVS(goodguy->s.origin,self->enemy->s.origin))
|
||||
{
|
||||
goodguy->monsterinfo.aiflags |= AI_FOLLOW_LEADER;
|
||||
goodguy->monsterinfo.old_leader = NULL;
|
||||
|
@ -634,8 +641,9 @@ void FoundTarget (edict_t *self)
|
|||
gi.dprintf("%s at %s, combattarget %s not found\n", self->classname, vtos(self->s.origin), self->combattarget);
|
||||
return;
|
||||
}
|
||||
|
||||
// Lazarus: Huh? How come yaw for combattarget isn't set?
|
||||
VectorSubtract(self->movetarget->s.origin,self->s.origin,v);
|
||||
VectorSubtract(self->movetarget->s.origin, self->s.origin, v);
|
||||
self->ideal_yaw = vectoyaw(v);
|
||||
|
||||
// clear out our combattarget, these are a one shot deal
|
||||
|
@ -645,7 +653,7 @@ void FoundTarget (edict_t *self)
|
|||
// clear the targetname, that point is ours!
|
||||
// Lazarus: Why, why, why???? This doesn't remove the point_combat, only makes it inaccessible!
|
||||
// to other monsters.
|
||||
//self->movetarget->targetname = NULL;
|
||||
// self->movetarget->targetname = NULL;
|
||||
self->monsterinfo.pausetime = 0;
|
||||
|
||||
// run for it
|
||||
|
@ -842,10 +850,10 @@ qboolean FindTarget (edict_t *self)
|
|||
int i;
|
||||
edict_t *ref;
|
||||
|
||||
for(i=0; i<6 && !reflection; i++)
|
||||
for (i=0; i<6 && !reflection; i++)
|
||||
{
|
||||
ref = client->reflection[i];
|
||||
if(ref && visible(self,ref) && infront(self,ref))
|
||||
if (ref && visible(self,ref) && infront(self,ref))
|
||||
{
|
||||
reflection = ref;
|
||||
self_reflection = self->reflection[i];
|
||||
|
@ -922,7 +930,7 @@ qboolean FindTarget (edict_t *self)
|
|||
// If MORON or DUMMY for the parent func_reflect is set,
|
||||
// attack the reflection (in the case of DUMMY, only
|
||||
// if monster doesn't see himself in the same mirror)
|
||||
if( (reflection->activator->spawnflags & 4) ||
|
||||
if ( (reflection->activator->spawnflags & 4) ||
|
||||
( (reflection->activator->spawnflags & 8) &&
|
||||
(!self_reflection || !visible(self,self_reflection)) ) ) // crashes here
|
||||
{
|
||||
|
@ -1018,7 +1026,7 @@ got_one:
|
|||
// PMM - if we got an enemy, we need to bail out of hint paths, so take over here
|
||||
if (self->monsterinfo.aiflags & AI_HINT_PATH)
|
||||
{
|
||||
// if(g_showlogic && g_showlogic->value)
|
||||
// if (g_showlogic && g_showlogic->value)
|
||||
// gi.dprintf("stopped following hint paths in FindTarget\n");
|
||||
|
||||
// this calls foundtarget for us
|
||||
|
@ -1098,8 +1106,9 @@ qboolean M_CheckAttack (edict_t *self)
|
|||
{
|
||||
// PMM - if we can't see our target, and we're not blocked by a monster, go into blind fire if available
|
||||
if ((!(tr.ent->svflags & SVF_MONSTER)) && (!visible(self, self->enemy)))
|
||||
{
|
||||
if ((self->monsterinfo.blindfire) && (self->monsterinfo.blind_fire_delay <= 20.0))
|
||||
{ // Knightmare- disable blindfire for Zaero maps, as it causes undesired behavior in zdef4
|
||||
// if ((self->monsterinfo.blindfire) && (self->monsterinfo.blind_fire_delay <= 20.0))
|
||||
if ( !IsZaeroMap() && (self->monsterinfo.blindfire) && (self->monsterinfo.blind_fire_delay <= 20.0) )
|
||||
{
|
||||
if (level.time < self->monsterinfo.attack_finished)
|
||||
{
|
||||
|
@ -1494,16 +1503,16 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
{
|
||||
self->goalentity = self->movetarget;
|
||||
// Lazarus: Let misc_actors who are following their leader RUN even when not mad
|
||||
if( (self->monsterinfo.aiflags & AI_FOLLOW_LEADER) &&
|
||||
if ( (self->monsterinfo.aiflags & AI_FOLLOW_LEADER) &&
|
||||
(self->movetarget) &&
|
||||
(self->movetarget->inuse) )
|
||||
{
|
||||
float R;
|
||||
|
||||
R = realrange(self,self->movetarget);
|
||||
if(R > ACTOR_FOLLOW_RUN_RANGE)
|
||||
if (R > ACTOR_FOLLOW_RUN_RANGE)
|
||||
self->monsterinfo.run (self);
|
||||
else if(R > ACTOR_FOLLOW_STAND_RANGE || !self->movetarget->client)
|
||||
else if (R > ACTOR_FOLLOW_STAND_RANGE || !self->movetarget->client)
|
||||
self->monsterinfo.walk (self);
|
||||
else
|
||||
{
|
||||
|
@ -1640,6 +1649,15 @@ void ai_run (edict_t *self, float dist)
|
|||
qboolean gotcha = false;
|
||||
edict_t *realEnemy;
|
||||
|
||||
// Zaero add
|
||||
// Monsters try to run away from flares
|
||||
if (self->monsterinfo.flashTime > 0)
|
||||
{
|
||||
M_MoveAwayFromFlare (self, dist);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
// if we're going to a combat point, just proceed
|
||||
if (self->monsterinfo.aiflags & (AI_COMBAT_POINT | AI_CHASE_THING))
|
||||
{
|
||||
|
@ -1738,16 +1756,16 @@ void ai_run (edict_t *self, float dist)
|
|||
// self->ideal_yaw = v_forward[YAW];
|
||||
// gi.dprintf("seeking hintpath. origin: %s %0.1f\n", vtos(v), self->ideal_yaw);
|
||||
M_MoveToGoal (self, dist);
|
||||
if(!self->inuse)
|
||||
if (!self->inuse)
|
||||
return; // PGM - g_touchtrigger free problem
|
||||
// return;
|
||||
|
||||
// if we've already seen the player, and can't see him now, return
|
||||
// if(self->enemy && !visible(self, self->enemy))
|
||||
// if (self->enemy && !visible(self, self->enemy))
|
||||
// return;
|
||||
|
||||
// if not and can't find the player, return
|
||||
// if(!FindTarget(self))
|
||||
// if (!FindTarget(self))
|
||||
// return;
|
||||
|
||||
// first off, make sure we're looking for the player, not a noise he made
|
||||
|
@ -1789,14 +1807,14 @@ void ai_run (edict_t *self, float dist)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(self->enemy && visible(self, realEnemy))
|
||||
if (self->enemy && visible(self, realEnemy))
|
||||
gotcha = true;
|
||||
}
|
||||
|
||||
// if we see the player, stop following hintpaths.
|
||||
if (gotcha)
|
||||
{
|
||||
// if(g_showlogic && g_showlogic->value)
|
||||
// if (g_showlogic && g_showlogic->value)
|
||||
// gi.dprintf("stopped following hint paths in ai_run\n");
|
||||
|
||||
// disconnect from hintpaths and start looking normally for players.
|
||||
|
@ -1827,7 +1845,7 @@ void ai_run (edict_t *self, float dist)
|
|||
// PMM - prevent double moves for sound_targets
|
||||
alreadyMoved = true;
|
||||
// pmm
|
||||
if(!self->inuse)
|
||||
if (!self->inuse)
|
||||
return; // PGM - g_touchtrigger free problem
|
||||
|
||||
if (!FindTarget (self))
|
||||
|
@ -1910,7 +1928,7 @@ void ai_run (edict_t *self, float dist)
|
|||
// PMM - check for alreadyMoved
|
||||
if (!alreadyMoved)
|
||||
M_MoveToGoal (self, dist);
|
||||
if(!self->inuse)
|
||||
if (!self->inuse)
|
||||
return; // PGM - g_touchtrigger free problem
|
||||
|
||||
self->monsterinfo.aiflags &= ~AI_LOST_SIGHT;
|
||||
|
@ -1927,14 +1945,14 @@ void ai_run (edict_t *self, float dist)
|
|||
//PGM
|
||||
// if we've been looking (unsuccessfully) for the player for 10 seconds
|
||||
// PMM - reduced to 5, makes them much nastier
|
||||
if((self->monsterinfo.trail_time + 5) <= level.time)
|
||||
if ((self->monsterinfo.trail_time + 5) <= level.time)
|
||||
{
|
||||
// and we haven't checked for valid hint paths in the last 10 seconds
|
||||
if((self->monsterinfo.last_hint_time + 10) <= level.time)
|
||||
if ((self->monsterinfo.last_hint_time + 10) <= level.time)
|
||||
{
|
||||
// check for hint_paths.
|
||||
self->monsterinfo.last_hint_time = level.time;
|
||||
if(monsterlost_checkhint(self))
|
||||
if (monsterlost_checkhint(self))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2090,7 +2108,7 @@ void ai_run (edict_t *self, float dist)
|
|||
}
|
||||
|
||||
M_MoveToGoal (self, dist);
|
||||
if(!self->inuse)
|
||||
if (!self->inuse)
|
||||
return; // PGM - g_touchtrigger free problem
|
||||
|
||||
G_FreeEdict(tempgoal);
|
||||
|
@ -2112,25 +2130,25 @@ qboolean ai_chicken (edict_t *self, edict_t *badguy)
|
|||
trace_t trace1, trace2;
|
||||
|
||||
// No point in hiding from attacker if he's gone
|
||||
if(!badguy || !badguy->inuse)
|
||||
if (!badguy || !badguy->inuse)
|
||||
return false;
|
||||
|
||||
if(!self || !self->inuse || (self->health <= 0))
|
||||
if (!self || !self->inuse || (self->health <= 0))
|
||||
return false;
|
||||
|
||||
if(!actorchicken->value)
|
||||
if (!actorchicken->value)
|
||||
return false;
|
||||
|
||||
// If we've already been here, quit
|
||||
if(self->monsterinfo.aiflags & AI_CHICKEN)
|
||||
if (self->monsterinfo.aiflags & AI_CHICKEN)
|
||||
{
|
||||
if(self->movetarget && !Q_stricmp(self->movetarget->classname,"thing"))
|
||||
if (self->movetarget && !Q_stricmp(self->movetarget->classname,"thing"))
|
||||
return true;
|
||||
}
|
||||
|
||||
VectorCopy(self->mins,mins);
|
||||
mins[2] += 18;
|
||||
if(mins[2] > 0) mins[2] = 0;
|
||||
if (mins[2] > 0) mins[2] = 0;
|
||||
VectorCopy(self->maxs,maxs);
|
||||
|
||||
// Find a vector that will hide the actor from his enemy
|
||||
|
@ -2141,7 +2159,7 @@ qboolean ai_chicken (edict_t *self, edict_t *badguy)
|
|||
dir[2] = 0;
|
||||
for (travel=512; travel>63 && best_dist == 0; travel /= 2)
|
||||
{
|
||||
for(i=0; i<5 && best_dist == 0; i++)
|
||||
for (i=0; i<5 && best_dist == 0; i++)
|
||||
{
|
||||
yaw = self->s.angles[YAW] + chase_angle[i];
|
||||
yaw = (int)(yaw/45)*45;
|
||||
|
@ -2155,29 +2173,29 @@ qboolean ai_chicken (edict_t *self, edict_t *badguy)
|
|||
// isn't foolproof - tests against 1) new origin, 2) new origin + maxs,
|
||||
// 3) new origin + mins, and 4) new origin + min x,y, max z.
|
||||
trace2 = gi.trace(trace1.endpos,NULL,NULL,atk,self,MASK_SOLID);
|
||||
if(trace2.fraction == 1.0) continue;
|
||||
if (trace2.fraction == 1.0) continue;
|
||||
|
||||
VectorAdd(trace1.endpos,self->maxs,testpos);
|
||||
trace2 = gi.trace(testpos,NULL,NULL,atk,self,MASK_SOLID);
|
||||
if(trace2.fraction == 1.0) continue;
|
||||
if (trace2.fraction == 1.0) continue;
|
||||
|
||||
VectorAdd(trace1.endpos,self->mins,testpos);
|
||||
trace2 = gi.trace(testpos,NULL,NULL,atk,self,MASK_SOLID);
|
||||
if(trace2.fraction == 1.0) continue;
|
||||
if (trace2.fraction == 1.0) continue;
|
||||
|
||||
testpos[2] = trace1.endpos[2] + self->maxs[2];
|
||||
trace2 = gi.trace(testpos,NULL,NULL,atk,self,MASK_SOLID);
|
||||
if(trace2.fraction == 1.0) continue;
|
||||
if (trace2.fraction == 1.0) continue;
|
||||
|
||||
best_dist = trace1.fraction * travel;
|
||||
if(best_dist < 32) // not much point to this move
|
||||
if (best_dist < 32) // not much point to this move
|
||||
continue;
|
||||
VectorCopy(dir,best_dir);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
if(best_dist < 32)
|
||||
if (best_dist < 32)
|
||||
return false;
|
||||
|
||||
// This snaps the angles, which may not be all that good but it sure
|
||||
|
|
|
@ -16,11 +16,11 @@ void camera_off (edict_t *ent)
|
|||
return;
|
||||
if (!ent->client->spycam)
|
||||
return;
|
||||
if(ent->client->spycam->viewer == ent)
|
||||
if (ent->client->spycam->viewer == ent)
|
||||
ent->client->spycam->viewer = NULL;
|
||||
|
||||
ent->client->spycam->flags &= ~FL_ROBOT;
|
||||
if(ent->client->spycam->svflags & SVF_MONSTER)
|
||||
if (ent->client->spycam->svflags & SVF_MONSTER)
|
||||
ent->client->spycam->svflags &= ~SVF_NOCLIENT;
|
||||
VectorCopy(ent->client->camplayer->s.origin,ent->s.origin);
|
||||
gi.TagFree(ent->client->camplayer->client);
|
||||
|
@ -69,14 +69,14 @@ void camera_off (edict_t *ent)
|
|||
|
||||
void faker_animate(edict_t *self)
|
||||
{
|
||||
if(self->s.frame < 0 || self->s.frame > 39)
|
||||
if (self->s.frame < 0 || self->s.frame > 39)
|
||||
{
|
||||
self->s.frame = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->s.frame++;
|
||||
if(self->s.frame > 39)
|
||||
if (self->s.frame > 39)
|
||||
self->s.frame = 0;
|
||||
}
|
||||
self->nextthink = level.time + FRAMETIME;
|
||||
|
@ -181,10 +181,10 @@ edict_t *G_FindNextCamera (edict_t *camera, edict_t *monitor)
|
|||
{
|
||||
edict_t *next;
|
||||
|
||||
if(!monitor->target) return NULL;
|
||||
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))
|
||||
if (camera && (camera->svflags & SVF_MONSTER))
|
||||
{
|
||||
camera->svflags &= ~SVF_NOCLIENT;
|
||||
gi.linkentity(camera);
|
||||
|
@ -195,10 +195,10 @@ edict_t *G_FindNextCamera (edict_t *camera, edict_t *monitor)
|
|||
// 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 (!next) return NULL;
|
||||
if (!next->count) {
|
||||
|
||||
if(camera) {
|
||||
if (camera) {
|
||||
next = camera;
|
||||
next++;
|
||||
} else
|
||||
|
@ -241,35 +241,35 @@ edict_t *G_FindNextCamera (edict_t *camera, edict_t *monitor)
|
|||
} else {
|
||||
int which, start;
|
||||
|
||||
if(camera) {
|
||||
if (camera) {
|
||||
which = camera->count+1;
|
||||
if(which > monitor->count) which = 1;
|
||||
if (which > monitor->count) which = 1;
|
||||
}
|
||||
else
|
||||
which = 1;
|
||||
start = which;
|
||||
next = g_edicts+1;
|
||||
while(1) {
|
||||
if(next->targetname) {
|
||||
if(!Q_stricmp(next->targetname,monitor->target)) {
|
||||
if(next->count == which) {
|
||||
if(!next->inuse || (next->deadflag == DEAD_DEAD) ||
|
||||
while (1) {
|
||||
if (next->targetname) {
|
||||
if (!Q_stricmp(next->targetname,monitor->target)) {
|
||||
if (next->count == which) {
|
||||
if (!next->inuse || (next->deadflag == DEAD_DEAD) ||
|
||||
(!Q_stricmp (next->classname,"turret_breach") && (next->spawnflags & 16)) )
|
||||
{
|
||||
next = g_edicts;
|
||||
which++;
|
||||
if(which > monitor->count) which=1;
|
||||
if(which == start) return NULL;
|
||||
if (which > monitor->count) which=1;
|
||||
if (which == start) return NULL;
|
||||
} else
|
||||
goto found_one;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(next == &g_edicts[globals.num_edicts-1]) {
|
||||
if (next == &g_edicts[globals.num_edicts-1]) {
|
||||
next = g_edicts;
|
||||
which++;
|
||||
if(which > monitor->count) which = 1;
|
||||
if(which == start) return NULL;
|
||||
if (which > monitor->count) which = 1;
|
||||
if (which == start) return NULL;
|
||||
}
|
||||
next++;
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ edict_t *G_FindNextCamera (edict_t *camera, edict_t *monitor)
|
|||
return NULL;
|
||||
|
||||
found_one:
|
||||
if(!(monitor->spawnflags & 32) && (next->svflags & SVF_MONSTER))
|
||||
if (!(monitor->spawnflags & 32) && (next->svflags & SVF_MONSTER))
|
||||
next->svflags |= SVF_NOCLIENT;
|
||||
return next;
|
||||
}
|
||||
|
@ -287,10 +287,10 @@ edict_t *G_FindPrevCamera (edict_t *camera, edict_t *monitor)
|
|||
edict_t *prev;
|
||||
edict_t *newcamera;
|
||||
|
||||
if(!monitor->target) return NULL;
|
||||
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))
|
||||
if (camera && (camera->svflags & SVF_MONSTER))
|
||||
{
|
||||
camera->svflags &= ~SVF_NOCLIENT;
|
||||
gi.linkentity(camera);
|
||||
|
@ -301,14 +301,14 @@ edict_t *G_FindPrevCamera (edict_t *camera, edict_t *monitor)
|
|||
// 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)
|
||||
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;
|
||||
if (newcamera) goto found_one;
|
||||
continue;
|
||||
}
|
||||
if (!prev->inuse)
|
||||
|
@ -329,25 +329,25 @@ edict_t *G_FindPrevCamera (edict_t *camera, edict_t *monitor)
|
|||
{
|
||||
int which, start;
|
||||
|
||||
if(camera) {
|
||||
if (camera) {
|
||||
which = camera->count-1;
|
||||
if(which <= 0) which = monitor->count;
|
||||
if (which <= 0) which = monitor->count;
|
||||
}
|
||||
else
|
||||
which = monitor->count;
|
||||
start = which;
|
||||
prev = g_edicts+1;
|
||||
while(1) {
|
||||
if(prev->targetname) {
|
||||
if(!Q_stricmp(prev->targetname,monitor->target)) {
|
||||
if(prev->count == which) {
|
||||
if(!prev->inuse || (prev->deadflag == DEAD_DEAD) ||
|
||||
while (1) {
|
||||
if (prev->targetname) {
|
||||
if (!Q_stricmp(prev->targetname,monitor->target)) {
|
||||
if (prev->count == which) {
|
||||
if (!prev->inuse || (prev->deadflag == DEAD_DEAD) ||
|
||||
(!Q_stricmp (prev->classname,"turret_breach") && (prev->spawnflags & 16)))
|
||||
{
|
||||
prev = g_edicts;
|
||||
which--;
|
||||
if(which <= 0) which=monitor->count;
|
||||
if(which == start) return NULL;
|
||||
if (which <= 0) which=monitor->count;
|
||||
if (which == start) return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -357,11 +357,11 @@ edict_t *G_FindPrevCamera (edict_t *camera, edict_t *monitor)
|
|||
}
|
||||
}
|
||||
}
|
||||
if(prev == &g_edicts[globals.num_edicts-1]) {
|
||||
if (prev == &g_edicts[globals.num_edicts-1]) {
|
||||
prev = g_edicts;
|
||||
which--;
|
||||
if(which <= 0) which=monitor->count;
|
||||
if(which == start) return NULL;
|
||||
if (which <= 0) which=monitor->count;
|
||||
if (which == start) return NULL;
|
||||
}
|
||||
prev++;
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ edict_t *G_FindPrevCamera (edict_t *camera, edict_t *monitor)
|
|||
|
||||
found_one:
|
||||
if (newcamera) { // Knightmare added- check this pointer!
|
||||
if(!(monitor->spawnflags & 32) && (newcamera->svflags & SVF_MONSTER))
|
||||
if (!(monitor->spawnflags & 32) && (newcamera->svflags & SVF_MONSTER))
|
||||
newcamera->svflags |= SVF_NOCLIENT;
|
||||
}
|
||||
return newcamera;
|
||||
|
@ -379,12 +379,12 @@ 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
|
||||
if (!activator->client) return;
|
||||
if (activator->client->spycam) // already using camera
|
||||
return;
|
||||
|
||||
target = G_FindNextCamera(NULL,self);
|
||||
if(!target) return;
|
||||
if (!target) return;
|
||||
|
||||
// if currently in thirdperson, turn that sucker off
|
||||
if (activator->client->chaseactive)
|
||||
|
@ -413,15 +413,15 @@ void func_monitor_init (edict_t *self)
|
|||
|
||||
self->count = 0;
|
||||
camera = NULL;
|
||||
while( (camera=G_Find(camera,FOFS(targetname),self->target)) != NULL)
|
||||
while ( (camera=G_Find(camera,FOFS(targetname),self->target)) != NULL)
|
||||
self->count++;
|
||||
if(!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 )
|
||||
if ( !self->target )
|
||||
{
|
||||
gi.dprintf("func_monitor without a target at %s\n",vtos(self->s.origin));
|
||||
G_FreeEdict(self);
|
||||
|
|
|
@ -148,8 +148,8 @@ void ValidateSelectedItem (edict_t *ent)
|
|||
|
||||
static void Cmd_Give_Usage (edict_t *ent, char *parm1)
|
||||
{
|
||||
gi.cprintf (ent, PRINT_HIGH, "usage: give %s {xatrix | rogue | neither | both}\n", parm1);
|
||||
// gi.cprintf (ent, PRINT_HIGH, "usage: give %s {xatrix | rogue | zaero | neither | both}\n", parm1);
|
||||
// gi.cprintf (ent, PRINT_HIGH, "usage: give %s {xatrix | rogue | neither | both}\n", parm1);
|
||||
gi.cprintf (ent, PRINT_HIGH, "usage: give %s {xatrix | rogue | lm | zaero | neither | both}\n", parm1);
|
||||
}
|
||||
|
||||
qboolean Cmd_Give_ParseFlags (edict_t *ent, char *parm1, int *flags)
|
||||
|
@ -167,9 +167,11 @@ qboolean Cmd_Give_ParseFlags (edict_t *ent, char *parm1, int *flags)
|
|||
*flags |= 4;
|
||||
else if (Q_stricmp(gi.argv(2), "both") == 0)
|
||||
*flags |= 6;
|
||||
// else if (Q_stricmp(gi.argv(2), "zaero") == 0)
|
||||
// *flags |= 8;
|
||||
else if (Q_stricmp(gi.argv(2), "neither")) {
|
||||
else if (Q_stricmp(gi.argv(2), "lm") == 0)
|
||||
*flags |= 8;
|
||||
else if (Q_stricmp(gi.argv(2), "zaero") == 0)
|
||||
*flags |= 16;
|
||||
else if (Q_stricmp(gi.argv(2), "neither") != 0) {
|
||||
Cmd_Give_Usage (ent, parm1);
|
||||
return false;
|
||||
}
|
||||
|
@ -204,7 +206,7 @@ void Cmd_Give_f (edict_t *ent)
|
|||
|
||||
name = gi.args();
|
||||
|
||||
if (!Q_stricmp(name,"jetpack"))
|
||||
if (!Q_stricmp(name, "jetpack"))
|
||||
{
|
||||
gitem_t *fuel;
|
||||
fuel = FindItem("fuel");
|
||||
|
@ -254,7 +256,9 @@ void Cmd_Give_f (edict_t *ent)
|
|||
continue;
|
||||
if ( (it->flags & IT_ROGUE) && !(give_flags & 4) )
|
||||
continue;
|
||||
if ( (it->flags & IT_ZAERO) && !(give_flags & 8) )
|
||||
if ( (it->flags & IT_LM) && !(give_flags & 8) )
|
||||
continue;
|
||||
if ( (it->flags & IT_ZAERO) && !(give_flags & 16) )
|
||||
continue;
|
||||
ent->client->pers.inventory[i] += 1;
|
||||
}
|
||||
|
@ -276,7 +280,9 @@ void Cmd_Give_f (edict_t *ent)
|
|||
continue;
|
||||
if ( (it->flags & IT_ROGUE) && !(give_flags & 4) )
|
||||
continue;
|
||||
if ( (it->flags & IT_ZAERO) && !(give_flags & 8) )
|
||||
if ( (it->flags & IT_LM) && !(give_flags & 8) )
|
||||
continue;
|
||||
if ( (it->flags & IT_ZAERO) && !(give_flags & 16) )
|
||||
continue;
|
||||
if (it->classname && !Q_stricmp(it->classname,"ammo_fuel") && !developer->value)
|
||||
continue;
|
||||
|
@ -335,7 +341,9 @@ void Cmd_Give_f (edict_t *ent)
|
|||
continue;
|
||||
if ( (it->flags & IT_ROGUE) && !(give_flags & 4) )
|
||||
continue;
|
||||
if ( (it->flags & IT_ZAERO) && !(give_flags & 8) )
|
||||
if ( (it->flags & IT_LM) && !(give_flags & 8) )
|
||||
continue;
|
||||
if ( (it->flags & IT_ZAERO) && !(give_flags & 16) )
|
||||
continue;
|
||||
if (it->classname && !Q_stricmp(it->classname,"item_jetpack") && !developer->value)
|
||||
continue;
|
||||
|
@ -364,13 +372,13 @@ void Cmd_Give_f (edict_t *ent)
|
|||
return;
|
||||
}
|
||||
|
||||
//ROGUE
|
||||
// ROGUE
|
||||
if (it->flags & IT_NOT_GIVEABLE)
|
||||
{
|
||||
gi.dprintf ("item cannot be given\n");
|
||||
return;
|
||||
}
|
||||
//ROGUE
|
||||
// ROGUE
|
||||
|
||||
index = ITEM_INDEX(it);
|
||||
|
||||
|
@ -384,6 +392,15 @@ void Cmd_Give_f (edict_t *ent)
|
|||
else
|
||||
ent->client->pers.inventory[index] += it->quantity;
|
||||
}
|
||||
// Zaero- special case for "plasma shield"
|
||||
else if (it->tag == AMMO_PLASMASHIELD)
|
||||
{
|
||||
if (gi.argc() == 4)
|
||||
ent->client->pers.inventory[index] = atoi(gi.argv(3));
|
||||
else
|
||||
ent->client->pers.inventory[index] += it->quantity;
|
||||
}
|
||||
// end Zaero
|
||||
else
|
||||
{
|
||||
if (gi.argc() == 3)
|
||||
|
@ -527,19 +544,19 @@ void Cmd_Use_f (edict_t *ent)
|
|||
}
|
||||
index = ITEM_INDEX(it);
|
||||
#ifdef JETPACK_MOD
|
||||
if(!Q_stricmp(s,"jetpack"))
|
||||
if (!Q_stricmp(s,"jetpack"))
|
||||
{
|
||||
// Special case - turns on/off
|
||||
if(!ent->client->jetpack)
|
||||
if (!ent->client->jetpack)
|
||||
{
|
||||
if(ent->waterlevel > 0)
|
||||
if (ent->waterlevel > 0)
|
||||
return;
|
||||
if(!ent->client->pers.inventory[index])
|
||||
if (!ent->client->pers.inventory[index])
|
||||
{
|
||||
gi.cprintf(ent, PRINT_HIGH, "Out of item: %s\n", s);
|
||||
return;
|
||||
}
|
||||
else if(ent->client->pers.inventory[fuel_index] <= 0)
|
||||
else if (ent->client->pers.inventory[fuel_index] <= 0)
|
||||
{
|
||||
gi.cprintf(ent, PRINT_HIGH, "No fuel for: %s\n", s);
|
||||
return;
|
||||
|
@ -553,7 +570,7 @@ void Cmd_Use_f (edict_t *ent)
|
|||
if (!Q_stricmp(s,"stasis generator"))
|
||||
{
|
||||
// Special case - turn freeze off if already on
|
||||
if(level.freeze)
|
||||
if (level.freeze)
|
||||
{
|
||||
level.freeze = false;
|
||||
level.freezeframes = 0;
|
||||
|
@ -640,7 +657,7 @@ void Cmd_Inven_f (edict_t *ent)
|
|||
// Don't show "No Weapon" or "Homing Rocket Launcher" in inventory
|
||||
if ((i == noweapon_index) || (i == hml_index))
|
||||
gi.WriteShort (0);
|
||||
else if((i == fuel_index) && (ent->client->jetpack_infinite))
|
||||
else if ((i == fuel_index) && (ent->client->jetpack_infinite))
|
||||
gi.WriteShort (0);
|
||||
else
|
||||
gi.WriteShort (cl->pers.inventory[i]);
|
||||
|
@ -672,13 +689,13 @@ void Cmd_InvUse_f (edict_t *ent)
|
|||
return;
|
||||
}
|
||||
#ifdef JETPACK_MOD
|
||||
if(!Q_stricmp(it->classname,"item_jetpack"))
|
||||
if (!Q_stricmp(it->classname,"item_jetpack"))
|
||||
{
|
||||
if(!ent->client->jetpack)
|
||||
if (!ent->client->jetpack)
|
||||
{
|
||||
if(ent->waterlevel > 0)
|
||||
if (ent->waterlevel > 0)
|
||||
return;
|
||||
if(ent->client->pers.inventory[fuel_index] <= 0)
|
||||
if (ent->client->pers.inventory[fuel_index] <= 0)
|
||||
{
|
||||
gi.cprintf(ent, PRINT_HIGH, "No fuel for jetpack\n" );
|
||||
return;
|
||||
|
@ -832,7 +849,7 @@ Cmd_Kill_f
|
|||
*/
|
||||
void Cmd_Kill_f (edict_t *ent)
|
||||
{
|
||||
if((level.time - ent->client->respawn_time) < 5)
|
||||
if ((level.time - ent->client->respawn_time) < 5)
|
||||
return;
|
||||
ent->flags &= ~FL_GODMODE;
|
||||
ent->health = 0;
|
||||
|
@ -840,7 +857,7 @@ void Cmd_Kill_f (edict_t *ent)
|
|||
|
||||
//ROGUE
|
||||
// make sure no trackers are still hurting us.
|
||||
if(ent->client->tracker_pain_framenum)
|
||||
if (ent->client->tracker_pain_framenum)
|
||||
RemoveAttackingPainDaemons (ent);
|
||||
|
||||
if (ent->client->owned_sphere)
|
||||
|
@ -867,6 +884,11 @@ void Cmd_PutAway_f (edict_t *ent)
|
|||
PMenu_Close(ent);
|
||||
if (ent->client->textdisplay)
|
||||
Text_Close(ent);
|
||||
|
||||
// Zaero
|
||||
if (ent->client->zCameraTrack)
|
||||
stopCamera(ent);
|
||||
// end Zaero
|
||||
}
|
||||
|
||||
|
||||
|
@ -1082,7 +1104,7 @@ void Cmd_Ent_Count_f (edict_t *ent)
|
|||
|
||||
for (e=g_edicts;e < &g_edicts[globals.num_edicts] ; e++)
|
||||
{
|
||||
if(e->inuse)
|
||||
if (e->inuse)
|
||||
x++;
|
||||
}
|
||||
|
||||
|
@ -1211,9 +1233,9 @@ void Cmd_Bbox_f (edict_t *ent)
|
|||
{
|
||||
edict_t *viewing;
|
||||
|
||||
viewing = LookingAt(ent, 0, NULL, NULL);
|
||||
if(!viewing) return;
|
||||
DrawBBox(viewing);
|
||||
viewing = LookingAt (ent, 0, NULL, NULL);
|
||||
if (!viewing) return;
|
||||
DrawBBox (viewing);
|
||||
}
|
||||
|
||||
void SetLazarusCrosshair (edict_t *ent)
|
||||
|
@ -1313,19 +1335,20 @@ Cmd_attack2_f
|
|||
Alternate firing mode
|
||||
=====================
|
||||
*/
|
||||
/*void Cmd_attack2_f(edict_t *ent, qboolean bOn)
|
||||
/*
|
||||
void Cmd_attack2_f(edict_t *ent, qboolean bOn)
|
||||
{
|
||||
if(!ent->client) return;
|
||||
if(ent->health <= 0) return;
|
||||
if (!ent->client) return;
|
||||
if (ent->health <= 0) return;
|
||||
|
||||
if(bOn)
|
||||
if (bOn)
|
||||
{
|
||||
ent->client->pers.fire_mode=1;
|
||||
ent->client->pers.fire_mode = 1;
|
||||
//ent->client->nNewLatch |= BUTTON_ATTACK2;
|
||||
}
|
||||
else
|
||||
{
|
||||
ent->client->pers.fire_mode=0;
|
||||
ent->client->pers.fire_mode = 0;
|
||||
//ent->client->nNewLatch &= ~BUTTON_ATTACK2;
|
||||
}
|
||||
}*/
|
||||
|
@ -1338,35 +1361,35 @@ void decoy_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage,
|
|||
|
||||
void decoy_think(edict_t *self)
|
||||
{
|
||||
if(self->s.frame < 0 || self->s.frame > 39)
|
||||
if (self->s.frame < 0 || self->s.frame > 39)
|
||||
{
|
||||
self->s.frame = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->s.frame++;
|
||||
if(self->s.frame > 39)
|
||||
if (self->s.frame > 39)
|
||||
self->s.frame = 0;
|
||||
}
|
||||
|
||||
// Every 2 seconds, make visible monsters mad at me
|
||||
if(level.framenum % 20 == 0)
|
||||
if (level.framenum % 20 == 0)
|
||||
{
|
||||
edict_t *e;
|
||||
int i;
|
||||
|
||||
for(i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
for (i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
{
|
||||
e = &g_edicts[i];
|
||||
if(!e->inuse)
|
||||
if (!e->inuse)
|
||||
continue;
|
||||
if(!(e->svflags & SVF_MONSTER))
|
||||
if (!(e->svflags & SVF_MONSTER))
|
||||
continue;
|
||||
if(e->monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
if (e->monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
continue;
|
||||
if(!visible(e,self))
|
||||
if (!visible(e,self))
|
||||
continue;
|
||||
if(e->enemy == self)
|
||||
if (e->enemy == self)
|
||||
continue;
|
||||
e->enemy = e->goalentity = self;
|
||||
e->monsterinfo.aiflags |= AI_TARGET_ANGER;
|
||||
|
@ -1403,7 +1426,7 @@ void SpawnForcewall(edict_t *player)
|
|||
tr = gi.trace(start,NULL,NULL,point,player,MASK_SOLID);
|
||||
VectorCopy(tr.endpos,wall->s.origin);
|
||||
|
||||
if(fabs(forward[0]) > fabs(forward[1]))
|
||||
if (fabs(forward[0]) > fabs(forward[1]))
|
||||
{
|
||||
wall->pos1[0] = wall->pos2[0] = wall->s.origin[0];
|
||||
wall->mins[0] = -1;
|
||||
|
@ -1468,12 +1491,12 @@ void ForcewallOff(edict_t *player)
|
|||
AngleVectors(player->client->v_angle,forward,NULL,NULL);
|
||||
VectorMA(start, WORLD_SIZE, forward, point); // was 8192
|
||||
tr = gi.trace(start,NULL,NULL,point,player,MASK_SHOT);
|
||||
if(Q_stricmp(tr.ent->classname,"forcewall"))
|
||||
if (Q_stricmp(tr.ent->classname,"forcewall"))
|
||||
{
|
||||
gi.cprintf(player,PRINT_HIGH,"Not a forcewall!\n");
|
||||
return;
|
||||
}
|
||||
if(tr.ent->activator != player)
|
||||
if (tr.ent->activator != player)
|
||||
{
|
||||
gi.cprintf(player,PRINT_HIGH,"You don't own this forcewall, bub!\n");
|
||||
return;
|
||||
|
@ -1500,11 +1523,37 @@ void ClientCommand (edict_t *ent)
|
|||
return; // not fully in game yet
|
||||
|
||||
cmd = gi.argv(0);
|
||||
if(gi.argc() < 2)
|
||||
if (gi.argc() < 2)
|
||||
parm = NULL;
|
||||
else
|
||||
parm = gi.argv(1);
|
||||
|
||||
// Zaero
|
||||
// if we're viewing thru the camera, only allow some things to happen
|
||||
if (ent->client->zCameraTrack && !level.intermissiontime)
|
||||
{
|
||||
if (Q_stricmp (cmd, "putaway") == 0)
|
||||
Cmd_PutAway_f (ent);
|
||||
else if (Q_stricmp(cmd, "use") == 0)
|
||||
{
|
||||
if (Q_stricmp(gi.args(), "Visor") == 0)
|
||||
Cmd_Use_f (ent);
|
||||
}
|
||||
else if (Q_stricmp (cmd, "invuse") == 0)
|
||||
{
|
||||
// only use the visor
|
||||
if (ent->client->pers.selected_item == ITEM_INDEX(FindItem("Visor")))
|
||||
Cmd_InvUse_f (ent);
|
||||
}
|
||||
else if (Q_stricmp (cmd, "invnext") == 0)
|
||||
SelectNextItem (ent, -1);
|
||||
else if (Q_stricmp (cmd, "invprev") == 0)
|
||||
SelectPrevItem (ent, -1);
|
||||
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
if (Q_stricmp (cmd, "players") == 0)
|
||||
{
|
||||
Cmd_Players_f (ent);
|
||||
|
@ -1606,11 +1655,11 @@ void ClientCommand (edict_t *ent)
|
|||
// zoom
|
||||
else if (!Q_stricmp(cmd, "zoomin"))
|
||||
{
|
||||
if(!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
if (!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
{
|
||||
if(ent->client->ps.fov > 5)
|
||||
if (ent->client->ps.fov > 5)
|
||||
{
|
||||
if(cl_gun->value)
|
||||
if (cl_gun->value)
|
||||
stuffcmd(ent,"cl_gun 0\n");
|
||||
ent->client->frame_zoomrate = zoomrate->value * ent->client->secs_per_frame;
|
||||
ent->client->zooming = 1;
|
||||
|
@ -1620,11 +1669,11 @@ void ClientCommand (edict_t *ent)
|
|||
}
|
||||
else if (!Q_stricmp(cmd, "zoomout"))
|
||||
{
|
||||
if(!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
if (!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
{
|
||||
if(ent->client->ps.fov < ent->client->original_fov)
|
||||
if (ent->client->ps.fov < ent->client->original_fov)
|
||||
{
|
||||
if(cl_gun->value)
|
||||
if (cl_gun->value)
|
||||
stuffcmd(ent,"cl_gun 0\n");
|
||||
ent->client->frame_zoomrate = zoomrate->value * ent->client->secs_per_frame;
|
||||
ent->client->zooming = -1;
|
||||
|
@ -1634,9 +1683,9 @@ void ClientCommand (edict_t *ent)
|
|||
}
|
||||
else if (!Q_stricmp(cmd, "zoom"))
|
||||
{
|
||||
if(!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
if (!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
{
|
||||
if(!parm)
|
||||
if (!parm)
|
||||
{
|
||||
gi.dprintf("syntax: zoom [0/1] (0=off, 1=on)\n");
|
||||
}
|
||||
|
@ -1651,7 +1700,7 @@ void ClientCommand (edict_t *ent)
|
|||
{
|
||||
ent->client->ps.fov = zoomsnap->value;
|
||||
ent->client->pers.hand = 2;
|
||||
if(cl_gun->value)
|
||||
if (cl_gun->value)
|
||||
stuffcmd(ent,"cl_gun 0\n");
|
||||
ent->client->zooming = 0;
|
||||
ent->client->zoomed = true;
|
||||
|
@ -1661,9 +1710,9 @@ void ClientCommand (edict_t *ent)
|
|||
}
|
||||
else if (!Q_stricmp(cmd, "zoomoff"))
|
||||
{
|
||||
if(!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
if (!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
{
|
||||
if(ent->client->zoomed && !ent->client->zooming)
|
||||
if (ent->client->zoomed && !ent->client->zooming)
|
||||
{
|
||||
ent->client->ps.fov = ent->client->original_fov;
|
||||
ent->client->zooming = 0;
|
||||
|
@ -1674,13 +1723,13 @@ void ClientCommand (edict_t *ent)
|
|||
}
|
||||
else if (!Q_stricmp(cmd, "zoomon"))
|
||||
{
|
||||
if(!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
if (!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
{
|
||||
if(!ent->client->zoomed && !ent->client->zooming)
|
||||
if (!ent->client->zoomed && !ent->client->zooming)
|
||||
{
|
||||
ent->client->ps.fov = zoomsnap->value;
|
||||
ent->client->pers.hand = 2;
|
||||
if(cl_gun->value)
|
||||
if (cl_gun->value)
|
||||
stuffcmd(ent,"cl_gun 0\n");
|
||||
ent->client->zooming = 0;
|
||||
ent->client->zoomed = true;
|
||||
|
@ -1690,12 +1739,12 @@ void ClientCommand (edict_t *ent)
|
|||
}
|
||||
else if (!Q_stricmp(cmd, "zoominstop"))
|
||||
{
|
||||
if(!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
if (!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
{
|
||||
if(ent->client->zooming > 0)
|
||||
if (ent->client->zooming > 0)
|
||||
{
|
||||
ent->client->zooming = 0;
|
||||
if(ent->client->ps.fov == ent->client->original_fov)
|
||||
if (ent->client->ps.fov == ent->client->original_fov)
|
||||
{
|
||||
ent->client->zoomed = false;
|
||||
SetSensitivities(ent,true);
|
||||
|
@ -1710,12 +1759,12 @@ void ClientCommand (edict_t *ent)
|
|||
}
|
||||
else if (!Q_stricmp(cmd, "zoomoutstop"))
|
||||
{
|
||||
if(!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
if (!deathmatch->value && !coop->value && !ent->client->chasetoggle)
|
||||
{
|
||||
if(ent->client->zooming < 0)
|
||||
if (ent->client->zooming < 0)
|
||||
{
|
||||
ent->client->zooming = 0;
|
||||
if(ent->client->ps.fov == ent->client->original_fov)
|
||||
if (ent->client->ps.fov == ent->client->original_fov)
|
||||
{
|
||||
ent->client->zoomed = false;
|
||||
SetSensitivities(ent,true);
|
||||
|
@ -1729,18 +1778,18 @@ void ClientCommand (edict_t *ent)
|
|||
}
|
||||
}
|
||||
#ifndef DISABLE_FMOD
|
||||
else if(!Q_stricmp(cmd, "playsound"))
|
||||
else if (!Q_stricmp(cmd, "playsound"))
|
||||
{
|
||||
vec3_t pos = {0, 0, 0};
|
||||
vec3_t vel = {0, 0, 0};
|
||||
if(s_primary->value)
|
||||
if (s_primary->value)
|
||||
{
|
||||
gi.dprintf("target_playback requires s_primary be set to 0.\n"
|
||||
"At the console type:\n"
|
||||
"s_primary 0;sound_restart\n");
|
||||
return;
|
||||
}
|
||||
if(parm)
|
||||
if (parm)
|
||||
{
|
||||
edict_t *temp;
|
||||
|
||||
|
@ -1749,7 +1798,7 @@ void ClientCommand (edict_t *ent)
|
|||
temp->message = parm;
|
||||
temp->volume = 255;
|
||||
|
||||
if( strstr(parm,".mod") ||
|
||||
if ( strstr(parm,".mod") ||
|
||||
strstr(parm,".s3m") ||
|
||||
strstr(parm,".xm") ||
|
||||
strstr(parm,".mid") )
|
||||
|
@ -1761,7 +1810,7 @@ void ClientCommand (edict_t *ent)
|
|||
else
|
||||
gi.dprintf("syntax: playsound <soundfile>, path relative to gamedir\n");
|
||||
}
|
||||
else if(!Q_stricmp(cmd,"sound_restart"))
|
||||
else if (!Q_stricmp(cmd,"sound_restart"))
|
||||
{
|
||||
// replacement for snd_restart to get around DirectSound/FMOD problem
|
||||
edict_t *temp;
|
||||
|
@ -1772,13 +1821,13 @@ void ClientCommand (edict_t *ent)
|
|||
temp->nextthink = level.time + 2;
|
||||
}
|
||||
#endif // DISABLE_FMOD
|
||||
else if(!Q_stricmp(cmd,"hud"))
|
||||
else if (!Q_stricmp(cmd,"hud"))
|
||||
{
|
||||
if(parm)
|
||||
if (parm)
|
||||
{
|
||||
int state = atoi(parm);
|
||||
|
||||
if(state)
|
||||
if (state)
|
||||
Hud_On();
|
||||
else
|
||||
Hud_Off();
|
||||
|
@ -1786,12 +1835,12 @@ void ClientCommand (edict_t *ent)
|
|||
else
|
||||
Cmd_ToggleHud();
|
||||
}
|
||||
else if(!Q_stricmp(cmd,"whatsit"))
|
||||
else if (!Q_stricmp(cmd,"whatsit"))
|
||||
{
|
||||
if(parm)
|
||||
if (parm)
|
||||
{
|
||||
int state = atoi(parm);
|
||||
if(state)
|
||||
if (state)
|
||||
world->effects |= FX_WORLDSPAWN_WHATSIT;
|
||||
else
|
||||
world->effects &= ~FX_WORLDSPAWN_WHATSIT;
|
||||
|
@ -1801,23 +1850,23 @@ void ClientCommand (edict_t *ent)
|
|||
}
|
||||
else if (!Q_stricmp(cmd,"bbox"))
|
||||
Cmd_Bbox_f (ent);
|
||||
else if(!Q_stricmp(cmd,"forcewall"))
|
||||
else if (!Q_stricmp(cmd,"forcewall"))
|
||||
SpawnForcewall(ent);
|
||||
else if(!Q_stricmp(cmd,"forcewall_off"))
|
||||
else if (!Q_stricmp(cmd,"forcewall_off"))
|
||||
ForcewallOff(ent);
|
||||
else if (!Q_stricmp(cmd,"freeze"))
|
||||
{
|
||||
if(level.freeze)
|
||||
if (level.freeze)
|
||||
level.freeze = false;
|
||||
else
|
||||
{
|
||||
if(ent->client->jetpack)
|
||||
if (ent->client->jetpack)
|
||||
gi.dprintf("Cannot use freeze while using jetpack\n");
|
||||
else
|
||||
level.freeze = true;
|
||||
}
|
||||
}
|
||||
else if(developer->value)
|
||||
else if (developer->value)
|
||||
{
|
||||
// if (!Q_stricmp(cmd,"lightswitch"))
|
||||
// ToggleLights();
|
||||
|
|
|
@ -113,7 +113,7 @@ void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, v
|
|||
|
||||
if ((targ->svflags & SVF_MONSTER) && (targ->deadflag != DEAD_DEAD))
|
||||
{
|
||||
// targ->svflags |= SVF_DEADMONSTER; // now treat as a different content type
|
||||
// targ->svflags |= SVF_DEADMONSTER; // now treat as a different content type
|
||||
// ROGUE - free up slot for spawned monster if it's spawned
|
||||
// if (targ->monsterinfo.aiflags & AI_SPAWNED_CARRIER)
|
||||
if (targ->monsterinfo.monsterflags & MFL_SPAWNED_CARRIER)
|
||||
|
@ -122,8 +122,8 @@ void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, v
|
|||
!strcmp(targ->monsterinfo.commander->classname, "monster_carrier"))
|
||||
{
|
||||
targ->monsterinfo.commander->monsterinfo.monster_slots++;
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("g_combat: freeing up carrier slot - %d left\n", targ->monsterinfo.commander->monsterinfo.monster_slots);
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("g_combat: freeing up carrier slot - %d left\n", targ->monsterinfo.commander->monsterinfo.monster_slots);
|
||||
}
|
||||
}
|
||||
// if (targ->monsterinfo.aiflags & AI_SPAWNED_MEDIC_C)
|
||||
|
@ -134,15 +134,14 @@ void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, v
|
|||
if (targ->monsterinfo.commander->inuse && !strcmp(targ->monsterinfo.commander->classname, "monster_medic_commander"))
|
||||
{
|
||||
targ->monsterinfo.commander->monsterinfo.monster_slots++;
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("g_combat: freeing up medic slot - %d left\n", targ->monsterinfo.commander->monsterinfo.monster_slots);
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("g_combat: freeing up medic slot - %d left\n", targ->monsterinfo.commander->monsterinfo.monster_slots);
|
||||
}
|
||||
// else
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("my commander is dead! he's a %s\n", targ->monsterinfo.commander->classname);
|
||||
// else if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("my commander is dead! he's a %s\n", targ->monsterinfo.commander->classname);
|
||||
}
|
||||
// else if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("My commander is GONE\n");
|
||||
// else if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("My commander is GONE\n");
|
||||
|
||||
}
|
||||
// if (targ->monsterinfo.aiflags & AI_SPAWNED_WIDOW)
|
||||
|
@ -154,21 +153,23 @@ void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, v
|
|||
{
|
||||
if (targ->monsterinfo.commander->monsterinfo.monster_used > 0)
|
||||
targ->monsterinfo.commander->monsterinfo.monster_used--;
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("g_combat: freeing up black widow slot - %d used\n", targ->monsterinfo.commander->monsterinfo.monster_used);
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("g_combat: freeing up black widow slot - %d used\n", targ->monsterinfo.commander->monsterinfo.monster_used);
|
||||
}
|
||||
}
|
||||
//Rogue
|
||||
// Rogue
|
||||
// if (!(targ->monsterinfo.aiflags & AI_GOOD_GUY) && !(targ->monsterinfo.aiflags & AI_DO_NOT_COUNT))
|
||||
if (!(targ->monsterinfo.aiflags & AI_GOOD_GUY) && !(targ->monsterinfo.monsterflags & MFL_DO_NOT_COUNT))
|
||||
// if ( !(targ->monsterinfo.aiflags & AI_GOOD_GUY) && !(targ->monsterinfo.monsterflags & MFL_DO_NOT_COUNT) )
|
||||
// Zaero- spawnflag 16 = do not count
|
||||
if ( !(targ->monsterinfo.aiflags & AI_GOOD_GUY) && !(targ->monsterinfo.monsterflags & MFL_DO_NOT_COUNT) && !(IsZaeroMap() && (targ->spawnflags & 16)) )
|
||||
{
|
||||
level.killed_monsters++;
|
||||
if (coop->value && attacker->client)
|
||||
attacker->client->resp.score++;
|
||||
// medics won't heal monsters that they kill themselves
|
||||
// PMM - now they will
|
||||
// if (strcmp(attacker->classname, "monster_medic") == 0)
|
||||
// targ->owner = attacker;
|
||||
// if (strcmp(attacker->classname, "monster_medic") == 0)
|
||||
// targ->owner = attacker;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -257,6 +258,13 @@ static int CheckPowerArmor (edict_t *ent, vec3_t point, vec3_t normal, int damag
|
|||
if (dflags & (DAMAGE_NO_ARMOR | DAMAGE_NO_POWER_ARMOR)) // PGM
|
||||
return 0;
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(ent, point))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
if (client)
|
||||
{
|
||||
power_armor_type = PowerArmorType (ent);
|
||||
|
@ -522,6 +530,12 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
qboolean new_tesla;
|
||||
qboolean is_turret;
|
||||
|
||||
// sanity check
|
||||
if (!targ || !targ->classname)
|
||||
return;
|
||||
if (!attacker || !attacker->classname)
|
||||
return;
|
||||
|
||||
// if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER))
|
||||
// return;
|
||||
|
||||
|
@ -537,7 +551,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
if (targ->flags & FL_ROBOT)
|
||||
return;
|
||||
|
||||
is_turret = (attacker->classname && !Q_stricmp(attacker->classname,"turret_breach"));
|
||||
is_turret = (attacker->classname && !Q_stricmp(attacker->classname, "turret_breach"));
|
||||
|
||||
//=======
|
||||
//ROGUE
|
||||
|
@ -584,34 +598,37 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
vec_t best_dist=0;
|
||||
trace_t trace1, trace2;
|
||||
|
||||
VectorCopy(targ->mins,mins);
|
||||
VectorCopy (targ->mins, mins);
|
||||
mins[2] += 16; // max step height? not sure about this
|
||||
if (mins[2] > 0) mins[2] = 0;
|
||||
VectorCopy(targ->maxs,maxs);
|
||||
if ( (attacker==world) ||
|
||||
(!Q_stricmp(attacker->classname,"func_door") ) ||
|
||||
(!Q_stricmp(attacker->classname,"func_water")) ||
|
||||
(!Q_stricmp(attacker->classname,"func_pushable")) )
|
||||
if (mins[2] > 0)
|
||||
mins[2] = 0;
|
||||
VectorCopy (targ->maxs, maxs);
|
||||
if ( (attacker == world) ||
|
||||
( attacker->classname &&
|
||||
( !Q_stricmp(attacker->classname, "func_door") ||
|
||||
!Q_stricmp(attacker->classname, "func_water") ||
|
||||
!Q_stricmp(attacker->classname, "func_pushable") )
|
||||
) )
|
||||
{
|
||||
// Just send the monster straight ahead and hope for the best.
|
||||
thing = SpawnThing();
|
||||
VectorCopy(targ->s.angles,thing->s.angles);
|
||||
AngleVectors(targ->s.angles,dir,NULL,NULL);
|
||||
VectorCopy (targ->s.angles, thing->s.angles);
|
||||
AngleVectors (targ->s.angles, dir, NULL, NULL);
|
||||
for (i=0; i<5; i++)
|
||||
{
|
||||
dir[2] = 0.1*i;
|
||||
VectorNormalize(dir);
|
||||
VectorMA(targ->s.origin, WORLD_SIZE, dir, end); // was 8192
|
||||
trace1 = gi.trace(targ->s.origin,mins,maxs,end,targ,MASK_MONSTERSOLID);
|
||||
VectorNormalize (dir);
|
||||
VectorMA (targ->s.origin, WORLD_SIZE, dir, end); // was 8192
|
||||
trace1 = gi.trace(targ->s.origin, mins, maxs, end, targ ,MASK_MONSTERSOLID);
|
||||
dist = trace1.fraction * WORLD_SIZE; // was 8192
|
||||
if (dist > best_dist)
|
||||
{
|
||||
best_dist = dist;
|
||||
VectorCopy(dir,best_dir);
|
||||
VectorCopy (dir, best_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!Q_stricmp(attacker->classname,"target_laser"))
|
||||
else if ( attacker->classname && !Q_stricmp(attacker->classname, "target_laser") )
|
||||
{
|
||||
// Send the monster in a direction perpendicular to laser
|
||||
// path, whichever direction is closest to current angles
|
||||
|
@ -619,18 +636,18 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
if (attacker->movedir[2] > 0.7)
|
||||
{
|
||||
// Just move straight ahead and hope for the best
|
||||
AngleVectors(targ->s.angles,best_dir,NULL,NULL);
|
||||
AngleVectors (targ->s.angles, best_dir, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy(attacker->movedir,best_dir);
|
||||
VectorCopy (attacker->movedir, best_dir);
|
||||
best_dir[2] = best_dir[0];
|
||||
best_dir[0] = -best_dir[1];
|
||||
best_dir[1] = best_dir[2];
|
||||
best_dir[2] = 0;
|
||||
AngleVectors(targ->s.angles,dir,NULL,NULL);
|
||||
if (DotProduct(best_dir,dir) < 0)
|
||||
VectorNegate(best_dir,best_dir);
|
||||
AngleVectors (targ->s.angles, dir,NULL,NULL);
|
||||
if (DotProduct(best_dir, dir) < 0)
|
||||
VectorNegate (best_dir, best_dir);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -641,15 +658,15 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
if (!VectorLength(attacker->size))
|
||||
{
|
||||
// point entity
|
||||
VectorCopy(attacker->s.origin,atk);
|
||||
VectorCopy (attacker->s.origin, atk);
|
||||
}
|
||||
else
|
||||
{
|
||||
// brush model... can't rely on origin
|
||||
VectorMA(attacker->mins,0.5,attacker->size,atk);
|
||||
VectorMA (attacker->mins, 0.5, attacker->size, atk);
|
||||
}
|
||||
VectorClear(best_dir);
|
||||
AngleVectors(targ->s.angles,forward,NULL,NULL);
|
||||
VectorClear (best_dir);
|
||||
AngleVectors (targ->s.angles, forward, NULL, NULL);
|
||||
for (i=0; i<32 && best_dist == 0; i++) {
|
||||
// Weight escape route tests in favor of forward-facing direction
|
||||
if (random() > 0.5)
|
||||
|
@ -664,10 +681,10 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
dir[1] = crandom();
|
||||
dir[2] = 0;
|
||||
}
|
||||
VectorNormalize(dir);
|
||||
VectorMA(targ->s.origin, WORLD_SIZE, dir, end); // was 8192
|
||||
trace1 = gi.trace(targ->s.origin,mins,maxs,end,targ,MASK_MONSTERSOLID);
|
||||
trace2 = gi.trace(trace1.endpos,NULL,NULL,atk,targ,MASK_SOLID);
|
||||
VectorNormalize (dir);
|
||||
VectorMA (targ->s.origin, WORLD_SIZE, dir, end); // was 8192
|
||||
trace1 = gi.trace (targ->s.origin, mins, maxs, end, targ, MASK_MONSTERSOLID);
|
||||
trace2 = gi.trace (trace1.endpos, NULL, NULL, atk, targ, MASK_SOLID);
|
||||
if (trace2.fraction == 1.0) continue;
|
||||
dist = trace1.fraction * WORLD_SIZE; // was 8192
|
||||
if (dist > best_dist)
|
||||
|
@ -679,24 +696,24 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
if (best_dist == 0.)
|
||||
return;
|
||||
thing = SpawnThing();
|
||||
vectoangles(best_dir,thing->s.angles);
|
||||
vectoangles (best_dir, thing->s.angles);
|
||||
}
|
||||
if ( (!Q_stricmp(attacker->classname,"func_door")) ||
|
||||
(!Q_stricmp(attacker->classname,"func_pushable")) )
|
||||
if ( attacker->classname &&
|
||||
(!Q_stricmp(attacker->classname, "func_door") || !Q_stricmp(attacker->classname, "func_pushable")) )
|
||||
run = 256;
|
||||
else
|
||||
run = WORLD_SIZE; // was 8192
|
||||
VectorMA(targ->s.origin,run,best_dir,end);
|
||||
trace1 = gi.trace(targ->s.origin,mins,maxs,end,targ,MASK_MONSTERSOLID);
|
||||
VectorMA (targ->s.origin, run, best_dir, end);
|
||||
trace1 = gi.trace (targ->s.origin, mins, maxs, end, targ, MASK_MONSTERSOLID);
|
||||
dist = trace1.fraction * run;
|
||||
VectorMA(targ->s.origin, dist, best_dir, thing->s.origin);
|
||||
VectorMA (targ->s.origin, dist, best_dir, thing->s.origin);
|
||||
// If monster already has an enemy, use a short lifespan for thing
|
||||
if (targ->enemy)
|
||||
thing->touch_debounce_time = level.time + 2.0;
|
||||
else
|
||||
thing->touch_debounce_time = level.time + max(5.0,dist/50.);
|
||||
thing->target_ent = targ;
|
||||
ED_CallSpawn(thing);
|
||||
ED_CallSpawn (thing);
|
||||
targ->movetarget = targ->goalentity = thing;
|
||||
targ->monsterinfo.aiflags &= ~AI_SOUND_TARGET;
|
||||
targ->monsterinfo.aiflags |= AI_CHASE_THING;
|
||||
|
@ -708,13 +725,13 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
// Lazarus: If in a no-win situation, actors run away
|
||||
if (targ->monsterinfo.aiflags & AI_ACTOR)
|
||||
{
|
||||
if (targ->health < targ->max_health/3)
|
||||
if ( targ->health < (targ->max_health/3) )
|
||||
{
|
||||
if (attacker->health > attacker->max_health/2)
|
||||
if ( attacker->health > (attacker->max_health/2) )
|
||||
{
|
||||
if (attacker->health > targ->health)
|
||||
{
|
||||
if (ai_chicken(targ,attacker))
|
||||
if ( ai_chicken(targ, attacker) )
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -723,9 +740,10 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
|
||||
// Zaero- handle autocanon
|
||||
// if ( !(attacker->client) && !(attacker->svflags & SVF_MONSTER) &&
|
||||
// (strncmp (attacker->classname, "monster_autocannon", 18) != 0) )
|
||||
if ( !strncmp (attacker->classname, "monster_autocannon", 18) )
|
||||
// (attacker->classname && (strncmp(attacker->classname, "monster_autocannon", 18) != 0) ) )
|
||||
if ( attacker->classname && !strncmp(attacker->classname, "monster_autocannon", 18) )
|
||||
return;
|
||||
// end Zaero
|
||||
|
||||
if (attacker == targ || attacker == targ->enemy)
|
||||
return;
|
||||
|
@ -813,17 +831,19 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
/*
|
||||
if (((targ->flags & (FL_FLY|FL_SWIM)) == (attacker->flags & (FL_FLY|FL_SWIM))) &&
|
||||
(strcmp (targ->classname, attacker->classname) != 0) &&
|
||||
(strcmp(attacker->classname, "monster_tank") != 0) &&
|
||||
(strncmp(attacker->classname, "monster_tank", 12) != 0) &&
|
||||
(strcmp(attacker->classname, "monster_supertank") != 0) &&
|
||||
(strcmp(attacker->classname, "monster_makron") != 0) &&
|
||||
(strcmp(attacker->classname, "monster_jorg") != 0) &&
|
||||
(strcmp(attacker->classname, "monster_carrier") != 0) &&
|
||||
(strncmp(attacker->classname, "monster_medic", 12) != 0) ) // this should get medics & medic_commanders
|
||||
(strncmp(attacker->classname, "monster_medic", 13) != 0) ) // this should get medics & medic_commanders
|
||||
*/
|
||||
if (((targ->flags & (FL_FLY|FL_SWIM)) == (attacker->flags & (FL_FLY|FL_SWIM))) &&
|
||||
(strcmp (targ->classname, attacker->classname) != 0) &&
|
||||
if ( ( (targ->flags & (FL_FLY|FL_SWIM)) == (attacker->flags & (FL_FLY|FL_SWIM)) ) &&
|
||||
(strcmp(targ->classname, attacker->classname) != 0) &&
|
||||
!(attacker->monsterinfo.aiflags & AI_IGNORE_SHOTS) &&
|
||||
!(targ->monsterinfo.aiflags & AI_IGNORE_SHOTS) )
|
||||
!(targ->monsterinfo.aiflags & AI_IGNORE_SHOTS) &&
|
||||
!( IsZaeroMap() && attacker->mteam && targ->mteam && (strcmp(attacker->mteam, targ->mteam) == 0) ) // Zaero- added monster team field
|
||||
)
|
||||
{
|
||||
if (targ->enemy && targ->enemy->client)
|
||||
targ->oldenemy = targ->enemy;
|
||||
|
@ -1160,9 +1180,9 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
if (take)
|
||||
{
|
||||
// Lazarus: dmgteam stuff
|
||||
CallMyFriends(targ,attacker);
|
||||
CallMyFriends (targ, attacker);
|
||||
|
||||
//Knightmare- no blood/particles from negative damage lasers and triggers or shockwave detonation effect
|
||||
// Knightmare- no blood/particles from negative damage lasers and triggers or shockwave detonation effect
|
||||
if ( (mod != MOD_SHOCK_SPLASH) && ((damage > 0) || ((mod != MOD_TRIGGER_HURT) && (mod != MOD_TARGET_LASER))) )
|
||||
{
|
||||
//PGM- need more blood for chainfist.
|
||||
|
@ -1216,7 +1236,7 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
{
|
||||
// Lazarus: For func_explosive target, check spawnflags and, if needed,
|
||||
// damage type
|
||||
if (targ->classname && !Q_stricmp(targ->classname,"func_explosive"))
|
||||
if (targ->classname && !Q_stricmp(targ->classname, "func_explosive"))
|
||||
{
|
||||
qboolean good_damage = true;
|
||||
|
||||
|
@ -1244,13 +1264,17 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
if (mod == MOD_DOPPLE_EXPLODE) good_damage = true;
|
||||
if (mod == MOD_SHOCK_SPLASH) good_damage = true;
|
||||
if (mod == MOD_ETF_SPLASH) good_damage = true;
|
||||
// Zaero
|
||||
if (mod == MOD_TRIPBOMB) good_damage = true;
|
||||
}
|
||||
if (!good_damage) return;
|
||||
}
|
||||
targ->health = targ->health - take;
|
||||
// Zaero
|
||||
if (targ->takedamage != DAMAGE_IMMORTAL)
|
||||
targ->health = targ->health - take;
|
||||
}
|
||||
|
||||
//PGM - spheres need to know who to shoot at
|
||||
// PGM - spheres need to know who to shoot at
|
||||
if (client && client->owned_sphere)
|
||||
{
|
||||
sphere_notified = true;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,24 @@
|
|||
extern void Weapon_FlareGun ( edict_t * ent ) ;
|
||||
extern void Weapon_FlareLauncher_Fire ( edict_t * ent ) ;
|
||||
extern void fire_flare ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , float damage_radius , int radius_damage ) ;
|
||||
extern void flare_think ( edict_t * self ) ;
|
||||
extern void flare_flash ( edict_t * ent ) ;
|
||||
extern void SP_misc_lasertripbomb ( edict_t * bomb ) ;
|
||||
extern void Weapon_LaserTripBomb ( edict_t * ent ) ;
|
||||
extern void weapon_lasertripbomb_fire ( edict_t * ent ) ;
|
||||
extern qboolean fire_lasertripbomb ( edict_t * self , vec3_t start , vec3_t dir , float timer , float damage , float damage_radius , qboolean quad ) ;
|
||||
extern void removeOldest ( void ) ;
|
||||
extern void setupBomb ( edict_t * bomb , char * classname , float damage , float damage_radius ) ;
|
||||
extern void tripbomb_think ( edict_t * self ) ;
|
||||
extern void tripbomb_pain ( edict_t * self , edict_t * other , float kick , int damage ) ;
|
||||
extern void turnOffGlow ( edict_t * self ) ;
|
||||
extern void use_tripbomb ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void create_tripbomb_laser ( edict_t * bomb ) ;
|
||||
extern void tripbomb_laser_on ( edict_t * self ) ;
|
||||
extern void tripbomb_laser_think ( edict_t * self ) ;
|
||||
extern void tripbomb_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
|
||||
extern void TripBomb_Explode ( edict_t * ent ) ;
|
||||
extern void shrapnel_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void angleToward ( edict_t * self , vec3_t point , float speed ) ;
|
||||
extern void SP_trigger_laser ( edict_t * self ) ;
|
||||
extern void trigger_laser_on ( edict_t * self ) ;
|
||||
|
@ -56,12 +74,25 @@ extern void SP_misc_crate_small ( edict_t * self ) ;
|
|||
extern void SP_misc_crate_medium ( edict_t * self ) ;
|
||||
extern void SP_misc_crate ( edict_t * self ) ;
|
||||
extern void setupCrate ( edict_t * self ) ;
|
||||
extern void Use_PlasmaShield ( edict_t * ent , gitem_t * item ) ;
|
||||
extern void PlasmaShield_killed ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
|
||||
extern void PlasmaShield_die ( edict_t * self ) ;
|
||||
extern qboolean EMPNukeCheck ( edict_t * ent , vec3_t pos ) ;
|
||||
extern void fire_empnuke ( edict_t * ent , vec3_t center , int radius ) ;
|
||||
extern void empBlastAnim ( edict_t * ent ) ;
|
||||
extern void empnukeFinish ( edict_t * ent ) ;
|
||||
extern void Weapon_EMPNuke ( edict_t * ent ) ;
|
||||
extern void weapon_EMPNuke_fire ( edict_t * ent ) ;
|
||||
extern void Use_Visor ( edict_t * ent , gitem_t * item ) ;
|
||||
extern edict_t * findNextCamera ( edict_t * old ) ;
|
||||
extern void stopCamera ( edict_t * self ) ;
|
||||
extern void startVisor ( edict_t * ent , edict_t * e ) ;
|
||||
extern void startVisorStatic ( edict_t * ent ) ;
|
||||
extern void updateVisorHud ( edict_t * ent ) ;
|
||||
extern void SP_misc_securitycamera ( edict_t * self ) ;
|
||||
extern void camera_pain ( edict_t * self , edict_t * other , float kick , int damage ) ;
|
||||
extern void securitycamera_think ( edict_t * self ) ;
|
||||
extern void use_securitycamera ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void hound_createHound ( edict_t * self , float healthPercent ) ;
|
||||
extern void SP_monster_hound ( edict_t * self ) ;
|
||||
extern void SP_monster_hound_precache ( void ) ;
|
||||
|
@ -101,6 +132,9 @@ extern void handler_sitdown ( edict_t * self ) ;
|
|||
extern void handler_standup ( edict_t * self ) ;
|
||||
extern void handler_scratch ( edict_t * self ) ;
|
||||
extern void handler_sight ( edict_t * self , edict_t * other ) ;
|
||||
extern void zCam_SetLocalCopy ( struct edict_s * player , char * s ) ;
|
||||
extern void zCam_Stop ( struct edict_s * player ) ;
|
||||
extern void zCam_TrackEntity ( struct edict_s * player , struct edict_s * track , qboolean playerVisiable , qboolean playerOffset ) ;
|
||||
extern void SP_target_zboss_target ( edict_t * self ) ;
|
||||
extern void trigger_zboss ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void SP_monster_zboss ( edict_t * self ) ;
|
||||
|
@ -239,6 +273,8 @@ extern void AngleVectors ( vec3_t angles , vec3_t forward , vec3_t right , vec3_
|
|||
extern void RotatePointAroundVector ( vec3_t dst , const vec3_t dir , const vec3_t point , float degrees ) ;
|
||||
extern void kick_attack ( edict_t * ent ) ;
|
||||
extern void Weapon_Null ( edict_t * ent ) ;
|
||||
extern void Weapon_Plasma_Rifle ( edict_t * ent ) ;
|
||||
extern void weapon_plasma_rifle_fire ( edict_t * ent , qboolean altfire ) ;
|
||||
extern void Weapon_Shockwave ( edict_t * ent ) ;
|
||||
extern void Shockwave_Fire ( edict_t * ent , qboolean altfire ) ;
|
||||
extern void Weapon_Heatbeam ( edict_t * ent ) ;
|
||||
|
@ -590,6 +626,8 @@ extern void SP_monster_soldier_lasergun ( edict_t * self ) ;
|
|||
extern void SP_monster_soldier_hypergun ( edict_t * self ) ;
|
||||
extern void SP_monster_soldier_ripper ( edict_t * self ) ;
|
||||
extern void SP_monster_soldier_h ( edict_t * self ) ;
|
||||
extern void SP_monster_soldier_plasma_sp ( edict_t * self ) ;
|
||||
extern void SP_monster_soldier_plasma_re ( edict_t * self ) ;
|
||||
extern void SP_monster_soldier_ss ( edict_t * self ) ;
|
||||
extern void SP_monster_soldier ( edict_t * self ) ;
|
||||
extern void SP_monster_soldier_light ( edict_t * self ) ;
|
||||
|
@ -936,6 +974,7 @@ extern void mutant_swing ( edict_t * self ) ;
|
|||
extern void mutant_search ( edict_t * self ) ;
|
||||
extern void mutant_sight ( edict_t * self , edict_t * other ) ;
|
||||
extern void mutant_step ( edict_t * self ) ;
|
||||
extern qboolean M_MoveAwayFromFlare ( edict_t * self , float dist ) ;
|
||||
extern qboolean M_walkmove ( edict_t * ent , float yaw , float dist ) ;
|
||||
extern void M_MoveToGoal ( edict_t * ent , float dist ) ;
|
||||
extern qboolean SV_CloseEnough ( edict_t * ent , edict_t * goal , float dist ) ;
|
||||
|
@ -1518,6 +1557,24 @@ extern void q1_fire_laser ( edict_t * self , vec3_t start , vec3_t dir , int dam
|
|||
extern void q1_laser_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void q1_fire_nail ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , qboolean sng ) ;
|
||||
extern void q1_nail_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void SP_goop ( edict_t * goop ) ;
|
||||
extern void goop_delayed_start ( edict_t * goop ) ;
|
||||
extern void fire_plasma_rifle ( edict_t * ent , vec3_t start , vec3_t dir , int damage , int speed , qboolean spread ) ;
|
||||
extern void fire_plasma_rifle_spread ( edict_t * ent , vec3_t start , vec3_t dir , int damage , int speed ) ;
|
||||
extern void fire_plasma_rifle_bounce ( edict_t * ent , vec3_t start , vec3_t dir , int damage , int speed ) ;
|
||||
extern edict_t * Spawn_Goop ( edict_t * ent , vec3_t start ) ;
|
||||
extern void plasma_rifle_spread_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void plasma_rifle_bounce_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void SP_shocksphere ( edict_t * shocksphere ) ;
|
||||
extern void shocksphere_delayed_start ( edict_t * shocksphere ) ;
|
||||
extern void fire_shock_sphere ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , float damage_radius , int radius_damage ) ;
|
||||
extern void shock_sphere_think ( edict_t * sphere ) ;
|
||||
extern void shock_sphere_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void ShockSplash ( edict_t * self , cplane_t * plane ) ;
|
||||
extern void ShockSplashThink ( edict_t * self ) ;
|
||||
extern void ShockEffect ( edict_t * source , edict_t * attacker , float damage , float radius , cplane_t * plane ) ;
|
||||
extern void shock_effect_center_think ( edict_t * self ) ;
|
||||
extern void shock_effect_think ( edict_t * self ) ;
|
||||
extern void Trap_Explode ( edict_t * ent ) ;
|
||||
extern void Cmd_KillTrap_f ( edict_t * ent ) ;
|
||||
extern void Trap_Die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
|
||||
|
@ -1556,16 +1613,6 @@ extern void fire_missile ( edict_t * self , vec3_t start , vec3_t dir , int dama
|
|||
extern void missile_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
|
||||
extern void missile_explode ( edict_t * ent ) ;
|
||||
extern void missile_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void SP_shocksphere ( edict_t * shocksphere ) ;
|
||||
extern void shocksphere_delayed_start ( edict_t * shocksphere ) ;
|
||||
extern void fire_shock_sphere ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , float damage_radius , int radius_damage ) ;
|
||||
extern void shock_sphere_think ( edict_t * sphere ) ;
|
||||
extern void shock_sphere_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void ShockSplash ( edict_t * self , cplane_t * plane ) ;
|
||||
extern void ShockSplashThink ( edict_t * self ) ;
|
||||
extern void ShockEffect ( edict_t * source , edict_t * attacker , float damage , float radius , cplane_t * plane ) ;
|
||||
extern void shock_effect_center_think ( edict_t * self ) ;
|
||||
extern void shock_effect_think ( edict_t * self ) ;
|
||||
extern void SP_handgrenade ( edict_t * grenade ) ;
|
||||
extern void handgrenade_delayed_start ( edict_t * grenade ) ;
|
||||
extern void SP_grenade ( edict_t * grenade ) ;
|
||||
|
@ -1601,6 +1648,7 @@ extern float PointDist ( vec3_t x , vec3_t y ) ;
|
|||
extern qboolean UseRegularGoodGuyFlag ( edict_t * monster ) ;
|
||||
extern qboolean UseSpecialGoodGuyFlag ( edict_t * monster ) ;
|
||||
extern qboolean CheckCoop_MapHacks ( edict_t * ent ) ;
|
||||
extern qboolean IsZaeroMap ( void ) ;
|
||||
extern qboolean IsRogueMap ( void ) ;
|
||||
extern qboolean IsXatrixMap ( void ) ;
|
||||
extern qboolean IsIdMap ( void ) ;
|
||||
|
@ -1615,6 +1663,7 @@ extern qboolean point_infront ( edict_t * self , vec3_t point ) ;
|
|||
extern void stuffcmd ( edict_t * ent , char * s ) ;
|
||||
extern float SnapToEights ( float x ) ;
|
||||
extern void AnglesNormalize ( vec3_t vec ) ;
|
||||
extern qboolean MonsterPlayerKillBox ( edict_t * ent ) ;
|
||||
extern qboolean KillBox ( edict_t * ent ) ;
|
||||
extern void G_TouchSolids ( edict_t * ent ) ;
|
||||
extern void G_TouchTriggers ( edict_t * ent ) ;
|
||||
|
@ -1663,6 +1712,7 @@ extern void turret_breach_think ( edict_t * self ) ;
|
|||
extern void turret_turn ( edict_t * self ) ;
|
||||
extern void turret_disengage ( edict_t * self ) ;
|
||||
extern void turret_breach_fire ( edict_t * self ) ;
|
||||
extern void hrocket_turret_fire ( edict_t * self , edict_t * owner , vec3_t start , vec3_t dir , vec3_t start2 , vec3_t dir2 , int damage , int speed , float damage_radius , int radius_damage , edict_t * home_target ) ;
|
||||
extern void turret_blocked ( edict_t * self , edict_t * other ) ;
|
||||
extern edict_t * TurretTarget ( edict_t * self ) ;
|
||||
extern void SP_trigger_switch ( edict_t * ent ) ;
|
||||
|
@ -2170,19 +2220,20 @@ extern void AttackFinished ( edict_t * self , float time ) ;
|
|||
extern void M_FlyCheck ( edict_t * self ) ;
|
||||
extern void M_FliesOn ( edict_t * self ) ;
|
||||
extern void M_FliesOff ( edict_t * self ) ;
|
||||
extern void monster_fire_plasma_rifle ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , qboolean spread ) ;
|
||||
extern void monster_fire_heat ( edict_t * self , vec3_t start , vec3_t dir , vec3_t offset , int damage , int kick , int flashtype ) ;
|
||||
extern void monster_fire_tracker ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , edict_t * enemy , int flashtype ) ;
|
||||
extern void monster_fire_blaster2 ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect ) ;
|
||||
extern void monster_dabeam ( edict_t * self ) ;
|
||||
extern void dabeam_hit ( edict_t * self ) ;
|
||||
extern void monster_fire_rocket_heat ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype ) ;
|
||||
extern void monster_fire_ionripper ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect ) ;
|
||||
extern void monster_fire_blueblaster ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect ) ;
|
||||
extern void monster_fire_bfg ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int speed , int kick , float damage_radius , int flashtype ) ;
|
||||
extern void monster_fire_railgun ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int kick , int flashtype ) ;
|
||||
extern void monster_fire_missile ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , edict_t * homing_target ) ;
|
||||
extern void monster_fire_rocket ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , edict_t * homing_target ) ;
|
||||
extern void monster_fire_grenade ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int speed , int flashtype ) ;
|
||||
extern void monster_dabeam ( edict_t * self ) ;
|
||||
extern void dabeam_hit ( edict_t * self ) ;
|
||||
extern void monster_fire_heat ( edict_t * self , vec3_t start , vec3_t dir , vec3_t offset , int damage , int kick , int flashtype ) ;
|
||||
extern void monster_fire_tracker ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , edict_t * enemy , int flashtype ) ;
|
||||
extern void monster_fire_blaster2 ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect ) ;
|
||||
extern void monster_fire_rocket_heat ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype ) ;
|
||||
extern void monster_fire_ionripper ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect ) ;
|
||||
extern void monster_fire_blueblaster ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect ) ;
|
||||
extern void monster_fire_blaster ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect , int color ) ;
|
||||
extern void monster_fire_shotgun ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int kick , int hspread , int vspread , int count , int flashtype ) ;
|
||||
extern void monster_fire_bullet ( edict_t * self , vec3_t start , vec3_t dir , int damage , int kick , int hspread , int vspread , int flashtype ) ;
|
||||
|
@ -2452,6 +2503,9 @@ extern void Item_Die ( edict_t * self , edict_t * inflictor , edict_t * attacker
|
|||
extern void drop_make_touchable ( edict_t * ent ) ;
|
||||
extern void drop_temp_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void Touch_Item ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void Drop_Visor ( edict_t * ent , gitem_t * item ) ;
|
||||
extern qboolean Pickup_Visor ( edict_t * ent , edict_t * other ) ;
|
||||
extern qboolean Pickup_PlasmaShield ( edict_t * ent , edict_t * other ) ;
|
||||
extern void Drop_PowerArmor ( edict_t * ent , gitem_t * item ) ;
|
||||
extern qboolean Pickup_PowerArmor ( edict_t * ent , edict_t * other ) ;
|
||||
extern void Use_PowerArmor ( edict_t * ent , gitem_t * item ) ;
|
||||
|
@ -2572,6 +2626,7 @@ extern void Think_SpawnDoorTrigger ( edict_t * ent ) ;
|
|||
extern void Think_CalcMoveSpeed ( edict_t * self ) ;
|
||||
extern void Touch_DoorTrigger ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void door_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void door_openclose ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void smart_water_go_up ( edict_t * self ) ;
|
||||
extern void door_go_up ( edict_t * self , edict_t * activator ) ;
|
||||
extern void door_go_down ( edict_t * self ) ;
|
||||
|
|
|
@ -1,6 +1,24 @@
|
|||
{"Weapon_FlareGun", (byte *)Weapon_FlareGun},
|
||||
{"Weapon_FlareLauncher_Fire", (byte *)Weapon_FlareLauncher_Fire},
|
||||
{"fire_flare", (byte *)fire_flare},
|
||||
{"flare_think", (byte *)flare_think},
|
||||
{"flare_flash", (byte *)flare_flash},
|
||||
{"SP_misc_lasertripbomb", (byte *)SP_misc_lasertripbomb},
|
||||
{"Weapon_LaserTripBomb", (byte *)Weapon_LaserTripBomb},
|
||||
{"weapon_lasertripbomb_fire", (byte *)weapon_lasertripbomb_fire},
|
||||
{"fire_lasertripbomb", (byte *)fire_lasertripbomb},
|
||||
{"removeOldest", (byte *)removeOldest},
|
||||
{"setupBomb", (byte *)setupBomb},
|
||||
{"tripbomb_think", (byte *)tripbomb_think},
|
||||
{"tripbomb_pain", (byte *)tripbomb_pain},
|
||||
{"turnOffGlow", (byte *)turnOffGlow},
|
||||
{"use_tripbomb", (byte *)use_tripbomb},
|
||||
{"create_tripbomb_laser", (byte *)create_tripbomb_laser},
|
||||
{"tripbomb_laser_on", (byte *)tripbomb_laser_on},
|
||||
{"tripbomb_laser_think", (byte *)tripbomb_laser_think},
|
||||
{"tripbomb_die", (byte *)tripbomb_die},
|
||||
{"TripBomb_Explode", (byte *)TripBomb_Explode},
|
||||
{"shrapnel_touch", (byte *)shrapnel_touch},
|
||||
{"angleToward", (byte *)angleToward},
|
||||
{"SP_trigger_laser", (byte *)SP_trigger_laser},
|
||||
{"trigger_laser_on", (byte *)trigger_laser_on},
|
||||
|
@ -56,12 +74,25 @@
|
|||
{"SP_misc_crate_medium", (byte *)SP_misc_crate_medium},
|
||||
{"SP_misc_crate", (byte *)SP_misc_crate},
|
||||
{"setupCrate", (byte *)setupCrate},
|
||||
{"Use_PlasmaShield", (byte *)Use_PlasmaShield},
|
||||
{"PlasmaShield_killed", (byte *)PlasmaShield_killed},
|
||||
{"PlasmaShield_die", (byte *)PlasmaShield_die},
|
||||
{"EMPNukeCheck", (byte *)EMPNukeCheck},
|
||||
{"fire_empnuke", (byte *)fire_empnuke},
|
||||
{"empBlastAnim", (byte *)empBlastAnim},
|
||||
{"empnukeFinish", (byte *)empnukeFinish},
|
||||
{"Weapon_EMPNuke", (byte *)Weapon_EMPNuke},
|
||||
{"weapon_EMPNuke_fire", (byte *)weapon_EMPNuke_fire},
|
||||
{"Use_Visor", (byte *)Use_Visor},
|
||||
{"findNextCamera", (byte *)findNextCamera},
|
||||
{"stopCamera", (byte *)stopCamera},
|
||||
{"startVisor", (byte *)startVisor},
|
||||
{"startVisorStatic", (byte *)startVisorStatic},
|
||||
{"updateVisorHud", (byte *)updateVisorHud},
|
||||
{"SP_misc_securitycamera", (byte *)SP_misc_securitycamera},
|
||||
{"camera_pain", (byte *)camera_pain},
|
||||
{"securitycamera_think", (byte *)securitycamera_think},
|
||||
{"use_securitycamera", (byte *)use_securitycamera},
|
||||
{"hound_createHound", (byte *)hound_createHound},
|
||||
{"SP_monster_hound", (byte *)SP_monster_hound},
|
||||
{"SP_monster_hound_precache", (byte *)SP_monster_hound_precache},
|
||||
|
@ -101,6 +132,9 @@
|
|||
{"handler_standup", (byte *)handler_standup},
|
||||
{"handler_scratch", (byte *)handler_scratch},
|
||||
{"handler_sight", (byte *)handler_sight},
|
||||
{"zCam_SetLocalCopy", (byte *)zCam_SetLocalCopy},
|
||||
{"zCam_Stop", (byte *)zCam_Stop},
|
||||
{"zCam_TrackEntity", (byte *)zCam_TrackEntity},
|
||||
{"SP_target_zboss_target", (byte *)SP_target_zboss_target},
|
||||
{"trigger_zboss", (byte *)trigger_zboss},
|
||||
{"SP_monster_zboss", (byte *)SP_monster_zboss},
|
||||
|
@ -239,6 +273,8 @@
|
|||
{"RotatePointAroundVector", (byte *)RotatePointAroundVector},
|
||||
{"kick_attack", (byte *)kick_attack},
|
||||
{"Weapon_Null", (byte *)Weapon_Null},
|
||||
{"Weapon_Plasma_Rifle", (byte *)Weapon_Plasma_Rifle},
|
||||
{"weapon_plasma_rifle_fire", (byte *)weapon_plasma_rifle_fire},
|
||||
{"Weapon_Shockwave", (byte *)Weapon_Shockwave},
|
||||
{"Shockwave_Fire", (byte *)Shockwave_Fire},
|
||||
{"Weapon_Heatbeam", (byte *)Weapon_Heatbeam},
|
||||
|
@ -590,6 +626,8 @@
|
|||
{"SP_monster_soldier_hypergun", (byte *)SP_monster_soldier_hypergun},
|
||||
{"SP_monster_soldier_ripper", (byte *)SP_monster_soldier_ripper},
|
||||
{"SP_monster_soldier_h", (byte *)SP_monster_soldier_h},
|
||||
{"SP_monster_soldier_plasma_sp", (byte *)SP_monster_soldier_plasma_sp},
|
||||
{"SP_monster_soldier_plasma_re", (byte *)SP_monster_soldier_plasma_re},
|
||||
{"SP_monster_soldier_ss", (byte *)SP_monster_soldier_ss},
|
||||
{"SP_monster_soldier", (byte *)SP_monster_soldier},
|
||||
{"SP_monster_soldier_light", (byte *)SP_monster_soldier_light},
|
||||
|
@ -936,6 +974,7 @@
|
|||
{"mutant_search", (byte *)mutant_search},
|
||||
{"mutant_sight", (byte *)mutant_sight},
|
||||
{"mutant_step", (byte *)mutant_step},
|
||||
{"M_MoveAwayFromFlare", (byte *)M_MoveAwayFromFlare},
|
||||
{"M_walkmove", (byte *)M_walkmove},
|
||||
{"M_MoveToGoal", (byte *)M_MoveToGoal},
|
||||
{"SV_CloseEnough", (byte *)SV_CloseEnough},
|
||||
|
@ -1518,6 +1557,24 @@
|
|||
{"q1_laser_touch", (byte *)q1_laser_touch},
|
||||
{"q1_fire_nail", (byte *)q1_fire_nail},
|
||||
{"q1_nail_touch", (byte *)q1_nail_touch},
|
||||
{"SP_goop", (byte *)SP_goop},
|
||||
{"goop_delayed_start", (byte *)goop_delayed_start},
|
||||
{"fire_plasma_rifle", (byte *)fire_plasma_rifle},
|
||||
{"fire_plasma_rifle_spread", (byte *)fire_plasma_rifle_spread},
|
||||
{"fire_plasma_rifle_bounce", (byte *)fire_plasma_rifle_bounce},
|
||||
{"Spawn_Goop", (byte *)Spawn_Goop},
|
||||
{"plasma_rifle_spread_touch", (byte *)plasma_rifle_spread_touch},
|
||||
{"plasma_rifle_bounce_touch", (byte *)plasma_rifle_bounce_touch},
|
||||
{"SP_shocksphere", (byte *)SP_shocksphere},
|
||||
{"shocksphere_delayed_start", (byte *)shocksphere_delayed_start},
|
||||
{"fire_shock_sphere", (byte *)fire_shock_sphere},
|
||||
{"shock_sphere_think", (byte *)shock_sphere_think},
|
||||
{"shock_sphere_touch", (byte *)shock_sphere_touch},
|
||||
{"ShockSplash", (byte *)ShockSplash},
|
||||
{"ShockSplashThink", (byte *)ShockSplashThink},
|
||||
{"ShockEffect", (byte *)ShockEffect},
|
||||
{"shock_effect_center_think", (byte *)shock_effect_center_think},
|
||||
{"shock_effect_think", (byte *)shock_effect_think},
|
||||
{"Trap_Explode", (byte *)Trap_Explode},
|
||||
{"Cmd_KillTrap_f", (byte *)Cmd_KillTrap_f},
|
||||
{"Trap_Die", (byte *)Trap_Die},
|
||||
|
@ -1556,16 +1613,6 @@
|
|||
{"missile_die", (byte *)missile_die},
|
||||
{"missile_explode", (byte *)missile_explode},
|
||||
{"missile_touch", (byte *)missile_touch},
|
||||
{"SP_shocksphere", (byte *)SP_shocksphere},
|
||||
{"shocksphere_delayed_start", (byte *)shocksphere_delayed_start},
|
||||
{"fire_shock_sphere", (byte *)fire_shock_sphere},
|
||||
{"shock_sphere_think", (byte *)shock_sphere_think},
|
||||
{"shock_sphere_touch", (byte *)shock_sphere_touch},
|
||||
{"ShockSplash", (byte *)ShockSplash},
|
||||
{"ShockSplashThink", (byte *)ShockSplashThink},
|
||||
{"ShockEffect", (byte *)ShockEffect},
|
||||
{"shock_effect_center_think", (byte *)shock_effect_center_think},
|
||||
{"shock_effect_think", (byte *)shock_effect_think},
|
||||
{"SP_handgrenade", (byte *)SP_handgrenade},
|
||||
{"handgrenade_delayed_start", (byte *)handgrenade_delayed_start},
|
||||
{"SP_grenade", (byte *)SP_grenade},
|
||||
|
@ -1601,6 +1648,7 @@
|
|||
{"UseRegularGoodGuyFlag", (byte *)UseRegularGoodGuyFlag},
|
||||
{"UseSpecialGoodGuyFlag", (byte *)UseSpecialGoodGuyFlag},
|
||||
{"CheckCoop_MapHacks", (byte *)CheckCoop_MapHacks},
|
||||
{"IsZaeroMap", (byte *)IsZaeroMap},
|
||||
{"IsRogueMap", (byte *)IsRogueMap},
|
||||
{"IsXatrixMap", (byte *)IsXatrixMap},
|
||||
{"IsIdMap", (byte *)IsIdMap},
|
||||
|
@ -1615,6 +1663,7 @@
|
|||
{"stuffcmd", (byte *)stuffcmd},
|
||||
{"SnapToEights", (byte *)SnapToEights},
|
||||
{"AnglesNormalize", (byte *)AnglesNormalize},
|
||||
{"MonsterPlayerKillBox", (byte *)MonsterPlayerKillBox},
|
||||
{"KillBox", (byte *)KillBox},
|
||||
{"G_TouchSolids", (byte *)G_TouchSolids},
|
||||
{"G_TouchTriggers", (byte *)G_TouchTriggers},
|
||||
|
@ -1663,6 +1712,7 @@
|
|||
{"turret_turn", (byte *)turret_turn},
|
||||
{"turret_disengage", (byte *)turret_disengage},
|
||||
{"turret_breach_fire", (byte *)turret_breach_fire},
|
||||
{"hrocket_turret_fire", (byte *)hrocket_turret_fire},
|
||||
{"turret_blocked", (byte *)turret_blocked},
|
||||
{"TurretTarget", (byte *)TurretTarget},
|
||||
{"SP_trigger_switch", (byte *)SP_trigger_switch},
|
||||
|
@ -2170,19 +2220,20 @@
|
|||
{"M_FlyCheck", (byte *)M_FlyCheck},
|
||||
{"M_FliesOn", (byte *)M_FliesOn},
|
||||
{"M_FliesOff", (byte *)M_FliesOff},
|
||||
{"monster_fire_plasma_rifle", (byte *)monster_fire_plasma_rifle},
|
||||
{"monster_fire_heat", (byte *)monster_fire_heat},
|
||||
{"monster_fire_tracker", (byte *)monster_fire_tracker},
|
||||
{"monster_fire_blaster2", (byte *)monster_fire_blaster2},
|
||||
{"monster_dabeam", (byte *)monster_dabeam},
|
||||
{"dabeam_hit", (byte *)dabeam_hit},
|
||||
{"monster_fire_rocket_heat", (byte *)monster_fire_rocket_heat},
|
||||
{"monster_fire_ionripper", (byte *)monster_fire_ionripper},
|
||||
{"monster_fire_blueblaster", (byte *)monster_fire_blueblaster},
|
||||
{"monster_fire_bfg", (byte *)monster_fire_bfg},
|
||||
{"monster_fire_railgun", (byte *)monster_fire_railgun},
|
||||
{"monster_fire_missile", (byte *)monster_fire_missile},
|
||||
{"monster_fire_rocket", (byte *)monster_fire_rocket},
|
||||
{"monster_fire_grenade", (byte *)monster_fire_grenade},
|
||||
{"monster_dabeam", (byte *)monster_dabeam},
|
||||
{"dabeam_hit", (byte *)dabeam_hit},
|
||||
{"monster_fire_heat", (byte *)monster_fire_heat},
|
||||
{"monster_fire_tracker", (byte *)monster_fire_tracker},
|
||||
{"monster_fire_blaster2", (byte *)monster_fire_blaster2},
|
||||
{"monster_fire_rocket_heat", (byte *)monster_fire_rocket_heat},
|
||||
{"monster_fire_ionripper", (byte *)monster_fire_ionripper},
|
||||
{"monster_fire_blueblaster", (byte *)monster_fire_blueblaster},
|
||||
{"monster_fire_blaster", (byte *)monster_fire_blaster},
|
||||
{"monster_fire_shotgun", (byte *)monster_fire_shotgun},
|
||||
{"monster_fire_bullet", (byte *)monster_fire_bullet},
|
||||
|
@ -2452,6 +2503,9 @@
|
|||
{"drop_make_touchable", (byte *)drop_make_touchable},
|
||||
{"drop_temp_touch", (byte *)drop_temp_touch},
|
||||
{"Touch_Item", (byte *)Touch_Item},
|
||||
{"Drop_Visor", (byte *)Drop_Visor},
|
||||
{"Pickup_Visor", (byte *)Pickup_Visor},
|
||||
{"Pickup_PlasmaShield", (byte *)Pickup_PlasmaShield},
|
||||
{"Drop_PowerArmor", (byte *)Drop_PowerArmor},
|
||||
{"Pickup_PowerArmor", (byte *)Pickup_PowerArmor},
|
||||
{"Use_PowerArmor", (byte *)Use_PowerArmor},
|
||||
|
@ -2572,6 +2626,7 @@
|
|||
{"Think_CalcMoveSpeed", (byte *)Think_CalcMoveSpeed},
|
||||
{"Touch_DoorTrigger", (byte *)Touch_DoorTrigger},
|
||||
{"door_use", (byte *)door_use},
|
||||
{"door_openclose", (byte *)door_openclose},
|
||||
{"smart_water_go_up", (byte *)smart_water_go_up},
|
||||
{"door_go_up", (byte *)door_go_up},
|
||||
{"door_go_down", (byte *)door_go_down},
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -16,6 +16,7 @@
|
|||
#include "p_menu.h"
|
||||
#include "p_text.h"
|
||||
#include "km_cvar.h"
|
||||
#include "plasma.h"
|
||||
#define JETPACK_MOD
|
||||
|
||||
// Zaero
|
||||
|
@ -129,6 +130,15 @@
|
|||
|
||||
#define FL_RESPAWN 0x80000000 // used for item respawning
|
||||
|
||||
// edict->moreflags
|
||||
#define FL2_TURRET_DOUBLE 0x00000001 // this is a double-barreled turret
|
||||
#define FL2_TURRET_DOUBLE_ALT 0x00000002 // this turret alternates firing its barrels (style is set)
|
||||
#define FL2_TURRET_DOUBLE_ALT_FIRING 0x00000004 // secondary barrel in use for alternate firing
|
||||
#define FL2_CRUCIFIED 0x00000008 // insane is crucified
|
||||
#define FL2_WEAPON_ALT 0x00000010 // plasma guard has spread mode
|
||||
#define FL2_DO_NOT_REFLECT 0x00000020 // do not reflect this entity
|
||||
|
||||
|
||||
#define FRAMETIME 0.1
|
||||
|
||||
// memory tags to allow dynamic memory to be cleaned up
|
||||
|
@ -165,7 +175,7 @@ typedef enum
|
|||
AMMO_GRENADES,
|
||||
AMMO_CELLS,
|
||||
AMMO_SLUGS,
|
||||
// RAFAEL
|
||||
// Xatrix
|
||||
AMMO_MAGSLUG,
|
||||
AMMO_TRAP,
|
||||
// ROGUE
|
||||
|
@ -173,7 +183,7 @@ typedef enum
|
|||
AMMO_TESLA,
|
||||
AMMO_PROX,
|
||||
AMMO_DISRUPTOR,
|
||||
// Knightmare
|
||||
// Knightmare added
|
||||
AMMO_SHOCKSPHERE,
|
||||
AMMO_FUEL,
|
||||
AMMO_HOMING_ROCKETS,
|
||||
|
@ -203,7 +213,7 @@ typedef enum
|
|||
#define GIB_ORGANIC 0
|
||||
#define GIB_METALLIC 1
|
||||
|
||||
//monster ai flags
|
||||
// monster ai flags
|
||||
#define AI_STAND_GROUND 0x00000001
|
||||
#define AI_TEMP_STAND_GROUND 0x00000002
|
||||
#define AI_SOUND_TARGET 0x00000004
|
||||
|
@ -371,9 +381,9 @@ typedef struct
|
|||
#define IT_XATRIX 0x00000100 // Xatrix item
|
||||
#define IT_ROGUE 0x00000200 // Rogue item
|
||||
#define IT_LAZARUS 0x00000400 // Lazarus item
|
||||
#define IT_ZAERO 0x00000800 // Zaero item
|
||||
|
||||
#define IT_Q1 0x00001000 // added for Q1 keys
|
||||
#define IT_LM 0x00000800 // Loki's Missions item
|
||||
#define IT_ZAERO 0x00001000 // Zaero item
|
||||
#define IT_Q1 0x00002000 // added for Q1 keys
|
||||
|
||||
// gitem_t->weapmodel for weapons indicates model index
|
||||
#define WEAP_BLASTER 1
|
||||
|
@ -396,10 +406,11 @@ typedef struct
|
|||
#define WEAP_PHALANX 17
|
||||
#define WEAP_BOOMER 18
|
||||
#define WEAP_SHOCKWAVE 19
|
||||
#define WEAP_TRAP 20
|
||||
#define WEAP_TESLA 21
|
||||
#define WEAP_GRAPPLE 22
|
||||
#define WEAP_NONE 23
|
||||
#define WEAP_PLASMARIFLE 20
|
||||
#define WEAP_TRAP 21
|
||||
#define WEAP_TESLA 22
|
||||
#define WEAP_GRAPPLE 23
|
||||
#define WEAP_NONE 24
|
||||
|
||||
|
||||
typedef struct gitem_s
|
||||
|
@ -804,6 +815,7 @@ extern int homing_index;
|
|||
extern int rl_index;
|
||||
extern int hml_index;
|
||||
extern int pl_index;
|
||||
extern int pr_index; // SKWiD MOD
|
||||
extern int magslug_index;
|
||||
extern int flechettes_index;
|
||||
extern int prox_index;
|
||||
|
@ -887,7 +899,7 @@ extern int lastgibframe;
|
|||
#define MOD_DOPPLE_EXPLODE 55
|
||||
#define MOD_DOPPLE_VENGEANCE 56
|
||||
#define MOD_DOPPLE_HUNTER 57
|
||||
// aned ROGUE
|
||||
// end ROGUE
|
||||
|
||||
// Knightmare
|
||||
#define MOD_SHOCK_SPHERE 58
|
||||
|
@ -900,15 +912,16 @@ extern int lastgibframe;
|
|||
#define MOD_KICK 66
|
||||
#define MOD_MISSILE 67
|
||||
#define MOD_MISSILE_SPLASH 68
|
||||
#define MOD_PLASMA 69 // SKWiD MOD
|
||||
|
||||
// Zaero
|
||||
#define MOD_SNIPERRIFLE 69
|
||||
#define MOD_TRIPBOMB 70
|
||||
#define MOD_FLARE 71
|
||||
#define MOD_A2K 72
|
||||
#define MOD_SONICCANNON 73
|
||||
#define MOD_AUTOCANNON 74
|
||||
#define MOD_GL_POLYBLEND 75
|
||||
#define MOD_SNIPERRIFLE 70
|
||||
#define MOD_TRIPBOMB 71
|
||||
#define MOD_FLARE 72
|
||||
#define MOD_A2K 73
|
||||
#define MOD_SONICCANNON 74
|
||||
#define MOD_AUTOCANNON 75
|
||||
#define MOD_GL_POLYBLEND 76
|
||||
// end Zaero
|
||||
|
||||
//===============================
|
||||
|
@ -1167,6 +1180,7 @@ void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf
|
|||
// g_utils.c
|
||||
//
|
||||
qboolean KillBox (edict_t *ent);
|
||||
qboolean MonsterPlayerKillBox (edict_t *ent); // Zaero added
|
||||
void G_ProjectSource (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result);
|
||||
edict_t *G_Find (edict_t *from, size_t fieldofs, char *match); // Knightmare- changed fieldofs from int
|
||||
edict_t *findradius (edict_t *from, vec3_t org, float rad);
|
||||
|
@ -1202,9 +1216,10 @@ void GameDirRelativePath(char *filename, char *output, size_t outputSize);
|
|||
void SavegameDirRelativePath(char *filename, char *output, size_t outputSize);
|
||||
void CreatePath (char *path);
|
||||
void G_UseTarget (edict_t *ent, edict_t *activator, edict_t *target);
|
||||
qboolean IsIdMap (void); //Knightmare added
|
||||
qboolean IsRogueMap (void); //Knightmare added
|
||||
qboolean IsXatrixMap (void); //Knightmare added
|
||||
qboolean IsIdMap (void); // Knightmare added
|
||||
qboolean IsXatrixMap (void); // Knightmare added
|
||||
qboolean IsRogueMap (void); // Knightmare added
|
||||
qboolean IsZaeroMap (void); // Knightmare added
|
||||
qboolean CheckCoop_MapHacks (edict_t *ent); // FS: Coop: Check if we have to modify some stuff for coop so we don't have to rely on distributing ent files
|
||||
qboolean UseSpecialGoodGuyFlag (edict_t *monster); // Knightmare added
|
||||
qboolean UseRegularGoodGuyFlag (edict_t *monster); // Knightmare added
|
||||
|
@ -1331,16 +1346,23 @@ void monster_fire_shotgun (edict_t *self, vec3_t start, vec3_t aimdir, int damag
|
|||
void monster_fire_blaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect, int color);
|
||||
void monster_fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype);
|
||||
void monster_fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, edict_t *homing_target);
|
||||
//Knightmare added
|
||||
void monster_fire_missile (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, edict_t *homing_target);
|
||||
void monster_fire_missile (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, edict_t *homing_target); // Knightmare added
|
||||
void monster_fire_railgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype);
|
||||
void monster_fire_bfg (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype);
|
||||
|
||||
// RAFAEL
|
||||
void monster_fire_blueblaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect);
|
||||
void monster_fire_ionripper (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect);
|
||||
void monster_fire_rocket_heat (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype);
|
||||
void monster_dabeam (edict_t *self);
|
||||
void monster_fire_blueblaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect);
|
||||
|
||||
// ROGUE
|
||||
void monster_fire_blaster2 (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect);
|
||||
void monster_fire_tracker (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, edict_t *enemy, int flashtype);
|
||||
void monster_fire_heat (edict_t *self, vec3_t start, vec3_t dir, vec3_t offset, int damage, int kick, int flashtype);
|
||||
// ROGUE
|
||||
|
||||
void monster_fire_plasma_rifle (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, qboolean spread); // SKWiD MOD
|
||||
|
||||
void M_droptofloor (edict_t *ent);
|
||||
void monster_think (edict_t *self);
|
||||
|
@ -1354,13 +1376,12 @@ void M_CatagorizePosition (edict_t *ent);
|
|||
qboolean M_CheckAttack (edict_t *self);
|
||||
void M_FlyCheck (edict_t *self);
|
||||
void M_CheckGround (edict_t *ent);
|
||||
//ROGUE
|
||||
void monster_fire_blaster2 (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect);
|
||||
void monster_fire_tracker (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, edict_t *enemy, int flashtype);
|
||||
void monster_fire_heat (edict_t *self, vec3_t start, vec3_t dir, vec3_t offset, int damage, int kick, int flashtype);
|
||||
|
||||
// ROGUE
|
||||
void stationarymonster_start (edict_t *self);
|
||||
void monster_done_dodge (edict_t *self);
|
||||
//ROGUE
|
||||
// ROGUE
|
||||
|
||||
void InitiallyDead (edict_t *self);
|
||||
qboolean M_SetDeath(edict_t *self, mmove_t **deathmoves);
|
||||
int PatchMonsterModel (char *modelname);
|
||||
|
@ -1436,11 +1457,14 @@ void fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int s
|
|||
void fire_grenade2 (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius, qboolean held);
|
||||
//void fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage);
|
||||
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);
|
||||
//Knightmare added
|
||||
void fire_missile (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_shock_sphere (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage);
|
||||
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);
|
||||
|
||||
// Knightmare added
|
||||
void fire_missile (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_shock_sphere (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage);
|
||||
void fire_plasma_rifle (edict_t *ent, vec3_t start, vec3_t dir, int damage, int speed, qboolean spread); // SKWiD MOD
|
||||
|
||||
// RAFAEL
|
||||
void fire_ionripper (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect);
|
||||
void fire_rocket_heat (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage);
|
||||
|
@ -1450,6 +1474,8 @@ void fire_trap (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int spee
|
|||
void Trap_Die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
|
||||
void Cmd_KillTrap_f (edict_t *ent);
|
||||
void Trap_Explode (edict_t *ent);
|
||||
|
||||
// Lazarus
|
||||
qboolean AimGrenade (edict_t *launcher, vec3_t start, vec3_t target, vec_t speed, vec3_t aim);
|
||||
void Grenade_Evade (edict_t *monster);
|
||||
|
||||
|
@ -1603,6 +1629,7 @@ qboolean M_CheckBottom (edict_t *ent);
|
|||
qboolean M_walkmove (edict_t *ent, float yaw, float dist);
|
||||
void M_MoveToGoal (edict_t *ent, float dist);
|
||||
void M_ChangeYaw (edict_t *ent);
|
||||
qboolean M_MoveAwayFromFlare(edict_t *self, float dist); // Zaero
|
||||
|
||||
//
|
||||
// g_phys.c
|
||||
|
@ -1853,6 +1880,9 @@ int trigger_transition_ents (edict_t *changelevel, edict_t *self);
|
|||
// z_item.c
|
||||
//
|
||||
qboolean EMPNukeCheck(edict_t *ent, vec3_t pos);
|
||||
void updateVisorHud (edict_t *ent);
|
||||
void startVisorStatic (edict_t *ent);
|
||||
void stopCamera (edict_t *self);
|
||||
|
||||
//
|
||||
// z_weapon.c
|
||||
|
@ -1917,7 +1947,8 @@ typedef struct
|
|||
gitem_t *weapon;
|
||||
gitem_t *lastweapon;
|
||||
|
||||
qboolean fire_mode; // Lazarus - alternate firing mode
|
||||
qboolean fire_mode; // Lazarus - alternate firing mode
|
||||
qboolean plasma_mode; // SKWiD MOD- plasma rifle mode
|
||||
|
||||
int power_cubes; // used for tracking the cubes in coop games
|
||||
int score; // for calculating total unit score in coop games
|
||||
|
|
|
@ -300,7 +300,7 @@ void ClientEndServerFrames (void)
|
|||
ClientEndServerFrame (ent);
|
||||
}
|
||||
|
||||
//reflection stuff -- modified from psychospaz' original code
|
||||
// reflection stuff -- modified from psychospaz' original code
|
||||
if (level.num_reflectors)
|
||||
{
|
||||
ent = &g_edicts[0];
|
||||
|
@ -324,6 +324,8 @@ void ClientEndServerFrames (void)
|
|||
continue;
|
||||
if (ent->client && (ent->client->resp.spectator || (ent->health <= 0) || (ent->deadflag == DEAD_DEAD)) )
|
||||
continue;
|
||||
if (ent->moreflags & FL2_DO_NOT_REFLECT) // Knightmare- don't reflect flagged entities
|
||||
continue;
|
||||
AddReflection(ent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -359,7 +359,7 @@ void ThrowHead (edict_t *self, char *gibname, int damage, int type)
|
|||
char *p;
|
||||
|
||||
// Lazarus reflections
|
||||
DeleteReflection(self,-1);
|
||||
DeleteReflection (self,-1);
|
||||
|
||||
if (self->movewith) // Knightmare- remove stuff for movewith monsters
|
||||
{
|
||||
|
@ -375,7 +375,7 @@ void ThrowHead (edict_t *self, char *gibname, int damage, int type)
|
|||
VectorClear (self->maxs);
|
||||
|
||||
Com_strcpy(modelname, sizeof(modelname), gibname);
|
||||
p = strstr(modelname,"models/objects/gibs/");
|
||||
p = strstr(modelname, "models/objects/gibs/");
|
||||
if(p && self->gib_type)
|
||||
{
|
||||
p += 18;
|
||||
|
@ -737,6 +737,14 @@ void path_corner_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface
|
|||
|
||||
if (self->wait > 0)
|
||||
{
|
||||
// Zaero
|
||||
if ( IsZaeroMap() && (other->goalentity) )
|
||||
{
|
||||
VectorSubtract (other->goalentity->s.origin, other->s.origin, v);
|
||||
other->ideal_yaw = vectoyaw (v);
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
other->monsterinfo.pausetime = level.time + self->wait;
|
||||
other->monsterinfo.stand (other);
|
||||
return;
|
||||
|
@ -1039,7 +1047,7 @@ void SP_func_wall (edict_t *self)
|
|||
// it must be TRIGGER_SPAWN
|
||||
if (!(self->spawnflags & 1))
|
||||
{
|
||||
// gi.dprintf("func_wall missing TRIGGER_SPAWN\n");
|
||||
// gi.dprintf("func_wall missing TRIGGER_SPAWN\n");
|
||||
self->spawnflags |= 1;
|
||||
}
|
||||
|
||||
|
@ -2557,13 +2565,52 @@ void SP_misc_viper (edict_t *ent)
|
|||
return;
|
||||
}
|
||||
|
||||
// Zaero
|
||||
if ( IsZaeroMap() && (ent->spawnflags & 1) )
|
||||
{
|
||||
ent->s.effects |= EF_ROCKET;
|
||||
ent->spawnflags &= ~1; // turn this off so that it doesn't mess up the trains
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
ent->class_id = ENTITY_MISC_VIPER;
|
||||
|
||||
if (!ent->speed)
|
||||
ent->speed = 300;
|
||||
|
||||
ent->movetype = MOVETYPE_PUSH;
|
||||
ent->solid = SOLID_NOT;
|
||||
|
||||
// Zaero
|
||||
if ( IsZaeroMap() && (ent->spawnflags & 2) ) {
|
||||
ent->solid = SOLID_BBOX;
|
||||
}
|
||||
else {
|
||||
ent->solid = SOLID_NOT;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
// Zaero
|
||||
if ( IsZaeroMap() )
|
||||
{
|
||||
if (ent->model) {
|
||||
ent->s.modelindex = gi.modelindex (ent->model);
|
||||
}
|
||||
else {
|
||||
ent->s.modelindex = gi.modelindex ("models/ships/viper/tris.md2");
|
||||
}
|
||||
if (ent->model2) {
|
||||
ent->s.modelindex2 = gi.modelindex (ent->model2);
|
||||
}
|
||||
if (ent->model3) {
|
||||
ent->s.modelindex3 = gi.modelindex (ent->model3);
|
||||
}
|
||||
if (ent->model4) {
|
||||
ent->s.modelindex4 = gi.modelindex (ent->model4);
|
||||
}
|
||||
ent->spawnflags |= TRAIN_SMOOTH|TRAIN_ORIGIN; // set smooth movement and origin flag for zdef4
|
||||
}
|
||||
else
|
||||
// end Zaero
|
||||
// Mappack
|
||||
if (ent->spawnflags & 2)
|
||||
{
|
||||
|
@ -2580,7 +2627,7 @@ void SP_misc_viper (edict_t *ent)
|
|||
}
|
||||
ent->s.renderfx |= RF_IR_VISIBLE;
|
||||
|
||||
if (st.noise) // Kngihtmare added- movement sound
|
||||
if (st.noise) // Knightmare- added movement sound
|
||||
ent->noise_index = gi.soundindex (st.noise);
|
||||
|
||||
ent->think = func_train_find;
|
||||
|
@ -2594,15 +2641,15 @@ void SP_misc_viper (edict_t *ent)
|
|||
else
|
||||
ent->smooth_movement = 0;
|
||||
|
||||
//Knightmare- change both rotate flags to spline flag
|
||||
if ((ent->spawnflags & TRAIN_ROTATE) && (ent->spawnflags &TRAIN_ROT_CONST))
|
||||
// Knightmare- change both rotate flags to spline flag
|
||||
if ( (ent->spawnflags & TRAIN_ROTATE) && (ent->spawnflags & TRAIN_ROT_CONST) )
|
||||
{
|
||||
ent->spawnflags &= ~TRAIN_ROTATE;
|
||||
ent->spawnflags &= ~TRAIN_ROT_CONST;
|
||||
ent->spawnflags |= TRAIN_SPLINE;
|
||||
}
|
||||
|
||||
//Mappack
|
||||
// Mappack
|
||||
if(!ent->accel)
|
||||
ent->moveinfo.accel = ent->speed;
|
||||
else
|
||||
|
@ -2612,7 +2659,7 @@ void SP_misc_viper (edict_t *ent)
|
|||
else
|
||||
ent->moveinfo.decel = ent->decel;
|
||||
ent->moveinfo.speed = ent->speed;
|
||||
//Mappack
|
||||
// Mappack
|
||||
|
||||
// ent->moveinfo.accel = ent->moveinfo.decel = ent->moveinfo.speed = ent->speed;
|
||||
|
||||
|
@ -3189,15 +3236,15 @@ void SP_misc_strogg_ship (edict_t *ent)
|
|||
|
||||
ent->blood_type = 2; //for smoking gibs
|
||||
|
||||
//Knightmare- change both rotate flags to spline flag
|
||||
if ((ent->spawnflags & TRAIN_ROTATE) && (ent->spawnflags &TRAIN_ROT_CONST))
|
||||
// Knightmare- change both rotate flags to spline flag
|
||||
if ( (ent->spawnflags & TRAIN_ROTATE) && (ent->spawnflags & TRAIN_ROT_CONST) )
|
||||
{
|
||||
ent->spawnflags &= ~TRAIN_ROTATE;
|
||||
ent->spawnflags &= ~TRAIN_ROT_CONST;
|
||||
ent->spawnflags |= TRAIN_SPLINE;
|
||||
}
|
||||
|
||||
//Mappack
|
||||
// Mappack
|
||||
if(!ent->accel)
|
||||
ent->moveinfo.accel = ent->speed;
|
||||
else
|
||||
|
@ -3207,7 +3254,7 @@ void SP_misc_strogg_ship (edict_t *ent)
|
|||
else
|
||||
ent->moveinfo.decel = ent->decel;
|
||||
ent->moveinfo.speed = ent->speed;
|
||||
//Mappack
|
||||
// Mappack
|
||||
// ent->moveinfo.accel = ent->moveinfo.decel = ent->moveinfo.speed = ent->speed;
|
||||
|
||||
gi.linkentity (ent);
|
||||
|
@ -3264,8 +3311,8 @@ void SP_misc_transport (edict_t *ent)
|
|||
else
|
||||
ent->smooth_movement = 0;
|
||||
|
||||
//Knightmare- change both rotate flags to spline flag
|
||||
if ((ent->spawnflags & TRAIN_ROTATE) && (ent->spawnflags &TRAIN_ROT_CONST))
|
||||
// Knightmare- change both rotate flags to spline flag
|
||||
if ( (ent->spawnflags & TRAIN_ROTATE) && (ent->spawnflags & TRAIN_ROT_CONST) )
|
||||
{
|
||||
ent->spawnflags &= ~TRAIN_ROTATE;
|
||||
ent->spawnflags &= ~TRAIN_ROT_CONST;
|
||||
|
|
|
@ -141,6 +141,14 @@ void monster_fire_shotgun (edict_t *self, vec3_t start, vec3_t aimdir, int damag
|
|||
|
||||
void monster_fire_blaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect, int color)
|
||||
{
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_blaster (self, start, dir, damage, speed, effect, false, color);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
|
@ -149,9 +157,102 @@ void monster_fire_blaster (edict_t *self, vec3_t start, vec3_t dir, int damage,
|
|||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
void monster_fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype)
|
||||
{
|
||||
fire_grenade (self, start, aimdir, damage, speed, 2.5, damage+40, false);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
void monster_fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, edict_t *homing_target)
|
||||
{
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_rocket (self, start, dir, damage, speed, damage+20, damage, homing_target);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
// Knightmare added
|
||||
void monster_fire_missile (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, edict_t *homing_target)
|
||||
{
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_missile (self, start, dir, damage, speed, damage+20, damage, homing_target);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
void monster_fire_railgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype)
|
||||
{
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
// PMM
|
||||
if (!(gi.pointcontents (start) & MASK_SOLID))
|
||||
fire_rail (self, start, aimdir, damage, kick);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
void monster_fire_bfg (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype)
|
||||
{
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_bfg (self, start, aimdir, damage, speed, damage_radius);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void monster_fire_blueblaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
|
||||
{
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_blueblaster (self, start, dir, damage, speed, effect);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
|
@ -163,6 +264,14 @@ void monster_fire_blueblaster (edict_t *self, vec3_t start, vec3_t dir, int dama
|
|||
// RAFAEL
|
||||
void monster_fire_ionripper (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
|
||||
{
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_ionripper (self, start, dir, damage, speed, effect);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
|
@ -174,6 +283,14 @@ void monster_fire_ionripper (edict_t *self, vec3_t start, vec3_t dir, int damage
|
|||
// RAFAEL
|
||||
void monster_fire_rocket_heat (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype)
|
||||
{
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_rocket_heat (self, start, dir, damage, speed, damage, damage);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
|
@ -182,39 +299,6 @@ void monster_fire_rocket_heat (edict_t *self, vec3_t start, vec3_t dir, int dama
|
|||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
//ROGUE
|
||||
void monster_fire_blaster2 (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
|
||||
{
|
||||
fire_blaster2 (self, start, dir, damage, speed, effect, false);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
// FIXME -- add muzzle flash
|
||||
void monster_fire_tracker (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, edict_t *enemy, int flashtype)
|
||||
{
|
||||
fire_tracker (self, start, dir, damage, speed, enemy);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
void monster_fire_heat (edict_t *self, vec3_t start, vec3_t dir, vec3_t offset, int damage, int kick, int flashtype)
|
||||
{
|
||||
fire_heat (self, start, dir, offset, damage, kick, true);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
//ROGUE
|
||||
|
||||
// RAFAEL
|
||||
void dabeam_hit (edict_t *self)
|
||||
{
|
||||
|
@ -325,10 +409,18 @@ void monster_dabeam (edict_t *self)
|
|||
self->svflags &= ~SVF_NOCLIENT;
|
||||
}
|
||||
|
||||
|
||||
void monster_fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype)
|
||||
// ROGUE
|
||||
void monster_fire_blaster2 (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect)
|
||||
{
|
||||
fire_grenade (self, start, aimdir, damage, speed, 2.5, damage+40, false);
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_blaster2 (self, start, dir, damage, speed, effect, false);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
|
@ -336,9 +428,18 @@ void monster_fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damag
|
|||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
void monster_fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, edict_t *homing_target)
|
||||
// FIXME -- add muzzle flash
|
||||
void monster_fire_tracker (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, edict_t *enemy, int flashtype)
|
||||
{
|
||||
fire_rocket (self, start, dir, damage, speed, damage+20, damage, homing_target);
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_tracker (self, start, dir, damage, speed, enemy);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
|
@ -346,22 +447,37 @@ void monster_fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, i
|
|||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
//Knightmare added
|
||||
void monster_fire_missile (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, edict_t *homing_target)
|
||||
void monster_fire_heat (edict_t *self, vec3_t start, vec3_t dir, vec3_t offset, int damage, int kick, int flashtype)
|
||||
{
|
||||
fire_missile (self, start, dir, damage, speed, damage+20, damage, homing_target);
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_heat (self, start, dir, offset, damage, kick, true);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
// ROGUE
|
||||
|
||||
void monster_fire_railgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype)
|
||||
// SKWiD MOD
|
||||
void monster_fire_plasma_rifle (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, qboolean spread)
|
||||
{
|
||||
// PMM
|
||||
if (!(gi.pointcontents (start) & MASK_SOLID))
|
||||
fire_rail (self, start, aimdir, damage, kick);
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
fire_plasma_rifle (self, start, dir, damage, speed, spread);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
|
@ -369,17 +485,6 @@ void monster_fire_railgun (edict_t *self, vec3_t start, vec3_t aimdir, int damag
|
|||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
void monster_fire_bfg (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype)
|
||||
{
|
||||
fire_bfg (self, start, aimdir, damage, speed, damage_radius);
|
||||
|
||||
gi.WriteByte (svc_muzzleflash2);
|
||||
gi.WriteShort (self - g_edicts);
|
||||
gi.WriteByte (flashtype);
|
||||
gi.multicast (start, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Monster utility functions
|
||||
|
@ -404,7 +509,7 @@ void M_FliesOn (edict_t *self)
|
|||
|
||||
void M_FlyCheck (edict_t *self)
|
||||
{
|
||||
//Knightmare- keep running lava check
|
||||
// Knightmare- keep running lava check
|
||||
self->postthink = deadmonster_think;
|
||||
|
||||
if (self->monsterinfo.flies > 1.0)
|
||||
|
@ -418,7 +523,7 @@ void M_FlyCheck (edict_t *self)
|
|||
if (self->waterlevel)
|
||||
return;
|
||||
|
||||
if (random() > self->monsterinfo.flies) //was 0.33
|
||||
if (random() > self->monsterinfo.flies) // was 0.33
|
||||
return;
|
||||
|
||||
if (world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
|
@ -498,9 +603,11 @@ void M_CheckGround (edict_t *ent)
|
|||
// 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.
|
||||
// Knightmare- this wrecks aiming for many/most monster_turrets in a map!
|
||||
// Leave this commented out, or disable it for turrets!
|
||||
// ent->groundentity = trace.ent;
|
||||
// ent->groundentity_linkcount = trace.ent->linkcount;
|
||||
|
||||
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)
|
||||
|
@ -616,7 +723,7 @@ void M_WorldEffects (edict_t *ent)
|
|||
T_Damage (ent, world, world, vec3_origin, ent->s.origin, vec3_origin, 10*ent->waterlevel, 0, 0, MOD_LAVA);
|
||||
}
|
||||
}
|
||||
//No slime damage for dead monsters
|
||||
// No slime damage for dead monsters
|
||||
if ((ent->watertype & CONTENTS_SLIME) && !(ent->flags & FL_IMMUNE_SLIME) && !(ent->svflags & SVF_DEADMONSTER))
|
||||
{
|
||||
if (ent->damage_debounce_time < level.time)
|
||||
|
@ -882,6 +989,12 @@ void monster_think (edict_t *self)
|
|||
M_CatagorizePosition (self);
|
||||
M_WorldEffects (self);
|
||||
M_SetEffects (self);
|
||||
|
||||
// Zaero add
|
||||
// decrease blindness
|
||||
if (self->monsterinfo.flashTime > 0)
|
||||
self->monsterinfo.flashTime--;
|
||||
// end Zaero
|
||||
}
|
||||
|
||||
// Knightmare- for dead monsters to check
|
||||
|
@ -950,6 +1063,7 @@ void monster_triggered_spawn (edict_t *self)
|
|||
self->movetype = MOVETYPE_STEP;
|
||||
self->svflags &= ~SVF_NOCLIENT;
|
||||
self->air_finished = level.time + 12;
|
||||
|
||||
// Knightmare- teleport effect for Q1 monsters
|
||||
if (self->flags & FL_Q1_MONSTER) {
|
||||
#ifdef KMQUAKE2_ENGINE_MOD
|
||||
|
@ -960,8 +1074,15 @@ void monster_triggered_spawn (edict_t *self)
|
|||
#endif
|
||||
}
|
||||
// end Knightmare
|
||||
gi.linkentity (self);
|
||||
|
||||
// Zaero add
|
||||
/* if ( IsZaeroMap() ) {
|
||||
self->s.event = EV_PLAYER_TELEPORT;
|
||||
MonsterPlayerKillBox (self);
|
||||
}*/
|
||||
// end Zaero
|
||||
|
||||
gi.linkentity (self);
|
||||
monster_start_go (self);
|
||||
|
||||
if (self->enemy && !(self->spawnflags & 1) && !(self->enemy->flags & FL_NOTARGET))
|
||||
|
@ -982,9 +1103,11 @@ void monster_triggered_spawn_use (edict_t *self, edict_t *other, edict_t *activa
|
|||
// we have a one frame delay here so we don't telefrag the guy who activated us
|
||||
self->think = monster_triggered_spawn;
|
||||
self->nextthink = level.time + FRAMETIME;
|
||||
|
||||
// Knightmare- good guy monsters shouldn't have an enemy from this
|
||||
if (activator->client && !(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
self->enemy = activator;
|
||||
|
||||
// Lazarus: Add 'em up
|
||||
// if (!(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
// level.total_monsters++;
|
||||
|
@ -1095,11 +1218,14 @@ qboolean monster_start (edict_t *self)
|
|||
self->spawnflags &= ~MONSTER_SIGHT;
|
||||
self->spawnflags |= MONSTER_AMBUSH;
|
||||
} */
|
||||
if ((self->spawnflags & SF_MONSTER_AMBUSH) && !(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
if ( (self->spawnflags & SF_MONSTER_AMBUSH) && !(self->monsterinfo.aiflags & AI_GOOD_GUY) )
|
||||
self->spawnflags |= SF_MONSTER_SIGHT;
|
||||
|
||||
//if (!(self->monsterinfo.aiflags & AI_GOOD_GUY) && !(self->monsterinfo.aiflags & AI_DO_NOT_COUNT))
|
||||
if (!(self->monsterinfo.aiflags & AI_GOOD_GUY) && !(self->monsterinfo.monsterflags & MFL_DO_NOT_COUNT)/* && !(self->spawnflags & SF_MONSTER_TRIGGER_SPAWN*/)
|
||||
// Zaero- spawnflag 16 = do not count
|
||||
// if ( !(self->monsterinfo.aiflags & AI_GOOD_GUY) && !(self->monsterinfo.aiflags & AI_DO_NOT_COUNT) )
|
||||
// if ( !(self->monsterinfo.aiflags & AI_GOOD_GUY) && !(self->monsterinfo.monsterflags & MFL_DO_NOT_COUNT)/* && !(self->spawnflags & SF_MONSTER_TRIGGER_SPAWN*/ )
|
||||
// Zaero- spawnflag 16 = do not count
|
||||
if ( !(self->monsterinfo.aiflags & AI_GOOD_GUY) && !(self->monsterinfo.monsterflags & MFL_DO_NOT_COUNT) && !(IsZaeroMap() && (self->spawnflags & 16)) )
|
||||
level.total_monsters++;
|
||||
|
||||
self->nextthink = level.time + FRAMETIME;
|
||||
|
@ -1542,7 +1668,7 @@ int PatchMonsterModel (char *modelname)
|
|||
else if (!strcmp(modelname,"models/monsters/soldier/tris.md2"))
|
||||
{
|
||||
is_soldier = true;
|
||||
numskins = 24;
|
||||
numskins = 32; // was 24
|
||||
}
|
||||
// Knightmare added
|
||||
#ifdef CITADELMOD_FEATURES
|
||||
|
@ -1635,41 +1761,57 @@ int PatchMonsterModel (char *modelname)
|
|||
case 5:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "skin_ssp.pcx"); break;
|
||||
case 6:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom1_lt.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "skin_pl.pcx"); break;
|
||||
case 7:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain1_lt.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "skin_plp.pcx"); break;
|
||||
case 8:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom1.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom1_lt.pcx"); break;
|
||||
case 9:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain1.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain1_lt.pcx"); break;
|
||||
case 10:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom1_ss.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom1.pcx"); break;
|
||||
case 11:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain1_ss.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain1.pcx"); break;
|
||||
case 12:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom2_lt.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom1_ss.pcx"); break;
|
||||
case 13:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain2_lt.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain1_ss.pcx"); break;
|
||||
case 14:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom2.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom1_pl.pcx"); break;
|
||||
case 15:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain2.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain1_pl.pcx"); break;
|
||||
case 16:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom2_ss.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom2_lt.pcx"); break;
|
||||
case 17:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain2_ss.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain2_lt.pcx"); break;
|
||||
case 18:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom3_lt.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom2.pcx"); break;
|
||||
case 19:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain3_lt.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain2.pcx"); break;
|
||||
case 20:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom3.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom2_ss.pcx"); break;
|
||||
case 21:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain3.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain2_ss.pcx"); break;
|
||||
case 22:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom3_ss.pcx"); break;
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom2_pl.pcx"); break;
|
||||
case 23:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain2_pl.pcx"); break;
|
||||
case 24:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom3_lt.pcx"); break;
|
||||
case 25:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain3_lt.pcx"); break;
|
||||
case 26:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom3.pcx"); break;
|
||||
case 27:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain3.pcx"); break;
|
||||
case 28:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom3_ss.pcx"); break;
|
||||
case 29:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain3_ss.pcx"); break;
|
||||
case 30:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custom3_pl.pcx"); break;
|
||||
case 31:
|
||||
Com_strcat (skins[j], sizeof(skins[j]), "custompain3_pl.pcx"); break;
|
||||
}
|
||||
}
|
||||
else if (is_tank)
|
||||
|
|
|
@ -48,7 +48,7 @@ void flechette_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t
|
|||
}
|
||||
else
|
||||
{
|
||||
if(!plane)
|
||||
if (!plane)
|
||||
VectorClear (dir);
|
||||
else
|
||||
VectorScale (plane->normal, 256, dir);
|
||||
|
@ -112,7 +112,7 @@ void fire_flechette (edict_t *self, vec3_t start, vec3_t dir, int damage, int sp
|
|||
|
||||
void flechette_delayed_start (edict_t *flechette)
|
||||
{
|
||||
if(g_edicts[1].linkcount)
|
||||
if (g_edicts[1].linkcount)
|
||||
{
|
||||
VectorScale(flechette->movedir,flechette->moveinfo.speed,flechette->velocity);
|
||||
flechette->nextthink = level.time + 2;
|
||||
|
@ -209,17 +209,17 @@ movefield:
|
|||
|
||||
// If parent is spinning, add appropriate velocities
|
||||
VectorSubtract(self->s.origin, host->s.origin, offset);
|
||||
if(host->avelocity[PITCH] != 0)
|
||||
if (host->avelocity[PITCH] != 0)
|
||||
{
|
||||
self->velocity[2] -= offset[0] * host->avelocity[PITCH] * M_PI / 180;
|
||||
self->velocity[0] += offset[2] * host->avelocity[PITCH] * M_PI / 180;
|
||||
}
|
||||
if(host->avelocity[YAW] != 0)
|
||||
if (host->avelocity[YAW] != 0)
|
||||
{
|
||||
self->velocity[0] -= offset[1] * host->avelocity[YAW] * M_PI / 180.;
|
||||
self->velocity[1] += offset[0] * host->avelocity[YAW] * M_PI / 180.;
|
||||
}
|
||||
if(host->avelocity[ROLL] != 0)
|
||||
if (host->avelocity[ROLL] != 0)
|
||||
{
|
||||
self->velocity[1] -= offset[2] * host->avelocity[ROLL] * M_PI / 180;
|
||||
self->velocity[2] += offset[1] * host->avelocity[ROLL] * M_PI / 180;
|
||||
|
@ -281,11 +281,11 @@ void Prox_Explode (edict_t *ent)
|
|||
// free the trigger field
|
||||
|
||||
//PMM - changed teammaster to "mover" .. owner of the field is the prox
|
||||
if(ent->teamchain && ent->teamchain->owner == ent)
|
||||
if (ent->teamchain && ent->teamchain->owner == ent)
|
||||
G_FreeEdict(ent->teamchain);
|
||||
|
||||
owner = ent;
|
||||
if(ent->teammaster)
|
||||
if (ent->teammaster)
|
||||
{
|
||||
owner = ent->teammaster;
|
||||
PlayerNoise(owner, ent->s.origin, PNOISE_IMPACT);
|
||||
|
@ -323,7 +323,7 @@ void Prox_Explode (edict_t *ent)
|
|||
|
||||
//===============
|
||||
//===============
|
||||
void prox_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
|
||||
void prox_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
|
||||
{
|
||||
//gi.dprintf("prox_die\n");
|
||||
// if set off by another prox, delay a little (chained explosions)
|
||||
|
@ -363,7 +363,7 @@ void Prox_Field_Touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t
|
|||
return;
|
||||
}
|
||||
|
||||
if(prox->teamchain == ent)
|
||||
if (prox->teamchain == ent)
|
||||
{
|
||||
gi.sound (ent, CHAN_VOICE, gi.soundindex ("weapons/proxwarn.wav"), 1, ATTN_NORM, 0);
|
||||
prox->think = Prox_Explode;
|
||||
|
@ -379,14 +379,14 @@ void Prox_Field_Touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t
|
|||
//===============
|
||||
void prox_seek (edict_t *ent)
|
||||
{
|
||||
if(level.time > ent->wait)
|
||||
if (level.time > ent->wait)
|
||||
{
|
||||
Prox_Explode(ent);
|
||||
}
|
||||
else
|
||||
{
|
||||
ent->s.frame++;
|
||||
if(ent->s.frame > 13)
|
||||
if (ent->s.frame > 13)
|
||||
ent->s.frame = 9;
|
||||
ent->think = prox_seek;
|
||||
ent->nextthink = level.time + 0.1;
|
||||
|
@ -408,14 +408,14 @@ void prox_open (edict_t *ent)
|
|||
search = NULL;
|
||||
// gi.dprintf("prox_open %d\n", ent->s.frame);
|
||||
// gi.dprintf("%f\n", ent->velocity[2]);
|
||||
if(ent->s.frame == 9) // end of opening animation
|
||||
if (ent->s.frame == 9) // end of opening animation
|
||||
{
|
||||
// set the owner to NULL so the owner can shoot it, etc. needs to be done here so the owner
|
||||
// doesn't get stuck on it while it's opening if fired at point blank wall
|
||||
ent->s.sound = 0;
|
||||
// Knightmare- the above never happens, and the owner pointer is needed for remote detonation
|
||||
//ent->owner = NULL;
|
||||
if(ent->teamchain)
|
||||
if (ent->teamchain)
|
||||
ent->teamchain->touch = Prox_Field_Touch;
|
||||
while ((search = findradius(search, ent->s.origin, sk_prox_radius->value + 10)) != NULL)
|
||||
{
|
||||
|
@ -530,7 +530,7 @@ void prox_land (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
|
|||
|
||||
if ((other->svflags & SVF_MONSTER) || other->client || (other->svflags & SVF_DAMAGEABLE))
|
||||
{
|
||||
if(other != ent->teammaster)
|
||||
if (other != ent->teammaster)
|
||||
Prox_Explode(ent);
|
||||
|
||||
return;
|
||||
|
@ -690,7 +690,7 @@ void fire_prox (edict_t *self, vec3_t start, vec3_t aimdir, int damage_multiplie
|
|||
//Knightmare- add player's base velocity to prox
|
||||
if (add_velocity_throw->value && self->client)
|
||||
VectorAdd (prox->velocity, self->velocity, prox->velocity);
|
||||
else if(self->groundentity)
|
||||
else if (self->groundentity)
|
||||
VectorAdd (prox->velocity, self->groundentity->velocity, prox->velocity);
|
||||
|
||||
VectorCopy (dir, prox->s.angles);
|
||||
|
@ -758,7 +758,7 @@ void Cmd_DetProx_f (edict_t *ent)
|
|||
|
||||
void prox_delayed_start (edict_t *prox)
|
||||
{
|
||||
if(g_edicts[1].linkcount)
|
||||
if (g_edicts[1].linkcount)
|
||||
{
|
||||
VectorScale(prox->movedir,prox->moveinfo.speed,prox->velocity);
|
||||
prox->movetype = MOVETYPE_BOUNCE;
|
||||
|
@ -779,7 +779,7 @@ void SP_prox (edict_t *prox)
|
|||
prox->postthink = NULL;
|
||||
|
||||
// For SP, freeze prox until player spawns in
|
||||
if(game.maxclients == 1 && VectorLength (prox->velocity))
|
||||
if (game.maxclients == 1 && VectorLength (prox->velocity))
|
||||
{
|
||||
prox->movetype = MOVETYPE_NONE;
|
||||
VectorCopy(prox->velocity,prox->movedir);
|
||||
|
@ -808,7 +808,7 @@ void SP_prox (edict_t *prox)
|
|||
|
||||
void fire_remove (edict_t *ent)
|
||||
{
|
||||
if(ent == ent->owner->teamchain)
|
||||
if (ent == ent->owner->teamchain)
|
||||
ent->owner->teamchain = NULL;
|
||||
|
||||
G_FreeEdict(ent);
|
||||
|
@ -885,27 +885,27 @@ void fire_maintain (edict_t *ent, edict_t *flame, vec3_t start, vec3_t aimdir, i
|
|||
// player fire point to flame origin.
|
||||
tr = gi.trace(start, flame->mins, flame->maxs,
|
||||
flame->s.origin, flame, MASK_SHOT);
|
||||
if(tr.fraction == 1.0)
|
||||
if (tr.fraction == 1.0)
|
||||
{
|
||||
// origin to point 1
|
||||
tr = gi.trace(flame->s.origin, flame->mins, flame->maxs,
|
||||
flame->flameinfo.pos1, flame, MASK_SHOT);
|
||||
if(tr.fraction == 1.0)
|
||||
if (tr.fraction == 1.0)
|
||||
{
|
||||
// point 1 to point 2
|
||||
tr = gi.trace(flame->flameinfo.pos1, flame->mins, flame->maxs,
|
||||
flame->flameinfo.pos2, flame, MASK_SHOT);
|
||||
if(tr.fraction == 1.0)
|
||||
if (tr.fraction == 1.0)
|
||||
{
|
||||
// point 2 to point 3
|
||||
tr = gi.trace(flame->flameinfo.pos2, flame->mins, flame->maxs,
|
||||
flame->flameinfo.pos3, flame, MASK_SHOT);
|
||||
if(tr.fraction == 1.0)
|
||||
if (tr.fraction == 1.0)
|
||||
{
|
||||
// point 3 to point 4, point 3 valid
|
||||
tr = gi.trace(flame->flameinfo.pos3, flame->mins, flame->maxs,
|
||||
flame->flameinfo.pos4, flame, MASK_SHOT);
|
||||
if(tr.fraction < 1.0) // point 4 blocked
|
||||
if (tr.fraction < 1.0) // point 4 blocked
|
||||
{
|
||||
VectorCopy(tr.endpos, flame->flameinfo.pos4);
|
||||
}
|
||||
|
@ -950,7 +950,7 @@ void fire_maintain (edict_t *ent, edict_t *flame, vec3_t start, vec3_t aimdir, i
|
|||
VectorCopy(tr.endpos, flame->flameinfo.pos4);
|
||||
}
|
||||
|
||||
if(tr.fraction < 1.0 && tr.ent->takedamage)
|
||||
if (tr.fraction < 1.0 && tr.ent->takedamage)
|
||||
{
|
||||
T_Damage (tr.ent, flame, ent, flame->velocity, tr.endpos, tr.plane.normal,
|
||||
damage, 0, DAMAGE_NO_KNOCKBACK | DAMAGE_ENERGY | DAMAGE_FIRE);
|
||||
|
@ -986,22 +986,22 @@ void flameshooter_think (edict_t *self)
|
|||
vec3_t forward, right, up;
|
||||
edict_t *flame;
|
||||
|
||||
if(self->delay)
|
||||
if (self->delay)
|
||||
{
|
||||
if(self->teamchain)
|
||||
if (self->teamchain)
|
||||
fire_remove (self->teamchain);
|
||||
return;
|
||||
}
|
||||
|
||||
self->s.angles[1] += self->speed;
|
||||
if(self->s.angles[1] > 135 || self->s.angles[1] < 45)
|
||||
if (self->s.angles[1] > 135 || self->s.angles[1] < 45)
|
||||
self->speed = -self->speed;
|
||||
|
||||
AngleVectors (self->s.angles, forward, right, up);
|
||||
|
||||
#ifdef FLAMESHOOTER_STREAM
|
||||
flame = self->teamchain;
|
||||
if(!self->teamchain)
|
||||
if (!self->teamchain)
|
||||
fire_flame (self, self->s.origin, forward, FLAMESHOOTER_DAMAGE, FLAMESHOOTER_VELOCITY);
|
||||
else
|
||||
fire_maintain (self, flame, self->s.origin, forward, FLAMESHOOTER_DAMAGE, FLAMESHOOTER_VELOCITY);
|
||||
|
@ -1018,7 +1018,7 @@ void flameshooter_think (edict_t *self)
|
|||
|
||||
void flameshooter_use (edict_t *self, edict_t *other, edict_t *activator)
|
||||
{
|
||||
if(self->delay)
|
||||
if (self->delay)
|
||||
{
|
||||
self->delay = 0;
|
||||
self->think = flameshooter_think;
|
||||
|
@ -1038,7 +1038,7 @@ void SP_trap_flameshooter(edict_t *self)
|
|||
self->delay = 0;
|
||||
|
||||
self->use = flameshooter_use;
|
||||
if(self->delay == 0)
|
||||
if (self->delay == 0)
|
||||
{
|
||||
self->think = flameshooter_think;
|
||||
self->nextthink = level.time + 0.1;
|
||||
|
@ -1082,20 +1082,20 @@ void fire_burst_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t
|
|||
return;
|
||||
}
|
||||
|
||||
if(other == ent->owner || ent == other)
|
||||
if (other == ent->owner || ent == other)
|
||||
return;
|
||||
|
||||
// don't let flame puffs blow each other up
|
||||
if(other->classname && !strcmp(other->classname, ent->classname))
|
||||
if (other->classname && !strcmp(other->classname, ent->classname))
|
||||
return;
|
||||
|
||||
if(ent->waterlevel)
|
||||
if (ent->waterlevel)
|
||||
{
|
||||
// gi.dprintf("Hit water. Removed\n");
|
||||
G_FreeEdict(ent);
|
||||
}
|
||||
|
||||
if(!(other->svflags & SVF_MONSTER) && !other->client)
|
||||
if (!(other->svflags & SVF_MONSTER) && !other->client)
|
||||
{
|
||||
powerunits = FLAME_BURST_FRAMES - ent->s.frame;
|
||||
damage = powerunits * 6;
|
||||
|
@ -1123,20 +1123,20 @@ void fire_burst_think (edict_t *self)
|
|||
{
|
||||
int current_radius;
|
||||
|
||||
if(self->waterlevel)
|
||||
if (self->waterlevel)
|
||||
{
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
}
|
||||
|
||||
self->s.frame++;
|
||||
if(self->s.frame >= FLAME_BURST_FRAMES)
|
||||
if (self->s.frame >= FLAME_BURST_FRAMES)
|
||||
{
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
}
|
||||
|
||||
else if(self->s.frame < FLAME_BURST_MIDPOINT)
|
||||
else if (self->s.frame < FLAME_BURST_MIDPOINT)
|
||||
{
|
||||
current_radius = (FLAME_BURST_MAX_SIZE / FLAME_BURST_MIDPOINT) * self->s.frame;
|
||||
}
|
||||
|
@ -1145,7 +1145,7 @@ void fire_burst_think (edict_t *self)
|
|||
current_radius = (FLAME_BURST_MAX_SIZE / FLAME_BURST_MIDPOINT) * (FLAME_BURST_FRAMES - self->s.frame);
|
||||
}
|
||||
|
||||
if(self->s.frame == 3)
|
||||
if (self->s.frame == 3)
|
||||
self->s.skinnum = 1;
|
||||
else if (self->s.frame == 7)
|
||||
self->s.skinnum = 2;
|
||||
|
@ -1158,9 +1158,9 @@ void fire_burst_think (edict_t *self)
|
|||
else if (self->s.frame == 19)
|
||||
self->s.skinnum = 6;
|
||||
|
||||
if(current_radius < 8)
|
||||
if (current_radius < 8)
|
||||
current_radius = 8;
|
||||
else if(current_radius > FLAME_BURST_MAX_SIZE)
|
||||
else if (current_radius > FLAME_BURST_MAX_SIZE)
|
||||
current_radius = FLAME_BURST_MAX_SIZE;
|
||||
|
||||
T_RadiusDamage(self, self->owner, self->dmg, self, current_radius, DAMAGE_FIRE);
|
||||
|
@ -1215,12 +1215,12 @@ void fire_burst (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int spe
|
|||
#ifdef INCLUDE_INCENDIARY
|
||||
void FireThink (edict_t *ent)
|
||||
{
|
||||
if(level.time > ent->wait)
|
||||
if (level.time > ent->wait)
|
||||
G_FreeEdict(ent);
|
||||
else
|
||||
{
|
||||
ent->s.frame++;
|
||||
if(ent->s.frame>10)
|
||||
if (ent->s.frame>10)
|
||||
ent->s.frame = 0;
|
||||
ent->nextthink = level.time + 0.05;
|
||||
ent->think = FireThink;
|
||||
|
@ -1378,7 +1378,7 @@ void fire_player_melee (edict_t *self, vec3_t start, vec3_t aim, int reach, int
|
|||
tr = gi.trace(start, NULL, NULL, point, self, MASK_SHOT);
|
||||
if (tr.fraction == 1.0)
|
||||
{
|
||||
if(!quiet)
|
||||
if (!quiet)
|
||||
gi.sound (self, CHAN_WEAPON, gi.soundindex ("weapons/swish.wav"), 1, ATTN_NORM, 0);
|
||||
//FIXME some sound here?
|
||||
return;
|
||||
|
@ -1392,18 +1392,18 @@ void fire_player_melee (edict_t *self, vec3_t start, vec3_t aim, int reach, int
|
|||
|
||||
// do the damage
|
||||
// FIXME - make the damage appear at right spot and direction
|
||||
if(mod == MOD_CHAINFIST)
|
||||
if (mod == MOD_CHAINFIST)
|
||||
T_Damage (tr.ent, self, self, vec3_origin, tr.ent->s.origin, vec3_origin, damage, kick/2,
|
||||
DAMAGE_DESTROY_ARMOR | DAMAGE_NO_KNOCKBACK, mod);
|
||||
else
|
||||
T_Damage (tr.ent, self, self, vec3_origin, tr.ent->s.origin, vec3_origin, damage, kick/2, DAMAGE_NO_KNOCKBACK, mod);
|
||||
|
||||
if(!quiet)
|
||||
if (!quiet)
|
||||
gi.sound (self, CHAN_WEAPON, gi.soundindex ("weapons/meatht.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!quiet)
|
||||
if (!quiet)
|
||||
gi.sound (self, CHAN_WEAPON, gi.soundindex ("weapons/tink1.wav"), 1, ATTN_NORM, 0);
|
||||
|
||||
VectorScale (tr.plane.normal, 256, point);
|
||||
|
@ -1587,7 +1587,7 @@ void Nuke_Think(edict_t *ent)
|
|||
else if (level.time >= (ent->wait - sk_nuke_life->value))
|
||||
{
|
||||
ent->s.frame++;
|
||||
if(ent->s.frame > 11)
|
||||
if (ent->s.frame > 11)
|
||||
ent->s.frame = 6;
|
||||
|
||||
if (gi.pointcontents (ent->s.origin) & (CONTENTS_SLIME|CONTENTS_LAVA))
|
||||
|
@ -1828,7 +1828,7 @@ void Nbomb_Think(edict_t *ent)
|
|||
attenuation = default_atten/3.0;
|
||||
muzzleflash = MZ_NUKE4;
|
||||
|
||||
if(ent->wait < level.time)
|
||||
if (ent->wait < level.time)
|
||||
Nbomb_Explode(ent);
|
||||
else if (level.time >= (ent->wait - sk_nbomb_life->value))
|
||||
{
|
||||
|
@ -1920,7 +1920,7 @@ void fire_nbomb (edict_t *self, vec3_t start, vec3_t aimdir, int speed)
|
|||
VectorMA (nbomb->velocity, 200 + crandom() * 10.0, up, nbomb->velocity);
|
||||
VectorMA (nbomb->velocity, crandom() * 10.0, right, nbomb->velocity);
|
||||
//Knightmare- add player's base velocity to nbomb
|
||||
if(self->groundentity)
|
||||
if (self->groundentity)
|
||||
VectorAdd (nbomb->velocity, self->groundentity->velocity, nbomb->velocity);
|
||||
|
||||
VectorClear (nbomb->avelocity);
|
||||
|
@ -1980,10 +1980,10 @@ void tesla_remove (edict_t *self)
|
|||
edict_t *cur, *next;
|
||||
|
||||
self->takedamage = DAMAGE_NO;
|
||||
if(self->teamchain)
|
||||
if (self->teamchain)
|
||||
{
|
||||
cur = self->teamchain;
|
||||
while(cur)
|
||||
while (cur)
|
||||
{
|
||||
next = cur->teamchain;
|
||||
G_FreeEdict ( cur );
|
||||
|
@ -2047,7 +2047,7 @@ void tesla_think_active (edict_t *self)
|
|||
for (i=0;i<num;i++)
|
||||
{
|
||||
// if the tesla died while zapping things, stop zapping.
|
||||
if(!(self->inuse))
|
||||
if (!(self->inuse))
|
||||
break;
|
||||
|
||||
hit=touch[i];
|
||||
|
@ -2130,7 +2130,7 @@ void tesla_activate (edict_t *self)
|
|||
// or it's a deathmatch start point
|
||||
// and we can see it
|
||||
// blow up
|
||||
if(search->classname)
|
||||
if (search->classname)
|
||||
{
|
||||
if ( ( (!strcmp(search->classname, "info_player_deathmatch"))
|
||||
|| (!strcmp(search->classname, "info_player_start"))
|
||||
|
@ -2193,11 +2193,11 @@ void tesla_think (edict_t *ent)
|
|||
else if (!ent->groundentity)
|
||||
ent->s.effects |= EF_GRENADE;
|
||||
|
||||
if(!(ent->s.frame))
|
||||
if (!(ent->s.frame))
|
||||
gi.sound (ent, CHAN_VOICE, gi.soundindex ("weapons/teslaopen.wav"), 1, ATTN_NORM, 0);
|
||||
|
||||
ent->s.frame++;
|
||||
if(ent->s.frame > 14)
|
||||
if (ent->s.frame > 14)
|
||||
{
|
||||
ent->s.frame = 14;
|
||||
ent->think = tesla_activate;
|
||||
|
@ -2205,9 +2205,9 @@ void tesla_think (edict_t *ent)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(ent->s.frame > 9)
|
||||
if (ent->s.frame > 9)
|
||||
{
|
||||
if(ent->s.frame == 10)
|
||||
if (ent->s.frame == 10)
|
||||
{
|
||||
if (ent->owner && ent->owner->client)
|
||||
{
|
||||
|
@ -2215,9 +2215,9 @@ void tesla_think (edict_t *ent)
|
|||
}
|
||||
ent->s.skinnum = 1;
|
||||
}
|
||||
else if(ent->s.frame == 12)
|
||||
else if (ent->s.frame == 12)
|
||||
ent->s.skinnum = 2;
|
||||
else if(ent->s.frame == 14)
|
||||
else if (ent->s.frame == 14)
|
||||
ent->s.skinnum = 3;
|
||||
}
|
||||
ent->think = tesla_think;
|
||||
|
@ -2268,7 +2268,7 @@ void fire_tesla (edict_t *self, vec3_t start, vec3_t aimdir, int damage_multipli
|
|||
//Knightmare- add player's base velocity to thrown tesla
|
||||
if (add_velocity_throw->value && self->client)
|
||||
VectorAdd (tesla->velocity, self->velocity, tesla->velocity);
|
||||
else if(self->groundentity)
|
||||
else if (self->groundentity)
|
||||
VectorAdd (tesla->velocity, self->groundentity->velocity, tesla->velocity);
|
||||
|
||||
// VectorCopy (dir, tesla->s.angles);
|
||||
|
@ -2293,7 +2293,7 @@ void fire_tesla (edict_t *self, vec3_t start, vec3_t aimdir, int damage_multipli
|
|||
// blow up on contact with lava & slime code
|
||||
tesla->touch = tesla_lava;
|
||||
|
||||
if(deathmatch->value)
|
||||
if (deathmatch->value)
|
||||
// PMM - lowered from 50 - 7/29/1998
|
||||
tesla->health = sk_tesla_health->value;
|
||||
else
|
||||
|
@ -2316,7 +2316,7 @@ void fire_tesla (edict_t *self, vec3_t start, vec3_t aimdir, int damage_multipli
|
|||
|
||||
void tesla_delayed_start (edict_t *tesla)
|
||||
{
|
||||
if(g_edicts[1].linkcount)
|
||||
if (g_edicts[1].linkcount)
|
||||
{
|
||||
VectorScale(tesla->movedir,tesla->moveinfo.speed,tesla->velocity);
|
||||
tesla->movetype = MOVETYPE_BOUNCE;
|
||||
|
@ -2334,7 +2334,7 @@ void SP_tesla (edict_t *tesla)
|
|||
tesla->touch = tesla_lava;
|
||||
|
||||
// For SP, freeze tesla until player spawns in
|
||||
if(game.maxclients == 1)
|
||||
if (game.maxclients == 1)
|
||||
{
|
||||
tesla->movetype = MOVETYPE_NONE;
|
||||
VectorCopy(tesla->velocity,tesla->movedir);
|
||||
|
@ -2484,7 +2484,7 @@ void SP_tesla (edict_t *tesla)
|
|||
VectorCopy (endpoint, beam_endpt);
|
||||
}
|
||||
// Knightmare- Gen cam code
|
||||
// if(self->client->chasetoggle)
|
||||
// if (self->client->chasetoggle)
|
||||
if (self->client && self->client->chaseactive)
|
||||
{
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
|
@ -2564,7 +2564,7 @@ void blaster2_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t
|
|||
{
|
||||
// the only time players will be firing blaster2 bolts will be from the
|
||||
// defender sphere.
|
||||
if(self->owner->client)
|
||||
if (self->owner->client)
|
||||
mod = MOD_DEFENDER_SPHERE;
|
||||
else
|
||||
mod = MOD_BLASTER2;
|
||||
|
@ -2663,7 +2663,7 @@ void fire_blaster2 (edict_t *self, vec3_t start, vec3_t dir, int damage, int spe
|
|||
// entities.
|
||||
void bolt2_delayed_start (edict_t *bolt)
|
||||
{
|
||||
if(g_edicts[1].linkcount)
|
||||
if (g_edicts[1].linkcount)
|
||||
{
|
||||
VectorScale(bolt->movedir,bolt->moveinfo.speed,bolt->velocity);
|
||||
bolt->nextthink = level.time + 2;
|
||||
|
@ -2696,7 +2696,7 @@ void SP_bolt2 (edict_t *bolt)
|
|||
void tracker_boom_think (edict_t *self)
|
||||
{
|
||||
self->s.frame--;
|
||||
if(self->s.frame < 0)
|
||||
if (self->s.frame < 0)
|
||||
G_FreeEdict(self);
|
||||
else
|
||||
self->nextthink = level.time + 0.1;
|
||||
|
@ -2733,30 +2733,30 @@ void tracker_pain_daemon_think (edict_t *self)
|
|||
static vec3_t pain_normal = { 0, 0, 1 };
|
||||
int hurt;
|
||||
|
||||
if(!self->inuse)
|
||||
if (!self->inuse)
|
||||
return;
|
||||
|
||||
if((level.time - self->timestamp) > TRACKER_DAMAGE_TIME)
|
||||
if ((level.time - self->timestamp) > TRACKER_DAMAGE_TIME)
|
||||
{
|
||||
if(!self->enemy->client)
|
||||
if (!self->enemy->client)
|
||||
self->enemy->s.effects &= ~EF_TRACKERTRAIL;
|
||||
G_FreeEdict (self);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(self->enemy->health > 0)
|
||||
if (self->enemy->health > 0)
|
||||
{
|
||||
// gi.dprintf("ouch %x\n", self);
|
||||
T_Damage (self->enemy, self, self->owner, vec3_origin, self->enemy->s.origin, pain_normal,
|
||||
self->dmg, 0, TRACKER_DAMAGE_FLAGS, MOD_TRACKER);
|
||||
|
||||
// if we kill the player, we'll be removed.
|
||||
if(self->inuse)
|
||||
if (self->inuse)
|
||||
{
|
||||
// if we killed a monster, gib them.
|
||||
if (self->enemy->health < 1)
|
||||
{
|
||||
if(self->enemy->gib_health)
|
||||
if (self->enemy->gib_health)
|
||||
hurt = - self->enemy->gib_health;
|
||||
else
|
||||
hurt = 500;
|
||||
|
@ -2766,7 +2766,7 @@ void tracker_pain_daemon_think (edict_t *self)
|
|||
pain_normal, hurt, 0, TRACKER_DAMAGE_FLAGS, MOD_TRACKER);
|
||||
}
|
||||
|
||||
if(self->enemy->client)
|
||||
if (self->enemy->client)
|
||||
self->enemy->client->tracker_pain_framenum = level.framenum + 1;
|
||||
else
|
||||
self->enemy->s.effects |= EF_TRACKERTRAIL;
|
||||
|
@ -2776,7 +2776,7 @@ void tracker_pain_daemon_think (edict_t *self)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(!self->enemy->client)
|
||||
if (!self->enemy->client)
|
||||
self->enemy->s.effects &= ~EF_TRACKERTRAIL;
|
||||
G_FreeEdict (self);
|
||||
}
|
||||
|
@ -2787,7 +2787,7 @@ void tracker_pain_daemon_spawn (edict_t *owner, edict_t *enemy, int damage)
|
|||
{
|
||||
edict_t *daemon;
|
||||
|
||||
if(enemy == NULL)
|
||||
if (enemy == NULL)
|
||||
return;
|
||||
|
||||
daemon = G_Spawn();
|
||||
|
@ -2804,7 +2804,7 @@ void tracker_explode (edict_t *self, cplane_t *plane)
|
|||
{
|
||||
vec3_t dir;
|
||||
|
||||
if(!plane)
|
||||
if (!plane)
|
||||
VectorClear (dir);
|
||||
else
|
||||
VectorScale (plane->normal, 256, dir);
|
||||
|
@ -2842,9 +2842,9 @@ void tracker_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *
|
|||
|
||||
if (other->takedamage)
|
||||
{
|
||||
if((other->svflags & SVF_MONSTER) || other->client)
|
||||
if ((other->svflags & SVF_MONSTER) || other->client)
|
||||
{
|
||||
if(other->health > 0) // knockback only for living creatures
|
||||
if (other->health > 0) // knockback only for living creatures
|
||||
{
|
||||
// PMM - kickback was times 4 .. reduced to 3
|
||||
// now this does no damage, just knockback
|
||||
|
@ -2890,11 +2890,11 @@ void tracker_fly (edict_t *self)
|
|||
}
|
||||
/*
|
||||
VectorCopy (self->enemy->s.origin, dest);
|
||||
if(self->enemy->client)
|
||||
if (self->enemy->client)
|
||||
dest[2] += self->enemy->viewheight;
|
||||
*/
|
||||
// PMM - try to hunt for center of enemy, if possible and not client
|
||||
if(self->enemy->client)
|
||||
if (self->enemy->client)
|
||||
{
|
||||
VectorCopy (self->enemy->s.origin, dest);
|
||||
dest[2] += self->enemy->viewheight;
|
||||
|
@ -2950,7 +2950,7 @@ void fire_tracker (edict_t *self, vec3_t start, vec3_t dir, int damage, int spee
|
|||
tracker->classname = "tracker";
|
||||
gi.linkentity (tracker);
|
||||
|
||||
if(enemy)
|
||||
if (enemy)
|
||||
{
|
||||
tracker->nextthink = level.time + 0.1;
|
||||
tracker->think = tracker_fly;
|
||||
|
@ -2977,7 +2977,7 @@ void fire_tracker (edict_t *self, vec3_t start, vec3_t dir, int damage, int spee
|
|||
|
||||
void tracker_delayed_start (edict_t *tracker)
|
||||
{
|
||||
if(g_edicts[1].linkcount)
|
||||
if (g_edicts[1].linkcount)
|
||||
{
|
||||
VectorScale(tracker->movedir,tracker->moveinfo.speed,tracker->velocity);
|
||||
tracker->nextthink = level.time + 10;
|
||||
|
|
|
@ -130,7 +130,7 @@ edict_t *SV_TestEntityPosition (edict_t *ent)
|
|||
// Lazarus: Original code doesn't distinguish between brush models and
|
||||
// point entities, which is just plain wrong if the brush model
|
||||
// doesn't have an origin brush.
|
||||
if(ent->solid == SOLID_BSP)
|
||||
if (ent->solid == SOLID_BSP)
|
||||
{
|
||||
vec3_t org, mins, maxs;
|
||||
VectorAdd(ent->s.origin,ent->origin_offset,org);
|
||||
|
@ -149,7 +149,7 @@ edict_t *SV_TestEntityPosition (edict_t *ent)
|
|||
return NULL;
|
||||
|
||||
// Lazarus - return a bit more useful info than simply "g_edicts"
|
||||
if(trace.ent)
|
||||
if (trace.ent)
|
||||
return trace.ent;
|
||||
else
|
||||
return world;
|
||||
|
@ -360,11 +360,11 @@ retry:
|
|||
vec3_t player_dest;
|
||||
trace_t ptrace;
|
||||
|
||||
if(ent->mass > hit->mass)
|
||||
if (ent->mass > hit->mass)
|
||||
{
|
||||
VectorMA (hit->s.origin,time_left,ent->velocity,player_dest);
|
||||
ptrace = gi.trace(hit->s.origin,hit->mins,hit->maxs,player_dest,hit,hit->clipmask);
|
||||
if(ptrace.fraction == 1.0)
|
||||
if (ptrace.fraction == 1.0)
|
||||
{
|
||||
VectorCopy(player_dest,hit->s.origin);
|
||||
gi.linkentity(hit);
|
||||
|
@ -527,7 +527,7 @@ retry:
|
|||
|
||||
VectorMA (hit->s.origin,time_left,ent->velocity,prox_dest);
|
||||
ptrace = gi.trace(hit->s.origin,hit->mins,hit->maxs,prox_dest,hit,hit->clipmask);
|
||||
if(ptrace.fraction == 1.0)
|
||||
if (ptrace.fraction == 1.0)
|
||||
{
|
||||
VectorCopy(prox_dest,hit->s.origin);
|
||||
gi.linkentity(hit);
|
||||
|
@ -578,11 +578,11 @@ retry:
|
|||
vec3_t player_dest;
|
||||
trace_t ptrace;
|
||||
|
||||
if(ent->mass > hit->mass)
|
||||
if (ent->mass > hit->mass)
|
||||
{
|
||||
VectorMA (hit->s.origin,time_left,ent->velocity,player_dest);
|
||||
ptrace = gi.trace(hit->s.origin,hit->mins,hit->maxs,player_dest,hit,hit->clipmask);
|
||||
if(ptrace.fraction == 1.0)
|
||||
if (ptrace.fraction == 1.0)
|
||||
{
|
||||
VectorCopy(player_dest,hit->s.origin);
|
||||
gi.linkentity(hit);
|
||||
|
@ -596,7 +596,7 @@ retry:
|
|||
{
|
||||
// Lazarus: special case - if this ent or the impact ent is
|
||||
// in water, motion is NOT blocked.
|
||||
if((hit->movetype != MOVETYPE_PUSHABLE) || ((ent->waterlevel==0) && (hit->waterlevel==0)))
|
||||
if ((hit->movetype != MOVETYPE_PUSHABLE) || ((ent->waterlevel==0) && (hit->waterlevel==0)))
|
||||
{
|
||||
blocked |= 1; // floor
|
||||
if ( hit->solid == SOLID_BSP)
|
||||
|
@ -637,7 +637,7 @@ retry:
|
|||
{
|
||||
// DH: experimenting here. 1 is no bounce,
|
||||
// 1.5 bounces like a grenade, 2 is a superball
|
||||
if(ent->bounce_me == 1)
|
||||
if (ent->bounce_me == 1)
|
||||
{
|
||||
ClipVelocity (original_velocity, planes[i], new_velocity, 1.4);
|
||||
// stop small oscillations
|
||||
|
@ -649,11 +649,11 @@ retry:
|
|||
}
|
||||
else
|
||||
{ // add a bit of random horizontal motion
|
||||
if(!new_velocity[0]) new_velocity[0] = crandom() * new_velocity[2]/4;
|
||||
if(!new_velocity[1]) new_velocity[1] = crandom() * new_velocity[2]/4;
|
||||
if (!new_velocity[0]) new_velocity[0] = crandom() * new_velocity[2]/4;
|
||||
if (!new_velocity[1]) new_velocity[1] = crandom() * new_velocity[2]/4;
|
||||
}
|
||||
}
|
||||
else if(ent->bounce_me == 2)
|
||||
else if (ent->bounce_me == 2)
|
||||
VectorCopy(ent->velocity,new_velocity);
|
||||
else
|
||||
ClipVelocity (original_velocity, planes[i], new_velocity, 1);
|
||||
|
@ -689,7 +689,7 @@ retry:
|
|||
// if velocity is against the original velocity, stop dead
|
||||
// to avoid tiny occilations in sloping corners
|
||||
//
|
||||
if( !ent->bounce_me ) {
|
||||
if ( !ent->bounce_me ) {
|
||||
if (DotProduct (ent->velocity, primal_velocity) <= 0)
|
||||
{
|
||||
VectorCopy (vec3_origin, ent->velocity);
|
||||
|
@ -710,17 +710,17 @@ SV_AddGravity
|
|||
void SV_AddGravity (edict_t *ent)
|
||||
{
|
||||
#ifdef ROGUE_GRAVITY
|
||||
if(ent->gravityVector[2] > 0)
|
||||
if (ent->gravityVector[2] > 0)
|
||||
{
|
||||
VectorMA(ent->velocity,
|
||||
ent->gravity * sv_gravity->value * FRAMETIME,
|
||||
ent->gravityVector,
|
||||
ent->velocity);
|
||||
}
|
||||
else if(level.time > ent->gravity_debounce_time)
|
||||
else if (level.time > ent->gravity_debounce_time)
|
||||
ent->velocity[2] -= ent->gravity * sv_gravity->value * FRAMETIME;
|
||||
#else
|
||||
if(level.time > ent->gravity_debounce_time)
|
||||
if (level.time > ent->gravity_debounce_time)
|
||||
ent->velocity[2] -= ent->gravity * sv_gravity->value * FRAMETIME;
|
||||
#endif
|
||||
}
|
||||
|
@ -808,10 +808,10 @@ retry:
|
|||
goto retry;
|
||||
}
|
||||
}
|
||||
if(onconveyor && !trace.ent->client)
|
||||
if (onconveyor && !trace.ent->client)
|
||||
{
|
||||
// If blocker can be damaged, destroy it. Otherwise destroy blockee.
|
||||
if(trace.ent->takedamage == DAMAGE_YES)
|
||||
if (trace.ent->takedamage == DAMAGE_YES)
|
||||
T_Damage(trace.ent, ent, ent, vec3_origin, trace.ent->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
|
||||
else
|
||||
T_Damage(ent, trace.ent, trace.ent, vec3_origin, ent->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH);
|
||||
|
@ -862,14 +862,14 @@ void MoveRiders(edict_t *platform, edict_t *ignore, vec3_t move, vec3_t amove, q
|
|||
int i;
|
||||
edict_t *rider;
|
||||
|
||||
for(i=1, rider=g_edicts+i; i<=globals.num_edicts; i++, rider++)
|
||||
for (i=1, rider=g_edicts+i; i<=globals.num_edicts; i++, rider++)
|
||||
{
|
||||
if((rider->groundentity == platform) && (rider != ignore))
|
||||
if ((rider->groundentity == platform) && (rider != ignore))
|
||||
{
|
||||
VectorAdd(rider->s.origin, move, rider->s.origin);
|
||||
if (turn && (amove[YAW] != 0.0f))
|
||||
{
|
||||
if(!rider->client)
|
||||
if (!rider->client)
|
||||
rider->s.angles[YAW] += amove[YAW];
|
||||
else
|
||||
{
|
||||
|
@ -880,12 +880,12 @@ void MoveRiders(edict_t *platform, edict_t *ignore, vec3_t move, vec3_t amove, q
|
|||
}
|
||||
}
|
||||
gi.linkentity(rider);
|
||||
if(SV_TestEntityPosition(rider))
|
||||
if (SV_TestEntityPosition(rider))
|
||||
{
|
||||
// Move is blocked. Since this is for riders, not pushees,
|
||||
// it should be ok to just back the move for this rider off
|
||||
VectorSubtract(rider->s.origin, move, rider->s.origin);
|
||||
if(turn && (amove[YAW] != 0.0f))
|
||||
if (turn && (amove[YAW] != 0.0f))
|
||||
rider->s.angles[YAW] -= amove[YAW];
|
||||
gi.linkentity(rider);
|
||||
}
|
||||
|
@ -916,27 +916,27 @@ void RealBoundingBox(edict_t *ent, vec3_t mins, vec3_t maxs)
|
|||
vec3_t p[8];
|
||||
int i, j, k, j2, k4;
|
||||
|
||||
for(k=0; k<2; k++)
|
||||
for (k=0; k<2; k++)
|
||||
{
|
||||
k4 = k*4;
|
||||
if(k)
|
||||
if (k)
|
||||
p[k4][2] = ent->maxs[2];
|
||||
else
|
||||
p[k4][2] = ent->mins[2];
|
||||
p[k4+1][2] = p[k4][2];
|
||||
p[k4+2][2] = p[k4][2];
|
||||
p[k4+3][2] = p[k4][2];
|
||||
for(j=0; j<2; j++)
|
||||
for (j=0; j<2; j++)
|
||||
{
|
||||
j2 = j*2;
|
||||
if(j)
|
||||
if (j)
|
||||
p[j2+k4][1] = ent->maxs[1];
|
||||
else
|
||||
p[j2+k4][1] = ent->mins[1];
|
||||
p[j2+k4+1][1] = p[j2+k4][1];
|
||||
for(i=0; i<2; i++)
|
||||
for (i=0; i<2; i++)
|
||||
{
|
||||
if(i)
|
||||
if (i)
|
||||
p[i+j2+k4][0] = ent->maxs[0];
|
||||
else
|
||||
p[i+j2+k4][0] = ent->mins[0];
|
||||
|
@ -944,7 +944,7 @@ void RealBoundingBox(edict_t *ent, vec3_t mins, vec3_t maxs)
|
|||
}
|
||||
}
|
||||
AngleVectors(ent->s.angles,forward,left,up);
|
||||
for(i=0; i<8; i++)
|
||||
for (i=0; i<8; i++)
|
||||
{
|
||||
VectorScale(forward,p[i][0],f1);
|
||||
VectorScale(left,-p[i][1],l1);
|
||||
|
@ -955,7 +955,7 @@ void RealBoundingBox(edict_t *ent, vec3_t mins, vec3_t maxs)
|
|||
}
|
||||
VectorCopy(p[0],mins);
|
||||
VectorCopy(p[0],maxs);
|
||||
for(i=1; i<8; i++)
|
||||
for (i=1; i<8; i++)
|
||||
{
|
||||
mins[0] = min(mins[0],p[i][0]);
|
||||
mins[1] = min(mins[1],p[i][1]);
|
||||
|
@ -1021,7 +1021,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
|
||||
// Lazarus: temp turn indicates whether riders
|
||||
// should rotate with the pusher
|
||||
if(pusher->turn_rider || turn_rider->value) //was AND, changed to OR
|
||||
if (pusher->turn_rider || turn_rider->value) //was AND, changed to OR
|
||||
turn = true;
|
||||
else
|
||||
turn = false;
|
||||
|
@ -1125,7 +1125,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
// 'cause it can be a fairly drastic change in gameplay
|
||||
if (turn && (check->groundentity == pusher))
|
||||
{
|
||||
if(!check->client)
|
||||
if (!check->client)
|
||||
{
|
||||
check->s.angles[YAW] += amove[YAW];
|
||||
}
|
||||
|
@ -1164,7 +1164,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
|
||||
// Lazarus: This is where we attempt to move check due to a rotation, WITHOUT embedding
|
||||
// check in pusher (or anything else)
|
||||
if((amove[PITCH] != 0) || (amove[YAW] != 0) || (amove[ROLL] != 0))
|
||||
if ((amove[PITCH] != 0) || (amove[YAW] != 0) || (amove[ROLL] != 0))
|
||||
{
|
||||
// Argh! - always need to do this, except for pendulums
|
||||
if (pusher->movetype != MOVETYPE_PENDULUM)
|
||||
|
@ -1187,7 +1187,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
VectorCopy(check->s.origin,org);
|
||||
org[2] += 2*check->mins[2];
|
||||
//tr = gi.trace(check->s.origin,vec3_origin,vec3_origin,org,check,MASK_SOLID);
|
||||
//if(!tr.startsolid && tr.fraction < 1)
|
||||
//if (!tr.startsolid && tr.fraction < 1)
|
||||
// check->s.origin[2] = tr.endpos[2] - check->mins[2]
|
||||
// + fabs(tr.plane.normal[0])*check->size[0]/2
|
||||
// + fabs(tr.plane.normal[1])*check->size[1]/2;
|
||||
|
@ -1196,14 +1196,14 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
// rotating pushers, trains still seem okay too but
|
||||
// I haven't tested them thoroughly
|
||||
tr = gi.trace(check->s.origin, check->mins, check->maxs, org, check, MASK_SOLID);
|
||||
if(!tr.startsolid && tr.fraction < 1)
|
||||
if (!tr.startsolid && tr.fraction < 1)
|
||||
check->s.origin[2] = tr.endpos[2];
|
||||
|
||||
// Lazarus: func_tracktrain is a special case. Since we KNOW (if the map was
|
||||
// constructed properly) that "move_origin" is a safe position, we
|
||||
// can infer that there should be a safe (not embedded) position
|
||||
// somewhere between move_origin and the proposed new location.
|
||||
if((pusher->flags & FL_TRACKTRAIN) && (check->client || (check->svflags & SVF_MONSTER)))
|
||||
if ((pusher->flags & FL_TRACKTRAIN) && (check->client || (check->svflags & SVF_MONSTER)))
|
||||
{
|
||||
vec3_t f,l,u;
|
||||
|
||||
|
@ -1215,13 +1215,13 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
org[2] += pusher->move_origin[2] + 1;
|
||||
org[2] += 16 * ( fabs(u[0]) + fabs(u[1]) );
|
||||
tr = gi.trace(org,check->mins,check->maxs,check->s.origin,check,MASK_SOLID);
|
||||
if(!tr.startsolid)
|
||||
if (!tr.startsolid)
|
||||
{
|
||||
VectorCopy(tr.endpos,check->s.origin);
|
||||
VectorCopy(check->s.origin,org);
|
||||
org[2] -= 128;
|
||||
tr = gi.trace(check->s.origin,check->mins,check->maxs,org,check,MASK_SOLID);
|
||||
if(tr.fraction > 0)
|
||||
if (tr.fraction > 0)
|
||||
VectorCopy(tr.endpos,check->s.origin);
|
||||
}
|
||||
}
|
||||
|
@ -1258,13 +1258,13 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
org[2] += pusher->move_origin[2] + 1;
|
||||
org[2] += 16 * ( fabs(u[0]) + fabs(u[1]) );
|
||||
tr = gi.trace(org,check->mins,check->maxs,check->s.origin,check,MASK_SOLID);
|
||||
if(!tr.startsolid)
|
||||
if (!tr.startsolid)
|
||||
{
|
||||
VectorCopy(tr.endpos,check->s.origin);
|
||||
VectorCopy(check->s.origin,org);
|
||||
org[2] -= 128;
|
||||
tr = gi.trace(check->s.origin,check->mins,check->maxs,org,check,MASK_SOLID);
|
||||
if(tr.fraction > 0)
|
||||
if (tr.fraction > 0)
|
||||
VectorCopy(tr.endpos,check->s.origin);
|
||||
block = SV_TestEntityPosition (check);
|
||||
}
|
||||
|
@ -1284,14 +1284,14 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
// this is only relevent for riding entities, not pushed
|
||||
VectorSubtract (check->s.origin, move, check->s.origin);
|
||||
VectorSubtract (check->s.origin, move2, check->s.origin);
|
||||
if(turn)
|
||||
if (turn)
|
||||
{
|
||||
// Argh! - angle
|
||||
if(!check->client)
|
||||
if (!check->client)
|
||||
check->s.angles[YAW] -= amove[YAW];
|
||||
else
|
||||
{
|
||||
if(amove[YAW] != 0.)
|
||||
if (amove[YAW] != 0.)
|
||||
{
|
||||
check->s.angles[YAW] -= amove[YAW];
|
||||
check->client->ps.pmove.delta_angles[YAW] -= ANGLE2SHORT(amove[YAW]);
|
||||
|
@ -1359,7 +1359,7 @@ void SV_Physics_Pusher (edict_t *ent)
|
|||
if (ent->flags & FL_TEAMSLAVE)
|
||||
return;
|
||||
|
||||
//Knightmare- always call think function for prox mines
|
||||
// Knightmare- always call think function for prox mines
|
||||
if (!strcmp(ent->classname, "prox") || !strcmp(ent->classname, "prox_field"))
|
||||
{
|
||||
if (ent->inuse)
|
||||
|
@ -1372,7 +1372,7 @@ void SV_Physics_Pusher (edict_t *ent)
|
|||
pushed_p = pushed;
|
||||
for (part = ent; part; part=part->teamchain)
|
||||
{
|
||||
if(part->attracted)
|
||||
if (part->attracted)
|
||||
part->velocity[0] = part->velocity[1] = 0;
|
||||
if (part->velocity[0] || part->velocity[1] || part->velocity[2] ||
|
||||
part->avelocity[0] || part->avelocity[1] || part->avelocity[2] )
|
||||
|
@ -1382,10 +1382,10 @@ void SV_Physics_Pusher (edict_t *ent)
|
|||
|
||||
if (!SV_Push (part, move, amove))
|
||||
break; // move was blocked
|
||||
if(part->moveinfo.is_blocked)
|
||||
if (part->moveinfo.is_blocked)
|
||||
{
|
||||
part->moveinfo.is_blocked = false;
|
||||
if(part->moveinfo.sound_middle)
|
||||
if (part->moveinfo.sound_middle)
|
||||
part->s.sound = part->moveinfo.sound_middle;
|
||||
}
|
||||
|
||||
|
@ -1408,20 +1408,20 @@ void SV_Physics_Pusher (edict_t *ent)
|
|||
if (part->blocked)
|
||||
{
|
||||
// Lazarus: Func_pushables with health < 0 & vehicles ALWAYS block pushers
|
||||
if( ( (obstacle->movetype == MOVETYPE_PUSHABLE) && (obstacle->health < 0)) ||
|
||||
if ( ( (obstacle->movetype == MOVETYPE_PUSHABLE) && (obstacle->health < 0)) ||
|
||||
(obstacle->movetype == MOVETYPE_VEHICLE) )
|
||||
{
|
||||
part->moveinfo.is_blocked = true;
|
||||
if(part->s.sound)
|
||||
if (part->s.sound)
|
||||
{
|
||||
if (part->moveinfo.sound_end)
|
||||
gi.sound (part, CHAN_NO_PHS_ADD+CHAN_VOICE, part->moveinfo.sound_end, 1, ATTN_STATIC, 0);
|
||||
part->s.sound = 0;
|
||||
}
|
||||
// Lazarus: More special-case stuff. Man I hate doing this
|
||||
if(part->movetype == MOVETYPE_PENDULUM)
|
||||
if (part->movetype == MOVETYPE_PENDULUM)
|
||||
{
|
||||
if(fabs(part->s.angles[ROLL]) > 2)
|
||||
if (fabs(part->s.angles[ROLL]) > 2)
|
||||
{
|
||||
// gi.dprintf("pendulum continue in g_phys, avelocity=%g\n",part->avelocity[ROLL]);
|
||||
part->moveinfo.start_angles[ROLL] = part->s.angles[ROLL];
|
||||
|
@ -1554,17 +1554,17 @@ void SV_Physics_Toss (edict_t *ent)
|
|||
end[2] -= 256;
|
||||
tr = gi.trace (point, ent->mins, ent->maxs, end, ent, MASK_SOLID);
|
||||
// tr.ent HAS to be ground, but just in case we screwed something up:
|
||||
if(tr.ent == ground)
|
||||
if (tr.ent == ground)
|
||||
{
|
||||
onconveyor = true;
|
||||
ent->velocity[0] = ground->movedir[0] * ground->speed;
|
||||
ent->velocity[1] = ground->movedir[1] * ground->speed;
|
||||
if(tr.plane.normal[2] > 0)
|
||||
if (tr.plane.normal[2] > 0)
|
||||
{
|
||||
ent->velocity[2] = ground->speed *
|
||||
sqrt(1.0 - tr.plane.normal[2]*tr.plane.normal[2]) /
|
||||
tr.plane.normal[2];
|
||||
if(DotProduct(ground->movedir,tr.plane.normal) > 0)
|
||||
if (DotProduct(ground->movedir,tr.plane.normal) > 0)
|
||||
{
|
||||
// then we're moving down
|
||||
ent->velocity[2] = -ent->velocity[2];
|
||||
|
@ -1734,11 +1734,11 @@ float RiderMass(edict_t *platform)
|
|||
trace_t trace;
|
||||
vec3_t point;
|
||||
|
||||
for(i=1, rider=g_edicts+i; i<=globals.num_edicts; i++, rider++)
|
||||
for (i=1, rider=g_edicts+i; i<=globals.num_edicts; i++, rider++)
|
||||
{
|
||||
if(rider == platform) continue;
|
||||
if(!rider->inuse) continue;
|
||||
if(rider->groundentity == platform)
|
||||
if (rider == platform) continue;
|
||||
if (!rider->inuse) continue;
|
||||
if (rider->groundentity == platform)
|
||||
{
|
||||
mass += rider->mass;
|
||||
mass += RiderMass(rider);
|
||||
|
@ -1756,7 +1756,7 @@ float RiderMass(edict_t *platform)
|
|||
continue;
|
||||
if (!trace.startsolid && !trace.allsolid)
|
||||
{
|
||||
if(trace.ent == platform)
|
||||
if (trace.ent == platform)
|
||||
{
|
||||
mass += rider->mass;
|
||||
mass += RiderMass(rider);
|
||||
|
@ -1797,7 +1797,7 @@ void SV_Physics_Step (edict_t *ent)
|
|||
ent->volume = ent->size[0] * ent->size[1] * ent->size[2];
|
||||
ent->density = ent->mass/ent->volume;
|
||||
|
||||
if(ent->movetype == MOVETYPE_PUSHABLE)
|
||||
if (ent->movetype == MOVETYPE_PUSHABLE)
|
||||
{
|
||||
// This stuff doesn't apply to anything else, and... heh...
|
||||
// caused monster_flipper to sink
|
||||
|
@ -1812,7 +1812,7 @@ void SV_Physics_Step (edict_t *ent)
|
|||
// (Otherwise, player might cause a 501 crate to leave
|
||||
// water and expect to be able to push it.)
|
||||
// Max floating density is then 0.0019073486328125
|
||||
if(ent->density > WATER_DENSITY)
|
||||
if (ent->density > WATER_DENSITY)
|
||||
ent->flags &= ~FL_SWIM; // sinks like a rock
|
||||
}
|
||||
}
|
||||
|
@ -1979,17 +1979,17 @@ void SV_Physics_Step (edict_t *ent)
|
|||
{
|
||||
// Crate is fully submerged
|
||||
Force = -total_mass + ent->volume * WATER_DENSITY;
|
||||
if(sv_gravity->value)
|
||||
if (sv_gravity->value)
|
||||
{
|
||||
Drag = 0.00190735 * 1.05 * Area * (ent->velocity[2]*ent->velocity[2])/sv_gravity->value;
|
||||
if(Drag > fabs(Force))
|
||||
if (Drag > fabs(Force))
|
||||
{
|
||||
// Drag actually CAN be > total weight, but if we do this we tend to
|
||||
// get crates flying back out of the water after being dropped from some
|
||||
// height
|
||||
Drag = fabs(Force);
|
||||
}
|
||||
if(ent->velocity[2] > 0)
|
||||
if (ent->velocity[2] > 0)
|
||||
Drag = -Drag;
|
||||
Force += Drag;
|
||||
}
|
||||
|
@ -2083,9 +2083,9 @@ void SV_Physics_Step (edict_t *ent)
|
|||
|
||||
if (ent->svflags & SVF_MONSTER)
|
||||
mask = MASK_MONSTERSOLID;
|
||||
else if(ent->movetype == MOVETYPE_PUSHABLE)
|
||||
else if (ent->movetype == MOVETYPE_PUSHABLE)
|
||||
mask = MASK_MONSTERSOLID | MASK_PLAYERSOLID;
|
||||
else if(ent->clipmask)
|
||||
else if (ent->clipmask)
|
||||
mask = ent->clipmask; // Lazarus edition
|
||||
else
|
||||
mask = MASK_SOLID;
|
||||
|
@ -2107,9 +2107,9 @@ void SV_Physics_Step (edict_t *ent)
|
|||
else
|
||||
{
|
||||
block = SV_FlyMove (ent, FRAMETIME, mask);
|
||||
if(block && !(block & 8) && onconveyor)
|
||||
if (block && !(block & 8) && onconveyor)
|
||||
{
|
||||
if(blocker && (blocker->takedamage == DAMAGE_YES))
|
||||
if (blocker && (blocker->takedamage == DAMAGE_YES))
|
||||
T_Damage(blocker,world,world,vec3_origin,ent->s.origin,vec3_origin,100000,1,0,MOD_CRUSH);
|
||||
else
|
||||
T_Damage(ent,world,world,vec3_origin,ent->s.origin,vec3_origin,100000,1,0,MOD_CRUSH);
|
||||
|
@ -2191,7 +2191,7 @@ void SV_Physics_Step (edict_t *ent)
|
|||
gi.sound (ent, CHAN_BODY, gi.soundindex("player/watr_in.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
if(!ent->inuse) // PGM g_touchtrigger free problem
|
||||
if (!ent->inuse) // PGM g_touchtrigger free problem
|
||||
return;
|
||||
|
||||
// regular thinking
|
||||
|
@ -2261,7 +2261,7 @@ int SV_VehicleMove (edict_t *ent, float time, int mask)
|
|||
|
||||
retry:
|
||||
trace = gi.trace (start, mins, maxs, end, ignore, mask);
|
||||
if(trace.ent && (trace.ent->movewith_ent == ent) )
|
||||
if (trace.ent && (trace.ent->movewith_ent == ent) )
|
||||
{
|
||||
ignore = trace.ent;
|
||||
VectorCopy(trace.endpos,start);
|
||||
|
@ -2271,7 +2271,7 @@ retry:
|
|||
if (trace.allsolid)
|
||||
{
|
||||
// entity is trapped in another solid
|
||||
if(trace.ent && (trace.ent->svflags & SVF_MONSTER)) {
|
||||
if (trace.ent && (trace.ent->svflags & SVF_MONSTER)) {
|
||||
// Monster stuck in vehicle. No matter how screwed up this is,
|
||||
// we've gotta get him out of there.
|
||||
// Give him a light-speed nudge and a velocity
|
||||
|
@ -2285,13 +2285,13 @@ retry:
|
|||
VectorMA(trace.ent->velocity,32,dir,new_velocity);
|
||||
VectorMA(trace.ent->s.origin,FRAMETIME,new_velocity,new_origin);
|
||||
tr = gi.trace(trace.ent->s.origin,trace.ent->mins,trace.ent->maxs,new_origin,trace.ent,MASK_MONSTERSOLID);
|
||||
if(tr.fraction == 1) {
|
||||
if (tr.fraction == 1) {
|
||||
VectorCopy(new_origin,trace.ent->s.origin);
|
||||
VectorCopy(new_velocity,trace.ent->velocity);
|
||||
gi.linkentity(trace.ent);
|
||||
}
|
||||
}
|
||||
else if(trace.ent->client && xy_speed > 0 )
|
||||
else if (trace.ent->client && xy_speed > 0 )
|
||||
{
|
||||
// If player is relatively close to the vehicle move_origin, AND the
|
||||
// vehicle is still moving, then most likely the player just disengaged
|
||||
|
@ -2361,23 +2361,23 @@ not_allsolid:
|
|||
break;
|
||||
}
|
||||
|
||||
if(trace.ent->classname)
|
||||
if (trace.ent->classname)
|
||||
{
|
||||
if(ent->owner && (trace.ent->svflags & (SVF_MONSTER | SVF_DEADMONSTER)))
|
||||
if (ent->owner && (trace.ent->svflags & (SVF_MONSTER | SVF_DEADMONSTER)))
|
||||
{
|
||||
continue; // handled in vehicle_touch
|
||||
}
|
||||
else if(trace.ent->movetype != MOVETYPE_PUSHABLE)
|
||||
else if (trace.ent->movetype != MOVETYPE_PUSHABLE)
|
||||
{
|
||||
// if not a func_pushable, match speeds...
|
||||
VectorCopy(trace.ent->velocity,ent->velocity);
|
||||
}
|
||||
else if(ent->mass && VectorLength(ent->velocity))
|
||||
else if (ent->mass && VectorLength(ent->velocity))
|
||||
{
|
||||
// otherwise push func_pushable (if vehicle has mass & is moving)
|
||||
e = 0.0; // coefficient of restitution
|
||||
m = (float)(ent->mass)/(float)(trace.ent->mass);
|
||||
for(i=0; i<2; i++) {
|
||||
for (i=0; i<2; i++) {
|
||||
v11 = ent->velocity[i];
|
||||
v21 = trace.ent->velocity[i];
|
||||
v22 = ( e*m*(v11-v21) + m*v11 + v21 ) / (1.0 + m);
|
||||
|
@ -2401,15 +2401,15 @@ not_allsolid:
|
|||
}
|
||||
|
||||
// players, monsters and func_pushables don't block us
|
||||
if(trace.ent->client) {
|
||||
if (trace.ent->client) {
|
||||
blocked = 0;
|
||||
continue;
|
||||
}
|
||||
if(trace.ent->svflags & SVF_MONSTER) {
|
||||
if (trace.ent->svflags & SVF_MONSTER) {
|
||||
blocked = 0;
|
||||
continue;
|
||||
}
|
||||
if(trace.ent->movetype == MOVETYPE_PUSHABLE)
|
||||
if (trace.ent->movetype == MOVETYPE_PUSHABLE)
|
||||
{
|
||||
blocked = 0;
|
||||
continue;
|
||||
|
@ -2496,7 +2496,7 @@ void SV_Physics_Vehicle (edict_t *ent)
|
|||
|
||||
if (ent->velocity[2] || ent->velocity[1] || ent->velocity[0])
|
||||
{
|
||||
if(ent->org_size[0])
|
||||
if (ent->org_size[0])
|
||||
{
|
||||
float ca, sa, yaw;
|
||||
vec3_t p[2][2];
|
||||
|
@ -2605,7 +2605,7 @@ trace_t SV_DebrisEntity (edict_t *ent, vec3_t push)
|
|||
if (speed1 > 100)
|
||||
{
|
||||
damage = (int)(ent->mass * speed1 / 5000.);
|
||||
if(damage)
|
||||
if (damage)
|
||||
T_Damage(trace.ent, world, world, v1, trace.ent->s.origin, vec3_origin,
|
||||
damage, 0, DAMAGE_NO_KNOCKBACK, MOD_CRUSH);
|
||||
}
|
||||
|
@ -2752,14 +2752,14 @@ void SV_Physics_Conveyor(edict_t *ent)
|
|||
|
||||
VectorScale(ent->movedir,ent->speed,v);
|
||||
VectorScale(v,FRAMETIME,move);
|
||||
for(i=0; i<game.maxclients; i++)
|
||||
for (i=0; i<game.maxclients; i++)
|
||||
{
|
||||
player = g_edicts + 1 + i;
|
||||
if(!player->inuse)
|
||||
if (!player->inuse)
|
||||
continue;
|
||||
if(!player->groundentity)
|
||||
if (!player->groundentity)
|
||||
continue;
|
||||
if(player->groundentity != ent)
|
||||
if (player->groundentity != ent)
|
||||
continue;
|
||||
// Look below player; make sure he's on a conveyor
|
||||
VectorCopy(player->s.origin,point);
|
||||
|
@ -2768,12 +2768,12 @@ void SV_Physics_Conveyor(edict_t *ent)
|
|||
end[2] -= 256;
|
||||
tr = gi.trace (point, player->mins, player->maxs, end, player, MASK_SOLID);
|
||||
// tr.ent HAS to be conveyor, but just in case we screwed something up:
|
||||
if(tr.ent == ent)
|
||||
if (tr.ent == ent)
|
||||
{
|
||||
if(tr.plane.normal[2] > 0) {
|
||||
if (tr.plane.normal[2] > 0) {
|
||||
v[2] = ent->speed * sqrt(1.0 - tr.plane.normal[2]*tr.plane.normal[2]) /
|
||||
tr.plane.normal[2];
|
||||
if(DotProduct(ent->movedir,tr.plane.normal) > 0) {
|
||||
if (DotProduct(ent->movedir,tr.plane.normal) > 0) {
|
||||
// then we're moving down
|
||||
v[2] = -v[2];
|
||||
}
|
||||
|
@ -3039,12 +3039,12 @@ void G_RunEntity (edict_t *ent)
|
|||
if (!VectorCompare(ent->s.origin, previous_origin))
|
||||
{
|
||||
trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, previous_origin, ent, MASK_MONSTERSOLID);
|
||||
if(trace.allsolid || trace.startsolid)
|
||||
if (trace.allsolid || trace.startsolid)
|
||||
VectorCopy (previous_origin, ent->s.origin);
|
||||
}
|
||||
}
|
||||
//PGM
|
||||
if (ent->postthink) //Knightmare added
|
||||
if (ent->postthink) // Knightmare added
|
||||
ent->postthink (ent);
|
||||
}
|
||||
|
||||
|
@ -3090,7 +3090,7 @@ void SV_Physics_NewToss (edict_t *ent)
|
|||
VectorCopy (ent->s.origin, move);
|
||||
move[2] -= 0.25;
|
||||
trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, move, ent, ent->clipmask);
|
||||
if(ent->groundentity && ent->groundentity->inuse)
|
||||
if (ent->groundentity && ent->groundentity->inuse)
|
||||
ent->groundentity = trace.ent;
|
||||
else
|
||||
ent->groundentity = NULL;
|
||||
|
@ -3122,7 +3122,7 @@ void SV_Physics_NewToss (edict_t *ent)
|
|||
|
||||
// add friction
|
||||
speed = VectorLength(ent->velocity);
|
||||
if(ent->waterlevel) // friction for water movement
|
||||
if (ent->waterlevel) // friction for water movement
|
||||
{
|
||||
newspeed = speed - (sv_waterfriction * 6 * ent->waterlevel);
|
||||
if (newspeed < 0)
|
||||
|
|
|
@ -326,6 +326,8 @@ field_t fields[] = {
|
|||
{"rideWithOffset1", FOFS(rideWithOffset[1]), F_VECTOR},
|
||||
|
||||
{"mangle", FOFS(mangle), F_VECTOR},
|
||||
{"mins", FOFS(mins), F_VECTOR},
|
||||
{"maxs", FOFS(maxs), F_VECTOR},
|
||||
{"visorFrames", FOFS(visorFrames), F_INT},
|
||||
{"mteam", FOFS(mteam), F_LSTRING},
|
||||
{"onFloor", FOFS(onFloor), F_INT},
|
||||
|
|
|
@ -174,6 +174,10 @@ void SP_monster_chick_heat (edict_t *self);
|
|||
void SP_monster_gladb (edict_t *self);
|
||||
void SP_monster_boss5 (edict_t *self);
|
||||
|
||||
// Knightmare- LM Escape soldiers
|
||||
void SP_monster_soldier_plasma_re (edict_t *self);
|
||||
void SP_monster_soldier_plasma_sp (edict_t *self);
|
||||
|
||||
// Zaero
|
||||
void SP_monster_autocannon (edict_t *self);
|
||||
void SP_monster_autocannon_floor (edict_t *self);
|
||||
|
@ -184,6 +188,7 @@ void SP_monster_zboss (edict_t *self);
|
|||
void SP_target_zboss_target(edict_t *self);
|
||||
void SP_func_barrier(edict_t *self);
|
||||
void SP_trigger_laser(edict_t *self);
|
||||
void SP_misc_securitycamera(edict_t *self);
|
||||
void SP_misc_commdish (edict_t *self);
|
||||
void SP_misc_crate(edict_t *self);
|
||||
void SP_misc_crate_medium(edict_t *self);
|
||||
|
@ -358,6 +363,7 @@ void SP_tesla (edict_t *self);
|
|||
void SP_trap (edict_t *self);
|
||||
void SP_rocket (edict_t *self);
|
||||
void SP_missile (edict_t *self);
|
||||
void SP_goop (edict_t *self); // SKWiD MOD
|
||||
//
|
||||
// end Lazarus
|
||||
|
||||
|
@ -482,9 +488,9 @@ spawn_t spawns[] = {
|
|||
{"misc_eastertank", SP_misc_eastertank},
|
||||
{"misc_easterchick", SP_misc_easterchick},
|
||||
{"misc_easterchick2", SP_misc_easterchick2},
|
||||
//Knightmare- patients for the infirmary
|
||||
// Knightmare- patients for the infirmary
|
||||
{"misc_sick_guard", SP_misc_sick_guard},
|
||||
//Knightmare- experiment gekks
|
||||
// Knightmare- experiment gekks
|
||||
{"misc_gekk_writhe", SP_misc_gekk_writhe},
|
||||
|
||||
// Knightmare- Coconut Monkey 3 Flame entities
|
||||
|
@ -555,6 +561,10 @@ spawn_t spawns[] = {
|
|||
{"monster_widow", SP_monster_widow},
|
||||
{"monster_widow2", SP_monster_widow2},
|
||||
|
||||
// Knightmare- LM Escape soldiers
|
||||
{"monster_soldier_plasma_re", SP_monster_soldier_plasma_re},
|
||||
{"monster_soldier_plasma_sp", SP_monster_soldier_plasma_sp},
|
||||
|
||||
// Zaero
|
||||
{"monster_autocannon", SP_monster_autocannon},
|
||||
{"monster_autocannon_floor", SP_monster_autocannon_floor},
|
||||
|
@ -565,6 +575,7 @@ spawn_t spawns[] = {
|
|||
{"target_zboss_target", SP_target_zboss_target},
|
||||
{"func_barrier", SP_func_barrier},
|
||||
{"trigger_laser", SP_trigger_laser},
|
||||
{"misc_securitycamera", SP_misc_securitycamera},
|
||||
{"misc_commdish", SP_misc_commdish},
|
||||
{"misc_crate", SP_misc_crate},
|
||||
{"misc_crate_medium", SP_misc_crate_medium},
|
||||
|
@ -745,6 +756,7 @@ spawn_t spawns[] = {
|
|||
{"homing rocket", SP_rocket},
|
||||
{"missile", SP_missile},
|
||||
{"homing rocket", SP_missile},
|
||||
{"goop", SP_goop}, // SKWiD MOD
|
||||
// end Lazarus
|
||||
|
||||
{NULL, NULL}
|
||||
|
@ -859,21 +871,29 @@ void ED_CallSpawn (edict_t *ent)
|
|||
ent->classname = "monster_chick_heat";
|
||||
// medic
|
||||
if (!strcmp(ent->classname, "monster_medic")
|
||||
//don't spawn another medic commander from medic commander
|
||||
// don't spawn another medic commander from medic commander
|
||||
&& !(ent->monsterinfo.monsterflags & MFL_DO_NOT_COUNT))
|
||||
ent->classname = "monster_medic_commander";
|
||||
}
|
||||
|
||||
//LM Escape monster replacement
|
||||
if (!strcmp(ent->classname, "monster_soldier_plasma_re"))
|
||||
// LM Escape monster replacement
|
||||
/* if (!strcmp(ent->classname, "monster_soldier_plasma_re"))
|
||||
ent->classname = "monster_soldier_ripper";
|
||||
if (!strcmp(ent->classname, "monster_soldier_plasma_sp"))
|
||||
ent->classname = "monster_soldier_hypergun";
|
||||
//LM Escape Plasma gun
|
||||
// LM Escape Plasma gun
|
||||
if (!strcmp(ent->classname, "weapon_plasma"))
|
||||
ent->classname = "weapon_boomer";
|
||||
*/
|
||||
// Zaero item replacement
|
||||
if (!strcmp(ent->classname, "weapon_sniperrifle"))
|
||||
ent->classname = "weapon_railgun";
|
||||
if (!strcmp(ent->classname, "weapon_soniccannon"))
|
||||
ent->classname = "weapon_plasmabeam";
|
||||
if (!strcmp(ent->classname, "ammo_a2k"))
|
||||
ent->classname = "ammo_nbomb";
|
||||
|
||||
//Knightmare- replace Pierre in Coconut Monkey 3 with Daedalus
|
||||
// Knightmare- replace Pierre in Coconut Monkey 3 with Daedalus
|
||||
if (!strcmp(ent->classname, "monster_pierre_monkey"))
|
||||
{
|
||||
ent->classname = "monster_daedalus";
|
||||
|
@ -883,7 +903,7 @@ void ED_CallSpawn (edict_t *ent)
|
|||
ent->powerarmor = 500;
|
||||
}
|
||||
|
||||
//Knightmare- backup entity's original angles
|
||||
// Knightmare- backup entity's original angles
|
||||
VectorCopy (ent->s.angles, ent->org_angles);
|
||||
|
||||
// check item spawn functions
|
||||
|
@ -2134,6 +2154,7 @@ void SP_worldspawn (edict_t *ent)
|
|||
gi.modelindex ("#w_phalanx.md2"); // Knightmare added
|
||||
gi.modelindex ("#w_ripper.md2"); // Knightmare added
|
||||
gi.modelindex ("#w_shockwave.md2"); // Knightmare added
|
||||
gi.modelindex ("#w_plasmarifle.md2"); // SKWiD MOD
|
||||
// gi.modelindex ("#a_trap.md2"); // Knightmare added
|
||||
// gi.modelindex ("#a_tesla.md2"); // Knightmare added
|
||||
// gi.modelindex ("#w_grapple.md2");
|
||||
|
|
|
@ -649,6 +649,14 @@ void use_target_blaster (edict_t *self, edict_t *other, edict_t *activator)
|
|||
vec3_t movedir, start, target;
|
||||
int effect;
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, self->s.origin))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
VectorCopy(self->s.origin,start);
|
||||
if (self->enemy)
|
||||
{
|
||||
|
|
|
@ -166,16 +166,16 @@ void trackchange_done (edict_t *self)
|
|||
{
|
||||
edict_t *train = self->target_ent;
|
||||
|
||||
VectorClear(self->velocity);
|
||||
VectorClear(self->avelocity);
|
||||
VectorClear (self->velocity);
|
||||
VectorClear (self->avelocity);
|
||||
if (self->s.sound && self->moveinfo.sound_end)
|
||||
gi.positioned_sound (self->s.origin, self, CHAN_AUTO, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_NORM
|
||||
self->s.sound = 0;
|
||||
|
||||
if (train)
|
||||
{
|
||||
VectorClear(train->velocity);
|
||||
VectorClear(train->avelocity);
|
||||
VectorClear (train->velocity);
|
||||
VectorClear (train->avelocity);
|
||||
train->spawnflags &= ~SF_TRACKTRAIN_DISABLED;
|
||||
if (self->spawnflags & SF_TRACK_ACTIVATETRAIN)
|
||||
{
|
||||
|
@ -202,10 +202,10 @@ void trackchange_done (edict_t *self)
|
|||
// SHOULD be at the target path_track now. But
|
||||
// physics may have caused lift to outrun train,
|
||||
// so force it:
|
||||
VectorCopy(train->target_ent->s.origin,train->s.origin);
|
||||
VectorCopy (train->target_ent->s.origin, train->s.origin);
|
||||
train->s.origin[2] += train->viewheight;
|
||||
gi.linkentity(train);
|
||||
tracktrain_next(train);
|
||||
gi.linkentity (train);
|
||||
tracktrain_next (train);
|
||||
}
|
||||
if (self->moveinfo.state == STATE_MOVEDOWN)
|
||||
self->moveinfo.state = STATE_BOTTOM;
|
||||
|
@ -243,7 +243,7 @@ void trackchange_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
else
|
||||
{
|
||||
vec3_t v;
|
||||
VectorSubtract(track->s.origin,self->target_ent->s.origin,v);
|
||||
VectorSubtract (track->s.origin, self->target_ent->s.origin, v);
|
||||
if (VectorLength(v) > self->target_ent->moveinfo.distance)
|
||||
self->target_ent = NULL;
|
||||
}
|
||||
|
@ -268,8 +268,8 @@ void trackchange_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
tspeed = -tspeed;
|
||||
rspeed = -rspeed;
|
||||
}
|
||||
VectorClear(self->velocity);
|
||||
VectorClear(self->avelocity);
|
||||
VectorClear (self->velocity);
|
||||
VectorClear (self->avelocity);
|
||||
if (self->spawnflags & SF_TRACK_XAXIS)
|
||||
self->velocity[0] = tspeed;
|
||||
else if (self->spawnflags & SF_TRACK_YAXIS)
|
||||
|
@ -277,14 +277,14 @@ void trackchange_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
else
|
||||
self->velocity[2] = tspeed;
|
||||
|
||||
VectorScale(self->movedir,rspeed,self->avelocity);
|
||||
VectorScale (self->movedir, rspeed, self->avelocity);
|
||||
|
||||
if (self->target_ent)
|
||||
{
|
||||
VectorCopy(self->velocity,self->target_ent->velocity);
|
||||
VectorCopy(self->avelocity,self->target_ent->avelocity);
|
||||
VectorCopy (self->velocity, self->target_ent->velocity);
|
||||
VectorCopy (self->avelocity, self->target_ent->avelocity);
|
||||
self->target_ent->spawnflags |= SF_TRACKTRAIN_DISABLED;
|
||||
gi.linkentity(self->target_ent);
|
||||
gi.linkentity (self->target_ent);
|
||||
}
|
||||
|
||||
if (self->moveinfo.state == STATE_TOP)
|
||||
|
@ -312,7 +312,7 @@ void SP_func_trackchange (edict_t *self)
|
|||
VectorClear (self->s.angles);
|
||||
|
||||
// set the axis of rotation
|
||||
VectorClear(self->movedir);
|
||||
VectorClear (self->movedir);
|
||||
if (self->spawnflags & SF_TRACK_XAXIS)
|
||||
self->movedir[2] = 1.0;
|
||||
else if (self->spawnflags & SF_TRACK_YAXIS)
|
||||
|
@ -334,8 +334,8 @@ void SP_func_trackchange (edict_t *self)
|
|||
if (!self->speed)
|
||||
self->speed = 100;
|
||||
|
||||
VectorCopy(self->s.origin,self->pos1);
|
||||
VectorCopy(self->pos1,self->pos2);
|
||||
VectorCopy (self->s.origin, self->pos1);
|
||||
VectorCopy (self->pos1, self->pos2);
|
||||
if (self->spawnflags & SF_TRACK_XAXIS)
|
||||
self->pos2[0] -= self->viewheight;
|
||||
else if (self->spawnflags & SF_TRACK_YAXIS)
|
||||
|
@ -353,11 +353,11 @@ void SP_func_trackchange (edict_t *self)
|
|||
if (self->spawnflags & SF_TRACK_STARTBOTTOM)
|
||||
{
|
||||
vec3_t temp;
|
||||
VectorCopy(self->pos1,temp);
|
||||
VectorCopy(self->pos2,self->pos1);
|
||||
VectorCopy(temp,self->pos2);
|
||||
VectorCopy(self->pos1,self->s.origin);
|
||||
VectorMA(self->s.angles,self->moveinfo.distance,self->movedir,self->s.angles);
|
||||
VectorCopy (self->pos1, temp);
|
||||
VectorCopy (self->pos2, self->pos1);
|
||||
VectorCopy (temp, self->pos2);
|
||||
VectorCopy (self->pos1, self->s.origin);
|
||||
VectorMA (self->s.angles, self->moveinfo.distance, self->movedir, self->s.angles);
|
||||
self->moveinfo.state = STATE_BOTTOM;
|
||||
}
|
||||
else
|
||||
|
@ -409,17 +409,17 @@ void tracktrain_drive (edict_t *train, edict_t *other )
|
|||
return;
|
||||
|
||||
// See if monster is in driving position
|
||||
VectorCopy(train->s.angles,angles);
|
||||
VectorNegate(angles,angles);
|
||||
AngleVectors(angles,f1,l1,u1);
|
||||
VectorCopy (train->s.angles, angles);
|
||||
VectorNegate (angles, angles);
|
||||
AngleVectors (angles, f1, l1, u1);
|
||||
|
||||
VectorSubtract(other->s.origin,train->s.origin,offset);
|
||||
VectorScale(f1, offset[0],f1);
|
||||
VectorScale(l1,-offset[1],l1);
|
||||
VectorScale(u1, offset[2],u1);
|
||||
VectorCopy(f1,offset);
|
||||
VectorAdd(offset,l1,offset);
|
||||
VectorAdd(offset,u1,offset);
|
||||
VectorSubtract (other->s.origin, train->s.origin, offset);
|
||||
VectorScale (f1, offset[0], f1);
|
||||
VectorScale (l1, -offset[1], l1);
|
||||
VectorScale (u1, offset[2], u1);
|
||||
VectorCopy (f1, offset);
|
||||
VectorAdd (offset, l1, offset);
|
||||
VectorAdd (offset, u1, offset);
|
||||
|
||||
// Relax the constraints on driving position just a bit for monsters
|
||||
|
||||
|
@ -441,12 +441,12 @@ void tracktrain_drive (edict_t *train, edict_t *other )
|
|||
|
||||
// Store the offset and later keep driver at same relative position
|
||||
// (with height adjustments for pitch)
|
||||
AngleVectors(train->s.angles, forward, left, NULL);
|
||||
VectorSubtract(other->s.origin,train->s.origin,train->offset);
|
||||
VectorScale(forward,train->offset[0],f1);
|
||||
VectorScale(left,train->offset[1],l1);
|
||||
VectorCopy(f1,train->offset);
|
||||
VectorAdd(train->offset,l1,train->offset);
|
||||
AngleVectors (train->s.angles, forward, left, NULL);
|
||||
VectorSubtract (other->s.origin, train->s.origin, train->offset);
|
||||
VectorScale (forward, train->offset[0], f1);
|
||||
VectorScale (left, train->offset[1], l1);
|
||||
VectorCopy (f1, train->offset);
|
||||
VectorAdd (train->offset, l1, train->offset);
|
||||
train->offset[1] = -train->offset[1];
|
||||
train->offset[2] = other->s.origin[2] - train->s.origin[2];
|
||||
gi.linkentity(other);
|
||||
|
@ -493,15 +493,15 @@ void tracktrain_disengage (edict_t *train)
|
|||
vec3_t forward, left, up, f1, l1, u1;
|
||||
|
||||
driver->movetype = MOVETYPE_WALK;
|
||||
AngleVectors(train->s.angles, forward, left, up);
|
||||
VectorScale(forward,train->offset[0],f1);
|
||||
VectorScale(left,-train->offset[1],l1);
|
||||
VectorScale(up,train->offset[2],u1);
|
||||
VectorAdd(train->s.origin,f1,driver->s.origin);
|
||||
VectorAdd(driver->s.origin,l1,driver->s.origin);
|
||||
VectorAdd(driver->s.origin,u1,driver->s.origin);
|
||||
AngleVectors (train->s.angles, forward, left, up);
|
||||
VectorScale (forward, train->offset[0], f1);
|
||||
VectorScale (left, -train->offset[1], l1);
|
||||
VectorScale (up, train->offset[2], u1);
|
||||
VectorAdd (train->s.origin, f1, driver->s.origin);
|
||||
VectorAdd (driver->s.origin, l1, driver->s.origin);
|
||||
VectorAdd (driver->s.origin, u1, driver->s.origin);
|
||||
driver->s.origin[2] += 16 * ( fabs(up[0]) + fabs(up[1]) );
|
||||
VectorCopy(train->velocity,driver->velocity);
|
||||
VectorCopy (train->velocity, driver->velocity);
|
||||
driver->client->vehicle_framenum = level.framenum;
|
||||
// turn ON client side prediction for this player
|
||||
driver->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
|
||||
|
@ -521,9 +521,9 @@ void tracktrain_disengage (edict_t *train)
|
|||
|
||||
driver->movetype = MOVETYPE_STEP;
|
||||
if (driver->health > 0)
|
||||
VectorCopy(train->velocity,driver->velocity);
|
||||
VectorCopy (train->velocity, driver->velocity);
|
||||
else
|
||||
VectorClear(driver->velocity);
|
||||
VectorClear (driver->velocity);
|
||||
driver->monsterinfo.pausetime = 0;
|
||||
driver->monsterinfo.aiflags &= ~AI_STAND_GROUND;
|
||||
}
|
||||
|
@ -557,8 +557,8 @@ void tracktrain_think (edict_t *self)
|
|||
self->spawnflags |= SF_TRACKTRAIN_DISABLED;
|
||||
self->think = tracktrain_hide;
|
||||
self->nextthink = level.time + FRAMETIME;
|
||||
VectorClear(self->velocity);
|
||||
VectorClear(self->avelocity);
|
||||
VectorClear (self->velocity);
|
||||
VectorClear (self->avelocity);
|
||||
self->moveinfo.state = self->moveinfo.prevstate = STOP;
|
||||
self->s.sound = 0;
|
||||
self->moveinfo.current_speed = 0;
|
||||
|
@ -597,12 +597,12 @@ void tracktrain_think (edict_t *self)
|
|||
self->s.frame = (self->moveinfo.state - RFAST)*2 + (1 - (self->s.frame % 2));
|
||||
}
|
||||
|
||||
AngleVectors(self->s.angles, forward, left, up);
|
||||
AngleVectors (self->s.angles, forward, left, up);
|
||||
|
||||
if (!(self->spawnflags & SF_TRACKTRAIN_DISABLED))
|
||||
{
|
||||
VectorCopy(self->velocity,v);
|
||||
speed = VectorLength(v);
|
||||
VectorCopy (self->velocity, v);
|
||||
speed = VectorLength (v);
|
||||
if (self->moveinfo.state < STOP)
|
||||
speed = -speed;
|
||||
self->moveinfo.current_speed = speed;
|
||||
|
@ -628,14 +628,14 @@ void tracktrain_think (edict_t *self)
|
|||
// get on or off, disengage
|
||||
if (level.framenum - driver->client->vehicle_framenum > 2)
|
||||
{
|
||||
VectorCopy(self->velocity,driver->velocity);
|
||||
VectorCopy (self->velocity, driver->velocity);
|
||||
tracktrain_disengage(self);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( (driver->client->ucmd.sidemove < -199) || (driver->client->ucmd.sidemove > 199) || (driver->client->ucmd.upmove > 0) )
|
||||
{
|
||||
VectorCopy(self->velocity,driver->velocity);
|
||||
VectorCopy (self->velocity, driver->velocity);
|
||||
tracktrain_disengage(self);
|
||||
return;
|
||||
}
|
||||
|
@ -707,11 +707,11 @@ void tracktrain_think (edict_t *self)
|
|||
vec3_t vec;
|
||||
|
||||
if (vis)
|
||||
VectorSubtract(driver->enemy->s.origin,driver->s.origin,vec);
|
||||
VectorSubtract (driver->enemy->s.origin, driver->s.origin, vec);
|
||||
else
|
||||
VectorSubtract(driver->monsterinfo.last_sighting,driver->s.origin,vec);
|
||||
VectorSubtract (driver->monsterinfo.last_sighting, driver->s.origin, vec);
|
||||
|
||||
r = VectorNormalize(vec);
|
||||
r = VectorNormalize (vec);
|
||||
dot = DotProduct(vec,forward);
|
||||
if ((r > 2000) && (dot < 0))
|
||||
{
|
||||
|
@ -749,8 +749,8 @@ void tracktrain_think (edict_t *self)
|
|||
if (speed < self->moveinfo.next_speed) speed = self->moveinfo.next_speed;
|
||||
}
|
||||
|
||||
VectorSubtract(self->moveinfo.end_origin,self->s.origin,v);
|
||||
distance = VectorLength(v);
|
||||
VectorSubtract (self->moveinfo.end_origin, self->s.origin, v);
|
||||
distance = VectorLength (v);
|
||||
if (speed != 0)
|
||||
{
|
||||
time = distance/fabs(speed);
|
||||
|
@ -760,8 +760,8 @@ void tracktrain_think (edict_t *self)
|
|||
}
|
||||
else
|
||||
time = 100000;
|
||||
VectorNormalize(v);
|
||||
VectorScale(v,fabs(speed),self->velocity);
|
||||
VectorNormalize (v);
|
||||
VectorScale (v, fabs(speed), self->velocity);
|
||||
|
||||
// gi.dprintf("distance to %s=%g, time=%g\n",
|
||||
// self->target_ent->targetname,distance,time);
|
||||
|
@ -770,14 +770,14 @@ void tracktrain_think (edict_t *self)
|
|||
}
|
||||
|
||||
// Set driver velocity, position, and angles
|
||||
VectorCopy(self->velocity,driver->velocity);
|
||||
VectorCopy (self->velocity, driver->velocity);
|
||||
|
||||
VectorScale(forward,self->offset[0],f1);
|
||||
VectorScale(left,-self->offset[1],l1);
|
||||
VectorScale(up,self->offset[2],u1);
|
||||
VectorAdd(self->s.origin,f1,driver->s.origin);
|
||||
VectorAdd(driver->s.origin,l1,driver->s.origin);
|
||||
VectorAdd(driver->s.origin,u1,driver->s.origin);
|
||||
VectorScale (forward, self->offset[0], f1);
|
||||
VectorScale (left, -self->offset[1], l1);
|
||||
VectorScale (up, self->offset[2], u1);
|
||||
VectorAdd (self->s.origin, f1, driver->s.origin);
|
||||
VectorAdd (driver->s.origin, l1, driver->s.origin);
|
||||
VectorAdd (driver->s.origin, u1, driver->s.origin);
|
||||
driver->s.origin[2] += 16 * ( fabs(up[0]) + fabs(up[1]) );
|
||||
|
||||
yaw = self->avelocity[YAW]*FRAMETIME;
|
||||
|
@ -832,15 +832,15 @@ void tracktrain_think (edict_t *self)
|
|||
|
||||
if (speed != 0)
|
||||
{
|
||||
VectorSubtract(self->moveinfo.end_origin,self->s.origin,v);
|
||||
distance = VectorLength(v);
|
||||
VectorSubtract (self->moveinfo.end_origin, self->s.origin, v);
|
||||
distance = VectorLength (v);
|
||||
time = distance/fabs(speed);
|
||||
time = 0.1 * ((int)(10*time - 0.5)+1);
|
||||
if ( (time > 0) && (distance > 0) )
|
||||
speed = distance/time;
|
||||
VectorNormalize(v);
|
||||
VectorScale(v,fabs(speed),self->velocity);
|
||||
gi.linkentity(self);
|
||||
VectorNormalize (v);
|
||||
VectorScale (v, fabs(speed), self->velocity);
|
||||
gi.linkentity (self);
|
||||
}
|
||||
|
||||
if ( !(self->spawnflags & SF_TRACKTRAIN_NOCONTROL) &&
|
||||
|
@ -850,20 +850,20 @@ void tracktrain_think (edict_t *self)
|
|||
vec3_t angles, offset;
|
||||
|
||||
// Check for player entering bleft/tright field of train
|
||||
VectorCopy(self->s.angles,angles);
|
||||
VectorNegate(angles,angles);
|
||||
AngleVectors(angles,f1,l1,u1);
|
||||
VectorCopy (self->s.angles, angles);
|
||||
VectorNegate (angles, angles);
|
||||
AngleVectors (angles, f1, l1, u1);
|
||||
for (i=1, ent=&g_edicts[1] ; i<=maxclients->value ; i++, ent++)
|
||||
{
|
||||
if (!ent->inuse) continue;
|
||||
if (ent->movetype == MOVETYPE_NOCLIP) continue;
|
||||
VectorSubtract(ent->s.origin,self->s.origin,offset);
|
||||
VectorScale(f1, offset[0],f1);
|
||||
VectorScale(l1,-offset[1],l1);
|
||||
VectorScale(u1, offset[2],u1);
|
||||
VectorCopy(f1,offset);
|
||||
VectorAdd(offset,l1,offset);
|
||||
VectorAdd(offset,u1,offset);
|
||||
VectorSubtract (ent->s.origin, self->s.origin, offset);
|
||||
VectorScale (f1, offset[0], f1);
|
||||
VectorScale (l1,-offset[1], l1);
|
||||
VectorScale (u1, offset[2], u1);
|
||||
VectorCopy (f1, offset);
|
||||
VectorAdd (offset, l1, offset);
|
||||
VectorAdd (offset, u1, offset);
|
||||
if (offset[0] < self->bleft[0])
|
||||
continue;
|
||||
if (offset[1] < self->bleft[1])
|
||||
|
@ -888,8 +888,8 @@ void tracktrain_think (edict_t *self)
|
|||
time = 100000;
|
||||
else
|
||||
{
|
||||
VectorClear(self->avelocity);
|
||||
VectorClear(self->avelocity);
|
||||
VectorClear (self->avelocity);
|
||||
VectorClear (self->avelocity);
|
||||
self->nextthink = 0;
|
||||
// if (self->movewith_next && (self->movewith_next->movewith_ent == self))
|
||||
// set_child_movement(self);
|
||||
|
@ -924,18 +924,18 @@ void tracktrain_think (edict_t *self)
|
|||
|
||||
if ( speed != 0 )
|
||||
{
|
||||
VectorSubtract(self->moveinfo.end_origin,self->s.origin,v);
|
||||
distance = VectorNormalize(v);
|
||||
VectorSubtract (self->moveinfo.end_origin, self->s.origin, v);
|
||||
distance = VectorNormalize (v);
|
||||
time = distance/fabs(speed);
|
||||
time = 0.1 * ((int)(10*time - 0.5)+1);
|
||||
if ( (time > 0) && (distance > 0) )
|
||||
speed = distance/time;
|
||||
VectorScale(v,fabs(speed),self->velocity);
|
||||
VectorScale (v, fabs(speed), self->velocity);
|
||||
gi.linkentity(self);
|
||||
}
|
||||
else if (self->moveinfo.current_speed != 0)
|
||||
{
|
||||
VectorClear(self->velocity);
|
||||
VectorClear (self->velocity);
|
||||
self->s.sound = 0;
|
||||
gi.linkentity(self);
|
||||
time = 100000;
|
||||
|
@ -952,25 +952,26 @@ void tracktrain_think (edict_t *self)
|
|||
|
||||
// Check if a player is in driving position (monsters handled elsewhere)
|
||||
|
||||
VectorCopy(self->s.angles,angles);
|
||||
VectorNegate(angles,angles);
|
||||
AngleVectors(angles,f1,l1,u1);
|
||||
VectorCopy (self->s.angles, angles);
|
||||
VectorNegate (angles, angles);
|
||||
AngleVectors (angles, f1, l1, u1);
|
||||
|
||||
// find a player
|
||||
for (i=1, ent=&g_edicts[1] ; i<=maxclients->value ; i++, ent++) {
|
||||
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 && !self->message) continue;
|
||||
if (level.framenum - ent->client->vehicle_framenum <= 2) continue;
|
||||
|
||||
VectorSubtract(ent->s.origin,self->s.origin,offset);
|
||||
VectorScale(f1, offset[0],f1);
|
||||
VectorScale(l1,-offset[1],l1);
|
||||
VectorScale(u1, offset[2],u1);
|
||||
VectorCopy(f1,offset);
|
||||
VectorAdd(offset,l1,offset);
|
||||
VectorAdd(offset,u1,offset);
|
||||
// gi.dprintf("offset=%g %g %g\n",offset[0],offset[1],offset[2]);
|
||||
VectorSubtract (ent->s.origin, self->s.origin, offset);
|
||||
VectorScale (f1, offset[0], f1);
|
||||
VectorScale (l1, -offset[1], l1);
|
||||
VectorScale (u1, offset[2], u1);
|
||||
VectorCopy (f1, offset);
|
||||
VectorAdd (offset, l1, offset);
|
||||
VectorAdd (offset, u1, offset);
|
||||
// gi.dprintf("offset=%g %g %g\n",offset[0],offset[1],offset[2]);
|
||||
if (offset[0] < self->bleft[0])
|
||||
continue;
|
||||
if (offset[1] < self->bleft[1])
|
||||
|
@ -1000,11 +1001,11 @@ void tracktrain_think (edict_t *self)
|
|||
|
||||
// Store the offset and later keep driver at same relative position
|
||||
// (with height adjustments for pitch)
|
||||
VectorSubtract(ent->s.origin,self->s.origin,self->offset);
|
||||
VectorScale(forward,self->offset[0],f1);
|
||||
VectorScale(left,self->offset[1],l1);
|
||||
VectorCopy(f1,self->offset);
|
||||
VectorAdd(self->offset,l1,self->offset);
|
||||
VectorSubtract (ent->s.origin, self->s.origin, self->offset);
|
||||
VectorScale (forward, self->offset[0], f1);
|
||||
VectorScale (left, self->offset[1] ,l1);
|
||||
VectorCopy (f1, self->offset);
|
||||
VectorAdd (self->offset, l1, self->offset);
|
||||
self->offset[1] = -self->offset[1];
|
||||
self->offset[2] = ent->s.origin[2] - self->s.origin[2];
|
||||
gi.linkentity(ent);
|
||||
|
@ -1031,20 +1032,20 @@ void tracktrain_blocked (edict_t *self, edict_t *other)
|
|||
edict_t *driver = self->owner;
|
||||
vec3_t forward, left, up;
|
||||
vec3_t f1, l1, u1;
|
||||
VectorCopy(self->velocity, driver->velocity);
|
||||
AngleVectors(self->s.angles,forward,left,up);
|
||||
VectorScale(forward,self->offset[0],f1);
|
||||
VectorScale(left,-self->offset[1],l1);
|
||||
VectorScale(up,self->offset[2],u1);
|
||||
VectorAdd(self->s.origin,f1,driver->s.origin);
|
||||
VectorAdd(driver->s.origin,l1,driver->s.origin);
|
||||
VectorAdd(driver->s.origin,u1,driver->s.origin);
|
||||
VectorCopy (self->velocity, driver->velocity);
|
||||
AngleVectors (self->s.angles, forward, left, up);
|
||||
VectorScale (forward, self->offset[0], f1);
|
||||
VectorScale (left, -self->offset[1], l1);
|
||||
VectorScale (up, self->offset[2], u1);
|
||||
VectorAdd (self->s.origin, f1, driver->s.origin);
|
||||
VectorAdd (driver->s.origin, l1, driver->s.origin);
|
||||
VectorAdd (driver->s.origin, u1, driver->s.origin);
|
||||
driver->s.origin[2] += 16 * ( fabs(up[0]) + fabs(up[1]) );
|
||||
gi.linkentity(driver);
|
||||
}
|
||||
VectorSubtract(other->s.origin,self->s.origin,dir);
|
||||
VectorSubtract (other->s.origin, self->s.origin, dir);
|
||||
dir[2] += 16;
|
||||
VectorNormalize(dir);
|
||||
VectorNormalize (dir);
|
||||
if (!(other->svflags & SVF_MONSTER) && (!other->client) )
|
||||
{
|
||||
// give it a chance to go away on it's own terms (like gibs)
|
||||
|
@ -1054,7 +1055,7 @@ void tracktrain_blocked (edict_t *self, edict_t *other)
|
|||
{
|
||||
// Some of our ents don't have origin near the model
|
||||
vec3_t save;
|
||||
VectorCopy(other->s.origin,save);
|
||||
VectorCopy (other->s.origin, save);
|
||||
VectorMA (other->absmin, 0.5, other->size, other->s.origin);
|
||||
BecomeExplosion1 (other);
|
||||
}
|
||||
|
@ -1072,7 +1073,7 @@ void tracktrain_blocked (edict_t *self, edict_t *other)
|
|||
// Don't cream riders who've become embedded - just do minor damage
|
||||
// and *maybe* help them get unstuck by pushing them up.
|
||||
knockback = 2;
|
||||
VectorSet(dir,0,0,1);
|
||||
VectorSet (dir, 0, 0, 1);
|
||||
T_Damage (other, self, self, dir, other->s.origin, vec3_origin, 1, knockback, 0, MOD_CRUSH);
|
||||
}
|
||||
else
|
||||
|
@ -1134,9 +1135,9 @@ qboolean is_backing_up (edict_t *train)
|
|||
{
|
||||
vec3_t forward, v_norm;
|
||||
|
||||
VectorCopy(train->velocity,v_norm);
|
||||
VectorNormalize(v_norm);
|
||||
AngleVectors(train->s.angles,forward,NULL,NULL);
|
||||
VectorCopy (train->velocity, v_norm);
|
||||
VectorNormalize (v_norm);
|
||||
AngleVectors (train->s.angles, forward, NULL, NULL);
|
||||
if (DotProduct(forward,v_norm) < 0.)
|
||||
return true;
|
||||
else
|
||||
|
@ -1150,7 +1151,7 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
vec3_t to_next;
|
||||
qboolean in_reverse;
|
||||
|
||||
AngleVectors(train->s.angles,forward,NULL,NULL);
|
||||
AngleVectors (train->s.angles ,forward, NULL, NULL);
|
||||
|
||||
if ( (train->moveinfo.prevstate < STOP && train->moveinfo.state > STOP) ||
|
||||
(train->moveinfo.prevstate > STOP && train->moveinfo.state < STOP) )
|
||||
|
@ -1158,8 +1159,8 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
next = path->prevpath;
|
||||
if (next)
|
||||
{
|
||||
VectorSubtract(next->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
VectorSubtract (next->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
if ((train->moveinfo.state > STOP) && (DotProduct(forward,to_next) < 0))
|
||||
next = NULL;
|
||||
else if ((train->moveinfo.state < STOP) && (DotProduct(forward,to_next) > 0))
|
||||
|
@ -1189,8 +1190,8 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
next = G_PickTarget (path->target);
|
||||
if (next)
|
||||
{
|
||||
VectorSubtract(next->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
VectorSubtract (next->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
if (DotProduct(forward,to_next) > 0)
|
||||
next = NULL;
|
||||
}
|
||||
|
@ -1203,8 +1204,8 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
if (next)
|
||||
{
|
||||
// Ensure we don't flipflop
|
||||
VectorSubtract(next->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
VectorSubtract (next->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
if (DotProduct(forward,to_next) > 0)
|
||||
next = NULL;
|
||||
}
|
||||
|
@ -1229,8 +1230,8 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
if (e->target && !Q_stricmp(e->target,path->targetname))
|
||||
{
|
||||
next = e;
|
||||
VectorSubtract(next->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
VectorSubtract (next->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
if (DotProduct(forward,to_next) > 0)
|
||||
next = NULL;
|
||||
// else
|
||||
|
@ -1239,8 +1240,8 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
if (!next && e->target2 && !Q_stricmp(e->target2,path->targetname))
|
||||
{
|
||||
next = e;
|
||||
VectorSubtract(next->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
VectorSubtract (next->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
if (DotProduct(forward,to_next) > 0)
|
||||
next = NULL;
|
||||
// else
|
||||
|
@ -1259,9 +1260,9 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
next = G_PickTarget (path->target);
|
||||
if (next)
|
||||
{
|
||||
VectorSubtract(next->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
dot = DotProduct(forward,to_next);
|
||||
VectorSubtract (next->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
dot = DotProduct (forward, to_next);
|
||||
if (dot > 0)
|
||||
next = NULL;
|
||||
}
|
||||
|
@ -1277,9 +1278,9 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
|
||||
if (next2)
|
||||
{
|
||||
VectorSubtract(next2->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
dot2 = DotProduct(forward,to_next);
|
||||
VectorSubtract (next2->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
dot2 = DotProduct (forward, to_next);
|
||||
if (dot2 > 0)
|
||||
next2 = NULL;
|
||||
else if (!next)
|
||||
|
@ -1304,8 +1305,8 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
next = G_PickTarget (path->target);
|
||||
if (next)
|
||||
{
|
||||
VectorSubtract(next->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
VectorSubtract (next->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
dot = DotProduct(forward,to_next);
|
||||
if (dot < 0)
|
||||
next = NULL;
|
||||
|
@ -1322,9 +1323,9 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
|
||||
if (next2)
|
||||
{
|
||||
VectorSubtract(next2->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
dot2 = DotProduct(forward,to_next);
|
||||
VectorSubtract (next2->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
dot2 = DotProduct (forward,to_next);
|
||||
if (dot2 < 0)
|
||||
next2 = NULL;
|
||||
else if (!next)
|
||||
|
@ -1358,9 +1359,9 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
if (e->target && !Q_stricmp(e->target,path->targetname))
|
||||
{
|
||||
next = e;
|
||||
VectorSubtract(next->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
dot = DotProduct(forward,to_next);
|
||||
VectorSubtract (next->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
dot = DotProduct (forward, to_next);
|
||||
if (dot < 0)
|
||||
next = NULL;
|
||||
}
|
||||
|
@ -1370,9 +1371,9 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path)
|
|||
float dot2;
|
||||
|
||||
next2 = e;
|
||||
VectorSubtract(next2->s.origin,path->s.origin,to_next);
|
||||
VectorNormalize(to_next);
|
||||
dot2 = DotProduct(forward,to_next);
|
||||
VectorSubtract (next2->s.origin, path->s.origin, to_next);
|
||||
VectorNormalize (to_next);
|
||||
dot2 = DotProduct (forward, to_next);
|
||||
if (dot2 < 0)
|
||||
next2 = NULL;
|
||||
else if (!next)
|
||||
|
@ -1421,22 +1422,22 @@ void LookAhead( edict_t *train, vec3_t point, float dist )
|
|||
return;
|
||||
}
|
||||
|
||||
VectorSubtract(path->s.origin,point,v);
|
||||
length = VectorLength(v);
|
||||
VectorSubtract (path->s.origin, point, v);
|
||||
length = VectorLength (v);
|
||||
if (length >= dist)
|
||||
{
|
||||
VectorMA(point,dist/length,v,point);
|
||||
VectorMA (point, dist/length, v, point);
|
||||
return;
|
||||
}
|
||||
dist -= length;
|
||||
VectorCopy(path->s.origin,point);
|
||||
VectorCopy (path->s.origin, point);
|
||||
|
||||
// Don't go past a switch
|
||||
/* if (path->spawnflags & SF_PATH_ALTPATH)
|
||||
{
|
||||
return;
|
||||
} */
|
||||
path = NextPathTrack(train,path);
|
||||
path = NextPathTrack (train,path);
|
||||
if (!path)
|
||||
return;
|
||||
}
|
||||
|
@ -1446,13 +1447,13 @@ void train_angles(edict_t *train)
|
|||
{
|
||||
vec3_t v, angles;
|
||||
|
||||
VectorCopy(train->s.origin,v);
|
||||
VectorCopy (train->s.origin, v);
|
||||
v[2] -= train->viewheight;
|
||||
LookAhead(train,v,train->moveinfo.distance);
|
||||
v[2] += train->viewheight;
|
||||
VectorSubtract (v, train->s.origin, v);
|
||||
if ( (train->moveinfo.state < STOP) || (train->moveinfo.state==STOP && is_backing_up(train)) )
|
||||
VectorNegate(v,v);
|
||||
VectorNegate (v, v);
|
||||
|
||||
// gi.dprintf("v = %g, %g, %g\n",v[0],v[1],v[2]);
|
||||
|
||||
|
@ -1513,7 +1514,7 @@ void tracktrain_turn (edict_t *self)
|
|||
// Train doesn't turn if at a complete stop
|
||||
if ((train->velocity[0]==0.) && (train->velocity[1]==0.) && (train->velocity[2]==0.))
|
||||
{
|
||||
VectorClear(train->avelocity);
|
||||
VectorClear (train->avelocity);
|
||||
gi.linkentity(train);
|
||||
return;
|
||||
}
|
||||
|
@ -1716,8 +1717,8 @@ void tracktrain_next (edict_t *self)
|
|||
return;
|
||||
}
|
||||
|
||||
VectorClear(self->velocity);
|
||||
VectorClear(self->avelocity);
|
||||
VectorClear (self->velocity);
|
||||
VectorClear (self->avelocity);
|
||||
self->moveinfo.prevstate = self->moveinfo.state;
|
||||
self->moveinfo.state = STOP;
|
||||
self->s.sound = 0;
|
||||
|
@ -1726,7 +1727,7 @@ void tracktrain_next (edict_t *self)
|
|||
gi.linkentity(self);
|
||||
if (self->owner)
|
||||
{
|
||||
VectorClear(self->owner->velocity);
|
||||
VectorClear (self->owner->velocity);
|
||||
gi.linkentity(self->owner);
|
||||
}
|
||||
if (self->target_ent->deathtarget)
|
||||
|
@ -1794,7 +1795,7 @@ void func_tracktrain_find (edict_t *self)
|
|||
return;
|
||||
}
|
||||
VectorSubtract (next->s.origin, ent->s.origin, vec);
|
||||
vectoangles2(vec,self->s.angles);
|
||||
vectoangles2 (vec, self->s.angles);
|
||||
|
||||
ent->think = tracktrain_turn;
|
||||
ent->enemy = self;
|
||||
|
@ -1804,7 +1805,7 @@ void func_tracktrain_find (edict_t *self)
|
|||
VectorCopy (ent->s.origin, self->s.origin);
|
||||
self->s.origin[2] += self->viewheight;
|
||||
|
||||
//Knightmare- move movewith pieces to spawning point
|
||||
// Knightmare- move movewith pieces to spawning point
|
||||
if (self->targetname)
|
||||
{
|
||||
edict_t *e = NULL;
|
||||
|
@ -1822,11 +1823,11 @@ void func_tracktrain_find (edict_t *self)
|
|||
continue;
|
||||
if (!strcmp(e->movewith, self->targetname))
|
||||
{
|
||||
//Knightmare- save distance moved for turret_breach to add to its firing point
|
||||
// Knightmare- save distance moved for turret_breach to add to its firing point
|
||||
if (!strcmp(e->classname, "turret_breach") || !strcmp(e->classname, "model_turret"))
|
||||
VectorCopy (dir, e->aim_point);
|
||||
|
||||
VectorAdd(dir, e->s.origin, e->s.origin);
|
||||
VectorAdd (dir, e->s.origin, e->s.origin);
|
||||
VectorCopy (e->s.origin, e->s.old_origin);
|
||||
//This is now the child's original position
|
||||
if ( (e->solid == SOLID_BSP) && strcmp(e->classname,"func_rotating")
|
||||
|
@ -1920,11 +1921,11 @@ void SP_func_tracktrain (edict_t *self)
|
|||
// Driving position
|
||||
if ( (VectorLength(self->bleft) == 0) && (VectorLength(self->tright) == 0))
|
||||
{
|
||||
VectorSet(self->bleft,-8,-8,-8);
|
||||
VectorSet(self->tright,8,8,8);
|
||||
VectorSet (self->bleft, -8, -8, -8);
|
||||
VectorSet (self->tright, 8, 8, 8);
|
||||
}
|
||||
VectorAdd(self->bleft,self->tright,self->move_origin);
|
||||
VectorScale(self->move_origin,0.5,self->move_origin);
|
||||
VectorAdd (self->bleft, self->tright, self->move_origin);
|
||||
VectorScale (self->move_origin ,0.5, self->move_origin);
|
||||
|
||||
self->solid = SOLID_BSP;
|
||||
gi.setmodel (self, self->model);
|
||||
|
@ -1974,7 +1975,7 @@ void SP_func_tracktrain (edict_t *self)
|
|||
self->moveinfo.prevstate = STOP+1; // Assumed, so that initial reverse works correctly
|
||||
self->s.sound = 0;
|
||||
self->turn_rider = 1;
|
||||
VectorClear(self->s.angles);
|
||||
VectorClear (self->s.angles);
|
||||
|
||||
self->postthink = train_move_children; //Knightmare- supports movewith
|
||||
|
||||
|
@ -2043,11 +2044,11 @@ void find_tracktrain (edict_t *self)
|
|||
train->svflags &= ~SVF_NOCLIENT;
|
||||
train->spawnflags = self->spawnflags;
|
||||
train->spawnflags &= ~(SF_TRACKTRAIN_OTHERMAP | SF_TRACKTRAIN_DISABLED);
|
||||
VectorCopy(self->s.origin,train->s.origin);
|
||||
VectorCopy(self->s.angles,train->s.angles);
|
||||
VectorCopy(self->bleft, train->bleft);
|
||||
VectorCopy(self->tright, train->tright);
|
||||
VectorClear(train->avelocity);
|
||||
VectorCopy (self->s.origin, train->s.origin);
|
||||
VectorCopy (self->s.angles, train->s.angles);
|
||||
VectorCopy (self->bleft, train->bleft);
|
||||
VectorCopy (self->tright, train->tright);
|
||||
VectorClear (train->avelocity);
|
||||
train->viewheight = self->viewheight;
|
||||
train->speed = self->speed;
|
||||
train->moveinfo.distance = self->radius;
|
||||
|
@ -2069,8 +2070,8 @@ void find_tracktrain (edict_t *self)
|
|||
train->s.sound = 0;
|
||||
train->moveinfo.next_speed = train->moveinfo.state * train->moveinfo.speed/3;
|
||||
// Assume train was already at it's "next_speed" when the level change occurred
|
||||
AngleVectors(train->s.angles,forward,NULL,NULL);
|
||||
VectorScale(forward,train->moveinfo.next_speed,train->velocity);
|
||||
AngleVectors (train->s.angles, forward, NULL, NULL);
|
||||
VectorScale (forward, train->moveinfo.next_speed, train->velocity);
|
||||
// Force a wait before taking player input
|
||||
train->moveinfo.wait = 1;
|
||||
|
||||
|
@ -2083,7 +2084,7 @@ void find_tracktrain (edict_t *self)
|
|||
train->owner->client->vehicle_framenum = level.framenum;
|
||||
train->owner->client->ps.pmove.pm_flags |= PMF_NO_PREDICTION;
|
||||
}
|
||||
VectorCopy(self->offset,train->offset);
|
||||
VectorCopy (self->offset, train->offset);
|
||||
}
|
||||
else
|
||||
train->owner = NULL;
|
||||
|
|
|
@ -86,7 +86,7 @@ void Use_Multi (edict_t *ent, edict_t *other, edict_t *activator)
|
|||
//PGM
|
||||
if (ent->spawnflags & TRIGGER_TOGGLE)
|
||||
{
|
||||
if(ent->solid == SOLID_TRIGGER)
|
||||
if (ent->solid == SOLID_TRIGGER)
|
||||
ent->solid = SOLID_NOT;
|
||||
else
|
||||
ent->solid = SOLID_TRIGGER;
|
||||
|
@ -102,7 +102,7 @@ void Use_Multi (edict_t *ent, edict_t *other, edict_t *activator)
|
|||
|
||||
void Touch_Multi (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
|
||||
{
|
||||
if(other->client || (other->flags & FL_ROBOT))
|
||||
if (other->client || (other->flags & FL_ROBOT))
|
||||
{
|
||||
if (self->spawnflags & TRIGGER_NOT_PLAYER)
|
||||
return;
|
||||
|
@ -115,7 +115,7 @@ void Touch_Multi (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *su
|
|||
else
|
||||
return;
|
||||
|
||||
if( (self->spawnflags & TRIGGER_CAMOWNER) && (!other->client || !other->client->spycam))
|
||||
if ( (self->spawnflags & TRIGGER_CAMOWNER) && (!other->client || !other->client->spycam))
|
||||
return;
|
||||
|
||||
if (!VectorCompare(self->movedir, vec3_origin))
|
||||
|
@ -304,7 +304,7 @@ void SP_trigger_relay (edict_t *self)
|
|||
self->noise_index = gi.soundindex ("misc/talk.wav");
|
||||
else if (self->sounds == 3)
|
||||
self->noise_index = -1;
|
||||
if(!self->count) self->count=-1;
|
||||
if (!self->count) self->count=-1;
|
||||
// end DWH
|
||||
self->use = trigger_relay_use;
|
||||
}
|
||||
|
@ -431,13 +431,13 @@ void trigger_key_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
if (!ent->client)
|
||||
continue;
|
||||
// DWH: keep key
|
||||
if(!(self->spawnflags & 2))
|
||||
if (!(self->spawnflags & 2))
|
||||
ent->client->pers.inventory[index] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// DWH: keep key
|
||||
else if(!(self->spawnflags & 2))
|
||||
else if (!(self->spawnflags & 2))
|
||||
{
|
||||
activator->client->pers.inventory[index]--;
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ void trigger_key_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
G_UseTargets (self, activator);
|
||||
|
||||
// DWH - multi-use
|
||||
if(!(self->spawnflags & 1))
|
||||
if (!(self->spawnflags & 1))
|
||||
{
|
||||
self->use = NULL;
|
||||
self->think = G_FreeEdict;
|
||||
|
@ -475,7 +475,7 @@ void SP_trigger_key (edict_t *self)
|
|||
return;
|
||||
}
|
||||
//Knightmare- don't load these sounds if it is silent
|
||||
if(!(self->spawnflags & 4))
|
||||
if (!(self->spawnflags & 4))
|
||||
{
|
||||
gi.soundindex ("misc/keytry.wav");
|
||||
gi.soundindex ("misc/keyuse.wav");
|
||||
|
@ -606,9 +606,9 @@ void trigger_push_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
|
|||
if (other->fly_sound_debounce_time < level.time)
|
||||
{
|
||||
other->fly_sound_debounce_time = level.time + 1.5;
|
||||
if(self->spawnflags & PUSH_CUSTOM_SND)
|
||||
if (self->spawnflags & PUSH_CUSTOM_SND)
|
||||
{
|
||||
if(self->noise_index)
|
||||
if (self->noise_index)
|
||||
gi.sound(other, CHAN_AUTO, self->noise_index, 1, ATTN_NORM, 0);
|
||||
}
|
||||
else
|
||||
|
@ -953,10 +953,10 @@ void SP_trigger_gravity_bbox (edict_t *self)
|
|||
// self->gravity = atoi(st.gravity);
|
||||
self->gravity = atof(st.gravity);
|
||||
|
||||
if(self->spawnflags & 1) // TOGGLE
|
||||
if (self->spawnflags & 1) // TOGGLE
|
||||
self->use = trigger_gravity_use;
|
||||
|
||||
if(self->spawnflags & 2) // START_OFF
|
||||
if (self->spawnflags & 2) // START_OFF
|
||||
{
|
||||
self->use = trigger_gravity_use;
|
||||
self->solid = SOLID_NOT;
|
||||
|
@ -1071,12 +1071,12 @@ void SP_trigger_mass (edict_t *self)
|
|||
// self->noise_index = gi.soundindex ("misc/trigger1.wav");
|
||||
self->noise_index = -1;
|
||||
|
||||
if(!self->wait)
|
||||
if (!self->wait)
|
||||
self->wait = 0.2;
|
||||
self->touch = trigger_mass_touch;
|
||||
self->movetype = MOVETYPE_NONE;
|
||||
self->svflags |= SVF_NOCLIENT;
|
||||
if(self->spawnflags & TRIGGER_TRIGGERED)
|
||||
if (self->spawnflags & TRIGGER_TRIGGERED)
|
||||
{
|
||||
self->solid = SOLID_NOT;
|
||||
self->use = trigger_enable;
|
||||
|
@ -1086,7 +1086,7 @@ void SP_trigger_mass (edict_t *self)
|
|||
self->solid = SOLID_TRIGGER;
|
||||
self->use = Use_Multi;
|
||||
}
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 100;
|
||||
|
||||
gi.setmodel (self, self->model);
|
||||
|
@ -1118,12 +1118,12 @@ void SP_trigger_mass_bbox (edict_t *self)
|
|||
// self->noise_index = gi.soundindex ("misc/trigger1.wav");
|
||||
self->noise_index = -1;
|
||||
|
||||
if(!self->wait) self->wait = 0.2;
|
||||
if (!self->wait) self->wait = 0.2;
|
||||
self->touch = trigger_mass_touch;
|
||||
|
||||
InitTriggerBbox (self);
|
||||
|
||||
if(self->spawnflags & TRIGGER_TRIGGERED)
|
||||
if (self->spawnflags & TRIGGER_TRIGGERED)
|
||||
{
|
||||
self->solid = SOLID_NOT;
|
||||
self->use = trigger_enable;
|
||||
|
@ -1133,7 +1133,7 @@ void SP_trigger_mass_bbox (edict_t *self)
|
|||
self->solid = SOLID_TRIGGER;
|
||||
self->use = Use_Multi;
|
||||
}
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 100;
|
||||
|
||||
gi.linkentity (self);
|
||||
|
@ -1182,13 +1182,13 @@ void SP_trigger_inside (edict_t *self)
|
|||
vec3_t v;
|
||||
|
||||
VectorMA (self->mins, 0.5, self->size, v);
|
||||
if(!self->target)
|
||||
if (!self->target)
|
||||
{
|
||||
gi.dprintf("trigger_inside with no target at %s.\n",vtos(v));
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
}
|
||||
if(!self->pathtarget)
|
||||
if (!self->pathtarget)
|
||||
{
|
||||
gi.dprintf("trigger_inside with no pathtarget at %s.\n",vtos(v));
|
||||
G_FreeEdict(self);
|
||||
|
@ -1197,7 +1197,7 @@ void SP_trigger_inside (edict_t *self)
|
|||
self->movetype = MOVETYPE_NONE;
|
||||
self->svflags |= SVF_NOCLIENT;
|
||||
self->solid = SOLID_TRIGGER;
|
||||
if(!self->wait)
|
||||
if (!self->wait)
|
||||
self->wait = 0.2;
|
||||
|
||||
gi.setmodel (self,self->model);
|
||||
|
@ -1224,13 +1224,13 @@ void SP_trigger_inside_bbox (edict_t *self)
|
|||
vec3_t v;
|
||||
|
||||
VectorMA (self->mins, 0.5, self->size, v);
|
||||
if(!self->target)
|
||||
if (!self->target)
|
||||
{
|
||||
gi.dprintf("trigger_inside_bbox with no target at %s.\n",vtos(v));
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
}
|
||||
if(!self->pathtarget)
|
||||
if (!self->pathtarget)
|
||||
{
|
||||
gi.dprintf("trigger_inside_bbox with no pathtarget at %s.\n",vtos(v));
|
||||
G_FreeEdict(self);
|
||||
|
@ -1238,7 +1238,7 @@ void SP_trigger_inside_bbox (edict_t *self)
|
|||
}
|
||||
InitTriggerBbox (self);
|
||||
|
||||
if(!self->wait)
|
||||
if (!self->wait)
|
||||
self->wait = 0.2;
|
||||
|
||||
self->think = trigger_inside_think;
|
||||
|
@ -1256,10 +1256,10 @@ float weight_on_top(edict_t *ent)
|
|||
int i;
|
||||
edict_t *e;
|
||||
weight = 0.0;
|
||||
for(i=1, e=g_edicts+i; i<globals.num_edicts; i++, e++)
|
||||
for (i=1, e=g_edicts+i; i<globals.num_edicts; i++, e++)
|
||||
{
|
||||
if(!e->inuse) continue;
|
||||
if(e->groundentity == ent)
|
||||
if (!e->inuse) continue;
|
||||
if (e->groundentity == ent)
|
||||
{
|
||||
weight += e->mass;
|
||||
weight += weight_on_top(e);
|
||||
|
@ -1283,19 +1283,19 @@ void trigger_scales_think (edict_t *self)
|
|||
if (!hit->inuse) continue;
|
||||
if (!hit->mass) continue;
|
||||
fx = fy = 0.0;
|
||||
if(hit->absmin[0] < self->absmin[0])
|
||||
if (hit->absmin[0] < self->absmin[0])
|
||||
fx += (self->absmin[0] - hit->absmin[0])/hit->size[0];
|
||||
if(hit->absmax[0] > self->absmax[0])
|
||||
if (hit->absmax[0] > self->absmax[0])
|
||||
fx += (hit->absmax[0] - self->absmax[0])/hit->size[0];
|
||||
if(hit->absmin[1] < self->absmin[1])
|
||||
if (hit->absmin[1] < self->absmin[1])
|
||||
fy += (self->absmin[1] - hit->absmin[1])/hit->size[1];
|
||||
if(hit->absmax[1] > self->absmax[1])
|
||||
if (hit->absmax[1] > self->absmax[1])
|
||||
fy += (hit->absmax[1] - self->absmax[1])/hit->size[1];
|
||||
f = (1.0 - fx - fy + fx*fy);
|
||||
if(f > 0) weight += f * hit->mass;
|
||||
if (f > 0) weight += f * hit->mass;
|
||||
weight += f*weight_on_top(hit);
|
||||
}
|
||||
if(weight != self->mass)
|
||||
if (weight != self->mass)
|
||||
{
|
||||
self->mass = weight;
|
||||
for (e = self->teammaster; e; e = e->teamchain)
|
||||
|
@ -1303,7 +1303,7 @@ void trigger_scales_think (edict_t *self)
|
|||
if (!e->count)
|
||||
continue;
|
||||
num = e->count;
|
||||
if(weight < pow(10,num-1))
|
||||
if (weight < pow(10,num-1))
|
||||
e->s.frame = 12;
|
||||
else
|
||||
e->s.frame = ( weight % (int)pow(10,num) ) / ( pow(10,num-1) );
|
||||
|
@ -1318,7 +1318,7 @@ void SP_trigger_scales (edict_t *self)
|
|||
vec3_t v;
|
||||
|
||||
VectorMA (self->mins, 0.5, self->size, v);
|
||||
if(!self->team)
|
||||
if (!self->team)
|
||||
{
|
||||
gi.dprintf("trigger_scales with no team at %s.\n",vtos(v));
|
||||
G_FreeEdict(self);
|
||||
|
@ -1339,7 +1339,7 @@ void SP_trigger_scales_bbox (edict_t *self)
|
|||
vec3_t v;
|
||||
|
||||
VectorMA (self->mins, 0.5, self->size, v);
|
||||
if(!self->team)
|
||||
if (!self->team)
|
||||
{
|
||||
gi.dprintf("trigger_scales_bbox with no team at %s.\n",vtos(v));
|
||||
G_FreeEdict(self);
|
||||
|
@ -1367,19 +1367,19 @@ void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
|
|||
vec_t dist;
|
||||
vec3_t dir, forward, left, up, end, start;
|
||||
|
||||
if(!other->client)
|
||||
if (!other->client)
|
||||
return;
|
||||
|
||||
if (self->nextthink)
|
||||
return; // already been triggered
|
||||
|
||||
if( (self->spawnflags & TRIGGER_TOGGLE) && !(other->client->use))
|
||||
if ( (self->spawnflags & TRIGGER_TOGGLE) && !(other->client->use))
|
||||
return;
|
||||
|
||||
if( (self->spawnflags & TRIGGER_CAMOWNER) && !other->client->spycam)
|
||||
if ( (self->spawnflags & TRIGGER_CAMOWNER) && !other->client->spycam)
|
||||
return;
|
||||
|
||||
if( self->spawnflags & 32 )
|
||||
if ( self->spawnflags & 32 )
|
||||
{
|
||||
// Then trigger only fires if looking at TARGET, not trigger bbox
|
||||
edict_t *target;
|
||||
|
@ -1388,10 +1388,10 @@ void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
|
|||
vec3_t endpos;
|
||||
|
||||
target = G_Find(NULL,FOFS(targetname),self->target);
|
||||
while(target && !num_triggered)
|
||||
while (target && !num_triggered)
|
||||
{
|
||||
what = LookingAt(other,0,endpos,NULL);
|
||||
if(target->inuse && (LookingAt(other,0,NULL,NULL) == target))
|
||||
if (target->inuse && (LookingAt(other,0,NULL,NULL) == target))
|
||||
{
|
||||
num_triggered++;
|
||||
self->activator = other;
|
||||
|
@ -1400,12 +1400,12 @@ void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
|
|||
else
|
||||
target = G_Find(target,FOFS(targetname),self->target);
|
||||
}
|
||||
if(!num_triggered)
|
||||
if (!num_triggered)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(other->client->spycam)
|
||||
if (other->client->spycam)
|
||||
{
|
||||
vec3_t f1, l1, u1;
|
||||
|
||||
|
@ -1434,17 +1434,17 @@ void trigger_look_touch (edict_t *self, edict_t *other, cplane_t *plane, csurfac
|
|||
// bleft-tright box is roughly a cube. If it's considerably
|
||||
// longer in one direction we'll get false misses.
|
||||
|
||||
if(end[0] < self->s.origin[0] + self->bleft[0])
|
||||
if (end[0] < self->s.origin[0] + self->bleft[0])
|
||||
return;
|
||||
if(end[1] < self->s.origin[1] + self->bleft[1])
|
||||
if (end[1] < self->s.origin[1] + self->bleft[1])
|
||||
return;
|
||||
if(end[2] < self->s.origin[2] + self->bleft[2])
|
||||
if (end[2] < self->s.origin[2] + self->bleft[2])
|
||||
return;
|
||||
if(end[0] > self->s.origin[0] + self->tright[0])
|
||||
if (end[0] > self->s.origin[0] + self->tright[0])
|
||||
return;
|
||||
if(end[1] > self->s.origin[1] + self->tright[1])
|
||||
if (end[1] > self->s.origin[1] + self->tright[1])
|
||||
return;
|
||||
if(end[2] > self->s.origin[2] + self->tright[2])
|
||||
if (end[2] > self->s.origin[2] + self->tright[2])
|
||||
return;
|
||||
|
||||
self->activator = other;
|
||||
|
@ -1470,7 +1470,7 @@ void trigger_look_enable (edict_t *self, edict_t *other, edict_t *activator);
|
|||
void trigger_look_disable (edict_t *self, edict_t *other, edict_t *activator)
|
||||
{
|
||||
self->count--;
|
||||
if(self->count == 0)
|
||||
if (self->count == 0)
|
||||
{
|
||||
self->think = G_FreeEdict;
|
||||
self->nextthink = level.time + 1;
|
||||
|
@ -1532,16 +1532,16 @@ void trigger_speaker_think (edict_t *self)
|
|||
touching = NULL;
|
||||
for (i = 1; i <= maxclients->value && !touching; i++) {
|
||||
player = &g_edicts[i];
|
||||
if(!player->inuse) continue;
|
||||
if(player->s.origin[0] < self->s.origin[0] + self->bleft[0]) continue;
|
||||
if(player->s.origin[1] < self->s.origin[1] + self->bleft[1]) continue;
|
||||
if(player->s.origin[2] < self->s.origin[2] + self->bleft[2]) continue;
|
||||
if(player->s.origin[0] > self->s.origin[0] + self->tright[0]) continue;
|
||||
if(player->s.origin[1] > self->s.origin[1] + self->tright[1]) continue;
|
||||
if(player->s.origin[2] > self->s.origin[2] + self->tright[2]) continue;
|
||||
if (!player->inuse) continue;
|
||||
if (player->s.origin[0] < self->s.origin[0] + self->bleft[0]) continue;
|
||||
if (player->s.origin[1] < self->s.origin[1] + self->bleft[1]) continue;
|
||||
if (player->s.origin[2] < self->s.origin[2] + self->bleft[2]) continue;
|
||||
if (player->s.origin[0] > self->s.origin[0] + self->tright[0]) continue;
|
||||
if (player->s.origin[1] > self->s.origin[1] + self->tright[1]) continue;
|
||||
if (player->s.origin[2] > self->s.origin[2] + self->tright[2]) continue;
|
||||
touching = player;
|
||||
}
|
||||
if(touching)
|
||||
if (touching)
|
||||
gi.sound (touching, CHAN_VOICE, self->noise_index, 1, ATTN_NORM, 0);
|
||||
self->nextthink = level.time + FRAMETIME;
|
||||
}
|
||||
|
@ -1565,7 +1565,7 @@ void SP_trigger_speaker (edict_t *self)
|
|||
{
|
||||
char buffer[MAX_QPATH];
|
||||
|
||||
if(!st.noise)
|
||||
if (!st.noise)
|
||||
{
|
||||
gi.dprintf("trigger_speaker with no noise set at %s\n", vtos(self->s.origin));
|
||||
return;
|
||||
|
@ -1609,7 +1609,7 @@ qboolean HasSpawnFunction(edict_t *ent)
|
|||
gitem_t *item;
|
||||
int i;
|
||||
|
||||
if(!ent->classname)
|
||||
if (!ent->classname)
|
||||
return false;
|
||||
|
||||
// check item spawn functions
|
||||
|
@ -1644,7 +1644,7 @@ void WriteTransitionEdict (FILE *f, edict_t *changelevel, edict_t *ent)
|
|||
if (!Q_stricmp(e.classname,"target_speaker"))
|
||||
e.spawnflags |= 8; // indicates that "message" contains noise
|
||||
|
||||
if(changelevel->s.angles[YAW])
|
||||
if (changelevel->s.angles[YAW])
|
||||
{
|
||||
vec3_t angles;
|
||||
vec3_t forward, right, v;
|
||||
|
@ -1672,7 +1672,7 @@ void WriteTransitionEdict (FILE *f, edict_t *changelevel, edict_t *ent)
|
|||
temp = (byte *)&e;
|
||||
for (field=fields ; field->name ; field++)
|
||||
{
|
||||
if((field->type == F_EDICT) || (field->type == F_FUNCTION))
|
||||
if ((field->type == F_EDICT) || (field->type == F_FUNCTION))
|
||||
{
|
||||
p = (void *)(temp + field->ofs);
|
||||
*(edict_t **)p = NULL;
|
||||
|
@ -1696,10 +1696,10 @@ void WriteTransitionEdict (FILE *f, edict_t *changelevel, edict_t *ent)
|
|||
e.noise_index = 0;
|
||||
// If the ent is a live bad guy monster, remove him from the total
|
||||
// monster count. He'll be added back in in the new map.
|
||||
if( (e.svflags & SVF_MONSTER) && !(e.monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
if ( (e.svflags & SVF_MONSTER) && !(e.monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
&& !(e.monsterinfo.monsterflags & MFL_DO_NOT_COUNT) )
|
||||
{
|
||||
if(e.health > 0)
|
||||
if (e.health > 0)
|
||||
level.total_monsters--;
|
||||
else
|
||||
e.max_health = -1;
|
||||
|
@ -1707,12 +1707,12 @@ void WriteTransitionEdict (FILE *f, edict_t *changelevel, edict_t *ent)
|
|||
// Enemy isn't preserved... let's try a new flag for
|
||||
// single-player only that tells monster to find
|
||||
// the player again at startup
|
||||
if(!coop->value && !deathmatch->value)
|
||||
if (!coop->value && !deathmatch->value)
|
||||
{
|
||||
if(ent->enemy == &g_edicts[1] && ent->health > 0)
|
||||
if (ent->enemy == &g_edicts[1] && ent->health > 0)
|
||||
e.monsterinfo.aiflags = AI_RESPAWN_FINDPLAYER;
|
||||
}
|
||||
if(e.classname &&
|
||||
if (e.classname &&
|
||||
( !Q_stricmp(e.classname,"misc_actor") || strstr(e.classname,"monster_") ) &&
|
||||
//Knightmare- changed this from a gib_health check, to take into account no_gib monsters
|
||||
(e.svflags & SVF_GIB) )
|
||||
|
@ -1792,30 +1792,30 @@ int trigger_transition_ents (edict_t *changelevel, edict_t *self)
|
|||
entlist_t *p;
|
||||
FILE *f;
|
||||
|
||||
if(developer->value)
|
||||
if (developer->value)
|
||||
gi.dprintf("==== WriteTransitionEnts ====\n");
|
||||
|
||||
trans_ent_filename (t_file, sizeof(t_file));
|
||||
f = fopen(t_file,"wb");
|
||||
if(!f)
|
||||
if (!f)
|
||||
{
|
||||
gi.dprintf("Error opening %s for writing\n",t_file);
|
||||
return 0;
|
||||
}
|
||||
// First scan entities for brush models that SHOULD change levels, e.g. func_tracktrain,
|
||||
// which had better have a partner train in the next map... or we'll bitch loudly
|
||||
for(i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
for (i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
{
|
||||
ent = &g_edicts[i];
|
||||
if(!ent->inuse) continue;
|
||||
if(ent->solid != SOLID_BSP) continue;
|
||||
if(ent->s.origin[0] > self->maxs[0]) continue;
|
||||
if(ent->s.origin[1] > self->maxs[1]) continue;
|
||||
if(ent->s.origin[2] > self->maxs[2]) continue;
|
||||
if(ent->s.origin[0] < self->mins[0]) continue;
|
||||
if(ent->s.origin[1] < self->mins[1]) continue;
|
||||
if(ent->s.origin[2] < self->mins[2]) continue;
|
||||
if(!Q_stricmp(ent->classname,"func_tracktrain") && !(ent->spawnflags & 8) && ent->targetname)
|
||||
if (!ent->inuse) continue;
|
||||
if (ent->solid != SOLID_BSP) continue;
|
||||
if (ent->s.origin[0] > self->maxs[0]) continue;
|
||||
if (ent->s.origin[1] > self->maxs[1]) continue;
|
||||
if (ent->s.origin[2] > self->maxs[2]) continue;
|
||||
if (ent->s.origin[0] < self->mins[0]) continue;
|
||||
if (ent->s.origin[1] < self->mins[1]) continue;
|
||||
if (ent->s.origin[2] < self->mins[2]) continue;
|
||||
if (!Q_stricmp(ent->classname,"func_tracktrain") && !(ent->spawnflags & 8) && ent->targetname)
|
||||
{
|
||||
edict_t *e;
|
||||
|
||||
|
@ -1840,7 +1840,7 @@ int trigger_transition_ents (edict_t *changelevel, edict_t *self)
|
|||
e->radius = ent->moveinfo.distance;
|
||||
e->solid = SOLID_NOT;
|
||||
e->svflags |= SVF_NOCLIENT;
|
||||
if(ent->owner)
|
||||
if (ent->owner)
|
||||
e->style = ent->owner - g_edicts;
|
||||
else
|
||||
e->style = 0;
|
||||
|
@ -1855,32 +1855,32 @@ int trigger_transition_ents (edict_t *changelevel, edict_t *self)
|
|||
}
|
||||
}
|
||||
|
||||
for(i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
for (i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
{
|
||||
ent = &g_edicts[i];
|
||||
ent->id = 0;
|
||||
if(!ent->inuse) continue;
|
||||
if (!ent->inuse) continue;
|
||||
// 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->s.origin[0] > self->maxs[0]) continue;
|
||||
if(ent->s.origin[1] > self->maxs[1]) continue;
|
||||
if(ent->s.origin[2] > self->maxs[2]) continue;
|
||||
if(ent->s.origin[0] < self->mins[0]) continue;
|
||||
if(ent->s.origin[1] < self->mins[1]) continue;
|
||||
if(ent->s.origin[2] < self->mins[2]) continue;
|
||||
if(ent->solid == SOLID_BSP) continue;
|
||||
if((ent->solid == SOLID_TRIGGER) && !FindItemByClassname(ent->classname)) continue;
|
||||
if (ent->owner && !ent->owner->client) continue;
|
||||
if (ent->movewith) continue;
|
||||
if (ent->s.origin[0] > self->maxs[0]) continue;
|
||||
if (ent->s.origin[1] > self->maxs[1]) continue;
|
||||
if (ent->s.origin[2] > self->maxs[2]) continue;
|
||||
if (ent->s.origin[0] < self->mins[0]) continue;
|
||||
if (ent->s.origin[1] < self->mins[1]) continue;
|
||||
if (ent->s.origin[2] < self->mins[2]) continue;
|
||||
if (ent->solid == SOLID_BSP) continue;
|
||||
if ((ent->solid == SOLID_TRIGGER) && !FindItemByClassname(ent->classname)) continue;
|
||||
// Do not under any circumstances move these entities:
|
||||
for(p=DoNotMove, nogo=false; p->name && !nogo; p++)
|
||||
if(!Q_stricmp(ent->classname,p->name))
|
||||
for (p=DoNotMove, nogo=false; p->name && !nogo; p++)
|
||||
if (!Q_stricmp(ent->classname,p->name))
|
||||
nogo = true;
|
||||
if(nogo) continue;
|
||||
if(!HasSpawnFunction(ent)) continue;
|
||||
if (nogo) continue;
|
||||
if (!HasSpawnFunction(ent)) continue;
|
||||
total++;
|
||||
ent->id = total;
|
||||
if(ent->owner)
|
||||
if (ent->owner)
|
||||
ent->owner_id = -(ent->owner - g_edicts);
|
||||
else
|
||||
ent->owner_id = 0;
|
||||
|
@ -1889,34 +1889,34 @@ int trigger_transition_ents (edict_t *changelevel, edict_t *self)
|
|||
ent->inuse = false;
|
||||
}
|
||||
// Repeat, ONLY for ents owned by non-players
|
||||
for(i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
for (i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
{
|
||||
ent = &g_edicts[i];
|
||||
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;
|
||||
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:
|
||||
for(p=DoNotMove, nogo=false; p->name && !nogo; p++)
|
||||
if(!Q_stricmp(ent->classname,p->name))
|
||||
for (p=DoNotMove, nogo=false; p->name && !nogo; p++)
|
||||
if (!Q_stricmp(ent->classname,p->name))
|
||||
nogo = true;
|
||||
if(nogo) continue;
|
||||
if(!HasSpawnFunction(ent)) continue;
|
||||
if(ent->s.origin[0] > self->maxs[0]) continue;
|
||||
if(ent->s.origin[1] > self->maxs[1]) continue;
|
||||
if(ent->s.origin[2] > self->maxs[2]) continue;
|
||||
if(ent->s.origin[0] < self->mins[0]) continue;
|
||||
if(ent->s.origin[1] < self->mins[1]) continue;
|
||||
if(ent->s.origin[2] < self->mins[2]) continue;
|
||||
if (nogo) continue;
|
||||
if (!HasSpawnFunction(ent)) continue;
|
||||
if (ent->s.origin[0] > self->maxs[0]) continue;
|
||||
if (ent->s.origin[1] > self->maxs[1]) continue;
|
||||
if (ent->s.origin[2] > self->maxs[2]) continue;
|
||||
if (ent->s.origin[0] < self->mins[0]) continue;
|
||||
if (ent->s.origin[1] < self->mins[1]) continue;
|
||||
if (ent->s.origin[2] < self->mins[2]) continue;
|
||||
ent->owner_id = 0;
|
||||
for(j=game.maxclients+1; j<globals.num_edicts && !ent->owner_id; j++)
|
||||
for (j=game.maxclients+1; j<globals.num_edicts && !ent->owner_id; j++)
|
||||
{
|
||||
if(ent->owner == &g_edicts[j])
|
||||
if (ent->owner == &g_edicts[j])
|
||||
ent->owner_id = g_edicts[j].id;
|
||||
}
|
||||
if(!ent->owner_id) continue;
|
||||
if (!ent->owner_id) continue;
|
||||
total++;
|
||||
ent->id = total;
|
||||
WriteTransitionEdict(f,changelevel,ent);
|
||||
|
@ -1931,7 +1931,7 @@ int trigger_transition_ents (edict_t *changelevel, edict_t *self)
|
|||
|
||||
void SP_trigger_transition (edict_t *self)
|
||||
{
|
||||
if(!self->targetname)
|
||||
if (!self->targetname)
|
||||
{
|
||||
gi.dprintf("trigger_transition w/o a targetname\n");
|
||||
G_FreeEdict(self);
|
||||
|
@ -1944,7 +1944,7 @@ void SP_trigger_transition (edict_t *self)
|
|||
|
||||
void SP_trigger_transition_bbox (edict_t *self)
|
||||
{
|
||||
if(!self->targetname)
|
||||
if (!self->targetname)
|
||||
{
|
||||
gi.dprintf("trigger_transition_bbox w/o a targetname\n");
|
||||
G_FreeEdict(self);
|
||||
|
@ -2025,17 +2025,17 @@ void trigger_switch_usetargets (edict_t *ent, edict_t *activator)
|
|||
while ((t = G_Find (t, FOFS(targetname), ent->killtarget)))
|
||||
{
|
||||
// Lazarus: remove LIVE killtargeted monsters from total_monsters
|
||||
if((t->svflags & SVF_MONSTER) && (t->deadflag == DEAD_NO))
|
||||
if ((t->svflags & SVF_MONSTER) && (t->deadflag == DEAD_NO))
|
||||
{
|
||||
if(!t->dmgteam || strcmp(t->dmgteam,"player"))
|
||||
if(!(t->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
if (!t->dmgteam || strcmp(t->dmgteam,"player"))
|
||||
if (!(t->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
level.total_monsters--;
|
||||
}
|
||||
// and decrement secret count if target_secret is removed
|
||||
else if(t->class_id == ENTITY_TARGET_SECRET)
|
||||
else if (t->class_id == ENTITY_TARGET_SECRET)
|
||||
level.total_secrets--;
|
||||
// same deal with target_goal, but also turn off CD music if applicable
|
||||
else if(t->class_id == ENTITY_TARGET_GOAL)
|
||||
else if (t->class_id == ENTITY_TARGET_GOAL)
|
||||
{
|
||||
level.total_goals--;
|
||||
if (level.found_goals >= level.total_goals)
|
||||
|
@ -2064,15 +2064,15 @@ void trigger_switch_usetargets (edict_t *ent, edict_t *activator)
|
|||
{
|
||||
gi.dprintf ("WARNING: Entity used itself.\n");
|
||||
}
|
||||
else if(t->use)
|
||||
else if (t->use)
|
||||
{
|
||||
on = 0;
|
||||
switch(t->class_id)
|
||||
switch (t->class_id)
|
||||
{
|
||||
case ENTITY_FUNC_CONVEYOR:
|
||||
case ENTITY_FUNC_FORCE_WALL:
|
||||
case ENTITY_FUNC_WALL:
|
||||
if(t->solid == SOLID_BSP)
|
||||
if (t->solid == SOLID_BSP)
|
||||
on=1;
|
||||
break;
|
||||
case ENTITY_FUNC_PENDULUM:
|
||||
|
@ -2087,42 +2087,42 @@ void trigger_switch_usetargets (edict_t *ent, edict_t *activator)
|
|||
case ENTITY_TARGET_LASER:
|
||||
case ENTITY_TARGET_MAL_LASER:
|
||||
case ENTITY_TARGET_PRECIPITATION:
|
||||
if(t->spawnflags & 1)
|
||||
if (t->spawnflags & 1)
|
||||
on=1;
|
||||
break;
|
||||
case ENTITY_FUNC_REFLECT:
|
||||
if(!(t->spawnflags & 1))
|
||||
if (!(t->spawnflags & 1))
|
||||
on=1;
|
||||
break;
|
||||
case ENTITY_FUNC_ROTATING:
|
||||
on = VectorCompare (t->avelocity, vec3_origin);
|
||||
break;
|
||||
case ENTITY_FUNC_TIMER:
|
||||
if(t->nextthink)
|
||||
if (t->nextthink)
|
||||
on=1;
|
||||
break;
|
||||
case ENTITY_FUNC_TRACKTRAIN:
|
||||
if(!(t->spawnflags & 128))
|
||||
if (!(t->spawnflags & 128))
|
||||
on=1;
|
||||
break;
|
||||
case ENTITY_MODEL_TURRET:
|
||||
case ENTITY_TURRET_BREACH:
|
||||
if(t->spawnflags & 16)
|
||||
if (t->spawnflags & 16)
|
||||
on=1;
|
||||
break;
|
||||
case ENTITY_TARGET_EFFECT:
|
||||
if(t->spawnflags & 3)
|
||||
if (t->spawnflags & 3)
|
||||
{
|
||||
if(t->spawnflags & 1)
|
||||
if (t->spawnflags & 1)
|
||||
on=1;
|
||||
}
|
||||
else
|
||||
on = -1;
|
||||
break;
|
||||
case ENTITY_TARGET_SPEAKER:
|
||||
if(t->spawnflags & 3)
|
||||
if (t->spawnflags & 3)
|
||||
{
|
||||
if(t->s.sound)
|
||||
if (t->s.sound)
|
||||
on=1;
|
||||
}
|
||||
else
|
||||
|
@ -2133,13 +2133,13 @@ void trigger_switch_usetargets (edict_t *ent, edict_t *activator)
|
|||
}
|
||||
|
||||
|
||||
if(ent->spawnflags & TRIGGER_TARGET_OFF)
|
||||
if (ent->spawnflags & TRIGGER_TARGET_OFF)
|
||||
{
|
||||
// Only use target if it is currently ON
|
||||
if(on==1)
|
||||
if (on==1)
|
||||
t->use (t, ent, activator);
|
||||
}
|
||||
else if(on==0)
|
||||
else if (on==0)
|
||||
{
|
||||
// Only use target if it is currently OFF
|
||||
t->use (t, ent, activator);
|
||||
|
@ -2177,7 +2177,7 @@ void trigger_switch (edict_t *ent)
|
|||
|
||||
void touch_trigger_switch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
|
||||
{
|
||||
if(other->client || (other->flags & FL_ROBOT))
|
||||
if (other->client || (other->flags & FL_ROBOT))
|
||||
{
|
||||
if (self->spawnflags & TRIGGER_NOT_PLAYER)
|
||||
return;
|
||||
|
@ -2190,7 +2190,7 @@ void touch_trigger_switch (edict_t *self, edict_t *other, cplane_t *plane, csurf
|
|||
else
|
||||
return;
|
||||
|
||||
if( (self->spawnflags & TRIGGER_CAMOWNER) && (!other->client || !other->client->spycam))
|
||||
if ( (self->spawnflags & TRIGGER_CAMOWNER) && (!other->client || !other->client->spycam))
|
||||
return;
|
||||
|
||||
if (!VectorCompare(self->movedir, vec3_origin))
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -4,6 +4,7 @@
|
|||
|
||||
#define SF_PLAYBACK_3D 16
|
||||
|
||||
void sentien_laser_off (edict_t *self); // Zaero add
|
||||
|
||||
void G_ProjectSource (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result)
|
||||
{
|
||||
|
@ -159,7 +160,7 @@ edict_t *G_PickTarget (char *targetname)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
ent = G_Find (ent, FOFS(targetname), targetname);
|
||||
if (!ent)
|
||||
|
@ -208,6 +209,8 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
edict_t *master;
|
||||
qboolean done = false;
|
||||
|
||||
if (!ent) // sanity check
|
||||
return;
|
||||
//
|
||||
// check for a delay
|
||||
//
|
||||
|
@ -231,7 +234,7 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
//
|
||||
// print the message
|
||||
//
|
||||
if ((ent->message) && !(activator->svflags & SVF_MONSTER))
|
||||
if ( (ent->message) && (activator) && !(activator->svflags & SVF_MONSTER) )
|
||||
{
|
||||
// Lazarus - change so that noise_index < 0 means no sound
|
||||
gi.centerprintf (activator, "%s", ent->message);
|
||||
|
@ -250,21 +253,24 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
while ((t = G_Find (t, FOFS(targetname), ent->killtarget)))
|
||||
{
|
||||
// Lazarus: remove LIVE killtargeted monsters from total_monsters
|
||||
if((t->svflags & SVF_MONSTER) && (t->deadflag == DEAD_NO))
|
||||
if ( (t->svflags & SVF_MONSTER) && (t->deadflag == DEAD_NO) )
|
||||
{
|
||||
if(!t->dmgteam || strcmp(t->dmgteam,"player"))
|
||||
if(!(t->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
if ( !t->dmgteam || strcmp(t->dmgteam, "player") ) {
|
||||
// if ( !(t->monsterinfo.aiflags & AI_GOOD_GUY) )
|
||||
// Zaero- spawnflag 16 = do not count
|
||||
if ( !(t->monsterinfo.aiflags & AI_GOOD_GUY) && !(t->monsterinfo.monsterflags & MFL_DO_NOT_COUNT) && !(IsZaeroMap() && (t->spawnflags & 16)) )
|
||||
level.total_monsters--;
|
||||
}
|
||||
}
|
||||
// and decrement secret count if target_secret is removed
|
||||
else if(!Q_stricmp(t->classname,"target_secret"))
|
||||
else if ( !Q_stricmp(t->classname, "target_secret") )
|
||||
level.total_secrets--;
|
||||
// same deal with target_goal, but also turn off CD music if applicable
|
||||
else if(!Q_stricmp(t->classname,"target_goal"))
|
||||
else if ( !Q_stricmp(t->classname, "target_goal") )
|
||||
{
|
||||
level.total_goals--;
|
||||
if (level.found_goals >= level.total_goals)
|
||||
gi.configstring (CS_CDTRACK, "0");
|
||||
gi.configstring (CS_CDTRACK, "0");
|
||||
}
|
||||
// PMM - if this entity is part of a train, cleanly remove it
|
||||
else if (t->flags & FL_TEAMSLAVE)
|
||||
|
@ -287,7 +293,7 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Couldn't find myself in master's chain, ignoring!\n");
|
||||
//Knightmare- why the hell didin't Rogue put this here? Ijits.
|
||||
// Knightmare- why the hell didin't Rogue put this here? Ijits.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -299,6 +305,28 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
}
|
||||
}
|
||||
// PMM
|
||||
|
||||
// Zaero- free sentien's laser first!
|
||||
if (Q_stricmp(t->classname, "monster_sentien") == 0)
|
||||
{
|
||||
if (t->flash) {
|
||||
// gi.dprintf ("removing sentien laser before removing sentien.\n");
|
||||
sentien_laser_off (t->flash);
|
||||
G_FreeEdict (t->flash);
|
||||
t->flash = NULL;
|
||||
}
|
||||
}
|
||||
// Also free the Titan's hook
|
||||
if (Q_stricmp(t->classname, "monster_zboss") == 0)
|
||||
{
|
||||
if (t->laser) {
|
||||
// gi.dprintf ("removing titan hook before removing titan.\n");
|
||||
G_FreeEdict (t->laser);
|
||||
t->laser = NULL;
|
||||
}
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
G_FreeEdict (t);
|
||||
if (!ent->inuse)
|
||||
{
|
||||
|
@ -599,8 +627,8 @@ void G_InitEdict (edict_t *e)
|
|||
// since freetime = nextthink - 0.1
|
||||
if (e->nextthink)
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("G_SPAWN: Fixed bad nextthink time\n");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("G_SPAWN: Fixed bad nextthink time\n");
|
||||
e->nextthink = 0;
|
||||
}
|
||||
// ROGUE
|
||||
|
@ -813,15 +841,57 @@ qboolean KillBox (edict_t *ent)
|
|||
return true; // all clear
|
||||
}
|
||||
|
||||
|
||||
// Zaero add
|
||||
/*
|
||||
=================
|
||||
MonsterPlayerKillBox
|
||||
|
||||
Kills all entities except players that would touch the proposed new
|
||||
positioning of ent. Ent should be unlinked before calling this!
|
||||
=================
|
||||
*/
|
||||
qboolean MonsterPlayerKillBox (edict_t *ent)
|
||||
{
|
||||
trace_t tr;
|
||||
|
||||
while (1)
|
||||
{
|
||||
tr = gi.trace (ent->s.origin, ent->mins, ent->maxs, ent->s.origin, ent, MASK_PLAYERSOLID);
|
||||
if (!tr.ent)
|
||||
break;
|
||||
|
||||
if ((ent->svflags & SVF_MONSTER) && tr.ent->client && tr.ent->health)
|
||||
{
|
||||
// nail myself
|
||||
T_Damage (ent, ent, ent, vec3_origin, ent->s.origin, vec3_origin, 100000, 0, DAMAGE_NO_PROTECTION, MOD_TELEFRAG);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// nail it
|
||||
T_Damage (tr.ent, ent, ent, vec3_origin, ent->s.origin, vec3_origin, 100000, 0, DAMAGE_NO_PROTECTION, MOD_TELEFRAG);
|
||||
}
|
||||
|
||||
// if we didn't kill it, fail
|
||||
if (tr.ent->solid)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true; // all clear
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
|
||||
void AnglesNormalize(vec3_t vec)
|
||||
{
|
||||
while(vec[0] > 180)
|
||||
while (vec[0] > 180)
|
||||
vec[0] -= 360;
|
||||
while(vec[0] < -180)
|
||||
while (vec[0] < -180)
|
||||
vec[0] += 360;
|
||||
while(vec[1] > 360)
|
||||
while (vec[1] > 360)
|
||||
vec[1] -= 360;
|
||||
while(vec[1] < 0)
|
||||
while (vec[1] < 0)
|
||||
vec[1] += 360;
|
||||
}
|
||||
|
||||
|
@ -865,7 +935,7 @@ float AtLeast(float x, float dx)
|
|||
float xx;
|
||||
|
||||
xx = (float)(floor(x/dx - 0.5)+1.)*dx;
|
||||
if(xx < x) xx += dx;
|
||||
if (xx < x) xx += dx;
|
||||
return xx;
|
||||
}
|
||||
|
||||
|
@ -880,20 +950,20 @@ edict_t *LookingAt(edict_t *ent, int filter, vec3_t endpos, float *range)
|
|||
vec3_t dir, entp, mins, maxs;
|
||||
int i, num;
|
||||
|
||||
if(!ent->client)
|
||||
if (!ent->client)
|
||||
{
|
||||
if(endpos) VectorClear(endpos);
|
||||
if(range) *range = 0;
|
||||
if (endpos) VectorClear(endpos);
|
||||
if (range) *range = 0;
|
||||
return NULL;
|
||||
}
|
||||
VectorClear(end);
|
||||
if(ent->client->chasetoggle)
|
||||
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)
|
||||
else if (ent->client->spycam)
|
||||
{
|
||||
AngleVectors(ent->client->ps.viewangles, forward, NULL, NULL);
|
||||
VectorCopy(ent->s.origin,start);
|
||||
|
@ -927,15 +997,15 @@ edict_t *LookingAt(edict_t *ent, int filter, vec3_t endpos, float *range)
|
|||
VectorSubtract(who->s.origin,start,dir);
|
||||
r = VectorLength(dir);
|
||||
VectorMA(start, r, forward, entp);
|
||||
if(entp[0] < who->s.origin[0] - 17) continue;
|
||||
if(entp[1] < who->s.origin[1] - 17) continue;
|
||||
if(entp[2] < who->s.origin[2] - 17) continue;
|
||||
if(entp[0] > who->s.origin[0] + 17) continue;
|
||||
if(entp[1] > who->s.origin[1] + 17) continue;
|
||||
if(entp[2] > who->s.origin[2] + 17) continue;
|
||||
if(endpos)
|
||||
if (entp[0] < who->s.origin[0] - 17) continue;
|
||||
if (entp[1] < who->s.origin[1] - 17) continue;
|
||||
if (entp[2] < who->s.origin[2] - 17) continue;
|
||||
if (entp[0] > who->s.origin[0] + 17) continue;
|
||||
if (entp[1] > who->s.origin[1] + 17) continue;
|
||||
if (entp[2] > who->s.origin[2] + 17) continue;
|
||||
if (endpos)
|
||||
VectorCopy(who->s.origin,endpos);
|
||||
if(range)
|
||||
if (range)
|
||||
*range = r;
|
||||
return who;
|
||||
}
|
||||
|
@ -947,37 +1017,37 @@ edict_t *LookingAt(edict_t *ent, int filter, vec3_t endpos, float *range)
|
|||
gi.sound (ent, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
|
||||
return NULL;
|
||||
}
|
||||
if(!tr.ent)
|
||||
if (!tr.ent)
|
||||
{
|
||||
// no hit
|
||||
gi.sound (ent, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
|
||||
return NULL;
|
||||
}
|
||||
if(!tr.ent->classname)
|
||||
if (!tr.ent->classname)
|
||||
{
|
||||
// should never happen
|
||||
gi.sound (ent, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((strstr(tr.ent->classname,"func_") != NULL) && (filter & LOOKAT_NOBRUSHMODELS))
|
||||
if ((strstr(tr.ent->classname,"func_") != NULL) && (filter & LOOKAT_NOBRUSHMODELS))
|
||||
{
|
||||
// don't hit on brush models
|
||||
gi.sound (ent, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
|
||||
return NULL;
|
||||
}
|
||||
if((Q_stricmp(tr.ent->classname,"worldspawn") == 0) && (filter & LOOKAT_NOWORLD))
|
||||
if ((Q_stricmp(tr.ent->classname,"worldspawn") == 0) && (filter & LOOKAT_NOWORLD))
|
||||
{
|
||||
// world brush
|
||||
gi.sound (ent, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
|
||||
return NULL;
|
||||
}
|
||||
if(endpos) {
|
||||
if (endpos) {
|
||||
endpos[0] = tr.endpos[0];
|
||||
endpos[1] = tr.endpos[1];
|
||||
endpos[2] = tr.endpos[2];
|
||||
}
|
||||
if(range) {
|
||||
if (range) {
|
||||
VectorSubtract(tr.endpos,start,start);
|
||||
*range = VectorLength(start);
|
||||
}
|
||||
|
@ -1098,10 +1168,10 @@ void G_UseTarget (edict_t *ent, edict_t *activator, edict_t *target)
|
|||
while ((t = G_Find (t, FOFS(targetname), ent->killtarget)))
|
||||
{
|
||||
// Lazarus: remove killtargeted monsters from total_monsters
|
||||
if(t->svflags & SVF_MONSTER)
|
||||
if (t->svflags & SVF_MONSTER)
|
||||
{
|
||||
if(!t->dmgteam || strcmp(t->dmgteam,"player"))
|
||||
if(!(t->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
if (!t->dmgteam || strcmp(t->dmgteam,"player"))
|
||||
if (!(t->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
level.total_monsters--;
|
||||
}
|
||||
G_FreeEdict (t);
|
||||
|
@ -1397,6 +1467,50 @@ qboolean IsRogueMap (void)
|
|||
}
|
||||
|
||||
|
||||
|
||||
// Knightmare added
|
||||
/*
|
||||
====================
|
||||
IsZaeroMap
|
||||
|
||||
Checks if the current map is from the Zaero mission pack.
|
||||
This is used for certain hacks.
|
||||
====================
|
||||
*/
|
||||
qboolean IsZaeroMap (void)
|
||||
{
|
||||
if (Q_stricmp(level.mapname, "zbase1") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zbase2") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zboss") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zdef1") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zdef2") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zdef3") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zdef4") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "ztomb1") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "ztomb2") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "ztomb3") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "ztomb4") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zwaste1") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zwaste2") == 0)
|
||||
return true;
|
||||
if (Q_stricmp(level.mapname, "zwaste3") == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
====================
|
||||
CheckCoop_MapHacks
|
||||
|
@ -1458,6 +1572,7 @@ qboolean UseSpecialGoodGuyFlag (edict_t *monster)
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Knightmare added
|
||||
/*
|
||||
====================
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -142,6 +142,47 @@ cvar_t *sk_shockwave_speed;
|
|||
cvar_t *sk_shockwave_effect_damage;
|
||||
cvar_t *sk_shockwave_effect_radius;
|
||||
|
||||
cvar_t *sk_plasma_rifle_damage_bounce;
|
||||
cvar_t *sk_plasma_rifle_damage_bounce_dm;
|
||||
cvar_t *sk_plasma_rifle_damage_spread;
|
||||
cvar_t *sk_plasma_rifle_damage_spread_dm;
|
||||
cvar_t *sk_plasma_rifle_speed_bounce;
|
||||
cvar_t *sk_plasma_rifle_speed_spread;
|
||||
cvar_t *sk_plasma_rifle_radius;
|
||||
|
||||
cvar_t *sk_flaregun_damage;
|
||||
cvar_t *sk_flaregun_rdamage;
|
||||
cvar_t *sk_flaregun_radius;
|
||||
cvar_t *sk_flaregun_speed;
|
||||
cvar_t *sk_flare_life;
|
||||
|
||||
cvar_t *sk_tbomb_damage;
|
||||
cvar_t *sk_tbomb_radius;
|
||||
cvar_t *sk_tbomb_shrapnel;
|
||||
cvar_t *sk_tbomb_shrapnel_damage;
|
||||
cvar_t *sk_tbomb_life;
|
||||
cvar_t *sk_tbomb_health;
|
||||
/*
|
||||
cvar_t *sk_sniperrifle_damage;
|
||||
cvar_t *sk_sniperrifle_damage_dm;
|
||||
cvar_t *sk_sniperrifle_kick;
|
||||
cvar_t *sk_sniperrifle_kick_dm;
|
||||
|
||||
cvar_t *sk_soniccannon_damage;
|
||||
cvar_t *sk_soniccannon_damage2;
|
||||
cvar_t *sk_soniccannon_radius;
|
||||
cvar_t *sk_soniccannon_maxfiretime;
|
||||
cvar_t *sk_soniccannon_maxcells;
|
||||
*/
|
||||
cvar_t *sk_empnuke_radius;
|
||||
/*
|
||||
cvar_t *sk_a2k_damage;
|
||||
cvar_t *sk_a2k_radius;
|
||||
*/
|
||||
cvar_t *sk_plasmashield_health;
|
||||
cvar_t *sk_plasmashield_life;
|
||||
|
||||
|
||||
// DM start values
|
||||
cvar_t *sk_dm_start_shells;
|
||||
cvar_t *sk_dm_start_bullets;
|
||||
|
@ -157,12 +198,10 @@ cvar_t *sk_dm_start_rounds;
|
|||
cvar_t *sk_dm_start_prox;
|
||||
cvar_t *sk_dm_start_tesla;
|
||||
cvar_t *sk_dm_start_shocksphere;
|
||||
/*
|
||||
cvar_t *sk_dm_start_flares;
|
||||
cvar_t *sk_dm_start_tbombs;
|
||||
cvar_t *sk_dm_start_empnuke;
|
||||
cvar_t *sk_dm_start_plasmashield;
|
||||
*/
|
||||
|
||||
cvar_t *sk_dm_start_shotgun;
|
||||
cvar_t *sk_dm_start_sshotgun;
|
||||
|
@ -181,6 +220,10 @@ cvar_t *sk_dm_start_plasmabeam;
|
|||
cvar_t *sk_dm_start_disruptor;
|
||||
cvar_t *sk_dm_start_chainfist;
|
||||
cvar_t *sk_dm_start_shockwave;
|
||||
cvar_t *sk_dm_start_plasmarifle;
|
||||
cvar_t *sk_dm_start_flaregun;
|
||||
//cvar_t *sk_dm_start_sniperrifle;
|
||||
//cvar_t *sk_dm_start_soniccannon;
|
||||
|
||||
// maximum values
|
||||
cvar_t *sk_max_health;
|
||||
|
@ -203,12 +246,11 @@ cvar_t *sk_max_flechettes;
|
|||
cvar_t *sk_max_rounds;
|
||||
cvar_t *sk_max_shocksphere;
|
||||
cvar_t *sk_max_fuel;
|
||||
/*
|
||||
cvar_t *sk_max_flares;
|
||||
cvar_t *sk_max_tbombs;
|
||||
cvar_t *sk_max_empnuke;
|
||||
cvar_t *sk_max_plasmashield;
|
||||
*/
|
||||
//cvar_t *sk_max_a2k;
|
||||
|
||||
// maximum settings if a player gets a bandolier
|
||||
cvar_t *sk_bando_bullets; // 300
|
||||
|
@ -219,7 +261,7 @@ cvar_t *sk_bando_magslugs;
|
|||
cvar_t *sk_bando_flechettes; // 250
|
||||
cvar_t *sk_bando_rounds; // 150
|
||||
cvar_t *sk_bando_fuel;
|
||||
//cvar_t *sk_bando_flares; // 45
|
||||
cvar_t *sk_bando_flares; // 50
|
||||
|
||||
// maximum settings if a player gets a pack
|
||||
cvar_t *sk_pack_health;
|
||||
|
@ -238,15 +280,15 @@ cvar_t *sk_pack_prox;
|
|||
cvar_t *sk_pack_tesla;
|
||||
cvar_t *sk_pack_shocksphere;
|
||||
cvar_t *sk_pack_fuel;
|
||||
/*
|
||||
cvar_t *sk_pack_flares; // 60
|
||||
cvar_t *sk_pack_tbombs; // 100
|
||||
cvar_t *sk_pack_empnuke; // 100
|
||||
cvar_t *sk_pack_plasmashield; // 40
|
||||
*/
|
||||
//cvar_t *sk_pack_a2k; // 1
|
||||
|
||||
cvar_t *sk_pack_give_xatrix_ammo;
|
||||
cvar_t *sk_pack_give_rogue_ammo;
|
||||
//cvar_t *sk_pack_give_zaero_ammo;
|
||||
cvar_t *sk_pack_give_zaero_ammo;
|
||||
|
||||
// pickup values
|
||||
cvar_t *sk_box_shells; // value of shells
|
||||
|
@ -263,12 +305,10 @@ cvar_t *sk_box_disruptors; // value of disruptor pack
|
|||
cvar_t *sk_box_shocksphere; // value of shocksphere
|
||||
cvar_t *sk_box_trap; // value of trap
|
||||
cvar_t *sk_box_fuel; // value of fuel
|
||||
/*
|
||||
cvar_t *sk_box_flares; // value of flares box
|
||||
cvar_t *sk_box_tbombs; // value of IRED box
|
||||
cvar_t *sk_box_empnuke; // value of EMP nuke
|
||||
cvar_t *sk_box_plasmashield; // value of plasma shield
|
||||
*/
|
||||
|
||||
// items/powerups
|
||||
cvar_t *sk_armor_bonus_value; // value of armor shards
|
||||
|
@ -293,7 +333,9 @@ cvar_t *sk_ir_time;
|
|||
cvar_t *sk_double_time;
|
||||
cvar_t *sk_quad_fire_time;
|
||||
cvar_t *sk_stasis_time;
|
||||
//cvar_t *sk_visor_time;
|
||||
cvar_t *sk_visor_time;
|
||||
//cvar_t *sk_sniper_charge_time;
|
||||
//cvar_t *sk_a2k_detonate_time;
|
||||
|
||||
|
||||
void InitLithiumVars (void)
|
||||
|
@ -435,6 +477,46 @@ void InitLithiumVars (void)
|
|||
sk_shockwave_effect_damage = gi.cvar("sk_shockwave_effect_damage", "100", 0);
|
||||
sk_shockwave_effect_radius = gi.cvar("sk_shockwave_effect_radius", "340", 0);
|
||||
|
||||
sk_plasma_rifle_damage_bounce = gi.cvar("sk_plasma_rifle_damage_bounce", "60", 0);
|
||||
sk_plasma_rifle_damage_bounce_dm = gi.cvar("sk_plasma_rifle_damage_bounce_dm", "39", 0);
|
||||
sk_plasma_rifle_damage_spread = gi.cvar("sk_plasma_rifle_damage_spread", "43", 0);
|
||||
sk_plasma_rifle_damage_spread_dm = gi.cvar("sk_plasma_rifle_damage_spread_dm", "28", 0);
|
||||
sk_plasma_rifle_speed_bounce = gi.cvar("sk_plasma_rifle_speed_bounce", "1200", 0);
|
||||
sk_plasma_rifle_speed_spread = gi.cvar("sk_plasma_rifle_speed_spread", "1200", 0);
|
||||
sk_plasma_rifle_radius = gi.cvar("sk_plasma_rifle_radius", "70", 0);
|
||||
|
||||
sk_flaregun_damage = gi.cvar("sk_flaregun_damage", "1", 0);
|
||||
sk_flaregun_rdamage = gi.cvar("sk_flaregun_rdamage", "1", 0);
|
||||
sk_flaregun_radius = gi.cvar("sk_flaregun_radius", "1", 0);
|
||||
sk_flaregun_speed = gi.cvar("sk_flaregun_speed", "600", 0);
|
||||
sk_flare_life = gi.cvar("sk_flare_life", "12", 0);
|
||||
|
||||
sk_tbomb_damage = gi.cvar("sk_tbomb_damage", "150", 0);
|
||||
sk_tbomb_radius = gi.cvar("sk_tbomb_radius", "384", 0);
|
||||
sk_tbomb_shrapnel = gi.cvar("sk_tbomb_shrapnel", "5", 0);
|
||||
sk_tbomb_shrapnel_damage = gi.cvar("sk_tbomb_shrapnel_damage", "15", 0);
|
||||
sk_tbomb_life = gi.cvar("sk_tbomb_life", "180", 0);
|
||||
sk_tbomb_health = gi.cvar("sk_tbomb_health", "30", 0);
|
||||
/*
|
||||
sk_sniperrifle_damage = gi.cvar("sk_sniperrifle_damage", "250", 0);
|
||||
sk_sniperrifle_damage_dm = gi.cvar("sk_sniperrifle_damage_dm", "150", 0);
|
||||
sk_sniperrifle_kick = gi.cvar("sk_sniperrifle_kick", "400", 0);
|
||||
sk_sniperrifle_kick_dm = gi.cvar("sk_sniperrifle_kick_dm", "300", 0);
|
||||
|
||||
sk_soniccannon_damage = gi.cvar("sk_soniccannon_damage", "10", 0);
|
||||
sk_soniccannon_damage2 = gi.cvar("sk_soniccannon_damage2", "990", 0);
|
||||
sk_soniccannon_radius = gi.cvar("sk_soniccannon_radius", "500", 0);
|
||||
sk_soniccannon_maxfiretime = gi.cvar("sk_soniccannon_maxfiretime", "5", 0);
|
||||
sk_soniccannon_maxcells = gi.cvar("sk_soniccannon_maxcells", "100", 0);
|
||||
*/
|
||||
sk_empnuke_radius = gi.cvar("sk_empnuke_radius", "1024", 0);
|
||||
/*
|
||||
sk_a2k_damage = gi.cvar("sk_a2k_damage", "2500", 0);
|
||||
sk_a2k_radius = gi.cvar("sk_a2k_radius", "512", 0);
|
||||
*/
|
||||
sk_plasmashield_health = gi.cvar("sk_plasmashield_health", "4000", 0);
|
||||
sk_plasmashield_life = gi.cvar("sk_plasmashield_life", "10", 0);
|
||||
|
||||
// DM start values
|
||||
sk_dm_start_shells = gi.cvar("sk_dm_start_shells", "0", 0);
|
||||
sk_dm_start_bullets = gi.cvar("sk_dm_start_bullets", "0", 0);
|
||||
|
@ -450,12 +532,10 @@ void InitLithiumVars (void)
|
|||
sk_dm_start_prox = gi.cvar("sk_dm_start_prox", "0", 0);
|
||||
sk_dm_start_tesla = gi.cvar("sk_dm_start_tesla", "0", 0);
|
||||
sk_dm_start_shocksphere = gi.cvar("sk_dm_start_shocksphere", "0", 0);
|
||||
/*
|
||||
sk_dm_start_flares = gi.cvar("sk_dm_start_flares", "0", 0);
|
||||
sk_dm_start_tbombs = gi.cvar("sk_dm_start_tbombs", "0", 0);
|
||||
sk_dm_start_empnuke = gi.cvar("sk_dm_start_empnuke", "0", 0);
|
||||
sk_dm_start_plasmashield = gi.cvar("sk_dm_start_plasmashield", "0", 0);
|
||||
*/
|
||||
|
||||
sk_dm_start_shotgun = gi.cvar("sk_dm_start_shotgun", "0", 0);
|
||||
sk_dm_start_sshotgun = gi.cvar("sk_dm_start_sshotgun", "0", 0);
|
||||
|
@ -474,6 +554,10 @@ void InitLithiumVars (void)
|
|||
sk_dm_start_disruptor = gi.cvar("sk_dm_start_disruptor", "0", 0);
|
||||
sk_dm_start_chainfist = gi.cvar("sk_dm_start_chainfist", "0", 0);
|
||||
sk_dm_start_shockwave = gi.cvar("sk_dm_start_shockwave", "0", 0);
|
||||
sk_dm_start_plasmarifle = gi.cvar("sk_dm_start_plasmarifle", "0", 0);
|
||||
sk_dm_start_flaregun = gi.cvar("sk_dm_start_flaregun", "0", 0);
|
||||
// sk_dm_start_sniperrifle = gi.cvar("sk_dm_start_sniperrifle", "0", 0);
|
||||
// sk_dm_start_soniccannon = gi.cvar("sk_dm_start_soniccannon", "0", 0);
|
||||
|
||||
// maximum values
|
||||
sk_max_health = gi.cvar("sk_max_health", "100", 0);
|
||||
|
@ -496,12 +580,11 @@ void InitLithiumVars (void)
|
|||
sk_max_rounds = gi.cvar("sk_max_rounds", "100", 0);
|
||||
sk_max_shocksphere = gi.cvar("sk_max_shocksphere", "10", 0);
|
||||
sk_max_fuel = gi.cvar("sk_max_fuel", "1000", 0);
|
||||
/*
|
||||
sk_max_flares = gi.cvar("sk_max_flares", "30", 0);
|
||||
sk_max_tbombs = gi.cvar("sk_max_tbombs", "30", 0);
|
||||
sk_max_empnuke = gi.cvar("sk_max_empnuke", "50", 0);
|
||||
sk_max_plasmashield = gi.cvar("sk_max_plasmashield", "20", 0);
|
||||
*/
|
||||
// sk_max_a2k = gi.cvar("sk_max_a2k", "1", 0);
|
||||
|
||||
// maximum settings if a player gets a bandolier
|
||||
sk_bando_bullets = gi.cvar("sk_bando_bullets", "250", 0);
|
||||
|
@ -512,7 +595,7 @@ void InitLithiumVars (void)
|
|||
sk_bando_flechettes = gi.cvar("sk_bando_flechettes", "250", 0);
|
||||
sk_bando_rounds = gi.cvar("sk_bando_rounds", "150", 0);
|
||||
sk_bando_fuel = gi.cvar("sk_bando_fuel", "1500", 0);
|
||||
// sk_bando_flares = gi.cvar("sk_bando_flares", "50", 0);
|
||||
sk_bando_flares = gi.cvar("sk_bando_flares", "45", 0);
|
||||
|
||||
// maximum settings if a player gets a pack
|
||||
sk_pack_health = gi.cvar("sk_pack_health", "120", 0);
|
||||
|
@ -531,16 +614,15 @@ void InitLithiumVars (void)
|
|||
sk_pack_tesla = gi.cvar("sk_pack_tesla", "100", 0);
|
||||
sk_pack_shocksphere = gi.cvar("sk_pack_shocksphere", "20", 0);
|
||||
sk_pack_fuel = gi.cvar("sk_pack_fuel", "2000", 0);
|
||||
/*
|
||||
sk_pack_flares = gi.cvar("sk_pack_flares", "100", 0);
|
||||
sk_pack_flares = gi.cvar("sk_pack_flares", "60", 0);
|
||||
sk_pack_tbombs = gi.cvar("sk_pack_tbombs", "100", 0);
|
||||
sk_pack_empnuke = gi.cvar("sk_pack_empnuke", "100", 0);
|
||||
sk_pack_plasmashield = gi.cvar("sk_pack_plasmashield", "40", 0);
|
||||
*/
|
||||
// sk_pack_a2k = gi.cvar("sk_pack_a2k", "1", 0);
|
||||
|
||||
sk_pack_give_xatrix_ammo = gi.cvar("sk_pack_give_xatrix_ammo", "0", CVAR_ARCHIVE);
|
||||
sk_pack_give_rogue_ammo = gi.cvar("sk_pack_give_rogue_ammo", "0", CVAR_ARCHIVE);
|
||||
// sk_pack_give_zaero_ammo = gi.cvar("sk_pack_give_zaero_ammo", "0", CVAR_ARCHIVE);
|
||||
sk_pack_give_zaero_ammo = gi.cvar("sk_pack_give_zaero_ammo", "0", CVAR_ARCHIVE);
|
||||
|
||||
// pickup values
|
||||
sk_box_shells = gi.cvar("sk_box_shells", "10", 0);
|
||||
|
@ -557,12 +639,10 @@ void InitLithiumVars (void)
|
|||
sk_box_shocksphere = gi.cvar("sk_box_shocksphere", "1", 0);
|
||||
sk_box_trap = gi.cvar("sk_box_trap", "1", 0);
|
||||
sk_box_fuel = gi.cvar("sk_box_fuel", "500", 0);
|
||||
/*
|
||||
sk_box_flares = gi.cvar("sk_box_flares", "3", 0);
|
||||
sk_box_tbombs = gi.cvar("sk_box_tbombs", "3", 0);
|
||||
sk_box_empnuke = gi.cvar("sk_box_empnuke", "1", 0);
|
||||
sk_box_plasmashield = gi.cvar("sk_box_plasmashield", "1", 0);
|
||||
*/
|
||||
sk_box_plasmashield = gi.cvar("sk_box_plasmashield", "5", 0);
|
||||
|
||||
// items/powerups
|
||||
sk_armor_bonus_value = gi.cvar("sk_armor_bonus_value", "2", 0);
|
||||
|
@ -587,5 +667,7 @@ void InitLithiumVars (void)
|
|||
sk_double_time = gi.cvar("sk_double_time", "30", 0);
|
||||
sk_quad_fire_time = gi.cvar("sk_quad_fire_time", "30", 0);
|
||||
sk_stasis_time = gi.cvar("sk_stasis_time", "30", 0);
|
||||
// sk_visor_time = gi.cvar("sk_visor_time", "30", 0);
|
||||
sk_visor_time = gi.cvar("sk_visor_time", "30", 0);
|
||||
// sk_sniper_charge_time = gi.cvar("sk_sniper_charge_time", "3", 0);
|
||||
// sk_a2k_detonate_time = gi.cvar("sk_a2k_detonate_time", "5", 0);
|
||||
}
|
||||
|
|
|
@ -138,6 +138,48 @@ extern cvar_t *sk_shockwave_radius;
|
|||
extern cvar_t *sk_shockwave_effect_damage;
|
||||
extern cvar_t *sk_shockwave_effect_radius;
|
||||
|
||||
extern cvar_t *sk_plasma_rifle_damage_bounce;
|
||||
extern cvar_t *sk_plasma_rifle_damage_bounce_dm;
|
||||
extern cvar_t *sk_plasma_rifle_damage_spread;
|
||||
extern cvar_t *sk_plasma_rifle_damage_spread_dm;
|
||||
extern cvar_t *sk_plasma_rifle_speed_bounce;
|
||||
extern cvar_t *sk_plasma_rifle_speed_spread;
|
||||
extern cvar_t *sk_plasma_rifle_radius;
|
||||
|
||||
extern cvar_t *sk_flaregun_damage;
|
||||
extern cvar_t *sk_flaregun_rdamage;
|
||||
extern cvar_t *sk_flaregun_radius;
|
||||
extern cvar_t *sk_flaregun_speed;
|
||||
extern cvar_t *sk_flare_life;
|
||||
|
||||
extern cvar_t *sk_tbomb_damage;
|
||||
extern cvar_t *sk_tbomb_radius;
|
||||
extern cvar_t *sk_tbomb_shrapnel;
|
||||
extern cvar_t *sk_tbomb_shrapnel_damage;
|
||||
extern cvar_t *sk_tbomb_life;
|
||||
extern cvar_t *sk_tbomb_health;
|
||||
|
||||
/*
|
||||
extern cvar_t *sk_sniperrifle_damage;
|
||||
extern cvar_t *sk_sniperrifle_damage_dm;
|
||||
extern cvar_t *sk_sniperrifle_kick;
|
||||
extern cvar_t *sk_sniperrifle_kick_dm;
|
||||
|
||||
extern cvar_t *sk_soniccannon_damage;
|
||||
extern cvar_t *sk_soniccannon_damage2;
|
||||
extern cvar_t *sk_soniccannon_radius;
|
||||
extern cvar_t *sk_soniccannon_maxfiretime;
|
||||
extern cvar_t *sk_soniccannon_maxcells;
|
||||
*/
|
||||
extern cvar_t *sk_empnuke_radius;
|
||||
/*
|
||||
extern cvar_t *sk_a2k_damage;
|
||||
extern cvar_t *sk_a2k_radius;
|
||||
*/
|
||||
extern cvar_t *sk_plasmashield_health;
|
||||
extern cvar_t *sk_plasmashield_life;
|
||||
|
||||
|
||||
// DM start values
|
||||
extern cvar_t *sk_dm_start_shells;
|
||||
extern cvar_t *sk_dm_start_bullets;
|
||||
|
@ -153,12 +195,10 @@ extern cvar_t *sk_dm_start_rounds;
|
|||
extern cvar_t *sk_dm_start_prox;
|
||||
extern cvar_t *sk_dm_start_tesla;
|
||||
extern cvar_t *sk_dm_start_shocksphere;
|
||||
/*
|
||||
extern cvar_t *sk_dm_start_flares;
|
||||
extern cvar_t *sk_dm_start_tbombs;
|
||||
extern cvar_t *sk_dm_start_empnuke;
|
||||
extern cvar_t *sk_dm_start_plasmashield;
|
||||
*/
|
||||
|
||||
extern cvar_t *sk_dm_start_shotgun;
|
||||
extern cvar_t *sk_dm_start_sshotgun;
|
||||
|
@ -177,6 +217,10 @@ extern cvar_t *sk_dm_start_plasmabeam;
|
|||
extern cvar_t *sk_dm_start_disruptor;
|
||||
extern cvar_t *sk_dm_start_chainfist;
|
||||
extern cvar_t *sk_dm_start_shockwave;
|
||||
extern cvar_t *sk_dm_start_plasmarifle;
|
||||
extern cvar_t *sk_dm_start_flaregun;
|
||||
//extern cvar_t *sk_dm_start_sniperrifle;
|
||||
//extern cvar_t *sk_dm_start_soniccannon;
|
||||
|
||||
// maximum values
|
||||
extern cvar_t *sk_max_health;
|
||||
|
@ -200,12 +244,11 @@ extern cvar_t *sk_max_prox;
|
|||
extern cvar_t *sk_max_tesla;
|
||||
extern cvar_t *sk_max_shocksphere;
|
||||
extern cvar_t *sk_max_fuel;
|
||||
/*
|
||||
extern cvar_t *sk_max_flares;
|
||||
extern cvar_t *sk_max_tbombs;
|
||||
extern cvar_t *sk_max_empnuke;
|
||||
extern cvar_t *sk_max_plasmashield;
|
||||
*/
|
||||
//extern cvar_t *sk_max_a2k;
|
||||
|
||||
// maximum settings if a player gets a bandolier
|
||||
extern cvar_t *sk_bando_bullets;
|
||||
|
@ -216,7 +259,7 @@ extern cvar_t *sk_bando_magslugs;
|
|||
extern cvar_t *sk_bando_flechettes;
|
||||
extern cvar_t *sk_bando_rounds;
|
||||
extern cvar_t *sk_bando_fuel;
|
||||
//extern cvar_t *sk_bando_flares;
|
||||
extern cvar_t *sk_bando_flares;
|
||||
|
||||
// maximum settings if a player gets a pack
|
||||
extern cvar_t *sk_pack_bullets;
|
||||
|
@ -233,38 +276,35 @@ extern cvar_t *sk_pack_prox;
|
|||
extern cvar_t *sk_pack_tesla;
|
||||
extern cvar_t *sk_pack_shocksphere;
|
||||
extern cvar_t *sk_pack_fuel;
|
||||
/*
|
||||
extern cvar_t *sk_pack_flares;
|
||||
extern cvar_t *sk_pack_tbombs;
|
||||
extern cvar_t *sk_pack_empnuke;
|
||||
extern cvar_t *sk_pack_plasmashield;
|
||||
*/
|
||||
//extern cvar_t *sk_pack_a2k;
|
||||
|
||||
extern cvar_t *sk_pack_give_xatrix_ammo;
|
||||
extern cvar_t *sk_pack_give_rogue_ammo;
|
||||
//extern cvar_t *sk_pack_give_zaero_ammo;
|
||||
extern cvar_t *sk_pack_give_zaero_ammo;
|
||||
|
||||
// pickup values
|
||||
extern cvar_t *sk_box_shells; //value of shells
|
||||
extern cvar_t *sk_box_bullets; //value of bullets
|
||||
extern cvar_t *sk_box_grenades; //value of grenade pack
|
||||
extern cvar_t *sk_box_rockets; //value of rocket pack
|
||||
extern cvar_t *sk_box_cells; //value of cell pack
|
||||
extern cvar_t *sk_box_slugs; //value of slug box
|
||||
extern cvar_t *sk_box_magslugs; //value ofmagslug box
|
||||
extern cvar_t *sk_box_flechettes; //value of flechettes
|
||||
extern cvar_t *sk_box_prox; //value of prox
|
||||
extern cvar_t *sk_box_tesla; //value of tesla pack
|
||||
extern cvar_t *sk_box_disruptors; //value of disruptor pack
|
||||
extern cvar_t *sk_box_shocksphere; //value of shocksphere
|
||||
extern cvar_t *sk_box_trap; //value of trap
|
||||
extern cvar_t *sk_box_fuel; //value of fuel
|
||||
/*
|
||||
extern cvar_t *sk_box_flares;
|
||||
extern cvar_t *sk_box_tbombs;
|
||||
extern cvar_t *sk_box_empnuke;
|
||||
extern cvar_t *sk_box_plasmashield;
|
||||
*/
|
||||
extern cvar_t *sk_box_shells; // value of shells
|
||||
extern cvar_t *sk_box_bullets; // value of bullets
|
||||
extern cvar_t *sk_box_grenades; // value of grenade pack
|
||||
extern cvar_t *sk_box_rockets; // value of rocket pack
|
||||
extern cvar_t *sk_box_cells; // value of cell pack
|
||||
extern cvar_t *sk_box_slugs; // value of slug box
|
||||
extern cvar_t *sk_box_magslugs; // value ofmagslug box
|
||||
extern cvar_t *sk_box_flechettes; // value of flechettes
|
||||
extern cvar_t *sk_box_prox; // value of prox
|
||||
extern cvar_t *sk_box_tesla; // value of tesla pack
|
||||
extern cvar_t *sk_box_disruptors; // value of disruptor pack
|
||||
extern cvar_t *sk_box_shocksphere; // value of shocksphere
|
||||
extern cvar_t *sk_box_trap; // value of trap
|
||||
extern cvar_t *sk_box_fuel; // value of fuel
|
||||
extern cvar_t *sk_box_flares; // value of flares box
|
||||
extern cvar_t *sk_box_tbombs; // value of IRED box
|
||||
extern cvar_t *sk_box_empnuke; // value of EMP nuke
|
||||
extern cvar_t *sk_box_plasmashield; // value of plasma shield
|
||||
|
||||
// items/powerups
|
||||
extern cvar_t *sk_armor_bonus_value; //value of armor shards
|
||||
|
@ -289,4 +329,6 @@ extern cvar_t *sk_double_time;
|
|||
extern cvar_t *sk_quad_fire_time;
|
||||
extern cvar_t *sk_doppleganger_time;
|
||||
extern cvar_t *sk_stasis_time;
|
||||
//extern cvar_t *sk_visor_time;
|
||||
extern cvar_t *sk_visor_time;
|
||||
//extern cvar_t *sk_sniper_charge_time;
|
||||
//extern cvar_t *sk_a2k_detonate_time;
|
||||
|
|
|
@ -271,6 +271,14 @@ void boss2_firebullet_right (edict_t *self)
|
|||
VectorSubtract (target, start, forward);
|
||||
VectorNormalize (forward);
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD*3, DEFAULT_BULLET_VSPREAD, MZ2_BOSS2_MACHINEGUN_R1);
|
||||
// monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_BOSS2_MACHINEGUN_R1);
|
||||
}
|
||||
|
@ -298,6 +306,14 @@ void boss2_firebullet_left (edict_t *self)
|
|||
VectorSubtract (target, start, forward);
|
||||
VectorNormalize (forward);
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD*3, DEFAULT_BULLET_VSPREAD, MZ2_BOSS2_MACHINEGUN_L1);
|
||||
// monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_BOSS2_MACHINEGUN_L1);
|
||||
}
|
||||
|
|
|
@ -471,7 +471,7 @@ void jorgBFG (edict_t *self)
|
|||
vec[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -504,7 +504,7 @@ void jorg_firebullet_right (edict_t *self)
|
|||
target[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
target[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
target[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -514,6 +514,14 @@ void jorg_firebullet_right (edict_t *self)
|
|||
VectorSubtract (target, start, forward);
|
||||
VectorNormalize (forward);
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_JORG_MACHINEGUN_R1);
|
||||
}
|
||||
|
||||
|
@ -529,13 +537,21 @@ void jorg_firebullet_left (edict_t *self)
|
|||
target[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
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);
|
||||
}
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
VectorSubtract (target, start, forward);
|
||||
VectorNormalize (forward);
|
||||
|
||||
|
@ -870,18 +886,18 @@ void SP_monster_jorg (edict_t *self)
|
|||
self->s.origin[2] += 8;
|
||||
|
||||
//Knightmare- gross hack for map6 of COS3- 3000 health
|
||||
if(Q_stricmp(level.mapname, "grinsp3f") == 0)
|
||||
if (Q_stricmp(level.mapname, "grinsp3f") == 0)
|
||||
self->health = 3000;
|
||||
else
|
||||
{
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 3000 + 1000 * (skill->value);
|
||||
}
|
||||
if (coop->value)
|
||||
self->health += 500 * (skill->value);
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -999;
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 1000;
|
||||
|
||||
self->pain = jorg_pain;
|
||||
|
@ -907,7 +923,7 @@ void SP_monster_jorg (edict_t *self)
|
|||
self->monsterinfo.scale = MODEL_SCALE;
|
||||
|
||||
// Lazarus
|
||||
if(self->powerarmor)
|
||||
if (self->powerarmor)
|
||||
{
|
||||
if (self->powerarmortype == 1)
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
|
||||
|
|
|
@ -399,11 +399,19 @@ void makronBFG (edict_t *self)
|
|||
AngleVectors (self->s.angles, forward, right, NULL);
|
||||
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_MAKRON_BFG], forward, right, start);
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
VectorCopy (self->enemy->s.origin, vec);
|
||||
vec[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -499,7 +507,7 @@ void MakronRailgun (edict_t *self)
|
|||
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_MAKRON_RAILGUN_1], forward, right, start);
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
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);
|
||||
|
@ -532,7 +540,7 @@ void MakronHyperblaster (edict_t *self)
|
|||
VectorCopy (self->enemy->s.origin, vec);
|
||||
vec[2] += self->enemy->viewheight;
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -625,7 +633,7 @@ void makron_attack(edict_t *self)
|
|||
range = VectorLength (vec);
|
||||
|
||||
//Knightmare- gross hack for map6 of COS3- no BFG attack
|
||||
if(Q_stricmp(level.mapname, "grinsp3f") == 0)
|
||||
if (Q_stricmp(level.mapname, "grinsp3f") == 0)
|
||||
{
|
||||
if (r <= 0.5)
|
||||
self->monsterinfo.currentmove = &makron_move_attack4;
|
||||
|
@ -862,10 +870,10 @@ void MakronPrecache (void)
|
|||
//PGM
|
||||
qboolean Makron_blocked (edict_t *self, float dist)
|
||||
{
|
||||
if(blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
if (blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
return true;
|
||||
|
||||
if(blocked_checkplat (self, dist))
|
||||
if (blocked_checkplat (self, dist))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -907,13 +915,13 @@ void SP_monster_makron_put (edict_t *self)
|
|||
VectorSet (self->mins, -30, -30, 0);
|
||||
VectorSet (self->maxs, 30, 30, 90);
|
||||
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 3000 + 1000 * (skill->value);
|
||||
if (coop->value)
|
||||
self->health += 500 * (skill->value);
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -800;
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 500;
|
||||
|
||||
self->pain = makron_pain;
|
||||
|
@ -938,7 +946,7 @@ void SP_monster_makron_put (edict_t *self)
|
|||
self->fogclip |= 2; //custom bloodtype flag
|
||||
|
||||
// Lazarus
|
||||
if(self->powerarmor)
|
||||
if (self->powerarmor)
|
||||
{
|
||||
if (self->powerarmortype == 1)
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
|
||||
|
@ -978,7 +986,7 @@ void MakronSpawn (edict_t *self)
|
|||
SP_monster_makron_put (self);
|
||||
|
||||
//Knightmare- gross hack for map6 of COS3- don't jump
|
||||
if(Q_stricmp(level.mapname, "grinsp3f") == 0)
|
||||
if (Q_stricmp(level.mapname, "grinsp3f") == 0)
|
||||
return;
|
||||
// jump at player
|
||||
player = level.sight_client;
|
||||
|
|
|
@ -203,7 +203,7 @@ void CarrierGrenade (edict_t *self)
|
|||
VectorCopy (self->enemy->s.origin, vec);
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -216,9 +216,9 @@ void CarrierGrenade (edict_t *self)
|
|||
VectorMA (aim, spreadR, right, aim);
|
||||
VectorMA (aim, spreadU, up, aim);
|
||||
|
||||
if(aim[2] > 0.15)
|
||||
if (aim[2] > 0.15)
|
||||
aim[2] = 0.15;
|
||||
else if(aim[2] < -0.5)
|
||||
else if (aim[2] < -0.5)
|
||||
aim[2] = -0.5;
|
||||
|
||||
flash_number = MZ2_GUNNER_GRENADE_1;
|
||||
|
@ -272,9 +272,9 @@ void CarrierRocket (edict_t *self)
|
|||
vec3_t dir;
|
||||
vec3_t vec;
|
||||
|
||||
if(self->enemy)
|
||||
if (self->enemy)
|
||||
{
|
||||
if(self->enemy->client && random() < 0.5)
|
||||
if (self->enemy->client && random() < 0.5)
|
||||
{
|
||||
CarrierPredictiveRocket(self);
|
||||
return;
|
||||
|
@ -292,7 +292,7 @@ void CarrierRocket (edict_t *self)
|
|||
vec[2] -= 15;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -313,7 +313,7 @@ void CarrierRocket (edict_t *self)
|
|||
// vec[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -334,7 +334,7 @@ void CarrierRocket (edict_t *self)
|
|||
// vec[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -355,7 +355,7 @@ void CarrierRocket (edict_t *self)
|
|||
// vec[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -400,23 +400,30 @@ void carrier_firebullet_right (edict_t *self)
|
|||
target[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
gi.WriteByte (TE_DEBUGTRAIL);
|
||||
gi.WritePosition (start);
|
||||
gi.WritePosition (target);
|
||||
gi.multicast (start, MULTICAST_ALL);
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
gi.WriteByte (TE_DEBUGTRAIL);
|
||||
gi.WritePosition (start);
|
||||
gi.WritePosition (target);
|
||||
gi.multicast (start, MULTICAST_ALL);
|
||||
*/
|
||||
VectorSubtract (target, start, forward);
|
||||
VectorNormalize (forward);
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD*3, DEFAULT_BULLET_VSPREAD, flashnum);
|
||||
}
|
||||
|
||||
|
@ -440,23 +447,30 @@ void carrier_firebullet_left (edict_t *self)
|
|||
target[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
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);
|
||||
/*
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
gi.WriteByte (TE_DEBUGTRAIL);
|
||||
gi.WritePosition (start);
|
||||
gi.WritePosition (target);
|
||||
gi.multicast (start, MULTICAST_ALL);
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
gi.WriteByte (TE_DEBUGTRAIL);
|
||||
gi.WritePosition (start);
|
||||
gi.WritePosition (target);
|
||||
gi.multicast (start, MULTICAST_ALL);
|
||||
*/
|
||||
VectorSubtract (target, start, forward);
|
||||
VectorNormalize (forward);
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD*3, DEFAULT_BULLET_VSPREAD, flashnum);
|
||||
}
|
||||
|
||||
|
@ -783,7 +797,7 @@ void CarrierRail (edict_t *self)
|
|||
G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_CARRIER_RAILGUN], forward, right, start);
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
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);
|
||||
|
@ -1209,7 +1223,7 @@ qboolean Carrier_CheckAttack (edict_t *self)
|
|||
}
|
||||
|
||||
// PGM - we want them to go ahead and shoot at info_notnulls if they can.
|
||||
if(self->enemy->solid != SOLID_NOT || tr.fraction < 1.0) //PGM
|
||||
if (self->enemy->solid != SOLID_NOT || tr.fraction < 1.0) //PGM
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1355,14 +1369,14 @@ void SP_monster_carrier (edict_t *self)
|
|||
VectorSet (self->maxs, 56, 56, 44);
|
||||
|
||||
// 2000 - 4000 health
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = max (2000, 2000 + 1000*((skill->value)-1));
|
||||
// add health in coop (500 * skill)
|
||||
if (coop->value)
|
||||
self->health += 500*(skill->value);
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -200;
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 1000;
|
||||
|
||||
self->yaw_speed = 15;
|
||||
|
@ -1390,7 +1404,7 @@ void SP_monster_carrier (edict_t *self)
|
|||
self->fogclip |= 2; //custom bloodtype flag
|
||||
|
||||
// Lazarus
|
||||
if(self->powerarmor)
|
||||
if (self->powerarmor)
|
||||
{
|
||||
if (self->powerarmortype == 1)
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
|
||||
|
|
|
@ -483,7 +483,7 @@ void insane_pain (edict_t *self, edict_t *other, float kick, int damage)
|
|||
|
||||
// Don't go into pain frames if crucified.
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & FL2_CRUCIFIED) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->monsterinfo.currentmove = &insane_move_struggle_cross;
|
||||
return;
|
||||
|
@ -528,7 +528,7 @@ void insane_checkup (edict_t *self)
|
|||
void insane_stand (edict_t *self)
|
||||
{
|
||||
// if (self->spawnflags & 8) // If crucified
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // If crucified // Knightmare- use moreflags field instead
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & FL2_CRUCIFIED) ) // If crucified // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->monsterinfo.currentmove = &insane_move_cross;
|
||||
self->monsterinfo.aiflags |= AI_STAND_GROUND;
|
||||
|
@ -546,7 +546,7 @@ void insane_stand (edict_t *self)
|
|||
void insane_dead (edict_t *self)
|
||||
{
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & FL2_CRUCIFIED) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->flags |= FL_FLY;
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ void insane_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag
|
|||
self->takedamage = DAMAGE_YES;
|
||||
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & FL2_CRUCIFIED) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
insane_dead (self);
|
||||
}
|
||||
|
@ -683,7 +683,7 @@ void SP_misc_insane (edict_t *self)
|
|||
{
|
||||
// Knightmare- Spawnflag 8 collides with SF_MONSTER_GOODGUY, and can be cleared in some instances.
|
||||
// This prevents it from screwing up crucified insanes.
|
||||
self->moreflags |= 8;
|
||||
self->moreflags |= FL2_CRUCIFIED;
|
||||
VectorSet (self->mins, -16, 0, 0);
|
||||
VectorSet (self->maxs, 16, 8, 32);
|
||||
self->flags |= FL_NO_KNOCKBACK;
|
||||
|
|
|
@ -140,7 +140,7 @@ void abortHeal (edict_t *self, qboolean change_frame, qboolean gib, qboolean mar
|
|||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("%s - gibbing bad heal target", self->classname);
|
||||
|
||||
if(self->enemy->gib_health)
|
||||
if (self->enemy->gib_health)
|
||||
hurt = - self->enemy->gib_health;
|
||||
else
|
||||
hurt = 500;
|
||||
|
@ -186,7 +186,7 @@ qboolean embedded (edict_t *ent)
|
|||
trace_t tr;
|
||||
|
||||
tr = gi.trace(ent->s.origin,ent->mins,ent->maxs,ent->s.origin,ent,MASK_MONSTERSOLID);
|
||||
if(tr.startsolid)
|
||||
if (tr.startsolid)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
@ -262,7 +262,7 @@ edict_t *medic_FindDeadMonster (edict_t *self)
|
|||
self->timestamp = level.time + MEDIC_TRY_TIME;
|
||||
FoundTarget (self);
|
||||
|
||||
if(developer->value)
|
||||
if (developer->value)
|
||||
gi.dprintf("medic found dead monster: %s at %s\n",
|
||||
best->classname,vtos(best->s.origin));
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ void medic_StopPatrolling (edict_t *self)
|
|||
self->monsterinfo.aiflags &= ~AI_MEDIC_PATROL;
|
||||
if (!(self->monsterinfo.aiflags & AI_MEDIC))
|
||||
{
|
||||
if(medic_FindDeadMonster(self))
|
||||
if (medic_FindDeadMonster(self))
|
||||
return;
|
||||
}
|
||||
if (has_valid_enemy(self))
|
||||
|
@ -289,7 +289,7 @@ void medic_StopPatrolling (edict_t *self)
|
|||
HuntTarget (self);
|
||||
return;
|
||||
}
|
||||
if(self->monsterinfo.aiflags & AI_MEDIC)
|
||||
if (self->monsterinfo.aiflags & AI_MEDIC)
|
||||
abortHeal(self,false,false,false);
|
||||
}
|
||||
|
||||
|
@ -302,21 +302,21 @@ void medic_NextPatrolPoint (edict_t *self, edict_t *hint)
|
|||
|
||||
self->monsterinfo.aiflags &= ~AI_MEDIC_PATROL;
|
||||
|
||||
// if(self->monsterinfo.aiflags & AI_MEDIC)
|
||||
// if (self->monsterinfo.aiflags & AI_MEDIC)
|
||||
// return;
|
||||
|
||||
if(self->goalentity == hint)
|
||||
if (self->goalentity == hint)
|
||||
self->goalentity = NULL;
|
||||
if(self->movetarget == hint)
|
||||
if (self->movetarget == hint)
|
||||
self->movetarget = NULL;
|
||||
if (!(self->monsterinfo.aiflags & AI_MEDIC))
|
||||
{
|
||||
if(medic_FindDeadMonster(self))
|
||||
if (medic_FindDeadMonster(self))
|
||||
return;
|
||||
}
|
||||
if(self->monsterinfo.pathdir == 1)
|
||||
if (self->monsterinfo.pathdir == 1)
|
||||
{
|
||||
if(hint->hint_chain)
|
||||
if (hint->hint_chain)
|
||||
next = hint->hint_chain;
|
||||
else
|
||||
{
|
||||
|
@ -324,12 +324,12 @@ void medic_NextPatrolPoint (edict_t *self, edict_t *hint)
|
|||
switch_paths = true;
|
||||
}
|
||||
}
|
||||
if(self->monsterinfo.pathdir == -1)
|
||||
if (self->monsterinfo.pathdir == -1)
|
||||
{
|
||||
e = hint_path_start[hint->hint_chain_id];
|
||||
while(e)
|
||||
while (e)
|
||||
{
|
||||
if(e->hint_chain == hint)
|
||||
if (e->hint_chain == hint)
|
||||
{
|
||||
next = e;
|
||||
break;
|
||||
|
@ -337,7 +337,7 @@ void medic_NextPatrolPoint (edict_t *self, edict_t *hint)
|
|||
e = e->hint_chain;
|
||||
}
|
||||
}
|
||||
if(!next)
|
||||
if (!next)
|
||||
{
|
||||
self->monsterinfo.pathdir = 1;
|
||||
next = hint->hint_chain;
|
||||
|
@ -345,7 +345,7 @@ void medic_NextPatrolPoint (edict_t *self, edict_t *hint)
|
|||
}
|
||||
// If switch_paths is true, we reached the end of a hint_chain. Just for grins,
|
||||
// search for *another* visible hint_path chain and use it if it's reasonably close
|
||||
if(switch_paths && num_hint_paths > 1)
|
||||
if (switch_paths && num_hint_paths > 1)
|
||||
{
|
||||
edict_t *e;
|
||||
edict_t *alternate=NULL;
|
||||
|
@ -354,31 +354,31 @@ void medic_NextPatrolPoint (edict_t *self, edict_t *hint)
|
|||
int i;
|
||||
float bestdistance=512;
|
||||
|
||||
for(i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
for (i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
{
|
||||
e = &g_edicts[i];
|
||||
if(!e->inuse)
|
||||
if (!e->inuse)
|
||||
continue;
|
||||
if(Q_stricmp(e->classname,"hint_path"))
|
||||
if (Q_stricmp(e->classname,"hint_path"))
|
||||
continue;
|
||||
if(next && (e->hint_chain_id == next->hint_chain_id))
|
||||
if (next && (e->hint_chain_id == next->hint_chain_id))
|
||||
continue;
|
||||
if(!visible(self,e))
|
||||
if (!visible(self,e))
|
||||
continue;
|
||||
if(!canReach(self,e))
|
||||
if (!canReach(self,e))
|
||||
continue;
|
||||
VectorSubtract(e->s.origin,self->s.origin,dir);
|
||||
dist = VectorLength(dir);
|
||||
if(dist < bestdistance)
|
||||
if (dist < bestdistance)
|
||||
{
|
||||
alternate = e;
|
||||
bestdistance = dist;
|
||||
}
|
||||
}
|
||||
if(alternate)
|
||||
if (alternate)
|
||||
next = alternate;
|
||||
}
|
||||
if(next)
|
||||
if (next)
|
||||
{
|
||||
self->hint_chain_id = next->hint_chain_id;
|
||||
VectorSubtract(next->s.origin, self->s.origin, dir);
|
||||
|
@ -401,7 +401,7 @@ void medic_idle (edict_t *self)
|
|||
{
|
||||
//edict_t *ent;
|
||||
|
||||
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
|
||||
if (!(self->spawnflags & SF_MONSTER_AMBUSH))
|
||||
{
|
||||
// PMM - commander sounds
|
||||
if (strcmp(self->classname, "monster_medic_commander"))
|
||||
|
@ -410,7 +410,7 @@ void medic_idle (edict_t *self)
|
|||
gi.sound (self, CHAN_VOICE, commander_sound_idle1, 1, ATTN_IDLE, 0);
|
||||
}
|
||||
|
||||
if(self->monsterinfo.aiflags & AI_MEDIC)
|
||||
if (self->monsterinfo.aiflags & AI_MEDIC)
|
||||
{
|
||||
// Then we must have reached this point after losing sight
|
||||
// of our patient.
|
||||
|
@ -429,7 +429,7 @@ void medic_idle (edict_t *self)
|
|||
FoundTarget (self);
|
||||
}
|
||||
}*/
|
||||
if(medic_FindDeadMonster(self))
|
||||
if (medic_FindDeadMonster(self))
|
||||
return;
|
||||
|
||||
// If the map has hint_paths, AND the medic isn't at a HOLD point_combat,
|
||||
|
@ -439,7 +439,7 @@ void medic_idle (edict_t *self)
|
|||
if (self->monsterinfo.aiflags2 & AI2_HINT_TEST)
|
||||
return;
|
||||
|
||||
if(hint_paths_present && !(self->monsterinfo.aiflags & AI_STAND_GROUND)
|
||||
if (hint_paths_present && !(self->monsterinfo.aiflags & AI_STAND_GROUND)
|
||||
&& ((self->monsterinfo.trail_time > 0) /*|| medic_test*/) )
|
||||
{
|
||||
edict_t *e;
|
||||
|
@ -449,29 +449,29 @@ void medic_idle (edict_t *self)
|
|||
int i;
|
||||
float bestdistance=99999;
|
||||
|
||||
for(i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
for (i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
{
|
||||
e = &g_edicts[i];
|
||||
if(!e->inuse)
|
||||
if (!e->inuse)
|
||||
continue;
|
||||
if(Q_stricmp(e->classname,"hint_path"))
|
||||
if (Q_stricmp(e->classname,"hint_path"))
|
||||
continue;
|
||||
if(!visible(self,e))
|
||||
if (!visible(self,e))
|
||||
continue;
|
||||
if(!canReach(self,e))
|
||||
if (!canReach(self,e))
|
||||
continue;
|
||||
VectorSubtract(e->s.origin,self->s.origin,dir);
|
||||
dist = VectorLength(dir);
|
||||
if(dist < bestdistance)
|
||||
if (dist < bestdistance)
|
||||
{
|
||||
hint = e;
|
||||
bestdistance = dist;
|
||||
}
|
||||
}
|
||||
if(hint)
|
||||
if (hint)
|
||||
{
|
||||
self->hint_chain_id = hint->hint_chain_id;
|
||||
if(!self->monsterinfo.pathdir)
|
||||
if (!self->monsterinfo.pathdir)
|
||||
self->monsterinfo.pathdir = 1;
|
||||
VectorSubtract(hint->s.origin, self->s.origin, dir);
|
||||
self->ideal_yaw = vectoyaw(dir);
|
||||
|
@ -803,7 +803,7 @@ void medic_fire_blaster (edict_t *self)
|
|||
end[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
end[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
end[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -833,7 +833,7 @@ void medic_dead (edict_t *self)
|
|||
M_FlyCheck (self);
|
||||
|
||||
// Lazarus monster fade
|
||||
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
if (world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
{
|
||||
self->think=FadeDieSink;
|
||||
self->nextthink=level.time+corpse_fadetime->value;
|
||||
|
@ -1078,7 +1078,7 @@ void medic_cable_attack (edict_t *self)
|
|||
// Lazarus: Check for enemy behind muzzle... don't do these guys, 'cause usually this
|
||||
// results in monster entanglement
|
||||
/*VectorNormalize(dir);
|
||||
if(DotProduct(dir,f) < 0.)
|
||||
if (DotProduct(dir,f) < 0.)
|
||||
{
|
||||
gi.dprintf ("medic - aborting heal due to proximity to target ");
|
||||
abortHeal (self, true, false, false);
|
||||
|
@ -1135,7 +1135,7 @@ void medic_cable_attack (edict_t *self)
|
|||
{
|
||||
vec3_t maxs;
|
||||
|
||||
//Knightmare- remember nogib flag for monsters that get resurrected
|
||||
// Knightmare- remember nogib flag for monsters that get resurrected
|
||||
if ((!strcmp(self->enemy->classname, "monster_gekk") || !strcmp(self->enemy->classname, "monster_stalker"))
|
||||
&& (self->enemy->spawnflags & 32))
|
||||
targ_nogib = true;
|
||||
|
@ -1143,7 +1143,7 @@ void medic_cable_attack (edict_t *self)
|
|||
targ_nogib = true;
|
||||
|
||||
self->enemy->spawnflags = 0;
|
||||
//now restore nogib flag
|
||||
// now restore nogib flag
|
||||
if ((!strcmp(self->enemy->classname, "monster_gekk") || !strcmp(self->enemy->classname, "monster_stalker"))
|
||||
&& targ_nogib)
|
||||
self->enemy->spawnflags |= 32;
|
||||
|
@ -1156,35 +1156,35 @@ void medic_cable_attack (edict_t *self)
|
|||
self->enemy->combattarget = NULL;
|
||||
self->enemy->deathtarget = NULL;
|
||||
self->enemy->monsterinfo.healer = self;
|
||||
//self->enemy->owner = self;
|
||||
// self->enemy->owner = self;
|
||||
VectorCopy (self->enemy->maxs, maxs);
|
||||
maxs[2] += 48; // compensate for change when they die
|
||||
|
||||
tr = gi.trace (self->enemy->s.origin, self->enemy->mins, maxs, self->enemy->s.origin, self->enemy, MASK_MONSTERSOLID);
|
||||
if (tr.startsolid || tr.allsolid)
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Spawn point obstructed, aborting heal!\n");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Spawn point obstructed, aborting heal!\n");
|
||||
abortHeal (self, true, true, false);
|
||||
return;
|
||||
}
|
||||
else if (tr.ent != world)
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf("heal in entity %s\n", tr.ent->classname);
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf("heal in entity %s\n", tr.ent->classname);
|
||||
abortHeal (self, true, true, false);
|
||||
return;
|
||||
}
|
||||
/* else if (tr.ent == world)
|
||||
/* else if (tr.ent == world)
|
||||
{
|
||||
if ((g_showlogic) && (g_showlogic->value))
|
||||
gi.dprintf ("heal in world, aborting!\n");
|
||||
abortHeal (self, 1);
|
||||
return;
|
||||
}
|
||||
*/ else
|
||||
}*/
|
||||
else
|
||||
{
|
||||
//self->enemy->monsterinfo.aiflags |= AI_DO_NOT_COUNT;
|
||||
// self->enemy->monsterinfo.aiflags |= AI_DO_NOT_COUNT;
|
||||
self->enemy->monsterinfo.monsterflags |= MFL_DO_NOT_COUNT;
|
||||
// Lazarus: reset initially dead monsters to use the INVERSE of their
|
||||
// initial health, and force gib_health to default value
|
||||
|
@ -1201,11 +1201,11 @@ void medic_cable_attack (edict_t *self)
|
|||
self->enemy->damage_debounce_time = 0;
|
||||
self->enemy->deadflag = DEAD_NO;
|
||||
// turn off flies
|
||||
if(self->enemy->s.effects & EF_FLIES)
|
||||
if (self->enemy->s.effects & EF_FLIES)
|
||||
M_FliesOff(self->enemy);
|
||||
ED_CallSpawn (self->enemy);
|
||||
self->enemy->monsterinfo.healer = NULL;
|
||||
//self->enemy->owner = NULL;
|
||||
// self->enemy->owner = NULL;
|
||||
|
||||
// Knightmare- disable deadmonster_think
|
||||
if (self->enemy->postthink)
|
||||
|
@ -1218,15 +1218,15 @@ void medic_cable_attack (edict_t *self)
|
|||
}
|
||||
self->enemy->monsterinfo.aiflags &= ~AI_RESURRECTING;
|
||||
M_SetEffects(self->enemy);
|
||||
//self->enemy->monsterinfo.aiflags |= AI_IGNORE_SHOTS|AI_DO_NOT_COUNT;
|
||||
// self->enemy->monsterinfo.aiflags |= AI_IGNORE_SHOTS|AI_DO_NOT_COUNT;
|
||||
self->enemy->monsterinfo.aiflags |= AI_IGNORE_SHOTS;
|
||||
self->enemy->monsterinfo.monsterflags |= MFL_DO_NOT_COUNT;
|
||||
|
||||
if ((self->oldenemy) && (self->oldenemy->inuse) && (self->oldenemy->health > 0)
|
||||
&& (self->oldenemy != self->enemy)) // Knightmare- don't have monster attack himself
|
||||
{ // turn healed monster on our enemy
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("setting heal target's enemy to %s\n", self->oldenemy->classname);
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("setting heal target's enemy to %s\n", self->oldenemy->classname);
|
||||
self->enemy->enemy = self->oldenemy;
|
||||
FoundTarget (self->enemy);
|
||||
}
|
||||
|
@ -1240,8 +1240,8 @@ void medic_cable_attack (edict_t *self)
|
|||
}
|
||||
else
|
||||
{
|
||||
// if (g_showlogic && g_showlogic->value)
|
||||
// gi.dprintf ("no valid enemy to set!\n");
|
||||
// if (g_showlogic && g_showlogic->value)
|
||||
// gi.dprintf ("no valid enemy to set!\n");
|
||||
self->enemy->enemy = NULL;
|
||||
if (!FindTarget (self->enemy))
|
||||
{
|
||||
|
@ -1274,7 +1274,7 @@ void medic_cable_attack (edict_t *self)
|
|||
// adjust start for beam origin being in middle of a segment
|
||||
VectorMA (start, 8, f, start);
|
||||
|
||||
//Knightmare- if enemy went away, like after returning from another level, return
|
||||
// Knightmare- if enemy went away, like after returning from another level, return
|
||||
if (!self->enemy)
|
||||
return;
|
||||
// adjust end z for end spot since the monster is currently dead
|
||||
|
@ -2023,10 +2023,10 @@ void medic_sidestep (edict_t *self)
|
|||
//PGM
|
||||
qboolean medic_blocked (edict_t *self, float dist)
|
||||
{
|
||||
if(blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
if (blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
return true;
|
||||
|
||||
if(blocked_checkplat (self, dist))
|
||||
if (blocked_checkplat (self, dist))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -2064,11 +2064,11 @@ void SP_monster_medic (edict_t *self)
|
|||
//PMM
|
||||
if (strcmp(self->classname, "monster_medic_commander") == 0)
|
||||
{
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 600; // fixme
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -150;
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 600;
|
||||
//PMM
|
||||
self->monsterinfo.aiflags |= AI_IGNORE_SHOTS;
|
||||
|
@ -2080,11 +2080,11 @@ void SP_monster_medic (edict_t *self)
|
|||
else
|
||||
{
|
||||
//PMM
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 300;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -150;
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 400;
|
||||
}
|
||||
|
||||
|
@ -2113,7 +2113,7 @@ void SP_monster_medic (edict_t *self)
|
|||
self->blood_type = 3; //sparks and blood
|
||||
|
||||
// Lazarus
|
||||
if(self->powerarmor)
|
||||
if (self->powerarmor)
|
||||
{
|
||||
if (self->powerarmortype == 1)
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
|
||||
|
@ -2121,9 +2121,9 @@ void SP_monster_medic (edict_t *self)
|
|||
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
|
||||
self->monsterinfo.power_armor_power = self->powerarmor;
|
||||
}
|
||||
if(!self->monsterinfo.flies && strcmp(self->classname, "monster_medic_commander") == 0)
|
||||
if (!self->monsterinfo.flies && strcmp(self->classname, "monster_medic_commander") == 0)
|
||||
self->monsterinfo.flies = 0.10;
|
||||
else if(!self->monsterinfo.flies)
|
||||
else if (!self->monsterinfo.flies)
|
||||
self->monsterinfo.flies = 0.15;
|
||||
|
||||
gi.linkentity (self);
|
||||
|
|
|
@ -37,7 +37,7 @@ qboolean M_CheckBottom (edict_t *ent)
|
|||
#ifdef ROGUE_GRAVITY
|
||||
// FIXME - this will only handle 0,0,1 and 0,0,-1 gravity vectors
|
||||
start[2] = mins[2] - 1;
|
||||
if(ent->gravityVector[2] > 0)
|
||||
if (ent->gravityVector[2] > 0)
|
||||
start[2] = maxs[2] + 1;
|
||||
#else
|
||||
start[2] = mins[2] - 1;
|
||||
|
@ -69,7 +69,7 @@ realcheck:
|
|||
|
||||
//PGM
|
||||
#ifdef ROGUE_GRAVITY
|
||||
if(ent->gravityVector[2] < 0)
|
||||
if (ent->gravityVector[2] < 0)
|
||||
{
|
||||
start[2] = mins[2];
|
||||
stop[2] = start[2] - STEPSIZE - STEPSIZE;
|
||||
|
@ -102,7 +102,7 @@ realcheck:
|
|||
//PGM
|
||||
#ifdef ROGUE_GRAVITY
|
||||
// FIXME - this will only handle 0,0,1 and 0,0,-1 gravity vectors
|
||||
if(ent->gravityVector[2] > 0)
|
||||
if (ent->gravityVector[2] > 0)
|
||||
{
|
||||
if (trace.fraction != 1.0 && trace.endpos[2] < bottom)
|
||||
bottom = trace.endpos[2];
|
||||
|
@ -156,7 +156,7 @@ qboolean IsBadAhead (edict_t *self, edict_t *bad, vec3_t move)
|
|||
|
||||
return false;
|
||||
/*
|
||||
if(DotProduct(forward, dir) > 0)
|
||||
if (DotProduct(forward, dir) > 0)
|
||||
{
|
||||
// gi.dprintf ("bad ahead...\n");
|
||||
return true;
|
||||
|
@ -179,8 +179,8 @@ 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?
|
||||
// FIXME since we need to test end position contents here, can we avoid doing
|
||||
// it again later in catagorize position?
|
||||
qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||
{
|
||||
float dz;
|
||||
|
@ -210,33 +210,42 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
if (ent->health > 0)
|
||||
{
|
||||
current_bad = CheckForBadArea(ent);
|
||||
if(current_bad)
|
||||
if (current_bad)
|
||||
{
|
||||
ent->bad_area = current_bad;
|
||||
|
||||
if(ent->enemy && !strcmp(ent->enemy->classname, "tesla"))
|
||||
if (ent->enemy && !strcmp(ent->enemy->classname, "tesla"))
|
||||
{
|
||||
// if the tesla is in front of us, back up...
|
||||
if (IsBadAhead (ent, current_bad, move))
|
||||
VectorScale(move, -1, move);
|
||||
}
|
||||
}
|
||||
else if(ent->bad_area)
|
||||
else if (ent->bad_area)
|
||||
{
|
||||
// if we're no longer in a bad area, get back to business.
|
||||
ent->bad_area = NULL;
|
||||
if(ent->oldenemy)// && ent->bad_area->owner == ent->enemy)
|
||||
if (ent->oldenemy) // && ent->bad_area->owner == ent->enemy)
|
||||
{
|
||||
// gi.dprintf("resuming being pissed at %s\n", ent->oldenemy->classname);
|
||||
ent->enemy = ent->oldenemy;
|
||||
ent->goalentity = ent->oldenemy;
|
||||
FoundTarget(ent);
|
||||
// FIXME - remove this when ready!!!
|
||||
// if (ent->lastMoveTime == level.time)
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
|
||||
// Knightmare- added missing relink
|
||||
if (relink)
|
||||
{
|
||||
gi.linkentity (ent);
|
||||
G_TouchTriggers (ent);
|
||||
}
|
||||
// end Knightmare
|
||||
|
||||
// FIXME - remove this when ready!!!
|
||||
// if (ent->lastMoveTime == level.time)
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -245,25 +254,25 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
//PGM
|
||||
//======
|
||||
|
||||
// try the move
|
||||
// try the move
|
||||
VectorCopy (ent->s.origin, oldorg);
|
||||
VectorAdd (ent->s.origin, move, neworg);
|
||||
|
||||
// Lazarus
|
||||
AngleVectors(ent->s.angles,forward,NULL,up);
|
||||
if(ent->enemy)
|
||||
AngleVectors (ent->s.angles, forward, NULL, up);
|
||||
if (ent->enemy)
|
||||
target = ent->enemy;
|
||||
else if(ent->movetarget)
|
||||
else if (ent->movetarget)
|
||||
target = ent->movetarget;
|
||||
else
|
||||
target = NULL;
|
||||
// end Lazarus
|
||||
|
||||
// flying monsters don't step up
|
||||
// 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++)
|
||||
// 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)
|
||||
|
@ -280,9 +289,8 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
minheight = 104;
|
||||
else
|
||||
minheight = 40;
|
||||
// if (dz > 40)
|
||||
if (dz > minheight)
|
||||
// pmm
|
||||
// if (dz > 40)
|
||||
if (dz > minheight) // pmm
|
||||
neworg[2] -= 8;
|
||||
if (!((ent->flags & FL_SWIM) && (ent->waterlevel < 2)))
|
||||
if (dz < (minheight - 10))
|
||||
|
@ -339,7 +347,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
VectorCopy (trace.endpos, ent->s.origin);
|
||||
//=====
|
||||
//PGM
|
||||
if(!current_bad && CheckForBadArea(ent))
|
||||
if (!current_bad && CheckForBadArea(ent))
|
||||
{
|
||||
// gi.dprintf("Oooh! Bad Area!\n");
|
||||
VectorCopy (oldorg, ent->s.origin);
|
||||
|
@ -351,12 +359,12 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
gi.linkentity (ent);
|
||||
G_TouchTriggers (ent);
|
||||
}
|
||||
// FIXME - remove this when ready!!!
|
||||
// if (ent->lastMoveTime == level.time)
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
// FIXME - remove this when ready!!!
|
||||
// if (ent->lastMoveTime == level.time)
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -371,7 +379,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
return false;
|
||||
}
|
||||
|
||||
// push down from a step height above the wished position
|
||||
// push down from a step height above the wished position
|
||||
if (!(ent->monsterinfo.aiflags & AI_NOSTEP))
|
||||
stepsize = STEPSIZE;
|
||||
else
|
||||
|
@ -393,13 +401,13 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
|
||||
// Lazarus- Determine whether monster is capable of and/or should jump
|
||||
jump = 0;
|
||||
if((ent->monsterinfo.jump) && !(ent->monsterinfo.aiflags & AI_DUCKED))
|
||||
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)))
|
||||
if (trace.ent && (trace.ent->client || (trace.ent->svflags & SVF_MONSTER)))
|
||||
canjump = false;
|
||||
else if (target)
|
||||
{
|
||||
|
@ -409,7 +417,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
d1 = VectorLength(dir);
|
||||
VectorSubtract(target->s.origin, trace.endpos, dir);
|
||||
d2 = VectorLength(dir);
|
||||
if(d2 < d1)
|
||||
if (d2 < d1)
|
||||
canjump = true;
|
||||
else
|
||||
canjump = false;
|
||||
|
@ -423,13 +431,13 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
if (trace.allsolid)
|
||||
// return false;
|
||||
{
|
||||
if(canjump && (ent->monsterinfo.jumpup > 0))
|
||||
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)))
|
||||
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
|
||||
|
@ -438,7 +446,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
|
||||
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)
|
||||
if (DotProduct(tr.plane.normal,forward) < -0.95)
|
||||
{
|
||||
jump = 1;
|
||||
jumpheight = trace.endpos[2] - ent->s.origin[2];
|
||||
|
@ -489,12 +497,12 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
#ifdef ROGUE_GRAVITY //PGM
|
||||
test[0] = trace.endpos[0];
|
||||
test[1] = trace.endpos[1];
|
||||
if(ent->gravityVector[2] > 0)
|
||||
if (ent->gravityVector[2] > 0)
|
||||
test[2] = trace.endpos[2] + ent->maxs[2] - 1;
|
||||
else
|
||||
test[2] = trace.endpos[2] + ent->mins[2] + 1;
|
||||
#else
|
||||
test[0] = trace.en dpos[0];
|
||||
test[0] = trace.endpos[0];
|
||||
test[1] = trace.endpos[1];
|
||||
test[2] = trace.endpos[2] + ent->mins[2] + 1;
|
||||
#endif //PGM
|
||||
|
@ -507,16 +515,16 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
// 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))
|
||||
if (!(ent->monsterinfo.aiflags & AI_CHASE_THING))
|
||||
{
|
||||
grenade = NULL;
|
||||
while( (grenade = findradius(grenade,neworg,128)) != NULL)
|
||||
while ( (grenade = findradius(grenade,neworg,128)) != NULL)
|
||||
{
|
||||
if(!grenade->inuse)
|
||||
if (!grenade->inuse)
|
||||
continue;
|
||||
if(!grenade->classname)
|
||||
if (!grenade->classname)
|
||||
continue;
|
||||
if(!Q_stricmp(grenade->classname,"grenade") || !Q_stricmp(grenade->classname,"hgrenade"))
|
||||
if (!Q_stricmp(grenade->classname,"grenade") || !Q_stricmp(grenade->classname,"hgrenade"))
|
||||
{
|
||||
VectorSubtract(grenade->s.origin,oldorg,dir);
|
||||
g1 = VectorLength(dir);
|
||||
|
@ -530,7 +538,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
|
||||
// Lazarus: Don't intentionally walk into lasers.
|
||||
dist = VectorLength(move);
|
||||
if(dist > 0.)
|
||||
if (dist > 0.)
|
||||
{
|
||||
edict_t *e;
|
||||
trace_t laser_trace;
|
||||
|
@ -539,26 +547,26 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
vec3_t laser_start, laser_end;
|
||||
vec3_t monster_mins, monster_maxs;
|
||||
|
||||
for(i=game.maxclients+1; i<globals.num_edicts; i++)
|
||||
for (i = game.maxclients+1; i < globals.num_edicts; i++)
|
||||
{
|
||||
e = &g_edicts[i];
|
||||
if(!e->inuse)
|
||||
if (!e->inuse)
|
||||
continue;
|
||||
if(!e->classname)
|
||||
if (!e->classname)
|
||||
continue;
|
||||
if(Q_stricmp(e->classname,"target_laser"))
|
||||
if (Q_stricmp(e->classname,"target_laser"))
|
||||
continue;
|
||||
if(e->svflags & SVF_NOCLIENT)
|
||||
if (e->svflags & SVF_NOCLIENT)
|
||||
continue;
|
||||
if( (e->style == 2) || (e->style == 3))
|
||||
if ( (e->style == 2) || (e->style == 3))
|
||||
continue;
|
||||
if(!gi.inPVS(ent->s.origin,e->s.origin))
|
||||
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)
|
||||
if (laser_trace.ent == ent)
|
||||
continue;
|
||||
VectorCopy(laser_trace.endpos,laser_end);
|
||||
laser_mins[0] = min(e->s.origin[0],laser_end[0]);
|
||||
|
@ -589,9 +597,9 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
// the total distance he's proposing moving.
|
||||
delta = min(16,dist);
|
||||
VectorNormalize2(move,dir);
|
||||
while(delta < dist+15.875)
|
||||
while (delta < dist+15.875)
|
||||
{
|
||||
if(delta > dist) delta = dist;
|
||||
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);
|
||||
|
@ -607,15 +615,15 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
{
|
||||
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.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)))
|
||||
if (!trace.ent || (!trace.ent->client && !(trace.ent->svflags & SVF_MONSTER) && !(trace.ent->svflags & SVF_DEADMONSTER)))
|
||||
jump = -1;
|
||||
}
|
||||
}
|
||||
|
||||
//if (trace.fraction == 1)
|
||||
if ((trace.fraction == 1) && !jump)
|
||||
// if (trace.fraction == 1)
|
||||
if ( (trace.fraction == 1) && !jump )
|
||||
// end Lazarus
|
||||
{
|
||||
// if monster had the ground pulled out, go ahead and fall
|
||||
|
@ -628,13 +636,12 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
G_TouchTriggers (ent);
|
||||
}
|
||||
ent->groundentity = NULL;
|
||||
// FIXME - remove this when ready!!!
|
||||
// if (ent->lastMoveTime == level.time)
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
|
||||
// FIXME - remove this when ready!!!
|
||||
// if (ent->lastMoveTime == level.time)
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -650,59 +657,59 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
{
|
||||
// use AI_BLOCKED to tell the calling layer that we're now mad at a tesla
|
||||
new_bad = CheckForBadArea(ent);
|
||||
if(!current_bad && new_bad)
|
||||
if (!current_bad && new_bad)
|
||||
{
|
||||
if (new_bad->owner)
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf("Blocked -");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf("Blocked -");
|
||||
if (!strcmp(new_bad->owner->classname, "tesla"))
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("it's a tesla -");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("it's a tesla -");
|
||||
if ((!(ent->enemy)) || (!(ent->enemy->inuse)))
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("I don't have a valid enemy, attacking tesla!\n");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("I don't have a valid enemy, attacking tesla!\n");
|
||||
TargetTesla (ent, new_bad->owner);
|
||||
ent->monsterinfo.aiflags |= AI_BLOCKED;
|
||||
}
|
||||
else if (!strcmp(ent->enemy->classname, "telsa"))
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("but we're already mad at a tesla\n");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("but we're already mad at a tesla\n");
|
||||
}
|
||||
else if ((ent->enemy) && (ent->enemy->client))
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("we have a player enemy -");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("we have a player enemy -");
|
||||
if (visible(ent, ent->enemy))
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("we can see him -");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("we can see him -");
|
||||
}
|
||||
else
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("can't see him, kill the tesla! -");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("can't see him, kill the tesla! -");
|
||||
TargetTesla (ent, new_bad->owner);
|
||||
ent->monsterinfo.aiflags |= AI_BLOCKED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("the enemy isn't a player, killing tesla -");
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("the enemy isn't a player, killing tesla -");
|
||||
TargetTesla (ent, new_bad->owner);
|
||||
ent->monsterinfo.aiflags |= AI_BLOCKED;
|
||||
}
|
||||
}
|
||||
// else if ((g_showlogic) && (g_showlogic->value))
|
||||
// {
|
||||
// gi.dprintf(" by non-tesla bad area!");
|
||||
// }
|
||||
/* else if ((g_showlogic) && (g_showlogic->value))
|
||||
{
|
||||
gi.dprintf(" by non-tesla bad area!");
|
||||
}*/
|
||||
}
|
||||
// gi.dprintf ("\n");
|
||||
// gi.dprintf ("\n");
|
||||
|
||||
VectorCopy (oldorg, ent->s.origin);
|
||||
return false;
|
||||
|
@ -720,13 +727,12 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
gi.linkentity (ent);
|
||||
G_TouchTriggers (ent);
|
||||
}
|
||||
// FIXME - remove this when ready!!!
|
||||
// if (ent->lastMoveTime == level.time)
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
|
||||
// FIXME - remove this when ready!!!
|
||||
// if (ent->lastMoveTime == level.time)
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
return true;
|
||||
}
|
||||
VectorCopy (oldorg, ent->s.origin);
|
||||
|
@ -752,7 +758,6 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
// gi.dprintf ("Duplicate move detected for %s, please tell programmers!\n", ent->classname);
|
||||
// ent->lastMoveTime = level.time;
|
||||
// FIXME
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -811,7 +816,6 @@ SV_StepDirection
|
|||
|
||||
Turns to the movement direction, and walks the current distance if
|
||||
facing it.
|
||||
|
||||
======================
|
||||
*/
|
||||
qboolean SV_StepDirection (edict_t *ent, float yaw, float dist)
|
||||
|
@ -819,7 +823,7 @@ qboolean SV_StepDirection (edict_t *ent, float yaw, float dist)
|
|||
vec3_t move, oldorigin;
|
||||
float delta;
|
||||
|
||||
if(!ent->inuse) return true; // PGM g_touchtrigger free problem
|
||||
if (!ent->inuse) return true; // PGM g_touchtrigger free problem
|
||||
|
||||
ent->ideal_yaw = yaw;
|
||||
M_ChangeYaw (ent);
|
||||
|
@ -830,13 +834,13 @@ qboolean SV_StepDirection (edict_t *ent, float yaw, float dist)
|
|||
move[2] = 0;
|
||||
|
||||
VectorCopy (ent->s.origin, oldorigin);
|
||||
if (SV_movestep (ent, move, false))
|
||||
if ( SV_movestep (ent, move, false) )
|
||||
{
|
||||
ent->monsterinfo.aiflags &= ~AI_BLOCKED;
|
||||
if(!ent->inuse) return true; // PGM g_touchtrigger free problem
|
||||
if ( !ent->inuse ) return true; // PGM g_touchtrigger free problem
|
||||
|
||||
delta = ent->s.angles[YAW] - ent->ideal_yaw;
|
||||
if (strncmp(ent->classname, "monster_widow", 13))
|
||||
if ( strncmp(ent->classname, "monster_widow", 13) )
|
||||
{
|
||||
if (delta > 45 && delta < 315)
|
||||
{ // not turned far enough, so don't take the step
|
||||
|
@ -878,7 +882,7 @@ void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist)
|
|||
float d[3];
|
||||
float tdir, olddir, turnaround;
|
||||
|
||||
//FIXME: how did we get here with no enemy
|
||||
// FIXME: how did we get here with no enemy
|
||||
if (!enemy)
|
||||
return;
|
||||
|
||||
|
@ -888,17 +892,17 @@ void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist)
|
|||
deltax = enemy->s.origin[0] - actor->s.origin[0];
|
||||
deltay = enemy->s.origin[1] - actor->s.origin[1];
|
||||
if (deltax>10)
|
||||
d[1]= 0;
|
||||
d[1] = 0;
|
||||
else if (deltax<-10)
|
||||
d[1]= 180;
|
||||
d[1] = 180;
|
||||
else
|
||||
d[1]= DI_NODIR;
|
||||
d[1] = DI_NODIR;
|
||||
if (deltay<-10)
|
||||
d[2]= 270;
|
||||
d[2] = 270;
|
||||
else if (deltay>10)
|
||||
d[2]= 90;
|
||||
d[2] = 90;
|
||||
else
|
||||
d[2]= DI_NODIR;
|
||||
d[2] = DI_NODIR;
|
||||
|
||||
// try direct route
|
||||
if (d[1] != DI_NODIR && d[2] != DI_NODIR)
|
||||
|
@ -912,28 +916,28 @@ void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist)
|
|||
return;
|
||||
}
|
||||
|
||||
// try other directions
|
||||
if ( ((rand()&3) & 1) || abs(deltay)>abs(deltax))
|
||||
// try other directions
|
||||
if ( ((rand()&3) & 1) || (abs(deltay) > abs(deltax)) )
|
||||
{
|
||||
tdir=d[1];
|
||||
d[1]=d[2];
|
||||
d[2]=tdir;
|
||||
tdir = d[1];
|
||||
d[1] = d[2];
|
||||
d[2] = tdir;
|
||||
}
|
||||
|
||||
if (d[1]!=DI_NODIR && d[1]!=turnaround
|
||||
if (d[1] != DI_NODIR && d[1] != turnaround
|
||||
&& SV_StepDirection(actor, d[1], dist))
|
||||
return;
|
||||
|
||||
if (d[2]!=DI_NODIR && d[2]!=turnaround
|
||||
if (d[2] != DI_NODIR && d[2] != turnaround
|
||||
&& SV_StepDirection(actor, d[2], dist))
|
||||
return;
|
||||
|
||||
//ROGUE
|
||||
if(actor->monsterinfo.blocked)
|
||||
if (actor->monsterinfo.blocked)
|
||||
{
|
||||
if ((actor->inuse) && (actor->health > 0))
|
||||
{
|
||||
if((actor->monsterinfo.blocked)(actor, dist))
|
||||
if ((actor->monsterinfo.blocked)(actor, dist))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -941,19 +945,19 @@ void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist)
|
|||
|
||||
/* there is no direct path to the player, so pick another direction */
|
||||
|
||||
if (olddir!=DI_NODIR && SV_StepDirection(actor, olddir, dist))
|
||||
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)
|
||||
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) )
|
||||
for (tdir = 315; tdir >= 0; tdir -= 45)
|
||||
if (tdir != turnaround && SV_StepDirection(actor, tdir, dist) )
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1003,21 +1007,21 @@ void M_MoveToGoal (edict_t *ent, float dist)
|
|||
if (!ent->groundentity && !(ent->flags & (FL_FLY|FL_SWIM)))
|
||||
return;
|
||||
|
||||
if( (ent->monsterinfo.aiflags & AI_FOLLOW_LEADER) &&
|
||||
if ( (ent->monsterinfo.aiflags & AI_FOLLOW_LEADER) &&
|
||||
(ent->movetarget) &&
|
||||
(ent->movetarget->inuse) &&
|
||||
(ent->movetarget->health > 0) )
|
||||
{
|
||||
if(ent->enemy)
|
||||
if (ent->enemy)
|
||||
ent->monsterinfo.currentmove = &actor_move_run;
|
||||
else
|
||||
{
|
||||
float R;
|
||||
|
||||
R = realrange(ent,ent->movetarget);
|
||||
if(R > ACTOR_FOLLOW_RUN_RANGE)
|
||||
if (R > ACTOR_FOLLOW_RUN_RANGE)
|
||||
ent->monsterinfo.currentmove = &actor_move_run;
|
||||
else if(R < ACTOR_FOLLOW_STAND_RANGE && ent->movetarget->client)
|
||||
else if (R < ACTOR_FOLLOW_STAND_RANGE && ent->movetarget->client)
|
||||
{
|
||||
ent->monsterinfo.pausetime = level.time + 0.5;
|
||||
ent->monsterinfo.currentmove = &actor_move_stand;
|
||||
|
@ -1075,5 +1079,65 @@ qboolean M_walkmove (edict_t *ent, float yaw, float dist)
|
|||
ent->monsterinfo.aiflags &= ~AI_BLOCKED;
|
||||
return retval;
|
||||
// PMM
|
||||
//return SV_movestep(ent, move, true);
|
||||
// return SV_movestep(ent, move, true);
|
||||
}
|
||||
|
||||
|
||||
// Zaero add
|
||||
qboolean ai_checkattack (edict_t *self, float dist);
|
||||
/*
|
||||
====================
|
||||
M_MoveAwayFromFlare
|
||||
====================
|
||||
*/
|
||||
qboolean M_MoveAwayFromFlare (edict_t *self, float dist)
|
||||
{
|
||||
edict_t *e = NULL;
|
||||
edict_t *goal = NULL;
|
||||
vec3_t delta;
|
||||
vec3_t forward;
|
||||
|
||||
// find the closest flare
|
||||
while (1)
|
||||
{
|
||||
e = findradius(e, self->s.origin, 256);
|
||||
if (e == NULL)
|
||||
break;
|
||||
|
||||
if (Q_stricmp(e->classname, "flare") == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
goal = G_Spawn();
|
||||
self->goalentity = goal;
|
||||
if (e == NULL)
|
||||
{
|
||||
// just move forward
|
||||
AngleVectors(self->s.angles, forward, NULL, NULL);
|
||||
VectorMA(self->s.origin, 128, forward, goal->s.origin);
|
||||
}
|
||||
else /* e != NULL */
|
||||
{
|
||||
VectorSubtract(self->s.origin, e->s.origin, delta);
|
||||
VectorNormalize(delta);
|
||||
VectorMA(self->s.origin, 128, delta, goal->s.origin);
|
||||
}
|
||||
|
||||
if ( (rand() & 7) == 1 )
|
||||
{
|
||||
// set the ideal_yaw
|
||||
VectorSubtract(goal->s.origin, self->s.origin, delta);
|
||||
self->ideal_yaw = vectoyaw(delta);
|
||||
}
|
||||
|
||||
if ( (rand()&3)==1 || !SV_StepDirection (self, self->ideal_yaw, dist))
|
||||
{
|
||||
SV_NewChaseDir (self, goal, dist);
|
||||
}
|
||||
|
||||
self->goalentity = NULL;
|
||||
G_FreeEdict(goal);
|
||||
|
||||
return true;
|
||||
}
|
||||
// end Zaero
|
||||
|
|
|
@ -37,7 +37,7 @@ qboolean M_CheckBottom (edict_t *ent)
|
|||
#ifdef ROGUE_GRAVITY
|
||||
// FIXME - this will only handle 0,0,1 and 0,0,-1 gravity vectors
|
||||
start[2] = mins[2] - 1;
|
||||
if(ent->gravityVector[2] > 0)
|
||||
if (ent->gravityVector[2] > 0)
|
||||
start[2] = maxs[2] + 1;
|
||||
#else
|
||||
start[2] = mins[2] - 1;
|
||||
|
@ -69,7 +69,7 @@ realcheck:
|
|||
|
||||
//PGM
|
||||
#ifdef ROGUE_GRAVITY
|
||||
if(ent->gravityVector[2] < 0)
|
||||
if (ent->gravityVector[2] < 0)
|
||||
{
|
||||
start[2] = mins[2];
|
||||
stop[2] = start[2] - STEPSIZE - STEPSIZE;
|
||||
|
@ -102,7 +102,7 @@ realcheck:
|
|||
//PGM
|
||||
#ifdef ROGUE_GRAVITY
|
||||
// FIXME - this will only handle 0,0,1 and 0,0,-1 gravity vectors
|
||||
if(ent->gravityVector[2] > 0)
|
||||
if (ent->gravityVector[2] > 0)
|
||||
{
|
||||
if (trace.fraction != 1.0 && trace.endpos[2] < bottom)
|
||||
bottom = trace.endpos[2];
|
||||
|
@ -157,23 +157,23 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
//======
|
||||
//PGM
|
||||
current_bad = CheckForBadArea(ent);
|
||||
if(current_bad)
|
||||
if (current_bad)
|
||||
{
|
||||
// gi.dprintf("in bad area\n");
|
||||
ent->bad_area = current_bad;
|
||||
|
||||
if(ent->enemy && !strcmp(ent->enemy->classname, "tesla"))
|
||||
if (ent->enemy && !strcmp(ent->enemy->classname, "tesla"))
|
||||
{
|
||||
// gi.dprintf("%s -->> ", vtos(move));
|
||||
VectorScale(move, -1, move);
|
||||
// gi.dprintf("%s\n", vtos(move));
|
||||
}
|
||||
}
|
||||
else if(ent->bad_area)
|
||||
else if (ent->bad_area)
|
||||
{
|
||||
// if we're no longer in a bad area, get back to business.
|
||||
ent->bad_area = NULL;
|
||||
if(ent->oldenemy)// && ent->bad_area->owner == ent->enemy)
|
||||
if (ent->oldenemy)// && ent->bad_area->owner == ent->enemy)
|
||||
{
|
||||
// gi.dprintf("resuming being pissed at %s\n", ent->oldenemy->classname);
|
||||
ent->enemy = ent->oldenemy;
|
||||
|
@ -269,7 +269,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
VectorCopy (trace.endpos, ent->s.origin);
|
||||
//=====
|
||||
//PGM
|
||||
if(!current_bad && CheckForBadArea(ent))
|
||||
if (!current_bad && CheckForBadArea(ent))
|
||||
{
|
||||
// gi.dprintf("Oooh! Bad Area!\n");
|
||||
VectorCopy (oldorg, ent->s.origin);
|
||||
|
@ -333,7 +333,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
#ifdef ROGUE_GRAVITY
|
||||
test[0] = trace.endpos[0];
|
||||
test[1] = trace.endpos[1];
|
||||
if(ent->gravityVector[2] > 0)
|
||||
if (ent->gravityVector[2] > 0)
|
||||
test[2] = trace.endpos[2] + ent->maxs[2] - 1;
|
||||
else
|
||||
test[2] = trace.endpos[2] + ent->mins[2] + 1;
|
||||
|
@ -373,7 +373,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
|
||||
//PGM
|
||||
new_bad = CheckForBadArea(ent);
|
||||
if(!current_bad && new_bad)
|
||||
if (!current_bad && new_bad)
|
||||
{
|
||||
if (new_bad->owner)
|
||||
{
|
||||
|
@ -518,7 +518,7 @@ qboolean SV_StepDirection (edict_t *ent, float yaw, float dist)
|
|||
vec3_t move, oldorigin;
|
||||
float delta;
|
||||
|
||||
if(!ent->inuse) return true; // PGM g_touchtrigger free problem
|
||||
if (!ent->inuse) return true; // PGM g_touchtrigger free problem
|
||||
|
||||
ent->ideal_yaw = yaw;
|
||||
M_ChangeYaw (ent);
|
||||
|
@ -531,7 +531,7 @@ qboolean SV_StepDirection (edict_t *ent, float yaw, float dist)
|
|||
VectorCopy (ent->s.origin, oldorigin);
|
||||
if (SV_movestep (ent, move, false))
|
||||
{
|
||||
if(!ent->inuse) return true; // PGM g_touchtrigger free problem
|
||||
if (!ent->inuse) return true; // PGM g_touchtrigger free problem
|
||||
|
||||
delta = ent->s.angles[YAW] - ent->ideal_yaw;
|
||||
if (strncmp(ent->classname, "monster_widow", 13))
|
||||
|
@ -627,9 +627,9 @@ void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist)
|
|||
return;
|
||||
|
||||
//ROGUE
|
||||
if(actor->monsterinfo.blocked)
|
||||
if (actor->monsterinfo.blocked)
|
||||
{
|
||||
if((actor->monsterinfo.blocked)(actor, dist))
|
||||
if ((actor->monsterinfo.blocked)(actor, dist))
|
||||
return;
|
||||
}
|
||||
//ROGUE
|
||||
|
|
|
@ -39,7 +39,7 @@ void soldier_stop_charge (edict_t *self)
|
|||
|
||||
void soldier_idle (edict_t *self)
|
||||
{
|
||||
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
|
||||
if (!(self->spawnflags & SF_MONSTER_AMBUSH))
|
||||
{
|
||||
if (random() > 0.8)
|
||||
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
|
||||
|
@ -306,7 +306,8 @@ void soldier_fire (edict_t *self, int);
|
|||
|
||||
void soldier_fire_run (edict_t *self)
|
||||
{
|
||||
if ( ((self->s.skinnum % 6) <= 1) && (self->enemy) && visible(self, self->enemy))
|
||||
// if ( ((self->s.skinnum % 6) <= 1) && (self->enemy) && visible(self, self->enemy) )
|
||||
if ( (self->skinnum <= 1) && (self->enemy) && visible(self, self->enemy) )
|
||||
{
|
||||
soldier_fire(self, 0);
|
||||
}
|
||||
|
@ -527,12 +528,16 @@ void soldier_fire (edict_t *self, int in_flash_number)
|
|||
else
|
||||
flash_number = in_flash_number;
|
||||
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
flash_index = blaster_flash[flash_number];
|
||||
else if ((self->s.skinnum % 6) < 4)
|
||||
// else if ((self->s.skinnum % 6) < 4)
|
||||
else if (self->skinnum < 4)
|
||||
flash_index = shotgun_flash[flash_number];
|
||||
else
|
||||
else if (self->skinnum < 6)
|
||||
flash_index = machinegun_flash[flash_number];
|
||||
else // if (self->skinnum < 8)
|
||||
flash_index = blaster_flash[flash_number];
|
||||
|
||||
AngleVectors (self->s.angles, forward, right, NULL);
|
||||
G_ProjectSource (self->s.origin, monster_flash_offset[flash_index], forward, right, start);
|
||||
|
@ -547,7 +552,7 @@ void soldier_fire (edict_t *self, int in_flash_number)
|
|||
end[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
end[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
end[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -568,13 +573,13 @@ void soldier_fire (edict_t *self, int in_flash_number)
|
|||
//gi.dprintf ("Dot Product: %f", DotProduct (aim_norm, forward));
|
||||
if (angle < 0.9) // ~25 degree angle
|
||||
{
|
||||
// if(g_showlogic && g_showlogic->value)
|
||||
// if (g_showlogic && g_showlogic->value)
|
||||
// gi.dprintf (" not firing due to bad dotprod %f\n", angle);
|
||||
return;
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// if(g_showlogic && g_showlogic->value)
|
||||
// if (g_showlogic && g_showlogic->value)
|
||||
// gi.dprintf (" firing: dotprod = %f\n", angle);
|
||||
// }
|
||||
}
|
||||
|
@ -611,21 +616,23 @@ void soldier_fire (edict_t *self, int in_flash_number)
|
|||
tr = gi.trace (start, NULL, NULL, aim_good, self, MASK_SHOT);
|
||||
if ((tr.ent != self->enemy) && (tr.ent != world))
|
||||
{
|
||||
// if(g_showlogic && g_showlogic->value)
|
||||
// if (g_showlogic && g_showlogic->value)
|
||||
// gi.dprintf ("infantry shot aborted due to bad target\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if ((self->s.skinnum % 6) <= 1)
|
||||
// if ((self->s.skinnum % 6) <= 1)
|
||||
if (self->skinnum <= 1)
|
||||
{
|
||||
monster_fire_blaster (self, start, aim, 5, 600, flash_index, EF_BLASTER, BLASTER_ORANGE);
|
||||
}
|
||||
else if ((self->s.skinnum % 6) <= 3)
|
||||
// else if ((self->s.skinnum % 6) <= 3)
|
||||
else if (self->skinnum <= 3)
|
||||
{
|
||||
monster_fire_shotgun (self, start, aim, 2, 1, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SHOTGUN_COUNT, flash_index);
|
||||
}
|
||||
else
|
||||
else if (self->skinnum <= 5)
|
||||
{
|
||||
// PMM - changed to wait from pausetime to not interfere with dodge code
|
||||
if (!(self->monsterinfo.aiflags & AI_HOLD_FRAME))
|
||||
|
@ -638,6 +645,13 @@ void soldier_fire (edict_t *self, int in_flash_number)
|
|||
else
|
||||
self->monsterinfo.aiflags |= AI_HOLD_FRAME;
|
||||
}
|
||||
else // if (self->skinnum <= 7)
|
||||
{
|
||||
if (self->moreflags & FL2_WEAPON_ALT)
|
||||
monster_fire_plasma_rifle (self, start, aim, PLASMA_SPREAD_DAMAGE, PLASMA_SPREAD_SPEED, flash_index, true);
|
||||
else
|
||||
monster_fire_plasma_rifle (self, start, aim, PLASMA_BOUNCE_DAMAGE, PLASMA_BOUNCE_SPEED, flash_index, false);
|
||||
}
|
||||
}
|
||||
|
||||
// ATTACK1 (blaster/shotgun)
|
||||
|
@ -660,7 +674,8 @@ void soldier_attack1_refire1 (edict_t *self)
|
|||
if (!self->enemy)
|
||||
return;
|
||||
|
||||
if ((self->s.skinnum % 6) > 1)
|
||||
// if ((self->s.skinnum % 6) > 1)
|
||||
if (self->skinnum > 1)
|
||||
return;
|
||||
|
||||
if (self->enemy->health <= 0)
|
||||
|
@ -677,7 +692,8 @@ void soldier_attack1_refire2 (edict_t *self)
|
|||
if (!self->enemy)
|
||||
return;
|
||||
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
return;
|
||||
|
||||
if (self->enemy->health <= 0)
|
||||
|
@ -716,7 +732,8 @@ void soldier_attack2_refire1 (edict_t *self)
|
|||
if (!self->enemy)
|
||||
return;
|
||||
|
||||
if ((self->s.skinnum % 6) > 1)
|
||||
// if ((self->s.skinnum % 6) > 1)
|
||||
if (self->skinnum > 1)
|
||||
return;
|
||||
|
||||
if (self->enemy->health <= 0)
|
||||
|
@ -733,7 +750,8 @@ void soldier_attack2_refire2 (edict_t *self)
|
|||
if (!self->enemy)
|
||||
return;
|
||||
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
return;
|
||||
|
||||
if (self->enemy->health <= 0)
|
||||
|
@ -978,16 +996,18 @@ void soldier_attack(edict_t *self)
|
|||
|
||||
r = random();
|
||||
|
||||
if ((!(self->monsterinfo.aiflags & (AI_BLOCKED|AI_STAND_GROUND))) &&
|
||||
if ( (!(self->monsterinfo.aiflags & (AI_BLOCKED|AI_STAND_GROUND))) &&
|
||||
(range(self, self->enemy) >= RANGE_NEAR) &&
|
||||
(r < (skill->value*0.25) &&
|
||||
((self->s.skinnum % 6) <= 3)))
|
||||
// ((self->s.skinnum % 6) <= 3)) )
|
||||
(self->skinnum <= 3)) )
|
||||
{
|
||||
self->monsterinfo.currentmove = &soldier_move_attack6;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 4)
|
||||
// if ((self->s.skinnum % 6) < 4)
|
||||
if (self->skinnum < 4)
|
||||
{
|
||||
if (random() < 0.5)
|
||||
{
|
||||
|
@ -1010,7 +1030,7 @@ void soldier_attack(edict_t *self)
|
|||
// SIGHT
|
||||
//
|
||||
|
||||
void soldier_sight(edict_t *self, edict_t *other)
|
||||
void soldier_sight (edict_t *self, edict_t *other)
|
||||
{
|
||||
if (random() < 0.5)
|
||||
gi.sound (self, CHAN_VOICE, sound_sight1, 1, ATTN_NORM, 0);
|
||||
|
@ -1021,11 +1041,12 @@ void soldier_sight(edict_t *self, edict_t *other)
|
|||
if ((skill->value > 0) && (self->enemy) && (range(self, self->enemy) >= RANGE_NEAR))
|
||||
{
|
||||
// PMM - don't let machinegunners run & shoot
|
||||
if ((random() > 0.75) && ((self->s.skinnum % 6) <= 3))
|
||||
// if ((random() > 0.75) && ((self->s.skinnum % 6) <= 3))
|
||||
if ((random() > 0.75) && (self->skinnum <= 3))
|
||||
{
|
||||
// if ((self->classname == "monster_soldier_ripper") || (self->classname == "monster_soldier_hypergun") || (self->classname == "monster_soldier_lasergun"))
|
||||
// self->monsterinfo.currentmove = &soldierh_move_attack6;
|
||||
// else
|
||||
// if ((self->classname == "monster_soldier_ripper") || (self->classname == "monster_soldier_hypergun") || (self->classname == "monster_soldier_lasergun"))
|
||||
// self->monsterinfo.currentmove = &soldierh_move_attack6;
|
||||
// else
|
||||
self->monsterinfo.currentmove = &soldier_move_attack6;
|
||||
}
|
||||
}
|
||||
|
@ -1135,7 +1156,8 @@ void soldier_dodge (edict_t *self, edict_t *attacker, float eta, trace_t *tr)
|
|||
self->monsterinfo.aiflags |= AI_DODGING;
|
||||
self->monsterinfo.attack_state = AS_SLIDING;
|
||||
|
||||
else if ((self->s.skinnum % 6) <= 3)
|
||||
// else if ((self->s.skinnum % 6) <= 3)
|
||||
else if (self->skinnum <= 3)
|
||||
{
|
||||
if ((g_showlogic) && (g_showlogic->value))
|
||||
gi.dprintf ("shooting back!\n");
|
||||
|
@ -1202,16 +1224,16 @@ qboolean soldier_blocked (edict_t *self, float dist)
|
|||
if ((self->monsterinfo.aiflags & AI_DODGING) || (self->monsterinfo.aiflags & AI_DUCKED))
|
||||
return false;
|
||||
|
||||
if(blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
if (blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
return true;
|
||||
|
||||
// if(blocked_checkjump (self, dist, 192, 40))
|
||||
// if (blocked_checkjump (self, dist, 192, 40))
|
||||
// {
|
||||
// soldier_jump(self);
|
||||
// return true;
|
||||
// }
|
||||
|
||||
if(blocked_checkplat (self, dist))
|
||||
if (blocked_checkplat (self, dist))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -1242,10 +1264,10 @@ void soldier_dead (edict_t *self)
|
|||
M_FlyCheck (self);
|
||||
|
||||
// Lazarus monster fade
|
||||
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
if (world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
{
|
||||
self->think=FadeDieSink;
|
||||
self->nextthink=level.time+corpse_fadetime->value;
|
||||
self->think = FadeDieSink;
|
||||
self->nextthink = level.time+corpse_fadetime->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1558,9 +1580,11 @@ void soldier_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int dama
|
|||
self->s.skinnum |= 1;
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
|
||||
|
||||
if ((self->s.skinnum % 6) == 1)
|
||||
// if ((self->s.skinnum % 6) == 1)
|
||||
if (self->s.skinnum <= 1)
|
||||
gi.sound (self, CHAN_VOICE, sound_death_light, 1, ATTN_NORM, 0);
|
||||
else if ((self->s.skinnum % 6) == 3)
|
||||
// else if ((self->s.skinnum % 6) == 3)
|
||||
else if (self->s.skinnum <= 3)
|
||||
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
|
||||
else // ((self->s.skinnum % 6) == 5)
|
||||
gi.sound (self, CHAN_VOICE, sound_death_ss, 1, ATTN_NORM, 0);
|
||||
|
@ -1642,7 +1666,7 @@ void soldier_blind (edict_t *self)
|
|||
|
||||
void soldierh_idle (edict_t *self)
|
||||
{
|
||||
if(!(self->spawnflags & SF_MONSTER_AMBUSH))
|
||||
if (!(self->spawnflags & SF_MONSTER_AMBUSH))
|
||||
{
|
||||
if (random() > 0.8)
|
||||
gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
|
||||
|
@ -2006,8 +2030,8 @@ void soldierh_laserbeam (edict_t *self, int flash_index)
|
|||
|
||||
// RAFAEL
|
||||
// this sound can't be called this frequent
|
||||
if (random() > 0.8)
|
||||
gi.sound(self, CHAN_AUTO, gi.soundindex("misc/lasfly.wav"), 1, ATTN_STATIC, 0);
|
||||
// if (random() > 0.8)
|
||||
// gi.sound (self, CHAN_AUTO, gi.soundindex("misc/lasfly.wav"), 1, ATTN_STATIC, 0);
|
||||
|
||||
VectorCopy (self->s.origin, start);
|
||||
VectorCopy (self->enemy->s.origin, end);
|
||||
|
@ -2015,6 +2039,19 @@ void soldierh_laserbeam (edict_t *self, int flash_index)
|
|||
vectoangles (dir, angles);
|
||||
VectorCopy (monster_flash_offset[flash_index], tempvec);
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, self->s.origin))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
// RAFAEL
|
||||
// this sound can't be called this frequent
|
||||
if (random() > 0.8)
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("misc/lasfly.wav"), 1, ATTN_STATIC, 0);
|
||||
|
||||
ent = G_Spawn ();
|
||||
VectorCopy (self->s.origin, ent->s.origin);
|
||||
VectorCopy (angles, tempang);
|
||||
|
@ -2057,9 +2094,11 @@ void soldierh_fire (edict_t *self, int flash_number)
|
|||
int flash_index;
|
||||
qboolean tone = true;
|
||||
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
flash_index = blaster_flash[flash_number]; // ripper
|
||||
else if ((self->s.skinnum % 6) < 4)
|
||||
// else if ((self->s.skinnum % 6) < 4)
|
||||
else if (self->skinnum < 4)
|
||||
flash_index = blaster_flash[flash_number]; // hyperblaster
|
||||
else
|
||||
flash_index = machinegun_flash[flash_number]; // laserbeam
|
||||
|
@ -2077,7 +2116,7 @@ void soldierh_fire (edict_t *self, int flash_number)
|
|||
end[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
end[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
end[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -2103,13 +2142,15 @@ void soldierh_fire (edict_t *self, int flash_number)
|
|||
VectorNormalize (aim);
|
||||
}
|
||||
|
||||
if ((self->s.skinnum % 6) <= 1)
|
||||
// if ((self->s.skinnum % 6) <= 1)
|
||||
if (self->skinnum <= 1)
|
||||
{
|
||||
// RAFAEL 24-APR-98
|
||||
// droped the damage from 15 to 5
|
||||
monster_fire_ionripper (self, start, aim, 8, 600, flash_index, EF_IONRIPPER);
|
||||
}
|
||||
else if ((self->s.skinnum % 6) <= 3)
|
||||
// else if ((self->s.skinnum % 6) <= 3)
|
||||
else if (self->skinnum <= 3)
|
||||
{
|
||||
// monster_fire_blaster (self, start, aim, 4, 600, MZ_BLUEHYPERBLASTER, EF_BLUEHYPERBLASTER, BLASTER_BLUE);
|
||||
monster_fire_blueblaster (self, start, aim, 4, 600, MZ_BLUEHYPERBLASTER, EF_BLUEHYPERBLASTER);
|
||||
|
@ -2132,9 +2173,11 @@ void soldierh_fire (edict_t *self, int flash_number)
|
|||
|
||||
void soldierh_hyper_refire1 (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
return;
|
||||
else if ((self->s.skinnum % 6) < 4)
|
||||
// else if ((self->s.skinnum % 6) < 4)
|
||||
else if (self->skinnum < 4)
|
||||
{
|
||||
if (random() < 0.7)
|
||||
self->s.frame = FRAME_attak103;
|
||||
|
@ -2145,9 +2188,11 @@ void soldierh_hyper_refire1 (edict_t *self)
|
|||
|
||||
void soldierh_ripper1 (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
soldierh_fire (self, 0);
|
||||
else if ((self->s.skinnum % 6) < 4)
|
||||
// else if ((self->s.skinnum % 6) < 4)
|
||||
else if (self->skinnum < 4)
|
||||
soldierh_fire (self, 0);
|
||||
}
|
||||
|
||||
|
@ -2159,7 +2204,8 @@ void soldierh_fire1 (edict_t *self)
|
|||
|
||||
void soldierh_attack1_refire1 (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) > 1)
|
||||
// if ((self->s.skinnum % 6) > 1)
|
||||
if (self->skinnum > 1)
|
||||
return;
|
||||
|
||||
if (self->enemy->health <= 0)
|
||||
|
@ -2173,7 +2219,8 @@ void soldierh_attack1_refire1 (edict_t *self)
|
|||
|
||||
void soldierh_attack1_refire2 (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
return;
|
||||
|
||||
if (self->enemy->health <= 0)
|
||||
|
@ -2185,9 +2232,11 @@ void soldierh_attack1_refire2 (edict_t *self)
|
|||
|
||||
void soldierh_hyper_sound (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
return;
|
||||
else if ((self->s.skinnum % 6) < 4)
|
||||
// else if ((self->s.skinnum % 6) < 4)
|
||||
else if (self->skinnum < 4)
|
||||
gi.sound(self, CHAN_AUTO, gi.soundindex("weapons/hyprbl1a.wav"), 1, ATTN_NORM, 0);
|
||||
else
|
||||
return;
|
||||
|
@ -2214,9 +2263,11 @@ mmove_t soldierh_move_attack1 = {FRAME_attak101, FRAME_attak112, soldierh_frames
|
|||
|
||||
void soldierh_hyper_refire2 (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
return;
|
||||
else if ((self->s.skinnum % 6) < 4)
|
||||
// else if ((self->s.skinnum % 6) < 4)
|
||||
else if (self->skinnum < 4)
|
||||
{
|
||||
if (random() < 0.7)
|
||||
self->s.frame = FRAME_attak205;
|
||||
|
@ -2227,9 +2278,11 @@ void soldierh_hyper_refire2 (edict_t *self)
|
|||
|
||||
void soldierh_ripper2 (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
soldierh_fire (self, 1);
|
||||
else if ((self->s.skinnum % 6) < 4)
|
||||
// else if ((self->s.skinnum % 6) < 4)
|
||||
else if (self->skinnum < 4)
|
||||
soldierh_fire (self, 1);
|
||||
}
|
||||
|
||||
|
@ -2241,7 +2294,8 @@ void soldierh_fire2 (edict_t *self)
|
|||
|
||||
void soldierh_attack2_refire1 (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) > 1)
|
||||
// if ((self->s.skinnum % 6) > 1)
|
||||
if (self->skinnum > 1)
|
||||
return;
|
||||
|
||||
if (self->enemy->health <= 0)
|
||||
|
@ -2255,14 +2309,16 @@ void soldierh_attack2_refire1 (edict_t *self)
|
|||
|
||||
void soldierh_attack2_refire2 (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 2)
|
||||
// if ((self->s.skinnum % 6) < 2)
|
||||
if (self->skinnum < 2)
|
||||
return;
|
||||
|
||||
if (self->enemy->health <= 0)
|
||||
return;
|
||||
|
||||
if ( ((skill->value == 3) && (random() < 0.5))
|
||||
|| (range(self, self->enemy) == RANGE_MELEE) && (self->s.skinnum % 6) < 4)
|
||||
// || (range(self, self->enemy) == RANGE_MELEE) && (self->s.skinnum % 6) < 4)
|
||||
|| (range(self, self->enemy) == RANGE_MELEE) && (self->skinnum < 4) )
|
||||
self->monsterinfo.nextframe = FRAME_attak204;
|
||||
}
|
||||
|
||||
|
@ -2429,7 +2485,7 @@ mframe_t soldierh_frames_attack6 [] =
|
|||
};
|
||||
mmove_t soldierh_move_attack6 = {FRAME_runs01, FRAME_runs14, soldierh_frames_attack6, soldierh_run};
|
||||
|
||||
void soldierh_attack(edict_t *self)
|
||||
void soldierh_attack (edict_t *self)
|
||||
{
|
||||
float r, chance;
|
||||
|
||||
|
@ -2482,13 +2538,15 @@ void soldierh_attack(edict_t *self)
|
|||
if ((!(self->monsterinfo.aiflags & (AI_BLOCKED|AI_STAND_GROUND))) &&
|
||||
(range(self, self->enemy) >= RANGE_NEAR) &&
|
||||
(r < (skill->value*0.25) &&
|
||||
((self->s.skinnum % 6) <= 3)))
|
||||
// ((self->s.skinnum % 6) <= 3)))
|
||||
(self->skinnum <= 3)))
|
||||
{
|
||||
self->monsterinfo.currentmove = &soldierh_move_attack6;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 4)
|
||||
// if ((self->s.skinnum % 6) < 4)
|
||||
if (self->skinnum < 4)
|
||||
{
|
||||
if (random() < 0.5)
|
||||
self->monsterinfo.currentmove = &soldierh_move_attack1;
|
||||
|
@ -2507,7 +2565,7 @@ void soldierh_attack(edict_t *self)
|
|||
// SIGHT
|
||||
//
|
||||
|
||||
void soldierh_sight(edict_t *self, edict_t *other)
|
||||
void soldierh_sight (edict_t *self, edict_t *other)
|
||||
{
|
||||
if (random() < 0.5)
|
||||
gi.sound (self, CHAN_VOICE, sound_sight1, 1, ATTN_NORM, 0);
|
||||
|
@ -2518,7 +2576,8 @@ void soldierh_sight(edict_t *self, edict_t *other)
|
|||
{
|
||||
if (random() > 0.5)
|
||||
{
|
||||
if ((self->s.skinnum % 6) < 4)
|
||||
// if ((self->s.skinnum % 6) < 4)
|
||||
if (self->skinnum < 4)
|
||||
self->monsterinfo.currentmove = &soldierh_move_attack6;
|
||||
else
|
||||
self->monsterinfo.currentmove = &soldierh_move_attack4;
|
||||
|
@ -2592,10 +2651,11 @@ void soldierh_dodge (edict_t *self, edict_t *attacker, float eta)
|
|||
//
|
||||
// NEW DODGE CODE
|
||||
//
|
||||
//Knightmare- moved this code down here below soldierh frame declarations
|
||||
// Knightmare- moved this code down here below soldierh frame declarations
|
||||
void soldier_sidestep (edict_t *self)
|
||||
{
|
||||
if ((self->s.skinnum % 6) <= 3)
|
||||
// if ((self->s.skinnum % 6) <= 3)
|
||||
if (self->skinnum <= 3)
|
||||
{
|
||||
// if ((g_showlogic) && (g_showlogic->value))
|
||||
// gi.dprintf ("shooting back!\n");
|
||||
|
@ -2665,7 +2725,8 @@ void soldierh_fire6 (edict_t *self)
|
|||
{
|
||||
|
||||
// no fire laser
|
||||
if ((self->s.skinnum % 6) < 4)
|
||||
// if ((self->s.skinnum % 6) < 4)
|
||||
if (self->skinnum < 4)
|
||||
soldierh_fire (self, 5);
|
||||
|
||||
}
|
||||
|
@ -2674,7 +2735,8 @@ void soldierh_fire7 (edict_t *self)
|
|||
{
|
||||
|
||||
// no fire laser
|
||||
if ((self->s.skinnum % 6) < 4)
|
||||
// if ((self->s.skinnum % 6) < 4)
|
||||
if (self->skinnum < 4)
|
||||
soldierh_fire (self, 6);
|
||||
|
||||
}
|
||||
|
@ -2690,7 +2752,7 @@ void soldierh_dead (edict_t *self)
|
|||
M_FlyCheck (self);
|
||||
|
||||
// Lazarus monster fade
|
||||
if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
if (world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
{
|
||||
self->think=FadeDieSink;
|
||||
self->nextthink=level.time+corpse_fadetime->value;
|
||||
|
@ -2973,9 +3035,11 @@ void soldierh_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int dam
|
|||
self->s.skinnum |= 1;
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
|
||||
|
||||
if ((self->s.skinnum % 6) == 1)
|
||||
// if ((self->s.skinnum % 6) == 1)
|
||||
if (self->skinnum <= 1)
|
||||
gi.sound (self, CHAN_VOICE, sound_death_light, 1, ATTN_NORM, 0);
|
||||
else if ((self->s.skinnum % 6) == 3)
|
||||
// else if ((self->s.skinnum % 6) == 3)
|
||||
else if (self->skinnum <= 3)
|
||||
gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
|
||||
else // ((self->s.skinnum % 6) == 5)
|
||||
gi.sound (self, CHAN_VOICE, sound_death_ss, 1, ATTN_NORM, 0);
|
||||
|
@ -2999,6 +3063,7 @@ void soldierh_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int dam
|
|||
else
|
||||
self->monsterinfo.currentmove = &soldierh_move_death6;
|
||||
}
|
||||
|
||||
//
|
||||
// SPAWN
|
||||
//
|
||||
|
@ -3025,7 +3090,7 @@ void SP_monster_soldier_x (edict_t *self)
|
|||
sound_sight2 = gi.soundindex ("soldier/solsrch1.wav");
|
||||
sound_cock = gi.soundindex ("infantry/infatck3.wav");
|
||||
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 100;
|
||||
|
||||
self->pain = soldier_pain;
|
||||
|
@ -3095,11 +3160,11 @@ void SP_monster_soldier_light (edict_t *self)
|
|||
gi.soundindex ("soldier/solatck2.wav");
|
||||
self->common_name = "Light Guard";
|
||||
|
||||
//self->s.skinnum = 0;
|
||||
if(!self->health)
|
||||
// self->s.skinnum = 0;
|
||||
if (!self->health)
|
||||
self->health = 20;
|
||||
if(!self->gib_health)
|
||||
self->gib_health = -40; //was -30
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -40; // was -30
|
||||
|
||||
// PMM - blindfire
|
||||
self->monsterinfo.blindfire = true;
|
||||
|
@ -3107,7 +3172,8 @@ void SP_monster_soldier_light (edict_t *self)
|
|||
// calls walkmonster_start, which the health and everything else need to be set up for
|
||||
SP_monster_soldier_x (self);
|
||||
// Lazarus: custom skins
|
||||
self->s.skinnum = 6*self->style;
|
||||
self->s.skinnum = 0 + 8 * self->style; // was 0 + 6 * self->style
|
||||
self->skinnum = 0; // Knightmare- simplify skinnum checks by excluding custom styles
|
||||
}
|
||||
|
||||
/*QUAKED monster_soldier (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight GoodGuy NoGib
|
||||
|
@ -3126,16 +3192,17 @@ void SP_monster_soldier (edict_t *self)
|
|||
gi.soundindex ("soldier/solatck1.wav");
|
||||
self->common_name = "Shotgun Guard";
|
||||
|
||||
//self->s.skinnum = 2;
|
||||
if(!self->health)
|
||||
// self->s.skinnum = 2;
|
||||
if (!self->health)
|
||||
self->health = 30;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -40;
|
||||
//Knightmare- call generic spawn function LAST, because it
|
||||
// Knightmare- call generic spawn function LAST, because it
|
||||
// calls walkmonster_start, which the health and everything else need to be set up for
|
||||
SP_monster_soldier_x (self);
|
||||
// Lazarus: custom skins
|
||||
self->s.skinnum = 2 + 6*self->style;
|
||||
self->s.skinnum = 2 + 8 * self->style; // was 2 + 6 * self->style
|
||||
self->skinnum = 2; // Knightmare- simplify skinnum checks by excluding custom styles
|
||||
}
|
||||
|
||||
/*QUAKED monster_soldier_ss (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight GoodGuy NoGib
|
||||
|
@ -3153,16 +3220,82 @@ void SP_monster_soldier_ss (edict_t *self)
|
|||
gi.soundindex ("soldier/solatck3.wav");
|
||||
self->common_name = "Machinegun Guard";
|
||||
|
||||
//self->s.skinnum = 4;
|
||||
if(!self->health)
|
||||
// self->s.skinnum = 4;
|
||||
if (!self->health)
|
||||
self->health = 40;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -40;
|
||||
//Knightmare- call generic spawn function LAST, because it
|
||||
// Knightmare- call generic spawn function LAST, because it
|
||||
// calls walkmonster_start, which the health and everything else need to be set up for
|
||||
SP_monster_soldier_x (self);
|
||||
// Lazarus: custom skins
|
||||
self->s.skinnum = 4 + 6*self->style;
|
||||
self->s.skinnum = 4 + 8 * self->style; // was 4 + 6 * self->style
|
||||
self->skinnum = 4; // Knightmare- simplify skinnum checks by excluding custom styles
|
||||
}
|
||||
|
||||
/*QUAKED monster_soldier_plasma_re (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight GoodGuy NoGib
|
||||
*/
|
||||
void SP_monster_soldier_plasma_re (edict_t *self)
|
||||
{
|
||||
if (deathmatch->value)
|
||||
{
|
||||
G_FreeEdict (self);
|
||||
return;
|
||||
}
|
||||
|
||||
sound_pain_ss = gi.soundindex ("soldier/solpain3.wav");
|
||||
sound_death_ss = gi.soundindex ("soldier/soldeth3.wav");
|
||||
gi.modelindex ("models/objects/laser/tris.md2");
|
||||
gi.soundindex ("misc/lasfly.wav");
|
||||
gi.soundindex ("soldier/solatck2.wav");
|
||||
self->common_name = "Plasma Guard";
|
||||
|
||||
// self->s.skinnum = 0;
|
||||
if (!self->health)
|
||||
self->health = 50;
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -40; // was -30
|
||||
|
||||
// PMM - blindfire
|
||||
self->monsterinfo.blindfire = false;
|
||||
// Knightmare- call generic spawn function LAST, because it
|
||||
// calls walkmonster_start, which the health and everything else need to be set up for
|
||||
SP_monster_soldier_x (self);
|
||||
// Lazarus: custom skins
|
||||
self->s.skinnum = 6 + 8 * self->style;
|
||||
self->skinnum = 6; // Knightmare- simplify skinnum checks by excluding custom styles
|
||||
}
|
||||
|
||||
/*QUAKED monster_soldier_plasma_sp (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight GoodGuy NoGib
|
||||
*/
|
||||
void SP_monster_soldier_plasma_sp (edict_t *self)
|
||||
{
|
||||
if (deathmatch->value)
|
||||
{
|
||||
G_FreeEdict (self);
|
||||
return;
|
||||
}
|
||||
|
||||
sound_pain_ss = gi.soundindex ("soldier/solpain3.wav");
|
||||
sound_death_ss = gi.soundindex ("soldier/soldeth3.wav");
|
||||
gi.soundindex ("soldier/solatck1.wav");
|
||||
self->common_name = "Plasma Guard";
|
||||
|
||||
// self->s.skinnum = 2;
|
||||
if (!self->health)
|
||||
self->health = 50;
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -40;
|
||||
|
||||
// PMM - blindfire
|
||||
self->monsterinfo.blindfire = true;
|
||||
// Knightmare- call generic spawn function LAST, because it
|
||||
// calls walkmonster_start, which the health and everything else need to be set up for
|
||||
SP_monster_soldier_x (self);
|
||||
// Lazarus: custom skins
|
||||
self->s.skinnum = 6 + 8 * self->style;
|
||||
self->skinnum = 6; // Knightmare- simplify skinnum checks by excluding custom styles
|
||||
self->moreflags |= FL2_WEAPON_ALT; // special flag for spread mode
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -3187,7 +3320,7 @@ void SP_monster_soldier_h (edict_t *self)
|
|||
sound_sight2 = gi.soundindex ("soldier/solsrch1.wav");
|
||||
sound_cock = gi.soundindex ("infantry/infatck3.wav");
|
||||
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 100;
|
||||
|
||||
self->pain = soldierh_pain;
|
||||
|
@ -3211,7 +3344,7 @@ void SP_monster_soldier_h (edict_t *self)
|
|||
//=====
|
||||
|
||||
// Lazarus
|
||||
if(self->powerarmor)
|
||||
if (self->powerarmor)
|
||||
{
|
||||
if (self->powerarmortype == 1)
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
|
||||
|
@ -3261,9 +3394,9 @@ void SP_monster_soldier_ripper (edict_t *self)
|
|||
self->common_name = "Ripper Guard";
|
||||
|
||||
//self->s.skinnum = 0;
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 50;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -40;
|
||||
|
||||
// PMM - blindfire
|
||||
|
@ -3272,7 +3405,8 @@ void SP_monster_soldier_ripper (edict_t *self)
|
|||
// calls walkmonster_start, which the health and everything else need to be set up for
|
||||
SP_monster_soldier_h (self);
|
||||
// Lazarus: custom skins
|
||||
self->s.skinnum = 6*self->style;
|
||||
self->s.skinnum = 0 + 6 * self->style;
|
||||
self->skinnum = 0; // Knightmare- simplify skinnum checks by excluding custom styles
|
||||
}
|
||||
|
||||
/*QUAKED monster_soldier_hypergun (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight GoodGuy NoGib
|
||||
|
@ -3294,9 +3428,9 @@ void SP_monster_soldier_hypergun (edict_t *self)
|
|||
self->common_name = "Hyperblaster Guard";
|
||||
|
||||
//self->s.skinnum = 2;
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 60;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -40;
|
||||
|
||||
// PMM - blindfire
|
||||
|
@ -3305,7 +3439,8 @@ void SP_monster_soldier_hypergun (edict_t *self)
|
|||
// calls walkmonster_start, which the health and everything else need to be set up for
|
||||
SP_monster_soldier_h (self);
|
||||
// Lazarus: custom skins
|
||||
self->s.skinnum = 2 + 6*self->style;
|
||||
self->s.skinnum = 2 + 6 * self->style;
|
||||
self->skinnum = 2; // Knightmare- simplify skinnum checks by excluding custom styles
|
||||
}
|
||||
|
||||
/*QUAKED monster_soldier_lasergun (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight GoodGuy NoGib ThroughGlass
|
||||
|
@ -3324,16 +3459,17 @@ void SP_monster_soldier_lasergun (edict_t *self)
|
|||
self->common_name = "Laser Guard";
|
||||
|
||||
//self->s.skinnum = 4;
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 70;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -40;
|
||||
|
||||
// Knightmare- call generic spawn function LAST, because it
|
||||
// calls walkmonster_start, which the health and everything else need to be set up for
|
||||
SP_monster_soldier_h (self);
|
||||
// Lazarus: custom skins
|
||||
self->s.skinnum = 4 + 6*self->style;
|
||||
self->s.skinnum = 4 + 6 * self->style;
|
||||
self->skinnum = 4; // Knightmare- simplify skinnum checks by excluding custom styles
|
||||
}
|
||||
|
||||
// END 13-APR-98
|
||||
|
|
|
@ -481,7 +481,7 @@ void supertankRocket (edict_t *self)
|
|||
vec3_t vec;
|
||||
int flash_number;
|
||||
|
||||
if(!self->enemy || !self->enemy->inuse) //PGM
|
||||
if (!self->enemy || !self->enemy->inuse) //PGM
|
||||
return; //PGM
|
||||
|
||||
if (self->s.frame == FRAME_attak2_8)
|
||||
|
@ -498,7 +498,7 @@ void supertankRocket (edict_t *self)
|
|||
vec[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -521,7 +521,7 @@ void supertankMachineGun (edict_t *self)
|
|||
vec3_t forward, right;
|
||||
int flash_number;
|
||||
|
||||
if(!self->enemy || !self->enemy->inuse) //PGM
|
||||
if (!self->enemy || !self->enemy->inuse) //PGM
|
||||
return; //PGM
|
||||
|
||||
flash_number = MZ2_SUPERTANK_MACHINEGUN_1 + (self->s.frame - FRAME_attak1_1);
|
||||
|
@ -541,7 +541,7 @@ void supertankMachineGun (edict_t *self)
|
|||
vec[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -550,7 +550,15 @@ void supertankMachineGun (edict_t *self)
|
|||
|
||||
VectorSubtract (vec, start, forward);
|
||||
VectorNormalize (forward);
|
||||
}
|
||||
}
|
||||
|
||||
// Zaero add
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
monster_fire_bullet (self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number);
|
||||
}
|
||||
|
@ -713,10 +721,10 @@ void supertank_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int da
|
|||
//PGM
|
||||
qboolean supertank_blocked (edict_t *self, float dist)
|
||||
{
|
||||
if(blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
if (blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
return true;
|
||||
|
||||
if(blocked_checkplat (self, dist))
|
||||
if (blocked_checkplat (self, dist))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -762,11 +770,11 @@ void SP_monster_supertank (edict_t *self)
|
|||
VectorSet (self->mins, -64, -64, 0);
|
||||
VectorSet (self->maxs, 64, 64, 112);
|
||||
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 1500;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -999;
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 800;
|
||||
|
||||
self->pain = supertank_pain;
|
||||
|
@ -787,7 +795,7 @@ void SP_monster_supertank (edict_t *self)
|
|||
self->fogclip |= 2; //custom bloodtype flag
|
||||
|
||||
// Lazarus
|
||||
if(self->powerarmor)
|
||||
if (self->powerarmor)
|
||||
{
|
||||
if (self->powerarmortype == 1)
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
|
||||
|
|
|
@ -322,7 +322,7 @@ void TankBlaster (edict_t *self)
|
|||
vec3_t dir;
|
||||
int flash_number;
|
||||
|
||||
if(!self->enemy || !self->enemy->inuse) //PGM
|
||||
if (!self->enemy || !self->enemy->inuse) //PGM
|
||||
return; //PGM
|
||||
|
||||
if (self->s.frame == FRAME_attak110)
|
||||
|
@ -339,7 +339,7 @@ void TankBlaster (edict_t *self)
|
|||
end[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
end[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
end[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -368,11 +368,12 @@ void TankRocket (edict_t *self)
|
|||
vec3_t target;
|
||||
qboolean blindfire = false;
|
||||
|
||||
if(!self->enemy || !self->enemy->inuse) //PGM
|
||||
if (!self->enemy || !self->enemy->inuse) //PGM
|
||||
return; //PGM
|
||||
|
||||
// pmm - blindfire check
|
||||
if (self->monsterinfo.aiflags & AI_MANUAL_STEERING)
|
||||
// if ( (self->monsterinfo.aiflags & AI_MANUAL_STEERING) && !IsZaeroMap() ) // Knightmare- no blind firing on Zaero maps, fix undesired airfield behavior
|
||||
blindfire = true;
|
||||
else
|
||||
blindfire = false;
|
||||
|
@ -409,7 +410,7 @@ void TankRocket (edict_t *self)
|
|||
}
|
||||
// pmm
|
||||
// don't shoot at feet if they're above me.
|
||||
else if(random() < 0.66 || (start[2] < self->enemy->absmin[2]))
|
||||
else if (random() < 0.66 || (start[2] < self->enemy->absmin[2]))
|
||||
{
|
||||
// gi.dprintf("normal shot\n");
|
||||
VectorCopy (self->enemy->s.origin, vec);
|
||||
|
@ -423,7 +424,7 @@ void TankRocket (edict_t *self)
|
|||
}
|
||||
//PGM
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -435,7 +436,7 @@ void TankRocket (edict_t *self)
|
|||
// 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((!blindfire) && (random() < (0.2 + skill->value * 0.15))
|
||||
if ((!blindfire) && (random() < (0.2 + skill->value * 0.15))
|
||||
&& !(self->spawnflags & SF_MONSTER_SPECIAL))
|
||||
{
|
||||
float dist;
|
||||
|
@ -500,9 +501,9 @@ void TankRocket (edict_t *self)
|
|||
else
|
||||
{
|
||||
trace = gi.trace(start, vec3_origin, vec3_origin, vec, self, MASK_SHOT);
|
||||
if(trace.ent == self->enemy || trace.ent == world)
|
||||
if (trace.ent == self->enemy || trace.ent == world)
|
||||
{
|
||||
if(trace.fraction > 0.5 || (trace.ent && trace.ent->client))
|
||||
if (trace.fraction > 0.5 || (trace.ent && trace.ent->client))
|
||||
// monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_CHICK_ROCKET_1);
|
||||
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_CHICK_ROCKET_1,
|
||||
(self->spawnflags & SF_MONSTER_SPECIAL ? self->enemy : NULL) );
|
||||
|
@ -521,7 +522,7 @@ void TankMachineGun (edict_t *self)
|
|||
vec3_t forward, right;
|
||||
int flash_number;
|
||||
|
||||
if(!self->enemy || !self->enemy->inuse) //PGM
|
||||
if (!self->enemy || !self->enemy->inuse) //PGM
|
||||
return; //PGM
|
||||
|
||||
flash_number = MZ2_TANK_MACHINEGUN_1 + (self->s.frame - FRAME_attak406);
|
||||
|
@ -535,7 +536,7 @@ void TankMachineGun (edict_t *self)
|
|||
vec[2] += self->enemy->viewheight;
|
||||
|
||||
// Lazarus fog reduction of accuracy
|
||||
if(self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
if (self->monsterinfo.visibility < FOG_CANSEEGOOD)
|
||||
{
|
||||
vec[0] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
vec[1] += crandom() * 640 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
|
@ -558,6 +559,14 @@ void TankMachineGun (edict_t *self)
|
|||
|
||||
AngleVectors (dir, forward, NULL, NULL);
|
||||
|
||||
// Zaero
|
||||
if (EMPNukeCheck(self, start))
|
||||
{
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
monster_fire_bullet (self, start, forward, 20, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number);
|
||||
}
|
||||
|
||||
|
@ -907,7 +916,7 @@ void tank_dead (edict_t *self)
|
|||
|
||||
//Knightmare- dead tanks are really too big to fade away
|
||||
// Lazarus monster fade
|
||||
/* if(world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
/* if (world->effects & FX_WORLDSPAWN_CORPSEFADE)
|
||||
{
|
||||
self->think=FadeDieSink;
|
||||
self->nextthink=level.time+corpse_fadetime->value;
|
||||
|
@ -991,10 +1000,10 @@ void tank_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage,
|
|||
//PGM
|
||||
qboolean tank_blocked (edict_t *self, float dist)
|
||||
{
|
||||
if(blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
if (blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
|
||||
return true;
|
||||
|
||||
if(blocked_checkplat (self, dist))
|
||||
if (blocked_checkplat (self, dist))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -1052,22 +1061,22 @@ void SP_monster_tank (edict_t *self)
|
|||
|
||||
if (strcmp(self->classname, "monster_tank_commander") == 0)
|
||||
{
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 1000;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -400;
|
||||
self->common_name = "Tank Commander";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 750;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -400;
|
||||
self->common_name = "Tank";
|
||||
}
|
||||
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 500;
|
||||
|
||||
self->pain = tank_pain;
|
||||
|
@ -1088,7 +1097,7 @@ void SP_monster_tank (edict_t *self)
|
|||
self->fogclip |= 2; //custom bloodtype flag
|
||||
|
||||
// Lazarus
|
||||
if(self->powerarmor)
|
||||
if (self->powerarmor)
|
||||
{
|
||||
if (self->powerarmortype == 1)
|
||||
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
|
||||
|
@ -1097,7 +1106,7 @@ void SP_monster_tank (edict_t *self)
|
|||
self->monsterinfo.power_armor_power = self->powerarmor;
|
||||
}
|
||||
|
||||
if(!self->monsterinfo.flies)
|
||||
if (!self->monsterinfo.flies)
|
||||
self->monsterinfo.flies = 0.05;
|
||||
|
||||
gi.linkentity (self);
|
||||
|
@ -1108,7 +1117,7 @@ void SP_monster_tank (edict_t *self)
|
|||
walkmonster_start(self);
|
||||
|
||||
// PMM
|
||||
//self->monsterinfo.aiflags |= AI_IGNORE_SHOTS;
|
||||
// self->monsterinfo.aiflags |= AI_IGNORE_SHOTS;
|
||||
self->monsterinfo.blindfire = true;
|
||||
//pmm
|
||||
// pmm
|
||||
}
|
||||
|
|
|
@ -41,24 +41,38 @@ mmove_t turret_move_fire_blind;
|
|||
|
||||
void TurretAim (edict_t *self)
|
||||
{
|
||||
vec3_t end, dir;
|
||||
vec3_t ang;
|
||||
float move, idealPitch, idealYaw, current, speed;
|
||||
int orientation;
|
||||
qboolean is_spinning = false;
|
||||
vec3_t end, dir;
|
||||
vec3_t ang;
|
||||
float move, idealPitch, idealYaw, current, speed, turn_yaw=0.0f;
|
||||
int orientation;
|
||||
qboolean is_spinning = false;
|
||||
qboolean is_turning = false;
|
||||
|
||||
// gi.dprintf("turret_aim: %d %d\n", self->s.frame, self->monsterinfo.nextframe);
|
||||
// gi.dprintf("turret_aim: %d %d\n", self->s.frame, self->monsterinfo.nextframe);
|
||||
|
||||
if (self->movewith_set && self->movewith_ent && self->movewith_ent->inuse
|
||||
&& (!strcmp(self->movewith_ent->classname, "func_rotating")
|
||||
|| !strcmp(self->movewith_ent->classname, "func_rotating_dh")
|
||||
|| !strcmp(self->movewith_ent->classname, "func_trackchange") )
|
||||
&& (self->movewith_ent->avelocity[YAW]))
|
||||
&& (self->movewith_ent->avelocity[YAW])) {
|
||||
is_spinning = true;
|
||||
turn_yaw = self->movewith_ent->avelocity[YAW] * FRAMETIME;
|
||||
}
|
||||
|
||||
if (self->movewith_set && self->movewith_ent && self->movewith_ent->inuse
|
||||
&& (!strcmp(self->movewith_ent->classname, "func_train")
|
||||
|| !strcmp(self->movewith_ent->classname, "func_tracktrain")
|
||||
|| !strcmp(self->movewith_ent->classname, "model_train")
|
||||
|| !strcmp(self->movewith_ent->classname, "func_door_rotating")
|
||||
|| !strcmp(self->movewith_ent->classname, "func_door_swinging") )
|
||||
&& (self->movewith_ent->avelocity[YAW])) {
|
||||
is_turning = true;
|
||||
turn_yaw = self->movewith_ent->avelocity[YAW] * FRAMETIME;
|
||||
}
|
||||
|
||||
if (!self->enemy || self->enemy == world)
|
||||
{
|
||||
if(!FindTarget (self))
|
||||
if (!FindTarget (self))
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -68,19 +82,19 @@ void TurretAim (edict_t *self)
|
|||
return;
|
||||
|
||||
// if turret is still in inactive mode, ready the gun, but don't aim
|
||||
if(self->s.frame < FRAME_active01)
|
||||
if (self->s.frame < FRAME_active01)
|
||||
{
|
||||
turret_ready_gun(self);
|
||||
turret_ready_gun (self);
|
||||
return;
|
||||
}
|
||||
// if turret is still readying, don't aim.
|
||||
if(self->s.frame < FRAME_run01)
|
||||
if (self->s.frame < FRAME_run01)
|
||||
return;
|
||||
|
||||
// PMM - blindfire aiming here
|
||||
if (self->monsterinfo.currentmove == &turret_move_fire_blind)// && !is_spinning)
|
||||
if (self->monsterinfo.currentmove == &turret_move_fire_blind) // && !is_spinning)
|
||||
{
|
||||
VectorCopy(self->monsterinfo.blind_fire_target, end);
|
||||
VectorCopy (self->monsterinfo.blind_fire_target, end);
|
||||
if (self->enemy->s.origin[2] < self->monsterinfo.blind_fire_target[2])
|
||||
end[2] += self->enemy->viewheight + 10;
|
||||
else
|
||||
|
@ -88,13 +102,13 @@ void TurretAim (edict_t *self)
|
|||
}
|
||||
else
|
||||
{
|
||||
VectorCopy(self->enemy->s.origin, end);
|
||||
VectorCopy (self->enemy->s.origin, end);
|
||||
if (self->enemy->client)
|
||||
end[2] += self->enemy->viewheight;
|
||||
}
|
||||
|
||||
VectorSubtract(end, self->s.origin, dir);
|
||||
vectoangles2(dir, ang);
|
||||
VectorSubtract (end, self->s.origin, dir);
|
||||
vectoangles2 (dir, ang);
|
||||
|
||||
//
|
||||
// Clamp first
|
||||
|
@ -132,22 +146,33 @@ void TurretAim (edict_t *self)
|
|||
else if (idealPitch < -85)
|
||||
idealPitch = -85;
|
||||
|
||||
if (idealYaw > orientation+180)
|
||||
if ( idealYaw > (orientation+180) )
|
||||
idealYaw -= 360;
|
||||
if (idealYaw < orientation-180)
|
||||
if ( idealYaw < (orientation-180) )
|
||||
idealYaw += 360;
|
||||
|
||||
if (idealYaw > orientation+85) {
|
||||
if (is_spinning) // Knightmare- if out of range, point to front
|
||||
idealYaw = orientation;
|
||||
else
|
||||
idealYaw = orientation+85;
|
||||
if (is_turning) // Knightmare- factor in avelocity of parent entity
|
||||
{
|
||||
// gi.dprintf("turret_aim: clamping yaw for turning parent entity\n");
|
||||
if ( idealYaw > (orientation + turn_yaw + 85) )
|
||||
idealYaw = orientation + turn_yaw + 85;
|
||||
else if ( idealYaw < (orientation + turn_yaw - 85) )
|
||||
idealYaw = orientation + turn_yaw - 85;
|
||||
}
|
||||
else if (idealYaw < orientation-85) {
|
||||
if (is_spinning) // Knightmare- if out of range, point to front
|
||||
else if (is_spinning) // Knightmare- if out of range, point to front
|
||||
{
|
||||
// gi.dprintf("turret_aim: clamping yaw for spinning parent entity\n");
|
||||
if ( idealYaw > (orientation + 85) )
|
||||
idealYaw = orientation;
|
||||
else
|
||||
idealYaw = orientation-85;
|
||||
else if ( idealYaw < (orientation - 85) )
|
||||
idealYaw = orientation;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( idealYaw > (orientation + 85) )
|
||||
idealYaw = orientation + 85;
|
||||
else if ( idealYaw < (orientation - 85) )
|
||||
idealYaw = orientation - 85;
|
||||
}
|
||||
break;
|
||||
// end Knightmare
|
||||
|
@ -159,18 +184,18 @@ void TurretAim (edict_t *self)
|
|||
current = self->s.angles[PITCH];
|
||||
speed = self->yaw_speed;
|
||||
|
||||
if(idealPitch != current)
|
||||
if (idealPitch != current)
|
||||
{
|
||||
move = idealPitch - current;
|
||||
|
||||
while(move >= 360)
|
||||
while (move >= 360)
|
||||
move -= 360;
|
||||
if (move >= 90)
|
||||
{
|
||||
move = move - 360;
|
||||
}
|
||||
|
||||
while(move <= -360)
|
||||
while (move <= -360)
|
||||
move += 360;
|
||||
if (move <= -90)
|
||||
{
|
||||
|
@ -197,7 +222,7 @@ void TurretAim (edict_t *self)
|
|||
current = self->s.angles[YAW];
|
||||
speed = self->yaw_speed;
|
||||
|
||||
if(idealYaw != current)
|
||||
if (idealYaw != current)
|
||||
{
|
||||
move = idealYaw - current;
|
||||
|
||||
|
@ -239,7 +264,7 @@ mmove_t turret_move_stand = {FRAME_stand01, FRAME_stand02, turret_frames_stand,
|
|||
|
||||
void turret_stand (edict_t *self)
|
||||
{
|
||||
//gi.dprintf("turret_stand\n");
|
||||
// gi.dprintf("turret_stand\n");
|
||||
self->monsterinfo.currentmove = &turret_move_stand;
|
||||
}
|
||||
|
||||
|
@ -271,7 +296,7 @@ mmove_t turret_move_seek = {FRAME_run01, FRAME_run02, turret_frames_seek, NULL};
|
|||
|
||||
void turret_walk (edict_t *self)
|
||||
{
|
||||
if(self->s.frame < FRAME_run01)
|
||||
if (self->s.frame < FRAME_run01)
|
||||
turret_ready_gun(self);
|
||||
else
|
||||
self->monsterinfo.currentmove = &turret_move_seek;
|
||||
|
@ -287,7 +312,7 @@ mmove_t turret_move_run = {FRAME_run01, FRAME_run02, turret_frames_run, turret_r
|
|||
|
||||
void turret_run (edict_t *self)
|
||||
{
|
||||
if(self->s.frame < FRAME_run01)
|
||||
if (self->s.frame < FRAME_run01)
|
||||
turret_ready_gun(self);
|
||||
else
|
||||
self->monsterinfo.currentmove = &turret_move_run;
|
||||
|
@ -305,12 +330,12 @@ void Turret_Railgun_Fire (edict_t *self)
|
|||
{
|
||||
vec3_t start, dir;
|
||||
|
||||
TurretAim(self);
|
||||
TurretAim (self);
|
||||
|
||||
VectorCopy(self->s.origin, start);
|
||||
VectorCopy (self->s.origin, start);
|
||||
// trail the target....
|
||||
// VectorMA(end, -0.2, self->enemy->velocity, end);
|
||||
VectorSubtract(self->aim_point, start, dir);
|
||||
VectorSubtract (self->aim_point, start, dir);
|
||||
VectorNormalize(dir);
|
||||
|
||||
monster_fire_railgun (self, start, dir, 50, 0, MZ2_GLADIATOR_RAILGUN_1);
|
||||
|
@ -323,12 +348,12 @@ void Turret_Railgun_Aim (edict_t *self)
|
|||
{
|
||||
vec3_t end;
|
||||
|
||||
TurretAim(self);
|
||||
TurretAim (self);
|
||||
|
||||
if(!self->enemy || !self->enemy->inuse)
|
||||
if (!self->enemy || !self->enemy->inuse)
|
||||
return;
|
||||
|
||||
VectorCopy(self->enemy->s.origin, end);
|
||||
VectorCopy (self->enemy->s.origin, end);
|
||||
// aim for the head.
|
||||
if ((self->enemy) && (self->enemy->client))
|
||||
end[2]+=self->enemy->viewheight;
|
||||
|
@ -348,16 +373,16 @@ void TurretFire (edict_t *self)
|
|||
trace_t trace;
|
||||
int rocketSpeed;
|
||||
|
||||
TurretAim(self);
|
||||
TurretAim (self);
|
||||
|
||||
if(!self->enemy || !self->enemy->inuse)
|
||||
if (!self->enemy || !self->enemy->inuse)
|
||||
return;
|
||||
|
||||
VectorSubtract(self->enemy->s.origin, self->s.origin, dir);
|
||||
VectorSubtract (self->enemy->s.origin, self->s.origin, dir);
|
||||
VectorNormalize(dir);
|
||||
AngleVectors(self->s.angles, forward, NULL, NULL);
|
||||
chance = DotProduct(dir, forward);
|
||||
if(chance < 0.98)
|
||||
if (chance < 0.98)
|
||||
{
|
||||
// gi.dprintf("off-angle\n");
|
||||
return;
|
||||
|
@ -394,10 +419,10 @@ void TurretFire (edict_t *self)
|
|||
// up the fire chance 20% per skill level.
|
||||
chance = chance - (0.2 * skill->value);
|
||||
|
||||
if(/*chance < 0.5 && */visible(self, self->enemy))
|
||||
if (/*chance < 0.5 && */visible(self, self->enemy))
|
||||
{
|
||||
VectorCopy(self->s.origin, start);
|
||||
VectorCopy(self->enemy->s.origin, end);
|
||||
VectorCopy (self->s.origin, start);
|
||||
VectorCopy (self->enemy->s.origin, end);
|
||||
|
||||
// aim for the head.
|
||||
if ((self->enemy) && (self->enemy->client))
|
||||
|
@ -413,16 +438,16 @@ void TurretFire (edict_t *self)
|
|||
end[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
}
|
||||
|
||||
VectorSubtract(end, start, dir);
|
||||
VectorSubtract (end, start, dir);
|
||||
dist = VectorLength(dir);
|
||||
|
||||
// check for predictive fire if distance less than 512
|
||||
if(!(self->spawnflags & SPAWN_INSTANT_WEAPON) && (dist<512))
|
||||
if (!(self->spawnflags & SPAWN_INSTANT_WEAPON) && (dist<512))
|
||||
{
|
||||
chance = random();
|
||||
// ramp chance. easy - 50%, avg - 60%, hard - 70%, nightmare - 80%
|
||||
chance += (3 - skill->value) * 0.1;
|
||||
if(chance < 0.8)
|
||||
if (chance < 0.8)
|
||||
{
|
||||
// lead the target....
|
||||
time = dist / 1000;
|
||||
|
@ -436,17 +461,17 @@ void TurretFire (edict_t *self)
|
|||
end[2] += crandom() * 320 * (FOG_CANSEEGOOD - self->monsterinfo.visibility);
|
||||
}
|
||||
|
||||
VectorSubtract(end, start, dir);
|
||||
VectorSubtract (end, start, dir);
|
||||
}
|
||||
}
|
||||
|
||||
VectorNormalize(dir);
|
||||
trace = gi.trace(start, vec3_origin, vec3_origin, end, self, MASK_SHOT);
|
||||
if(trace.ent == self->enemy || trace.ent == world || (self->monsterinfo.visibility < FOG_CANSEEGOOD))
|
||||
if (trace.ent == self->enemy || trace.ent == world || (self->monsterinfo.visibility < FOG_CANSEEGOOD))
|
||||
{
|
||||
if(self->spawnflags & SPAWN_BLASTER)
|
||||
if (self->spawnflags & SPAWN_BLASTER)
|
||||
monster_fire_blaster(self, start, dir, 20, rocketSpeed, MZ2_TURRET_BLASTER, EF_BLASTER, BLASTER_ORANGE);
|
||||
else if(self->spawnflags & SPAWN_RAILGUN && self->last_fire_time <= level.time) //was SPAWN_MACHINEGUN
|
||||
else if (self->spawnflags & SPAWN_RAILGUN && self->last_fire_time <= level.time) //was SPAWN_MACHINEGUN
|
||||
{
|
||||
//monster_fire_bullet (self, start, dir, TURRET_BULLET_DAMAGE, 0, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_TURRET_MACHINEGUN);
|
||||
gi.sound (self, CHAN_WEAPON, gi.soundindex ("gladiator/railgun.wav"), 1, ATTN_NORM, 0);
|
||||
|
@ -454,9 +479,9 @@ void TurretFire (edict_t *self)
|
|||
self->nextthink = level.time + 2 * FRAMETIME;
|
||||
self->last_fire_time = level.time + 1.5;
|
||||
}
|
||||
else if(self->spawnflags & SPAWN_ROCKET)
|
||||
else if (self->spawnflags & SPAWN_ROCKET)
|
||||
{
|
||||
if(dist * trace.fraction > 72)
|
||||
if (dist * trace.fraction > 72)
|
||||
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_TURRET_ROCKET, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -471,16 +496,16 @@ void TurretFireBlind (edict_t *self)
|
|||
float dist, chance;
|
||||
int rocketSpeed;
|
||||
|
||||
TurretAim(self);
|
||||
TurretAim (self);
|
||||
|
||||
if(!self->enemy || !self->enemy->inuse)
|
||||
if (!self->enemy || !self->enemy->inuse)
|
||||
return;
|
||||
|
||||
VectorSubtract(self->monsterinfo.blind_fire_target, self->s.origin, dir);
|
||||
VectorSubtract (self->monsterinfo.blind_fire_target, self->s.origin, dir);
|
||||
VectorNormalize(dir);
|
||||
AngleVectors(self->s.angles, forward, NULL, NULL);
|
||||
chance = DotProduct(dir, forward);
|
||||
if(chance < 0.98)
|
||||
if (chance < 0.98)
|
||||
{
|
||||
// gi.dprintf("off-angle\n");
|
||||
return;
|
||||
|
@ -499,22 +524,22 @@ void TurretFireBlind (edict_t *self)
|
|||
}
|
||||
}
|
||||
|
||||
VectorCopy(self->s.origin, start);
|
||||
VectorCopy(self->monsterinfo.blind_fire_target, end);
|
||||
VectorCopy (self->s.origin, start);
|
||||
VectorCopy (self->monsterinfo.blind_fire_target, end);
|
||||
|
||||
if (self->enemy->s.origin[2] < self->monsterinfo.blind_fire_target[2])
|
||||
end[2] += self->enemy->viewheight + 10;
|
||||
else
|
||||
end[2] += self->enemy->mins[2] - 10;
|
||||
|
||||
VectorSubtract(end, start, dir);
|
||||
VectorSubtract (end, start, dir);
|
||||
dist = VectorLength(dir);
|
||||
|
||||
VectorNormalize(dir);
|
||||
|
||||
if (self->spawnflags & SPAWN_BLASTER)
|
||||
monster_fire_blaster(self, start, dir, 20, 1000, MZ2_TURRET_BLASTER, EF_BLASTER, BLASTER_ORANGE);
|
||||
else if(self->spawnflags & SPAWN_ROCKET)
|
||||
else if (self->spawnflags & SPAWN_ROCKET)
|
||||
monster_fire_rocket (self, start, dir, 50, rocketSpeed, MZ2_TURRET_ROCKET, NULL);
|
||||
}
|
||||
//pmm
|
||||
|
@ -545,7 +570,7 @@ void turret_attack(edict_t *self)
|
|||
{
|
||||
float r, chance;
|
||||
|
||||
if(self->s.frame < FRAME_run01)
|
||||
if (self->s.frame < FRAME_run01)
|
||||
turret_ready_gun(self);
|
||||
// PMM
|
||||
else if (self->monsterinfo.attack_state != AS_BLIND)
|
||||
|
@ -614,7 +639,7 @@ void turret_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag
|
|||
ThrowDebris (self, "models/objects/debris1/tris.md2", 1, start, 0, 0);
|
||||
ThrowDebris (self, "models/objects/debris1/tris.md2", 2, start, 0, 0);
|
||||
|
||||
if(self->teamchain)
|
||||
if (self->teamchain)
|
||||
{
|
||||
base = self->teamchain;
|
||||
base->solid = SOLID_BBOX;
|
||||
|
@ -623,9 +648,9 @@ void turret_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag
|
|||
gi.linkentity (base);
|
||||
}
|
||||
|
||||
if(self->target)
|
||||
if (self->target)
|
||||
{
|
||||
if(self->enemy && self->enemy->inuse)
|
||||
if (self->enemy && self->enemy->inuse)
|
||||
G_UseTargets (self, self->enemy);
|
||||
else
|
||||
G_UseTargets (self, self);
|
||||
|
@ -646,15 +671,15 @@ void turret_wall_spawn (edict_t *turret)
|
|||
|
||||
ent = G_Spawn();
|
||||
ent->classname = "turret_wall";
|
||||
VectorCopy(turret->s.origin, ent->s.origin);
|
||||
VectorCopy(turret->s.angles, turret->deploy_angles);
|
||||
VectorCopy(turret->s.angles, ent->s.angles);
|
||||
VectorCopy(ent->s.angles, ent->deploy_angles);
|
||||
VectorCopy (turret->s.origin, ent->s.origin);
|
||||
VectorCopy (turret->s.angles, turret->deploy_angles);
|
||||
VectorCopy (turret->s.angles, ent->s.angles);
|
||||
VectorCopy (ent->s.angles, ent->deploy_angles);
|
||||
|
||||
angle = ent->s.angles[1];
|
||||
if(ent->s.angles[0] == 90)
|
||||
if (ent->s.angles[0] == 90)
|
||||
angle = -1;
|
||||
else if(ent->s.angles[0] == 270)
|
||||
else if (ent->s.angles[0] == 270)
|
||||
angle = -2;
|
||||
switch (angle)
|
||||
{
|
||||
|
@ -706,22 +731,22 @@ void turret_wall_spawn (edict_t *turret)
|
|||
break;
|
||||
}
|
||||
|
||||
/*if (turret->s.angles[0] == 270)
|
||||
VectorSet (forward, 0,0,1);
|
||||
/* if (turret->s.angles[0] == 270)
|
||||
VectorSet (forward, 0, 0, 1);
|
||||
else if (turret->s.angles[0] == 90)
|
||||
VectorSet (forward, 0,0,-1);
|
||||
VectorSet (forward, 0, 0, -1);
|
||||
else if (turret->s.angles[1] == 0)
|
||||
VectorSet (forward, 1,0,0);
|
||||
VectorSet (forward, 1, 0, 0);
|
||||
else if (turret->s.angles[1] == 90)
|
||||
VectorSet (forward, 0,1,0);
|
||||
VectorSet (forward, 0, 1, 0);
|
||||
else if (turret->s.angles[1] == 180)
|
||||
VectorSet (forward, -1,0,0);
|
||||
VectorSet (forward, -1, 0, 0);
|
||||
else if (turret->s.angles[1] == 270)
|
||||
VectorSet (forward, 0,-1,0);*/
|
||||
|
||||
//Knightmare- set up the turret's movement positions here
|
||||
VectorSet (forward, 0, -1, 0);
|
||||
*/
|
||||
// Knightmare- set up the turret's movement positions here
|
||||
AngleVectors (turret->s.angles, forward, NULL, NULL);
|
||||
//Move turret wall backward a bit so it will be flush with surrounding wall
|
||||
// Move turret wall backward a bit so it will be flush with surrounding wall
|
||||
VectorMA (ent->s.origin, -2, forward, ent->s.origin);
|
||||
|
||||
VectorCopy (turret->s.origin, turret->pos1);
|
||||
|
@ -742,14 +767,14 @@ void turret_wall_spawn (edict_t *turret)
|
|||
ent->flags |= FL_TEAMSLAVE;
|
||||
ent->owner = turret;
|
||||
|
||||
//Knightmare- set movewith if applicable and backup original angles
|
||||
// Knightmare- set movewith if applicable and backup original angles
|
||||
if (turret->movewith)
|
||||
ent->movewith = turret->movewith;
|
||||
|
||||
VectorCopy (ent->s.angles, ent->org_angles);
|
||||
|
||||
ent->s.modelindex = gi.modelindex("models/monsters/turretbase/tris.md2");
|
||||
ent->s.renderfx |= RF_NOSHADOW; // Knightmare added
|
||||
ent->s.renderfx |= RF_NOSHADOW; // Knightmare added
|
||||
|
||||
gi.linkentity (ent);
|
||||
}
|
||||
|
@ -760,7 +785,7 @@ void turret_wake (edict_t *self)
|
|||
// just return without doing anything. Easiest way to have a null function.
|
||||
self->moveinfo.state = STATE_TOP;
|
||||
|
||||
if(self->flags & FL_TEAMSLAVE)
|
||||
if (self->flags & FL_TEAMSLAVE)
|
||||
return;
|
||||
|
||||
self->monsterinfo.stand = turret_stand;
|
||||
|
@ -782,9 +807,9 @@ void turret_wake (edict_t *self)
|
|||
|
||||
stationarymonster_start (self);
|
||||
|
||||
if(self->spawnflags & SPAWN_RAILGUN) //was SPAWN_MACHINEGUN
|
||||
if (self->spawnflags & SPAWN_RAILGUN) //was SPAWN_MACHINEGUN
|
||||
self->s.skinnum = 1;
|
||||
else if(self->spawnflags & SPAWN_ROCKET)
|
||||
else if (self->spawnflags & SPAWN_ROCKET)
|
||||
self->s.skinnum = 2;
|
||||
|
||||
// but we do want the death to count
|
||||
|
@ -800,8 +825,8 @@ void turret_activate (edict_t *self, edict_t *other, edict_t *activator)
|
|||
edict_t *base;
|
||||
|
||||
self->movetype = MOVETYPE_PUSH;
|
||||
self->use = NULL; //Knightmare added
|
||||
if(!self->speed)
|
||||
self->use = NULL; // Knightmare added
|
||||
if (!self->speed)
|
||||
self->speed = 15;
|
||||
self->moveinfo.speed = self->speed;
|
||||
self->moveinfo.accel = self->speed;
|
||||
|
@ -812,7 +837,7 @@ void turret_activate (edict_t *self, edict_t *other, edict_t *activator)
|
|||
Move_Calc(self, self->pos2, turret_wake);
|
||||
|
||||
base = self->teamchain;
|
||||
if(base)
|
||||
if (base)
|
||||
{
|
||||
base->movetype = MOVETYPE_PUSH;
|
||||
base->speed = self->speed;
|
||||
|
@ -1036,7 +1061,7 @@ void SP_monster_turret (edict_t *self)
|
|||
self->gravity = 0;
|
||||
self->last_fire_time = 0;
|
||||
|
||||
VectorCopy(self->s.angles, self->offset);
|
||||
VectorCopy (self->s.angles, self->offset);
|
||||
|
||||
angle = (int)self->s.angles[1];
|
||||
switch (angle)
|
||||
|
@ -1094,9 +1119,9 @@ void SP_monster_turret (edict_t *self)
|
|||
{
|
||||
// vec3_t forward;
|
||||
|
||||
if(!self->targetname)
|
||||
if (!self->targetname)
|
||||
{
|
||||
// gi.dprintf("Wall Unit Turret without targetname! %s\n", vtos(self->s.origin));
|
||||
// gi.dprintf("Wall Unit Turret without targetname! %s\n", vtos(self->s.origin));
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -533,6 +533,10 @@ SOURCE=.\z_boss.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\z_camera.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\z_handler.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -854,6 +854,10 @@
|
|||
RelativePath=".\z_boss.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\z_camera.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\z_handler.c"
|
||||
>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -782,6 +782,23 @@ void G_SetStats (edict_t *ent)
|
|||
ent->client->ps.stats[STAT_ZOOM] = gi.imageindex("zoom");
|
||||
else
|
||||
ent->client->ps.stats[STAT_ZOOM] = 0;
|
||||
|
||||
// Zaero
|
||||
if (ent->client->zCameraTrack)
|
||||
{
|
||||
ent->client->ps.stats[STAT_CAMERA_ICON] = gi.imageindex("i_visor");
|
||||
ent->client->ps.stats[STAT_CAMERA_TIMER] = ent->client->pers.visorFrames/10;
|
||||
#ifdef KMQUAKE2_ENGINE_MOD // for enhanced HUD
|
||||
// ent->client->ps.stats[STAT_CAMERA_RANGE] = min(max((int)sk_visor_time->value, 0), 10000);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
ent->client->ps.stats[STAT_CAMERA_ICON] = 0;
|
||||
#ifdef KMQUAKE2_ENGINE_MOD // for enhanced HUD
|
||||
// ent->client->ps.stats[STAT_CAMERA_RANGE] = 0;
|
||||
#endif
|
||||
}
|
||||
// end Zaero
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -190,7 +190,7 @@ void P_DamageFeedback (edict_t *player)
|
|||
//end Skid
|
||||
======================================================================*/
|
||||
|
||||
/*static*/ void CommonViewOffsets(edict_t *ent, vec3_t v)
|
||||
/*static*/ void CommonViewOffsets (edict_t *ent, vec3_t v)
|
||||
{
|
||||
// absolutely bound offsets
|
||||
// so the view can never be outside the player box
|
||||
|
@ -208,12 +208,12 @@ void P_DamageFeedback (edict_t *player)
|
|||
}
|
||||
}
|
||||
//CHASECAM added
|
||||
//Lazarus
|
||||
else if(ent->client->spycam)
|
||||
// Lazarus
|
||||
else if (ent->client->spycam)
|
||||
{
|
||||
VectorSet (v, 0, 0, 0);
|
||||
VectorCopy (ent->client->spycam->s.angles, ent->client->ps.viewangles);
|
||||
if(ent->client->spycam->svflags & SVF_MONSTER)
|
||||
if (ent->client->spycam->svflags & SVF_MONSTER)
|
||||
ent->client->ps.viewangles[PITCH] = ent->client->spycam->move_angles[PITCH];
|
||||
}
|
||||
// if (!ent->client->chasetoggle)
|
||||
|
@ -269,11 +269,11 @@ void SV_CalcViewOffset (edict_t *ent)
|
|||
// if dead, fix the angle and don't add any kick
|
||||
if (ent->deadflag)
|
||||
{
|
||||
if(ent->deadflag != DEAD_FROZEN)
|
||||
if (ent->deadflag != DEAD_FROZEN)
|
||||
{
|
||||
VectorClear (angles);
|
||||
|
||||
if(ent->flags & FL_SAM_RAIMI)
|
||||
if (ent->flags & FL_SAM_RAIMI)
|
||||
{
|
||||
ent->client->ps.viewangles[ROLL] = 0;
|
||||
ent->client->ps.viewangles[PITCH] = 0;
|
||||
|
@ -304,7 +304,7 @@ void SV_CalcViewOffset (edict_t *ent)
|
|||
angles[PITCH] += ratio * ent->client->v_dmg_pitch;
|
||||
angles[ROLL] += ratio * ent->client->v_dmg_roll;
|
||||
|
||||
//Knightmare- no bobbing if player is controlling a turret
|
||||
// Knightmare- no bobbing if player is controlling a turret
|
||||
if (ent->flags & FL_TURRET_OWNER)
|
||||
return;
|
||||
|
||||
|
@ -366,49 +366,98 @@ void SV_CalcViewOffset (edict_t *ent)
|
|||
|
||||
VectorAdd (v, ent->client->kick_origin, v);
|
||||
|
||||
// CommonViewOffsets(ent,v);
|
||||
// CommonViewOffsets(ent, v);
|
||||
|
||||
// absolutely bound offsets
|
||||
// so the view can never be outside the player box
|
||||
|
||||
//CHASECAM added
|
||||
if (ent->client->chaseactive)
|
||||
// Zaero
|
||||
if (ent->client->zCameraTrack)
|
||||
{
|
||||
VectorSet (v, 0, 0, 0);
|
||||
if (ent->client->chasecam != NULL)
|
||||
int i;
|
||||
|
||||
VectorAdd (ent->client->zCameraTrack->s.origin, ent->client->zCameraOffset, v);
|
||||
|
||||
if (ent->client->zCameraTrack->client)
|
||||
{
|
||||
ent->client->ps.pmove.origin[0] = ent->client->chasecam->s.origin[0]*8;
|
||||
ent->client->ps.pmove.origin[1] = ent->client->chasecam->s.origin[1]*8;
|
||||
ent->client->ps.pmove.origin[2] = ent->client->chasecam->s.origin[2]*8;
|
||||
VectorCopy (ent->client->chasecam->s.angles, ent->client->ps.viewangles);
|
||||
vec3_t f;
|
||||
|
||||
VectorAdd(ent->client->zCameraTrack->client->ps.viewoffset, v, v);
|
||||
// AngleVectors (ent->client->zCameraTrack->client->v_angle, f, NULL, NULL);
|
||||
AngleVectors (ent->client->zCameraTrack->s.angles, f, NULL, NULL);
|
||||
VectorMA(v, 10, f, v);
|
||||
}
|
||||
else if (Q_stricmp(ent->client->zCameraTrack->classname, "misc_securitycamera") == 0)
|
||||
{
|
||||
float framepercent = sin(((float)(level.framenum & 63) / 64.0) * M_PI * 2);
|
||||
VectorCopy(ent->client->zCameraTrack->move_origin, v);
|
||||
VectorCopy(ent->client->zCameraTrack->move_angles, ent->client->ps.viewangles);
|
||||
|
||||
// adjust yaw a bit due to sway
|
||||
ent->client->ps.viewangles[YAW] += framepercent * 15;
|
||||
}
|
||||
else
|
||||
VectorCopy (ent->client->zCameraTrack->s.angles, ent->client->ps.viewangles);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
ent->client->ps.pmove.origin[i] = v[i] * 8;
|
||||
}
|
||||
|
||||
VectorSet (ent->client->ps.viewoffset, 0, 0, 0);
|
||||
// make our "double" do what we're doing
|
||||
if (ent->client->zCameraLocalEntity)
|
||||
{
|
||||
edict_t *e = ent->client->zCameraLocalEntity;
|
||||
VectorCopy(ent->s.origin, e->s.origin);
|
||||
e->s.frame = ent->s.frame;
|
||||
e->s.modelindex = ent->s.modelindex;
|
||||
e->s.modelindex2 = ent->s.modelindex2;
|
||||
e->s.skinnum = ent->s.skinnum;
|
||||
}
|
||||
}
|
||||
//CHASECAM added
|
||||
//Lazarus
|
||||
else if(ent->client->spycam)
|
||||
{
|
||||
VectorSet (v, 0, 0, 0);
|
||||
VectorCopy (ent->client->spycam->s.angles, ent->client->ps.viewangles);
|
||||
if(ent->client->spycam->svflags & SVF_MONSTER)
|
||||
ent->client->ps.viewangles[PITCH] = ent->client->spycam->move_angles[PITCH];
|
||||
}
|
||||
else
|
||||
// end Zaero
|
||||
{
|
||||
if (v[0] < -14)
|
||||
v[0] = -14;
|
||||
else if (v[0] > 14)
|
||||
v[0] = 14;
|
||||
if (v[1] < -14)
|
||||
v[1] = -14;
|
||||
else if (v[1] > 14)
|
||||
v[1] = 14;
|
||||
if (v[2] < -22)
|
||||
v[2] = -22;
|
||||
else if (v[2] > 30)
|
||||
v[2] = 30;
|
||||
}
|
||||
// CHASECAM added
|
||||
if (ent->client->chaseactive)
|
||||
{
|
||||
VectorSet (v, 0, 0, 0);
|
||||
if (ent->client->chasecam != NULL)
|
||||
{
|
||||
ent->client->ps.pmove.origin[0] = ent->client->chasecam->s.origin[0]*8;
|
||||
ent->client->ps.pmove.origin[1] = ent->client->chasecam->s.origin[1]*8;
|
||||
ent->client->ps.pmove.origin[2] = ent->client->chasecam->s.origin[2]*8;
|
||||
VectorCopy (ent->client->chasecam->s.angles, ent->client->ps.viewangles);
|
||||
}
|
||||
}
|
||||
// CHASECAM added
|
||||
// Lazarus
|
||||
else if (ent->client->spycam)
|
||||
{
|
||||
VectorSet (v, 0, 0, 0);
|
||||
VectorCopy (ent->client->spycam->s.angles, ent->client->ps.viewangles);
|
||||
if (ent->client->spycam->svflags & SVF_MONSTER)
|
||||
ent->client->ps.viewangles[PITCH] = ent->client->spycam->move_angles[PITCH];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (v[0] < -14)
|
||||
v[0] = -14;
|
||||
else if (v[0] > 14)
|
||||
v[0] = 14;
|
||||
if (v[1] < -14)
|
||||
v[1] = -14;
|
||||
else if (v[1] > 14)
|
||||
v[1] = 14;
|
||||
if (v[2] < -22)
|
||||
v[2] = -22;
|
||||
else if (v[2] > 30)
|
||||
v[2] = 30;
|
||||
}
|
||||
|
||||
VectorCopy (v, ent->client->ps.viewoffset);
|
||||
VectorCopy (v, ent->client->ps.viewoffset);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -420,13 +469,13 @@ void SV_CalcGunOffset (edict_t *ent)
|
|||
{
|
||||
int i;
|
||||
float delta;
|
||||
//ROGUE
|
||||
// ROGUE
|
||||
static gitem_t *heatbeam;
|
||||
|
||||
if (!heatbeam)
|
||||
heatbeam = FindItemByClassname ("weapon_plasmabeam");
|
||||
|
||||
//ROGUE - heatbeam shouldn't bob so the beam looks right
|
||||
// ROGUE - heatbeam shouldn't bob so the beam looks right
|
||||
if (ent->client->pers.weapon != heatbeam)
|
||||
{
|
||||
// ROGUE
|
||||
|
@ -534,7 +583,7 @@ void SV_CalcBlend (edict_t *ent)
|
|||
SV_AddBlend (0.0, 0.1, 0.05, 0.6, ent->client->ps.blend);
|
||||
else if (contents & CONTENTS_WATER)
|
||||
{
|
||||
if(ent->in_mud == 3)
|
||||
if (ent->in_mud == 3)
|
||||
SV_AddBlend (0.4, 0.3, 0.2, 0.9, ent->client->ps.blend);
|
||||
else
|
||||
SV_AddBlend (0.5, 0.3, 0.2, 0.4, ent->client->ps.blend);
|
||||
|
@ -621,7 +670,7 @@ void SV_CalcBlend (edict_t *ent)
|
|||
if (ent->client->ir_framenum > level.framenum)
|
||||
{
|
||||
remaining = ent->client->ir_framenum - level.framenum;
|
||||
if(remaining > 30 || (remaining & 4))
|
||||
if (remaining > 30 || (remaining & 4))
|
||||
{
|
||||
ent->client->ps.rdflags |= RDF_IRGOGGLES;
|
||||
SV_AddBlend (1, 0, 0, 0.2, ent->client->ps.blend);
|
||||
|
@ -659,9 +708,13 @@ void SV_CalcBlend (edict_t *ent)
|
|||
float alpha = (float)ent->client->flashTime / (float)ent->client->flashBase;
|
||||
if (alpha > 1)
|
||||
alpha = 1;
|
||||
SV_AddBlend(1, 1, 1, alpha, ent->client->ps.blend);
|
||||
SV_AddBlend (1, 1, 1, alpha, ent->client->ps.blend);
|
||||
ent->client->flashTime--;
|
||||
}
|
||||
|
||||
if (ent->client->zCameraStaticFramenum > level.time) {
|
||||
SV_AddBlend (1, 1, 1, 1, ent->client->ps.blend);
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
// drop the damage value
|
||||
|
@ -739,7 +792,7 @@ void P_SlamDamage (edict_t *ent)
|
|||
{
|
||||
if (ent->health > 0)
|
||||
{
|
||||
/* if(delta > 65)
|
||||
/* if (delta > 65)
|
||||
ent->s.event = EV_FALLFAR;
|
||||
else
|
||||
ent->s.event = EV_FALL;*/
|
||||
|
@ -1080,12 +1133,12 @@ void G_SetClientEffects (edict_t *ent)
|
|||
|
||||
//=========
|
||||
//PGM
|
||||
if(ent->flags & FL_DISGUISED)
|
||||
if (ent->flags & FL_DISGUISED)
|
||||
ent->s.renderfx |= RF_USE_DISGUISE;
|
||||
|
||||
if (gamerules && gamerules->value)
|
||||
{
|
||||
if(DMGame.PlayerEffects)
|
||||
if (DMGame.PlayerEffects)
|
||||
DMGame.PlayerEffects(ent);
|
||||
}
|
||||
//PGM
|
||||
|
@ -1339,6 +1392,10 @@ void G_SetClientSound (edict_t *ent)
|
|||
ent->s.sound = gi.soundindex ("weapons/ion_hum.wav");
|
||||
else if (strcmp (weap, "weapon_shockwave") == 0)
|
||||
ent->s.sound = gi.soundindex ("weapons/shock_hum.wav");
|
||||
// SKWiD MOD
|
||||
else if (strcmp(weap, "weapon_plasma") == 0)
|
||||
ent->s.sound = gi.soundindex(PLASMA_SOUND_IDLE);
|
||||
// END
|
||||
#endif
|
||||
else if (ent->client->weapon_sound)
|
||||
ent->s.sound = ent->client->weapon_sound;
|
||||
|
@ -1411,9 +1468,9 @@ void G_SetClientFrame (edict_t *ent)
|
|||
if (!ent->groundentity && client->anim_priority <= ANIM_WAVE && (!floor || ent->waterlevel > 2))
|
||||
goto newanim;
|
||||
|
||||
if(client->anim_priority == ANIM_REVERSE)
|
||||
if (client->anim_priority == ANIM_REVERSE)
|
||||
{
|
||||
if(ent->s.frame > client->anim_end)
|
||||
if (ent->s.frame > client->anim_end)
|
||||
{
|
||||
ent->s.frame--;
|
||||
return;
|
||||
|
@ -1451,7 +1508,8 @@ newanim:
|
|||
ent->s.frame = FRAME_jump1;
|
||||
client->anim_end = FRAME_jump2;
|
||||
}
|
||||
else if (run)
|
||||
// else if (run)
|
||||
else if (run && client->zCameraTrack == NULL) // Zaero
|
||||
{ // running
|
||||
if (duck)
|
||||
{
|
||||
|
@ -1577,7 +1635,7 @@ void ClientEndServerFrame (edict_t *ent)
|
|||
bobmove = 0;
|
||||
current_client->bobtime = 0; // start at beginning of cycle again
|
||||
}
|
||||
//Kngightmare- exception for wading
|
||||
// Kngightmare- exception for wading
|
||||
else if (ent->groundentity || ent->waterlevel == 2)
|
||||
{ // so bobbing only cycles when on ground
|
||||
if (xyspeed > 450) // Knightmare added
|
||||
|
@ -1601,7 +1659,7 @@ void ClientEndServerFrame (edict_t *ent)
|
|||
|
||||
bobcycle = (int)bobtime;
|
||||
// Lazarus: vehicle drivers don't bob
|
||||
if(ent->vehicle)
|
||||
if (ent->vehicle)
|
||||
bobfracsin = 0.;
|
||||
else
|
||||
bobfracsin = fabs(sin(bobtime*M_PI));
|
||||
|
@ -1658,19 +1716,39 @@ void ClientEndServerFrame (edict_t *ent)
|
|||
if (ent->client->showscores)
|
||||
{
|
||||
if (ent->client->menu)
|
||||
PMenu_Update(ent);
|
||||
PMenu_Update (ent);
|
||||
else if (ent->client->textdisplay)
|
||||
Text_Update(ent);
|
||||
Text_Update (ent);
|
||||
// Zaero
|
||||
else if (ent->client->zCameraTrack)
|
||||
updateVisorHud (ent);
|
||||
// end Zaero
|
||||
else
|
||||
DeathmatchScoreboardMessage (ent, ent->enemy);
|
||||
gi.unicast (ent, false);
|
||||
}
|
||||
else if(ent->client->whatsit)
|
||||
WhatsIt(ent);
|
||||
else if (ent->client->whatsit)
|
||||
WhatsIt (ent);
|
||||
}
|
||||
|
||||
// Zaero
|
||||
// this we want to do regardless
|
||||
if (ent->client->zCameraTrack)
|
||||
{
|
||||
// decrease the visor frame time
|
||||
ent->client->pers.visorFrames--;
|
||||
if (ent->client->pers.visorFrames == 0)
|
||||
{
|
||||
stopCamera (ent);
|
||||
ent->client->pers.inventory[ITEM_INDEX(FindItem("Visor"))]--;
|
||||
ValidateSelectedItem (ent);
|
||||
}
|
||||
}
|
||||
// end Zaero
|
||||
|
||||
// CHASECAM Knightmare- Gen cam code
|
||||
// if (ent->client->chasetoggle == 1)
|
||||
if (ent->client->chaseactive == 1)
|
||||
CheckChasecam_Viewent(ent);
|
||||
CheckChasecam_Viewent (ent);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
44
missionpack/plasma.h
Normal file
44
missionpack/plasma.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
//==============================================================================
|
||||
// Plasma Rifle Configuration File
|
||||
//==============================================================================
|
||||
|
||||
// Bat
|
||||
// release 5.0 was at 2.8
|
||||
|
||||
#define PLASMA_SPREAD_DAMAGE 28
|
||||
#define PLASMA_BOUNCE_DAMAGE 39
|
||||
#define PLASMA_SPLASH_RADIUS 70
|
||||
|
||||
// -bat
|
||||
#define PLASMA_BOUNCE_SPEED 1200
|
||||
#define PLASMA_SPREAD_SPEED 1200
|
||||
|
||||
#define PLASMA_CELLS_PER_SHOT 2 // was 10
|
||||
|
||||
// Model/Sprite Information
|
||||
#define PLASMA_SPRITE_FLY "sprites/s_plasma1.sp2"
|
||||
#define PLASMA_SPRITE_HIT "sprites/s_plasma2.sp2"
|
||||
#define PLASMA_MODEL_VIEW "models/weapons/v_plasma/tris.md2"
|
||||
#define PLASMA_MODEL_WORLD "models/weapons/g_plasma/tris.md2"
|
||||
|
||||
// Sound
|
||||
#define PLASMA_SOUND_BOUNCE "weapons/plasma/bounce.wav"
|
||||
#define PLASMA_SOUND_EMPTY "weapons/plasma/empty.wav"
|
||||
#define PLASMA_SOUND_FIRE1 "weapons/plasma/fire1.wav"
|
||||
#define PLASMA_SOUND_FIRE2 "weapons/plasma/fire2.wav"
|
||||
#define PLASMA_SOUND_FLYBY "weapons/plasma/flyby.wav"
|
||||
#define PLASMA_SOUND_HIT "weapons/plasma/hit.wav"
|
||||
#define PLASMA_SOUND_IDLE "weapons/plasma/idle.wav"
|
||||
#define PLASMA_SOUND_VENT "weapons/plasma/vent.wav"
|
||||
|
||||
// Misc
|
||||
//#define PLASMA_ICON "w_plasma"
|
||||
#define PLASMA_PICKUP_NAME "Plasma Rifle"
|
||||
|
||||
// Precache
|
||||
#define PLASMA_PRECACHE PLASMA_SOUND_BOUNCE PLASMA_SOUND_EMPTY \
|
||||
PLASMA_SOUND_FIRE1 PLASMA_SOUND_FIRE2 \
|
||||
PLASMA_SOUND_FLYBY PLASMA_SOUND_HIT \
|
||||
PLASMA_SOUND_IDLE PLASMA_SOUND_VENT \
|
||||
PLASMA_MODEL_VIEW PLASMA_MODEL_WORLD \
|
||||
PLASMA_SPRITE_FLY PLASMA_SPRITE_HIT
|
|
@ -101,7 +101,7 @@ __inline int Q_vsnprintf (char *Dest, size_t Count, const char *Format, va_list
|
|||
|
||||
#define SAVEGAME_USE_FUNCTION_TABLE
|
||||
#define SAVEGAME_DLLNAME "Rogue + Xatrix + Lazarus integrated mod"
|
||||
#define SAVEGAME_VERSION 3
|
||||
#define SAVEGAME_VERSION 4
|
||||
|
||||
// angle indexes
|
||||
#define PITCH 0 // up / down
|
||||
|
@ -497,6 +497,7 @@ COLLISION DETECTION
|
|||
#define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_SLIME|CONTENTS_LAVA)
|
||||
#define MASK_SHOT (CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEADMONSTER)
|
||||
#define MASK_CURRENT (CONTENTS_CURRENT_0|CONTENTS_CURRENT_90|CONTENTS_CURRENT_180|CONTENTS_CURRENT_270|CONTENTS_CURRENT_UP|CONTENTS_CURRENT_DOWN)
|
||||
#define MASK_SHOT_NO_WINDOW (CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_DEADMONSTER) // Zaero added
|
||||
|
||||
|
||||
// gi.BoxEdicts() can return a list of either solid or trigger entities
|
||||
|
@ -1162,6 +1163,11 @@ typedef enum
|
|||
#define STAT_SPECTATOR 17
|
||||
#define STAT_SPEED 22
|
||||
#define STAT_ZOOM 23
|
||||
// Zaero
|
||||
#define STAT_CAMERA_ICON 24
|
||||
#define STAT_CAMERA_TIMER 25
|
||||
// end Zaero
|
||||
|
||||
// Knightmare- some extra stats for scripted HUDs
|
||||
#define STAT_TIMER_RANGE 251
|
||||
#define STAT_MAXAMMO 252
|
||||
|
|
|
@ -690,7 +690,7 @@ void zboss_reelInGraaple2 (edict_t *self)
|
|||
|
||||
if (length <= 80 || (self->laser->think == HookDragThink && self->laser->powerarmor_time < level.time))
|
||||
{
|
||||
G_FreeEdict(self->laser);
|
||||
G_FreeEdict (self->laser);
|
||||
self->laser = NULL;
|
||||
|
||||
self->s.modelindex3 = gi.modelindex ("models/monsters/bossz/grapple/tris.md2");
|
||||
|
@ -971,7 +971,7 @@ void PlasmaballBlastAnim (edict_t *ent)
|
|||
|
||||
if (ent->s.frame > 1)
|
||||
{
|
||||
G_FreeEdict(ent);
|
||||
G_FreeEdict (ent);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -1543,7 +1543,7 @@ void DeadHookTouch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *s
|
|||
T_Damage (other, ent, ent->owner, ent->velocity, ent->s.origin, plane->normal, 10, 0, 0, MOD_HIT);
|
||||
}
|
||||
|
||||
G_FreeEdict(ent);
|
||||
G_FreeEdict (ent);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1568,7 +1568,7 @@ void FireDeadGrapple (edict_t *self)
|
|||
|
||||
gi.sound (self, CHAN_WEAPON, sound_hooklaunch, 1, ATTN_NORM, 0);
|
||||
|
||||
hook = G_Spawn();
|
||||
hook = G_Spawn ();
|
||||
VectorCopy (start, hook->s.origin);
|
||||
VectorCopy (up, hook->movedir);
|
||||
vectoangles (up, hook->s.angles);
|
||||
|
@ -1654,7 +1654,7 @@ void zboss_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage
|
|||
|
||||
if (self->laser)
|
||||
{
|
||||
G_FreeEdict(self->laser);
|
||||
G_FreeEdict (self->laser);
|
||||
self->laser = NULL;
|
||||
}
|
||||
|
||||
|
|
126
missionpack/z_camera.c
Normal file
126
missionpack/z_camera.c
Normal file
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
Zaero Camera
|
||||
*/
|
||||
|
||||
#include "g_local.h"
|
||||
|
||||
void zCam_SetLocalCopy (struct edict_s *player, char *s);
|
||||
|
||||
|
||||
void zCam_TrackEntity (struct edict_s *player, struct edict_s *track, qboolean playerVisiable, qboolean playerOffset)
|
||||
{
|
||||
if (player->client == NULL)
|
||||
return; // not a true player
|
||||
|
||||
player->client->zCameraTrack = track;
|
||||
|
||||
// set the player view stuff...
|
||||
player->movetype = MOVETYPE_FREEZE;
|
||||
player->client->ps.gunindex = 0;
|
||||
player->client->ps.fov = 90;
|
||||
|
||||
VectorSet(player->client->zCameraOffset, 0, 0, 0);
|
||||
|
||||
// if invisible, turn off model, etc
|
||||
if (playerVisiable)
|
||||
{
|
||||
edict_t *e = NULL;
|
||||
player->client->zCameraLocalEntity = e = G_Spawn();
|
||||
e->classname = "VisorCopy";
|
||||
e->owner = player;
|
||||
e->movetype = MOVETYPE_NONE;
|
||||
e->solid = SOLID_BBOX;
|
||||
e->s.skinnum = player->s.skinnum;
|
||||
e->s.modelindex = player->s.modelindex;
|
||||
e->s.modelindex2 = player->s.modelindex2;
|
||||
VectorCopy(player->mins, e->mins);
|
||||
VectorCopy(player->maxs, e->maxs);
|
||||
VectorCopy (player->s.origin, e->s.origin);
|
||||
VectorCopy (player->s.angles, e->s.angles);
|
||||
VectorCopy (player->s.old_origin, e->s.old_origin);
|
||||
e->s.frame = player->s.frame;
|
||||
e->s.effects = player->s.effects;
|
||||
player->svflags |= SVF_NOCLIENT; // so that no one can see our real model
|
||||
|
||||
gi.linkentity(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
player->client->zCameraLocalEntity = NULL;
|
||||
// to do
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void zCam_Stop (struct edict_s *player)
|
||||
{
|
||||
if (player->client == NULL)
|
||||
{
|
||||
return; // not a true player
|
||||
}
|
||||
|
||||
player->client->zCameraTrack = NULL;
|
||||
|
||||
// set the player view stuff...
|
||||
player->movetype = MOVETYPE_WALK;
|
||||
player->client->ps.gunindex = gi.modelindex(player->client->pers.weapon->view_model);
|
||||
|
||||
// if invisible, turn on model, etc
|
||||
if (player->client->zCameraLocalEntity)
|
||||
{
|
||||
G_FreeEdict(player->client->zCameraLocalEntity);
|
||||
player->client->zCameraLocalEntity = NULL;
|
||||
player->svflags &= ~SVF_NOCLIENT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// todo
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
char *getSkinModel (char *s, char *buffer, size_t bufSize)
|
||||
{
|
||||
char *cp;
|
||||
|
||||
|
||||
Com_strcpy(buffer, bufSize, "players/");
|
||||
cp = buffer + strlen(buffer);
|
||||
|
||||
while(*s && *s != '/')
|
||||
{
|
||||
*cp = *s;
|
||||
cp++;
|
||||
s++;
|
||||
}
|
||||
|
||||
// strcpy(cp, "/tris.md2");
|
||||
Com_strcpy(cp, bufSize - (cp - buffer), "/tris.md2");
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
char *getSkinName (char *s, char *buffer, size_t bufSize)
|
||||
{
|
||||
Com_strcpy(buffer, bufSize, "players/");
|
||||
Com_strcat(buffer, bufSize, s);
|
||||
Com_strcat(buffer, bufSize, ".pcx");
|
||||
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
|
||||
void zCam_SetLocalCopy (struct edict_s *player, char *s)
|
||||
{
|
||||
// char model[255];
|
||||
|
||||
if (player->client->zCameraLocalEntity)
|
||||
{
|
||||
/*
|
||||
player->client->zCameraLocalEntity->s.modelindex = gi.modelindex(getSkinModel(s, model, sizeof(model)));
|
||||
player->client->zCameraLocalEntity->s.renderfx |= RF_CUSTOMSKIN;
|
||||
player->client->zCameraLocalEntity->s.skinnum = gi.imageindex(getSkinName(s, model, sizeof(model)));
|
||||
*/
|
||||
player->client->zCameraLocalEntity->s.modelindex = gi.modelindex("models/objects/gibs/head2/tris.md2");
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
extern qboolean is_quad;
|
||||
extern byte is_silenced;
|
||||
|
||||
void playQuadSound(edict_t *ent);
|
||||
void playQuadSound (edict_t *ent);
|
||||
void Weapon_Generic (edict_t *ent,
|
||||
int FRAME_ACTIVATE_LAST,
|
||||
int FRAME_FIRE_LAST,
|
||||
|
@ -17,13 +17,13 @@ void NoAmmoWeaponChange (edict_t *ent);
|
|||
void check_dodge (edict_t *self, vec3_t start, vec3_t dir, int speed);
|
||||
void barrel_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf);
|
||||
|
||||
void Grenade_Explode(edict_t *ent);
|
||||
void Grenade_Explode (edict_t *ent);
|
||||
void P_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result);
|
||||
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
void zCam_TrackEntity(struct edict_s *player, struct edict_s *track, qboolean playerVisiable, qboolean playerOffset);
|
||||
void zCam_Stop(struct edict_s *player);
|
||||
#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
//#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
void zCam_TrackEntity (struct edict_s *player, struct edict_s *track, qboolean playerVisiable, qboolean playerOffset);
|
||||
void zCam_Stop (struct edict_s *player);
|
||||
//#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
|
||||
void fire_empnuke(edict_t *ent, vec3_t center, int radius);
|
||||
|
||||
|
@ -37,7 +37,7 @@ This is where the visor locates too...
|
|||
|
||||
======================================================================
|
||||
*/
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
//#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
void use_securitycamera (edict_t *self, edict_t *other, edict_t *activator)
|
||||
{
|
||||
self->active = !self->active;
|
||||
|
@ -45,7 +45,7 @@ void use_securitycamera (edict_t *self, edict_t *other, edict_t *activator)
|
|||
|
||||
#define CAMERA_FRAME_FIRST 0
|
||||
#define CAMERA_FRAME_LAST 59
|
||||
void securitycamera_think(edict_t *self)
|
||||
void securitycamera_think (edict_t *self)
|
||||
{
|
||||
if (self->active)
|
||||
{
|
||||
|
@ -68,12 +68,12 @@ void securitycamera_think(edict_t *self)
|
|||
self->nextthink = level.time + FRAMETIME;
|
||||
}
|
||||
|
||||
void camera_pain(edict_t *self, edict_t *other, float kick, int damage)
|
||||
void camera_pain (edict_t *self, edict_t *other, float kick, int damage)
|
||||
{
|
||||
self->timeout = level.time + FRAMETIME * 2;
|
||||
}
|
||||
|
||||
void SP_misc_securitycamera(edict_t *self)
|
||||
void SP_misc_securitycamera (edict_t *self)
|
||||
{
|
||||
vec3_t offset, forward, up;
|
||||
|
||||
|
@ -115,8 +115,7 @@ void SP_misc_securitycamera(edict_t *self)
|
|||
}
|
||||
self->think = securitycamera_think;
|
||||
self->nextthink = level.time + FRAMETIME;
|
||||
|
||||
self->health = 1;
|
||||
self->health = 1000; // Knightmare- was 1
|
||||
self->takedamage = DAMAGE_IMMORTAL; // health will not be deducted
|
||||
self->pain = camera_pain;
|
||||
|
||||
|
@ -126,29 +125,30 @@ void SP_misc_securitycamera(edict_t *self)
|
|||
char *camera_statusbar =
|
||||
"xv 26 yb -75 string \"Tracking %s\" "
|
||||
// timer
|
||||
"if 20 "
|
||||
"if 24 " // was "if 20"
|
||||
" xv 246 "
|
||||
" num 3 21 "
|
||||
" num 3 25 " // was " num 3 21"
|
||||
" xv 296 "
|
||||
" pic 20 "
|
||||
" pic 24 " // was " pic 20"
|
||||
"endif "
|
||||
;
|
||||
|
||||
void updateVisorHud(edict_t *ent)
|
||||
void updateVisorHud (edict_t *ent)
|
||||
{
|
||||
static char buf[1024];
|
||||
|
||||
gi.WriteByte (svc_layout);
|
||||
// sprintf(buf, camera_statusbar, ent->client->zCameraTrack->message);
|
||||
Com_sprintf(buf, sizeof(buf), camera_statusbar, ent->client->zCameraTrack->message);
|
||||
gi.WriteString(buf);
|
||||
}
|
||||
|
||||
void startVisorStatic(edict_t *ent)
|
||||
void startVisorStatic (edict_t *ent)
|
||||
{
|
||||
ent->client->zCameraStaticFramenum = level.time + FRAMETIME * 2;
|
||||
}
|
||||
|
||||
void startVisor(edict_t *ent, edict_t *e)
|
||||
void startVisor (edict_t *ent, edict_t *e)
|
||||
{
|
||||
// don't do anything if we're already at the destination camera
|
||||
if (e == ent->client->zCameraTrack)
|
||||
|
@ -157,30 +157,30 @@ void startVisor(edict_t *ent, edict_t *e)
|
|||
// no more time?
|
||||
if (ent->client->pers.visorFrames <= 0)
|
||||
{
|
||||
gi.cprintf(ent, PRINT_HIGH, "No time left for visor\n");
|
||||
gi.cprintf (ent, PRINT_HIGH, "No time left for visor\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// look thru the camera
|
||||
zCam_TrackEntity(ent, e, true, true);
|
||||
zCam_TrackEntity (ent, e, true, true);
|
||||
|
||||
startVisorStatic(ent);
|
||||
updateVisorHud(ent);
|
||||
gi.unicast(ent, true); // reliably send to ent
|
||||
startVisorStatic (ent);
|
||||
updateVisorHud (ent);
|
||||
gi.unicast (ent, true); // reliably send to ent
|
||||
ent->client->showscores = true;
|
||||
|
||||
// play activation sound
|
||||
gi.sound(ent, CHAN_AUTO, gi.soundindex("items/visor/act.wav"), 1, ATTN_NORM, 0);
|
||||
gi.sound (ent, CHAN_AUTO, gi.soundindex("items/visor/act.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
void stopCamera(edict_t *self)
|
||||
void stopCamera (edict_t *self)
|
||||
{
|
||||
zCam_Stop(self);
|
||||
zCam_Stop (self);
|
||||
self->client->showscores = false;
|
||||
gi.sound(self, CHAN_AUTO, gi.soundindex("items/visor/deact.wav"), 1, ATTN_NORM, 0);
|
||||
gi.sound (self, CHAN_AUTO, gi.soundindex("items/visor/deact.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
edict_t *findNextCamera(edict_t *old)
|
||||
edict_t *findNextCamera (edict_t *old)
|
||||
{
|
||||
edict_t *e = NULL;
|
||||
|
||||
|
@ -221,7 +221,7 @@ void Use_Visor (edict_t *ent, gitem_t *item)
|
|||
|
||||
if (ent->client->pers.visorFrames == 0)
|
||||
ent->client->pers.visorFrames = (sk_visor_time->value * 10);
|
||||
startVisor(ent, e);
|
||||
startVisor (ent, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -232,13 +232,13 @@ void Use_Visor (edict_t *ent, gitem_t *item)
|
|||
ent->client->zCameraTrack = e;
|
||||
// play sound
|
||||
gi.sound(ent, CHAN_AUTO, gi.soundindex("items/visor/act.wav"), 1, ATTN_NORM, 0);
|
||||
startVisorStatic(ent);
|
||||
updateVisorHud(ent);
|
||||
gi.unicast(ent, true); // reliably send to ent
|
||||
startVisorStatic (ent);
|
||||
updateVisorHud (ent);
|
||||
gi.unicast (ent, true); // reliably send to ent
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
//#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
|
||||
|
||||
/*
|
||||
|
@ -344,6 +344,7 @@ void fire_empnuke (edict_t *ent, vec3_t center, int radius)
|
|||
empnuke->s.skinnum = 0;
|
||||
// empnuke->s.renderfx = RF_TRANSLUCENT | RF_FULLBRIGHT;
|
||||
// empnuke->s.renderfx = RF_TRANSLUCENT;
|
||||
empnuke->moreflags |= FL2_DO_NOT_REFLECT; // Knightmare- do not reflect flag
|
||||
|
||||
empnuke->think = empBlastAnim;
|
||||
empnuke->nextthink = level.time + FRAMETIME;
|
||||
|
@ -384,7 +385,7 @@ Plasma Shield
|
|||
|
||||
======================================================================
|
||||
*/
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
//#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
void PlasmaShield_die (edict_t *self)
|
||||
{
|
||||
#ifndef KMQUAKE2_ENGINE_MOD // Knightmare- no need to worry about overflows...
|
||||
|
@ -409,12 +410,12 @@ void Use_PlasmaShield (edict_t *ent, gitem_t *item)
|
|||
edict_t *PlasmaShield;
|
||||
vec3_t forward, right, up, frontbottomleft, backtopright;
|
||||
|
||||
if(!ent->client->pers.inventory[ammoIdx])
|
||||
if (!ent->client->pers.inventory[ammoIdx])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(EMPNukeCheck(ent, ent->s.origin))
|
||||
if (EMPNukeCheck(ent, ent->s.origin))
|
||||
{
|
||||
gi.sound (ent, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
|
||||
return;
|
||||
|
@ -467,7 +468,7 @@ void Use_PlasmaShield (edict_t *ent, gitem_t *item)
|
|||
|
||||
gi.linkentity (PlasmaShield);
|
||||
}
|
||||
#endif
|
||||
//#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
|
||||
|
||||
/*
|
||||
|
@ -553,11 +554,11 @@ misc_commdish
|
|||
======================================================================
|
||||
*/
|
||||
|
||||
void Anim_CommDish(edict_t *self)
|
||||
void Anim_CommDish (edict_t *self)
|
||||
{
|
||||
self->s.frame++;
|
||||
|
||||
if(self->s.frame >= 98)
|
||||
if (self->s.frame >= 98)
|
||||
{
|
||||
self->s.frame = 98;
|
||||
}
|
||||
|
@ -624,7 +625,7 @@ qboolean thruBarrier (edict_t *targ, edict_t *inflictor)
|
|||
if (tr.ent->classname && Q_stricmp(tr.ent->classname, "func_barrier") == 0)
|
||||
return true;
|
||||
|
||||
if(e == tr.ent)
|
||||
if (e == tr.ent)
|
||||
break;
|
||||
|
||||
e = tr.ent;
|
||||
|
@ -666,7 +667,6 @@ void barrier_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *
|
|||
gi.sound (self, CHAN_AUTO, gi.soundindex("weapons/lashit.wav"), 1, ATTN_NORM, 0);
|
||||
self->touch_debounce_time = level.time + FRAMETIME * 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SP_func_barrier (edict_t *self)
|
||||
|
@ -680,7 +680,7 @@ void SP_func_barrier (edict_t *self)
|
|||
self->think = barrier_think;
|
||||
self->nextthink = level.time + FRAMETIME;
|
||||
self->touch = barrier_touch;
|
||||
self->health = 1;
|
||||
self->health = 1000; // Knightmare- was 1
|
||||
self->takedamage = DAMAGE_IMMORTAL; // health will not be deducted
|
||||
self->pain = barrier_pain;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,9 +2,11 @@
|
|||
#include "m_player.h"
|
||||
|
||||
extern qboolean is_quad;
|
||||
extern qboolean is_double;
|
||||
extern qboolean is_quadfire;
|
||||
extern byte is_silenced;
|
||||
|
||||
void playQuadSound(edict_t *ent);
|
||||
//void playQuadSound(edict_t *ent);
|
||||
void Weapon_Generic (edict_t *ent,
|
||||
int FRAME_ACTIVATE_LAST,
|
||||
int FRAME_FIRE_LAST,
|
||||
|
@ -19,10 +21,10 @@ void check_dodge (edict_t *self, vec3_t start, vec3_t dir, int speed);
|
|||
void Grenade_Explode(edict_t *ent);
|
||||
void P_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result);
|
||||
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
#ifdef USE_ZAERO_WEAPONS
|
||||
void fire_sconnan (edict_t *self);
|
||||
void fire_sconnanEffects (edict_t *self);
|
||||
#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
#endif // USE_ZAERO_WEAPONS
|
||||
|
||||
const int SC_MAXFIRETIME = 5; // in seconds...
|
||||
const int SC_BASEDAMAGE = 10; // minimum damage
|
||||
|
@ -72,6 +74,8 @@ void angleToward (edict_t *self, vec3_t point, float speed)
|
|||
/*
|
||||
Laser Trip Bombs
|
||||
*/
|
||||
#define TBOMB_KILLABLE
|
||||
|
||||
// spawnflags
|
||||
#define CHECK_BACK_WALL 1
|
||||
|
||||
|
@ -85,7 +89,7 @@ void angleToward (edict_t *self, vec3_t point, float speed)
|
|||
#define TBOMB_SHRAPNEL_DMG 15
|
||||
#define TBOMB_MAX_EXIST 25
|
||||
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
//#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
void shrapnel_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
|
||||
{
|
||||
// do damage if we can
|
||||
|
@ -102,33 +106,42 @@ void shrapnel_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *
|
|||
|
||||
void TripBomb_Explode (edict_t *ent)
|
||||
{
|
||||
vec3_t origin;
|
||||
int i = 0;
|
||||
vec3_t origin;
|
||||
int i = 0, type;
|
||||
|
||||
T_RadiusDamage(ent, ent->owner ? ent->owner : ent, ent->dmg, ent->enemy, ent->dmg_radius, MOD_TRIPBOMB);
|
||||
|
||||
VectorMA (ent->s.origin, -0.02, ent->velocity, origin);
|
||||
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
if (ent->waterlevel)
|
||||
{
|
||||
if (ent->groundentity)
|
||||
gi.WriteByte (TE_GRENADE_EXPLOSION_WATER);
|
||||
// gi.WriteByte (TE_GRENADE_EXPLOSION_WATER);
|
||||
type = TE_GRENADE_EXPLOSION_WATER;
|
||||
else
|
||||
gi.WriteByte (TE_ROCKET_EXPLOSION_WATER);
|
||||
// gi.WriteByte (TE_ROCKET_EXPLOSION_WATER);
|
||||
type = TE_ROCKET_EXPLOSION_WATER;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ent->groundentity)
|
||||
gi.WriteByte (TE_GRENADE_EXPLOSION);
|
||||
// gi.WriteByte (TE_GRENADE_EXPLOSION);
|
||||
type = TE_GRENADE_EXPLOSION;
|
||||
else
|
||||
gi.WriteByte (TE_ROCKET_EXPLOSION);
|
||||
// gi.WriteByte (TE_ROCKET_EXPLOSION);
|
||||
type = TE_ROCKET_EXPLOSION;
|
||||
}
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
gi.WriteByte (type);
|
||||
gi.WritePosition (origin);
|
||||
gi.multicast (ent->s.origin, MULTICAST_PHS);
|
||||
|
||||
// Lazarus reflections
|
||||
if (level.num_reflectors)
|
||||
ReflectExplosion (type, origin);
|
||||
|
||||
// throw off some debris
|
||||
for (i = 0; i < sk_tbomb_shrapnel->value; i++)
|
||||
for (i = 0; i < (int)sk_tbomb_shrapnel->value; i++)
|
||||
{
|
||||
edict_t *sh = G_Spawn();
|
||||
vec3_t forward, right, up;
|
||||
|
@ -146,13 +159,47 @@ void TripBomb_Explode (edict_t *ent)
|
|||
VectorMA(forward, crandom()*500, up, forward);
|
||||
VectorCopy(forward, sh->velocity);
|
||||
sh->touch = shrapnel_touch;
|
||||
#ifdef KMQUAKE2_ENGINE_MOD
|
||||
sh->think = gib_fade; // Knightmare- have the debris fade away
|
||||
#else
|
||||
sh->think = G_FreeEdict;
|
||||
#endif // KMQUAKE2_ENGINE_MOD
|
||||
sh->nextthink = level.time + 3.0 + crandom() * 1.5;
|
||||
}
|
||||
|
||||
G_FreeEdict(ent);
|
||||
G_FreeEdict (ent);
|
||||
}
|
||||
|
||||
// Knightmare added
|
||||
#ifdef TBOMB_KILLABLE
|
||||
void tripbomb_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
|
||||
{
|
||||
// gi.dprintf("tripbomb_die\n");
|
||||
// if set off by another TripBomb, delay a little (chained explosions)
|
||||
if ( strcmp(inflictor->classname, "ired") )
|
||||
{
|
||||
self->takedamage = DAMAGE_NO;
|
||||
if (self->chain) {
|
||||
G_FreeEdict (self->chain);
|
||||
self->chain = NULL;
|
||||
}
|
||||
TripBomb_Explode (self);
|
||||
}
|
||||
else
|
||||
{
|
||||
self->takedamage = DAMAGE_NO;
|
||||
if (self->chain) {
|
||||
G_FreeEdict (self->chain);
|
||||
self->chain = NULL;
|
||||
}
|
||||
self->think = TripBomb_Explode;
|
||||
self->nextthink = level.time + FRAMETIME;
|
||||
}
|
||||
|
||||
}
|
||||
#endif // TBOMB_KILLABLE
|
||||
// end Knightmare
|
||||
|
||||
void tripbomb_laser_think (edict_t *self)
|
||||
{
|
||||
vec3_t start;
|
||||
|
@ -254,7 +301,7 @@ void create_tripbomb_laser (edict_t *bomb)
|
|||
laser->think = tripbomb_laser_on;
|
||||
laser->nextthink = level.time + FRAMETIME;
|
||||
laser->svflags |= SVF_NOCLIENT;
|
||||
laser->timeout = level.time + TBOMB_TIMEOUT;
|
||||
laser->timeout = level.time + sk_tbomb_life->value; // was TBOMB_TIMEOUT;
|
||||
gi.linkentity (laser);
|
||||
}
|
||||
|
||||
|
@ -263,12 +310,12 @@ void use_tripbomb (edict_t *self, edict_t *other, edict_t *activator)
|
|||
if (self->chain)
|
||||
{
|
||||
// we already have a laser, remove it
|
||||
G_FreeEdict(self->chain);
|
||||
G_FreeEdict (self->chain);
|
||||
self->chain = NULL;
|
||||
}
|
||||
else
|
||||
// create the laser
|
||||
create_tripbomb_laser(self);
|
||||
create_tripbomb_laser (self);
|
||||
}
|
||||
|
||||
void turnOffGlow (edict_t *self)
|
||||
|
@ -279,6 +326,12 @@ void turnOffGlow (edict_t *self)
|
|||
self->nextthink = 0;
|
||||
}
|
||||
|
||||
// Knightmare- removed this for shootable tripbombs
|
||||
#ifdef TBOMB_KILLABLE
|
||||
void tripbomb_pain (edict_t *self, edict_t *other, float kick, int damage)
|
||||
{
|
||||
}
|
||||
#else
|
||||
void tripbomb_pain (edict_t *self, edict_t *other, float kick, int damage)
|
||||
{
|
||||
// play the green glow sound
|
||||
|
@ -296,6 +349,8 @@ void tripbomb_pain (edict_t *self, edict_t *other, float kick, int damage)
|
|||
self->think = turnOffGlow;
|
||||
}
|
||||
}
|
||||
#endif // TBOMB_KILLABLE
|
||||
|
||||
|
||||
void tripbomb_think (edict_t *self)
|
||||
{
|
||||
|
@ -334,12 +389,20 @@ void setupBomb (edict_t *bomb, char *classname, float damage, float damage_radiu
|
|||
bomb->radius_dmg = damage;
|
||||
bomb->dmg = damage;
|
||||
bomb->dmg_radius = damage_radius;
|
||||
// Knightmare- made the tripbomb destroyable
|
||||
#ifdef TBOMB_KILLABLE
|
||||
bomb->health = (int)sk_tbomb_health->value; // was 1
|
||||
bomb->takedamage = DAMAGE_AIM;
|
||||
bomb->pain = NULL;
|
||||
bomb->die = tripbomb_die;
|
||||
#else
|
||||
bomb->health = 1;
|
||||
bomb->takedamage = DAMAGE_IMMORTAL; // health will not be deducted
|
||||
bomb->pain = tripbomb_pain;
|
||||
#endif // TBOMB_KILLABLE
|
||||
}
|
||||
|
||||
void removeOldest ()
|
||||
void removeOldest (void)
|
||||
{
|
||||
edict_t *oldestEnt = NULL;
|
||||
edict_t *e = NULL;
|
||||
|
@ -387,23 +450,23 @@ qboolean fire_lasertripbomb (edict_t *self, vec3_t start, vec3_t dir, float time
|
|||
if (tr.fraction == 1.0)
|
||||
{
|
||||
// not close enough
|
||||
//gi.cprintf(self, PRINT_HIGH, "Not close enough to a wall");
|
||||
// gi.cprintf(self, PRINT_HIGH, "Not close enough to a wall");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Q_stricmp(tr.ent->classname, "worldspawn") != 0)
|
||||
{
|
||||
//gi.cprintf(self, PRINT_HIGH, "Hit something other than a wall");
|
||||
// gi.cprintf(self, PRINT_HIGH, "Hit something other than a wall");
|
||||
return false;
|
||||
}
|
||||
|
||||
// create the bomb
|
||||
bomb = G_Spawn();
|
||||
//VectorCopy(tr.endpos, bomb->s.origin);
|
||||
// VectorCopy(tr.endpos, bomb->s.origin);
|
||||
VectorMA(tr.endpos, 3, tr.plane.normal, bomb->s.origin);
|
||||
vectoangles(tr.plane.normal, bomb->s.angles);
|
||||
bomb->owner = self;
|
||||
setupBomb(bomb, "ired", damage, damage_radius);
|
||||
setupBomb (bomb, "ired", damage, damage_radius);
|
||||
gi.linkentity(bomb);
|
||||
|
||||
bomb->timestamp = level.time;
|
||||
|
@ -430,6 +493,8 @@ void weapon_lasertripbomb_fire (edict_t *ent)
|
|||
float radius = sk_tbomb_radius->value;
|
||||
if (is_quad)
|
||||
damage *= 4;
|
||||
if (is_double)
|
||||
damage *= 2;
|
||||
|
||||
// place the trip bomb
|
||||
VectorSet(offset, 0, 0, ent->viewheight * 0.75);
|
||||
|
@ -444,7 +509,7 @@ void weapon_lasertripbomb_fire (edict_t *ent)
|
|||
ent->client->ps.gunindex = gi.modelindex("models/weapons/v_ired/hand.md2");
|
||||
|
||||
// play quad sound
|
||||
playQuadSound(ent);
|
||||
// playQuadSound (ent);
|
||||
}
|
||||
}
|
||||
else if (ent->client->ps.gunframe == 15)
|
||||
|
@ -598,9 +663,9 @@ void SP_misc_lasertripbomb (edict_t *bomb)
|
|||
// precache
|
||||
gi.soundindex("weapons/ired/las_set.wav");
|
||||
gi.soundindex("weapons/ired/las_arm.wav");
|
||||
//gi.soundindex("weapons/ired/las_tink.wav");
|
||||
//gi.soundindex("weapons/ired/las_trig.wav");
|
||||
//gi.soundindex("weapons/ired/las_glow.wav");
|
||||
// gi.soundindex("weapons/ired/las_tink.wav");
|
||||
// gi.soundindex("weapons/ired/las_trig.wav");
|
||||
// gi.soundindex("weapons/ired/las_glow.wav");
|
||||
gi.modelindex("models/objects/shrapnel/tris.md2");
|
||||
gi.modelindex("models/objects/ired/tris.md2");
|
||||
|
||||
|
@ -630,7 +695,7 @@ void SP_misc_lasertripbomb (edict_t *bomb)
|
|||
}
|
||||
gi.linkentity(bomb);
|
||||
}
|
||||
#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
//#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
|
||||
/*
|
||||
======================================================================
|
||||
|
@ -639,7 +704,7 @@ Sonic Cannon
|
|||
|
||||
======================================================================
|
||||
*/
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
#ifdef USE_ZAERO_WEAPONS
|
||||
void weapon_sc_fire (edict_t *ent)
|
||||
{
|
||||
int maxfiretime = sk_soniccannon_maxfiretime->value;
|
||||
|
@ -794,6 +859,8 @@ void Weapon_SonicCannon (edict_t *ent)
|
|||
}
|
||||
|
||||
Weapon_Generic (ent, 6, 22, 52, 57, pause_frames, fire_frames, weapon_sc_fire);
|
||||
if (is_quadfire)
|
||||
Weapon_Generic (ent, 6, 22, 52, 57, pause_frames, fire_frames, weapon_sc_fire);
|
||||
}
|
||||
|
||||
|
||||
|
@ -899,9 +966,9 @@ void fire_sconnan (edict_t *self)
|
|||
}
|
||||
|
||||
// play quad damage sound
|
||||
playQuadSound(self);
|
||||
// playQuadSound (self);
|
||||
}
|
||||
#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
#endif // USE_ZAERO_WEAPONS
|
||||
|
||||
|
||||
|
||||
|
@ -1052,7 +1119,7 @@ void fire_flare (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed,
|
|||
gi.linkentity (flare);
|
||||
}
|
||||
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
//#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
void Weapon_FlareLauncher_Fire (edict_t *ent)
|
||||
{
|
||||
vec3_t offset, start;
|
||||
|
@ -1069,7 +1136,7 @@ void Weapon_FlareLauncher_Fire (edict_t *ent)
|
|||
PlayerNoise(ent, start, PNOISE_WEAPON);
|
||||
|
||||
// play quad sound
|
||||
playQuadSound(ent);
|
||||
// playQuadSound (ent);
|
||||
|
||||
if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
|
||||
ent->client->pers.inventory[ent->client->ammo_index]--;
|
||||
|
@ -1087,8 +1154,10 @@ void Weapon_FlareGun (edict_t *ent)
|
|||
static int fire_frames[] = {8, 0};
|
||||
|
||||
Weapon_Generic (ent, 5, 14, 44, 48, pause_frames, fire_frames, Weapon_FlareLauncher_Fire);
|
||||
if (is_quadfire)
|
||||
Weapon_Generic (ent, 5, 14, 44, 48, pause_frames, fire_frames, Weapon_FlareLauncher_Fire);
|
||||
}
|
||||
#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
//#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
|
||||
/*
|
||||
======================================================================
|
||||
|
@ -1097,7 +1166,7 @@ Sniper Rifle
|
|||
|
||||
======================================================================
|
||||
*/
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
#ifdef USE_ZAERO_WEAPONS
|
||||
void fire_sniper_bullet (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick)
|
||||
{
|
||||
trace_t tr;
|
||||
|
@ -1107,7 +1176,7 @@ void fire_sniper_bullet (edict_t *self, vec3_t start, vec3_t aimdir, int damage,
|
|||
|
||||
VectorMA (start, WORLD_SIZE, aimdir, end); // was 8192
|
||||
VectorCopy(start, s);
|
||||
while (i<256) // Knightmare- prevent infinite loop, was 1
|
||||
while (i < 256) // Knightmare- prevent infinite loop, was 1
|
||||
{
|
||||
tr = gi.trace (s, NULL, NULL, end, ignore, MASK_SHOT_NO_WINDOW);
|
||||
if (tr.fraction >= 1.0)
|
||||
|
@ -1164,11 +1233,14 @@ void weapon_sniperrifle_fire (edict_t *ent)
|
|||
kick = sk_sniperrifle_kick->value; // 400
|
||||
}
|
||||
|
||||
if (is_quad)
|
||||
{
|
||||
if (is_quad) {
|
||||
damage *= 4;
|
||||
kick *= 4;
|
||||
}
|
||||
if (is_double) {
|
||||
damage *= 2;
|
||||
kick *= 2;
|
||||
}
|
||||
|
||||
AngleVectors (ent->client->v_angle, forward, right, NULL);
|
||||
// centre the shot
|
||||
|
@ -1184,7 +1256,7 @@ void weapon_sniperrifle_fire (edict_t *ent)
|
|||
PlayerNoise(ent, start, PNOISE_WEAPON);
|
||||
|
||||
// play quad sound
|
||||
playQuadSound(ent);
|
||||
// playQuadSound (ent);
|
||||
|
||||
VectorScale (forward, -20, ent->client->kick_origin);
|
||||
ent->client->kick_angles[0] = -2;
|
||||
|
@ -1339,7 +1411,7 @@ void Weapon_SniperRifle(edict_t *ent)
|
|||
ent->client->sniperFramenum = level.framenum + (sk_sniper_charge_time->value * 10); // SNIPER_CHARGE_TIME;
|
||||
}
|
||||
}
|
||||
#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
#endif // USE_ZAERO_WEAPONS
|
||||
|
||||
/*
|
||||
======================================================================
|
||||
|
@ -1348,7 +1420,7 @@ Armageddon 2000
|
|||
|
||||
======================================================================
|
||||
*/
|
||||
#ifdef USE_ZAERO_ITEMS_WEAPONS
|
||||
#ifdef USE_ZAERO_WEAPONS
|
||||
void weapon_a2k_exp_think(edict_t *self)
|
||||
{
|
||||
self->s.frame++;
|
||||
|
@ -1406,12 +1478,12 @@ void weapon_a2k_fire (edict_t *ent)
|
|||
ent->client->ps.gunframe++;
|
||||
|
||||
// start scream sound
|
||||
//ent->client->weapon_sound = gi.soundindex("weapons/a2k/countdn.wav");
|
||||
// ent->client->weapon_sound = gi.soundindex("weapons/a2k/countdn.wav");
|
||||
gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/a2k/countdn.wav"), 1, ATTN_NORM, 0);
|
||||
//gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/a2k/ak_trig.wav"), 1, ATTN_NORM, 0);
|
||||
// gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/a2k/ak_trig.wav"), 1, ATTN_NORM, 0);
|
||||
|
||||
// play quad sound
|
||||
playQuadSound(ent);
|
||||
// playQuadSound (ent);
|
||||
}
|
||||
else if (ent->client->a2kFramenum == level.framenum)
|
||||
{
|
||||
|
@ -1422,12 +1494,16 @@ void weapon_a2k_fire (edict_t *ent)
|
|||
float dmg_radius = sk_a2k_radius->value; // was 512
|
||||
|
||||
// play quad sound
|
||||
playQuadSound(ent);
|
||||
if (is_quad)
|
||||
{
|
||||
// playQuadSound (ent);
|
||||
if (is_quad) {
|
||||
damage *= 4;
|
||||
dmg_radius *= 4;
|
||||
}
|
||||
if (is_double) {
|
||||
damage *= 4;
|
||||
dmg_radius *= 4;
|
||||
}
|
||||
|
||||
// do some damage
|
||||
T_RadiusDamage(ent, ent, damage, NULL, dmg_radius, MOD_A2K);
|
||||
|
||||
|
@ -1474,7 +1550,7 @@ void Weapon_A2k (edict_t *ent)
|
|||
|
||||
Weapon_Generic (ent, 9, 19, 49, 55, pause_frames, fire_frames, weapon_a2k_fire);
|
||||
}
|
||||
#endif // USE_ZAERO_ITEMS_WEAPONS
|
||||
#endif // USE_ZAERO_WEAPONS
|
||||
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue