Baut nun fehlerfrei

This commit is contained in:
Yamagi Burmeister 2009-03-31 15:11:03 +00:00
parent 4cd96d7fb4
commit 597a7ca7ec
5 changed files with 66 additions and 144 deletions

View file

@ -700,8 +700,6 @@ int flyer_blocked (edict_t *self, float dist)
!strcmp(self->monsterinfo.commander->classname, "monster_carrier")) !strcmp(self->monsterinfo.commander->classname, "monster_carrier"))
{ {
self->monsterinfo.commander->monsterinfo.monster_slots++; self->monsterinfo.commander->monsterinfo.monster_slots++;
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("suicide blocked, exploding. %d slots left\n", self->monsterinfo.commander->monsterinfo.monster_slots);
} }
VectorMA (self->s.origin, -0.02, self->velocity, origin); VectorMA (self->s.origin, -0.02, self->velocity, origin);
@ -770,7 +768,7 @@ void SP_monster_flyer (edict_t *self)
self->monsterinfo.melee = flyer_melee; self->monsterinfo.melee = flyer_melee;
self->monsterinfo.sight = flyer_sight; self->monsterinfo.sight = flyer_sight;
self->monsterinfo.idle = flyer_idle; self->monsterinfo.idle = flyer_idle;
self->monsterinfo.blocked = flyer_blocked; self->monsterinfo.blocked = (void *)flyer_blocked;
gi.linkentity (self); gi.linkentity (self);
@ -825,7 +823,7 @@ void SP_monster_kamikaze (edict_t *self)
self->monsterinfo.sight = flyer_sight; self->monsterinfo.sight = flyer_sight;
self->monsterinfo.idle = flyer_idle; self->monsterinfo.idle = flyer_idle;
self->monsterinfo.blocked = flyer_blocked; self->monsterinfo.blocked = (void *)flyer_blocked;
gi.linkentity (self); gi.linkentity (self);

View file

@ -584,7 +584,7 @@ void SP_monster_gunner (edict_t *self)
self->monsterinfo.stand = gunner_stand; self->monsterinfo.stand = gunner_stand;
self->monsterinfo.walk = gunner_walk; self->monsterinfo.walk = gunner_walk;
self->monsterinfo.run = gunner_run; self->monsterinfo.run = gunner_run;
self->monsterinfo.dodge = gunner_dodge; self->monsterinfo.dodge = (void *)gunner_dodge;
self->monsterinfo.attack = gunner_attack; self->monsterinfo.attack = gunner_attack;
self->monsterinfo.melee = NULL; self->monsterinfo.melee = NULL;
self->monsterinfo.sight = gunner_sight; self->monsterinfo.sight = gunner_sight;

View file

@ -733,7 +733,7 @@ void SP_monster_medic (edict_t *self)
self->monsterinfo.stand = medic_stand; self->monsterinfo.stand = medic_stand;
self->monsterinfo.walk = medic_walk; self->monsterinfo.walk = medic_walk;
self->monsterinfo.run = medic_run; self->monsterinfo.run = medic_run;
self->monsterinfo.dodge = medic_dodge; self->monsterinfo.dodge = (void *)medic_dodge;
self->monsterinfo.attack = medic_attack; self->monsterinfo.attack = medic_attack;
self->monsterinfo.melee = NULL; self->monsterinfo.melee = NULL;
self->monsterinfo.sight = medic_sight; self->monsterinfo.sight = medic_sight;

View file

