mirror of
https://github.com/yquake2/zaero.git
synced 2024-11-10 06:32:04 +00:00
Animationscode, die Autocannon, die KI und die Handler
This commit is contained in:
parent
a68d4e906f
commit
db9643d393
4 changed files with 17 additions and 60 deletions
|
@ -62,7 +62,7 @@ ac_anim_t acFiringFrames[5] =
|
|||
// dummy
|
||||
{
|
||||
0,
|
||||
{ true, false, -1 }
|
||||
{ { true, false, -1 } }
|
||||
},
|
||||
|
||||
// chaingun
|
||||
|
@ -700,10 +700,7 @@ void monster_autocannon_deactivate(edict_t *self)
|
|||
self->s.frame < acDeactEnd[self->style])
|
||||
{
|
||||
self->chain->s.sound = 0;
|
||||
if (self->s.frame == acDeactStart[self->style])
|
||||
{
|
||||
//gi.sound(self, CHAN_VOICE, gi.soundindex("objects/acannon/ac_away.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
// continue
|
||||
self->s.frame++;
|
||||
self->chain->s.frame++;
|
||||
|
@ -801,8 +798,6 @@ void SP_monster_autocannon(edict_t *self)
|
|||
// precache some sounds and models
|
||||
gi.soundindex("objects/acannon/ac_idle.wav");
|
||||
gi.soundindex("objects/acannon/ac_act.wav");
|
||||
//gi.soundindex("objects/acannon/ac_out.wav");
|
||||
//gi.soundindex("objects/acannon/ac_away.wav");
|
||||
gi.modelindex("models/objects/rocket/tris.md2");
|
||||
gi.modelindex("models/objects/laser/tris.md2");
|
||||
|
||||
|
@ -873,7 +868,6 @@ void SP_monster_autocannon(edict_t *self)
|
|||
self->seq = 0;
|
||||
if (st.lip)
|
||||
self->monsterinfo.linkcount = (st.lip > 0 ? st.lip : 0);
|
||||
//self->svflags = SVF_MONSTER;
|
||||
|
||||
// default health
|
||||
if (!self->health)
|
||||
|
@ -917,3 +911,4 @@ void SP_monster_autocannon_floor(edict_t *self)
|
|||
// call the other one
|
||||
SP_monster_autocannon(self);
|
||||
}
|
||||
|
||||
|
|
60
src/z_ai.c
60
src/z_ai.c
|
@ -4,25 +4,10 @@
|
|||
#define Z_RADUISLISTSIZE 2000
|
||||
|
||||
|
||||
|
||||
void ai_run_melee(edict_t *self);
|
||||
qboolean FindTarget (edict_t *self);
|
||||
qboolean SV_StepDirection (edict_t *ent, float yaw, float dist);
|
||||
void SV_NewChaseDir (edict_t *actor, vec3_t eOrigin, float dist);
|
||||
#if 0
|
||||
void z_aiMoveTo(edict_t *self, float dist)
|
||||
{
|
||||
// sanity check
|
||||
if (!(self->monsterinfo.scriptState & MSS_AIMOVETO))
|
||||
return;
|
||||
#if 0
|
||||
if (!SV_StepDirection (self, self->ideal_yaw, dist))
|
||||
{
|
||||
SV_NewChaseDir (self, self->monsterinfo.aiMoveTo, dist);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -38,7 +23,8 @@ void zCreateRaduisList(edict_t *self)
|
|||
vec3_t vec;
|
||||
|
||||
if(self->zRaduisList)
|
||||
{ // already created for this think, don't bother doing it again...
|
||||
{
|
||||
// already created for this think, don't bother doing it again...
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -146,9 +132,8 @@ int zFindRoamYaw(edict_t *self, float distcheck)
|
|||
while(tr.fraction < 1.0 && maxtrys)
|
||||
{
|
||||
// blocked, change ideal yaw...
|
||||
self->ideal_yaw = vectoyaw(forward);
|
||||
self->ideal_yaw = vectoyaw(forward);
|
||||
self->ideal_yaw = self->ideal_yaw + (random() * dir);
|
||||
// self->ideal_yaw = self->ideal_yaw + (-45 + (random() * 90));
|
||||
|
||||
angles[YAW] = anglemod (self->ideal_yaw);
|
||||
AngleVectors (angles, forward, NULL, NULL);
|
||||
|
@ -181,13 +166,13 @@ int zSchoolMonsters(edict_t *self, float dist, int runStyle, float *currentSpeed
|
|||
|
||||
maxInsight = zSchoolAllVisiable(self);
|
||||
|
||||
// If you're not out in front
|
||||
// If you're not out in front
|
||||
if(maxInsight > 0)
|
||||
{
|
||||
float totalSpeed;
|
||||
float totalBearing;
|
||||
float distanceToNearest, distanceToLeader, dist;
|
||||
edict_t *nearestEntity, *list;
|
||||
edict_t *nearestEntity = 0, *list;
|
||||
vec3_t vec;
|
||||
|
||||
totalSpeed = 0;
|
||||
|
@ -198,12 +183,12 @@ int zSchoolMonsters(edict_t *self, float dist, int runStyle, float *currentSpeed
|
|||
|
||||
while(list)
|
||||
{
|
||||
// Gather data on those you see
|
||||
totalSpeed += list->speed;
|
||||
totalBearing += anglemod(list->s.angles[YAW]);
|
||||
// Gather data on those you see
|
||||
totalSpeed += list->speed;
|
||||
totalBearing += anglemod(list->s.angles[YAW]);
|
||||
|
||||
VectorSubtract(self->s.origin, list->s.origin, vec);
|
||||
dist = VectorLength(vec);
|
||||
VectorSubtract(self->s.origin, list->s.origin, vec);
|
||||
dist = VectorLength(vec);
|
||||
|
||||
if(dist < distanceToNearest)
|
||||
{
|
||||
|
@ -238,7 +223,8 @@ int zSchoolMonsters(edict_t *self, float dist, int runStyle, float *currentSpeed
|
|||
|
||||
}
|
||||
else
|
||||
{ //You are in front, so slow down a bit
|
||||
{
|
||||
//You are in front, so slow down a bit
|
||||
edict_t *head;
|
||||
|
||||
self->speed = (self->speed * self->monsterinfo.zSchoolDecayRate);
|
||||
|
@ -262,11 +248,6 @@ int zSchoolMonsters(edict_t *self, float dist, int runStyle, float *currentSpeed
|
|||
}
|
||||
}
|
||||
|
||||
// if(self.rm_schoolFlags & 1)
|
||||
// { // check to see is I keep away from "other" entities...
|
||||
// zSchoolCheckForOtherEntities(checkOtherRaduis);
|
||||
// }
|
||||
|
||||
if(self->speed > self->monsterinfo.zSchoolMaxSpeed)
|
||||
{
|
||||
self->speed = self->monsterinfo.zSchoolMaxSpeed;
|
||||
|
@ -366,13 +347,9 @@ void ai_schoolStand (edict_t *self, float dist)
|
|||
// do the normal stand stuff
|
||||
if (dist)
|
||||
M_walkmove (self, self->ideal_yaw, dist);
|
||||
// M_walkmove (self, self->ideal_yaw, dist * speed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
ai_schoolRun
|
||||
|
@ -415,11 +392,9 @@ void ai_schoolRun (edict_t *self, float dist)
|
|||
|
||||
// do the normal run stuff
|
||||
SV_StepDirection (self, self->ideal_yaw, dist);
|
||||
// SV_StepDirection (self, self->ideal_yaw, dist * speed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
ai_schoolWalk
|
||||
|
@ -462,11 +437,9 @@ void ai_schoolWalk (edict_t *self, float dist)
|
|||
|
||||
// do the normal walk stuff
|
||||
SV_StepDirection (self, self->ideal_yaw, dist);
|
||||
// SV_StepDirection (self, self->ideal_yaw, dist * speed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
ai_schoolCharge
|
||||
|
@ -477,15 +450,6 @@ Use this call with a distnace of 0 to replace ai_face
|
|||
*/
|
||||
void ai_schoolCharge (edict_t *self, float dist)
|
||||
{
|
||||
/*
|
||||
if(!(self->monsterinfo.aiflags & AI_SCHOOLING))
|
||||
{
|
||||
ai_charge(self, dist);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
ai_charge(self, dist);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -386,8 +386,6 @@ void calculate_buffer_actuals(anim_data_t *data)
|
|||
{
|
||||
data->actual_sequence = data->monster_sequences[data->current_sequence - 1];
|
||||
data->actual_sequence_idx = data->current_frame;
|
||||
/*data->actual_frame %= actual_sequence->lastframe -
|
||||
actual_sequence->firstframe + 1;*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -396,12 +396,12 @@ End Death Stuff
|
|||
===
|
||||
*/
|
||||
|
||||
void SP_monster_infantry_precache(void);
|
||||
//void SP_monster_infantry_precache(void);
|
||||
void SP_monster_hound_precache();
|
||||
|
||||
void SP_monster_handler_precache(void)
|
||||
{
|
||||
SP_monster_infantry_precache();
|
||||
//SP_monster_infantry_precache();
|
||||
SP_monster_hound_precache();
|
||||
|
||||
sound_attack = gi.soundindex("monsters/guard/hhattack.wav");
|
||||
|
|
Loading…
Reference in a new issue