mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-01-18 06:22:30 +00:00
Fixed crucified insanes being screwed up by the clearing of spawnflags bit 8, which conflicts with SF_MONSTER_GOODGUY.
This manifiested as glitches such as them sliding downward when they or the player are shot.
This commit is contained in:
parent
62c5281baa
commit
b020f21541
20 changed files with 424 additions and 369 deletions
|
@ -39,6 +39,11 @@ fatal error when loading too many md2 models (VirtualAlloc reserve failure)
|
|||
|
||||
game menu text doesn't show when connected to RA2 server
|
||||
- FIXED by allowing CS_STATUSBAR to overflow thru CS_AIRACCEL-1
|
||||
|
||||
Crucified insane in jail4 moving downward when player is shot by blaster guard.
|
||||
Causes startsolid error for key_security_pass spawned by target_spawner in air above floor.
|
||||
This is due to insane's earlier death by crusher, spawning key_security_pass when crusher overlaps its bbox.
|
||||
- FIXED by using moreflags edict_t field for internal crucified checks
|
||||
|
||||
Thirdperson player shadow not drawn correctly at times (start of hangar1)
|
||||
|
||||
|
|
143
game/g_combat.c
143
game/g_combat.c
|
@ -75,7 +75,7 @@ qboolean CanDamage (edict_t *targ, edict_t *inflictor)
|
|||
// from inflictor to targ is blocked by a func_tracktrain, AND the targ is riding/driving
|
||||
// the tracktrain, go ahead and hurt him.
|
||||
|
||||
if(trace.ent && (trace.ent->flags & FL_TRACKTRAIN) && ((trace.ent->owner == targ) || (targ->groundentity == trace.ent)) )
|
||||
if (trace.ent && (trace.ent->flags & FL_TRACKTRAIN) && ((trace.ent->owner == targ) || (targ->groundentity == trace.ent)) )
|
||||
return true;
|
||||
|
||||
VectorCopy (targ->s.origin, dest);
|
||||
|
@ -203,7 +203,7 @@ void SpawnDamage (int type, vec3_t origin, vec3_t normal)
|
|||
gi.WriteDir (normal);
|
||||
gi.multicast (origin, MULTICAST_PVS);
|
||||
|
||||
if(level.num_reflectors)
|
||||
if (level.num_reflectors)
|
||||
ReflectSparks(type,origin,normal);
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
{
|
||||
edict_t *teammate;
|
||||
|
||||
if(!targ || !attacker)
|
||||
if (!targ || !attacker)
|
||||
return;
|
||||
|
||||
// Knightmare- insanes ignore damage- fix crash on fact2?
|
||||
|
@ -389,28 +389,28 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
return;
|
||||
|
||||
// Lazarus dmgteam stuff
|
||||
if( (attacker->client && !(attacker->flags & FL_NOTARGET)) || (attacker->svflags & SVF_MONSTER))
|
||||
if ( (attacker->client && !(attacker->flags & FL_NOTARGET)) || (attacker->svflags & SVF_MONSTER))
|
||||
{ // the attacker is a player or a monster
|
||||
if( (targ->svflags & SVF_MONSTER) && (targ->dmgteam) && (targ->health > 0) )
|
||||
if ( (targ->svflags & SVF_MONSTER) && (targ->dmgteam) && (targ->health > 0) )
|
||||
{ // the target is a live monster on a dmgteam
|
||||
if( !attacker->dmgteam || strcmp(targ->dmgteam,attacker->dmgteam) )
|
||||
if ( !attacker->dmgteam || strcmp(targ->dmgteam,attacker->dmgteam) )
|
||||
{ // attacker is not on same dmgteam as target
|
||||
if( !Q_stricmp(targ->dmgteam,"player") && attacker->client )
|
||||
if ( !Q_stricmp(targ->dmgteam,"player") && attacker->client )
|
||||
{ // Target is a GOOD_GUY, attacked by the player. Allow self-defense,
|
||||
// but don't get other dmgteam teammates involved.
|
||||
// Special case for misc_actors - if ACTOR_BAD_GUY isn't set,
|
||||
// actor stays on the same team and only taunts player
|
||||
if(!(targ->monsterinfo.aiflags & AI_ACTOR) || (targ->spawnflags & SF_ACTOR_BAD_GUY))
|
||||
if (!(targ->monsterinfo.aiflags & AI_ACTOR) || (targ->spawnflags & SF_ACTOR_BAD_GUY))
|
||||
{
|
||||
targ->enemy = targ->movetarget = targ->goalentity = attacker;
|
||||
targ->monsterinfo.aiflags &= ~AI_FOLLOW_LEADER;
|
||||
if(visible(targ,targ->enemy))
|
||||
if (visible(targ,targ->enemy))
|
||||
FoundTarget(targ);
|
||||
else
|
||||
HuntTarget(targ);
|
||||
}
|
||||
}
|
||||
else if( !(targ->svflags & SVF_MONSTER) || !(attacker->svflags & SVF_MONSTER) ||
|
||||
else if ( !(targ->svflags & SVF_MONSTER) || !(attacker->svflags & SVF_MONSTER) ||
|
||||
(targ->monsterinfo.aiflags & AI_FREEFORALL) ||
|
||||
((targ->monsterinfo.aiflags & AI_GOOD_GUY) != (attacker->monsterinfo.aiflags & AI_GOOD_GUY)) )
|
||||
{
|
||||
|
@ -420,13 +420,13 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
teammate = G_Find(NULL,FOFS(dmgteam),targ->dmgteam);
|
||||
while(teammate)
|
||||
{
|
||||
if(teammate != targ)
|
||||
if (teammate != targ)
|
||||
{
|
||||
if(teammate->svflags & SVF_MONSTER)
|
||||
if (teammate->svflags & SVF_MONSTER)
|
||||
{
|
||||
if(teammate->health > 0 && (teammate->enemy != attacker) && !(teammate->monsterinfo.aiflags & AI_CHASE_THING))
|
||||
if (teammate->health > 0 && (teammate->enemy != attacker) && !(teammate->monsterinfo.aiflags & AI_CHASE_THING))
|
||||
{
|
||||
if(!teammate->enemy || !teammate->enemy->dmgteam || !attacker->dmgteam )
|
||||
if (!teammate->enemy || !teammate->enemy->dmgteam || !attacker->dmgteam )
|
||||
{
|
||||
// If either 1) this teammate doesn't currently have an enemy,
|
||||
// or 2) the teammate's enemy is not a member of a dmgteam
|
||||
|
@ -434,7 +434,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
// then set the attacker as the enemy of this teammate
|
||||
DefendMyFriend(teammate,attacker);
|
||||
}
|
||||
else if(strcmp(teammate->enemy->dmgteam,attacker->dmgteam))
|
||||
else if (strcmp(teammate->enemy->dmgteam,attacker->dmgteam))
|
||||
{
|
||||
// attacker is a member of a team different than the
|
||||
// current enemy
|
||||
|
@ -442,7 +442,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(!(teammate->svflags & SVF_DEADMONSTER))
|
||||
else if (!(teammate->svflags & SVF_DEADMONSTER))
|
||||
G_UseTargets(teammate,attacker);
|
||||
}
|
||||
teammate = G_Find(teammate,FOFS(dmgteam),targ->dmgteam);
|
||||
|
@ -451,7 +451,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
}
|
||||
}
|
||||
}
|
||||
if( targ->client && (attacker->svflags & SVF_MONSTER) )
|
||||
if ( targ->client && (attacker->svflags & SVF_MONSTER) )
|
||||
{
|
||||
// target is player; attacker is monster... alert "good guys", if any
|
||||
// trace_t tr;
|
||||
|
@ -459,16 +459,16 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
teammate = G_Find(NULL,FOFS(dmgteam),"player");
|
||||
while(teammate)
|
||||
{
|
||||
if((teammate->health > 0) && !(teammate->monsterinfo.aiflags & AI_CHASE_THING) && (teammate != attacker))
|
||||
if ((teammate->health > 0) && !(teammate->monsterinfo.aiflags & AI_CHASE_THING) && (teammate != attacker))
|
||||
{
|
||||
// Can teammate see player?
|
||||
// tr = gi.trace(teammate->s.origin,vec3_origin,vec3_origin,targ->s.origin,teammate,MASK_OPAQUE);
|
||||
// if(tr.fraction == 1.0)
|
||||
if(gi.inPVS(teammate->s.origin,targ->s.origin))
|
||||
// if (tr.fraction == 1.0)
|
||||
if (gi.inPVS(teammate->s.origin,targ->s.origin))
|
||||
{
|
||||
teammate->enemy = attacker;
|
||||
FoundTarget(teammate);
|
||||
if(teammate->monsterinfo.aiflags & AI_ACTOR)
|
||||
if (teammate->monsterinfo.aiflags & AI_ACTOR)
|
||||
{
|
||||
teammate->monsterinfo.aiflags |= AI_FOLLOW_LEADER;
|
||||
teammate->monsterinfo.old_leader = NULL;
|
||||
|
@ -480,19 +480,20 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
}
|
||||
}
|
||||
// If player attacks a GOODGUY, turn GOODGUY stuff off
|
||||
if (attacker->client && (targ->svflags & SVF_MONSTER) && (targ->spawnflags & SF_MONSTER_GOODGUY))
|
||||
if (attacker->client && (targ->svflags & SVF_MONSTER)
|
||||
&& UseRegularGoodGuyFlag(targ) && (targ->spawnflags & SF_MONSTER_GOODGUY))
|
||||
{
|
||||
if(!(targ->monsterinfo.aiflags & AI_ACTOR) || (targ->spawnflags & SF_ACTOR_BAD_GUY))
|
||||
if (!(targ->monsterinfo.aiflags & AI_ACTOR) || (targ->spawnflags & SF_ACTOR_BAD_GUY))
|
||||
{
|
||||
targ->spawnflags &= ~SF_MONSTER_GOODGUY;
|
||||
targ->monsterinfo.aiflags &= ~(AI_GOOD_GUY + AI_FOLLOW_LEADER);
|
||||
if(targ->dmgteam && !Q_stricmp(targ->dmgteam,"player"))
|
||||
if (targ->dmgteam && !Q_stricmp(targ->dmgteam,"player"))
|
||||
targ->dmgteam = NULL;
|
||||
}
|
||||
}
|
||||
// 1.6.1.3 change - one chance and one chance only to call friends
|
||||
/* if(targ->dmgteam)
|
||||
if(Q_stricmp(targ->dmgteam,"player"))
|
||||
/* if (targ->dmgteam)
|
||||
if (Q_stricmp(targ->dmgteam,"player"))
|
||||
targ->dmgteam = NULL; */
|
||||
}
|
||||
|
||||
|
@ -500,7 +501,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
{
|
||||
qboolean is_turret;
|
||||
|
||||
if( targ->health <= 0 )
|
||||
if ( targ->health <= 0 )
|
||||
return;
|
||||
|
||||
// If targ is currently chasing a "thing" or we're running a hint_path test, he
|
||||
|
@ -537,7 +538,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
|
||||
VectorCopy(targ->mins,mins);
|
||||
mins[2] += 16; // max step height? not sure about this
|
||||
if(mins[2] > 0) mins[2] = 0;
|
||||
if (mins[2] > 0) mins[2] = 0;
|
||||
VectorCopy(targ->maxs,maxs);
|
||||
if ((attacker == world) ||
|
||||
(!Q_stricmp(attacker->classname,"func_door") ) ||
|
||||
|
@ -561,12 +562,12 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if(!Q_stricmp(attacker->classname,"target_laser"))
|
||||
else if (!Q_stricmp(attacker->classname,"target_laser"))
|
||||
{
|
||||
// Send the monster in a direction perpendicular to laser
|
||||
// path, whichever direction is closest to current angles
|
||||
thing = SpawnThing();
|
||||
if(attacker->movedir[2] > 0.7)
|
||||
if (attacker->movedir[2] > 0.7)
|
||||
{
|
||||
// Just move straight ahead and hope for the best
|
||||
AngleVectors(targ->s.angles,best_dir,NULL,NULL);
|
||||
|
@ -579,7 +580,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
best_dir[1] = best_dir[2];
|
||||
best_dir[2] = 0;
|
||||
AngleVectors(targ->s.angles,dir,NULL,NULL);
|
||||
if(DotProduct(best_dir,dir) < 0)
|
||||
if (DotProduct(best_dir,dir) < 0)
|
||||
VectorNegate(best_dir,best_dir);
|
||||
}
|
||||
}
|
||||
|
@ -588,7 +589,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
// Attacked by a point entity or moving brush model
|
||||
// not covered above. Find a vector that will hide the
|
||||
// monster from the attacker.
|
||||
if(!VectorLength(attacker->size)) {
|
||||
if (!VectorLength(attacker->size)) {
|
||||
// point entity
|
||||
VectorCopy(attacker->s.origin,atk);
|
||||
} else {
|
||||
|
@ -597,9 +598,9 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
}
|
||||
VectorClear(best_dir);
|
||||
AngleVectors(targ->s.angles,forward,NULL,NULL);
|
||||
for(i=0; i<32 && best_dist == 0; i++) {
|
||||
for (i=0; i<32 && best_dist == 0; i++) {
|
||||
// Weight escape route tests in favor of forward-facing direction
|
||||
if(random() > 0.5) {
|
||||
if (random() > 0.5) {
|
||||
dir[0] = forward[0] + 0.5*crandom();
|
||||
dir[1] = forward[1] + 0.5*crandom();
|
||||
dir[2] = forward[2];
|
||||
|
@ -612,19 +613,19 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
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;
|
||||
if (trace2.fraction == 1.0) continue;
|
||||
dist = trace1.fraction * WORLD_SIZE; // was 8192
|
||||
if(dist > best_dist) {
|
||||
if (dist > best_dist) {
|
||||
best_dist = dist;
|
||||
VectorCopy(dir,best_dir);
|
||||
}
|
||||
}
|
||||
if(best_dist == 0.)
|
||||
if (best_dist == 0.)
|
||||
return;
|
||||
thing = SpawnThing();
|
||||
vectoangles(best_dir,thing->s.angles);
|
||||
}
|
||||
if( (!Q_stricmp(attacker->classname,"func_door")) ||
|
||||
if ( (!Q_stricmp(attacker->classname,"func_door")) ||
|
||||
(!Q_stricmp(attacker->classname,"func_pushable")) )
|
||||
run = 256;
|
||||
else
|
||||
|
@ -634,7 +635,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
dist = trace1.fraction * run;
|
||||
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)
|
||||
if (targ->enemy)
|
||||
thing->touch_debounce_time = level.time + 2.0;
|
||||
else
|
||||
thing->touch_debounce_time = level.time + max(5.0,dist/50.);
|
||||
|
@ -679,7 +680,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
if ((targ->monsterinfo.aiflags & AI_TARGET_ANGER) && (targ->enemy)) {
|
||||
|
||||
// ensure that the subject of our wrath is still present & we're not too beat up
|
||||
if(targ->enemy->inuse) {
|
||||
if (targ->enemy->inuse) {
|
||||
float health_ratio = (float)(targ->health) / (float)(targ->max_health);
|
||||
if ((health_ratio > 0.333) && (targ->enemy->inuse)) return;
|
||||
}
|
||||
|
@ -715,7 +716,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
targ->oldenemy = targ->enemy;
|
||||
}
|
||||
targ->enemy = attacker;
|
||||
if(visible(targ,targ->enemy))
|
||||
if (visible(targ,targ->enemy))
|
||||
FoundTarget (targ);
|
||||
else
|
||||
HuntTarget (targ);
|
||||
|
@ -734,13 +735,13 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
// Lazarus: Check IGNORE_SHOTS spawnflag for attacker. If set AND
|
||||
// targ and attacker have same GOODGUY setting, don't respond
|
||||
// to attacks.
|
||||
if( ( (targ->spawnflags & SF_MONSTER_GOODGUY) != (attacker->spawnflags & SF_MONSTER_GOODGUY) ) ||
|
||||
if ( ( (targ->spawnflags & SF_MONSTER_GOODGUY) != (attacker->spawnflags & SF_MONSTER_GOODGUY) ) ||
|
||||
!(attacker->spawnflags & SF_MONSTER_IGNORESHOTS) )
|
||||
{
|
||||
if (targ->enemy && targ->enemy->client)
|
||||
targ->oldenemy = targ->enemy;
|
||||
targ->enemy = attacker;
|
||||
if(visible(targ,targ->enemy))
|
||||
if (visible(targ,targ->enemy))
|
||||
FoundTarget (targ);
|
||||
else
|
||||
HuntTarget (targ);
|
||||
|
@ -753,7 +754,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
if (targ->enemy && targ->enemy->client)
|
||||
targ->oldenemy = targ->enemy;
|
||||
targ->enemy = attacker;
|
||||
if(visible(targ,targ->enemy))
|
||||
if (visible(targ,targ->enemy))
|
||||
FoundTarget (targ);
|
||||
else
|
||||
HuntTarget (targ);
|
||||
|
@ -765,7 +766,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
if (targ->enemy && targ->enemy->client)
|
||||
targ->oldenemy = targ->enemy;
|
||||
targ->enemy = attacker->enemy;
|
||||
if(visible(targ,targ->enemy))
|
||||
if (visible(targ,targ->enemy))
|
||||
FoundTarget (targ);
|
||||
else
|
||||
HuntTarget (targ);
|
||||
|
@ -808,7 +809,7 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
// Lazarus: If monster/actor is currently being forced to use
|
||||
// specific animations due to target_animation, release that
|
||||
// control over it.
|
||||
if((targ->think == target_animate) && (targ->svflags & SVF_MONSTER))
|
||||
if ((targ->think == target_animate) && (targ->svflags & SVF_MONSTER))
|
||||
{
|
||||
targ->think = monster_think;
|
||||
targ->nextthink = level.time + FRAMETIME;
|
||||
|
@ -824,9 +825,9 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
// out of the camera and do the damage to him
|
||||
if (!Q_stricmp(targ->classname,"camplayer"))
|
||||
{
|
||||
if(targ->target_ent && targ->target_ent->client && targ->target_ent->client->spycam)
|
||||
if (targ->target_ent && targ->target_ent->client && targ->target_ent->client->spycam)
|
||||
{
|
||||
if(attacker->enemy == targ)
|
||||
if (attacker->enemy == targ)
|
||||
{
|
||||
attacker->enemy = targ->target_ent;
|
||||
attacker->goalentity = NULL;
|
||||
|
@ -834,23 +835,23 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
}
|
||||
targ = targ->target_ent;
|
||||
camera_off(targ);
|
||||
if(attacker->svflags & SVF_MONSTER)
|
||||
if (attacker->svflags & SVF_MONSTER)
|
||||
{
|
||||
if(attacker->spawnflags & SF_MONSTER_GOODGUY)
|
||||
if ( UseRegularGoodGuyFlag(attacker) && (attacker->spawnflags & SF_MONSTER_GOODGUY) )
|
||||
{
|
||||
if(attacker->enemy == targ)
|
||||
if (attacker->enemy == targ)
|
||||
{
|
||||
attacker->enemy = NULL;
|
||||
attacker->monsterinfo.aiflags &= ~AI_FOLLOW_LEADER;
|
||||
attacker->monsterinfo.attack_finished = 0;
|
||||
attacker->monsterinfo.pausetime = level.time + 100000000;
|
||||
if(attacker->monsterinfo.stand)
|
||||
if (attacker->monsterinfo.stand)
|
||||
attacker->monsterinfo.stand(attacker);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(attacker->enemy == targ)
|
||||
if (attacker->enemy == targ)
|
||||
FoundTarget(attacker);
|
||||
}
|
||||
}
|
||||
|
@ -1038,7 +1039,7 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
{
|
||||
// Knightmare- added support for sparks and blood
|
||||
// SpawnDamage ( BloodType(targ->blood_type), point, normal );
|
||||
if(targ->blood_type == 1)
|
||||
if (targ->blood_type == 1)
|
||||
SpawnDamage (TE_GREENBLOOD, point, normal);
|
||||
else if (targ->blood_type == 2)
|
||||
{
|
||||
|
@ -1058,9 +1059,9 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
SpawnDamage (te_sparks, point, normal);
|
||||
}
|
||||
|
||||
if(targ->client)
|
||||
if (targ->client)
|
||||
{
|
||||
if(in_targ != targ)
|
||||
if (in_targ != targ)
|
||||
{
|
||||
// Then player has taken the place of whatever was originally
|
||||
// damaged, as in switching from func_monitor usage. Limit
|
||||
|
@ -1070,34 +1071,34 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_
|
|||
targ->client->invincible_framenum = level.framenum+2;
|
||||
targ->pain_debounce_time = max(targ->pain_debounce_time,level.time+0.3);
|
||||
}
|
||||
else if(level.framenum - targ->client->startframe > 30)
|
||||
else if (level.framenum - targ->client->startframe > 30)
|
||||
targ->health = targ->health - take;
|
||||
else if(targ->health > 10)
|
||||
else if (targ->health > 10)
|
||||
targ->health = max(10,targ->health - take);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Lazarus: For func_explosive target, check spawnflags and, if needed,
|
||||
// damage type
|
||||
if(targ->classname && !Q_stricmp(targ->classname,"func_explosive"))
|
||||
if (targ->classname && !Q_stricmp(targ->classname,"func_explosive"))
|
||||
{
|
||||
qboolean good_damage = true;
|
||||
// Knightmare- changed spawnflag
|
||||
if(targ->spawnflags & 16) // explosion only
|
||||
if (targ->spawnflags & 16) // explosion only
|
||||
{
|
||||
good_damage = false;
|
||||
if(mod == MOD_GRENADE) good_damage = true;
|
||||
if(mod == MOD_G_SPLASH) good_damage = true;
|
||||
if(mod == MOD_ROCKET) good_damage = true;
|
||||
if(mod == MOD_R_SPLASH) good_damage = true;
|
||||
if(mod == MOD_BFG_BLAST) good_damage = true;
|
||||
if(mod == MOD_HANDGRENADE) good_damage = true;
|
||||
if(mod == MOD_HG_SPLASH) good_damage = true;
|
||||
if(mod == MOD_EXPLOSIVE) good_damage = true;
|
||||
if(mod == MOD_BARREL) good_damage = true;
|
||||
if(mod == MOD_BOMB) good_damage = true;
|
||||
if (mod == MOD_GRENADE) good_damage = true;
|
||||
if (mod == MOD_G_SPLASH) good_damage = true;
|
||||
if (mod == MOD_ROCKET) good_damage = true;
|
||||
if (mod == MOD_R_SPLASH) good_damage = true;
|
||||
if (mod == MOD_BFG_BLAST) good_damage = true;
|
||||
if (mod == MOD_HANDGRENADE) good_damage = true;
|
||||
if (mod == MOD_HG_SPLASH) good_damage = true;
|
||||
if (mod == MOD_EXPLOSIVE) good_damage = true;
|
||||
if (mod == MOD_BARREL) good_damage = true;
|
||||
if (mod == MOD_BOMB) good_damage = true;
|
||||
}
|
||||
if(!good_damage) return;
|
||||
if (!good_damage) return;
|
||||
}
|
||||
|
||||
targ->health = targ->health - take;
|
||||
|
|
|
@ -731,6 +731,7 @@ extern void vehicle_disengage ( edict_t * vehicle ) ;
|
|||
extern void vehicle_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
|
||||
extern void vehicle_blocked ( edict_t * self , edict_t * other ) ;
|
||||
extern void func_vehicle_explode ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
|
||||
extern qboolean UseRegularGoodGuyFlag ( edict_t * monster ) ;
|
||||
extern void my_bprintf ( int printlevel , char * fmt , ... ) ;
|
||||
extern qboolean IsIdMap ( void ) ;
|
||||
extern void G_UseTarget ( edict_t * ent , edict_t * activator , edict_t * target ) ;
|
||||
|
|
|
@ -731,6 +731,7 @@
|
|||
{"vehicle_touch", (byte *)vehicle_touch},
|
||||
{"vehicle_blocked", (byte *)vehicle_blocked},
|
||||
{"func_vehicle_explode", (byte *)func_vehicle_explode},
|
||||
{"UseRegularGoodGuyFlag", (byte *)UseRegularGoodGuyFlag},
|
||||
{"my_bprintf", (byte *)my_bprintf},
|
||||
{"IsIdMap", (byte *)IsIdMap},
|
||||
{"G_UseTarget", (byte *)G_UseTarget},
|
||||
|
|
|
@ -1178,6 +1178,7 @@ void CreatePath (char *path);
|
|||
void G_UseTarget (edict_t *ent, edict_t *activator, edict_t *target);
|
||||
qboolean IsIdMap (void); // Knightmare added
|
||||
void my_bprintf (int printlevel, char *fmt, ...);
|
||||
qboolean UseRegularGoodGuyFlag (edict_t *monster); // Knightmare added
|
||||
|
||||
void G_ProjectSource2 (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t up, vec3_t result);
|
||||
float vectoyaw2 (vec3_t vec);
|
||||
|
|
|
@ -572,7 +572,9 @@ void monster_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
// if monster is "used" by player, turn off good guy stuff
|
||||
if (activator->client)
|
||||
{
|
||||
self->spawnflags &= ~SF_MONSTER_GOODGUY;
|
||||
if (UseRegularGoodGuyFlag(self)) {
|
||||
self->spawnflags &= ~SF_MONSTER_GOODGUY;
|
||||
}
|
||||
self->monsterinfo.aiflags &= ~(AI_GOOD_GUY + AI_FOLLOW_LEADER);
|
||||
if(self->dmgteam && !Q_stricmp(self->dmgteam,"player"))
|
||||
self->dmgteam = NULL;
|
||||
|
@ -696,7 +698,8 @@ qboolean monster_start (edict_t *self)
|
|||
}
|
||||
|
||||
// Lazarus: Good guys
|
||||
if (self->spawnflags & SF_MONSTER_GOODGUY) {
|
||||
if ( UseRegularGoodGuyFlag(self) && (self->spawnflags & SF_MONSTER_GOODGUY) )
|
||||
{
|
||||
self->monsterinfo.aiflags |= AI_GOOD_GUY;
|
||||
if(!self->dmgteam) {
|
||||
self->dmgteam = gi.TagMalloc(8*sizeof(char), TAG_LEVEL);
|
||||
|
|
|
@ -1159,4 +1159,30 @@ void my_bprintf (int printlevel, char *fmt, ...)
|
|||
|
||||
safe_cprintf(cl_ent, printlevel, bigbuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Knightmare added
|
||||
/*
|
||||
====================
|
||||
UseRegularGoodGuyFlag
|
||||
|
||||
Checks the classname to see if a monster should use
|
||||
the standard goodguy flag (e.g. not a gekk, stalker, turret, or fixbot).
|
||||
====================
|
||||
*/
|
||||
qboolean UseRegularGoodGuyFlag (edict_t *monster)
|
||||
{
|
||||
// check for bad entity reference
|
||||
if (!monster || !monster->inuse || !monster->classname)
|
||||
return false;
|
||||
|
||||
if ( /*strcmp(monster->classname, "monster_gekk")
|
||||
&& strcmp(monster->classname, "monster_stalker")
|
||||
&& strcmp(monster->classname, "monster_turret")
|
||||
&& strcmp(monster->classname, "monster_fixbot")
|
||||
&& strcmp(monster->classname, "monster_handler")
|
||||
&&*/ strcmp(monster->classname, "misc_insane") )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -503,7 +503,8 @@ void insane_pain (edict_t *self, edict_t *other, float kick, int damage)
|
|||
return; // no pain anims in nightmare
|
||||
|
||||
// Don't go into pain frames if crucified.
|
||||
if (self->spawnflags & 8)
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->monsterinfo.currentmove = &insane_move_struggle_cross;
|
||||
return;
|
||||
|
@ -547,7 +548,8 @@ void insane_checkup (edict_t *self)
|
|||
|
||||
void insane_stand (edict_t *self)
|
||||
{
|
||||
if (self->spawnflags & 8) // If crucified
|
||||
// if (self->spawnflags & 8) // If crucified
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // If crucified // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->monsterinfo.currentmove = &insane_move_cross;
|
||||
self->monsterinfo.aiflags |= AI_STAND_GROUND;
|
||||
|
@ -564,7 +566,8 @@ void insane_stand (edict_t *self)
|
|||
|
||||
void insane_dead (edict_t *self)
|
||||
{
|
||||
if (self->spawnflags & 8)
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->flags |= FL_FLY;
|
||||
}
|
||||
|
@ -580,7 +583,7 @@ void insane_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;
|
||||
|
@ -612,7 +615,8 @@ void insane_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag
|
|||
self->deadflag = DEAD_DEAD;
|
||||
self->takedamage = DAMAGE_YES;
|
||||
|
||||
if (self->spawnflags & 8)
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
insane_dead (self);
|
||||
}
|
||||
|
@ -657,11 +661,11 @@ void SP_misc_insane (edict_t *self)
|
|||
VectorSet (self->mins, -16, -16, -24);
|
||||
VectorSet (self->maxs, 16, 16, 32);
|
||||
|
||||
if(!self->health)
|
||||
if (!self->health)
|
||||
self->health = 100;
|
||||
if(!self->gib_health)
|
||||
if (!self->gib_health)
|
||||
self->gib_health = -50;
|
||||
if(!self->mass)
|
||||
if (!self->mass)
|
||||
self->mass = 300;
|
||||
|
||||
self->pain = insane_pain;
|
||||
|
@ -689,7 +693,7 @@ void SP_misc_insane (edict_t *self)
|
|||
|
||||
self->monsterinfo.currentmove = &insane_move_stand_normal;
|
||||
|
||||
if(!self->monsterinfo.flies)
|
||||
if (!self->monsterinfo.flies)
|
||||
self->monsterinfo.flies = 0.30;
|
||||
|
||||
self->common_name = "Insane Marine";
|
||||
|
@ -698,6 +702,9 @@ void SP_misc_insane (edict_t *self)
|
|||
|
||||
if (self->spawnflags & 8) // Crucified ?
|
||||
{
|
||||
// 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;
|
||||
VectorSet (self->mins, -16, 0, 0);
|
||||
VectorSet (self->maxs, 16, 8, 32);
|
||||
self->flags |= FL_NO_KNOCKBACK;
|
||||
|
|
|
@ -489,7 +489,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker)
|
|||
&& UseSpecialGoodGuyFlag(targ) && (targ->spawnflags & 16) )
|
||||
{
|
||||
targ->spawnflags &= ~16;
|
||||
//Knightmare- don't add to body count
|
||||
// Knightmare- don't add to body count
|
||||
targ->monsterinfo.monsterflags |= MFL_DO_NOT_COUNT;
|
||||
targ->monsterinfo.aiflags &= ~(AI_GOOD_GUY + AI_FOLLOW_LEADER);
|
||||
if (targ->dmgteam && !Q_stricmp(targ->dmgteam,"player"))
|
||||
|
|
|
@ -1467,7 +1467,7 @@ int PowerArmorType (edict_t *ent)
|
|||
return POWER_ARMOR_NONE;
|
||||
}
|
||||
|
||||
//Knightmare- rewrote this to differentiate between power shield and power screen
|
||||
// Knightmare- rewrote this to differentiate between power shield and power screen
|
||||
void Use_PowerArmor (edict_t *ent, gitem_t *item)
|
||||
{
|
||||
int index;
|
||||
|
@ -1816,7 +1816,7 @@ void droptofloor (edict_t *ent)
|
|||
ent->movetype = MOVETYPE_TOSS;
|
||||
ent->touch = Touch_Item;
|
||||
|
||||
if (!(ent->spawnflags & ITEM_NO_DROPTOFLOOR)) //Knightmare- allow marked items to spawn in solids
|
||||
if (!(ent->spawnflags & ITEM_NO_DROPTOFLOOR)) // Knightmare- allow marked items to spawn in solids
|
||||
{
|
||||
v = tv(0,0,-128);
|
||||
VectorAdd (ent->s.origin, v, dest);
|
||||
|
|
|
@ -1206,8 +1206,8 @@ qboolean IsIdMap (void); //Knightmare added
|
|||
qboolean IsRogueMap (void); //Knightmare added
|
||||
qboolean IsXatrixMap (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
|
||||
qboolean UseSpecialGoodGuyFlag (edict_t *monster); // Knightmare added
|
||||
qboolean UseRegularGoodGuyFlag (edict_t *monster); // Knightmare added
|
||||
|
||||
//ROGUE
|
||||
void G_ProjectSource2 (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t up, vec3_t result);
|
||||
|
|
|
@ -87,22 +87,22 @@ qboolean M_SetDeath(edict_t *self, mmove_t **deathmoves)
|
|||
mmove_t *move=NULL;
|
||||
mmove_t *dmove;
|
||||
|
||||
if(self->health > 0)
|
||||
if (self->health > 0)
|
||||
return false;
|
||||
|
||||
while(*deathmoves && !move)
|
||||
{
|
||||
dmove = *deathmoves;
|
||||
if( (self->s.frame >= dmove->firstframe) &&
|
||||
if ( (self->s.frame >= dmove->firstframe) &&
|
||||
(self->s.frame <= dmove->lastframe) )
|
||||
move = dmove;
|
||||
else
|
||||
deathmoves++;
|
||||
}
|
||||
if(move)
|
||||
if (move)
|
||||
{
|
||||
self->monsterinfo.currentmove = move;
|
||||
if(self->monsterinfo.currentmove->endfunc)
|
||||
if (self->monsterinfo.currentmove->endfunc)
|
||||
self->monsterinfo.currentmove->endfunc(self);
|
||||
self->s.frame = move->lastframe;
|
||||
self->s.skinnum |= 1;
|
||||
|
@ -659,7 +659,7 @@ void M_droptofloor (edict_t *ent)
|
|||
|
||||
#ifdef ROGUE_GRAVITY
|
||||
//PGM
|
||||
if(ent->gravityVector[2] < 0)
|
||||
if (ent->gravityVector[2] < 0)
|
||||
{
|
||||
ent->s.origin[2] += 1;
|
||||
VectorCopy (ent->s.origin, end);
|
||||
|
@ -918,15 +918,17 @@ void monster_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
// if monster is "used" by player, turn off good guy stuff
|
||||
if (activator->client)
|
||||
{ // Knightmare- gekks and stalkers use different spawnflag
|
||||
if (UseSpecialGoodGuyFlag(self))
|
||||
if (UseSpecialGoodGuyFlag(self)) {
|
||||
self->spawnflags &= ~16;
|
||||
else if (UseRegularGoodGuyFlag(self))
|
||||
}
|
||||
else if (UseRegularGoodGuyFlag(self)) {
|
||||
self->spawnflags &= ~SF_MONSTER_GOODGUY;
|
||||
//Knightmare- don't include goodguy monsters turned bad in body count
|
||||
}
|
||||
// Knightmare- don't include goodguy monsters turned bad in body count
|
||||
if (self->monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
self->monsterinfo.monsterflags |= MFL_DO_NOT_COUNT;
|
||||
self->monsterinfo.aiflags &= ~(AI_GOOD_GUY + AI_FOLLOW_LEADER);
|
||||
if(self->dmgteam && !Q_stricmp(self->dmgteam,"player"))
|
||||
if (self->dmgteam && !Q_stricmp(self->dmgteam,"player"))
|
||||
self->dmgteam = NULL;
|
||||
}
|
||||
|
||||
|
@ -964,7 +966,7 @@ void monster_triggered_spawn (edict_t *self)
|
|||
|
||||
if (self->enemy && !(self->spawnflags & 1) && !(self->enemy->flags & FL_NOTARGET))
|
||||
{
|
||||
if(!(self->enemy->flags & FL_DISGUISED)) // PGM
|
||||
if (!(self->enemy->flags & FL_DISGUISED)) // PGM
|
||||
FoundTarget (self);
|
||||
else // PMM - just in case, make sure to clear the enemy so FindTarget doesn't get confused
|
||||
self->enemy = NULL;
|
||||
|
@ -984,7 +986,7 @@ void monster_triggered_spawn_use (edict_t *self, edict_t *other, edict_t *activa
|
|||
if (activator->client && !(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
self->enemy = activator;
|
||||
// Lazarus: Add 'em up
|
||||
// if(!(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
// if (!(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
// level.total_monsters++;
|
||||
self->use = monster_use;
|
||||
}
|
||||
|
@ -1026,7 +1028,7 @@ void monster_death_use (edict_t *self)
|
|||
// turn camera off for that player
|
||||
for(i=0,player=g_edicts+1; i<maxclients->value; i++, player++)
|
||||
{
|
||||
if(player->client && player->client->spycam == self)
|
||||
if (player->client && player->client->spycam == self)
|
||||
camera_off(player);
|
||||
}
|
||||
|
||||
|
@ -1071,7 +1073,7 @@ qboolean monster_start (edict_t *self)
|
|||
|| (UseSpecialGoodGuyFlag(self) && (self->spawnflags & 16)) )
|
||||
{
|
||||
self->monsterinfo.aiflags |= AI_GOOD_GUY;
|
||||
if(!self->dmgteam)
|
||||
if (!self->dmgteam)
|
||||
{
|
||||
self->dmgteam = gi.TagMalloc(8*sizeof(char), TAG_LEVEL);
|
||||
strcpy(self->dmgteam,"player");
|
||||
|
@ -1194,7 +1196,7 @@ void monster_start_go (edict_t *self)
|
|||
}
|
||||
|
||||
// Lazarus: move_origin for func_monitor
|
||||
if(!VectorLength(self->move_origin))
|
||||
if (!VectorLength(self->move_origin))
|
||||
VectorSet(self->move_origin,0,0,self->viewheight);
|
||||
|
||||
// check for target to combat_point and change to combattarget
|
||||
|
@ -1257,7 +1259,7 @@ void monster_start_go (edict_t *self)
|
|||
{
|
||||
// Lazarus: Don't wipe out target for trigger spawned monsters
|
||||
// that aren't triggered yet
|
||||
if( !(self->spawnflags & MONSTER_TRIGGER_SPAWN) )
|
||||
if ( !(self->spawnflags & MONSTER_TRIGGER_SPAWN) )
|
||||
{
|
||||
VectorSubtract (self->goalentity->s.origin, self->s.origin, v);
|
||||
self->ideal_yaw = self->s.angles[YAW] = vectoyaw(v);
|
||||
|
@ -1378,7 +1380,7 @@ void stationarymonster_triggered_spawn (edict_t *self)
|
|||
|
||||
if (self->enemy && !(self->spawnflags & 1) && !(self->enemy->flags & FL_NOTARGET))
|
||||
{
|
||||
if(!(self->enemy->flags & FL_DISGUISED)) // PGM
|
||||
if (!(self->enemy->flags & FL_DISGUISED)) // PGM
|
||||
FoundTarget (self);
|
||||
else // PMM - just in case, make sure to clear the enemy so FindTarget doesn't get confused
|
||||
self->enemy = NULL;
|
||||
|
@ -1398,7 +1400,7 @@ void stationarymonster_triggered_spawn_use (edict_t *self, edict_t *other, edict
|
|||
if (activator->client && !(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
self->enemy = activator;
|
||||
// Lazarus: Add 'em up
|
||||
// if(!(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
// if (!(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
// level.total_monsters++;
|
||||
self->use = monster_use;
|
||||
}
|
||||
|
@ -1457,7 +1459,7 @@ void InitiallyDead (edict_t *self)
|
|||
if ((self->max_health <= 0) && !(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
{
|
||||
level.total_monsters--;
|
||||
if(self->deadflag != DEAD_DEAD)
|
||||
if (self->deadflag != DEAD_DEAD)
|
||||
level.killed_monsters--;
|
||||
}
|
||||
if (self->deadflag != DEAD_DEAD)
|
||||
|
@ -1465,7 +1467,7 @@ void InitiallyDead (edict_t *self)
|
|||
damage = 1 - self->health;
|
||||
self->health = 1;
|
||||
T_Damage (self, world, world, vec3_origin, self->s.origin, vec3_origin, damage, 0, DAMAGE_NO_ARMOR, 0);
|
||||
if(self->svflags & SVF_MONSTER)
|
||||
if (self->svflags & SVF_MONSTER)
|
||||
{
|
||||
self->svflags |= SVF_DEADMONSTER;
|
||||
self->think = monster_think;
|
||||
|
@ -1609,7 +1611,7 @@ int PatchMonsterModel (char *modelname)
|
|||
memset (skins[j], 0, MAX_SKINNAME);
|
||||
Com_strcpy( skins[j], sizeof(skins[j]), modelname );
|
||||
p = strstr( skins[j], "tris.md2" );
|
||||
if(!p)
|
||||
if (!p)
|
||||
{
|
||||
fclose (outfile);
|
||||
gi.dprintf( "Error patching %s\n",modelname);
|
||||
|
|
|
@ -431,7 +431,7 @@ void InitGame (void)
|
|||
coop = gi.cvar ("coop", "0", CVAR_LATCH);
|
||||
skill = gi.cvar ("skill", "1", CVAR_LATCH);
|
||||
|
||||
//Knightmare- increase maxentities
|
||||
// Knightmare- increase maxentities
|
||||
//maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH);
|
||||
maxentities = gi.cvar ("maxentities", va("%i",MAX_EDICTS), CVAR_LATCH);
|
||||
gamerules = gi.cvar ("gamerules", "0", CVAR_LATCH); //PGM
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1258,7 +1258,7 @@ qboolean IsIdMap (void)
|
|||
}
|
||||
|
||||
|
||||
//Knightmare added
|
||||
// Knightmare added
|
||||
/*
|
||||
====================
|
||||
IsXatrixMap
|
||||
|
@ -1323,7 +1323,7 @@ qboolean IsXatrixMap (void)
|
|||
return false;
|
||||
}
|
||||
|
||||
//Knightmare added
|
||||
// Knightmare added
|
||||
/*
|
||||
====================
|
||||
IsRogueMap
|
||||
|
@ -1450,9 +1450,9 @@ qboolean UseSpecialGoodGuyFlag (edict_t *monster)
|
|||
if (!monster || !monster->inuse || !monster->classname)
|
||||
return false;
|
||||
|
||||
if (!strcmp(monster->classname, "monster_gekk")
|
||||
if ( !strcmp(monster->classname, "monster_gekk")
|
||||
|| !strcmp(monster->classname, "monster_stalker")
|
||||
|| !strcmp(monster->classname, "monster_handler"))
|
||||
|| !strcmp(monster->classname, "monster_handler") )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -1473,11 +1473,12 @@ qboolean UseRegularGoodGuyFlag (edict_t *monster)
|
|||
if (!monster || !monster->inuse || !monster->classname)
|
||||
return false;
|
||||
|
||||
if (strcmp(monster->classname, "monster_gekk")
|
||||
if ( strcmp(monster->classname, "monster_gekk")
|
||||
&& strcmp(monster->classname, "monster_stalker")
|
||||
&& strcmp(monster->classname, "monster_turret")
|
||||
&& strcmp(monster->classname, "monster_fixbot")
|
||||
&& strcmp(monster->classname, "monster_handler"))
|
||||
&& strcmp(monster->classname, "monster_handler")
|
||||
&& strcmp(monster->classname, "misc_insane") )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -508,7 +508,7 @@ mframe_t brainbeta_frames_attack2 [] =
|
|||
};
|
||||
mmove_t brainbeta_move_attack2 = {FRAME_attak201, FRAME_attak217, brainbeta_frames_attack2, brainbeta_run};
|
||||
|
||||
//Knightmare- replaced by brainbeta_attack
|
||||
// Knightmare- replaced by brainbeta_attack
|
||||
/*
|
||||
void brainbeta_melee (edict_t *self)
|
||||
{
|
||||
|
@ -968,7 +968,7 @@ void SP_monster_brain_beta (edict_t *self)
|
|||
// self->monsterinfo.dodge = brainbeta_dodge;
|
||||
// pmm
|
||||
self->monsterinfo.attack = brainbeta_attack;
|
||||
self->monsterinfo.melee = NULL; //was brainbeta_melee;
|
||||
self->monsterinfo.melee = NULL; // was brainbeta_melee
|
||||
self->monsterinfo.sight = brainbeta_sight;
|
||||
self->monsterinfo.search = brainbeta_search;
|
||||
self->monsterinfo.idle = brainbeta_idle;
|
||||
|
|
|
@ -482,7 +482,8 @@ void insane_pain (edict_t *self, edict_t *other, float kick, int damage)
|
|||
return; // no pain anims in nightmare
|
||||
|
||||
// Don't go into pain frames if crucified.
|
||||
if (self->spawnflags & 8)
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->monsterinfo.currentmove = &insane_move_struggle_cross;
|
||||
return;
|
||||
|
@ -526,7 +527,8 @@ void insane_checkup (edict_t *self)
|
|||
|
||||
void insane_stand (edict_t *self)
|
||||
{
|
||||
if (self->spawnflags & 8) // If crucified
|
||||
// if (self->spawnflags & 8) // If crucified
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // If crucified // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->monsterinfo.currentmove = &insane_move_cross;
|
||||
self->monsterinfo.aiflags |= AI_STAND_GROUND;
|
||||
|
@ -543,7 +545,8 @@ void insane_stand (edict_t *self)
|
|||
|
||||
void insane_dead (edict_t *self)
|
||||
{
|
||||
if (self->spawnflags & 8)
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
self->flags |= FL_FLY;
|
||||
}
|
||||
|
@ -591,7 +594,8 @@ void insane_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag
|
|||
self->deadflag = DEAD_DEAD;
|
||||
self->takedamage = DAMAGE_YES;
|
||||
|
||||
if (self->spawnflags & 8)
|
||||
// if (self->spawnflags & 8)
|
||||
if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead
|
||||
{
|
||||
insane_dead (self);
|
||||
}
|
||||
|
@ -663,7 +667,7 @@ void SP_misc_insane (edict_t *self)
|
|||
|
||||
gi.linkentity (self);
|
||||
|
||||
if (self->spawnflags & 16) // Stand Ground
|
||||
if (self->spawnflags & 16) // Stand Ground
|
||||
self->monsterinfo.aiflags |= AI_STAND_GROUND;
|
||||
|
||||
self->monsterinfo.currentmove = &insane_move_stand_normal;
|
||||
|
@ -675,8 +679,11 @@ void SP_misc_insane (edict_t *self)
|
|||
|
||||
self->monsterinfo.scale = MODEL_SCALE;
|
||||
|
||||
if (self->spawnflags & 8) // Crucified ?
|
||||
if (self->spawnflags & 8) // Crucified ?
|
||||
{
|
||||
// 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;
|
||||
VectorSet (self->mins, -16, 0, 0);
|
||||
VectorSet (self->maxs, 16, 8, 32);
|
||||
self->flags |= FL_NO_KNOCKBACK;
|
||||
|
|
|
@ -247,7 +247,7 @@ void DeathmatchScoreboardMessage (edict_t *ent, edict_t *killer)
|
|||
// allow new DM games to override the tag picture
|
||||
if (gamerules && gamerules->value)
|
||||
{
|
||||
if(DMGame.DogTag)
|
||||
if (DMGame.DogTag)
|
||||
DMGame.DogTag(cl_ent, killer, &tag);
|
||||
}
|
||||
//ROGUE
|
||||
|
@ -421,7 +421,7 @@ void WhatIsIt (edict_t *ent)
|
|||
tr = gi.trace(start, NULL, NULL, end, ent, MASK_SHOT|CONTENTS_SLIME|CONTENTS_LAVA);
|
||||
if (tr.ent > world)
|
||||
{
|
||||
if(tr.ent->common_name)
|
||||
if (tr.ent->common_name)
|
||||
ent->client->whatsit = tr.ent->common_name;
|
||||
// else
|
||||
// ent->client->whatsit = tr.ent->classname;
|
||||
|
@ -450,16 +450,16 @@ void WhatIsIt (edict_t *ent)
|
|||
VectorSubtract(who->s.origin,viewp,dir);
|
||||
range = VectorLength(dir);
|
||||
VectorMA(viewp, range, 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 (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;
|
||||
best = who;
|
||||
break;
|
||||
}
|
||||
if(best)
|
||||
if (best)
|
||||
{
|
||||
ent->client->whatsit = best->item->pickup_name;
|
||||
return;
|
||||
|
@ -622,15 +622,15 @@ void G_SetStats (edict_t *ent)
|
|||
else if (ent->client->owned_sphere)
|
||||
{
|
||||
int sphere_time;
|
||||
if(ent->client->owned_sphere->spawnflags == 1) { // defender
|
||||
if (ent->client->owned_sphere->spawnflags == 1) { // defender
|
||||
ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex ("p_defender");
|
||||
sphere_time = sk_defender_time->value;
|
||||
}
|
||||
else if(ent->client->owned_sphere->spawnflags == 2) { // hunter
|
||||
else if (ent->client->owned_sphere->spawnflags == 2) { // hunter
|
||||
ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex ("p_hunter");
|
||||
sphere_time = sk_hunter_time->value;
|
||||
}
|
||||
else if(ent->client->owned_sphere->spawnflags == 4) { // vengeance
|
||||
else if (ent->client->owned_sphere->spawnflags == 4) { // vengeance
|
||||
ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex ("p_vengeance");
|
||||
sphere_time = sk_vengeance_time->value;
|
||||
}
|
||||
|
@ -694,9 +694,9 @@ void G_SetStats (edict_t *ent)
|
|||
ent->client->ps.stats[STAT_SELECTED_ITEM] = ent->client->pers.selected_item;
|
||||
|
||||
// Lazarus vehicle/tracktrain
|
||||
if(ent->vehicle && !(ent->vehicle->spawnflags & 16))
|
||||
if (ent->vehicle && !(ent->vehicle->spawnflags & 16))
|
||||
{
|
||||
switch(ent->vehicle->moveinfo.state)
|
||||
switch (ent->vehicle->moveinfo.state)
|
||||
{
|
||||
case -3: ent->client->ps.stats[STAT_SPEED] = gi.imageindex("speedr3"); break;
|
||||
case -2: ent->client->ps.stats[STAT_SPEED] = gi.imageindex("speedr2"); break;
|
||||
|
@ -715,13 +715,13 @@ void G_SetStats (edict_t *ent)
|
|||
{
|
||||
if (ent->client->showscores || ent->client->showhelp || ent->client->showinventory)
|
||||
ent->client->whatsit = NULL;
|
||||
else if(!(level.framenum % 5)) // only update every 1/2 second
|
||||
else if (!(level.framenum % 5)) // only update every 1/2 second
|
||||
{
|
||||
char *temp = ent->client->whatsit;
|
||||
|
||||
ent->client->whatsit = NULL;
|
||||
WhatIsIt(ent);
|
||||
if(ent->client->whatsit && !temp)
|
||||
if (ent->client->whatsit && !temp)
|
||||
WhatsIt(ent);
|
||||
}
|
||||
}
|
||||
|
@ -778,7 +778,7 @@ void G_SetStats (edict_t *ent)
|
|||
|
||||
ent->client->ps.stats[STAT_SPECTATOR] = 0;
|
||||
|
||||
if(ent->client->zoomed)
|
||||
if (ent->client->zoomed)
|
||||
ent->client->ps.stats[STAT_ZOOM] = gi.imageindex("zoom");
|
||||
else
|
||||
ent->client->ps.stats[STAT_ZOOM] = 0;
|
||||
|
|
|
@ -862,7 +862,7 @@ void P_FallingDamage (edict_t *ent)
|
|||
}
|
||||
else // if delta > 7
|
||||
#ifndef FMOD_FOOTSTEPS
|
||||
ent->s.event = EV_LOUDSTEP; //Knightmare- loud footstep for softer landing
|
||||
ent->s.event = EV_LOUDSTEP; // Knightmare- loud footstep for softer landing
|
||||
#else
|
||||
FootStep(ent);
|
||||
#endif
|
||||
|
@ -1226,7 +1226,7 @@ void G_SetClientEvent (edict_t *ent)
|
|||
if ( (level.framenum % 10) == 0 )
|
||||
{
|
||||
#ifndef FMOD_FOOTSTEPS
|
||||
ent->s.event = EV_WADE_MUD; // Knightmare- move this client-side
|
||||
ent->s.event = EV_WADE_MUD; // Knightmare- move this client-side
|
||||
#else
|
||||
if ( rand() & 1 )
|
||||
// gi.sound(ent, CHAN_BODY, gi.soundindex("mud/wade_mud1.wav"), 1, ATTN_NORM, 0);
|
||||
|
@ -1263,16 +1263,16 @@ void G_SetClientEvent (edict_t *ent)
|
|||
#endif
|
||||
}
|
||||
// Ladder sounds
|
||||
else if( (level.framenum % 4) == 0)
|
||||
else if ( (level.framenum % 4) == 0)
|
||||
{
|
||||
if(!ent->waterlevel && (ent->movetype != MOVETYPE_NOCLIP) && (fabs(ent->velocity[2]) > 50))
|
||||
if (!ent->waterlevel && (ent->movetype != MOVETYPE_NOCLIP) && (fabs(ent->velocity[2]) > 50))
|
||||
{
|
||||
vec3_t end, forward;
|
||||
trace_t tr;
|
||||
AngleVectors(ent->s.angles,forward,NULL,NULL);
|
||||
VectorMA(ent->s.origin,2,forward,end);
|
||||
tr = gi.trace(ent->s.origin,ent->mins,ent->maxs,end,ent,CONTENTS_LADDER);
|
||||
if(tr.fraction < 1.0)
|
||||
if (tr.fraction < 1.0)
|
||||
#ifndef FMOD_FOOTSTEPS
|
||||
ent->s.event = EV_CLIMB_LADDER; // Knightmare- move Lazarus footsteps client-side
|
||||
#else
|
||||
|
@ -1378,7 +1378,7 @@ void G_SetClientFrame (edict_t *ent)
|
|||
qboolean duck, run;
|
||||
qboolean floor;
|
||||
|
||||
if (ent->s.modelindex != (MAX_MODELS-1)) //was 255
|
||||
if (ent->s.modelindex != (MAX_MODELS-1)) // was 255
|
||||
return; // not in the player model
|
||||
|
||||
client = ent->client;
|
||||
|
@ -1444,7 +1444,7 @@ newanim:
|
|||
client->anim_run = run;
|
||||
|
||||
// Knightmare- added swimming check
|
||||
if (!ent->groundentity && (!floor || ent->waterlevel > 2)) //CDawg modify this
|
||||
if (!ent->groundentity && (!floor || ent->waterlevel > 2)) // CDawg modify this
|
||||
{
|
||||
client->anim_priority = ANIM_JUMP;
|
||||
if (ent->s.frame != FRAME_jump2)
|
||||
|
|
|
@ -1282,7 +1282,7 @@ ROGUE - VERSIONS
|
|||
#define CS_PAKFILE (CS_GENERAL+MAX_GENERAL)
|
||||
#define MAX_CONFIGSTRINGS (CS_PAKFILE+1)
|
||||
|
||||
//Knightmare- hacked configstring offsets for backward compatiblity
|
||||
// Knightmare- hacked configstring offsets for backward compatiblity
|
||||
#define OLD_CS_SOUNDS (CS_MODELS+OLD_MAX_MODELS)
|
||||
#define OLD_CS_IMAGES (OLD_CS_SOUNDS+OLD_MAX_SOUNDS)
|
||||
#define OLD_CS_LIGHTS (OLD_CS_IMAGES+OLD_MAX_IMAGES)
|
||||
|
@ -1290,7 +1290,7 @@ ROGUE - VERSIONS
|
|||
#define OLD_CS_PLAYERSKINS (OLD_CS_ITEMS+MAX_ITEMS)
|
||||
#define OLD_CS_GENERAL (OLD_CS_PLAYERSKINS+MAX_CLIENTS)
|
||||
#define OLD_MAX_CONFIGSTRINGS (OLD_CS_GENERAL+MAX_GENERAL)
|
||||
//end Knightmare
|
||||
// end Knightmare
|
||||
|
||||
|
||||
//==============================================
|
||||
|
|
Loading…
Reference in a new issue