@ -155,16 +155,6 @@ qboolean IsBadAhead (edict_t *self, edict_t *bad, vec3_t move)
return true; return true;
return false; return false;
/*
if(DotProduct(forward, dir) > 0)
{
// gi.dprintf ("bad ahead...\n");
return true;
}
// gi.dprintf ("bad behind...\n");
return false;
*/
} }
// ROGUE // ROGUE
//============ //============
@ -190,7 +180,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
float stepsize; float stepsize;
vec3_t test; vec3_t test;
int contents; int contents;
edict_t *current_bad; // PGM edict_t *current_bad = NULL; // PGM
float minheight; // pmm float minheight; // pmm
//====== //======
@ -217,17 +207,9 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
ent->bad_area = NULL; 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->enemy = ent->oldenemy;
ent->goalentity = ent->oldenemy; ent->goalentity = ent->oldenemy;
FoundTarget(ent); 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
return true; return true;
} }
} }
@ -260,7 +242,6 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
minheight = 104; minheight = 104;
else else
minheight = 40; minheight = 40;
// if (dz > 40)
if (dz > minheight) if (dz > minheight)
// pmm // pmm
neworg[2] -= 8; neworg[2] -= 8;
@ -311,8 +292,6 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
} }
} }
// if (trace.fraction == 1)
// PMM - changed above to this // PMM - changed above to this
if ((trace.fraction == 1) && (!trace.allsolid) && (!trace.startsolid)) if ((trace.fraction == 1) && (!trace.allsolid) && (!trace.startsolid))
{ {
@ -321,7 +300,6 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
//PGM //PGM
if(!current_bad && CheckForBadArea(ent)) if(!current_bad && CheckForBadArea(ent))
{ {
// gi.dprintf("Oooh! Bad Area!\n");
VectorCopy (oldorg, ent->s.origin); VectorCopy (oldorg, ent->s.origin);
} }
else else
@ -331,13 +309,6 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
gi.linkentity (ent); gi.linkentity (ent);
G_TouchTriggers (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
return true; return true;
} }
//PGM //PGM
@ -419,12 +390,6 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
G_TouchTriggers (ent); G_TouchTriggers (ent);
} }
ent->groundentity = NULL; 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
return true; return true;
} }
@ -445,55 +410,34 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
{ {
if (new_bad->owner) if (new_bad->owner)
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf("Blocked -");
if (!strcmp(new_bad->owner->classname, "tesla")) if (!strcmp(new_bad->owner->classname, "tesla"))
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("it's a tesla -");
if ((!(ent->enemy)) || (!(ent->enemy->inuse))) if ((!(ent->enemy)) || (!(ent->enemy->inuse)))
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("I don't have a valid enemy, attacking tesla!\n");
TargetTesla (ent, new_bad->owner); TargetTesla (ent, new_bad->owner);
ent->monsterinfo.aiflags |= AI_BLOCKED; ent->monsterinfo.aiflags |= AI_BLOCKED;
} }
else if (!strcmp(ent->enemy->classname, "telsa")) else if (!strcmp(ent->enemy->classname, "telsa"))
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("but we're already mad at a tesla\n");
} }
else if ((ent->enemy) && (ent->enemy->client)) else if ((ent->enemy) && (ent->enemy->client))
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("we have a player enemy -");
if (visible(ent, ent->enemy)) if (visible(ent, ent->enemy))
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("we can see him -");
} }
else else
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("can't see him, kill the tesla! -");
TargetTesla (ent, new_bad->owner); TargetTesla (ent, new_bad->owner);
ent->monsterinfo.aiflags |= AI_BLOCKED; ent->monsterinfo.aiflags |= AI_BLOCKED;
} }
} }
else else
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("the enemy isn't a player, killing tesla -");
TargetTesla (ent, new_bad->owner); TargetTesla (ent, new_bad->owner);
ent->monsterinfo.aiflags |= AI_BLOCKED; ent->monsterinfo.aiflags |= AI_BLOCKED;
} }
} }
// else if ((g_showlogic) && (g_showlogic->value))
// {
// gi.dprintf(" by non-tesla bad area!");
// }
} }
// gi.dprintf ("\n");
VectorCopy (oldorg, ent->s.origin); VectorCopy (oldorg, ent->s.origin);
return false; return false;
@ -511,13 +455,6 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
gi.linkentity (ent); gi.linkentity (ent);
G_TouchTriggers (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
return true; return true;
} }
VectorCopy (oldorg, ent->s.origin); VectorCopy (oldorg, ent->s.origin);
@ -531,19 +468,11 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
ent->groundentity = trace.ent; ent->groundentity = trace.ent;
ent->groundentity_linkcount = trace.ent->linkcount; ent->groundentity_linkcount = trace.ent->linkcount;
// the move is ok
if (relink) if (relink)
{ {
gi.linkentity (ent); gi.linkentity (ent);
G_TouchTriggers (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
return true; return true;
} }
@ -730,8 +659,6 @@ void SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist)
} }
//ROGUE //ROGUE
/* 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; return;
@ -798,15 +725,10 @@ void M_MoveToGoal (edict_t *ent, float dist)
if (ent->enemy && SV_CloseEnough (ent, ent->enemy, dist) ) if (ent->enemy && SV_CloseEnough (ent, ent->enemy, dist) )
return; return;
// bump around...
// if ( (rand()&3)==1 || !SV_StepDirection (ent, ent->ideal_yaw, dist))
// PMM - charging monsters (AI_CHARGING) don't deflect unless they have to
if ( (((rand()&3)==1) && !(ent->monsterinfo.aiflags & AI_CHARGING)) || !SV_StepDirection (ent, ent->ideal_yaw, dist)) if ( (((rand()&3)==1) && !(ent->monsterinfo.aiflags & AI_CHARGING)) || !SV_StepDirection (ent, ent->ideal_yaw, dist))
{ {
if (ent->monsterinfo.aiflags & AI_BLOCKED) if (ent->monsterinfo.aiflags & AI_BLOCKED)
{ {
// if ((g_showlogic) && (g_showlogic->value))
// gi.dprintf ("tesla attack detected, not changing direction!\n");
ent->monsterinfo.aiflags &= ~AI_BLOCKED; ent->monsterinfo.aiflags &= ~AI_BLOCKED;
return; return;
} }
@ -841,5 +763,5 @@ qboolean M_walkmove (edict_t *ent, float yaw, float dist)
ent->monsterinfo.aiflags &= ~AI_BLOCKED; ent->monsterinfo.aiflags &= ~AI_BLOCKED;
return retval; return retval;
// pmm // pmm
//return SV_movestep(ent, move, true);
} }

View file

@ -457,27 +457,27 @@ void parasite_jump_wait_land (edict_t *self)
mframe_t parasite_frames_jump_up [] = mframe_t parasite_frames_jump_up [] =
{ {
ai_move, -8, NULL, {ai_move, -8, NULL},
ai_move, -8, NULL, {ai_move, -8, NULL},
ai_move, -8, NULL, {ai_move, -8, NULL},
ai_move, -8, parasite_jump_up, {ai_move, -8, parasite_jump_up},
ai_move, 0, NULL, {ai_move, 0, NULL},
ai_move, 0, NULL, {ai_move, 0, NULL},
ai_move, 0, parasite_jump_wait_land, {ai_move, 0, parasite_jump_wait_land},
ai_move, 0, NULL {ai_move, 0, NULL}
}; };
mmove_t parasite_move_jump_up = { FRAME_jump01, FRAME_jump08, parasite_frames_jump_up, parasite_run }; mmove_t parasite_move_jump_up = { FRAME_jump01, FRAME_jump08, parasite_frames_jump_up, parasite_run };
mframe_t parasite_frames_jump_down [] = mframe_t parasite_frames_jump_down [] =
{ {
ai_move, 0, NULL, {ai_move, 0, NULL},
ai_move, 0, NULL, {ai_move, 0, NULL},
ai_move, 0, NULL, {ai_move, 0, NULL},
ai_move, 0, parasite_jump_down, {ai_move, 0, parasite_jump_down},
ai_move, 0, NULL, {ai_move, 0, NULL},
ai_move, 0, NULL, {ai_move, 0, NULL},
ai_move, 0, parasite_jump_wait_land, {ai_move, 0, parasite_jump_wait_land},
ai_move, 0, NULL {ai_move, 0, NULL}
}; };
mmove_t parasite_move_jump_down = { FRAME_jump01, FRAME_jump08, parasite_frames_jump_down, parasite_run }; mmove_t parasite_move_jump_down = { FRAME_jump01, FRAME_jump08, parasite_frames_jump_down, parasite_run };
@ -510,6 +510,7 @@ qboolean parasite_blocked (edict_t *self, float dist)
if(blocked_checkplat (self, dist)) if(blocked_checkplat (self, dist))
return true; return true;
return false;
} }
//ROGUE //ROGUE
//================ //================
@ -554,6 +555,7 @@ qboolean parasite_checkattack (edict_t *self)
self->monsterinfo.aiflags &= ~AI_BLOCKED; self->monsterinfo.aiflags &= ~AI_BLOCKED;
return true; return true;
} }
return false;
} }